运检食堂代码修改3

This commit is contained in:
zzyuan 2025-06-26 16:29:28 +08:00
parent f4dc839318
commit b8f423846d
3 changed files with 76 additions and 24 deletions

View File

@ -38,6 +38,11 @@
<!-- <el-table-column label="订单状态" align="center" prop="name" />
<el-table-column label="支付类型" align="center" prop="name" /> -->
<el-table-column label="订单完成时间" align="center" prop="orderDateStr"/>
<el-table-column label="状态" align="center" prop="delFlag">
<template slot-scope="scope">
{{scope.row.delFlag === '1'? '已退费' : '未退费'}}
</template>
</el-table-column>
<!-- <el-table-column label="评价状态" align="center" prop="pingjia" /> -->
</el-table>

View File

@ -8,9 +8,10 @@
<!-- 菜单添加标签 -->
<el-tab-pane :label="activeLabel" name="add">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" style="width: 600px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" style="width: 600px" class="form-style">
<el-form-item label="时间:" prop="menuDate">
<el-date-picker v-model="form.menuDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
<el-date-picker v-model="form.menuDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"
:picker-options="datePickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="数量限制:" prop="quantityRestriction">
@ -27,14 +28,16 @@
</el-form-item>
<el-form-item label="发布地点:" prop="carteenId">
<!-- <el-input v-model="form.carteenName" disabled/> -->
<el-select v-model="form.carteenId" placeholder="请选择发布地点" >
<el-option v-for="item in canteenList" :key="item.id" :label="item.name" :value="item.id" @click.native="handleCarteenChange(item)">
<el-select v-model="form.carteenId" placeholder="请选择发布地点">
<el-option v-for="item in canteenList" :key="item.id" :label="item.name" :value="item.id"
@click.native="handleCarteenChange(item)">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="厨师:" prop="chef">
<el-select v-model="form.chef" placeholder="请选择厨师" >
<el-option v-for="item in chefList" :key="item.id" :label="item.name" :value="item.id" @click.native="handleChefChange(item)">
<el-select v-model="form.chef" placeholder="请选择厨师">
<el-option v-for="item in chefList" :key="item.id" :label="item.name" :value="item.id"
@click.native="handleChefChange(item)">
</el-option>
</el-select>
</el-form-item>
@ -62,7 +65,7 @@
<el-dialog width="60%" title="选择菜品" :visible.sync="dialogVisible" :before-close="handleClose" append-to-body>
<el-tree-transfer :fromData="treeMenuData" :title="['餐品列表', '已选择餐品']" :to-data="proceedForm.areaList"
:default-checked-keys="proceedForm.areaIds" @addBtn="addTreeTransfer" @removeBtn="removeTreeTransfer"
@resetData="resetData" ref="treeTransfer"/>
@resetData="resetData" ref="treeTransfer" />
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="submitMenu"> </el-button>
@ -115,7 +118,7 @@ export default {
mealList: [], //
//
form: {
menuDate: '',
menuDate: this.formatDate(new Date()),
chef: '',
chefName: '',
quantityRestriction: null,
@ -124,7 +127,7 @@ export default {
carteName: '',*/
description: '',
cartePath: [],
carteenId:null,
carteenId: null,
unlimited: false, // falsetrue
},
copyForm: {
@ -142,6 +145,11 @@ export default {
createByNameList: [],
carteenNameList: [],
canteenList: [],
datePickerOptions: {
disabledDate: time => {
return time.getTime() <= new Date().getTime() - 24 * 60 * 60 * 1000;
}
},
}
},
created() {
@ -171,6 +179,7 @@ export default {
}
//
await this.getChefList(this.form.carteenId)
this.open = true;
this.title = "修改菜单";
} catch (e) {
@ -281,12 +290,20 @@ export default {
},
//
initData() {
// this.form.menuDate = this.formateDate();
this.getList();
this.getUser();
this.getFindMealDict('CANTEEN_GENRE');
// this.getTreeMenuData();
this.getCanteen(); //
},
//
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
detailData(data, pid) {
data.forEach((el) => {
el.pid = pid || 0;
@ -337,7 +354,7 @@ export default {
})
},
//
handleCarteenChange(item){
handleCarteenChange(item) {
this.form.carteenId = item.id;
this.form.carteenName = item.name;
this.form.chef = null;
@ -411,10 +428,10 @@ export default {
})
}
/*
this.$nextTick(() => {
this.$refs.menuList.getList();
})*/
/*
this.$nextTick(() => {
this.$refs.menuList.getList();
})*/
} else {
console.log('error submit!!');
return false;
@ -425,16 +442,16 @@ export default {
resetForm() {
this.$refs.form.resetFields();
this.form = {
menuDate: '',
menuDate: this.formatDate(new Date()),
chef: '',
chefName: '',
createByName: '',
description: '',
carteenId:this.canteenList[0].id,
carteenName:null,
carteenId: this.canteenList[0].id,
carteenName: null,
...this.copyForm
};
console.log(this.form.carteenId,'carteenId')
console.log(this.form.carteenId, 'carteenId')
this.getChefList(this.form.carteenId);
this.activeTab = 'list';
this.proceedFormCurrent = {
@ -453,7 +470,7 @@ export default {
},
'form.carteenId': {
handler(val) {
if(val && !this.form.id) {
if (val && !this.form.id) {
this.proceedForm = {
areaList: [],
areaIds: [],
@ -469,3 +486,14 @@ export default {
},
}
</script>
<style lang="scss">
.el-date-table td.current {
&.disabled {
div {
background-color: #409eff !important;
color: #fff !important;
// color: #409eff !important;
}
}
}
</style>

View File

@ -118,7 +118,7 @@
<Treeselect v-model="form.userId" :options="deptOptions" :normalizer="normalizer" :show-count="true"
:multiple="false" :flat="true"
@input="inputHandle" :disable-branch-nodes="true"
placeholder="请选择" style="width: 220px"/>
placeholder="请选择" style="width: 220px" :disabled="this.title === '修改食堂客户调岗'"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -133,7 +133,7 @@
<el-col :span="12">
<el-form-item label="原食堂" prop="originalCanteenId">
<el-select v-model="form.originalCanteenId" placeholder="请选择原食堂:" filterable
@change="getOriginalCanteenName">
@change="getOriginalCanteenName" disabled>
<el-option v-for="item in canteenList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@ -194,6 +194,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {deptUserTree} from "@/api/canteen/pointsDistribution";
import {listCanteenAll} from "@/api/canteen/canteenIncome";
import {formatInportData} from "@/utils/yjCanteen/common";
import {getCustomers} from "@/api/canteen/customers";
export default {
name: "Transfer",
@ -257,7 +258,9 @@ export default {
//
deptOptions: [],
//
canteenList: []
canteenList: [],
//
isManual: false,
};
},
created() {
@ -333,7 +336,14 @@ export default {
//
inputHandle(value) {
this.form.userName = this.findUserNameByNodeId(this.deptOptions, value)
if(value === undefined){
this.form.originalCanteenId = undefined
this.form.originalCanteenName = undefined
this.form.balance = undefined
}else if(this.isManual){
this.form.userName = this.findUserNameByNodeId(this.deptOptions, value)
this.getCustomerInfo(value)
}
},
getCarteenName() {
this.form.carteenName = this.canteenList.find(item => item.id === this.form.carteenId)?.name
@ -342,6 +352,13 @@ export default {
this.form.originalCanteenName = this.canteenList.find(item => item.id === this.form.originalCanteenId)?.name
},
// ID
getCustomerInfo(userId){
getCustomers(userId).then(res => {
this.form.originalCanteenId = res.data.carteenId
this.form.originalCanteenName = res.data.carteenName
})
},
//
cancel() {
this.open = false;
@ -359,7 +376,7 @@ export default {
originalCanteenName: null,
balance: null,
isSettled: null,
recordTime: null,
recordTime: new Date().toISOString().split('T')[0],
};
this.resetForm("form");
},
@ -381,6 +398,7 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.isManual = true;
this.reset();
this.open = true;
this.title = "添加食堂客户调岗";
@ -410,6 +428,7 @@ export default {
const handleSuccess = async () => {
this.$modal.msgSuccess(this.form.id ? "修改成功" : "新增成功");
this.open = false;
this.isManual = false;
//
await this.initDeptUserTree(); //
await this.getList(); //