页面修改

This commit is contained in:
zzyuan 2025-07-16 14:37:00 +08:00
parent 377a8fb1ad
commit de636dc350
10 changed files with 125 additions and 65 deletions

View File

@ -44,6 +44,16 @@ export function drpWareHousePageApi(data) {
})
}
//获取菜品原料反算接口dishes/convert
export function dishesConvertApi(data) {
return request({
url: '/smart-canteen/cook_dishes/dishes/convert',
method: 'post',
data: data
})
}
// -------------采购合同---------------
//获取采购合同分页列表

View File

@ -169,15 +169,15 @@ export const constantRoutes = [
redirect: 'noredirect',
children: [
{
path: 'planDetail',
path: 'purchasePlanDetail',
component: () => import('@/views/foodManage/purchaseManage/purchasePlan/detail'),
name: 'PlanDetail',
name: 'purchasePlanDetail',
meta: { title: '采购计划详情', icon: '' }
},
{
path: 'planEdit',
path: 'purchasePlanEdit',
component: () => import('@/views/foodManage/purchaseManage/purchasePlan/edit'),
name: 'PlanEdit',
name: 'PurchasePlanEdit',
meta: { title: '采购计划新增/编辑', icon: '' }
},
]

View File

@ -402,7 +402,7 @@
// this.menuTypeList.push(item)
// }
// })
this.menuTypeList = [{bindType: 7,id: 2,name: "智慧餐台/消费机"},{bindType: 1,id: 6,name: "移动端当餐点餐"},{bindType: 2,id: 7,name: "移动端预订餐"},{bindType: 3,id: 8,name: "移动端一周菜谱"}]
this.menuTypeList = [{bindType: 7,id: 2,name: "智慧餐台/消费机"},{bindType: 2,id: 7,name: "移动端预订餐"},{bindType: 3,id: 8,name: "移动端一周菜谱"}]
this.bindType = this.menuTypeList[0].bindType
// });
},

View File

@ -77,7 +77,7 @@
<script>
import { getFetchMaterialInfoApi } from "@/api/foodManage/pickManage";
export default {
name: "orderDetail",
name: "MaterialPickingDetail",
dicts: [],
data() {
return {

View File

@ -167,7 +167,7 @@ import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/ap
import { systemMaterialTreeApi,getStockMaterialListApi,drpWareHousePageApi } from "@/api/foodManage/pickManage";
import { getFetchMaterialInfoApi,addFetchMaterialApi,editFetchMaterialApi } from "@/api/foodManage/pickManage";
export default {
name: "orderEdit",
name: "MaterialPickingEdit",
dicts: [],
data() {
return {

View File

@ -165,10 +165,8 @@
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-table v-loading="loading2" :data="dialogTableList" height="600">
<el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="原料名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
<el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
<el-table-column label="原料名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
<!-- <template slot-scope="scope">
<span v-if="scope.row.salesMode==1">按份</span>
@ -176,21 +174,28 @@
</template> -->
</el-table-column>
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="可食用部分(%)" align="center" prop="" :show-overflow-tooltip="true" width="120">
<el-table-column label="可食用部分(%)" align="center" prop="edible" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>100</span>
</template>
</el-table-column>
<el-table-column label="系统分解重量(kg)" align="center" prop="" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="预留比例(%)" align="center" prop="" :show-overflow-tooltip="true" width="140">
<el-table-column label="系统分解重量(kg)" align="center" prop="totalConvertWeight" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="预留比例(%)" align="center" prop="rate" :show-overflow-tooltip="true" width="140">
<template slot-scope="scope">
<!-- <el-input-number v-model="scope.row.rate" style="width: 100%;" controls-position="right" maxlength="3" :min="0" :max="100" @change="inputRate(scope.row)"></el-input-number> -->
<el-input v-model="scope.row.rate" style="width: 100%;" maxlength="6" clearable @input="inputRate(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="数量(kg)" align="center" prop="" :show-overflow-tooltip="true" width="150">
<el-table-column align="center" prop="purchaseNum" :show-overflow-tooltip="true" width="150">
<template slot="header" slot-scope="scope">
<span>数量(kg)</span>
<el-button type="text" style="margin-left: 10px;" @click="">取整</el-button>
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.purchaseNum" maxlength="10" clearable @input="(v)=>(scope.row.purchaseNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
</template>
</el-table-column>
</el-table>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitPlan">生成采购计划</el-button>
<el-button @click="cancel"> </el-button>
@ -201,9 +206,9 @@
<script>
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
import { productionPlanPageApi,delProductionPlanApi } from "@/api/foodManage/purchaseManage";
import { addPurchaseInspectApi } from "../../../../api/foodManage/purchaseManage";
import { supplierPageApi,dishesConvertApi } from "@/api/foodManage/purchaseManage";
import { productionPlanPageApi,delProductionPlanApi,getProductionPlanInfoApi,addPurchasePlanApi } from "@/api/foodManage/purchaseManage";
import { getSettingListApi } from "@/api/foodManage/baseInfo.js";
export default {
name: "",
dicts: [],
@ -267,6 +272,8 @@ export default {
open: false,
loading2: false,
dialogTableList: [],
rowData:{},
material_conversion_rounding_method:null,//-
};
},
created() {
@ -275,6 +282,17 @@ export default {
this.getList();
},
methods: {
getSettings(){
getSettingListApi().then(response => {
let arr = response.rows;
arr.forEach(item=>{
if(item.itemName=='material_conversion_rounding_method'){
this.material_conversion_rounding_method = item.itemValue
}
})
console.log(this.material_conversion_rounding_method)
});
},
//
getAreaTreeData() {
systemAreaTreeApi({}).then((response) => {
@ -358,26 +376,30 @@ export default {
this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {productionPlanRowData:JSON.stringify(row)} });
},
/** 生成采购计划操作 */
handlePurchasePlan(row) { //purchaseManage/planEdit
handlePurchasePlan(row) { //purchaseManage/purchasePlanEdit
this.dialogTableList = [];
// let param = {
// "productionPlanCode": this.queryParams.productionPlanCode,
// "goodsType":1,
// "areaId": this.queryParams.areaId,
// "canteenId": this.queryParams.canteenId,
// "stallId": this.queryParams.stallId,
// "status": this.queryParams.status,
// "decompositionState": this.queryParams.decompositionState,
// }
// this.loading2=true;
// productionPlanPageApi(param).then(response => {
// this.dialogTableList = response.rows;
this.title = "生成采购计划"
this.open=true;
// this.loading2 = false;
// }).catch(() => {
// this.loading2 = false;
// });
this.rowData = row
let param = {
planId:row.planId
}
//
getProductionPlanInfoApi(param).then((response) => {
let param = response.data.productionPlanDetailVOList
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;
});
})
},
//
cancel() {
@ -385,8 +407,31 @@ export default {
this.dialogTableList = [];
},
/** 提交按钮 */
submitPlan: {
submitPlan() {
let param = {
"status": 1,
"purchaseDate": this.formatDateTime(new Date()),
"productionPlanId": this.rowData.planId,
"areaId": this.rowData.areaId,
"canteenId": this.rowData.canteenId,
"stallId": this.rowData.stallId,
"purchaseBudgetTotal": 0,
"totalNum": 0,
"purchasePlanDetailList":[]
}
this.dialogTableList.forEach(item=>{
let obj = Object.assign({}, item)
obj.productionPlanNum = Number(obj.purchaseNum)
obj.unitPrice = 100
obj.purchasingBudgetPrice = (100*Number(obj.purchaseNum))
param.purchasePlanDetailList.push(obj)
param.totalNum = param.totalNum+Number(obj.purchaseNum)
param.purchaseBudgetTotal = param.purchaseBudgetTotal+obj.purchasingBudgetPrice
})
addPurchasePlanApi(param).then((response) => {
let res = response.data;//planId
this.$router.push({ path: "/foodManage/purchaseManage/purchasePlanEdit",query: {purchasePlanRowData:JSON.stringify(res)} });
}).catch(() => {});
},
/** 删除按钮操作 */
handleDelete(row) {
@ -396,7 +441,11 @@ export default {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
},
inputRate(row){
this.$set(row,"rate",row.rate.replace(/[^\d]/g,''))
this.$set(row,"purchaseNum",(row.totalConvertWeight*((Number(row.rate)/100)+1)).toFixed(4))
},
defaultDateRange() {
const end = new Date(new Date().toLocaleDateString());
end.setTime(end.getTime() + 24 * 60 * 60 * 1000 -1);

View File

@ -113,7 +113,7 @@
<script>
import { getPurchasePlanInfoApi } from "@/api/foodManage/purchaseManage";
export default {
name: "PlanDetail",
name: "PurchasePlanDetail",
dicts: [],
data() {
return {
@ -194,7 +194,7 @@ export default {
methods: {
//
jumpList() {
const obj = { path: "foodManage/purchaseManage/planEdit" };
const obj = { path: "foodManage/purchaseManage/purchasePlanEdit" };
this.$tab.closeOpenPage(obj);
this.$router.replace({ path: "/foodManage/purchaseManage/purchasePlan" }); //
},

View File

@ -182,11 +182,11 @@ import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/ap
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/purchaseManage";
import { getPurchasePlanInfoApi, addPurchasePlanApi, editPurchasePlanApi } from "@/api/foodManage/purchaseManage";
export default {
name: "PlanEdit",
name: "PurchasePlanEdit",
dicts: [],
data() {
return {
purchasePlanRowData:{},//
purchasePlanRowData:{},//
loading:false,
loadingBtn:false,
baseInfo: {},
@ -195,9 +195,9 @@ export default {
purchaseDate: [
{ required: true, message: "采购日期不能为空", trigger: "change" }
],
deliverGoodsDate: [
{ required: true, message: "交货日期不能为空", trigger: "change" }
],
// deliverGoodsDate: [
// { required: true, message: "", trigger: "change" }
// ],
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "change" }
],
@ -228,8 +228,7 @@ export default {
total: 0, //
tableListData: [],//-
batchChosenMaterial:[],//--
noMaterial:false,
noMaterial:false,
};
},
created() {
@ -245,19 +244,17 @@ export default {
if(newId){
this.purchasePlanRowData = JSON.parse(newId)
this.getContractInfo()
}else{
this.baseInfo={}
this.materialList=[]
}
},
},
methods: {
//
jumpList() {
const obj = { path: "foodManage/purchaseManage/planEdit" };
const obj = { path: "foodManage/purchaseManage/purchasePlanEdit" };
this.$tab.closeOpenPage(obj);
this.$router.replace({ path: "/foodManage/purchaseManage/purchasePlan" }); //
},
//-
getContractInfo(){
console.log(this.purchasePlanRowData)
let param = {
@ -416,7 +413,9 @@ export default {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.purchaseDate = this.formatDateTime(this.baseInfo.purchaseDate)
param.deliverGoodsDate = this.formatDate(this.baseInfo.deliverGoodsDate)
if(this.baseInfo.deliverGoodsDate){
param.deliverGoodsDate = this.formatDate(this.baseInfo.deliverGoodsDate)
}
param.purchaseBudgetTotal = 0
param.totalNum=0
param.status=1
@ -477,7 +476,9 @@ export default {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.purchaseDate = this.formatDateTime(this.baseInfo.purchaseDate)
param.deliverGoodsDate = this.formatDate(this.baseInfo.deliverGoodsDate)
if(this.baseInfo.deliverGoodsDate){
param.deliverGoodsDate = this.formatDate(this.baseInfo.deliverGoodsDate)
}
param.purchaseBudgetTotal = 0
param.totalNum=0
param.status=2

View File

@ -307,15 +307,15 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({ path: "/foodManage/purchaseManage/planEdit" });
this.$router.push({ path: "/foodManage/purchaseManage/purchasePlanEdit" });
},
/** 修改按钮操作 */
handleView(row) {
this.$router.push({ path: "/foodManage/purchaseManage/planDetail",query: {purchasePlanRowData:JSON.stringify(row)} });
this.$router.push({ path: "/foodManage/purchaseManage/purchasePlanDetail",query: {purchasePlanRowData:JSON.stringify(row)} });
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push({ path: "/foodManage/purchaseManage/planEdit",query: {purchasePlanRowData:JSON.stringify(row)} });
this.$router.push({ path: "/foodManage/purchaseManage/purchasePlanEdit",query: {purchasePlanRowData:JSON.stringify(row)} });
},
//
cancel() {

View File

@ -1266,8 +1266,8 @@ export default {
validateNewPassword(null, value, errorMessage)
},
}).then(({ value }) => {
let password = encryptWithSM4(value)
resetUserPwd(row.userId, password).then((response) => {
// let password = encryptWithSM4(value)
resetUserPwd(row.userId, value).then((response) => {
this.$modal.msgSuccess('修改成功,新密码是:' + value)
})
}).catch(() => {})