|
@@ -23,10 +23,10 @@
|
|
|
{{ (sorts.page - 1) * sorts.limit + scope.$index + 1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="canteenName" label="姓名" :show-overflow-tooltip="true" min-width="160" />
|
|
|
- <el-table-column prop="founder" :show-overflow-tooltip="true" label="负责区域" />
|
|
|
- <el-table-column prop="principal" :show-overflow-tooltip="true" label="联系电话" />
|
|
|
- <el-table-column prop="complaintPhone" :show-overflow-tooltip="true" label="当前状态" />
|
|
|
+ <el-table-column prop="name" label="姓名" :show-overflow-tooltip="true" min-width="160" />
|
|
|
+ <el-table-column prop="region" :show-overflow-tooltip="true" label="负责区域" />
|
|
|
+ <el-table-column prop="phoneNum" :show-overflow-tooltip="true" label="联系电话" />
|
|
|
+ <el-table-column prop="status" :show-overflow-tooltip="true" label="当前状态" :formatter = "statusFormat" />
|
|
|
<el-table-column prop="createTime" :show-overflow-tooltip="true" label="创建时间" width="160" />
|
|
|
<el-table-column prop="updateTime" :show-overflow-tooltip="true" label="更新时间" width="160" />
|
|
|
<el-table-column label="操作" width="140">
|
|
@@ -142,6 +142,13 @@
|
|
|
* 检索当前手机号是否存在微信用户
|
|
|
*/
|
|
|
hasWxUser(){
|
|
|
+ if (
|
|
|
+ !this.postManagement.phoneNum ||
|
|
|
+ this.postManagement.phoneNum.length < 1
|
|
|
+ ) {
|
|
|
+ this.$message.error("请输入工人联系电话!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
let params = {
|
|
|
phoneNum: this.postManagement.phoneNum
|
|
|
};
|
|
@@ -150,9 +157,26 @@
|
|
|
params
|
|
|
},
|
|
|
).then(res => {
|
|
|
- this.add = res.data
|
|
|
+ if (res.data){
|
|
|
+ this.add = res.data
|
|
|
+ this.$message.success('检索成功!用户存在。');
|
|
|
+ }else {
|
|
|
+ this.$message.error("检索失败,请使用该手机号登录微信小程序后重试!")
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
+ statusFormat(data){
|
|
|
+ console.log(data.status);
|
|
|
+ switch (data.status){
|
|
|
+ case 0:
|
|
|
+ return "在职"
|
|
|
+ case 1:
|
|
|
+ return "请假"
|
|
|
+ case -1:
|
|
|
+ return "离职"
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
// 列表排序
|
|
|
compare(property) {
|
|
@@ -195,40 +219,43 @@
|
|
|
if (
|
|
|
!this.postManagement.phoneNum ||
|
|
|
this.postManagement.phoneNum.length < 1
|
|
|
+
|
|
|
) {
|
|
|
this.$message.error("请输入工人联系电话!");
|
|
|
return;
|
|
|
}
|
|
|
if (
|
|
|
- !this.isMobile(this.postManagement.region) &&
|
|
|
- !this.isTel(this.postManagement.region)
|
|
|
+ !this.postManagement.region ||
|
|
|
+ this.postManagement.region< 1
|
|
|
) {
|
|
|
this.$message.error("请输入地区!");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ let params = new FormData()
|
|
|
+ params.append("name",this.postManagement.name)
|
|
|
+ params.append("phoneNum",this.postManagement.phoneNum)
|
|
|
+ params.append("region",this.postManagement.region)
|
|
|
if (this.workTitle == "编辑工人") {
|
|
|
params.append("id", this.postManagement.id);
|
|
|
- api
|
|
|
- .updateCanteen(params)
|
|
|
- .then((r) => {
|
|
|
- if (r.data.result) {
|
|
|
- this.$message.success("编辑成功");
|
|
|
- this.getData();
|
|
|
- this.workDialog = false;
|
|
|
- } else {
|
|
|
- this.$message.error(r.data.msg);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- // this.$message.error(r.data.msg);
|
|
|
- });
|
|
|
+ // api
|
|
|
+ // .updateCanteen(params)
|
|
|
+ // .then((r) => {
|
|
|
+ // if (r.data.result) {
|
|
|
+ // this.$message.success("编辑成功");
|
|
|
+ // this.getData();
|
|
|
+ // this.workDialog = false;
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(r.data.msg);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // // this.$message.error(r.data.msg);
|
|
|
+ // });
|
|
|
} else {
|
|
|
// 新增食堂
|
|
|
- params.append("founder", sessionStorage.getItem("pid"));
|
|
|
- api
|
|
|
- .addCanteen(params)
|
|
|
+ Repair
|
|
|
+ .add(params)
|
|
|
.then((r) => {
|
|
|
if (r.data.result) {
|
|
|
this.$message.success("新增成功");
|
|
@@ -255,6 +282,27 @@
|
|
|
this.sorts.page = currentPage;
|
|
|
this.getData();
|
|
|
},
|
|
|
+ isMobile(value) {
|
|
|
+ if (!value || value === "") {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ const mobileReg =
|
|
|
+ /^(([1][3,4,5,7,8]\d{9})|([0]\d{10,11})|(\d{7,8})|(\d{4}|\d{3})-(\d{7,8}))$/;
|
|
|
+ if (!mobileReg.test(value)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ isTel(value) {
|
|
|
+ if (!value || value === "") {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ const phoneReg = /^\d{3}-\d{8}|\d{4}-\d{7}$/;
|
|
|
+ if (!phoneReg.test(value)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
//删除
|
|
|
handleDelete(id, index) {
|
|
|
this.$confirm("您确定要删除该数据吗?", "提示", {
|
|
@@ -292,7 +340,7 @@
|
|
|
// 获取列表数据
|
|
|
getData() {
|
|
|
let params = {
|
|
|
- page:this.sorts.page,
|
|
|
+ page:this.sorts.page-1,
|
|
|
size:this.sorts.limit
|
|
|
}
|
|
|
Repair
|
|
@@ -301,6 +349,8 @@
|
|
|
})
|
|
|
.then((r) => {
|
|
|
console.log(r);
|
|
|
+ this.total = r.data.totalElements
|
|
|
+ this.tableData = r.data.content
|
|
|
});
|
|
|
},
|
|
|
// 搜索
|