|
|
@@ -138,19 +138,7 @@
|
|
|
unit_id : "",
|
|
|
time_unit_id : "",
|
|
|
},
|
|
|
- operation:{
|
|
|
- operation_type:"入库",
|
|
|
- strategy:"默认",
|
|
|
- discount_count:[''],
|
|
|
- name:"",
|
|
|
- feature:"",
|
|
|
- total_discount_price:[''],
|
|
|
- items : [
|
|
|
- {strategy:"起步",type:"0",discount_price:['']},
|
|
|
- {strategy:"默认",discount_price:['']},
|
|
|
- {strategy:"特征",discount_price:['']},
|
|
|
- ],
|
|
|
- },
|
|
|
+ operation:{},
|
|
|
express:{
|
|
|
name:"",
|
|
|
initial_weight:"",
|
|
|
@@ -214,11 +202,28 @@
|
|
|
if (!this.isLoad && !this.ownerTemp.id) this.isLoad = true;
|
|
|
},0);
|
|
|
}
|
|
|
+ this._resetOperation();
|
|
|
this.ownerTemp = JSON.parse(JSON.stringify(this.owner));
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
|
$("#container").removeClass("d-none");
|
|
|
},
|
|
|
methods:{
|
|
|
+ //重置作业计费数据
|
|
|
+ _resetOperation(){
|
|
|
+ this.model.operation = {
|
|
|
+ operation_type:"入库",
|
|
|
+ strategy:"默认",
|
|
|
+ discount_count:[''],
|
|
|
+ name:"",
|
|
|
+ feature:"",
|
|
|
+ total_discount_price:[''],
|
|
|
+ items : [
|
|
|
+ {strategy:"起步",type:"0",discount_price:['']},
|
|
|
+ {strategy:"默认",discount_price:['']},
|
|
|
+ {strategy:"特征",discount_price:['']},
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
//悬浮效果
|
|
|
hoverEffect(key,val){
|
|
|
this.$set(this.hover,key,val);
|
|
|
@@ -429,8 +434,8 @@
|
|
|
if (operation.total_discount_price) res.owner_price_operations[i].total_discount_price = operation.total_discount_price.split(",");
|
|
|
operation.isDiscount = true;
|
|
|
}
|
|
|
- operation.items.forEach((item,i)=>{
|
|
|
- if (item.discount_price) res.owner_price_operations[i].items[i].discount_price = item.discount_price.split(",");
|
|
|
+ operation.items.forEach((item,j)=>{
|
|
|
+ if (item.discount_price) res.owner_price_operations[i].items[j].discount_price = item.discount_price.split(",");
|
|
|
});
|
|
|
if (operation.total_price)operation.isSingle = true;
|
|
|
});
|
|
|
@@ -687,35 +692,26 @@
|
|
|
res.items[i].features = this.model.operation.items[sign]['features'];
|
|
|
res.items[i].featureFormat = this.model.operation.items[sign]['featureFormat'];
|
|
|
res.items[i].type = this.model.operation.items[sign]['type'];
|
|
|
+ res.items[i].discount_price = res.items[i].discount_price ? res.items[i].discount_price.split(",") : [""];
|
|
|
sign++;
|
|
|
}
|
|
|
if (res.discount_count)res.isDiscount = true;
|
|
|
if (res.total_price)res.isSingle = true;
|
|
|
+
|
|
|
+ res.discount_count = res.discount_count ? res.discount_count.split(",") : [""];
|
|
|
+ res.total_discount_price = res.total_discount_price ? res.total_discount_price.split(",") : [""];
|
|
|
+
|
|
|
if (params.id) this.selectedModel.operation[params.index] = res;
|
|
|
else this.selectedModel.operation.push(res);
|
|
|
- this.model.operation = {
|
|
|
- operation_type:"入库",
|
|
|
- strategy:"默认",
|
|
|
- name:"",
|
|
|
- feature:"",
|
|
|
- items : [
|
|
|
- {strategy:"起步",type:"0"},
|
|
|
- {strategy:"默认"},
|
|
|
- {strategy:"特征"},
|
|
|
- ],
|
|
|
- };
|
|
|
+ this._resetOperation();
|
|
|
this.errors = [];
|
|
|
});
|
|
|
},
|
|
|
_verifyOperationItem(itemIndex){//验证作业费子项信息完整
|
|
|
let obj = this.model.operation.items[itemIndex];
|
|
|
let sign = false;
|
|
|
- if (obj.strategy === '特征' && !obj.feature){
|
|
|
- this.errors['items.'+itemIndex+'.feature'] = ["必须选择特征"];
|
|
|
- sign = true;
|
|
|
- }
|
|
|
- if (this.model.operation.isDiscount && !obj.discount_price){
|
|
|
- this.errors['items.'+itemIndex+'.discount_price'] = ["满减单价不得为空"];
|
|
|
+ if (obj.strategy === '特征' && !obj.feature) {
|
|
|
+ this.errors['items.' + itemIndex + '.feature'] = ["必须选择特征"];
|
|
|
sign = true;
|
|
|
}
|
|
|
if (obj.strategy!=='起步' && !obj.amount){
|