Commit bc203d29 authored by xinzhedeai's avatar xinzhedeai

add:员工接口对接 解绑、绑定 定位卡号列表

parent 716588d1
......@@ -11,6 +11,17 @@ export function listCard(query) {
})
}
export function listUnboundCard(query) {
return request({
url: '/person/card/getUnboundCardList',
method: 'GET',
// data: query
params: query
})
}
// 查询人员定位卡详细
export function getCard(id) {
return request({
......
......@@ -233,6 +233,8 @@ import {
getInfo,
getCardList, // 引入获取定位卡号列表的接口
} from "@/api/jinrun/fangke";
import { listUnboundCard } from "@/api/jinrun/card"; // 引入获取未绑定定位卡号列表的接口
import { getDict } from "@/api/jinrun/common";
export default {
......@@ -312,7 +314,7 @@ export default {
/** 获取定位卡号列表数据 */
getCardIdList() {
getCardList()
listUnboundCard()
.then((response) => {
this.cardIdOptions = response.data || [];
})
......
......@@ -86,7 +86,7 @@
size="small"
icon="el-icon-unlock"
v-if="scope.row.cardId"
@click="handleUnbindCard(scope.row)"
@click="handleUnbindCard1(scope.row)"
>定位卡解绑</el-button
>
<el-button
......@@ -293,9 +293,8 @@ import {
addInfo,
getInfo, // 引入获取人员信息的接口
updateInfo,
unbindCard,
getCardList, // 引入获取定位卡号列表的接口
} from "@/api/jinrun/yuangong";
import { listUnboundCard } from "@/api/jinrun/card"; // 引入获取未绑定定位卡号列表的接口
import { getDict } from "@/api/jinrun/common";
import { getDept, getPosition } from "@/api/jinrun/zhongkong";
......@@ -307,16 +306,7 @@ export default {
components: { Treeselect },
data() {
return {
deptOptions: [
{
label: "部门1",
value: "1",
},
{
label: "部门2",
value: "2",
},
],
deptOptions: [],
// 绑定卡对话框
bindOpen: false,
// 绑定卡表单
......@@ -512,69 +502,42 @@ export default {
}));
});
},
/** 获取部门列表 */
// getDeptList() {
// getDept({
// pageNum: 1,
// pageSize: 1000,
// }).then((response) => {
// console.log(response.data, "33333");
// this.deptOptions = response.data.data[0].children.map((item) => ({
// label: item.deptName,
// value: item.deptId,
// }));
// });
// },
/** 解绑卡按钮操作 */
handleUnbindCard(row) {
handleUnbindCard1(row) {
const formData = { ...row };
formData.cardId = "";
this.$modal
.confirm("是否确认解绑该人员的卡")
.confirm("是否确认删除该数据项")
.then(function () {
return unbindCard({
personId: row.personId,
personType: row.personType,
});
return updateInfo(formData);
})
.then(() => {
this.$modal.msgSuccess("解绑成功");
this.bindOpen = false;
this.getList();
this.$modal.msgSuccess("解绑卡成功");
})
.catch(() => {});
},
/** 绑定卡按钮操作 */
handleBindCard(row) {
this.bindForm = {
personId: row.personId,
realName: row.realName,
cardId: row.cardId || null,
personType: row.personType || "staff",
};
this.bindForm = { ...row };
this.bindOpen = true;
},
/** 取消绑定卡对话框 */
cancelBind() {
this.bindOpen = false;
this.bindForm = {
personId: null,
realName: null,
cardId: null,
personType: "staff",
};
this.bindForm = {};
},
/** 提交绑定卡表单 */
submitBindForm() {
this.$refs["bindForm"].validate((valid) => {
if (valid) {
bindCard(this.bindForm)
.then((response) => {
updateInfo(this.bindForm).then((response) => {
this.$modal.msgSuccess("绑定成功");
this.bindOpen = false;
this.getList();
})
.catch((error) => {
this.$modal.msgError("绑定失败,请重试");
console.error("绑定卡失败:", error);
});
}
});
......@@ -594,13 +557,8 @@ export default {
},
/** 获取定位卡号列表数据 */
getCardIdList() {
getCardList()
.then((response) => {
listUnboundCard().then((response) => {
this.cardIdOptions = response.data || [];
})
.catch((error) => {
this.$modal.msgError("获取定位卡号列表失败");
console.error("获取定位卡号列表失败:", error);
});
},
......@@ -620,7 +578,9 @@ export default {
},
// 表单重置
reset() {
this.form = {};
this.form = {
sex: "",
};
this.resetForm("form");
},
/** 搜索按钮操作 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment