|
|
|
@ -1,16 +1,32 @@
|
|
|
|
|
<template>
|
|
|
|
|
<a-modal
|
|
|
|
|
title="编辑客户信息"
|
|
|
|
|
<!-- <a-modal
|
|
|
|
|
title="新增客户信息"
|
|
|
|
|
:width="1100"
|
|
|
|
|
:visible="visible"
|
|
|
|
|
:confirmLoading="confirmLoading"
|
|
|
|
|
@ok="handleSubmit"
|
|
|
|
|
@cancel="handleCancel"
|
|
|
|
|
>
|
|
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
|
|
<a-form :form="form">
|
|
|
|
|
> -->
|
|
|
|
|
<!-- <a-spin :spinning="confirmLoading"> -->
|
|
|
|
|
<a-form :form="form" class="CsForm">
|
|
|
|
|
<a-row type="flex" justify="end">
|
|
|
|
|
<a-col :span="1">
|
|
|
|
|
<a-button type="primary" @click="handleSubmit">
|
|
|
|
|
保存
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<p class="CsFormTitle"><span>基本信息</span></p>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入助记码"
|
|
|
|
|
v-decorator="['codeName', { rules: [{ required: true, message: '请输入助记码!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="简称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入简称"
|
|
|
|
@ -18,7 +34,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="全称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入全称"
|
|
|
|
@ -26,7 +42,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入负责人"
|
|
|
|
@ -36,7 +52,7 @@
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入电话"
|
|
|
|
@ -44,7 +60,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入邮箱"
|
|
|
|
@ -52,7 +68,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="QQ" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入QQ"
|
|
|
|
@ -60,9 +76,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="网址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入网址"
|
|
|
|
@ -70,7 +84,9 @@
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入省份"
|
|
|
|
@ -78,7 +94,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入城市"
|
|
|
|
@ -86,26 +102,26 @@
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入地址"
|
|
|
|
|
v-decorator="['addr', { rules: [{ required: true, message: '请输入地址!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="英文全名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="英文全名" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入英文全名"
|
|
|
|
|
v-decorator="['fullNameEN', { rules: [{ required: true, message: '请输入英文全名!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="英文地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="英文地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入英文地址"
|
|
|
|
|
v-decorator="['addrEN', { rules: [{ required: true, message: '请输入英文地址!' }] }]"
|
|
|
|
@ -113,25 +129,74 @@
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<p class="CsFormTitle"><span>联系人信息</span></p>
|
|
|
|
|
<vxe-toolbar>
|
|
|
|
|
<template #buttons>
|
|
|
|
|
<vxe-button icon="vxe-icon-square-plus" @click="insertEvent()">新增</vxe-button>
|
|
|
|
|
<vxe-button @click="removeCheckboxRow()">删除选中</vxe-button>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-toolbar>
|
|
|
|
|
<vxe-table
|
|
|
|
|
ref="xTable"
|
|
|
|
|
border
|
|
|
|
|
resizable
|
|
|
|
|
show-overflow
|
|
|
|
|
:data="ContactsData"
|
|
|
|
|
:edit-config="{ trigger: 'click', mode: 'cell' }"
|
|
|
|
|
>
|
|
|
|
|
<vxe-column type="checkbox" width="60"></vxe-column>
|
|
|
|
|
<vxe-column type="seq" width="60"></vxe-column>
|
|
|
|
|
<vxe-column field="roleName" title="角色" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.roleName" type="text" placeholder="请输入角色"></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="name" title="姓名" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.name" type="text" placeholder="请输入姓名"></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="email" title="邮箱" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.email" type="text" placeholder="请输入邮箱"></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="tel" title="电话" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.tel" type="text" placeholder="请输入电话"></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="qq" title="QQ" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.qq" type="text" placeholder="请输入QQ" transfer></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="remark" title="备注" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.remark" type="text" placeholder="请输入备注" transfer></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
</vxe-table>
|
|
|
|
|
<p class="CsFormTitle" :style="{ marginTop: '10px' }"><span>财务信息</span></p>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="发票抬头" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="发票抬头" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入发票抬头"
|
|
|
|
|
v-decorator="['invTitle', { rules: [{ required: true, message: '请输入发票抬头!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="纳税人识别号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="纳税人识别号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入纳税人识别号"
|
|
|
|
|
v-decorator="['taxNO', { rules: [{ required: true, message: '请输入纳税人识别号!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="发票地址电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="18">
|
|
|
|
|
<a-form-item label="发票地址电话" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入发票地址电话"
|
|
|
|
|
v-decorator="['invAddrTel', { rules: [{ required: true, message: '请输入发票地址电话!' }] }]"
|
|
|
|
@ -140,16 +205,16 @@
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="人民币开户行" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="人民币开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入人民币开户行"
|
|
|
|
|
v-decorator="['rmbBank', { rules: [{ required: true, message: '请输入人民币开户行!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="人民币账号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="人民币账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入人民币账号"
|
|
|
|
|
v-decorator="['rmbAccount', { rules: [{ required: true, message: '请输入人民币账号!' }] }]"
|
|
|
|
@ -158,16 +223,16 @@
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="美元开户行" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="美元开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入美元开户行"
|
|
|
|
|
v-decorator="['usdBank', { rules: [{ required: true, message: '请输入美元开户行!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="美元账号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="美元账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入美元账号"
|
|
|
|
|
v-decorator="['usdAccount', { rules: [{ required: true, message: '请输入美元账号!' }] }]"
|
|
|
|
@ -176,91 +241,150 @@
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-spin>
|
|
|
|
|
</a-modal>
|
|
|
|
|
<!-- </a-spin>
|
|
|
|
|
</a-modal> -->
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { DjyCustomerEdit } from '@/api/modular/main/CustomerInformationManagement'
|
|
|
|
|
import { DjyCustomerEdit, DjyCustomerDetail } from '@/api/modular/main/CustomerInformationManagement'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
props: ['RowData'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
sexList: [
|
|
|
|
|
{ label: '', value: '' },
|
|
|
|
|
{ label: '男', value: '1' },
|
|
|
|
|
{ label: '女', value: '0' }
|
|
|
|
|
],
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 7 }
|
|
|
|
|
sm: { span: 6 }
|
|
|
|
|
},
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
labelCol2: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 15 }
|
|
|
|
|
sm: { span: 3 }
|
|
|
|
|
},
|
|
|
|
|
labelCol3: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 2 }
|
|
|
|
|
},
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
xs: { span: 25 },
|
|
|
|
|
sm: { span: 16 }
|
|
|
|
|
},
|
|
|
|
|
wrapperCol2: {
|
|
|
|
|
xs: { span: 25 },
|
|
|
|
|
sm: { span: 20 }
|
|
|
|
|
},
|
|
|
|
|
wrapperCol3: {
|
|
|
|
|
xs: { span: 25 },
|
|
|
|
|
sm: { span: 22 }
|
|
|
|
|
},
|
|
|
|
|
typeData: [],
|
|
|
|
|
visible: false,
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
form: this.$form.createForm(this)
|
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
|
ContactsData: [],
|
|
|
|
|
Data: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
DjyCustomerDetail({ id: this.RowData.id }).then(res => {
|
|
|
|
|
this.Data = res.data
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
...res.data
|
|
|
|
|
})
|
|
|
|
|
res.data.contacts.forEach((item, index) => {
|
|
|
|
|
console.log(index)
|
|
|
|
|
item.WebKey = index
|
|
|
|
|
this.ContactsData.push(item)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
removeCheckboxRow() {
|
|
|
|
|
console.log(this.$refs.xTable.selection)
|
|
|
|
|
this.$refs.xTable.selection.forEach(item => {
|
|
|
|
|
this.ContactsData.forEach((item2, index2) => {
|
|
|
|
|
if (item.WebKey == item2.WebKey) {
|
|
|
|
|
this.ContactsData.splice(index2, 1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
insertEvent() {
|
|
|
|
|
this.ContactsData.push({
|
|
|
|
|
WebKey: this.ContactsData.length ? this.ContactsData[this.ContactsData.length - 1].WebKey + 1 : 1,
|
|
|
|
|
roleName: '',
|
|
|
|
|
name: '',
|
|
|
|
|
tel: '',
|
|
|
|
|
email: '',
|
|
|
|
|
qq: '',
|
|
|
|
|
remark: ''
|
|
|
|
|
})
|
|
|
|
|
console.log(this.ContactsData)
|
|
|
|
|
},
|
|
|
|
|
formatSex(value) {
|
|
|
|
|
if (value === '1') {
|
|
|
|
|
return '男'
|
|
|
|
|
}
|
|
|
|
|
if (value === '0') {
|
|
|
|
|
return '女'
|
|
|
|
|
}
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
formatMultiSex(values) {
|
|
|
|
|
if (values) {
|
|
|
|
|
return values.map(val => this.formatSex(val)).join(',')
|
|
|
|
|
}
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
// 初始化方法
|
|
|
|
|
edit(record) {
|
|
|
|
|
console.log(record)
|
|
|
|
|
add(record) {
|
|
|
|
|
this.visible = true
|
|
|
|
|
const typeOption = this.$options
|
|
|
|
|
this.typeData = typeOption.filters['dictData']('edi_type')
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
addr: record.addr,
|
|
|
|
|
addrEN: record.addrEN,
|
|
|
|
|
chief: record.chief,
|
|
|
|
|
city: record.city,
|
|
|
|
|
createdTime: record.createdTime,
|
|
|
|
|
createdUserId: record.createdUserId,
|
|
|
|
|
createdUserName: record.createdUserName,
|
|
|
|
|
email: record.email,
|
|
|
|
|
fullName: record.fullName,
|
|
|
|
|
fullNameEN: record.fullNameEN,
|
|
|
|
|
id: record.id,
|
|
|
|
|
invAddrTel: record.invAddrTel,
|
|
|
|
|
invTitle: record.invTitle,
|
|
|
|
|
isDeleted: record.isDeleted,
|
|
|
|
|
province: record.province,
|
|
|
|
|
qq: record.qq,
|
|
|
|
|
rmbAccount: record.rmbAccount,
|
|
|
|
|
rmbBank: record.rmbBank,
|
|
|
|
|
shortName: record.shortName,
|
|
|
|
|
taxNO: record.taxNO,
|
|
|
|
|
tel: record.tel,
|
|
|
|
|
tenantId: record.tenantId,
|
|
|
|
|
usdAccount: record.usdAccount,
|
|
|
|
|
usdBank: record.usdBank,
|
|
|
|
|
webUrl: record.webUrl
|
|
|
|
|
})
|
|
|
|
|
console.log(this.form.getFieldsValue())
|
|
|
|
|
}, 100)
|
|
|
|
|
this.typeData = [
|
|
|
|
|
{
|
|
|
|
|
code: 10,
|
|
|
|
|
name: '收货人'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
code: 20,
|
|
|
|
|
name: '发货人'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
code: 30,
|
|
|
|
|
name: '通知人'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
code: 40,
|
|
|
|
|
name: '第二通知人'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 提交表单
|
|
|
|
|
*/
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
const {
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
} = this
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
console.log(errors, values)
|
|
|
|
|
if (!errors) {
|
|
|
|
|
for (const key in values) {
|
|
|
|
|
console.log(key, 1)
|
|
|
|
|
if (typeof values[key] === 'object' && !(values[key] === null)) {
|
|
|
|
|
values[key] = JSON.stringify(values[key])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(this.form, values.id)
|
|
|
|
|
DjyCustomerEdit(values)
|
|
|
|
|
DjyCustomerEdit({ ...this.Data, ...values, contacts: this.ContactsData })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('编辑成功')
|
|
|
|
|
this.$message.success('新增成功')
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
this.handleCancel()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('编辑失败') // + res.message
|
|
|
|
|
this.$message.error('新增失败') // + res.message
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.finally(res => {
|
|
|
|
@ -278,3 +402,16 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
.CsForm {
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 25px;
|
|
|
|
|
}
|
|
|
|
|
.CsFormTitle {
|
|
|
|
|
border-bottom: 1px solid #c9c9c9;
|
|
|
|
|
}
|
|
|
|
|
.CsFormTitle > span {
|
|
|
|
|
padding: 0.25rem 0.5rem 0 0.5rem;
|
|
|
|
|
/* border: 1px solid #c9c9c9; */
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|