添加所属区域

This commit is contained in:
zzyuan 2025-06-27 17:20:53 +08:00
parent f0ba460485
commit e09b88f9b2
3 changed files with 88 additions and 16 deletions

View File

@ -50,6 +50,7 @@
</el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName" :show-overflow-tooltip="true" />
<el-table-column label="设备SN码" align="center" prop="deviceSn" :show-overflow-tooltip="true" />
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/>
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" />
<el-table-column label="位置" align="center" prop="subPlaceName" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
@ -79,7 +80,7 @@
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="24">
<div style="font-size: 18px;font-weight: bold;border-left: 4px solid #1890FF;padding-left: 4px;margin-bottom: 20px;">
@ -110,9 +111,21 @@
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="关联食堂:" prop="canteenId">
<el-select v-model="form.canteenId" style="width: 100%;" placeholder="请选择关联食堂">
<el-col :span="12">
<el-form-item label="所属区域:" prop="areaId">
<el-cascader v-model="form.areaId"
:options="treeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable @change="handleTreeChange">
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属食堂:" prop="canteenId">
<el-select v-model="form.canteenId" style="width: 100%;" placeholder="请选择所属食堂">
<el-option
v-for="item in canteenOptions"
:key="item.canteenId"
@ -151,7 +164,7 @@
<script>
import { getKitchenDeviceTypeApi, getKitchenDeviceListApi, addKitchenDeviceApi, editKitchenDeviceApi, delKitchenDeviceApi,getKitchenSubPlaceListAllApi } from "@/api/kitchen/devices";
import { getCanteenByAreaApi } from "@/api/base/stall";
import { systemAreaTreeApi,getCanteenByAreaApi } from "@/api/base/stall";
export default {
name: "",
dicts: [],
@ -171,7 +184,8 @@ export default {
total: 0,
//
tableListData: [],
deviceTypeList: [],
deviceTypeList: [],
treeOptions:[], //
canteenOptions: [],
subPlaceOptions: [],
//
@ -190,6 +204,12 @@ export default {
form: {},
//
rules: {
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "change" }
],
canteenId: [
{ required: true, message: "所属食堂不能为空", trigger: "change" }
],
// canteenName: [
// { required: true, message: "", trigger: "blur" }
// ],
@ -201,7 +221,7 @@ export default {
},
created() {
this.getKitchenSubPlaceList();
this.getCanteenList();
this.getTreeData();
this.getKitchenDeviceType();
this.getList();
},
@ -224,6 +244,22 @@ export default {
this.subPlaceOptions = response.rows
})
},
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response.data;
});
},
handleTreeChange(e){
let param= {
"areaId":e,
"canteenType":1
}
getCanteenByAreaApi(param).then((response) => {
this.canteenOptions=response.rows||[]
this.$set(this.form,'canteenId',null)
});
},
//
getCanteenList(){
getCanteenByAreaApi({}).then((response) => {

View File

@ -67,6 +67,7 @@
</template>
</el-table-column>
<el-table-column label="日期" align="center" prop="sampleSaveTime" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" />
<el-table-column label="关联食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" />
<el-table-column label="档口名称" align="center" prop="stallName" :show-overflow-tooltip="true" />
<el-table-column label="餐次" align="center" prop="mealtimeType" :show-overflow-tooltip="true">

View File

@ -52,7 +52,9 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="员工编号" align="center" prop="staffNo" :show-overflow-tooltip="true"/>
<el-table-column label="员工编号" align="center" prop="staffNo" :show-overflow-tooltip="true"/>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/>
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true"/>
<el-table-column label="员工名称" align="center" prop="staffName" :show-overflow-tooltip="true" />
<el-table-column label="手机号" align="center" prop="mobile" :show-overflow-tooltip="true"/>
<el-table-column label="性别" align="center" prop="sex" :show-overflow-tooltip="true">
@ -160,10 +162,22 @@
<el-form-item label="手机号:" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入手机号" maxlength="11"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属区域:" prop="areaId">
<el-cascader v-model="form.areaId"
:options="treeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable @change="handleTreeChange">
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="关联食堂:" prop="canteenId">
<el-select v-model="form.canteenId" style="width: 100%;" placeholder="请选择关联食堂">
<el-form-item label="所属食堂:" prop="canteenId">
<el-select v-model="form.canteenId" style="width: 100%;" placeholder="请选择所属食堂">
<el-option
v-for="item in canteenOptions"
:key="item.canteenId"
@ -399,7 +413,7 @@
</template>
<script>
import { getCanteenByAreaApi } from "@/api/base/stall";
import { systemAreaTreeApi,getCanteenByAreaApi } from "@/api/base/stall";
import { getKitchenDeviceSelectApi } from "@/api/kitchen/devices";
import { getStaffListApi,getStaffInfoApi,addKitchenStaffApi,editKitchenStaffApi,delStaffApi,editStaffFaceStateApi} from '@/api/kitchen/staff';
import { imgUpLoadTwo } from '@/api/system/upload';
@ -422,11 +436,12 @@ export default {
total: 0,
//
tableListData: [],
//
treeOptions:[],
//
canteenOptions:[],
//
devicesOptions:[],
devicesOptions:[],
loading2: false,
//
title: "",
@ -473,8 +488,11 @@ export default {
trigger: 'blur',
},
],
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "change" }
],
canteenId: [
{ required: true, message: "关联食堂不能为空", trigger: "change" }
{ required: true, message: "所属食堂不能为空", trigger: "change" }
],
postName: [
{ required: true, message: "员工岗位名称不能为空", trigger: "blur" }
@ -502,6 +520,7 @@ export default {
},
created() {
this.getList();
this.getTreeData()
},
computed: {
//1
@ -516,9 +535,25 @@ export default {
},
},
methods: {
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response.data;
});
},
handleTreeChange(e){
let param= {
"areaId":e,
"canteenType":1
}
getCanteenByAreaApi(param).then((response) => {
this.canteenOptions=response.rows||[]
this.$set(this.form,'canteenId',null)
});
},
//
getCanteenList(){
getCanteenByAreaApi({}).then((response) => {
getCanteenByAreaApi({"areaId":this.form.areaId}).then((response) => {
this.canteenOptions = response.rows
})
},
@ -618,7 +653,7 @@ export default {
},
//
reset() {
this.getCanteenList();
// this.getCanteenList();
this.getKitchenDeviceSelect();
this.fileList0 = []//
this.checkUrlList0 = []//