|
@@ -40,21 +40,21 @@
|
|
<a-col span="8">
|
|
<a-col span="8">
|
|
<a-form-model-item prop="provinceSn">
|
|
<a-form-model-item prop="provinceSn">
|
|
<a-select id="customerManagementEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
|
|
<a-select id="customerManagementEdit-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-option v-for="item in addrProvinceList" :value="item.sn" :key="item.sn + 'a'">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col span="8">
|
|
<a-col span="8">
|
|
<a-form-model-item prop="citySn">
|
|
<a-form-model-item prop="citySn">
|
|
<a-select id="customerManagementEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
|
|
<a-select id="customerManagementEdit-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-option v-for="item in addrCityList" :value="item.sn" :key="item.sn + 'b'">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col span="8">
|
|
<a-col span="8">
|
|
<a-form-model-item prop="countySn">
|
|
<a-form-model-item prop="countySn">
|
|
<a-select id="customerManagementEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
|
|
<a-select id="customerManagementEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
|
|
- <a-select-option v-for="item in addrAreaList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
|
|
|
+ <a-select-option v-for="item in addrDistrictList" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -86,13 +86,7 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
<a-form-model-item label="是否卫星仓客户" prop="satelliteFlag">
|
|
<a-form-model-item label="是否卫星仓客户" prop="satelliteFlag">
|
|
- <v-select
|
|
|
|
- code="DISPATCH_FASHION"
|
|
|
|
- id="customerManagementEdit-satelliteFlag"
|
|
|
|
- v-model="form.satelliteFlag"
|
|
|
|
- allowClear
|
|
|
|
- placeholder="请选择"
|
|
|
|
- ></v-select>
|
|
|
|
|
|
+ <span style="padding-left: 11px;">{{ form.satelliteFlag == 1 ? '是' : '否' }}</span>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -104,26 +98,26 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
<a-form-model-item label="支付方式" prop="payType">
|
|
<a-form-model-item label="支付方式" prop="payType">
|
|
- <v-select code="PAY_FASHION" id="customerManagementEdit-payType" v-model="form.payType" allowClear placeholder="请选择支付方式" />
|
|
|
|
|
|
+ <v-select code="PAY_TYPE" id="customerManagementEdit-payType" v-model="form.payType" allowClear placeholder="请选择支付方式" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
<a-form-model-item label="收款方式" prop="settleStyleSn">
|
|
<a-form-model-item label="收款方式" prop="settleStyleSn">
|
|
- <v-select code="RECEIPT_PAYMENT" id="customerManagementEdit-settleStyleSn" v-model="form.settleStyleSn" allowClear placeholder="请选择收款方式"></v-select>
|
|
|
|
|
|
+ <v-select code="SETTLE_STYLE_NAME" id="customerManagementEdit-settleStyleSn" v-model="form.settleStyleSn" allowClear placeholder="请选择收款方式"></v-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
- <a-form-model-item label="客户类型" prop="custType">
|
|
|
|
- <a-select id="customerManagementEdit-custType" v-model="form.customerTypeSn" allowClear placeholder="请选择客户类型">
|
|
|
|
- <a-select-option v-for="item in custTypeList" :value="item.id" :key="item.id">{{ item.name }}</a-select-option>
|
|
|
|
|
|
+ <a-form-model-item label="客户类型" prop="customerTypeSn">
|
|
|
|
+ <a-select id="customerManagementEdit-customerTypeSn" v-model="form.customerTypeSn" allowClear placeholder="请选择客户类型">
|
|
|
|
+ <a-select-option v-for="item in custTypeList" :value="item.customersTypeSn" :key="item.customersTypeSn">{{ item.customersTypeName }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
|
|
<a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
|
|
- <a-button type="primary" @click="handleSubmit" id="customerManagementEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="handleSubmit" size="large" id="customerManagementEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
</a-card>
|
|
</a-card>
|
|
@@ -149,11 +143,11 @@ export default {
|
|
contactTel: '', // 联系电话
|
|
contactTel: '', // 联系电话
|
|
contactName: '', // 联系人
|
|
contactName: '', // 联系人
|
|
provinceSn: undefined, // 省
|
|
provinceSn: undefined, // 省
|
|
- province: '',
|
|
|
|
|
|
+ provinceName: '',
|
|
citySn: undefined, // 市
|
|
citySn: undefined, // 市
|
|
- city: '',
|
|
|
|
|
|
+ cityName: '',
|
|
countySn: undefined, // 区
|
|
countySn: undefined, // 区
|
|
- area: '',
|
|
|
|
|
|
+ countyName: '',
|
|
customerAddr: '', // 详细地址
|
|
customerAddr: '', // 详细地址
|
|
fax: '', // 客户传真
|
|
fax: '', // 客户传真
|
|
dispatchType: '', // 配送方式
|
|
dispatchType: '', // 配送方式
|
|
@@ -176,7 +170,7 @@ export default {
|
|
},
|
|
},
|
|
addrProvinceList: [], // 省下拉
|
|
addrProvinceList: [], // 省下拉
|
|
addrCityList: [], // 市下拉
|
|
addrCityList: [], // 市下拉
|
|
- addrAreaList: [], // 区下拉
|
|
|
|
|
|
+ addrDistrictList: [], // 区下拉
|
|
custTypeList: [] // 客户类型 下拉数据
|
|
custTypeList: [] // 客户类型 下拉数据
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -185,7 +179,9 @@ export default {
|
|
getDetail () {
|
|
getDetail () {
|
|
custFindById({ id: this.$route.params.id }).then(res => {
|
|
custFindById({ id: this.$route.params.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- // this.detailsData = res.data
|
|
|
|
|
|
+ if (res.data.provinceSn) { this.getArea('city', res.data.provinceSn) }
|
|
|
|
+ if (res.data.citySn) { this.getArea('district', res.data.citySn) }
|
|
|
|
+ this.form = Object.assign(this.form, res.data)
|
|
} else {
|
|
} else {
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
}
|
|
}
|
|
@@ -207,10 +203,6 @@ export default {
|
|
if (valid) {
|
|
if (valid) {
|
|
const form = _this.form
|
|
const form = _this.form
|
|
form.id = this.$route.params.id ? this.$route.params.id : null
|
|
form.id = this.$route.params.id ? this.$route.params.id : null
|
|
- const areas = [ form.provinceSn, form.citySn, form.countySn ]
|
|
|
|
- form.areas = areas.join(',')
|
|
|
|
- delete form.provinceSn
|
|
|
|
- delete form.citySn
|
|
|
|
console.log(form, '-----提交信息')
|
|
console.log(form, '-----提交信息')
|
|
custSave(form).then(res => {
|
|
custSave(form).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -230,59 +222,71 @@ export default {
|
|
handleBack () {
|
|
handleBack () {
|
|
this.$router.push({ path: '/customerManagement/customerInfo/list' })
|
|
this.$router.push({ path: '/customerManagement/customerInfo/list' })
|
|
},
|
|
},
|
|
- // 获取城市列表
|
|
|
|
- getCityList (val) {
|
|
|
|
- this.addrCityList = []
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- this.form.cityCode = undefined
|
|
|
|
- this.form.districtCode = undefined
|
|
|
|
- this.form.address = ''
|
|
|
|
- this.getArea('city', val)
|
|
|
|
- },
|
|
|
|
- // 获取区县列表
|
|
|
|
- getAreaList (val) {
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- this.form.districtCode = undefined
|
|
|
|
- this.form.address = ''
|
|
|
|
- this.getArea('district', val)
|
|
|
|
- },
|
|
|
|
- // 区县变更
|
|
|
|
- areaCharged (val) {
|
|
|
|
- this.form.address = ''
|
|
|
|
- },
|
|
|
|
- // 省/市/区
|
|
|
|
- getArea (type, sn) {
|
|
|
|
- let params
|
|
|
|
- if (type == 'province') {
|
|
|
|
- params = { level: '1' }
|
|
|
|
- } else {
|
|
|
|
- params = { psn: sn }
|
|
|
|
- }
|
|
|
|
- getArea(params).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- if (type == 'province') {
|
|
|
|
- this.addrProvinceList = res.data || []
|
|
|
|
- } else if (type == 'city') {
|
|
|
|
- this.addrCityList = res.data || []
|
|
|
|
- } else if (type == 'district') {
|
|
|
|
- this.addrDistrictList = res.data || []
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (type == 'province') {
|
|
|
|
- this.addrProvinceList = []
|
|
|
|
- } else if (type == 'city') {
|
|
|
|
- this.addrCityList = []
|
|
|
|
- } else if (type == 'district') {
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ // 获取城市列表
|
|
|
|
+ getCityList (val) {
|
|
|
|
+ const index = this.addrProvinceList.findIndex(item => item.sn == val)
|
|
|
|
+ if (index >= 0) {
|
|
|
|
+ this.form.provinceName = this.addrProvinceList[index].name
|
|
|
|
+ }
|
|
|
|
+ this.addrCityList = []
|
|
|
|
+ this.addrDistrictList = []
|
|
|
|
+ this.form.citySn = undefined
|
|
|
|
+ this.form.countySn = undefined
|
|
|
|
+ this.form.customerAddr = ''
|
|
|
|
+ this.getArea('city', val)
|
|
|
|
+ },
|
|
|
|
+ // 获取区县列表
|
|
|
|
+ getAreaList (val) {
|
|
|
|
+ const index = this.addrCityList.findIndex(item => item.sn == val)
|
|
|
|
+ if (index >= 0) {
|
|
|
|
+ this.form.cityName = this.addrCityList[index].name
|
|
|
|
+ }
|
|
|
|
+ this.addrDistrictList = []
|
|
|
|
+ this.form.countySn = undefined
|
|
|
|
+ this.form.customerAddr = ''
|
|
|
|
+ this.getArea('district', val)
|
|
|
|
+ },
|
|
|
|
+ // 区县变更
|
|
|
|
+ areaCharged (val) {
|
|
|
|
+ const index = this.addrDistrictList.findIndex(item => item.sn == val)
|
|
|
|
+ if (index >= 0) {
|
|
|
|
+ this.form.countyName = this.addrDistrictList[index].name
|
|
|
|
+ }
|
|
|
|
+ this.form.customerAddr = ''
|
|
|
|
+ },
|
|
|
|
+ // 省/市/区
|
|
|
|
+ getArea (type, sn) {
|
|
|
|
+ let params
|
|
|
|
+ if (type == 'province') {
|
|
|
|
+ params = { level: '1' }
|
|
|
|
+ } else {
|
|
|
|
+ params = { psn: sn }
|
|
|
|
+ }
|
|
|
|
+ getArea(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ if (type == 'province') {
|
|
|
|
+ this.addrProvinceList = res.data || []
|
|
|
|
+ } else if (type == 'city') {
|
|
|
|
+ this.addrCityList = res.data || []
|
|
|
|
+ } else if (type == 'district') {
|
|
|
|
+ this.addrDistrictList = res.data || []
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (type == 'province') {
|
|
|
|
+ this.addrProvinceList = []
|
|
|
|
+ } else if (type == 'city') {
|
|
|
|
+ this.addrCityList = []
|
|
|
|
+ } else if (type == 'district') {
|
|
|
|
+ this.addrDistrictList = []
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
vm.getArea('province') // 省市区
|
|
vm.getArea('province') // 省市区
|
|
- // vm.getCustTypeList() // 客户类型
|
|
|
|
|
|
+ vm.getCustTypeList() // 客户类型
|
|
vm.$refs.ruleForm.resetFields()
|
|
vm.$refs.ruleForm.resetFields()
|
|
if (vm.$route.params.id) {
|
|
if (vm.$route.params.id) {
|
|
// 编辑页
|
|
// 编辑页
|