|
@@ -619,7 +619,7 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="物流时间" prop="delivery_day">
|
|
|
+ <el-form-item label="物流时间" prop="delivery_day" style="padding-bottom:1px">
|
|
|
<digital-input
|
|
|
:values="ruleForm.delivery_day"
|
|
|
:placeholder="'物流时间'"
|
|
@@ -637,7 +637,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="供货周期" prop="lead_time">
|
|
|
+ <el-form-item label="供货周期" prop="lead_time" style="padding-bottom:1px">
|
|
|
<digital-input
|
|
|
:values="ruleForm.lead_time"
|
|
|
:placeholder="'物流时间'"
|
|
@@ -655,7 +655,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="调样周期" prop="sample_day">
|
|
|
+ <el-form-item label="调样周期" prop="sample_day" style="padding-bottom:1px">
|
|
|
<digital-input
|
|
|
:values="ruleForm.sample_day"
|
|
|
:placeholder="'调样周期'"
|
|
@@ -674,25 +674,29 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="发货地" prop="delivery_place">
|
|
|
- <select-area
|
|
|
- :placeholder="'发货地'"
|
|
|
- :value="ruleForm.delivery_place"
|
|
|
- :is-detail="id !== 'add'"
|
|
|
+ <search-area
|
|
|
+ :value="areaInfo.delivery_place.code"
|
|
|
+ :is-detail="true"
|
|
|
+ size="mini"
|
|
|
:disabled="type === 'view' || type === 'editCoin'"
|
|
|
- :size="'mini'"
|
|
|
- @selectChange="selectAreaChange($event, 'delivery_place')"
|
|
|
+ :names="areaInfo.delivery_place.label"
|
|
|
+ placeholder="收货省市区"
|
|
|
+ :level="3"
|
|
|
+ @searchChange="areaChange($event, 'delivery_place')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="产地" prop="origin_place">
|
|
|
- <select-area
|
|
|
- :placeholder="'产地'"
|
|
|
- :value="ruleForm.origin_place"
|
|
|
- :size="'mini'"
|
|
|
- :is-detail="id !== 'add'"
|
|
|
+ <search-area
|
|
|
+ :value="areaInfo.origin_place.code"
|
|
|
:disabled="type === 'view' || type === 'editCoin'"
|
|
|
- @selectChange="selectAreaChange($event, 'origin_place')"
|
|
|
+ :is-detail="true"
|
|
|
+ size="mini"
|
|
|
+ :names="areaInfo.origin_place.label"
|
|
|
+ placeholder="收货省市区"
|
|
|
+ :level="3"
|
|
|
+ @searchChange="areaChange($event, 'origin_place')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -1104,6 +1108,16 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ areaInfo:{
|
|
|
+ delivery_place:{
|
|
|
+ code:[],
|
|
|
+ label:[]
|
|
|
+ },
|
|
|
+ origin_place:{
|
|
|
+ code:[],
|
|
|
+ label:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
spec_tableData: [],
|
|
|
is_support_stock: "",
|
|
|
cat_id_name: "",
|
|
@@ -1146,6 +1160,22 @@ export default {
|
|
|
this.$nextTick(() => this.onCompanyChange()) //MARK
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getArea(prop = "delivery_place") {
|
|
|
+ const chunks = this.sitem[prop].split(",");
|
|
|
+ let { data: province } = await asyncRequest.province();
|
|
|
+ province = province.find(({ province_code }) => province_code === chunks[0]);
|
|
|
+ let { data: city } = await asyncRequest.city({ code: chunks[0] });
|
|
|
+ city = city.find(({ city_code }) => city_code === chunks[1]);
|
|
|
+ let { data: area } = await asyncRequest.area({ code: chunks[1] });
|
|
|
+ return area.find(({ area_code }) => area_code === chunks[2]) || {};
|
|
|
+ },
|
|
|
+ async areaChange(e,key) {
|
|
|
+ const { code, area_code, label } = e
|
|
|
+ this.ruleForm[key] = code ? code.split(',') : []
|
|
|
+ this.areaInfo[key].code = area_code ? [area_code] : []
|
|
|
+ this.areaInfo[key].label = label ? [label] : []
|
|
|
+ this.$refs.ruleForm.validateField(key)
|
|
|
+ },
|
|
|
onCompanyChange(){ //MARK
|
|
|
// this.ruleForm.supplierNo = this.currentCompany
|
|
|
this.supplierNosearchChange({code: this.currentCompany})
|
|
@@ -1790,6 +1820,17 @@ export default {
|
|
|
stock_moq,
|
|
|
is_support_stock,
|
|
|
} = this.sitem;
|
|
|
+
|
|
|
+
|
|
|
+ if(this.type !== 'add'){
|
|
|
+ const {name, area_code} = await this.getArea('delivery_place')
|
|
|
+ this.areaInfo.delivery_place.label = [name]
|
|
|
+ this.areaInfo.delivery_place.code = [area_code]
|
|
|
+ const {name:_name, area_code:_area_code} = await this.getArea('origin_place')
|
|
|
+ this.areaInfo.origin_place.label = [_name]
|
|
|
+ this.areaInfo.origin_place.code = [_area_code]
|
|
|
+ }
|
|
|
+
|
|
|
this.is_support_stock = is_support_stock || "1";
|
|
|
let cat_id_name = "";
|
|
|
let cat_id = [];
|
|
@@ -1908,8 +1949,11 @@ export default {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- this.ruleForm.supplierNo = this.currentCompany
|
|
|
- this.$refs.ruleForm.validateField('supplierNo');
|
|
|
+ if(this.type === 'add'){
|
|
|
+ this.ruleForm.supplierNo = this.currentCompany
|
|
|
+ this.$refs.ruleForm.validateField('supplierNo');
|
|
|
+ }
|
|
|
+
|
|
|
await this.set_must_spec();
|
|
|
});
|
|
|
},
|
|
@@ -1978,7 +2022,7 @@ export default {
|
|
|
},
|
|
|
//商品分类选择
|
|
|
async goods_class_change(e) {
|
|
|
- const { code, is_gold, id, label, cat_desc } = e;
|
|
|
+ const { code, is_gold, id, label, cat_desc, pid } = e;
|
|
|
this.spec_tableData = []
|
|
|
|
|
|
if(is_gold){
|