|
@@ -500,19 +500,7 @@
|
|
|
}
|
|
|
},
|
|
|
itemChange(itemId) {
|
|
|
- let items = this.itemTypeList.flatMap(obj => obj.items);
|
|
|
- let item = items.filter(obj => obj.id == itemId)[0];
|
|
|
- let typeName = item.typeName;
|
|
|
- let checkItem = this.checkItem;
|
|
|
- if ((typeName == '干杂货人工装卸' && checkItem == '特殊车辆') ||
|
|
|
- (typeName == '特殊车辆' && checkItem == '干杂货人工装卸')) {
|
|
|
- this.itemTypeList.filter(obj => obj.id == item.typeId)[0].itemId = ''
|
|
|
- sa.error('不能同时选择干杂货人工装卸和特殊车辆')
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (typeName == '干杂货人工装卸' || typeName == '特殊车辆') {
|
|
|
- this.checkItem = typeName;
|
|
|
- }
|
|
|
+
|
|
|
},
|
|
|
addCar() {
|
|
|
this.china.visible = true;
|
|
@@ -728,24 +716,15 @@
|
|
|
sa.error('载重只能输入数字')
|
|
|
return;
|
|
|
}
|
|
|
- let checkList = this.itemTypeList;
|
|
|
- let chechItem = this.checkItem;
|
|
|
- for (let j in this.needTypeId) {
|
|
|
- let id = this.needTypeId[j];
|
|
|
- for (let i in checkList) {
|
|
|
- let type = checkList[i];
|
|
|
- let typeName = type.name;
|
|
|
- if (id == type.id && !type.itemId && typeName !== '特殊车辆' && typeName !== '干杂货人工装卸') {
|
|
|
- sa.error('选择[' + this.m.goodsName + ']时,[' + typeName + ']必选')
|
|
|
- return;
|
|
|
- }
|
|
|
+
|
|
|
+ let typeList = this.itemTypeList.filter(obj => obj.itemId);
|
|
|
+ let needIds=this.needTypeId;
|
|
|
+ for(let i in needIds){
|
|
|
+ if(typeList.map(obj=>obj.id).indexOf(needIds[i])==-1){
|
|
|
+ sa.error('缺少必选业务');
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
- if (!chechItem && this.m.goodsName == '干杂货') {
|
|
|
- sa.error('请选择特殊车辆或干杂货人工装卸之一')
|
|
|
- return;
|
|
|
- }
|
|
|
- let typeList = this.itemTypeList.filter(obj => obj.itemId);
|
|
|
let list = [];
|
|
|
if (typeList.length == 0) {
|
|
|
sa.error('至少选择一项业务');
|