Commit 7152a10d by ym

tab

1 parent b50b74a6
......@@ -57,6 +57,18 @@ const staticRoutes = Object.freeze([{
path: '/employee/detailEmployee/:id',
meta: {},
component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve)
},
{
name: 'baseInfo',
path: '/baseInfo/index',
meta: {},
component: resolve => require([`@/views/baseInfo/index.vue`], resolve)
},
{
name: 'relevance',
path: '/baseInfo/relevance',
meta: {},
component: resolve => require([`@/views/baseInfo/relevance.vue`], resolve)
}
])
export default staticRoutes
\ No newline at end of file
......@@ -29,4 +29,25 @@ util.checkisCard = function(card) {
let myreg = /^(^\d{15}$)|(^\d{17}([0-9]|X)$)/;
return myreg.test(card);
}
util.deepClone = function(obj) {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = util.deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
}
export default util
\ No newline at end of file
......@@ -184,6 +184,7 @@
highlight-current
:props="defaultProps"
:filter-node-method="filterNode"
@check="clickDeal"
>
</el-tree>
</div>
......@@ -288,6 +289,9 @@ export default {
},
},
methods: {
clickDeal() {
this.$parent.editStatus = true;
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
......
......@@ -35,11 +35,10 @@
</div>
</div>
</template>
<script>
import util from "@/utils/util";
export default {
name: 'product',
props: {
title: {
type: String
......@@ -48,12 +47,13 @@ export default {
type: Boolean
}
},
data() {
return {
loading: false,
treeHeight: 450,
tabMenu: [],
tabMenu_x: [],
tabMenu_s: [],
accountList: [],
selectIndex: 0,
productId: 0,
......@@ -68,7 +68,6 @@ export default {
accountTypes: []
}
},
methods: {
handleClik(tab, event) {
console.log(tab, event)
......@@ -101,7 +100,6 @@ export default {
}
})
.filter(i => arr.includes(i.accounttypeId))
this.$nextTick(() => {
this.addStyle()
})
......@@ -145,6 +143,7 @@ export default {
accounttypeId: item.accounttypeId
}
})
this.tabMenu_s = util.deepClone(this.accountList);
// this.tabName = this.tabMenu[0].accounttypeId
this.findPermissionsByMerId(params.merchantId ? params.merchantId : params.id)
return this.accountList
......@@ -156,6 +155,7 @@ export default {
}
this.$apis.store.findPermissionsByMerId(params).then(res => {
this.loading = false
this.tabMenu_x = util.deepClone(res);
res.forEach(item => {
console.log(item)
this.accountList.forEach(itm => {
......@@ -182,6 +182,28 @@ export default {
// console.log(this.tabMenu, arr)
})
},
resetView() {
this.tabMenu = [];
this.accountList = util.deepClone(this.tabMenu_s);
this.tabMenu_x.forEach(item => {
this.accountList.forEach(itm => {
console.log(itm)
if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm)
item.products.forEach(i => {
itm.products.forEach(j => {
if (i.productId == j.productId) {
itm.productsArr.push(j)
this.$nextTick(() => {
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.menuIds)
})
}
})
})
}
})
})
},
// 渲染树结构
renderContent(h, v) {
if (v.data.logo == 'functionValue') {
......@@ -356,7 +378,6 @@ export default {
return this.accountTypes
}
},
mounted() {
// this.accountTypeSearchRequest();
// this.findPermissionsByMerId()
......
......@@ -13,29 +13,29 @@
<el-row>
<el-col :span="14">
<span class="itemName">登录账户名:</span>
<span class="itemValue">{{ firstPageObj.merchantLoginAccount }}</span>
<span class="itemValue">{{ firstPageObj.merchantLoginAccount || '-' }}</span>
</el-col>
<el-col :span="10">
<span class="itemName itemNameCol2">账户等级:</span>
<span class="itemValue">{{ firstPageObj.accountLevelName }}</span>
<span class="itemValue">{{ firstPageObj.accountLevelName || '-' }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<span class="itemName">开通模式:</span>
<span class="itemValue">{{ firstPageObj.merchantModelName }}</span>
<span class="itemValue">{{ firstPageObj.merchantModelName || '-' }}</span>
</el-col>
<el-col :span="10">
<span class="itemName itemNameCol2">账户状态:</span>
<span class="itemValue">
{{ firstPageObj.statusName }}
{{ firstPageObj.statusName || '-' }}
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<span class="itemName">关联企业微信名:</span>
<span class="itemValue">{{ firstPageObj.entmicroName }}</span>
<span class="itemValue">{{ firstPageObj.entmicroName || '-' }}</span>
</el-col>
<el-col :span="10">
<span class="itemName itemNameCol2">账户有效期:</span>
......@@ -86,23 +86,23 @@
<el-row>
<el-col :span="14">
<span class="itemName">商户名称:</span>
<span class="itemValue">{{ firstPageObj.merchantName }}</span>
<span class="itemValue">{{ firstPageObj.merchantName || '-' }}</span>
</el-col>
<el-col :span="10">
<span class="itemName itemNameCol2">简称:</span>
<span class="itemValue">
{{ firstPageObj.merchantAbbreviation }}
{{ firstPageObj.merchantAbbreviation || '-' }}
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<span class="itemName">商户类型:</span>
<span class="itemValue">{{ firstPageObj.merchantTypeName }}</span>
<span class="itemValue">{{ firstPageObj.merchantTypeName || '-' }}</span>
</el-col>
<el-col :span="10">
<span class="itemName itemNameCol2">身份证:</span>
<span class="itemValue">{{ firstPageObj.merchantOrgcode }}</span>
<span class="itemValue">{{ firstPageObj.merchantOrgcode || '-' }}</span>
</el-col>
</el-row>
<el-row>
......@@ -110,28 +110,28 @@
<span class="itemName">地址:</span>
<span class="itemValue">
{{ firstPageObj.merchantAddress }}
{{ firstPageObj.merchantAddress || '-' }}
</span>
</el-col>
<el-col :span="10">
<span class="itemName itemNameCol2">联系人:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPerson }}</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPerson || '-' }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<span class="itemName">联系电话:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone }}</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone || '-' }}</span>
</el-col>
<el-col :span="10">
<span class="itemName itemNameCol2">营业范围:</span>
<span class="itemValue">{{ firstPageObj.businessScopName }}</span>
<span class="itemValue">{{ firstPageObj.businessScopName || '-' }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<span class="itemName">主营品牌:</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName }}</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span>
</el-col>
</el-row>
</div>
......
......@@ -166,6 +166,7 @@
</template>
<script>
import util from "@/utils/util";
import mapView from "@/components/mapView/index";
import autoButton from "@/components/auto-button/index";
import selectProduct from "./components/selectProduct";
......@@ -181,6 +182,7 @@ export default {
data() {
return {
editStatus: false,
detailFirst: {},
tabWidth: 0,
editInfo: {},
pwdStatus: true,
......@@ -254,6 +256,12 @@ export default {
},
deep: true,
},
accountInfoForm: {
handler() {
this.editStatus = true;
},
deep: true,
},
},
methods: {
hanleTab(status) {
......@@ -267,12 +275,21 @@ export default {
this.handleNext(status);
})
.catch(() => {
this.handleTabs(status);
this.tabCancel(status);
});
} else {
this.handleTabs(status);
}
},
tabCancel(status) {
if (status == 2) {
this.$refs.productForm.resetView();
} else {
this.renderView(this.detailFirst);
this.pwdStatus = true;
}
this.handleTabs(status);
},
handleTabs(status) {
this.editStatus = false;
if (status == 1 && this.step == "second") {
......@@ -284,18 +301,10 @@ export default {
this.tabWidth = 124;
}
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
getAddress() {
this.dialogMapVisible = false;
this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
console.log(this.accountAddForm.merchantAddress);
},
handleCancel() {
this.$router.push("/account/index");
},
//保存
handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) {
this.$message.error("请选择产品");
......@@ -359,12 +368,6 @@ export default {
});
this.findMerchantDetail();
},
addBusinessScope() {
this.businessScopeCustomize.push({ name: "" });
},
removeBusinessScope(index) {
this.businessScopeCustomize.splice(index, 1);
},
async findMerchantDetail() {
this.$apis.store
.findMerchantDetail({
......@@ -386,98 +389,98 @@ export default {
};
}
this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant);
let {
isloginName,
bussinessBegintime,
bussinessEndtime,
lat,
lng,
merchantAddress,
merchantName,
merchantAbbreviation,
merchantType,
merchantOrgcode,
merchantLegalPerson,
merchantLegalPersonPhone,
residentContact,
residentPhone,
merchantLoginAccount,
merchantLoginPassword,
merchantAccountLevel,
businessScope,
businessScopeCustomize,
merchantBrand,
merchantFileResponses,
merchantModel,
accountTypes,
accounttypeId,
} = res;
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
this.accountTypes = accountTypes;
this.accountAddForm.businessScope = businessScope
? businessScope.split(",")
: [];
if (this.accountAddForm.businessScope.length > 0) {
for (let i in this.accountAddForm.businessScope) {
this.accountAddForm.businessScope[i] = parseInt(
this.accountAddForm.businessScope[i]
);
}
}
this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime];
businessScopeCustomize = businessScopeCustomize
? businessScopeCustomize.split(",")
: [];
if (businessScopeCustomize.length > 0) {
this.businessScopeCustomize = businessScopeCustomize.map((item) => {
return {
name: item,
};
});
}
accounttypeId = accounttypeId ? accounttypeId.split(",") : [];
if (accounttypeId.length > 0) {
this.accounttypeId = accounttypeId.map((item) => {
return {
name: item,
};
});
}
if (merchantFileResponses.length > 0) {
this.accountAddForm.merchantFiles = merchantFileResponses.map((item) => {
return {
fileUrl: item.fileUrl,
};
});
}
merchantBrand = merchantBrand ? merchantBrand.split(",") : [];
if (merchantBrand && merchantBrand.length > 0) {
for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]);
}
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand);
}
this.accountAddForm = Object.assign(this.accountAddForm, {
isloginName: isloginName ? true : false,
lat,
lng,
merchantAddress,
merchantName,
merchantAbbreviation,
merchantType,
merchantOrgcode,
merchantLegalPerson,
merchantLegalPersonPhone,
residentContact,
residentPhone,
merchantAccountLevel,
merchantModel,
});
this.$nextTick(() => {
this.editStatus = false;
});
this.detailFirst = util.deepClone(res);
this.renderView(res);
});
},
renderView(res) {
let {
isloginName,
bussinessBegintime,
bussinessEndtime,
lat,
lng,
merchantAddress,
merchantName,
merchantAbbreviation,
merchantType,
merchantOrgcode,
merchantLegalPerson,
merchantLegalPersonPhone,
residentContact,
residentPhone,
merchantLoginAccount,
merchantLoginPassword,
merchantAccountLevel,
businessScope,
businessScopeCustomize,
merchantBrand,
merchantFileResponses,
merchantModel,
accountTypes,
accounttypeId,
} = res;
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
this.accountTypes = accountTypes;
this.accountAddForm.businessScope = businessScope ? businessScope.split(",") : [];
if (this.accountAddForm.businessScope.length > 0) {
for (let i in this.accountAddForm.businessScope) {
this.accountAddForm.businessScope[i] = parseInt(
this.accountAddForm.businessScope[i]
);
}
}
this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime];
businessScopeCustomize = businessScopeCustomize
? businessScopeCustomize.split(",")
: [];
if (businessScopeCustomize.length > 0) {
this.businessScopeCustomize = businessScopeCustomize.map((item) => {
return {
name: item,
};
});
}
accounttypeId = accounttypeId ? accounttypeId.split(",") : [];
if (accounttypeId.length > 0) {
this.accounttypeId = accounttypeId.map((item) => {
return {
name: item,
};
});
}
if (merchantFileResponses.length > 0) {
this.accountAddForm.merchantFiles = merchantFileResponses.map((item) => {
return {
fileUrl: item.fileUrl,
};
});
}
merchantBrand = merchantBrand ? merchantBrand.split(",") : [];
for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]);
}
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand);
this.accountAddForm = Object.assign(this.accountAddForm, {
isloginName: isloginName ? true : false,
lat,
lng,
merchantAddress,
merchantName,
merchantAbbreviation,
merchantType,
merchantOrgcode,
merchantLegalPerson,
merchantLegalPersonPhone,
residentContact,
residentPhone,
merchantAccountLevel,
merchantModel,
});
this.$nextTick(() => {
this.editStatus = false;
});
},
getCarbrandTree() {
this.$apis.store.getCarbrandTree({}).then((res) => {
......@@ -485,7 +488,6 @@ export default {
});
},
},
mounted() {
this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!