diff --git a/src/views/canteen/ordersSearch/timelyPayList.vue b/src/views/canteen/ordersSearch/timelyPayList.vue index 431a7565..a823c488 100644 --- a/src/views/canteen/ordersSearch/timelyPayList.vue +++ b/src/views/canteen/ordersSearch/timelyPayList.vue @@ -38,6 +38,11 @@ + + + diff --git a/src/views/canteen/publishMenu/index.vue b/src/views/canteen/publishMenu/index.vue index bc21aeea..6bd00648 100644 --- a/src/views/canteen/publishMenu/index.vue +++ b/src/views/canteen/publishMenu/index.vue @@ -8,9 +8,10 @@ - + - + @@ -27,14 +28,16 @@ - - + + - - + + @@ -62,7 +65,7 @@ + @resetData="resetData" ref="treeTransfer" /> 取 消 确 定 @@ -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, // 是否是无限,false表示有限制,true表示无限制 }, 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 { }, } + \ No newline at end of file diff --git a/src/views/canteen/transfer/index.vue b/src/views/canteen/transfer/index.vue index 1397d581..38ec4ab4 100644 --- a/src/views/canteen/transfer/index.vue +++ b/src/views/canteen/transfer/index.vue @@ -118,7 +118,7 @@ + placeholder="请选择" style="width: 220px" :disabled="this.title === '修改食堂客户调岗'"/> @@ -133,7 +133,7 @@ + @change="getOriginalCanteenName" disabled> @@ -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(); // 再刷新列表数据