From 4d3882045d317ddb3c7416f606ac738ca6ec2c01 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期三, 23 七月 2025 10:21:05 +0800 Subject: [PATCH] 1.生产管理联调 --- src/views/productionManagement/operationScheduling/index.vue | 133 ++++++++++++++++++++++++++------------------ 1 files changed, 78 insertions(+), 55 deletions(-) diff --git a/src/views/productionManagement/operationScheduling/index.vue b/src/views/productionManagement/operationScheduling/index.vue index ca4bae6..3b35180 100644 --- a/src/views/productionManagement/operationScheduling/index.vue +++ b/src/views/productionManagement/operationScheduling/index.vue @@ -16,8 +16,9 @@ </el-form-item> <el-form-item label="鐘舵��:"> <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" style="width: 140px" clearable> - <el-option label="宸叉帓浜�" :value="1"></el-option> - <el-option label="寰呮帓浜�" :value="0"></el-option> + <el-option label="寰呮帓浜�" :value="1"></el-option> + <el-option label="宸叉帓浜�" :value="0"></el-option> + <el-option label="鎺掍骇涓�" :value="2"></el-option> </el-select> </el-form-item> <el-form-item> @@ -27,8 +28,8 @@ </div> <div class="table_list"> <div style="text-align: right" class="mb10"> - <el-button type="primary" @click="openForm('add')">宸ュ簭鎺掍骇</el-button> - <el-button type="danger" @click="openForm('delete')" plain>鍙栨秷鎺掍骇</el-button> + <el-button type="primary" @click="openForm">宸ュ簭鎺掍骇</el-button> + <el-button type="danger" @click="handleDelete" plain>鍙栨秷鎺掍骇</el-button> </div> <PIMTable rowKey="id" @@ -48,15 +49,15 @@ <script setup> import {onMounted, ref} from "vue"; -import FormDia from "@/views/productionManagement/productionDispatching/components/formDia.vue"; -import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; +import FormDia from "@/views/productionManagement/operationScheduling/components/formDia.vue"; import {ElMessageBox} from "element-plus"; import dayjs from "dayjs"; +import {listPageProcess, productionDispatchDelete} from "@/api/productionManagement/operationScheduling.js"; const data = reactive({ searchForm: { staffName: "", - status: 0, + status: 1, entryDate: [ dayjs().format("YYYY-MM-DD"), dayjs().add(1, "day").format("YYYY-MM-DD"), @@ -68,54 +69,83 @@ const { searchForm } = toRefs(data); const tableColumn = ref([ { - label: "褰曞叆鏃ユ湡", - prop: "staffNo", + label: "鐘舵��", + prop: "status", + dataType: "tag", + formatData: (params) => { + if (params == 0) { + return "宸叉帓浜�"; + } else if (params == 1) { + return "寰呮帓浜�"; + } else { + return '鎺掍骇涓�'; + } + }, + formatType: (params) => { + if (params == 0) { + return "success"; + } else if (params == 1) { + return "primary"; + } else { + return 'warning'; + } + }, + }, + { + label: "娲惧伐鏃ユ湡", + prop: "schedulingDate", + width: 120, + }, + { + label: "娲惧伐浜�", + prop: "schedulingUserName", }, { label: "鍚堝悓鍙�", - prop: "staffName", + prop: "salesContractNo", + width: 200, }, { label: "瀹㈡埛鍚堝悓鍙�", - prop: "addressPhone", - width: 250, + prop: "customerContractNo", + width: 200, }, { label: "瀹㈡埛鍚嶇О", - prop: "contactPerson", + prop: "customerName", + width: 200, }, { label: "椤圭洰鍚嶇О", - prop: "contactPhone", - width:150 + prop: "projectName", + width:300 }, { label: "浜у搧澶х被", - prop: "basicBankAccount", - width: 220, + prop: "productCategory", + width: 150, }, { label: "瑙勬牸鍨嬪彿", - prop: "bankAccount", - width: 220, + prop: "specificationModel", + width: 150, }, { label: "鍗曚綅", - prop: "bankCode", - width:220 + prop: "unit", }, { - label: "鏁伴噺", - prop: "maintainer", + label: "鎺掍骇鎬绘暟", + prop: "schedulingNum", }, { - label: "鎺掍骇鏁伴噺", - prop: "maintenanceTime", + label: "宸叉帓浜ф暟閲�", + prop: "successNum", width: 100, }, { - label: "寰呮帓鏁伴噺", - prop: "maintenanceTime", + label: "寰呮帓浜ф暟閲�", + prop: "pendingNum", width: 100, }, ]); @@ -138,11 +168,11 @@ }; const changeDaterange = (value) => { if (value) { - searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); - searchForm.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); + searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); + searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); } else { - searchForm.entryDateStart = undefined; - searchForm.entryDateEnd = undefined; + searchForm.value.entryDateStart = undefined; + searchForm.value.entryDateEnd = undefined; } handleQuery(); }; @@ -153,9 +183,14 @@ }; const getList = () => { tableLoading.value = true; - staffJoinListPage({...page, ...searchForm.value}).then(res => { + const params = { ...searchForm.value, ...page }; + params.entryDate = undefined + listPageProcess(params).then(res => { tableLoading.value = false; - tableData.value = res.data.records + tableData.value = res.data.records.map(item => ({ + ...item, + pendingNum: (Number(item.schedulingNum) || 0) - (Number(item.successNum) || 0) + })); page.total = res.data.total; }).catch(err => { tableLoading.value = false; @@ -172,12 +207,12 @@ proxy.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�"); return; } - if (selectedRows.value[0].unPaymentAmountTotal == 0) { - proxy.$message.warning("鏃犻渶鍐嶄粯娆�"); + if (selectedRows.value[0].pendingNum == 0) { + proxy.$message.warning("鏃犻渶鍐嶆帓浜�"); return; } nextTick(() => { - formDia.value?.openDialog(type, row) + formDia.value?.openDialog(type, selectedRows.value[0]) }) }; @@ -190,30 +225,18 @@ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁"); return; } - ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", { + ElMessageBox.confirm("鏄惁纭鍙栨秷鎺掍骇锛�", "鍒犻櫎鎻愮ず", { confirmButtonText: "纭", cancelButtonText: "鍙栨秷", type: "warning", }) .then(() => { - staffJoinDel(ids).then((res) => { - proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - getList(); - }); - }) - .catch(() => { - proxy.$modal.msg("宸插彇娑�"); - }); -}; -// 瀵煎嚭 -const handleOut = () => { - ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", { - confirmButtonText: "纭", - cancelButtonText: "鍙栨秷", - type: "warning", - }) - .then(() => { - proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 1}, "浜哄憳鍏ヨ亴.xlsx"); + tableLoading.value = true; + productionDispatchDelete(ids) + .then((res) => { + proxy.$modal.msgSuccess("鍙栨秷鎺掍骇鎴愬姛"); + getList(); + }) }) .catch(() => { proxy.$modal.msg("宸插彇娑�"); -- Gitblit v1.9.3