From c1d7564b419907258fd0d1f9520f68501c53748a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Fri, 11 Nov 2022 11:46:48 +0800 Subject: [PATCH] 11/11 --- src/views/main/Customer/addForm.vue | 30 ++++++++++++++----- src/views/main/Customer/editForm.vue | 40 ++++++++++++++++++------- src/views/main/Customer/index.vue | 18 +++++++---- src/views/main/DJYTenantParam/index.vue | 3 +- 4 files changed, 67 insertions(+), 24 deletions(-) diff --git a/src/views/main/Customer/addForm.vue b/src/views/main/Customer/addForm.vue index caf670c..5da8f80 100644 --- a/src/views/main/Customer/addForm.vue +++ b/src/views/main/Customer/addForm.vue @@ -146,12 +146,12 @@ > - + @@ -323,11 +323,15 @@ export default { }, formatRole(value) { let RData = '' - this.TypeData.forEach(item => { - if (item.code == value) { - RData = item.value - } - }) + if (value) { + this.TypeData.forEach(item => { + value.forEach(item2 => { + if (item.code == item2) { + RData == '' ? (RData = item.value) : (RData = RData + ',' + item.value) + } + }) + }) + } return RData }, formatSex(value) { @@ -382,6 +386,16 @@ export default { values[key] = JSON.stringify(values[key]) } } + this.ContactsData.forEach(item => { + if (item.WroleCode.length) { + let data = '' + item.WroleCode.forEach(item => { + data = `${data}[${item}]` + }) + item.roleCode = data + } + }) + console.log(this.ContactsData) DjyCustomerAdd({ ...values, contacts: this.ContactsData }) .then(res => { if (res.success) { diff --git a/src/views/main/Customer/editForm.vue b/src/views/main/Customer/editForm.vue index 1b4c9e5..8dbc9ba 100644 --- a/src/views/main/Customer/editForm.vue +++ b/src/views/main/Customer/editForm.vue @@ -146,12 +146,12 @@ > - + @@ -300,14 +300,22 @@ export default { this.form.setFieldsValue({ ...res.data }) + res.data.contacts.forEach((item, index) => { item.WebKey = index + let data = [] + item.roleCode.split(']').forEach(item => { + if (item) { + data.push(item.split('[')[1]) + } + }) + item.WroleCode = data + console.log(item.WroleCode) this.ContactsData.push(item) }) }) sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => { this.TypeData = res.data.rows - console.log(this.TypeData) }) }, methods: { @@ -333,12 +341,15 @@ export default { }, formatRole(value) { let RData = '' - this.TypeData.forEach(item => { - console.log(item.code, value) - if (item.code == value) { - RData = item.value - } - }) + if (value) { + this.TypeData.forEach(item => { + value.forEach(item2 => { + if (item.code == item2) { + RData == '' ? (RData = item.value) : (RData = RData + ',' + item.value) + } + }) + }) + } return RData }, formatSex(value) { @@ -375,6 +386,15 @@ export default { values[key] = JSON.stringify(values[key]) } } + this.ContactsData.forEach(item => { + if (item.WroleCode.length) { + let data = '' + item.WroleCode.forEach(item => { + data = `${data}[${item}]` + }) + item.roleCode = data + } + }) DjyCustomerEdit({ ...this.Data, ...values, contacts: this.ContactsData }) .then(res => { if (res.success) { diff --git a/src/views/main/Customer/index.vue b/src/views/main/Customer/index.vue index d33e3ba..cb096c6 100644 --- a/src/views/main/Customer/index.vue +++ b/src/views/main/Customer/index.vue @@ -2,7 +2,7 @@
-
+
- - + + @@ -132,8 +132,10 @@ import { DjyCustomerDelete, DjyUserConfigAdd } from '@/api/modular/main/CustomerInformationManagement' -import addForm from './addForm.vue' -import editForm from './editForm.vue' +// import addForm from './addForm.vue' +// import editForm from './editForm.vue' +const addForm = () => import('./addForm.vue') +const editForm = () => import('./editForm.vue') import columnSetting from '@/components/tableColumnSetting' const columns = [ { @@ -214,6 +216,12 @@ const columns = [ width: '80', dataIndex: 'addrEN' }, + { + title: '属性字符串', + align: 'center', + width: '80', + dataIndex: 'propString' + }, { title: '发票抬头', align: 'center', diff --git a/src/views/main/DJYTenantParam/index.vue b/src/views/main/DJYTenantParam/index.vue index 19bb67a..e2a86c3 100644 --- a/src/views/main/DJYTenantParam/index.vue +++ b/src/views/main/DJYTenantParam/index.vue @@ -53,9 +53,10 @@ {{ FnTurnD(row.typeCode) }} - +