|
|
@@ -6,7 +6,7 @@
|
|
|
</div>
|
|
|
<div class="inform-body">
|
|
|
<div class="order-top">
|
|
|
- <div class="staff-inquire">
|
|
|
+ <div class="username-inquire">
|
|
|
<el-input
|
|
|
placeholder="请输入手机号码或员工姓名"
|
|
|
style="width: 261px"
|
|
|
@@ -35,7 +35,7 @@
|
|
|
<div class="info">
|
|
|
<div class="user">
|
|
|
<div class="name">职位</div>
|
|
|
- <el-select v-model="positionValue" placeholder="请选择">
|
|
|
+ <el-select v-model="position" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
|
:key="item.value"
|
|
|
@@ -75,10 +75,10 @@
|
|
|
>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="staff" align="center" label="员工姓名">
|
|
|
+ <el-table-column prop="username" align="center" label="员工姓名">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="positionValue" align="center" label="职位">
|
|
|
+ <el-table-column prop="position" align="center" label="职位">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="address" align="center" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -106,7 +106,7 @@
|
|
|
<div class="info">
|
|
|
<div class="user">
|
|
|
<div class="name">职位</div>
|
|
|
- <el-select v-model="positionValue" placeholder="请选择">
|
|
|
+ <el-select v-model="position" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
|
:key="item.value"
|
|
|
@@ -153,113 +153,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import Cookies from "js-cookie";
|
|
|
export default {
|
|
|
name: "Inform",
|
|
|
data() {
|
|
|
return {
|
|
|
//总数据
|
|
|
- data: [
|
|
|
- {
|
|
|
- phone: 13611110232,
|
|
|
- staff: "刘德华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13620220232,
|
|
|
- staff: "刘",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 1363636320232,
|
|
|
- staff: "德华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 1344540232,
|
|
|
- staff: "华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 1360468880232,
|
|
|
- staff: "刘德",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13602220232,
|
|
|
- staff: "德",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 1360888832,
|
|
|
- staff: "刘华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13655550232,
|
|
|
- staff: "华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13605656232,
|
|
|
- staff: "刘",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13464520232,
|
|
|
- staff: "德",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 1365650232,
|
|
|
- staff: "华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13605656232,
|
|
|
- staff: "刘",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13464520232,
|
|
|
- staff: "德",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 1365650232,
|
|
|
- staff: "华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13605656232,
|
|
|
- staff: "刘",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13464520232,
|
|
|
- staff: "德",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 1365650232,
|
|
|
- staff: "华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13605656232,
|
|
|
- staff: "刘",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 13464520232,
|
|
|
- staff: "德",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- {
|
|
|
- phone: 1365650232,
|
|
|
- staff: "华",
|
|
|
- positionValue: "歌星",
|
|
|
- },
|
|
|
- ],
|
|
|
+ data: [],
|
|
|
datas: [],
|
|
|
|
|
|
// 当前页显示的数据
|
|
|
@@ -293,7 +193,7 @@ export default {
|
|
|
// 添加员工
|
|
|
staffValue: "",
|
|
|
phoneValue: "", // 当前的号码
|
|
|
- positionValue: "",
|
|
|
+ position: "",
|
|
|
phoneVal: "", // 修改前的号码
|
|
|
dialogVisible: false,
|
|
|
waterTable: [
|
|
|
@@ -314,8 +214,12 @@ export default {
|
|
|
document.getElementsByClassName(
|
|
|
"el-pagination__jump"
|
|
|
)[0].childNodes[0].nodeValue = "跳转到";
|
|
|
- this.handleCurrentChange(this.currentPage);
|
|
|
- this.datas = JSON.parse(JSON.stringify(this.data));
|
|
|
+ let cook = Cookies.get("cook");
|
|
|
+ this.API.hotelStaff.hotelStaffList(cook).then((res) => {
|
|
|
+ this.data = res.data.list;
|
|
|
+ this.datas = JSON.parse(JSON.stringify(this.data));
|
|
|
+ this.handleCurrentChange(this.currentPage);
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
allRead($event, index) {
|
|
|
@@ -345,10 +249,10 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res == "confirm") {
|
|
|
this.data = this.data.filter((item) => {
|
|
|
- return item.phone !== row.phone && item.staff !== row.staff;
|
|
|
+ return item.phone !== row.phone && item.username !== row.username;
|
|
|
});
|
|
|
this.datas = this.datas.filter((item) => {
|
|
|
- return item.phone !== row.phone && item.staff !== row.staff;
|
|
|
+ return item.phone !== row.phone && item.username !== row.username;
|
|
|
});
|
|
|
}
|
|
|
if (this.tableData.length <= 1) {
|
|
|
@@ -376,7 +280,7 @@ export default {
|
|
|
this.datas.forEach((item, index) => {
|
|
|
if (
|
|
|
item.phone.toString().includes(this.value) ||
|
|
|
- item.staff.includes(this.value)
|
|
|
+ item.username.includes(this.value)
|
|
|
) {
|
|
|
this.data.push(item);
|
|
|
}
|
|
|
@@ -412,15 +316,15 @@ export default {
|
|
|
});
|
|
|
} else if (this.staffValue.trim() == "") {
|
|
|
this.$message({ message: "输入的姓名不能为空", type: "error" });
|
|
|
- } else if (this.positionValue == "") {
|
|
|
+ } else if (this.position == "") {
|
|
|
this.$message({ message: "职位不能为空", type: "error" });
|
|
|
} else {
|
|
|
let arr = {
|
|
|
phone: this.phoneValue,
|
|
|
- staff: this.staffValue,
|
|
|
- positionValue: this.positionValue,
|
|
|
+ username: this.staffValue,
|
|
|
+ position: this.position,
|
|
|
};
|
|
|
- // console.log(this.positionValue);
|
|
|
+ // console.log(this.position);
|
|
|
this.datas.push(arr);
|
|
|
this.data = this.datas;
|
|
|
this.currentPage = Math.ceil(this.data.length / 8);
|
|
|
@@ -428,7 +332,7 @@ export default {
|
|
|
this.addStaffShow = false;
|
|
|
this.phoneValue = "";
|
|
|
this.staffValue = "";
|
|
|
- this.positionValue = "";
|
|
|
+ this.position = "";
|
|
|
}
|
|
|
} else {
|
|
|
this.$message({ message: "请输入正确的电话号码", type: "error" });
|
|
|
@@ -442,7 +346,7 @@ export default {
|
|
|
this.editShow = false;
|
|
|
this.phoneValue = "";
|
|
|
this.staffValue = "";
|
|
|
- this.positionValue = "";
|
|
|
+ this.position = "";
|
|
|
})
|
|
|
.catch((_) => {});
|
|
|
},
|
|
|
@@ -450,15 +354,15 @@ export default {
|
|
|
this.editShow = false;
|
|
|
this.phoneValue = "";
|
|
|
this.staffValue = "";
|
|
|
- this.positionValue = "";
|
|
|
+ this.position = "";
|
|
|
},
|
|
|
handleEdit(index, row) {
|
|
|
// console.log(row);
|
|
|
this.editShow = true;
|
|
|
this.phoneValue = row.phone;
|
|
|
this.phoneVal = row.phone;
|
|
|
- this.staffValue = row.staff;
|
|
|
- this.positionValue = row.positionValue;
|
|
|
+ this.staffValue = row.username;
|
|
|
+ this.position = row.position;
|
|
|
},
|
|
|
editSuccess() {
|
|
|
let reg_tel =
|
|
|
@@ -481,15 +385,15 @@ export default {
|
|
|
});
|
|
|
} else if (this.staffValue.trim() == "") {
|
|
|
this.$message({ message: "输入的姓名不能为空", type: "error" });
|
|
|
- } else if (this.positionValue == "") {
|
|
|
+ } else if (this.position == "") {
|
|
|
this.$message({ message: "职位不能为空", type: "error" });
|
|
|
} else {
|
|
|
if (reg_tel.test(this.phoneValue)) {
|
|
|
// console.log("电话号码符合要求");
|
|
|
let arr = {
|
|
|
phone: this.phoneValue,
|
|
|
- staff: this.staffValue,
|
|
|
- positionValue: this.positionValue,
|
|
|
+ username: this.staffValue,
|
|
|
+ position: this.position,
|
|
|
};
|
|
|
this.datas[editIndex] = arr;
|
|
|
this.data = this.datas;
|
|
|
@@ -497,7 +401,7 @@ export default {
|
|
|
this.editShow = false;
|
|
|
this.phoneValue = "";
|
|
|
this.staffValue = "";
|
|
|
- this.positionValue = "";
|
|
|
+ this.position = "";
|
|
|
} else {
|
|
|
this.$message({ message: "请输入正确的电话号码", type: "error" });
|
|
|
}
|