Commit 7152a10d by ym

tab

1 parent b50b74a6
...@@ -57,6 +57,18 @@ const staticRoutes = Object.freeze([{ ...@@ -57,6 +57,18 @@ const staticRoutes = Object.freeze([{
path: '/employee/detailEmployee/:id', path: '/employee/detailEmployee/:id',
meta: {}, meta: {},
component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve) 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 export default staticRoutes
\ No newline at end of file \ No newline at end of file
...@@ -29,4 +29,25 @@ util.checkisCard = function(card) { ...@@ -29,4 +29,25 @@ util.checkisCard = function(card) {
let myreg = /^(^\d{15}$)|(^\d{17}([0-9]|X)$)/; let myreg = /^(^\d{15}$)|(^\d{17}([0-9]|X)$)/;
return myreg.test(card); 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 export default util
\ No newline at end of file \ No newline at end of file
...@@ -184,6 +184,7 @@ ...@@ -184,6 +184,7 @@
highlight-current highlight-current
:props="defaultProps" :props="defaultProps"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@check="clickDeal"
> >
</el-tree> </el-tree>
</div> </div>
...@@ -288,6 +289,9 @@ export default { ...@@ -288,6 +289,9 @@ export default {
}, },
}, },
methods: { methods: {
clickDeal() {
this.$parent.editStatus = true;
},
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
......
...@@ -35,11 +35,10 @@ ...@@ -35,11 +35,10 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import util from "@/utils/util";
export default { export default {
name: 'product', name: 'product',
props: { props: {
title: { title: {
type: String type: String
...@@ -48,12 +47,13 @@ export default { ...@@ -48,12 +47,13 @@ export default {
type: Boolean type: Boolean
} }
}, },
data() { data() {
return { return {
loading: false, loading: false,
treeHeight: 450, treeHeight: 450,
tabMenu: [], tabMenu: [],
tabMenu_x: [],
tabMenu_s: [],
accountList: [], accountList: [],
selectIndex: 0, selectIndex: 0,
productId: 0, productId: 0,
...@@ -68,7 +68,6 @@ export default { ...@@ -68,7 +68,6 @@ export default {
accountTypes: [] accountTypes: []
} }
}, },
methods: { methods: {
handleClik(tab, event) { handleClik(tab, event) {
console.log(tab, event) console.log(tab, event)
...@@ -101,7 +100,6 @@ export default { ...@@ -101,7 +100,6 @@ export default {
} }
}) })
.filter(i => arr.includes(i.accounttypeId)) .filter(i => arr.includes(i.accounttypeId))
this.$nextTick(() => { this.$nextTick(() => {
this.addStyle() this.addStyle()
}) })
...@@ -145,6 +143,7 @@ export default { ...@@ -145,6 +143,7 @@ export default {
accounttypeId: item.accounttypeId accounttypeId: item.accounttypeId
} }
}) })
this.tabMenu_s = util.deepClone(this.accountList);
// this.tabName = this.tabMenu[0].accounttypeId // this.tabName = this.tabMenu[0].accounttypeId
this.findPermissionsByMerId(params.merchantId ? params.merchantId : params.id) this.findPermissionsByMerId(params.merchantId ? params.merchantId : params.id)
return this.accountList return this.accountList
...@@ -156,6 +155,7 @@ export default { ...@@ -156,6 +155,7 @@ export default {
} }
this.$apis.store.findPermissionsByMerId(params).then(res => { this.$apis.store.findPermissionsByMerId(params).then(res => {
this.loading = false this.loading = false
this.tabMenu_x = util.deepClone(res);
res.forEach(item => { res.forEach(item => {
console.log(item) console.log(item)
this.accountList.forEach(itm => { this.accountList.forEach(itm => {
...@@ -182,6 +182,28 @@ export default { ...@@ -182,6 +182,28 @@ export default {
// console.log(this.tabMenu, arr) // 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) { renderContent(h, v) {
if (v.data.logo == 'functionValue') { if (v.data.logo == 'functionValue') {
...@@ -356,7 +378,6 @@ export default { ...@@ -356,7 +378,6 @@ export default {
return this.accountTypes return this.accountTypes
} }
}, },
mounted() { mounted() {
// this.accountTypeSearchRequest(); // this.accountTypeSearchRequest();
// this.findPermissionsByMerId() // this.findPermissionsByMerId()
......
...@@ -13,29 +13,29 @@ ...@@ -13,29 +13,29 @@
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">登录账户名:</span> <span class="itemName">登录账户名:</span>
<span class="itemValue">{{ firstPageObj.merchantLoginAccount }}</span> <span class="itemValue">{{ firstPageObj.merchantLoginAccount || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">账户等级:</span> <span class="itemName itemNameCol2">账户等级:</span>
<span class="itemValue">{{ firstPageObj.accountLevelName }}</span> <span class="itemValue">{{ firstPageObj.accountLevelName || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">开通模式:</span> <span class="itemName">开通模式:</span>
<span class="itemValue">{{ firstPageObj.merchantModelName }}</span> <span class="itemValue">{{ firstPageObj.merchantModelName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">账户状态:</span> <span class="itemName itemNameCol2">账户状态:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.statusName }} {{ firstPageObj.statusName || '-' }}
</span> </span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">关联企业微信名:</span> <span class="itemName">关联企业微信名:</span>
<span class="itemValue">{{ firstPageObj.entmicroName }}</span> <span class="itemValue">{{ firstPageObj.entmicroName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">账户有效期:</span> <span class="itemName itemNameCol2">账户有效期:</span>
...@@ -86,23 +86,23 @@ ...@@ -86,23 +86,23 @@
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">商户名称:</span> <span class="itemName">商户名称:</span>
<span class="itemValue">{{ firstPageObj.merchantName }}</span> <span class="itemValue">{{ firstPageObj.merchantName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">简称:</span> <span class="itemName itemNameCol2">简称:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.merchantAbbreviation }} {{ firstPageObj.merchantAbbreviation || '-' }}
</span> </span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">商户类型:</span> <span class="itemName">商户类型:</span>
<span class="itemValue">{{ firstPageObj.merchantTypeName }}</span> <span class="itemValue">{{ firstPageObj.merchantTypeName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">身份证:</span> <span class="itemName itemNameCol2">身份证:</span>
<span class="itemValue">{{ firstPageObj.merchantOrgcode }}</span> <span class="itemValue">{{ firstPageObj.merchantOrgcode || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -110,28 +110,28 @@ ...@@ -110,28 +110,28 @@
<span class="itemName">地址:</span> <span class="itemName">地址:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.merchantAddress }} {{ firstPageObj.merchantAddress || '-' }}
</span> </span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">联系人:</span> <span class="itemName itemNameCol2">联系人:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPerson }}</span> <span class="itemValue">{{ firstPageObj.merchantLegalPerson || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">联系电话:</span> <span class="itemName">联系电话:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone }}</span> <span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">营业范围:</span> <span class="itemName itemNameCol2">营业范围:</span>
<span class="itemValue">{{ firstPageObj.businessScopName }}</span> <span class="itemValue">{{ firstPageObj.businessScopName || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<span class="itemName">主营品牌:</span> <span class="itemName">主营品牌:</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName }}</span> <span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
......
...@@ -166,6 +166,7 @@ ...@@ -166,6 +166,7 @@
</template> </template>
<script> <script>
import util from "@/utils/util";
import mapView from "@/components/mapView/index"; import mapView from "@/components/mapView/index";
import autoButton from "@/components/auto-button/index"; import autoButton from "@/components/auto-button/index";
import selectProduct from "./components/selectProduct"; import selectProduct from "./components/selectProduct";
...@@ -181,6 +182,7 @@ export default { ...@@ -181,6 +182,7 @@ export default {
data() { data() {
return { return {
editStatus: false, editStatus: false,
detailFirst: {},
tabWidth: 0, tabWidth: 0,
editInfo: {}, editInfo: {},
pwdStatus: true, pwdStatus: true,
...@@ -254,6 +256,12 @@ export default { ...@@ -254,6 +256,12 @@ export default {
}, },
deep: true, deep: true,
}, },
accountInfoForm: {
handler() {
this.editStatus = true;
},
deep: true,
},
}, },
methods: { methods: {
hanleTab(status) { hanleTab(status) {
...@@ -267,12 +275,21 @@ export default { ...@@ -267,12 +275,21 @@ export default {
this.handleNext(status); this.handleNext(status);
}) })
.catch(() => { .catch(() => {
this.handleTabs(status); this.tabCancel(status);
}); });
} else { } else {
this.handleTabs(status); 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) { handleTabs(status) {
this.editStatus = false; this.editStatus = false;
if (status == 1 && this.step == "second") { if (status == 1 && this.step == "second") {
...@@ -284,18 +301,10 @@ export default { ...@@ -284,18 +301,10 @@ export default {
this.tabWidth = 124; 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() { handleCancel() {
this.$router.push("/account/index"); this.$router.push("/account/index");
}, },
//保存
handleSave(status) { handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) { if (this.$refs.productForm.getSelectInfo().length == 0) {
this.$message.error("请选择产品"); this.$message.error("请选择产品");
...@@ -359,12 +368,6 @@ export default { ...@@ -359,12 +368,6 @@ export default {
}); });
this.findMerchantDetail(); this.findMerchantDetail();
}, },
addBusinessScope() {
this.businessScopeCustomize.push({ name: "" });
},
removeBusinessScope(index) {
this.businessScopeCustomize.splice(index, 1);
},
async findMerchantDetail() { async findMerchantDetail() {
this.$apis.store this.$apis.store
.findMerchantDetail({ .findMerchantDetail({
...@@ -386,6 +389,11 @@ export default { ...@@ -386,6 +389,11 @@ export default {
}; };
} }
this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant); this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant);
this.detailFirst = util.deepClone(res);
this.renderView(res);
});
},
renderView(res) {
let { let {
isloginName, isloginName,
bussinessBegintime, bussinessBegintime,
...@@ -415,9 +423,7 @@ export default { ...@@ -415,9 +423,7 @@ export default {
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount; this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword; this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
this.accountTypes = accountTypes; this.accountTypes = accountTypes;
this.accountAddForm.businessScope = businessScope this.accountAddForm.businessScope = businessScope ? businessScope.split(",") : [];
? businessScope.split(",")
: [];
if (this.accountAddForm.businessScope.length > 0) { if (this.accountAddForm.businessScope.length > 0) {
for (let i in this.accountAddForm.businessScope) { for (let i in this.accountAddForm.businessScope) {
this.accountAddForm.businessScope[i] = parseInt( this.accountAddForm.businessScope[i] = parseInt(
...@@ -452,12 +458,10 @@ export default { ...@@ -452,12 +458,10 @@ export default {
}); });
} }
merchantBrand = merchantBrand ? merchantBrand.split(",") : []; merchantBrand = merchantBrand ? merchantBrand.split(",") : [];
if (merchantBrand && merchantBrand.length > 0) {
for (let i in merchantBrand) { for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]); merchantBrand[i] = parseInt(merchantBrand[i]);
} }
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand); this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand);
}
this.accountAddForm = Object.assign(this.accountAddForm, { this.accountAddForm = Object.assign(this.accountAddForm, {
isloginName: isloginName ? true : false, isloginName: isloginName ? true : false,
lat, lat,
...@@ -477,7 +481,6 @@ export default { ...@@ -477,7 +481,6 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false; this.editStatus = false;
}); });
});
}, },
getCarbrandTree() { getCarbrandTree() {
this.$apis.store.getCarbrandTree({}).then((res) => { this.$apis.store.getCarbrandTree({}).then((res) => {
...@@ -485,7 +488,6 @@ export default { ...@@ -485,7 +488,6 @@ export default {
}); });
}, },
}, },
mounted() { mounted() {
this.footerLeft = document.querySelector(".base-container-right").offsetLeft; this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft; 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!