|
@@ -83,15 +83,22 @@
|
|
|
<el-row>
|
|
|
<el-col :span="22">
|
|
|
<el-form-item class="input-star" label="负责人" prop="principal">
|
|
|
- <el-input v-model="postManagement.principal" @click="selectUser" maxlength="32" placeholder="请输入食堂负责人">
|
|
|
- </el-input>
|
|
|
+<!-- <el-input v-model="postManagement.principal" @click="selectUser" maxlength="32" placeholder="请输入食堂负责人">-->
|
|
|
+<!-- </el-input>-->
|
|
|
+
|
|
|
+ <el-autocomplete
|
|
|
+ v-model="state"
|
|
|
+ :fetch-suggestions="querySearchAsync"
|
|
|
+ placeholder="请输入食堂负责人"
|
|
|
+ @select="handleSelect"
|
|
|
+ ></el-autocomplete>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="22">
|
|
|
<el-form-item class="input-star" label="投诉电话" prop="complaintPhone">
|
|
|
- <el-input v-model="postManagement.complaintPhone" placeholder="请输入食堂投诉电话" maxlength="12">
|
|
|
+ <el-input v-model="postManagement.complaintPhone" placeholder="请输入食堂投诉电话" maxlength="12">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -119,7 +126,7 @@
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="saveWork">提交</el-button>
|
|
|
- <el-button @click="workDialog = false">返回</el-button>
|
|
|
+ <el-button @click="back()">返回</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- <el-dialog :visible.sync="userDialog" width="50%" class="detailDialog" :close-on-click-modal="false" top="40px">-->
|
|
@@ -141,6 +148,7 @@
|
|
|
|
|
|
import CONFIG from "../../../vue.config"
|
|
|
import CanteenPersion from "@/views/canteen/components/CanteenPersionDialog"
|
|
|
+ import Repair from "@/api/repair";
|
|
|
|
|
|
export default {
|
|
|
name: "CanteenManage",
|
|
@@ -203,6 +211,7 @@
|
|
|
principal: "",
|
|
|
complaint_phone: "",
|
|
|
takeout_phone: "",
|
|
|
+ workerId:""
|
|
|
},
|
|
|
// 分页
|
|
|
sorts: {
|
|
@@ -213,13 +222,52 @@
|
|
|
uploadFiles: [],
|
|
|
// 文件上传绑定的list
|
|
|
fileList: [],
|
|
|
+ restaurants: [],
|
|
|
+ state: '',
|
|
|
+ timeout: null
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ back(){
|
|
|
+ this.workDialog = false;
|
|
|
+ this.state='';
|
|
|
+ },
|
|
|
+ loadAll() {
|
|
|
+
|
|
|
+ Repair.listUser().then((r)=>{
|
|
|
+ if (r.status){
|
|
|
+ this.restaurants = r.data.map((t)=>{
|
|
|
+ console.log(t);
|
|
|
+ return{
|
|
|
+ value:t.userName,
|
|
|
+ phone:t.phone,
|
|
|
+ id:t.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- selectUser(){
|
|
|
- this.userDialog = true;
|
|
|
+ },
|
|
|
+ querySearchAsync(queryString, cb) {
|
|
|
+ var restaurants = this.restaurants;
|
|
|
+ var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
|
|
|
+ cb(results)
|
|
|
+ // clearTimeout(this.timeout);
|
|
|
+ // this.timeout = setTimeout(() => {
|
|
|
+ // cb(results);
|
|
|
+ // }, 3000 * Math.random());
|
|
|
+ },
|
|
|
+ createStateFilter(queryString) {
|
|
|
+ return (state) => {
|
|
|
+ return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
|
|
+ };
|
|
|
+ },
|
|
|
|
|
|
+ handleSelect(item) {
|
|
|
+ this.postManagement.complaintPhone = item.phone
|
|
|
+ this.postManagement.workerId = item.id
|
|
|
+ this.postManagement.principal = item.username
|
|
|
+ // console.log(item);
|
|
|
},
|
|
|
// 删除文件
|
|
|
picRemove(file, fileList) {
|
|
@@ -395,6 +443,7 @@
|
|
|
this.postManagement.supplyTimeId =
|
|
|
this.postManagement.supplyTimeId.split(",");
|
|
|
}
|
|
|
+ this.state = this.postManagement.principal;
|
|
|
this.timeNodeChange();
|
|
|
this.fileList = [];
|
|
|
let params = {
|
|
@@ -531,6 +580,7 @@
|
|
|
}
|
|
|
params.append("principal", this.postManagement.principal);
|
|
|
params.append("complaintPhone", this.postManagement.complaintPhone);
|
|
|
+ params.append("workerId",this.postManagement.workerId);
|
|
|
if (this.postManagement.takeoutPhone) {
|
|
|
params.append("takeoutPhone", this.postManagement.takeoutPhone);
|
|
|
}
|
|
@@ -643,6 +693,9 @@
|
|
|
this.getData();
|
|
|
},
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.loadAll();
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|