|
|
|
@ -12,7 +12,7 @@
|
|
|
|
|
<a-row type="flex" justify="end">
|
|
|
|
|
<a-col :span="1">
|
|
|
|
|
<a-button type="primary" @click="handleSubmit">
|
|
|
|
|
保存
|
|
|
|
|
{{ this.id ? '修改' : '新增' }}
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
@ -36,78 +36,51 @@
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="全称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入全称"
|
|
|
|
|
v-decorator="['fullName', { rules: [{ required: true, message: '请输入全称!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入全称" v-decorator="['fullName']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入负责人"
|
|
|
|
|
v-decorator="['chief', { rules: [{ required: true, message: '请输入负责人!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入负责人" 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
|
|
|
|
|
placeholder="请输入电话"
|
|
|
|
|
v-decorator="['tel', { rules: [{ required: true, message: '请输入电话!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入电话" v-decorator="['tel']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入邮箱"
|
|
|
|
|
v-decorator="['email', { rules: [{ required: true, message: '请输入邮箱!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入邮箱" 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
|
|
|
|
|
placeholder="请输入QQ"
|
|
|
|
|
v-decorator="['qq', { rules: [{ required: true, message: '请输入QQ!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入QQ" v-decorator="['qq']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="网址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入网址"
|
|
|
|
|
v-decorator="['webUrl', { rules: [{ required: true, message: '请输入网址!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入网址" 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
|
|
|
|
|
placeholder="请输入省份"
|
|
|
|
|
v-decorator="['province', { rules: [{ required: true, message: '请输入省份!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入省份" v-decorator="['province']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入城市"
|
|
|
|
|
v-decorator="['city', { rules: [{ required: true, message: '请输入城市!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入城市" v-decorator="['city']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入地址"
|
|
|
|
|
v-decorator="['addr', { rules: [{ required: true, message: '请输入地址!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入地址" v-decorator="['addr']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
@ -117,9 +90,9 @@
|
|
|
|
|
placeholder="请选择客户属性"
|
|
|
|
|
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-option v-for="item in propStringData" :key="item.id" :value="item.code">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
@ -127,18 +100,12 @@
|
|
|
|
|
<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-input placeholder="请输入英文全名" v-decorator="['fullNameEN']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="英文地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入英文地址"
|
|
|
|
|
v-decorator="['addrEN', { rules: [{ required: true, message: '请输入英文地址!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入英文地址" v-decorator="['addrEN']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
@ -199,62 +166,41 @@
|
|
|
|
|
<a-row>
|
|
|
|
|
<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-input placeholder="请输入发票抬头" v-decorator="['invTitle']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<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-input placeholder="请输入纳税人识别号" v-decorator="['taxNO']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="18">
|
|
|
|
|
<a-form-item label="发票地址电话" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入发票地址电话"
|
|
|
|
|
v-decorator="['invAddrTel', { rules: [{ required: true, message: '请输入发票地址电话!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入发票地址电话" 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
|
|
|
|
|
placeholder="请输入人民币开户行"
|
|
|
|
|
v-decorator="['rmbBank', { rules: [{ required: true, message: '请输入人民币开户行!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入人民币开户行" v-decorator="['rmbBank']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="人民币账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入人民币账号"
|
|
|
|
|
v-decorator="['rmbAccount', { rules: [{ required: true, message: '请输入人民币账号!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入人民币账号" 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
|
|
|
|
|
placeholder="请输入美元开户行"
|
|
|
|
|
v-decorator="['usdBank', { rules: [{ required: true, message: '请输入美元开户行!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入美元开户行" v-decorator="['usdBank']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="美元账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入美元账号"
|
|
|
|
|
v-decorator="['usdAccount', { rules: [{ required: true, message: '请输入美元账号!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
<a-input placeholder="请输入美元账号" v-decorator="['usdAccount']" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
@ -264,7 +210,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { DjyCustomerAdd } from '@/api/modular/main/CustomerInformationManagement'
|
|
|
|
|
import { DjyCustomerAdd, DjyCustomerEdit } from '@/api/modular/main/CustomerInformationManagement'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -303,7 +249,18 @@ export default {
|
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
|
ContactsData: [],
|
|
|
|
|
TypeData: [],
|
|
|
|
|
propStringData: []
|
|
|
|
|
propStringData: [],
|
|
|
|
|
id: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
$route() {
|
|
|
|
|
let type = localStorage.getItem('CustomerInformationManagementAdd')
|
|
|
|
|
if (type == 'new') {
|
|
|
|
|
localStorage.setItem('CustomerInformationManagementAdd', 'old')
|
|
|
|
|
this.form.resetFields()
|
|
|
|
|
this.id = ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
@ -355,6 +312,7 @@ export default {
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
} = this
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
for (const key in values) {
|
|
|
|
@ -362,19 +320,34 @@ export default {
|
|
|
|
|
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}]`)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (this.id) {
|
|
|
|
|
DjyCustomerEdit({ id: this.id, ...values, propString: propString, 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
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
DjyCustomerAdd({ ...values, propString: propString, contacts: this.ContactsData })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.id = res.data
|
|
|
|
|
this.$message.success('新增成功')
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
@ -385,6 +358,7 @@ export default {
|
|
|
|
|
.finally(res => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|