|
@@ -44,22 +44,22 @@
|
|
|
<a-row :gutter="15">
|
|
|
<!-- 客户地址 -->
|
|
|
<a-col span="8">
|
|
|
- <a-form-model-item prop="shippingAddressProvinceSn">
|
|
|
- <a-select id="chooseCustom-provinceSn" @change="getCityList" v-model="form.shippingAddressProvinceSn" placeholder="请选择省">
|
|
|
+ <a-form-model-item prop="provinceSn">
|
|
|
+ <a-select id="chooseCustom-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
|
|
|
<a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col span="8">
|
|
|
- <a-form-model-item prop="shippingAddressCitySn">
|
|
|
- <a-select id="chooseCustom-citySn" @change="getAreaList" v-model="form.shippingAddressCitySn" placeholder="请选择市">
|
|
|
+ <a-form-model-item prop="citySn">
|
|
|
+ <a-select id="chooseCustom-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
|
|
|
<a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col span="8">
|
|
|
- <a-form-model-item prop="shippingAddressCountySn">
|
|
|
- <a-select id="chooseCustom-countySn" @change="areaCharged" v-model="form.shippingAddressCountySn" placeholder="请选择区/县">
|
|
|
+ <a-form-model-item prop="countySn">
|
|
|
+ <a-select id="chooseCustom-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
|
|
|
<a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
@@ -68,11 +68,11 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="8">
|
|
|
- <a-form-model-item label="" prop="shippingAddress">
|
|
|
+ <a-form-model-item label="" prop="customerAddr">
|
|
|
<a-input
|
|
|
- id="chooseCustom-shippingAddress"
|
|
|
+ id="chooseCustom-customerAddr"
|
|
|
:maxLength="60"
|
|
|
- v-model="form.shippingAddress"
|
|
|
+ v-model="form.customerAddr"
|
|
|
placeholder="请输入详细地址(最多60个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
@@ -110,19 +110,6 @@
|
|
|
<a-form-model-item label="开单人">{{ $store.state.user.info.userNameCN }}</a-form-model-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <a-row :gutter="15">
|
|
|
- <a-col :span="8">
|
|
|
- <a-form-model-item label="备注" prop="remarks">
|
|
|
- <a-input
|
|
|
- id="chooseCustom-remarks"
|
|
|
- type="textarea"
|
|
|
- :maxLength="100"
|
|
|
- v-model="form.remarks"
|
|
|
- placeholder="请输入联系电话(最多100个字符)"
|
|
|
- allowClear />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
<a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
|
|
|
<a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
|
|
|
<a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
|
|
@@ -146,8 +133,6 @@
|
|
|
import { getArea } from '@/api/data'
|
|
|
import { custAllList, custFindById, updateByCustomerSn } from '@/api/customer'
|
|
|
import { salesReturnSave } from '@/api/salesReturn'
|
|
|
-import { getUserAllList } from '@/api/power-user'
|
|
|
-import { settleStyleQueryAll } from '@/api/settleStyle'
|
|
|
import { VSelect } from '@/components'
|
|
|
import CustomerManagementEdit from '@/views/customerManagement/customerInfo/edit.vue'
|
|
|
export default {
|
|
@@ -171,16 +156,14 @@ export default {
|
|
|
buyerSn: undefined, // 客户sn
|
|
|
consigneeTel: '', // 联系电话
|
|
|
consigneeName: '', // 联系人
|
|
|
- shippingAddressProvinceSn: undefined, // 省
|
|
|
- shippingAddressProvinceName: '',
|
|
|
- shippingAddressCitySn: undefined, // 市
|
|
|
- shippingAddressCityName: '',
|
|
|
- shippingAddressCountySn: undefined, // 区
|
|
|
- shippingAddressCountyName: '',
|
|
|
- shippingAddress: '', // 详细地址
|
|
|
- grabFlag: '1', // 是否抓单
|
|
|
- salesTragetType: 'C',
|
|
|
- remarks: '' // 备注
|
|
|
+ provinceSn: undefined, // 省
|
|
|
+ provinceName: '',
|
|
|
+ citySn: undefined, // 市
|
|
|
+ cityName: '',
|
|
|
+ countySn: undefined, // 区
|
|
|
+ countyName: '',
|
|
|
+ customerAddr: '', // 详细地址
|
|
|
+ grabFlag: '1' // 是否抓单
|
|
|
},
|
|
|
rules: {
|
|
|
buyerSn: [
|
|
@@ -189,16 +172,16 @@ export default {
|
|
|
consigneeTel: [
|
|
|
{ required: true, message: '请输入联系电话', trigger: 'blur' }
|
|
|
],
|
|
|
- shippingAddressProvinceSn: [
|
|
|
+ provinceSn: [
|
|
|
{ required: true, message: '请选择省', trigger: 'change' }
|
|
|
],
|
|
|
- shippingAddressCitySn: [
|
|
|
+ citySn: [
|
|
|
{ required: true, message: '请选择市', trigger: 'change' }
|
|
|
],
|
|
|
- shippingAddressCountySn: [
|
|
|
+ countySn: [
|
|
|
{ required: true, message: '请选择区/县', trigger: 'change' }
|
|
|
],
|
|
|
- shippingAddress: [
|
|
|
+ customerAddr: [
|
|
|
{ required: true, message: '请输入详细地址', trigger: 'blur' }
|
|
|
],
|
|
|
grabFlag: [
|
|
@@ -233,10 +216,6 @@ export default {
|
|
|
this.custChange(data.customerSn)
|
|
|
}, 300)
|
|
|
},
|
|
|
- // 业务员
|
|
|
- salesManChange (id) {
|
|
|
- this.form.salesManName = this.userList.find(item => item.id == id).name
|
|
|
- },
|
|
|
// 客户 change
|
|
|
custChange (val) {
|
|
|
console.log(val, 'custChange')
|
|
@@ -268,8 +247,8 @@ export default {
|
|
|
console.log(data)
|
|
|
this.title = '编辑客户信息'
|
|
|
this.isEdit = true
|
|
|
- if (data.shippingAddressProvinceSn) { this.getArea('city', data.shippingAddressProvinceSn) }
|
|
|
- if (data.shippingAddressCitySn) { this.getArea('district', data.shippingAddressCitySn) }
|
|
|
+ if (data.provinceSn) { this.getArea('city', data.provinceSn) }
|
|
|
+ if (data.citySn) { this.getArea('district', data.citySn) }
|
|
|
this.form = Object.assign(this.form, data)
|
|
|
this.buyerSnBak = this.form.buyerSn
|
|
|
},
|
|
@@ -285,18 +264,14 @@ export default {
|
|
|
buyerSn: data.customerSn, // 客户sn
|
|
|
consigneeTel: data.contactTel, // 联系电话
|
|
|
consigneeName: data.contactName, // 联系人
|
|
|
- shippingAddressProvinceSn: data.provinceSn, // 省
|
|
|
- shippingAddressProvinceName: data.provinceName,
|
|
|
- shippingAddressCitySn: data.citySn, // 市
|
|
|
- shippingAddressCityName: data.cityName,
|
|
|
- shippingAddressCountySn: data.countySn, // 区
|
|
|
- shippingAddressCountyName: data.countyName,
|
|
|
- shippingAddress: data.customerAddr, // 详细地址
|
|
|
- fax: data.fax, // 客户传真
|
|
|
- dispatchType: data.dispatchType, // 配送方式
|
|
|
- satelliteFlag: data.satelliteFlag, // 是否卫星仓客户
|
|
|
- priceType: data.priceType, // 价格类型
|
|
|
- settleStyleSn: data.settleStyleSn // 收款方式
|
|
|
+ provinceSn: data.provinceSn, // 省
|
|
|
+ provinceName: data.provinceName,
|
|
|
+ citySn: data.citySn, // 市
|
|
|
+ cityName: data.cityName,
|
|
|
+ countySn: data.countySn, // 区
|
|
|
+ countyName: data.countyName,
|
|
|
+ customerAddr: data.customerAddr, // 详细地址
|
|
|
+ fax: data.fax // 客户传真
|
|
|
})
|
|
|
} else {
|
|
|
this.$message.error('获取客户信息失败')
|
|
@@ -312,16 +287,13 @@ export default {
|
|
|
customerSn: this.form.buyerSn,
|
|
|
contactTel: this.form.consigneeTel, // 联系电话
|
|
|
contactName: this.form.consigneeName, // 联系人
|
|
|
- provinceSn: this.form.shippingAddressProvinceSn, // 省
|
|
|
- provinceName: this.form.shippingAddressProvinceName,
|
|
|
- citySn: this.form.shippingAddressCitySn, // 市
|
|
|
- cityName: this.form.shippingAddressCityName,
|
|
|
- countySn: this.form.shippingAddressCountySn, // 区
|
|
|
- countyName: this.form.shippingAddressCountyName,
|
|
|
- customerAddr: this.form.shippingAddress, // 详细地址
|
|
|
- dispatchType: this.form.dispatchType, // 配送方式
|
|
|
- priceType: this.form.priceType, // 价格类型
|
|
|
- settleStyleSn: this.form.settleStyleSn // 收款方式
|
|
|
+ provinceSn: this.form.provinceSn, // 省
|
|
|
+ provinceName: this.form.provinceName,
|
|
|
+ citySn: this.form.citySn, // 市
|
|
|
+ cityName: this.form.cityName,
|
|
|
+ countySn: this.form.countySn, // 区
|
|
|
+ countyName: this.form.countyName,
|
|
|
+ customerAddr: this.form.customerAddr // 详细地址
|
|
|
}
|
|
|
updateByCustomerSn(params).then(res => {
|
|
|
if (res.status != 200) {
|
|
@@ -379,42 +351,32 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 获取业务员列表数据
|
|
|
- getUserAllList () {
|
|
|
- getUserAllList({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.userList = res.data || []
|
|
|
- } else {
|
|
|
- this.userList = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 获取城市列表
|
|
|
getCityList (val) {
|
|
|
console.log(val, '-------------')
|
|
|
this.addrCityList = []
|
|
|
this.addrDistrictList = []
|
|
|
- this.form.shippingAddressCitySn = undefined
|
|
|
- this.form.shippingAddressCityName = ''
|
|
|
- this.form.shippingAddressCountySn = undefined
|
|
|
- this.form.shippingAddressCountyName = ''
|
|
|
- this.form.shippingAddress = ''
|
|
|
- this.form.shippingAddressCountyName = this.addrProvinceList.find(item => item.id == val).name
|
|
|
+ this.form.citySn = undefined
|
|
|
+ this.form.cityName = ''
|
|
|
+ this.form.countySn = undefined
|
|
|
+ this.form.countyName = ''
|
|
|
+ this.form.customerAddr = ''
|
|
|
+ this.form.countyName = this.addrProvinceList.find(item => item.id == val).name
|
|
|
this.getArea('city', val)
|
|
|
},
|
|
|
// 获取区县列表
|
|
|
getAreaList (val) {
|
|
|
this.addrDistrictList = []
|
|
|
- this.form.shippingAddressCountySn = undefined
|
|
|
- this.form.shippingAddressCountyName = ''
|
|
|
- this.form.shippingAddress = ''
|
|
|
- this.form.shippingAddressCityName = this.addrCityList.find(item => item.id == val).name
|
|
|
+ this.form.countySn = undefined
|
|
|
+ this.form.countyName = ''
|
|
|
+ this.form.customerAddr = ''
|
|
|
+ this.form.cityName = this.addrCityList.find(item => item.id == val).name
|
|
|
this.getArea('district', val)
|
|
|
},
|
|
|
// 区县变更
|
|
|
areaCharged (val) {
|
|
|
- this.form.shippingAddress = ''
|
|
|
- this.form.shippingAddressCountyName = this.addrDistrictList.find(item => item.id == val).name
|
|
|
+ this.form.customerAddr = ''
|
|
|
+ this.form.countyName = this.addrDistrictList.find(item => item.id == val).name
|
|
|
},
|
|
|
// 省/市/区
|
|
|
getArea (type, sn) {
|
|
@@ -448,14 +410,6 @@ export default {
|
|
|
return (
|
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
)
|
|
|
- },
|
|
|
- // 获取收款方式
|
|
|
- getSettleStyle () {
|
|
|
- settleStyleQueryAll().then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.settleStyleList = res.data
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -464,8 +418,6 @@ export default {
|
|
|
if (newValue) {
|
|
|
this.getArea('province')
|
|
|
this.getCustAllList()
|
|
|
- this.getUserAllList()
|
|
|
- this.getSettleStyle()
|
|
|
}
|
|
|
}
|
|
|
}
|