From 7e8ac114fef1b2b29121df10ea885cb6b0bbf627 Mon Sep 17 00:00:00 2001
From: chenxinying <1039655633@qq.com>
Date: Wed, 21 Feb 2024 11:18:02 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E7=A7=8D=E4=BD=9C=E4=B8=9A=E4=BA=BA?=
=?UTF-8?q?=E5=91=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/request/special_operations.js | 14 +++----
.../personnel_management/add.vue | 39 +++++++++++--------
.../personnel_management/index.vue | 16 ++++----
3 files changed, 38 insertions(+), 31 deletions(-)
diff --git a/src/request/special_operations.js b/src/request/special_operations.js
index 18cabe7..27fe382 100644
--- a/src/request/special_operations.js
+++ b/src/request/special_operations.js
@@ -1,16 +1,16 @@
import { post } from "@/request/axios.js";
export const getPersonnelManagementList = (params) =>
- post("/personnelmanagement/list", params); // 特种作业人员管理列表
+ post("/specialoperations/list", params); // 特种作业人员管理列表
export const getPersonnelManagementView = (params) =>
- post("/personnelmanagement/goEdit", params); // 特种作业人员管理查看
+ post("/specialoperations/goEdit", params); // 特种作业人员管理查看
export const setPersonnelManagementDelete = (params) =>
- post("/personnelmanagement/delete", params); // 特种作业人员管理删除
+ post("/specialoperations/delete", params); // 特种作业人员管理删除
export const setPersonnelManagementDeleteBatch = (params) =>
- post("/personnelmanagement/deleteAll", params); // 特种作业人员管理批量删除
+ post("/specialoperations/deleteAll", params); // 特种作业人员管理批量删除
export const setPersonnelManagementAdd = (params) =>
- post("/personnelmanagement/add", params); // 特种作业人员管理批量添加
+ post("/specialoperations/add", params); // 特种作业人员管理批量添加
export const setPersonnelManagementEdit = (params) =>
- post("/personnelmanagement/edit", params); // 特种作业人员管理批量修改
+ post("/specialoperations/edit", params); // 特种作业人员管理批量修改
export const getVerifyDeduplicationCertificateNum = (params) =>
- post("/personnelmanagement/hasCertificate", params); // 特种作业证书编号验证
+ post("/specialoperations/hasCertificate", params); // 特种作业证书编号验证
diff --git a/src/views/special_operations/personnel_management/add.vue b/src/views/special_operations/personnel_management/add.vue
index ab3401a..673a521 100644
--- a/src/views/special_operations/personnel_management/add.vue
+++ b/src/views/special_operations/personnel_management/add.vue
@@ -91,15 +91,13 @@
-
+
@@ -131,7 +129,7 @@ import { getUnitsListAll } from "@/request/keyprojects.js";
const userStore = useUserStore();
const route = useRoute();
const router = useRouter();
-const { PERSONNELMANAGEMENT_ID } = route.query;
+const { SPECIALOPERATIONS_ID } = route.query;
const CORP_NAME = userStore.getUserInfo.CORP_NAME;
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
const typeList = [
@@ -142,6 +140,10 @@ const sexList = [
{ ID: "0", NAME: "男" },
{ ID: "1", NAME: "女" },
];
+
+const fnDisabledDate = (time) => {
+ return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
+};
const personnelManagementJobTypeList =
await layoutFnGetPersonnelManagementJobType();
const { list: unitsNameList } = useListData(getUnitsListAll);
@@ -149,7 +151,7 @@ const fnHasCertificate = async (rule, value, callback) => {
if (value) {
const resData = await getVerifyDeduplicationCertificateNum({
CERTIFICATE_NUM: value,
- PERSONNELMANAGEMENT_ID,
+ SPECIALOPERATIONS_ID,
});
if (resData.msg) callback(new Error(resData.msg));
else callback();
@@ -179,6 +181,13 @@ const rules = {
message: "请输入正确的手机号码",
},
],
+ VALID_ETIME: [
+ {
+ required: true,
+ message: "特种作业证书到期时间不能为空",
+ trigger: "change",
+ },
+ ],
IDENTITYCARD: [
{
pattern:
@@ -198,16 +207,15 @@ const form = ref({
PHONENUM: "",
IDENTITYCARD: "",
LICENSING: "",
- VALID_TIME: [],
+ VALID_ETIME: [],
});
const formRef = ref(null);
const fnGetData = async () => {
- if (!PERSONNELMANAGEMENT_ID) return;
+ if (!SPECIALOPERATIONS_ID) return;
const resData = await getPersonnelManagementView({
- PERSONNELMANAGEMENT_ID,
+ SPECIALOPERATIONS_ID,
});
form.value = resData.pd;
- form.value.VALID_TIME = [resData.pd.VALID_STIME, resData.pd.VALID_ETIME];
};
fnGetData();
const fnSubmit = debounce(
@@ -218,10 +226,9 @@ const fnSubmit = debounce(
...form.value,
UNITS_ID:
form.value.PTYPE === "公司员工" ? CORPINFO_ID : form.value.UNITS_ID,
- VALID_STIME: form.value.VALID_TIME[0],
- VALID_ETIME: form.value.VALID_TIME[1],
+ VALID_ETIME: form.value.VALID_ETIME,
};
- !PERSONNELMANAGEMENT_ID
+ !SPECIALOPERATIONS_ID
? await setPersonnelManagementAdd(params)
: await setPersonnelManagementEdit(params);
ElMessage.success("提交成功");
diff --git a/src/views/special_operations/personnel_management/index.vue b/src/views/special_operations/personnel_management/index.vue
index bf0f0cf..f5267cc 100644
--- a/src/views/special_operations/personnel_management/index.vue
+++ b/src/views/special_operations/personnel_management/index.vue
@@ -51,7 +51,7 @@
@@ -65,8 +65,8 @@
{{
- row.PERSONNELMANAGEMENT_ID === CORPINFO_ID
- ? CORP_NAME
+ row.UNITS_ID === CORPINFO_ID
+ ? row.CREATOR_CORP_NAME
: row.UNITS_NAME
}}
@@ -87,7 +87,7 @@
@click="
router.push({
path: '/special_operations/personnel_management/edit',
- query: { PERSONNELMANAGEMENT_ID: row.PERSONNELMANAGEMENT_ID },
+ query: { SPECIALOPERATIONS_ID: row.SPECIALOPERATIONS_ID },
})
"
>
@@ -98,7 +98,7 @@
type="primary"
text
link
- @click="fnDelete(row.PERSONNELMANAGEMENT_ID)"
+ @click="fnDelete(row.SPECIALOPERATIONS_ID)"
>
删除
@@ -158,9 +158,9 @@ const personnelManagementJobTypeList =
await layoutFnGetPersonnelManagementJobType();
const fnDelete = debounce(
1000,
- async (PERSONNELMANAGEMENT_ID) => {
+ async (SPECIALOPERATIONS_ID) => {
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
- await setPersonnelManagementDelete({ PERSONNELMANAGEMENT_ID });
+ await setPersonnelManagementDelete({ SPECIALOPERATIONS_ID });
ElMessage.success("删除成功");
fnResetPagination();
},
@@ -175,7 +175,7 @@ const fnDeleteAll = debounce(
return;
}
const DATA_IDS = selectionData
- .map((item) => item.PERSONNELMANAGEMENT_ID)
+ .map((item) => item.SPECIALOPERATIONS_ID)
.join(",");
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
await setPersonnelManagementDeleteBatch({ DATA_IDS });