From c87165a43d0ea1ab2995ee00b5684e019fa654cf Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期二, 24 三月 2026 17:53:58 +0800
Subject: [PATCH] feat(production): 更新工单页面检品数量输入组件并添加批号等字段
---
src/views/personnelManagement/employeeRecord/index.vue | 146 +++++++++++++++++++++++++++++-------------------
1 files changed, 89 insertions(+), 57 deletions(-)
diff --git a/src/views/personnelManagement/employeeRecord/index.vue b/src/views/personnelManagement/employeeRecord/index.vue
index 4c2e296..e5f2e8b 100644
--- a/src/views/personnelManagement/employeeRecord/index.vue
+++ b/src/views/personnelManagement/employeeRecord/index.vue
@@ -19,9 +19,9 @@
>
</div>
<div>
-<!-- <el-button type="primary" @click="openForm('add')">鏂板鍏ヨ亴</el-button>-->
+ <el-button type="primary" @click="openFormNewOrEditFormDia('add')">鏂板鍏ヨ亴</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
-<!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
+ <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
</div>
</div>
<div class="table_list">
@@ -37,17 +37,26 @@
:total="page.total"
></PIMTable>
</div>
- <form-dia ref="formDia" @close="handleQuery"></form-dia>
+ <show-form-dia ref="formDia" @close="handleQuery"></show-form-dia>
+ <new-or-edit-form-dia ref="formDiaNewOrEditFormDia" @close="handleQuery"></new-or-edit-form-dia>
+ <renew-contract
+ v-if="isShowRenewContractModal"
+ v-model:visible="isShowRenewContractModal"
+ :id="id"
+ @completed="handleQuery"
+ />
</div>
</template>
<script setup>
import { Search } from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
-import FormDia from "@/views/personnelManagement/employeeRecord/components/formDia.vue";
import {ElMessageBox} from "element-plus";
-import {staffOnJobListPage} from "@/api/personnelManagement/employeeRecord.js";
+import {batchDeleteStaffOnJobs, staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
import dayjs from "dayjs";
+const NewOrEditFormDia = defineAsyncComponent(() => import("@/views/personnelManagement/employeeRecord/components/NewOrEditFormDia.vue"));
+const ShowFormDia = defineAsyncComponent(() => import( "@/views/personnelManagement/employeeRecord/components/Show.vue"));
+const RenewContract = defineAsyncComponent(() => import( "@/views/personnelManagement/employeeRecord/components/RenewContract.vue"));
const data = reactive({
searchForm: {
@@ -58,6 +67,8 @@
},
});
const { searchForm } = toRefs(data);
+const isShowRenewContractModal = ref(false);
+const id = ref(0);
const tableColumn = ref([
{
label: "鐘舵��",
@@ -91,82 +102,71 @@
prop: "staffName",
},
{
+ label: "鍒悕",
+ prop: "alias",
+ },
+ {
+ label: "鎵嬫満",
+ prop: "phone",
+ width: 150,
+ },
+ {
label: "鎬у埆",
prop: "sex",
},
{
- label: "鎴风睄浣忓潃",
- prop: "nativePlace",
- },
- {
- label: "宀椾綅",
- prop: "postJob",
- },
- {
- label: "鐜颁綇鍧�",
- prop: "adress",
- width:200
- },
- {
- label: "绗竴瀛﹀巻",
- prop: "firstStudy",
- },
- {
- label: "涓撲笟",
- prop: "profession",
- width:100
- },
- {
- label: "韬唤璇佸彿",
- prop: "identityCard",
- width:200
+ label: "鍑虹敓鏃ユ湡",
+ prop: "birthDate",
+ width: 120,
},
{
label: "骞撮緞",
prop: "age",
},
{
- label: "鑱旂郴鐢佃瘽",
- prop: "phone",
- width:150
+ label: "绫嶈疮",
+ prop: "nativePlace",
},
{
- label: "绱ф�ヨ仈绯讳汉",
- prop: "emergencyContact",
- width: 120
+ label: "姘戞棌",
+ prop: "nation",
+ width: 100,
},
{
- label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
- prop: "emergencyContactPhone",
- width:150
- },
- {
- label: "鍚堝悓骞撮檺",
- prop: "contractTerm",
- },
- // {
- // label: "鍚堝悓寮�濮嬫棩鏈�",
- // prop: "contractStartTime",
- // width: 120
- // },
- {
- label: "鍚堝悓缁撴潫鏃ユ湡",
- prop: "contractExpireTime",
- width: 120
+ label: "濠氬Щ鐘跺喌",
+ prop: "maritalStatus",
+ width: 100,
},
{
dataType: "action",
label: "鎿嶄綔",
align: "center",
fixed: 'right',
+ width: 180,
operation: [
{
- name: "璇︽儏",
+ name: "缂栬緫",
type: "text",
clickFun: (row) => {
- openForm("edit", row);
+ openFormNewOrEditFormDia("edit", row);
},
},
+ {
+ name: "缁鍚堝悓",
+ type: "text",
+ showHide: row => row.staffState === 1,
+ clickFun: (row) => {
+ isShowRenewContractModal.value = true;
+ id.value = row.id;
+ },
+ },
+ // {
+ // name: "璇︽儏",
+ // type: "text",
+ // clickFun: (row) => {
+ // openForm("edit", row);
+ // },
+ // },
],
},
]);
@@ -179,6 +179,7 @@
total: 0
});
const formDia = ref()
+const formDiaNewOrEditFormDia = ref()
const { proxy } = getCurrentInstance()
const changeDaterange = (value) => {
@@ -205,7 +206,7 @@
tableLoading.value = true;
const params = { ...searchForm.value, ...page };
params.entryDate = undefined
- staffOnJobListPage({...params, staffState: 1}).then(res => {
+ staffOnJobListPage({...params}).then(res => {
tableLoading.value = false;
tableData.value = res.data.records
page.total = res.data.total;
@@ -224,6 +225,37 @@
formDia.value?.openDialog(type, row)
})
};
+const openFormNewOrEditFormDia = (type, row) => {
+ nextTick(() => {
+ formDiaNewOrEditFormDia.value?.openDialog(type, row)
+ })
+};
+
+// 鍒犻櫎
+const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ ids = selectedRows.value.map((item) => item.id);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ batchDeleteStaffOnJobs(ids).then((res) => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+
// 瀵煎嚭
const handleOut = () => {
ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
@@ -232,7 +264,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/staff/staffOnJob/export", {staffState: 1}, "鍦ㄨ亴鍛樺伐鍙拌处.xlsx");
+ proxy.download("/staff/staffOnJob/export", {staffState: 1}, "鍛樺伐鍙拌处.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
--
Gitblit v1.9.3