|
|
|
@ -0,0 +1,561 @@
|
|
|
|
|
<template>
|
|
|
|
|
<!-- <a-modal
|
|
|
|
|
title="新增客户信息"
|
|
|
|
|
:width="1100"
|
|
|
|
|
:visible="visible"
|
|
|
|
|
:confirmLoading="confirmLoading"
|
|
|
|
|
@ok="handleSubmit"
|
|
|
|
|
@cancel="handleCancel"
|
|
|
|
|
> -->
|
|
|
|
|
<!-- <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" :loading="SaveLoading">
|
|
|
|
|
保存
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<p class="CsFormTitle">
|
|
|
|
|
<span><i class="iconfont icon-shiyongwendang"></i>基本信息</span>
|
|
|
|
|
</p>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input 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 v-decorator="['shortName', { 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 v-decorator="['fullName']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['chief']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['tel']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['email']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="QQ" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['qq']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="网址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['webUrl']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['province']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['city']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input v-decorator="['addr']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="客户属性" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
mode="multiple"
|
|
|
|
|
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择客户属性!' }] }]"
|
|
|
|
|
>
|
|
|
|
|
<a-select-option v-for="item in propStringData" :key="item.id" :value="item.code">{{
|
|
|
|
|
item.name
|
|
|
|
|
}}</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="服务项目" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-select mode="multiple" v-decorator="['WserviceItem']">
|
|
|
|
|
<a-select-option v-for="item in bookingServiceItem" :key="item.id" :value="item.code">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="英文全名" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input v-decorator="['fullNameEN']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="英文地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input v-decorator="['addrEN']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="18">
|
|
|
|
|
<a-form-item label="提单信息" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
|
|
|
|
|
<a-textarea v-decorator="['tidaninfo']" :auto-size="{ minRows: 3, maxRows: 5 }" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row class="from-box3">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['saleid']" @focus="getUserList">
|
|
|
|
|
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item class="from-label" label="操作人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['opid']" @focus="getUserList">
|
|
|
|
|
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item class="from-label" label="单证人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-select :showSearch="true" :filterOption="filterOption" v-decorator="['docid']" @focus="getUserList">
|
|
|
|
|
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item class="from-label" label="客服人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
:showSearch="true"
|
|
|
|
|
:filterOption="filterOption"
|
|
|
|
|
v-decorator="['custserviceid']"
|
|
|
|
|
@focus="getUserList"
|
|
|
|
|
>
|
|
|
|
|
<a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<p class="CsFormTitle">
|
|
|
|
|
<span><i class="iconfont icon-tuandui"></i>联系人信息</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="roleCode" title="岗位" :edit-render="{}">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span>{{ formatRole(row.roleCode) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-select v-model="row.roleCode" transfer>
|
|
|
|
|
<vxe-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.name"></vxe-option>
|
|
|
|
|
</vxe-select>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="name" title="姓名" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.name" type="text"></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="email" title="邮箱" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.email" type="text"></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="tel" title="电话" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.tel" type="text"></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="qq" title="QQ" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.qq" type="text" transfer></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="remark" title="备注" :edit-render="{}">
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<vxe-input v-model="row.remark" type="text" transfer></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
</vxe-table>
|
|
|
|
|
<p class="CsFormTitle" :style="{ marginTop: '10px' }">
|
|
|
|
|
<span><i class="iconfont icon-icon_xinyong_xianxing_jijin-217"></i>财务信息</span>
|
|
|
|
|
</p>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="发票抬头" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input v-decorator="['invTitle']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="纳税人识别号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input v-decorator="['taxNO']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="18">
|
|
|
|
|
<a-form-item label="发票地址电话" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
|
|
|
|
|
<a-input v-decorator="['invAddrTel']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="人民币开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input v-decorator="['rmbBank']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="人民币账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input v-decorator="['rmbAccount']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="美元开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input v-decorator="['usdBank']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="美元账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input v-decorator="['usdAccount']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
|
<!-- </a-spin>
|
|
|
|
|
</a-modal> -->
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { DjyCustomerEdit, DjyCustomerDetail } from '@/api/modular/main/CustomerInformationManagement'
|
|
|
|
|
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
sexList: [
|
|
|
|
|
{ label: '', value: '' },
|
|
|
|
|
{ label: '男', value: '1' },
|
|
|
|
|
{ label: '女', value: '0' }
|
|
|
|
|
],
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 6 }
|
|
|
|
|
},
|
|
|
|
|
labelCol2: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
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 }
|
|
|
|
|
},
|
|
|
|
|
visible: false,
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
|
ContactsData: [],
|
|
|
|
|
Data: {},
|
|
|
|
|
TypeData: [],
|
|
|
|
|
propStringData: [],
|
|
|
|
|
saleUserList: [],
|
|
|
|
|
bookingServiceItem: [],
|
|
|
|
|
SaveLoading: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
$route() {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.init()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
init() {
|
|
|
|
|
this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item')
|
|
|
|
|
DjyCustomerDetail({ id: this.$route.query.id }).then(res => {
|
|
|
|
|
if (res.data) {
|
|
|
|
|
this.Data = res.data
|
|
|
|
|
let WpropString = []
|
|
|
|
|
if (res.data.propString) {
|
|
|
|
|
res.data.propString.split(']').forEach(item => {
|
|
|
|
|
if (item.split('[')[1]) {
|
|
|
|
|
WpropString.push(item.split('[')[1])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let WserviceItem = []
|
|
|
|
|
if (res.data.serviceItem) {
|
|
|
|
|
res.data.serviceItem.split(']').forEach(item => {
|
|
|
|
|
if (item.split('[')[1]) {
|
|
|
|
|
WserviceItem.push(item.split('[')[1])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
res.data.contacts.forEach((item, index) => {
|
|
|
|
|
item.WebKey = index + 1
|
|
|
|
|
})
|
|
|
|
|
// 后端返回的 ID 类型不一致 在此处 转为一致
|
|
|
|
|
let UserArr = ['saleid', 'opid', 'docid', 'custserviceid']
|
|
|
|
|
UserArr.forEach(item => {
|
|
|
|
|
if (res.data[item]) {
|
|
|
|
|
res.data[item] = parseInt(res.data[item])
|
|
|
|
|
} else {
|
|
|
|
|
res.data[item] = null
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.ContactsData = res.data.contacts
|
|
|
|
|
|
|
|
|
|
if (WserviceItem.length) {
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
...res.data,
|
|
|
|
|
WserviceItem
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
...res.data,
|
|
|
|
|
WserviceItem: []
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (WpropString.length) {
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
...res.data,
|
|
|
|
|
WpropString
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
...res.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.TypeData = this.$options.filters['dictData']('djy_cust_contact_role')
|
|
|
|
|
this.propStringData = this.$options.filters['dictData']('djy_cust_prop')
|
|
|
|
|
this.getUserList()
|
|
|
|
|
},
|
|
|
|
|
getUserList(name = '', type) {
|
|
|
|
|
GetSysUserPage({
|
|
|
|
|
name: name
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.saleUserList = res.data
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
filterOption(value, option) {
|
|
|
|
|
return option.componentOptions.children[0].text.indexOf(value) >= 0
|
|
|
|
|
},
|
|
|
|
|
removeCheckboxRow() {
|
|
|
|
|
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: ''
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
formatRole(value) {
|
|
|
|
|
let RData = ''
|
|
|
|
|
if (value) {
|
|
|
|
|
this.TypeData.forEach(item => {
|
|
|
|
|
if (item.code == value) {
|
|
|
|
|
RData = item.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
return RData
|
|
|
|
|
},
|
|
|
|
|
formatSex(value) {
|
|
|
|
|
if (value === '1') {
|
|
|
|
|
return '男'
|
|
|
|
|
}
|
|
|
|
|
if (value === '0') {
|
|
|
|
|
return '女'
|
|
|
|
|
}
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
formatMultiSex(values) {
|
|
|
|
|
if (values) {
|
|
|
|
|
return values.map(val => this.formatSex(val)).join(',')
|
|
|
|
|
}
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
// 初始化方法
|
|
|
|
|
add(record) {
|
|
|
|
|
this.visible = true
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 提交表单
|
|
|
|
|
*/
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
const {
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
} = this
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
this.SaveLoading = true
|
|
|
|
|
for (const key in values) {
|
|
|
|
|
if (typeof values[key] === 'object' && !(values[key] === null)) {
|
|
|
|
|
values[key] = JSON.stringify(values[key])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let propString = ''
|
|
|
|
|
if (values.WpropString) {
|
|
|
|
|
values.WpropString.split('["')[1]
|
|
|
|
|
.split('"]')[0]
|
|
|
|
|
.split('","')
|
|
|
|
|
.forEach(item2 => {
|
|
|
|
|
propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let serviceItem = ''
|
|
|
|
|
if (values.WserviceItem && values.WserviceItem != '[]') {
|
|
|
|
|
values.WserviceItem.split('["')[1]
|
|
|
|
|
.split('"]')[0]
|
|
|
|
|
.split('","')
|
|
|
|
|
.forEach(item2 => {
|
|
|
|
|
serviceItem == '' ? (serviceItem = `[${item2}]`) : (serviceItem = `${serviceItem}[${item2}]`)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let Arr = ['sale', 'op', 'doc', 'custservice']
|
|
|
|
|
GetSysUserPage()
|
|
|
|
|
.then(res => {
|
|
|
|
|
this.SaveLoading = false
|
|
|
|
|
if (res.success) {
|
|
|
|
|
let saleUserList = res.data
|
|
|
|
|
Arr.forEach(item => {
|
|
|
|
|
if (values[`${item}id`]) {
|
|
|
|
|
saleUserList.forEach(i => {
|
|
|
|
|
if (i.id == values[`${item}id`]) {
|
|
|
|
|
values[item] = i.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
DjyCustomerEdit({
|
|
|
|
|
...this.Data,
|
|
|
|
|
...values,
|
|
|
|
|
propString: propString,
|
|
|
|
|
serviceItem: serviceItem,
|
|
|
|
|
contacts: this.ContactsData
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('编辑成功')
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`编辑失败,${res.message}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.finally(res => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
this.SaveLoading = false
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// handleCancel() {
|
|
|
|
|
// this.form.resetFields()
|
|
|
|
|
// this.visible = false
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
.CsForm {
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 25px;
|
|
|
|
|
height: 760px;
|
|
|
|
|
overflow-y: auto !important;
|
|
|
|
|
}
|
|
|
|
|
.CsFormTitle {
|
|
|
|
|
border-bottom: 1px solid #c9c9c9;
|
|
|
|
|
}
|
|
|
|
|
.CsFormTitle > span {
|
|
|
|
|
padding: 0.25rem 0.5rem 0 0.5rem;
|
|
|
|
|
font-weight: bolder;
|
|
|
|
|
/* border: 1px solid #c9c9c9; */
|
|
|
|
|
}
|
|
|
|
|
.CsFormTitle span i {
|
|
|
|
|
margin-right: 7px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|