feat(采购登记):

1.新增作业规则物料组ITEM_GROUP和质检等级QUALITY_INSPECTION_STATUS
1.如果物料的物料组在作业规则ITEM_GROUP中,设置辅助数量必填标识为Y,并显示辅助数量和辅助单位,且辅助数量必填,否则不显示;
2.提交按钮:提交方法参数修改
This commit is contained in:
leiqiaozhen 2025-03-19 14:47:34 +08:00
parent 3c2255834c
commit 5d4d83a008

View File

@ -212,6 +212,17 @@
</template>
</el-table-column>
<el-table-column prop="unit" label="单位"></el-table-column>
<el-table-column v-if="false" prop="auxiliaryQtyFlag" label="辅助数量必填标识"></el-table-column>
<el-table-column v-if="showFlag" prop="auxiliaryOty" label="辅助数量" width="110">
<template slot-scope="scope">
<el-input v-if="scope.row.auxiliaryQtyFlag === 'Y'" v-model="scope.row.auxiliaryOty" type="number"></el-input>
</template>
</el-table-column>
<el-table-column v-if="showFlag" prop="auxiliaryUnit" label="辅助单位">
<template slot-scope="scope">
<span v-if="scope.row.auxiliaryQtyFlag === 'Y'">{{ scope.row.auxiliaryUnit }}</span>
</template>
</el-table-column>
<el-table-column prop="uebto" label="过量收货比例%" width="130"></el-table-column>
<el-table-column prop="storagLocation" label="到货仓库" width="130">
<template slot-scope="scope">
@ -348,6 +359,7 @@ import {
saveDocumentDetailData
} from "@/api/mes/wms-nalinv/poRegister";
import {fetchList as fetchWarehouseList} from "@/api/wms/warehouse";
import {listByActivityId} from "@/api/admin/activity-option";
export default {
name: 'po-register',
@ -445,6 +457,11 @@ export default {
{ required: true, message: '请选择日期', trigger: 'blur' }
],
},
// 作业规则 物料组 ITEM_GROUP
itemGroups: '',
// 作业规则 质检等级 QUALITY_INSPECTION_STATUS
qualityInspectionStatus: '',
showFlag:false,
page: {
total: 0, // 总页数
currentPage: 1, // 当前页数
@ -453,6 +470,28 @@ export default {
};
},
created() {
// 获取作业规则
let activityId = this.$route.query.ACTIVITY_ID
showLoading()
listByActivityId(activityId)
.then((response) => {
hideLoading()
if (response.data.code != 0) {
return this.$message.error(response.data.msg)
}
for (let i = 0; i < response.data.data.length; i++) {
// 判断 作业规则是否为 ITEM_GROUP物料组;
if (response.data.data[i].optionName == 'ITEM_GROUP') {
this.itemGroups = response.data.data[i].optionValue
} else if (response.data.data[i].optionName == 'QUALITY_INSPECTION_STATUS') {
this.qualityInspectionStatus = response.data.data[i].optionValue
}
}
})
.catch((e) => {
hideLoading()
})
// avue option 翻譯 用
this.getDataDictionary('DOCUMENT_STATE', 'documentStatusList');
this.getDataDictionary('IQC_STATUS', 'iqcStatusList')
@ -520,15 +559,31 @@ export default {
// 检索采购订单明细
searchPoDetailAction(){
let me = this;
me.showFlag = false;
showLoading();
getDetailByPo(me.registerFormObj.po).then(res => {
hideLoading();
me.documentRegisterList = res.data.data;
hideLoading();
// 循环遍历
res.data.data.forEach(o => {
// 判断物料的物料组是否在作业规则中
if (!isBlank(this.itemGroups) && !isBlank(o.itemGroup) ) {
// 把this.itemGroups 以英文,进行分隔,组成
const itemGroupList = this.itemGroups.split(',').map(group => group.trim());
if (itemGroupList.includes(o.itemGroup)) {
o.auxiliaryQtyFlag = 'Y'
me.showFlag = true
} else {
o.auxiliaryQtyFlag = 'N'
}
} else {
o.auxiliaryQtyFlag = 'N'
}
});
me.documentRegisterList = res.data.data;
}).catch(error => {
hideLoading();
});
},
// 添加一行
addRowData(row,index){
let me = this;
@ -621,6 +676,10 @@ export default {
// this.$message.error('物料'+rowObj.matnr+ '、第'+rowObj.bseg+'行收货数量不能为空');
continue;
}
if(!isBlank(rowObj.auxiliaryQtyFlag) && rowObj.auxiliaryQtyFlag === 'Y' && isBlank(rowObj.auxiliaryOty)){
this.$message.error('序号' + rowObj.bseg+ '、物料' + rowObj.matnr +'辅助数量不能为空');
return;
}
let key = rowObj.matnr+'-'+rowObj.bseg;
if(rowObj.state != 'SON' && sumMap.get(key) == undefined){
sumMap.set(key,Number(rowObj.actualQuantity));
@ -646,7 +705,11 @@ export default {
itemDescription: rowObj.itemDesc,
matnr: rowObj.matnr,
applicationsQuantity: rowObj.actualQuantity,
unitOfMeasure: rowObj.unit
unitOfMeasure: rowObj.unit,
auxiliaryQtyFlag: rowObj.auxiliaryQtyFlag,
auxiliaryOty: rowObj.auxiliaryOty,
auxiliaryUnit: rowObj.auxiliaryUnit,
qualityInspectionStatus: me.qualityInspectionStatus
});
}
let successFlag = true;