|
@@ -50,7 +50,7 @@
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
<a-form-model-item label="联系电话" prop="dealerTelephone">
|
|
|
- <a-input v-model.trim="form.dealerTelephone" id="merchantInfoManagementEdit-dealerTelephone" :maxLength="11" allowClear placeholder="请输入联系电话(最多11个字符)" />
|
|
|
+ <a-input v-model.trim="form.dealerTelephone" id="merchantInfoManagementEdit-dealerTelephone" :maxLength="13" allowClear placeholder="请输入联系电话" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
|
|
@@ -60,21 +60,21 @@
|
|
|
<a-col span="8">
|
|
|
<a-form-model-item prop="provinceSn">
|
|
|
<a-select id="merchantInfoManagementEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
|
|
|
- <a-select-option v-for="item in addrProvinceList" :value="item.sn" :key="item.sn + 'a'">{{ item.name }}</a-select-option>
|
|
|
+ <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col span="8">
|
|
|
<a-form-model-item prop="citySn">
|
|
|
<a-select id="merchantInfoManagementEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
|
|
|
- <a-select-option v-for="item in addrCityList" :value="item.sn" :key="item.sn + 'b'">{{ item.name }}</a-select-option>
|
|
|
+ <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col span="8">
|
|
|
<a-form-model-item prop="districtSn">
|
|
|
<a-select id="merchantInfoManagementEdit-districtSn" @change="areaCharged" v-model="form.districtSn" placeholder="请选择区/县">
|
|
|
- <a-select-option v-for="item in addrDistrictList" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
|
|
|
+ <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
@@ -91,17 +91,6 @@
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
- <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="是否可用" prop="enableFlag">
|
|
|
- <a-radio-group
|
|
|
- name="radioGroup"
|
|
|
- v-model="form.enableFlag"
|
|
|
- id="merchantInfoManagementEdit-enableFlag" >
|
|
|
- <a-radio :value="1">是</a-radio>
|
|
|
- <a-radio :value="0">否</a-radio>
|
|
|
- </a-radio-group>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
</a-row>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
@@ -233,7 +222,7 @@
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
<a-form-model-item label="收货电话" prop="receiveMobile">
|
|
|
- <a-input v-model.trim="form.receiveMobile" id="merchantInfoManagementEdit-receiveMobile" :maxLength="30" allowClear placeholder="请输入收货电话(最多30个字符)" />
|
|
|
+ <a-input v-model.trim="form.receiveMobile" id="merchantInfoManagementEdit-receiveMobile" :maxLength="13" allowClear placeholder="请输入收货电话" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
|
|
@@ -243,21 +232,21 @@
|
|
|
<a-col span="8">
|
|
|
<a-form-model-item prop="receiveProvinceSn">
|
|
|
<a-select id="merchantInfoManagementEdit-receiveProvinceSn" @change="getCityList1" v-model="form.receiveProvinceSn" placeholder="请选择省">
|
|
|
- <a-select-option v-for="item in addrProvinceList1" :value="item.sn" :key="item.sn + 'a'">{{ item.name }}</a-select-option>
|
|
|
+ <a-select-option v-for="item in addrProvinceList1" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col span="8">
|
|
|
<a-form-model-item prop="receiveCitySn">
|
|
|
<a-select id="merchantInfoManagementEdit-receiveCitySn" @change="getAreaList1" v-model="form.receiveCitySn" placeholder="请选择市">
|
|
|
- <a-select-option v-for="item in addrCityList1" :value="item.sn" :key="item.sn + 'b'">{{ item.name }}</a-select-option>
|
|
|
+ <a-select-option v-for="item in addrCityList1" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col span="8">
|
|
|
<a-form-model-item prop="receiveDistrictSn">
|
|
|
<a-select id="merchantInfoManagementEdit-receiveDistrictSn" @change="areaCharged1" v-model="form.receiveDistrictSn" placeholder="请选择区/县">
|
|
|
- <a-select-option v-for="item in addrDistrictList1" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
|
|
|
+ <a-select-option v-for="item in addrDistrictList1" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
@@ -371,7 +360,7 @@
|
|
|
<script>
|
|
|
import { getArea } from '@/api/data'
|
|
|
import { VSelect } from '@/components'
|
|
|
-import { dealerSave } from '@/api/dealer'
|
|
|
+import { dealerSave, dealerFindUpdateInfoBySn } from '@/api/dealer'
|
|
|
export default {
|
|
|
components: { VSelect },
|
|
|
data () {
|
|
@@ -385,7 +374,43 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
form: {
|
|
|
- isShowSpecialPrice: 0
|
|
|
+ dealerName: '',
|
|
|
+ dealerAlias: '',
|
|
|
+ dealerType: undefined,
|
|
|
+ contact: '',
|
|
|
+ contactMobile: '',
|
|
|
+ provinceSn: undefined,
|
|
|
+ citySn: undefined,
|
|
|
+ districtSn: undefined,
|
|
|
+ address: '',
|
|
|
+ contactRole: '',
|
|
|
+ dealerTelephone: '',
|
|
|
+ busniessMode: '',
|
|
|
+ busniessItmes: '',
|
|
|
+ busniessScope: '',
|
|
|
+ buildDate: '',
|
|
|
+ isTaxpayer: undefined,
|
|
|
+ indentityCard: '',
|
|
|
+ brithday: '',
|
|
|
+ nativePlace: '',
|
|
|
+ mail: '',
|
|
|
+ contact2: '',
|
|
|
+ contactMobile2: '',
|
|
|
+ contractRole2: '',
|
|
|
+ zipCode: '',
|
|
|
+ receiveContact: '',
|
|
|
+ receiveMobile: '',
|
|
|
+ receiveProvinceSn: undefined,
|
|
|
+ receiveCitySn: undefined,
|
|
|
+ receiveDistrictSn: undefined,
|
|
|
+ receiveAddress: '',
|
|
|
+ tradeAccountName: '',
|
|
|
+ tradeBankName: '',
|
|
|
+ tradeBankAccount: '',
|
|
|
+ jgAutoPartsCode: '',
|
|
|
+ jgDoorHeaderChangeTime: '',
|
|
|
+ isShowSpecialPrice: 0,
|
|
|
+ remark: ''
|
|
|
},
|
|
|
rules: {
|
|
|
dealerName: [
|
|
@@ -401,7 +426,8 @@ export default {
|
|
|
{ required: true, message: '请输入联系人1', trigger: 'change' }
|
|
|
],
|
|
|
contactMobile: [
|
|
|
- { required: true, message: '请输入联系手机1', trigger: 'change' }
|
|
|
+ { required: true, message: '请输入联系手机1', trigger: 'change' },
|
|
|
+ { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' }
|
|
|
],
|
|
|
provinceSn: [
|
|
|
{ required: true, message: '请选择省', trigger: 'change' }
|
|
@@ -414,6 +440,15 @@ export default {
|
|
|
],
|
|
|
address: [
|
|
|
{ required: true, message: '请输入详细地址', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ dealerTelephone: [
|
|
|
+ { pattern: /^[0-9]{11,13}$/, message: '请输入正确的电话号码!' }
|
|
|
+ ],
|
|
|
+ contactMobile2: [
|
|
|
+ { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' }
|
|
|
+ ],
|
|
|
+ receiveMobile: [
|
|
|
+ { pattern: /^[0-9]{11,13}$/, message: '请输入正确的电话号码!' }
|
|
|
]
|
|
|
},
|
|
|
brandData: [],
|
|
@@ -431,6 +466,19 @@ export default {
|
|
|
disabledDate (date, dateStrings) {
|
|
|
return date && date.valueOf() > Date.now()
|
|
|
},
|
|
|
+ // 详情编辑
|
|
|
+ getDetail () {
|
|
|
+ dealerFindUpdateInfoBySn({ sn: this.$route.params.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.form = Object.assign(this.form, res.data)
|
|
|
+ this.form.isShowSpecialPrice = Number(this.form.isShowSpecialPrice)
|
|
|
+ this.getArea('city', this.form.provinceSn, 0)
|
|
|
+ this.getArea('district', this.form.citySn, 0)
|
|
|
+ this.getArea('city', this.form.receiveProvinceSn, 1)
|
|
|
+ this.getArea('district', this.form.receiveCitySn, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 提交
|
|
|
handleSubmit () {
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
@@ -453,7 +501,7 @@ export default {
|
|
|
},
|
|
|
// 获取城市列表
|
|
|
getCityList (val) {
|
|
|
- const index = this.addrProvinceList.findIndex(item => item.sn == val)
|
|
|
+ const index = this.addrProvinceList.findIndex(item => item.areaSn == val)
|
|
|
if (index >= 0) {
|
|
|
this.form.provinceName = this.addrProvinceList[index].name
|
|
|
}
|
|
@@ -466,7 +514,7 @@ export default {
|
|
|
},
|
|
|
// 获取区县列表
|
|
|
getAreaList (val) {
|
|
|
- const index = this.addrCityList.findIndex(item => item.sn == val)
|
|
|
+ const index = this.addrCityList.findIndex(item => item.areaSn == val)
|
|
|
if (index >= 0) {
|
|
|
this.form.cityName = this.addrCityList[index].name
|
|
|
}
|
|
@@ -477,7 +525,7 @@ export default {
|
|
|
},
|
|
|
// 区县变更
|
|
|
areaCharged (val) {
|
|
|
- const index = this.addrDistrictList.findIndex(item => item.sn == val)
|
|
|
+ const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
|
|
|
if (index >= 0) {
|
|
|
this.form.districtName = this.addrDistrictList[index].name
|
|
|
}
|
|
@@ -485,9 +533,9 @@ export default {
|
|
|
},
|
|
|
// 获取城市列表
|
|
|
getCityList1 (val) {
|
|
|
- const index = this.addrProvinceList1.findIndex(item => item.sn == val)
|
|
|
+ const index = this.addrProvinceList1.findIndex(item => item.areaSn == val)
|
|
|
if (index >= 0) {
|
|
|
- this.form.receiveProvinceName = this.addrProvinceList[index].name
|
|
|
+ this.form.receiveProvinceName = this.addrProvinceList1[index].name
|
|
|
}
|
|
|
this.addrCityList1 = []
|
|
|
this.addrDistrictList1 = []
|
|
@@ -498,7 +546,7 @@ export default {
|
|
|
},
|
|
|
// 获取区县列表
|
|
|
getAreaList1 (val) {
|
|
|
- const index = this.addrCityList1.findIndex(item => item.sn == val)
|
|
|
+ const index = this.addrCityList1.findIndex(item => item.areaSn == val)
|
|
|
if (index >= 0) {
|
|
|
this.form.receiveCityName = this.addrCityList1[index].name
|
|
|
}
|
|
@@ -509,7 +557,7 @@ export default {
|
|
|
},
|
|
|
// 区县变更
|
|
|
areaCharged1 (val) {
|
|
|
- const index = this.addrDistrictList1.findIndex(item => item.sn == val)
|
|
|
+ const index = this.addrDistrictList1.findIndex(item => item.areaSn == val)
|
|
|
if (index >= 0) {
|
|
|
this.form.receiveDistrictName = this.addrDistrictList1[index].name
|
|
|
}
|
|
@@ -527,9 +575,7 @@ export default {
|
|
|
if (res.status == 200) {
|
|
|
if (leve == 'province') {
|
|
|
this.addrProvinceList = JSON.parse(JSON.stringify(res.data || []))
|
|
|
- if (index == 1) {
|
|
|
- this.addrProvinceList1 = JSON.parse(JSON.stringify(res.data || []))
|
|
|
- }
|
|
|
+ this.addrProvinceList1 = JSON.parse(JSON.stringify(res.data || []))
|
|
|
} else if (leve == 'city') {
|
|
|
this.addrCityList = JSON.parse(JSON.stringify(res.data || []))
|
|
|
if (index == 1) {
|
|
@@ -544,9 +590,7 @@ export default {
|
|
|
} else {
|
|
|
if (leve == 'province') {
|
|
|
this.addrProvinceList = []
|
|
|
- if (index == 1) {
|
|
|
- this.addrProvinceList1 = []
|
|
|
- }
|
|
|
+ this.addrProvinceList1 = []
|
|
|
} else if (leve == 'city') {
|
|
|
this.addrCityList = []
|
|
|
if (index == 1) {
|
|
@@ -567,7 +611,7 @@ export default {
|
|
|
vm.getArea('province')
|
|
|
vm.$refs.ruleForm.resetFields()
|
|
|
if (vm.$route.params.id) { // 编辑页
|
|
|
- // vm.getGoodsDetail()
|
|
|
+ vm.getDetail()
|
|
|
}
|
|
|
})
|
|
|
}
|