生产计划详情展示

This commit is contained in:
zzyuan 2025-07-16 09:57:57 +08:00
parent 576e266a02
commit 3aaec65899
2 changed files with 136 additions and 137 deletions

View File

@ -1,44 +1,18 @@
<template> <template>
<div style="padding: 10px;background: #E5EBF6;min-height: 830px;"> <div style="padding: 10px;background: #E5EBF6;min-height: 830px;">
<div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;"> <div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;">
<el-descriptions style="margin-bottom: 20px;" title="采购计划状态" :column="4" size="medium" border>
<el-descriptions-item>
<template slot="label">提交状态</template>
<span v-if="baseInfo.status==1">待发布</span>
<span v-if="baseInfo.status==2">已发布</span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">提交时间</template>
{{ baseInfo.createTime }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">提交人</template>
{{ baseInfo.createBy }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">审批状态</template>
<span v-if="baseInfo.approveStatus==1">待审批</span>
<span v-if="baseInfo.approveStatus==2">审批中</span>
<span v-if="baseInfo.approveStatus==3">审批同意</span>
<span v-if="baseInfo.approveStatus==4">审批拒绝</span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">审批时间</template>
{{ baseInfo.approveTime }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">审批人</template>
{{ baseInfo.approveBy }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions style="margin-bottom: 20px;" title="基本信息" :column="4" size="medium" border> <el-descriptions style="margin-bottom: 20px;" title="基本信息" :column="4" size="medium" border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">采购计划单号</template> <template slot="label">生产计划单号</template>
{{baseInfo.planCode}} {{baseInfo.productionPlanCode}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">采购时间</template> <template slot="label">生产计划名称</template>
{{ baseInfo.purchaseDate }} {{baseInfo.productionPlanName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">生产计划时间</template>
{{ this.dateRange[0] }}{{ this.dateRange[1] }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">所属区域</template> <template slot="label">所属区域</template>
@ -51,56 +25,40 @@
<el-descriptions-item> <el-descriptions-item>
<template slot="label">所属档口</template> <template slot="label">所属档口</template>
{{ baseInfo.stallName }} {{ baseInfo.stallName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">采购预算金额</template>
{{ (baseInfo.purchaseBudgetTotal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">操作人</template>
{{ baseInfo.updateBy }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item v-if="baseInfo.productionPlanType==1">
<template slot="label">备注</template> <template slot="label">是否重复</template>
{{ baseInfo.remark }} <span v-if="baseInfo.ifRepeat==1">多天重复</span>
</el-descriptions-item> <span v-if="baseInfo.ifRepeat==2">多天不重复</span>
</el-descriptions> </el-descriptions-item>
</div> </el-descriptions>
<el-row class="mb8" v-if="baseInfo.ifRepeat==2||baseInfo.productionPlanType==2">
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;background: #FFF;"> <el-col :span="1">
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;"> <span style="font-weight: bold;color: #606266;font-size: 14px;">日期</span>
<div> </el-col>
货品信息 <el-col :span="23">
</div> <el-radio-group v-model="dateRangeRadio" @change="choseDateRadio">
</div> <el-radio :label="item.applyDate" v-for="(item,index) in dateRangeList" :key="index" style="font-size: 14px;margin-bottom: 10px;">{{ item.applyDateStr }}</el-radio>
<div style="width: 100%;height: 400px;overflow-y: auto;"> </el-radio-group>
<el-table v-loading="loading" :data="materialList" ref="multipleTable" height="380" :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange"> </el-col>
<!-- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" /> --> </el-row>
<el-table-column label="序号" align="center" width="80" type="index" /> </div>
<!-- <el-table-column label="图片" align="center" prop="" :show-overflow-tooltip="true" /> --> <div style="width: 100%;height: 480px;padding: 10px;border-radius: 10px;margin-bottom: 10px;background: #FFF;">
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" /> <div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;display: flex;" >
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" /> <el-card class="dishes-card" v-for="item in detailList" :key="item.mealtimeType">
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" /> <div slot="header">
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" /> <span>{{item.mealtimeName}}</span>
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true"> </div>
<!-- <template slot-scope="scope"> <div class="body-card">
<span v-if="scope.row.salesMode==1">按份</span> <div v-for="dish in item.dishesList" :key="dish.dishesId" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
<span v-if="scope.row.salesMode==2">称重</span> <span>{{dish.dishesName}}</span>
</template> --> <span>{{dish.dishesNum}}</span>
</el-table-column> </div>
<el-table-column label="参考价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true"> </div>
<template slot-scope="scope"> <div class="bottom-card">
<span>{{ (scope.row.unitPrice).toFixed(2) }}</span>
</template> </div>
</el-table-column> </el-card>
<el-table-column label="采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="预计采购金额(元)" align="center" prop="" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.purchaseNum*scope.row.unitPrice }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"></el-table-column>
</el-table>
</div> </div>
</div> </div>
<div style="width: 100%;height: 80px;padding: 10px;background: #FFF;border-radius: 10px;display: flex;align-items: center;justify-content: center;"> <div style="width: 100%;height: 80px;padding: 10px;background: #FFF;border-radius: 10px;display: flex;align-items: center;justify-content: center;">
@ -111,7 +69,7 @@
</template> </template>
<script> <script>
import { getPurchasePlanInfoApi } from "@/api/foodManage/purchaseManage"; import { getProductionPlanInfoApi } from "@/api/foodManage/purchaseManage";
export default { export default {
name: "ProductionPlanDetail", name: "ProductionPlanDetail",
dicts: [], dicts: [],
@ -120,13 +78,7 @@ export default {
productionPlanRowData:{},// productionPlanRowData:{},//
loading:false, loading:false,
loadingBtn:false, loadingBtn:false,
baseInfo: { baseInfo: {},
contractTitle:undefined,
contractType:undefined,
areaId:undefined,
canteenId:undefined,
dateRange:[],
},
// //
baseRules: { baseRules: {
contractTitle: [ contractTitle: [
@ -143,35 +95,19 @@ export default {
], ],
contractSigningTime: [ contractSigningTime: [
{ required: true, message: "签订日期不能为空", trigger: "change" } { required: true, message: "签订日期不能为空", trigger: "change" }
],
dateRange: [
{ required: true, message: "合同生效周期不能为空", trigger: "change" }
] ]
}, },
treeAreaOptions:[], dateRange:[],
canteenOptions:[],
supplierOptions:[],
stallOptions:[],
pickerOptions: { pickerOptions: {
disabledDate(v) { disabledDate(v) {
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000 return v.getTime() < (new Date().getTime() - 86400000);// - 86400000
} }
}, },
materialList:[], dateRangeList:[],
openDialog:false, dateRangeIndex:0,
materialTreeOptions:[], dateRangeRadio:"",
// detailList:[],
queryParams: { resDetailList:[],
pageNum: 1,
pageSize: 10,
},
//
total: 0,
//
tableListData: [],
batchChosenMaterial:[],
noMaterial:false,
}; };
}, },
created() { created() {
@ -185,9 +121,6 @@ export default {
if(newId){ if(newId){
this.productionPlanRowData = JSON.parse(newId) this.productionPlanRowData = JSON.parse(newId)
this.getContractInfo() this.getContractInfo()
}else{
this.baseInfo={}
this.materialList=[]
} }
}, },
}, },
@ -200,26 +133,92 @@ export default {
}, },
getContractInfo(){ getContractInfo(){
console.log(this.productionPlanRowData) console.log(this.productionPlanRowData)
let param = { let param = {
planId:this.productionPlanRowData.planId planId:this.productionPlanRowData.planId
} }
// //
getPurchasePlanInfoApi(param).then((response) => { getProductionPlanInfoApi(param).then((response) => {
this.baseInfo = response.data; this.baseInfo = response.data;
this.materialList = this.baseInfo.purchasePlanDetailList; this.resDetailList = response.data.productionPlanDetailVOList;
this.materialList.forEach(item=>{ this.dateRange=[this.resDetailList[0].detailDate,this.resDetailList[this.resDetailList.length-1].detailDate]
this.$set(item,"unitPrice",Number(item.unitPrice)/100) this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1])
}) this.dateRangeIndex = 0
// getCanteenByAreaApi({areaId:this.baseInfo.areaId}).then((response) => { this.dateRangeRadio = this.formatDate(this.dateRange[0]);
// this.canteenOptions=response.rows||[]; for (let i = 0; i < this.resDetailList.length; i++) {
// this.$set(this.baseInfo,"canteenId",this.baseInfo.canteenId) this.dateRangeList.forEach(item=>{
// }); if(this.resDetailList[i].detailDate==item.applyDate){
// getStallByCanteenApi({ canteenId:this.baseInfo.canteenId }).then((response) => { item.detailList.forEach(subItem=>{
// this.stallOptions=response.rows||[] if(this.resDetailList[i].mealtimeType==subItem.mealtimeType){
// this.$set(this.baseInfo,"stallId",this.baseInfo.stallId) this.$set(this.resDetailList[i],'dishesNum',this.resDetailList[i].dishesNum)
// }); subItem.dishesList.push(this.resDetailList[i])
}
})
}
})
}
this.detailList = this.dateRangeList[0].detailList;
// if(e==1){//
// this.dateRangeIndex = 0
// this.detailList = this.dateRangeList[0].detailList;
// }else{
// let index = this.dateRangeList.findIndex(v=>v.applyDate==this.dateRangeRadio)
// this.dateRangeIndex = index
// this.detailList = this.dateRangeList[index].detailList;
// }
}); });
}, },
//-
choseDateRadio(e){
let index = this.dateRangeList.findIndex(v=>v.applyDate==this.dateRangeRadio)
this.dateRangeIndex = index
this.detailList = this.dateRangeList[index].detailList;
},
//-
getDateRange(startDate, endDate) {
let start = new Date(startDate);
let end = new Date(endDate)
let dateArray = [];
while (start <= end) {
//
var days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
var dayOfWeek = start.getDay();
let obj = {
applyDate:this.formatDate(start),
applyWeek:dayOfWeek,
applyDateStr:this.formatDate(start)+" "+days[dayOfWeek],
detailList:[
{
mealtimeType:"1",
mealtimeName:"早餐",
dishesList:[]
},
{
mealtimeType:"2",
mealtimeName:"午餐",
dishesList:[]
},
{
mealtimeType:"3",
mealtimeName:"下午茶",
dishesList:[]
},
{
mealtimeType:"4",
mealtimeName:"晚餐",
dishesList:[]
},
{
mealtimeType:"5",
mealtimeName:"夜宵",
dishesList:[]
}
]
}
dateArray.push(obj); // YYYY-MM-DD
start.setDate(start.getDate() + 1); // 1
}
return dateArray;
},
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
// this.batchIds1 = selection.map(item => item.tradeId) // this.batchIds1 = selection.map(item => item.tradeId)

View File

@ -2,8 +2,8 @@
<div style="padding: 10px;background: #E5EBF6;min-height: 830px;"> <div style="padding: 10px;background: #E5EBF6;min-height: 830px;">
<div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;"> <div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;">
<el-form :model="baseInfo" ref="baseInfo" :rules="baseRules" size="medium" :inline="true" label-width="110px"> <el-form :model="baseInfo" ref="baseInfo" :rules="baseRules" size="medium" :inline="true" label-width="110px">
<!-- <el-form-item label="生产计划单号" prop="planCode"> <!-- <el-form-item label="生产计划单号" prop="productionPlanCode">
<el-input v-model="baseInfo.planCode" placeholder="生产计划单号自动生成" disabled maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.productionPlanCode" placeholder="生产计划单号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
</el-form-item> --> </el-form-item> -->
<el-form-item label="生产计划名称" prop="productionPlanName"> <el-form-item label="生产计划名称" prop="productionPlanName">
<el-input v-model="baseInfo.productionPlanName" placeholder="请输入生产计划名称" maxlength="20" clearable style="width: 240px"/> <el-input v-model="baseInfo.productionPlanName" placeholder="请输入生产计划名称" maxlength="20" clearable style="width: 240px"/>
@ -170,7 +170,7 @@
</div> </div>
<div class="dialog-right"> <div class="dialog-right">
<el-table :data="dishesTableList" height="620"> <el-table :data="dishesTableList" height="620">
<el-table-column label="菜品编号" align="center" prop="dishesNum" /> <!-- <el-table-column label="菜品编号" align="center" prop="dishesNum" /> -->
<el-table-column label="菜品名称" align="center" prop="dishesName" /> <el-table-column label="菜品名称" align="center" prop="dishesName" />
<el-table-column label="所属食堂" align="center" prop="canteenName" /> <el-table-column label="所属食堂" align="center" prop="canteenName" />
<el-table-column label="规格" align="center" prop="sizeType"> <el-table-column label="规格" align="center" prop="sizeType">
@ -353,7 +353,7 @@ export default {
this.dateRangeIndex = 0 this.dateRangeIndex = 0
this.dateRangeRadio = this.formatDate(this.dateRange[0]); this.dateRangeRadio = this.formatDate(this.dateRange[0]);
if(this.dialogType==1){ if(this.dialogType==1){
for (let i = 0; i < this.resDetailList.length; i++) { for (let i = 0; i < this.resDetailList.length; i++) {
this.dateRangeList.forEach(item=>{ this.dateRangeList.forEach(item=>{
if(this.resDetailList[i].detailDate==item.applyDate){ if(this.resDetailList[i].detailDate==item.applyDate){
item.detailList.forEach(subItem=>{ item.detailList.forEach(subItem=>{