From 70ecfcddb4a414e58cdde6dcb8246b7b80ed9ed8 Mon Sep 17 00:00:00 2001 From: maven <2163098428@qq.com> Date: 星期三, 23 七月 2025 14:14:09 +0800 Subject: [PATCH] yys 人事,质量,设备增加时间筛选 --- src/views/qualityManagement/rawMaterialInspection/index.vue | 107 ++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 72 insertions(+), 35 deletions(-) diff --git a/src/views/qualityManagement/rawMaterialInspection/index.vue b/src/views/qualityManagement/rawMaterialInspection/index.vue index 29e52df..bbee1bc 100644 --- a/src/views/qualityManagement/rawMaterialInspection/index.vue +++ b/src/views/qualityManagement/rawMaterialInspection/index.vue @@ -2,15 +2,18 @@ <div class="app-container"> <div class="search_form"> <div> - <span class="search_title">濮撳悕锛�</span> + <span class="search_title">渚涘簲鍟嗭細</span> <el-input - v-model="searchForm.staffName" + v-model="searchForm.supplier" style="width: 240px" - placeholder="璇疯緭鍏ュ鍚嶆悳绱�" + placeholder="璇疯緭鍏ヤ緵搴斿晢鎼滅储" @change="handleQuery" clearable :prefix-icon="Search" /> + <span style="margin-left: 10px" class="search_title">妫�娴嬫棩鏈燂細</span> + <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" + placeholder="璇烽�夋嫨" clearable @change="changeDaterange" /> <el-button type="primary" @click="handleQuery" style="margin-left: 10px" >鎼滅储</el-button > @@ -34,76 +37,80 @@ :total="page.total" ></PIMTable> </div> - <form-dia ref="formDia" @close="handleQuery"></form-dia> + <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> + <FormDia ref="formDia" @close="handleQuery"></FormDia> + <files-dia ref="filesDia" @close="handleQuery"></files-dia> </div> </template> <script setup> import { Search } from "@element-plus/icons-vue"; import {onMounted, ref} from "vue"; +import InspectionFormDia from "@/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue"; import FormDia from "@/views/qualityManagement/rawMaterialInspection/components/formDia.vue"; -import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; import {ElMessageBox} from "element-plus"; +import {qualityInspectDel, qualityInspectListPage} from "@/api/qualityManagement/rawMaterialInspection.js"; +import FilesDia from "@/views/qualityManagement/rawMaterialInspection/components/filesDia.vue"; +import dayjs from "dayjs"; const data = reactive({ searchForm: { - staffName: "", + supplier: "", + entryDate: [ + dayjs().format("YYYY-MM-DD"), + dayjs().add(1, "day").format("YYYY-MM-DD"), + ], // 褰曞叆鏃ユ湡 + entryDateStart: dayjs().format("YYYY-MM-DD"), + entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"), }, }); const { searchForm } = toRefs(data); const tableColumn = ref([ { label: "妫�娴嬫棩鏈�", - prop: "staffNo", + prop: "checkTime", + width: 120 }, { label: "渚涘簲鍟�", - prop: "staffName", + prop: "supplier", + width: 230 }, { label: "妫�楠屽憳", - prop: "sex", + prop: "checkName", }, { label: "浜у搧鍚嶇О", - prop: "nativePlace", + prop: "productName", }, { label: "瑙勬牸鍨嬪彿", - prop: "nativePlace", + prop: "model", }, { label: "鍗曚綅", - prop: "nativePlace", + prop: "unit", }, { label: "鏁伴噺", - prop: "contractStartTime", + prop: "quantity", width: 120 }, { label: "妫�娴嬪崟浣�", - prop: "contractEndTime", + prop: "checkCompany", width: 120 }, { label: "妫�娴嬬粨鏋�", - prop: "staffState", + prop: "checkResult", dataType: "tag", - formatData: (params) => { - if (params == 0) { - return "绂昏亴"; - } else if (params == 1) { - return "鍦ㄨ亴"; - } else { - return null; - } - }, formatType: (params) => { - if (params == 0) { + if (params == '涓嶅悎鏍�') { return "danger"; - } else if (params == 1) { - return "primary"; + } else if (params == '鍚堟牸') { + return "success"; } else { return null; } @@ -114,20 +121,27 @@ label: "鎿嶄綔", align: "center", fixed: "right", - width: 160, + width: 190, operation: [ { - name: "鏂板妫�楠岃褰�", + name: "缂栬緫", type: "text", clickFun: (row) => { openForm("edit", row); }, }, { + name: "鏂板妫�楠岃褰�", + type: "text", + clickFun: (row) => { + openInspectionForm("edit", row); + }, + }, + { name: "闄勪欢", type: "text", clickFun: (row) => { - openForm("edit", row); + openFilesFormDia(row); }, }, ], @@ -142,8 +156,18 @@ total: 0 }); const formDia = ref() +const filesDia = ref() +const inspectionFormDia = ref() const { proxy } = getCurrentInstance() - +const changeDaterange = (value) => { + searchForm.value.entryDateStart = undefined; + searchForm.value.entryDateEnd = undefined; + if (value) { + searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); + searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); + } + getList(); +}; // 鏌ヨ鍒楄〃 /** 鎼滅储鎸夐挳鎿嶄綔 */ const handleQuery = () => { @@ -157,11 +181,12 @@ }; const getList = () => { tableLoading.value = true; - staffJoinListPage({...page, ...searchForm.value, staffState: 0}).then(res => { + const params = { ...searchForm.value, ...page }; + params.entryDate = undefined + qualityInspectListPage({...params, inspectType: 0}).then(res => { tableLoading.value = false; tableData.value = res.data.records page.total = res.data.total; - console.log(page) }).catch(err => { tableLoading.value = false; }) @@ -175,6 +200,18 @@ const openForm = (type, row) => { nextTick(() => { formDia.value?.openDialog(type, row) + }) +}; +// 鎵撳紑鏂板妫�楠屽脊妗� +const openInspectionForm = (type, row) => { + nextTick(() => { + inspectionFormDia.value?.openDialog(type, row) + }) +}; +// 鎵撳紑闄勪欢寮规 +const openFilesFormDia = (type, row) => { + nextTick(() => { + filesDia.value?.openDialog(type, row) }) }; @@ -193,7 +230,7 @@ type: "warning", }) .then(() => { - staffJoinDel(ids).then((res) => { + qualityInspectDel(ids).then((res) => { proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛"); getList(); }); @@ -210,7 +247,7 @@ type: "warning", }) .then(() => { - proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 0}, "浜哄憳绂昏亴.xlsx"); + proxy.download("/quality/qualityInspect/export", {inspectType: 0}, "鍘熸潗鏂欐楠�.xlsx"); }) .catch(() => { proxy.$modal.msg("宸插彇娑�"); -- Gitblit v1.9.3