dev
张同海 2 years ago
parent b75c3c28c7
commit c1d7564b41

@ -146,12 +146,12 @@
>
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="roleCode" title="角色" :edit-render="{}">
<vxe-column field="WroleCode" title="角色" :edit-render="{}">
<template #default="{ row }">
<span>{{ formatRole(row.roleCode) }}</span>
<span>{{ formatRole(row.WroleCode) }}</span>
</template>
<template #edit="{ row }">
<vxe-select v-model="row.roleCode" transfer>
<vxe-select v-model="row.WroleCode" multiple transfer>
<vxe-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.value"></vxe-option>
</vxe-select>
</template>
@ -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) {

@ -146,12 +146,12 @@
>
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="roleCode" title="角色" :edit-render="{}">
<vxe-column field="WroleCode" title="角色" :edit-render="{}">
<template #default="{ row }">
<span>{{ formatRole(row.roleCode) }}</span>
<span>{{ formatRole(row.WroleCode) }}</span>
</template>
<template #edit="{ row }">
<vxe-select v-model="row.roleCode" transfer>
<vxe-select v-model="row.WroleCode" multiple transfer>
<vxe-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.value"></vxe-option>
</vxe-select>
</template>
@ -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) {

@ -2,7 +2,7 @@
<div class="CsMain">
<a-tabs class="CsMainTable" v-model="activeKey" hide-add type="editable-card" @edit="onEdit">
<a-tab-pane v-for="pane in panes" :key="pane.key" :tab="pane.title" :closable="pane.key == 0 ? false : true">
<div v-show="pane.title == '客户信息'">
<div v-if="pane.title == '客户信息'">
<a-card :bordered="false" :bodyStyle="tstyle">
<div
class="table-page-search-wrapper"
@ -118,8 +118,8 @@
</vxe-pager>
</a-card>
</div>
<add-form ref="addForm" v-show="pane.title == ''" @ok="handleOk" />
<edit-form ref="editForm" v-show="pane.title == ''" :RowData="pane.row" @ok="handleOk" />
<add-form ref="addForm" v-if="pane.title == ''" @ok="handleOk" />
<edit-form ref="editForm" v-if="pane.title == ''" :RowData="pane.row" @ok="handleOk" />
<!-- <addForm ></addForm> -->
</a-tab-pane>
</a-tabs>
@ -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',

@ -53,9 +53,10 @@
<span>{{ FnTurnD(row.typeCode) }}</span>
</template>
</vxe-column>
<vxe-column title="操作" fixed="right" width="200" align="center">
<vxe-column title="操作" fixed="right" width="260" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button>
<vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button>
<a-popconfirm
title="请确认删除?"
ok-text="是"

Loading…
Cancel
Save