diff --git a/src/views/foodManage/purchaseManage/productionPlan/index.vue b/src/views/foodManage/purchaseManage/productionPlan/index.vue
index 664baabb..e78a8319 100644
--- a/src/views/foodManage/purchaseManage/productionPlan/index.vue
+++ b/src/views/foodManage/purchaseManage/productionPlan/index.vue
@@ -67,7 +67,7 @@
-
+
新增食堂生产计划
@@ -76,18 +76,19 @@
-
+ size="mini" style="margin-left: 20px;"
+ @click="handleBatchPurchasePlan"
+ >合并生成采购计划
-
+
+
{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}
@@ -274,6 +275,7 @@ export default {
dialogTableList: [],
rowData:{},
material_conversion_rounding_method:null,//配置-菜品原料换算取整方式
+ batchList:[],
};
},
created() {
@@ -374,6 +376,43 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {productionPlanRowData:JSON.stringify(row)} });
+ },
+ //批量弹窗勾选
+ handleSelectionChange(selection){
+ this.batchList = selection
+ },
+ /** 合并生成采购计划操作 */
+ handleBatchPurchasePlan(){
+ if(this.batchList&&this.batchList.length>0){
+ console.log(this.batchList)
+ const canteenIdIsSame = this.batchList.every(item => item.canteenId == this.batchList[0].canteenId);
+ const ifBreakDownIsSame = this.batchList.every(item => item.ifBreakDown == false);
+ if(canteenIdIsSame&&ifBreakDownIsSame){//只能选择相同食堂,审批同意且待分解的生产计划
+ this.dialogTableList = [];
+ this.rowData = this.batchList[0]
+ let param = []
+ this.batchList.forEach(item=>{
+ param = param.concat(item.productionPlanGoodsSumVOList)
+ })
+ this.loading2=true;
+ dishesConvertApi(param).then(response => {
+ this.dialogTableList = response;
+ this.dialogTableList.forEach((item)=>{
+ this.$set(item,"rate",0)
+ this.$set(item,"purchaseNum",item.totalConvertWeight)
+ })
+ this.title = "生成采购计划"
+ this.open=true;
+ this.loading2 = false;
+ }).catch(() => {
+ this.loading2 = false;
+ });
+ }else{
+ this.$modal.msgError("只能选择相同食堂,审批同意且待分解的生产计划");
+ }
+ }else{
+ this.$modal.msgError("请先选择生产计划");
+ }
},
/** 生成采购计划操作 */
handlePurchasePlan(row) { //purchaseManage/purchasePlanEdit
@@ -394,7 +433,7 @@ export default {
this.loading2 = false;
});
- },
+ },
// 取消按钮
cancel() {
this.open = false;
diff --git a/src/views/foodManage/purchaseManage/purchaseInspection/edit.vue b/src/views/foodManage/purchaseManage/purchaseInspection/edit.vue
index 3c5f9586..1f25c3c3 100644
--- a/src/views/foodManage/purchaseManage/purchaseInspection/edit.vue
+++ b/src/views/foodManage/purchaseManage/purchaseInspection/edit.vue
@@ -119,24 +119,33 @@
-
+
+
+ {{scope.row.totalQualifiedNum}}
+
+
+
+
-
+
+ {{ scope.row.deliveryNum }}
-
+
-
+
+ {{ scope.row.deliveryNum }}
-
+
-
+
+ {{ scope.row.remark }}
@@ -560,15 +569,17 @@ export default {
}
this.noMaterial = false;
if(this.materialList.length>0){
- this.materialList.forEach(item=>{
- if(item.deliveryNum==0 || item.qualifiedNum==0){
- this.noMaterial = true
- }else{
- let obj = Object.assign({}, item)
- param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
- param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
- param.inspectGoodsDetails.push(obj)
- }
+ this.materialList.forEach(item=>{
+ if(item.orderNum>item.totalQualifiedNum){
+ if(item.deliveryNum==0 || Number(item.qualifiedNum)==0){
+ this.noMaterial = true
+ }else{
+ let obj = Object.assign({}, item)
+ param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
+ param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
+ param.inspectGoodsDetails.push(obj)
+ }
+ }
})
}
if(this.noMaterial){
@@ -625,14 +636,16 @@ export default {
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
- if(item.deliveryNum==0 || item.qualifiedNum==0){
- this.noMaterial = true
- }else{
- let obj = Object.assign({}, item)
- param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
- param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
- param.inspectGoodsDetails.push(obj)
- }
+ if(item.orderNum>item.totalQualifiedNum){
+ if(item.deliveryNum==0 || item.qualifiedNum==0){
+ this.noMaterial = true
+ }else{
+ let obj = Object.assign({}, item)
+ param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
+ param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
+ param.inspectGoodsDetails.push(obj)
+ }
+ }
})
}
if(this.noMaterial){
@@ -700,6 +713,7 @@ export default {
"pageNum": this.queryParams2.pageNum,
"orderGoodsCode": this.queryParams2.orderGoodsCode,
"orderStatus":2,
+ "isInspect":2,
"areaId": this.baseInfo.areaId,
"warehouseId": this.baseInfo.deliveryWarehouseId,
"supplierId": this.baseInfo.deliverySupplierId,
@@ -724,7 +738,26 @@ export default {
this.materialList.forEach(item=>{
this.$set(item,"unitPrice",Number(item.singlePrice))
this.$set(item,"orderNum",item.orderNum)
+ if(item.totalQualifiedNum&&item.totalQualifiedNum>0){
+ this.$set(item,"deliveryNum",item.orderNum-item.totalQualifiedNum)
+ }else{
+ this.$set(item,"deliveryNum",item.orderNum)
+ }
})
+ // this.materialList = [];
+ // this.materialDetailsData.forEach(item=>{
+ // if(item.totalQualifiedNum0){
+ // this.$set(obj,"deliveryNum",obj.orderNum-obj.totalQualifiedNum)
+ // }else{
+ // this.$set(obj,"deliveryNum",obj.orderNum)
+ // }
+ // this.materialList.push(obj)
+ // }
+ // })
this.baseInfo.relateOrderGoodsId = this.importRow.orderGoodsCode;
this.$set(this.baseInfo,"remark","导入采购订单")
setTimeout(()=>{
@@ -762,20 +795,27 @@ export default {
},
patternValue(row){
row.deliveryNum = row.deliveryNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
- setTimeout(()=>{
- if(Number(row.deliveryNum)>Number(row.orderNum)){
- row.deliveryNum = row.orderNum
- }
- },500)
-
+ if(row.totalQualifiedNum&&row.totalQualifiedNum>0){
+ setTimeout(()=>{
+ if(Number(row.deliveryNum)>(Number(row.orderNum)-Number(row.totalQualifiedNum))){
+ row.deliveryNum = Number(row.orderNum)-Number(row.totalQualifiedNum)
+ }
+ },500)
+ }else{
+ setTimeout(()=>{
+ if(Number(row.deliveryNum)>Number(row.orderNum)){
+ row.deliveryNum = Number(row.orderNum)
+ }
+ },500)
+ }
},
- patternValue2(row){
- row.qualifiedNum = row.qualifiedNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
+ patternValue2(row){
+ row.qualifiedNum = row.qualifiedNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
setTimeout(()=>{
if(Number(row.qualifiedNum)>Number(row.deliveryNum)){
- row.qualifiedNum = row.deliveryNum
+ row.qualifiedNum = Number(row.deliveryNum)
}
- },500)
+ },500)
},
//日期
formatDate(date) {
diff --git a/src/views/foodManage/purchaseManage/purchaseInspection/index.vue b/src/views/foodManage/purchaseManage/purchaseInspection/index.vue
index e2733e3a..c303dcae 100644
--- a/src/views/foodManage/purchaseManage/purchaseInspection/index.vue
+++ b/src/views/foodManage/purchaseManage/purchaseInspection/index.vue
@@ -63,15 +63,15 @@
-
+
-
+
-
+