特种作业人员

pull/1/head
chenxinying 2024-02-21 11:18:02 +08:00
parent f645b8fbe8
commit 7e8ac114fe
3 changed files with 38 additions and 31 deletions

View File

@ -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); // 特种作业证书编号验证

View File

@ -91,15 +91,13 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特种作业证书有效期" prop="VALID_TIME">
<el-form-item label="证书到期时间" prop="VALID_ETIME">
<el-date-picker
v-model="form.VALID_TIME"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
v-model="form.VALID_ETIME"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:disabled-date="fnDisabledDate"
type="date"
/>
</el-form-item>
</el-col>
@ -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("提交成功");

View File

@ -51,7 +51,7 @@
<layout-table
ref="tableRef"
v-model:pagination="pagination"
row-key="PERSONNELMANAGEMENT_ID"
row-key="SPECIALOPERATIONS_ID"
:data="list"
@get-data="fnGetData"
>
@ -65,8 +65,8 @@
<el-table-column label="单位名称">
<template #default="{ row }">
{{
row.PERSONNELMANAGEMENT_ID === CORPINFO_ID
? CORP_NAME
row.UNITS_ID === CORPINFO_ID
? row.CREATOR_CORP_NAME
: row.UNITS_NAME
}}
</template>
@ -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)"
>
删除
</el-button>
@ -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 });