采购验收多次验收

This commit is contained in:
zzyuan 2025-08-06 13:35:29 +08:00
parent 0f1cb53c64
commit 9aca2751ed
3 changed files with 123 additions and 44 deletions

View File

@ -67,7 +67,7 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-dropdown trigger="click" @command="handleCommand"> <el-dropdown trigger="click" @command="handleCommand">
<el-button type="primary"> <el-button type="primary" size="mini">
新增食堂生产计划<i class="el-icon-arrow-down el-icon--right"></i> 新增食堂生产计划<i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -76,18 +76,19 @@
<!-- <el-dropdown-item command="3">按预订单生成计划</el-dropdown-item> --> <!-- <el-dropdown-item command="3">按预订单生成计划</el-dropdown-item> -->
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<!-- <el-button <el-button
type="primary" type="primary"
plain plain
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini" style="margin-left: 20px;"
@click="handleAdd" @click="handleBatchPurchasePlan"
>新增食堂生产计划</el-button> --> >合并生成采购计划</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="tableListData" height="800"> <el-table v-loading="loading" :data="tableListData" height="800" :row-key="(row)=>{return row.planId}" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"/>
<el-table-column label="序号" align="center" width="80" type="index"> <el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span> <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
@ -274,6 +275,7 @@ export default {
dialogTableList: [], dialogTableList: [],
rowData:{}, rowData:{},
material_conversion_rounding_method:null,//- material_conversion_rounding_method:null,//-
batchList:[],
}; };
}, },
created() { created() {
@ -374,6 +376,43 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {productionPlanRowData:JSON.stringify(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 handlePurchasePlan(row) { //purchaseManage/purchasePlanEdit

View File

@ -119,24 +119,33 @@
<!-- <el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.orderNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/> --> <!-- <el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.orderNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true"> <el-table-column label="已验收数量" align="center" prop="totalQualifiedNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.totalQualifiedNum}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ (scope.row.orderNum*scope.row.unitPrice/100).toFixed(2) }}</span> <span>{{ (scope.row.orderNum*scope.row.unitPrice/100).toFixed(2) }}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true"> <el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.deliveryNum" placeholder="请输入" maxlength="10" clearable @change="patternValue(scope.row)"/> <el-input v-model="scope.row.deliveryNum" placeholder="请输入" maxlength="10" v-if="scope.row.deliveryNum>0" clearable @change="patternValue(scope.row)"/>
<span v-else>{{ scope.row.deliveryNum }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true"> <el-table-column label="验收合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.qualifiedNum" placeholder="请输入" maxlength="10" clearable @change="patternValue2(scope.row)"/> <el-input v-model="scope.row.qualifiedNum" placeholder="请输入" maxlength="10" v-if="scope.row.deliveryNum>0" clearable @change="patternValue2(scope.row)"/>
<span v-else>{{ scope.row.deliveryNum }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="请输入" maxlength="20" clearable/> <el-input v-model="scope.row.remark" placeholder="请输入" v-if="scope.row.deliveryNum>0" maxlength="20" clearable/>
<span v-else>{{ scope.row.remark }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -561,13 +570,15 @@ export default {
this.noMaterial = false; this.noMaterial = false;
if(this.materialList.length>0){ if(this.materialList.length>0){
this.materialList.forEach(item=>{ this.materialList.forEach(item=>{
if(item.deliveryNum==0 || item.qualifiedNum==0){ if(item.orderNum>item.totalQualifiedNum){
this.noMaterial = true if(item.deliveryNum==0 || Number(item.qualifiedNum)==0){
}else{ this.noMaterial = true
let obj = Object.assign({}, item) }else{
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)// let obj = Object.assign({}, item)
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)// param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//
param.inspectGoodsDetails.push(obj) param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//
param.inspectGoodsDetails.push(obj)
}
} }
}) })
} }
@ -625,13 +636,15 @@ export default {
this.noMaterial = false; this.noMaterial = false;
if(this.materialList.length>0){ if(this.materialList.length>0){
this.materialList.forEach(item=>{ this.materialList.forEach(item=>{
if(item.deliveryNum==0 || item.qualifiedNum==0){ if(item.orderNum>item.totalQualifiedNum){
this.noMaterial = true if(item.deliveryNum==0 || item.qualifiedNum==0){
}else{ this.noMaterial = true
let obj = Object.assign({}, item) }else{
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)// let obj = Object.assign({}, item)
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)// param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//
param.inspectGoodsDetails.push(obj) param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//
param.inspectGoodsDetails.push(obj)
}
} }
}) })
} }
@ -700,6 +713,7 @@ export default {
"pageNum": this.queryParams2.pageNum, "pageNum": this.queryParams2.pageNum,
"orderGoodsCode": this.queryParams2.orderGoodsCode, "orderGoodsCode": this.queryParams2.orderGoodsCode,
"orderStatus":2, "orderStatus":2,
"isInspect":2,
"areaId": this.baseInfo.areaId, "areaId": this.baseInfo.areaId,
"warehouseId": this.baseInfo.deliveryWarehouseId, "warehouseId": this.baseInfo.deliveryWarehouseId,
"supplierId": this.baseInfo.deliverySupplierId, "supplierId": this.baseInfo.deliverySupplierId,
@ -724,7 +738,26 @@ export default {
this.materialList.forEach(item=>{ this.materialList.forEach(item=>{
this.$set(item,"unitPrice",Number(item.singlePrice)) this.$set(item,"unitPrice",Number(item.singlePrice))
this.$set(item,"orderNum",item.orderNum) 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.totalQualifiedNum<item.orderNum){
// let obj = Object.assign({},item)
// this.$set(obj,"unitPrice",Number(obj.singlePrice))
// this.$set(obj,"orderNum",obj.orderNum)
// if(obj.totalQualifiedNum&&obj.totalQualifiedNum>0){
// 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.baseInfo.relateOrderGoodsId = this.importRow.orderGoodsCode;
this.$set(this.baseInfo,"remark","导入采购订单") this.$set(this.baseInfo,"remark","导入采购订单")
setTimeout(()=>{ setTimeout(()=>{
@ -762,18 +795,25 @@ export default {
}, },
patternValue(row){ patternValue(row){
row.deliveryNum = row.deliveryNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1') row.deliveryNum = row.deliveryNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
setTimeout(()=>{ if(row.totalQualifiedNum&&row.totalQualifiedNum>0){
if(Number(row.deliveryNum)>Number(row.orderNum)){ setTimeout(()=>{
row.deliveryNum = row.orderNum if(Number(row.deliveryNum)>(Number(row.orderNum)-Number(row.totalQualifiedNum))){
} row.deliveryNum = Number(row.orderNum)-Number(row.totalQualifiedNum)
},500) }
},500)
}else{
setTimeout(()=>{
if(Number(row.deliveryNum)>Number(row.orderNum)){
row.deliveryNum = Number(row.orderNum)
}
},500)
}
}, },
patternValue2(row){ patternValue2(row){
row.qualifiedNum = row.qualifiedNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1') row.qualifiedNum = row.qualifiedNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
setTimeout(()=>{ setTimeout(()=>{
if(Number(row.qualifiedNum)>Number(row.deliveryNum)){ if(Number(row.qualifiedNum)>Number(row.deliveryNum)){
row.qualifiedNum = row.deliveryNum row.qualifiedNum = Number(row.deliveryNum)
} }
},500) },500)
}, },

View File

@ -63,15 +63,15 @@
<!-- <el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/> --> <!-- <el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/> -->
<el-table-column label="验货日期" align="center" prop="inspectDate" :show-overflow-tooltip="true" width="150"/> <el-table-column label="验货日期" align="center" prop="inspectDate" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="关联采购订单号" align="center" prop="relateOrderGoodsId" :show-overflow-tooltip="true" width="180"/> <el-table-column label="关联采购订单号" align="center" prop="relateOrderGoodsId" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="验货人" align="center" prop="inspector" :show-overflow-tooltip="true"/> <el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="送货单号" align="center" prop="relateDeliveryGoodsId" :show-overflow-tooltip="true"/> --> <!-- <el-table-column label="送货单号" align="center" prop="relateDeliveryGoodsId" :show-overflow-tooltip="true"/> -->
<el-table-column label="送货供应商" align="center" prop="deliverySupplierName" :show-overflow-tooltip="true"/> <el-table-column label="送货供应商" align="center" prop="deliverySupplierName" :show-overflow-tooltip="true"/>
<el-table-column label="送货人" align="center" prop="deliveryMan" :show-overflow-tooltip="true"/> <el-table-column label="送货人" align="center" prop="deliveryMan" :show-overflow-tooltip="true"/>
<el-table-column label="送货人电话" align="center" prop="deliveryPhone" :show-overflow-tooltip="true"/> <el-table-column label="送货人电话" align="center" prop="deliveryPhone" :show-overflow-tooltip="true"/>
<el-table-column label="送货仓库" align="center" prop="deliveryWarehouseId" :show-overflow-tooltip="true"/> <!-- <el-table-column label="送货仓库" align="center" prop="deliveryWarehouseId" :show-overflow-tooltip="true"/> -->
<el-table-column label="送货日期" align="center" prop="deliveryDate" :show-overflow-tooltip="true"/> <el-table-column label="送货日期" align="center" prop="deliveryDate" :show-overflow-tooltip="true"/>
<el-table-column label="送货总数量" align="center" prop="deliveryTotalNum" :show-overflow-tooltip="true"/> <el-table-column label="送货总数量" align="center" prop="deliveryTotalNum" :show-overflow-tooltip="true"/>
<el-table-column label="合格总数量" align="center" prop="inspectQualifiedNum" :show-overflow-tooltip="true"/> <el-table-column label="验收总数量" align="center" prop="inspectQualifiedNum" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="提交状态" align="center" prop="status" :show-overflow-tooltip="true" width="100"> <!-- <el-table-column label="提交状态" align="center" prop="status" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status==1">待提交</span> <span v-if="scope.row.status==1">待提交</span>