dev
张同海 2 years ago
parent b75c3c28c7
commit c1d7564b41

@ -146,12 +146,12 @@
> >
<vxe-column type="checkbox" width="60"></vxe-column> <vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column type="seq" 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 }"> <template #default="{ row }">
<span>{{ formatRole(row.roleCode) }}</span> <span>{{ formatRole(row.WroleCode) }}</span>
</template> </template>
<template #edit="{ row }"> <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-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.value"></vxe-option>
</vxe-select> </vxe-select>
</template> </template>
@ -323,11 +323,15 @@ export default {
}, },
formatRole(value) { formatRole(value) {
let RData = '' let RData = ''
if (value) {
this.TypeData.forEach(item => { this.TypeData.forEach(item => {
if (item.code == value) { value.forEach(item2 => {
RData = item.value if (item.code == item2) {
RData == '' ? (RData = item.value) : (RData = RData + ',' + item.value)
} }
}) })
})
}
return RData return RData
}, },
formatSex(value) { formatSex(value) {
@ -382,6 +386,16 @@ export default {
values[key] = JSON.stringify(values[key]) 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 }) DjyCustomerAdd({ ...values, contacts: this.ContactsData })
.then(res => { .then(res => {
if (res.success) { if (res.success) {

@ -146,12 +146,12 @@
> >
<vxe-column type="checkbox" width="60"></vxe-column> <vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column type="seq" 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 }"> <template #default="{ row }">
<span>{{ formatRole(row.roleCode) }}</span> <span>{{ formatRole(row.WroleCode) }}</span>
</template> </template>
<template #edit="{ row }"> <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-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.value"></vxe-option>
</vxe-select> </vxe-select>
</template> </template>
@ -300,14 +300,22 @@ export default {
this.form.setFieldsValue({ this.form.setFieldsValue({
...res.data ...res.data
}) })
res.data.contacts.forEach((item, index) => { res.data.contacts.forEach((item, index) => {
item.WebKey = 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) this.ContactsData.push(item)
}) })
}) })
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => { sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => {
this.TypeData = res.data.rows this.TypeData = res.data.rows
console.log(this.TypeData)
}) })
}, },
methods: { methods: {
@ -333,12 +341,15 @@ export default {
}, },
formatRole(value) { formatRole(value) {
let RData = '' let RData = ''
if (value) {
this.TypeData.forEach(item => { this.TypeData.forEach(item => {
console.log(item.code, value) value.forEach(item2 => {
if (item.code == value) { if (item.code == item2) {
RData = item.value RData == '' ? (RData = item.value) : (RData = RData + ',' + item.value)
} }
}) })
})
}
return RData return RData
}, },
formatSex(value) { formatSex(value) {
@ -375,6 +386,15 @@ export default {
values[key] = JSON.stringify(values[key]) 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 }) DjyCustomerEdit({ ...this.Data, ...values, contacts: this.ContactsData })
.then(res => { .then(res => {
if (res.success) { if (res.success) {

@ -2,7 +2,7 @@
<div class="CsMain"> <div class="CsMain">
<a-tabs class="CsMainTable" v-model="activeKey" hide-add type="editable-card" @edit="onEdit"> <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"> <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"> <a-card :bordered="false" :bodyStyle="tstyle">
<div <div
class="table-page-search-wrapper" class="table-page-search-wrapper"
@ -118,8 +118,8 @@
</vxe-pager> </vxe-pager>
</a-card> </a-card>
</div> </div>
<add-form ref="addForm" v-show="pane.title == ''" @ok="handleOk" /> <add-form ref="addForm" v-if="pane.title == ''" @ok="handleOk" />
<edit-form ref="editForm" v-show="pane.title == ''" :RowData="pane.row" @ok="handleOk" /> <edit-form ref="editForm" v-if="pane.title == ''" :RowData="pane.row" @ok="handleOk" />
<!-- <addForm ></addForm> --> <!-- <addForm ></addForm> -->
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
@ -132,8 +132,10 @@ import {
DjyCustomerDelete, DjyCustomerDelete,
DjyUserConfigAdd DjyUserConfigAdd
} from '@/api/modular/main/CustomerInformationManagement' } from '@/api/modular/main/CustomerInformationManagement'
import addForm from './addForm.vue' // import addForm from './addForm.vue'
import editForm from './editForm.vue' // import editForm from './editForm.vue'
const addForm = () => import('./addForm.vue')
const editForm = () => import('./editForm.vue')
import columnSetting from '@/components/tableColumnSetting' import columnSetting from '@/components/tableColumnSetting'
const columns = [ const columns = [
{ {
@ -214,6 +216,12 @@ const columns = [
width: '80', width: '80',
dataIndex: 'addrEN' dataIndex: 'addrEN'
}, },
{
title: '属性字符串',
align: 'center',
width: '80',
dataIndex: 'propString'
},
{ {
title: '发票抬头', title: '发票抬头',
align: 'center', align: 'center',

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

Loading…
Cancel
Save