dev
张同海 2 years ago
parent 08b2c52d79
commit 349c21aa82

@ -704,6 +704,7 @@ export default {
uploadFile(file) { uploadFile(file) {
const formData = new FormData() const formData = new FormData()
formData.append('file', file.file) formData.append('file', file.file)
formData.append('bookingId', this.id)
const type = file.file.type const type = file.file.type
console.log(type) console.log(type)
BookingOrderOcrUpFile(formData).then(res => { BookingOrderOcrUpFile(formData).then(res => {

@ -104,65 +104,46 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row class="from-box3" :gutter="10"> <a-row class="from-box3">
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6"> <a-col :span="6">
<a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item class="from-label" label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<auto-complete <a-select :showSearch="true" :filterOption="filterOption" v-decorator="['saleid']" @focus="getUserList">
:allowClear="true" <a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
class="customer-input" {{ item.name }}
v-model="details.sale" </a-select-option>
:data-source="saleUserListArr" </a-select>
:dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }"
@select="saleSelect"
@change="saleChange"
@focus="saleChange"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6"> <a-col :span="6">
<a-form-item class="from-label" label="操作人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item class="from-label" label="操作人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<auto-complete <a-select :showSearch="true" :filterOption="filterOption" v-decorator="['opid']" @focus="getUserList">
:allowClear="true" <a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
class="customer-input" {{ item.name }}
v-model="details.op" </a-select-option>
:data-source="opUserListArr" </a-select>
:dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }"
@select="opSelect"
@change="opChange"
@focus="opChange"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6"> <a-col :span="6">
<a-form-item class="from-label" label="单证人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item class="from-label" label="单证人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<auto-complete <a-select :showSearch="true" :filterOption="filterOption" v-decorator="['docid']" @focus="getUserList">
:allowClear="true" <a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
class="customer-input" {{ item.name }}
v-model="details.doc" </a-select-option>
:data-source="docUserListArr" </a-select>
:dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }"
@select="docSelect"
@change="docChange"
@focus="docChange"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6"> <a-col :span="6">
<a-form-item class="from-label" label="客服人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item class="from-label" label="客服人员" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<auto-complete <a-select
:allowClear="true" :showSearch="true"
class="customer-input" :filterOption="filterOption"
v-model="details.custservice" v-decorator="['custserviceid']"
:data-source="custserviceUserListArr" @focus="getUserList"
:dropdown-match-select-width="false" >
:dropdown-style="{ width: '200px' }" <a-select-option v-for="item in saleUserList" :key="item.id" :value="item.id">
@select="custserviceSelect" {{ item.name }}
@change="custserviceChange" </a-select-option>
@focus="custserviceChange" </a-select>
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -272,6 +253,7 @@
<script> <script>
import { DjyCustomerAdd, DjyCustomerEdit } from '@/api/modular/main/CustomerInformationManagement' import { DjyCustomerAdd, DjyCustomerEdit } from '@/api/modular/main/CustomerInformationManagement'
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
export default { export default {
data() { data() {
return { return {
@ -311,7 +293,8 @@ export default {
ContactsData: [], ContactsData: [],
TypeData: [], TypeData: [],
propStringData: [], propStringData: [],
id: '' id: '',
saleUserList: []
} }
}, },
watch: { watch: {
@ -329,6 +312,22 @@ export default {
this.propStringData = this.$options.filters['dictData']('djy_cust_prop') this.propStringData = this.$options.filters['dictData']('djy_cust_prop')
}, },
methods: { methods: {
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() { removeCheckboxRow() {
this.$refs.xTable.selection.forEach(item => { this.$refs.xTable.selection.forEach(item => {
this.ContactsData.forEach((item2, index2) => { this.ContactsData.forEach((item2, index2) => {
@ -390,36 +389,55 @@ export default {
propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`) propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
}) })
} }
if (this.id) { let Arr = ['sale', 'op', 'doc', 'custservice']
DjyCustomerEdit({ id: this.id, ...values, propString: propString, contacts: this.ContactsData }) GetSysUserPage()
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success('修改成功') let saleUserList = res.data
this.confirmLoading = false Arr.forEach(item => {
this.$emit('ok', values) if (values[`${item}id`]) {
} else { saleUserList.forEach(i => {
this.$message.error(`修改失败,${res.message}`) if (i.id == values[`${item}id`]) {
} values[item] = i.name
}) }
.finally(res => { })
this.confirmLoading = false }
}) })
} else { if (this.id) {
DjyCustomerAdd({ ...values, propString: propString, contacts: this.ContactsData }) DjyCustomerEdit({ id: this.id, ...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) } else {
this.$message.error(`修改失败,${res.message}`)
}
})
.finally(res => {
this.confirmLoading = false
})
} else { } else {
this.$message.error(`新增失败,${res.message}`) 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)
} else {
this.$message.error(`新增失败,${res.message}`)
}
})
.finally(res => {
this.confirmLoading = false
})
} }
}) }
.finally(res => { })
this.confirmLoading = false .catch(err => {
}) console.log(err)
} })
} else { } else {
this.confirmLoading = false this.confirmLoading = false
} }
@ -432,7 +450,7 @@ export default {
} }
} }
</script> </script>
<style scoped> <style scoped lang="less">
.CsForm { .CsForm {
background: #fff; background: #fff;
padding: 25px; padding: 25px;
@ -454,4 +472,23 @@ export default {
.CsFormTitle span i { .CsFormTitle span i {
margin-right: 7px; margin-right: 7px;
} }
.from-label {
margin-bottom: 0;
overflow: hidden;
}
.customer-box {
display: flex;
.customer-input {
flex: 1;
}
.customer-btn {
display: inline-block;
padding: 0 4px;
color: @primary-color;
cursor: pointer;
margin-top: -3px;
}
}
</style> </style>

@ -102,6 +102,49 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </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>联系人信息</span></p> <p class="CsFormTitle"><span>联系人信息</span></p>
<vxe-toolbar> <vxe-toolbar>
<template #buttons> <template #buttons>
@ -242,7 +285,8 @@ export default {
ContactsData: [], ContactsData: [],
Data: {}, Data: {},
TypeData: [], TypeData: [],
propStringData: [] propStringData: [],
saleUserList: []
} }
}, },
watch: { watch: {
@ -256,33 +300,51 @@ export default {
methods: { methods: {
init() { init() {
DjyCustomerDetail({ id: this.$route.query.id }).then(res => { DjyCustomerDetail({ id: this.$route.query.id }).then(res => {
this.Data = res.data if (res.data) {
let WpropString = [] this.Data = res.data
if (res.data.propString) { let WpropString = []
res.data.propString.split(']').forEach(item => { if (res.data.propString) {
if (item.split('[')[1]) { res.data.propString.split(']').forEach(item => {
WpropString.push(item.split('[')[1]) if (item.split('[')[1]) {
} WpropString.push(item.split('[')[1])
}) }
} })
res.data.contacts.forEach((item, index) => { }
item.WebKey = index + 1 res.data.contacts.forEach((item, index) => {
}) item.WebKey = index + 1
this.ContactsData = res.data.contacts
if (WpropString.length) {
this.form.setFieldsValue({
...res.data,
WpropString
})
} else {
this.form.setFieldsValue({
...res.data
}) })
this.ContactsData = res.data.contacts
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.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')
}, },
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() { removeCheckboxRow() {
this.$refs.xTable.selection.forEach(item => { this.$refs.xTable.selection.forEach(item => {
this.ContactsData.forEach((item2, index2) => { this.ContactsData.forEach((item2, index2) => {
@ -357,19 +419,37 @@ export default {
propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`) propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
}) })
} }
let Arr = ['sale', 'op', 'doc', 'custservice']
DjyCustomerEdit({ ...this.Data, ...values, propString: propString, contacts: this.ContactsData }) GetSysUserPage()
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success('编辑成功') let saleUserList = res.data
this.confirmLoading = false Arr.forEach(item => {
this.$emit('ok', values) if (values[`${item}id`]) {
} else { saleUserList.forEach(i => {
this.$message.error(`编辑失败,${res.message}`) if (i.id == values[`${item}id`]) {
values[item] = i.name
}
})
}
})
DjyCustomerEdit({ ...this.Data, ...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
})
} }
}) })
.finally(res => { .catch(err => {
this.confirmLoading = false console.log(err)
}) })
} else { } else {
this.confirmLoading = false this.confirmLoading = false

Loading…
Cancel
Save