添加所属区域
This commit is contained in:
parent
f0ba460485
commit
e09b88f9b2
|
|
@ -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,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
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) => {
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
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 = []//图片
|
||||
|
|
|
|||
Loading…
Reference in New Issue