lilu 2 years ago
commit 51dbf188e6

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

@ -36,78 +36,51 @@
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="全称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="全称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入全称" v-decorator="['fullName']" />
placeholder="请输入全称"
v-decorator="['fullName', { rules: [{ required: true, message: '请输入全称!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入负责人" v-decorator="['chief']" />
placeholder="请输入负责人"
v-decorator="['chief', { rules: [{ required: true, message: '请输入负责人!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入电话" v-decorator="['tel']" />
placeholder="请输入电话"
v-decorator="['tel', { rules: [{ required: true, message: '请输入电话!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入邮箱" v-decorator="['email']" />
placeholder="请输入邮箱"
v-decorator="['email', { rules: [{ required: true, message: '请输入邮箱!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="QQ" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="QQ" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入QQ" v-decorator="['qq']" />
placeholder="请输入QQ"
v-decorator="['qq', { rules: [{ required: true, message: '请输入QQ' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="网址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="网址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入网址" v-decorator="['webUrl']" />
placeholder="请输入网址"
v-decorator="['webUrl', { rules: [{ required: true, message: '请输入网址!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入省份" v-decorator="['province']" />
placeholder="请输入省份"
v-decorator="['province', { rules: [{ required: true, message: '请输入省份!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入城市" v-decorator="['city']" />
placeholder="请输入城市"
v-decorator="['city', { rules: [{ required: true, message: '请输入城市!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input placeholder="请输入地址" v-decorator="['addr']" />
placeholder="请输入地址"
v-decorator="['addr', { rules: [{ required: true, message: '请输入地址!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
@ -127,18 +100,12 @@
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="英文全名" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="英文全名" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input <a-input placeholder="请输入英文全名" v-decorator="['fullNameEN']" />
placeholder="请输入英文全名"
v-decorator="['fullNameEN', { rules: [{ required: true, message: '请输入英文全名!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="英文地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="英文地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input <a-input placeholder="请输入英文地址" v-decorator="['addrEN']" />
placeholder="请输入英文地址"
v-decorator="['addrEN', { rules: [{ required: true, message: '请输入英文地址!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -199,62 +166,41 @@
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="发票抬头" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="发票抬头" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input <a-input placeholder="请输入发票抬头" v-decorator="['invTitle']" />
placeholder="请输入发票抬头"
v-decorator="['invTitle', { rules: [{ required: true, message: '请输入发票抬头!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="纳税人识别号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="纳税人识别号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input <a-input placeholder="请输入纳税人识别号" v-decorator="['taxNO']" />
placeholder="请输入纳税人识别号"
v-decorator="['taxNO', { rules: [{ required: true, message: '请输入纳税人识别号!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="18"> <a-col :span="18">
<a-form-item label="发票地址电话" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback> <a-form-item label="发票地址电话" :labelCol="labelCol3" :wrapperCol="wrapperCol3" has-feedback>
<a-input <a-input placeholder="请输入发票地址电话" v-decorator="['invAddrTel']" />
placeholder="请输入发票地址电话"
v-decorator="['invAddrTel', { rules: [{ required: true, message: '请输入发票地址电话!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="人民币开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="人民币开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input <a-input placeholder="请输入人民币开户行" v-decorator="['rmbBank']" />
placeholder="请输入人民币开户行"
v-decorator="['rmbBank', { rules: [{ required: true, message: '请输入人民币开户行!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="人民币账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="人民币账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input <a-input placeholder="请输入人民币账号" v-decorator="['rmbAccount']" />
placeholder="请输入人民币账号"
v-decorator="['rmbAccount', { rules: [{ required: true, message: '请输入人民币账号!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="美元开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="美元开户行" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input <a-input placeholder="请输入美元开户行" v-decorator="['usdBank']" />
placeholder="请输入美元开户行"
v-decorator="['usdBank', { rules: [{ required: true, message: '请输入美元开户行!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="美元账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="美元账号" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input <a-input placeholder="请输入美元账号" v-decorator="['usdAccount']" />
placeholder="请输入美元账号"
v-decorator="['usdAccount', { rules: [{ required: true, message: '请输入美元账号!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -306,10 +252,18 @@ export default {
propStringData: [] propStringData: []
} }
}, },
watch: {
$route() {
this.init()
}
},
mounted() { mounted() {
this.init()
},
methods: {
init() {
DjyCustomerDetail({ id: this.$route.query.id }).then(res => { DjyCustomerDetail({ id: this.$route.query.id }).then(res => {
this.Data = res.data this.Data = res.data
console.log(res.data)
let WpropString = [] let WpropString = []
if (res.data.propString) { if (res.data.propString) {
res.data.propString.split(']').forEach(item => { res.data.propString.split(']').forEach(item => {
@ -318,20 +272,24 @@ export default {
} }
}) })
} }
res.data.contacts.forEach((item, index) => { res.data.contacts.forEach((item, index) => {
item.WebKey = index + 1 item.WebKey = index + 1
}) })
this.ContactsData = res.data.contacts this.ContactsData = res.data.contacts
if (WpropString.length) {
this.form.setFieldsValue({ this.form.setFieldsValue({
...res.data, ...res.data,
WpropString WpropString
}) })
} else {
this.form.setFieldsValue({
...res.data
})
}
}) })
this.TypeData = this.$options.filters['dictData']('djy_cust_contact_role') this.TypeData = this.$options.filters['dictData']('djy_cust_contact_role')
this.propStringData = this.$options.filters['dictData']('djy_cust_prop') this.propStringData = this.$options.filters['dictData']('djy_cust_prop')
}, },
methods: {
removeCheckboxRow() { removeCheckboxRow() {
this.$refs.xTable.selection.forEach(item => { this.$refs.xTable.selection.forEach(item => {
this.ContactsData.forEach((item2, index2) => { this.ContactsData.forEach((item2, index2) => {
@ -354,7 +312,6 @@ export default {
}, },
formatRole(value) { formatRole(value) {
let RData = '' let RData = ''
console.log(value)
if (value) { if (value) {
this.TypeData.forEach(item => { this.TypeData.forEach(item => {
if (item.code == value) { if (item.code == value) {
@ -399,12 +356,15 @@ export default {
} }
} }
let propString = '' let propString = ''
if (values.WpropString) {
values.WpropString.split('["')[1] values.WpropString.split('["')[1]
.split('"]')[0] .split('"]')[0]
.split('","') .split('","')
.forEach(item2 => { .forEach(item2 => {
propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`) propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
}) })
}
DjyCustomerEdit({ ...this.Data, ...values, propString: propString, contacts: this.ContactsData }) DjyCustomerEdit({ ...this.Data, ...values, propString: propString, contacts: this.ContactsData })
.then(res => { .then(res => {
if (res.success) { if (res.success) {

@ -336,6 +336,7 @@ export default {
// activeKey = panes[0].key // activeKey = panes[0].key
// } // }
// } // }
this.panes = panes this.panes = panes
this.activeKey = activeKey this.activeKey = activeKey
}, },
@ -352,15 +353,8 @@ export default {
// this.activeKey = activeKey // this.activeKey = activeKey
}, },
TabsAdd() { TabsAdd() {
// CustomerInformationManagementAdd
this.$router.push({ name: 'CustomerInformationManagementAdd' }) this.$router.push({ name: 'CustomerInformationManagementAdd' })
// this.$router.push({ name: 'CustomerInformationManagementAdd', query: { type: this.carrierRadio } }) localStorage.setItem('CustomerInformationManagementAdd', 'new')
// let activeKey = this.panes.length + 1
// this.panes.push({
// title: '',
// key: activeKey
// })
// this.activeKey = activeKey
}, },
columnChange(data) { columnChange(data) {
this.ColumnsQuery = [...data] this.ColumnsQuery = [...data]

@ -226,6 +226,11 @@ export default {
values.tenantId = item.id values.tenantId = item.id
} }
}) })
this.EdiNameData.forEach(item => {
if (values.edicode == item.code) {
values.ediname = item.name
}
})
DjyEdiSettingAdd(values) DjyEdiSettingAdd(values)
.then(res => { .then(res => {
if (res.success) { if (res.success) {

@ -234,6 +234,11 @@ export default {
values.tenantId = item.id values.tenantId = item.id
} }
}) })
this.EdiNameData.forEach(item => {
if (values.edicode == item.code) {
values.ediname = item.name
}
})
// console.log(this.form, values.id) // console.log(this.form, values.id)
let data = { ...values, id: this.data.id } let data = { ...values, id: this.data.id }
DjyEdiSettingEdit(data) DjyEdiSettingEdit(data)

@ -266,7 +266,7 @@ export default {
let data = '' let data = ''
this.EdiNameData.forEach(item => { this.EdiNameData.forEach(item => {
if (item.code == code) { if (item.code == code) {
data = `${item.value}` data = `${item.name}`
} }
}) })
return data return data

@ -1,11 +1,7 @@
<template> <template>
<div> <div>
<a-card :bordered="false" :bodyStyle="tstyle"> <a-card :bordered="false" :bodyStyle="tstyle">
<div <div class="table-page-search-wrapper" :class="advanced ? 'Open' : 'Close'">
class="table-page-search-wrapper"
v-if="hasPerm('BookingTemplate:page')"
:class="advanced ? 'Open' : 'Close'"
>
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="48"> <a-row :gutter="48">
<a-col :md="18"> <a-col :md="18">

@ -85,7 +85,6 @@ export default {
// //
edit(record) { edit(record) {
this.data = record this.data = record
console.log(record)
this.visible = true this.visible = true
const typeOption = this.$options const typeOption = this.$options
this.typeData = typeOption.filters['dictData']('edi_type') this.typeData = typeOption.filters['dictData']('edi_type')
@ -96,7 +95,6 @@ export default {
password: record.password, password: record.password,
remark: record.remark remark: record.remark
}) })
console.log(this.form.getFieldsValue())
}, 100) }, 100)
}, },
handleSubmit() { handleSubmit() {
@ -105,17 +103,13 @@ export default {
} = this } = this
this.confirmLoading = true this.confirmLoading = true
validateFields((errors, values) => { validateFields((errors, values) => {
console.log(errors, values)
if (!errors) { if (!errors) {
for (const key in values) { for (const key in values) {
console.log(key, 1)
if (typeof values[key] === 'object' && !(values[key] === null)) { if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key]) values[key] = JSON.stringify(values[key])
} }
} }
console.log(this.form, values.id)
values.id = this.data.id values.id = this.data.id
console.log(values)
DjyWebsiteAccountConfigEdit(values) DjyWebsiteAccountConfigEdit(values)
.then(res => { .then(res => {
if (res.success) { if (res.success) {

@ -1,11 +1,7 @@
<template> <template>
<div> <div>
<a-card :bordered="false" :bodyStyle="tstyle"> <a-card :bordered="false" :bodyStyle="tstyle">
<div <div class="table-page-search-wrapper" :class="advanced ? 'Open' : 'Close'">
class="table-page-search-wrapper"
v-if="hasPerm('BookingTemplate:page')"
:class="advanced ? 'Open' : 'Close'"
>
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="48"> <a-row :gutter="48">
<a-col :md="18"> <a-col :md="18">

Loading…
Cancel
Save