|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<div class="supplierInfoEdit-wrap">
|
|
|
- <a-page-header :ghost="false" @back="handleBack" class="supplierInfoEdit-cont">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="merchantInfoManagementEdit-cont">
|
|
|
<!-- 自定义的二级文字标题 -->
|
|
|
<template slot="subTitle">
|
|
|
- <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
|
|
|
+ <a id="merchantInfoManagement-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
<a-form-model
|
|
@@ -29,23 +29,23 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="联系人1" prop="productTypeName">
|
|
|
- <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="30" allowClear placeholder="请输入联系人1(最多30个字符)" />
|
|
|
+ <a-form-model-item label="联系人1" prop="contact">
|
|
|
+ <a-input v-model.trim="form.contact" id="supplierInfoEdit-contact" :maxLength="30" allowClear placeholder="请输入联系人1(最多30个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="联系手机1" prop="productTypeName">
|
|
|
- <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="11" allowClear placeholder="请输入联系手机1(最多11个字符)" />
|
|
|
+ <a-form-model-item label="联系手机1" prop="contactMobile">
|
|
|
+ <a-input v-model.trim="form.contactMobile" id="supplierInfoEdit-contactMobile" :maxLength="11" allowClear placeholder="请输入联系手机1(最多11个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="联系角色1" prop="productTypeName">
|
|
|
- <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="30" allowClear placeholder="请输入联系角色1(最多30个字符)" />
|
|
|
+ <a-form-model-item label="联系角色1" prop="contactRole">
|
|
|
+ <a-input v-model.trim="form.contactRole" id="supplierInfoEdit-contactRole" :maxLength="30" allowClear placeholder="请输入联系角色1(最多30个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="联系电话" prop="productTypeName">
|
|
|
- <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="11" allowClear placeholder="请输入联系电话(最多11个字符)" />
|
|
|
+ <a-form-model-item label="联系电话" prop="supplierTelephone">
|
|
|
+ <a-input v-model.trim="form.supplierTelephone" id="supplierInfoEdit-supplierTelephone" :maxLength="13" allowClear placeholder="请输入联系电话" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
|
|
@@ -55,21 +55,21 @@
|
|
|
<a-col span="8">
|
|
|
<a-form-model-item prop="provinceSn">
|
|
|
<a-select id="supplierInfoEdit-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="supplierInfoEdit-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="countySn">
|
|
|
- <a-select id="supplierInfoEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
|
|
|
- <a-select-option v-for="item in addrDistrictList" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
|
|
|
+ <a-form-model-item prop="districtSn">
|
|
|
+ <a-select id="supplierInfoEdit-districtSn" @change="areaCharged" v-model="form.districtSn" placeholder="请选择区/县">
|
|
|
+ <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>
|
|
@@ -77,20 +77,20 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="详细地址" prop="supplierAddress">
|
|
|
+ <a-form-model-item label="详细地址" prop="address">
|
|
|
<a-input
|
|
|
- id="supplierInfoEdit-supplierAddress"
|
|
|
+ id="supplierInfoEdit-address"
|
|
|
:maxLength="60"
|
|
|
- v-model="form.supplierAddress"
|
|
|
+ v-model="form.address"
|
|
|
placeholder="请输入详细地址(最多60个字符)"
|
|
|
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="supplierAddress">
|
|
|
+ <a-form-model-item label="生产周期(天)" prop="produceCycle">
|
|
|
<a-input-number
|
|
|
- id="supplierInfoEdit-name"
|
|
|
- v-model="form.storageQuantity"
|
|
|
+ id="supplierInfoEdit-produceCycle"
|
|
|
+ v-model="form.produceCycle"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
:max="999999"
|
|
@@ -99,10 +99,10 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="配送周期(天)" prop="supplierAddress">
|
|
|
+ <a-form-model-item label="配送周期(天)" prop="deliveryCycle">
|
|
|
<a-input-number
|
|
|
- id="supplierInfoEdit-name"
|
|
|
- v-model="form.storageQuantity"
|
|
|
+ id="supplierInfoEdit-deliveryCycle"
|
|
|
+ v-model="form.deliveryCycle"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
:max="999999"
|
|
@@ -111,10 +111,10 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="贷款结算周期(天)" prop="supplierAddress">
|
|
|
+ <a-form-model-item label="贷款结算周期(天)" prop="settleCycle">
|
|
|
<a-input-number
|
|
|
- id="supplierInfoEdit-name"
|
|
|
- v-model="form.storageQuantity"
|
|
|
+ id="supplierInfoEdit-settleCycle"
|
|
|
+ v-model="form.settleCycle"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
:max="999999"
|
|
@@ -123,11 +123,11 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="是否合作" prop="enabledFlag">
|
|
|
+ <a-form-model-item label="是否合作" prop="cooperateFlag">
|
|
|
<a-radio-group
|
|
|
name="radioGroup"
|
|
|
- v-model="form.enabledFlag"
|
|
|
- id="supplierInfoEdit-enabledFlag" >
|
|
|
+ v-model="form.cooperateFlag"
|
|
|
+ id="supplierInfoEdit-cooperateFlag" >
|
|
|
<a-radio :value="1">是</a-radio>
|
|
|
<a-radio :value="0">否</a-radio>
|
|
|
</a-radio-group>
|
|
@@ -143,20 +143,20 @@
|
|
|
<a-collapse-panel key="1" header="扩展信息">
|
|
|
<a-row>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="经营方式" prop="productTypeName" help="(例:国有企业)">
|
|
|
+ <a-form-model-item label="经营方式" prop="busniessMode" help="(例:国有企业)">
|
|
|
<a-input
|
|
|
- v-model.trim="form.productTypeName"
|
|
|
- id="supplierInfoEdit-name"
|
|
|
+ v-model.trim="form.busniessMode"
|
|
|
+ id="supplierInfoEdit-busniessMode"
|
|
|
:maxLength="30"
|
|
|
allowClear
|
|
|
placeholder="请输入经营方式(最多30个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="公司规模" prop="productTypeName" help="(例:100-999人)">
|
|
|
+ <a-form-model-item label="公司规模" prop="busniessScope" help="(例:100-999人)">
|
|
|
<a-input-number
|
|
|
- id="supplierInfoEdit-name"
|
|
|
- v-model="form.storageQuantity"
|
|
|
+ id="supplierInfoEdit-busniessScope"
|
|
|
+ v-model="form.busniessScope"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
:max="999999"
|
|
@@ -165,68 +165,68 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="成立时间" prop="productTypeName">
|
|
|
+ <a-form-model-item label="成立时间" prop="buildDate">
|
|
|
<a-date-picker
|
|
|
style="width:100%"
|
|
|
- id="supplierInfoEdit-time"
|
|
|
+ id="supplierInfoEdit-buildDate"
|
|
|
:disabledDate="disabledDate"
|
|
|
- v-model="form.time"
|
|
|
+ v-model="form.buildDate"
|
|
|
:format="dateFormat"
|
|
|
placeholder="请选择日期" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="银行账户" prop="productTypeName" help="(例:张三)">
|
|
|
+ <a-form-model-item label="银行账户" prop="tradeAccountName" help="(例:张三)">
|
|
|
<a-input
|
|
|
- v-model.trim="form.productTypeName"
|
|
|
- id="supplierInfoEdit-name"
|
|
|
+ v-model.trim="form.tradeAccountName"
|
|
|
+ id="supplierInfoEdit-tradeAccountName"
|
|
|
:maxLength="30"
|
|
|
allowClear
|
|
|
placeholder="请输入银行账户(最多30个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="开户行" prop="productTypeName" help="(例:交通银行)">
|
|
|
+ <a-form-model-item label="开户行" prop="tradeBankName" help="(例:交通银行)">
|
|
|
<a-input
|
|
|
- v-model.trim="form.productTypeName"
|
|
|
- id="supplierInfoEdit-name"
|
|
|
+ v-model.trim="form.tradeBankName"
|
|
|
+ id="supplierInfoEdit-tradeBankName"
|
|
|
:maxLength="30"
|
|
|
allowClear
|
|
|
placeholder="请输入开户行(最多30个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="银行账号" prop="productTypeName" help="(例:1123 5677 1112 22342 1123)">
|
|
|
+ <a-form-model-item label="银行账号" prop="tradeBankAccount" help="(例:1123 5677 1112 22342 1123)">
|
|
|
<a-input
|
|
|
- v-model.trim="form.productTypeName"
|
|
|
- id="supplierInfoEdit-name"
|
|
|
+ v-model.trim="form.tradeBankAccount"
|
|
|
+ id="supplierInfoEdit-tradeBankAccount"
|
|
|
:maxLength="30"
|
|
|
allowClear
|
|
|
placeholder="请输入银行账号(最多30个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="联系人2" prop="productTypeName">
|
|
|
- <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="30" allowClear placeholder="请输入联系人2(最多30个字符)" />
|
|
|
+ <a-form-model-item label="联系人2" prop="contact2">
|
|
|
+ <a-input v-model.trim="form.contact2" id="supplierInfoEdit-contact2" :maxLength="30" allowClear placeholder="请输入联系人2(最多30个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="联系手机2" prop="productTypeName">
|
|
|
- <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="11" allowClear placeholder="请输入联系手机2(最多11个字符)" />
|
|
|
+ <a-form-model-item label="联系手机2" prop="contactMobile2">
|
|
|
+ <a-input v-model.trim="form.contactMobile2" id="supplierInfoEdit-contactMobile2" :maxLength="11" allowClear placeholder="请输入联系手机2(最多11个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
|
|
|
- <a-form-model-item label="联系角色2" prop="productTypeName">
|
|
|
- <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="30" allowClear placeholder="请输入联系角色2(最多30个字符)" />
|
|
|
+ <a-form-model-item label="联系角色2" prop="contactRole2">
|
|
|
+ <a-input v-model.trim="form.contactRole2" id="supplierInfoEdit-contactRole2" :maxLength="30" allowClear placeholder="请输入联系角色2(最多30个字符)" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
|
|
|
- <a-form-model-item label="备注" prop="enabledFlag" :label-col="{span:4}" :wrapper-col="{span:20}">
|
|
|
+ <a-form-model-item label="备注" prop="remark" :label-col="{span:4}" :wrapper-col="{span:20}">
|
|
|
<a-textarea
|
|
|
- id="merchantInfoManagementEdit-supplierAddress"
|
|
|
- :maxLength="30"
|
|
|
- v-model="form.supplierAddress"
|
|
|
- placeholder="请输入箭冠汽配代码(最多30个字符)"
|
|
|
+ id="merchantInfoManagementEdit-remark"
|
|
|
+ :maxLength="300"
|
|
|
+ v-model="form.remark"
|
|
|
+ placeholder="请输入备注(最多300字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
@@ -245,10 +245,10 @@
|
|
|
|
|
|
<script>
|
|
|
import { getArea } from '@/api/data'
|
|
|
-import { VSelect, Upload } from '@/components'
|
|
|
-import Editor from '@/components/WEeditor'
|
|
|
+import { VSelect } from '@/components'
|
|
|
+import { supplierDetail, supplierSave } from '@/api/supplier.js'
|
|
|
export default {
|
|
|
- components: { VSelect, Upload, Editor },
|
|
|
+ components: { VSelect },
|
|
|
data () {
|
|
|
return {
|
|
|
formItemLayout: {
|
|
@@ -260,16 +260,67 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
form: {
|
|
|
- time: ''
|
|
|
+ supplierName: '',
|
|
|
+ contact: '',
|
|
|
+ contactMobile: '',
|
|
|
+ contactRole: '',
|
|
|
+ supplierTelephone: '',
|
|
|
+ provinceSn: undefined,
|
|
|
+ citySn: undefined,
|
|
|
+ districtSn: undefined,
|
|
|
+ address: '',
|
|
|
+ produceCycle: '',
|
|
|
+ deliveryCycle: '',
|
|
|
+ settleCycle: '',
|
|
|
+ cooperateFlag: undefined,
|
|
|
+ busniessMode: '',
|
|
|
+ busniessScope: '',
|
|
|
+ buildDate: '',
|
|
|
+ tradeAccountName: '',
|
|
|
+ tradeBankName: '',
|
|
|
+ tradeBankAccount: '',
|
|
|
+ contact2: '',
|
|
|
+ contactMobile2: '',
|
|
|
+ contactRole2: '',
|
|
|
+ remark: ''
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ supplierName: [
|
|
|
+ { required: true, message: '请输入供应商名称', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ contact: [
|
|
|
+ { required: true, message: '请输入联系人1', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ contactMobile: [
|
|
|
+ { required: true, message: '请输入联系手机1', trigger: 'change' },
|
|
|
+ { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' }
|
|
|
+ ],
|
|
|
+ provinceSn: [
|
|
|
+ { required: true, message: '请选择省', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ citySn: [
|
|
|
+ { required: true, message: '请选择市', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ districtSn: [
|
|
|
+ { required: true, message: '请选择区县', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ address: [
|
|
|
+ { required: true, message: '请输入详细地址', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ supplierTelephone: [
|
|
|
+ { pattern: /^[0-9]{11,13}$/, message: '请输入正确的电话号码!' }
|
|
|
+ ],
|
|
|
+ contactMobile2: [
|
|
|
+ { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' }
|
|
|
+ ],
|
|
|
+ cooperateFlag: [
|
|
|
+ { required: true, message: '请选择是否合作', trigger: 'change' }
|
|
|
+ ]
|
|
|
},
|
|
|
- rules: {},
|
|
|
- brandData: [],
|
|
|
addrProvinceList: [], // 省下拉
|
|
|
addrCityList: [], // 市下拉
|
|
|
addrDistrictList: [], // 区下拉
|
|
|
- dateFormat: 'YYYY-MM-DD',
|
|
|
- productBrandList: [], // 品牌下拉数据
|
|
|
- productTypeList: [] // 分类下拉数据
|
|
|
+ dateFormat: 'YYYY-MM-DD'
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -277,84 +328,92 @@ export default {
|
|
|
disabledDate (date, dateStrings) {
|
|
|
return date && date.valueOf() > Date.now()
|
|
|
},
|
|
|
+ // 详情编辑
|
|
|
+ getDetail () {
|
|
|
+ supplierDetail({ sn: this.$route.params.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.form = Object.assign(this.form, res.data)
|
|
|
+ this.form.cooperateFlag = Number(this.form.cooperateFlag)
|
|
|
+ this.getArea('city', this.form.provinceSn)
|
|
|
+ this.getArea('district', this.form.citySn)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 提交
|
|
|
- handleSubmit () {},
|
|
|
+ handleSubmit () {
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ console.log(this.form, 'form data')
|
|
|
+ supplierSave(this.form).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.handleBack()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 返回
|
|
|
handleBack () {
|
|
|
- this.$router.push({ path: '/dealerManagement/supplierInfo/list' })
|
|
|
- },
|
|
|
- // 产品图片上传
|
|
|
- changeHomeImage (file) {
|
|
|
- this.form.homeImage = file
|
|
|
- },
|
|
|
- // 文本编辑器
|
|
|
- editorChange (html, text) {
|
|
|
- this.form.desc = html
|
|
|
- },
|
|
|
- // 产品分类 change
|
|
|
- changeProductType (val, opt) {
|
|
|
- this.form.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
- },
|
|
|
- filterOption (input, option) {
|
|
|
- return (
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- )
|
|
|
+ this.$router.push({ name: 'supplierInfoList' })
|
|
|
},
|
|
|
// 获取城市列表
|
|
|
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
|
|
|
}
|
|
|
this.addrCityList = []
|
|
|
this.addrDistrictList = []
|
|
|
this.form.citySn = undefined
|
|
|
- this.form.countySn = undefined
|
|
|
- this.form.supplierAddress = ''
|
|
|
+ this.form.districtSn = undefined
|
|
|
+ this.form.address = ''
|
|
|
this.getArea('city', val)
|
|
|
},
|
|
|
// 获取区县列表
|
|
|
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
|
|
|
}
|
|
|
this.addrDistrictList = []
|
|
|
- this.form.countySn = undefined
|
|
|
- this.form.supplierAddress = ''
|
|
|
+ this.form.districtSn = undefined
|
|
|
+ this.form.address = ''
|
|
|
this.getArea('district', val)
|
|
|
},
|
|
|
// 区县变更
|
|
|
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.countyName = this.addrDistrictList[index].name
|
|
|
+ this.form.districtName = this.addrDistrictList[index].name
|
|
|
}
|
|
|
- this.form.supplierAddress = ''
|
|
|
+ this.form.address = ''
|
|
|
},
|
|
|
// 省/市/区
|
|
|
- getArea (type, sn) {
|
|
|
+ getArea (leve, sn) {
|
|
|
let params
|
|
|
- if (type == 'province') {
|
|
|
- params = { level: '1' }
|
|
|
+ if (leve == 'province') {
|
|
|
+ params = { type: '2' }
|
|
|
} else {
|
|
|
- params = { psn: sn }
|
|
|
+ params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
|
|
|
}
|
|
|
getArea(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- if (type == 'province') {
|
|
|
+ if (leve == 'province') {
|
|
|
this.addrProvinceList = res.data || []
|
|
|
- } else if (type == 'city') {
|
|
|
+ } else if (leve == 'city') {
|
|
|
this.addrCityList = res.data || []
|
|
|
- } else if (type == 'district') {
|
|
|
+ } else if (leve == 'district') {
|
|
|
this.addrDistrictList = res.data || []
|
|
|
}
|
|
|
} else {
|
|
|
- if (type == 'province') {
|
|
|
+ if (leve == 'province') {
|
|
|
this.addrProvinceList = []
|
|
|
- } else if (type == 'city') {
|
|
|
+ } else if (leve == 'city') {
|
|
|
this.addrCityList = []
|
|
|
- } else if (type == 'district') {
|
|
|
+ } else if (leve == 'district') {
|
|
|
this.addrDistrictList = []
|
|
|
}
|
|
|
}
|
|
@@ -366,7 +425,7 @@ export default {
|
|
|
vm.getArea('province')
|
|
|
vm.$refs.ruleForm.resetFields()
|
|
|
if (vm.$route.params.id) { // 编辑页
|
|
|
- // vm.getGoodsDetail()
|
|
|
+ vm.getDetail()
|
|
|
}
|
|
|
})
|
|
|
}
|