From 3712799f3e0904f28e4268deaa5c5ee291323c38 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 08 一月 2026 09:27:53 +0800
Subject: [PATCH] 军泰伟业 1.迁移仓库
---
src/views/personnelManagement/scheduling/index.vue | 307
src/api/productionManagement/workOrder.js | 25
src/views/basicData/product/index.vue | 90
src/views/qualityManagement/rawMaterialInspection/index.vue | 2
src/views/productionManagement/productionDispatching/index.vue | 464 +
src/views/qualityManagement/finalInspection/index.vue | 2
src/views/salesManagement/paymentShipping/index.vue | 27
src/views/qualityManagement/processInspection/index.vue | 2
src/views/productionManagement/productStructure/index.vue | 101
src/views/salesManagement/invoiceLedger/index.vue | 89
src/api/personnelManagement/payrollManagement.js | 16
src/views/productionManagement/processRoute/New.vue | 163
src/views/inventoryManagement/receiptManagement/index.vue | 374 -
src/views/inventoryManagement/stockManagement/index.vue | 338
src/views/equipmentManagement/calibration/index.vue | 38
src/views/equipmentManagement/ledger/index.vue | 59
src/views/procurementManagement/invoiceEntry/components/Modal.vue | 916 ++-
src/views/inventoryManagement/dispatchLog/index.vue | 162
src/views/personnelManagement/onboarding/index.vue | 4
src/views/reportAnalysis/projectProfit/index.vue | 10
src/api/productionManagement/productionReporting.js | 10
src/views/financialManagement/revenueManagement/index.vue | 9
src/views/productionManagement/productStructure/StructureEdit.vue | 304 +
multiple/assets/logo/JTWYLogo.png | 0
src/api/productionManagement/productionProductOutput.js | 11
src/views/customerService/feedbackRegistration/index.vue | 9
src/api/viewIndex.js | 16
src/views/salesManagement/orderManagement/index.vue | 20
src/views/collaborativeApproval/approvalProcess/fileList.vue | 26
src/views/inventoryManagement/receiptManagement/components/formDia.vue | 615 +-
src/views/salesManagement/receiptPaymentHistory/index.vue | 42
src/views/collaborativeApproval/noticeManagement/index.vue | 93
src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue | 48
src/views/procurementManagement/procurementInvoiceLedger/index.vue | 63
src/views/productionManagement/processRoute/index.vue | 184
src/views/basicData/supplierManage/index.vue | 13
src/views/salesManagement/invoiceLedger/fileList.vue | 67
src/views/personnelManagement/employeeRecord/components/formDia.vue | 166
src/views/reportAnalysis/dataDashboard/index.vue | 30
src/views/procurementManagement/invoiceEntry/index.vue | 22
src/views/collaborativeApproval/approvalProcess/index.vue | 12
src/views/personnelManagement/onboarding/components/formDiaXJHT.vue | 100
src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue | 1
src/views/procurementManagement/paymentEntry/index.vue | 4
src/views/salesManagement/salesLedger/index.vue | 214
src/api/personnelManagement/employeeRecord.js | 9
src/api/productionManagement/processRouteItem.js | 19
src/api/productionManagement/processRoute.js | 34
src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue | 16
src/views/salesManagement/salesLedger/fileList.vue | 26
src/views/equipmentManagement/upkeep/Modal/PlanModal.vue | 2
src/api/system/user.js | 7
src/views/procurementManagement/procurementReport/index.vue | 11
src/views/salesManagement/receiptPayment/index.vue | 51
src/views/productionManagement/productionReporting/Output.vue | 107
src/components/PIMTable/PIMTable.vue | 5
src/views/equipmentManagement/repair/Form/RepairForm.vue | 17
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue | 131
src/views/equipmentManagement/inspectionManagement/index.vue | 509 +-
src/views/salesManagement/invoiceRegistration/index.vue | 1256 ++--
src/views/productionManagement/productionReporting/Input.vue | 107
src/views/qualityManagement/finalInspection/components/filesDia.vue | 15
src/views/customerService/expiryAfterSales/index.vue | 2
src/api/inventoryManagement/stockOut.js | 12
multiple/assets/favicon/JTWYico.ico | 0
src/api/basicData/productModel.js | 9
src/views/productionManagement/productionReporting/components/formDia.vue | 54
src/views/index.vue | 134
src/views/productionManagement/productionProcess/index.vue | 189
src/views/basicData/product/ProductSelectDialog.vue | 163
src/views/personnelManagement/payrollManagement/components/formDia.vue | 168
src/views/personnelManagement/payrollManagement/index.vue | 219
src/views/equipmentManagement/measurementEquipment/components/formDia.vue | 4
src/api/productionManagement/productionOrder.js | 71
src/api/inventoryManagement/stockIn.js | 21
src/views/personnelManagement/contractManagement/index.vue | 42
src/views/productionManagement/productionProcess/Edit.vue | 102
src/views/basicData/customerFile/index.vue | 15
src/components/Upload/FileUpload.vue | 6
vite.config.js | 18
multiple/assets/screen/JTWYView.png | 0
src/views/financialManagement/financialStatements/index.vue | 26
src/views/equipmentManagement/upkeep/index.vue | 22
src/views/qualityManagement/processInspection/components/formDia.vue | 4
src/views/personnelManagement/onboarding/components/formDia.vue | 19
src/views/productionManagement/operationScheduling/components/formDia.vue | 121
src/views/equipmentManagement/repair/Modal/RepairModal.vue | 2
src/views/inventoryManagement/issueManagement/index.vue | 195
src/views/salesManagement/salesQuotation/index.vue | 11
src/views/productionManagement/operationScheduling/index.vue | 47
src/api/productionManagement/productProcessRoute.js | 28
src/views/financialManagement/expenseManagement/index.vue | 9
src/views/procurementManagement/procurementLedger/index.vue | 109
src/views/equipmentManagement/measurementEquipment/index.vue | 20
src/views/equipmentManagement/repair/Form/MaintainForm.vue | 8
src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue | 153
src/views/productionManagement/productionReporting/index.vue | 877 +-
src/api/productionManagement/productionProductMain.js | 11
src/views/productionManagement/productionOrder/index.vue | 385
src/views/qualityManagement/processInspection/components/filesDia.vue | 27
src/views/equipmentManagement/upkeep/Form/PlanForm.vue | 40
src/api/equipmentManagement/calibration.js | 8
src/views/productionManagement/productionProcess/New.vue | 96
src/views/procurementManagement/paymentHistory/index.vue | 10
src/api/personnelManagement/scheduling.js | 7
src/api/productionManagement/productionProductInput.js | 11
multiple/config.json | 22
src/views/productionManagement/workOrder/index.vue | 559 ++
src/views/equipmentManagement/inspectionManagement/components/formDia.vue | 382
src/views/productionManagement/productionDispatching/components/formDia.vue | 25
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue | 104
src/views/productionManagement/processRoute/ItemsForm.vue | 531 ++
src/api/productionManagement/productStructure.js | 18
src/views/basicData/product/ImportExcel/index.vue | 14
src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue | 228
src/views/qualityManagement/finalInspection/components/formDia.vue | 4
src/api/productionManagement/productionProcess.js | 51
src/views/productionManagement/productionCosting/index.vue | 32
src/views/equipmentManagement/repair/index.vue | 3
src/views/productionManagement/productionOrder/ProcessRouteItemForm.vue | 555 ++
src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue | 17
src/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue | 4
src/views/procurementManagement/procurementInvoiceLedger/fileList.vue | 91
src/views/equipmentManagement/inspectionManagement/components/viewFiles.vue | 4
src/views/procurementManagement/paymentLedger/index.vue | 21
/dev/null | 0
src/views/personnelManagement/dimission/components/formDia.vue | 4
src/views/salesManagement/indicatorStats/index.vue | 4
package.json | 1
src/components/PIMTable/Pagination.vue | 2
src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue | 165
src/views/personnelManagement/contractManagement/filesDia.vue | 16
src/views/productionManagement/processRoute/Edit.vue | 168
133 files changed, 9,351 insertions(+), 4,739 deletions(-)
diff --git a/multiple/assets/favicon/AYNMico.ico b/multiple/assets/favicon/AYNMico.ico
deleted file mode 100644
index 42f5b4a..0000000
--- a/multiple/assets/favicon/AYNMico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/BDSMico.ico b/multiple/assets/favicon/BDSMico.ico
deleted file mode 100644
index 890782c..0000000
--- a/multiple/assets/favicon/BDSMico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/BHMY.ico b/multiple/assets/favicon/BHMY.ico
deleted file mode 100644
index 868632b..0000000
--- a/multiple/assets/favicon/BHMY.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/CJNYico.ico b/multiple/assets/favicon/CJNYico.ico
deleted file mode 100644
index 5ad6d83..0000000
--- a/multiple/assets/favicon/CJNYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/CMNYico.ico b/multiple/assets/favicon/CMNYico.ico
deleted file mode 100644
index 4536de7..0000000
--- a/multiple/assets/favicon/CMNYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/DHDCico.ico b/multiple/assets/favicon/DHDCico.ico
deleted file mode 100644
index b4c4363..0000000
--- a/multiple/assets/favicon/DHDCico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/DHHBico.ico b/multiple/assets/favicon/DHHBico.ico
deleted file mode 100644
index 4bfd006..0000000
--- a/multiple/assets/favicon/DHHBico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/DZYSico.ico b/multiple/assets/favicon/DZYSico.ico
deleted file mode 100644
index abbfb0a..0000000
--- a/multiple/assets/favicon/DZYSico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HCKXico.ico b/multiple/assets/favicon/HCKXico.ico
deleted file mode 100644
index 22f62da..0000000
--- a/multiple/assets/favicon/HCKXico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HCMYico.ico b/multiple/assets/favicon/HCMYico.ico
deleted file mode 100644
index d7ed334..0000000
--- a/multiple/assets/favicon/HCMYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HGJJico.ico b/multiple/assets/favicon/HGJJico.ico
deleted file mode 100644
index 19b583b..0000000
--- a/multiple/assets/favicon/HGJJico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HHKJIco.ico b/multiple/assets/favicon/HHKJIco.ico
deleted file mode 100644
index 2554cbf..0000000
--- a/multiple/assets/favicon/HHKJIco.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HSMYico.ico b/multiple/assets/favicon/HSMYico.ico
deleted file mode 100644
index d43a485..0000000
--- a/multiple/assets/favicon/HSMYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HSXico.ico b/multiple/assets/favicon/HSXico.ico
deleted file mode 100644
index 500081c..0000000
--- a/multiple/assets/favicon/HSXico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HXGYico.ico b/multiple/assets/favicon/HXGYico.ico
deleted file mode 100644
index 6182687..0000000
--- a/multiple/assets/favicon/HXGYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HXSJico.ico b/multiple/assets/favicon/HXSJico.ico
deleted file mode 100644
index 004fef6..0000000
--- a/multiple/assets/favicon/HXSJico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/HYSNico.ico b/multiple/assets/favicon/HYSNico.ico
deleted file mode 100644
index 70148cc..0000000
--- a/multiple/assets/favicon/HYSNico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/JLMYico.ico b/multiple/assets/favicon/JLMYico.ico
deleted file mode 100644
index c41fc33..0000000
--- a/multiple/assets/favicon/JLMYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/JLSNico.ico b/multiple/assets/favicon/JLSNico.ico
deleted file mode 100644
index ea7aed7..0000000
--- a/multiple/assets/favicon/JLSNico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/JMSLico.ico b/multiple/assets/favicon/JMSLico.ico
deleted file mode 100644
index 2b049ed..0000000
--- a/multiple/assets/favicon/JMSLico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/JSMYico.ico b/multiple/assets/favicon/JSMYico.ico
deleted file mode 100644
index 81352d8..0000000
--- a/multiple/assets/favicon/JSMYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/JSYNYico.ico b/multiple/assets/favicon/JSYNYico.ico
deleted file mode 100644
index 0d831be..0000000
--- a/multiple/assets/favicon/JSYNYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/JTWYico.ico b/multiple/assets/favicon/JTWYico.ico
new file mode 100644
index 0000000..bf07a70
--- /dev/null
+++ b/multiple/assets/favicon/JTWYico.ico
Binary files differ
diff --git a/multiple/assets/favicon/JYHJico.ico b/multiple/assets/favicon/JYHJico.ico
deleted file mode 100644
index 47dbc30..0000000
--- a/multiple/assets/favicon/JYHJico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/JZYJico.ico b/multiple/assets/favicon/JZYJico.ico
deleted file mode 100644
index f5a7820..0000000
--- a/multiple/assets/favicon/JZYJico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/LQMico.ico b/multiple/assets/favicon/LQMico.ico
deleted file mode 100644
index f59c6a9..0000000
--- a/multiple/assets/favicon/LQMico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/MKZSico.ico b/multiple/assets/favicon/MKZSico.ico
deleted file mode 100644
index 559a417..0000000
--- a/multiple/assets/favicon/MKZSico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/MXSCIco.ico b/multiple/assets/favicon/MXSCIco.ico
deleted file mode 100644
index 2214848..0000000
--- a/multiple/assets/favicon/MXSCIco.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/NYDLico.ico b/multiple/assets/favicon/NYDLico.ico
deleted file mode 100644
index 73c9f4a..0000000
--- a/multiple/assets/favicon/NYDLico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/PHMKico.ico b/multiple/assets/favicon/PHMKico.ico
deleted file mode 100644
index dd5b404..0000000
--- a/multiple/assets/favicon/PHMKico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/QLMCico.ico b/multiple/assets/favicon/QLMCico.ico
deleted file mode 100644
index 8a51d67..0000000
--- a/multiple/assets/favicon/QLMCico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/RTSWico.ico b/multiple/assets/favicon/RTSWico.ico
deleted file mode 100644
index 585d1be..0000000
--- a/multiple/assets/favicon/RTSWico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/RZNY.ico b/multiple/assets/favicon/RZNY.ico
deleted file mode 100644
index c2f4ba5..0000000
--- a/multiple/assets/favicon/RZNY.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/SQDico.ico b/multiple/assets/favicon/SQDico.ico
deleted file mode 100644
index cd34955..0000000
--- a/multiple/assets/favicon/SQDico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/TJKHico.ico b/multiple/assets/favicon/TJKHico.ico
deleted file mode 100644
index 550db27..0000000
--- a/multiple/assets/favicon/TJKHico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/TJXM.ico b/multiple/assets/favicon/TJXM.ico
deleted file mode 100644
index dcc4fa5..0000000
--- a/multiple/assets/favicon/TJXM.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/TYMKico.ico b/multiple/assets/favicon/TYMKico.ico
deleted file mode 100644
index 0fbc2d1..0000000
--- a/multiple/assets/favicon/TYMKico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/WDSYico.ico b/multiple/assets/favicon/WDSYico.ico
deleted file mode 100644
index bfad99c..0000000
--- a/multiple/assets/favicon/WDSYico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/XYHBico.ico b/multiple/assets/favicon/XYHBico.ico
deleted file mode 100644
index 3bee1fc..0000000
--- a/multiple/assets/favicon/XYHBico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/ZDXMico.ico b/multiple/assets/favicon/ZDXMico.ico
deleted file mode 100644
index 0fb0a1d..0000000
--- a/multiple/assets/favicon/ZDXMico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/ZQHXico.ico b/multiple/assets/favicon/ZQHXico.ico
deleted file mode 100644
index 748238e..0000000
--- a/multiple/assets/favicon/ZQHXico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/ZYRQico.ico b/multiple/assets/favicon/ZYRQico.ico
deleted file mode 100644
index 8be95d0..0000000
--- a/multiple/assets/favicon/ZYRQico.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/favicon/favicon.ico b/multiple/assets/favicon/favicon.ico
deleted file mode 100644
index 0fb0a1d..0000000
--- a/multiple/assets/favicon/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/AYNMLogo.png b/multiple/assets/logo/AYNMLogo.png
deleted file mode 100644
index 7f64b20..0000000
--- a/multiple/assets/logo/AYNMLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/BDSMLogo.png b/multiple/assets/logo/BDSMLogo.png
deleted file mode 100644
index 07d0fe9..0000000
--- a/multiple/assets/logo/BDSMLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/BHMYLogo.png b/multiple/assets/logo/BHMYLogo.png
deleted file mode 100644
index f0e779c..0000000
--- a/multiple/assets/logo/BHMYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/CJNYLogo.png b/multiple/assets/logo/CJNYLogo.png
deleted file mode 100644
index e4e9d73..0000000
--- a/multiple/assets/logo/CJNYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/CMNYLogo.png b/multiple/assets/logo/CMNYLogo.png
deleted file mode 100644
index 202664a..0000000
--- a/multiple/assets/logo/CMNYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/DHDCLogo.png b/multiple/assets/logo/DHDCLogo.png
deleted file mode 100644
index 139bdd1..0000000
--- a/multiple/assets/logo/DHDCLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/DHHBLogo.png b/multiple/assets/logo/DHHBLogo.png
deleted file mode 100644
index 0c6d832..0000000
--- a/multiple/assets/logo/DHHBLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/DZYSLogo.png b/multiple/assets/logo/DZYSLogo.png
deleted file mode 100644
index 53986b5..0000000
--- a/multiple/assets/logo/DZYSLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HCKXLogo.png b/multiple/assets/logo/HCKXLogo.png
deleted file mode 100644
index e15f67f..0000000
--- a/multiple/assets/logo/HCKXLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HCMYLogo.png b/multiple/assets/logo/HCMYLogo.png
deleted file mode 100644
index 5910ffd..0000000
--- a/multiple/assets/logo/HCMYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HGJJLogo.png b/multiple/assets/logo/HGJJLogo.png
deleted file mode 100644
index a1bc1f1..0000000
--- a/multiple/assets/logo/HGJJLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HHKJLogo.png b/multiple/assets/logo/HHKJLogo.png
deleted file mode 100644
index 018abe6..0000000
--- a/multiple/assets/logo/HHKJLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HSMYLogo.png b/multiple/assets/logo/HSMYLogo.png
deleted file mode 100644
index daec820..0000000
--- a/multiple/assets/logo/HSMYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HSXLogo.png b/multiple/assets/logo/HSXLogo.png
deleted file mode 100644
index c4150c4..0000000
--- a/multiple/assets/logo/HSXLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HXGYLogo.png b/multiple/assets/logo/HXGYLogo.png
deleted file mode 100644
index d21365d..0000000
--- a/multiple/assets/logo/HXGYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HXSJLogo.png b/multiple/assets/logo/HXSJLogo.png
deleted file mode 100644
index 920c1dc..0000000
--- a/multiple/assets/logo/HXSJLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/HYSNLogo.png b/multiple/assets/logo/HYSNLogo.png
deleted file mode 100644
index 70148cc..0000000
--- a/multiple/assets/logo/HYSNLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/JLMYLogo.png b/multiple/assets/logo/JLMYLogo.png
deleted file mode 100644
index 4a09b97..0000000
--- a/multiple/assets/logo/JLMYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/JLSNLogo.png b/multiple/assets/logo/JLSNLogo.png
deleted file mode 100644
index ff94cd7..0000000
--- a/multiple/assets/logo/JLSNLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/JMSLLogo.png b/multiple/assets/logo/JMSLLogo.png
deleted file mode 100644
index 8835d46..0000000
--- a/multiple/assets/logo/JMSLLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/JSMYLogo.png b/multiple/assets/logo/JSMYLogo.png
deleted file mode 100644
index 512ad75..0000000
--- a/multiple/assets/logo/JSMYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/JSYNYLogo.png b/multiple/assets/logo/JSYNYLogo.png
deleted file mode 100644
index 6d8f65d..0000000
--- a/multiple/assets/logo/JSYNYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/JTWYLogo.png b/multiple/assets/logo/JTWYLogo.png
new file mode 100644
index 0000000..a2c17f5
--- /dev/null
+++ b/multiple/assets/logo/JTWYLogo.png
Binary files differ
diff --git a/multiple/assets/logo/JYHJLogo.png b/multiple/assets/logo/JYHJLogo.png
deleted file mode 100644
index c121f92..0000000
--- a/multiple/assets/logo/JYHJLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/JZYJLogo.png b/multiple/assets/logo/JZYJLogo.png
deleted file mode 100644
index b50afc2..0000000
--- a/multiple/assets/logo/JZYJLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/LQMLogo.png b/multiple/assets/logo/LQMLogo.png
deleted file mode 100644
index 84ef782..0000000
--- a/multiple/assets/logo/LQMLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/MKZSLogo.png b/multiple/assets/logo/MKZSLogo.png
deleted file mode 100644
index a7079a5..0000000
--- a/multiple/assets/logo/MKZSLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/MXSCLogo.png b/multiple/assets/logo/MXSCLogo.png
deleted file mode 100644
index 1ece4b5..0000000
--- a/multiple/assets/logo/MXSCLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/NYDLLogo.png b/multiple/assets/logo/NYDLLogo.png
deleted file mode 100644
index 27738e4..0000000
--- a/multiple/assets/logo/NYDLLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/PHMKLogo.png b/multiple/assets/logo/PHMKLogo.png
deleted file mode 100644
index e179c2c..0000000
--- a/multiple/assets/logo/PHMKLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/QLMCLogo.png b/multiple/assets/logo/QLMCLogo.png
deleted file mode 100644
index f94d826..0000000
--- a/multiple/assets/logo/QLMCLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/RTSWLogo.png b/multiple/assets/logo/RTSWLogo.png
deleted file mode 100644
index e53803a..0000000
--- a/multiple/assets/logo/RTSWLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/RZNYLogo.png b/multiple/assets/logo/RZNYLogo.png
deleted file mode 100644
index 5296331..0000000
--- a/multiple/assets/logo/RZNYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/SQDLogo.png b/multiple/assets/logo/SQDLogo.png
deleted file mode 100644
index 271f835..0000000
--- a/multiple/assets/logo/SQDLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/TJKHLogo.png b/multiple/assets/logo/TJKHLogo.png
deleted file mode 100644
index f369979..0000000
--- a/multiple/assets/logo/TJKHLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/TJXMLogo.png b/multiple/assets/logo/TJXMLogo.png
deleted file mode 100644
index 0f260e6..0000000
--- a/multiple/assets/logo/TJXMLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/TYMKLogo.png b/multiple/assets/logo/TYMKLogo.png
deleted file mode 100644
index 1da706f..0000000
--- a/multiple/assets/logo/TYMKLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/WDSYLogo.png b/multiple/assets/logo/WDSYLogo.png
deleted file mode 100644
index 3bc9755..0000000
--- a/multiple/assets/logo/WDSYLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/XYHBLogo.png b/multiple/assets/logo/XYHBLogo.png
deleted file mode 100644
index b7989d8..0000000
--- a/multiple/assets/logo/XYHBLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/ZDXMLogo.png b/multiple/assets/logo/ZDXMLogo.png
deleted file mode 100644
index 072a936..0000000
--- a/multiple/assets/logo/ZDXMLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/ZGLTLogo.png b/multiple/assets/logo/ZGLTLogo.png
deleted file mode 100644
index a4a4587..0000000
--- a/multiple/assets/logo/ZGLTLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/ZQHXLogo.png b/multiple/assets/logo/ZQHXLogo.png
deleted file mode 100644
index 6924240..0000000
--- a/multiple/assets/logo/ZQHXLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/ZYRQLogo.png b/multiple/assets/logo/ZYRQLogo.png
deleted file mode 100644
index bc6fe5d..0000000
--- a/multiple/assets/logo/ZYRQLogo.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/logo/logo.png b/multiple/assets/logo/logo.png
deleted file mode 100644
index 072a936..0000000
--- a/multiple/assets/logo/logo.png
+++ /dev/null
Binary files differ
diff --git "a/multiple/assets/logo/\345\215\227\351\200\232\344\272\221\344\273\216\345\267\245\344\270\232\344\272\222\350\201\224\347\275\221\346\234\211\351\231\220\345\205\254\345\217\270.png" "b/multiple/assets/logo/\345\215\227\351\200\232\344\272\221\344\273\216\345\267\245\344\270\232\344\272\222\350\201\224\347\275\221\346\234\211\351\231\220\345\205\254\345\217\270.png"
deleted file mode 100644
index d7ecf59..0000000
--- "a/multiple/assets/logo/\345\215\227\351\200\232\344\272\221\344\273\216\345\267\245\344\270\232\344\272\222\350\201\224\347\275\221\346\234\211\351\231\220\345\205\254\345\217\270.png"
+++ /dev/null
Binary files differ
diff --git "a/multiple/assets/logo/\346\226\260\347\274\206\357\274\210\346\261\237\350\213\217\357\274\211\346\225\260\345\255\227\347\247\221\346\212\200\346\234\211\351\231\220\345\205\254\345\217\270.png" "b/multiple/assets/logo/\346\226\260\347\274\206\357\274\210\346\261\237\350\213\217\357\274\211\346\225\260\345\255\227\347\247\221\346\212\200\346\234\211\351\231\220\345\205\254\345\217\270.png"
deleted file mode 100644
index 4481de2..0000000
--- "a/multiple/assets/logo/\346\226\260\347\274\206\357\274\210\346\261\237\350\213\217\357\274\211\346\225\260\345\255\227\347\247\221\346\212\200\346\234\211\351\231\220\345\205\254\345\217\270.png"
+++ /dev/null
Binary files differ
diff --git "a/multiple/assets/logo/\350\212\257\345\257\274\350\275\257\344\273\266\357\274\210\346\261\237\350\213\217\357\274\211\346\234\211\351\231\220\345\205\254\345\217\270.png" "b/multiple/assets/logo/\350\212\257\345\257\274\350\275\257\344\273\266\357\274\210\346\261\237\350\213\217\357\274\211\346\234\211\351\231\220\345\205\254\345\217\270.png"
deleted file mode 100644
index 5b49e96..0000000
--- "a/multiple/assets/logo/\350\212\257\345\257\274\350\275\257\344\273\266\357\274\210\346\261\237\350\213\217\357\274\211\346\234\211\351\231\220\345\205\254\345\217\270.png"
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/BDSMView.png b/multiple/assets/screen/BDSMView.png
deleted file mode 100644
index 3822931..0000000
--- a/multiple/assets/screen/BDSMView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/DHDCView.png b/multiple/assets/screen/DHDCView.png
deleted file mode 100644
index 7d3e8af..0000000
--- a/multiple/assets/screen/DHDCView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/DHHBView.png b/multiple/assets/screen/DHHBView.png
deleted file mode 100644
index f1928d9..0000000
--- a/multiple/assets/screen/DHHBView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/DZYSView.png b/multiple/assets/screen/DZYSView.png
deleted file mode 100644
index 958c5cc..0000000
--- a/multiple/assets/screen/DZYSView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HCKXView.png b/multiple/assets/screen/HCKXView.png
deleted file mode 100644
index e8574c8..0000000
--- a/multiple/assets/screen/HCKXView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HCMYView.png b/multiple/assets/screen/HCMYView.png
deleted file mode 100644
index bf0a9dc..0000000
--- a/multiple/assets/screen/HCMYView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HGJJView.png b/multiple/assets/screen/HGJJView.png
deleted file mode 100644
index 00575e8..0000000
--- a/multiple/assets/screen/HGJJView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HHKJView.png b/multiple/assets/screen/HHKJView.png
deleted file mode 100644
index 9c39567..0000000
--- a/multiple/assets/screen/HHKJView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HSMYView.png b/multiple/assets/screen/HSMYView.png
deleted file mode 100644
index 201c406..0000000
--- a/multiple/assets/screen/HSMYView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HSXView.png b/multiple/assets/screen/HSXView.png
deleted file mode 100644
index f619ab0..0000000
--- a/multiple/assets/screen/HSXView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HXGYView.png b/multiple/assets/screen/HXGYView.png
deleted file mode 100644
index a1094e8..0000000
--- a/multiple/assets/screen/HXGYView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HXSJView.png b/multiple/assets/screen/HXSJView.png
deleted file mode 100644
index 02dde1c..0000000
--- a/multiple/assets/screen/HXSJView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/HYSNView.png b/multiple/assets/screen/HYSNView.png
deleted file mode 100644
index ccd5fcc..0000000
--- a/multiple/assets/screen/HYSNView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/JLSNView.png b/multiple/assets/screen/JLSNView.png
deleted file mode 100644
index 663b5d5..0000000
--- a/multiple/assets/screen/JLSNView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/JMSLView.png b/multiple/assets/screen/JMSLView.png
deleted file mode 100644
index 65fcfd8..0000000
--- a/multiple/assets/screen/JMSLView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/AYNMView.png b/multiple/assets/screen/JTWYView.png
similarity index 100%
rename from multiple/assets/screen/AYNMView.png
rename to multiple/assets/screen/JTWYView.png
Binary files differ
diff --git a/multiple/assets/screen/JZYJView.png b/multiple/assets/screen/JZYJView.png
deleted file mode 100644
index f64d46b..0000000
--- a/multiple/assets/screen/JZYJView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/LQMView.png b/multiple/assets/screen/LQMView.png
deleted file mode 100644
index 8c0e23d..0000000
--- a/multiple/assets/screen/LQMView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/MKZSView.png b/multiple/assets/screen/MKZSView.png
deleted file mode 100644
index 9033a9a..0000000
--- a/multiple/assets/screen/MKZSView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/MXSCBack.png b/multiple/assets/screen/MXSCBack.png
deleted file mode 100644
index 0beafd5..0000000
--- a/multiple/assets/screen/MXSCBack.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/NYDLView.png b/multiple/assets/screen/NYDLView.png
deleted file mode 100644
index 02249e1..0000000
--- a/multiple/assets/screen/NYDLView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/PHMKView.png b/multiple/assets/screen/PHMKView.png
deleted file mode 100644
index 3fd67ee..0000000
--- a/multiple/assets/screen/PHMKView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/QLMCView.png b/multiple/assets/screen/QLMCView.png
deleted file mode 100644
index 814b628..0000000
--- a/multiple/assets/screen/QLMCView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/RTSWView.png b/multiple/assets/screen/RTSWView.png
deleted file mode 100644
index 02dde1c..0000000
--- a/multiple/assets/screen/RTSWView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/RZNYView.png b/multiple/assets/screen/RZNYView.png
deleted file mode 100644
index 4905096..0000000
--- a/multiple/assets/screen/RZNYView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/SQDView.png b/multiple/assets/screen/SQDView.png
deleted file mode 100644
index f53a22f..0000000
--- a/multiple/assets/screen/SQDView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/TJKHView.png b/multiple/assets/screen/TJKHView.png
deleted file mode 100644
index 958c5cc..0000000
--- a/multiple/assets/screen/TJKHView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/TJXMView.png b/multiple/assets/screen/TJXMView.png
deleted file mode 100644
index e56a8c7..0000000
--- a/multiple/assets/screen/TJXMView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/TYMKView.png b/multiple/assets/screen/TYMKView.png
deleted file mode 100644
index 3449ceb..0000000
--- a/multiple/assets/screen/TYMKView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/WDSYView.png b/multiple/assets/screen/WDSYView.png
deleted file mode 100644
index 19ec19d..0000000
--- a/multiple/assets/screen/WDSYView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/XYHBView.png b/multiple/assets/screen/XYHBView.png
deleted file mode 100644
index 5878cd5..0000000
--- a/multiple/assets/screen/XYHBView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/ZDXMView.png b/multiple/assets/screen/ZDXMView.png
deleted file mode 100644
index 6f6b11d..0000000
--- a/multiple/assets/screen/ZDXMView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/ZQHXView.png b/multiple/assets/screen/ZQHXView.png
deleted file mode 100644
index 1830213..0000000
--- a/multiple/assets/screen/ZQHXView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/assets/screen/ZYRQView.png b/multiple/assets/screen/ZYRQView.png
deleted file mode 100644
index 3487d39..0000000
--- a/multiple/assets/screen/ZYRQView.png
+++ /dev/null
Binary files differ
diff --git a/multiple/config.json b/multiple/config.json
index a760667..9352bb6 100644
--- a/multiple/config.json
+++ b/multiple/config.json
@@ -1,21 +1,21 @@
{
"default": {
"env": {
- "VITE_APP_TITLE": "鑺浜戯紙绠$悊淇℃伅绯荤粺锛�"
+ "VITE_APP_TITLE": "鍐涙嘲浼熶笟淇℃伅绠$悊绯荤粺"
},
- "screen": "screen/SQDView.png",
- "logo": "logo/SQDLogo.png",
- "favicon": "favicon/SQDico.ico"
+ "screen": "screen/JTWYView.png",
+ "logo": "logo/JTWYLogo.png",
+ "favicon": "favicon/JTWYico.ico"
},
- "SQD": {
+ "JTWY": {
"env": {
- "VITE_APP_TITLE": "澶╂触鍙屽鐐圭鐞嗙郴缁�",
- "VITE_BASE_API": "http://114.132.189.42:9042",
- "VITE_JAVA_API": "http://114.132.189.42:9044"
+ "VITE_APP_TITLE": "鍐涙嘲浼熶笟淇℃伅绠$悊绯荤粺",
+ "VITE_BASE_API": "http://114.132.189.42:9123",
+ "VITE_JAVA_API": "http://114.132.189.42:9031"
},
- "screen": "screen/SQDView.png",
- "logo": "logo/SQDLogo.png",
- "favicon": "favicon/SQDico.ico"
+ "screen": "screen/JTWYView.png",
+ "logo": "logo/JTWYLogo.png",
+ "favicon": "favicon/JTWYico.ico"
},
"screen": "/src/assets/images/login-background.png",
"logo": "/src/assets/logo/logo.png",
diff --git a/package.json b/package.json
index fcfbd99..e80e1e7 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,6 @@
"fuse.js": "6.6.2",
"js-beautify": "1.14.11",
"js-cookie": "3.0.5",
- "jsbarcode": "^3.12.1",
"jsencrypt": "3.3.2",
"nprogress": "0.2.0",
"pinia": "2.1.7",
diff --git a/src/api/basicData/productModel.js b/src/api/basicData/productModel.js
new file mode 100644
index 0000000..f048f9e
--- /dev/null
+++ b/src/api/basicData/productModel.js
@@ -0,0 +1,9 @@
+import request from "@/utils/request.js";
+
+export function productModelList(query) {
+ return request({
+ url: '/basic/product/pageModel',
+ method: 'get',
+ params: query
+ })
+}
\ No newline at end of file
diff --git a/src/api/equipmentManagement/calibration.js b/src/api/equipmentManagement/calibration.js
index 54b99f9..b0a9844 100644
--- a/src/api/equipmentManagement/calibration.js
+++ b/src/api/equipmentManagement/calibration.js
@@ -24,4 +24,12 @@
method: "post",
data: query,
});
+}
+// 鍒犻櫎璁板綍
+export function ledgerRecordDelete(ids) {
+ return request({
+ url: "/measuringInstrumentLedgerRecord/delete",
+ method: "delete",
+ data: ids,
+ });
}
\ No newline at end of file
diff --git a/src/api/inventoryManagement/stockIn.js b/src/api/inventoryManagement/stockIn.js
index 5ce4570..70f07a7 100644
--- a/src/api/inventoryManagement/stockIn.js
+++ b/src/api/inventoryManagement/stockIn.js
@@ -117,8 +117,8 @@
// 鍒犻櫎鑷畾涔夊叆搴撲俊鎭�
export function delStockInCustom(ids) {
return request({
- url: '/stockin/deleteCustom',
- method: 'delete',
+ url: '/stockin/delteCustom',
+ method: 'post',
data: ids
})
}
@@ -136,23 +136,6 @@
export function selectProductRecordListByPuechaserId(query) {
return request({
url: '/stockin/productlist',
- method: 'get',
- params: query
- })
-}
-
-// 鑷畾涔夊叆搴�-璇︽儏
-export function detailManagementByCustom(query) {
- return request({
- url: '/stockin/detailManagementByCustom',
- method: 'get',
- params: query
- })
-}
-// 閲囪喘鍏ュ簱-璇︽儏
-export function stockinDetail(query) {
- return request({
- url: '/stockin/detail',
method: 'get',
params: query
})
diff --git a/src/api/inventoryManagement/stockOut.js b/src/api/inventoryManagement/stockOut.js
index 5d410d9..7d188af 100644
--- a/src/api/inventoryManagement/stockOut.js
+++ b/src/api/inventoryManagement/stockOut.js
@@ -1,6 +1,6 @@
import request from "@/utils/request";
-//鏌ヨ鍑哄簱鍒楄〃
+// 鍑哄簱鍙拌处-閲囪喘鍑哄簱鏌ヨ鍑哄簱鍒楄〃
export const getStockOutPage = (params) => {
return request({
url: "/stockmanagement/listPage",
@@ -35,13 +35,3 @@
data: ids
})
}
-
-//瀵煎嚭鍑哄簱淇℃伅
-export const exportStockOut = (query) => {
- return request({
- url: '/stockmanagement/export',
- method: 'get',
- params: query,
- responseType: 'blob'
- })
-}
\ No newline at end of file
diff --git a/src/api/personnelManagement/employeeRecord.js b/src/api/personnelManagement/employeeRecord.js
index 378756a..a4ad34b 100644
--- a/src/api/personnelManagement/employeeRecord.js
+++ b/src/api/personnelManagement/employeeRecord.js
@@ -15,4 +15,13 @@
method: 'get',
params: query,
})
+}
+
+// 瀵煎嚭鍚堝悓鍓湰
+export function staffOnJobExportCopy(data) {
+ return request({
+ url: '/staff/staffOnJob/exportCopy',
+ method: 'post',
+ data: data,
+ })
}
\ No newline at end of file
diff --git a/src/api/personnelManagement/payrollManagement.js b/src/api/personnelManagement/payrollManagement.js
index c29a6b1..c7284d4 100644
--- a/src/api/personnelManagement/payrollManagement.js
+++ b/src/api/personnelManagement/payrollManagement.js
@@ -32,4 +32,20 @@
method: "delete",
data: query,
});
+}
+// 瀵煎叆
+export function importData(query) {
+ return request({
+ url: "/compensationPerformance/importData",
+ method: "post",
+ data: query,
+ });
+}
+// 涓嬭浇妯$増
+export function exportTemplate(query) {
+ return request({
+ url: "/compensationPerformance/exportTemplate",
+ method: "post",
+ data: query,
+ });
}
\ No newline at end of file
diff --git a/src/api/personnelManagement/scheduling.js b/src/api/personnelManagement/scheduling.js
index 8e4b058..67d7c51 100644
--- a/src/api/personnelManagement/scheduling.js
+++ b/src/api/personnelManagement/scheduling.js
@@ -30,3 +30,10 @@
data: data
})
}
+
+export function getCurrentUserLatestScheduling(){
+ return request({
+ url: "/staff/staffScheduling/getCurrentUserLatestScheduling",
+ method: "get"
+ })
+}
\ No newline at end of file
diff --git a/src/api/productionManagement/processRoute.js b/src/api/productionManagement/processRoute.js
new file mode 100644
index 0000000..4d16775
--- /dev/null
+++ b/src/api/productionManagement/processRoute.js
@@ -0,0 +1,34 @@
+// 宸ヨ壓璺嚎椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ
+export function listPage(query) {
+ return request({
+ url: "/processRoute/page",
+ method: "get",
+ params: query,
+ });
+}
+
+export function add(data) {
+ return request({
+ url: "/processRoute",
+ method: "post",
+ data: data,
+ });
+}
+
+export function del(ids) {
+ return request({
+ url: '/processRoute/' + ids,
+ method: 'delete',
+ })
+}
+
+export function update(data) {
+ return request({
+ url: '/processRoute',
+ method: 'put',
+ data: data,
+ })
+}
\ No newline at end of file
diff --git a/src/api/productionManagement/processRouteItem.js b/src/api/productionManagement/processRouteItem.js
new file mode 100644
index 0000000..ad4861c
--- /dev/null
+++ b/src/api/productionManagement/processRouteItem.js
@@ -0,0 +1,19 @@
+// 宸ヨ壓璺嚎椤圭洰椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒楄〃鏌ヨ
+export function findProcessRouteItemList(query) {
+ return request({
+ url: "/processRouteItem/list",
+ method: "get",
+ params: query,
+ });
+}
+
+export function addOrUpdateProcessRouteItem(data) {
+ return request({
+ url: "/processRouteItem",
+ method: "post",
+ data: data,
+ });
+}
\ No newline at end of file
diff --git a/src/api/productionManagement/productProcessRoute.js b/src/api/productionManagement/productProcessRoute.js
new file mode 100644
index 0000000..d756e26
--- /dev/null
+++ b/src/api/productionManagement/productProcessRoute.js
@@ -0,0 +1,28 @@
+// 宸ヨ壓璺嚎椤圭洰椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒楄〃鏌ヨ
+export function findProductProcessRouteItemList(query) {
+ return request({
+ url: "/productProcessRoute/list",
+ method: "get",
+ params: query,
+ });
+}
+
+export function addOrUpdateProductProcessRouteItem(data) {
+ return request({
+ url: "/productProcessRoute/updateRouteItem",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鍒犻櫎瀹㈡埛妗f
+export function deleteRouteItem(ids) {
+ return request({
+ url: '/productProcessRoute/deleteRouteItem',
+ method: 'delete',
+ data: ids
+ })
+}
\ No newline at end of file
diff --git a/src/api/productionManagement/productStructure.js b/src/api/productionManagement/productStructure.js
new file mode 100644
index 0000000..074e27a
--- /dev/null
+++ b/src/api/productionManagement/productStructure.js
@@ -0,0 +1,18 @@
+// 浜у搧缁撴瀯椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ
+export function queryList(id) {
+ return request({
+ url: "/productStructure/listByproductModelId/" + id,
+ method: "get",
+ });
+}
+
+export function add(data) {
+ return request({
+ url: "/productStructure",
+ method: "post",
+ data: data,
+ });
+}
\ No newline at end of file
diff --git a/src/api/productionManagement/productionOrder.js b/src/api/productionManagement/productionOrder.js
index ab3dc06..0c37be1 100644
--- a/src/api/productionManagement/productionOrder.js
+++ b/src/api/productionManagement/productionOrder.js
@@ -9,6 +9,43 @@
params: query,
});
}
+
+
+export function productOrderListPage(query) {
+ return request({
+ url: "/productOrder/page",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鑾峰彇鐐掓満姝e湪宸ヤ綔閲忔暟鎹�
+export function schedulingList(query) {
+ return request({
+ url: "/salesLedger/scheduling/list",
+ method: "get",
+ params: query,
+ });
+}
+
+// 淇濆瓨鐐掓満璁剧疆
+export function addSpeculatTrading(data) {
+ return request({
+ url: "/salesLedger/scheduling/addSpeculatTrading",
+ method: "post",
+ data: data,
+ });
+}
+
+// 淇敼鐐掓満璁剧疆
+export function updateSpeculatTrading(data) {
+ return request({
+ url: "/salesLedger/scheduling/updateSpeculatTrading",
+ method: "post",
+ data: data,
+ });
+}
+
// 鐢熶骇娲惧伐
export function productionDispatch(query) {
return request({
@@ -16,4 +53,38 @@
method: "post",
data: query,
});
+}
+// 鑷姩娲惧伐
+export function productionDispatchList(query) {
+ return request({
+ url: "/salesLedger/scheduling/productionDispatchList",
+ method: "post",
+ data: query,
+ });
+}
+
+// 鏌ヨ鎹熻�楃巼
+export function getLossRate() {
+ return request({
+ url: "/salesLedger/scheduling/loss",
+ method: "get",
+ });
+}
+
+// 鏂板鎹熻�楃巼
+export function addLossRate(data) {
+ return request({
+ url: "/salesLedger/scheduling/addLoss",
+ method: "post",
+ data: data,
+ });
+}
+
+// 淇敼鎹熻�楃巼
+export function updateLossRate(data) {
+ return request({
+ url: "/salesLedger/scheduling/updateLoss",
+ method: "post",
+ data: data,
+ });
}
\ No newline at end of file
diff --git a/src/api/productionManagement/productionProcess.js b/src/api/productionManagement/productionProcess.js
new file mode 100644
index 0000000..e3cd929
--- /dev/null
+++ b/src/api/productionManagement/productionProcess.js
@@ -0,0 +1,51 @@
+// 宸ュ簭椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ
+export function listPage(query) {
+ return request({
+ url: "/productProcess/listPage",
+ method: "get",
+ params: query,
+ });
+}
+
+export function processList(query) {
+ return request({
+ url: "/productProcess/list",
+ method: "get",
+ params: query,
+ });
+}
+
+export function add(data) {
+ return request({
+ url: "/productProcess",
+ method: "post",
+ data: data,
+ });
+}
+
+export function del(data) {
+ return request({
+ url: '/productProcess/batchDelete',
+ method: 'delete',
+ data: data,
+ })
+}
+
+export function update(data) {
+ return request({
+ url: '/productProcess/update',
+ method: 'put',
+ data: data,
+ })
+}
+
+// 宸ュ簭鏌ヨ
+export function list() {
+ return request({
+ url: "/productProcess/list",
+ method: "get",
+ });
+}
\ No newline at end of file
diff --git a/src/api/productionManagement/productionProductInput.js b/src/api/productionManagement/productionProductInput.js
new file mode 100644
index 0000000..f72cd9b
--- /dev/null
+++ b/src/api/productionManagement/productionProductInput.js
@@ -0,0 +1,11 @@
+// 鐢熶骇鎶曞叆椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ
+export function productionProductInputListPage(query) {
+ return request({
+ url: "/productionProductInput/listPage",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/api/productionManagement/productionProductMain.js b/src/api/productionManagement/productionProductMain.js
new file mode 100644
index 0000000..0493f8b
--- /dev/null
+++ b/src/api/productionManagement/productionProductMain.js
@@ -0,0 +1,11 @@
+// 鐢熶骇鎶ュ伐椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ
+export function productionProductMainListPage(query) {
+ return request({
+ url: "/productionProductMain/listPage",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/api/productionManagement/productionProductOutput.js b/src/api/productionManagement/productionProductOutput.js
new file mode 100644
index 0000000..10095e9
--- /dev/null
+++ b/src/api/productionManagement/productionProductOutput.js
@@ -0,0 +1,11 @@
+// 鐢熶骇浜у嚭椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ
+export function productionProductOutputListPage(query) {
+ return request({
+ url: "/productionProductOutput/listPage",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/api/productionManagement/productionReporting.js b/src/api/productionManagement/productionReporting.js
index fdec712..3e29943 100644
--- a/src/api/productionManagement/productionReporting.js
+++ b/src/api/productionManagement/productionReporting.js
@@ -32,4 +32,12 @@
method: "post",
data: query,
});
-}
\ No newline at end of file
+}
+// 鐢熶骇鎶ュ伐-鍒犻櫎
+export function productionReportDelete(query) {
+ return request({
+ url: "/productionProductMain/delete",
+ method: "delete",
+ data: query,
+ });
+}
diff --git a/src/api/productionManagement/workOrder.js b/src/api/productionManagement/workOrder.js
new file mode 100644
index 0000000..bf4b381
--- /dev/null
+++ b/src/api/productionManagement/workOrder.js
@@ -0,0 +1,25 @@
+import request from "@/utils/request";
+
+export function productWorkOrderPage(query) {
+ return request({
+ url: "/productWorkOrder/page",
+ method: "get",
+ params: query,
+ });
+}
+
+export function updateProductWorkOrder(data) {
+ return request({
+ url: "/productWorkOrder/updateProductWorkOrder",
+ method: "post",
+ data: data,
+ });
+}
+
+export function addProductMain(data) {
+ return request({
+ url: "/productionProductMain/addProductMain",
+ method: "post",
+ data: data,
+ });
+}
diff --git a/src/api/system/user.js b/src/api/system/user.js
index 431f6b0..1a455c7 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -8,6 +8,13 @@
method: 'get',
params: query
})
+}// 鏌ヨ鐢ㄦ埛鍒楄〃
+export function listAll(query) {
+ return request({
+ url: '/system/user//listAll',
+ method: 'get',
+ params: query
+ })
}
// 鏌ヨ鐢ㄦ埛璇︾粏
diff --git a/src/api/viewIndex.js b/src/api/viewIndex.js
index 2d85171..6931110 100644
--- a/src/api/viewIndex.js
+++ b/src/api/viewIndex.js
@@ -44,4 +44,18 @@
url: '/sales/ledger/getAmountHalfYear',
method: 'get'
})
-}
\ No newline at end of file
+}
+
+// 鍗忓悓寰呭鎵瑰拰鎶ヤ慨寰呭姙浜嬮」
+export const approveAndDeviceTodos = () => {
+ return request({
+ url: '/home/approveAndDeviceTodos',
+ method: 'get'
+ })
+}
+export const noticesCount = () => {
+ return request({
+ url: '/home/noticesCount',
+ method: 'get'
+ })
+}
diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index 12d73ad..1fa1695 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -204,7 +204,6 @@
</el-table-column>
</el-table>
<pagination
- v-if="isShowPage"
:total="page.total"
:layout="page.layout"
:page="page.current"
@@ -267,10 +266,6 @@
isSelection: {
type: Boolean,
default: false,
- },
- isShowPage: {
- type: Boolean,
- default: true,
},
isShowSummary: {
type: Boolean,
diff --git a/src/components/PIMTable/Pagination.vue b/src/components/PIMTable/Pagination.vue
index 7639e64..47a63cf 100644
--- a/src/components/PIMTable/Pagination.vue
+++ b/src/components/PIMTable/Pagination.vue
@@ -71,6 +71,7 @@
})
const handleSizeChange = (val) => {
+ console.log('handleSizeChange', val)
if (currentPage.value * val > props.total) {
currentPage.value = 1
}
@@ -81,6 +82,7 @@
}
const handleCurrentChange = (val) => {
+ console.log('handleCurrentChange---', val)
emit('pagination', { page: val, limit: pageSize.value })
if (props.autoScroll) {
scrollTo(0, 800)
diff --git a/src/components/Upload/FileUpload.vue b/src/components/Upload/FileUpload.vue
index 65c6374..1ac0344 100644
--- a/src/components/Upload/FileUpload.vue
+++ b/src/components/Upload/FileUpload.vue
@@ -6,7 +6,7 @@
});
const props = defineProps({
- // downloadTemplate: Function,
+ downloadTemplate: Function,
showTips: Boolean,
accept: {
type: String,
@@ -31,7 +31,7 @@
default: 1,
},
});
-const emits = defineEmits(["success", "remove", "downloadTemplate"]);
+const emits = defineEmits(["success", "remove"]);
const uploadRef = ref();
const fileList = ref([]);
@@ -85,7 +85,7 @@
type="primary"
link
class="reset-margin"
- @click="emits('downloadTemplate')"
+ @click="props.downloadTemplate()"
>
<span style="font-size: 12px; font-weight: normal">涓嬭浇妯℃澘</span>
</el-button>
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 94168c4..e5bab03 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -147,8 +147,10 @@
<el-select
v-model="form.maintainer"
placeholder="璇烽�夋嫨"
+ filterable
+ default-first-option
+ :reserve-keyword="false"
clearable
- disabled
>
<el-option
v-for="item in userList"
@@ -305,10 +307,7 @@
type: "text",
clickFun: (row) => {
openForm("edit", row);
- },
- disabled: (row) => {
- return row.maintainer !== userStore.nickName
- }
+ }
},
],
},
@@ -558,12 +557,6 @@
const handleDelete = () => {
let ids = [];
if (selectedRows.value.length > 0) {
- // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
- const unauthorizedData = selectedRows.value.filter(item => item.maintainer !== userStore.nickName);
- if (unauthorizedData.length > 0) {
- proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
- return;
- }
ids = selectedRows.value.map((item) => item.id);
} else {
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
diff --git a/src/views/basicData/product/ImportExcel/index.vue b/src/views/basicData/product/ImportExcel/index.vue
index fe77420..c25d254 100644
--- a/src/views/basicData/product/ImportExcel/index.vue
+++ b/src/views/basicData/product/ImportExcel/index.vue
@@ -5,13 +5,12 @@
<el-dialog v-model="upload.open" :title="upload.title">
<FileUpload
ref="fileUploadRef"
- accept=".xlsx,.xls"
+ accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
- :showTip="true"
+ :showTip="false"
@success="handleFileSuccess"
- @downloadTemplate="downloadTemplate"
/>
<template #footer>
<div class="dialog-footer">
@@ -23,12 +22,11 @@
</template>
<script setup>
-import { reactive, ref, getCurrentInstance } from "vue";
+import { reactive } from "vue";
import { getToken } from "@/utils/auth.js";
import { FileUpload } from "@/components/Upload";
import { ElMessage } from "element-plus";
-const { proxy } = getCurrentInstance();
defineOptions({
name: "浜у搧缁存姢瀵煎叆",
});
@@ -46,18 +44,12 @@
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/system/supplier/import",
- updateSupport: true,
});
// 鐐瑰嚮瀵煎叆
const handleImport = () => {
upload.open = true;
upload.title = "浜у搧瀵煎叆";
};
-
-// 涓嬭浇妯℃澘
-const downloadTemplate = () =>{
- proxy.download("/basic/product/downloadTemplate", {}, "浜у搧瀵煎叆妯℃澘.xlsx");
-}
const submitFileForm = () => {
fileUploadRef.value.uploadApi();
diff --git a/src/views/basicData/product/ProductSelectDialog.vue b/src/views/basicData/product/ProductSelectDialog.vue
new file mode 100644
index 0000000..246cd88
--- /dev/null
+++ b/src/views/basicData/product/ProductSelectDialog.vue
@@ -0,0 +1,163 @@
+<template>
+ <el-dialog
+ v-model="visible"
+ title="閫夋嫨浜у搧"
+ width="900px"
+ destroy-on-close
+ :close-on-click-modal="false"
+ >
+ <el-form :inline="true" :model="query" class="mb-2">
+ <el-form-item label="浜у搧澶х被">
+ <el-input
+ v-model="query.productName"
+ placeholder="杈撳叆浜у搧澶х被"
+ clearable
+ @keyup.enter="onSearch"
+ />
+ </el-form-item>
+
+ <el-form-item label="鍨嬪彿鍚嶇О">
+ <el-input
+ v-model="query.model"
+ placeholder="杈撳叆鍨嬪彿鍚嶇О"
+ clearable
+ @keyup.enter="onSearch"
+ />
+ </el-form-item>
+
+ <el-form-item>
+ <el-button type="primary" @click="onSearch">鎼滅储</el-button>
+ <el-button @click="onReset">閲嶇疆</el-button>
+ </el-form-item>
+ </el-form>
+
+ <!-- 鍒楄〃 -->
+ <el-table
+ v-loading="loading"
+ :data="tableData"
+ height="420"
+ highlight-current-row
+ row-key="id"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55" />
+ <el-table-column type="index" label="#" width="60"/>
+ <el-table-column prop="productName" label="浜у搧澶х被" min-width="160"/>
+ <el-table-column prop="model" label="鍨嬪彿鍚嶇О" min-width="200"/>
+ <el-table-column prop="unit" label="鍗曚綅" min-width="160"/>
+ </el-table>
+
+ <div class="mt-3 flex justify-end">
+ <el-pagination
+ background
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="total"
+ v-model:page-size="page.pageSize"
+ v-model:current-page="page.pageNum"
+ :page-sizes="[10, 20, 50, 100]"
+ @size-change="onPageChange"
+ @current-change="onPageChange"
+ />
+ </div>
+
+ <template #footer>
+ <el-button @click="close()">鍙栨秷</el-button>
+ <el-button type="primary" :disabled="multipleSelection.length === 0" @click="onConfirm">
+ 纭畾
+ </el-button>
+ </template>
+ </el-dialog>
+</template>
+
+<script setup lang="ts">
+import {computed, onMounted, reactive, ref, watch} from "vue";
+import {ElMessage} from "element-plus";
+import {productModelList} from '@/api/basicData/productModel'
+
+export type ProductRow = {
+ id: number;
+ productName: string;
+ model: string;
+ unit?: string;
+};
+
+const props = defineProps<{
+ modelValue: boolean;
+}>();
+
+const emit = defineEmits(['update:modelValue', 'confirm']);
+
+const visible = computed({
+ get: () => props.modelValue,
+ set: (v) => emit("update:modelValue", v),
+});
+
+const query = reactive({
+ productName: "",
+ model: "",
+});
+
+const page = reactive({
+ pageNum: 1,
+ pageSize: 10,
+});
+
+const loading = ref(false);
+const tableData = ref<ProductRow[]>([]);
+const total = ref(0);
+const multipleSelection = ref<ProductRow[]>([])
+
+function close() {
+ visible.value = false;
+}
+
+const handleSelectionChange = (val: ProductRow[]) => {
+ multipleSelection.value = val
+}
+
+function onSearch() {
+ page.pageNum = 1;
+ loadData();
+}
+
+function onReset() {
+ query.productName = "";
+ query.model = "";
+ page.pageNum = 1;
+ loadData();
+}
+
+function onPageChange() {
+ loadData();
+}
+
+function onConfirm() {
+ if (multipleSelection.value.length === 0) {
+ ElMessage.warning("璇烽�夋嫨涓�鏉′骇鍝�");
+ return;
+ }
+ emit("confirm", multipleSelection.value);
+ close();
+}
+
+async function loadData() {
+ loading.value = true;
+ try {
+ multipleSelection.value = []; // 缈婚〉/鎼滅储鍚庢竻绌洪�夋嫨鏇寸鍚堥鏈�
+ const res = await productModelList({
+ productName: query.productName.trim(),
+ model: query.model.trim(),
+ current: page.pageNum,
+ size: page.pageSize,
+ });
+ tableData.value = res.records;
+ total.value = res.total;
+ } finally {
+ loading.value = false;
+ }
+}
+
+onMounted(() => {
+ loadData()
+})
+</script>
diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index 68e8221..42cf147 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -76,7 +76,7 @@
<div class="right">
<div style="margin-bottom: 10px" v-if="isShowButton">
<el-button type="primary" @click="openModelDia('add')">
- 鏂板浜у搧楂樺害
+ 鏂板瑙勬牸鍨嬪彿
</el-button>
<ImportExcel @uploadSuccess="getModelList" />
<el-button
@@ -129,7 +129,7 @@
</el-dialog>
<el-dialog
v-model="modelDia"
- title="浜у搧楂樺害"
+ title="瑙勬牸鍨嬪彿"
width="400px"
@close="closeModelDia"
@keydown.enter.prevent
@@ -143,10 +143,10 @@
>
<el-row>
<el-col :span="24">
- <el-form-item label="浜у搧楂樺害锛�" prop="model">
+ <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="model">
<el-input
v-model="modelForm.model"
- placeholder="璇疯緭鍏ヤ骇鍝侀珮搴�"
+ placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�(g*琚嬫暟)"
clearable
@keydown.enter.prevent
/>
@@ -155,16 +155,46 @@
</el-row>
<el-row>
<el-col :span="24">
- <el-form-item label="楂樺害鍗曚綅锛�" prop="unit">
+ <el-form-item label="鍏朵粬瑙勬牸鍨嬪彿锛�" prop="otherModel">
<el-input
- v-model="modelForm.unit"
- placeholder="璇疯緭鍏ラ珮搴﹀崟浣�"
+ v-model="modelForm.otherModel"
+ placeholder="璇疯緭鍏ュ叾浠栬鏍煎瀷鍙�"
clearable
@keydown.enter.prevent
/>
</el-form-item>
</el-col>
</el-row>
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="鍗曚綅锛�" prop="unit">
+ <el-input
+ v-model="modelForm.unit"
+ placeholder="璇疯緭鍏ュ崟浣�"
+ clearable
+ @keydown.enter.prevent
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+<!-- <el-row>-->
+<!-- <el-col :span="24">-->
+<!-- <el-form-item label="缁戝畾鏈哄櫒锛�" prop="speculativeTradingName">-->
+<!-- <el-select-->
+<!-- v-model="modelForm.speculativeTradingName"-->
+<!-- placeholder="璇烽�夋嫨缁戝畾鏈哄櫒"-->
+<!-- multiple-->
+<!-- clearable-->
+<!-- style="width: 100%"-->
+<!-- >-->
+<!-- <el-option label="鐐掓満1" value="鐐掓満1" />-->
+<!-- <el-option label="鐐掓満2" value="鐐掓満2" />-->
+<!-- <el-option label="鐐掓満3" value="鐐掓満3" />-->
+<!-- <el-option label="鐐掓満4" value="鐐掓満4" />-->
+<!-- </el-select>-->
+<!-- </el-form-item>-->
+<!-- </el-col>-->
+<!-- </el-row>-->
</el-form>
<template #footer>
<div class="dialog-footer">
@@ -205,13 +235,17 @@
const expandedKeys = ref([]);
const tableColumn = ref([
{
- label: "浜у搧楂樺害",
+ label: "瑙勬牸鍨嬪彿",
prop: "model",
},
{
- label: "楂樺害鍗曚綅",
+ label: "鍗曚綅",
prop: "unit",
},
+ // {
+ // label: "缁戝畾鏈哄櫒",
+ // prop: "speculativeTradingName",
+ // },
{
dataType: "action",
label: "鎿嶄綔",
@@ -244,12 +278,22 @@
productName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
},
modelForm: {
+ otherModel:'',
model: "",
unit: "",
+ speculativeTradingName: [],
},
modelRules: {
- model: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- unit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ model: [
+ // { required: true, message: "璇疯緭鍏�", trigger: "blur" },
+ {
+ pattern: /^[0-9*]*$/,
+ message: "鍙兘杈撳叆鏁板瓧鍜�*鍙�",
+ trigger: "blur"
+ }
+ ],
+ // unit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ // speculativeTradingName: [{ required: false, message: "璇烽�夋嫨缁戝畾鏈哄櫒", trigger: "change" }],
},
});
const { form, rules, modelForm, modelRules } = toRefs(data);
@@ -281,15 +325,20 @@
form.value.productName = data.productName;
}
};
-// 鎵撳紑浜у搧楂樺害寮规
+// 鎵撳紑瑙勬牸鍨嬪彿寮规
const openModelDia = (type, data) => {
modelOperationType.value = type;
modelDia.value = true;
modelForm.value.model = "";
- modelForm.value.model = "";
+ modelForm.value.unit = "";
+ modelForm.value.speculativeTradingName = [];
modelForm.value.id = "";
if (type === "edit") {
modelForm.value = { ...data };
+ // 濡傛灉鍚庣杩斿洖鐨勬槸瀛楃涓诧紝闇�瑕佽浆鎹负鏁扮粍
+ if (data.speculativeTradingName && typeof data.speculativeTradingName === 'string') {
+ modelForm.value.speculativeTradingName = data.speculativeTradingName.split(',');
+ }
}
};
// 鎻愪氦浜у搧鍚嶇О淇敼
@@ -358,8 +407,19 @@
const submitModelForm = () => {
proxy.$refs.modelFormRef.validate((valid) => {
if (valid) {
- modelForm.value.productId = currentId.value;
- addOrEditProductModel(modelForm.value).then((res) => {
+ let _modelForm = { ...modelForm.value };
+
+ if(_modelForm.otherModel){
+ _modelForm.model = _modelForm.otherModel;
+ }
+ delete _modelForm.otherModel;
+ // 灏嗛�変腑鐨勬満鍣ㄦ暟缁勮浆鎹负閫楀彿鍒嗛殧鐨勫瓧绗︿覆
+ const submitData = {
+ ..._modelForm,
+ productId: currentId.value,
+ speculativeTradingName: modelForm.value.speculativeTradingName.join(',')
+ };
+ addOrEditProductModel(submitData).then((res) => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeModelDia();
getModelList();
diff --git a/src/views/basicData/supplierManage/index.vue b/src/views/basicData/supplierManage/index.vue
index 82a1d57..7cb29bd 100644
--- a/src/views/basicData/supplierManage/index.vue
+++ b/src/views/basicData/supplierManage/index.vue
@@ -141,7 +141,9 @@
v-model="form.maintainUserId"
placeholder="璇烽�夋嫨"
clearable
- disabled
+ filterable
+ default-first-option
+ :reserve-keyword="false"
>
<el-option
v-for="item in userList"
@@ -299,9 +301,6 @@
clickFun: (row) => {
openForm("edit", row);
},
- disabled: (row) => {
- return row.maintainUserName !== userStore.nickName
- }
},
],
},
@@ -496,12 +495,6 @@
const handleDelete = () => {
let ids = [];
if (selectedRows.value.length > 0) {
- // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
- const unauthorizedData = selectedRows.value.filter(item => item.maintainUserName !== userStore.nickName);
- if (unauthorizedData.length > 0) {
- proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
- return;
- }
ids = selectedRows.value.map((item) => item.id);
} else {
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
diff --git a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
index 403cab6..9ff205f 100644
--- a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
+++ b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -121,33 +121,16 @@
<template #footer v-if="operationType === 'approval'">
<div class="dialog-footer">
<el-button type="primary" @click="submitForm(2)">涓嶉�氳繃</el-button>
- <el-button type="primary" @click="openSignatureDialog(1)">閫氳繃</el-button>
+ <el-button type="primary" @click="submitForm(1)">閫氳繃</el-button>
<el-button @click="closeDia">鍙栨秷</el-button>
</div>
</template>
- </el-dialog>
- <!-- 鐢靛瓙绛惧悕寮圭獥锛坴ue3-signature-pad锛� -->
- <el-dialog v-model="signatureDialogVisible" title="鐢靛瓙绛惧悕" width="600px" append-to-body>
- <vueEsign
- ref="esign"
- class="mySign"
- :width="800"
- :height="300"
- :isCrop="isCrop"
- :lineWidth="lineWidth"
- :lineColor="lineColor"
- />
- <div style="margin-top:10px;">
- <el-button @click="clearSignature">娓呴櫎</el-button>
- <el-button type="primary" @click="confirmSignature">纭畾</el-button>
- </div>
</el-dialog>
</div>
</template>
<script setup>
import { getCurrentInstance, reactive, ref, toRefs } from "vue";
-import vueEsign from "vue-esign";
import {
approveProcessDetails,
getDept,
@@ -156,7 +139,6 @@
import useUserStore from "@/store/modules/user.js";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import { WarningFilled, Edit, Check, MoreFilled } from '@element-plus/icons-vue'
-import { getToken } from "@/utils/auth";
const emit = defineEmits(['close'])
const { proxy } = getCurrentInstance()
@@ -178,21 +160,6 @@
},
});
const { form } = toRefs(data);
-const signatureDialogVisible = ref(false);
-const signatureImg = ref('');
-let submitStatus = null; // 涓存椂瀛樺偍閫氳繃/涓嶉�氳繃鐘舵��
-const isCrop = ref("");
-const esign = ref(null);
-const lineWidth = ref(0);
-const lineColor = ref("#000000");
-
-// 涓婁紶閰嶇疆
-const upload = reactive({
- // 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
- // 璁剧疆涓婁紶鐨勮姹傚ご閮�
- headers: { Authorization: "Bearer " + getToken() },
-});
// 鑺傜偣鏍囬
const getNodeTitle = (index, len) => {
@@ -248,77 +215,10 @@
productOptions.value = res.data;
});
};
-// 鎵撳紑绛惧悕寮圭獥
-const openSignatureDialog = (status) => {
- submitStatus = status;
- signatureDialogVisible.value = true;
-};
-// 娓呴櫎绛惧悕
-const clearSignature = () => {
- esign.value.reset();
-};
-// 纭绛惧悕
-const confirmSignature = () => {
- esign.value.generate().then((res) => {
- console.log(res);
- // 灏哹ase64杞崲涓轰簩杩涘埗
- const base64Data = res.split(',')[1]; // 绉婚櫎data:image/png;base64,鍓嶇紑
- const binaryString = atob(base64Data);
- const bytes = new Uint8Array(binaryString.length);
- for (let i = 0; i < binaryString.length; i++) {
- bytes[i] = binaryString.charCodeAt(i);
- }
- signatureImg.value = bytes;
-
- // 鍒涘缓鏂囦欢瀵硅薄鐢ㄤ簬涓婁紶
- const blob = new Blob([bytes], { type: 'image/png' });
- const file = new File([blob], 'signature.png', { type: 'image/png' });
-
- // 鍒涘缓FormData
- const formData = new FormData();
- formData.append('file', file);
-
- // 涓婁紶绛惧悕鍥剧墖
- fetch(upload.url, {
- method: 'POST',
- headers: upload.headers,
- body: formData
- })
- .then(response => response.json())
- .then(data => {
- if (data.code === 200) {
- console.log('data---', data)
- let tempFileIds = [];
- tempFileIds.push(data.data.tempId);
- signatureDialogVisible.value = false;
- clearSignature();
- // 鍙湁閫氳繃鏃舵墠浼犻�掔鍚嶆枃浠禝D
- if (submitStatus === 1) {
- submitForm(submitStatus, tempFileIds);
- } else {
- submitForm(submitStatus);
- }
- } else {
- proxy.$modal.msgError("绛惧悕鍥剧墖涓婁紶澶辫触锛�" + data.msg);
- }
- })
- .catch(error => {
- console.error('涓婁紶澶辫触:', error);
- proxy.$modal.msgError("绛惧悕鍥剧墖涓婁紶澶辫触");
- });
- }).catch((err) => {
- console.log(err);
- proxy.$modal.msgWarning("璇峰厛绛惧悕锛�");
- })
-};
// 鎻愪氦瀹℃壒
-const submitForm = (status, tempFileIds) => {
+const submitForm = (status) => {
const filteredActivities = activities.value.filter(activity => activity.isShen);
filteredActivities[0].approveNodeStatus = status;
- // 鍙湁閫氳繃鏃舵墠闇�瑕佺鍚�
- if (status === 1 && tempFileIds) {
- filteredActivities[0].tempFileIds = tempFileIds;
- }
// 鍒ゆ柇鏄惁涓烘渶鍚庝竴姝�
const isLast = activities.value.findIndex(a => a.isShen) === activities.value.length-1;
updateApproveNode({ ...filteredActivities[0], isLast }).then(() => {
diff --git a/src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue b/src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
index 24bb1d0..04dd066 100644
--- a/src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
+++ b/src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
@@ -16,19 +16,20 @@
</el-row>
<el-row>
<el-col :span="24">
- <el-form-item label="鐢宠閮ㄩ棬锛�" prop="approveDeptId">
- <el-select
- disabled
- v-model="form.approveDeptId"
- placeholder="閫夋嫨閮ㄩ棬"
- >
- <el-option
- v-for="user in productOptions"
- :key="user.deptId"
- :label="user.deptName"
- :value="user.deptId"
- />
- </el-select>
+ <el-form-item label="鐢宠閮ㄩ棬锛�" prop="approveDeptName">
+ <el-input v-model="form.approveDeptName" placeholder="璇疯緭鍏�" clearable/>
+<!-- <el-select-->
+<!-- disabled-->
+<!-- v-model="form.approveDeptId"-->
+<!-- placeholder="閫夋嫨閮ㄩ棬"-->
+<!-- >-->
+<!-- <el-option-->
+<!-- v-for="user in productOptions"-->
+<!-- :key="user.deptId"-->
+<!-- :label="user.deptName"-->
+<!-- :value="user.deptId"-->
+<!-- />-->
+<!-- </el-select>-->
</el-form-item>
</el-col>
</el-row>
@@ -36,6 +37,63 @@
<el-col :span="24">
<el-form-item :label="props.approveType == 5 ? '閲囪喘璇存槑锛�' : '瀹℃壒浜嬬敱锛�'" prop="approveReason">
<el-input v-model="form.approveReason" placeholder="璇疯緭鍏�" clearable type="textarea" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <!-- 璇峰亣鏃堕棿锛堜粎褰� approveType 涓� 2 鏃舵樉绀猴級 -->
+ <el-row :gutter="30" v-if="props.approveType == 2">
+ <el-col :span="12">
+ <el-form-item label="璇峰亣寮�濮嬫椂闂达細" prop="startDate">
+ <el-date-picker
+ v-model="form.startDate"
+ type="date"
+ placeholder="璇烽�夋嫨寮�濮嬫棩鏈�"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ style="width: 100%"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璇峰亣缁撴潫鏃堕棿锛�" prop="endDate">
+ <el-date-picker
+ v-model="form.endDate"
+ type="date"
+ placeholder="璇烽�夋嫨缁撴潫鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ style="width: 100%"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <!-- 鎶ラ攢閲戦锛堜粎褰� approveType 涓� 4 鏃舵樉绀猴級 -->
+ <el-row v-if="props.approveType == 4">
+ <el-col :span="24">
+ <el-form-item label="鎶ラ攢閲戦锛�" prop="price">
+ <el-input-number
+ v-model="form.price"
+ placeholder="璇疯緭鍏ユ姤閿�閲戦"
+ :min="0"
+ :precision="2"
+ :step="0.01"
+ style="width: 100%"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <!-- 鍑哄樊鍦扮偣锛堜粎褰� approveType 涓� 3 鏃舵樉绀猴級 -->
+ <el-row v-if="props.approveType == 3">
+ <el-col :span="24">
+ <el-form-item label="鍑哄樊鍦扮偣锛�" prop="location">
+ <el-input
+ v-model="form.location"
+ placeholder="璇疯緭鍏ュ嚭宸湴鐐�"
+ clearable
+ />
</el-form-item>
</el-col>
</el-row>
@@ -88,6 +146,9 @@
<el-select
v-model="form.approveUser"
placeholder="閫夋嫨浜哄憳"
+ filterable
+ default-first-option
+ :reserve-keyword="false"
>
<el-option
v-for="user in userList"
@@ -172,18 +233,27 @@
approveId: "",
approveUser: "",
approveDeptId: "",
+ approveDeptName: "",
approveReason: "",
checkResult: "",
tempFileIds: [],
- approverList: [] // 鏂板瀛楁锛屽瓨鍌ㄦ墍鏈夎妭鐐圭殑瀹℃壒浜篿d
+ approverList: [], // 鏂板瀛楁锛屽瓨鍌ㄦ墍鏈夎妭鐐圭殑瀹℃壒浜篿d
+ startDate: "", // 璇峰亣寮�濮嬫椂闂�
+ endDate: "", // 璇峰亣缁撴潫鏃堕棿
+ price: null, // 鎶ラ攢閲戦
+ location: "" // 鍑哄樊鍦扮偣
},
rules: {
approveTime: [{ required: false, message: "璇疯緭鍏�", trigger: "change" },],
approveId: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
approveUser: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
- approveDeptId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ approveDeptName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
approveReason: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
checkResult: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+ startDate: [{ required: true, message: "璇烽�夋嫨璇峰亣寮�濮嬫椂闂�", trigger: "change" }],
+ endDate: [{ required: true, message: "璇烽�夋嫨璇峰亣缁撴潫鏃堕棿", trigger: "change" }],
+ price: [{ required: true, message: "璇疯緭鍏ユ姤閿�閲戦", trigger: "blur" }],
+ location: [{ required: true, message: "璇疯緭鍏ュ嚭宸湴鐐�", trigger: "blur" }],
},
});
const { form, rules } = toRefs(data);
@@ -211,7 +281,6 @@
// 鎵撳紑寮规
const openDialog = (type, row) => {
- console.log('openDialog', type, row)
operationType.value = type;
dialogFormVisible.value = true;
userListNoPageByTenantId().then((res) => {
@@ -278,6 +347,36 @@
proxy.$modal.msgError("璇蜂负鎵�鏈夊鎵硅妭鐐归�夋嫨瀹℃壒浜猴紒")
return
}
+ // 褰� approveType 涓� 2 鏃讹紝鏍¢獙璇峰亣鏃堕棿
+ if (props.approveType == 2) {
+ if (!form.value.startDate) {
+ proxy.$modal.msgError("璇烽�夋嫨璇峰亣寮�濮嬫椂闂达紒")
+ return
+ }
+ if (!form.value.endDate) {
+ proxy.$modal.msgError("璇烽�夋嫨璇峰亣缁撴潫鏃堕棿锛�")
+ return
+ }
+ // 鏍¢獙缁撴潫鏃堕棿涓嶈兘鏃╀簬寮�濮嬫椂闂�
+ if (new Date(form.value.endDate) < new Date(form.value.startDate)) {
+ proxy.$modal.msgError("璇峰亣缁撴潫鏃堕棿涓嶈兘鏃╀簬寮�濮嬫椂闂达紒")
+ return
+ }
+ }
+ // 褰� approveType 涓� 3 鏃讹紝鏍¢獙鍑哄樊鍦扮偣
+ if (props.approveType == 3) {
+ if (!form.value.location || form.value.location.trim() === '') {
+ proxy.$modal.msgError("璇疯緭鍏ュ嚭宸湴鐐癸紒")
+ return
+ }
+ }
+ // 褰� approveType 涓� 4 鏃讹紝鏍¢獙鎶ラ攢閲戦
+ if (props.approveType == 4) {
+ if (!form.value.price || form.value.price <= 0) {
+ proxy.$modal.msgError("璇疯緭鍏ユ湁鏁堢殑鎶ラ攢閲戦锛�")
+ return
+ }
+ }
proxy.$refs.formRef.validate(valid => {
if (valid) {
if (operationType.value === "add" || currentApproveStatus.value == 3) {
diff --git a/src/views/collaborativeApproval/approvalProcess/fileList.vue b/src/views/collaborativeApproval/approvalProcess/fileList.vue
index da37db2..c0055fe 100644
--- a/src/views/collaborativeApproval/approvalProcess/fileList.vue
+++ b/src/views/collaborativeApproval/approvalProcess/fileList.vue
@@ -2,10 +2,11 @@
<el-dialog v-model="dialogVisible" title="闄勪欢" width="40%" :before-close="handleClose">
<el-table :data="tableData" border height="40vh">
<el-table-column label="闄勪欢鍚嶇О" prop="name" min-width="400" show-overflow-tooltip />
- <el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
+ <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
<template #default="scope">
<el-button link type="primary" size="small" @click="downLoadFile(scope.row)">涓嬭浇</el-button>
<el-button link type="primary" size="small" @click="lookFile(scope.row)">棰勮</el-button>
+ <el-button link type="danger" size="small" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -16,6 +17,8 @@
<script setup>
import { ref } from 'vue'
import filePreview from '@/components/filePreview/index.vue'
+import { ElMessageBox, ElMessage } from 'element-plus'
+import { delCommonFile } from '@/api/publicApi/commonFile.js'
const dialogVisible = ref(false)
const tableData = ref([])
@@ -35,6 +38,27 @@
const lookFile = (row) => {
filePreviewRef.value.open(row.url)
}
+// 鍒犻櫎闄勪欢
+const handleDelete = (row) => {
+ ElMessageBox.confirm(`纭鍒犻櫎闄勪欢"${row.name}"鍚楋紵`, '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ delCommonFile([row.id]).then(() => {
+ ElMessage.success('鍒犻櫎鎴愬姛')
+ // 浠庡垪琛ㄤ腑绉婚櫎宸插垹闄ょ殑闄勪欢
+ const index = tableData.value.findIndex(item => item.id === row.id)
+ if (index !== -1) {
+ tableData.value.splice(index, 1)
+ }
+ }).catch(() => {
+ ElMessage.error('鍒犻櫎澶辫触')
+ })
+ }).catch(() => {
+ ElMessage.info('宸插彇娑堝垹闄�')
+ })
+}
defineExpose({
open
})
diff --git a/src/views/collaborativeApproval/approvalProcess/index.vue b/src/views/collaborativeApproval/approvalProcess/index.vue
index 13e155b..78d21fb 100644
--- a/src/views/collaborativeApproval/approvalProcess/index.vue
+++ b/src/views/collaborativeApproval/approvalProcess/index.vue
@@ -130,13 +130,18 @@
width: 120
},
{
- label: "鐢宠鏃ユ湡",
- prop: "approveTime",
+ label: "閲戦锛堝厓锛�",
+ prop: "price",
+ width: 120
+ },
+ {
+ label: props.approveType === 2 ? "寮�濮嬫棩鏈�" : "鐢宠鏃ユ湡",
+ prop: props.approveType === 2 ? "startDate" : "approveTime",
width: 200
},
{
label: "缁撴潫鏃ユ湡",
- prop: "approveOverTime",
+ prop: props.approveType === 2 ? "endDate" : "approveOverTime",
width: 120
},
{
@@ -157,7 +162,6 @@
clickFun: (row) => {
openForm("edit", row);
},
- disabled: (row) => row.approveStatus == 2 || row.approveStatus == 1 || row.approveStatus == 4
},
{
name: "瀹℃牳",
diff --git a/src/views/collaborativeApproval/noticeManagement/index.vue b/src/views/collaborativeApproval/noticeManagement/index.vue
index 5fbc927..dcbbf65 100644
--- a/src/views/collaborativeApproval/noticeManagement/index.vue
+++ b/src/views/collaborativeApproval/noticeManagement/index.vue
@@ -10,16 +10,17 @@
<!-- 閫氱煡鍏憡鏉� -->
<div class="notice-board">
- <!-- 鏀惧亣閫氱煡鍖哄煙 -->
- <div class="notice-section" v-if="holidayNoticeCount > 0">
+ <!-- 缁熶竴閫氱煡鍖哄煙 -->
+ <div class="notice-section" v-if="totalNoticeCount > 0">
<div class="section-header">
- <h3>馃搮 鏀惧亣閫氱煡</h3>
- <span class="section-count">{{ holidayNoticeCount }}鏉�</span>
+ <h3>锟� 閫氱煡鍏憡</h3>
+ <span class="section-count">{{ totalNoticeCount }}鏉�</span>
</div>
<div class="notice-cards">
+ <!-- 鏀惧亣閫氱煡 -->
<div
v-for="notice in holidayNotices"
- :key="notice.id"
+ :key="'holiday-' + notice.id"
class="notice-card holiday-card"
:class="{ 'urgent': notice.priority === '3' }"
>
@@ -40,6 +41,9 @@
</div>
<div class="card-footer">
<div class="card-meta">
+ <span class="type" :class="'type-' + notice.type">
+ {{ notice.type }}
+ </span>
<span class="priority" :class="'priority-' + notice.priority">
{{ getPriorityText(notice.priority) }}
</span>
@@ -59,27 +63,11 @@
<span>{{ notice.remark }}</span>
</div>
</div>
- </div>
- </div>
-
- <pagination
- v-if="holidayNoticePage.total > 0"
- :total="holidayNoticePage.total"
- :page="holidayNoticePage.current"
- :limit="holidayNoticePage.size"
- @pagination="handleHolidayNoticeCurrentChange"
- />
-
- <!-- 璁惧缁翠慨閫氱煡鍖哄煙 -->
- <div class="notice-section" v-if="maintenanceNoticeCount > 0">
- <div class="section-header">
- <h3>馃敡 璁惧缁翠慨閫氱煡</h3>
- <span class="section-count">{{ maintenanceNoticeCount }}鏉�</span>
- </div>
- <div class="notice-cards">
+
+ <!-- 璁惧缁翠慨閫氱煡 -->
<div
v-for="notice in maintenanceNotices"
- :key="notice.id"
+ :key="'maintenance-' + notice.id"
class="notice-card maintenance-card"
:class="{ 'urgent': notice.priority === '3' }"
>
@@ -122,12 +110,13 @@
</div>
</div>
+ <!-- 缁熶竴鍒嗛〉 -->
<pagination
- v-if="maintenanceNoticePage.total > 0"
- :total="maintenanceNoticePage.total"
- :page="maintenanceNoticePage.current"
- :limit="maintenanceNoticePage.size"
- @pagination="handleMaintenanceNoticeCurrentChange"
+ v-if="(holidayNoticePage.total + maintenanceNoticePage.total) > 0"
+ :total="holidayNoticePage.total + maintenanceNoticePage.total"
+ :page="Math.max(holidayNoticePage.current, maintenanceNoticePage.current)"
+ :limit="Math.max(holidayNoticePage.size, maintenanceNoticePage.size)"
+ @pagination="handleCurrentChange"
/>
<!-- 绌虹姸鎬� -->
@@ -153,10 +142,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="鍏憡绫诲瀷" prop="type">
- <el-select v-model="form.type" placeholder="璇烽�夋嫨鍏憡绫诲瀷" style="width: 100%">
- <el-option label="鏀惧亣閫氱煡" :value="1"/>
- <el-option label="璁惧缁翠慨閫氱煡" :value="2"/>
- </el-select>
+ <el-input v-model="form.type" placeholder="璇疯緭鍏ュ叕鍛婃爣棰�"/>
</el-form-item>
</el-col>
</el-row>
@@ -419,16 +405,10 @@
});
};
-const holidayNoticeCount = ref()
-const maintenanceNoticeCount = ref()
+const totalNoticeCount = ref(0)
const fetchCount = () => {
getCount().then(res => {
- holidayNoticeCount.value = res.data.filter(item => {
- return item.type === 1
- })[0].count;
- maintenanceNoticeCount.value = res.data.filter(item => {
- return item.type === 2
- })[0].count;
+ totalNoticeCount.value = res.data.reduce((total, item) => total + item.count, 0);
});
}
@@ -447,7 +427,7 @@
})
const fetchHolidayNotices = () => {
- listNotice({...holidayNoticePage.value, type: 1}).then(res => {
+ listNotice({...holidayNoticePage.value}).then(res => {
holidayNotices.value = res.data.records
holidayNoticePage.value.total = res.data.total
});
@@ -460,15 +440,12 @@
});
};
-const handleHolidayNoticeCurrentChange = (val) => {
+const handleCurrentChange = (val) => {
holidayNoticePage.value.size = val.limit
holidayNoticePage.value.current = val.page
- fetchHolidayNotices()
-};
-
-const handleMaintenanceNoticeCurrentChange = (val) => {
maintenanceNoticePage.value.size = val.limit
maintenanceNoticePage.value.current = val.page
+ fetchHolidayNotices()
fetchMaintenanceNotices()
};
@@ -624,7 +601,6 @@
color: #606266;
line-height: 1.6;
font-size: 14px;
- word-wrap: break-word;
}
.card-footer {
@@ -639,11 +615,21 @@
gap: 8px;
}
-.priority, .status {
+.type, .priority, .status {
padding: 2px 8px;
border-radius: 12px;
font-size: 12px;
font-weight: 500;
+}
+
+.type-1 {
+ background: #f0f9ff;
+ color: #0369a1;
+}
+
+.type-2 {
+ background: #fef3c7;
+ color: #d97706;
}
.priority-1 {
@@ -703,15 +689,6 @@
font-size: 12px;
color: #606266;
border-left: 3px solid #409eff;
-}
-
-.card-remark span {
- flex: 1;
- min-width: 0;
- word-wrap: break-word;
- word-break: break-all;
- white-space: normal;
- line-height: 1.5;
}
.empty-state {
diff --git a/src/views/customerService/expiryAfterSales/index.vue b/src/views/customerService/expiryAfterSales/index.vue
index df44504..6433358 100644
--- a/src/views/customerService/expiryAfterSales/index.vue
+++ b/src/views/customerService/expiryAfterSales/index.vue
@@ -59,7 +59,7 @@
<template #operation="{ row }">
<el-button type="primary" link @click="openForm('view', row)">鏌ョ湅</el-button>
- <el-button type="primary" link @click="openForm('edit', row)" v-if="row.status === 1">缂栬緫</el-button>
+ <el-button type="primary" link @click="openForm('edit', row)">缂栬緫</el-button>
</template>
</PIMTable>
</div>
diff --git a/src/views/customerService/feedbackRegistration/index.vue b/src/views/customerService/feedbackRegistration/index.vue
index 0825aac..f1a55e3 100644
--- a/src/views/customerService/feedbackRegistration/index.vue
+++ b/src/views/customerService/feedbackRegistration/index.vue
@@ -120,9 +120,6 @@
clickFun: (row) => {
openForm("edit", row);
},
- disabled: (row) => {
- return row.checkUserId !== userStore.id || row.status !== 1
- }
},
],
},
@@ -172,12 +169,6 @@
const handleDelete = () => {
let ids = [];
if (selectedRows.value.length > 0) {
- // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
- const unauthorizedData = selectedRows.value.filter(item => item.checkUserId !== userStore.id);
- if (unauthorizedData.length > 0) {
- proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
- return;
- }
ids = selectedRows.value.map((item) => item.id);
} else {
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
diff --git a/src/views/equipmentManagement/calibration/index.vue b/src/views/equipmentManagement/calibration/index.vue
index 7dfd405..89d71b6 100644
--- a/src/views/equipmentManagement/calibration/index.vue
+++ b/src/views/equipmentManagement/calibration/index.vue
@@ -57,10 +57,10 @@
<script setup>
import {onMounted, ref} from "vue";
-import {ElMessageBox} from "element-plus";
+import {ElMessageBox, ElMessage} from "element-plus";
import useUserStore from "@/store/modules/user.js";
import CalibrationDia from "@/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue";
-import {ledgerRecordListPage} from "@/api/equipmentManagement/calibration.js";
+import {ledgerRecordListPage, ledgerRecordDelete} from "@/api/equipmentManagement/calibration.js";
const { proxy } = getCurrentInstance();
const userStore = useUserStore()
@@ -134,6 +134,7 @@
{
dataType: "action",
label: "鎿嶄綔",
+ width: 100,
align: "center",
fixed: 'right',
operation: [
@@ -143,9 +144,16 @@
clickFun: (row) => {
openCalibrationDia("edit", row);
},
- disabled: (row) => {
- return row.userId !== userStore.id
- }
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ style: {
+ color: "#F56C6C"
+ },
+ clickFun: (row) => {
+ handleDelete(row);
+ },
},
],
},
@@ -194,6 +202,26 @@
})
}
+// 鍒犻櫎璁板綍
+const handleDelete = (row) => {
+ ElMessageBox.confirm(`纭鍒犻櫎璁¢噺鍣ㄥ叿缂栧彿涓�"${row.code}"鐨勬瀹氳褰曞悧锛焋, "鍒犻櫎纭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ ledgerRecordDelete([row.id]).then(() => {
+ ElMessage.success("鍒犻櫎鎴愬姛");
+ getList();
+ }).catch(() => {
+ ElMessage.error("鍒犻櫎澶辫触");
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑堝垹闄�");
+ });
+};
+
// 瀵煎嚭
const handleOut = () => {
ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
diff --git a/src/views/equipmentManagement/inspectionManagement/components/formDia.vue b/src/views/equipmentManagement/inspectionManagement/components/formDia.vue
index 79ff5b0..82837af 100644
--- a/src/views/equipmentManagement/inspectionManagement/components/formDia.vue
+++ b/src/views/equipmentManagement/inspectionManagement/components/formDia.vue
@@ -1,102 +1,116 @@
<template>
- <div>
- <el-dialog :title="operationType === 'add' ? '鏂板宸℃浠诲姟' : '缂栬緫宸℃浠诲姟'"
- v-model="dialogVisitable" width="800px" @close="cancel">
- <el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
- <el-row>
- <el-col :span="12">
- <el-form-item label="璁惧鍚嶇О" prop="taskId">
- <el-select v-model="form.taskId" @change="setDeviceModel">
- <el-option
- v-for="(item, index) in deviceOptions"
- :key="index"
- :label="item.deviceName"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="宸℃浜�" prop="inspector">
- <el-select v-model="form.inspector" placeholder="璇烽�夋嫨" multiple clearable>
- <el-option v-for="item in userList" :label="item.nickName" :value="item.userId" :key="item.userId"/>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="澶囨敞" prop="remarks">
- <el-input v-model="form.remarks" placeholder="璇疯緭鍏ュ娉�" type="textarea" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="浠诲姟棰戠巼" prop="frequencyType">
- <el-select v-model="form.frequencyType" placeholder="璇烽�夋嫨" clearable>
- <el-option label="姣忔棩" value="DAILY"/>
- <el-option label="姣忓懆" value="WEEKLY"/>
- <el-option label="姣忔湀" value="MONTHLY"/>
- <!-- <el-option label="瀛e害" value="QUARTERLY"/> -->
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12" v-if="form.frequencyType === 'DAILY' && form.frequencyType">
- <el-form-item label="鏃ユ湡" prop="frequencyDetail">
- <el-time-picker v-model="form.frequencyDetail" placeholder="閫夋嫨鏃堕棿" format="HH:mm"
- value-format="HH:mm" />
- </el-form-item>
- </el-col>
- <el-col :span="12" v-if="form.frequencyType === 'WEEKLY' && form.frequencyType">
- <el-form-item label="鏃ユ湡" prop="frequencyDetail">
- <el-select v-model="form.week" placeholder="璇烽�夋嫨" clearable style="width: 50%">
- <el-option label="鍛ㄤ竴" value="MON"/>
- <el-option label="鍛ㄤ簩" value="TUE"/>
- <el-option label="鍛ㄤ笁" value="WED"/>
- <el-option label="鍛ㄥ洓" value="THU"/>
- <el-option label="鍛ㄤ簲" value="FRI"/>
- <el-option label="鍛ㄥ叚" value="SAT"/>
- <el-option label="鍛ㄦ棩" value="SUN"/>
- </el-select>
- <el-time-picker v-model="form.time" placeholder="閫夋嫨鏃堕棿" format="HH:mm"
- value-format="HH:mm" style="width: 50%"/>
- </el-form-item>
- </el-col>
- <el-col :span="12" v-if="form.frequencyType === 'MONTHLY' && form.frequencyType">
- <el-form-item label="鏃ユ湡" prop="frequencyDetail">
- <el-date-picker
- v-model="form.frequencyDetail"
- type="datetime"
- clearable
- placeholder="閫夋嫨寮�濮嬫棩鏈�"
- format="DD,HH:mm"
- value-format="DD,HH:mm"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12" v-if="form.frequencyType === 'QUARTERLY' && form.frequencyType">
- <el-form-item label="鏃ユ湡" prop="frequencyDetail">
- <el-date-picker
- v-model="form.frequencyDetail"
- type="datetime"
- clearable
- placeholder="閫夋嫨寮�濮嬫棩鏈�"
- format="MM,DD,HH:mm"
- value-format="MM,DD,HH:mm"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="cancel">鍙栨秷</el-button>
- <el-button type="primary" @click="submitForm">淇濆瓨</el-button>
- </div>
- </template>
- </el-dialog>
- </div>
+ <div>
+ <el-dialog :title="operationType === 'add' ? '鏂板宸℃浠诲姟' : '缂栬緫宸℃浠诲姟'"
+ v-model="dialogVisitable" width="800px" @close="cancel">
+ <el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="璁惧鍚嶇О" prop="taskId">
+ <el-select v-model="form.taskId" @change="setDeviceModel" filterable>
+ <el-option
+ v-for="(item, index) in deviceOptions"
+ :key="index"
+ :label="item.deviceName"
+ :value="item.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="宸℃浜�" prop="inspector">
+ <el-select v-model="form.inspector" filterable
+ default-first-option
+ :reserve-keyword="false" placeholder="璇烽�夋嫨" multiple clearable>
+ <el-option v-for="item in userList" :label="item.nickName" :value="item.userId" :key="item.userId"/>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="澶囨敞" prop="remarks">
+ <el-input v-model="form.remarks" placeholder="璇疯緭鍏ュ娉�" type="textarea" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐧昏鏃堕棿" prop="dateStr">
+ <el-date-picker
+ v-model="form.dateStr"
+ type="date"
+ placeholder="閫夋嫨鐧昏鏃ユ湡"
+ format="YYYY-MM-DD"
+ value-format="YYYY-MM-DD"
+ style="width: 100%"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="浠诲姟棰戠巼" prop="frequencyType">
+ <el-select v-model="form.frequencyType" placeholder="璇烽�夋嫨" clearable>
+ <el-option label="姣忔棩" value="DAILY"/>
+ <el-option label="姣忓懆" value="WEEKLY"/>
+ <el-option label="姣忔湀" value="MONTHLY"/>
+ <!-- <el-option label="瀛e害" value="QUARTERLY"/> -->
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12" v-if="form.frequencyType === 'DAILY' && form.frequencyType">
+ <el-form-item label="鏃ユ湡" prop="frequencyDetail">
+ <el-time-picker v-model="form.frequencyDetail" placeholder="閫夋嫨鏃堕棿" format="HH:mm"
+ value-format="HH:mm" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12" v-if="form.frequencyType === 'WEEKLY' && form.frequencyType">
+ <el-form-item label="鏃ユ湡" prop="frequencyDetail">
+ <el-select v-model="form.week" placeholder="璇烽�夋嫨" clearable style="width: 50%">
+ <el-option label="鍛ㄤ竴" value="MON"/>
+ <el-option label="鍛ㄤ簩" value="TUE"/>
+ <el-option label="鍛ㄤ笁" value="WED"/>
+ <el-option label="鍛ㄥ洓" value="THU"/>
+ <el-option label="鍛ㄤ簲" value="FRI"/>
+ <el-option label="鍛ㄥ叚" value="SAT"/>
+ <el-option label="鍛ㄦ棩" value="SUN"/>
+ </el-select>
+ <el-time-picker v-model="form.time" placeholder="閫夋嫨鏃堕棿" format="HH:mm"
+ value-format="HH:mm" style="width: 50%"/>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12" v-if="form.frequencyType === 'MONTHLY' && form.frequencyType">
+ <el-form-item label="鏃ユ湡" prop="frequencyDetail">
+ <el-date-picker
+ v-model="form.frequencyDetail"
+ type="datetime"
+ clearable
+ placeholder="閫夋嫨寮�濮嬫棩鏈�"
+ format="DD,HH:mm"
+ value-format="DD,HH:mm"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12" v-if="form.frequencyType === 'QUARTERLY' && form.frequencyType">
+ <el-form-item label="鏃ユ湡" prop="frequencyDetail">
+ <el-date-picker
+ v-model="form.frequencyDetail"
+ type="datetime"
+ clearable
+ placeholder="閫夋嫨寮�濮嬫棩鏈�"
+ format="MM,DD,HH:mm"
+ value-format="MM,DD,HH:mm"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button @click="cancel">鍙栨秷</el-button>
+ <el-button type="primary" @click="submitForm">淇濆瓨</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
</template>
<script setup>
@@ -113,115 +127,117 @@
const operationType = ref('add');
const deviceOptions = ref([]);
const data = reactive({
- form: {
- taskId: undefined,
- taskName: undefined,
- inspector: '',
- inspectorIds: '',
- remarks: '',
- frequencyType: '',
- frequencyDetail: '',
- week: '',
- time: ''
- },
- rules: {
- taskId: [{ required: true, message: "璇烽�夋嫨璁惧", trigger: "change" },],
- inspector: [{ required: true, message: "璇疯緭鍏ュ贰妫�浜�", trigger: "blur" },],
- }
+ form: {
+ taskId: undefined,
+ taskName: undefined,
+ inspector: '',
+ inspectorIds: '',
+ remarks: '',
+ frequencyType: '',
+ frequencyDetail: '',
+ week: '',
+ time: '',
+ dateStr: ''
+ },
+ rules: {
+ taskId: [{ required: true, message: "璇烽�夋嫨璁惧", trigger: "change" },],
+ inspector: [{ required: true, message: "璇疯緭鍏ュ贰妫�浜�", trigger: "blur" },],
+ dateStr: [{ required: true, message: "璇烽�夋嫨鐧昏鏃堕棿", trigger: "change" }]
+ }
})
const { form, rules } = toRefs(data)
const userList = ref([])
const loadDeviceName = async () => {
- const { data } = await getDeviceLedger();
- deviceOptions.value = data;
+ const { data } = await getDeviceLedger();
+ deviceOptions.value = data;
};
const setDeviceModel = (id) => {
- const option = deviceOptions.value.find((item) => item.id === id);
- if (option) {
- form.value.taskName = option.deviceName;
- }
+ const option = deviceOptions.value.find((item) => item.id === id);
+ if (option) {
+ form.value.taskName = option.deviceName;
+ }
}
// 鎵撳紑寮规
const openDialog = async (type, row) => {
- dialogVisitable.value = true
- operationType.value = type
-
- // 閲嶇疆琛ㄥ崟
- resetForm();
-
- // 鍔犺浇鐢ㄦ埛鍒楄〃
- userListNoPageByTenantId().then((res) => {
- userList.value = res.data;
- });
-
- // 鍔犺浇璁惧鍒楄〃
- await loadDeviceName();
-
- if (type === 'edit' && row) {
- form.value = {...row}
- form.value.inspector = form.value.inspectorIds.split(',').map(Number)
-
- // 濡傛灉鏈夎澶嘔D锛岃嚜鍔ㄨ缃澶囦俊鎭�
- if (form.value.taskId) {
- setDeviceModel(form.value.taskId);
- }
- }
+ dialogVisitable.value = true
+ operationType.value = type
+
+ // 閲嶇疆琛ㄥ崟
+ resetForm();
+
+ // 鍔犺浇鐢ㄦ埛鍒楄〃
+ userListNoPageByTenantId().then((res) => {
+ userList.value = res.data;
+ });
+
+ // 鍔犺浇璁惧鍒楄〃
+ await loadDeviceName();
+
+ if (type === 'edit' && row) {
+ form.value = {...row}
+ form.value.inspector = form.value.inspectorIds.split(',').map(Number)
+
+ // 濡傛灉鏈夎澶嘔D锛岃嚜鍔ㄨ缃澶囦俊鎭�
+ if (form.value.taskId) {
+ setDeviceModel(form.value.taskId);
+ }
+ }
}
// 鍏抽棴瀵硅瘽妗�
const cancel = () => {
- resetForm()
- dialogVisitable.value = false
- emit('closeDia')
+ resetForm()
+ dialogVisitable.value = false
+ emit('closeDia')
}
// 閲嶇疆琛ㄥ崟鍑芥暟
const resetForm = () => {
- if (proxy.$refs.formRef) {
- proxy.$refs.formRef.resetFields()
- }
- // 閲嶇疆琛ㄥ崟鏁版嵁纭繚璁惧淇℃伅姝g‘閲嶇疆
- form.value = {
- taskId: undefined,
- taskName: undefined,
- inspector: '',
- inspectorIds: '',
- remarks: '',
- frequencyType: '',
- frequencyDetail: '',
- week: '',
- time: ''
- }
+ if (proxy.$refs.formRef) {
+ proxy.$refs.formRef.resetFields()
+ }
+ // 閲嶇疆琛ㄥ崟鏁版嵁纭繚璁惧淇℃伅姝g‘閲嶇疆
+ form.value = {
+ taskId: undefined,
+ taskName: undefined,
+ inspector: '',
+ inspectorIds: '',
+ remarks: '',
+ frequencyType: '',
+ frequencyDetail: '',
+ week: '',
+ time: ''
+ }
}
// 鎻愪氦琛ㄥ崟
const submitForm = () => {
- proxy.$refs["formRef"].validate(async valid => {
- if (valid) {
- try {
- form.value.inspectorIds = form.value.inspector.join(',')
- delete form.value.inspector
-
- if (form.value.frequencyType === 'WEEKLY') {
- let frequencyDetail = ''
- frequencyDetail = form.value.week + ',' + form.value.time
- form.value.frequencyDetail = frequencyDetail
- }
-
- let res = await userStore.getInfo()
- form.value.registrantId = res.user.userId
-
- await addOrEditTimingTask(form.value)
- cancel()
- proxy.$modal.msgSuccess('鎻愪氦鎴愬姛')
- } catch (error) {
- proxy.$modal.msgError('鎻愪氦澶辫触锛岃閲嶈瘯')
- }
- }
- })
+ proxy.$refs["formRef"].validate(async valid => {
+ if (valid) {
+ try {
+ form.value.inspectorIds = form.value.inspector.join(',')
+ delete form.value.inspector
+
+ if (form.value.frequencyType === 'WEEKLY') {
+ let frequencyDetail = ''
+ frequencyDetail = form.value.week + ',' + form.value.time
+ form.value.frequencyDetail = frequencyDetail
+ }
+
+ let res = await userStore.getInfo()
+ form.value.registrantId = res.user.userId
+
+ await addOrEditTimingTask(form.value)
+ cancel()
+ proxy.$modal.msgSuccess('鎻愪氦鎴愬姛')
+ } catch (error) {
+ proxy.$modal.msgError('鎻愪氦澶辫触锛岃閲嶈瘯')
+ }
+ }
+ })
}
defineExpose({ openDialog })
</script>
diff --git a/src/views/equipmentManagement/inspectionManagement/components/viewFiles.vue b/src/views/equipmentManagement/inspectionManagement/components/viewFiles.vue
index d1c9d8d..f0deddb 100644
--- a/src/views/equipmentManagement/inspectionManagement/components/viewFiles.vue
+++ b/src/views/equipmentManagement/inspectionManagement/components/viewFiles.vue
@@ -32,7 +32,7 @@
<!-- 鐢熶骇鍚� -->
<div class="form-container">
- <div class="title">鐢熶骇鍚�</div>
+ <div class="title">鐢熶骇涓�</div>
<!-- 鍥剧墖鍒楄〃 -->
<div style="display: flex; flex-wrap: wrap;">
@@ -59,7 +59,7 @@
<!-- 鐢熶骇闂 -->
<div class="form-container">
- <div class="title">鐢熶骇闂</div>
+ <div class="title">鐢熶骇鍚�</div>
<!-- 鍥剧墖鍒楄〃 -->
<div style="display: flex; flex-wrap: wrap;">
diff --git a/src/views/equipmentManagement/inspectionManagement/index.vue b/src/views/equipmentManagement/inspectionManagement/index.vue
index 3e4e31e..2bfc1ee 100644
--- a/src/views/equipmentManagement/inspectionManagement/index.vue
+++ b/src/views/equipmentManagement/inspectionManagement/index.vue
@@ -1,80 +1,78 @@
<template>
- <div class="app-container">
- <el-form :inline="true" :model="queryParams" class="search-form">
- <el-form-item label="鎼滅储">
- <el-input
- v-model="queryParams.searchAll"
- placeholder="璇疯緭鍏ュ叧閿瓧"
- clearable
- :style="{ width: '100%' }"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="handleQuery">鏌ヨ</el-button>
- <el-button @click="resetQuery">閲嶇疆</el-button>
- </el-form-item>
- </el-form>
- <el-card>
- <div style="display: flex;flex-direction: row;justify-content: space-between;margin-bottom: 10px;">
- <el-radio-group v-model="activeRadio" @change="radioChange">
- <el-radio-button v-for="tab in radios"
- :key="tab.name"
- :label="tab.label"
- :value="tab.name"/>
- </el-radio-group>
- <!-- 鎿嶄綔鎸夐挳鍖� -->
- <el-space v-if="activeRadio !== 'task'">
- <el-button type="primary" :icon="Plus" @click="handleAdd(undefined)">鏂板缓</el-button>
- <el-button type="danger" :icon="Delete" @click="handleDelete">鍒犻櫎</el-button>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- </el-space>
- <el-space v-else>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- </el-space>
- </div>
- <div>
- <div>
- <PIMTable :table-loading="tableLoading"
- :table-data="tableData"
- :column="tableColumns"
- @selection-change="handleSelectionChange"
- :is-selection="true"
- :border="true"
- :table-style="{ width: '100%', height: 'calc(100vh - 23em)' }"
- >
- <template #inspector="{ row }">
- <div class="person-tags">
- <!-- 璋冭瘯淇℃伅锛屼笂绾挎椂鍒犻櫎 -->
- <!-- {{ console.log('inspector data:', row.inspector) }} -->
- <template v-if="row.inspector && row.inspector.length > 0">
- <el-tag
- v-for="(person, index) in row.inspector"
- :key="index"
- size="small"
- type="primary"
- class="person-tag"
- >
- {{ person }}
- </el-tag>
- </template>
- <span v-else class="no-data">--</span>
- </div>
- </template>
- </PIMTable>
- </div>
- <pagination
- v-if="total>0"
- :page="pageNum"
- :limit="pageSize"
- :total="total"
- @pagination="handlePagination"
- :layout="'total, prev, pager, next, jumper'"
- />
- </div>
- </el-card>
- <form-dia ref="formDia" @closeDia="handleQuery"></form-dia>
- <view-files ref="viewFiles"></view-files>
- </div>
+ <div class="app-container">
+ <el-form :inline="true" :model="queryParams" class="search-form">
+ <el-form-item label="鎼滅储">
+ <el-input
+ v-model="queryParams.searchAll"
+ placeholder="璇疯緭鍏ュ叧閿瓧"
+ clearable
+ :style="{ width: '100%' }"
+ />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleQuery">鏌ヨ</el-button>
+ <el-button @click="resetQuery">閲嶇疆</el-button>
+ </el-form-item>
+ </el-form>
+ <el-card>
+ <div style="display: flex;flex-direction: row;justify-content: space-between;margin-bottom: 10px;">
+ <el-radio-group v-model="activeRadio" @change="radioChange">
+ <el-radio-button v-for="tab in radios"
+ :key="tab.name"
+ :label="tab.label"
+ :value="tab.name"/>
+ </el-radio-group>
+ <!-- 鎿嶄綔鎸夐挳鍖� -->
+ <el-space v-if="activeRadio !== 'task'">
+ <el-button type="primary" :icon="Plus" @click="handleAdd(undefined)">鏂板缓</el-button>
+ <el-button type="danger" :icon="Delete" @click="handleDelete">鍒犻櫎</el-button>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ </el-space>
+ <el-space v-else>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ </el-space>
+ </div>
+ <div>
+ <div>
+ <PIMTable :table-loading="tableLoading"
+ :table-data="tableData"
+ :column="tableColumns"
+ @selection-change="handleSelectionChange"
+ :is-selection="true"
+ :border="true"
+ :table-style="{ width: '100%', height: 'calc(100vh - 23em)' }"
+ :page="{
+ current: pageNum,
+ size: pageSize,
+ total: total,
+ }"
+ @pagination="pagination"
+ >
+ <template #inspector="{ row }">
+ <div class="person-tags">
+ <!-- 璋冭瘯淇℃伅锛屼笂绾挎椂鍒犻櫎 -->
+ <!-- {{ console.log('inspector data:', row.inspector) }} -->
+ <template v-if="row.inspector && row.inspector.length > 0">
+ <el-tag
+ v-for="(person, index) in row.inspector"
+ :key="index"
+ size="small"
+ type="primary"
+ class="person-tag"
+ >
+ {{ person }}
+ </el-tag>
+ </template>
+ <span v-else class="no-data">--</span>
+ </div>
+ </template>
+ </PIMTable>
+ </div>
+ </div>
+ </el-card>
+ <form-dia ref="formDia" @closeDia="handleQuery"></form-dia>
+ <view-files ref="viewFiles"></view-files>
+ </div>
</template>
<script setup>
@@ -90,9 +88,9 @@
// 鎺ュ彛寮曞叆
import {
- delTimingTask,
- inspectionTaskList,
- timingTaskList
+ delTimingTask,
+ inspectionTaskList,
+ timingTaskList
} from "@/api/inspectionManagement/index.js";
// 鍏ㄥ眬鍙橀噺
@@ -102,14 +100,14 @@
// 鏌ヨ鍙傛暟
const queryParams = reactive({
- searchAll: "",
+ searchAll: "",
});
// 鍗曢�夋閰嶇疆
const activeRadio = ref("taskManage");
const radios = reactive([
- { name: "taskManage", label: "瀹氭椂浠诲姟绠$悊" },
- { name: "task", label: "瀹氭椂浠诲姟璁板綍" },
+ { name: "taskManage", label: "瀹氭椂浠诲姟绠$悊" },
+ { name: "task", label: "瀹氭椂浠诲姟璁板綍" },
]);
// 琛ㄦ牸鏁版嵁
@@ -124,234 +122,233 @@
// 鍒楅厤缃�
const columns = ref([
- { prop: "taskName", label: "宸℃浠诲姟鍚嶇О", minWidth: 160 },
- { prop: "remarks", label: "澶囨敞", minWidth: 150 },
- { prop: "inspector", label: "鎵ц宸℃浜�", minWidth: 150, slot: "inspector" },
- {
- prop: "frequencyType",
- label: "棰戞",
- minWidth: 150,
- formatter: (_, __, val) => ({
- DAILY: "姣忔棩",
- WEEKLY: "姣忓懆",
- MONTHLY: "姣忔湀",
- QUARTERLY: "瀛e害"
- }[val] || "")
- },
- {
- prop: "frequencyDetail",
- label: "寮�濮嬫棩鏈熶笌鏃堕棿",
- minWidth: 150,
- formatter: (row, column, cellValue) => {
- // 鍏堝垽鏂槸鍚︽槸瀛楃涓�
- if (typeof cellValue !== 'string') return '';
- let val = cellValue;
- const replacements = {
- MON: '鍛ㄤ竴',
- TUE: '鍛ㄤ簩',
- WED: '鍛ㄤ笁',
- THU: '鍛ㄥ洓',
- FRI: '鍛ㄤ簲',
- SAT: '鍛ㄥ叚',
- SUN: '鍛ㄦ棩'
- };
- // 浣跨敤姝e垯涓�娆℃�ф浛鎹㈡墍鏈夊尮閰嶉」
- return val.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => replacements[match]);
- }
- },
- { prop: "registrant", label: "鐧昏浜�", minWidth: 100 },
- { prop: "createTime", label: "鐧昏鏃ユ湡", minWidth: 100 },
+ { prop: "taskName", label: "宸℃浠诲姟鍚嶇О", minWidth: 160 },
+ { prop: "remarks", label: "澶囨敞", minWidth: 150 },
+ { prop: "inspector", label: "鎵ц宸℃浜�", minWidth: 150, slot: "inspector" },
+ {
+ prop: "frequencyType",
+ label: "棰戞",
+ minWidth: 150,
+ formatter: (_, __, val) => ({
+ DAILY: "姣忔棩",
+ WEEKLY: "姣忓懆",
+ MONTHLY: "姣忔湀",
+ QUARTERLY: "瀛e害"
+ }[val] || "")
+ },
+ {
+ prop: "frequencyDetail",
+ label: "寮�濮嬫棩鏈熶笌鏃堕棿",
+ minWidth: 150,
+ formatter: (row, column, cellValue) => {
+ // 鍏堝垽鏂槸鍚︽槸瀛楃涓�
+ if (typeof cellValue !== 'string') return '';
+ let val = cellValue;
+ const replacements = {
+ MON: '鍛ㄤ竴',
+ TUE: '鍛ㄤ簩',
+ WED: '鍛ㄤ笁',
+ THU: '鍛ㄥ洓',
+ FRI: '鍛ㄤ簲',
+ SAT: '鍛ㄥ叚',
+ SUN: '鍛ㄦ棩'
+ };
+ // 浣跨敤姝e垯涓�娆℃�ф浛鎹㈡墍鏈夊尮閰嶉」
+ return val.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => replacements[match]);
+ }
+ },
+ { prop: "registrant", label: "鐧昏浜�", minWidth: 100 },
+ { prop: "dateStr", label: "鐧昏鏃ユ湡", minWidth: 100 },
]);
// 鎿嶄綔鍒楅厤缃�
const getOperationColumn = (operations) => {
- if (!operations || operations.length === 0) return null;
-
- const operationConfig = {
- label: "鎿嶄綔",
- width: 130,
- fixed: "right",
- dataType: "action",
- operation: operations.map(op => {
- switch (op) {
- case 'edit':
- return {
- name: "缂栬緫",
- clickFun: handleAdd,
- color: "#409EFF"
- };
- case 'viewFile':
- return {
- name: "鏌ョ湅闄勪欢",
- clickFun: viewFile,
- color: "#67C23A"
- };
- default:
- return null;
- }
- }).filter(Boolean)
- };
-
- return operationConfig;
+ if (!operations || operations.length === 0) return null;
+
+ const operationConfig = {
+ label: "鎿嶄綔",
+ width: 130,
+ fixed: "right",
+ dataType: "action",
+ operation: operations.map(op => {
+ switch (op) {
+ case 'edit':
+ return {
+ name: "缂栬緫",
+ clickFun: handleAdd,
+ color: "#409EFF"
+ };
+ case 'viewFile':
+ return {
+ name: "鏌ョ湅闄勪欢",
+ clickFun: viewFile,
+ color: "#67C23A"
+ };
+ default:
+ return null;
+ }
+ }).filter(Boolean)
+ };
+
+ return operationConfig;
};
onMounted(() => {
- radioChange('taskManage');
+ radioChange('taskManage');
});
// 鍗曢�夊彉鍖�
const radioChange = (value) => {
- if (value === "taskManage") {
- const operationColumn = getOperationColumn(['edit']);
- tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
- operationsArr.value = ['edit'];
- } else if (value === "task") {
- const operationColumn = getOperationColumn(['viewFile']);
- tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
- operationsArr.value = ['viewFile'];
- }
- pageNum.value = 1;
- pageSize.value = 10;
- getList();
+ if (value === "taskManage") {
+ const operationColumn = getOperationColumn(['edit']);
+ tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
+ operationsArr.value = ['edit'];
+ } else if (value === "task") {
+ const operationColumn = getOperationColumn(['viewFile']);
+ tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
+ operationsArr.value = ['viewFile'];
+ }
+ pageNum.value = 1;
+ pageSize.value = 10;
+ getList();
};
// 鏌ヨ鎿嶄綔
const handleQuery = () => {
- pageNum.value = 1;
- pageSize.value = 10;
- getList();
+ pageNum.value = 1;
+ pageSize.value = 10;
+ getList();
};
-// 鍒嗛〉澶勭悊
-const handlePagination = (val) => {
- pageNum.value = val.page;
- pageSize.value = val.size;
+const pagination = (obj) => {
+ pageNum.value = obj.page;
+ pageSize.value = obj.limit;
getList();
};
// 鑾峰彇鍒楄〃鏁版嵁
const getList = () => {
- tableLoading.value = true;
-
- const params = { ...queryParams, size: pageSize.value, current: pageNum.value };
-
- let apiCall;
- if (activeRadio.value === "task") {
- apiCall = inspectionTaskList(params);
- } else {
- apiCall = timingTaskList(params);
- }
-
- apiCall.then(res => {
- const rawData = res.data.records || [];
- // 澶勭悊 inspector 瀛楁锛屽皢瀛楃涓茶浆鎹负鏁扮粍锛堥�傜敤浜庢墍鏈夋儏鍐碉級
- tableData.value = rawData.map(item => {
- const processedItem = { ...item };
-
- // 澶勭悊 inspector 瀛楁
- if (processedItem.inspector) {
- if (typeof processedItem.inspector === 'string') {
- // 瀛楃涓叉寜閫楀彿鍒嗗壊
- processedItem.inspector = processedItem.inspector.split(',').map(s => s.trim()).filter(s => s);
- } else if (!Array.isArray(processedItem.inspector)) {
- // 闈炴暟缁勮浆涓烘暟缁�
- processedItem.inspector = [processedItem.inspector];
- }
- } else {
- // 绌哄�艰涓虹┖鏁扮粍
- processedItem.inspector = [];
- }
-
- return processedItem;
- });
- total.value = res.data.total || 0;
- }).finally(() => {
- tableLoading.value = false;
- });
+ tableLoading.value = true;
+
+ const params = { ...queryParams, size: pageSize.value, current: pageNum.value };
+
+ let apiCall;
+ if (activeRadio.value === "task") {
+ apiCall = inspectionTaskList(params);
+ } else {
+ apiCall = timingTaskList(params);
+ }
+
+ apiCall.then(res => {
+ const rawData = res.data.records || [];
+ // 澶勭悊 inspector 瀛楁锛屽皢瀛楃涓茶浆鎹负鏁扮粍锛堥�傜敤浜庢墍鏈夋儏鍐碉級
+ tableData.value = rawData.map(item => {
+ const processedItem = { ...item };
+
+ // 澶勭悊 inspector 瀛楁
+ if (processedItem.inspector) {
+ if (typeof processedItem.inspector === 'string') {
+ // 瀛楃涓叉寜閫楀彿鍒嗗壊
+ processedItem.inspector = processedItem.inspector.split(',').map(s => s.trim()).filter(s => s);
+ } else if (!Array.isArray(processedItem.inspector)) {
+ // 闈炴暟缁勮浆涓烘暟缁�
+ processedItem.inspector = [processedItem.inspector];
+ }
+ } else {
+ // 绌哄�艰涓虹┖鏁扮粍
+ processedItem.inspector = [];
+ }
+
+ return processedItem;
+ });
+ total.value = res.data.total || 0;
+ }).finally(() => {
+ tableLoading.value = false;
+ });
};
// 閲嶇疆鏌ヨ
const resetQuery = () => {
- for (const key in queryParams) {
- if (!["pageNum", "pageSize"].includes(key)) {
- queryParams[key] = "";
- }
- }
- handleQuery();
+ for (const key in queryParams) {
+ if (!["pageNum", "pageSize"].includes(key)) {
+ queryParams[key] = "";
+ }
+ }
+ handleQuery();
};
// 鏂板 / 缂栬緫
const handleAdd = (row) => {
- const type = row ? 'edit' : 'add';
- nextTick(() => {
- formDia.value?.openDialog(type, row);
- });
+ const type = row ? 'edit' : 'add';
+ nextTick(() => {
+ formDia.value?.openDialog(type, row);
+ });
};
// 鏌ョ湅闄勪欢
const viewFile = (row) => {
- nextTick(() => {
- viewFiles.value?.openDialog(row);
- });
+ nextTick(() => {
+ viewFiles.value?.openDialog(row);
+ });
};
// 鍒犻櫎鎿嶄綔
const handleDelete = () => {
- if (!selectedRows.value.length) {
- proxy.$modal.msgWarning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
- return;
- }
-
- const deleteIds = selectedRows.value.map(item => item.id);
-
- proxy.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(() => {
- return delTimingTask(deleteIds);
- }).then(() => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- handleQuery();
- }).catch(() => {});
+ if (!selectedRows.value.length) {
+ proxy.$modal.msgWarning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
+ return;
+ }
+
+ const deleteIds = selectedRows.value.map(item => item.id);
+
+ proxy.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(() => {
+ return delTimingTask(deleteIds);
+ }).then(() => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ handleQuery();
+ }).catch(() => {});
};
// 澶氶�夊彉鏇�
const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
+ selectedRows.value = selection;
};
// 瀵煎嚭
const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- // 鏍规嵁褰撳墠閫変腑鐨勬爣绛鹃〉璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
- if (activeRadio.value === "taskManage") {
- // 瀹氭椂浠诲姟绠$悊
- proxy.download("/timingTask/export", {}, "瀹氭椂浠诲姟绠$悊.xlsx");
- } else if (activeRadio.value === "task") {
- // 瀹氭椂浠诲姟璁板綍
- proxy.download("/inspectionTask/export", {}, "瀹氭椂浠诲姟璁板綍.xlsx");
- }
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ // 鏍规嵁褰撳墠閫変腑鐨勬爣绛鹃〉璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+ if (activeRadio.value === "taskManage") {
+ // 瀹氭椂浠诲姟绠$悊
+ proxy.download("/timingTask/export", {}, "瀹氭椂浠诲姟绠$悊.xlsx");
+ } else if (activeRadio.value === "task") {
+ // 瀹氭椂浠诲姟璁板綍
+ proxy.download("/inspectionTask/export", {}, "瀹氭椂浠诲姟璁板綍.xlsx");
+ }
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
};
</script>
<style scoped>
.person-tags {
- display: flex;
- flex-wrap: wrap;
- gap: 4px;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 4px;
}
.person-tag {
- margin-right: 4px;
- margin-bottom: 2px;
+ margin-right: 4px;
+ margin-bottom: 2px;
}
.no-data {
- color: #909399;
- font-size: 14px;
+ color: #909399;
+ font-size: 14px;
}
</style>
\ No newline at end of file
diff --git a/src/views/equipmentManagement/ledger/index.vue b/src/views/equipmentManagement/ledger/index.vue
index 6af5543..83512ae 100644
--- a/src/views/equipmentManagement/ledger/index.vue
+++ b/src/views/equipmentManagement/ledger/index.vue
@@ -82,15 +82,14 @@
</PIMTable>
</div>
<Modal ref="modalRef" @success="getTableData"></Modal>
- <el-dialog v-model="qrDialogVisible" title="浜岀淮鐮�" width="300px">
- <div style="text-align:center;">
- <img :src="qrCodeUrl" alt="浜岀淮鐮�" style="width:200px;height:200px;" />
- <div style="margin-top:6px;font-size:14px;color:#333;">{{ qrRowData?.deviceName }}</div>
- <div style="margin:10px 0;">
- <el-button type="primary" @click="downloadQRCode">涓嬭浇浜岀淮鐮佸浘鐗�</el-button>
- </div>
- </div>
- </el-dialog>
+ <el-dialog v-model="qrDialogVisible" title="浜岀淮鐮�" width="300px">
+ <div style="text-align:center;">
+ <img :src="qrCodeUrl" alt="浜岀淮鐮�" style="width:200px;height:200px;" />
+ <div style="margin:10px 0;">
+ <el-button type="primary" @click="downloadQRCode">涓嬭浇浜岀淮鐮佸浘鐗�</el-button>
+ </div>
+ </div>
+ </el-dialog>
</div>
</template>
@@ -300,44 +299,10 @@
};
const downloadQRCode = () => {
- const name = qrRowData.value?.deviceName || "浜岀淮鐮�";
- const img = new Image();
- img.src = qrCodeUrl.value;
- img.onload = () => {
- const padding = 10;
- const qrSize = 200;
- const textHeight = 24; // space for text
- const width = qrSize + padding * 2;
- const height = qrSize + padding * 2 + textHeight;
- const canvas = document.createElement("canvas");
- canvas.width = width;
- canvas.height = height;
- const ctx = canvas.getContext("2d");
- // background
- ctx.fillStyle = "#ffffff";
- ctx.fillRect(0, 0, width, height);
- // draw QR centered
- ctx.drawImage(img, padding, padding, qrSize, qrSize);
- // draw name centered below
- ctx.fillStyle = "#333";
- ctx.font = "14px Arial";
- ctx.textAlign = "center";
- ctx.textBaseline = "middle";
- const maxTextWidth = width - padding * 2;
- let displayName = name;
- // ellipsis if too long
- while (ctx.measureText(displayName).width > maxTextWidth && displayName.length > 0) {
- displayName = displayName.slice(0, -1);
- }
- if (displayName !== name) displayName = displayName + "鈥�";
- ctx.fillText(displayName, width / 2, qrSize + padding + textHeight / 2);
-
- const dataUrl = canvas.toDataURL("image/png");
- const a = document.createElement("a");
- a.href = dataUrl;
- a.download = `${name}.png`;
- a.click();
- };
+ const a = document.createElement("a");
+ a.href = qrCodeUrl.value;
+ a.download = `${qrRowData.value.deviceName || "浜岀淮鐮�"}.png`;
+ a.click();
};
onMounted(() => {
diff --git a/src/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue b/src/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue
index 8987485..7932174 100644
--- a/src/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue
+++ b/src/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue
@@ -67,7 +67,9 @@
<el-select
v-model="form.userId"
placeholder="璇烽�夋嫨"
- disabled
+ filterable
+ default-first-option
+ :reserve-keyword="false"
clearable
>
<el-option
diff --git a/src/views/equipmentManagement/measurementEquipment/components/formDia.vue b/src/views/equipmentManagement/measurementEquipment/components/formDia.vue
index 891316d..a9dbc10 100644
--- a/src/views/equipmentManagement/measurementEquipment/components/formDia.vue
+++ b/src/views/equipmentManagement/measurementEquipment/components/formDia.vue
@@ -64,7 +64,9 @@
v-model="form.userId"
placeholder="璇烽�夋嫨"
clearable
- disabled
+ filterable
+ default-first-option
+ :reserve-keyword="false"
>
<el-option
v-for="item in userList"
diff --git a/src/views/equipmentManagement/measurementEquipment/index.vue b/src/views/equipmentManagement/measurementEquipment/index.vue
index e983a99..363a85a 100644
--- a/src/views/equipmentManagement/measurementEquipment/index.vue
+++ b/src/views/equipmentManagement/measurementEquipment/index.vue
@@ -148,13 +148,13 @@
openCalibrationDia("verifying", row);
},
},
- {
- name: "闄勪欢",
- type: "text",
- clickFun: (row) => {
- openFilesFormDia(row);
- },
- },
+ // {
+ // name: "闄勪欢",
+ // type: "text",
+ // clickFun: (row) => {
+ // openFilesFormDia(row);
+ // },
+ // },
],
},
]);
@@ -221,12 +221,6 @@
const handleDelete = () => {
let ids = [];
if (selectedRows.value.length > 0) {
- // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
- const unauthorizedData = selectedRows.value.filter(item => item.userId !== userStore.id);
- if (unauthorizedData.length > 0) {
- proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
- return;
- }
ids = selectedRows.value.map((item) => item.id);
} else {
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
diff --git a/src/views/equipmentManagement/repair/Form/MaintainForm.vue b/src/views/equipmentManagement/repair/Form/MaintainForm.vue
index bbb25c1..2a64d3f 100644
--- a/src/views/equipmentManagement/repair/Form/MaintainForm.vue
+++ b/src/views/equipmentManagement/repair/Form/MaintainForm.vue
@@ -6,6 +6,13 @@
<el-form-item label="缁翠慨缁撴灉">
<el-input v-model="form.maintenanceResult" placeholder="璇疯緭鍏ョ淮淇粨鏋�" />
</el-form-item>
+ <el-form-item label="鎶ヤ慨鐘舵��">
+ <el-select v-model="form.status">
+ <el-option label="寰呮姤淇�" :value="0"></el-option>
+ <el-option label="瀹岀粨" :value="1"></el-option>
+ <el-option label="澶辫触" :value="2"></el-option>
+ </el-select>
+ </el-form-item>
<el-form-item label="缁翠慨鏃ユ湡">
<el-date-picker
v-model="form.maintenanceTime"
@@ -34,6 +41,7 @@
maintenanceName: undefined, // 缁翠慨鍚嶇О
maintenanceResult: undefined, // 缁翠慨缁撴灉
maintenanceTime: undefined, // 缁翠慨鏃ユ湡
+ status: 0,
});
const setForm = (data) => {
diff --git a/src/views/equipmentManagement/repair/Form/RepairForm.vue b/src/views/equipmentManagement/repair/Form/RepairForm.vue
index 1fadde4..eaef93f 100644
--- a/src/views/equipmentManagement/repair/Form/RepairForm.vue
+++ b/src/views/equipmentManagement/repair/Form/RepairForm.vue
@@ -40,6 +40,19 @@
<el-input v-model="form.repairName" placeholder="璇疯緭鍏ユ姤淇汉" />
</el-form-item>
</el-col>
+ </el-row>
+ <el-row v-if="id">
+ <el-col :span="12">
+ <el-form-item label="鎶ヤ慨鐘舵��">
+ <el-select v-model="form.status">
+ <el-option label="寰呯淮淇�" :value="0"></el-option>
+ <el-option label="瀹岀粨" :value="1"></el-option>
+ <el-option label="澶辫触" :value="2"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
<el-col :span="24">
<el-form-item label="鏁呴殰鐜拌薄">
<el-input
@@ -58,6 +71,8 @@
import useFormData from "@/hooks/useFormData";
import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import useUserStore from "@/store/modules/user";
+
+const { id } = defineProps(["id"])
defineOptions({
name: "璁惧鎶ヤ慨琛ㄥ崟",
@@ -78,6 +93,7 @@
repairTime: undefined, // 鎶ヤ慨鏃ユ湡
repairName: userStore.nickName, // 鎶ヤ慨浜�
remark: undefined, // 鏁呴殰鐜拌薄
+ status: 0, // 鎶ヤ慨鐘舵��
});
const setDeviceModel = (id) => {
@@ -96,6 +112,7 @@
form.repairTime = data.repairTime;
form.repairName = data.repairName;
form.remark = data.remark;
+ form.status = data.status;
};
// onMounted(() => {
diff --git a/src/views/equipmentManagement/repair/Modal/RepairModal.vue b/src/views/equipmentManagement/repair/Modal/RepairModal.vue
index 8441da2..0ae3bbe 100644
--- a/src/views/equipmentManagement/repair/Modal/RepairModal.vue
+++ b/src/views/equipmentManagement/repair/Modal/RepairModal.vue
@@ -1,6 +1,6 @@
<template>
<el-dialog v-model="visible" :title="modalOptions.title" @close="close">
- <RepairForm ref="repairFormRef" />
+ <RepairForm ref="repairFormRef" :id="id" />
<template #footer>
<el-button type="primary" @click="sendForm" :loading="loading">
{{ modalOptions.confirmText }}
diff --git a/src/views/equipmentManagement/repair/index.vue b/src/views/equipmentManagement/repair/index.vue
index 1a2ff1e..08cbcc2 100644
--- a/src/views/equipmentManagement/repair/index.vue
+++ b/src/views/equipmentManagement/repair/index.vue
@@ -106,8 +106,9 @@
@pagination="changePage"
>
<template #statusRef="{ row }">
+ <el-tag v-if="row.status === 2" type="danger">澶辫触</el-tag>
<el-tag v-if="row.status === 1" type="success">瀹岀粨</el-tag>
- <el-tag v-if="row.status === 0" type="danger">寰呯淮淇�</el-tag>
+ <el-tag v-if="row.status === 0" type="warning">寰呯淮淇�</el-tag>
</template>
<template #operation="{ row }">
<el-button
diff --git a/src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue b/src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue
index bc3db70..3aa0867 100644
--- a/src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue
+++ b/src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue
@@ -17,11 +17,22 @@
style="width: 100%"
/>
</el-form-item>
+ <el-form-item label="淇濆吇鐘舵��">
+ <el-select v-model="form.status">
+ <el-option label="寰呬繚鍏�" :value="0"></el-option>
+ <el-option label="瀹岀粨" :value="1"></el-option>
+ <el-option label="澶辫触" :value="2"></el-option>
+ </el-select>
+ </el-form-item>
<el-form-item label="淇濆吇缁撴灉">
- <el-select v-model="form.maintenanceResult" placeholder="璇烽�夋嫨淇濆吇缁撴灉">
+ <!-- <el-select v-model="form.maintenanceResult" placeholder="璇烽�夋嫨淇濆吇缁撴灉">
<el-option label="瀹屽ソ" :value="1"></el-option>
<el-option label="缁翠慨" :value="0"></el-option>
- </el-select>
+ </el-select> -->
+ <el-input
+ v-model="form.maintenanceResult"
+ placeholder="璇疯緭鍏ヤ繚鍏荤粨鏋�"
+ type="text" />
</el-form-item>
</el-form>
</template>
@@ -40,6 +51,7 @@
maintenanceActuallyName: undefined, // 瀹為檯淇濆吇浜�
maintenanceActuallyTime: undefined, // 瀹為檯淇濆吇鏃ユ湡
maintenanceResult: undefined, // 淇濆吇缁撴灉
+ status: 0, // 淇濆吇鐘舵��
});
const setForm = (data) => {
diff --git a/src/views/equipmentManagement/upkeep/Form/PlanForm.vue b/src/views/equipmentManagement/upkeep/Form/PlanForm.vue
index 1d94b68..2c16f55 100644
--- a/src/views/equipmentManagement/upkeep/Form/PlanForm.vue
+++ b/src/views/equipmentManagement/upkeep/Form/PlanForm.vue
@@ -5,6 +5,9 @@
v-model="form.deviceLedgerId"
@change="setDeviceModel"
placeholder="璇烽�夋嫨璁惧"
+ filterable
+ default-first-option
+ :reserve-keyword="false"
>
<el-option
v-for="(item, index) in deviceOptions"
@@ -20,6 +23,30 @@
placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
disabled
/>
+ </el-form-item>
+ <el-form-item label="褰曞叆浜�">
+ <el-select
+ v-model="form.createUser"
+ placeholder="璇烽�夋嫨"
+ filterable
+ default-first-option
+ :reserve-keyword="false"
+ clearable
+ >
+ <el-option
+ v-for="item in userList"
+ :key="item.userId"
+ :label="item.userName"
+ :value="item.userId"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item v-if="id" label="淇濅慨鐘舵��">
+ <el-select v-model="form.status">
+ <el-option label="寰呬繚淇�" :value="0"></el-option>
+ <el-option label="瀹岀粨" :value="1"></el-option>
+ <el-option label="澶辫触" :value="2"></el-option>
+ </el-select>
</el-form-item>
<el-form-item label="璁″垝淇濆吇鏃ユ湡">
<el-date-picker
@@ -40,6 +67,7 @@
import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import { onMounted } from "vue";
import dayjs from "dayjs";
+import { userListNoPage } from "@/api/system/user.js";
defineOptions({
name: "璁″垝琛ㄥ崟",
@@ -51,11 +79,15 @@
deviceOptions.value = data;
};
+const { id } = defineProps(['id']);
+
const { form, resetForm } = useFormData({
deviceLedgerId: undefined, // 璁惧Id
deviceName: undefined, // 璁惧鍚嶇О
deviceModel: undefined, // 瑙勬牸鍨嬪彿
maintenancePlanTime: undefined, // 璁″垝淇濆吇鏃ユ湡
+ createUser: undefined, // 褰曞叆浜�
+ status: 0, //淇濅慨鐘舵��
});
const setDeviceModel = (id) => {
@@ -75,15 +107,23 @@
form.deviceLedgerId = data.deviceLedgerId;
form.deviceName = data.deviceName;
form.deviceModel = data.deviceModel;
+ form.createUser = Number(data.createUser);
+ form.status = data.status;
form.maintenancePlanTime = dayjs(data.maintenancePlanTime).format(
"YYYY-MM-DD HH:mm:ss"
);
};
+// 鐢ㄦ埛鍒楄〃
+const userList = ref([]);
+
const loadForm = () => {};
onMounted(() => {
loadDeviceName();
+ userListNoPage().then((res) => {
+ userList.value = res.data;
+ });
});
defineExpose({
diff --git a/src/views/equipmentManagement/upkeep/Modal/PlanModal.vue b/src/views/equipmentManagement/upkeep/Modal/PlanModal.vue
index d9cf246..0fb15f2 100644
--- a/src/views/equipmentManagement/upkeep/Modal/PlanModal.vue
+++ b/src/views/equipmentManagement/upkeep/Modal/PlanModal.vue
@@ -5,7 +5,7 @@
width="30%"
@close="close"
>
- <PlanForm ref="planFormRef"></PlanForm>
+ <PlanForm ref="planFormRef" :id="id"></PlanForm>
<template #footer>
<el-button type="primary" @click="sendForm" :loading="loading">
{{ modalOptions.confirmText }}
diff --git a/src/views/equipmentManagement/upkeep/index.vue b/src/views/equipmentManagement/upkeep/index.vue
index 5612bb6..cc6396b 100644
--- a/src/views/equipmentManagement/upkeep/index.vue
+++ b/src/views/equipmentManagement/upkeep/index.vue
@@ -86,16 +86,18 @@
@pagination="changePage"
>
<template #maintenanceResultRef="{ row }">
- <el-tag v-if="row.maintenanceResult === 1" type="success">
+ <div>{{ row.maintenanceResult || '-' }}</div>
+ <!-- <el-tag v-if="row.maintenanceResult === 1" type="success">
瀹屽ソ
</el-tag>
<el-tag v-if="row.maintenanceResult === 0" type="danger">
缁翠慨
- </el-tag>
+ </el-tag> -->
</template>
<template #statusRef="{ row }">
+ <el-tag v-if="row.status === 2" type="danger">澶辫触</el-tag>
<el-tag v-if="row.status === 1" type="success">瀹岀粨</el-tag>
- <el-tag v-if="row.status === 0" type="danger">寰呬繚鍏�</el-tag>
+ <el-tag v-if="row.status === 0" type="warning">寰呬繚鍏�</el-tag>
</template>
<template #operation="{ row }">
<el-button
@@ -186,13 +188,13 @@
align: "center",
prop: "createUserName",
},
- {
- label: "褰曞叆鏃ユ湡",
- align: "center",
- prop: "createTime",
- formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"),
- width: 200,
- },
+ // {
+ // label: "褰曞叆鏃ユ湡",
+ // align: "center",
+ // prop: "createTime",
+ // formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"),
+ // width: 200,
+ // },
{
label: "瀹為檯淇濆吇浜�",
align: "center",
diff --git a/src/views/financialManagement/expenseManagement/index.vue b/src/views/financialManagement/expenseManagement/index.vue
index a45c32d..b1e9fb1 100644
--- a/src/views/financialManagement/expenseManagement/index.vue
+++ b/src/views/financialManagement/expenseManagement/index.vue
@@ -106,7 +106,6 @@
listPage,
{
expenseMethod: undefined,
- entryDate: undefined,
},
[
{
@@ -227,11 +226,9 @@
const changeDaterange = (value) => {
if (value) {
- filters.entryDate = value;
filters.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
filters.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
} else {
- filters.entryDate = null;
filters.entryDateStart = undefined;
filters.entryDateEnd = undefined;
}
@@ -259,6 +256,12 @@
};
onMounted(() => {
+ filters.entryDate = [
+ dayjs().format("YYYY-MM-DD"),
+ dayjs().add(1, "day").format("YYYY-MM-DD"),
+ ]
+ filters.entryDateStart = dayjs().format("YYYY-MM-DD")
+ filters.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD")
getTableData();
});
</script>
diff --git a/src/views/financialManagement/financialStatements/index.vue b/src/views/financialManagement/financialStatements/index.vue
index e5f9b23..430fe6a 100644
--- a/src/views/financialManagement/financialStatements/index.vue
+++ b/src/views/financialManagement/financialStatements/index.vue
@@ -1,4 +1,4 @@
- <template>
+<template>
<div style="padding: 20px;">
<!-- 椤甸潰鏍囬鍜屾棩鏈熺瓫閫� -->
<div class="w-full md:w-auto flex items-center gap-3" style="margin-bottom: 20px;">
@@ -10,7 +10,7 @@
range-separator="鑷�"
start-placeholder="寮�濮嬫棩鏈�"
end-placeholder="缁撴潫鏃ユ湡"
- clearable
+ :default-value="[new Date(firstDayOfMonth), new Date()]"
@change="handleDateChange"
class="w-full md:w-auto"
style="margin-right: 30px;"
@@ -137,7 +137,8 @@
import dayjs from "dayjs";
// 鏃ユ湡鑼冨洿
-const dateRange = ref(null);
+const dateRange = ref([]);
+const firstDayOfMonth = ref(null);
const chartStyle = {
width: '100%',
height: '100%', // 璁剧疆鍥捐〃瀹瑰櫒鐨勯珮搴�
@@ -319,9 +320,6 @@
})
const getData = async () => {
- if (!dateRange.value || !dateRange.value.length) {
- return;
- }
try {
const {code,data} = await reportForms({entryDateStart:dateRange.value[0], entryDateEnd:dateRange.value[1]});
if(code === 200) {
@@ -372,22 +370,30 @@
};
-// 鍒濆鍖�
+// 鍒濆鍖栨棩鏈熻寖鍥达紙榛樿褰撴湀锛�
onMounted(() => {
- // 涓嶈缃粯璁ゆ棩鏈燂紝鐢辩敤鎴锋墜鍔ㄩ�夋嫨
+ const today = new Date();
+ const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
+ firstDayOfMonth.value = firstDay;
+ dateRange.value = [dayjs(firstDay).format("YYYY-MM-DD"), dayjs(today).format("YYYY-MM-DD")];
+ getData()
+
});
// 澶勭悊鏃ユ湡鑼冨洿鍙樺寲
const handleDateChange = (newRange) => {
- dateRange.value = newRange;
if (newRange && newRange.length === 2) {
+ dateRange.value = newRange;
getData()
}
};
// 閲嶇疆鏃ユ湡鑼冨洿
const resetDateRange = () => {
- dateRange.value = null;
+ const today = new Date();
+ const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
+ dateRange.value = [dayjs(firstDay).format("YYYY-MM-DD"), dayjs(today).format("YYYY-MM-DD")];
+ getData()
};
</script>
diff --git a/src/views/financialManagement/revenueManagement/index.vue b/src/views/financialManagement/revenueManagement/index.vue
index 9dcd23e..285b73f 100644
--- a/src/views/financialManagement/revenueManagement/index.vue
+++ b/src/views/financialManagement/revenueManagement/index.vue
@@ -106,7 +106,6 @@
listPage,
{
incomeMethod: undefined,
- entryDate: undefined,
},
[
{
@@ -227,11 +226,9 @@
const changeDaterange = (value) => {
if (value) {
- filters.entryDate = value;
filters.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
filters.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
} else {
- filters.entryDate = null;
filters.entryDateStart = undefined;
filters.entryDateEnd = undefined;
}
@@ -259,6 +256,12 @@
};
onMounted(() => {
+ filters.entryDate = [
+ dayjs().format("YYYY-MM-DD"),
+ dayjs().add(1, "day").format("YYYY-MM-DD"),
+ ]
+ filters.entryDateStart = dayjs().format("YYYY-MM-DD")
+ filters.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD")
getTableData();
});
</script>
diff --git a/src/views/index.vue b/src/views/index.vue
index 8292b85..e6b22c5 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -13,9 +13,13 @@
<div class="company-meta">{{userStore.roleName}}</div>
</div>
<div style="display: flex;align-items: center;gap: 8px">
- <el-icon color="#5053B5" size="22"><Clock /></el-icon>
- <span>鐧婚檰鏃ユ湡锛歿{userStore.currentLoginTime}}</span>
- </div>
+ <el-icon color="#5053B5" size="22"><Clock /></el-icon>
+ <span>鐧婚檰鏃ユ湡锛歿{userStore.currentLoginTime}}</span>
+ </div>
+ <div style="display: flex;align-items: center;gap: 8px">
+ <el-icon color="#5053B5" size="22"><Calendar /></el-icon>
+ <span>鎺掔彮鏃堕棿锛歿{scheduleTime}}</span>
+ </div>
</div>
</div>
<div class="data-cards">
@@ -24,11 +28,11 @@
<div class="data-num">
<div>
<div class="data-desc">鏈湀閿�鍞/鍏�</div>
- <div class="data-value" :title="businessInfo.monthSaleMoney">{{businessInfo.monthSaleMoney}}</div>
+ <div class="data-value">{{businessInfo.monthSaleMoney}}</div>
</div>
<div>
<div class="data-desc">鏈紑绁ㄩ噾棰�/鍏�</div>
- <div class="data-value" :title="businessInfo.monthSaleHaveMoney">{{businessInfo.monthSaleHaveMoney}}</div>
+ <div class="data-value">{{businessInfo.monthSaleHaveMoney}}</div>
</div>
</div>
@@ -38,24 +42,24 @@
<div class="data-num">
<div>
<div class="data-desc">鏈湀閲囪喘棰�/鍏�</div>
- <div class="data-value" :title="businessInfo.monthPurchaseMoney">{{businessInfo.monthPurchaseMoney}}</div>
+ <div class="data-value">{{businessInfo.monthPurchaseMoney}}</div>
</div>
<div>
<div class="data-desc">寰呬粯娆鹃噾棰�/鍏�</div>
- <div class="data-value" :title="businessInfo.monthPurchaseHaveMoney">{{businessInfo.monthPurchaseHaveMoney}}</div>
+ <div class="data-value">{{businessInfo.monthPurchaseHaveMoney}}</div>
</div>
</div>
</div>
<div class="data-card inventory">
- <div class="data-title">閲囪喘搴撳瓨</div>
+ <div class="data-title">搴撳瓨鏁版嵁</div>
<div class="data-num">
<div>
<div class="data-desc">褰撳墠搴撳瓨鎬婚噺/浠�</div>
- <div class="data-value" :title="businessInfo.inventoryNum">{{businessInfo.inventoryNum}}</div>
+ <div class="data-value">{{businessInfo.inventoryNum}}</div>
</div>
<div>
<div class="data-desc">浠婃棩鍏ュ簱/浠�</div>
- <div class="data-value" :title="businessInfo.todayInventoryNum">{{businessInfo.todayInventoryNum}}</div>
+ <div class="data-value">{{businessInfo.todayInventoryNum}}</div>
</div>
</div>
</div>
@@ -118,11 +122,11 @@
<div class="main-panel">
<div style="display: flex;justify-content: space-between;">
<div class="section-title">搴旀敹搴斾粯缁熻</div>
- <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable">
- <el-radio-button label="鎸夊懆" :value="1" />
- <el-radio-button label="鎸夋湀" :value="2" />
- <el-radio-button label="鎸夊搴�" :value="3" />
- </el-radio-group>
+<!-- <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable">-->
+<!-- <el-radio-button label="鎸夊懆" :value="1" />-->
+<!-- <el-radio-button label="鎸夋湀" :value="2" />-->
+<!-- <el-radio-button label="鎸夊搴�" :value="3" />-->
+<!-- </el-radio-group>-->
</div>
<Echarts ref="chart"
:color="barColors2"
@@ -165,17 +169,23 @@
</template>
<script setup>
-import { ref, onMounted } from 'vue'
+import { ref, reactive, onMounted } from 'vue'
+import { ElNotification } from 'element-plus'
import Echarts from "@/components/Echarts/echarts.vue";
import * as echarts from 'echarts';
import useUserStore from "@/store/modules/user.js";
+import { Clock, Calendar } from '@element-plus/icons-vue'
import {
analysisCustomerContractAmounts, getAmountHalfYear,
getBusiness,
homeTodos,
qualityStatistics,
- statisticsReceivablePayable
+ statisticsReceivablePayable,
+ approveAndDeviceTodos,
+ noticesCount
} from "@/api/viewIndex.js";
+import { getCurrentUserLatestScheduling } from "@/api/personnelManagement/scheduling.js";
+import dayjs from "dayjs";
const userStore = useUserStore()
@@ -287,7 +297,7 @@
formatter: function (params) {
// 鍔ㄦ�佺敓鎴愭彁绀轰俊鎭紝鍩轰簬鏁版嵁椤圭殑 name 灞炴��
const description = params.name === '鏈湀鍥炴閲戦' ? '鏈湀鍥炴閲戦' : '搴旀敹娆鹃噾棰�';
- return `${description} ${formattedNumber(params.value)}鍏� ${params.percent}%`;
+ return `${description} ${formatNumber(params.value)}鍏� ${params.percent}%`;
},
position: 'right'
})
@@ -341,6 +351,10 @@
const todoList = ref([])
const radio1 = ref(1)
+// 鎺掔彮鏃堕棿
+const scheduleTime = ref('')
+const scheduleInfo = ref({})
+
// 鍥捐〃寮曠敤
const barChart = ref(null)
const lineChart = ref(null)
@@ -358,6 +372,9 @@
statisticsReceivable()
qualityStatisticsInfo()
getAmountHalfYearNum()
+ getCurrentUserSchedule()
+ getApproveAndDeviceTodos()
+ getOngoingAnnouncementNoticeNumber()
})
// 鏁版嵁缁熻
const getBusinessData = () => {
@@ -365,13 +382,6 @@
businessInfo.value = {...res.data}
})
}
-const formattedNumber = (row, column, cellValue) => {
- // 濡傛灉鍙紶浜嗕竴涓弬鏁帮紝鐩存帴鏍煎紡鍖栬鍙傛暟
- if (column === undefined && cellValue === undefined) {
- return parseFloat(row).toFixed(2)
- }
- return parseFloat(cellValue).toFixed(2)
-};
// 鍚堝悓閲戦
const analysisCustomer = () => {
analysisCustomerContractAmounts().then((res) => {
@@ -416,6 +426,35 @@
qualityStatisticsObject.value.factoryNum = res.data.factoryNum
})
}
+// 鑾峰彇褰撳墠鐢ㄦ埛鎺掔彮淇℃伅
+const getCurrentUserSchedule = async () => {
+ try {
+ const res = await getCurrentUserLatestScheduling()
+
+ if (res.data) {
+ const currentSchedule = res.data
+ scheduleInfo.value = currentSchedule
+
+ // 鏍煎紡鍖栨帓鐝椂闂存樉绀�
+ if (currentSchedule.startTime && currentSchedule.endTime) {
+ scheduleTime.value = `${currentSchedule.startTime} - ${currentSchedule.endTime}`
+ } else if (currentSchedule.workStartTime && currentSchedule.workEndTime) {
+ const startTime = dayjs(currentSchedule.workStartTime).format('HH:mm')
+ const endTime = dayjs(currentSchedule.workEndTime).format('HH:mm')
+ scheduleTime.value = `${startTime} - ${endTime}`
+ } else {
+ scheduleTime.value = '浠婃棩鏃犳帓鐝�'
+ }
+ } else {
+ scheduleTime.value = '浠婃棩鏃犳帓鐝�'
+ scheduleInfo.value = {}
+ }
+ } catch (error) {
+ console.error('鑾峰彇鎺掔彮淇℃伅澶辫触:', error)
+ scheduleTime.value = '鑾峰彇鎺掔彮淇℃伅澶辫触'
+ }
+}
+
const getAmountHalfYearNum = async () => {
const res = await getAmountHalfYear()
console.log(res)
@@ -432,7 +471,7 @@
xAxis2.value[0].data = monthName.map(item => item.replace(/~/g, '\n~'));
lineSeries.value = [
{
- name: '鍥炴',
+ name: '寮�绁�',
type: 'line',
data: receiptAmount,
stack: 'Total',
@@ -461,7 +500,7 @@
showSymbol: true,
},
{
- name: '寮�绁�',
+ name: '鍥炴',
type: 'line',
data: invoiceAmount,
stack: 'Total',
@@ -490,6 +529,44 @@
},
}
]
+}
+
+// 鍗忓悓寰呭鎵瑰拰鎶ヤ慨寰呭姙浜嬮」
+const getApproveAndDeviceTodos = async () => {
+ try {
+ const res = await approveAndDeviceTodos()
+ const { approveTodo, deviceRepairTodo } = res.data
+
+ // 鏄剧ず閫氱煡
+ ElNotification({
+ title: '寰呭姙浜嬮」鎻愰啋',
+ message: `褰撳墠鏈�${approveTodo}鏉″緟瀹℃壒浜嬮」锛�${deviceRepairTodo}鏉″緟缁翠慨浜嬮」`,
+ type: 'warning',
+ duration: 5000
+ })
+ } catch (error) {
+ console.error('鑾峰彇鍗忓悓寰呭姙浜嬮」澶辫触:', error)
+ }
+}
+// 杩涜涓叕鍛婇�氱煡
+const getOngoingAnnouncementNoticeNumber = async () => {
+ try {
+ const res = await noticesCount()
+ // const { approveTodo, deviceRepairTodo } = res.data
+ const _noticesCount = res.data
+ if(!_noticesCount){
+ return
+ }
+ // 鏄剧ず閫氱煡
+ ElNotification({
+ title: '閫氱煡鍏憡閫氱煡',
+ message: `褰撳墠鏈�${_noticesCount}鏉″叕鍛婇�氱煡锛屾敞鎰忔煡鐪媊,
+ type: 'warning',
+ duration: 5000
+ })
+ } catch (error) {
+ console.error('鑾峰彇鍗忓悓寰呭姙浜嬮」澶辫触:', error)
+ }
}
</script>
@@ -609,9 +686,6 @@
color: #FFFFFF;
}
.data-value {
- max-width: 100px;
- overflow: hidden;
- text-overflow: ellipsis;
font-size: 18px;
font-weight: 500;
margin: 10px 0;
diff --git a/src/views/inventoryManagement/dispatchLog/index.vue b/src/views/inventoryManagement/dispatchLog/index.vue
index a58c62e..5f73d91 100644
--- a/src/views/inventoryManagement/dispatchLog/index.vue
+++ b/src/views/inventoryManagement/dispatchLog/index.vue
@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
- <!-- <el-tab-pane label="閲囪喘鍑哄簱" name="production">
+ <el-tab-pane label="鎴愬搧鍑哄簱" name="production">
<div class="search_form">
<div>
<span class="search_title ml10">鍑哄簱鏃ユ湡锛�</span>
@@ -44,7 +44,8 @@
>
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="鍑哄簱鏃ユ湡" prop="createTime" min-width="120" show-overflow-tooltip />
+ <el-table-column label="鍑哄簱鏃ユ湡" prop="createTime" width="120" show-overflow-tooltip />
+ <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" width="180" show-overflow-tooltip />
<el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
<el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
<el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
@@ -62,9 +63,9 @@
@pagination="paginationChange"
/>
</div>
- </el-tab-pane> -->
+ </el-tab-pane>
- <el-tab-pane label="閲囪喘鍑哄簱" name="purchase">
+ <el-tab-pane label="鍘熸枡鍑哄簱" name="purchase">
<div class="search_form">
<div>
<span class="search_title ml10">鍑哄簱鏃ユ湡锛�</span>
@@ -107,18 +108,15 @@
>
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="鍑哄簱鏃ユ湡" prop="createTime" show-overflow-tooltip />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100" show-overflow-tooltip>
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <el-table-column label="鍑哄簱鏁伴噺/浠�" prop="inboundNum" show-overflow-tooltip />
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍗曚环(鍏�)/鏀�" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="150"></el-table-column>
- <el-table-column label="鍑哄簱浜�" prop="createBy" show-overflow-tooltip />
+ <el-table-column label="鍑哄簱鏃ユ湡" prop="createTime" width="120" show-overflow-tooltip />
+ <el-table-column label="閲囪喘鍚堝悓鍙�" prop="purchaseContractNumber" width="180" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
+ <el-table-column label="鍑哄簱鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
+ <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" width="150"></el-table-column>
+ <el-table-column label="鍑哄簱浜�" prop="createBy" width="80" show-overflow-tooltip />
</el-table>
<pagination
v-show="total > 0"
@@ -131,7 +129,7 @@
</div>
</el-tab-pane>
- <el-tab-pane label="鎴愬搧鍑哄簱" name="manual">
+ <el-tab-pane label="鏉愭枡鍑哄簱" name="manual">
<div class="search_form">
<div>
<span class="search_title ml10">鍑哄簱鏃ユ湡锛�</span>
@@ -174,23 +172,16 @@
>
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧鍥剧墖" width="100" align="center">
- <template #default="scope">
- <img class="barcode-img" :src="javaApiUrl+scope.row.url"></img>
- </template>
- </el-table-column>
- <el-table-column label="鍑哄簱鏃ユ湡" prop="createTime" width="150" show-overflow-tooltip />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100" show-overflow-tooltip>
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <el-table-column label="鍑哄簱鏁伴噺/浠�" prop="inboundNum" width="150" show-overflow-tooltip />
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍗曚环(缇庡厓)/浠�" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="150"></el-table-column>
- <el-table-column label="鍑哄簱浜�" prop="createBy" width="150" show-overflow-tooltip />
+ <el-table-column label="鍑哄簱鏃ユ湡" prop="createTime" show-overflow-tooltip width="130"/>
+ <el-table-column label="鎵规鍙�" prop="code" width="130" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" show-overflow-tooltip />
+ <el-table-column label="鐗╁搧绫诲瀷" prop="itemType" show-overflow-tooltip />
+ <el-table-column label="鍑哄簱鏁伴噺" prop="inboundNum" show-overflow-tooltip />
+ <el-table-column label="鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
+ <el-table-column label="鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" width="150"></el-table-column>
+ <el-table-column label="鍑哄簱浜�" prop="createBy" show-overflow-tooltip />
</el-table>
<pagination
v-show="total > 0"
@@ -227,7 +218,7 @@
<div v-for="(item, index) in printData" :key="index" class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">澶╂触鍙屽鐐规湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">娴峰窛寮�蹇冮鍝佹湁闄愬叕鍙�</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
@@ -240,7 +231,7 @@
<div>
<span class="label">瀹㈡埛鍚嶇О锛�</span>
- <span class="value">{{ item.supplierName }}</span>
+ <span class="value">{{ item.supplierName || '寮犵埍鏈�' }}</span>
</div>
</div>
<div class="info-row">
@@ -254,32 +245,32 @@
<thead>
<tr>
<th>浜у搧鍚嶇О</th>
- <th>浜у搧楂樺害</th>
- <th>鍗曚环锛堢編鍏冿級/浠�</th>
- <th>闆跺敭鏁伴噺/浠�</th>
- <th>姣忎欢鏁伴噺/鏀�</th>
- <th>绾哥瑙勬牸</th>
+ <th>瑙勬牸鍨嬪彿</th>
+ <th>鍗曚綅</th>
+ <th>鍗曚环</th>
+ <th>闆跺敭鏁伴噺</th>
+ <th>闆跺敭閲戦</th>
</tr>
</thead>
<tbody>
<tr>
- <td>{{ item.productCategory || '' }}</td>
- <td>{{ item.specificationModel || '' }}{{ item.unit || '' }}</td>
+ <td>{{ item.productCategory || '鐮傜伆鐮�' }}</td>
+ <td>{{ item.specificationModel || '鏍囧噯' }}</td>
+ <td>{{ item.unit || '鍧�' }}</td>
<td>{{ item.taxInclusiveUnitPrice || '0' }}</td>
- <td>{{ item.inboundNum || '0' }}</td>
- <td>{{ item.boxNum || '0' }}</td>
- <td>{{ item.cartonSpecifications || '0' }}</td>
+ <td>{{ item.inboundNum || '2000' }}</td>
+ <td>{{ item.taxInclusiveTotalPrice || '0' }}</td>
</tr>
</tbody>
<tfoot>
- <!-- <tr>
+ <tr>
<td class="label">鍚堣</td>
<td class="total-value"></td>
<td class="total-value"></td>
<td class="total-value"></td>
<td class="total-value">{{ item.inboundNum || '2000' }}</td>
<td class="total-value">{{ item.taxInclusiveTotalPrice || '0' }}</td>
- </tr> -->
+ </tr>
</tfoot>
</table>
</div>
@@ -333,12 +324,11 @@
getStockInPageByProduct,
getStockInPageByCustom,
} from "@/api/inventoryManagement/stockIn.js";
-const javaApiUrl = __BASE_API__;
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const tableData = ref([]);
-const activeTab = ref('purchase');
+const activeTab = ref('production');
const selectedRows = ref([]);
const tableLoading = ref(false);
const page = reactive({
@@ -440,7 +430,7 @@
page.current = 1
searchForm.value.supplierName = ''
searchForm.value.customerName = ''
- searchForm.value.timeStr = getCurrentDate() // 閲嶇疆涓哄綋鍓嶆棩鏈�
+ searchForm.value.timeStr = ''
selectedRows.value = []
searchForm.value.productCategory = ''
getList()
@@ -671,7 +661,7 @@
<div class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">鍙屽鐐规湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">娴峰窛寮�蹇冮鍝佹湁闄愬叕鍙�</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
@@ -683,41 +673,49 @@
</div>
<div>
<span class="label">瀹㈡埛鍚嶇О锛�</span>
- <span class="value">${item.supplierName}</span>
+ <span class="value">${item.supplierName || '寮犵埍鏈�'}</span>
</div>
</div>
<div class="info-row">
<span class="label">鍗曞彿锛�</span>
- <span class="value">${item.code}</span>
+ <span class="value">${item.code || ''}</span>
</div>
</div>
<div class="table-section">
- <table class="product-table">
- <thead>
- <tr>
- <th>浜у搧鍚嶇О</th>
- <th>浜у搧楂樺害</th>
- <th>鍗曚环锛堢編鍏冿級/浠�</th>
- <th>闆跺敭鏁伴噺/浠�</th>
- <th>姣忎欢鏁伴噺/鏀�</th>
- <th>绾哥瑙勬牸</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{ item.productCategory || '' }}</td>
- <td>{{ item.specificationModel || '' }}{{ item.unit || '' }}</td>
- <td>{{ item.taxInclusiveUnitPrice || '0' }}</td>
- <td>{{ item.inboundNum || '0' }}</td>
- <td>{{ item.boxNum || '0' }}</td>
- <td>{{ item.cartonSpecifications || '0' }}</td>
- </tr>
- </tbody>
- <tfoot>
- </tfoot>
- </table>
- </div>
+ <table class="product-table">
+ <thead>
+ <tr>
+ <th>浜у搧鍚嶇О</th>
+ <th>瑙勬牸鍨嬪彿</th>
+ <th>鍗曚綅</th>
+ <th>鍗曚环</th>
+ <th>闆跺敭鏁伴噺</th>
+ <th>闆跺敭閲戦</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>${item.productCategory || '鐮傜伆鐮�'}</td>
+ <td>${item.specificationModel || '鏍囧噯'}</td>
+ <td>${item.unit || '鍧�'}</td>
+ <td>${item.taxInclusiveUnitPrice || '0'}</td>
+ <td>${item.inboundNum || '2000'}</td>
+ <td>${item.taxInclusiveTotalPrice || '0'}</td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <td class="label">鍚堣</td>
+ <td class="total-value"></td>
+ <td class="total-value"></td>
+ <td class="total-value"></td>
+ <td class="total-value">${item.inboundNum || '2000'}</td>
+ <td class="total-value">${item.taxInclusiveTotalPrice || '0'}</td>
+ </tr>
+ </tfoot>
+ </table>
+ </div>
<div class="footer-section">
<div class="footer-row">
@@ -970,12 +968,6 @@
.print-page:last-child {
page-break-after: avoid;
}
-}
-.barcode-img{
- width: 80px;
- height: 80px;
- border-radius: 5px;
- background-color: #F5F5F5;
}
</style>
diff --git a/src/views/inventoryManagement/issueManagement/index.vue b/src/views/inventoryManagement/issueManagement/index.vue
index d283332..57ac9be 100644
--- a/src/views/inventoryManagement/issueManagement/index.vue
+++ b/src/views/inventoryManagement/issueManagement/index.vue
@@ -1,19 +1,9 @@
<template>
<div class="app-container">
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
- <!-- <el-tab-pane label="閲囪喘鍑哄簱" name="production">
+ <el-tab-pane label="鎴愬搧鍑哄簱" name="production">
<div class="search_form">
<div>
- <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
- <el-date-picker
- v-model="searchForm.timeStr"
- type="date"
- placeholder="璇烽�夋嫨鏃ユ湡"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- clearable
- @change="handleQuery"
- />
<span class="search_title ml10">浜у搧澶х被锛�</span>
<el-input
v-model="searchForm.productCategory"
@@ -32,36 +22,25 @@
:expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
:summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="鍏ュ簱鏃堕棿" prop="createTime" width="100" show-overflow-tooltip />
+ <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" width="180" show-overflow-tooltip />
<el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
<el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
<el-table-column label="鍗曚綅" prop="unit" width="70" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="90" show-overflow-tooltip />
<el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="90" show-overflow-tooltip />
<el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
<template #default="scope">
- <el-button link type="primary" size="small" @click="openForm(scope.row);">棰嗙敤</el-button>
+ <el-button link type="primary" size="small" @click="openForm(scope.row);">鍙戣揣</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
:page="page.current" :limit="page.size" @pagination="paginationChange" />
</div>
- </el-tab-pane> -->
+ </el-tab-pane>
- <el-tab-pane label="閲囪喘鍑哄簱" name="purchase">
+ <el-tab-pane label="鍘熸枡鍑哄簱" name="purchase">
<div class="search_form">
<div>
- <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
- <el-date-picker
- v-model="searchForm.timeStr"
- type="date"
- placeholder="璇烽�夋嫨鏃ユ湡"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- clearable
- @change="handleQuery"
- />
<span class="search_title ml10">浜у搧澶х被锛�</span>
<el-input
v-model="searchForm.productCategory"
@@ -81,22 +60,16 @@
:summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="鍏ュ簱鏃堕棿" prop="createTime" width="100" show-overflow-tooltip />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100" show-overflow-tooltip>
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <el-table-column label="鍏ュ簱鏁伴噺/浠�" prop="inboundNum" width="100" show-overflow-tooltip />
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="90" show-overflow-tooltip />
- <el-table-column label="鍗曚环(鍏�)/浠�" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="150"></el-table-column>
- <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
+ <el-table-column label="閲囪喘鍚堝悓鍙�" prop="purchaseContractNumber" width="180" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="70" show-overflow-tooltip />
+ <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="90" show-overflow-tooltip />
+ <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
+ <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" width="150"></el-table-column>
<el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
<template #default="scope">
- <el-button link type="primary" size="small" @click="openForm(scope.row);" :disabled="!scope.row.inboundNum0">棰嗙敤</el-button>
+ <el-button link type="primary" size="small" @click="openForm(scope.row);">棰嗙敤</el-button>
</template>
</el-table-column>
</el-table>
@@ -105,22 +78,9 @@
</div>
</el-tab-pane>
- <el-tab-pane label="鎴愬搧鍑哄簱" name="manual">
+ <el-tab-pane label="鏉愭枡鍑哄簱" name="manual">
<div class="search_form">
<div>
-<!-- <span class="search_title">渚涘簲鍟嗗悕绉帮細</span>-->
-<!-- <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="璇疯緭鍏�" @change="handleQuery"-->
-<!-- clearable prefix-icon="Search" />-->
- <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
- <el-date-picker
- v-model="searchForm.timeStr"
- type="date"
- placeholder="璇烽�夋嫨鏃ユ湡"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- clearable
- @change="handleQuery"
- />
<span class="search_title ml10">浜у搧澶х被锛�</span>
<el-input
v-model="searchForm.productCategory"
@@ -138,29 +98,17 @@
<el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
:expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
:summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
- <!-- <el-table-column align="center" type="selection" width="55" /> -->
+ <el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧鍥剧墖" width="100" align="center">
- <template #default="scope">
- <img class="barcode-img" :src="javaApiUrl+scope.row.url"></img>
- </template>
- </el-table-column>
- <el-table-column label="鍏ュ簱鏃堕棿" prop="inboundDate" width="100" show-overflow-tooltip />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100" show-overflow-tooltip>
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <el-table-column label="鍏ュ簱鏁伴噺/浠�" prop="inboundNum" width="100" show-overflow-tooltip />
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="90" show-overflow-tooltip />
- <el-table-column label="鍗曚环(缇庡厓)/浠�" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="150"></el-table-column>
- <el-table-column label="鍏ュ簱浜�" prop="createBy" width="150" show-overflow-tooltip />
+ <el-table-column label="鎵规鍙�" prop="code" width="130" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="70" show-overflow-tooltip />
+ <el-table-column label="鐗╁搧绫诲瀷" prop="itemType" show-overflow-tooltip />
+ <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="90" show-overflow-tooltip />
<el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
<template #default="scope">
- <el-button link type="primary" size="small" @click="openForm(scope.row);" :disabled="!scope.row.inboundNum0">棰嗙敤</el-button>
+ <el-button link type="primary" size="small" @click="openForm(scope.row);">棰嗙敤</el-button>
</template>
</el-table-column>
</el-table>
@@ -169,17 +117,17 @@
</div>
</el-tab-pane>
</el-tabs>
- <el-dialog v-model="dialogFormVisible" :title="'鏂板鍑哄簱'" width="40%" @close="closeDia">
+ <el-dialog v-model="dialogFormVisible" :title="getDialogTitle()" width="40%" @close="closeDia">
<el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
- <div>鍙嚭搴撴暟閲�:{{currentRowNum}}</div>
- <el-form-item label="鍑哄簱鏁伴噺锛�" prop="salesContractNo">
- <el-input-number :step="1" :min="0" :max="currentRowNum" style="width: 100%" v-model="form.inboundQuantity" placeholder="璇疯緭鍏�" clearable />
+ <div>{{getAvailableQuantityText()}}:{{currentRowNum}}</div>
+ <el-form-item :label="getQuantityLabel()" prop="salesContractNo">
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inboundQuantity" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
- <el-form-item label="鍑哄簱鏃ユ湡锛�" prop="projectName">
+ <el-form-item :label="getDateLabel()" prop="projectName">
<el-date-picker style="width: 100%" v-model="form.inboundTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
type="date" placeholder="璇烽�夋嫨" clearable />
</el-form-item>
- <el-form-item label="鍑哄簱浜猴細" prop="entryPerson">
+ <el-form-item :label="getPersonLabel()" prop="entryPerson">
<el-select v-model="form.nickName" filterable
default-first-option
:reserve-keyword="false" placeholder="璇烽�夋嫨" clearable>
@@ -213,7 +161,6 @@
delStockManage,
stockOut,
} from "@/api/inventoryManagement/stockManage.js";
-const javaApiUrl = __BASE_API__;
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
@@ -230,12 +177,12 @@
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const dialogFormVisible = ref(false)
-const activeTab = ref('purchase')
+const activeTab = ref('production')
const data = reactive({
searchForm: {
supplierName: '',
customerName: '',
- inboundQuantity:0,
+ inboundQuantity:'',
inboundTime:'',
nickName: '',
userId: '',
@@ -296,7 +243,7 @@
page.current = 1
searchForm.value.supplierName = ''
searchForm.value.customerName = ''
- searchForm.value.timeStr = getCurrentDate() // 閲嶇疆涓哄綋鍓嶆棩鏈�
+ searchForm.value.timeStr = ''
selectedRows.value = []
searchForm.value.productCategory = ''
getList()
@@ -343,7 +290,7 @@
// 鍒濆鍖栬〃鍗曟暟鎹�
form.value = {
productrecordId: '',
- inboundQuantity: 0, // 鍑哄簱鏁伴噺娓呯┖
+ inboundQuantity: '', // 鍑哄簱鏁伴噺娓呯┖
inboundTime: getCurrentDate(), // 榛樿褰撳墠鏃ユ湡
nickName: '', // 榛樿褰撳墠鐢ㄦ埛
}
@@ -361,13 +308,7 @@
const submitForm = () => {
let num = Number(form.value.inboundQuantity)
if(num <= 0 || num > currentRowNum.value){
- return proxy.$modal.msgWarning("璇峰~鍐欏嚭搴撴暟閲�")
- }
- if(!form.value.nickName){
- return proxy.$modal.msgWarning("璇烽�夋嫨鍑哄簱浜�")
- }
- if(!form.value.inboundTime){
- return proxy.$modal.msgWarning("璇烽�夋嫨鍑哄簱鏃堕棿")
+ return proxy.$modal.msgWarning("璇峰~鍏ユ湁鏁堟暟瀛�")
}
proxy.$refs["formRef"].validate(valid => {
if (valid && currentRowId.value) {
@@ -409,13 +350,13 @@
}
).then(() => {
// 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
- let exportUrl = "/stockmanagement/export"
+ let exportUrl = "/stockin/export"
if (activeTab.value === 'production') {
- exportUrl = "/stockmanagement/exportOne"
+ exportUrl = "/stockin/exportOne"
} else if (activeTab.value === 'manual') {
- exportUrl = "/stockmanagement/exportTwo"
+ exportUrl = "/stockin/exportTwo"
}
- proxy.download(exportUrl, {}, '鍑哄簱鍙拌处.xlsx')
+ proxy.download(exportUrl, {}, '鍏ュ簱鍙拌处.xlsx')
}).catch(() => {
proxy.$modal.msg("宸插彇娑�")
})
@@ -453,16 +394,62 @@
const day = String(today.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
+
+// 鏍规嵁tab绫诲瀷鑾峰彇寮规鏍囬
+const getDialogTitle = () => {
+ const titleMap = {
+ production: '鏂板鍙戣揣',
+ purchase: '鏂板棰嗙敤',
+ manual: '鏂板棰嗙敤'
+ };
+ return titleMap[activeTab.value] || '鏂板鍑哄簱';
+};
+
+// 鏍规嵁tab绫诲瀷鑾峰彇鍙嚭搴撴暟閲忔枃鏈�
+const getAvailableQuantityText = () => {
+ const textMap = {
+ production: '鍙彂璐ф暟閲�',
+ purchase: '鍙鐢ㄦ暟閲�',
+ manual: '鍙鐢ㄦ暟閲�'
+ };
+ return textMap[activeTab.value] || '鍙嚭搴撴暟閲�';
+};
+
+// 鏍规嵁tab绫诲瀷鑾峰彇鏁伴噺瀛楁鏍囩
+const getQuantityLabel = () => {
+ const labelMap = {
+ production: '鍙戣揣鏁伴噺锛�',
+ purchase: '棰嗙敤鏁伴噺锛�',
+ manual: '棰嗙敤鏁伴噺锛�'
+ };
+ return labelMap[activeTab.value] || '鍑哄簱鏁伴噺锛�';
+};
+
+// 鏍规嵁tab绫诲瀷鑾峰彇鏃ユ湡瀛楁鏍囩
+const getDateLabel = () => {
+ const labelMap = {
+ production: '鍙戣揣鏃ユ湡锛�',
+ purchase: '棰嗙敤鏃ユ湡锛�',
+ manual: '棰嗙敤鏃ユ湡锛�'
+ };
+ return labelMap[activeTab.value] || '鍑哄簱鏃ユ湡锛�';
+};
+
+// 鏍规嵁tab绫诲瀷鑾峰彇浜哄憳瀛楁鏍囩
+const getPersonLabel = () => {
+ const labelMap = {
+ production: '鍙戣揣浜猴細',
+ purchase: '棰嗙敤浜猴細',
+ manual: '棰嗙敤浜猴細'
+ };
+ return labelMap[activeTab.value] || '鍑哄簱浜猴細';
+};
+
onMounted(() => {
getList()
})
</script>
-<style scoped lang="scss">
- .barcode-img{
- width: 80px;
- height: 80px;
- border-radius: 5px;
- background-color: #F5F5F5;
- }
-</style>
+<style scoped lang="scss"></style>
+
+
diff --git a/src/views/inventoryManagement/receiptManagement/components/formDia.vue b/src/views/inventoryManagement/receiptManagement/components/formDia.vue
index 09b9fef..3bd3390 100644
--- a/src/views/inventoryManagement/receiptManagement/components/formDia.vue
+++ b/src/views/inventoryManagement/receiptManagement/components/formDia.vue
@@ -1,81 +1,81 @@
<template>
- <el-dialog v-model="dialogFormVisible" :title="getDialogTitle()" width="70%"
- @close="closeDia">
- <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
- <el-form-item label="閲囪喘璁㈠崟鍙�" prop="purchaseContractNumber">
- <el-select
- v-model="form.purchaseContractNumber"
- placeholder="璇烽�夋嫨閲囪喘璁㈠崟鍙�"
- clearable
- filterable
- :loading="loadingPurchaseOptions"
- @change="handlePurchaseChange"
- :disabled="operationType === 'edit'"
- style="width: 100%"
- >
- <el-option
- v-for="item in purchaseOptions"
- :key="item.purchaseContractNumber"
- :label="formatPurchaseOption(item)"
- :value="item.purchaseContractNumber"
- />
- </el-select>
- </el-form-item>
- <el-table
- :data="productList"
- border
- v-loading="loadingProducts"
- @selection-change="handleSelectionChange"
- >
- <el-table-column align="center" type="selection" width="55" />
- <el-table-column
- align="center"
- label="搴忓彿"
- type="index"
- width="60"
- />
- <el-table-column label="浜у搧澶х被" prop="productCategory" />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
- <el-table-column label="鍗曚綅" prop="unit" width="70" />
- <!-- <el-table-column label="渚涘簲鍟�" prop="supplierName" width="100" /> -->
- <el-table-column label="閲囪喘鏁伴噺" prop="quantity" width="100" />
- <el-table-column label="寰呭叆搴撴暟閲�" prop="quantity0" width="100" />
- <el-table-column label="鏈鍏ュ簱鏁伴噺" prop="quantityStock" width="150">
- <template #default="scope">
- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" @change="() => calculateTotalPrice(scope.row)" />
- </template>
- </el-table-column>
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="120" />
- <el-table-column label="鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150">
+ <el-dialog v-model="dialogFormVisible" :title="getDialogTitle()" width="70%"
+ @close="closeDia">
+ <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
+ <el-form-item label="閲囪喘璁㈠崟鍙�" prop="purchaseContractNumber">
+ <el-select
+ v-model="form.purchaseContractNumber"
+ placeholder="璇烽�夋嫨閲囪喘璁㈠崟鍙�"
+ clearable
+ filterable
+ :loading="loadingPurchaseOptions"
+ @change="handlePurchaseChange"
+ :disabled="operationType === 'edit'"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in purchaseOptions"
+ :key="item.purchaseContractNumber"
+ :label="formatPurchaseOption(item)"
+ :value="item.purchaseContractNumber"
+ />
+ </el-select>
+ </el-form-item>
+ <el-table
+ :data="productList"
+ border
+ v-loading="loadingProducts"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column align="center" type="selection" width="55" />
+ <el-table-column
+ align="center"
+ label="搴忓彿"
+ type="index"
+ width="60"
+ />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
+ <el-table-column label="鍗曚綅" prop="unit" width="70" />
+ <!-- <el-table-column label="渚涘簲鍟�" prop="supplierName" width="100" /> -->
+ <el-table-column label="閲囪喘鏁伴噺" prop="quantity" width="100" />
+ <el-table-column label="寰呭叆搴撴暟閲�" prop="quantity0" width="100" />
+ <el-table-column label="鏈鍏ュ簱鏁伴噺" prop="quantityStock" width="150">
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" @change="() => calculateTotalPrice(scope.row)" />
+ </template>
+ </el-table-column>
+ <el-table-column label="绋庣巼(%)" prop="taxRate" width="120" />
+ <el-table-column label="鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150">
<template #default="scope">
<el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" :disabled="operationType === 'edit'"/>
</template>
</el-table-column>
- <el-table-column
- label="鎬讳环(鍏�)"
+ <el-table-column
+ label="鎬讳环(鍏�)"
:formatter="formattedNumber"
- prop="taxInclusiveTotalPrice"
- width="150"
- >
- </el-table-column>
- </el-table>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
- <el-button @click="closeDia">鍙栨秷</el-button>
- </div>
- </template>
- </el-dialog>
+ prop="taxInclusiveTotalPrice"
+ width="150"
+ >
+ </el-table-column>
+ </el-table>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
</template>
<script setup>
import { ref, reactive, toRefs, getCurrentInstance } from 'vue'
import useUserStore from '@/store/modules/user'
import {
- updateStockIn,
- addSutockIn,
- selectProductRecordListByPuechaserId
+ updateStockIn,
+ addSutockIn,
+ selectProductRecordListByPuechaserId
} from "@/api/inventoryManagement/stockIn.js";
import { purchaseListPage } from "@/api/procurementManagement/procurementLedger.js";
@@ -93,302 +93,303 @@
const loading = ref(false);
const data = reactive({
- form: {
- id: null,
- purchaseContractNumber: '', // 閲囪喘璁㈠崟鍙�
- supplierId: null, // 渚涘簲鍟咺D
- supplierName: '', // 渚涘簲鍟嗗悕绉�
- inboundTime: '', // 鍏ュ簱鏃堕棿
- inboundBatch: '', // 鍏ュ簱鎵规
- recorderId: userStore.userId, // 褰曞叆浜篒D
- recorderName: userStore.name, // 褰曞叆浜哄鍚�
- entryDate: getCurrentDate(), // 褰曞叆鏃ユ湡
- remark: '', // 澶囨敞
- },
- rules: {
- purchaseContractNumber: [{ required: true, message: "璇疯緭鍏ラ噰璐悎鍚屽彿", trigger: "blur" }],
- supplierId: [{ required: true, message: "璇烽�夋嫨渚涘簲鍟�", trigger: "change" }],
- inboundTime: [{ required: true, message: "璇烽�夋嫨鍏ュ簱鏃堕棿", trigger: "change" }],
- inboundBatch: [{ required: true, message: "璇疯緭鍏ュ叆搴撴壒娆�", trigger: "blur" }]
- }
+ form: {
+ id: null,
+ purchaseContractNumber: '', // 閲囪喘璁㈠崟鍙�
+ supplierId: null, // 渚涘簲鍟咺D
+ supplierName: '', // 渚涘簲鍟嗗悕绉�
+ inboundTime: '', // 鍏ュ簱鏃堕棿
+ inboundBatch: '', // 鍏ュ簱鎵规
+ recorderId: userStore.userId, // 褰曞叆浜篒D
+ recorderName: userStore.name, // 褰曞叆浜哄鍚�
+ entryDate: getCurrentDate(), // 褰曞叆鏃ユ湡
+ remark: '', // 澶囨敞
+ },
+ rules: {
+ purchaseContractNumber: [{ required: true, message: "璇疯緭鍏ラ噰璐悎鍚屽彿", trigger: "blur" }],
+ supplierId: [{ required: true, message: "璇烽�夋嫨渚涘簲鍟�", trigger: "change" }],
+ inboundTime: [{ required: true, message: "璇烽�夋嫨鍏ュ簱鏃堕棿", trigger: "change" }],
+ inboundBatch: [{ required: true, message: "璇疯緭鍏ュ叆搴撴壒娆�", trigger: "blur" }]
+ }
})
const { form, rules } = toRefs(data)
// 鍔ㄦ�佽绠楀璇濇鏍囬
const getDialogTitle = () => {
- return operationType.value === 'add' ? '鏂板鍏ュ簱' : '缂栬緫鍏ュ簱'
+ return operationType.value === 'add' ? '鏂板鍏ュ簱' : '缂栬緫鍏ュ簱'
}
const formatPurchaseOption = (item = {}) => {
- const contract = item.purchaseContractNumber || '--';
- const supplier = item.supplierName ? ` 路 ${item.supplierName}` : '';
- return `${contract}${supplier}`;
+ const contract = item.purchaseContractNumber || '--';
+ const supplier = item.supplierName ? ` 路 ${item.supplierName}` : '';
+ return `${contract}${supplier}`;
};
const loadPurchaseOptions = async (keyword = '') => {
- try {
- loadingPurchaseOptions.value = true;
- const res = await purchaseListPage({
- current: -1,
- size: -1,
- purchaseContractNumber: keyword,
- });
- const records = res.data?.records || [];
- purchaseOptions.value = records;
- if (
- form.value.purchaseContractNumber &&
- !purchaseOptions.value.find(
- (item) => item.purchaseContractNumber === form.value.purchaseContractNumber
- )
- ) {
- purchaseOptions.value.push({
- purchaseContractNumber: form.value.purchaseContractNumber,
- supplierName: form.value.supplierName,
- supplierId: form.value.supplierId,
- });
- }
- } finally {
- loadingPurchaseOptions.value = false;
- }
+ try {
+ loadingPurchaseOptions.value = true;
+ const res = await purchaseListPage({
+ current: -1,
+ size: -1,
+ purchaseContractNumber: keyword,
+ });
+ const records = res.data?.records || [];
+ purchaseOptions.value = records;
+ if (
+ form.value.purchaseContractNumber &&
+ !purchaseOptions.value.find(
+ (item) => item.purchaseContractNumber === form.value.purchaseContractNumber
+ )
+ ) {
+ purchaseOptions.value.push({
+ purchaseContractNumber: form.value.purchaseContractNumber,
+ supplierName: form.value.supplierName,
+ supplierId: form.value.supplierId,
+ });
+ }
+ } finally {
+ loadingPurchaseOptions.value = false;
+ }
};
const handlePurchaseChange = (value) => {
- form.value.purchaseContractNumber = value || '';
- const matched = purchaseOptions.value.find(
- (item) => item.purchaseContractNumber === value
- );
- if (matched) {
- form.value.supplierName = matched.supplierName || form.value.supplierName;
- form.value.supplierId = matched.supplierId || form.value.supplierId;
- }
- if (!value) {
- productList.value = [];
- return;
- }
- fetchProductsByContract();
+ form.value.purchaseContractNumber = value || '';
+ const matched = purchaseOptions.value.find(
+ (item) => item.purchaseContractNumber === value
+ );
+ if (matched) {
+ form.value.supplierName = matched.supplierName || form.value.supplierName;
+ form.value.supplierId = matched.supplierId || form.value.supplierId;
+ }
+ if (!value) {
+ productList.value = [];
+ return;
+ }
+ fetchProductsByContract();
};
const exceedsAddLimit = (product) => {
- const stock = Number(product?.quantityStock ?? 0);
- const waiting = Number(product?.quantity0 ?? 0);
- if (!Number.isFinite(stock) || !Number.isFinite(waiting)) {
- return false;
- }
- return stock > waiting;
+ const stock = Number(product?.quantityStock ?? 0);
+ const waiting = Number(product?.quantity0 ?? 0);
+ if (!Number.isFinite(stock) || !Number.isFinite(waiting)) {
+ return false;
+ }
+ return stock > waiting;
};
const exceedsEditLimit = (product) => {
- const stock = Number(product?.quantityStock ?? 0);
- const waiting = Number(product?.quantity0 ?? 0);
- const original = Number(product?.originalQuantityStock ?? 0);
- if (!Number.isFinite(stock) || !Number.isFinite(waiting) || !Number.isFinite(original)) {
- return false;
- }
- return stock > waiting + original;
+ const stock = Number(product?.quantityStock ?? 0);
+ const waiting = Number(product?.quantity0 ?? 0);
+ const original = Number(product?.originalQuantityStock ?? 0);
+ if (!Number.isFinite(stock) || !Number.isFinite(waiting) || !Number.isFinite(original)) {
+ return false;
+ }
+ return stock > waiting + original;
};
const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(2);
};
// 璁$畻鎬讳环
const calculateTotalPrice = (row) => {
- const quantityStock = Number(row?.quantityStock ?? 0);
- const taxInclusiveUnitPrice = Number(row?.taxInclusiveUnitPrice ?? 0);
-
- if (Number.isFinite(quantityStock) && Number.isFinite(taxInclusiveUnitPrice)) {
- row.taxInclusiveTotalPrice = quantityStock * taxInclusiveUnitPrice;
- } else {
- row.taxInclusiveTotalPrice = 0;
- }
+ const quantityStock = Number(row?.quantityStock ?? 0);
+ const taxInclusiveUnitPrice = Number(row?.taxInclusiveUnitPrice ?? 0);
+
+ if (Number.isFinite(quantityStock) && Number.isFinite(taxInclusiveUnitPrice)) {
+ row.taxInclusiveTotalPrice = quantityStock * taxInclusiveUnitPrice;
+ } else {
+ row.taxInclusiveTotalPrice = 0;
+ }
};
const fetchProductsByContract = async () => {
- if (!form.value.purchaseContractNumber) {
- proxy.$modal.msgWarning('璇烽�夋嫨鍚堝悓鍙�')
- return
- }
- try {
- loadingProducts.value = true
- const productRes = await selectProductRecordListByPuechaserId({
- purchaseContractNumber: form.value.purchaseContractNumber
- });
- if (!productRes.data || productRes.data.length === 0) {
- proxy.$modal.msgWarning('璇ュ悎鍚屼笅娌℃湁浜у搧璁板綍')
- productList.value = [];
- return
- }
- productList.value = productRes.data.map(item => ({
- ...item,
- quantityStock: 0,
- taxInclusiveUnitPrice: Number(item?.taxInclusiveUnitPrice ?? 0),
- taxInclusiveTotalPrice: 0,
- originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? 0),
- }))
- } catch (error) {
- console.error('鏌ヨ浜у搧璁板綍澶辫触:', error)
- proxy.$modal.msgError('鏌ヨ浜у搧璁板綍澶辫触')
- productList.value = [];
- } finally {
- loadingProducts.value = false
- }
+ if (!form.value.purchaseContractNumber) {
+ proxy.$modal.msgWarning('璇烽�夋嫨鍚堝悓鍙�')
+ return
+ }
+ try {
+ loadingProducts.value = true
+ const productRes = await selectProductRecordListByPuechaserId({
+ purchaseContractNumber: form.value.purchaseContractNumber
+ });
+ if (!productRes.data || productRes.data.length === 0) {
+ proxy.$modal.msgWarning('璇ュ悎鍚屼笅娌℃湁浜у搧璁板綍')
+ productList.value = [];
+ return
+ }
+ productList.value = productRes.data.map(item => ({
+ ...item,
+ quantityStock: 0,
+ taxInclusiveUnitPrice: Number(item?.taxInclusiveUnitPrice ?? 0),
+ taxInclusiveTotalPrice: 0,
+ originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? 0),
+ }))
+ } catch (error) {
+ console.error('鏌ヨ浜у搧璁板綍澶辫触:', error)
+ proxy.$modal.msgError('鏌ヨ浜у搧璁板綍澶辫触')
+ productList.value = [];
+ } finally {
+ loadingProducts.value = false
+ }
}
const updatePro = async () => {
- if (selectedRows.value.length === 0) {
- proxy.$modal.msgWarning('璇峰厛閫夋嫨浜у搧');
- return;
- }
- const target = selectedRows.value[0];
- const stock = Number(target?.quantityStock ?? 0);
- if (!Number.isFinite(stock) || stock <= 0) {
- proxy.$modal.msgWarning('璇峰~鍐欐湁鏁堢殑鍏ュ簱鏁伴噺');
- return;
- }
- if (exceedsEditLimit(target)) {
- proxy.$modal.msgError('鏈鍏ュ簱鏁伴噺涓嶈兘瓒呰繃鍘熷叆搴撴暟閲忎笌寰呭叆搴撴暟閲忎箣鍜�');
- return;
- }
- const stockInData = {
- id: selectedRows.value[0].recordId,
- quantityStock: Number(selectedRows.value[0].quantityStock),
- };
- await updateStockIn(stockInData)
- proxy.$modal.msgSuccess('淇敼鍏ュ簱鎴愬姛')
- closeDia()
- emit('success')
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning('璇峰厛閫夋嫨浜у搧');
+ return;
+ }
+ const target = selectedRows.value[0];
+ const stock = Number(target?.quantityStock ?? 0);
+ if (!Number.isFinite(stock) || stock <= 0) {
+ proxy.$modal.msgWarning('璇峰~鍐欐湁鏁堢殑鍏ュ簱鏁伴噺');
+ return;
+ }
+ if (exceedsEditLimit(target)) {
+ proxy.$modal.msgError('鏈鍏ュ簱鏁伴噺涓嶈兘瓒呰繃鍘熷叆搴撴暟閲忎笌寰呭叆搴撴暟閲忎箣鍜�');
+ return;
+ }
+ const stockInData = {
+ id: selectedRows.value[0].recordId,
+ quantityStock: Number(selectedRows.value[0].quantityStock),
+ };
+ await updateStockIn(stockInData)
+ proxy.$modal.msgSuccess('淇敼鍏ュ簱鎴愬姛')
+ closeDia()
+ emit('success')
}
const submitForm = async () => {
- if (selectedRows.value.length === 0) {
- proxy.$modal.msgWarning('璇峰厛閫夋嫨閲囪喘鍚堝悓骞堕�夋嫨浜у搧')
- return
- }
- if(operationType.value !== 'add'){
- await updatePro()
- return
- }
- try {
- await proxy.$refs.formRef.validate()
- const invalidProducts = selectedRows.value.filter((product) => {
- const stock = Number(product?.quantityStock ?? 0);
- if (!Number.isFinite(stock) || stock <= 0) {
- return true;
- }
- return exceedsAddLimit(product);
- })
- if (invalidProducts.length > 0) {
- proxy.$modal.msgWarning('鏈鍏ュ簱鏁伴噺涓嶈兘澶т簬寰呭叆搴撴暟閲忥紝涓旈渶澶т簬0');
- return;
- }
-
- const stockInData = {
- ...form.value,
- inboundTime: formatDateTime(),
- nickName: userStore.nickName,
- details: selectedRows.value.map(product => ({
- id: product.id,
- inboundQuantity: Number(product.quantityStock),
- unitPrice: Number(product.taxInclusiveUnitPrice),
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning('璇峰厛閫夋嫨閲囪喘鍚堝悓骞堕�夋嫨浜у搧')
+ return
+ }
+ if(operationType.value !== 'add'){
+ await updatePro()
+ return
+ }
+ try {
+ await proxy.$refs.formRef.validate()
+ const invalidProducts = selectedRows.value.filter((product) => {
+ const stock = Number(product?.quantityStock ?? 0);
+ if (!Number.isFinite(stock) || stock <= 0) {
+ return true;
+ }
+ return exceedsAddLimit(product);
+ })
+
+ if (invalidProducts.length > 0) {
+ proxy.$modal.msgError('鏈鍏ュ簱鏁伴噺闇�澶т簬0锛屼笖涓嶈兘瓒呰繃寰呭叆搴撴暟閲�')
+ return
+ }
+
+ const stockInData = {
+ ...form.value,
+ inboundTime: formatDateTime(form.value.inboundTime),
+ nickName: userStore.nickName,
+ details: selectedRows.value.map(product => ({
+ id: product.id,
+ inboundQuantity: Number(product.quantityStock),
+ taxInclusiveUnitPrice: Number(product.taxInclusiveUnitPrice),
taxInclusiveTotalPrice: Number(product.taxInclusiveTotalPrice)
- })),
- };
- loading.value = true
- await addSutockIn(stockInData)
-
- proxy.$modal.msgSuccess('鏂板鍏ュ簱鎴愬姛')
- closeDia()
- emit('success')
-
- } catch (error) {
- console.error('鎻愪氦澶辫触:', error)
- if (!error.errors) {
- proxy.$modal.msgError('鎿嶄綔澶辫触锛岃閲嶈瘯')
- }
- } finally {
- loading.value = false
- }
+ })),
+ };
+ loading.value = true
+ await addSutockIn(stockInData)
+
+ proxy.$modal.msgSuccess('鏂板鍏ュ簱鎴愬姛')
+ closeDia()
+ emit('success')
+
+ } catch (error) {
+ console.error('鎻愪氦澶辫触:', error)
+ if (!error.errors) {
+ proxy.$modal.msgError('鎿嶄綔澶辫触锛岃閲嶈瘯')
+ }
+ } finally {
+ loading.value = false
+ }
}
const closeDia = () => {
- proxy.$refs.formRef.resetFields()
- dialogFormVisible.value = false
- emit('close')
+ proxy.$refs.formRef.resetFields()
+ dialogFormVisible.value = false
+ emit('close')
}
const handleSelectionChange = (selection) => {
- selectedRows.value = selection.filter(item => item.id);
+ selectedRows.value = selection.filter(item => item.id);
}
function formatDateTime(date = new Date(), includeTime = true) {
- const d = new Date(date);
- const year = d.getFullYear();
- const month = String(d.getMonth() + 1).padStart(2, '0');
- const day = String(d.getDate()).padStart(2, '0');
-
- if (!includeTime) {
- return `${year}-${month}-${day}`;
- }
-
- const hours = String(d.getHours()).padStart(2, '0');
- const minutes = String(d.getMinutes()).padStart(2, '0');
- const seconds = String(d.getSeconds()).padStart(2, '0');
-
- return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+ const d = new Date(date);
+ const year = d.getFullYear();
+ const month = String(d.getMonth() + 1).padStart(2, '0');
+ const day = String(d.getDate()).padStart(2, '0');
+
+ if (!includeTime) {
+ return `${year}-${month}-${day}`;
+ }
+
+ const hours = String(d.getHours()).padStart(2, '0');
+ const minutes = String(d.getMinutes()).padStart(2, '0');
+ const seconds = String(d.getSeconds()).padStart(2, '0');
+
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
function getCurrentDate() {
- return formatDateTime(new Date(), false);
+ return formatDateTime(new Date(), false);
}
const openDialog = async (type, row) => {
- operationType.value = type
- dialogFormVisible.value = true
- selectedRows.value = []
- await loadPurchaseOptions();
-
- if (type === 'add') {
- form.value = {
- id: null,
- purchaseContractNumber: '',
- supplierId: null,
- supplierName: '',
- inboundTime: '',
- inboundBatch: '',
- recorderId: userStore.userId,
- recorderName: userStore.name,
- entryDate: getCurrentDate(),
- remark: ''
- }
- productList.value = []
- } else {
- form.value = JSON.parse(JSON.stringify(row))
- try {
- loadingProducts.value = true
- const res = await selectProductRecordListByPuechaserId({
- purchaseContractNumber: form.value.purchaseContractNumber,
- id: row.id
- });
- productList.value = res.data.map(item => ({
- ...item,
- quantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? row.inboundNum ?? 0),
- taxInclusiveUnitPrice: Number(item?.taxInclusiveUnitPrice ?? 0),
- taxInclusiveTotalPrice: Number(item?.quantityStock ?? 0) * Number(item?.taxInclusiveUnitPrice ?? 0),
- originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? row.inboundNum ?? 0),
- }))
- selectedRows.value = productList.value
- } catch (error) {
- console.error('鍔犺浇浜у搧澶辫触:', error)
- proxy.$modal.msgError('鍔犺浇浜у搧澶辫触')
- productList.value = []
- } finally {
- loadingProducts.value = false
- }
- }
+ operationType.value = type
+ dialogFormVisible.value = true
+ selectedRows.value = []
+ await loadPurchaseOptions();
+
+ if (type === 'add') {
+ form.value = {
+ id: null,
+ purchaseContractNumber: '',
+ supplierId: null,
+ supplierName: '',
+ inboundTime: '',
+ inboundBatch: '',
+ recorderId: userStore.userId,
+ recorderName: userStore.name,
+ entryDate: getCurrentDate(),
+ remark: ''
+ }
+ productList.value = []
+ } else {
+ form.value = JSON.parse(JSON.stringify(row))
+ try {
+ loadingProducts.value = true
+ const res = await selectProductRecordListByPuechaserId({
+ purchaseContractNumber: form.value.purchaseContractNumber,
+ id: row.id
+ });
+ productList.value = res.data.map(item => ({
+ ...item,
+ quantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? row.inboundNum ?? 0),
+ taxInclusiveUnitPrice: Number(item?.taxInclusiveUnitPrice ?? 0),
+ taxInclusiveTotalPrice: Number(item?.quantityStock ?? 0) * Number(item?.taxInclusiveUnitPrice ?? 0),
+ originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? row.inboundNum ?? 0),
+ }))
+ selectedRows.value = productList.value
+ } catch (error) {
+ console.error('鍔犺浇浜у搧澶辫触:', error)
+ proxy.$modal.msgError('鍔犺浇浜у搧澶辫触')
+ productList.value = []
+ } finally {
+ loadingProducts.value = false
+ }
+ }
}
defineExpose({
- openDialog,
+ openDialog,
})
</script>
diff --git a/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue b/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
index 016fef6..abaaeb8 100644
--- a/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
+++ b/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
@@ -16,54 +16,43 @@
type="index"
width="60"
/>
- <el-table-column label="浜у搧鍥剧墖" align="center" prop="productCategory" width="100">
+ <el-table-column label="浜у搧澶х被" prop="productCategory" width="200">
<template #default="scope">
- <el-upload
- :action="uploadUrl"
- :before-upload="handleBeforeUpload"
- :on-success="(res,file)=>{handleUploadSuccess(res,file,scope.row)}"
- :on-error="handleUploadError"
- name="file"
- :show-file-list="false"
- :headers="headers"
- accept="image/*"
- :data="{ type: 9 }"
- >
- <img class="upload-img" v-if="scope.row.url" :src="javaApiUrl+scope.row.url"></img>
- <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
- </el-upload>
+ <el-input v-model="scope.row.productCategory" placeholder="璇疯緭鍏ヤ骇鍝佸ぇ绫�" />
</template>
</el-table-column>
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" width="200">
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200">
<template #default="scope">
- <el-input v-model="scope.row.productCategory" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" />
+ <el-input v-model="scope.row.specificationModel" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" />
</template>
</el-table-column>
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="200">
+ <el-table-column label="鍗曚綅" prop="unit" width="100">
<template #default="scope">
- <el-input v-model="scope.row.specificationModel" placeholder="璇疯緭鍏ヤ骇鍝侀珮搴�" />
+ <el-input v-model="scope.row.unit" placeholder="璇疯緭鍏ュ崟浣�" />
</template>
</el-table-column>
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="200">
+ <el-table-column label="渚涘簲鍟�" prop="supplierName" width="200">
<template #default="scope">
- <el-input v-model="scope.row.cartonSpecifications" placeholder="璇疯緭鍏ョ焊绠辫鏍�" />
+ <el-input v-model="scope.row.supplierName" placeholder="璇疯緭鍏ヤ緵搴斿晢" />
</template>
</el-table-column>
- <el-table-column label="鍏ュ簱鏁伴噺-浠�" prop="inboundNum" width="150">
+ <el-table-column label="鐗╁搧绫诲瀷" prop="itemType" width="150">
<template #default="scope">
- <el-input-number :step="1" :min="0" style="width: 100%" v-model="scope.row.inboundNum" @change="() => calculateTotalPrice(scope.row)" />
+ <el-select v-model="scope.row.itemType" filterable allow-create placeholder="璇烽�夋嫨鐗╁搧绫诲瀷" style="width: 100%">
+ <el-option
+ v-for="item in itemTypeOptions"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
</template>
</el-table-column>
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="150">
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="150">
<template #default="scope">
- <el-input-number :step="1" :min="0" style="width: 100%" v-model="scope.row.boxNum" @change="() => calculateTotalPrice(scope.row)" />
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.inboundNum" @change="() => calculateTotalPrice(scope.row)" />
</template>
</el-table-column>
- <el-table-column label="鍗曚环(缇庡厓)/浠�" prop="taxInclusiveUnitPrice" width="150">
- <template #default="scope">
- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" />
- </template>
- </el-table-column>
<el-table-column label="鍏ュ簱鏃ユ湡" prop="inboundDate" width="180">
<template #default="scope">
<el-date-picker
@@ -76,18 +65,22 @@
/>
</template>
</el-table-column>
-<!-- <el-table-column label="鏁伴噺" prop="quantityStock" width="150">-->
-<!-- <template #default="scope">-->
-<!-- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" @change="() => calculateTotalPrice(scope.row)" />-->
-<!-- </template>-->
-<!-- </el-table-column>-->
-
-<!-- <el-table-column -->
-<!-- label="鎬讳环(鍏�)" -->
-<!-- prop="taxInclusiveTotalPrice" -->
-<!-- width="150" -->
-<!-- >-->
-<!-- </el-table-column>-->
+ <el-table-column label="鏁伴噺" prop="quantityStock" width="150">
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" @change="() => calculateTotalPrice(scope.row)" />
+ </template>
+ </el-table-column>
+ <el-table-column label="鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150">
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" />
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鎬讳环(鍏�)"
+ prop="taxInclusiveTotalPrice"
+ width="150"
+ >
+ </el-table-column>
<el-table-column label="鎿嶄綔" width="80" v-if="operationType === 'add'">
<template #default="scope">
<el-button type="danger" size="small" @click="removeProductRow(scope.$index)">鍒犻櫎</el-button>
@@ -111,18 +104,10 @@
addStockInCustom,
updateStockInCustom,
} from "@/api/inventoryManagement/stockIn.js";
-import { getToken } from "@/utils/auth";
-const headers = ref({
- Authorization: "Bearer " + getToken(),
-});
-
-const javaApiUrl = __BASE_API__;
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close', 'success'])
-
-const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload"); // 涓婁紶鐨勫浘鐗囨湇鍔″櫒鍦板潃
const operationType = ref('')// 鎿嶄綔绫诲瀷: 'add' 鎴� 'edit'
const dialogFormVisible = ref(false)// 寮规鏄剧ず鐘舵��
@@ -186,7 +171,7 @@
id: null,
productCategory: '',
specificationModel: '',
- cartonSpecifications:'',
+ unit: '',
supplierName: form.value.supplierName || '',
itemType: '',
inboundNum: 0,
@@ -196,7 +181,6 @@
taxInclusiveTotalPrice: 0,
taxRate: null,
taxExclusiveTotalPrice: 0,
- boxNum: 0,
});
};
@@ -233,42 +217,23 @@
// 楠岃瘉鑷畾涔夋坊鍔犵殑鏁版嵁蹇呭~瀛楁
for (let i = 0; i < productList.value.length; i++) {
const product = productList.value[i];
- if (!product.productCategory || !product.specificationModel) {
- proxy.$modal.msgError(`绗�${i + 1}琛屼骇鍝佹暟鎹湭濉啓瀹屾暣锛堜骇鍝併�佷骇鍝侀珮搴︺�侀珮搴﹀崟浣嶄负蹇呭~锛塦)
+ if (!product.productCategory || !product.specificationModel || !product.unit) {
+ proxy.$modal.msgError(`绗�${i + 1}琛屼骇鍝佹暟鎹湭濉啓瀹屾暣锛堜骇鍝佸ぇ绫汇�佽鏍煎瀷鍙枫�佸崟浣嶄负蹇呭~锛塦)
return
}
- if (!product.url) {
- proxy.$modal.msgError(`绗�${i + 1}琛屼骇鍝佹湭涓婁紶浜у搧鍥剧墖`)
- return
- }
- if (!product.cartonSpecifications) {
- proxy.$modal.msgError(`绗�${i + 1}琛屼骇鍝佹湭濉啓绾哥瑙勬牸`)
- return
- }
- // if (!product.itemType) {
- // proxy.$modal.msgError(`绗�${i + 1}琛岃閫夋嫨鐗╁搧绫诲瀷`)
- // return
- // }
- const stock = Number(product?.inboundNum ?? 0);
- if (!Number.isFinite(stock) || stock <= 0) {
- proxy.$modal.msgError(`绗�${i + 1}琛屾湰娆″叆搴撴暟閲忛渶澶т簬0`)
- return
- }
- const boxNum = Number(product?.boxNum ?? 0);
- if (!Number.isFinite(boxNum) || boxNum <= 0) {
- proxy.$modal.msgError(`绗�${i + 1}琛屾瘡浠舵暟閲�/鏀渶澶т簬0`)
- return
- }
- const taxInclusiveUnitPrice = Number(product?.taxInclusiveUnitPrice ?? 0);
- if (!Number.isFinite(taxInclusiveUnitPrice) || taxInclusiveUnitPrice <= 0) {
- proxy.$modal.msgError(`绗�${i + 1}琛屽崟浠凤紙鍏冿級闇�澶т簬0`)
+ if (!product.itemType) {
+ proxy.$modal.msgError(`绗�${i + 1}琛岃閫夋嫨鐗╁搧绫诲瀷`)
return
}
if (!product.inboundDate) {
proxy.$modal.msgError(`绗�${i + 1}琛岃閫夋嫨鍏ュ簱鏃ユ湡`)
return
}
-
+ const stock = Number(product?.inboundNum ?? 0);
+ if (!Number.isFinite(stock) || stock <= 0) {
+ proxy.$modal.msgError(`绗�${i + 1}琛屾湰娆″叆搴撴暟閲忛渶澶т簬0`)
+ return
+ }
}
const payloadList = productList.value.map(product => ({
@@ -276,6 +241,7 @@
inboundNum: Number(product.inboundNum),
productCategory: product.productCategory,
specificationModel: product.specificationModel,
+ unit: product.unit,
supplierName: product.supplierName || form.value.supplierName,
itemType: product.itemType,
inboundDate: formatDateTime(product.inboundDate, false),
@@ -283,9 +249,6 @@
taxExclusiveTotalPrice: Number(product.taxExclusiveTotalPrice || 0),
taxInclusiveUnitPrice: Number(product.taxInclusiveUnitPrice || 0),
taxInclusiveTotalPrice: Number(product.taxInclusiveTotalPrice || 0),
- boxNum:Number(product.boxNum),
- cartonSpecifications: product.cartonSpecifications,
- url: product.url||'',
}));
loading.value = true
if (operationType.value === 'edit') {
@@ -314,30 +277,6 @@
dialogFormVisible.value = false
productList.value = []
emit('close')
-}
-
-// 涓婁紶鍓嶆牎妫�鏍煎紡鍜屽ぇ灏�
-function handleBeforeUpload(file) {
- const type = ["image/jpeg", "image/jpg", "image/png", "image/svg"];
- const isJPG = type.includes(file.type);
- //妫�楠屾枃浠舵牸寮�
- if (!isJPG) {
- proxy.$modal.msgError(`鍥剧墖鏍煎紡閿欒!`);
- return false;
- }
- return true;
-}
-const handleUploadSuccess = (res, file,item) => {
- // 濡傛灉涓婁紶鎴愬姛
- if (res.code == 200) {
- item.url = res.data?.tempPath||''
- } else {
- proxy.$modal.msgError("鍥剧墖鎻掑叆澶辫触");
- }
-}
-// 涓婁紶澶辫触澶勭悊
-function handleUploadError() {
- proxy.$modal.msgError("鍥剧墖鎻掑叆澶辫触");
}
const openDialog = async (type, row) => {
@@ -370,6 +309,7 @@
id: row?.id ?? null,
productCategory: row?.productCategory ?? '',
specificationModel: row?.specificationModel ?? '',
+ unit: row?.unit ?? '',
supplierName: row?.supplierName ?? '',
itemType: row?.itemType ?? '',
inboundNum: Number(row?.inboundNum ?? row?.inboundQuantity ?? 0),
@@ -379,9 +319,6 @@
taxInclusiveUnitPrice: Number(row?.taxInclusiveUnitPrice ?? 0),
taxInclusiveTotalPrice: Number(row?.taxInclusiveTotalPrice ?? 0),
taxExclusiveTotalPrice: Number(row?.taxExclusiveTotalPrice ?? 0),
- boxNum: Number(row?.boxNum ?? 0),
- cartonSpecifications: row?.cartonSpecifications ?? '',
- url: row?.url ?? '',
}]
}
}
@@ -391,11 +328,5 @@
})
</script>
-<style scoped lang="scss">
- .upload-img{
- width: 80px;
- height: 80px;
- object-fit: contain;
- }
-</style>
+<style scoped lang="scss"></style>
diff --git a/src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue b/src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue
index 460d785..6048e18 100644
--- a/src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue
+++ b/src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue
@@ -289,7 +289,6 @@
taxRate: Number(row?.taxRate ?? 0),
unitPrice: Number(row?.unitPrice ?? 0),
taxExclusiveTotalPrice: Number(row?.taxExclusiveTotalPrice ?? 0),
- dollarPrice: Number(row?.dollarPrice ?? 0),
}]
}
}
diff --git a/src/views/inventoryManagement/receiptManagement/index.vue b/src/views/inventoryManagement/receiptManagement/index.vue
index 16af5cd..68b1b77 100644
--- a/src/views/inventoryManagement/receiptManagement/index.vue
+++ b/src/views/inventoryManagement/receiptManagement/index.vue
@@ -1,7 +1,59 @@
<template>
<div class="app-container">
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
- <el-tab-pane label="閲囪喘鍏ュ簱" name="purchase">
+ <el-tab-pane label="鎴愬搧鍏ュ簱" name="production">
+ <div class="search_form">
+ <div>
+ <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
+ <el-date-picker
+ v-model="searchForm.timeStr"
+ type="date"
+ placeholder="璇烽�夋嫨鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ @change="handleQuery"
+ />
+ <span class="search_title ml10">浜у搧澶х被锛�</span>
+ <el-input
+ v-model="searchForm.productCategory"
+ style="width: 240px"
+ placeholder="璇疯緭鍏�"
+ clearable
+ />
+ <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+ </div>
+ <div>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ </div>
+ </div>
+ <div class="table_list">
+ <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
+ :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
+ :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
+ <el-table-column align="center" type="selection" width="55" />
+ <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+ <el-table-column label="鍏ュ簱鏃堕棿" prop="createTime" show-overflow-tooltip />
+ <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" width="180" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="70" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="鍗曚环(鍏�)" prop="unitPrice" width="150"></el-table-column>
+ <el-table-column label="鎬讳环(鍏�)" prop="totalPrice" width="150"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="openForm('edit', scope.row, 'production');">缂栬緫</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current" :limit="page.size" @pagination="paginationChange" />
+ </div>
+ </el-tab-pane>
+
+ <el-tab-pane label="鍘熸枡鍏ュ簱" name="purchase">
<div class="search_form">
<div>
<span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
@@ -36,20 +88,18 @@
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column label="鍏ュ簱鏃堕棿" prop="createTime" width="100" show-overflow-tooltip />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100" show-overflow-tooltip>
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍗曚环(鍏�)/浠�" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
- <el-table-column label="鍏ュ簱浜�" prop="createBy" width="120" show-overflow-tooltip />
+ <el-table-column label="閲囪喘鍚堝悓鍙�" prop="purchaseContractNumber" width="180" show-overflow-tooltip />
+<el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="240" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="70" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
+ <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" width="150"></el-table-column>
+ <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
<el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
<template #default="scope">
<el-button link type="primary" size="small" @click="openForm('edit', scope.row, 'purchase');">缂栬緫</el-button>
- <!-- <el-button link type="success" size="small" @click="showQRCode(scope.row,1)">鐢熸垚鏉″舰鐮�</el-button>
- <el-button link type="success" size="small" @click="showERCode(scope.row,1)">鐢熸垚浜岀淮鐮�</el-button> -->
</template>
</el-table-column>
</el-table>
@@ -58,7 +108,7 @@
</div>
</el-tab-pane>
- <el-tab-pane label="鎴愬搧鍏ュ簱" name="manual">
+ <el-tab-pane label="鏉愭枡鍏ュ簱" name="manual">
<div class="search_form">
<div>
<span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
@@ -92,28 +142,20 @@
:summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧鍥剧墖" width="100" align="center">
- <template #default="scope">
- <img class="barcode-img" :src="javaApiUrl+scope.row.url"></img>
- </template>
- </el-table-column>
<el-table-column label="鍏ュ簱鏃堕棿" prop="inboundDate" width="100" show-overflow-tooltip />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100" show-overflow-tooltip>
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <el-table-column label="鍏ュ簱鏁伴噺/浠�" prop="inboundNum" width="100" show-overflow-tooltip />
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍗曚环(鍏�)/浠�" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="150"></el-table-column>
- <el-table-column label="鍏ュ簱浜�" prop="createBy" width="150" show-overflow-tooltip />
+ <el-table-column label="鎵规鍙�" prop="code" width="130" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="70" show-overflow-tooltip />
+ <el-table-column label="鐗╁搧绫诲瀷" prop="itemType" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" show-overflow-tooltip />
+ <el-table-column label="鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
+ <el-table-column label="鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" width="150"></el-table-column>
+ <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
<el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
<template #default="scope">
<el-button link type="primary" size="small" @click="openForm('edit', scope.row, 'manual');">缂栬緫</el-button>
- <el-button link type="success" size="small" @click="showQRCode(scope.row,2)">鐢熸垚鏉″舰鐮�</el-button>
- <el-button link type="success" size="small" @click="showERCode(scope.row,2)">鐢熸垚浜岀淮鐮�</el-button>
</template>
</el-table-column>
</el-table>
@@ -126,102 +168,6 @@
<form-dia ref="formDia" @close="handleQuery" @success="handleQuery"></form-dia>
<form-dia-manual ref="formDiaManual" @close="handleQuery" @success="handleQuery"></form-dia-manual>
<form-dia-product ref="formDiaProduct" @close="handleQuery" @success="handleQuery"></form-dia-product>
- <el-dialog
- v-model="qrCodeDialogVisible"
- title="鍟嗗搧鏉″舰鐮�"
- width="400px"
- center
- >
- <div style="text-align: center;">
- <img id="barcode" style="width:200px;height: 50px;"/>
- <!-- <img :src="qrCodeUrl" alt="浜岀淮鐮�" style="width:200px;height:200px;" /> -->
- <div style="margin: 20px;">
- <el-button type="primary" @click="downloadQRCode">涓嬭浇鏉″舰鐮�</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 浜岀淮鐮佹樉绀哄璇濇 -->
- <el-dialog
- v-model="erCodeDialogVisible"
- title="鍟嗗搧浜岀淮鐮�"
- width="400px"
- center
- >
- <div style="text-align: center;">
- <img :src="erCodeUrl" alt="浜岀淮鐮�" style="width:200px;height:200px;" />
- <div style="margin: 20px;">
- <el-button type="primary" @click="downloadERCode">涓嬭浇浜岀淮鐮佸浘鐗�</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog v-model="barcodeDia" title="浜у搧淇℃伅" width="40%" @close="closeBarcodeDia">
- <div>
- <el-row v-if="barcodeDetail.url" :gutter="30">
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">鍥剧墖</div>
- <img class="barcode-img" :src="javaApiUrl+barcodeDetail.url"></img>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">鍚嶇О</div>
- <div class="barcode-value">{{barcodeDetail.productCategory}}</div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">浜у搧楂樺害</div>
- <div class="barcode-value">{{barcodeDetail.specificationModel}}{{barcodeDetail.unit}}</div>
- </div>
- </el-col>
-
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">鍗曚环</div>
- <div class="barcode-value">{{barcodeDetail.taxInclusiveUnitPrice}}缇庡厓/浠�</div>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">鏁伴噺/浠�</div>
- <div class="barcode-value">{{barcodeDetail.inboundNum}}</div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">姣忎欢鏁伴噺/鏀�</div>
- <div class="barcode-value">{{barcodeDetail.boxNum}}</div>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">绾哥瑙勬牸</div>
- <div class="barcode-value">{{barcodeDetail.cartonSpecifications}}</div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">鍏ュ簱浜�</div>
- <div class="barcode-value">{{barcodeDetail.createBy}}</div>
- </div>
- </el-col>
- </el-row>
- </div>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="closeBarcodeDia">鍏抽棴</el-button>
- </div>
- </template>
- </el-dialog>
</div>
</template>
@@ -231,19 +177,15 @@
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
import dayjs from 'dayjs'
-const javaApiUrl = __BASE_API__;
import {
getStockInPage,
getStockInPageByProduction,
delStockIn,
delStockInCustom, getInPageByCustom,
- stockinDetail,detailManagementByCustom
} from "@/api/inventoryManagement/stockIn.js";
import FormDia from './components/formDia.vue'
import FormDiaManual from './components/formDiaManual.vue'
import FormDiaProduct from './components/formDiaProduct.vue'
-import QRCode from "qrcode";
-import JsBarcode from "jsbarcode";
// 鑾峰彇褰撳墠鏃ユ湡
function getCurrentDate() {
@@ -258,7 +200,7 @@
const formDia = ref()
const formDiaManual = ref()
const formDiaProduct = ref()
-const activeTab = ref('purchase') // 褰撳墠婵�娲荤殑 tab
+const activeTab = ref('production') // 褰撳墠婵�娲荤殑 tab
const page = reactive({
current: 1,
@@ -342,14 +284,13 @@
// 鍒囨崲 tab 鏃舵竻绌烘悳绱㈡潯浠�
searchForm.value.supplierName = ''
searchForm.value.customerName = ''
- searchForm.value.timeStr = getCurrentDate() // 閲嶇疆涓哄綋鍓嶆棩鏈�
+ searchForm.value.timeStr = ''
searchForm.value.productCategory = ''
getList()
}
// 鎵撳紑寮规
const openForm = async (type, row, tabType) => {
- if(barcodeDia.value)return
const currentTab = tabType || activeTab.value
await nextTick(() => {
if (currentTab === 'manual') {
@@ -421,7 +362,7 @@
} else {
// 鏉愭枡鍏ュ簱
deleteApi = delStockInCustom
- deleteParams = [...ids]
+ deleteParams = { ids }
}
deleteApi(deleteParams).then(() => {
@@ -435,173 +376,12 @@
})
}
-
-// 浜岀淮鐮佺浉鍏冲彉閲�
-const qrCodeDialogVisible = ref(false);
-const qrCodeUrl = ref("");
-const showQRCode = async (row,type) => {
- if(barcodeDia.value)return
- try {
- // 鏋勫缓浜岀淮鐮佸唴瀹癸紝鍙寘鍚噰璐悎鍚屽彿锛堢函鏂囨湰锛�
- let qrContent = row.id || '';
- // 妫�鏌ュ唴瀹规槸鍚︿负绌�
- if (!qrContent) {
- proxy.$modal.msgWarning("璇ヨ鍟嗗搧id锛屾棤娉曠敓鎴愭潯褰㈢爜");
- return;
- }
- qrContent+=`,${type}`
- qrCodeDialogVisible.value = true;
- await nextTick();
- JsBarcode("#barcode", qrContent+'', {
- width:10,
- height:100,
- displayValue: false
- });
- } catch (error) {
- console.error('鐢熸垚鏉″舰鐮佸け璐�:', error);
- proxy.$modal.msgError("鐢熸垚鏉″舰鐮佸け璐ワ細" + error.message);
- }
-};
-
-const erCodeDialogVisible = ref(false);
-const erCodeUrl = ref("");
-const showERCode = async (row,type) => {
- if(barcodeDia.value)return
- let qrContent = row.id || '';
- // 妫�鏌ュ唴瀹规槸鍚︿负绌�
- if (!qrContent) {
- proxy.$modal.msgWarning("璇ヨ鍟嗗搧id锛屾棤娉曠敓鎴愪簩缁寸爜");
- return;
- }
- qrContent+=`,${type}`
- try {
- erCodeUrl.value = await QRCode.toDataURL(qrContent+'', {
- width: 200,
- margin: 2,
- color: {
- dark: '#000000',
- light: '#FFFFFF'
- }
- });
- erCodeDialogVisible.value = true;
- } catch (error) {
- console.error('鐢熸垚浜岀淮鐮佸け璐�:', error);
- proxy.$modal.msgError("鐢熸垚浜岀淮鐮佸け璐ワ細" + error.message);
- }
-};
-const downloadQRCode = () => {
- const imgSrc = document.getElementById('barcode').src
- const a = document.createElement('a');
- if(!imgSrc){
- proxy.$modal.msgWarning('鏆傛棤鏉″舰鐮�')
- return
- }
- a.href = imgSrc;
- a.download = `鍟嗗搧鏉″舰鐮乢${new Date().getTime()}.png`;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- proxy.$modal.msgSuccess("涓嬭浇鎴愬姛");
-};
-
-// 涓嬭浇浜岀淮鐮�
-const downloadERCode = () => {
- if (!erCodeUrl.value) {
- proxy.$modal.msgWarning("浜岀淮鐮佹湭鐢熸垚");
- return;
- }
-
- const a = document.createElement('a');
- a.href = erCodeUrl.value;
- a.download = `鍟嗗搧浜岀淮鐮乢${new Date().getTime()}.png`;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- proxy.$modal.msgSuccess("涓嬭浇鎴愬姛");
-};
-
-//鎵爜鐩稿叧鍙傛暟
-const barcodeDia = ref(false);
-const scanBarcodeInput = ref('');
-const barcodeDetail = ref({})
-// 鎵爜鍑芥暟
-function scanBarcode (e){
- if(!e||!e.target||!e.target.tagName){
- return;
- }
- if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') {
- return
- }
- if (e.key === 'Enter') {
- let _value = scanBarcodeInput.value
- getDetail(_value)
- scanBarcodeInput.value = ""
- } else {
- scanBarcodeInput.value += e.key
- }
-}
-const getDetail = (barcode)=>{
- if(barcode.indexOf(",")==-1){
- proxy.$modal.msgWarning("璇锋壂鎻忔纭殑鏉″舰鐮�")
- return
- }
- let barcodeList = barcode.split(",")
- let barcodeId = barcodeList[0]
- let type = barcodeList[1]
- let detailApi = null
- if(type==1){
- detailApi = stockinDetail
- }else if(type==2){
- detailApi = detailManagementByCustom
- }
-
- if(!detailApi){
- proxy.$modal.msgWarning("璇锋壂鎻忔纭殑鏉″舰鐮�")
- return
- }
- detailApi({id:barcodeId}).then((resp) => {
- if(!resp.data){
- proxy.$modal.msgError("鍟嗗搧涓嶅瓨鍦�")
- return
- }
- if(resp.code!=200){
- proxy.$modal.msgError(res.msg)
- return
- }
- barcodeDetail.value = resp.data
- barcodeDia.value = true
- }).catch(() => {
- proxy.$modal.msgError("鏌ョ湅璇︽儏澶辫触")
- })
-
-}
-
-const closeBarcodeDia = () => {
- barcodeDia.value = false
-}
-
onMounted(() => {
- // 娣诲姞鎵爜鏋洃鍚簨浠�
- document.removeEventListener('keypress',scanBarcode)
- document.addEventListener('keypress', scanBarcode)
getList()
})
</script>
-<style scoped lang="scss">
-.barcode-item{
- display: flex;
- justify-content: space-between;
- padding: 5px 0;
-
-}
-.barcode-img{
- width: 80px;
- height: 80px;
- border-radius: 5px;
- background-color: #F5F5F5;
-}
-</style>
+<style scoped lang="scss"></style>
diff --git a/src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue b/src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue
index 5e948fb..d66b0e6 100644
--- a/src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue
+++ b/src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue
@@ -4,28 +4,27 @@
<el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="浜у搧鍚嶇О锛�" prop="productCategory">
+ <el-form-item label="浜у搧澶х被锛�" prop="productCategory">
<el-input disabled v-model="form.productCategory" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
</el-col>
-
- </el-row>
- <el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="浜у搧楂樺害锛�" prop="specificationModel">
+ <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="specificationModel">
<el-input disabled v-model="form.specificationModel" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
</el-col>
+ </el-row>
+ <el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="楂樺害鍗曚綅锛�" prop="unit">
+ <el-form-item label="鍗曚綅锛�" prop="unit">
<el-input disabled v-model="form.unit" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
</el-col>
- <!-- <el-col :span="12">
+ <el-col :span="12">
<el-form-item label="鐗╁搧绫诲瀷锛�" prop="itemType">
<el-input disabled v-model="form.itemType" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
- </el-col> -->
+ </el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
@@ -35,36 +34,35 @@
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鍏ュ簱鏁伴噺/浠讹細" prop="inboundNum">
- <el-input-number :step="1" v-model="form.inboundNum" :min="form.totalInboundNum" style="width: 100%"
- placeholder="璇疯緭鍏�" clearable/>
+ <el-form-item label="搴撳瓨鏁伴噺锛�" prop="inboundNum">
+ <el-input v-model="form.inboundNum" placeholder="璇疯緭鍏�" clearable @input="calculateTotalPrice" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="宸插嚭搴撴暟閲�/浠讹細" prop="totalInboundNum">
+ <el-form-item label="宸插嚭搴撴暟閲忥細" prop="totalInboundNum">
<el-input disabled v-model="form.totalInboundNum" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="寰呭嚭搴撴暟閲�/浠讹細" prop="inboundNum0">
+ <el-form-item label="寰呭嚭搴撴暟閲忥細" prop="inboundNum0">
<el-input disabled v-model="form.inboundNum0" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
</el-col>
</el-row>
-<!-- <el-row :gutter="30">-->
-<!-- <el-col :span="12">-->
-<!-- <el-form-item label="鍗曚环(鍏�)锛�" prop="taxInclusiveUnitPrice">-->
-<!-- <el-input v-model="form.taxInclusiveUnitPrice" placeholder="璇疯緭鍏�" clearable @input="calculateTotalPrice" />-->
-<!-- </el-form-item>-->
-<!-- </el-col>-->
-<!-- <el-col :span="12">-->
-<!-- <el-form-item label="鎬讳环(鍏�)锛�" prop="taxInclusiveTotalPrice">-->
-<!-- <el-input disabled v-model="form.taxInclusiveTotalPrice" placeholder="鑷姩璁$畻" clearable />-->
-<!-- </el-form-item>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="鍗曚环(鍏�)锛�" prop="taxInclusiveUnitPrice">
+ <el-input v-model="form.taxInclusiveUnitPrice" placeholder="璇疯緭鍏�" clearable @input="calculateTotalPrice" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎬讳环(鍏�)锛�" prop="taxInclusiveTotalPrice">
+ <el-input disabled v-model="form.taxInclusiveTotalPrice" placeholder="鑷姩璁$畻" clearable />
+ </el-form-item>
+ </el-col>
+ </el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
diff --git a/src/views/inventoryManagement/stockManagement/index.vue b/src/views/inventoryManagement/stockManagement/index.vue
index 95247bc..00c037c 100644
--- a/src/views/inventoryManagement/stockManagement/index.vue
+++ b/src/views/inventoryManagement/stockManagement/index.vue
@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
- <!-- <el-tab-pane label="閲囪喘搴撳瓨" name="production">
+ <el-tab-pane label="鎴愬搧搴撳瓨" name="production">
<div class="search_form">
<div>
<span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
@@ -14,7 +14,7 @@
clearable
@change="handleQuery"
/>
- <span class="search_title ml10">浜у搧鍚嶇О锛�</span>
+ <span class="search_title ml10">浜у搧澶х被锛�</span>
<el-input
v-model="searchForm.productCategory"
style="width: 240px"
@@ -25,6 +25,7 @@
</div>
<div>
<el-button @click="handleOut">瀵煎嚭</el-button>
+<!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
</div>
</div>
<div class="table_list">
@@ -35,10 +36,10 @@
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column label="鍏ュ簱鏃ユ湡" prop="createTime" width="100" show-overflow-tooltip />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" width="180" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
<el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
<el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
<el-table-column label="宸插嚭搴撴暟閲�" prop="totalInboundNum" width="100" show-overflow-tooltip />
<el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="100" show-overflow-tooltip />
<el-table-column label="鍗曚环(鍏�)" prop="unitPrice" width="150"></el-table-column>
@@ -47,155 +48,145 @@
<template #default="scope">
<el-button link type="primary" size="small" @click="openForm('edit', scope.row);">缂栬緫</el-button>
</template>
-</el-table-column>
-</el-table>
-<pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current"
- :limit="page.size" @pagination="paginationChange" />
-</div>
-</el-tab-pane> -->
-
- <el-tab-pane label="閲囪喘搴撳瓨" name="purchase">
- <div class="search_form">
- <div>
- <span class="search_title ml10">浜у搧鍚嶇О锛�</span>
- <el-input v-model="searchForm.productCategory" style="width: 240px" placeholder="璇疯緭鍏�" clearable />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
- </div>
- <div>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- </div>
- </div>
- <div class="table_list">
- <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
- :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
- :row-class-name="tableRowClassName" :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
- <el-table-column align="center" type="selection" width="55" />
- <el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100" show-overflow-tooltip>
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
</el-table-column>
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍗曚环(鍏�)/浠�" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
- <el-table-column label="宸插嚭搴撴暟閲�" prop="totalInboundNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="100" show-overflow-tooltip />
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="150"></el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
:page="page.current" :limit="page.size" @pagination="paginationChange" />
</div>
</el-tab-pane>
- <el-tab-pane label="鎴愬搧搴撳瓨" name="manual">
+ <el-tab-pane label="鍘熸枡搴撳瓨" name="purchase">
+ <div class="search_form">
+ <div>
+ <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
+ <el-date-picker
+ v-model="searchForm.timeStr"
+ type="date"
+ placeholder="璇烽�夋嫨鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ @change="handleQuery"
+ />
+ <span class="search_title ml10">浜у搧澶х被锛�</span>
+ <el-input
+ v-model="searchForm.productCategory"
+ style="width: 240px"
+ placeholder="璇疯緭鍏�"
+ clearable
+ />
+ <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+ </div>
+ <div>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+<!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
+ </div>
+ </div>
+ <div class="table_list">
+ <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
+ :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
+ :row-class-name="tableRowClassName"
+ :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
+ <el-table-column align="center" type="selection" width="55" />
+ <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+ <el-table-column label="鍏ュ簱鏃ユ湡" prop="createTime" width="100" show-overflow-tooltip />
+ <el-table-column label="閲囪喘鍚堝悓鍙�" prop="purchaseContractNumber" width="180" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
+ <el-table-column label="宸插嚭搴撴暟閲�" prop="totalInboundNum" show-overflow-tooltip />
+ <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" show-overflow-tooltip />
+ <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
+ <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" width="150"></el-table-column>
+ </el-table>
+ <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current" :limit="page.size" @pagination="paginationChange" />
+ </div>
+ </el-tab-pane>
+
+ <el-tab-pane label="鏉愭枡搴撳瓨" name="manual">
<div class="search_form">
<div>
- <!-- <span class="search_title">渚涘簲鍟嗗悕绉帮細</span>-->
- <!-- <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="璇疯緭鍏�" @change="handleQuery"-->
- <!-- clearable prefix-icon="Search" />-->
- <span class="search_title ml10">浜у搧鍚嶇О锛�</span>
- <el-input v-model="searchForm.productCategory" style="width: 240px" placeholder="璇疯緭鍏�" clearable />
+ <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
+ <el-date-picker
+ v-model="searchForm.timeStr"
+ type="date"
+ placeholder="璇烽�夋嫨鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ @change="handleQuery"
+ />
+ <span class="search_title ml10">浜у搧澶х被锛�</span>
+ <el-input
+ v-model="searchForm.productCategory"
+ style="width: 240px"
+ placeholder="璇疯緭鍏�"
+ clearable
+ />
<el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
</div>
<div>
<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">
<el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
:expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
- :row-class-name="tableRowClassName" :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
+ :row-class-name="tableRowClassName"
+ :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧鍥剧墖" width="100" align="center">
- <template #default="scope">
- <img class="barcode-img" :src="javaApiUrl + scope.row.url"></img>
- </template>
- </el-table-column>
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100" show-overflow-tooltip>
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <el-table-column label="鍗曚环(缇庡厓)/浠�" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="100" show-overflow-tooltip />
- <el-table-column label="宸插嚭搴撴暟閲�" prop="totalInboundNum" width="100" show-overflow-tooltip />
- <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="100" show-overflow-tooltip />
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="150"></el-table-column>
- <!-- <el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
+ <el-table-column label="鍏ュ簱鏃ユ湡" prop="inboundDate" width="100" show-overflow-tooltip />
+ <el-table-column label="鎵规鍙�" prop="code" width="130" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
+ <el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
+ <el-table-column label="鐗╁搧绫诲瀷" prop="itemType" width="120" show-overflow-tooltip />
+ <el-table-column label="宸插嚭搴撴暟閲�" prop="totalInboundNum" width="100" show-overflow-tooltip />
+ <el-table-column label="鍓╀綑搴撳瓨" prop="inboundNum0" width="100" show-overflow-tooltip />
+ <el-table-column label="鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
+ <el-table-column label="鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" width="150"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
<template #default="scope">
<el-button link type="primary" size="small" @click="openForm('edit', scope.row);">缂栬緫</el-button>
</template>
- </el-table-column> -->
+ </el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
:page="page.current" :limit="page.size" @pagination="paginationChange" />
</div>
</el-tab-pane>
</el-tabs>
-
+
<!-- 鎴愬搧搴撳瓨寮规 -->
- <FormDiaProduction v-model:dialogFormVisible="productionDialogVisible" :operationType="operationType"
- :formData="form" @submit="submitForm" @close="closeDia" />
-
+ <FormDiaProduction
+ v-model:dialogFormVisible="productionDialogVisible"
+ :operationType="operationType"
+ :formData="form"
+ @submit="submitForm"
+ @close="closeDia"
+ />
+
<!-- 鍘熸枡搴撳瓨寮规 -->
- <FormDiaPurchase v-model:dialogFormVisible="purchaseDialogVisible" :operationType="operationType" :formData="form"
- @submit="submitForm" @close="closeDia" />
-
+ <FormDiaPurchase
+ v-model:dialogFormVisible="purchaseDialogVisible"
+ :operationType="operationType"
+ :formData="form"
+ @submit="submitForm"
+ @close="closeDia"
+ />
+
<!-- 鏉愭枡搴撳瓨寮规 -->
- <FormDiaManual v-model:dialogFormVisible="manualDialogVisible" :operationType="operationType" :formData="form"
- @submit="submitForm" @close="closeDia" />
+ <FormDiaManual
+ v-model:dialogFormVisible="manualDialogVisible"
+ :operationType="operationType"
+ :formData="form"
+ @submit="submitForm"
+ @close="closeDia"
+ />
</div>
- <el-dialog v-model="barcodeDia" title="浜у搧淇℃伅" width="70%" @close="closeBarcodeDia">
- <div>
- <el-row :gutter="30">
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">鍚嶇О</div>
- <div class="barcode-value">{{ barcodeDetail.barcode }}</div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">鍗曚环</div>
- <div class="barcode-value">xxx鍏�</div>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">浜у搧楂樺害</div>
- <div class="barcode-value">222cm</div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">鏁伴噺/浠�</div>
- <div class="barcode-value">120</div>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <div class="barcode-item">
- <div class="barcode-label">瑙勬牸</div>
- <div class="barcode-value">12*20*30</div>
- </div>
- </el-col>
- </el-row>
- </div>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="closeBarcodeDia">鍏抽棴</el-button>
- </div>
- </template>
- </el-dialog>
</template>
<script setup>
@@ -204,7 +195,7 @@
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
import { userListNoPageByTenantId } from "@/api/system/user.js";
-import { productTreeList, modelList } from "@/api/basicData/product.js"
+import { productTreeList,modelList } from "@/api/basicData/product.js"
import {
getStockManagePage,
getStockManagePageByProduction,
@@ -212,9 +203,8 @@
delStockManage,
} from "@/api/inventoryManagement/stockManage.js";
import {
- updateManagement, updateManagementByCustom, updateStockIn
+ updateManagement, updateManagementByCustom, updateStockIn
} from "@/api/inventoryManagement/stockIn.js";
-const javaApiUrl = __BASE_API__;
// 瀵煎叆涓変釜鐙珛鐨勫脊妗嗙粍浠�
import FormDiaProduction from './components/FormDiaProduction.vue'
@@ -240,7 +230,7 @@
const loading = ref(false);
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref('')
-const activeTab = ref('purchase')
+const activeTab = ref('production')
// 涓変釜鐙珛鐨勫脊妗嗘樉绀虹姸鎬�
const productionDialogVisible = ref(false)
@@ -250,8 +240,9 @@
const data = reactive({
searchForm: {
// supplierName: '',
- productCategory: '',
+ productCategory:'',
customerName: '',
+ timeStr: getCurrentDate(),
},
form: {
supplierId: null,
@@ -273,7 +264,7 @@
inboundBatch: '',
stockQuantity: '',
boundTime: '',
- warnNum: '', // 鏂板鏈�浣庡簱瀛樺瓧娈�
+ warnNum: '', // 鏂板鏈�浣庡簱瀛樺瓧娈�
salesLedgerProductId: null,
},
rules: {
@@ -290,7 +281,7 @@
boundTime: [{ required: true, message: '璇烽�夋嫨搴撳瓨鏃堕棿', trigger: 'change' }],
inboundTime: [{ required: true, message: '璇烽�夋嫨鍏ュ簱鏃堕棿', trigger: 'change' }],
inboundPerson: [{ required: true, message: '璇烽�夋嫨鍑哄簱浜�', trigger: 'change' }],
- warnNum: [{ required: true, message: '璇疯緭鍏ユ渶浣庡簱瀛�', trigger: 'blur' }],
+ warnNum: [{ required: true, message: '璇疯緭鍏ユ渶浣庡簱瀛�', trigger: 'blur' }],
}
})
const { searchForm, form, rules } = toRefs(data)
@@ -309,6 +300,7 @@
const buildQueryParams = () => {
const params = {
...page,
+ timeStr: searchForm.value.timeStr,
}
params.productCategory = searchForm.value.productCategory
if (activeTab.value === 'production') {
@@ -333,14 +325,14 @@
apiCall.then(res => {
tableLoading.value = false
tableData.value = res.data.records
-
+
// 涓鸿〃鏍兼暟鎹嚜鍔ㄨ绠楁�讳环
tableData.value = tableData.value.map(item => {
// 璁$畻鍓╀綑搴撳瓨
const stockQuantity = parseFloat(item.inboundNum) || 0
const outboundQuantity = parseFloat(item.totalInboundNum) || 0
const remainingStock = Math.max(stockQuantity - outboundQuantity, 0)
-
+
// 鏍规嵁鏍囩椤电被鍨嬭绠楁�讳环
if (activeTab.value === 'production') {
// 鎴愬搧搴撳瓨锛氭�讳环 = 鍗曚环 脳 鍓╀綑搴撳瓨
@@ -355,10 +347,10 @@
const taxInclusiveUnitPrice = parseFloat(item.taxInclusiveUnitPrice) || 0
item.taxInclusiveTotalPrice = (taxInclusiveUnitPrice * remainingStock).toFixed(2)
}
-
+
return item
})
-
+
total.value = res.data.total
// 鏁版嵁鍔犺浇瀹屾垚鍚庢鏌ュ簱瀛�
// checkStockAndCreatePurchase();
@@ -372,6 +364,7 @@
page.current = 1
// searchForm.value.supplierName = ''
searchForm.value.customerName = ''
+ searchForm.value.timeStr = ''
selectedRows.value = []
searchForm.value.productCategory = ''
getList()
@@ -410,9 +403,9 @@
userList.value = userLists.data
if (type === 'edit') {
form.value = { ...row }
- productTreeList().then(res => {
+ productTreeList().then(res =>{
productList.value = res
- productList.value.forEach(i => {
+ productList.value.forEach(i =>{
if (i.label === row.productCategory) {
modelList({ id: i.id }).then((res) => {
productModelList.value = res;
@@ -422,7 +415,7 @@
})
}
form.value.entryDate = getCurrentDate() // 璁剧疆榛樿褰曞叆鏃ユ湡涓哄綋鍓嶆棩鏈�
-
+
// 鏍规嵁褰撳墠鏍囩椤垫樉绀哄搴旂殑寮规
if (activeTab.value === 'production') {
productionDialogVisible.value = true
@@ -436,10 +429,10 @@
// 鎻愪氦琛ㄥ崟
const submitForm = (submittedData) => {
console.log('瀛愮粍浠舵彁浜ょ殑鏁版嵁:', submittedData)
-
+
// 浣跨敤瀛愮粍浠舵彁浜ょ殑鏁版嵁锛岃�屼笉鏄埗缁勪欢鐨刦orm瀵硅薄
const submitData = { ...submittedData }
-
+
// 鏍规嵁褰撳墠鏍囩椤电Щ闄ゅ搴旂殑鎬讳环瀛楁
if (activeTab.value === 'production') {
// 鎴愬搧搴撳瓨锛氱Щ闄ゆ�讳环瀛楁
@@ -451,12 +444,12 @@
// 鏉愭枡搴撳瓨锛氱Щ闄ゅ惈绋庢�讳环瀛楁
delete submitData.taxInclusiveTotalPrice
}
-
+
// 绉婚櫎鍏朵粬鍙兘鐨勬�讳环瀛楁
delete submitData.taxExclusiveTotalPrice
-
+
console.log('鎻愪氦缁欏悗绔殑鏁版嵁锛堝凡绉婚櫎鎬讳环瀛楁锛�:', submitData)
- submitData.inboundNum = parseFloat(submitData.inboundNum) || 0
+
// 鏍规嵁褰撳墠鏍囩椤佃皟鐢ㄤ笉鍚岀殑鎻愪氦鎺ュ彛
let apiCall
if (activeTab.value === 'production') {
@@ -469,7 +462,7 @@
// 鍘熸枡搴撳瓨浣跨敤 updateManagementByCustom 鎺ュ彛
apiCall = updateManagementByCustom(submitData)
}
-
+
apiCall.then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
closeDia()
@@ -551,7 +544,7 @@
type: 'warning',
}
).then(() => {
- delStockManage({ ids: ids }).then(res => {
+ delStockManage({ids:ids}).then(res => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
getList()
})
@@ -567,54 +560,16 @@
const day = String(today.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
-
-//鎵爜鐩稿叧鍙傛暟
-const barcodeDia = ref(false);
-const scanBarcodeInput = ref('');
-const barcodeDetail = ref({})
-// 鎵爜鍑芥暟
-const scanBarcode = (e) => {
- if (!e || !e.target || !e.target.tagName) {
- return;
- }
- if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') {
- return
- }
- if (e.key === 'Enter') {
- let _value = scanBarcodeInput.value
- getDetail(_value)
- scanBarcodeInput.value = ""
- } else {
- scanBarcodeInput.value += e.key
- }
-}
-const getDetail = (barcode) => {
- barcodeDetail.value = {
- barcode: barcode
- }
- barcodeDia.value = true
-}
-
-const closeBarcodeDia = () => {
- barcodeDia.value = false
-}
onMounted(() => {
- // 娣诲姞鎵爜鏋洃鍚簨浠�
- // document.addEventListener('keypress', scanBarcode)
getList()
// checkStockAndCreatePurchase();
- // 姣忓皬鏃舵鏌ヤ竴娆″簱瀛�
- // const intervalId = setInterval(checkStockAndCreatePurchase, 60 * 60 * 1000);
+ // 姣忓皬鏃舵鏌ヤ竴娆″簱瀛�
+ // const intervalId = setInterval(checkStockAndCreatePurchase, 60 * 60 * 1000);
- // onUnmounted(() => {
- // // 缁勪欢鍗歌浇鏃舵竻闄ゅ畾鏃跺櫒
- // clearInterval(intervalId);
- // });
-})
-onUnmounted(() => {
- // 绉婚櫎閿洏鐩戝惉浜嬩欢
- document.removeEventListener('keypress', scanBarcode)
- console.log('缁勪欢鍗歌浇')
+// onUnmounted(() => {
+// // 缁勪欢鍗歌浇鏃舵竻闄ゅ畾鏃跺櫒
+// clearInterval(intervalId);
+// });
})
</script>
@@ -626,18 +581,5 @@
:deep(.row-low-stock:hover > td) {
background-color: #fcd4d4;
-}
-
-.barcode-item {
- display: flex;
- justify-content: space-between;
- padding: 5px 0;
-}
-
-.barcode-img {
- width: 80px;
- height: 80px;
- border-radius: 5px;
- background-color: #F5F5F5;
}
</style>
\ No newline at end of file
diff --git a/src/views/personnelManagement/contractManagement/filesDia.vue b/src/views/personnelManagement/contractManagement/filesDia.vue
index 050c7b6..2b72581 100644
--- a/src/views/personnelManagement/contractManagement/filesDia.vue
+++ b/src/views/personnelManagement/contractManagement/filesDia.vue
@@ -28,19 +28,12 @@
:tableData="tableData"
:tableLoading="tableLoading"
:isSelection="true"
- :isShowPage="false"
@selection-change="handleSelectionChange"
height="500"
+ :page="page"
+ @pagination="pagination"
>
</PIMTable>
- <pagination
- style="margin: 10px 0"
- v-show="total > 0"
- @pagination="paginationSearch"
- :total="total"
- :page="page.current"
- :limit="page.size"
- />
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDia">鍙栨秷</el-button>
@@ -99,6 +92,7 @@
const page = reactive({
current: 1,
size: 100,
+ total: 0
});
const total = ref(0);
const tableData = ref([]);
@@ -117,7 +111,7 @@
currentId.value = row.id;
getList()
}
-const paginationSearch = (obj) => {
+const pagination = (obj) => {
page.current = obj.page;
page.size = obj.limit;
getList();
@@ -125,7 +119,7 @@
const getList = () => {
fileListPage({accountId: currentId.value,accountType:accountType.value, ...page}).then(res => {
tableData.value = res.data.records;
- total.value = res.data.total;
+ page.total = res.data.total;
})
}
// 琛ㄦ牸閫夋嫨鏁版嵁
diff --git a/src/views/personnelManagement/contractManagement/index.vue b/src/views/personnelManagement/contractManagement/index.vue
index 9fcd73a..f691bf3 100644
--- a/src/views/personnelManagement/contractManagement/index.vue
+++ b/src/views/personnelManagement/contractManagement/index.vue
@@ -70,11 +70,11 @@
</template>
<script setup>
-import { Search } from "@element-plus/icons-vue";
-import { onMounted, ref } from "vue";
+import { Search, UploadFilled } from "@element-plus/icons-vue";
+import { onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue";
import FormDia from "@/views/personnelManagement/contractManagement/components/formDia.vue";
import { ElMessageBox } from "element-plus";
-import { staffOnJobListPage } from "@/api/personnelManagement/employeeRecord.js";
+import { staffOnJobListPage, staffOnJobExportCopy } from "@/api/personnelManagement/employeeRecord.js";
import dayjs from "dayjs";
import { getToken } from "@/utils/auth.js";
import FilesDia from "./filesDia.vue";
@@ -183,7 +183,7 @@
label: "鎿嶄綔",
align: "center",
fixed: 'right',
- width: 120,
+ width: 180,
operation: [
{
name: "璇︽儏",
@@ -197,6 +197,13 @@
type: "text",
clickFun: (row) => {
openFilesFormDia(row);
+ },
+ },
+ {
+ name: "涓嬭浇鍚堝悓",
+ type: "text",
+ clickFun: (row) => {
+ handleDownloadContract(row);
},
},
],
@@ -278,6 +285,33 @@
proxy.$modal.msg("宸插彇娑�");
});
};
+// 涓嬭浇鍚堝悓
+const handleDownloadContract = (row) => {
+ const fileName = `${row.staffName || "鍚堝悓"}鍔冲姩鍚堝悓.docx`;
+ proxy.$modal?.loading?.("姝e湪鐢熸垚鍚堝悓锛岃绋嶅��...");
+ staffOnJobExportCopy({ ...row })
+ .then((res) => {
+ proxy.$modal?.closeLoading?.();
+ if (res?.code === 200 && res?.msg) {
+ const javaApi = proxy.javaApi || import.meta.env.VITE_JAVA_API || "";
+ const downloadPath = res.msg.startsWith("/") ? res.msg : `/${res.msg}`;
+ const downloadUrl = `${javaApi}${downloadPath}`;
+ const link = document.createElement("a");
+ link.href = downloadUrl;
+ link.download = fileName;
+ link.target = "_blank";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ } else {
+ proxy.$modal.msgError(res?.msg || "鍚堝悓鐢熸垚澶辫触");
+ }
+ })
+ .catch(() => {
+ proxy.$modal?.closeLoading?.();
+ proxy.$modal.msgError("鍚堝悓鐢熸垚澶辫触锛岃绋嶅悗閲嶈瘯");
+ });
+};
const upload = reactive({
// 鏄惁鏄剧ず寮瑰嚭灞傦紙鍚堝悓瀵煎叆锛�
open: false,
diff --git a/src/views/personnelManagement/dimission/components/formDia.vue b/src/views/personnelManagement/dimission/components/formDia.vue
index d77eb90..9c6e77d 100644
--- a/src/views/personnelManagement/dimission/components/formDia.vue
+++ b/src/views/personnelManagement/dimission/components/formDia.vue
@@ -13,7 +13,9 @@
<el-col :span="12">
<div class="info-item">
<span class="info-label">濮撳悕锛�</span>
- <el-select v-model="form.staffName" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect">
+ <el-select v-model="form.staffName" filterable
+ default-first-option
+ :reserve-keyword="false" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect">
<el-option
v-for="item in personList"
:key="item.id"
diff --git a/src/views/personnelManagement/employeeRecord/components/formDia.vue b/src/views/personnelManagement/employeeRecord/components/formDia.vue
index 3c9674c..6f66f9b 100644
--- a/src/views/personnelManagement/employeeRecord/components/formDia.vue
+++ b/src/views/personnelManagement/employeeRecord/components/formDia.vue
@@ -6,16 +6,56 @@
width="70%"
@close="closeDia"
>
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :tableLoading="tableLoading"
- height="600"
- ></PIMTable>
+ <el-descriptions class="detail-descriptions" :column="2" border size="small">
+ <el-descriptions-item label="鍛樺伐缂栧彿">{{ formData.staffNo || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="濮撳悕">{{ formData.staffName || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鎬у埆">{{ formData.sex || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="骞撮緞">{{ formData.age || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="韬唤璇佸彿">{{ formData.identityCard || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鎴风睄浣忓潃" :span="2">{{ formData.nativePlace || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鐜颁綇鍧�" :span="2">{{ formData.adress || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="宀椾綅">{{ formData.postJob || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="绗竴瀛﹀巻">{{ formData.firstStudy || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="涓撲笟">{{ formData.profession || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鑱旂郴鐢佃瘽">{{ formData.phone || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="绱ф�ヨ仈绯讳汉">{{ formData.emergencyContact || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="绱ф�ヨ仈绯讳汉鐢佃瘽">{{ formData.emergencyContactPhone || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鍚堝悓绛捐鏃ユ湡">{{ formData.signDate || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鍔冲姩鍚堝悓鏈熼檺閫夋嫨">
+ <span v-if="formData.dateSelect === 'A'">A銆佹湁鍥哄畾鏈熼檺</span>
+ <span v-else-if="formData.dateSelect === 'B'">B銆佹棤鍥哄畾鏈熼檺</span>
+ <span v-else-if="formData.dateSelect === 'C'">C銆佷互瀹屾垚涓�瀹氬伐浣滀换鍔′负鏈熼檺</span>
+ <span v-else>-</span>
+ </el-descriptions-item>
+ <el-descriptions-item label="鍚堝悓骞撮檺">{{ formattedContractTerm }}</el-descriptions-item>
+ <el-descriptions-item label="璇曠敤鏈熷紑濮嬫棩鏈�" v-if="formData.dateSelect === 'A' || formData.dateSelect === 'B'">
+ {{ formData.trialStartDate || '-' }}
+ </el-descriptions-item>
+ <el-descriptions-item label="璇曠敤鏈熺粨鏉熸棩鏈�" v-if="formData.dateSelect === 'A' || formData.dateSelect === 'B'">
+ {{ formData.trialEndDate || '-' }}
+ </el-descriptions-item>
+ <el-descriptions-item label="璇曠敤鏈熷伐璧�" v-if="formData.dateSelect === 'A' || formData.dateSelect === 'B'">
+ {{ formData.proSalary ? formData.proSalary.toFixed(2) : '-' }}
+ </el-descriptions-item>
+ <el-descriptions-item label="鍚堝悓寮�濮嬫棩鏈�">{{ calculatedContractStart }}</el-descriptions-item>
+ <el-descriptions-item label="鍚堝悓缁撴潫鏃ユ湡">{{ formData.contractEndTime || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="宸ヨ祫鎶ラ叕" :span="2">
+ <span v-if="formData.salarySelect === 'A'">
+ A銆佷箼鏂圭殑宸ヨ祫鎶ラ叕鎸夌収鐢叉柟渚濇硶鍒跺畾鐨勮绔犲埗搴︿腑鐨勫唴閮ㄥ伐璧勫垎閰嶅姙娉曠‘瀹氾紝鏍规嵁涔欐柟鐨勫伐浣滃矖浣嶇‘瀹氬叾姣忔湀宸ヨ祫銆�
+ </span>
+ <span v-else-if="formData.salarySelect === 'B'">
+ B銆佺敳鏂瑰涔欐柟瀹炶鍩烘湰宸ヨ祫鍜岀哗鏁堝伐璧勭浉缁撳悎鐨勫唴閮ㄥ伐璧勫垎閰嶅姙娉曪紝涔欐柟鐨勬敹鍏ュ寘鎷熀鏈伐璧勩�佽椁愩�佷氦閫氥�佺敓娲讳綇瀹跨瓑鍚勯」琛ュ姪锛屽鏈夊彉鍔ㄦ牴鎹唴閮ㄥ伐璧勫垎閰嶅姙娉曡皟鏁村叾宸ヨ祫锛涚哗鏁堝伐璧勬牴鎹箼鏂圭殑宸ヤ綔涓氱哗銆佸姵鍔ㄦ垚鏋滃拰瀹為檯璐$尞鎸夌収鍐呴儴鍒嗛厤鍔炴硶鑰冩牳纭畾銆�
+ </span>
+ <span v-else-if="formData.salarySelect === 'C'">
+ C銆佺敳鏂瑰疄琛岃浠跺伐璧勫埗锛屼互鐢叉柟鎺ュ埌璁㈠崟鍙婂叕鍙哥敓浜ц鍒掞紝鎸夌収瀹氶鍜岃浠跺崟浠凤紝鏍规嵁涔欐柟瀹屾垚鐨勪笟缁╋紝鎸夋椂瓒抽鏀粯涔欐柟鐨勫伐璧勬姤閰��
+ </span>
+ <span v-else>-</span>
+ </el-descriptions-item>
+ <el-descriptions-item label="绂忓埄寰呴亣" :span="2">{{ formData.remark || '-' }}</el-descriptions-item>
+ </el-descriptions>
<template #footer>
<div class="dialog-footer">
- <el-button @click="closeDia">鍙栨秷</el-button>
+ <el-button @click="closeDia">鍏抽棴</el-button>
</div>
</template>
</el-dialog>
@@ -23,38 +63,82 @@
</template>
<script setup>
-import {ref} from "vue";
-import {staffOnJobInfo} from "@/api/personnelManagement/employeeRecord.js";
-const { proxy } = getCurrentInstance()
+import {ref, reactive, computed} from "vue";
+import dayjs from "dayjs";
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const operationType = ref('')
-const tableColumn = ref([
- // {
- // label: "鍚堝悓骞撮檺",
- // prop: "contractTerm",
- // },
- {
- label: "鍚堝悓寮�濮嬫棩鏈�",
- prop: "contractStartTime",
- },
- {
- label: "鍚堝悓缁撴潫鏃ユ湡",
- prop: "contractEndTime",
- },
-]);
-const tableData = ref([]);
-const tableLoading = ref(false);
+const formData = reactive({
+ staffNo: "",
+ staffName: "",
+ sex: "",
+ identityCard: "",
+ nativePlace: "",
+ postJob: "",
+ adress: "",
+ firstStudy: "",
+ profession: "",
+ age: 0,
+ phone: "",
+ emergencyContact: "",
+ emergencyContactPhone: "",
+ dateSelect: "",
+ trialStartDate: "",
+ trialEndDate: "",
+ proSalary: null,
+ signDate: "",
+ salarySelect: "",
+ contractStartTime: "",
+ contractEndTime: "",
+ contractTerm: null,
+ remark: "",
+});
+
+const formattedContractTerm = computed(() => {
+ const value = formData.contractTerm;
+ if (value === null || value === undefined || value === "") {
+ return "-";
+ }
+ const numberValue = Number(value);
+ if (!isNaN(numberValue)) {
+ return `${numberValue}骞碻;
+ }
+ return value;
+});
+
+const calculatedContractStart = computed(() => {
+ const endDate = formData.contractEndTime;
+ const termValue = formData.contractTerm;
+ const numberValue = Number(termValue);
+ if (!endDate || isNaN(numberValue)) {
+ return formData.contractStartTime || "-";
+ }
+ const start = dayjs(endDate).subtract(numberValue, "year");
+ if (!start.isValid()) {
+ return formData.contractStartTime || "-";
+ }
+ return start.format("YYYY-MM-DD");
+});
// 鎵撳紑寮规
const openDialog = (type, row) => {
operationType.value = type;
dialogFormVisible.value = true;
- if (operationType.value === 'edit') {
- staffOnJobInfo({staffNo: row.staffNo}).then(res => {
- tableData.value = res.data
- })
+ // 閲嶇疆琛ㄥ崟鏁版嵁
+ Object.keys(formData).forEach(key => {
+ if (key === 'age') {
+ formData[key] = 0;
+ } else if (["proSalary", "contractTerm"].includes(key)) {
+ formData[key] = null;
+ } else {
+ formData[key] = "";
+ }
+ });
+
+ if (operationType.value === 'edit' && row) {
+ // 鐩存帴浣跨敤 row 鏁版嵁璧嬪��
+ Object.assign(formData, row);
}
}
@@ -69,5 +153,25 @@
</script>
<style scoped>
+.detail-descriptions {
+ margin-bottom: 16px;
+ border-radius: 6px;
+ overflow: hidden;
+}
+.detail-descriptions :deep(.el-descriptions__cell) {
+ padding: 12px 16px !important;
+}
+
+.detail-descriptions :deep(.el-descriptions__label) {
+ width: 140px;
+ color: #606266;
+ background-color: #f7f9fc;
+ font-weight: 500;
+}
+
+.detail-descriptions :deep(.el-descriptions__content) {
+ color: #303133;
+ line-height: 20px;
+}
</style>
\ No newline at end of file
diff --git a/src/views/personnelManagement/onboarding/components/formDia.vue b/src/views/personnelManagement/onboarding/components/formDia.vue
index a13d6ba..8a732b2 100644
--- a/src/views/personnelManagement/onboarding/components/formDia.vue
+++ b/src/views/personnelManagement/onboarding/components/formDia.vue
@@ -83,11 +83,11 @@
<el-input v-model="form.emergencyContactPhone" placeholder="璇疯緭鍏�" clearable/>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="鍚堝悓骞撮檺锛�" prop="contractTerm">
- <el-input-number v-model="form.contractTerm" :precision="0" :step="1" style="width: 100%" :disabled="true"/>
- </el-form-item>
- </el-col>
+<!-- <el-col :span="12">-->
+<!-- <el-form-item label="鍚堝悓骞撮檺锛�" prop="contractTermcontractTerm">-->
+<!-- <el-input-number v-model="form.contractTerm" :precision="0" :step="1" style="width: 100%" :disabled="true"/>-->
+<!-- </el-form-item>-->
+<!-- </el-col>-->
</el-row>
<el-row :gutter="30">
<el-col :span="12">
@@ -100,7 +100,6 @@
format="YYYY-MM-DD"
clearable
style="width: 100%"
- @change="calculateContractTerm"
/>
</el-form-item>
</el-col>
@@ -114,7 +113,6 @@
format="YYYY-MM-DD"
clearable
style="width: 100%"
- @change="calculateContractTerm"
/>
</el-form-item>
</el-col>
@@ -181,15 +179,14 @@
const openDialog = (type, row) => {
operationType.value = type;
dialogFormVisible.value = true;
+ form.value.id = ''
if (operationType.value === 'edit') {
getStaffJoinInfo(row.id).then(res => {
form.value = {...res.data}
// 缂栬緫鏃朵篃璁$畻涓�娆″悎鍚屽勾闄�
- calculateContractTerm();
+ // calculateContractTerm();
})
- } else {
- form.value.id = ''
- }
+ }
}
// 鎻愪氦浜у搧琛ㄥ崟
const submitForm = () => {
diff --git a/src/views/personnelManagement/onboarding/components/formDiaXJHT.vue b/src/views/personnelManagement/onboarding/components/formDiaXJHT.vue
index fa0c9e6..b97ec3f 100644
--- a/src/views/personnelManagement/onboarding/components/formDiaXJHT.vue
+++ b/src/views/personnelManagement/onboarding/components/formDiaXJHT.vue
@@ -59,6 +59,11 @@
</el-col>
</el-row>
<el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="韬唤璇佸彿锛�" prop="identityCard">
+ <el-input v-model="form.identityCard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙风爜" clearable maxlength="18" />
+ </el-form-item>
+ </el-col>
<el-col :span="12">
<el-form-item label="骞撮緞锛�" prop="age">
<el-input-number v-model="form.age" :precision="0" :step="1" style="width: 100%"/>
@@ -84,9 +89,9 @@
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鍚堝悓绛捐鏃ユ湡锛�" prop="trialStartDate">
+ <el-form-item label="鍚堝悓绛捐鏃ユ湡锛�" prop="signDate">
<el-date-picker
- v-model="form.trialStartDate"
+ v-model="form.signDate"
type="date"
placeholder="璇烽�夋嫨鏃ユ湡"
value-format="YYYY-MM-DD"
@@ -116,9 +121,9 @@
</el-row>
<el-row :gutter="30" v-if="showProbationDates">
<el-col :span="12">
- <el-form-item label="璇曠敤鏈熷紑濮嬫棩鏈燂細" prop="signDate">
+ <el-form-item label="璇曠敤鏈熷紑濮嬫棩鏈燂細" prop="trialStartDate">
<el-date-picker
- v-model="form.signDate"
+ v-model="form.trialStartDate"
type="date"
placeholder="璇烽�夋嫨鏃ユ湡"
value-format="YYYY-MM-DD"
@@ -142,13 +147,13 @@
</el-form-item>
</el-col>
</el-row>
-<!-- <el-row :gutter="30">-->
-<!-- <el-col :span="12">-->
-<!-- <el-form-item label="鍚堝悓骞撮檺锛�" prop="contractTerm">-->
-<!-- <el-input-number v-model="form.contractTerm" :precision="0" :step="1" style="width: 100%" :disabled="true"/>-->
-<!-- </el-form-item>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="鍚堝悓骞撮檺锛�" prop="contractTerm">
+ <el-input-number v-model="form.contractTerm" :precision="0" :step="1" style="width: 100%" :disabled="true"/>
+ </el-form-item>
+ </el-col>
+ </el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="鍚堝悓寮�濮嬫棩鏈燂細" prop="contractStartTime">
@@ -160,6 +165,7 @@
format="YYYY-MM-DD"
clearable
style="width: 100%"
+ @change="calculateContractTerm"
/>
</el-form-item>
</el-col>
@@ -173,6 +179,7 @@
format="YYYY-MM-DD"
clearable
style="width: 100%"
+ @change="calculateContractTerm"
/>
</el-form-item>
</el-col>
@@ -234,6 +241,7 @@
staffNo: "",
staffName: "",
sex: "",
+ identityCard: "",
nativePlace: "",
postJob: "",
adress: "",
@@ -244,20 +252,22 @@
emergencyContact: "",
emergencyContactPhone: "",
dateSelect: "",
- signDate: "",
+ trialStartDate: "",
trialEndDate: "",
proSalary: null,
- trialStartDate: "",
+ signDate: "",
salarySelect: "",
- // contractTerm: 0,
+ contractTerm: 0,
contractStartTime: "",
contractEndTime: "",
staffState: "",
+ remark: "鏃�",
},
rules: {
staffNo: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" },],
staffName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
sex: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ identityCard: [{ required: true, message: "璇疯緭鍏ヨ韩浠借瘉鍙风爜", trigger: "blur" }],
nativePlace: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
postJob: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
adress: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -268,13 +278,14 @@
emergencyContact: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
remark: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
dateSelect: [{ required: true, message: "璇烽�夋嫨鍔冲姩鍚堝悓鏈熼檺", trigger: "change" }],
- signDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ trialStartDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
trialEndDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- trialStartDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ signDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
salarySelect: [{ required: true, message: "璇烽�夋嫨宸ヨ祫鎶ラ叕鏂瑰紡", trigger: "change" }],
- // contractTerm: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ contractTerm: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
contractStartTime: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
contractEndTime: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ proSalary: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
},
});
const { form, rules } = toRefs(data);
@@ -298,11 +309,12 @@
const openDialog = (type, row) => {
operationType.value = type;
dialogFormVisible.value = true;
+ form.value.id = ''
if (operationType.value === 'edit') {
getStaffJoinInfo(row.id).then(res => {
form.value = {...res.data}
// 缂栬緫鏃朵篃璁$畻涓�娆″悎鍚屽勾闄�
- // calculateContractTerm();
+ calculateContractTerm();
})
}
}
@@ -326,32 +338,32 @@
})
}
// 璁$畻鍚堝悓骞撮檺
-// const calculateContractTerm = () => {
-// if (form.value.contractStartTime && form.value.contractEndTime) {
-// const startDate = new Date(form.value.contractStartTime);
-// const endDate = new Date(form.value.contractEndTime);
-//
-// if (endDate > startDate) {
-// // 璁$畻骞翠唤宸�
-// const yearDiff = endDate.getFullYear() - startDate.getFullYear();
-// const monthDiff = endDate.getMonth() - startDate.getMonth();
-// const dayDiff = endDate.getDate() - startDate.getDate();
-//
-// let years = yearDiff;
-//
-// // 濡傛灉缁撴潫鏃ユ湡鐨勬湀鏃ュ皬浜庡紑濮嬫棩鏈熺殑鏈堟棩锛屽垯鍑忓幓1骞�
-// if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
-// years = yearDiff - 1;
-// }
-//
-// form.value.contractTerm = Math.max(0, years);
-// } else {
-// form.value.contractTerm = 0;
-// }
-// } else {
-// form.value.contractTerm = 0;
-// }
-// };
+const calculateContractTerm = () => {
+ if (form.value.contractStartTime && form.value.contractEndTime) {
+ const startDate = new Date(form.value.contractStartTime);
+ const endDate = new Date(form.value.contractEndTime);
+
+ if (endDate > startDate) {
+ // 璁$畻骞翠唤宸�
+ const yearDiff = endDate.getFullYear() - startDate.getFullYear();
+ const monthDiff = endDate.getMonth() - startDate.getMonth();
+ const dayDiff = endDate.getDate() - startDate.getDate();
+
+ let years = yearDiff;
+
+ // 濡傛灉缁撴潫鏃ユ湡鐨勬湀鏃ュ皬浜庡紑濮嬫棩鏈熺殑鏈堟棩锛屽垯鍑忓幓1骞�
+ if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
+ years = yearDiff - 1;
+ }
+
+ form.value.contractTerm = Math.max(0, years);
+ } else {
+ form.value.contractTerm = 0;
+ }
+ } else {
+ form.value.contractTerm = 0;
+ }
+};
// 鍏抽棴寮规
const closeDia = () => {
diff --git a/src/views/personnelManagement/onboarding/index.vue b/src/views/personnelManagement/onboarding/index.vue
index 9151a6c..a0c168e 100644
--- a/src/views/personnelManagement/onboarding/index.vue
+++ b/src/views/personnelManagement/onboarding/index.vue
@@ -57,8 +57,8 @@
<script setup>
import { Search } from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
-import FormDia from "@/views/personnelManagement/onboarding/components/formDia.vue";
-// import FormDia from "@/views/personnelManagement/onboarding/components/formDiaXJHT.vue"; // 鏂扮枂椋熷搧鍏徃鐢ㄧ殑琛ㄥ崟
+// import FormDia from "@/views/personnelManagement/onboarding/components/formDia.vue";
+import FormDia from "@/views/personnelManagement/onboarding/components/formDiaXJHT.vue"; // 鏂扮枂椋熷搧鍏徃鐢ㄧ殑琛ㄥ崟
import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js";
import {ElMessageBox} from "element-plus";
import dayjs from "dayjs";
diff --git a/src/views/personnelManagement/payrollManagement/components/formDia.vue b/src/views/personnelManagement/payrollManagement/components/formDia.vue
index e4cf0b3..8da9fb3 100644
--- a/src/views/personnelManagement/payrollManagement/components/formDia.vue
+++ b/src/views/personnelManagement/payrollManagement/components/formDia.vue
@@ -27,128 +27,15 @@
<el-select v-model="form.staffId" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect" :disabled="operationType === 'edit'">
<el-option
v-for="item in personList"
- :key="item.id"
- :label="item.staffName"
- :value="item.id"
+ :key="item.userId"
+ :label="item.nickName"
+ :value="item.userId"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="搴斿嚭鍕ゅぉ鏁帮細" prop="shouldAttendedNum">
- <el-input v-model="form.shouldAttendedNum" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="瀹為檯鍑哄嫟澶╂暟锛�" prop="actualAttendedNum">
- <el-input v-model="form.actualAttendedNum" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍩烘湰宸ヨ祫锛�" prop="basicSalary">
- <el-input v-model="form.basicSalary" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="宀椾綅宸ヨ祫锛�" prop="postSalary">
- <el-input v-model="form.postSalary" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍏ョ鑱岀己鍕ゆ墸娆撅細" prop="deductionAbsenteeism">
- <el-input v-model="form.deductionAbsenteeism" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鐥呭亣鎵f锛�" prop="sickLeaveDeductions">
- <el-input v-model="form.sickLeaveDeductions" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="浜嬪亣鎵f锛�" prop="deductionPersonalLeave">
- <el-input v-model="form.deductionPersonalLeave" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="蹇樿鎵撳崱鎵f锛�" prop="forgetClockDeduct">
- <el-input v-model="form.forgetClockDeduct" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="缁╂晥寰楀垎锛�" prop="performanceScore">
- <el-input v-model="form.performanceScore" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="缁╂晥宸ヨ祫锛�" prop="performancePay">
- <el-input v-model="form.performancePay" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="搴斿彂鍚堣锛�" prop="payableWages">
- <el-input v-model="form.payableWages" placeholder="璇疯緭鍏�" clearable type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="绀句繚涓汉锛�" prop="socialSecurityIndividuals">
- <el-input v-model="form.socialSecurityIndividuals" :precision="0" :step="1" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="绀句繚鍏徃锛�" prop="socialSecurityCompanies">
- <el-input v-model="form.socialSecurityCompanies" :precision="0" :step="1" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="绀句繚鍚堣锛�" prop="socialSecurityTotal">
- <el-input v-model="form.socialSecurityTotal" :precision="0" :step="1" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍏Н閲戜釜浜猴細" prop="providentFundIndividuals">
- <el-input v-model="form.providentFundIndividuals" :precision="0" :step="1" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍏Н閲戝叕鍙革細" prop="providentFundCompany">
- <el-input v-model="form.providentFundCompany" :precision="0" :step="1" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍏Н閲戝悎璁★細" prop="providentFundTotal">
- <el-input v-model="form.providentFundTotal" :precision="0" :step="1" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="搴旂◣宸ヨ祫锛�" prop="taxableWaget">
- <el-input v-model="form.taxableWaget" :precision="0" :step="1" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="涓汉鎵�寰楃◣锛�" prop="personalIncomeTax">
- <el-input v-model="form.personalIncomeTax" :step="0.1" style="width: 100%" type="number"/>
- </el-form-item>
- </el-col>
<el-col :span="12">
<el-form-item label="瀹炲彂宸ヨ祫锛�" prop="actualWages">
<el-input v-model="form.actualWages" style="width: 100%" type="number"/>
@@ -170,6 +57,7 @@
import {ref} from "vue";
import {getStaffJoinInfo, getStaffOnJob, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
import {compensationAdd, compensationUpdate} from "@/api/personnelManagement/payrollManagement.js";
+import {listUser} from "@/api/system/user.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -180,50 +68,11 @@
payDate: "",
staffId: "",
name: "",
- shouldAttendedNum: "",
- actualAttendedNum: "",
- basicSalary: "",
- postSalary: "",
- deductionAbsenteeism: "",
- sickLeaveDeductions: "",
- deductionPersonalLeave: "",
- forgetClockDeduct: "",
- performanceScore: "",
- performancePay: "",
- payableWages: "",
- socialSecurityIndividuals: "",
- socialSecurityCompanies: "",
- socialSecurityTotal: "",
- providentFundIndividuals: "",
- providentFundCompany: "",
- providentFundTotal: "",
- taxableWaget: "",
- personalIncomeTax: "",
actualWages: "",
},
rules: {
payDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" },],
staffId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" },],
- staffName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- shouldAttendedNum: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- actualAttendedNum: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- basicSalary: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- postSalary: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- deductionAbsenteeism: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- sickLeaveDeductions: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- deductionPersonalLeave: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- forgetClockDeduct: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- performanceScore: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- performancePay: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- payableWages: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- socialSecurityIndividuals: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- socialSecurityCompanies: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- socialSecurityTotal: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- providentFundIndividuals: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- providentFundCompany: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- providentFundTotal: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- taxableWaget: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- personalIncomeTax: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
actualWages: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
},
});
@@ -234,8 +83,8 @@
const openDialog = (type, row) => {
operationType.value = type;
dialogFormVisible.value = true;
- getStaffOnJob().then(res => {
- personList.value = res.data
+ listUser().then(res => {
+ personList.value = res.rows
})
form.value = {}
if (operationType.value === 'edit') {
@@ -246,10 +95,9 @@
}
}
const handleSelect = (value) => {
- console.log('value', value)
- const index = personList.value.findIndex(row => row.id === value)
+ const index = personList.value.findIndex(row => row.userId === value)
if (index > -1) {
- form.value.name = personList.value[index].staffName
+ form.value.name = personList.value[index].nickName
}
}
// 鎻愪氦浜у搧琛ㄥ崟
diff --git a/src/views/personnelManagement/payrollManagement/index.vue b/src/views/personnelManagement/payrollManagement/index.vue
index 24e3dd8..a116316 100644
--- a/src/views/personnelManagement/payrollManagement/index.vue
+++ b/src/views/personnelManagement/payrollManagement/index.vue
@@ -27,9 +27,10 @@
>
</div>
<div>
- <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
+ <el-button @click="handleImport">瀵煎叆</el-button>
<el-button type="primary" @click="openForm('add')">鏂板钖祫</el-button>
<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ <el-button @click="handleExport">瀵煎嚭</el-button>
</div>
</div>
<div class="table_list">
@@ -46,17 +47,56 @@
></PIMTable>
</div>
<form-dia ref="formDia" @close="handleQuery"></form-dia>
+
+ <!-- 瀵煎叆寮圭獥 -->
+ <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body @close="handleUploadClose">
+ <el-upload
+ ref="uploadRef"
+ :limit="1"
+ accept=".xlsx, .xls"
+ :headers="upload.headers"
+ :action="upload.url"
+ :disabled="upload.isUploading"
+ :on-progress="upload.onProgress"
+ :on-success="upload.onSuccess"
+ :on-error="upload.onError"
+ :on-change="upload.onChange"
+ :auto-upload="false"
+ drag
+ >
+ <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+ <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+ <template #tip>
+ <div class="el-upload__tip text-center">
+ <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
+ <el-link
+ type="primary"
+ :underline="false"
+ style="font-size: 12px; vertical-align: baseline"
+ @click="importTemplate"
+ >涓嬭浇妯℃澘</el-link>
+ </div>
+ </template>
+ </el-upload>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
+ <el-button @click="handleUploadCancel">鍙� 娑�</el-button>
+ </div>
+ </template>
+ </el-dialog>
</div>
</template>
<script setup>
-import { Search } from "@element-plus/icons-vue";
+import { Search, UploadFilled } from "@element-plus/icons-vue";
import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
import FormDia from "@/views/personnelManagement/payrollManagement/components/formDia.vue";
import {staffJoinDel} from "@/api/personnelManagement/onboarding.js";
import {ElMessageBox} from "element-plus";
import dayjs from "dayjs";
import {compensationDelete, compensationListPage} from "@/api/personnelManagement/payrollManagement.js";
+import { getToken } from "@/utils/auth.js";
const data = reactive({
searchForm: {
@@ -73,98 +113,6 @@
{
label: "濮撳悕",
prop: "name",
- },
- {
- label: "搴斿嚭鍕ゅぉ鏁�",
- prop: "shouldAttendedNum",
- width:100
- },
- {
- label: "瀹為檯鍑哄嫟澶╂暟",
- prop: "actualAttendedNum",
- width:110
- },
- {
- label: "鍩烘湰宸ヨ祫",
- prop: "basicSalary",
- },
- {
- label: "宀椾綅宸ヨ祫",
- prop: "postSalary",
- width:100
- },
- {
- label: "鍏ョ鑱岀己鍕ゆ墸娆�",
- prop: "deductionAbsenteeism",
- width:130
- },
- {
- label: "鐥呭亣鎵f",
- prop: "sickLeaveDeductions",
- width:100
- },
- {
- label: "浜嬪亣鎵f",
- prop: "deductionPersonalLeave",
- width:100
- },
- {
- label: "蹇樿鎵撳崱鎵f",
- prop: "forgetClockDeduct",
- width:110
- },
- {
- label: "缁╂晥寰楀垎",
- prop: "performanceScore",
- width:150
- },
- {
- label: "缁╂晥宸ヨ祫",
- prop: "performancePay",
- width: 120
- },
- {
- label: "搴斿彂鍚堣",
- prop: "payableWages",
- width:150
- },
- {
- label: "绀句繚涓汉",
- prop: "socialSecurityIndividuals",
- },
- {
- label: "绀句繚鍏徃",
- prop: "socialSecurityCompanies",
- width: 120
- },
- {
- label: "绀句繚鍚堣",
- prop: "socialSecurityTotal",
- width: 120
- },
- {
- label: "鍏Н閲戜釜浜�",
- prop: "providentFundIndividuals",
- width: 120
- },
- {
- label: "鍏Н閲戝叕鍙�",
- prop: "providentFundCompany",
- width: 120
- },
- {
- label: "鍏Н閲戝悎璁�",
- prop: "providentFundTotal",
- width: 120
- },
- {
- label: "搴旂◣宸ヨ祫",
- prop: "taxableWaget",
- },
- {
- label: "涓汉鎵�寰楃◣",
- prop: "personalIncomeTax",
- width: 120
},
{
label: "瀹炲彂宸ヨ祫",
@@ -197,6 +145,56 @@
});
const formDia = ref()
const { proxy } = getCurrentInstance()
+
+// 瀵煎叆鍔熻兘閰嶇疆
+const upload = reactive({
+ // 鏄惁鏄剧ず寮瑰嚭灞傦紙钖祫瀵煎叆锛�
+ open: false,
+ // 寮瑰嚭灞傛爣棰橈紙钖祫瀵煎叆锛�
+ title: "",
+ // 鏄惁绂佺敤涓婁紶
+ isUploading: false,
+ // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+ headers: { Authorization: "Bearer " + getToken() },
+ // 涓婁紶鐨勫湴鍧�
+ url: import.meta.env.VITE_APP_BASE_API + "/compensationPerformance/importData",
+ // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
+ beforeUpload: (file) => {
+ // 鍙互鍦ㄦ澶勫仛鏂囦欢绫诲瀷鎴栧ぇ灏忔牎楠�
+ const isValid = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.name.endsWith('.xlsx') || file.name.endsWith('.xls');
+ if (!isValid) {
+ proxy.$modal.msgError("鍙兘涓婁紶 Excel 鏂囦欢");
+ }
+ return isValid;
+ },
+ // 鏂囦欢鐘舵�佹敼鍙樻椂鐨勫洖璋�
+ onChange: (file, fileList) => {
+ console.log('鏂囦欢鐘舵�佹敼鍙�', file, fileList);
+ },
+ // 鏂囦欢涓婁紶鎴愬姛鏃剁殑鍥炶皟
+ onSuccess: (response, file, fileList) => {
+ upload.isUploading = false;
+ if(response.code === 200){
+ proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
+ handleUploadClose();
+ getList();
+ }else if(response.code === 500){
+ proxy.$modal.msgError(response.msg);
+ }else{
+ proxy.$modal.msgWarning(response.msg);
+ }
+ },
+ // 鏂囦欢涓婁紶澶辫触鏃剁殑鍥炶皟
+ onError: (error, file, fileList) => {
+ console.error('涓婁紶澶辫触', error, file, fileList);
+ upload.isUploading = false;
+ proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+ },
+ // 鏂囦欢涓婁紶杩涘害鍥炶皟
+ onProgress: (event, file, fileList) => {
+ console.log('涓婁紶涓�...', event.percent);
+ }
+});
const handleDateChange = (value,type) => {
searchForm.value.entryDateEnd = null
@@ -299,6 +297,39 @@
});
};
+/** 瀵煎叆鎸夐挳鎿嶄綔 */
+function handleImport() {
+ upload.title = "钖祫瀵煎叆";
+ upload.open = true;
+}
+
+/** 鎻愪氦涓婁紶鏂囦欢 */
+function submitFileForm() {
+ upload.isUploading = true;
+ proxy.$refs["uploadRef"].submit();
+}
+
+/** 涓嬭浇妯℃澘 */
+function importTemplate() {
+ proxy.download("/compensationPerformance/exportTemplate", {}, "钖祫瀵煎叆妯℃澘.xlsx");
+}
+
+// 澶勭悊涓婁紶寮规鍙栨秷
+function handleUploadCancel() {
+ upload.open = false;
+ handleUploadClose();
+}
+
+// 澶勭悊涓婁紶寮规鍏抽棴
+function handleUploadClose() {
+ upload.open = false;
+ upload.isUploading = false;
+ // 娓呯┖涓婁紶鏂囦欢缂撳瓨
+ if (proxy.$refs.uploadRef) {
+ proxy.$refs.uploadRef.clearFiles();
+ }
+}
+
onMounted(() => {
getList();
});
diff --git a/src/views/personnelManagement/scheduling/index.vue b/src/views/personnelManagement/scheduling/index.vue
index 251dbe9..15bf05c 100644
--- a/src/views/personnelManagement/scheduling/index.vue
+++ b/src/views/personnelManagement/scheduling/index.vue
@@ -11,34 +11,14 @@
style="width: 150px"
/>
</el-form-item>
- <el-form-item label="鐝绫诲瀷锛�">
- <el-select v-model="filterForm.shiftType" placeholder="璇烽�夋嫨鐝" clearable style="width: 120px">
- <el-option v-for="item in shift_type" :label="item.label" :value="item.value" :key="item.value"/>
- </el-select>
- </el-form-item>
- <el-form-item label="鏃ユ湡鑼冨洿锛�">
- <el-date-picker
- v-model="filterForm.dateRange"
- type="daterange"
- range-separator="鑷�"
- start-placeholder="寮�濮嬫棩鏈�"
- end-placeholder="缁撴潫鏃ユ湡"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- style="width: 250px"
- />
- </el-form-item>
<el-form-item>
<el-button type="primary" @click="handleFilter">
- <el-icon><Search/></el-icon>
- 绛涢��
+ 鎼滅储
</el-button>
<el-button @click="resetFilter">
- <el-icon><Refresh/></el-icon>
閲嶇疆
</el-button>
<el-button @click="handleExport">
- <el-icon><Download/></el-icon>
瀵煎嚭
</el-button>
<el-button type="primary" @click="openScheduleDialog('add')">
@@ -61,48 +41,53 @@
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"/>
- <el-table-column prop="staffName" label="鍛樺伐濮撳悕" width="120"/>
- <el-table-column prop="staffNo" label="鍛樺伐宸ュ彿" width="100"/>
- <el-table-column prop="department" label="閮ㄩ棬" width="120">
+ <el-table-column prop="staffName" label="鍛樺伐濮撳悕"/>
+ <!-- <el-table-column prop="staffNo" label="鍛樺伐宸ュ彿" width="100"/> -->
+ <!-- <el-table-column prop="department" label="閮ㄩ棬" width="120">
<template #default="scope">
{{ (department_type.find(i => i.value === String(scope.row.department)) || {}).label }}
</template>
- </el-table-column>
- <el-table-column prop="shiftType" label="鐝绫诲瀷" width="100">
+ </el-table-column> -->
+ <el-table-column prop="shiftType" label="鐝绫诲瀷" width="120">
<template #default="scope">
<el-tag :type="getShiftTagType(scope.row.shiftType)">
- {{ (shift_type.find(i => i.value === String(scope.row.shiftType)) || {}).label }}
+ {{ (shift_type.find(i => i.value === String(scope.row.shiftType)) || {}).label || '鏈煡' }}
</el-tag>
</template>
</el-table-column>
- <el-table-column prop="workDate" label="宸ヤ綔鏃ユ湡" width="120"/>
- <el-table-column prop="startTime" label="寮�濮嬫椂闂�" width="100"/>
- <el-table-column prop="endTime" label="缁撴潫鏃堕棿" width="100"/>
- <el-table-column prop="workHours" label="宸ヤ綔鏃堕暱" width="100">
+ <!-- <el-table-column prop="workDate" label="宸ヤ綔鏃ユ湡" width="120"/> -->
+ <el-table-column prop="workStartTime" label="寮�濮嬫椂闂�"/>
+ <el-table-column prop="workEndTime" label="缁撴潫鏃堕棿"/>
+ <el-table-column prop="lunchTime" label="鍗堜紤鏃堕棿(h)">
+ <template #default="scope">
+ {{ scope.row.lunchTime }}灏忔椂
+ </template>
+ </el-table-column>
+ <!-- <el-table-column prop="workHours" label="宸ヤ綔鏃堕暱" width="100">
<template #default="scope">
{{ scope.row.workHours }}灏忔椂
</template>
- </el-table-column>
- <el-table-column prop="status" label="鐘舵��" width="100">
+ </el-table-column> -->
+ <!-- <el-table-column prop="status" label="鐘舵��" width="100">
<template #default="scope">
<el-tag :type="getStatusTagType(scope.row.status)">
{{ (schedule_status.find(i => i.value === String(scope.row.status)) || {}).label }}
</el-tag>
</template>
- </el-table-column>
- <el-table-column prop="remark" label="澶囨敞" min-width="150"/>
- <el-table-column label="鎿嶄綔" width="200" fixed="right">
+ </el-table-column> -->
+ <!-- <el-table-column prop="remark" label="澶囨敞" min-width="150"/> -->
+ <el-table-column label="鎿嶄綔" width="200" fixed="right" align="center">
<template #default="scope">
<el-button
- type="primary"
- size="small"
+ link
+ type="primary"
@click="openScheduleDialog('edit', scope.row)"
>
缂栬緫
</el-button>
<el-button
- type="danger"
- size="small"
+ link
+ type="danger"
@click="handleDelete(scope.row)"
>
鍒犻櫎
@@ -144,22 +129,36 @@
label-width="120px"
>
<el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="鍛樺伐濮撳悕锛�" prop="staffId">
- <el-select v-model="scheduleForm.staffId" placeholder="璇疯緭鍏ュ憳宸ュ鍚�" style="width: 100%"
+ <el-col :span="24">
+ <el-form-item label="鍛樺伐濮撳悕锛�" prop="staffIds">
+ <el-select v-model="scheduleForm.staffIds" placeholder="璇烽�夋嫨鍛樺伐濮撳悕" style="width: 100%"
+ multiple filterable collapse-tags-tooltip
@change="handleSelectStaff">
- <el-option v-for="item in personList" :label="item.staffName" :value="item.id" :key="item.id"/>
- </el-select>
- </el-form-item>
+ <el-option v-for="item in personList" :label="item.nickName" :value="item.userId" :key="item.userId"/>
+ </el-select>
+ </el-form-item>
</el-col>
+ </el-row>
+
+ <!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="鍛樺伐宸ュ彿锛�" prop="staffNo">
<el-input :disabled="true" v-model="scheduleForm.staffNo" placeholder=""/>
</el-form-item>
</el-col>
- </el-row>
+ </el-row> -->
<el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鐝绫诲瀷锛�" prop="shiftType">
+ <el-select v-model="scheduleForm.shiftType" placeholder="璇烽�夋嫨鐝绫诲瀷" style="width: 100%">
+ <el-option v-for="item in shift_type" :label="item.label" :value="item.value" :key="item.value"/>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="閮ㄩ棬锛�" prop="department">
<el-select v-model="scheduleForm.department" placeholder="璇烽�夋嫨閮ㄩ棬" style="width: 100%">
@@ -174,9 +173,9 @@
</el-select>
</el-form-item>
</el-col>
- </el-row>
+ </el-row> -->
- <el-row :gutter="20">
+ <!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="宸ヤ綔鏃ユ湡锛�" prop="workDate">
<el-date-picker
@@ -196,34 +195,49 @@
</el-select>
</el-form-item>
</el-col>
- </el-row>
+ </el-row> -->
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="寮�濮嬫椂闂达細" prop="startTime">
+ <el-form-item label="寮�濮嬫椂闂达細" prop="workStartTime">
<el-time-picker
- v-model="scheduleForm.startTime"
+ v-model="scheduleForm.workStartTime"
placeholder="閫夋嫨寮�濮嬫椂闂�"
style="width: 100%"
format="HH:mm"
- value-format="HH:mm"
+ value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="缁撴潫鏃堕棿锛�" prop="endTime">
+ <el-form-item label="缁撴潫鏃堕棿锛�" prop="workEndTime">
<el-time-picker
- v-model="scheduleForm.endTime"
+ v-model="scheduleForm.workEndTime"
placeholder="閫夋嫨缁撴潫鏃堕棿"
style="width: 100%"
format="HH:mm"
- value-format="HH:mm"
+ value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鍗堜紤鏃堕棿(h)锛�" prop="lunchTime">
+ <el-input-number
+ v-model="scheduleForm.lunchTime"
+ :min="0"
+ :max="8"
+ :step="0.5"
+ placeholder="璇疯緭鍏ュ崍浼戞椂闂�"
+ style="width: 100%"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- <el-row :gutter="20">
<el-col :span="24">
<el-form-item label="澶囨敞锛�" prop="remark">
<el-input
@@ -234,7 +248,7 @@
/>
</el-form-item>
</el-col>
- </el-row>
+ </el-row> -->
</el-form>
<template #footer>
@@ -248,7 +262,7 @@
</template>
<script setup>
-import {ref, reactive, computed, onMounted, getCurrentInstance} from 'vue'
+import {ref, reactive, computed, onMounted, getCurrentInstance, watch} from 'vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import {useDict} from "@/utils/dict.js"
import {Plus, Download, Search, Refresh} from '@element-plus/icons-vue'
@@ -256,6 +270,7 @@
import {getStaffOnJob} from "@/api/personnelManagement/onboarding.js";
import dayjs from "dayjs";
import pagination from "@/components/PIMTable/Pagination.vue";
+import {listUser} from "@/api/system/user.js";
const { proxy } = getCurrentInstance();
@@ -269,8 +284,6 @@
// 绛涢�夎〃鍗�
const filterForm = reactive({
staffName: '',
- shiftType: '',
- dateRange: [],
current:1,
size: 10
})
@@ -278,29 +291,31 @@
// 鎺掔彮琛ㄥ崟
const scheduleForm = reactive({
id: '',
- staffId: '',
- staffNo: '',
- department: '',
+ staffIds: [],
+ // staffNo: '',
+ // department: '',
shiftType: '',
- workDate: '',
- startTime: '',
- endTime: '',
+ // workDate: '',
workStartTime: '',
workEndTime: '',
- workHours: 0,
- status: '',
- remark: ''
+ lunchTime: 3,
+ // workStartTime: '',
+ // workEndTime: '',
+ // workHours: 0,
+ // status: '',
+ // remark: ''
})
// 琛ㄥ崟楠岃瘉瑙勫垯
const scheduleRules = reactive({
- staffId: [{required: true, message: '璇烽�夋嫨鍛樺伐', trigger: 'change'}],
- department: [{required: true, message: '璇烽�夋嫨閮ㄩ棬', trigger: 'change'}],
+ staffIds: [{required: true, message: '璇烽�夋嫨鍛樺伐', trigger: 'change'}],
+ // department: [{required: true, message: '璇烽�夋嫨閮ㄩ棬', trigger: 'change'}],
shiftType: [{required: true, message: '璇烽�夋嫨鐝绫诲瀷', trigger: 'change'}],
- workDate: [{required: true, message: '璇烽�夋嫨宸ヤ綔鏃ユ湡', trigger: 'change'}],
- startTime: [{required: true, message: '璇烽�夋嫨寮�濮嬫椂闂�', trigger: 'change'}],
- endTime: [{required: true, message: '璇烽�夋嫨缁撴潫鏃堕棿', trigger: 'change'}],
- status: [{required: true, message: '璇烽�夋嫨鐘舵��', trigger: 'change'}]
+ // workDate: [{required: true, message: '璇烽�夋嫨宸ヤ綔鏃ユ湡', trigger: 'change'}],
+ workStartTime: [{required: true, message: '璇烽�夋嫨寮�濮嬫椂闂�', trigger: 'change'}],
+ workEndTime: [{required: true, message: '璇烽�夋嫨缁撴潫鏃堕棿', trigger: 'change'}],
+ lunchTime: [{required: true, message: '璇疯緭鍏ュ崍浼戞椂闂�', trigger: 'blur'}],
+ // status: [{required: true, message: '璇烽�夋嫨鐘舵��', trigger: 'change'}]
})
const tableLoading = ref(false)
@@ -317,9 +332,9 @@
* 鑾峰彇褰撳墠鍦ㄨ亴浜哄憳鍒楄〃
*/
const getPersonList = () => {
- getStaffOnJob().then(res => {
- personList.value = res.data
- })
+ listUser().then(res => {
+ personList.value = res.rows
+ })
};
const paginationChange = (obj) => {
filterForm.current = obj.page;
@@ -328,9 +343,9 @@
};
const handleSelectStaff = (val) => {
- let obj = personList.value.find(item => item.id === val)
- scheduleForm.staffNo = obj.staffNo
-
+ // 澶氶�夊憳宸ワ紝涓嶅啀鑷姩璁剧疆鍛樺伐宸ュ彿
+ // let obj = personList.value.find(item => item.id === val)
+ // scheduleForm.staffNo = obj.staffNo
}
// 鑾峰彇鐝鏍囩绫诲瀷
@@ -349,19 +364,19 @@
const handleFilter = async () => {
tableLoading.value = true
let searchForm = {
- ...filterForm,
- ...(filterForm.dateRange.length > 0 && {
- startDate: filterForm.dateRange[0],
- endDate: filterForm.dateRange[1],
- })
+ ...filterForm
}
let resp = await listPage(searchForm)
tableCount.value = resp.data.total
scheduleList.value = resp.data.records.map(it => {
return {
...it,
- 'startTime': dayjs(it.workStartTime).format('HH:mm'),
- 'endTime': dayjs(it.workEndTime).format('HH:mm'),
+ // 淇濆瓨鍘熷鏃堕棿鏍煎紡鐢ㄤ簬缂栬緫
+ 'originalWorkStartTime': it.workStartTime,
+ 'originalWorkEndTime': it.workEndTime,
+ // 鏍煎紡鍖栨椂闂寸敤浜庤〃鏍兼樉绀�
+ 'workStartTime': dayjs(it.workStartTime).format('HH:mm'),
+ 'workEndTime': dayjs(it.workEndTime).format('HH:mm'),
}
})
tableLoading.value = false
@@ -371,8 +386,6 @@
// 閲嶇疆绛涢��
const resetFilter = () => {
filterForm.staffName = ''
- filterForm.shiftType = ''
- filterForm.dateRange = []
}
// 鎵撳紑鎺掔彮瀵硅瘽妗�
@@ -381,16 +394,29 @@
scheduleDialog.value = true
getPersonList()
if (type === 'edit' && data) {
- // 缂栬緫妯″紡锛屽鍒舵暟鎹�
- Object.assign(scheduleForm, {...data})
- } else {
- // 鏂板妯″紡锛岄噸缃〃鍗�
- Object.keys(scheduleForm).forEach(key => {
- scheduleForm[key] = ''
+ // 缂栬緫妯″紡锛屽鍒舵暟鎹紝灏嗗憳宸D瀛楃涓茶浆鎹负鏁扮粍鏍煎紡锛屽苟澶勭悊鏃堕棿瀛楁
+ Object.assign(scheduleForm, {
+ ...data,
+ lunchTime: Number(data.lunchTime),
+ staffIds: data.staffId ? data.staffId.split(',').map(id => parseInt(id)) : [],
+ // 浣跨敤鍘熷鏃堕棿瀛楃涓诧紝鍥犱负琛ㄦ牸涓樉绀虹殑鏄牸寮忓寲鍚庣殑HH:mm
+ workStartTime: data.originalWorkStartTime || '',
+ workEndTime: data.originalWorkEndTime || ''
})
- // scheduleForm.status = '宸插畨鎺�'
- scheduleForm.workDate = new Date().toISOString().split('T')[0]
- }
+ } else {
+ // 鏂板妯″紡锛岄噸缃〃鍗�
+ Object.keys(scheduleForm).forEach(key => {
+ if (key === 'staffIds') {
+ scheduleForm[key] = []
+ } else if (key === 'lunchTime') {
+ scheduleForm[key] = 3
+ } else {
+ scheduleForm[key] = ''
+ }
+ })
+ // scheduleForm.status = '宸插畨鎺�'
+ // scheduleForm.workDate = new Date().toISOString().split('T')[0]
+ }
}
// 鍏抽棴鎺掔彮瀵硅瘽妗�
@@ -401,37 +427,86 @@
// 璁$畻宸ヤ綔鏃堕暱
const calculateWorkHours = () => {
- if (scheduleForm.workDate && scheduleForm.startTime && scheduleForm.endTime) {
- // 浣跨敤 workDate 涓� startTime 鍜� endTime 缁勫悎
- const startDateTime = new Date(`${scheduleForm.workDate} ${scheduleForm.startTime}`)
- const endDateTime = new Date(`${scheduleForm.workDate} ${scheduleForm.endTime}`)
+ if (!scheduleForm.workStartTime || !scheduleForm.workEndTime) {
+ return;
+ }
+
+ try {
+ // 浣跨敤dayjs姝g‘瑙f瀽鏃堕棿
+ const startDayjs = dayjs(scheduleForm.workStartTime);
+ const endDayjs = dayjs(scheduleForm.workEndTime);
+
+ if (!startDayjs.isValid() || !endDayjs.isValid()) {
+ return;
+ }
+
+ const startDateTime = startDayjs.toDate();
+ const endDateTime = endDayjs.toDate();
// 澶勭悊璺ㄥぉ鎯呭喌锛堢粨鏉熸椂闂存棭浜庡紑濮嬫椂闂达級
if (endDateTime < startDateTime) {
// 璺ㄥぉ锛屽皢缁撴潫鏃ユ湡鍔犱竴澶�
- endDateTime.setDate(endDateTime.getDate() + 1)
+ endDateTime.setDate(endDateTime.getDate() + 1);
}
- // 璁$畻宸ヤ綔鏃堕暱锛堝皬鏃讹級
- const diffMs = endDateTime - startDateTime
- const diffHours = diffMs / (1000 * 60 * 60)
- scheduleForm.workHours = Math.round(diffHours * 100) / 100
- scheduleForm.workStartTime = dayjs(startDateTime).format("YYYY-MM-DD HH:mm:ss")
- scheduleForm.workEndTime = dayjs(endDateTime).format("YYYY-MM-DD HH:mm:ss")
+ // 璁$畻宸ヤ綔鏃堕暱锛堝皬鏃讹級
+ const diffMs = endDateTime - startDateTime;
+ const diffHours = diffMs / (1000 * 60 * 60);
+ scheduleForm.workHours = Math.round(diffHours * 100) / 100;
+ } catch (error) {
+ console.error('鏃堕棿璁$畻閿欒:', error);
}
}
+
+// 鐩戝惉鏃堕棿瀛楁鍙樺寲锛岃嚜鍔ㄨ绠楀伐浣滄椂闀�
+watch(
+ () => [scheduleForm.workStartTime, scheduleForm.workEndTime],
+ () => {
+ calculateWorkHours()
+ },
+ { deep: true }
+)
// 鎻愪氦鎺掔彮琛ㄥ崟
const submitScheduleForm = async () => {
const valid = await scheduleFormRef.value.validate()
if (!valid) return
- calculateWorkHours()
- const newSchedule = {...scheduleForm}
+ // 鐢变簬鍛樺伐鏄閫夛紝闇�瑕佷负姣忎釜閫変腑鐨勫憳宸ュ垱寤烘帓鐝褰�
+ const selectedStaffIds = scheduleForm.staffIds || []
+
+ if (selectedStaffIds.length === 0) {
+ ElMessage.warning('璇疯嚦灏戦�夋嫨涓�涓憳宸�')
+ return
+ }
try {
+ // 鑾峰彇閫変腑鐨勫憳宸ュ鍚嶅垪琛�
+ const selectedStaffNames = selectedStaffIds.map(staffId => {
+ const staff = personList.value.find(item => item.userId === staffId)
+ return staff ? staff.nickName : ''
+ }).filter(name => name !== '')
+
+ // 灏嗗憳宸ュ鍚嶇粍瑁呮垚閫楀彿鍒嗛殧鐨勫瓧绗︿覆
+ const staffNameString = selectedStaffNames.join(',')
+
+ // 鍒涘缓鎺掔彮璁板綍锛屽皢鍛樺伐濮撳悕淇濆瓨涓哄瓧绗︿覆鏍煎紡
+ const newSchedule = {
+ ...scheduleForm,
+ staffName: staffNameString,
+ staffId: selectedStaffIds.join(','), // 灏嗗憳宸D涔熶繚瀛樹负閫楀彿鍒嗛殧鐨勫瓧绗︿覆
+ // 璁剧疆鍏朵粬蹇呰瀛楁鐨勯粯璁ゅ��
+ staffNo: '', // 鍙互鏍规嵁闇�瑕佷粠personList涓幏鍙�
+ department: '',
+ shiftType: scheduleForm.shiftType,
+ workDate: '',
+ status: '',
+ remark: ''
+ }
+
await save(newSchedule)
- ElMessage.success('淇濆瓨鎺掔彮鎴愬姛')
+
+ ElMessage.success(`鎴愬姛涓� ${selectedStaffNames.length} 涓憳宸ュ垱寤烘帓鐝璥)
handleFilter()
closeScheduleDialog()
@@ -491,11 +566,7 @@
// 瀵煎嚭
const handleExport = () => {
let searchForm = {
- ...filterForm,
- ...(filterForm.dateRange.length > 0 && {
- startDate: filterForm.dateRange[0],
- endDate: filterForm.dateRange[1],
- })
+ ...filterForm
}
proxy.download('/staff/staffScheduling/export', {}, '浜哄憳鎺掔彮.xlsx')
}
diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
index f29b78a..475eabc 100644
--- a/src/views/procurementManagement/invoiceEntry/components/Modal.vue
+++ b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -1,160 +1,202 @@
<template>
- <el-dialog :title="modalOptions.title" v-model="visible" width="70%">
- <el-form
- ref="formRef"
- :model="form"
- :rules="rules"
- label-width="120px"
- label-position="top"
- >
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="閲囪喘鍚堝悓鍙凤細" prop="purchaseLedgerNo">
- <el-input v-model="form.purchaseLedgerNo" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="閿�鍞悎鍚屽彿锛�" prop="salesContractNo">
- <el-input
- v-model="form.salesContractNo"
- placeholder="鑷姩濉厖"
- clearable
- disabled
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="渚涘簲鍟嗗悕绉帮細" prop="supplierName">
- <el-input
- v-model="form.supplierName"
- placeholder="鑷姩濉厖"
- clearable
- disabled
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
- <el-input
- v-model="form.projectName"
- placeholder="鑷姩濉厖"
- clearable
- disabled
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍙戠エ鍙凤細" prop="invoiceNumber">
- <el-input
- v-model="form.invoiceNumber"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍙戠エ閲戦(鍏�)锛�" prop="invoiceAmount">
- <el-input-number :step="0.01" :min="0" style="width: 100%"
- v-model="form.invoiceAmount"
- placeholder="鑷姩濉厖"
- clearable
- :disabled="true"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="褰曞叆浜猴細" prop="issUer">
- <el-input
- v-model="form.issUer"
- placeholder="璇疯緭鍏�"
- clearable
- disabled
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="寮�绁ㄦ棩鏈燂細" prop="entryDate">
- <el-date-picker
- style="width: 100%"
- v-model="form.entryDate"
- type="date"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="涓婁紶闄勪欢">
- <FileUpload
- :showTip="false"
- accept="*"
- :autoUpload="true"
- :action="action"
- :headers="{
+ <el-dialog :title="modalOptions.title" v-model="visible" width="70%">
+ <el-form
+ ref="formRef"
+ :model="form"
+ :rules="rules"
+ label-width="120px"
+ label-position="top"
+ >
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="閲囪喘鍚堝悓鍙凤細" prop="purchaseLedgerNo">
+ <el-input v-model="form.purchaseLedgerNo" disabled placeholder="澶氬悎鍚屾壒閲忓鐞嗭紙鍏蜂綋鍚堝悓鍙疯浜у搧鍒楄〃锛�" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="閿�鍞悎鍚屽彿锛�" prop="salesContractNo">
+ <el-input
+ v-model="form.salesContractNo"
+ placeholder="鑷姩濉厖"
+ clearable
+ disabled
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="渚涘簲鍟嗗悕绉帮細" prop="supplierName">
+ <el-input
+ v-model="form.supplierName"
+ placeholder="鑷姩濉厖"
+ clearable
+ disabled
+ />
+ </el-form-item>
+ </el-col>
+<!-- <el-col :span="12">-->
+<!-- <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">-->
+<!-- <el-input-->
+<!-- v-model="form.projectName"-->
+<!-- placeholder="鑷姩濉厖"-->
+<!-- clearable-->
+<!-- disabled-->
+<!-- />-->
+<!-- </el-form-item>-->
+<!-- </el-col>-->
+ <el-col :span="12">
+ <el-form-item label="鍙戠エ鍙凤細" prop="invoiceNumber">
+ <el-input
+ v-model="form.invoiceNumber"
+ placeholder="璇疯緭鍏�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍙戠エ閲戦(鍏�)锛�" prop="invoiceAmount">
+ <el-input-number :step="0.01" :min="0" style="width: 100%"
+ v-model="form.invoiceAmount"
+ placeholder="璇疯緭鍏ュ彂绁ㄩ噾棰�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="褰曞叆浜猴細" prop="issUer">
+ <el-input
+ v-model="form.issUer"
+ placeholder="璇疯緭鍏�"
+ clearable
+ disabled
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="寮�绁ㄦ棩鏈燂細" prop="entryDate">
+ <el-date-picker
+ style="width: 100%"
+ v-model="form.entryDate"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="褰曞叆鏃ユ湡锛�" prop="enterDate">
+ <el-date-picker
+ style="width: 100%"
+ v-model="form.enterDate"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="涓婁紶闄勪欢">
+ <FileUpload
+ :showTip="false"
+ accept="*"
+ :autoUpload="true"
+ :action="action"
+ :headers="{
Authorization: 'Bearer ' + getToken(),
}"
- :limit="10"
- @success="uploadSuccess"
- @remove="removeFile"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="褰曞叆鏃ユ湡锛�" prop="enterDate">
- <el-date-picker
- style="width: 100%"
- v-model="form.enterDate"
- type="date"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- clearable
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="浜у搧淇℃伅锛�"> </el-form-item>
- <PIMTable
- rowKey="id"
- :column="columns"
- :tableData="form.productData"
- :summaryMethod="summarizeChildrenTable"
- :isShowSummary="true"
- height="auto"
- >
- <template #ticketsNumRef="{ row }">
- <el-input-number
- v-model="row.ticketsNum"
- placeholder="璇疯緭鍏�"
- :min="0"
- :step="0.1"
- :precision="2"
- clearable
- style="width: 100%"
- @change="invoiceNumBlur(row)"
- />
- </template>
- <template #ticketsAmountRef="{ row }">
- <el-input-number
- v-model="row.ticketsAmount"
- placeholder="璇疯緭鍏�"
- :min="0"
- :precision="2"
- :step="0.1"
- clearable
- style="width: 100%"
- @change="invoiceAmountBlur(row)"
- />
- </template>
- </PIMTable>
- </el-form>
- <template #footer>
+ :limit="10"
+ @success="uploadSuccess"
+ @remove="removeFile"
+ />
+ </el-form-item>
+ </el-col>
+
+ </el-row>
+ <el-form-item label="浜у搧淇℃伅锛�"> </el-form-item>
+ <el-table
+ :data="form.productData"
+ border
+ show-summary
+ :summary-method="summarizeChildrenTable"
+ >
+ <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+ <el-table-column label="鎵�灞炲悎鍚�" prop="purchaseLedgerNo" width="200">
+ <template #default="{ row }">
+ <el-tag type="primary">{{ row.purchaseLedgerNo }}</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="浜у搧澶х被" prop="productCategory" />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="150" />
+ <el-table-column label="鍗曚綅" prop="unit" width="70" />
+ <el-table-column label="鏁伴噺" prop="quantity" width="70" />
+ <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" />
+ <el-table-column
+ label="鍚◣鍗曚环(鍏�)"
+ prop="taxInclusiveUnitPrice"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鍚◣鎬讳环(鍏�)"
+ prop="taxInclusiveTotalPrice"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="涓嶅惈绋庢�讳环(鍏�)"
+ prop="taxExclusiveTotalPrice"
+ :formatter="formattedNumber"
+ />
+ <el-table-column label="鏈寮�绁ㄦ暟" prop="ticketsNum" width="180">
+ <template #default="scope">
+ <el-input-number :step="0.1" :min="0" style="width: 100%"
+ :precision="2"
+ v-model="scope.row.ticketsNum"
+ @change="invoiceNumBlur(scope.row)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鏈寮�绁ㄩ噾棰�(鍏�)"
+ prop="ticketsAmount"
+ width="180"
+ >
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%"
+ :precision="2"
+ v-model="scope.row.ticketsAmount"
+ @change="invoiceAmountBlur(scope.row)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鏈潵绁ㄦ暟"
+ prop="futureTickets"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鏈鏉ョエ閲戦(鍏�)"
+ prop="ticketsAmount"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鏈潵绁ㄦ暟"
+ prop="futureTickets"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鏈潵绁ㄩ噾棰�(鍏�)"
+ prop="futureTicketsAmount"
+ :formatter="formattedNumber"
+ />
+ </el-table>
+ </el-form>
+ <template #footer>
<el-button type="primary" :loading="modalLoading" @click="submitForm">
- {{ modalOptions.confirmText }}
+ 纭
</el-button>
- <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button>
- </template>
- </el-dialog>
+ <el-button @click="closeModal">鍙栨秷</el-button>
+ </template>
+ </el-dialog>
</template>
<script setup>
@@ -164,9 +206,9 @@
import useFormData from "@/hooks/useFormData";
import FileUpload from "@/components/Upload/FileUpload.vue";
import {
- getPurchaseNoById,
- getInfo,
- addOrUpdateRegistration,
+ getPurchaseNoById,
+ getInfo,
+ addOrUpdateRegistration,
} from "@/api/procurementManagement/invoiceEntry.js";
import { getPurchaseById } from "@/api/procurementManagement/procurementLedger.js";
import { getToken } from "@/utils/auth";
@@ -174,7 +216,7 @@
import dayjs from "dayjs";
defineOptions({
- name: "鏉ョエ鐧昏妯℃�佹",
+ name: "鏉ョエ鐧昏妯℃�佹",
});
const userStore = useUserStore();
@@ -182,155 +224,218 @@
const formRef = ref();
const { proxy } = getCurrentInstance();
const { form } = useFormData({
- purchaseLedgerNo: undefined, // 閲囪喘鍚堝悓鍙�
- salesContractNo: undefined, // 閿�鍞悎鍚屽彿
- supplierName: undefined, // 渚涘簲鍟嗗悕绉�
- projectName: undefined, // 椤圭洰鍚嶇О
- invoiceNumber: undefined, // 鍙戠エ鍙�
- invoiceAmount: undefined, // 鍙戠エ閲戦(鍏�)
- issUerId: userStore.id, // 褰曞叆浜�
- issUer: userStore.nickName, // 褰曞叆浜�
- entryDate: undefined, // 寮�绁ㄦ棩鏈�
- salesContractNoId: undefined, // 寮�绁ㄦ棩鏈�
- enterDate: dayjs().format("YYYY-MM-DD"),
- productData: [], // 琛ㄦ牸
- tempFileIds: [], // 鏂囦欢
+ purchaseLedgerNo: undefined, // 閲囪喘鍚堝悓鍙�
+ salesContractNo: undefined, // 閿�鍞悎鍚屽彿
+ supplierName: undefined, // 渚涘簲鍟嗗悕绉�
+ projectName: undefined, // 椤圭洰鍚嶇О
+ invoiceNumber: undefined, // 鍙戠エ鍙�
+ invoiceAmount: undefined, // 鍙戠エ閲戦(鍏�)
+ issUerId: userStore.id, // 褰曞叆浜�
+ issUer: userStore.nickName, // 褰曞叆浜�
+ entryDate: undefined, // 寮�绁ㄦ棩鏈�
+ salesContractNoId: undefined, // 寮�绁ㄦ棩鏈�
+ enterDate: dayjs().format("YYYY-MM-DD"),
+ productData: [], // 琛ㄦ牸
+ tempFileIds: [], // 鏂囦欢
});
+const selectedContracts = ref([]); // 瀛樺偍閫変腑鐨勫悎鍚屾暟鎹�
+
const rules = ref({
- invoiceNumber: [
- { required: true, message: "璇疯緭鍏ュ彂绁ㄥ彿", trigger: "blur" },
- { type: "string" },
- ],
- invoiceAmount: [
- { required: true, message: "璇疯緭鍏ュ彂绁ㄩ噾棰�", trigger: "blur" },
- ],
- entryDate: [{ required: true, message: "璇烽�夋嫨寮�绁ㄦ棩鏈�", trigger: "change" }],
- enterDate: [{ required: true, message: "璇烽�夋嫨褰曞叆鏃ユ湡", trigger: "change" }],
+ invoiceNumber: [
+ { required: true, message: "璇疯緭鍏ュ彂绁ㄥ彿", trigger: "blur" },
+ { type: "string" },
+ ],
+ invoiceAmount: [
+ { required: true, message: "璇疯緭鍏ュ彂绁ㄩ噾棰�", trigger: "blur" },
+ ],
+ entryDate: [{ required: true, message: "璇烽�夋嫨寮�绁ㄦ棩鏈�", trigger: "change" }],
+ enterDate: [{ required: true, message: "璇烽�夋嫨褰曞叆鏃ユ湡", trigger: "change" }],
});
const {
- id,
- visible,
- loading: modalLoading,
- openModal,
- modalOptions,
- handleConfirm,
- closeModal,
+ id,
+ visible,
+ loading: modalLoading,
+ openModal,
+ modalOptions,
+ handleConfirm,
+ closeModal,
} = useModal({
- title: "鏉ョエ鐧昏",
+ title: "鏉ョエ鐧昏",
});
const emit = defineEmits(['refreshList']);
const columns = [
- {
- label: "浜у搧澶х被",
- prop: "productCategory",
+ {
+ label: "浜у搧澶х被",
+ prop: "productCategory",
width: 120,
- },
- {
- label: "瑙勬牸鍨嬪彿",
- prop: "specificationModel",
+ },
+ {
+ label: "瑙勬牸鍨嬪彿",
+ prop: "specificationModel",
width: 120,
- },
- {
- label: "鍗曚綅",
- prop: "unit",
- width: 80,
- },
- {
- label: "鏁伴噺",
- prop: "quantity",
- width: 80,
- },
- {
- label: "绋庣巼(%)",
- prop: "taxRate",
- width: 80,
- },
- {
- label: "褰曞叆鏃ユ湡",
- prop: "registerDate",
- width: 120,
- },
- {
- label: "鍚◣鍗曚环(鍏�)",
- prop: "taxInclusiveUnitPrice",
- width: 150,
- formatData: (val) => {
- return val ? parseFloat(val).toFixed(2) : 0;
- },
- },
- {
- label: "鍚◣鎬讳环(鍏�)",
- prop: "taxInclusiveTotalPrice",
- width: 150,
- formatData: (val) => {
- return parseFloat(val).toFixed(2) ?? 0;
- },
- },
- {
- label: "涓嶅惈绋庢�讳环(鍏�)",
- prop: "taxExclusiveTotalPrice",
- width: 150,
- formatData: (val) => {
- return parseFloat(val).toFixed(2) ?? 0;
- },
- },
- {
- label: "鏈鏉ョエ鏁�",
- prop: "ticketsNum",
- dataType: "slot",
- slot: "ticketsNumRef",
- width: 180,
- align: "center",
- },
- {
- label: "鏈鏉ョエ閲戦(鍏�)",
- prop: "ticketsAmount",
- dataType: "slot",
- slot: "ticketsAmountRef",
- width: 180,
- align: "center",
- },
- {
- label: "鏈潵绁ㄦ暟",
- prop: "futureTickets",
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ width: 80,
+ },
+ {
+ label: "鏁伴噺",
+ prop: "quantity",
+ width: 80,
+ },
+ {
+ label: "绋庣巼(%)",
+ prop: "taxRate",
+ width: 80,
+ },
+ {
+ label: "褰曞叆鏃ユ湡",
+ prop: "registerDate",
+ width: 120,
+ },
+ {
+ label: "鍚◣鍗曚环(鍏�)",
+ prop: "taxInclusiveUnitPrice",
+ width: 150,
+ formatData: (val) => {
+ return val ? parseFloat(val).toFixed(2) : 0;
+ },
+ },
+ {
+ label: "鍚◣鎬讳环(鍏�)",
+ prop: "taxInclusiveTotalPrice",
+ width: 150,
+ formatData: (val) => {
+ return parseFloat(val).toFixed(2) ?? 0;
+ },
+ },
+ {
+ label: "涓嶅惈绋庢�讳环(鍏�)",
+ prop: "taxExclusiveTotalPrice",
+ width: 150,
+ formatData: (val) => {
+ return parseFloat(val).toFixed(2) ?? 0;
+ },
+ },
+ {
+ label: "鏈鏉ョエ鏁�",
+ prop: "ticketsNum",
+ dataType: "slot",
+ slot: "ticketsNumRef",
+ width: 180,
+ align: "center",
+ },
+ {
+ label: "鏈鏉ョエ閲戦(鍏�)",
+ prop: "ticketsAmount",
+ dataType: "slot",
+ slot: "ticketsAmountRef",
+ width: 180,
+ align: "center",
+ },
+ {
+ label: "鏈潵绁ㄦ暟",
+ prop: "futureTickets",
width: 100,
- },
- {
- label: "鏈潵绁ㄩ噾棰�(鍏�)",
- prop: "futureTicketsAmount",
+ },
+ {
+ label: "鏈潵绁ㄩ噾棰�(鍏�)",
+ prop: "futureTicketsAmount",
width: 200,
- },
+ },
];
-
-const getTableData = async (type, id) => {
- if (type == "add") {
- const { data } = await getPurchaseNoById({ id });
- form.purchaseLedgerNo = data.purchaseContractNumber;
- form.invoiceAmount = data.invoiceAmount;
- form.invoiceNumber = data.invoiceNumber;
- form.entryDate = data.entryDate;
- form.salesContractNoId = data.salesContractNoId;
-
- const { data: infoData } = await getInfo({ id });
- form.salesContractNo = infoData.salesContractNo;
- form.projectName = infoData.projectName;
- form.supplierName = infoData.supplierName;
- form.productData = infoData.productData;
- } else if (type == "edit") {
- const data = await getPurchaseById({ id, type: 2 });
- form.purchaseLedgerNo = data.purchaseContractNumber;
- form.invoiceAmount = data.invoiceAmount;
- form.invoiceNumber = data.invoiceNumber;
- form.salesContractNo = data.salesContractNo;
- form.projectName = data.projectName;
- form.supplierName = data.supplierName;
- form.entryDate = data.entryDate;
- form.productData = data.productData;
- }
+const formattedNumber = (row, column, cellValue) => {
+ if (cellValue == 0) {
+ return parseFloat(cellValue).toFixed(2);
+ }
+ if (cellValue) {
+ return parseFloat(cellValue).toFixed(2);
+ } else {
+ return cellValue;
+ }
+};
+const getTableData = async (type, selectedRows) => {
+ if (type == "add") {
+ // 妫�鏌ユ墍鏈夐�夋嫨鐨勫悎鍚屾槸鍚﹀叿鏈夌浉鍚岀殑渚涘簲鍟嗗悕绉�
+ const firstRow = selectedRows[0];
+ const isSameSupplier = selectedRows.every(row =>
+ row.supplierName === firstRow.supplierName
+ );
+
+ if (!isSameSupplier) {
+ proxy.$modal.msgError("璇烽�夋嫨鐩稿悓渚涘簲鍟嗗悕绉扮殑鍚堝悓");
+ return;
+ }
+
+ // 鍏佽涓嶅悓鐨勯噰璐悎鍚屽彿鎵归噺澶勭悊锛屾棤闇�妫�鏌ラ噸澶�
+
+ // 娓呯┖琛ㄥ崟鏁版嵁
+ Object.keys(form).forEach(key => {
+ if (key !== 'productData') {
+ form[key] = undefined;
+ }
+ });
+ form.productData = [];
+
+ // 鍔犺浇鎵�鏈夐�変腑鍚堝悓鐨勪骇鍝佹暟鎹�
+ const promises = selectedRows.map(row =>
+ getInfo({ id: row.id })
+ );
+
+ Promise.all(promises).then(results => {
+ // 鍚堝苟鎵�鏈夊悎鍚岀殑浜у搧鏁版嵁锛屽苟涓烘瘡涓骇鍝佹坊鍔犲搴旂殑鍚堝悓淇℃伅
+ const allProductData = [];
+ results.forEach((result, index) => {
+ const contract = selectedRows[index];
+ const contractId = contract.id;
+ if (result.data && result.data.productData) {
+ result.data.productData.forEach(item => {
+ allProductData.push({
+ ...item,
+ id: contractId, // 鏄庣‘璁剧疆鍚堝悓ID
+ purchaseLedgerNo: contract.purchaseContractNumber, // 娣诲姞閲囪喘鍚堝悓鍙�
+ supplierName: contract.supplierName, // 娣诲姞渚涘簲鍟嗗悕绉�
+ projectName: contract.projectName // 娣诲姞椤圭洰鍚嶇О
+ });
+ });
+ }
+ });
+
+ // 璁剧疆琛ㄥ崟鏁版嵁锛堜娇鐢ㄧ涓�涓悎鍚岀殑鍩烘湰淇℃伅锛岄噰璐悎鍚屽彿鐣欑┖锛�
+ form.purchaseLedgerNo = ""; // 閲囪喘鍚堝悓鍙风暀绌猴紝鍥犱负浼氬湪浜у搧琛ㄦ牸涓垎鍒樉绀�
+ form.invoiceAmount = 0;
+ form.invoiceNumber = "";
+ form.entryDate = dayjs().format("YYYY-MM-DD");
+ form.enterDate = dayjs().format("YYYY-MM-DD");
+ form.salesContractNo = results[0].data.salesContractNo;
+ form.projectName = results[0].data.projectName;
+ form.supplierName = results[0].data.supplierName;
+ // 淇濈暀褰曞叆浜轰俊鎭�
+ form.issUerId = userStore.id;
+ form.issUer = userStore.nickName;
+
+ form.productData = allProductData;
+
+ // 瀛樺偍閫変腑鐨勫悎鍚屾暟鎹�
+ selectedContracts.value = selectedRows;
+ });
+ } else if (type == "edit") {
+ const id = Array.isArray(selectedRows) ? selectedRows[0].id : selectedRows;
+ const data = await getPurchaseById({ id, type: 2 });
+ form.purchaseLedgerNo = data.purchaseContractNumber;
+ form.invoiceAmount = data.invoiceAmount;
+ form.invoiceNumber = data.invoiceNumber;
+ form.salesContractNo = data.salesContractNo;
+ form.projectName = data.projectName;
+ form.supplierName = data.supplierName;
+ form.entryDate = data.entryDate;
+ form.productData = data.productData;
+ }
};
// 瀛愯〃鍚堣鏂规硶
const summarizeChildrenTable = (param) => {
@@ -347,109 +452,186 @@
};
//鏈鏉ョエ鏁板け鐒︽搷浣�
const invoiceNumBlur = (row) => {
- if (!row.ticketsNum || row.ticketsNum === "") {
- row.ticketsNum = 0;
- }
- if (Number(row.ticketsNum) > Number(row.tempFutureTickets)) {
- proxy.$modal.msgWarning("鏈寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
- row.ticketsNum = 0;
- return;
- }
- // 璁$畻鏈鏉ョエ閲戦
- row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(2)
- // 璁$畻鏈潵绁ㄦ暟
- row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
- // 璁$畻鏈潵绁ㄩ噾棰�
- row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
- calculateinvoiceAmount();
+ if (!row.ticketsNum || row.ticketsNum === "") {
+ row.ticketsNum = 0;
+ }
+ if (Number(row.ticketsNum) > Number(row.tempFutureTickets)) {
+ proxy.$modal.msgWarning("鏈寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
+ row.ticketsNum = 0;
+ return;
+ }
+ // 璁$畻鏈鏉ョエ閲戦
+ row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(2)
+ // 璁$畻鏈潵绁ㄦ暟
+ row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
+ // 璁$畻鏈潵绁ㄩ噾棰�
+ row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
+ calculateinvoiceAmount();
};
// 鏈鏉ョエ閲戦澶辩劍鎿嶄綔
const invoiceAmountBlur = (row) => {
- if (!row.ticketsAmount) {
- row.ticketsAmount = 0;
- }
- // 璁$畻鏄惁瓒呰繃鏉ョエ鎬婚噾棰�
- if (row.ticketsAmount > row.tempFutureTicketsAmount) {
- proxy.$modal.msgWarning("鏈鏉ョエ閲戦涓嶅緱澶т簬鏈潵绁ㄩ噾棰�");
- row.ticketsAmount = 0;
- }
- // 璁$畻鏈鏉ョエ鏁�
- row.ticketsNum = Number(
- (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2)
- );
- // 璁$畻鏈潵绁ㄦ暟
- row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
- // 璁$畻鏈潵绁ㄩ噾棰�
- row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
- calculateinvoiceAmount();
+ if (!row.ticketsAmount) {
+ row.ticketsAmount = 0;
+ }
+ // 璁$畻鏄惁瓒呰繃鏉ョエ鎬婚噾棰�
+ if (row.ticketsAmount > row.tempFutureTicketsAmount) {
+ proxy.$modal.msgWarning("鏈鏉ョエ閲戦涓嶅緱澶т簬鏈潵绁ㄩ噾棰�");
+ row.ticketsAmount = 0;
+ }
+ // 璁$畻鏈鏉ョエ鏁�
+ row.ticketsNum = Number(
+ (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2)
+ );
+ // 璁$畻鏈潵绁ㄦ暟
+ row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
+ // 璁$畻鏈潵绁ㄩ噾棰�
+ row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
+ calculateinvoiceAmount();
};
const calculateinvoiceAmount = () => {
- let invoiceAmountTotal = 0;
- form.productData.forEach((item) => {
- if (item.ticketsAmount) {
- invoiceAmountTotal += Number(item.ticketsAmount);
- }
- });
- form.invoiceAmount = invoiceAmountTotal.toFixed(2);
+ let invoiceAmountTotal = 0;
+ form.productData.forEach((item) => {
+ if (item.ticketsAmount) {
+ invoiceAmountTotal += Number(item.ticketsAmount);
+ }
+ });
+ form.invoiceAmount = invoiceAmountTotal.toFixed(2);
};
-const open = (type, eid) => {
- openModal();
- getTableData(type, eid);
- id.value = eid;
+const open = async (type, selectedRows) => {
+ visible.value = true;
+
+ // 濡傛灉鏄壒閲忔搷浣滐紝璁剧疆鏍囬
+ if (Array.isArray(selectedRows) && selectedRows.length > 1) {
+ modalOptions.title = `鎵归噺鏂板 (${selectedRows.length}鏉�)`;
+ } else {
+ modalOptions.title = type == "add" ? "鏂板" : "缂栬緫";
+ }
+
+ // 濡傛灉鏄崟涓搷浣滐紝鑾峰彇id
+ if (!Array.isArray(selectedRows) || selectedRows.length === 1) {
+ const idValue = Array.isArray(selectedRows) ? selectedRows[0].id : selectedRows;
+ id.value = idValue;
+ }
+
+ await getTableData(type, selectedRows);
};
const uploadSuccess = (response) => {
- form.tempFileIds.push(response.data.tempId);
- console.log(form);
+ form.tempFileIds.push(response.data.tempId);
+ console.log(form);
};
const removeFile = (file) => {
- const { tempId } = file.response.data;
- form.tempFileIds = form.tempFileIds.filter((item) => item !== tempId);
+ const { tempId } = file.response.data;
+ form.tempFileIds = form.tempFileIds.filter((item) => item !== tempId);
};
const closeAndRefresh = () => {
- closeModal();
- emit('refreshList');
+ closeModal();
+ emit('refreshList');
};
const submitForm = () => {
- formRef.value.validate(async (valid, fields) => {
- if (valid) {
- // modalLoading.value = true;
- const { code } = await addOrUpdateRegistration({
- purchaseLedgerId: id.value,
- purchaseContractNumber: form.purchaseLedgerNo,
- invoiceNumber: form.invoiceNumber,
- invoiceAmount: form.invoiceAmount,
- salesContractNo: form.salesContractNo,
- projectName: form.projectName,
- productData: form.productData,
- issueDate: form.entryDate,
- issUerId: form.issUerId, // 褰曞叆浜篿d
- issUer: form.issUer, // 褰曞叆浜�
- salesContractNoId: form.salesContractNoId,
- supplierName: form.supplierName,
- tempFileIds: form.tempFileIds,
- enterDate: form.enterDate,
- type: 4,
- });
- modalLoading.value = false;
- if (code == 200) {
- closeAndRefresh();
- }
- } else {
- modalLoading.value = false;
- }
- });
+ proxy.$refs["formRef"].validate((valid) => {
+ if (valid) {
+ // 濡傛灉鏄壒閲忔搷浣滐紝灏嗘墍鏈夊悎鍚岀殑鏁版嵁鏀惧湪涓�涓暟缁勯噷锛屽彧璋冪敤涓�娆℃帴鍙�
+ if (selectedContracts.value.length > 1) {
+ // 鍒涘缓鍖呭惈鎵�鏈夊悎鍚屾暟鎹殑鏁扮粍
+ const batchData = selectedContracts.value.map(contract => {
+ // 绛涢�夊嚭灞炰簬褰撳墠鍚堝悓鐨勪骇鍝佹暟鎹�
+ const contractProductData = form.productData.filter(item =>
+ item.id === contract.id
+ );
+
+ // 涓烘瘡涓噰璐悎鍚屽垱寤虹嫭绔嬬殑瀵硅薄
+ return {
+ // 鍩虹琛ㄥ崟鏁版嵁
+ invoiceNumber: form.invoiceNumber,
+ invoiceAmount: form.invoiceAmount,
+ entryDate: form.entryDate,
+ enterDate: form.enterDate,
+ issUerId: form.issUerId, // 褰曞叆浜篿d
+ issUer: form.issUer, // 褰曞叆浜�
+ tempFileIds: form.tempFileIds,
+
+ // 鍚堝悓瀹為檯淇℃伅
+ purchaseLedgerId: contract.id, // 浣跨敤id浣滀负瀛楁鍚嶏紝鍊间负purchaseLedgerId
+ purchaseContractNumber: contract.purchaseContractNumber, // 浣跨敤瀹為檯鐨勯噰璐悎鍚屽彿
+ salesContractNo: contract.salesContractNo, // 浣跨敤瀹為檯鐨勯攢鍞悎鍚屽彿
+ supplierName: contract.supplierName, // 浣跨敤瀹為檯鐨勪緵搴斿晢鍚嶇О
+ projectName: contract.projectName, // 浣跨敤瀹為檯鐨勯」鐩悕绉�
+
+ // 浜у搧鏁版嵁
+ productData: proxy.HaveJson(contractProductData),
+
+ // 鎵归噺鏍囪瘑
+ isBatch: true,
+ type: 4
+ };
+ });
+
+ // 鍙皟鐢ㄤ竴娆℃帴鍙o紝浼犻�掑寘鍚墍鏈夊悎鍚屾暟鎹殑鏁扮粍
+ modalLoading.value = true;
+ addOrUpdateRegistration(batchData).then((res) => {
+ modalLoading.value = false;
+ if (res.code === 200) {
+ proxy.$modal.msgSuccess("鎵归噺鐧昏鎴愬姛");
+ closeAndRefresh();
+ }
+ }).catch(() => {
+ modalLoading.value = false;
+ proxy.$modal.msgError("鎵归噺鐧昏澶辫触");
+ });
+ } else {
+ // 鍗曚釜鍚堝悓鎻愪氦閫昏緫 - 浠ユ暟缁勬牸寮忎紶閫�
+ const singleContract = selectedContracts.value[0];
+ const singleFormArray = [{
+ // 鍩虹琛ㄥ崟鏁版嵁
+ invoiceNumber: form.invoiceNumber,
+ invoiceAmount: form.invoiceAmount,
+ entryDate: form.entryDate,
+ enterDate: form.enterDate,
+ issUerId: form.issUerId, // 褰曞叆浜篿d
+ issUer: form.issUer, // 褰曞叆浜�
+ tempFileIds: form.tempFileIds,
+
+ // 鍚堝悓瀹為檯淇℃伅
+ purchaseLedgerId: singleContract.id, // 浣跨敤id浣滀负瀛楁鍚嶏紝鍊间负purchaseLedgerId
+ purchaseContractNumber: singleContract.purchaseContractNumber, // 浣跨敤瀹為檯鐨勯噰璐悎鍚屽彿
+ salesContractNo: singleContract.salesContractNo, // 浣跨敤瀹為檯鐨勯攢鍞悎鍚屽彿
+ supplierName: singleContract.supplierName, // 浣跨敤瀹為檯鐨勪緵搴斿晢鍚嶇О
+ projectName: singleContract.projectName, // 浣跨敤瀹為檯鐨勯」鐩悕绉�
+
+ // 浜у搧鏁版嵁
+ productData: proxy.HaveJson(form.productData),
+
+ // 鎵归噺鏍囪瘑
+ isBatch: false,
+ type: 4
+ }];
+
+ modalLoading.value = true;
+ addOrUpdateRegistration(singleFormArray).then((res) => {
+ modalLoading.value = false;
+ if (res.code === 200) {
+ proxy.$modal.msgSuccess("鐧昏鎴愬姛");
+ closeAndRefresh();
+ }
+ }).catch(() => {
+ modalLoading.value = false;
+ proxy.$modal.msgError("鐧昏澶辫触");
+ });
+ }
+ }
+ });
};
defineExpose({
- open,
- closeAndRefresh,
+ open,
+ closeAndRefresh,
});
</script>
diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue
index 87e08e9..2797edb 100644
--- a/src/views/procurementManagement/invoiceEntry/index.vue
+++ b/src/views/procurementManagement/invoiceEntry/index.vue
@@ -28,13 +28,6 @@
clearable
/>
</el-form-item>
- <el-form-item label="椤圭洰鍚嶇О">
- <el-input
- v-model="filters.projectName"
- placeholder="璇疯緭鍏ラ」鐩悕绉�"
- clearable
- />
- </el-form-item>
<el-form-item>
<el-button type="primary" @click="getTableData"> 鎼滅储 </el-button>
<el-button @click="resetFilters"> 閲嶇疆 </el-button>
@@ -143,11 +136,6 @@
width:300
},
{
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width:400
- },
- {
label: "褰曞叆浜�",
prop: "recorderName",
},
@@ -198,11 +186,11 @@
};
const handleAdd = (type) => {
- if (selectedRows.value.length !== 1) {
- proxy.$modal.msgWarning("璇峰厛閫変腑涓�鏉℃暟鎹�");
- return;
- }
- modalRef.value.open(type, selectedRows.value[0].id);
+ if (selectedRows.value.length < 1) {
+ proxy.$modal.msgWarning("璇疯嚦灏戦�変腑涓�鏉℃暟鎹�");
+ return;
+ }
+ modalRef.value.open(type, selectedRows.value);
};
const handleEdit = (type, id) => {
diff --git a/src/views/procurementManagement/paymentEntry/index.vue b/src/views/procurementManagement/paymentEntry/index.vue
index 4da6ac9..e04da41 100644
--- a/src/views/procurementManagement/paymentEntry/index.vue
+++ b/src/views/procurementManagement/paymentEntry/index.vue
@@ -104,7 +104,6 @@
size="small"
@click="changeEditType(scope.row)"
v-if="!scope.row.editType"
- :disabled="scope.row.registrant !== userStore.nickName"
>缂栬緫</el-button
>
<el-button
@@ -113,7 +112,6 @@
size="small"
@click="saveReceiptPayment(scope.row)"
v-if="scope.row.editType"
- :disabled="scope.row.registrant !== userStore.nickName"
>淇濆瓨</el-button
>
<el-button
@@ -121,7 +119,6 @@
type="primary"
size="small"
@click="handleDelete(scope.row)"
- :disabled="scope.row.registrant !== userStore.nickName"
>鍒犻櫎</el-button
>
</template>
@@ -243,7 +240,6 @@
v-model="form.registrant"
placeholder="璇疯緭鍏�"
clearable
- disabled
/>
</el-form-item>
</el-col>
diff --git a/src/views/procurementManagement/paymentHistory/index.vue b/src/views/procurementManagement/paymentHistory/index.vue
index c38b4b0..4d23b9c 100644
--- a/src/views/procurementManagement/paymentHistory/index.vue
+++ b/src/views/procurementManagement/paymentHistory/index.vue
@@ -118,9 +118,10 @@
const { form: searchForm } = useFormData({
searchText: undefined,
purchaseContractNumber: undefined,
- paymentDate: [],
- paymentDateStart: undefined,
- paymentDateEnd: undefined,
+ // 璁剧疆浠樻鏃ユ湡鑼冨洿涓哄綋澶�
+ paymentDate: [dayjs().startOf('day').format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')],
+ paymentDateStart: dayjs().startOf('day').format('YYYY-MM-DD'),
+ paymentDateEnd: dayjs().endOf('day').format('YYYY-MM-DD'),
});
// 鏌ヨ鍒楄〃
@@ -137,7 +138,8 @@
const getList = () => {
tableLoading.value = true;
const { paymentDate, ...rest } = searchForm;
- paymentHistoryListPage({ ...rest, ...page }).then((res) => {
+ const { total, ...pageParams } = page;
+ paymentHistoryListPage({ ...rest, ...pageParams }).then((res) => {
tableLoading.value = false;
tableData.value = res.records;
page.total = res.total;
diff --git a/src/views/procurementManagement/paymentLedger/index.vue b/src/views/procurementManagement/paymentLedger/index.vue
index 14bcaf4..741e6ac 100644
--- a/src/views/procurementManagement/paymentLedger/index.vue
+++ b/src/views/procurementManagement/paymentLedger/index.vue
@@ -86,8 +86,7 @@
:tableLoading="tableLoadingSon"
:isShowSummary="isShowSummarySon"
:summaryMethod="summarizeMainTable1"
- :isShowPage="false"
- height="calc(100vh - 18.5em)"
+ height="calc(100vh - 18.5em)"
>
<template #payableAmountSlot="{ row }">
<el-text type="danger">
@@ -95,14 +94,14 @@
</el-text>
</template>
</PIMTable>
-<!-- <pagination-->
-<!-- v-show="sonTotal > 0"-->
-<!-- :total="sonTotal"-->
-<!-- @pagination="sonPaginationSearch"-->
-<!-- :layout="page.layout"-->
-<!-- :page="sonPage.current"-->
-<!-- :limit="sonPage.size"-->
-<!-- />-->
+ <pagination
+ v-show="sonTotal > 0"
+ :total="sonTotal"
+ @pagination="sonPaginationSearch"
+ :layout="page.layout"
+ :page="sonPage.current"
+ :limit="sonPage.size"
+ />
</div>
</el-col>
</el-row>
@@ -246,6 +245,8 @@
paymentLedgerList({
...searchForm.value,
...page,
+ detailPageNum: detailPageNum.value, // 鏂板
+ detailPageSize: detailPageSize.value, // 鏂板
}).then((res) => {
let result = res.data;
tableLoading.value = false;
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue b/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
index 6290804..e26d73c 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
@@ -1,48 +1,48 @@
<template>
- <el-form :model="form">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="閲囪喘鍚堝悓鍙凤細">
- <el-tag size="large">{{ form.purchaseContractNumber }}</el-tag>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="閿�鍞悎鍚屽彿锛�">
- <el-text>{{ form.salesContractNo }}</el-text>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍚◣鍗曚环(鍏�)锛�">
- <el-text type="primary">{{ form.taxInclusiveUnitPrice }}</el-text>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍒涘缓鏃堕棿锛�">
- <el-text>{{ form.createdAt }}</el-text>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍙戠エ鍙凤細">
- <el-input v-model="form.invoiceNumber" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鏉ョエ鏁帮細">
- <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsNum" @change="inputTicketsNum" :precision="2"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鏈鏉ョエ閲戦(鍏�)锛�">
+ <el-form :model="form">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="閲囪喘鍚堝悓鍙凤細">
+ <el-tag size="large">{{ form.purchaseContractNumber }}</el-tag>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="閿�鍞悎鍚屽彿锛�">
+ <el-text>{{ form.salesContractNo }}</el-text>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍚◣鍗曚环(鍏�)锛�">
+ <el-text type="primary">{{ form.taxInclusiveUnitPrice }}</el-text>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍒涘缓鏃堕棿锛�">
+ <el-text>{{ form.createdAt }}</el-text>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍙戠エ鍙凤細">
+ <el-input v-model="form.invoiceNumber" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏉ョエ鏁帮細">
+ <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsNum" @change="inputTicketsNum" :precision="2"/>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏈鏉ョエ閲戦(鍏�)锛�">
<el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsAmount" @change="inputTicketsAmount" :precision="2"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鏈潵绁ㄦ暟锛�">
- <el-text type="success">{{ form.futureTickets }}</el-text>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏈潵绁ㄦ暟锛�">
+ <el-text type="success">{{ form.futureTickets }}</el-text>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
</template>
<script setup>
@@ -51,43 +51,36 @@
const { proxy } = getCurrentInstance()
defineOptions({
- name: "鏉ョエ鍙拌处琛ㄥ崟",
+ name: "鏉ョエ鍙拌处琛ㄥ崟",
});
-const temFutureTickets = ref(0) // 鍒濆鏈潵绁ㄦ暟
-const initialTicketsNum = ref(0) // 鍒濆鏉ョエ鏁�
-const initialTicketsAmount = ref(0) // 鍒濆鏉ョエ閲戦
-const quantity = ref(0) // 鎬绘暟閲�
+const temFutureTickets = ref(0)
const { form, resetForm } = useFormData({
- id: undefined,
- purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
- salesContractNo: undefined, // 閿�鍞悎鍚屽彿
- createdAt: undefined, // 鍒涘缓鏃堕棿
- invoiceNumber: undefined, // 鍙戠エ鍙�
- ticketsNum: undefined, // 鏉ョエ鏁�
- ticketsAmount: undefined, // 鏉ョエ閲戦
+ id: undefined,
+ purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
+ salesContractNo: undefined, // 閿�鍞悎鍚屽彿
+ createdAt: undefined, // 鍒涘缓鏃堕棿
+ invoiceNumber: undefined, // 鍙戠エ鍙�
+ ticketsNum: undefined, // 鏉ョエ鏁�
+ ticketsAmount: undefined, // 鏉ョエ閲戦
taxInclusiveUnitPrice: undefined, // 鍚◣鍗曚环
ticketRegistrationId: undefined, // 鍚◣鍗曚环
});
const load = async (id) => {
- const { code, data } = await getProductRecordById({ id });
- if (code === 200) {
- form.id = data.id;
- form.purchaseContractNumber = data.purchaseContractNumber;
- form.salesContractNo = data.salesContractNo;
- form.createdAt = data.createdAt;
- form.invoiceNumber = data.invoiceNumber;
- form.ticketsNum = data.ticketsNum;
- form.ticketsAmount = data.ticketsAmount ? Number(data.ticketsAmount).toFixed(2) : 0;
- form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice;
- form.futureTickets = data.futureTickets;
- temFutureTickets.value = data.futureTickets;
- initialTicketsNum.value = data.ticketsNum || 0;
- initialTicketsAmount.value = data.ticketsAmount || 0;
+ const { code, data } = await getProductRecordById({ id });
+ if (code === 200) {
+ form.id = data.id;
+ form.purchaseContractNumber = data.purchaseContractNumber;
+ form.salesContractNo = data.salesContractNo;
+ form.createdAt = data.createdAt;
+ form.invoiceNumber = data.invoiceNumber;
+ form.ticketsNum = data.ticketsNum;
+ form.ticketsAmount = data.ticketsAmount.toFixed(2);
+ form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice;
+ form.futureTickets = data.futureTickets;
+ temFutureTickets.value = data.futureTickets;
form.ticketRegistrationId = data.ticketRegistrationId;
- // 鑾峰彇鎬绘暟閲忥紝濡傛灉鏁版嵁涓湁 quantity 瀛楁鍒欎娇鐢紝鍚﹀垯浣跨敤鏉ョエ鏁�+鏈潵绁ㄦ暟
- quantity.value = data.quantity || (Number(data.ticketsNum || 0) + Number(data.futureTickets || 0));
- }
+ }
};
const inputTicketsNum = (val) => {
@@ -96,44 +89,15 @@
proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
return;
}
-
- const newTicketsNum = Number(form.ticketsNum) || 0;
- const currentTicketsNum = Number(initialTicketsNum.value) || 0;
-
- // 璁$畻鏂板鐨勬潵绁ㄦ暟
- const addedTicketsNum = newTicketsNum - currentTicketsNum;
-
- // 璁$畻鏂扮殑鏈潵绁ㄦ暟 = 鍒濆鏈潵绁ㄦ暟 - 鏂板鐨勬潵绁ㄦ暟
- const newFutureTickets = Number(temFutureTickets.value) - addedTicketsNum;
-
- // 楠岃瘉锛氭柊鐨勬潵绁ㄦ暟 + 鏂扮殑鏈潵绁ㄦ暟 鈮� quantity
- if (newTicketsNum + newFutureTickets > Number(quantity.value)) {
- proxy.$modal.msgWarning(`鏉ョエ鏁�+鏈潵绁ㄦ暟涓嶈兘澶т簬鎬绘暟閲�(${quantity.value})`);
- // 闄愬埗鏉ョエ鏁帮紝浣垮叾婊¤冻锛氭潵绁ㄦ暟 + 鏈潵绁ㄦ暟 鈮� quantity
- // 鏈�澶ф潵绁ㄦ暟 = quantity - 鍒濆鏈潵绁ㄦ暟 + 鍒濆鏉ョエ鏁�
- const maxTicketsNum = Number(quantity.value) - Number(temFutureTickets.value) + Number(initialTicketsNum.value);
- form.ticketsNum = Math.max(0, Math.min(maxTicketsNum, newTicketsNum));
- // 閲嶆柊璁$畻
- const recalculatedAddedTicketsNum = Number(form.ticketsNum) - Number(initialTicketsNum.value);
- const recalculatedFutureTickets = Number(temFutureTickets.value) - recalculatedAddedTicketsNum;
- form.futureTickets = Number(recalculatedFutureTickets.toFixed(2));
- const ticketsAmount = Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice);
- form.ticketsAmount = Number(ticketsAmount.toFixed(2));
- return;
- }
-
- // 妫�鏌ユ柊澧炵殑鏉ョエ鏁版槸鍚﹀ぇ浜庡垵濮嬫湭鏉ョエ鏁�
- if (addedTicketsNum > Number(temFutureTickets.value)) {
- proxy.$modal.msgWarning("鏂板寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
- form.ticketsNum = Number(initialTicketsNum.value) + Number(temFutureTickets.value);
+ if (Number(form.ticketsNum) > Number(temFutureTickets.value)) {
+ proxy.$modal.msgWarning("寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
+ form.ticketsNum = temFutureTickets.value
}
// 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
- const finalTicketsNum = Number(form.ticketsNum) || 0;
- const finalAddedTicketsNum = finalTicketsNum - Number(initialTicketsNum.value);
- const finalFutureTickets = Number(temFutureTickets.value) - finalAddedTicketsNum;
- const ticketsAmount = finalTicketsNum * Number(form.taxInclusiveUnitPrice);
- form.futureTickets = Number(finalFutureTickets.toFixed(2));
+ const ticketsAmount = Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice);
+ const futureTickets = Number(temFutureTickets.value) - Number(form.ticketsNum);
+ form.futureTickets = Number(futureTickets.toFixed(2));
form.ticketsAmount = Number(ticketsAmount.toFixed(2));
};
const inputTicketsAmount = (val) => {
@@ -143,53 +107,23 @@
return;
}
- const newTicketsAmount = Number(val) || 0;
-
- // 璁$畻鏂扮殑鏉ョエ鏁�
- const newTicketsNum = newTicketsAmount / Number(form.taxInclusiveUnitPrice);
- const currentTicketsNum = Number(initialTicketsNum.value) || 0;
-
- // 璁$畻鏂板鐨勬潵绁ㄦ暟
- const addedTicketsNum = newTicketsNum - currentTicketsNum;
-
- // 璁$畻鏂扮殑鏈潵绁ㄦ暟 = 鍒濆鏈潵绁ㄦ暟 - 鏂板鐨勬潵绁ㄦ暟
- const newFutureTickets = Number(temFutureTickets.value) - addedTicketsNum;
-
- // 楠岃瘉锛氭柊鐨勬潵绁ㄦ暟 + 鏂扮殑鏈潵绁ㄦ暟 鈮� quantity
- if (newTicketsNum + newFutureTickets > Number(quantity.value)) {
- proxy.$modal.msgWarning(`鏉ョエ鏁�+鏈潵绁ㄦ暟涓嶈兘澶т簬鎬绘暟閲�(${quantity.value})`);
- // 闄愬埗鏉ョエ鏁帮紝浣垮叾婊¤冻锛氭潵绁ㄦ暟 + 鏈潵绁ㄦ暟 鈮� quantity
- const maxTicketsNum = Number(quantity.value) - Number(temFutureTickets.value) + Number(initialTicketsNum.value);
- form.ticketsNum = Math.max(0, Math.min(maxTicketsNum, newTicketsNum));
- form.ticketsAmount = Number((form.ticketsNum * Number(form.taxInclusiveUnitPrice)).toFixed(2));
- const recalculatedAddedTicketsNum = Number(form.ticketsNum) - Number(initialTicketsNum.value);
- const recalculatedFutureTickets = Number(temFutureTickets.value) - recalculatedAddedTicketsNum;
- form.futureTickets = Number(recalculatedFutureTickets.toFixed(2));
- return;
- }
-
- // 妫�鏌ユ柊澧炵殑鏉ョエ閲戦鏄惁澶т簬鍒濆鏈潵绁ㄦ暟瀵瑰簲鐨勯噾棰�
- const maxAddedAmount = Number(temFutureTickets.value * form.taxInclusiveUnitPrice);
- if (addedTicketsNum > 0 && addedTicketsNum * Number(form.taxInclusiveUnitPrice) > maxAddedAmount) {
- proxy.$modal.msgWarning("鏂板鏉ョエ閲戦涓嶅緱澶т簬鏈紑绁ㄩ噾棰�");
- form.ticketsAmount = Number((initialTicketsAmount.value + maxAddedAmount).toFixed(2));
- form.ticketsNum = Number((currentTicketsNum + Number(temFutureTickets.value)).toFixed(2));
- form.futureTickets = 0;
+ if (Number(val) > Number(form.futureTickets*form.taxInclusiveUnitPrice)) {
+ proxy.$modal.msgWarning("鏈鏉ョエ閲戦涓嶅緱澶т簬鎬婚噾棰�");
+ form.ticketsAmount = (form.futureTickets*form.taxInclusiveUnitPrice).toFixed(2)
+ const ticketsNum = Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice);
+ form.ticketsNum = Number(ticketsNum.toFixed(2))
return;
}
// 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
- const finalTicketsNum = Number(newTicketsNum.toFixed(2));
- const finalAddedTicketsNum = finalTicketsNum - Number(initialTicketsNum.value);
- const finalFutureTickets = Number(temFutureTickets.value) - finalAddedTicketsNum;
- form.ticketsNum = finalTicketsNum;
- form.futureTickets = Number(finalFutureTickets.toFixed(2));
+ const ticketsNum = Number(val) / Number(form.taxInclusiveUnitPrice);
+ form.ticketsNum = Number(ticketsNum.toFixed(2));
};
defineExpose({
- load,
- form,
- resetForm,
+ load,
+ form,
+ resetForm,
});
</script>
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/fileList.vue b/src/views/procurementManagement/procurementInvoiceLedger/fileList.vue
new file mode 100644
index 0000000..88aa8f5
--- /dev/null
+++ b/src/views/procurementManagement/procurementInvoiceLedger/fileList.vue
@@ -0,0 +1,91 @@
+<template>
+ <el-dialog v-model="dialogVisible" title="闄勪欢" width="50%" :before-close="handleClose">
+ <el-table :data="tableData" border height="40vh">
+ <el-table-column label="闄勪欢鍚嶇О" prop="name" min-width="400" show-overflow-tooltip />
+ <el-table-column fixed="right" label="鎿嶄綔" width="200" align="center">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">涓嬭浇</el-button>
+ <el-button link type="primary" size="small" @click="lookFile(scope.row)">棰勮</el-button>
+ <el-button link type="danger" size="small" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+ <filePreview ref="filePreviewRef" />
+ <UploadModal ref="uploadModalRef" @uploadSuccess="handleUploadSuccess" />
+</template>
+
+<script setup>
+import { ref } from 'vue'
+import { ElMessageBox, ElMessage } from 'element-plus'
+import filePreview from '@/components/filePreview/index.vue'
+import UploadModal from './Modal/UploadModal.vue'
+import { delCommonFileInvoiceLedger} from '@/api/publicApi/commonFile.js'
+
+const dialogVisible = ref(false)
+const tableData = ref([])
+const currentId = ref('')
+const { proxy } = getCurrentInstance();
+const filePreviewRef = ref()
+const uploadModalRef = ref()
+
+const handleClose = () => {
+ dialogVisible.value = false
+}
+
+const open = (list, id = '') => {
+ dialogVisible.value = true
+ tableData.value = list
+ currentId.value = id
+}
+
+const handleUpload = () => {
+ if (!currentId.value) {
+ ElMessage.warning('鏃犳硶鑾峰彇褰撳墠璁板綍ID锛岃鍏抽棴鍚庨噸鏂版墦寮�闄勪欢绐楀彛')
+ return
+ }
+ uploadModalRef.value.handleImport(currentId.value)
+}
+
+const handleUploadSuccess = (data) => {
+ ElMessage.success('涓婁紶鎴愬姛')
+ // 杩欓噷鍙互娣诲姞鍒锋柊闄勪欢鍒楄〃鐨勯�昏緫
+ // 鏆傛椂鍏堝叧闂笂浼犳ā鎬佹
+}
+
+const downLoadFile = (row) => {
+ proxy.$download.name(row.url);
+}
+
+const lookFile = (row) => {
+ filePreviewRef.value.open(row.url)
+}
+
+// 鍒犻櫎闄勪欢
+const handleDelete = (row) => {
+ ElMessageBox.confirm(`纭鍒犻櫎闄勪欢"${row.name}"鍚楋紵`, '鍒犻櫎纭', {
+ confirmButtonText: '纭',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ delCommonFileInvoiceLedger([row.id]).then(() => {
+ ElMessage.success('鍒犻櫎鎴愬姛')
+ // 浠庡垪琛ㄤ腑绉婚櫎宸插垹闄ょ殑闄勪欢
+ const index = tableData.value.findIndex(item => item.id === row.id)
+ if (index !== -1) {
+ tableData.value.splice(index, 1)
+ }
+ }).catch(() => {
+ ElMessage.error('鍒犻櫎澶辫触')
+ })
+ }).catch(() => {
+ proxy.$modal.msg('宸插彇娑堝垹闄�')
+ })
+}
+
+defineExpose({
+ open
+})
+</script>
+
+<style></style>
\ No newline at end of file
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index 439837b..5c01e3a 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -63,13 +63,6 @@
<el-button link :icon="Files" type="danger"> 闄勪欢 </el-button>
<template #dropdown>
<el-dropdown-menu>
- <el-dropdown-item
- v-if="row.commonFiles.length !== 0"
- :icon="Download"
- command="download"
- >
- 涓嬭浇
- </el-dropdown-item>
<el-dropdown-item :icon="Upload" command="upload">
涓婁紶
</el-dropdown-item>
@@ -80,16 +73,15 @@
<template #operation="{ row }">
<el-button
type="primary"
- text
+ link
@click="openEdit(row)"
- :disabled="row.issUerId !== userStore.id"
>
缂栬緫
</el-button>
+ <el-button link type="primary" size="small" @click="downLoadFile(row)">闄勪欢</el-button>
<el-button
type="primary"
- text
- :disabled="row.issUerId !== userStore.id"
+ link
@click="handleDelete(row)"
>
鍒犻櫎
@@ -97,6 +89,7 @@
</template>
</PIMTable>
</div>
+ <FileList ref="fileListRef" />
<UploadModal ref="modalRef" @uploadSuccess="uploadSuccess"></UploadModal>
<EditModal ref="editmodalRef" @success="getTableData"></EditModal>
</div>
@@ -111,19 +104,21 @@
Search,
Upload,
EditPen,
+ Delete,
} from "@element-plus/icons-vue";
import {
delRegistration,
productRecordPage,
productUploadFile,
} from "@/api/procurementManagement/procurementInvoiceLedger.js";
+import { delCommonFile } from "@/api/publicApi/commonFile.js";
import { onMounted } from "vue";
-import { ElMessageBox } from "element-plus";
+import { ElMessageBox, ElMessage } from "element-plus";
import UploadModal from "./Modal/UploadModal.vue";
import EditModal from "./Modal/EditModal.vue";
import useUserStore from "@/store/modules/user.js";
-import {delInvoiceLedgerByRegProductId} from "@/api/salesManagement/invoiceLedger.js";
-const userStore = useUserStore();
+import dayjs from "dayjs";
+import FileList from "./fileList.vue";
defineOptions({
name: "鏉ョエ鍙拌处",
@@ -148,7 +143,8 @@
{
purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
supplierName: undefined, // 渚涘簲鍟�
- createdAt: [], // 鏉ョエ鏃ユ湡
+ // 璁剧疆鏉ョエ鏃ユ湡鑼冨洿涓哄綋澶�
+ createdAt: [dayjs().startOf('day').format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')], // 鏉ョエ鏃ユ湡
},
[
{
@@ -160,11 +156,6 @@
label: "閿�鍞悎鍚屽彿",
prop: "salesContractNo",
width: 150,
- },
- {
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width: 240,
},
{
label: "渚涘簲鍟嗗悕绉�",
@@ -231,7 +222,7 @@
},
{
fixed: "right",
- width: 150,
+ width: 190,
label: "鎿嶄綔",
dataType: "slot",
slot: "operation",
@@ -267,7 +258,12 @@
const handleSelectionChange = (val) => {
multipleVal.value = val;
};
-
+//闄勪欢鐩稿叧
+const fileListRef = ref(null)
+//鏌ョ湅闄勪欢
+const downLoadFile = (row) => {
+ fileListRef.value.open(row.commonFiles, row.id)
+}
// 瀵煎嚭
const handleOut = () => {
ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
@@ -304,6 +300,29 @@
console.log(row.commonFiles);
openUoload(row.ticketRegistrationId);
break;
+ case "delete":
+ // 鍒犻櫎鎵�鏈夐檮浠�
+ if (row.commonFiles.length > 0) {
+ ElMessageBox.confirm(`纭鍒犻櫎璇ヨ褰曠殑鎵�鏈夐檮浠跺悧锛焋, '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ // 鑾峰彇鎵�鏈夐檮浠剁殑ID
+ const fileIds = row.commonFiles.map(file => file.id);
+
+ delCommonFile(fileIds).then(() => {
+ ElMessage.success('鍒犻櫎鎴愬姛')
+ // 鍒锋柊鏁版嵁
+ getTableData();
+ }).catch(() => {
+ ElMessage.error('鍒犻櫎澶辫触')
+ })
+ }).catch(() => {
+ ElMessage.info('宸插彇娑堝垹闄�')
+ })
+ }
+ break;
}
};
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 36ff34b..abdc474 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -21,10 +21,6 @@
<el-input v-model="searchForm.salesContractNo" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
@change="handleQuery" />
</el-form-item>
- <el-form-item label="椤圭洰鍚嶇О锛�">
- <el-input v-model="searchForm.projectName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
- @change="handleQuery" />
- </el-form-item>
<el-form-item label="褰曞叆鏃ユ湡锛�">
<el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
@@ -39,7 +35,7 @@
<div class="table_list">
<div style="display: flex;justify-content: flex-end;margin-bottom: 20px;">
<el-button type="primary" @click="openForm('add')">鏂板鍙拌处</el-button>
- <!-- <el-button type="success" @click="openScanAddDialog">鎵爜鏂板</el-button> -->
+ <el-button type="success" @click="openScanAddDialog">鎵爜鏂板</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
</div>
@@ -110,12 +106,12 @@
prop="supplierName"
show-overflow-tooltip
/>
- <el-table-column
- label="椤圭洰鍚嶇О"
- prop="projectName"
- width="420"
- show-overflow-tooltip
- />
+ <el-table-column
+ label="绛捐鏃ユ湡"
+ prop="executionDate"
+ width="100"
+ show-overflow-tooltip
+ />
<el-table-column
label="浠樻鏂瑰紡"
width="100"
@@ -132,7 +128,7 @@
<el-table-column
label="褰曞叆浜�"
prop="recorderName"
- width="100"
+ width="120"
show-overflow-tooltip
/>
<el-table-column
@@ -144,7 +140,7 @@
<el-table-column
fixed="right"
label="鎿嶄綔"
- min-width="100"
+ width="180"
align="center"
>
<template #default="scope">
@@ -154,6 +150,13 @@
size="small"
@click="openForm('edit', scope.row)"
>缂栬緫</el-button
+ >
+ <el-button
+ link
+ type="success"
+ size="small"
+ @click="showQRCode(scope.row)"
+ >鐢熸垚浜岀淮鐮�</el-button
>
<el-button
link
@@ -205,7 +208,6 @@
placeholder="璇烽�夋嫨"
filterable
clearable
- @change="salesLedgerChange"
>
<el-option
v-for="item in salesContractList"
@@ -235,17 +237,6 @@
</el-select>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
- <el-input
- v-model="form.projectName"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
<el-col :span="12">
<el-form-item label="浠樻鏂瑰紡">
<el-input
@@ -255,6 +246,8 @@
/>
</el-form-item>
</el-col>
+ </el-row>
+ <el-row :gutter="30">
<el-col :span="12">
<el-form-item label="绛捐鏃ユ湡锛�" prop="executionDate">
<el-date-picker
@@ -276,8 +269,9 @@
v-model="form.recorderId"
placeholder="璇烽�夋嫨"
clearable
- disabled
- filterable
+ filterable
+ default-first-option
+ :reserve-keyword="false"
>
<el-option
v-for="item in userList"
@@ -637,15 +631,6 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
- <el-input
- v-model="scanAddForm.projectName"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
<el-form-item label="鍚堝悓閲戦(鍏�)锛�" prop="contractAmount">
<el-input-number
v-model="scanAddForm.contractAmount"
@@ -723,11 +708,6 @@
</el-col>
</el-row>
<el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О锛�">
- <el-input v-model="scanForm.projectName" disabled />
- </el-form-item>
- </el-col>
<el-col :span="12">
<el-form-item label="鎵爜鏃堕棿锛�">
<el-input v-model="scanForm.scanTime" disabled />
@@ -853,7 +833,6 @@
supplierName: "", // 渚涘簲鍟嗗悕绉�
purchaseContractNumber: "", // 閲囪喘鍚堝悓缂栧彿
salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
- projectName: "", // 椤圭洰鍚嶇О
entryDate: null, // 褰曞叆鏃ユ湡
entryDateStart: undefined,
entryDateEnd: undefined,
@@ -861,7 +840,6 @@
form: {
purchaseContractNumber: "",
salesLedgerId: "",
- projectName: "",
recorderId: "",
entryDate: "",
productData: [],
@@ -874,14 +852,19 @@
purchaseContractNumber: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
- projectName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
supplierId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
entryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
executionDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
},
});
const { form, rules } = toRefs(data);
-const { form: searchForm } = useFormData(data.searchForm);
+const { form: searchForm } = useFormData({
+ ...data.searchForm,
+ // 璁剧疆褰曞叆鏃ユ湡鑼冨洿涓哄綋澶�
+ entryDate: [dayjs().startOf('day').format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')],
+ entryDateStart: dayjs().startOf('day').format('YYYY-MM-DD'),
+ entryDateEnd: dayjs().endOf('day').format('YYYY-MM-DD')
+});
// 浜у搧琛ㄥ崟寮规鏁版嵁
const productFormVisible = ref(false);
@@ -912,7 +895,7 @@
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- warnNum: [{ required: false, message: "璇烽�夋嫨", trigger: "change" }],
+ warnNum: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
taxInclusiveTotalPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
@@ -1123,6 +1106,12 @@
}
form.value.tempFileIds = tempFileIds;
form.value.type = 2;
+
+ // 濡傛灉salesLedgerId涓虹┖锛屽垯涓嶄紶閫抯alesContractNo
+ if (!form.value.salesLedgerId) {
+ form.value.salesContractNo = ''
+ }
+
addOrEditPurchase(form.value).then((res) => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
@@ -1156,7 +1145,6 @@
const getModels = (value) => {
if (value) {
productForm.value.productCategory = findNodeById(productOptions.value, value) || "";
- productForm.value.productId = value;
modelList({ id: value }).then((res) => {
modelOptions.value = res;
});
@@ -1240,13 +1228,6 @@
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
return;
}
- // 淇濊瘉鑷冲皯淇濈暀涓�鏉′骇鍝佷俊鎭�
- const remainingCount =
- productData.value.length - productSelectedRows.value.length;
- if (remainingCount < 1) {
- proxy.$modal.msgWarning("鑷冲皯淇濈暀涓�鏉′骇鍝佷俊鎭紝鏃犳硶鍏ㄩ儴鍒犻櫎");
- return;
- }
if (operationType.value === "add") {
productSelectedRows.value.forEach((selectedRow) => {
const index = productData.value.findIndex(
@@ -1270,7 +1251,7 @@
delProduct(ids).then((res) => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
closeProductDia();
- getPurchaseById({ id: currentId.value, type: 2 }).then(
+ getSalesLedgerWithProducts({ id: currentId.value, type: 2 }).then(
(res) => {
productData.value = res.productData;
}
@@ -1408,7 +1389,6 @@
var index = salesContractList.value.findIndex((item) => item.id == row);
console.log("index", index);
if (index > -1) {
- form.value.projectName = salesContractList.value[index].projectName;
await querygProductInfoByContractNo();
}
};
@@ -1474,7 +1454,6 @@
scanContent: "",
purchaseContractNumber: "",
supplierName: "",
- projectName: "",
contractAmount: "",
paymentMethod: "",
recorderName: "",
@@ -1483,7 +1462,6 @@
const scanAddRules = {
purchaseContractNumber: [{ required: true, message: "璇疯緭鍏ラ噰璐悎鍚屽彿", trigger: "blur" }],
supplierName: [{ required: true, message: "璇疯緭鍏ヤ緵搴斿晢鍚嶇О", trigger: "blur" }],
- projectName: [{ required: true, message: "璇疯緭鍏ラ」鐩悕绉�", trigger: "blur" }],
};
// 鎵爜鐧昏瀵硅瘽妗嗙浉鍏冲彉閲�
@@ -1491,7 +1469,6 @@
const scanForm = reactive({
purchaseContractNumber: "",
supplierName: "",
- projectName: "",
scanTime: "",
scannerName: "",
scanStatus: "鏈壂鐮�",
@@ -1507,7 +1484,6 @@
scanAddForm.scanContent = "";
scanAddForm.purchaseContractNumber = "";
scanAddForm.supplierName = "";
- scanAddForm.projectName = "";
scanAddForm.contractAmount = "";
scanAddForm.paymentMethod = "";
scanAddForm.recorderName = userStore.nickName;
@@ -1520,14 +1496,13 @@
if (!content) return;
// 妯℃嫙瑙f瀽浜岀淮鐮佸唴瀹癸紝杩欓噷鍙互鏍规嵁瀹為檯闇�姹傝皟鏁磋В鏋愰�昏緫
- // 鍋囪鎵爜鍐呭鏍煎紡涓猴細鍚堝悓鍙穦渚涘簲鍟唡椤圭洰|閲戦|浠樻鏂瑰紡
+ // 鍋囪鎵爜鍐呭鏍煎紡涓猴細鍚堝悓鍙穦渚涘簲鍟唡閲戦|浠樻鏂瑰紡
const parts = content.split('|');
- if (parts.length >= 3) {
+ if (parts.length >= 2) {
scanAddForm.purchaseContractNumber = parts[0] || "";
scanAddForm.supplierName = parts[1] || "";
- scanAddForm.projectName = parts[2] || "";
- scanAddForm.contractAmount = parts[3] || "";
- scanAddForm.paymentMethod = parts[4] || "";
+ scanAddForm.contractAmount = parts[2] || "";
+ scanAddForm.paymentMethod = parts[3] || "";
}
};
@@ -1545,7 +1520,6 @@
const newData = {
purchaseContractNumber: scanAddForm.purchaseContractNumber,
supplierName: scanAddForm.supplierName,
- projectName: scanAddForm.projectName,
contractAmount: scanAddForm.contractAmount,
paymentMethod: scanAddForm.paymentMethod,
recorderName: scanAddForm.recorderName,
@@ -1568,7 +1542,6 @@
const openScanDialog = (row) => {
scanForm.purchaseContractNumber = row.purchaseContractNumber;
scanForm.supplierName = row.supplierName;
- scanForm.projectName = row.projectName;
scanForm.scanTime = getCurrentDateTime();
scanForm.scannerName = userStore.nickName;
scanForm.scanStatus = "鏈壂鐮�";
@@ -1620,4 +1593,4 @@
});
</script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss"></style>
\ No newline at end of file
diff --git a/src/views/procurementManagement/procurementReport/index.vue b/src/views/procurementManagement/procurementReport/index.vue
index 33a0e91..d421c67 100644
--- a/src/views/procurementManagement/procurementReport/index.vue
+++ b/src/views/procurementManagement/procurementReport/index.vue
@@ -280,6 +280,7 @@
import { ref, reactive, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { Document, List, TrendCharts, Shop, Search, Refresh, Download } from '@element-plus/icons-vue'
+import dayjs from "dayjs";
// 鍝嶅簲寮忔暟鎹�
const loading = ref(false)
@@ -690,14 +691,10 @@
}
onMounted(() => {
- // 璁剧疆榛樿鏃堕棿鑼冨洿涓烘渶杩�30澶�
- const endDate = new Date()
- const startDate = new Date()
- startDate.setDate(startDate.getDate() - 30)
-
+ // 璁剧疆榛樿鏃堕棿鑼冨洿涓哄綋澶�
searchForm.dateRange = [
- startDate.toISOString().split('T')[0],
- endDate.toISOString().split('T')[0]
+ dayjs().startOf('day').format('YYYY-MM-DD'),
+ dayjs().endOf('day').format('YYYY-MM-DD')
]
})
</script>
diff --git a/src/views/productionManagement/operationScheduling/components/formDia.vue b/src/views/productionManagement/operationScheduling/components/formDia.vue
index a4f36bf..06b46ac 100644
--- a/src/views/productionManagement/operationScheduling/components/formDia.vue
+++ b/src/views/productionManagement/operationScheduling/components/formDia.vue
@@ -8,20 +8,47 @@
>
<el-button type="primary" @click="addRow" style="margin-bottom: 10px;">鏂板</el-button>
<span style="font-size: 18px;margin-left: 10px">寰呮帓浜ф暟閲忥細{{pendingNum}}</span>
+<!-- <div style="margin-bottom: 10px; margin-left: 10px;">-->
+<!-- <el-form-item label="棰嗙敤锛�" style="margin-bottom: 0;">-->
+<!-- <el-input v-model="receive" placeholder="璇疯緭鍏ラ鐢�" style="width: 200px;" />-->
+<!-- </el-form-item>-->
+<!-- </div>-->
<el-table :data="tableData" border style="width: 100%" :summary-method="summarizeMainTable" show-summary :row-key="row => row.id">
- <el-table-column label="搴忓彿" width="60">
+ <el-table-column label="搴忓彿" width="60" align="center">
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
- <el-table-column label="宸ュ簭" prop="process">
+ <el-table-column label="宸ュ簭" prop="process" width="150">
<template #default="scope">
<el-input v-model="scope.row.process" placeholder="璇疯緭鍏ュ伐搴�" />
</template>
</el-table-column>
- <el-table-column label="鍗曚綅" prop="unit">
+ <el-table-column label="浜х嚎" prop="productionLine" width="150">
+ <template #default="scope">
+ <el-select
+ v-model="scope.row.productionLine"
+ placeholder="閫夋嫨浜х嚎"
+ style="width: 100%;"
+ clearable
+ >
+ <el-option
+ v-for="line in productionLines"
+ :key="line.value"
+ :label="line.label"
+ :value="line.value"
+ />
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍗曚綅" prop="unit" width="90">
<template #default="scope">
<el-input v-model="scope.row.unit" placeholder="璇疯緭鍏ュ崟浣�" />
+ </template>
+ </el-table-column>
+ <el-table-column label="鍙e懗/鍝佸悕/瑙勬牸" prop="type" width="150">
+ <template #default="scope">
+ <el-input v-model="scope.row.type" placeholder="璇疯緭鍏�" />
</template>
</el-table-column>
<el-table-column label="鎺掍骇鏁伴噺" width="200" prop="schedulingNum">
@@ -50,17 +77,20 @@
/>
</template>
</el-table-column>
- <el-table-column label="鎺掍骇鏃ユ湡" prop="schedulingDate">
+ <el-table-column label="鎺掍骇鏃ユ湡" prop="schedulingDate" width="200">
<template #default="scope">
<el-date-picker v-model="scope.row.schedulingDate" type="date" placeholder="閫夋嫨鏃ユ湡" style="width: 100%;" value-format="YYYY-MM-DD" format="YYYY-MM-DD"/>
</template>
</el-table-column>
- <el-table-column label="鎺掍骇浜�" prop="schedulingUserId">
+ <el-table-column label="鎺掍骇浜�" prop="schedulingUserId" width="150">
<template #default="scope">
<el-select
v-model="scope.row.schedulingUserId"
placeholder="閫夋嫨浜哄憳"
style="width: 100%;"
+ filterable
+ default-first-option
+ :reserve-keyword="false"
>
<el-option
v-for="user in userList"
@@ -69,6 +99,11 @@
:value="user.userId"
/>
</el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="澶囨敞" prop="remark" width="200">
+ <template #default="scope">
+ <el-input v-model="scope.row.remark" placeholder="璇疯緭鍏ュ娉�" />
</template>
</el-table-column>
<el-table-column label="鎿嶄綔" width="80">
@@ -88,7 +123,7 @@
</template>
<script setup>
-import {ref} from "vue";
+import {ref, getCurrentInstance} from "vue";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import {processScheduling} from "@/api/productionManagement/operationScheduling.js";
const { proxy } = getCurrentInstance()
@@ -97,33 +132,56 @@
const dialogFormVisible = ref(false);
const operationType = ref('')
-const tableData = ref([
- { process: '', schedulingDate: '', schedulingNum: '', schedulingUserId: '', workHours: '', unit: '' }
-]);
+const tableData = ref([]);
const unitFromRow = ref('');
const idFromRow = ref('');
-const pendingNum = ref('');
+const specificationModelFromRow = ref('');
+const pendingNum = ref(0);
const userList = ref([])
+const receive = ref('')
+const sunqianUserId = ref('')
+// 浜х嚎閫夐」
+const productionLines = ref([
+ { label: '浜х嚎1', value: '浜х嚎1' },
+ { label: '浜х嚎2', value: '浜х嚎2' },
+ { label: '浜х嚎3', value: '浜х嚎3' },
+ { label: '浜х嚎4', value: '浜х嚎4' }
+])
// 鎵撳紑寮规
const openDialog = (type, row) => {
operationType.value = type;
dialogFormVisible.value = true;
+ pendingNum.value = row?.pendingNum ?? 0;
+ unitFromRow.value = row?.unit ?? '';
+ idFromRow.value = row?.id ?? '';
+ specificationModelFromRow.value = row?.specificationModel ?? '';
+
userListNoPageByTenantId().then((res) => {
userList.value = res.data;
+ // 鎵惧埌瀛欏�╃殑鐢ㄦ埛ID骞惰缃负榛樿鍊�
+ const sunqianUser = userList.value.find(user => user.nickName === '瀛欏��');
+ if (sunqianUser) {
+ sunqianUserId.value = sunqianUser.userId;
+ }
+ // 鍦ㄧ敤鎴峰垪琛ㄥ姞杞藉畬鎴愬悗鍒涘缓琛屾暟鎹紝骞跺皢浜х嚎鏁版嵁甯﹀叆
+ tableData.value = [createRow(row)];
});
- pendingNum.value = row.pendingNum
- if (row && row.unit !== undefined) {
- unitFromRow.value = row.unit;
- idFromRow.value = row.id;
- tableData.value.forEach(item => {
- item.unit = row.unit;
- item.id = row.id;
- });
- } else {
- unitFromRow.value = '';
- }
}
+
+const createRow = (row) => ({
+ id: idFromRow.value,
+ process: '鍖呰',
+ schedulingDate: '',
+ schedulingNum: null,
+ schedulingUserId: sunqianUserId.value, // 榛樿璁剧疆涓哄瓩鍊╃殑鐢ㄦ埛ID
+ workHours: null,
+ unit: unitFromRow.value,
+ remark: '',
+ type: specificationModelFromRow.value,
+ productionLine: row?.productionLine ?? '', // 浠庤鏁版嵁涓幏鍙栦骇绾夸俊鎭�
+});
+
const submitForm = () => {
// 1. 妫�鏌ユ瘡涓�琛屾槸鍚﹀~鍐欏畬鏁�
for (let i = 0; i < tableData.value.length; i++) {
@@ -134,7 +192,8 @@
row.schedulingNum === '' || row.schedulingNum === null ||
!row.schedulingUserId ||
row.workHours === '' || row.workHours === null ||
- !row.unit
+ !row.unit ||
+ !row.productionLine
) {
proxy.$modal.msgError(`绗�${i + 1}琛屾暟鎹湭濉啓瀹屾暣`);
return;
@@ -148,7 +207,15 @@
proxy.$modal.msgError('鎺掍骇鏁伴噺鍚堣涓嶈兘瓒呰繃寰呮帓浜ф暟閲�');
return;
}
- processScheduling(tableData.value).then((res) => {
+ // 3. 灏� receive 瀛楁娣诲姞鍒版瘡鏉℃暟鎹腑锛屽苟绉婚櫎 loss 瀛楁
+ const submitData = tableData.value.map(row => {
+ const { loss, ...rest } = row;
+ return {
+ ...rest,
+ receive: receive.value
+ };
+ });
+ processScheduling(submitData).then((res) => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
})
@@ -159,6 +226,12 @@
// 鍏抽棴寮规
const closeDia = () => {
dialogFormVisible.value = false;
+ receive.value = '';
+ tableData.value = [];
+ unitFromRow.value = '';
+ idFromRow.value = '';
+ specificationModelFromRow.value = '';
+ pendingNum.value = 0;
emit('close')
};
defineExpose({
@@ -166,7 +239,7 @@
});
const addRow = () => {
- tableData.value.push({ id: idFromRow.value, process: '', unit: unitFromRow.value, schedulingNum: '', workHours: '', schedulingDate: '', schedulingUserId: '' });
+ tableData.value.push(createRow());
};
const removeRow = (index) => {
tableData.value.splice(index, 1);
diff --git a/src/views/productionManagement/operationScheduling/index.vue b/src/views/productionManagement/operationScheduling/index.vue
index 082b782..a9c06fb 100644
--- a/src/views/productionManagement/operationScheduling/index.vue
+++ b/src/views/productionManagement/operationScheduling/index.vue
@@ -7,11 +7,16 @@
style="width: 200px;"
@change="handleQuery" />
</el-form-item>
- <el-form-item label="椤圭洰鍚嶇О:">
- <el-input v-model="searchForm.projectName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
+ <el-form-item label="鍚堝悓鍙�:">
+ <el-input v-model="searchForm.salesContractNo" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
style="width: 200px;"
@change="handleQuery" />
</el-form-item>
+<!-- <el-form-item label="椤圭洰鍚嶇О:">-->
+<!-- <el-input v-model="searchForm.projectName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"-->
+<!-- style="width: 200px;"-->
+<!-- @change="handleQuery" />-->
+<!-- </el-form-item>-->
<el-form-item label="娲惧伐鏃ユ湡:">
<el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
@@ -60,10 +65,12 @@
const data = reactive({
searchForm: {
staffName: "",
+ customerName: "",
+ salesContractNo: "",
status: 1,
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
+ entryDate: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")], // 褰曞叆鏃ユ湡锛岄粯璁ゅ綋澶�
+ entryDateStart: dayjs().format("YYYY-MM-DD"),
+ entryDateEnd: dayjs().format("YYYY-MM-DD"),
},
});
const { searchForm } = toRefs(data);
@@ -105,21 +112,21 @@
prop: "salesContractNo",
width: 200,
},
- {
- label: "瀹㈡埛鍚堝悓鍙�",
- prop: "customerContractNo",
- width: 200,
- },
+ // {
+ // label: "瀹㈡埛鍚堝悓鍙�",
+ // prop: "customerContractNo",
+ // width: 200,
+ // },
{
label: "瀹㈡埛鍚嶇О",
prop: "customerName",
width: 200,
},
- {
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width:300
- },
+ // {
+ // label: "椤圭洰鍚嶇О",
+ // prop: "projectName",
+ // width:300
+ // },
{
label: "浜у搧澶х被",
prop: "productCategory",
@@ -131,6 +138,16 @@
width: 150,
},
{
+ label: "缁戝畾鏈哄櫒",
+ prop: "speculativeTradingName",
+ width: 220,
+ },
+ // {
+ // label: "浜х嚎",
+ // prop: "productionLine",
+ // width: 220,
+ // },
+ {
label: "鍗曚綅",
prop: "unit",
},
diff --git a/src/views/productionManagement/processRoute/Edit.vue b/src/views/productionManagement/processRoute/Edit.vue
new file mode 100644
index 0000000..773d333
--- /dev/null
+++ b/src/views/productionManagement/processRoute/Edit.vue
@@ -0,0 +1,168 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="isShow"
+ title="缂栬緫宸ヨ壓璺嚎"
+ width="400"
+ @close="closeModal"
+ >
+ <el-form label-width="140px" :model="formState" label-position="top" ref="formRef">
+ <el-form-item label="浜у搧澶х被锛�" prop="productId">
+ <el-tree-select
+ v-model="formState.productId"
+ placeholder="璇烽�夋嫨"
+ clearable
+ check-strictly
+ @change="getModels"
+ :data="productOptions"
+ :render-after-expand="false"
+ style="width: 100%"
+ />
+ </el-form-item>
+
+ <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="productModelId">
+ <el-select
+ v-model="formState.productModelId"
+ placeholder="璇烽�夋嫨"
+ clearable
+ >
+ <el-option
+ v-for="item in productModelsOptions"
+ :key="item.id"
+ :label="item.model"
+ :value="item.id"
+ />
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="澶囨敞" prop="description">
+ <el-input v-model="formState.description" type="textarea" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="handleSubmit">纭</el-button>
+ <el-button @click="closeModal">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import {ref, computed, getCurrentInstance, onMounted} from "vue";
+import {update} from "@/api/productionManagement/processRoute.js";
+import {modelList, productTreeList} from "@/api/basicData/product.js";
+
+const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ },
+
+ record: {
+ type: Object,
+ required: true,
+ }
+});
+
+const emit = defineEmits(['update:visible', 'completed']);
+
+// 鍝嶅簲寮忔暟鎹紙鏇夸唬閫夐」寮忕殑 data锛�
+const formState = ref({});
+
+const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit('update:visible', val);
+ },
+});
+
+let { proxy } = getCurrentInstance()
+const productModelsOptions = ref([])
+const productOptions = ref([])
+
+const closeModal = () => {
+ isShow.value = false;
+};
+
+const setFormData = () => {
+ formState.value = props.record
+}
+
+const getProductOptions = () => {
+ productTreeList().then((res) => {
+ productOptions.value = convertIdToValue(res);
+ });
+};
+const getModels = (value) => {
+ formState.value.productModelId = undefined;
+ productModelsOptions.value = [];
+ if (value) {
+ modelList({ id: value }).then((res) => {
+ productModelsOptions.value = res;
+ });
+ }
+};
+
+const findNodeById = (nodes, productId) => {
+ for (let i = 0; i < nodes.length; i++) {
+ if (nodes[i].value === productId) {
+ return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣鐨刲abel
+ }
+ if (nodes[i].children && nodes[i].children.length > 0) {
+ const foundNode = findNodeById(nodes[i].children, productId);
+ if (foundNode) {
+ return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝鐩存帴杩斿洖锛堝凡缁忔槸label瀛楃涓诧級
+ }
+ }
+ }
+ return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
+};
+
+function convertIdToValue(data) {
+ return data.map((item) => {
+ const { id, children, ...rest } = item;
+ const newItem = {
+ ...rest,
+ value: id, // 灏� id 鏀逛负 value
+ };
+ if (children && children.length > 0) {
+ newItem.children = convertIdToValue(children);
+ }
+
+ return newItem;
+ });
+}
+
+const handleSubmit = () => {
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ update(formState.value).then(res => {
+ // 鍏抽棴妯℃�佹
+ isShow.value = false;
+ // 鍛婄煡鐖剁粍浠跺凡瀹屾垚
+ emit('completed');
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ })
+ }
+ })
+};
+
+defineExpose({
+ closeModal,
+ handleSubmit,
+ isShow,
+});
+
+
+onMounted(() => {
+ getProductOptions()
+ getModels(props.record.productId)
+ nextTick(() => {
+ setFormData()
+ });
+})
+</script>
diff --git a/src/views/productionManagement/processRoute/ItemsForm.vue b/src/views/productionManagement/processRoute/ItemsForm.vue
new file mode 100644
index 0000000..ed6e499
--- /dev/null
+++ b/src/views/productionManagement/processRoute/ItemsForm.vue
@@ -0,0 +1,531 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="isShow"
+ title="宸ヨ壓璺嚎椤圭洰"
+ width="800px"
+ @close="closeModal"
+ >
+ <div class="operate-button">
+ <el-button
+ type="primary"
+ @click="isShowProductSelectDialog = true"
+ class="mb5"
+ style="margin-bottom: 10px;"
+ >
+ 閫夋嫨浜у搧
+ </el-button>
+
+ <el-switch
+ v-model="isTable"
+ inline-prompt
+ active-text="琛ㄦ牸"
+ inactive-text="鍒楄〃"
+ @change="handleViewChange"
+ />
+ </div>
+
+ <el-table
+ v-if="isTable"
+ ref="multipleTable"
+ v-loading="tableLoading"
+ border
+ :data="routeItems"
+ :header-cell-style="{ background: '#F0F1F5', color: '#333333' }"
+ row-key="id"
+ tooltip-effect="dark"
+ class="lims-table"
+ style="cursor: move;"
+ >
+ <el-table-column align="center" label="搴忓彿" width="60">
+ <template #default="scope">
+ {{ scope.$index + 1 }}
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ v-for="(item, index) in tableColumn"
+ :key="index"
+ :label="item.label"
+ :width="item.width"
+ show-overflow-tooltip
+ >
+ <template #default="scope" v-if="item.dataType === 'action'">
+ <el-button
+ v-for="(op, opIndex) in item.operation"
+ :key="opIndex"
+ :type="op.type"
+ :link="op.link"
+ size="small"
+ @click.stop="op.clickFun(scope.row)"
+ >
+ {{ op.name }}
+ </el-button>
+ </template>
+
+ <template #default="scope" v-else>
+ <template v-if="item.prop === 'processId'">
+ <el-select
+ v-model="scope.row[item.prop]"
+ style="width: 100%;"
+ @mousedown.stop
+ >
+ <el-option
+ v-for="process in processOptions"
+ :key="process.id"
+ :label="process.name"
+ :value="process.id"
+ />
+ </el-select>
+ </template>
+ <template v-else>
+ {{ scope.row[item.prop] || '-' }}
+ </template>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <!-- 浣跨敤鏅�歞iv鏇夸唬el-steps -->
+ <div
+ v-else
+ ref="stepsContainer"
+ class="mb5 custom-steps"
+ style="padding: 10px 0; display: flex; flex-wrap: nowrap; gap: 20px; align-items: flex-start;"
+ >
+ <div
+ v-for="(item, index) in routeItems"
+ :key="item.id"
+ class="custom-step draggable-step"
+ :data-id="item.id"
+ style="cursor: move; flex: 0 0 auto; min-width: 220px;"
+ >
+ <div class="step-content">
+ <div class="step-number">{{ index + 1 }}</div>
+ <el-card
+ :header="item.productName"
+ class="step-card"
+ style="cursor: move;"
+ >
+ <div class="step-card-content">
+ <p>{{ item.model }}</p>
+ <p>{{ item.unit }}</p>
+ <el-select
+ v-model="item.processId"
+ style="width: 100%;"
+ @mousedown.stop
+ >
+ <el-option
+ v-for="process in processOptions"
+ :key="process.id"
+ :label="process.name"
+ :value="process.id"
+ />
+ </el-select>
+ </div>
+ <template #footer>
+ <div class="step-card-footer">
+ <el-button type="danger" link size="small" @click.stop="removeItemByID(item.id)">鍒犻櫎</el-button>
+ </div>
+ </template>
+ </el-card>
+ </div>
+ </div>
+ </div>
+
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="handleSubmit">纭</el-button>
+ <el-button @click="closeModal">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+
+ <ProductSelectDialog
+ v-model="isShowProductSelectDialog"
+ @confirm="handelSelectProducts"
+ />
+ </div>
+</template>
+
+<script setup>
+import { ref, computed, getCurrentInstance, onMounted, onUnmounted, nextTick } from "vue";
+import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
+import { findProcessRouteItemList, addOrUpdateProcessRouteItem } from "@/api/productionManagement/processRouteItem.js";
+import { processList } from "@/api/productionManagement/productionProcess.js";
+import Sortable from 'sortablejs';
+
+const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ default: false
+ },
+ record: {
+ type: Object,
+ required: true,
+ default: () => ({})
+ }
+});
+
+const emit = defineEmits(['update:visible', 'completed']);
+
+const processOptions = ref([]);
+const tableLoading = ref(false);
+const isShowProductSelectDialog = ref(false);
+const routeItems = ref([]);
+let tableSortable = null;
+let stepsSortable = null;
+const multipleTable = ref(null);
+const stepsContainer = ref(null);
+const isTable = ref(true);
+
+const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit('update:visible', val);
+ }
+});
+
+const tableColumn = ref([
+ { label: "浜у搧鍚嶇О", prop: "productName", width: 180 },
+ { label: "瑙勬牸鍚嶇О", prop: "model", width: 150 },
+ { label: "鍗曚綅", prop: "unit", width: 80 },
+ { label: "宸ュ簭鍚嶇О", prop: "processId", width: 180 },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 100,
+ operation: [
+ {
+ name: "鍒犻櫎",
+ type: "danger",
+ link: true,
+ clickFun: (row) => {
+ const idx = routeItems.value.findIndex(item => item.id === row.id);
+ if (idx > -1) {
+ removeItem(idx)
+ }
+ }
+ }
+ ]
+ }
+]);
+
+const removeItem = (index) => {
+ routeItems.value.splice(index, 1);
+ nextTick(() => initSortable());
+};
+
+const removeItemByID = (id) => {
+ const idx = routeItems.value.findIndex(item => item.id === id);
+ if (idx > -1) {
+ routeItems.value.splice(idx, 1);
+ nextTick(() => initSortable());
+ }
+};
+
+const closeModal = () => {
+ isShow.value = false;
+};
+
+const handelSelectProducts = (products) => {
+ destroySortable();
+
+ const newData = products.map(({ id, ...product }) => ({
+ ...product,
+ productModelId: id,
+ routeId: props.record.id,
+ id: `${Date.now()}-${Math.random().toString(36).slice(2)}`,
+ processId: undefined
+ }));
+
+ console.log('閫夋嫨浜у搧鍓嶆暟缁�:', routeItems.value);
+ routeItems.value.push(...newData);
+ routeItems.value = [...routeItems.value];
+ console.log('閫夋嫨浜у搧鍚庢暟缁�:', routeItems.value);
+
+ // 寤惰繜鍒濆鍖栵紝纭繚DOM瀹屽叏娓叉煋
+ nextTick(() => {
+ // 寮哄埗閲嶆柊娓叉煋缁勪欢
+ if (proxy?.$forceUpdate) {
+ proxy.$forceUpdate();
+ }
+
+ const temp = [...routeItems.value];
+ routeItems.value = [];
+ nextTick(() => {
+ routeItems.value = temp;
+ initSortable();
+ });
+ });
+};
+
+const findProcessRouteItems = () => {
+ tableLoading.value = true;
+ findProcessRouteItemList({ routeId: props.record.id })
+ .then(res => {
+ tableLoading.value = false;
+ routeItems.value = res.data.map(item => ({
+ ...item,
+ processId: item.processId === 0 ? undefined : item.processId
+ }));
+ // 寤惰繜鍒濆鍖栵紝纭繚DOM瀹屽叏娓叉煋
+ nextTick(() => {
+ setTimeout(() => initSortable(), 100);
+ });
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ console.error("鑾峰彇鍒楄〃澶辫触锛�", err);
+ });
+};
+
+const findProcessList = () => {
+ processList({})
+ .then(res => {
+ processOptions.value = res.data;
+ })
+ .catch(err => {
+ console.error("鑾峰彇宸ュ簭澶辫触锛�", err);
+ });
+};
+
+const { proxy } = getCurrentInstance() || {};
+
+const handleSubmit = () => {
+ const hasEmptyProcess = routeItems.value.some(item => !item.processId);
+ if (hasEmptyProcess) {
+ proxy?.$modal?.msgError("璇蜂负鎵�鏈夐」鐩�夋嫨宸ュ簭");
+ return;
+ }
+
+ addOrUpdateProcessRouteItem({
+ routeId: props.record.id,
+ processRouteItem: routeItems.value.map(({ id, ...item }) => item)
+ })
+ .then(res => {
+ isShow.value = false;
+ emit('completed');
+ proxy?.$modal?.msgSuccess("鎻愪氦鎴愬姛");
+ })
+ .catch(err => {
+ proxy?.$modal?.msgError(`鎻愪氦澶辫触锛�${err.msg || "缃戠粶寮傚父"}`);
+ });
+};
+
+const destroySortable = () => {
+ if (tableSortable) {
+ tableSortable.destroy();
+ tableSortable = null;
+ }
+ if (stepsSortable) {
+ stepsSortable.destroy();
+ stepsSortable = null;
+ }
+};
+
+const initSortable = () => {
+ destroySortable();
+
+ if (isTable.value) {
+ if (!multipleTable.value) return;
+ const tbody = multipleTable.value.$el.querySelector('.el-table__body tbody') ||
+ multipleTable.value.$el.querySelector('.el-table__body-wrapper > table > tbody');
+ if (!tbody) return;
+
+ tableSortable = new Sortable(tbody, {
+ animation: 150,
+ ghostClass: 'sortable-ghost',
+ handle: '.el-table__row',
+ filter: '.el-button, .el-select',
+ onEnd: (evt) => {
+ if (evt.oldIndex === evt.newIndex || !routeItems.value[evt.oldIndex]) return;
+
+ // 浣跨敤鏁扮粍 splice 鏂规硶閲嶆柊鎺掑簭锛屼笌琛ㄦ牸妯″紡淇濇寔涓�鑷�
+ const moveItem = routeItems.value.splice(evt.oldIndex, 1)[0];
+ routeItems.value.splice(evt.newIndex, 0, moveItem);
+ routeItems.value = [...routeItems.value];
+ console.log('鎺掑簭鍚庢暟缁�:', routeItems.value);
+ }
+ });
+ } else {
+ if (!stepsContainer.value) return;
+
+ // 淇敼锛氱洿鎺ヤ娇鐢╯tepsContainer.value浣滀负鎷栨嫿瀹瑰櫒
+ const stepsList = stepsContainer.value;
+ if (!stepsList) {
+ console.warn('鏈壘鍒版楠ゆ潯鎷栨嫿瀹瑰櫒');
+ return;
+ }
+
+ // 淇敼锛氱畝鍖栨嫋鎷介厤缃�
+ stepsSortable = new Sortable(stepsList, {
+ animation: 150,
+ ghostClass: 'sortable-ghost',
+ draggable: '.draggable-step', // 鍙嫋鎷藉厓绱�
+ handle: '.draggable-step, .step-card', // 鎷栨嫿鎵嬫焺
+ filter: '.el-button, .el-select, .el-input', // 杩囨护鎸夐挳/閫夋嫨鍣�
+ forceFallback: true,
+ fallbackClass: 'sortable-fallback',
+ preventOnFilter: true,
+ scroll: true,
+ scrollSensitivity: 30,
+ scrollSpeed: 10,
+ bubbleScroll: true,
+ onEnd: (evt) => {
+ if (evt.oldIndex === evt.newIndex || !routeItems.value[evt.oldIndex]) return;
+
+ // 浣跨敤鏁扮粍 splice 鏂规硶閲嶆柊鎺掑簭
+ const moveItem = routeItems.value.splice(evt.oldIndex, 1)[0];
+ routeItems.value.splice(evt.newIndex, 0, moveItem);
+ routeItems.value = [...routeItems.value];
+ }
+ });
+
+ // 璋冭瘯锛氭墦鍗板鍣ㄥ拰瀹炰緥锛岀‘璁ょ粦瀹氭垚鍔�
+ console.log('姝ラ鏉℃嫋鎷藉鍣�:', stepsList);
+ console.log('Sortable瀹炰緥:', stepsSortable);
+ }
+};
+
+const handleViewChange = () => {
+ destroySortable();
+ // 寤惰繜鍒濆鍖栵紝纭繚瑙嗗浘鍒囨崲鍚嶥OM瀹屽叏娓叉煋
+ nextTick(() => {
+ setTimeout(() => initSortable(), 100);
+ });
+};
+
+onMounted(() => {
+ findProcessRouteItems();
+ findProcessList();
+});
+
+onUnmounted(() => {
+ destroySortable();
+});
+
+defineExpose({
+ closeModal,
+ handleSubmit,
+ isShow
+});
+</script>
+
+<style scoped>
+:deep(.sortable-ghost) {
+ opacity: 0.6;
+ background-color: #f5f7fa !important;
+}
+
+:deep(.el-table__row) {
+ transition: background-color 0.2s;
+}
+
+:deep(.el-table__row:hover) {
+ background-color: #f9fafc !important;
+}
+
+:deep(.el-card__footer){
+ padding: 0 !important;
+}
+
+.operate-button {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+/* 淇敼锛氳嚜瀹氫箟姝ラ鏉″鍣ㄦ牱寮� */
+.custom-steps {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: flex-start;
+ gap: 20px;
+ min-height: 100px;
+}
+
+/* 淇敼锛氳嚜瀹氫箟姝ラ椤规牱寮� */
+.custom-step {
+ cursor: move !important;
+ padding: 8px;
+ position: relative;
+ transition: all 0.2s ease;
+ flex: 0 0 auto;
+ min-width: 220px;
+ touch-action: none;
+}
+
+/* 鎷栨嫿鎮诞鏍峰紡锛屾彁绀哄彲鎷栨嫿 */
+.custom-step:hover {
+ background-color: rgba(64, 158, 255, 0.05);
+ transform: translateY(-2px);
+}
+
+.sortable-ghost {
+ opacity: 0.4;
+ background-color: #f5f7fa !important;
+ border: 2px dashed #409eff;
+ margin: 10px;
+ transform: scale(1.02);
+}
+
+.sortable-fallback {
+ opacity: 0.9;
+ background-color: #f5f7fa;
+ border: 1px solid #409eff;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
+ transform: rotate(2deg);
+ margin: 10px;
+}
+
+.step-card {
+ cursor: move !important;
+ transition: box-shadow 0.2s ease;
+ user-select: none;
+ -webkit-user-select: none;
+ pointer-events: auto;
+ margin: 10px;
+ height: 240px;
+}
+
+.step-card:hover {
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
+}
+
+.step-content {
+ width: 220px;
+ user-select: none;
+}
+
+.step-card-content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.step-card-footer {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ padding: 10px;
+}
+
+/* 鑷畾涔夊簭鍙锋牱寮忎紭鍖� */
+.step-number {
+ font-weight: bold;
+ text-align: center;
+ width: 36px;
+ height: 36px;
+ line-height: 36px;
+ margin: 0 auto 10px;
+ background: #409eff;
+ color: #fff;
+ border-radius: 50%;
+ font-size: 14px;
+}
+</style>
diff --git a/src/views/productionManagement/processRoute/New.vue b/src/views/productionManagement/processRoute/New.vue
new file mode 100644
index 0000000..5c56fd4
--- /dev/null
+++ b/src/views/productionManagement/processRoute/New.vue
@@ -0,0 +1,163 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="isShow"
+ title="鏂板宸ヨ壓璺嚎"
+ width="400"
+ @close="closeModal"
+ >
+ <el-form label-width="140px" :model="formState" label-position="top" ref="formRef">
+ <el-form-item label="浜у搧澶х被锛�" prop="productId">
+ <el-tree-select
+ v-model="formState.productId"
+ placeholder="璇烽�夋嫨"
+ clearable
+ check-strictly
+ @change="getModels"
+ :data="productOptions"
+ :render-after-expand="false"
+ style="width: 100%"
+ />
+ </el-form-item>
+
+ <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="productModelId">
+ <el-select
+ v-model="formState.productModelId"
+ placeholder="璇烽�夋嫨"
+ clearable
+ >
+ <el-option
+ v-for="item in productModelsOptions"
+ :key="item.id"
+ :label="item.model"
+ :value="item.id"
+ />
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="澶囨敞" prop="description">
+ <el-input v-model="formState.description" type="textarea" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="handleSubmit">纭</el-button>
+ <el-button @click="closeModal">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import {ref, computed, getCurrentInstance, onMounted} from "vue";
+import {add} from "@/api/productionManagement/processRoute.js";
+import {modelList, productTreeList} from "@/api/basicData/product.js";
+
+const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ },
+});
+
+const emit = defineEmits(['update:visible', 'completed']);
+
+// 鍝嶅簲寮忔暟鎹紙鏇夸唬閫夐」寮忕殑 data锛�
+const formState = ref({
+ productId: undefined,
+ productModelId: undefined,
+ description: '',
+});
+
+const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit('update:visible', val);
+ },
+});
+
+const productModelsOptions = ref([])
+const productOptions = ref([])
+
+let { proxy } = getCurrentInstance()
+
+const closeModal = () => {
+ isShow.value = false;
+};
+
+const getProductOptions = () => {
+ productTreeList().then((res) => {
+ productOptions.value = convertIdToValue(res);
+ });
+};
+const getModels = (value) => {
+ formState.value.productId = undefined;
+ formState.value.productModelId = undefined;
+ productModelsOptions.value = [];
+
+ if (value) {
+ formState.value.productId = findNodeById(productOptions.value, value) || undefined;
+ modelList({ id: value }).then((res) => {
+ productModelsOptions.value = res;
+ });
+ }
+};
+
+const findNodeById = (nodes, productId) => {
+ for (let i = 0; i < nodes.length; i++) {
+ if (nodes[i].value === productId) {
+ return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣鐨刲abel
+ }
+ if (nodes[i].children && nodes[i].children.length > 0) {
+ const foundNode = findNodeById(nodes[i].children, productId);
+ if (foundNode) {
+ return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝鐩存帴杩斿洖锛堝凡缁忔槸label瀛楃涓诧級
+ }
+ }
+ }
+ return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
+};
+
+function convertIdToValue(data) {
+ return data.map((item) => {
+ const { id, children, ...rest } = item;
+ const newItem = {
+ ...rest,
+ value: id, // 灏� id 鏀逛负 value
+ };
+ if (children && children.length > 0) {
+ newItem.children = convertIdToValue(children);
+ }
+
+ return newItem;
+ });
+}
+
+const handleSubmit = () => {
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ add(formState.value).then(res => {
+ // 鍏抽棴妯℃�佹
+ isShow.value = false;
+ // 鍛婄煡鐖剁粍浠跺凡瀹屾垚
+ emit('completed');
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ })
+ }
+ })
+};
+
+
+defineExpose({
+ closeModal,
+ handleSubmit,
+ isShow,
+});
+
+onMounted(() => {
+ getProductOptions()
+})
+</script>
diff --git a/src/views/productionManagement/processRoute/index.vue b/src/views/productionManagement/processRoute/index.vue
new file mode 100644
index 0000000..20de386
--- /dev/null
+++ b/src/views/productionManagement/processRoute/index.vue
@@ -0,0 +1,184 @@
+<template>
+ <div class="app-container">
+ <div class="search_form">
+ <el-form :model="searchForm" :inline="true">
+ <el-form-item label="瑙勬牸鍚嶇О:">
+ <el-input v-model="searchForm.model" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleQuery">鎼滅储</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="table_list">
+ <div style="text-align: right" class="mb10">
+ <el-button type="primary" @click="showNewModal">鏂板宸ヨ壓璺嚎</el-button>
+ <el-button type="danger" @click="handleDelete" :disabled="selectedRows.length === 0" plain>鍒犻櫎宸ヨ壓璺嚎</el-button>
+ </div>
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total"
+ />
+ </div>
+ <new-process
+ v-if="isShowNewModal"
+ v-model:visible="isShowNewModal"
+ @completed="getList"
+ />
+
+ <edit-process
+ v-if="isShowEditModal"
+ v-model:visible="isShowEditModal"
+ :record="record"
+ @completed="getList"
+ />
+
+ <route-item-form
+ v-if="isShowItemModal"
+ v-model:visible="isShowItemModal"
+ :record="record"
+ @completed="getList"
+ />
+ </div>
+</template>
+
+<script setup>
+import {onMounted, ref} from "vue";
+import NewProcess from "@/views/productionManagement/processRoute/New.vue";
+import EditProcess from "@/views/productionManagement/processRoute/Edit.vue";
+import RouteItemForm from "@/views/productionManagement/processRoute/ItemsForm.vue";
+import {listPage, del} from "@/api/productionManagement/processRoute.js";
+
+const data = reactive({
+ searchForm: {
+ model: "",
+ },
+});
+const { searchForm } = toRefs(data);
+const tableColumn = ref([
+ {
+ label: "浜у搧鍚嶇О",
+ prop: "productName",
+ },
+ {
+ label: "瑙勬牸鍚嶇О",
+ prop: "model",
+ },
+ {
+ label: "鎻忚堪",
+ prop: "description",
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 280,
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ showEditModal(row);
+ }
+ },
+ {
+ name: "璺嚎椤圭洰",
+ type: "text",
+ clickFun: (row) => {
+ showItemModal(row);
+ }
+ }
+ ]
+ }
+]);
+const tableData = ref([]);
+const selectedRows = ref([]);
+const tableLoading = ref(false);
+const isShowNewModal = ref(false);
+const isShowEditModal = ref(false);
+const isShowItemModal = ref(false);
+const record = ref({});
+const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+});
+const { proxy } = getCurrentInstance()
+
+// 鏌ヨ鍒楄〃
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+ page.current = 1;
+ getList();
+};
+
+const pagination = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+};
+const getList = () => {
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined
+ listPage(params).then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records.map(item => ({
+ ...item,
+ }));
+ page.total = res.data.total;
+ }).catch(err => {
+ tableLoading.value = false;
+ })
+};
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+ selectedRows.value = selection;
+};
+
+// 鎵撳紑鏂板寮规
+const showNewModal = () => {
+ isShowNewModal.value = true
+};
+
+const showEditModal = (row) => {
+ isShowEditModal.value = true
+ record.value = row
+};
+
+const showItemModal = (row) => {
+ isShowItemModal.value = true
+ record.value = row
+};
+
+// 鍒犻櫎
+function handleDelete() {
+ const ids = selectedRows.value.map((item) => item.id);
+ proxy.$modal
+ .confirm('鏄惁纭鍒犻櫎宸插嬀閫夌殑鏁版嵁椤癸紵')
+ .then(function () {
+ return del(ids);
+ })
+ .then(() => {
+ getList();
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ })
+ .catch(() => {});
+}
+
+onMounted(() => {
+ getList();
+});
+</script>
+
+<style scoped></style>
diff --git a/src/views/productionManagement/productStructure/StructureEdit.vue b/src/views/productionManagement/productStructure/StructureEdit.vue
new file mode 100644
index 0000000..fb5784f
--- /dev/null
+++ b/src/views/productionManagement/productStructure/StructureEdit.vue
@@ -0,0 +1,304 @@
+<template>
+ <el-dialog
+ v-model="visible"
+ title="缁撴瀯"
+ width="1200"
+ close-on-click-modal
+ @close="visible = false"
+ >
+ <el-button
+ v-if="dataValue.isEdit"
+ type="primary"
+ @click="addItem"
+ style="margin-bottom: 10px"
+ >娣诲姞
+ </el-button>
+ <el-button
+ v-if="!dataValue.isEdit"
+ type="primary"
+ @click="dataValue.isEdit = true"
+ style="margin-bottom: 10px"
+ >缂栬緫
+ </el-button>
+ <el-button
+ v-if="dataValue.isEdit"
+ type="primary"
+ @click="cancelEdit"
+ style="margin-bottom: 10px"
+ >鍙栨秷
+ </el-button>
+ <el-form
+ ref="form"
+ :model="dataValue"
+ >
+ <el-table :data="dataValue.dataList" style="width: 100%">
+ <el-table-column prop="productName" label="浜у搧" width="150"/>
+ <el-table-column prop="model" label="瑙勬牸" width="150">
+ <template #default="{ row, $index }">
+ <el-form-item
+ v-if="dataValue.isEdit"
+ :prop="`dataList.${$index}.model`"
+ :rules="[{ required: true, message: '璇烽�夋嫨瑙勬牸', trigger: ['blur','change'] }]"
+ style="margin: 0"
+ >
+ <el-select
+ v-model="row.model"
+ placeholder="璇烽�夋嫨浜у搧"
+ clearable
+ :disabled="!dataValue.isEdit"
+ style="width: 100%"
+ @visible-change="(v) => { if (v) openDialog($index) }"
+ >
+ <el-option v-if="row.model" :label="row.model" :value="row.model" />
+ </el-select>
+ </el-form-item>
+ </template>
+ </el-table-column>
+
+ <el-table-column prop="processId" label="娑堣�楀伐搴�" width="150">
+ <template #default="{ row, $index }">
+ <el-form-item
+ :prop="`dataList.${$index}.processId`"
+ :rules="[{ required: true, message: '璇烽�夋嫨娑堣�楀伐搴�', trigger: 'change' }]"
+ style="margin: 0"
+ >
+ <el-select
+ v-model="row.processId"
+ placeholder="璇烽�夋嫨"
+ filterable
+ clearable
+ style="width: 100%"
+ :disabled="!dataValue.isEdit"
+ >
+ <el-option
+ v-for="item in dataValue.processOptions"
+ :key="item.id"
+ :label="item.name"
+ :value="item.id"
+ />
+ </el-select>
+ </el-form-item>
+ </template>
+ </el-table-column>
+
+ <el-table-column prop="unitQuantity" label="鍗曚綅浜у嚭鎵�闇�鏁伴噺" width="150">
+ <template #default="{ row, $index }">
+ <el-form-item
+ :prop="`dataList.${$index}.unitQuantity`"
+ :rules="[{ required: true, message: '璇疯緭鍏ュ崟浣嶄骇鍑烘墍闇�鏁伴噺', trigger: ['blur','change'] }]"
+ style="margin: 0"
+ >
+ <el-input-number
+ v-model="row.unitQuantity"
+ :min="0"
+ :precision="2"
+ :step="1"
+ controls-position="right"
+ style="width: 100%"
+ :disabled="!dataValue.isEdit"
+ />
+ </el-form-item>
+ </template>
+ </el-table-column>
+
+ <el-table-column prop="demandedQuantity" label="闇�姹傛�婚噺" width="150">
+ <template #default="{ row, $index }">
+ <el-form-item
+ :prop="`dataList.${$index}.demandedQuantity`"
+ :rules="[{ required: true, message: '璇疯緭鍏ラ渶姹傛�婚噺', trigger: ['blur','change'] }]"
+ style="margin: 0"
+ >
+ <el-input-number
+ v-model="row.demandedQuantity"
+ :min="0"
+ :precision="2"
+ :step="1"
+ controls-position="right"
+ style="width: 100%"
+ :disabled="!dataValue.isEdit"
+ />
+ </el-form-item>
+ </template>
+ </el-table-column>
+
+ <el-table-column prop="unit" label="鍗曚綅" width="150">
+ <template #default="{ row, $index }">
+ <el-form-item
+ :prop="`dataList.${$index}.unit`"
+ :rules="[{ required: true, message: '璇疯緭鍏ュ崟浣�', trigger: ['blur','change'] }]"
+ style="margin: 0"
+ >
+ <el-input
+ v-model="row.unit"
+ placeholder="璇疯緭鍏ュ崟浣�"
+ clearable
+ :disabled="!dataValue.isEdit"
+ />
+ </el-form-item>
+ </template>
+ </el-table-column>
+
+ <el-table-column prop="diskQuantity" label="鐩樻暟锛堢洏锛�" width="150">
+ <template #default="{ row, $index }">
+ <el-form-item
+ :prop="`dataList.${$index}.diskQuantity`"
+ :rules="[{ required: true, message: '璇疯緭鍏ョ洏鏁�', trigger: ['blur','change'] }]"
+ style="margin: 0"
+ >
+ <el-input-number
+ v-model="row.diskQuantity"
+ :min="0"
+ :precision="0"
+ :step="1"
+ controls-position="right"
+ style="width: 100%"
+ :disabled="!dataValue.isEdit"
+ />
+ </el-form-item>
+ </template>
+ </el-table-column>
+
+ <el-table-column label="鎿嶄綔">
+ <template #default="{ row, $index }">
+ <el-button
+ type="danger"
+ text
+ @click="dataValue.dataList.splice($index, 1)"
+ >鍒犻櫎
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-form>
+
+ <product-select-dialog
+ v-if="dataValue.showProductDialog"
+ v-model:model-value="dataValue.showProductDialog"
+ @confirm="handleProduct"/>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button @click="visible = false">鍙栨秷</el-button>
+ <el-button type="primary" :loading="dataValue.loading" @click="submit" :disabled="!dataValue.isEdit">
+ 纭
+ </el-button>
+ </div>
+ </template>
+ </el-dialog>
+</template>
+
+<script setup lang="ts">
+import {computed, defineAsyncComponent, defineComponent, onMounted, reactive, ref} from "vue";
+import {queryList, add} from '@/api/productionManagement/productStructure.js'
+import {list} from '@/api/productionManagement/productionProcess'
+import {ElMessage} from "element-plus";
+
+
+defineComponent({
+ name: "StructureEdit",
+})
+
+const ProductSelectDialog = defineAsyncComponent(() => import('@/views/basicData/product/ProductSelectDialog.vue'))
+const form = ref()
+
+
+
+const props = defineProps({
+ showModel: {
+ type: Boolean,
+ default: false
+ },
+ productModelId: {
+ type: Number,
+ required: true
+ }
+})
+
+const emits = defineEmits(['update:showModel'])
+const visible = computed({
+ get() {
+ return props.showModel
+ },
+ set(val) {
+ emits('update:showModel', val)
+ }
+})
+
+const dataValue = reactive({
+ dataList: [],
+ productOptions: [],
+ processOptions: [],
+ showProductDialog: false,
+ currentRowIndex: null,
+ loading: false,
+ isEdit: false,
+});
+
+const openDialog = (index) => {
+ dataValue.currentRowIndex = index
+ dataValue.showProductDialog = true
+}
+
+const fetchData = async () => {
+ const {data} = await queryList(props.productModelId)
+ dataValue.dataList = data
+}
+
+const fetchProcessOptions = async () => {
+ const {data} = await list(props.productModelId)
+ dataValue.processOptions = data
+}
+
+const handleProduct = (row) => {
+ if (row?.length > 1) {
+ ElMessage.error('鍙兘閫夋嫨涓�涓骇鍝�')
+ }
+ dataValue.dataList[dataValue.currentRowIndex].productName = row[0].productName
+ dataValue.dataList[dataValue.currentRowIndex].model = row[0].model
+ dataValue.dataList[dataValue.currentRowIndex].productModelId = row[0].id
+ dataValue.showProductDialog = false
+}
+
+const submit = () => {
+ form.value.validate(valid => {
+ dataValue.loading = true
+ if (valid) {
+ add({
+ parentId: props.productModelId,
+ productStructureList: dataValue.dataList || []
+ }).then(res => {
+ ElMessage.success('淇濆瓨鎴愬姛')
+ visible.value = false
+ dataValue.loading = false
+ })
+ }
+ }).finally(() => {
+ dataValue.loading = false
+ })
+}
+
+const addItem = () => {
+ dataValue.dataList.push({
+ productName: '',
+ productId: '',
+ model: undefined,
+ productModelId: undefined,
+ processId: '',
+ unitQuantity: 0,
+ demandedQuantity: 0,
+ unit: '',
+ diskQuantity: 0,
+ })
+}
+
+const cancelEdit = () => {
+ dataValue.isEdit = false
+ dataValue.dataList = dataValue.dataList.filter(item => item.id !== undefined)
+}
+
+onMounted(() => {
+ fetchData()
+ fetchProcessOptions()
+})
+
+
+</script>
\ No newline at end of file
diff --git a/src/views/productionManagement/productStructure/index.vue b/src/views/productionManagement/productStructure/index.vue
new file mode 100644
index 0000000..bdbec9c
--- /dev/null
+++ b/src/views/productionManagement/productStructure/index.vue
@@ -0,0 +1,101 @@
+<template>
+ <div class="app-container">
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ >
+ <template #detail="{row}">
+ <el-button
+ type="primary"
+ text
+ @click="() =>{
+ currentRowId = row.id;
+ showEdit = true;
+ }"
+ >{{ row.productName }}
+ </el-button>
+ </template>
+ </PIMTable>
+ <StructureEdit v-if="showEdit" v-model:show-model="showEdit" :product-model-id="currentRowId"/>
+ </div>
+</template>
+
+<script setup>
+import {ref} from "vue";
+import {productModelList} from "@/api/basicData/productModel.js";
+
+const StructureEdit = defineAsyncComponent(() => import('@/views/productionManagement/productStructure/StructureEdit.vue'))
+
+const tableColumn = ref([
+ {
+ label: "浜у搧鍚嶇О",
+ prop: "productName",
+ dataType: 'slot',
+ slot: "detail"
+ },
+ {
+ label: "瑙勬牸鍨嬪彿",
+ prop: "model",
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ }
+]);
+const tableData = ref([]);
+const tableLoading = ref(false);
+const showEdit = ref(false);
+const selectedRows = ref([]);
+const currentRowId = ref(0);
+const page = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+});
+const data = reactive({
+ form: {
+ productName: "",
+ },
+ rules: {
+ productName: [{required: true, message: "璇疯緭鍏�", trigger: "blur"}],
+ },
+ modelForm: {
+ otherModel: '',
+ model: "",
+ unit: "",
+ speculativeTradingName: [],
+ },
+});
+const {form, rules} = toRefs(data);
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+ selectedRows.value = selection;
+};
+
+// 鏌ヨ瑙勬牸鍨嬪彿
+const pagination = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getModelList();
+};
+const getModelList = () => {
+ tableLoading.value = true;
+ productModelList({
+ current: page.current,
+ size: page.size,
+ }).then((res) => {
+ tableData.value = res.records;
+ page.total = res.total;
+ tableLoading.value = false;
+ });
+};
+onMounted(() => {
+ getModelList();
+})
+</script>
diff --git a/src/views/productionManagement/productionCosting/index.vue b/src/views/productionManagement/productionCosting/index.vue
index 71e4a12..a597317 100644
--- a/src/views/productionManagement/productionCosting/index.vue
+++ b/src/views/productionManagement/productionCosting/index.vue
@@ -14,6 +14,15 @@
clearable
prefix-icon="Search"
/>
+ <span class="search_title ml10">鍚堝悓鍙凤細</span>
+ <el-input
+ v-model="searchForm.salesContractNo"
+ style="width: 240px"
+ placeholder="璇疯緭鍏�"
+ @change="handleQuery"
+ clearable
+ prefix-icon="Search"
+ />
<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
>鎼滅储</el-button
>
@@ -61,21 +70,21 @@
prop: "salesContractNo",
width: 220,
},
- {
- label: "瀹㈡埛鍚堝悓鍙�",
- prop: "customerContractNo",
- width: 250,
- },
+ // {
+ // label: "瀹㈡埛鍚堝悓鍙�",
+ // prop: "customerContractNo",
+ // width: 250,
+ // },
{
label: "瀹㈡埛鍚嶇О",
prop: "customerName",
width: 250,
},
- {
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width:300
- },
+ // {
+ // label: "椤圭洰鍚嶇О",
+ // prop: "projectName",
+ // width:300
+ // },
{
label: "浜у搧澶х被",
prop: "productCategory",
@@ -121,6 +130,7 @@
const data = reactive({
searchForm: {
schedulingUserName: "",
+ salesContractNo: "",
entryDate: [
dayjs().format("YYYY-MM-DD"),
dayjs().add(1, "day").format("YYYY-MM-DD"),
@@ -171,7 +181,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/salesLedger/productionAccounting/export", {}, "鐢熶骇鏍哥畻.xlsx");
+ proxy.download("/basic/customer/export", {}, "鐢熶骇鏍哥畻.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
diff --git a/src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue b/src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue
new file mode 100644
index 0000000..b4a76f6
--- /dev/null
+++ b/src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue
@@ -0,0 +1,153 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="dialogFormVisible"
+ title="鑷姩娲惧伐"
+ width="80%"
+ @close="closeDia"
+ >
+ <el-form :model="form" label-width="140px" label-position="top" ref="formRef">
+ <el-divider content-position="left">娲惧伐鍒楄〃</el-divider>
+
+ <el-table
+ :data="dispatchList"
+ border
+ style="width: 100%; margin-top: 20px;"
+ :row-class-name="tableRowClassName"
+ >
+ <el-table-column label="搴忓彿" type="index" width="60" align="center" />
+ <el-table-column label="鍚堝悓鍙�" prop="salesContractNo" width="200" />
+ <el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" width="200" />
+ <!-- <el-table-column label="椤圭洰鍚嶇О" prop="projectName" width="250" /> -->
+ <el-table-column label="浜у搧澶х被" prop="productCategory" width="150" />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200" />
+ <el-table-column label="缁戝畾鏈哄櫒" prop="speculativeTradingName" width="120" />
+ <el-table-column label="鎬绘暟閲�" prop="quantity" width="100" align="right" />
+ <el-table-column label="宸叉帓浜�" prop="schedulingNum" width="100" align="right" fixed="right" />
+ <el-table-column label="寰呮帓浜�" prop="pendingQuantity" width="100" align="right" fixed="right" />
+ <el-table-column label="鏈鎺掍骇" width="150" align="center" fixed="right">
+ <template #default="{ row }">
+ <el-input-number
+ v-model="row.schedulingNum"
+ :min="0"
+ :max="row.pendingQuantity"
+ :step="1"
+ :precision="0"
+ size="small"
+ style="width: 120px"
+ @change="(value) => changeCurrentNum(value, row)"
+ />
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-form>
+
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="submitForm">纭娲惧伐</el-button>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import {ref, reactive, toRefs, computed} from "vue";
+import {productionDispatch, productionDispatchList} from "@/api/productionManagement/productionOrder.js";
+
+const { proxy } = getCurrentInstance()
+const emit = defineEmits(['close'])
+
+const dialogFormVisible = ref(false);
+const operationType = ref('')
+
+const data = reactive({
+ form: {},
+ dispatchList: [], // 娲惧伐鍒楄〃鏁版嵁
+});
+
+const { form, dispatchList } = toRefs(data);
+
+
+// 琛ㄦ牸琛屾牱寮�
+const tableRowClassName = ({ rowIndex }) => {
+ if (rowIndex % 2 === 1) {
+ return 'even-row'
+ }
+ return ''
+}
+
+// 淇敼鏈鎺掍骇鏁伴噺
+const changeCurrentNum = (value, row) => {
+ if (value > row.pendingQuantity) {
+ row.schedulingNum = row.pendingQuantity
+ proxy.$modal.msgWarning('鎺掍骇鏁伴噺涓嶅彲澶т簬寰呮帓浜ф暟閲�')
+ }
+}
+
+// 鎵撳紑寮规
+const openDialog = (type, rows) => {
+ operationType.value = type;
+ dialogFormVisible.value = true;
+
+ // 澶勭悊浼犲叆鐨勬暟鎹�
+ dispatchList.value = rows.map(row => ({
+ ...row,
+ schedulingNum: 0, // 鍒濆鍖栨湰娆℃帓浜ф暟閲忎负0
+ pendingQuantity: (Number(row.quantity) || 0) - (Number(row.schedulingNum) || 0) // 璁$畻寰呮帓浜ф暟閲�
+ }))
+}
+
+// 鎻愪氦琛ㄥ崟
+const submitForm = () => {
+ // 妫�鏌ユ槸鍚︽湁鎺掍骇鏁版嵁
+ const hasSchedulingData = dispatchList.value.some(item => item.schedulingNum > 0)
+ if (!hasSchedulingData) {
+ proxy.$modal.msgWarning('璇疯嚦灏戜负涓�鏉¤褰曡缃帓浜ф暟閲�')
+ return
+ }
+
+ // 鏋勯�犳彁浜ゆ暟鎹� - 鐩存帴浼犻�掓暟缁勶紝涓嶈繃婊�
+ const submitData = dispatchList.value
+
+ console.log('鎻愪氦鑷姩娲惧伐鏁版嵁:', submitData)
+
+ // 璋冪敤API锛堣繖閲岄渶瑕佹牴鎹疄闄呮帴鍙h皟鏁达級
+ productionDispatchList(submitData).then(res => {
+ proxy.$modal.msgSuccess(res.msg);
+ closeDia();
+ }).catch(err => {
+ proxy.$modal.msgError("娲惧伐澶辫触");
+ console.error('娲惧伐澶辫触:', err);
+ })
+}
+
+// 鍏抽棴寮规
+const closeDia = () => {
+ proxy.resetForm("formRef");
+ dialogFormVisible.value = false;
+ dispatchList.value = []
+ emit('close')
+};
+
+defineExpose({
+ openDialog,
+});
+</script>
+
+<style scoped>
+:deep(.even-row) {
+ background-color: #fafafa;
+}
+
+:deep(.el-table .cell) {
+ padding: 8px 12px;
+}
+
+:deep(.el-table th) {
+ background-color: #f5f7fa;
+ color: #606266;
+ font-weight: 600;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/productionManagement/productionDispatching/components/formDia.vue b/src/views/productionManagement/productionDispatching/components/formDia.vue
index a60f751..971bc6e 100644
--- a/src/views/productionManagement/productionDispatching/components/formDia.vue
+++ b/src/views/productionManagement/productionDispatching/components/formDia.vue
@@ -7,7 +7,7 @@
@close="closeDia"
>
<el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
- <el-row :gutter="30">
+ <!-- <el-row :gutter="30">
<el-col :span="12">
<el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
<el-input v-model="form.projectName" placeholder="璇疯緭鍏�" clearable disabled/>
@@ -16,6 +16,18 @@
<el-col :span="12">
<el-form-item label="浜у搧澶х被锛�" prop="productCategory">
<el-input v-model="form.productCategory" placeholder="璇疯緭鍏�" clearable disabled/>
+ </el-form-item>
+ </el-col>
+ </el-row> -->
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="specificationModel">
+ <el-input v-model="form.specificationModel" placeholder="璇疯緭鍏�" clearable disabled/>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁戝畾鏈哄櫒锛�" prop="speculativeTradingName">
+ <el-input v-model="form.speculativeTradingName" placeholder="鑷姩鑾峰彇" clearable disabled/>
</el-form-item>
</el-col>
</el-row>
@@ -46,6 +58,11 @@
/>
</el-form-item>
</el-col>
+ <el-col :span="12">
+ <el-form-item label="浜у搧澶х被锛�" prop="productCategory">
+ <el-input v-model="form.productCategory" placeholder="璇疯緭鍏�" clearable disabled/>
+ </el-form-item>
+ </el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
@@ -54,6 +71,9 @@
v-model="form.schedulingUserId"
placeholder="閫夋嫨浜哄憳"
style="width: 100%;"
+ filterable
+ default-first-option
+ :reserve-keyword="false"
>
<el-option
v-for="user in userList"
@@ -105,11 +125,13 @@
form: {
projectName: "",
productCategory: "",
+ specificationModel: "", // 瑙勬牸鍨嬪彿
quantity: "",
schedulingNum: "",
schedulingUserId: "",
schedulingDate: "",
pendingQuantity: "",
+ speculativeTradingName: "", // 缁戝畾鏈哄櫒鍚嶇О
},
rules: {
schedulingNum: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" },],
@@ -121,6 +143,7 @@
const userList = ref([])
const userStore = useUserStore()
+
// 鎵撳紑寮规
const openDialog = (type, row) => {
operationType.value = type;
diff --git a/src/views/productionManagement/productionDispatching/index.vue b/src/views/productionManagement/productionDispatching/index.vue
index 527880f..2d39890 100644
--- a/src/views/productionManagement/productionDispatching/index.vue
+++ b/src/views/productionManagement/productionDispatching/index.vue
@@ -1,5 +1,32 @@
<template>
<div class="app-container">
+ <!-- 鐐掓満1-4 灞曠ず锛堟�婚噺 / 姝e湪鐢熶骇閲� / 绌轰綑閲忥級 -->
+ <div class="machines-grid">
+ <div v-for="machine in machines" :key="machine.id" class="machine-card">
+ <div class="machine-title">{{ machine.name }}</div>
+ <div class="machine-metrics">
+ <div class="machine-control">
+ <span>鎬婚噺(kg)锛�</span>
+ <el-input-number v-model="machineData[machine.name].workLoad" :min="0" :step="1" size="small" />
+ </div>
+ <div><span> 棰勮鎶曞叆閲�(kg)锛�</span><span>{{ machineData[machine.name].currentWorkLoad }}</span></div>
+ <div><span>绌轰綑宸ヤ綔閲�(kg)锛�</span><span>{{ machineData[machine.name].vacant }}</span></div>
+ </div>
+ </div>
+ <div class="save-button-container">
+ <div class="loss-rate-container">
+ <span class="loss-rate-label">鎹熻�楃巼(%)锛�</span>
+ <el-select v-model="rate" placeholder="璇烽�夋嫨鎹熻�楃巼" style="width: 120px" size="small">
+ <el-option label="6" :value="6" />
+ <el-option label="7" :value="7" />
+ <el-option label="8" :value="8" />
+ <el-option label="9" :value="9" />
+ <el-option label="10" :value="10" />
+ </el-select>
+ </div>
+ <el-button type="primary" @click="saveMachineTotals" size="small">淇濆瓨璁剧疆</el-button>
+ </div>
+ </div>
<div class="search_form">
<div>
<span class="search_title">瀹㈡埛鍚嶇О锛�</span>
@@ -11,24 +38,40 @@
clearable
prefix-icon="Search"
/>
- <span class="search_title ml10">椤圭洰鍚嶇О锛�</span>
+ <span class="search_title ml10">鍚堝悓鍙凤細</span>
<el-input
- v-model="searchForm.projectName"
+ v-model="searchForm.salesContractNo"
style="width: 240px"
placeholder="璇疯緭鍏�"
@change="handleQuery"
clearable
prefix-icon="Search"
/>
+<!-- <span class="search_title ml10">椤圭洰鍚嶇О锛�</span>-->
+<!-- <el-input-->
+<!-- v-model="searchForm.projectName"-->
+<!-- style="width: 240px"-->
+<!-- placeholder="璇疯緭鍏�"-->
+<!-- @change="handleQuery"-->
+<!-- clearable-->
+<!-- prefix-icon="Search"-->
+<!-- />-->
<span class="search_title ml10">褰曞叆鏃ユ湡锛�</span>
<el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
- placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
+ placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
+ <el-checkbox
+ style="margin-left: 10px"
+ v-model="searchForm.status"
+ label="涓嶆樉绀哄緟鎺掓暟閲忎负0"
+ @change="handleQuery"
+ />
<el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
</div>
<div>
- <el-button type="primary" @click="openForm('add')">鐢熶骇娲惧伐</el-button>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- </div>
+ <el-button type="primary" @click="openForm('add')">鐢熶骇娲惧伐</el-button>
+ <el-button type="success" @click="openAutoDispatch">鑷姩娲惧伐</el-button>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ </div>
</div>
<div class="table_list">
<PIMTable
@@ -44,23 +87,27 @@
></PIMTable>
</div>
<form-dia ref="formDia" @close="handleQuery"></form-dia>
+ <auto-dispatch-dia ref="autoDispatchDia" @close="handleQuery"></auto-dispatch-dia>
</div>
</template>
<script setup>
-import {onMounted, ref} from "vue";
+import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick, computed, watch} from "vue";
import FormDia from "@/views/productionManagement/productionDispatching/components/formDia.vue";
+import AutoDispatchDia from "@/views/productionManagement/productionDispatching/components/autoDispatchDia.vue";
import dayjs from "dayjs";
-import {schedulingListPage} from "@/api/productionManagement/productionOrder.js";
+import {schedulingListPage, schedulingList, addSpeculatTrading, updateSpeculatTrading, getLossRate, addLossRate, updateLossRate} from "@/api/productionManagement/productionOrder.js";
import { ElMessageBox } from "element-plus";
const data = reactive({
searchForm: {
customerName: "",
+ salesContractNo: "",
projectName: "",
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
+ status: true,
+ entryDate: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")], // 褰曞叆鏃ユ湡锛岄粯璁ゅ綋澶�
+ entryDateStart: dayjs().format("YYYY-MM-DD"),
+ entryDateEnd: dayjs().format("YYYY-MM-DD"),
},
});
const { searchForm } = toRefs(data);
@@ -71,19 +118,9 @@
width: 220,
},
{
- label: "瀹㈡埛鍚堝悓鍙�",
- prop: "customerContractNo",
- width: 250,
- },
- {
label: "瀹㈡埛鍚嶇О",
prop: "customerName",
width: 250,
- },
- {
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width:300
},
{
label: "浜у搧澶х被",
@@ -93,7 +130,12 @@
{
label: "瑙勬牸鍨嬪彿",
prop: "specificationModel",
- width: 220,
+ width: 120,
+ },
+ {
+ label: "缁戝畾鏈哄櫒",
+ prop: "speculativeTradingName",
+ width: 160,
},
{
label: "鍗曚綅",
@@ -104,6 +146,32 @@
label: "褰曞叆鏃ユ湡",
prop: "entryDate",
width: 120,
+ },
+ {
+ label: "鐘舵��",
+ prop: "status",
+ dataType: "tag",
+ formatType: (params) => {
+ if (params == '鐢熶骇涓�') {
+ return "warning";
+ } else if (params == '鏈紑濮�') {
+ return "danger";
+ } else {
+ return "success";
+ }
+ },
+ },
+ {
+ label: "鐢熶骇杩涘害",
+ prop: "progress",
+ formatData: (cellValue) => {
+ // 濡傛灉鍊间负绌烘垨undefined锛屾樉绀虹┖瀛楃涓�
+ if (cellValue === null || cellValue === undefined || cellValue === '') {
+ return '';
+ }
+ // 鐩存帴鍦ㄦ暟瀛楀悗闈㈡坊鍔犵櫨鍒嗗彿
+ return `${cellValue}%`;
+ }
},
{
label: "鏁伴噺",
@@ -118,6 +186,7 @@
label: "寰呮帓鏁伴噺",
prop: "pendingQuantity",
width: 100,
+ fixed: 'right',
},
]);
const tableData = ref([]);
@@ -129,7 +198,140 @@
total: 0,
});
const formDia = ref()
+const autoDispatchDia = ref()
const { proxy } = getCurrentInstance()
+
+// 鐐掓満鏁版嵁
+const machineData = reactive({
+ "鐐掓満1": { workLoad: 0, currentWorkLoad: 0, vacant: 0 },
+ "鐐掓満2": { workLoad: 0, currentWorkLoad: 0, vacant: 0 },
+ "鐐掓満3": { workLoad: 0, currentWorkLoad: 0, vacant: 0 },
+ "鐐掓満4": { workLoad: 0, currentWorkLoad: 0, vacant: 0 }
+})
+
+// 鐐掓満閰嶇疆鏁扮粍
+const machines = [
+ { id: 1, name: '鐐掓満1' },
+ { id: 2, name: '鐐掓満2' },
+ { id: 3, name: '鐐掓満3' },
+ { id: 4, name: '鐐掓満4' }
+]
+
+// 淇濆瓨鐐掓満鎬婚噺璁剧疆
+const saveMachineTotals = () => {
+ // 楠岃瘉鎹熻�楃巼鏄惁宸查�夋嫨
+ if (rate.value === null || rate.value === undefined || isNaN(rate.value)) {
+ proxy.$message.warning('璇烽�夋嫨鎹熻�楃巼');
+ return;
+ }
+
+ // 鏋勯�犱繚瀛樻暟鎹暟缁勶紝浣跨敤machines鏁扮粍寰幆鏋勫缓
+ const saveData = machines.map(machine => {
+ const saveItem = {
+ name: machine.name, // 鐐掓満鍚嶇О
+ workLoad: machineData[machine.name].workLoad, // 鎬婚噺
+ currentWorkLoad: machineData[machine.name].currentWorkLoad, // 棰勮鎶曞叆閲�
+ vacant: machineData[machine.name].vacant // 绌轰綑閲�
+ };
+
+ // 濡傛灉鏄慨鏀规搷浣滐紝闇�瑕佷紶閫抜d瀛楁
+ if (hasQueryData.value) {
+ const queryData = getMachineQueryData(machine.id);
+ if (queryData && queryData.id) {
+ saveItem.id = queryData.id;
+ }
+ }
+
+ return saveItem;
+ });
+
+ // 鏋勯�犳崯鑰楃巼鏁版嵁
+ const rateData = {
+ rate: rate.value
+ };
+
+ // 濡傛灉鏈塈D锛岃鏄庢槸淇敼鎿嶄綔
+ if (rateId.value) {
+ rateData.id = rateId.value;
+ }
+
+ // 鏍规嵁鏄惁鏈夋煡璇㈡暟鎹喅瀹氳皟鐢ㄦ柊澧炴帴鍙h繕鏄慨鏀规帴鍙�
+ const saveApi = hasQueryData.value ? updateSpeculatTrading : addSpeculatTrading;
+ const successMessage = hasQueryData.value ? '鐐掓満璁剧疆淇敼鎴愬姛' : '鐐掓満璁剧疆鏂板鎴愬姛';
+
+ // 鏍规嵁鏄惁鏈塈D鍐冲畾璋冪敤鏂板鎺ュ彛杩樻槸淇敼鎺ュ彛
+ const rateApi = rateId.value ? updateLossRate : addLossRate;
+ const rateSuccessMessage = rateId.value ? '鎹熻�楃巼淇敼鎴愬姛' : '鎹熻�楃巼鏂板鎴愬姛';
+
+ // 骞惰璋冪敤涓や釜鎺ュ彛
+ Promise.all([
+ saveApi(saveData),
+ rateApi(rateData)
+ ]).then(([saveRes, rateRes]) => {
+ proxy.$message.success(successMessage);
+ proxy.$message.success(rateSuccessMessage);
+
+ // 淇濆瓨鎴愬姛鍚庯紝璁剧疆hasQueryData涓簍rue锛屼笅娆′繚瀛樺皢璋冪敤淇敼鎺ュ彛
+ if (!hasQueryData.value) {
+ hasQueryData.value = true;
+ }
+
+ // 濡傛灉杩斿洖浜咺D锛屼繚瀛樿捣鏉�
+ if (rateRes && rateRes.data && rateRes.data.id) {
+ rateId.value = rateRes.data.id;
+ }
+
+ // 淇濆瓨鎴愬姛鍚庨噸鏂拌皟鐢ㄦ煡璇㈤〉闈�
+ getList();
+ }).catch(err => {
+ proxy.$message.error('淇濆瓨澶辫触');
+ console.error('淇濆瓨澶辫触:', err);
+ });
+}
+
+// 鑾峰彇鐐掓満鏌ヨ鏁版嵁
+const machineQueryData = ref([]);
+
+const getMachineQueryData = (machineId) => {
+ return machineQueryData.value.find(item => item.id === machineId);
+};
+
+const getMachineIndex = (item) => {
+ // 鍏煎澶氱瀛楁鍛藉悕锛岃繑鍥� 1-4 涔嬩竴锛屽惁鍒欒繑鍥� 0锛堟湭鐭ワ級
+ const candidates = [item.machineId, item.machineNo, item.machine, item.deviceNo, item.deviceId]
+ for (const v of candidates) {
+ if (v === undefined || v === null) continue
+ const n = Number(String(v).replace(/[^\d]/g, "")) // 鎶藉彇鏁板瓧
+ if ([1,2,3,4].includes(n)) return n
+ }
+ return 0
+}
+
+const computeTodaySummary = () => {
+ const todayStr = dayjs().format("YYYY-MM-DD")
+
+ // 閲嶇疆鎵�鏈夌倰鏈烘暟鎹�
+ machines.forEach(machine => {
+ machineData[machine.name] = { workLoad: 0, currentWorkLoad: 0, vacant: 0 }
+ })
+
+ tableData.value.forEach(item => {
+ // 浠呯粺璁″綋澶�
+ const isToday = dayjs(item.entryDate).format("YYYY-MM-DD") === todayStr
+ if (!isToday) return
+
+ // 浣跨敤姝g‘鐨勫瓧娈靛悕锛歸orkLoad锛堢倰鏈哄伐浣滈噺锛�, currentWorkLoad锛堢倰鏈烘鍦ㄥ伐浣滈噺锛�
+ const workLoad = Number(item.workLoad) || 0
+ const currentWorkLoad = Number(item.currentWorkLoad) || 0
+ const machineName = item.speculativeTradingName || '鐐掓満1'
+
+ if (machineData[machineName]) {
+ machineData[machineName].workLoad += workLoad
+ machineData[machineName].currentWorkLoad += currentWorkLoad
+ machineData[machineName].vacant = machineData[machineName].workLoad - machineData[machineName].currentWorkLoad
+ }
+ })
+}
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -137,6 +339,56 @@
page.current = 1;
getList();
};
+
+// 鏄惁鏈夋煡璇㈡暟鎹�
+const hasQueryData = ref(false)
+// 鎹熻�楃巼
+const rate = ref(6)
+// 鎹熻�楃巼ID
+const rateId = ref(null)
+
+// 鑾峰彇鐐掓満姝e湪宸ヤ綔閲忔暟鎹�
+const getMachineProductionData = () => {
+ schedulingList().then((res) => {
+ // 澶勭悊鐐掓満姝e湪宸ヤ綔閲忔暟鎹�
+ if (res.data && Array.isArray(res.data)) {
+ // 璁剧疆鏄惁鏈夋煡璇㈡暟鎹�
+ hasQueryData.value = res.data.length > 0
+
+ // 淇濆瓨鏌ヨ鏁版嵁鍒癿achineQueryData
+ machineQueryData.value = res.data;
+
+ // 閲嶇疆鎵�鏈夌倰鏈烘暟鎹�
+ machines.forEach(machine => {
+ machineData[machine.name] = { workLoad: 0, currentWorkLoad: 0, vacant: 0 }
+ });
+
+ // 閬嶅巻鏁版嵁锛屾牴鎹煡璇㈣繑鍥炵殑鏁版嵁缁撴瀯澶勭悊
+ res.data.forEach(item => {
+ // 鏍规嵁name瀛楁纭畾鐐掓満
+ const machineName = item.name || '鐐掓満1';
+
+ if (machineData[machineName]) {
+ // 濡傛灉鏌ヨ鏁版嵁涓湁workLoad锛屽垯鍒濆鍖栫倰鏈烘�婚噺
+ if (item.workLoad !== null && item.workLoad !== undefined) {
+ machineData[machineName].workLoad = Number(item.workLoad) || 0;
+ }
+
+ // 濡傛灉鏌ヨ鏁版嵁涓湁currentWorkLoad锛屽垯璁剧疆姝e湪宸ヤ綔閲�
+ if (item.currentWorkLoad !== null && item.currentWorkLoad !== undefined) {
+ machineData[machineName].currentWorkLoad = Number(item.currentWorkLoad) || 0;
+ }
+
+ // 璁$畻绌轰綑宸ヤ綔閲�
+ machineData[machineName].vacant = machineData[machineName].workLoad - machineData[machineName].currentWorkLoad;
+ }
+ });
+ }
+ }).catch(err => {
+ console.error('鑾峰彇鐐掓満姝e湪宸ヤ綔閲忔暟鎹け璐�:', err);
+ });
+};
+
const changeDaterange = (value) => {
if (value) {
searchForm.value.entryDateStart = value[0];
@@ -165,9 +417,33 @@
pendingQuantity: (Number(item.quantity) || 0) - (Number(item.schedulingNum) || 0)
}));
page.total = res.data.total;
+ computeTodaySummary()
+
+ // 鍚屾椂鑾峰彇鐐掓満姝e湪宸ヤ綔閲忔暟鎹�
+ getMachineProductionData();
+ // 鑾峰彇鎹熻�楃巼鏁版嵁
+ getLossRateData();
}).catch(() => {
tableLoading.value = false;
})
+};
+
+// 鑾峰彇鎹熻�楃巼鏁版嵁
+const getLossRateData = () => {
+ getLossRate().then((res) => {
+ const data = res.data || res;
+ if (data && data.rate !== undefined && data.rate !== null) {
+ rate.value = Number(data.rate); // 纭繚杞崲涓烘暟瀛�
+ rateId.value = data.id || null;
+ } else {
+ rate.value = 6;
+ rateId.value = null;
+ }
+ }).catch(err => {
+ console.error('鑾峰彇鎹熻�楃巼鏁版嵁澶辫触:', err);
+ rate.value = 6;
+ rateId.value = null;
+ });
};
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
@@ -189,6 +465,26 @@
})
};
+// 鎵撳紑鑷姩娲惧伐寮规
+const openAutoDispatch = () => {
+ if (selectedRows.value.length === 0) {
+ proxy.$message.error("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
+ return;
+ }
+
+ // 杩囨护鎺夊緟鎺掍骇鏁伴噺涓�0鐨勬暟鎹�
+ const validRows = selectedRows.value.filter(row => row.pendingQuantity > 0);
+
+ if (validRows.length === 0) {
+ proxy.$message.warning("閫変腑鐨勬暟鎹棤闇�娲惧伐");
+ return;
+ }
+
+ nextTick(() => {
+ autoDispatchDia.value?.openDialog('auto', validRows)
+ })
+};
+
// 瀵煎嚭
const handleOut = () => {
ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
@@ -206,7 +502,129 @@
onMounted(() => {
getList();
+ getLossRateData();
});
</script>
-<style scoped></style>
+<style scoped>
+.summary-bar{
+ display: flex;
+ gap: 16px;
+ margin: 10px 0 16px 0;
+}
+.summary-item{
+ background: #f5f7fa;
+ border: 1px solid #ebeef5;
+ border-radius: 6px;
+ padding: 10px 16px;
+ min-width: 160px;
+}
+.summary-label{
+ color: #909399;
+ font-size: 12px;
+ margin-bottom: 6px;
+}
+.summary-value{
+ color: #303133;
+ font-size: 20px;
+ font-weight: 600;
+}
+.summary-control{
+ display: flex;
+ align-items: center;
+ height: 28px;
+}
+.machines-grid{
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 16px;
+ margin-bottom: 20px;
+ padding: 16px;
+ background: #f8f9fa;
+ border-radius: 8px;
+ border: 1px solid #e9ecef;
+}
+.machine-card{
+ border: 1px solid #dee2e6;
+ border-radius: 8px;
+ padding: 16px;
+ background: #fff;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.05);
+ transition: all 0.3s ease;
+}
+.machine-card:hover{
+ transform: translateY(-2px);
+ box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+}
+.machine-title{
+ font-weight: 600;
+ font-size: 16px;
+ margin-bottom: 12px;
+ color: #2c3e50;
+ text-align: center;
+ padding-bottom: 8px;
+ border-bottom: 2px solid #3498db;
+}
+.machine-metrics{
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ color: #495057;
+}
+.machine-control{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ padding: 8px 0;
+ border-bottom: 1px solid #f1f3f4;
+}
+.machine-control span{
+ font-size: 14px;
+ white-space: nowrap;
+ color: #6c757d;
+ font-weight: 500;
+}
+.machine-metrics > div:not(.machine-control) {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 4px 0;
+ font-size: 14px;
+}
+.machine-metrics > div:not(.machine-control) span:first-child {
+ color: #6c757d;
+}
+.machine-metrics > div:not(.machine-control) span:last-child {
+ font-weight: 600;
+ color: #2c3e50;
+}
+.save-button-container{
+ grid-column: 1 / -1;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 16px;
+ margin-top: 16px;
+ padding-top: 16px;
+ border-top: 1px solid #e9ecef;
+}
+.loss-rate-container{
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+.loss-rate-label{
+ font-size: 14px;
+ color: #6c757d;
+ font-weight: 500;
+ white-space: nowrap;
+}
+</style>
+
+
+
+
+
+
+
diff --git a/src/views/productionManagement/productionOrder/ProcessRouteItemForm.vue b/src/views/productionManagement/productionOrder/ProcessRouteItemForm.vue
new file mode 100644
index 0000000..354f9de
--- /dev/null
+++ b/src/views/productionManagement/productionOrder/ProcessRouteItemForm.vue
@@ -0,0 +1,555 @@
+<template>
+ <div>
+ <el-dialog v-model="isShow"
+ title="宸ヨ壓璺嚎椤圭洰"
+ width="800px"
+ @close="closeModal">
+ <div class="operate-button">
+ <el-button type="primary"
+ @click="isShowProductSelectDialog = true"
+ class="mb5"
+ style="margin-bottom: 10px;">
+ 閫夋嫨浜у搧
+ </el-button>
+ <el-switch v-model="isTable"
+ inline-prompt
+ active-text="琛ㄦ牸"
+ inactive-text="鍒楄〃"
+ @change="handleViewChange" />
+ </div>
+ <el-table v-if="isTable"
+ ref="multipleTable"
+ v-loading="tableLoading"
+ border
+ :data="routeItems"
+ :header-cell-style="{ background: '#F0F1F5', color: '#333333' }"
+ row-key="id"
+ tooltip-effect="dark"
+ class="lims-table"
+ style="cursor: move;">
+ <el-table-column align="center"
+ label="搴忓彿"
+ width="60">
+ <template #default="scope">
+ {{ scope.$index + 1 }}
+ </template>
+ </el-table-column>
+ <el-table-column v-for="(item, index) in tableColumn"
+ :key="index"
+ :label="item.label"
+ :width="item.width"
+ show-overflow-tooltip>
+ <template #default="scope"
+ v-if="item.dataType === 'action'">
+ <el-button v-for="(op, opIndex) in item.operation"
+ :key="opIndex"
+ :type="op.type"
+ :link="op.link"
+ size="small"
+ @click.stop="op.clickFun(scope.row)">
+ {{ op.name }}
+ </el-button>
+ </template>
+ <template #default="scope"
+ v-else>
+ <template v-if="item.prop === 'processId'">
+ <el-select v-model="scope.row[item.prop]"
+ style="width: 100%;"
+ @mousedown.stop>
+ <el-option v-for="process in processOptions"
+ :key="process.id"
+ :label="process.name"
+ :value="process.id" />
+ </el-select>
+ </template>
+ <template v-else>
+ {{ scope.row[item.prop] || '-' }}
+ </template>
+ </template>
+ </el-table-column>
+ </el-table>
+ <!-- 浣跨敤鏅�歞iv鏇夸唬el-steps -->
+ <div v-else
+ ref="stepsContainer"
+ class="mb5 custom-steps"
+ style="padding: 10px 0; display: flex; flex-wrap: nowrap; gap: 20px; align-items: flex-start;">
+ <div v-for="(item, index) in routeItems"
+ :key="item.id"
+ class="custom-step draggable-step"
+ :data-id="item.id"
+ style="cursor: move; flex: 0 0 auto; min-width: 220px;">
+ <div class="step-content">
+ <div class="step-number">{{ index + 1 }}</div>
+ <el-card :header="item.productName"
+ class="step-card"
+ style="cursor: move;">
+ <div class="step-card-content">
+ <p>{{ item.model }}</p>
+ <p>{{ item.unit }}</p>
+ <el-select v-model="item.processId"
+ style="width: 100%;"
+ @mousedown.stop>
+ <el-option v-for="process in processOptions"
+ :key="process.id"
+ :label="process.name"
+ :value="process.id" />
+ </el-select>
+ </div>
+ <template #footer>
+ <div class="step-card-footer">
+ <el-button type="danger"
+ link
+ size="small"
+ @click.stop="removeItemByID(item.id)">鍒犻櫎</el-button>
+ </div>
+ </template>
+ </el-card>
+ </div>
+ </div>
+ </div>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary"
+ @click="handleSubmit">纭</el-button>
+ <el-button @click="closeModal">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ <ProductSelectDialog v-model="isShowProductSelectDialog"
+ @confirm="handelSelectProducts" />
+ </div>
+</template>
+
+<script setup>
+ import {
+ ref,
+ computed,
+ getCurrentInstance,
+ onMounted,
+ onUnmounted,
+ nextTick,
+ } from "vue";
+ import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
+ import {
+ findProductProcessRouteItemList,
+ addOrUpdateProductProcessRouteItem,
+ deleteRouteItem,
+ } from "@/api/productionManagement/productProcessRoute.js";
+ import { processList } from "@/api/productionManagement/productionProcess.js";
+ import Sortable from "sortablejs";
+
+ const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ default: false,
+ },
+ record: {
+ type: Object,
+ required: true,
+ default: () => ({}),
+ },
+ });
+
+ const emit = defineEmits(["update:visible", "completed"]);
+
+ const processOptions = ref([]);
+ const tableLoading = ref(false);
+ const isShowProductSelectDialog = ref(false);
+ const routeItems = ref([]);
+ let tableSortable = null;
+ let stepsSortable = null;
+ const multipleTable = ref(null);
+ const stepsContainer = ref(null);
+ const isTable = ref(true);
+
+ const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit("update:visible", val);
+ },
+ });
+
+ const tableColumn = ref([
+ { label: "浜у搧鍚嶇О", prop: "productName", width: 180 },
+ { label: "瑙勬牸鍚嶇О", prop: "model", width: 150 },
+ { label: "鍗曚綅", prop: "unit", width: 80 },
+ { label: "宸ュ簭鍚嶇О", prop: "processId", width: 180 },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 100,
+ operation: [
+ {
+ name: "鍒犻櫎",
+ type: "danger",
+ link: true,
+ clickFun: row => {
+ console.log(row.id, "鍒犻櫎");
+
+ const dragSortx = routeItems.value.findIndex(
+ item => item.dragSort === row.dragSort
+ );
+ const idx = routeItems.value.findIndex(item => item.id === row.id);
+ console.log(idx, "idx");
+ if (row.id) {
+ deleteRouteItemByIds({ id: row.id }, idx);
+ } else {
+ removeItem(dragSortx);
+ }
+ },
+ },
+ ],
+ },
+ ]);
+
+ const removeItem = index => {
+ console.log("杞垹闄�", index);
+
+ routeItems.value.splice(index, 1);
+ updateDragSort();
+ nextTick(() => initSortable());
+ };
+
+ const removeItemByID = id => {
+ const idx = routeItems.value.findIndex(item => item.id === id);
+ if (idx > -1) {
+ routeItems.value.splice(idx, 1);
+ updateDragSort();
+ nextTick(() => initSortable());
+ }
+ };
+
+ const deleteRouteItemByIds = (ids, index) => {
+ deleteRouteItem(ids).then(res => {
+ routeItems.value.splice(index, 1);
+ updateDragSort();
+ nextTick(() => initSortable());
+ });
+ };
+
+ const closeModal = () => {
+ isShow.value = false;
+ };
+
+ const updateDragSort = () => {
+ routeItems.value.forEach((item, index) => {
+ item.dragSort = index + 1;
+ });
+ routeItems.value = [...routeItems.value];
+ console.log("鏇存柊鍚庣殑鏁扮粍:", routeItems.value);
+ };
+
+ const handelSelectProducts = products => {
+ destroySortable();
+
+ // 璁$畻鏂扮殑dragSort鍊艰捣濮嬬偣
+ const maxDragSort =
+ routeItems.value.length > 0
+ ? Math.max(...routeItems.value.map(item => item.dragSort || 0))
+ : 0;
+
+ const newData = products.map(({ id, ...product }, index) => ({
+ ...product,
+ productModelId: id,
+ routeId: props.record.id,
+ // id: `${Date.now()}-${Math.random().toString(36).slice(2)}`,
+ processId: undefined,
+ dragSort: maxDragSort + index + 1,
+ }));
+
+ console.log("閫夋嫨浜у搧鍓嶆暟缁�:", routeItems.value);
+ routeItems.value.push(...newData);
+ updateDragSort();
+ console.log("閫夋嫨浜у搧鍚庢暟缁�:", routeItems.value);
+
+ // 寤惰繜鍒濆鍖栵紝纭繚DOM瀹屽叏娓叉煋
+ nextTick(() => {
+ // 寮哄埗閲嶆柊娓叉煋缁勪欢
+ if (proxy?.$forceUpdate) {
+ proxy.$forceUpdate();
+ }
+
+ const temp = [...routeItems.value];
+ routeItems.value = [];
+ nextTick(() => {
+ routeItems.value = temp;
+ initSortable();
+ });
+ });
+ };
+
+ const findProcessRouteItems = () => {
+ tableLoading.value = true;
+ findProductProcessRouteItemList({ orderId: props.record.id })
+ .then(res => {
+ tableLoading.value = false;
+ routeItems.value = res.data.map(item => ({
+ ...item,
+ processId: item.processId === 0 ? undefined : item.processId,
+ }));
+ // 寤惰繜鍒濆鍖栵紝纭繚DOM瀹屽叏娓叉煋
+ nextTick(() => {
+ setTimeout(() => initSortable(), 100);
+ });
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ console.error("鑾峰彇鍒楄〃澶辫触锛�", err);
+ });
+ };
+
+ const findProcessList = () => {
+ processList({})
+ .then(res => {
+ processOptions.value = res.data;
+ })
+ .catch(err => {
+ console.error("鑾峰彇宸ュ簭澶辫触锛�", err);
+ });
+ };
+
+ const { proxy } = getCurrentInstance() || {};
+
+ const handleSubmit = () => {
+ const hasEmptyProcess = routeItems.value.some(item => !item.processId);
+ if (hasEmptyProcess) {
+ proxy?.$modal?.msgError("璇蜂负鎵�鏈夐」鐩�夋嫨宸ュ簭");
+ return;
+ }
+
+ addOrUpdateProductProcessRouteItem({
+ routeId: props.record.id,
+ processRouteItem: routeItems.value,
+ })
+ .then(res => {
+ isShow.value = false;
+ emit("completed");
+ proxy?.$modal?.msgSuccess("鎻愪氦鎴愬姛");
+ })
+ .catch(err => {
+ proxy?.$modal?.msgError(`鎻愪氦澶辫触锛�${err.msg || "缃戠粶寮傚父"}`);
+ });
+ };
+
+ const destroySortable = () => {
+ if (tableSortable) {
+ tableSortable.destroy();
+ tableSortable = null;
+ }
+ if (stepsSortable) {
+ stepsSortable.destroy();
+ stepsSortable = null;
+ }
+ };
+
+ const initSortable = () => {
+ destroySortable();
+
+ if (isTable.value) {
+ if (!multipleTable.value) return;
+ const tbody =
+ multipleTable.value.$el.querySelector(".el-table__body tbody") ||
+ multipleTable.value.$el.querySelector(
+ ".el-table__body-wrapper > table > tbody"
+ );
+ if (!tbody) return;
+
+ tableSortable = new Sortable(tbody, {
+ animation: 150,
+ ghostClass: "sortable-ghost",
+ handle: ".el-table__row",
+ filter: ".el-button, .el-select",
+ onEnd: evt => {
+ if (evt.oldIndex === evt.newIndex || !routeItems.value[evt.oldIndex])
+ return;
+
+ // 浣跨敤鏁扮粍 splice 鏂规硶閲嶆柊鎺掑簭锛屼笌琛ㄦ牸妯″紡淇濇寔涓�鑷�
+ const moveItem = routeItems.value.splice(evt.oldIndex, 1)[0];
+ routeItems.value.splice(evt.newIndex, 0, moveItem);
+ updateDragSort();
+ console.log("鎺掑簭鍚庢暟缁�:", routeItems.value);
+ },
+ });
+ } else {
+ if (!stepsContainer.value) return;
+
+ // 淇敼锛氱洿鎺ヤ娇鐢╯tepsContainer.value浣滀负鎷栨嫿瀹瑰櫒
+ const stepsList = stepsContainer.value;
+ if (!stepsList) {
+ console.warn("鏈壘鍒版楠ゆ潯鎷栨嫿瀹瑰櫒");
+ return;
+ }
+
+ // 淇敼锛氱畝鍖栨嫋鎷介厤缃�
+ stepsSortable = new Sortable(stepsList, {
+ animation: 150,
+ ghostClass: "sortable-ghost",
+ draggable: ".draggable-step", // 鍙嫋鎷藉厓绱�
+ handle: ".draggable-step, .step-card", // 鎷栨嫿鎵嬫焺
+ filter: ".el-button, .el-select, .el-input", // 杩囨护鎸夐挳/閫夋嫨鍣�
+ forceFallback: true,
+ fallbackClass: "sortable-fallback",
+ preventOnFilter: true,
+ scroll: true,
+ scrollSensitivity: 30,
+ scrollSpeed: 10,
+ bubbleScroll: true,
+ onEnd: evt => {
+ if (evt.oldIndex === evt.newIndex || !routeItems.value[evt.oldIndex])
+ return;
+
+ // 浣跨敤鏁扮粍 splice 鏂规硶閲嶆柊鎺掑簭
+ const moveItem = routeItems.value.splice(evt.oldIndex, 1)[0];
+ routeItems.value.splice(evt.newIndex, 0, moveItem);
+ updateDragSort();
+ },
+ });
+
+ // 璋冭瘯锛氭墦鍗板鍣ㄥ拰瀹炰緥锛岀‘璁ょ粦瀹氭垚鍔�
+ console.log("姝ラ鏉℃嫋鎷藉鍣�:", stepsList);
+ console.log("Sortable瀹炰緥:", stepsSortable);
+ }
+ };
+
+ const handleViewChange = () => {
+ destroySortable();
+ // 寤惰繜鍒濆鍖栵紝纭繚瑙嗗浘鍒囨崲鍚嶥OM瀹屽叏娓叉煋
+ nextTick(() => {
+ setTimeout(() => initSortable(), 100);
+ });
+ };
+
+ onMounted(() => {
+ findProcessRouteItems();
+ findProcessList();
+ });
+
+ onUnmounted(() => {
+ destroySortable();
+ });
+
+ defineExpose({
+ closeModal,
+ handleSubmit,
+ isShow,
+ });
+</script>
+
+<style scoped>
+ :deep(.sortable-ghost) {
+ opacity: 0.6;
+ background-color: #f5f7fa !important;
+ }
+
+ :deep(.el-table__row) {
+ transition: background-color 0.2s;
+ }
+
+ :deep(.el-table__row:hover) {
+ background-color: #f9fafc !important;
+ }
+
+ :deep(.el-card__footer) {
+ padding: 0 !important;
+ }
+
+ .operate-button {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+
+ /* 淇敼锛氳嚜瀹氫箟姝ラ鏉″鍣ㄦ牱寮� */
+ .custom-steps {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: flex-start;
+ gap: 20px;
+ min-height: 100px;
+ }
+
+ /* 淇敼锛氳嚜瀹氫箟姝ラ椤规牱寮� */
+ .custom-step {
+ cursor: move !important;
+ padding: 8px;
+ position: relative;
+ transition: all 0.2s ease;
+ flex: 0 0 auto;
+ min-width: 220px;
+ touch-action: none;
+ }
+
+ /* 鎷栨嫿鎮诞鏍峰紡锛屾彁绀哄彲鎷栨嫿 */
+ .custom-step:hover {
+ background-color: rgba(64, 158, 255, 0.05);
+ transform: translateY(-2px);
+ }
+
+ .sortable-ghost {
+ opacity: 0.4;
+ background-color: #f5f7fa !important;
+ border: 2px dashed #409eff;
+ margin: 10px;
+ transform: scale(1.02);
+ }
+
+ .sortable-fallback {
+ opacity: 0.9;
+ background-color: #f5f7fa;
+ border: 1px solid #409eff;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
+ transform: rotate(2deg);
+ margin: 10px;
+ }
+
+ .step-card {
+ cursor: move !important;
+ transition: box-shadow 0.2s ease;
+ user-select: none;
+ -webkit-user-select: none;
+ pointer-events: auto;
+ margin: 10px;
+ height: 240px;
+ }
+
+ .step-card:hover {
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
+ }
+
+ .step-content {
+ width: 220px;
+ user-select: none;
+ }
+
+ .step-card-content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ }
+
+ .step-card-footer {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ padding: 10px;
+ }
+
+ /* 鑷畾涔夊簭鍙锋牱寮忎紭鍖� */
+ .step-number {
+ font-weight: bold;
+ text-align: center;
+ width: 36px;
+ height: 36px;
+ line-height: 36px;
+ margin: 0 auto 10px;
+ background: #409eff;
+ color: #fff;
+ border-radius: 50%;
+ font-size: 14px;
+ }
+</style>
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index f35670a..c175d33 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -1,198 +1,211 @@
<template>
- <div class="app-container">
- <div class="search_form">
- <div>
- <span class="search_title">瀹㈡埛鍚嶇О锛�</span>
- <el-input
- v-model="searchForm.customerName"
- style="width: 240px"
- placeholder="璇疯緭鍏�"
- @change="handleQuery"
- clearable
- prefix-icon="Search"
- />
- <span class="search_title ml10">椤圭洰鍚嶇О锛�</span>
- <el-input
- v-model="searchForm.projectName"
- style="width: 240px"
- placeholder="璇疯緭鍏�"
- @change="handleQuery"
- clearable
- prefix-icon="Search"
- />
- <span class="search_title ml10">褰曞叆鏃ユ湡锛�</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
- >
- </div>
- <div>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- </div>
- </div>
- <div class="table_list">
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :page="page"
- :tableLoading="tableLoading"
- @pagination="pagination"
- ></PIMTable>
- </div>
- </div>
+ <div class="app-container">
+ <div class="search_form">
+ <el-form :model="searchForm"
+ :inline="true">
+ <el-form-item label="瀹㈡埛鍚嶇О:">
+ <el-input v-model="searchForm.customerName"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="鍚堝悓鍙�:">
+ <el-input v-model="searchForm.salesContractNo"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="椤圭洰鍚嶇О:">
+ <el-input v-model="searchForm.projectName"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="浜у搧鍚嶇О:">
+ <el-input v-model="searchForm.productCategory"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="瑙勬牸:">
+ <el-input v-model="searchForm.specificationModel"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary"
+ @click="handleQuery">鎼滅储</el-button>
+ </el-form-item>
+ </el-form>
+ <div>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ </div>
+ </div>
+ <div class="table_list">
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :tableLoading="tableLoading"
+ @pagination="pagination"></PIMTable>
+ </div>
+ <process-route-item-form v-if="isShowItemModal"
+ v-model:visible="isShowItemModal"
+ :record="record"
+ @completed="getList" />
+ </div>
</template>
<script setup>
-import {onMounted, ref} from "vue";
-import { ElMessageBox } from "element-plus";
-import dayjs from "dayjs";
-import {schedulingListPage} from "@/api/productionManagement/productionOrder.js";
-const { proxy } = getCurrentInstance();
+ import { onMounted, ref } from "vue";
+ import { ElMessageBox } from "element-plus";
+ import dayjs from "dayjs";
+ import { productOrderListPage } from "@/api/productionManagement/productionOrder.js";
+ const { proxy } = getCurrentInstance();
+ import ProcessRouteItemForm from "@/views/productionManagement/productionOrder/ProcessRouteItemForm.vue";
-const tableColumn = ref([
- {
- label: "褰曞叆鏃ユ湡",
- prop: "entryDate",
- width: 120,
- },
- {
- label: "鍚堝悓鍙�",
- prop: "salesContractNo",
- width: 220,
- },
- {
- label: "瀹㈡埛鍚堝悓鍙�",
- prop: "customerContractNo",
- width: 250,
- },
- {
- label: "瀹㈡埛鍚嶇О",
- prop: "customerName",
- width: 250,
- },
- {
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width:300
- },
- {
- label: "鐢熶骇鐘舵��",
- prop: "status",
- dataType: "tag",
- formatType: (params) => {
- if (params == '鏈畬鎴�') {
- return "danger";
- } else if (params == '宸插畬鎴�') {
- return "success";
- } else {
- return null;
- }
- },
- },
- {
- label: "浜у搧澶х被",
- prop: "productCategory",
- width: 160,
- },
- {
- label: "瑙勬牸鍨嬪彿",
- prop: "specificationModel",
- width: 220,
- },
- {
- label: "鍗曚綅",
- prop: "unit",
- width:90
- },
- {
- label: "鏁伴噺",
- prop: "quantity",
- },
- {
- label: "鎺掍骇鏁伴噺",
- prop: "schedulingNum",
- width: 100,
- },
- {
- label: "瀹屽伐鏁伴噺",
- prop: "successNum",
- width: 100,
- },
-]);
-const tableData = ref([]);
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
- total: 0,
-});
+ const tableColumn = ref([
+ {
+ label: "鐢熶骇璁㈠崟鍙�",
+ prop: "npsNo",
+ width: 120,
+ },
+ {
+ label: "閿�鍞悎鍚屽彿",
+ prop: "salesContractNo",
+ width: 220,
+ },
+ {
+ label: "椤圭洰鍚嶇О",
+ prop: "projectName",
+ width: 300,
+ },
+ {
+ label: "瀹㈡埛鍚嶇О",
+ prop: "customerName",
+ width: 250,
+ },
+ {
+ label: "浜у搧鍚嶇О",
+ prop: "productCategory",
+ width: 250,
+ },
+ {
+ label: "瑙勬牸",
+ prop: "specificationModel",
+ width: 250,
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 200,
+ operation: [
+ {
+ name: "宸ヨ壓璺嚎",
+ type: "text",
+ clickFun: row => {
+ showRouteItemModal(row);
+ },
+ },
+ ],
+ },
+ ]);
+ const tableData = ref([]);
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
-const data = reactive({
- searchForm: {
- customerName: "",
- projectName: "",
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
- },
-});
-const { searchForm } = toRefs(data);
+ const data = reactive({
+ searchForm: {
+ customerName: "",
+ salesContractNo: "",
+ projectName: "",
+ productCategory: "",
+ specificationModel: "",
+ },
+ });
+ const { searchForm } = toRefs(data);
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const changeDaterange = (value) => {
- if (value) {
- searchForm.value.entryDateStart = value[0];
- searchForm.value.entryDateEnd = value[1];
- } else {
- searchForm.value.entryDateStart = undefined;
- searchForm.value.entryDateEnd = undefined;
- }
- handleQuery();
-};
-const getList = () => {
- tableLoading.value = true;
- // 鏋勯�犱竴涓柊鐨勫璞★紝涓嶅寘鍚玡ntryDate瀛楁
- const params = { ...searchForm.value, ...page };
- params.entryDate = undefined
- schedulingListPage(params).then((res) => {
- tableLoading.value = false;
- tableData.value = res.data.records;
- page.total = res.data.total;
- }).catch(() => {
- tableLoading.value = false;
- })
-};
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const changeDaterange = value => {
+ if (value) {
+ searchForm.value.entryDateStart = value[0];
+ searchForm.value.entryDateEnd = value[1];
+ } else {
+ searchForm.value.entryDateStart = undefined;
+ searchForm.value.entryDateEnd = undefined;
+ }
+ handleQuery();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ // 鏋勯�犱竴涓柊鐨勫璞★紝涓嶅寘鍚玡ntryDate瀛楁
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined;
+ productOrderListPage(params)
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(() => {
+ tableLoading.value = false;
+ });
+ };
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/salesLedger/scheduling/export", {}, "鐢熶骇璁㈠崟.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
+ const isShowItemModal = ref(false);
+ const record = ref({});
+ const showRouteItemModal = row => {
+ isShowItemModal.value = true;
+ record.value = row;
+ };
-onMounted(() => {
- getList();
-});
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/salesLedger/scheduling/export", {}, "鐢熶骇璁㈠崟.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+
+ const handleConfirmRoute = () => {};
+
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped lang="scss"></style>
diff --git a/src/views/productionManagement/productionProcess/Edit.vue b/src/views/productionManagement/productionProcess/Edit.vue
new file mode 100644
index 0000000..31e3109
--- /dev/null
+++ b/src/views/productionManagement/productionProcess/Edit.vue
@@ -0,0 +1,102 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="isShow"
+ title="缂栬緫宸ュ簭"
+ width="400"
+ @close="closeModal"
+ >
+ <el-form label-width="140px" :model="formState" label-position="top" ref="formRef">
+ <el-form-item
+ label="宸ュ簭鍚嶇О锛�"
+ prop="name"
+ :rules="[
+ {
+ required: true,
+ message: '璇疯緭鍏ュ伐搴忓悕绉�',
+ },
+ {
+ max: 100,
+ message: '鏈�澶�100涓瓧绗�',
+ }
+ ]">
+ <el-input v-model="formState.name" />
+ </el-form-item>
+ <el-form-item label="宸ヨ祫瀹氶" prop="salaryQuota">
+ <el-input v-model="formState.salaryQuota" type="number" :step="0.001" />
+ </el-form-item>
+ <el-form-item label="澶囨敞" prop="remark">
+ <el-input v-model="formState.remark" type="textarea" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="handleSubmit">纭</el-button>
+ <el-button @click="closeModal">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import { ref, computed, getCurrentInstance } from "vue";
+import {update} from "@/api/productionManagement/productionProcess.js";
+
+const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ },
+
+ record: {
+ type: Object,
+ required: true,
+ }
+});
+
+const emit = defineEmits(['update:visible', 'completed']);
+
+// 鍝嶅簲寮忔暟鎹紙鏇夸唬閫夐」寮忕殑 data锛�
+const formState = ref({
+ id: props.record.id,
+ name: props.record.name,
+ remark: props.record.remark,
+ salaryQuota: props.record.salaryQuota,
+});
+
+const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit('update:visible', val);
+ },
+});
+
+let { proxy } = getCurrentInstance()
+
+const closeModal = () => {
+ isShow.value = false;
+};
+
+const handleSubmit = () => {
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ update(formState.value).then(res => {
+ // 鍏抽棴妯℃�佹
+ isShow.value = false;
+ // 鍛婄煡鐖剁粍浠跺凡瀹屾垚
+ emit('completed');
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ })
+ }
+ })
+};
+
+defineExpose({
+ closeModal,
+ handleSubmit,
+ isShow,
+});
+</script>
diff --git a/src/views/productionManagement/productionProcess/New.vue b/src/views/productionManagement/productionProcess/New.vue
new file mode 100644
index 0000000..a73a755
--- /dev/null
+++ b/src/views/productionManagement/productionProcess/New.vue
@@ -0,0 +1,96 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="isShow"
+ title="鏂板宸ュ簭"
+ width="400"
+ @close="closeModal"
+ >
+ <el-form label-width="140px" :model="formState" label-position="top" ref="formRef">
+ <el-form-item
+ label="宸ュ簭鍚嶇О锛�"
+ prop="name"
+ :rules="[
+ {
+ required: true,
+ message: '璇疯緭鍏ュ伐搴忓悕绉�',
+ },
+ {
+ max: 100,
+ message: '鏈�澶�100涓瓧绗�',
+ }
+ ]">
+ <el-input v-model="formState.name" />
+ </el-form-item>
+ <el-form-item label="宸ヨ祫瀹氶" prop="salaryQuota">
+ <el-input v-model="formState.salaryQuota" type="number" :step="0.001" />
+ </el-form-item>
+ <el-form-item label="澶囨敞" prop="remark">
+ <el-input v-model="formState.remark" type="textarea" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="handleSubmit">纭</el-button>
+ <el-button @click="closeModal">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import { ref, computed, getCurrentInstance } from "vue";
+import {add} from "@/api/productionManagement/productionProcess.js";
+
+const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ },
+});
+
+const emit = defineEmits(['update:visible', 'completed']);
+
+// 鍝嶅簲寮忔暟鎹紙鏇夸唬閫夐」寮忕殑 data锛�
+const formState = ref({
+ name: '',
+ remark: '',
+ salaryQuota: '',
+});
+
+const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit('update:visible', val);
+ },
+});
+
+let { proxy } = getCurrentInstance()
+
+const closeModal = () => {
+ isShow.value = false;
+};
+
+const handleSubmit = () => {
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ add(formState.value).then(res => {
+ // 鍏抽棴妯℃�佹
+ isShow.value = false;
+ // 鍛婄煡鐖剁粍浠跺凡瀹屾垚
+ emit('completed');
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ })
+ }
+ })
+};
+
+defineExpose({
+ closeModal,
+ handleSubmit,
+ isShow,
+});
+</script>
diff --git a/src/views/productionManagement/productionProcess/index.vue b/src/views/productionManagement/productionProcess/index.vue
new file mode 100644
index 0000000..d2624ea
--- /dev/null
+++ b/src/views/productionManagement/productionProcess/index.vue
@@ -0,0 +1,189 @@
+<template>
+ <div class="app-container">
+ <div class="search_form">
+ <el-form :model="searchForm" :inline="true">
+ <el-form-item label="宸ュ簭鍚嶇О:">
+ <el-input v-model="searchForm.name" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="宸ュ簭缂栧彿:">
+ <el-input v-model="searchForm.no" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleQuery">鎼滅储</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="table_list">
+ <div style="text-align: right" class="mb10">
+ <el-button type="primary" @click="showNewModal">鏂板宸ュ簭</el-button>
+ <el-button type="danger" @click="handleDelete" :disabled="selectedRows.length === 0" plain>鍒犻櫎宸ュ簭</el-button>
+ </div>
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total"
+ ></PIMTable>
+ </div>
+ <new-process
+ v-if="isShowNewModal"
+ v-model:visible="isShowNewModal"
+ @completed="getList"
+ />
+
+ <edit-process
+ v-if="isShowEditModal"
+ v-model:visible="isShowEditModal"
+ :record="record"
+ @completed="getList"
+ />
+ </div>
+</template>
+
+<script setup>
+import {onMounted, ref} from "vue";
+import NewProcess from "@/views/productionManagement/productionProcess/New.vue";
+import EditProcess from "@/views/productionManagement/productionProcess/Edit.vue";
+import {listPage, del} from "@/api/productionManagement/productionProcess.js";
+
+const data = reactive({
+ searchForm: {
+ name: "",
+ no: "",
+ },
+});
+const { searchForm } = toRefs(data);
+const tableColumn = ref([
+ {
+ label: "宸ュ簭鍚嶇О",
+ prop: "name",
+ },
+ {
+ label: "宸ュ簭缂栧彿",
+ prop: "no",
+ },
+ {
+ label: "宸ヨ祫瀹氶",
+ prop: "salaryQuota",
+ },
+ {
+ label: "澶囨敞",
+ prop: "remark",
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 280,
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ showEditModal(row);
+ }
+ }
+ ]
+ }
+]);
+const tableData = ref([]);
+const selectedRows = ref([]);
+const tableLoading = ref(false);
+const isShowNewModal = ref(false);
+const isShowEditModal = ref(false);
+const record = ref({});
+const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+});
+const { proxy } = getCurrentInstance()
+
+// 鏌ヨ鍒楄〃
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+ page.current = 1;
+ getList();
+};
+
+const pagination = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+};
+const getList = () => {
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined
+ listPage(params).then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records.map(item => ({
+ ...item,
+ }));
+ page.total = res.data.total;
+ }).catch(err => {
+ tableLoading.value = false;
+ })
+};
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+ selectedRows.value = selection;
+};
+
+// 鎵撳紑鏂板寮规
+const showNewModal = () => {
+ isShowNewModal.value = true
+};
+
+const showEditModal = (row) => {
+ isShowEditModal.value = true
+ record.value = row
+};
+
+// 鍒犻櫎
+function handleDelete() {
+ const no = selectedRows.value.map((item) => item.no);
+ const ids = selectedRows.value.map((item) => item.id);
+ proxy.$modal
+ .confirm('鏄惁纭鍒犻櫎宸ュ簭缂栧彿涓�"' + no + '"鐨勬暟鎹」锛�')
+ .then(function () {
+ return del(ids);
+ })
+ .then(() => {
+ getList();
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ })
+ .catch(() => {});
+}
+
+// 瀵煎嚭
+// const handleOut = () => {
+// ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+// confirmButtonText: "纭",
+// cancelButtonText: "鍙栨秷",
+// type: "warning",
+// })
+// .then(() => {
+// proxy.download("/salesLedger/scheduling/exportTwo", {}, "宸ュ簭鎺掍骇.xlsx");
+// })
+// .catch(() => {
+// proxy.$modal.msg("宸插彇娑�");
+// });
+// };
+
+onMounted(() => {
+ getList();
+});
+</script>
+
+<style scoped></style>
diff --git a/src/views/productionManagement/productionReporting/Input.vue b/src/views/productionManagement/productionReporting/Input.vue
new file mode 100644
index 0000000..7959848
--- /dev/null
+++ b/src/views/productionManagement/productionReporting/Input.vue
@@ -0,0 +1,107 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="isShow"
+ title="鎶曞叆"
+ @close="closeModal"
+ >
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="data"
+ :page="page"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ ></PIMTable>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="closeModal">鍏抽棴</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import {ref, computed, onMounted} from "vue";
+import { productionProductInputListPage } from "@/api/productionManagement/productionProductInput";
+
+const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ },
+ productionProductMainId: {
+ type: Number,
+ required: true,
+ },
+});
+
+const emit = defineEmits(['update:visible', 'completed']);
+
+const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0
+});
+
+const pagination = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ fetchData();
+};
+
+const tableLoading = ref(false);
+
+const tableColumn = [
+ {
+ label: '鎶ュ伐鍗曞彿',
+ prop: 'productNo',
+ },
+ {
+ label: '浜у搧鍨嬪彿',
+ prop: 'model',
+ },
+ {
+ label: '鎶曞叆鏁伴噺',
+ prop: 'quantity',
+ },
+]
+
+const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit('update:visible', val);
+ },
+});
+
+const data = ref([])
+
+const closeModal = () => {
+ isShow.value = false;
+};
+
+const fetchData = () => {
+ tableLoading.value = true;
+ const params = { productMainId: props.productionProductMainId, ...page };
+
+ productionProductInputListPage(params).then(res => {
+ tableLoading.value = false;
+ data.value = res.data.records;
+ page.total = res.data.total;
+ }).catch(err => {
+ tableLoading.value = false;
+ })
+};
+
+defineExpose({
+ closeModal,
+ isShow,
+});
+
+onMounted(() => {
+ fetchData()
+})
+</script>
diff --git a/src/views/productionManagement/productionReporting/Output.vue b/src/views/productionManagement/productionReporting/Output.vue
new file mode 100644
index 0000000..0f49a55
--- /dev/null
+++ b/src/views/productionManagement/productionReporting/Output.vue
@@ -0,0 +1,107 @@
+<template>
+ <div>
+ <el-dialog
+ v-model="isShow"
+ title="浜у嚭"
+ @close="closeModal"
+ >
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="data"
+ :page="page"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ ></PIMTable>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="closeModal">鍏抽棴</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import {ref, computed, onMounted} from "vue";
+import { productionProductOutputListPage } from "@/api/productionManagement/productionProductOutput.js";
+
+const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ },
+ productionProductMainId: {
+ type: Number,
+ required: true,
+ },
+});
+
+const emit = defineEmits(['update:visible', 'completed']);
+
+const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0
+});
+
+const pagination = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ fetchData();
+};
+
+const tableLoading = ref(false);
+
+const tableColumn = [
+ {
+ label: '鎶ュ伐鍗曞彿',
+ prop: 'productNo',
+ },
+ {
+ label: '浜у搧鍨嬪彿',
+ prop: 'model',
+ },
+ {
+ label: '鎶曞叆鏁伴噺',
+ prop: 'quantity',
+ },
+]
+
+const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit('update:visible', val);
+ },
+});
+
+const data = ref([])
+
+const closeModal = () => {
+ isShow.value = false;
+};
+
+const fetchData = () => {
+ tableLoading.value = true;
+ const params = { productMainId: props.productionProductMainId, ...page };
+
+ productionProductOutputListPage(params).then(res => {
+ tableLoading.value = false;
+ data.value = res.data.records;
+ page.total = res.data.total;
+ }).catch(err => {
+ tableLoading.value = false;
+ })
+};
+
+defineExpose({
+ closeModal,
+ isShow,
+});
+
+onMounted(() => {
+ fetchData()
+})
+</script>
diff --git a/src/views/productionManagement/productionReporting/components/formDia.vue b/src/views/productionManagement/productionReporting/components/formDia.vue
index 3986865..2eb1c0b 100644
--- a/src/views/productionManagement/productionReporting/components/formDia.vue
+++ b/src/views/productionManagement/productionReporting/components/formDia.vue
@@ -13,8 +13,15 @@
<el-input v-model="form.schedulingNum" placeholder="璇疯緭鍏�" clearable disabled/>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="鏈鐢熶骇鏁伴噺锛�" prop="finishedNum">
+ <el-col :span="12">
+ <el-form-item label="寰呯敓浜ф暟閲忥細" prop="pendingNum">
+ <el-input v-model="form.pendingNum" placeholder="璇疯緭鍏�" clearable disabled/>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="鏈鐢熶骇鏁伴噺锛�" prop="finishedNum">
<el-input-number
v-model="form.finishedNum"
placeholder="璇疯緭鍏�"
@@ -25,13 +32,18 @@
style="width: 100%"
@change="changeNum"
/>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍗曚环(鍏�)锛�" prop="unitPrice">
+ <el-input v-model="form.unitPrice" placeholder="璇疯緭鍏�" clearable @input="calculateTotalPrice"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="寰呯敓浜ф暟閲忥細" prop="pendingNum">
- <el-input :value="form.pendingNum !== undefined && form.pendingNum !== null ? Number(form.pendingNum).toFixed(2) : ''" placeholder="璇疯緭鍏�" clearable disabled/>
+ <el-form-item label="鎬讳环(鍏�)锛�" prop="totalPrice">
+ <el-input v-model="form.totalPrice" placeholder="璇疯緭鍏�" clearable disabled/>
</el-form-item>
</el-col>
</el-row>
@@ -42,6 +54,9 @@
v-model="form.schedulingUserId"
placeholder="閫夋嫨浜哄憳"
style="width: 100%;"
+ filterable
+ default-first-option
+ :reserve-keyword="false"
>
<el-option
v-for="user in userList"
@@ -88,7 +103,6 @@
const userList = ref([])
const dialogFormVisible = ref(false);
const operationType = ref('')
-const pendingFinishNum = ref(0) // 澶栭儴浼犲叆鐨勫緟鐢熶骇鏁伴噺锛堝墿浣欏彲鎶ュ伐鏁伴噺锛�
const data = reactive({
form: {
successNum: "",
@@ -96,6 +110,8 @@
finishedNum: "",
schedulingUserId: "",
schedulingDate: "",
+ unitPrice: "",
+ totalPrice: "",
},
rules: {
schedulingNum: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" },],
@@ -111,21 +127,27 @@
userList.value = res.data;
});
form.value = {...row}
- pendingFinishNum.value = Number(row?.pendingFinishNum || 0)
- // 灏嗗緟鐢熶骇鏁伴噺甯﹀叆琛ㄥ崟锛屾柟渚垮睍绀轰笌鏍¢獙锛屼繚鐣欎袱浣嶅皬鏁�
- form.value.pendingNum = Number(pendingFinishNum.value.toFixed(2))
}
const changeNum = (value) => {
- const maxPending = Number(pendingFinishNum.value) || 0
- // 涓婇檺锛氫笉鑳借秴杩囧緟鐢熶骇鏁伴噺
- if (Number(value) > maxPending) {
- form.value.finishedNum = Number(maxPending.toFixed(2));
- proxy.$modal.msgWarning('鏈鐢熶骇鏁伴噺涓嶅彲澶т簬寰呯敓浜ф暟閲�')
+ if (value > form.value.schedulingNum) {
+ form.value.finishedNum = form.value.schedulingNum;
+ proxy.$modal.msgWarning('鏈鐢熶骇鏁伴噺涓嶅彲澶т簬鎺掍骇鏁伴噺')
}
- // 閲嶆柊璁$畻鍓╀綑寰呯敓浜ф暟閲忥紝淇濈暀涓や綅灏忔暟
- const finishedNum = Number(form.value.finishedNum) || 0
- form.value.pendingNum = Number((maxPending - finishedNum).toFixed(2));
+ form.value.pendingNum = form.value.schedulingNum - form.value.finishedNum;
+ calculateTotalPrice();
+}
+
+// 璁$畻鎬讳环
+const calculateTotalPrice = () => {
+ const quantity = Number(form.value.finishedNum ?? 0);
+ const unitPrice = Number(form.value.unitPrice ?? 0);
+
+ if (quantity > 0 && unitPrice > 0) {
+ form.value.totalPrice = (quantity * unitPrice).toFixed(2);
+ } else {
+ form.value.totalPrice = '0.00';
+ }
}
// 鎻愪氦浜у搧琛ㄥ崟
const submitForm = () => {
diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index 42a0c4f..a08326a 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -1,428 +1,469 @@
<template>
- <div class="app-container">
- <div class="search_form">
- <el-form :model="searchForm" :inline="true">
- <el-form-item label="瀹㈡埛鍚嶇О:">
- <el-input v-model="searchForm.customerName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
- style="width: 200px;"
- @change="handleQuery" />
- </el-form-item>
- <el-form-item label="椤圭洰鍚嶇О:">
- <el-input v-model="searchForm.projectName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
- style="width: 200px;"
- @change="handleQuery" />
- </el-form-item>
- <el-form-item label="鎺掍骇鏃ユ湡:">
- <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
- placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
- </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="3"></el-option>
- <el-option label="鐢熶骇涓�" :value="2"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="handleQuery">鎼滅储</el-button>
- </el-form-item>
- </el-form>
- </div>
- <div class="table_list">
- <div style="text-align: right" class="mb10">
- <el-button type="primary" @click="openForm('add')">鐢熶骇鎶ュ伐</el-button>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- </div>
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :page="page"
- :isSelection="true"
- :expandRowKeys="expandedRowKeys"
- @expand-change="expandChange"
- @selection-change="handleSelectionChange"
- :tableLoading="tableLoading"
- @pagination="pagination"
- :total="page.total"
- >
- <template #expand="{ row }">
- <el-table
- :data="expandData"
- border
- show-summary
- :summary-method="summarizeMainTable"
- v-loading="childrenLoading"
- >
- <el-table-column
- align="center"
- label="搴忓彿"
- type="index"
- width="60"
- />
- <el-table-column label="鏈鐢熶骇鏁伴噺" prop="finishedNum" align="center" width="400">
- <template #default="scope">
- <el-input-number :step="0.01" :min="0" style="width: 100%"
- v-model="scope.row.finishedNum"
- :disabled="!scope.row.editType"
- :precision="2"
- placeholder="璇疯緭鍏�"
- clearable
- @change="changeNum(scope.row)"
- />
- </template>
- </el-table-column>
-<!-- <el-table-column label="寰呯敓浜ф暟閲�" prop="pendingNum" width="240" align="center"></el-table-column>-->
- <el-table-column label="鐢熶骇浜�" prop="schedulingUserId" width="400">
- <template #default="scope">
- <el-select
- v-model="scope.row.schedulingUserId"
- placeholder="閫夋嫨浜哄憳"
- :disabled="!scope.row.editType"
- style="width: 100%;"
- >
- <el-option
- v-for="user in userList"
- :key="user.userId"
- :label="user.nickName"
- :value="user.userId"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="鐢熶骇鏃ユ湡" prop="schedulingDate" width="400">
- <template #default="scope">
- <el-date-picker
- v-model="scope.row.schedulingDate"
- type="date"
- :disabled="!scope.row.editType"
- placeholder="璇烽�夋嫨鏃ユ湡"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- clearable
- style="width: 100%"
- />
- </template>
- </el-table-column>
- <el-table-column label="鎿嶄綔" width="60">
- <template #default="scope">
- <el-button
- link
- type="primary"
- size="small"
- @click="changeEditType(scope.row)"
- v-if="!scope.row.editType"
- :disabled="scope.row.parentStatus === 3"
- >缂栬緫</el-button
- >
- <el-button
- link
- type="primary"
- size="small"
- @click="saveReceiptPayment(scope.row)"
- v-if="scope.row.editType"
- >淇濆瓨</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </template>
- </PIMTable>
- </div>
- <form-dia ref="formDia" @close="handleQuery"></form-dia>
- </div>
+ <div class="app-container">
+ <div class="search_form">
+ <el-form :model="searchForm"
+ :inline="true">
+ <el-form-item label="鎶ュ伐浜哄憳鍚嶇О:">
+ <el-input v-model="searchForm.nickName"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="宸ュ崟鍙�:">
+ <el-input v-model="searchForm.workOrderNo"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ style="width: 200px;"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="宸ュ崟鐘舵��:">
+ <el-select v-model="searchForm.workOrderStatus"
+ placeholder="璇烽�夋嫨宸ュ崟鐘舵��"
+ style="width: 140px"
+ clearable>
+ <el-option label="寰呯‘璁�"
+ :value="1"></el-option>
+ <el-option label="寰呯敓浜�"
+ :value="2"></el-option>
+ <el-option label="鐢熶骇涓�"
+ :value="3"></el-option>
+ <el-option label="宸茬敓浜�"
+ :value="4"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary"
+ @click="handleQuery">鎼滅储</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="table_list">
+ <div style="text-align: right"
+ class="mb10">
+ <el-button type="primary"
+ @click="openForm('add')">鐢熶骇鎶ュ伐</el-button>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ </div>
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ :expandRowKeys="expandedRowKeys"
+ @expand-change="expandChange"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total">
+ <template #expand="{ row }">
+ <el-table :data="expandData"
+ border
+ show-summary
+ :summary-method="summarizeMainTable"
+ v-loading="childrenLoading">
+ <el-table-column align="center"
+ label="搴忓彿"
+ type="index"
+ width="60" />
+ <el-table-column label="鏈鐢熶骇鏁伴噺"
+ prop="finishedNum"
+ align="center"
+ width="400">
+ <template #default="scope">
+ <el-input-number :step="0.01"
+ :min="0"
+ style="width: 100%"
+ v-model="scope.row.finishedNum"
+ :disabled="!scope.row.editType"
+ :precision="2"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @change="changeNum(scope.row)" />
+ </template>
+ </el-table-column>
+ <!-- <el-table-column label="寰呯敓浜ф暟閲�" prop="pendingNum" width="240" align="center"></el-table-column>-->
+ <el-table-column label="鐢熶骇浜�"
+ prop="schedulingUserId"
+ width="400">
+ <template #default="scope">
+ <el-select v-model="scope.row.schedulingUserId"
+ placeholder="閫夋嫨浜哄憳"
+ :disabled="!scope.row.editType"
+ style="width: 100%;">
+ <el-option v-for="user in userList"
+ :key="user.userId"
+ :label="user.nickName"
+ :value="user.userId" />
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐢熶骇鏃ユ湡"
+ prop="schedulingDate"
+ width="400">
+ <template #default="scope">
+ <el-date-picker v-model="scope.row.schedulingDate"
+ type="date"
+ :disabled="!scope.row.editType"
+ placeholder="璇烽�夋嫨鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ style="width: 100%" />
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔"
+ width="60">
+ <template #default="scope">
+ <el-button link
+ type="primary"
+ size="small"
+ @click="changeEditType(scope.row)"
+ v-if="!scope.row.editType"
+ :disabled="scope.row.parentStatus === 3">缂栬緫</el-button>
+ <el-button link
+ type="primary"
+ size="small"
+ @click="saveReceiptPayment(scope.row)"
+ v-if="scope.row.editType">淇濆瓨</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </template>
+ </PIMTable>
+ </div>
+ <form-dia ref="formDia"
+ @close="handleQuery"></form-dia>
+ <input-modal v-if="isShowInput"
+ v-model:visible="isShowInput"
+ :production-product-main-id="isShowingId" />
+ <output-modal v-if="isShowOutput"
+ v-model:visible="isShowOutput"
+ :production-product-main-id="isShowingId" />
+ </div>
</template>
<script setup>
-import {onMounted, ref} from "vue";
-import FormDia from "@/views/productionManagement/productionReporting/components/formDia.vue";
-import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js";
-import {ElMessageBox} from "element-plus";
-import dayjs from "dayjs";
-import {
- productionReportUpdate,
- workListPage,
- workListPageById
-} from "@/api/productionManagement/productionReporting.js";
-import {userListNoPageByTenantId} from "@/api/system/user.js";
+ import { onMounted, ref } from "vue";
+ import FormDia from "@/views/productionManagement/productionReporting/components/formDia.vue";
+ import { ElMessageBox } from "element-plus";
+ import {
+ productionReportUpdate,
+ workListPageById,
+ productionReportDelete,
+ } from "@/api/productionManagement/productionReporting.js";
+ import { productionProductMainListPage } from "@/api/productionManagement/productionProductMain.js";
+ import { userListNoPageByTenantId } from "@/api/system/user.js";
+ import InputModal from "@/views/productionManagement/productionReporting/Input.vue";
+ import OutputModal from "@/views/productionManagement/productionReporting/Output.vue";
-const data = reactive({
- searchForm: {
- staffName: "",
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
- },
-});
-const { searchForm } = toRefs(data);
-const expandedRowKeys = ref([]);
-const expandData = ref([]);
-const userList = ref([])
-const tableColumn = ref([
- {
- type: "expand",
- dataType: "slot",
- slot: "expand",
- },
- {
- label: "鐘舵��",
- prop: "status",
- dataType: "tag",
- formatData: (params) => {
- if (params == 3) {
- return "宸叉姤宸�";
- } else if (params == 1) {
- return "寰呯敓浜�";
- } else {
- return '鐢熶骇涓�';
- }
- },
- formatType: (params) => {
- if (params == 3) {
- return "success";
- } else if (params == 1) {
- return "primary";
- } else {
- return 'warning';
- }
- },
- },
- {
- label: "鎺掍骇鏃ユ湡",
- prop: "schedulingDate",
- width: 120,
- },
- {
- label: "鎺掍骇浜�",
- prop: "schedulingUserName",
- },
- {
- label: "鍚堝悓鍙�",
- prop: "salesContractNo",
- width: 200,
- },
- {
- label: "瀹㈡埛鍚堝悓鍙�",
- prop: "customerContractNo",
- width: 200,
- },
- {
- label: "瀹㈡埛鍚嶇О",
- prop: "customerName",
- width: 200,
- },
- {
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width:300
- },
- {
- label: "浜у搧澶х被",
- prop: "productCategory",
- width: 150,
- },
- {
- label: "瑙勬牸鍨嬪彿",
- prop: "specificationModel",
- width: 150,
- },
- {
- label: "鍗曚綅",
- prop: "unit",
- },
- {
- label: "宸ュ簭",
- prop: "process",
- },
- {
- label: "鎺掍骇鏁伴噺",
- prop: "schedulingNum",
- width: 100,
- },
- {
- label: "鐢熶骇鏁伴噺",
- prop: "finishedNum",
- width: 100,
- },
- {
- label: "寰呯敓浜ф暟閲�",
- prop: "pendingFinishNum",
- width: 100,
- },
-]);
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-const childrenLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
- total: 0,
-});
-const formDia = ref()
-const { proxy } = getCurrentInstance()
+ const data = reactive({
+ searchForm: {
+ nickName: "",
+ workOrderNo: "",
+ workOrderStatus: "",
+ },
+ });
+ const { searchForm } = toRefs(data);
+ const expandedRowKeys = ref([]);
+ const expandData = ref([]);
+ const userList = ref([]);
+ const tableColumn = ref([
+ {
+ label: "鎶ュ伐鍗曞彿",
+ prop: "productNo",
+ width: 120,
+ },
+ {
+ label: "鎶ュ伐浜哄憳",
+ prop: "nickName",
+ width: 120,
+ },
+ {
+ label: "宸ュ崟缂栧彿",
+ prop: "workOrderNo",
+ width: 120,
+ },
+ {
+ label: "鎶ュ伐鐘舵��",
+ prop: "status",
+ dataType: "tag",
+ formatData: params => {
+ if (params == 3) {
+ return "宸叉姤宸�";
+ } else if (params == 1) {
+ return "寰呯敓浜�";
+ } else {
+ return "鐢熶骇涓�";
+ }
+ },
+ formatType: params => {
+ if (params == 3) {
+ return "success";
+ } else if (params == 1) {
+ return "primary";
+ } else {
+ return "warning";
+ }
+ },
+ },
+ {
+ label: "宸ュ崟鐘舵��",
+ prop: "workOrderStatus",
+ dataType: "tag",
+ formatData: params => {
+ switch (params) {
+ case "1":
+ return "寰呯‘璁�";
+ case "2":
+ return "寰呯敓浜�";
+ case "3":
+ return "鐢熶骇涓�";
+ case "4":
+ return "宸茬敓浜�";
+ default:
+ return "";
+ }
+ },
+ formatType: params => {
+ switch (params) {
+ case "1":
+ return "primary";
+ case "2":
+ return "info";
+ case "3":
+ return "warning";
+ case "4":
+ return "success";
+ default:
+ return "";
+ }
+ },
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 200,
+ operation: [
+ {
+ name: "鏌ョ湅鎶曞叆",
+ type: "text",
+ clickFun: row => {
+ showInput(row);
+ },
+ },
+ {
+ name: "鏌ョ湅浜у嚭",
+ type: "text",
+ clickFun: row => {
+ showOutput(row);
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "danger",
+ clickFun: row => {
+ deleteReport(row);
+ },
+ },
+ ],
+ },
+ ]);
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const childrenLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ const formDia = ref();
+ const { proxy } = getCurrentInstance();
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const changeDaterange = (value) => {
- if (value) {
- searchForm.value.entryDateStart = value[0];
- searchForm.value.entryDateEnd = value[1];
- } else {
- searchForm.value.entryDateStart = undefined;
- searchForm.value.entryDateEnd = undefined;
- }
- handleQuery();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- const params = { ...searchForm.value, ...page };
- params.entryDate = undefined
- expandedRowKeys.value = []
- workListPage(params).then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records.map(item => ({
- ...item,
- pendingFinishNum: (Number(item.schedulingNum) || 0) - (Number(item.finishedNum) || 0)
- }));
- page.total = res.data.total;
- }).catch(err => {
- tableLoading.value = false;
- })
-};
-// 灞曞紑琛�
-const expandChange = (row, expandedRows) => {
- userListNoPageByTenantId().then((res) => {
- userList.value = res.data;
- });
- if (expandedRows.length > 0) {
- nextTick(() => {
- expandedRowKeys.value = [];
- try {
- childrenLoading.value = true;
- workListPageById({ id: row.id }).then((res) => {
- childrenLoading.value = false;
- const index = tableData.value.findIndex((item) => item.id === row.id);
- if (index > -1) {
- expandData.value = res.data.map(item => ({
- ...item,
- pendingNum: (Number(item.schedulingNum) || 0) - (Number(item.finishedNum) || 0),
- parentStatus: row.status // 鏂板鐖惰〃鐘舵��
- }));
- }
- expandedRowKeys.value.push(row.id);
- });
- } catch (error) {
- childrenLoading.value = false;
- console.log(error);
- }
- })
- } else {
- expandedRowKeys.value = [];
- }
-};
-const changeNum = (row) => {
- // 鎵惧埌鐖惰〃鏍兼暟鎹�
- const parentRow = tableData.value.find(item => item.id === expandedRowKeys.value[0]);
- // 璁$畻鎵�鏈夊瓙琛ㄦ牸 finishedNum 鐨勬�诲拰
- const totalFinishedNum = expandData.value.reduce((sum, item) => sum + (Number(item.finishedNum) || 0), 0);
- // 鐖惰〃鏍肩殑鎺掍骇鏁伴噺
- const schedulingNum = parentRow ? Number(parentRow.schedulingNum) : 0;
-
- if (totalFinishedNum > schedulingNum) {
- // 鍥為��鏈杈撳叆
- row.finishedNum = schedulingNum - (totalFinishedNum - Number(row.finishedNum));
- proxy.$modal.msgWarning('鎵�鏈夋湰娆$敓浜ф暟閲忎箣鍜屼笉鍙ぇ浜庢帓浜ф暟閲�');
- }
- row.pendingNum = row.schedulingNum - row.finishedNum;
-}
-// 缂栬緫淇敼鐘舵��
-const changeEditType = (row) => {
- row.editType = !row.editType;
-};
-// 淇濆瓨璁板綍
-const saveReceiptPayment = (row) => {
- productionReportUpdate(row).then((res) => {
- row.editType = !row.editType;
- getList();
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- });
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
-const summarizeMainTable = (param) => {
- return proxy.summarizeTable(param, [
- "finishedNum"
- ]);
-};
-// 鎵撳紑寮规
-const openForm = (type, row) => {
- if (selectedRows.value.length !== 1) {
- proxy.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�");
- return;
- }
- if (selectedRows.value[0].pendingFinishNum == 0) {
- proxy.$message.warning("鏃犻渶鍐嶆姤宸�");
- return;
- }
- nextTick(() => {
- const rowInfo = type === 'add' ? selectedRows.value[0] : row
- formDia.value?.openDialog(type, rowInfo)
- })
-};
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const changeDaterange = value => {
+ if (value) {
+ searchForm.value.entryDateStart = value[0];
+ searchForm.value.entryDateEnd = value[1];
+ } else {
+ searchForm.value.entryDateStart = undefined;
+ searchForm.value.entryDateEnd = undefined;
+ }
+ handleQuery();
+ };
+ const deleteReport = row => {
+ ElMessageBox.confirm("纭畾鍒犻櫎璇ユ姤宸ュ悧锛�", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ productionReportDelete({ id: row.id }).then(res => {
+ if (res.code === 200) {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ } else {
+ ElMessageBox.alert(res.msg || "鍒犻櫎澶辫触", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ });
+ }
+ });
+ });
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined;
+ expandedRowKeys.value = [];
+ productionProductMainListPage(params)
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records.map(item => ({
+ ...item,
+ pendingFinishNum:
+ (Number(item.schedulingNum) || 0) - (Number(item.finishedNum) || 0),
+ }));
+ page.total = res.data.total;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+ // 灞曞紑琛�
+ const expandChange = (row, expandedRows) => {
+ userListNoPageByTenantId().then(res => {
+ userList.value = res.data;
+ });
+ if (expandedRows.length > 0) {
+ nextTick(() => {
+ expandedRowKeys.value = [];
+ try {
+ childrenLoading.value = true;
+ workListPageById({ id: row.id }).then(res => {
+ childrenLoading.value = false;
+ const index = tableData.value.findIndex(item => item.id === row.id);
+ if (index > -1) {
+ expandData.value = res.data.map(item => ({
+ ...item,
+ pendingNum:
+ (Number(item.schedulingNum) || 0) -
+ (Number(item.finishedNum) || 0),
+ parentStatus: row.status, // 鏂板鐖惰〃鐘舵��
+ }));
+ }
+ expandedRowKeys.value.push(row.id);
+ });
+ } catch (error) {
+ childrenLoading.value = false;
+ console.log(error);
+ }
+ });
+ } else {
+ expandedRowKeys.value = [];
+ }
+ };
+ const changeNum = row => {
+ // 鎵惧埌鐖惰〃鏍兼暟鎹�
+ const parentRow = tableData.value.find(
+ item => item.id === expandedRowKeys.value[0]
+ );
+ // 璁$畻鎵�鏈夊瓙琛ㄦ牸 finishedNum 鐨勬�诲拰
+ const totalFinishedNum = expandData.value.reduce(
+ (sum, item) => sum + (Number(item.finishedNum) || 0),
+ 0
+ );
+ // 鐖惰〃鏍肩殑鎺掍骇鏁伴噺
+ const schedulingNum = parentRow ? Number(parentRow.schedulingNum) : 0;
-// 鍒犻櫎
-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(() => {
- staffJoinDel(ids).then((res) => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- getList();
- });
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/salesLedger/work/export", {}, "鐢熶骇鎶ュ伐.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
-onMounted(() => {
- getList();
-});
+ if (totalFinishedNum > schedulingNum) {
+ // 鍥為��鏈杈撳叆
+ row.finishedNum =
+ schedulingNum - (totalFinishedNum - Number(row.finishedNum));
+ proxy.$modal.msgWarning("鎵�鏈夋湰娆$敓浜ф暟閲忎箣鍜屼笉鍙ぇ浜庢帓浜ф暟閲�");
+ }
+ row.pendingNum = row.schedulingNum - row.finishedNum;
+ };
+ // 缂栬緫淇敼鐘舵��
+ const changeEditType = row => {
+ row.editType = !row.editType;
+ };
+ // 淇濆瓨璁板綍
+ const saveReceiptPayment = row => {
+ productionReportUpdate(row).then(res => {
+ row.editType = !row.editType;
+ getList();
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ });
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
+ const summarizeMainTable = param => {
+ return proxy.summarizeTable(param, ["finishedNum"]);
+ };
+ // 鎵撳紑寮规
+ const openForm = (type, row) => {
+ if (selectedRows.value.length !== 1) {
+ proxy.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ if (selectedRows.value[0].pendingFinishNum == 0) {
+ proxy.$message.warning("鏃犻渶鍐嶆姤宸�");
+ return;
+ }
+ nextTick(() => {
+ const rowInfo = type === "add" ? selectedRows.value[0] : row;
+ formDia.value?.openDialog(type, rowInfo);
+ });
+ };
+
+ // 鎵撳紑鎶曞叆妯℃�佹
+ const isShowInput = ref(false);
+ const isShowingId = ref(0);
+ const showInput = row => {
+ isShowInput.value = true;
+ isShowingId.value = row.id;
+ };
+
+ // 鎵撳紑浜у嚭妯℃�佹
+ const isShowOutput = ref(false);
+ const showOutput = row => {
+ isShowOutput.value = true;
+ isShowingId.value = row.id;
+ };
+
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/salesLedger/work/export", {}, "鐢熶骇鎶ュ伐.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped></style>
diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
new file mode 100644
index 0000000..255e317
--- /dev/null
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -0,0 +1,559 @@
+<template>
+ <div class="app-container">
+ <div class="search_form">
+ <div class="search-row">
+ <div class="search-item">
+ <span class="search_title">宸ュ崟缂栧彿锛�</span>
+ <el-input v-model="searchForm.workOrderNo"
+ style="width: 240px"
+ placeholder="璇疯緭鍏�"
+ @change="handleQuery"
+ clearable
+ prefix-icon="Search" />
+ </div>
+ <div class="search-item">
+ <el-button type="primary"
+ @click="handleQuery">鎼滅储</el-button>
+ </div>
+ </div>
+ </div>
+ <div class="table_list">
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :tableLoading="tableLoading"
+ @pagination="pagination"></PIMTable>
+ </div>
+ <el-dialog v-model="editDialogVisible"
+ title="缂栬緫鏃堕棿"
+ width="500px">
+ <el-form :model="editrow"
+ label-width="120px">
+ <el-form-item label="璁″垝寮�濮嬫椂闂�">
+ <el-date-picker v-model="editrow.planStartTime"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ value-format="YYYY-MM-DD"
+ style="width: 300px" />
+ </el-form-item>
+ <el-form-item label="璁″垝缁撴潫鏃堕棿">
+ <el-date-picker v-model="editrow.planEndTime"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ value-format="YYYY-MM-DD"
+ style="width: 300px" />
+ </el-form-item>
+ <el-form-item label="瀹為檯寮�濮嬫椂闂�">
+ <el-date-picker v-model="editrow.actualStartTime"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ value-format="YYYY-MM-DD"
+ style="width: 300px" />
+ </el-form-item>
+ <el-form-item label="瀹為檯缁撴潫鏃堕棿">
+ <el-date-picker v-model="editrow.actualEndTime"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ value-format="YYYY-MM-DD"
+ style="width: 300px" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button @click="editDialogVisible = false">鍙栨秷</el-button>
+ <el-button type="primary"
+ @click="handleUpdate">纭畾</el-button>
+ </span>
+ </template>
+ </el-dialog>
+ <el-dialog v-model="transferCardVisible"
+ title="娴佽浆鍗�"
+ width="1000px">
+ <div class="transfer-card-title">宸ュ崟娴佽浆鍗�</div>
+ <div class="transfer-card-container">
+ <div class="transfer-card-info">
+ <div class="info-group">
+ <div class="info-item">
+ <span class="info-label">宸ュ崟缂栧彿</span>
+ <span class="info-value">{{ transferCardRowData.workOrderNo }}</span>
+ </div>
+ <!-- <div class="info-item">
+ <span class="info-label">浜у搧缂栧彿</span>
+ <span class="info-value">{{ transferCardRowData.productNo }}</span>
+ </div> -->
+ <div class="info-item">
+ <span class="info-label">浜у搧鍚嶇О</span>
+ <span class="info-value">{{ transferCardRowData.productName }}</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">浜у搧瑙勬牸</span>
+ <span class="info-value">{{ transferCardRowData.model }}</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">宸ュ崟鐘舵��</span>
+ <span class="info-value">{{
+ transferCardRowData.status === 1 ? '寰呯‘璁�' :
+ transferCardRowData.status === 2 ? '寰呯敓浜�' :
+ transferCardRowData.status === 3 ? '鐢熶骇涓�' :
+ transferCardRowData.status === 4 ? '宸茬敓浜�' :
+ transferCardRowData.status
+ }}</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">璁″垝寮�濮嬫椂闂�</span>
+ <span class="info-value">{{ transferCardRowData.planStartTime }}</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">璁″垝缁撴潫鏃堕棿</span>
+ <span class="info-value">{{ transferCardRowData.planEndTime }}</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">澶囨敞</span>
+ <span class="info-value">{{ transferCardRowData.remark }}</span>
+ </div>
+ </div>
+ <div class="info-group">
+ <div class="info-item">
+ <span class="info-label"> </span>
+ <span class="info-value"> </span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">璁″垝鏁伴噺</span>
+ <span class="info-value">{{ transferCardRowData.planQuantity }}</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">鑹搧鏁伴噺</span>
+ <span class="info-value">0</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">涓嶈壇鍝佹暟</span>
+ <span class="info-value">0</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">瀹為檯寮�濮嬫椂闂�</span>
+ <span class="info-value">{{ transferCardRowData.actualStartTime }}</span>
+ </div>
+ <div class="info-item">
+ <span class="info-label">瀹為檯缁撴潫鏃堕棿</span>
+ <span class="info-value">{{ transferCardRowData.actualEndTime }}</span>
+ </div>
+ </div>
+ </div>
+ <div class="transfer-card-qr">
+ <div class="qr-container">
+ <img :src="transferCardQrUrl"
+ alt="娴佽浆鍗′簩缁寸爜"
+ style="width: 200px; height: 200px;" />
+ <!-- <div class="qr-tip"
+ style="margin-top: 10px; text-align: center;">娴佽浆鍗′簩缁寸爜</div> -->
+ </div>
+ </div>
+ </div>
+ <div class="print-button-container"
+ style=" text-align: center;
+ margin-bottom: 40px;">
+ <el-button type="primary"
+ style="margin-top: 20px;"
+ @click="printTransferCard">鎵撳嵃娴佽浆鍗�</el-button>
+ </div>
+ </el-dialog>
+ <el-dialog v-model="reportDialogVisible"
+ title="鎶ュ伐"
+ width="500px">
+ <el-form :model="reportForm"
+ label-width="120px">
+ <el-form-item label="寰呯敓浜ф暟閲�">
+ <el-input v-model="reportForm.remainingQuantity"
+ readonly
+ style="width: 300px" />
+ </el-form-item>
+ <el-form-item label="鏈鐢熶骇鏁伴噺">
+ <el-input v-model.number="reportForm.quantity"
+ type="number"
+ min="1"
+ style="width: 300px"
+ placeholder="璇疯緭鍏ユ湰娆$敓浜ф暟閲�" />
+ </el-form-item>
+ <el-form-item label="鐝粍淇℃伅">
+ <el-input v-model="reportForm.userName"
+ style="width: 300px"
+ readonly
+ placeholder="璇疯緭鍏ョ彮缁勪俊鎭�" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button @click="reportDialogVisible = false">鍙栨秷</el-button>
+ <el-button type="primary"
+ @click="handleReport">纭畾</el-button>
+ </span>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+ import { onMounted, ref } from "vue";
+ import { ElMessageBox } from "element-plus";
+ import dayjs from "dayjs";
+ import {
+ productWorkOrderPage,
+ updateProductWorkOrder,
+ addProductMain,
+ } from "@/api/productionManagement/workOrder.js";
+ import { getUserProfile } from "@/api/system/user.js";
+ import QRCode from "qrcode";
+ import { getCurrentInstance, reactive, toRefs } from "vue";
+ const { proxy } = getCurrentInstance();
+
+ const tableColumn = ref([
+ {
+ label: "宸ュ崟缂栧彿",
+ prop: "workOrderNo",
+ },
+ {
+ label: "浜у搧鍚嶇О",
+ prop: "productName",
+ },
+ {
+ label: "瑙勬牸",
+ prop: "model",
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ },
+ {
+ label: "宸ュ簭鍚嶇О",
+ prop: "processName",
+ },
+ {
+ label: "璁″垝寮�濮嬫椂闂�",
+ prop: "planStartTime",
+ },
+ {
+ label: "璁″垝缁撴潫鏃堕棿",
+ prop: "planEndTime",
+ },
+ {
+ label: "瀹為檯寮�濮嬫椂闂�",
+ prop: "actualStartTime",
+ },
+ {
+ label: "瀹為檯缁撴潫鏃堕棿",
+ prop: "actualEndTime",
+ },
+ {
+ label: "鎿嶄綔",
+ width: "200",
+ align: "center",
+ dataType: "action",
+ fixed: "right",
+ operation: [
+ {
+ name: "缂栬緫",
+ clickFun: row => {
+ handleEdit(row);
+ },
+ },
+ {
+ name: "娴佽浆鍗�",
+ clickFun: row => {
+ showTransferCard(row);
+ },
+ },
+ {
+ name: "鎶ュ伐",
+ clickFun: row => {
+ showReportDialog(row);
+ },
+ },
+ ],
+ },
+ ]);
+ const tableData = ref([]);
+ const tableLoading = ref(false);
+ const qrCodeUrl = ref("");
+ const qrRowData = ref(null);
+ const editDialogVisible = ref(false);
+ const transferCardVisible = ref(false);
+ const transferCardData = ref([]);
+ const transferCardQrUrl = ref("");
+ const transferCardRowData = ref(null);
+ const reportDialogVisible = ref(false);
+ const reportForm = reactive({
+ remainingQuantity: 0,
+ quantity: 0,
+ userName: "",
+ workOrderId: "",
+ reportWork: "",
+ productProcessRouteItemId: "",
+ userId: "",
+ productMainId: null,
+ });
+ const currentReportRowData = ref(null);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+
+ const data = reactive({
+ searchForm: {
+ workOrderNo: "",
+ },
+ });
+ const { searchForm } = toRefs(data);
+ let editrow = ref(null);
+
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page };
+ productWorkOrderPage(params)
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(() => {
+ tableLoading.value = false;
+ });
+ };
+
+ const showTransferCard = async row => {
+ transferCardRowData.value = row;
+ const qrContent =
+ proxy.javaApi + "/work-order?orderRow=" + JSON.stringify(row);
+ console.log(qrContent, "qrContent");
+
+ transferCardQrUrl.value = await QRCode.toDataURL(qrContent);
+ transferCardVisible.value = true;
+ };
+
+ const printTransferCard = () => {
+ window.print();
+ };
+
+ const handleEdit = row => {
+ editrow.value = JSON.parse(JSON.stringify(row));
+ editDialogVisible.value = true;
+ };
+
+ const handleUpdate = () => {
+ updateProductWorkOrder(editrow.value)
+ .then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ editDialogVisible.value = false;
+ getList();
+ })
+ .catch(() => {
+ ElMessageBox.alert("淇敼澶辫触", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ });
+ });
+ };
+
+ const showReportDialog = row => {
+ currentReportRowData.value = row;
+ reportForm.remainingQuantity = 1;
+ reportForm.quantity = row.quantity;
+ reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
+ reportForm.workOrderId = row.id;
+ reportForm.reportWork = row.reportWork;
+ reportForm.productMainId = row.productMainId;
+ // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛淇℃伅
+
+ reportDialogVisible.value = true;
+ };
+
+ const handleReport = () => {
+ if (!reportForm.quantity || reportForm.quantity <= 0) {
+ ElMessageBox.alert("璇疯緭鍏ユ湁鏁堢殑鏈鐢熶骇鏁伴噺", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ });
+ return;
+ }
+ if (reportForm.quantity > reportForm.remainingQuantity) {
+ ElMessageBox.alert("鏈鐢熶骇鏁伴噺涓嶈兘瓒呰繃寰呯敓浜ф暟閲�", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ });
+ return;
+ }
+ // console.log(reportForm);
+ addProductMain(reportForm).then(res => {
+ if (res.code === 200) {
+ proxy.$modal.msgSuccess("鎶ュ伐鎴愬姛");
+ reportDialogVisible.value = false;
+ getList();
+ } else {
+ ElMessageBox.alert(res.msg || "鎶ュ伐澶辫触", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ });
+ }
+ });
+ };
+
+ onMounted(() => {
+ getList();
+ getUserProfile()
+ .then(res => {
+ if (res.code === 200) {
+ reportForm.userName = res.data.userName;
+ reportForm.userId = res.data.userId;
+ }
+ })
+ .catch(err => {
+ console.error("鑾峰彇鐢ㄦ埛淇℃伅澶辫触", err);
+ });
+ });
+</script>
+
+<style scoped lang="scss">
+ .search_form {
+ margin-bottom: 20px;
+ .search-row {
+ display: flex;
+ gap: 20px;
+ align-items: center;
+ .search-item {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ }
+ }
+ }
+
+ .transfer-card-title {
+ font-size: 24px;
+ font-weight: bold;
+ text-align: center;
+ margin-bottom: 20px;
+ }
+
+ .transfer-card-container {
+ display: flex;
+ gap: 20px;
+ height: 350px;
+ .transfer-card-info {
+ flex: 1;
+ overflow: auto;
+ .info-group {
+ width: 50%;
+ float: left;
+ }
+ .info-item {
+ display: flex;
+ margin-bottom: 15px;
+ .info-label {
+ width: 120px;
+ font-weight: bold;
+ margin-right: 20px;
+ }
+ .info-value {
+ flex: 1;
+ }
+ }
+ }
+ .transfer-card-qr {
+ width: 240px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-start;
+ }
+ }
+</style>
+
+<style lang="scss">
+ @media print {
+ @page {
+ size: landscape;
+ }
+ body * {
+ visibility: hidden;
+ }
+ .el-dialog__wrapper,
+ .el-dialog,
+ .el-dialog__body,
+ .transfer-card-title,
+ .transfer-card-container,
+ .transfer-card-container *,
+ .info-item,
+ .info-label,
+ .info-value {
+ visibility: visible;
+ }
+ .print-button-container {
+ visibility: hidden;
+ }
+ .el-dialog__wrapper {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ margin: 0;
+ }
+ .el-dialog {
+ width: 100% !important;
+ max-width: 800px;
+ margin: 0 auto !important;
+ }
+ .el-dialog__header,
+ .el-dialog__footer {
+ display: none;
+ }
+ .el-dialog__body {
+ padding: 20px;
+ }
+ .transfer-card-container {
+ height: auto;
+ display: flex;
+ gap: 20px;
+ }
+ .transfer-card-info {
+ flex: 1;
+ .info-group {
+ width: 100%;
+ float: none;
+ margin-bottom: 20px;
+ }
+ .info-item {
+ display: flex;
+ margin-bottom: 10px;
+ .info-label {
+ width: 100px;
+ font-weight: bold;
+ margin-right: 15px;
+ white-space: nowrap;
+ }
+ .info-value {
+ flex: 1;
+ word-break: break-word;
+ }
+ }
+ }
+ .transfer-card-qr {
+ width: 160px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-start;
+ }
+ .qr-container img {
+ width: 140px !important;
+ height: 140px !important;
+ }
+ }
+</style>
diff --git a/src/views/qualityManagement/finalInspection/components/filesDia.vue b/src/views/qualityManagement/finalInspection/components/filesDia.vue
index 66392f3..7fe250a 100644
--- a/src/views/qualityManagement/finalInspection/components/filesDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/filesDia.vue
@@ -30,16 +30,10 @@
:isSelection="true"
@selection-change="handleSelectionChange"
height="500"
+ :page="page"
+ @pagination="pagination"
>
</PIMTable>
- <pagination
- style="margin: 10px 0"
- v-show="total > 0"
- @pagination="paginationSearch"
- :total="total"
- :page="page.current"
- :limit="page.size"
- />
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDia">鍙栨秷</el-button>
@@ -95,6 +89,7 @@
const page = reactive({
current: 1,
size: 100,
+ total: 0
});
const total = ref(0);
const tableData = ref([]);
@@ -111,7 +106,7 @@
currentId.value = row.id;
getList()
}
-const paginationSearch = (obj) => {
+const pagination = (obj) => {
page.current = obj.page;
page.size = obj.limit;
getList();
@@ -119,7 +114,7 @@
const getList = () => {
qualityInspectFileListPage({inspectId: currentId.value}).then(res => {
tableData.value = res.data.records;
- total.value = res.data.total;
+ page.total = res.data.total;
})
}
// 琛ㄦ牸閫夋嫨鏁版嵁
diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index 057781c..26e5b3a 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -58,7 +58,9 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="妫�楠屽憳锛�" prop="checkName">
- <el-select v-model="form.checkName" placeholder="璇烽�夋嫨" clearable>
+ <el-select v-model="form.checkName" filterable
+ default-first-option
+ :reserve-keyword="false" placeholder="璇烽�夋嫨" clearable>
<el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
:value="item.nickName"/>
</el-select>
diff --git a/src/views/qualityManagement/finalInspection/index.vue b/src/views/qualityManagement/finalInspection/index.vue
index 17e74b1..12aadac 100644
--- a/src/views/qualityManagement/finalInspection/index.vue
+++ b/src/views/qualityManagement/finalInspection/index.vue
@@ -150,7 +150,7 @@
label: "鎿嶄綔",
align: "center",
fixed: "right",
- width: 280,
+ width: 300,
operation: [
{
name: "缂栬緫",
diff --git a/src/views/qualityManagement/processInspection/components/filesDia.vue b/src/views/qualityManagement/processInspection/components/filesDia.vue
index fb47850..768ea5b 100644
--- a/src/views/qualityManagement/processInspection/components/filesDia.vue
+++ b/src/views/qualityManagement/processInspection/components/filesDia.vue
@@ -30,16 +30,10 @@
:isSelection="true"
@selection-change="handleSelectionChange"
height="500"
+ :page="page"
+ @pagination="pagination"
>
</PIMTable>
- <pagination
- style="margin: 10px 0"
- v-show="total > 0"
- @pagination="paginationSearch"
- :total="total"
- :page="page.current"
- :limit="page.size"
- />
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDia">鍙栨秷</el-button>
@@ -60,7 +54,6 @@
qualityInspectFileDel,
qualityInspectFileListPage
} from "@/api/qualityManagement/qualityInspectFile.js";
-import Pagination from "@/components/PIMTable/Pagination.vue";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -98,6 +91,7 @@
const page = reactive({
current: 1,
size: 100,
+ total: 0
});
const total = ref(0);
const tableData = ref([]);
@@ -114,17 +108,18 @@
currentId.value = row.id;
getList()
}
-const paginationSearch = (obj) => {
+
+const getList = () => {
+ qualityInspectFileListPage({inspectId: currentId.value}).then(res => {
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+}
+const pagination = (obj) => {
page.current = obj.page;
page.size = obj.limit;
getList();
};
-const getList = () => {
- qualityInspectFileListPage({inspectId: currentId.value}).then(res => {
- tableData.value = res.data.records;
- total.value = res.data.total;
- })
-}
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index 6126e6b..b371e67 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -65,7 +65,9 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="妫�楠屽憳锛�" prop="checkName">
- <el-select v-model="form.checkName" placeholder="璇烽�夋嫨" clearable>
+ <el-select v-model="form.checkName" filterable
+ default-first-option
+ :reserve-keyword="false" placeholder="璇烽�夋嫨" clearable>
<el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
:value="item.nickName"/>
</el-select>
diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index cebda55..b6429de 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -155,7 +155,7 @@
label: "鎿嶄綔",
align: "center",
fixed: "right",
- width: 280,
+ width: 300,
operation: [
{
name: "缂栬緫",
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
index 9907fbe..3208c6c 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
@@ -30,16 +30,10 @@
:isSelection="true"
@selection-change="handleSelectionChange"
height="500"
+ :page="page"
+ @pagination="pagination"
>
</PIMTable>
- <pagination
- style="margin: 10px 0"
- v-show="total > 0"
- @pagination="paginationSearch"
- :total="total"
- :page="page.current"
- :limit="page.size"
- />
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDia">鍙栨秷</el-button>
@@ -60,7 +54,6 @@
qualityInspectFileDel,
qualityInspectFileListPage
} from "@/api/qualityManagement/qualityInspectFile.js";
-import Pagination from "@/components/PIMTable/Pagination.vue";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -97,6 +90,7 @@
const page = reactive({
current: 1,
size: 100,
+ total: 0
});
const total = ref(0);
const tableData = ref([]);
@@ -114,15 +108,16 @@
currentId.value = row.id;
getList()
}
-const paginationSearch = (obj) => {
+const pagination = (obj) => {
page.current = obj.page;
page.size = obj.limit;
getList();
};
+
const getList = () => {
qualityInspectFileListPage({inspectId: currentId.value, ...page}).then(res => {
tableData.value = res.data.records;
- total.value = res.data.total;
+ page.total = res.data.total;
})
}
// 琛ㄦ牸閫夋嫨鏁版嵁
diff --git a/src/views/qualityManagement/rawMaterialInspection/index.vue b/src/views/qualityManagement/rawMaterialInspection/index.vue
index c9ea3db..477b55e 100644
--- a/src/views/qualityManagement/rawMaterialInspection/index.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -157,7 +157,7 @@
label: "鎿嶄綔",
align: "center",
fixed: "right",
- width: 280,
+ width: 300,
operation: [
{
name: "缂栬緫",
diff --git a/src/views/reportAnalysis/dataDashboard/index.vue b/src/views/reportAnalysis/dataDashboard/index.vue
index 9848898..75fbf34 100644
--- a/src/views/reportAnalysis/dataDashboard/index.vue
+++ b/src/views/reportAnalysis/dataDashboard/index.vue
@@ -54,7 +54,7 @@
<!-- 璐ㄩ噺缁熻 -->
<div class="panel-header">
- <span class="panel-title">璐ㄩ噺缁熻</span>
+ <span class="panel-title">杩�4鏈堣川閲忕粺璁�</span>
</div>
<div class="main-panel">
<div class="panel-item-customers">
@@ -174,7 +174,7 @@
</div>
<div class="financial-header">
- <span class="financial-title">璐㈠姟鍒嗘瀽</span>
+ <span class="financial-title">杩�4鏈堣储鍔″垎鏋�</span>
</div>
<div class="main-panel">
<div class="panel-item-customers">
@@ -205,11 +205,11 @@
<div class="panel-item-customers">
<div style="display: flex;justify-content: space-between;margin-bottom: 20px;">
<div class="section-title">搴旀敹搴斾粯缁熻</div>
- <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable" class="custom-radio-group">
- <el-radio-button label="鎸夊懆" :value="1" />
- <el-radio-button label="鎸夋湀" :value="2" />
- <el-radio-button label="鎸夊搴�" :value="3" />
- </el-radio-group>
+<!-- <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable" class="custom-radio-group">-->
+<!-- <el-radio-button label="鎸夊懆" :value="1" />-->
+<!-- <el-radio-button label="鎸夋湀" :value="2" />-->
+<!-- <el-radio-button label="鎸夊搴�" :value="3" />-->
+<!-- </el-radio-group>-->
</div>
<Echarts ref="chart"
:color="barColors2"
@@ -226,7 +226,7 @@
<!-- 鍥炴涓庡紑绁ㄥ垎鏋� -->
<div class="panel-header">
- <span class="panel-title">鍥炴涓庡紑绁ㄥ垎鏋�</span>
+ <span class="panel-title">杩戜竴鏈堝洖娆句笌寮�绁ㄥ垎鏋�</span>
</div>
<div class="panel-item-customers" style="padding-top: 60px;">
<Echarts ref="chart" :chartStyle="chartStyle" :grid="grid" :legend="lineLegend" :series="lineSeries"
@@ -412,7 +412,7 @@
const barLegend = {
show: true,
textStyle: { color: '#B8C8E0' },
- data: ['鍘熸潗鏂欎笉鍚堟牸鏁�', '杩囩▼涓嶅悎鏍兼暟', '鍑哄巶涓嶅悎鏍兼暟']
+ data: ['鍘熸潗鏂欏悎鏍兼暟', '杩囩▼鍚堟牸鏁�', '鍑轰笉鍚堟牸鏁�']
}
const barLegend1 = {
show: true,
@@ -487,7 +487,7 @@
])
const barSeries1 = ref([
{
- name: '鍘熸潗鏂欎笉鍚堟牸鏁�',
+ name: '鍘熸潗鏂欏悎鏍兼暟',
type: 'bar',
barGap: 0,
emphasis: {
@@ -509,7 +509,7 @@
data: []
},
{
- name: '杩囩▼涓嶅悎鏍兼暟',
+ name: '杩囩▼鍚堟牸鏁�',
type: 'bar',
emphasis: {
focus: 'series'
@@ -530,7 +530,7 @@
data: []
},
{
- name: '鍑哄巶涓嶅悎鏍兼暟',
+ name: '鍑哄巶鍚堟牸鏁�',
type: 'bar',
emphasis: {
focus: 'series'
@@ -672,10 +672,10 @@
getLedgerPage(params).then((res) => {
equipmentNum.value = res.data.total
});
- getRepairPage(params).then((res) => {
+ getRepairPage({...params, status:0}).then((res) => {
equipmentRepair.value = res.data.total
});
- getUpkeepPage(params).then((res) => {
+ getUpkeepPage({...params, status:0}).then((res) => {
equipmentMaintain.value = res.data.total
});
measuringInstrumentListPage(params).then((res) => {
@@ -920,7 +920,7 @@
// 浣跨敤nextTick纭繚DOM瀹屽叏娓叉煋鍚庡啀鍒濆鍖栧浘琛�
nextTick(() => {
// 鍒濆鍖朼utofit鑷�傚簲
- autofit.init({ dh: 1080, dw: 1920, el: '.data-dashboard', resize: true }, false)
+ autofit.init({ dh: 800, dw: 1280, el: '.data-dashboard', resize: true }, false)
// 娣诲姞鑷姩婊氬姩鍔ㄧ敾鏁堟灉 - 瀹㈡埛淇℃伅鍒楄〃
const contractList = refContractList.value
diff --git a/src/views/reportAnalysis/projectProfit/index.vue b/src/views/reportAnalysis/projectProfit/index.vue
index 1aa36c1..6fd8719 100644
--- a/src/views/reportAnalysis/projectProfit/index.vue
+++ b/src/views/reportAnalysis/projectProfit/index.vue
@@ -64,11 +64,11 @@
align: "center",
prop: "customerName",
},
- {
- label: "椤圭洰鍚嶇О",
- align: "center",
- prop: "projectName",
- },
+ // {
+ // label: "椤圭洰鍚嶇О",
+ // align: "center",
+ // prop: "projectName",
+ // },
{
label: "鍚堝悓閲戦",
align: "center",
diff --git a/src/views/salesManagement/indicatorStats/index.vue b/src/views/salesManagement/indicatorStats/index.vue
index 617ef6f..24a4a62 100644
--- a/src/views/salesManagement/indicatorStats/index.vue
+++ b/src/views/salesManagement/indicatorStats/index.vue
@@ -224,6 +224,10 @@
}
onMounted(() => {
+ // 璁剧疆鎸囨爣绛涢�夋棩鏈熻寖鍥撮粯璁ゅ�间负褰撳ぉ
+ const today = dayjs().format('YYYY-MM-DD')
+ indicatorFilter.dateRange = [today, today]
+
nextTick(() => initIndicatorChart())
})
</script>
diff --git a/src/views/salesManagement/invoiceLedger/fileList.vue b/src/views/salesManagement/invoiceLedger/fileList.vue
new file mode 100644
index 0000000..9d95833
--- /dev/null
+++ b/src/views/salesManagement/invoiceLedger/fileList.vue
@@ -0,0 +1,67 @@
+<template>
+ <el-dialog v-model="dialogVisible" title="闄勪欢" width="40%" :before-close="handleClose">
+ <el-table :data="tableData" border height="40vh">
+ <el-table-column label="闄勪欢鍚嶇О" prop="name" min-width="400" show-overflow-tooltip />
+ <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">涓嬭浇</el-button>
+ <el-button link type="primary" size="small" @click="lookFile(scope.row)">棰勮</el-button>
+ <el-button link type="danger" size="small" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+ <filePreview ref="filePreviewRef" />
+</template>
+
+<script setup>
+import { ref } from 'vue'
+import { ElMessageBox, ElMessage } from 'element-plus'
+import filePreview from '@/components/filePreview/index.vue'
+import { delCommonFileInvoiceLedger} from '@/api/publicApi/commonFile.js'
+
+const dialogVisible = ref(false)
+const tableData = ref([])
+const { proxy } = getCurrentInstance();
+const filePreviewRef = ref()
+const handleClose = () => {
+ dialogVisible.value = false
+}
+const open = (list) => {
+ dialogVisible.value = true
+ tableData.value = list
+}
+const downLoadFile = (row) => {
+ proxy.$download.name(row.url);
+
+}
+const lookFile = (row) => {
+ filePreviewRef.value.open(row.url)
+}
+// 鍒犻櫎闄勪欢
+const handleDelete = (row) => {
+ ElMessageBox.confirm(`纭鍒犻櫎闄勪欢"${row.name}"鍚楋紵`, '鍒犻櫎纭', {
+ confirmButtonText: '纭',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ delCommonFileInvoiceLedger([row.id]).then(() => {
+ ElMessage.success('鍒犻櫎鎴愬姛')
+ // 浠庡垪琛ㄤ腑绉婚櫎宸插垹闄ょ殑闄勪欢
+ const index = tableData.value.findIndex(item => item.id === row.id)
+ if (index !== -1) {
+ tableData.value.splice(index, 1)
+ }
+ }).catch(() => {
+ ElMessage.error('鍒犻櫎澶辫触')
+ })
+ }).catch(() => {
+ proxy.$modal.msg('宸插彇娑堝垹闄�')
+ })
+}
+defineExpose({
+ open
+})
+</script>
+
+<style></style>
\ No newline at end of file
diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index cfea002..814b36f 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -12,7 +12,7 @@
@change="changeDateRange" @clear="clearRange" />
</el-form-item>
<el-form-item label="褰曞叆鏃ユ湡">
- <el-date-picker style="width: 100%" v-model="searchForm.createTimeStart" value-format="YYYY-MM-DD"
+ <el-date-picker style="width: 100%" v-model="searchForm.createTimeStart" value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD" type="date" placeholder="璇烽�夋嫨" clearable @change="handleQuery" />
</el-form-item>
<el-form-item label="涓嶆樉绀烘湁鍙戠エ琛�">
@@ -31,9 +31,8 @@
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" show-overflow-tooltip width="180" />
- <el-table-column label="瀹㈡埛鍚堝悓鍙�" prop="customerContractNo" show-overflow-tooltip width="180" />
<el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" show-overflow-tooltip width="240" />
- <el-table-column label="椤圭洰" prop="projectName" width="320" />
+<!-- <el-table-column label="椤圭洰" prop="projectName" width="320" />-->
<el-table-column label="浜у搧澶х被" prop="productCategory" width="200" />
<el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="160" show-overflow-tooltip />
<el-table-column label="鍙戠エ鍙�" prop="invoiceNo" width="200" show-overflow-tooltip />
@@ -43,21 +42,22 @@
<el-table-column label="褰曞叆浜�" prop="invoicePerson" show-overflow-tooltip />
<el-table-column label="褰曞叆鏃ユ湡" prop="createTime" show-overflow-tooltip :formatter="formatDate" width="180" />
<el-table-column label="寮�绁ㄦ棩鏈�" prop="invoiceDate" show-overflow-tooltip width="120" />
- <el-table-column label="鍙戠エ" prop="invoiceFileName" width="120" align="center" show-overflow-tooltip fixed="right">
+ <!-- <el-table-column label="鍙戠エ" prop="invoiceFileName" width="120" align="center" show-overflow-tooltip fixed="right">
<template #default="scope">
<el-button v-if="scope.row.invoiceFileName" text bg type="primary"
@click="handleFile(scope.row.commonFiles)">
鏌ョ湅闄勪欢
</el-button>
- <el-button v-else link type="primary" @click="handleDownload(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">
+ <el-button v-else link type="primary" @click="handleDownload(scope.row)">
涓婁紶
</el-button>
</template>
- </el-table-column>
+ </el-table-column> -->
<el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
<template #default="scope">
- <el-button link type="primary" size="small" @click="openForm(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">缂栬緫</el-button>
- <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">鍒犻櫎</el-button>
+ <el-button link type="primary" size="small" @click="openForm(scope.row)">缂栬緫</el-button>
+ <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">闄勪欢</el-button>
+ <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -108,7 +108,7 @@
<el-form-item label="闄勪欢鏉愭枡锛�" prop="remark">
<el-upload v-model:file-list="fileList" :action="upload.url" multiple ref="fileUpload" auto-upload
:headers="upload.headers" accept=".pdf" :limit="10" :before-upload="handleBeforeUpload"
- :on-error="handleUploadError" :on-success="handleUploadSuccess" :on-remove="handleRemove">
+ :on-error="handleUploadError" :on-success="handleUploadSuccess">
<el-button type="primary">涓婁紶</el-button>
<template #tip>
<!-- 鏂囦欢鏍煎紡鏀寔 doc锛宒ocx锛寈ls锛寈lsx锛宲pt锛宲ptx锛宲df锛宼xt锛寈ml锛宩pg锛宩peg锛宲ng锛実if锛宐mp锛宺ar锛寊ip锛�7z-->
@@ -149,6 +149,7 @@
</div>
</template>
</el-dialog>
+ <FileList ref="fileListRef" />
</div>
</template>
@@ -164,10 +165,11 @@
commitFile,
registrationProductPage,
delInvoiceLedgerByRegProductId,
-} from "../../../api/salesManagement/invoiceLedger.js";
+} from "@/api/salesManagement/invoiceLedger.js";
import useUserStore from "@/store/modules/user.js";
import useFormData from "@/hooks/useFormData";
import dayjs from "dayjs";
+import FileList from "./fileList.vue";
const { proxy } = getCurrentInstance();
const tableData = ref([]);
@@ -229,7 +231,7 @@
return parseFloat(cellValue).toFixed(2);
};
const formatDate = (row, column, cellValue) => {
- return dayjs(cellValue).format("YYYY-MM-DD");
+ return dayjs(cellValue).format("YYYY-MM-DD HH:mm:ss");
};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -245,7 +247,11 @@
const getList = () => {
tableLoading.value = true;
const { invoiceDate, ...rest } = searchForm;
- registrationProductPage({ ...rest, ...page }).then((res) => {
+ // 灏嗚寖鍥存棩鏈熷瓧娈典紶閫掔粰鍚庣
+ const params = { ...rest, ...page };
+ // 绉婚櫎寮�绁ㄦ棩鏈熺殑榛樿鍊艰缃紝鍙繚鐣欒寖鍥存棩鏈熷瓧娈�
+ delete params.invoiceDate;
+ registrationProductPage(params).then((res) => {
tableLoading.value = false;
tableData.value = res.data.records;
total.value = res.data.total;
@@ -272,13 +278,15 @@
invoiceLedgerProductInfo({ id: row.id }).then((res) => {
form.value = { ...res.data };
fileList.value = res.data.fileList;
+ // 淇濆瓨ticketRegistrationId鍒拌〃鍗曟暟鎹腑
+ if (row.ticketRegistrationId) {
+ form.value.ticketRegistrationId = row.ticketRegistrationId;
+ }
if (!form.value.invoicePerson) {
form.value.invoicePerson = userStore.nickName;
- form.value.entryDate = getCurrentDate();
+ // 绉婚櫎褰曞叆鏃ユ湡榛樿鍊艰缃紝鍙鐞嗚寖鍥存棩鏈熷瓧娈�
}
- if (!form.value.invoiceDate) {
- form.value.invoiceDate = getCurrentDate();
- }
+ // 绉婚櫎寮�绁ㄦ棩鏈熼粯璁ゅ�艰缃紝鍙鐞嗚寖鍥存棩鏈熷瓧娈�
});
dialogFormVisible.value = true;
};
@@ -291,7 +299,6 @@
};
// 涓婁紶鍓嶆牎妫�
function handleBeforeUpload(file) {
- console.log("file", file);
// 鏍℃鏂囦欢澶у皬
if (file.size > 1024 * 1024 * 10) {
proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
@@ -303,6 +310,7 @@
proxy.$modal.msgError("鏂囦欢鏍煎紡涓嶅尮閰�");
return false;
}
+ console.log('handleBeforeUpload');
proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
return true;
}
@@ -314,20 +322,27 @@
// 涓婁紶鎴愬姛鍥炶皟
function handleUploadSuccess(res, file, uploadFiles) {
proxy.$modal.closeLoading();
+ console.log('handleUploadSuccess');
if (res.code === 200) {
- proxy.$refs["fileUpload"].handleRemove(file);
- fileList.value.push(res.data);
proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
+ // 灏嗕笂浼犳垚鍔熺殑鏂囦欢淇℃伅娣诲姞鍒癴ileList涓�
+ const fileInfo = {
+ name: file.name,
+ url: res.data.url || file.response?.data?.url || file.url,
+ response: file.response
+ };
+ // 妫�鏌ユ槸鍚﹀凡瀛樺湪鐩稿悓鏂囦欢锛岄伩鍏嶉噸澶嶆坊鍔�
+ const existingFileIndex = fileList.value.findIndex(f => f.name === fileInfo.name);
+ if (existingFileIndex === -1) {
+ fileList.value.push(fileInfo);
+ } else {
+ fileList.value[existingFileIndex] = fileInfo;
+ }
+ // 纭繚琛ㄥ崟鏁版嵁涓殑fileList涔熸洿鏂�
+ form.value.fileList = fileList.value;
} else {
proxy.$modal.msgError(res.msg);
proxy.$refs.fileUpload.handleRemove(file);
- }
-}
-// 绉婚櫎鏂囦欢
-function handleRemove(file) {
- let index = fileList.value.findIndex((item) => item.url === file.url);
- if (index > -1) {
- fileList.value.splice(index, 1);
}
}
// 鎻愪氦琛ㄥ崟
@@ -361,13 +376,6 @@
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
-
-// 鎵撳紑闄勪欢涓婁紶寮圭獥
-const handleDownload = (val) => {
- fileList.value = [];
- uploadModal.value = true;
- currentId.value = val.id;
};
// 纭鏂囦欢涓婁紶
@@ -433,7 +441,22 @@
getList();
};
+//闄勪欢鐩稿叧
+const fileListRef = ref(null)
+//鏌ョ湅闄勪欢
+const downLoadFile = (row) => {
+ invoiceLedgerProductInfo({ id: row.id }).then((res) => {
+ fileListRef.value.open(res.data.fileList)
+ });
+}
+
onMounted(() => {
+ // 璁剧疆寮�绁ㄦ棩鏈熻寖鍥撮粯璁ゅ�间负褰撳ぉ
+ const today = dayjs().format('YYYY-MM-DD');
+ searchForm.invoiceDate = [today, today];
+ // 璁剧疆鑼冨洿鏃ユ湡瀛楁鐨勮捣濮嬪拰缁撴潫鏃堕棿
+ searchForm.invoiceDateStart = today;
+ searchForm.invoiceDateEnd = today;
getList();
});
</script>
diff --git a/src/views/salesManagement/invoiceRegistration/index.vue b/src/views/salesManagement/invoiceRegistration/index.vue
index 8bf1236..17b38bb 100644
--- a/src/views/salesManagement/invoiceRegistration/index.vue
+++ b/src/views/salesManagement/invoiceRegistration/index.vue
@@ -1,406 +1,378 @@
<template>
- <div class="app-container">
- <div class="search_form">
- <el-form :inline="true" :model="searchForm">
- <el-form-item label="瀹㈡埛鍚嶇О">
- <el-input
- v-model="searchForm.customerName"
- style="width: 240px"
- placeholder="璇疯緭鍏ュ悕绉版悳绱�"
- clearable
- :prefix-icon="Search"
- @change="handleQuery"
- />
- </el-form-item>
- <el-form-item label="瀹㈡埛鍚堝悓鍙�">
- <el-input
- v-model="searchForm.customerContractNo"
- placeholder="璇疯緭鍏ュ鎴峰悎鍚屽彿"
- clearable
- />
- </el-form-item>
- <el-form-item label="椤圭洰鍚嶇О">
- <el-input
- v-model="searchForm.projectName"
- placeholder="璇疯緭鍏ラ」鐩悕绉�"
- clearable
- />
- </el-form-item>
- <el-form-item>
- <el-checkbox
- v-model="searchForm.status"
- label="涓嶆樉绀烘湭寮�绁ㄩ噾棰濅负0"
- @change="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button>
- <el-button @click="resetForm"> 閲嶇疆 </el-button>
- <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
- </el-form-item>
- </el-form>
- </div>
- <div class="table_list">
- <div class="flex justify-between">
- <div></div>
- <div>
- <el-button type="primary" @click="openForm" style="margin-bottom: 8px">
- 鏂板鐧昏
- </el-button>
- </div>
- </div>
- <el-table
- :data="tableData"
- :border="true"
- height="calc(100vh - 21em)"
- v-loading="tableLoading"
- :expand-row-keys="expandedRowKeys"
- :row-key="(row) => row.id"
- show-summary
- :summary-method="summarizeMainTable"
- @expand-change="expandChange"
- @selection-change="handleSelectionChange"
- >
- <el-table-column align="center" type="selection" width="55" />
- <el-table-column type="expand">
- <template #default="props">
- <el-table
- :data="props.row.children"
- border
- show-summary
- :summary-method="summarizeChildrenTable"
- >
- <el-table-column
- align="center"
- label="搴忓彿"
- type="index"
- width="60"
- />
- <el-table-column label="浜у搧澶х被" prop="productCategory" />
- <el-table-column
- label="瑙勬牸鍨嬪彿"
- prop="specificationModel"
- width="150"
- />
- <el-table-column label="鍗曚綅" prop="unit" width="70" />
- <el-table-column label="鏁伴噺" prop="quantity" width="70" />
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" />
- <el-table-column
- label="鍚◣鍗曚环(鍏�)"
- prop="taxInclusiveUnitPrice"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="鍚◣鎬讳环(鍏�)"
- prop="taxInclusiveTotalPrice"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="涓嶅惈绋庢�讳环(鍏�)"
- prop="taxExclusiveTotalPrice"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="寮�绁ㄦ暟"
- prop="invoiceNum"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="寮�绁ㄩ噾棰�(鍏�)"
- prop="invoiceAmount"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="鏈紑绁ㄦ暟"
- prop="noInvoiceNum"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="鏈紑绁ㄩ噾棰�(鍏�)"
- prop="noInvoiceAmount"
- :formatter="formattedNumber"
- />
- </el-table>
- </template>
- </el-table-column>
- <el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column
- label="閿�鍞悎鍚屽彿"
- prop="salesContractNo"
- show-overflow-tooltip
- width="200"
- />
- <el-table-column
- label="瀹㈡埛鍚堝悓鍙�"
- prop="customerContractNo"
- width="200"
- show-overflow-tooltip
- />
- <el-table-column
- label="瀹㈡埛鍚嶇О"
- prop="customerName"
- show-overflow-tooltip
- width="240"
- />
- <el-table-column label="涓氬姟鍛�" prop="salesman" show-overflow-tooltip width="90"/>
- <el-table-column
- label="椤圭洰鍚嶇О"
- prop="projectName"
- show-overflow-tooltip
- width="200"
- />
- <el-table-column
- label="鍚堝悓閲戦(鍏�)"
- prop="contractAmount"
- show-overflow-tooltip
- :formatter="formattedNumber"
- width="220"
-
- />
- <el-table-column
- label="宸插紑绁ㄩ噾棰�(鍏�)"
- prop="invoiceTotal"
- show-overflow-tooltip
- :formatter="formattedNumber"
- width="120"
- />
- <el-table-column
- label="鏈紑绁ㄩ噾棰�(鍏�)"
- prop="noInvoiceAmountTotal"
- show-overflow-tooltip
- width="120"
- >
- <template #default="{ row, column }">
- <el-text type="danger">
- {{ formattedNumber(row, column, row.noInvoiceAmountTotal) }}
- </el-text>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- layout="total, sizes, prev, pager, next, jumper"
- :page="page.current"
- :limit="page.size"
- @pagination="paginationChange"
- />
- </div>
- <el-dialog
- v-model="dialogFormVisible"
- title="鏂板寮�绁ㄧ櫥璁伴〉闈�"
- width="85%"
- @close="closeDia"
- >
- <el-form
- :model="form"
- label-width="140px"
- label-position="top"
- :rules="rules"
- ref="formRef"
- >
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="閿�鍞悎鍚屽彿锛�" prop="salesContractNo">
- <el-input v-model="form.salesContractNo" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="瀹㈡埛鍚嶇О锛�" prop="customerName">
- <el-input
- v-model="form.customerName"
- placeholder="鑷姩濉厖"
- disabled
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="涓氬姟鍛橈細" prop="salesman">
- <el-input
- v-model="form.salesman"
- placeholder="鑷姩濉厖"
- disabled
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
- <el-input
- v-model="form.projectName"
- placeholder="鑷姩濉厖"
- disabled
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="褰曞叆浜�" prop="createUer">
- <el-input v-model="form.createUer" placeholder="璇疯緭鍏ュ綍鍏ヤ汉" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="寮�绁ㄦ棩鏈�" prop="issueDate">
- <el-date-picker
- style="width: 100%"
- v-model="form.issueDate"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="褰曞叆鏃ユ湡锛�" prop="createTime">
- <el-date-picker
- style="width: 100%"
- v-model="form.createTime"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍙戠エ鍙风爜锛�" prop="invoiceNo">
- <el-input
- v-model="form.invoiceNo"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-form-item label="浜у搧淇℃伅锛�" prop="entryDate"> </el-form-item>
- </el-row>
- <el-table
- :data="productData"
- border
- show-summary
- :summary-method="summarizeChildrenTable"
- >
- <el-table-column
- align="center"
- label="搴忓彿"
- type="index"
- width="60"
- />
- <el-table-column label="浜у搧澶х被" prop="productCategory" />
- <el-table-column
- label="瑙勬牸鍨嬪彿"
- prop="specificationModel"
- width="150"
- />
- <el-table-column label="鍗曚綅" prop="unit" />
- <el-table-column label="鏁伴噺" prop="quantity" width="70" />
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" />
- <el-table-column
- label="鍚◣鍗曚环(鍏�)"
- prop="taxInclusiveUnitPrice"
- :formatter="formattedNumber"
+ <div class="app-container">
+ <div class="search_form">
+ <el-form :inline="true" :model="searchForm">
+ <el-form-item label="瀹㈡埛鍚嶇О">
+ <el-input
+ v-model="searchForm.customerName"
+ style="width: 240px"
+ placeholder="璇疯緭鍏ュ悕绉版悳绱�"
+ clearable
+ :prefix-icon="Search"
+ @change="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item>
+ <el-checkbox
+ v-model="searchForm.status"
+ label="涓嶆樉绀烘湭寮�绁ㄩ噾棰濅负0"
+ @change="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button>
+ <el-button @click="resetForm"> 閲嶇疆 </el-button>
+ <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="table_list">
+ <div class="flex justify-between">
+ <div></div>
+ <div>
+ <el-button type="primary" @click="openForm" style="margin-bottom: 8px">
+ 鏂板鐧昏
+ </el-button>
+ </div>
+ </div>
+ <el-table
+ :data="tableData"
+ :border="true"
+ height="calc(100vh - 21em)"
+ v-loading="tableLoading"
+ :expand-row-keys="expandedRowKeys"
+ :row-key="(row) => row.id"
+ show-summary
+ :summary-method="summarizeMainTable"
+ @expand-change="expandChange"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column align="center" type="selection" width="55" />
+ <el-table-column type="expand">
+ <template #default="props">
+ <el-table
+ :data="props.row.children"
+ border
+ show-summary
+ :summary-method="summarizeChildrenTable"
+ >
+ <el-table-column
+ align="center"
+ label="搴忓彿"
+ type="index"
+ width="60"
+ />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" />
+ <el-table-column
+ label="瑙勬牸鍨嬪彿"
+ prop="specificationModel"
+ width="150"
+ />
+ <el-table-column label="鍗曚綅" prop="unit" width="70" />
+ <el-table-column label="鏁伴噺" prop="quantity" width="70" />
+ <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" />
+ <el-table-column
+ label="鍚◣鍗曚环(鍏�)"
+ prop="taxInclusiveUnitPrice"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鍚◣鎬讳环(鍏�)"
+ prop="taxInclusiveTotalPrice"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="涓嶅惈绋庢�讳环(鍏�)"
+ prop="taxExclusiveTotalPrice"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="寮�绁ㄦ暟"
+ prop="invoiceNum"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="寮�绁ㄩ噾棰�(鍏�)"
+ prop="invoiceAmount"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鏈紑绁ㄦ暟"
+ prop="noInvoiceNum"
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鏈紑绁ㄩ噾棰�(鍏�)"
+ prop="noInvoiceAmount"
+ :formatter="formattedNumber"
+ />
+ </el-table>
+ </template>
+ </el-table-column>
+ <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+ <el-table-column
+ label="閿�鍞悎鍚屽彿"
+ prop="salesContractNo"
+ show-overflow-tooltip
+ />
+<!-- <el-table-column-->
+<!-- label="瀹㈡埛鍚堝悓鍙�"-->
+<!-- prop="customerContractNo"-->
+<!-- width="200"-->
+<!-- show-overflow-tooltip-->
+<!-- />-->
+ <el-table-column
+ label="瀹㈡埛鍚嶇О"
+ prop="customerName"
+ show-overflow-tooltip
+ />
+ <el-table-column label="涓氬姟鍛�" prop="salesman" show-overflow-tooltip/>
+ <el-table-column
+ label="鍚堝悓閲戦(鍏�)"
+ prop="contractAmount"
+ show-overflow-tooltip
+ :formatter="formattedNumber"
+
+ />
+ <el-table-column
+ label="宸插紑绁ㄩ噾棰�(鍏�)"
+ prop="invoiceTotal"
+ show-overflow-tooltip
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鏈紑绁ㄩ噾棰�(鍏�)"
+ prop="noInvoiceAmountTotal"
+ show-overflow-tooltip
+ width="120"
+ >
+ <template #default="{ row, column }">
+ <el-text type="danger">
+ {{ formattedNumber(row, column, row.noInvoiceAmountTotal) }}
+ </el-text>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination
+ v-show="total > 0"
+ :total="total"
+ layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current"
+ :limit="page.size"
+ @pagination="paginationChange"
+ />
+ </div>
+ <el-dialog
+ v-model="dialogFormVisible"
+ title="鏂板寮�绁ㄧ櫥璁伴〉闈�"
+ width="85%"
+ @close="closeDia"
+ >
+ <el-form
+ :model="form"
+ label-width="140px"
+ label-position="top"
+ :rules="rules"
+ ref="formRef"
+ >
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="閿�鍞悎鍚屽彿锛�" prop="salesContractNo">
+ <el-input v-model="form.salesContractNo" disabled placeholder="澶氬悎鍚屾壒閲忓鐞嗭紙鍏蜂綋鍚堝悓鍙疯浜у搧鍒楄〃锛�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀹㈡埛鍚嶇О锛�" prop="customerName">
+ <el-input
+ v-model="form.customerName"
+ placeholder="鑷姩濉厖"
+ disabled
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="涓氬姟鍛橈細" prop="salesman">
+ <el-input
+ v-model="form.salesman"
+ placeholder="鑷姩濉厖"
+ disabled
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="褰曞叆浜�" prop="createUer">
+ <el-input v-model="form.createUer" placeholder="璇疯緭鍏ュ綍鍏ヤ汉" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="寮�绁ㄦ棩鏈�" prop="issueDate">
+ <el-date-picker
+ style="width: 100%"
+ v-model="form.issueDate"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ clearable
+ format="YYYY-MM-DD"
+ value-format="YYYY-MM-DD"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="褰曞叆鏃ユ湡锛�" prop="createTime">
+ <el-date-picker
+ style="width: 100%"
+ v-model="form.createTime"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍙戠エ鍙风爜锛�" prop="invoiceNo">
+ <el-input
+ v-model="form.invoiceNo"
+ placeholder="璇疯緭鍏�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-form-item label="浜у搧淇℃伅锛�" prop="entryDate"> </el-form-item>
+ </el-row>
+ <el-table
+ :data="productData"
+ border
+ show-summary
+ :summary-method="summarizeChildrenTable"
+ >
+ <el-table-column
+ align="center"
+ label="搴忓彿"
+ type="index"
+ width="60"
+ />
+ <el-table-column label="鎵�灞炲悎鍚�" prop="salesContractNo" width="200">
+ <template #default="{ row }">
+ <el-tag type="primary">{{ row.salesContractNo }}</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="浜у搧澶х被" prop="productCategory" />
+ <el-table-column
+ label="瑙勬牸鍨嬪彿"
+ prop="specificationModel"
+ width="150"
+ />
+ <el-table-column label="鍗曚綅" prop="unit" />
+ <el-table-column label="鏁伴噺" prop="quantity" width="70" />
+ <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" />
+ <el-table-column
+ label="鍚◣鍗曚环(鍏�)"
+ prop="taxInclusiveUnitPrice"
+ :formatter="formattedNumber"
width="200"
- />
- <el-table-column
- label="鍚◣鎬讳环(鍏�)"
- prop="taxInclusiveTotalPrice"
- :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="鍚◣鎬讳环(鍏�)"
+ prop="taxInclusiveTotalPrice"
+ :formatter="formattedNumber"
width="200"
- />
- <el-table-column
- label="涓嶅惈绋庢�讳环(鍏�)"
- prop="taxExclusiveTotalPrice"
- :formatter="formattedNumber"
- width="150"
- />
- <el-table-column label="鏈寮�绁ㄦ暟" prop="currentInvoiceNum" width="180">
- <template #default="scope">
- <el-input-number :step="0.1" :min="0" style="width: 100%"
+ />
+ <el-table-column
+ label="涓嶅惈绋庢�讳环(鍏�)"
+ prop="taxExclusiveTotalPrice"
+ :formatter="formattedNumber"
+ width="150"
+ />
+ <el-table-column label="鏈寮�绁ㄦ暟" prop="currentInvoiceNum" width="180">
+ <template #default="scope">
+ <el-input-number :step="0.1" :min="0" style="width: 100%"
:precision="2"
- v-model="scope.row.currentInvoiceNum"
- @change="invoiceNumBlur(scope.row)"
- ></el-input-number>
- </template>
- </el-table-column>
- <el-table-column
- label="鏈寮�绁ㄩ噾棰�(鍏�)"
- prop="currentInvoiceAmount"
- width="180"
- >
- <template #default="scope">
- <el-input-number :step="0.01" :min="0" style="width: 100%"
+ v-model="scope.row.currentInvoiceNum"
+ @change="invoiceNumBlur(scope.row)"
+ ></el-input-number>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鏈寮�绁ㄩ噾棰�(鍏�)"
+ prop="currentInvoiceAmount"
+ width="180"
+ >
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%"
:precision="2"
- v-model="scope.row.currentInvoiceAmount"
- @change="invoiceAmountBlur(scope.row)"
- ></el-input-number>
- </template>
- </el-table-column>
- <el-table-column label="鏈紑绁ㄦ暟" prop="noInvoiceNum" width="120">
- <template #default="scope">
- <el-input
- type="number"
- min="0"
- disabled
- v-model="scope.row.noInvoiceNum"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="鏈紑绁ㄩ噾棰�(鍏�)"
- prop="noInvoiceAmount"
- width="200"
- >
- <template #default="scope">
- <el-input
- type="number"
- min="0"
- disabled
- v-model="scope.row.noInvoiceAmount"
- :formatter="formattedInputNumber"
- :precision="2"
- :step="0.01"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column label="鐧昏浜�" prop="register" width="100">
- <!-- <template #default="{ row }">
- <el-input
- v-model="row.register"
- placeholder="璇疯緭鍏ョ櫥璁颁汉"
- disabled
- />
- </template> -->
- </el-table-column>
- <el-table-column label="鐧昏鏃ユ湡" prop="registerDate" width="150">
- <!-- <template #default="{ row }">
- <el-date-picker
- style="width: 100%"
- v-model="row.registerDate"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable
- disabled
- />
- </template> -->
- </el-table-column>
- </el-table>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
- <el-button @click="closeDia">鍙栨秷</el-button>
- </div>
- </template>
- </el-dialog>
- </div>
+ v-model="scope.row.currentInvoiceAmount"
+ @change="invoiceAmountBlur(scope.row)"
+ ></el-input-number>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏈紑绁ㄦ暟" prop="noInvoiceNum" width="120">
+ <template #default="scope">
+ <el-input
+ type="number"
+ min="0"
+ disabled
+ v-model="scope.row.noInvoiceNum"
+ ></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鏈紑绁ㄩ噾棰�(鍏�)"
+ prop="noInvoiceAmount"
+ width="200"
+ >
+ <template #default="scope">
+ <el-input
+ type="number"
+ min="0"
+ disabled
+ v-model="scope.row.noInvoiceAmount"
+ :formatter="formattedInputNumber"
+ :precision="2"
+ :step="0.01"
+ ></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐧昏浜�" prop="register" width="100">
+ <!-- <template #default="{ row }">
+ <el-input
+ v-model="row.register"
+ placeholder="璇疯緭鍏ョ櫥璁颁汉"
+ disabled
+ />
+ </template> -->
+ </el-table-column>
+ <el-table-column label="鐧昏鏃ユ湡" prop="registerDate" width="150">
+ <!-- <template #default="{ row }">
+ <el-date-picker
+ style="width: 100%"
+ v-model="row.registerDate"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ clearable
+ disabled
+ />
+ </template> -->
+ </el-table-column>
+ </el-table>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
</template>
<script setup>
@@ -410,9 +382,9 @@
import { ElMessageBox } from "element-plus";
// import {userListNoPage} from "@/api/system/user.js";
import {
- getSalesLedgerWithProducts,
- ledgerListPage,
- productList,
+ getSalesLedgerWithProducts,
+ ledgerListPage,
+ productList,
} from "@/api/salesManagement/salesLedger.js";
import { invoiceRegistrationSave } from "@/api/salesManagement/invoiceRegistration.js";
import useFormData from "@/hooks/useFormData";
@@ -426,261 +398,377 @@
const selectedRows = ref([]);
const tableLoading = ref(false);
const page = reactive({
- current: 1,
- size: 100,
+ current: 1,
+ size: 100,
});
const total = ref(0);
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref("");
const dialogFormVisible = ref(false);
const data = reactive({
- searchForm: {
- customerName: "",
- status: false,
- customerContractNo: undefined, // 瀹㈡埛鍚堝悓鍙�
- projectName: undefined, // 椤圭洰鍚嶇О
- createUer: undefined, // 鐧昏浜�
- issueDate: undefined, // 寮�绁ㄦ棩鏈�
- createTime: undefined, // 褰曞叆鏃ユ湡锛�
- },
- form: {
- salesLedgerId: "",
- customerName: "",
- salesman: "",
- projectName: "",
- productData: [],
- invoiceNo: "",
- createUer: userStore.nickName,
- issueDate: dayjs().format("YYYY-MM-DD"),
- },
- rules: {
- salesLedgerId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- createUer: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }],
- issueDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- invoiceNo: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
- createTime: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- },
+ searchForm: {
+ customerName: "",
+ status: false,
+ customerContractNo: undefined, // 瀹㈡埛鍚堝悓鍙�
+ projectName: undefined, // 椤圭洰鍚嶇О
+ createUer: undefined, // 鐧昏浜�
+ issueDate: undefined, // 寮�绁ㄦ棩鏈�
+ createTime: undefined, // 褰曞叆鏃ユ湡锛�
+ productCategory: "",
+ isInvoice: 1
+ },
+ form: {
+ salesLedgerId: "",
+ customerName: "",
+ salesman: "",
+ projectName: "",
+ productData: [],
+ invoiceNo: "",
+ createUer: userStore.nickName,
+ issueDate: dayjs().format("YYYY-MM-DD"),
+ selectedContractIds: [], // 鏂板锛氬瓨鍌ㄦ墍鏈夐�変腑鐨勫悎鍚孖D
+ isBatch: false // 鏂板锛氭爣璇嗘槸鍚︿负鎵归噺鎿嶄綔
+ },
+ rules: {
+ createUer: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }],
+ issueDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ invoiceNo: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
+ createTime: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ },
});
const { form, rules } = toRefs(data);
const { form: searchForm, resetForm } = useFormData(data.searchForm);
const formattedNumber = (row, column, cellValue) => {
- if (cellValue == 0) {
- return parseFloat(cellValue).toFixed(2);
- }
- if (cellValue) {
- return parseFloat(cellValue).toFixed(2);
- } else {
- return cellValue;
- }
+ if (cellValue == 0) {
+ return parseFloat(cellValue).toFixed(2);
+ }
+ if (cellValue) {
+ return parseFloat(cellValue).toFixed(2);
+ } else {
+ return cellValue;
+ }
};
const formattedInputNumber = (value) => {
- return value ? parseFloat(value).toFixed(2) : 0;
+ return value ? parseFloat(value).toFixed(2) : 0;
};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
- page.current = 1;
- getList();
+ page.current = 1;
+ getList();
};
const paginationChange = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
};
const getList = () => {
- tableLoading.value = true;
- ledgerListPage({ ...searchForm, ...page }).then((res) => {
- tableLoading.value = false;
- tableData.value = res.records;
- total.value = res.total;
- expandedRowKeys.value = [];
- });
+ tableLoading.value = true;
+ ledgerListPage({ ...searchForm, ...page }).then((res) => {
+ tableLoading.value = false;
+ tableData.value = res.records;
+ total.value = res.total;
+ expandedRowKeys.value = [];
+ });
};
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
- console.log("selection", selection);
- selectedRows.value = selection.filter(
- (item) => item.salesContractNo !== undefined
- );
+ console.log("selection", selection);
+ selectedRows.value = selection.filter(
+ (item) => item.salesContractNo !== undefined
+ );
};
const expandedRowKeys = ref([]);
// 灞曞紑琛�
const expandChange = (row, expandedRows) => {
- if (expandedRows.length > 0) {
- expandedRowKeys.value = [];
- try {
- productList({ salesLedgerId: row.id, type: 1 }).then((res) => {
- const index = tableData.value.findIndex((item) => item.id === row.id);
- if (index > -1) {
- tableData.value[index].children = res.data;
- }
- expandedRowKeys.value.push(row.id);
- });
- } catch (error) {
- console.log(error);
- }
- } else {
- expandedRowKeys.value = [];
- }
+ if (expandedRows.length > 0) {
+ expandedRowKeys.value = [];
+ try {
+ productList({ salesLedgerId: row.id, type: 1 }).then((res) => {
+ const index = tableData.value.findIndex((item) => item.id === row.id);
+ if (index > -1) {
+ tableData.value[index].children = res.data;
+ }
+ expandedRowKeys.value.push(row.id);
+ });
+ } catch (error) {
+ console.log(error);
+ }
+ } else {
+ expandedRowKeys.value = [];
+ }
};
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- return proxy.summarizeTable(param, [
- "contractAmount",
- "invoiceTotal",
- "noInvoiceAmountTotal",
- ]);
+ return proxy.summarizeTable(param, [
+ "contractAmount",
+ "invoiceTotal",
+ "noInvoiceAmountTotal",
+ ]);
};
// 瀛愯〃鍚堣鏂规硶
const summarizeChildrenTable = (param) => {
- return proxy.summarizeTable(param, [
- "taxInclusiveUnitPrice",
- "taxInclusiveTotalPrice",
- "taxExclusiveTotalPrice",
- "invoiceNum",
- "invoiceAmount",
- "currentInvoiceAmount",
- "noInvoiceNum",
- "noInvoiceAmount",
- "currentInvoiceNum",
- ]);
+ return proxy.summarizeTable(param, [
+ "taxInclusiveUnitPrice",
+ "taxInclusiveTotalPrice",
+ "taxExclusiveTotalPrice",
+ "invoiceNum",
+ "invoiceAmount",
+ "currentInvoiceAmount",
+ "noInvoiceNum",
+ "noInvoiceAmount",
+ "currentInvoiceNum",
+ ]);
};
// 鎵撳紑寮规
const openForm = () => {
- // 鍒ゆ柇鏄惁澶氶��
- if (selectedRows.value.length != 1) {
- proxy.$modal.msgError("璇烽�夋嫨涓�鏉″悎鍚�");
- return;
- }
- form.value = {};
- productData.value = [];
- getSalesLedgerWithProducts({ id: selectedRows.value[0].id }).then((res) => {
- form.value = { ...res };
- form.value.createTime = dayjs().format("YYYY-MM-DD");
- form.value.issueDate = dayjs().format("YYYY-MM-DD");
- form.value.createUer = userStore.nickName;
- productData.value = form.value.productData.map((item) => {
- return item;
- });
- dialogFormVisible.value = true;
- console.log("productData.value ", productData.value);
- });
+ // 鍒ゆ柇鏄惁閫夋嫨浜嗗悎鍚�
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgError("璇疯嚦灏戦�夋嫨涓�鏉″悎鍚�");
+ return;
+ }
+
+ // 妫�鏌ユ墍鏈夐�夋嫨鐨勫悎鍚屾槸鍚﹀叿鏈夌浉鍚岀殑瀹㈡埛鍚嶇О
+ const firstRow = selectedRows.value[0];
+ const isSameCustomer = selectedRows.value.every(row =>
+ row.customerName === firstRow.customerName
+ );
+
+ if (!isSameCustomer) {
+ proxy.$modal.msgError("璇烽�夋嫨鐩稿悓瀹㈡埛鍚嶇О鐨勫悎鍚�");
+ return;
+ }
+
+ // 鍏佽涓嶅悓鐨勯攢鍞悎鍚屽彿鎵归噺澶勭悊锛屾棤闇�妫�鏌ラ噸澶�
+
+ form.value = {};
+ productData.value = [];
+
+ // 鍔犺浇鎵�鏈夐�変腑鍚堝悓鐨勪骇鍝佹暟鎹�
+ const promises = selectedRows.value.map(row =>
+ getSalesLedgerWithProducts({ id: row.id })
+ );
+
+ Promise.all(promises).then(results => {
+ // 鍚堝苟鎵�鏈夊悎鍚岀殑浜у搧鏁版嵁锛屽苟涓烘瘡涓骇鍝佹坊鍔犲搴旂殑鍚堝悓淇℃伅
+ const allProductData = [];
+ results.forEach((result, index) => {
+ const contract = selectedRows.value[index];
+ const contractId = contract.id;
+ if (result.productData) {
+ result.productData.forEach(item => {
+ allProductData.push({
+ ...item,
+ id: contractId, // 鏄庣‘璁剧疆鍚堝悓ID
+ salesContractNo: contract.salesContractNo, // 娣诲姞閿�鍞悎鍚屽彿
+ customerName: contract.customerName, // 娣诲姞瀹㈡埛鍚嶇О
+ customerContractNo: contract.customerContractNo // 娣诲姞瀹㈡埛鍚堝悓鍙�
+ });
+ });
+ }
+ });
+
+ // 璁剧疆琛ㄥ崟鏁版嵁锛堜娇鐢ㄧ涓�涓悎鍚岀殑鍩烘湰淇℃伅锛岄攢鍞悎鍚屽彿鐣欑┖锛�
+ form.value = { ...results[0] };
+ form.value.createTime = dayjs().format("YYYY-MM-DD");
+ form.value.issueDate = dayjs().format("YYYY-MM-DD");
+ form.value.createUer = userStore.nickName;
+ form.value.selectedContractIds = selectedRows.value.map(row => row.id); // 瀛樺偍鎵�鏈夐�変腑鐨勫悎鍚孖D
+ form.value.salesContractNo = ""; // 閿�鍞悎鍚屽彿鐣欑┖锛屽洜涓轰細鍦ㄤ骇鍝佽〃鏍间腑鍒嗗埆鏄剧ず
+
+ productData.value = allProductData;
+
+ dialogFormVisible.value = true;
+ console.log("productData.value ", productData.value);
+ });
};
// 鎻愪氦琛ㄥ崟
const submitForm = () => {
- proxy.$refs["formRef"].validate((valid) => {
- if (valid) {
- form.value.productData = proxy.HaveJson(productData.value);
- invoiceRegistrationSave(form.value).then((res) => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- getList();
- });
- }
- });
+ proxy.$refs["formRef"].validate((valid) => {
+ if (valid) {
+ // 濡傛灉鏄壒閲忔搷浣滐紝灏嗘墍鏈夊悎鍚岀殑鏁版嵁鏀惧湪涓�涓暟缁勯噷锛屽彧璋冪敤涓�娆℃帴鍙�
+ if (selectedRows.value.length > 1) {
+ // 鍒涘缓鍖呭惈鎵�鏈夊悎鍚屾暟鎹殑鏁扮粍
+ const batchData = selectedRows.value.map(contract => {
+ // 绛涢�夊嚭灞炰簬褰撳墠鍚堝悓鐨勪骇鍝佹暟鎹�
+ const contractProductData = productData.value.filter(item =>
+ item.salesLedgerId === contract.id
+ );
+
+ // 涓烘瘡涓攢鍞悎鍚屽彿鍒涘缓鐙珛鐨勫璞�
+ return {
+ // 鍩虹琛ㄥ崟鏁版嵁
+ issueDate: form.value.issueDate,
+ createTime: form.value.createTime,
+ createUer: form.value.createUer,
+ invoiceNo: form.value.invoiceNo,
+
+ // 鍚堝悓瀹為檯淇℃伅
+ id: contract.id, // 浣跨敤id浣滀负瀛楁鍚嶏紝鍊间负salesLedgerId
+ salesContractNo: contract.salesContractNo, // 浣跨敤瀹為檯鐨勯攢鍞悎鍚屽彿
+ customerName: contract.customerName, // 浣跨敤瀹為檯鐨勫鎴峰悕绉�
+ customerId: contract.customerId, // 娣诲姞瀹㈡埛ID
+ customerContractNo: contract.customerContractNo, // 浣跨敤瀹為檯鐨勫鎴峰悎鍚屽彿
+ projectName: contract.projectName, // 浣跨敤瀹為檯鐨勯」鐩悕绉�
+ salesman: contract.salesman, // 浣跨敤瀹為檯鐨勪笟鍔″憳
+
+ // 浜у搧鏁版嵁
+ productData: proxy.HaveJson(contractProductData),
+
+ // 鎵归噺鏍囪瘑
+ isBatch: true
+ };
+ });
+
+ // 鍙皟鐢ㄤ竴娆℃帴鍙o紝浼犻�掑寘鍚墍鏈夊悎鍚屾暟鎹殑鏁扮粍
+ invoiceRegistrationSave(batchData).then(() => {
+ proxy.$modal.msgSuccess("鎵归噺鏂板鎴愬姛");
+ closeDia();
+ getList();
+ });
+ } else {
+ // 鍗曚釜鍚堝悓鎻愪氦閫昏緫 - 涔熶互鏁扮粍褰㈠紡浼犻��
+ const singleContract = selectedRows.value[0];
+ const singleFormArray = [
+ {
+ // 鍩虹琛ㄥ崟鏁版嵁
+ issueDate: form.value.issueDate,
+ createTime: form.value.createTime,
+ createUer: form.value.createUer,
+ invoiceNo: form.value.invoiceNo,
+
+ // 鍚堝悓瀹為檯淇℃伅
+ id: singleContract.id, // 浣跨敤id浣滀负瀛楁鍚嶏紝鍊间负salesLedgerId
+ salesContractNo: singleContract.salesContractNo, // 浣跨敤瀹為檯鐨勯攢鍞悎鍚屽彿
+ customerName: singleContract.customerName, // 浣跨敤瀹為檯鐨勫鎴峰悕绉�
+ customerId: singleContract.customerId, // 娣诲姞瀹㈡埛ID
+ customerContractNo: singleContract.customerContractNo, // 浣跨敤瀹為檯鐨勫鎴峰悎鍚屽彿
+ projectName: singleContract.projectName, // 浣跨敤瀹為檯鐨勯」鐩悕绉�
+ salesman: singleContract.salesman, // 浣跨敤瀹為檯鐨勪笟鍔″憳
+
+ // 浜у搧鏁版嵁
+ productData: proxy.HaveJson(productData.value),
+
+ // 鎵归噺鏍囪瘑
+ isBatch: false
+ }
+ ];
+ invoiceRegistrationSave(singleFormArray).then((res) => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ getList();
+ });
+ }
+ }
+ });
};
// 鍏抽棴寮规
const closeDia = () => {
- proxy.resetForm("formRef");
- dialogFormVisible.value = false;
+ proxy.resetForm("formRef");
+ dialogFormVisible.value = false;
};
// 瀵煎嚭
const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/invoiceRegistration/export", {}, "寮�绁ㄧ櫥璁颁俊鎭�.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/invoiceRegistration/export", {}, "寮�绁ㄧ櫥璁颁俊鎭�.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
};
// 瀵煎嚭閿�鍞彴璐�
const handleExport = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/sales/ledger/exportOne", { ...searchForm, ...page }, "寮�绁ㄧ櫥璁�.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/sales/ledger/exportOne", { ...searchForm, ...page }, "寮�绁ㄧ櫥璁�.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
};
//鏈寮�绁ㄥけ鐒︽搷浣�
const invoiceNumBlur = (row) => {
- if (!row.currentInvoiceNum) {
- row.currentInvoiceNum = 0;
- }
- if (row.currentInvoiceNum > row.tempNoInvoiceNum) {
- proxy.$modal.msgWarning("鏈寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
- row.currentInvoiceNum = 0;
- }
- // 璁$畻鏈寮�绁ㄩ噾棰�
- row.currentInvoiceAmount = (
- row.currentInvoiceNum * row.taxInclusiveUnitPrice
- ).toFixed(2);
- // 璁$畻鏈紑绁ㄦ暟
- row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(
- 2
- );
- // 璁$畻鏈紑绁ㄩ噾棰�
- row.noInvoiceAmount = (
- row.tempnoInvoiceAmount - row.currentInvoiceAmount
- ).toFixed(2);
+ if (!row.currentInvoiceNum) {
+ row.currentInvoiceNum = 0;
+ }
+ if (row.currentInvoiceNum > row.tempNoInvoiceNum) {
+ proxy.$modal.msgWarning("鏈寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
+ row.currentInvoiceNum = 0;
+ }
+ // 璁$畻鏈寮�绁ㄩ噾棰�
+ row.currentInvoiceAmount = (
+ row.currentInvoiceNum * row.taxInclusiveUnitPrice
+ ).toFixed(2);
+ // 璁$畻鏈紑绁ㄦ暟
+ row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(
+ 2
+ );
+ // 璁$畻鏈紑绁ㄩ噾棰�
+ row.noInvoiceAmount = (
+ row.tempnoInvoiceAmount - row.currentInvoiceAmount
+ ).toFixed(2);
};
// 鏈寮�绁ㄩ噾棰濆け鐒︽搷浣�
const invoiceAmountBlur = (row) => {
- if (!row.currentInvoiceAmount) {
- row.currentInvoiceAmount = 0;
- }
- // 璁$畻鏄惁瓒呰繃寮�绁ㄦ�婚噾棰�
- if (row.currentInvoiceAmount > row.tempnoInvoiceAmount) {
- proxy.$modal.msgWarning("鏈寮�绁ㄩ噾棰濅笉寰楀ぇ浜庢湭寮�绁ㄩ噾棰�");
- row.currentInvoiceAmount = 0;
- }
- // 璁$畻鏈寮�绁ㄦ暟
- row.currentInvoiceNum = (
- row.currentInvoiceAmount / row.taxInclusiveUnitPrice
- ).toFixed(2);
- console.log("row.currentInvoiceNum ", row.currentInvoiceNum);
- console.log(" row.originalNoInvoiceNum ", row.originalNoInvoiceNum);
- // 璁$畻鏈紑绁ㄦ暟
- row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(
- 2
- );
- // 璁$畻鏈紑绁ㄩ噾棰�
- row.noInvoiceAmount = (
- row.tempnoInvoiceAmount - row.currentInvoiceAmount
- ).toFixed(2);
+ if (!row.currentInvoiceAmount) {
+ row.currentInvoiceAmount = 0;
+ }
+ // 璁$畻鏄惁瓒呰繃寮�绁ㄦ�婚噾棰�
+ if (row.currentInvoiceAmount > row.tempnoInvoiceAmount) {
+ proxy.$modal.msgWarning("鏈寮�绁ㄩ噾棰濅笉寰楀ぇ浜庢湭寮�绁ㄩ噾棰�");
+ row.currentInvoiceAmount = 0;
+ }
+ // 璁$畻鏈寮�绁ㄦ暟
+ row.currentInvoiceNum = (
+ row.currentInvoiceAmount / row.taxInclusiveUnitPrice
+ ).toFixed(2);
+ console.log("row.currentInvoiceNum ", row.currentInvoiceNum);
+ console.log(" row.originalNoInvoiceNum ", row.originalNoInvoiceNum);
+ // 璁$畻鏈紑绁ㄦ暟
+ row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(
+ 2
+ );
+ // 璁$畻鏈紑绁ㄩ噾棰�
+ row.noInvoiceAmount = (
+ row.tempnoInvoiceAmount - row.currentInvoiceAmount
+ ).toFixed(2);
};
onMounted(() => {
- getList();
+ getList();
});
</script>
<style scoped lang="scss">
.table_list {
- margin-top: unset;
+ margin-top: unset;
}
.flex {
- display: flex;
+ display: flex;
}
.justify-between {
- justify-content: space-between;
+ justify-content: space-between;
}
::v-deep(.el-checkbox__label) {
- font-weight: bold;
+ font-weight: bold;
}
</style>
+
+
+
+
+
diff --git a/src/views/salesManagement/orderManagement/index.vue b/src/views/salesManagement/orderManagement/index.vue
index aac840f..90bdd67 100644
--- a/src/views/salesManagement/orderManagement/index.vue
+++ b/src/views/salesManagement/orderManagement/index.vue
@@ -59,7 +59,6 @@
楼{{ scope.row.amount.toFixed(2) }}
</template>
</el-table-column>
- <el-table-column prop="paymentMethod" label="浠樻鏂瑰紡" width="120" />
<el-table-column prop="status" label="璁㈠崟鐘舵��" width="100">
<template #default="scope">
<el-tag :type="getStatusType(scope.row.status)">
@@ -131,15 +130,6 @@
</el-col>
</el-row>
<el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="浠樻鏂瑰紡" prop="paymentMethod">
- <el-select v-model="form.paymentMethod" placeholder="璇烽�夋嫨浠樻鏂瑰紡" style="width: 100%">
- <el-option label="鍏ㄦ鍒颁粯" value="鍏ㄦ鍒颁粯"></el-option>
- <el-option label="鍒嗘湡浠樻" value="鍒嗘湡浠樻"></el-option>
- <el-option label="鏈堢粨" value="鏈堢粨"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
<el-col :span="12">
<el-form-item label="璁㈠崟鐘舵��" prop="status">
<el-select v-model="form.status" placeholder="璇烽�夋嫨鐘舵��" style="width: 100%">
@@ -246,11 +236,10 @@
{
id: 1,
orderNo: 'ORD202312001',
- customer: '涓婃捣绉戞妧鏈夐檺鍏徃',
- salesperson: '闄堝織寮�',
+ customer: '骞垮窞绉戞妧鍏徃',
+ salesperson: '寮犱笁',
orderDate: '2023-12-01',
amount: 50000.00,
- paymentMethod: '鍏ㄦ鍒颁粯',
status: '寰呭鏍�',
remark: '閲嶈瀹㈡埛璁㈠崟'
},
@@ -261,7 +250,6 @@
salesperson: '鍒橀泤濠�',
orderDate: '2023-12-02',
amount: 35000.00,
- paymentMethod: '鍒嗘湡浠樻',
status: '宸插鏍�',
remark: '甯歌璁㈠崟'
},
@@ -272,7 +260,6 @@
salesperson: '鐜嬪缓鍥�',
orderDate: '2023-12-03',
amount: 28000.00,
- paymentMethod: '鏈堢粨',
status: '宸插彂璐�',
remark: '鏂板鎴疯鍗�'
}
@@ -291,7 +278,6 @@
salesperson: '',
orderDate: '',
amount: 0,
- paymentMethod: '',
status: '寰呭鏍�',
remark: ''
})
@@ -301,7 +287,6 @@
salesperson: [{ required: true, message: '璇烽�夋嫨涓氬姟鍛�', trigger: 'change' }],
orderDate: [{ required: true, message: '璇烽�夋嫨璁㈠崟鏃ユ湡', trigger: 'change' }],
amount: [{ required: true, message: '璇疯緭鍏ヨ鍗曢噾棰�', trigger: 'blur' }],
- paymentMethod: [{ required: true, message: '璇烽�夋嫨浠樻鏂瑰紡', trigger: 'change' }],
status: [{ required: true, message: '璇烽�夋嫨鐘舵��', trigger: 'change' }]
}
@@ -360,7 +345,6 @@
form.salesperson = ''
form.orderDate = ''
form.amount = 0
- form.paymentMethod = ''
form.status = '寰呭鏍�'
form.remark = ''
dialogVisible.value = true
diff --git a/src/views/salesManagement/paymentShipping/index.vue b/src/views/salesManagement/paymentShipping/index.vue
index 0bcfd87..31dcf55 100644
--- a/src/views/salesManagement/paymentShipping/index.vue
+++ b/src/views/salesManagement/paymentShipping/index.vue
@@ -60,7 +60,6 @@
楼{{ scope.row.paidAmount }}
</template>
</el-table-column>
- <el-table-column prop="paymentMethod" label="浠樻鏂瑰紡" width="120" />
<el-table-column prop="paymentStatus" label="浠樻鐘舵��" width="100">
<template #default="scope">
<el-tag :type="getPaymentStatusType(scope.row.paymentStatus)">
@@ -120,15 +119,6 @@
<el-col :span="12">
<el-form-item label="璁㈠崟閲戦" prop="orderAmount">
<el-input-number v-model="form.orderAmount" :precision="2" :min="0" style="width: 100%"></el-input-number>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="浠樻鏂瑰紡" prop="paymentMethod">
- <el-select v-model="form.paymentMethod" placeholder="璇烽�夋嫨浠樻鏂瑰紡" style="width: 100%">
- <el-option label="鍏ㄦ鍒颁粯" value="鍏ㄦ鍒颁粯"></el-option>
- <el-option label="鍒嗘湡浠樻" value="鍒嗘湡浠樻"></el-option>
- <el-option label="鏈堢粨" value="鏈堢粨"></el-option>
- </el-select>
</el-form-item>
</el-col>
</el-row>
@@ -201,14 +191,6 @@
</el-form-item>
<el-form-item label="浠樻閲戦" prop="paymentAmount">
<el-input-number v-model="paymentAmount" :precision="2" :min="0" :max="currentRecord.orderAmount" style="width: 100%"></el-input-number>
- </el-form-item>
- <el-form-item label="浠樻鏂瑰紡" prop="paymentMethod">
- <el-select v-model="paymentMethod" placeholder="璇烽�夋嫨浠樻鏂瑰紡" style="width: 100%">
- <el-option label="鐜伴噾" value="鐜伴噾"></el-option>
- <el-option label="閾惰杞处" value="閾惰杞处"></el-option>
- <el-option label="鏀粯瀹�" value="鏀粯瀹�"></el-option>
- <el-option label="寰俊鏀粯" value="寰俊鏀粯"></el-option>
- </el-select>
</el-form-item>
<el-form-item label="浠樻澶囨敞" prop="paymentRemark">
<el-input type="textarea" v-model="paymentRemark" rows="3" placeholder="璇疯緭鍏ヤ粯娆惧娉�"></el-input>
@@ -312,7 +294,6 @@
orderNo: '',
customer: '',
orderAmount: 0,
- paymentMethod: '',
paymentStatus: '鏈粯娆�',
shippingStatus: '寰呭彂璐�',
shippingDate: '',
@@ -324,7 +305,6 @@
// orderNo: [{ required: true, message: '璇疯緭鍏ヨ鍗曞彿', trigger: 'blur' }],
customer: [{ required: true, message: '璇烽�夋嫨瀹㈡埛', trigger: 'change' }],
orderAmount: [{ required: true, message: '璇疯緭鍏ヨ鍗曢噾棰�', trigger: 'blur' }],
- paymentMethod: [{ required: true, message: '璇烽�夋嫨浠樻鏂瑰紡', trigger: 'change' }],
paymentStatus: [{ required: true, message: '璇烽�夋嫨浠樻鐘舵��', trigger: 'change' }],
shippingStatus: [{ required: true, message: '璇烽�夋嫨鍙戣揣鐘舵��', trigger: 'change' }]
}
@@ -335,7 +315,6 @@
const shippingDialogVisible = ref(false)
const currentRecord = ref({})
const paymentAmount = ref(0)
-const paymentMethod = ref('')
const paymentRemark = ref('')
const shippingDate = ref('')
const logisticsCompany = ref('')
@@ -379,7 +358,6 @@
form.orderNo = ''
form.customer = ''
form.orderAmount = 0
- form.paymentMethod = ''
form.paymentStatus = '鏈粯娆�'
form.shippingStatus = '寰呭彂璐�'
form.shippingDate = ''
@@ -404,7 +382,6 @@
const handlePayment = (row) => {
currentRecord.value = row
paymentAmount.value = row.orderAmount - row.paidAmount
- paymentMethod.value = ''
paymentRemark.value = ''
paymentDialogVisible.value = true
}
@@ -435,10 +412,6 @@
}
const savePayment = () => {
- if (!paymentMethod.value) {
- ElMessage.warning('璇烽�夋嫨浠樻鏂瑰紡')
- return
- }
currentRecord.value.paidAmount = Number(currentRecord.value.paidAmount) + paymentAmount.value
if(currentRecord.value.paidAmount == currentRecord.value.orderAmount){
currentRecord.value.paymentStatus = '宸蹭粯娆�'
diff --git a/src/views/salesManagement/receiptPayment/index.vue b/src/views/salesManagement/receiptPayment/index.vue
index 995bd24..336f3fa 100644
--- a/src/views/salesManagement/receiptPayment/index.vue
+++ b/src/views/salesManagement/receiptPayment/index.vue
@@ -13,24 +13,6 @@
prefix-icon="Search"
/>
</el-form-item>
- <el-form-item label="瀹㈡埛鍚堝悓鍙�">
- <el-input
- v-model="searchForm.customerContractNo"
- placeholder="璇疯緭鍏�"
- @change="handleQuery"
- clearable
- prefix-icon="Search"
- />
- </el-form-item>
- <el-form-item label="椤圭洰鍚嶇О">
- <el-input
- v-model="searchForm.projectName"
- placeholder="璇疯緭鍏�"
- @change="handleQuery"
- clearable
- prefix-icon="Search"
- />
- </el-form-item>
<el-form-item>
<el-checkbox
v-model="searchForm.status"
@@ -122,7 +104,6 @@
size="small"
@click="changeEditType(scope.row)"
v-if="!scope.row.editType"
- :disabled="scope.row.registrant !== userStore.nickName"
>缂栬緫</el-button
>
<el-button
@@ -131,7 +112,6 @@
size="small"
@click="saveReceiptPayment(scope.row)"
v-if="scope.row.editType"
- :disabled="scope.row.registrant !== userStore.nickName"
>淇濆瓨</el-button
>
<el-button
@@ -139,7 +119,6 @@
type="primary"
size="small"
@click="delReceiptRecord(scope.row)"
- :disabled="scope.row.registrant !== userStore.nickName"
>鍒犻櫎</el-button
>
</template>
@@ -155,23 +134,10 @@
width="240"
/>
<el-table-column
- label="瀹㈡埛鍚堝悓鍙�"
- prop="customerContractNo"
- show-overflow-tooltip
- width="240"
-
- />
- <el-table-column
label="瀹㈡埛鍚嶇О"
prop="customerName"
show-overflow-tooltip
width="240"
- />
- <el-table-column
- label="椤圭洰鍚嶇О"
- prop="projectName"
- show-overflow-tooltip
- width="340"
/>
<el-table-column
label="鍥炴鐘舵��"
@@ -184,12 +150,12 @@
</el-tag>
</template>
</el-table-column>
- <el-table-column
- label="浜у搧澶х被"
- prop="productCategory"
- show-overflow-tooltip
- width="100"
- />
+<!-- <el-table-column-->
+<!-- label="浜у搧澶х被"-->
+<!-- prop="productCategory"-->
+<!-- show-overflow-tooltip-->
+<!-- width="100"-->
+<!-- />-->
<el-table-column
label="鍙戠エ鍙�"
prop="invoiceNo"
@@ -349,7 +315,6 @@
v-model="form.registrant"
placeholder="璇疯緭鍏�"
clearable
- disabled
/>
</el-form-item>
</el-col>
@@ -504,9 +469,7 @@
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
console.log("selection", selection);
- selectedRows.value = selection.filter(
- (item) => item.customerContractNo !== null
- );
+ selectedRows.value = selection
};
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
diff --git a/src/views/salesManagement/receiptPaymentHistory/index.vue b/src/views/salesManagement/receiptPaymentHistory/index.vue
index 589d567..e5db7c0 100644
--- a/src/views/salesManagement/receiptPaymentHistory/index.vue
+++ b/src/views/salesManagement/receiptPaymentHistory/index.vue
@@ -10,24 +10,6 @@
:prefix-icon="Search"
/>
</el-form-item>
- <el-form-item label="瀹㈡埛鍚堝悓鍙�">
- <el-input
- v-model="searchForm.customerContractNo"
- placeholder="杈撳叆瀹㈡埛鍚堝悓鍙�"
- @change="handleQuery"
- clearable
- :prefix-icon="Search"
- />
- </el-form-item>
- <el-form-item label="椤圭洰鍚嶇О">
- <el-input
- v-model="searchForm.projectName"
- placeholder="杈撳叆椤圭洰鍚嶇О"
- @change="handleQuery"
- clearable
- :prefix-icon="Search"
- />
- </el-form-item>
<el-form-item label="鍥炴鏃ユ湡">
<el-date-picker
v-model="searchForm.receiptPaymentDate"
@@ -80,11 +62,6 @@
width:240
},
{
- label: "瀹㈡埛鍚堝悓鍙�",
- prop: "customerContractNo",
- width:240
- },
- {
label: "鍥炴鏃ユ湡",
prop: "receiptPaymentDate",
width:100
@@ -93,11 +70,6 @@
label: "瀹㈡埛鍚嶇О",
prop: "customerName",
width:240
- },
- {
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width:200
},
{
label: "鍥炴閲戦锛堝厓锛�",
@@ -149,8 +121,6 @@
receiptPaymentDate: [],
receiptPaymentDateStart: undefined,
receiptPaymentDateEnd: undefined,
- customerContractNo: undefined,
- projectName: undefined,
});
const { receipt_payment_type } = proxy.useDict("receipt_payment_type");
const isShowSummarySon = ref(true);
@@ -168,7 +138,11 @@
const getList = () => {
tableLoading.value = true;
const { receiptPaymentDate, ...rest } = searchForm;
- receiptPaymentHistoryListPage({ ...rest, ...page }).then((res) => {
+ // 灏嗚寖鍥存棩鏈熷瓧娈典紶閫掔粰鍚庣
+ const params = { ...rest, ...page };
+ // 绉婚櫎鍥炴鏃ユ湡鐨勯粯璁ゅ�艰缃紝鍙繚鐣欒寖鍥存棩鏈熷瓧娈�
+ delete params.receiptPaymentDate;
+ receiptPaymentHistoryListPage(params).then((res) => {
tableLoading.value = false;
tableData.value = res.records;
page.total = res.total;
@@ -212,6 +186,12 @@
};
onMounted(() => {
+ // 璁剧疆鍥炴鏃ユ湡鑼冨洿榛樿鍊间负褰撳ぉ
+ const today = dayjs().format('YYYY-MM-DD');
+ searchForm.receiptPaymentDate = [today, today];
+ // 璁剧疆鑼冨洿鏃ユ湡瀛楁鐨勮捣濮嬪拰缁撴潫鏃堕棿
+ searchForm.receiptPaymentDateStart = dayjs(today).format('YYYY-MM-DD 00:00:00');
+ searchForm.receiptPaymentDateEnd = dayjs(today).format('YYYY-MM-DD 23:59:59');
getList();
});
</script>
diff --git a/src/views/salesManagement/salesLedger/fileList.vue b/src/views/salesManagement/salesLedger/fileList.vue
index da37db2..fb392c5 100644
--- a/src/views/salesManagement/salesLedger/fileList.vue
+++ b/src/views/salesManagement/salesLedger/fileList.vue
@@ -2,10 +2,11 @@
<el-dialog v-model="dialogVisible" title="闄勪欢" width="40%" :before-close="handleClose">
<el-table :data="tableData" border height="40vh">
<el-table-column label="闄勪欢鍚嶇О" prop="name" min-width="400" show-overflow-tooltip />
- <el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
+ <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
<template #default="scope">
<el-button link type="primary" size="small" @click="downLoadFile(scope.row)">涓嬭浇</el-button>
<el-button link type="primary" size="small" @click="lookFile(scope.row)">棰勮</el-button>
+ <el-button link type="danger" size="small" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -15,7 +16,9 @@
<script setup>
import { ref } from 'vue'
+import { ElMessageBox, ElMessage } from 'element-plus'
import filePreview from '@/components/filePreview/index.vue'
+import { delCommonFile } from '@/api/publicApi/commonFile.js'
const dialogVisible = ref(false)
const tableData = ref([])
@@ -35,6 +38,27 @@
const lookFile = (row) => {
filePreviewRef.value.open(row.url)
}
+// 鍒犻櫎闄勪欢
+const handleDelete = (row) => {
+ ElMessageBox.confirm(`纭鍒犻櫎闄勪欢"${row.name}"鍚楋紵`, '鍒犻櫎纭', {
+ confirmButtonText: '纭',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ delCommonFile([row.id]).then(() => {
+ ElMessage.success('鍒犻櫎鎴愬姛')
+ // 浠庡垪琛ㄤ腑绉婚櫎宸插垹闄ょ殑闄勪欢
+ const index = tableData.value.findIndex(item => item.id === row.id)
+ if (index !== -1) {
+ tableData.value.splice(index, 1)
+ }
+ }).catch(() => {
+ ElMessage.error('鍒犻櫎澶辫触')
+ })
+ }).catch(() => {
+ proxy.$modal.msg('宸插彇娑堝垹闄�')
+ })
+}
defineExpose({
open
})
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index cfdf052..d599868 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -6,16 +6,8 @@
<el-input v-model="searchForm.customerName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
@change="handleQuery" />
</el-form-item>
- <el-form-item label="瀹㈡埛鍚堝悓鍙凤細">
- <el-input v-model="searchForm.customerContractNo" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
- @change="handleQuery" />
- </el-form-item>
<el-form-item label="閿�鍞悎鍚屽彿锛�">
<el-input v-model="searchForm.salesContractNo" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
- @change="handleQuery" />
- </el-form-item>
- <el-form-item label="椤圭洰鍚嶇О锛�">
- <el-input v-model="searchForm.projectName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
@change="handleQuery" />
</el-form-item>
<el-form-item label="褰曞叆鏃ユ湡锛�">
@@ -41,45 +33,47 @@
</div>
<el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
:expand-row-keys="expandedRowKeys" :row-key="(row) => row.id" show-summary style="width: 100%"
- :summary-method="summarizeMainTable" @expand-change="expandChange" height="calc(100vh - 18.5em)">
+ :summary-method="summarizeMainTable" @expand-change="expandChange" height="calc(100vh - 21em)">
<el-table-column align="center" type="selection" width="55" />
<el-table-column type="expand">
<template #default="props">
<el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable">
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory"/>
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="100">
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <el-table-column label="鏁伴噺" prop="quantity"/>
- <el-table-column label="鍗曚环(缇庡厓)/浠�" prop="taxInclusiveUnitPrice" :formatter="formattedNumber"></el-table-column>
-
+ <el-table-column label="浜у搧澶х被" prop="productCategory" />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
+ <el-table-column label="鍗曚綅" prop="unit" />
+ <el-table-column label="鏁伴噺" prop="quantity" />
<el-table-column label="绋庣巼(%)" prop="taxRate" />
- <el-table-column label="鍚◣鎬讳环(缇庡厓)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column label="涓嶅惈绋庢�讳环(缇庡厓)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
+ <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
+ <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
+ <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
</el-table>
</template>
</el-table-column>
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" width="180" show-overflow-tooltip />
- <el-table-column label="瀹㈡埛鍚堝悓鍙�" prop="customerContractNo" width="180" show-overflow-tooltip />
<el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" width="300" show-overflow-tooltip />
<el-table-column label="涓氬姟鍛�" prop="salesman" width="100" show-overflow-tooltip />
- <el-table-column label="椤圭洰鍚嶇О" prop="projectName" width="180" show-overflow-tooltip />
- <el-table-column label="浠樻鏂瑰紡" prop="paymentMethod" show-overflow-tooltip />
<el-table-column label="鍚堝悓閲戦(鍏�)" prop="contractAmount" width="220" show-overflow-tooltip
:formatter="formattedNumber" />
<el-table-column label="褰曞叆浜�" prop="entryPersonName" width="100" show-overflow-tooltip />
+ <el-table-column label="鍙戣揣杞︾墝" prop="shippingCarNumber" width="120" show-overflow-tooltip>
+ <template #default="scope">
+ <div>
+ <div v-if="scope.row.shippingCarNumber">{{ scope.row.shippingCarNumber }}</div>
+ <el-tag v-else type="warning">鏈彂璐�</el-tag>
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍙戣揣鏃ユ湡" prop="shippingDate" width="120" show-overflow-tooltip />
<el-table-column label="褰曞叆鏃ユ湡" prop="entryDate" width="120" show-overflow-tooltip />
<el-table-column label="绛捐鏃ユ湡" prop="executionDate" width="120" show-overflow-tooltip />
<el-table-column fixed="right" label="鎿嶄綔" min-width="200" align="center">
<template #default="scope">
- <el-button link type="primary" size="small" :disabled="scope.row.invoiceTotal>0 || scope.row.entryPersonName !== userStore.nickName" @click="openForm('edit', scope.row)">缂栬緫</el-button>
+ <el-button link type="primary" size="small" @click="openForm('edit', scope.row)">缂栬緫</el-button>
<!-- <el-button link type="primary" size="small" @click="openForm('view', scope.row)">璇︽儏</el-button>-->
<el-button link type="primary" size="small" @click="downLoadFile(scope.row)">闄勪欢</el-button>
- <el-button link type="primary" size="small" @click="openDeliveryForm(scope.row)">鍙戣揣</el-button>
+ <el-button v-if="!scope.row.shippingCarNumber" link type="primary" size="small" @click="openDeliveryForm(scope.row)">鍙戣揣</el-button>
</template>
</el-table-column>
</el-table>
@@ -97,7 +91,9 @@
</el-col>
<el-col :span="12">
<el-form-item label="涓氬姟鍛橈細" prop="salesman">
- <el-select v-model="form.salesman" placeholder="璇烽�夋嫨" clearable :disabled="operationType === 'view'">
+ <el-select v-model="form.salesman" filterable
+ default-first-option
+ :reserve-keyword="false" placeholder="璇烽�夋嫨" clearable :disabled="operationType === 'view'">
<el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
:value="item.nickName" />
</el-select>
@@ -106,26 +102,14 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍚堝悓鍙凤細" prop="customerContractNo">
- <el-input v-model="form.customerContractNo" placeholder="璇疯緭鍏�" clearable :disabled="operationType === 'view'"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
<el-form-item label="瀹㈡埛鍚嶇О锛�" prop="customerId">
- <el-select v-model="form.customerId" placeholder="璇烽�夋嫨" clearable :disabled="operationType === 'view'">
+ <el-select v-model="form.customerId" placeholder="璇烽�夋嫨" clearable :disabled="operationType === 'view'" filterable>
<el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id">
{{
item.customerName + "鈥斺��" + item.taxpayerIdentificationNumber
}}
</el-option>
</el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
- <el-input v-model="form.projectName" placeholder="璇疯緭鍏�" clearable :disabled="operationType === 'view'" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -138,7 +122,9 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="褰曞叆浜猴細" prop="entryPerson">
- <el-select v-model="form.entryPerson" placeholder="璇烽�夋嫨" clearable @change="changs" disabled>
+ <el-select v-model="form.entryPerson" filterable
+ default-first-option
+ :reserve-keyword="false" placeholder="璇烽�夋嫨" clearable @change="changs">
<el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
</el-select>
</el-form-item>
@@ -150,13 +136,7 @@
</el-form-item>
</el-col>
</el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="浠樻鏂瑰紡">
- <el-input v-model="form.paymentMethod" placeholder="璇疯緭鍏�" clearable :disabled="operationType === 'view'" />
- </el-form-item>
- </el-col>
- </el-row>
+
<el-row>
<el-form-item label="浜у搧淇℃伅锛�" prop="entryDate">
<el-button v-if="operationType !== 'view'" type="primary" @click="openProductForm('add')">娣诲姞</el-button>
@@ -167,18 +147,15 @@
:summary-method="summarizeMainTable">
<el-table-column align="center" type="selection" width="55" v-if="operationType !== 'view'" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" />
- <el-table-column label="浜у搧楂樺害" prop="specificationModel">
- <template #default="scope">
- <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
- </template>
- </el-table-column>
- <!-- <el-table-column label="鍗曚綅" prop="unit" /> -->
+ <el-table-column label="浜у搧澶х被" prop="productCategory" />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
+ <el-table-column label="缁戝畾鏈哄櫒" prop="speculativeTradingName" />
+ <el-table-column label="鍗曚綅" prop="unit" />
<el-table-column label="鏁伴噺" prop="quantity" />
- <!-- <el-table-column label="绋庣巼(%)" prop="taxRate" /> -->
- <el-table-column label="鍗曚环(缇庡厓)/浠�" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
- <!-- <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" /> -->
+ <el-table-column label="绋庣巼(%)" prop="taxRate" />
+ <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
+ <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
+ <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
<el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center" v-if="operationType !== 'view'">
<template #default="scope">
<el-button link type="primary" size="small" @click="openProductForm('edit', scope.row,scope.$index)">缂栬緫</el-button>
@@ -222,7 +199,7 @@
<el-form :model="productForm" label-width="140px" label-position="top" :rules="productRules" ref="productFormRef">
<el-row :gutter="30">
<el-col :span="24">
- <el-form-item label="浜у搧鍚嶇О锛�" prop="productCategory">
+ <el-form-item label="浜у搧澶х被锛�" prop="productCategory">
<!-- <el-select v-model="productForm.productCategory" placeholder="璇烽�夋嫨" clearable>
<el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/>
</el-select> -->
@@ -233,7 +210,7 @@
</el-row>
<el-row :gutter="30">
<el-col :span="24">
- <el-form-item label="浜у搧楂樺害锛�" prop="productModelId">
+ <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="productModelId">
<el-select v-model="productForm.productModelId" placeholder="璇烽�夋嫨" clearable @change="getProductModel">
<el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" />
</el-select>
@@ -241,8 +218,15 @@
</el-col>
</el-row>
<el-row :gutter="30">
+ <el-col :span="24">
+ <el-form-item label="缁戝畾鏈哄櫒锛�">
+ <el-input v-model="productForm.speculativeTradingName" placeholder="璇峰厛閫夋嫨瑙勬牸鍨嬪彿" clearable disabled />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="楂樺害鍗曚綅锛�" prop="unit">
+ <el-form-item label="鍗曚綅锛�" prop="unit">
<el-input v-model="productForm.unit" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
</el-col>
@@ -258,7 +242,7 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="鍗曚环(缇庡厓)/浠讹細" prop="taxInclusiveUnitPrice">
+ <el-form-item label="鍚◣鍗曚环(鍏�)锛�" prop="taxInclusiveUnitPrice">
<el-input-number :step="0.01" :min="0" v-model="productForm.taxInclusiveUnitPrice" style="width: 100%"
:precision="2"
placeholder="璇疯緭鍏�" clearable @change="calculateFromUnitPrice" />
@@ -266,19 +250,20 @@
</el-col>
<el-col :span="12">
<el-form-item label="鏁伴噺锛�" prop="quantity">
- <el-input-number :min="0" v-model="productForm.quantity" placeholder="璇疯緭鍏�" clearable
+ <el-input-number :step="0.1" :min="0" v-model="productForm.quantity" placeholder="璇疯緭鍏�" clearable
+ :precision="2"
@change="calculateFromQuantity" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="鍚◣鎬讳环(缇庡厓)锛�" prop="taxInclusiveTotalPrice">
+ <el-form-item label="鍚◣鎬讳环(鍏�)锛�" prop="taxInclusiveTotalPrice">
<el-input v-model="productForm.taxInclusiveTotalPrice" placeholder="璇疯緭鍏�" clearable @change="calculateFromTotalPrice" />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="涓嶅惈绋庢�讳环(缇庡厓)锛�" prop="taxExclusiveTotalPrice">
+ <el-form-item label="涓嶅惈绋庢�讳环(鍏�)锛�" prop="taxExclusiveTotalPrice">
<el-input v-model="productForm.taxExclusiveTotalPrice" placeholder="璇疯緭鍏�" clearable @change="calculateFromExclusiveTotalPrice" />
</el-form-item>
</el-col>
@@ -324,7 +309,7 @@
<div v-for="(item, index) in printData" :key="index" class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">鍙屽鐐规湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">娴峰窛寮�蹇冮鍝佹湁闄愬叕鍙�</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
@@ -335,12 +320,15 @@
<span class="value">{{ formatDate(item.createTime) }}</span>
</div>
<div>
-
- <span class="label">瀹㈡埛鍚嶇О锛�</span>
- <span class="value">{{ item.customerName || '寮犵埍鏈�' }}</span>
+ <span class="label">鍙戣揣杞︾墝鍙凤細</span>
+ <span class="value">{{ item.shippingCarNumber }}</span>
</div>
</div>
<div class="info-row">
+ <div>
+ <span class="label">瀹㈡埛鍚嶇О锛�</span>
+ <span class="value">{{ item.customerName || '寮犵埍鏈�' }}</span>
+ </div>
<span class="label">鍗曞彿锛�</span>
<span class="value">{{ item.salesContractNo }}</span>
</div>
@@ -441,11 +429,19 @@
<el-row :gutter="30">
<el-col :span="24">
<el-form-item label="鍙戣揣杞︾墝鍙凤細" prop="shippingCarNumber">
- <el-input
+ <el-select v-model="deliveryForm.shippingCarNumber" filterable allow-create placeholder="璇烽�夋嫨鍙戣揣杞︾墝鍙�">
+ <el-option key="1" label="鏂癆 H5153" value="鏂癆 H5153"/>
+ <el-option key="2" label="鏂癆 H4232" value="鏂癆 H4232"/>
+ <el-option key="3" label="鏂癆 H4001" value="鏂癆 H4001"/>
+ <el-option key="4" label="鏂癆 H6409" value="鏂癆 H6409"/>
+ <el-option key="5" label="鏂癆 G7446" value="鏂癆 G7446"/>
+ <el-option key="6" label="鏂癏 80369" value="鏂癏 80369"/>
+ </el-select>
+ <!-- <el-input
v-model="deliveryForm.shippingCarNumber"
placeholder="璇疯緭鍏ュ彂璐ц溅鐗屽彿"
clearable
- />
+ /> -->
</el-form-item>
</el-col>
</el-row>
@@ -509,9 +505,7 @@
const data = reactive({
searchForm: {
customerName: "", // 瀹㈡埛鍚嶇О
- customerContractNo: "", // 瀹㈡埛鍚堝悓缂栧彿
salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
- projectName: "", // 椤圭洰鍚嶇О
entryDate: null, // 褰曞叆鏃ユ湡
entryDateStart: undefined,
entryDateEnd: undefined,
@@ -519,23 +513,16 @@
form: {
salesContractNo: "",
salesman: "",
- customerContractNo: "",
customerId: "",
- projectName: "",
entryPerson: "",
entryDate: "",
maintenanceTime: "",
productData: [],
executionDate: "",
- paymentMethod: "",
},
rules: {
salesman: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- customerContractNo: [
- { required: true, message: "璇疯緭鍏�", trigger: "blur" },
- ],
customerId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- projectName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
entryPerson: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
entryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
executionDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -558,7 +545,7 @@
taxInclusiveTotalPrice: "",
taxExclusiveTotalPrice: "",
invoiceType: "",
- cartonSpecifications:'',
+ speculativeTradingName: "",
},
productRules: {
productCategory: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -571,7 +558,6 @@
taxInclusiveUnitPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
- cartonSpecifications: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
taxInclusiveTotalPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
@@ -628,7 +614,11 @@
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
- page.current = 1;
+ // 鍙湁鍦ㄧ偣鍑绘悳绱㈡寜閽椂鎵嶉噸缃〉鐮佸埌绗竴椤�
+ // 閬垮厤琛ㄥ崟瀛楁change浜嬩欢骞叉壈鍒嗛〉
+ if (arguments.length === 0) {
+ page.current = 1;
+ }
expandedRowKeys.value = [];
getList();
};
@@ -640,7 +630,11 @@
const getList = () => {
tableLoading.value = true;
const { entryDate, ...rest } = searchForm;
- ledgerListPage({ ...rest, ...page })
+ // 灏嗚寖鍥存棩鏈熷瓧娈典紶閫掔粰鍚庣
+ const params = { ...rest, ...page };
+ // 绉婚櫎褰曞叆鏃ユ湡鐨勯粯璁ゅ�艰缃紝鍙繚鐣欒寖鍥存棩鏈熷瓧娈�
+ delete params.entryDate;
+ ledgerListPage(params)
.then((res) => {
tableLoading.value = false;
tableData.value = res.records;
@@ -653,7 +647,7 @@
tableLoading.value = false;
});
};
-// 鑾峰彇浜у搧鍚嶇Оtree鏁版嵁
+// 鑾峰彇浜у搧澶х被tree鏁版嵁
const getProductOptions = () => {
productTreeList().then((res) => {
productOptions.value = convertIdToValue(res);
@@ -665,7 +659,6 @@
// 鑾峰彇tree瀛愭暟鎹�
const getModels = (value) => {
productForm.value.productCategory = findNodeById(productOptions.value, value);
- productForm.value.productId = value;
modelList({ id: value }).then((res) => {
modelOptions.value = res;
});
@@ -676,9 +669,11 @@
if (index !== -1) {
productForm.value.specificationModel = modelOptions.value[index].model;
productForm.value.unit = modelOptions.value[index].unit;
+ productForm.value.speculativeTradingName = modelOptions.value[index].speculativeTradingName || "";
} else {
productForm.value.specificationModel = null;
productForm.value.unit = null;
+ productForm.value.speculativeTradingName = "";
}
};
const findNodeById = (nodes, productId) => {
@@ -780,7 +775,7 @@
// form.value.entryPerson = userAll.user.userId // 璁剧疆榛樿涓氬姟鍛樹负褰撳墠鐢ㄦ埛
// }
// });
- form.value.entryDate = getCurrentDate(); // 璁剧疆榛樿褰曞叆鏃ユ湡涓哄綋鍓嶆棩鏈�
+ // 绉婚櫎褰曞叆鏃ユ湡榛樿鍊艰缃紝鍙鐞嗚寖鍥存棩鏈熷瓧娈�
dialogFormVisible.value = true;
};
function changs(val) {
@@ -878,7 +873,6 @@
}else{
productData.value[productIndex.value] = { ...productForm.value }
}
- console.log('productData',productData)
closeProductDia();
}
}
@@ -1177,7 +1171,7 @@
<div class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">鍙屽鐐规湁闄愯矗浠诲叕鍙�</div>
+ <div class="company-name">娴峰窛寮�蹇冮鍝佹湁闄愬叕鍙�</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
@@ -1404,10 +1398,10 @@
// 鏍规嵁涓嶅惈绋庢�讳环璁$畻鍚◣鍗曚环鍜屾暟閲�
const calculateFromExclusiveTotalPrice = () => {
- // if (!productForm.value.taxRate) {
- // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- // return;
- // }
+ if (!productForm.value.taxRate) {
+ proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ return;
+ }
if (isCalculating.value) return;
const exclusiveTotalPrice = parseFloat(productForm.value.taxExclusiveTotalPrice);
@@ -1433,10 +1427,10 @@
// 鏍规嵁鏁伴噺鍙樺寲璁$畻鎬讳环
const calculateFromQuantity = () => {
- // if (!productForm.value.taxRate) {
- // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- // return;
- // }
+ if (!productForm.value.taxRate) {
+ proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ return;
+ }
if (isCalculating.value) return;
const quantity = parseFloat(productForm.value.quantity);
@@ -1465,10 +1459,10 @@
// 鏍规嵁鍚◣鍗曚环鍙樺寲璁$畻鎬讳环
const calculateFromUnitPrice = () => {
- // if (!productForm.value.taxRate) {
- // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- // return;
- // }
+ if (!productForm.value.taxRate) {
+ proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ return;
+ }
if (isCalculating.value) return;
const quantity = parseFloat(productForm.value.quantity);
@@ -1497,10 +1491,10 @@
// 鏍规嵁绋庣巼鍙樺寲璁$畻涓嶅惈绋庢�讳环
const calculateFromTaxRate = () => {
- // if (!productForm.value.taxRate) {
- // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- // return;
- // }
+ if (!productForm.value.taxRate) {
+ proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ return;
+ }
if (isCalculating.value) return;
const inclusiveTotalPrice = parseFloat(productForm.value.taxInclusiveTotalPrice);
@@ -1537,7 +1531,7 @@
const openDeliveryForm = (row) => {
currentDeliveryRow.value = row;
deliveryForm.value = {
- shippingDate: getCurrentDate(),
+ shippingDate: "", // 绉婚櫎榛樿鍊艰缃�
shippingCarNumber: "",
};
deliveryFormVisible.value = true;
@@ -1572,7 +1566,13 @@
};
onMounted(() => {
- getList();
+ // 璁剧疆褰曞叆鏃ユ湡鑼冨洿榛樿鍊间负褰撳ぉ
+ const today = dayjs().format('YYYY-MM-DD');
+ searchForm.entryDate = [today, today];
+ // 璁剧疆鑼冨洿鏃ユ湡瀛楁鐨勮捣濮嬪拰缁撴潫鏃堕棿
+ searchForm.entryDateStart = today;
+ searchForm.entryDateEnd = today;
+ getList();
});
</script>
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index cefc769..fac1afe 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -144,15 +144,6 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="浠樻鏂瑰紡" prop="paymentMethod">
- <el-select v-model="form.paymentMethod" placeholder="璇烽�夋嫨浠樻鏂瑰紡" style="width: 100%">
- <el-option label="鍏ㄦ鍒颁粯" value="鍏ㄦ鍒颁粯"></el-option>
- <el-option label="鍒嗘湡浠樻" value="鍒嗘湡浠樻"></el-option>
- <el-option label="鏈堢粨" value="鏈堢粨"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
<el-form-item label="浜よ揣鏈�" prop="deliveryPeriod">
<el-date-picker
v-model="form.deliveryPeriod"
@@ -302,7 +293,6 @@
<el-descriptions-item label="涓氬姟鍛�">{{ currentQuotation.salesperson }}</el-descriptions-item>
<el-descriptions-item label="鎶ヤ环鏃ユ湡">{{ currentQuotation.quotationDate }}</el-descriptions-item>
<el-descriptions-item label="鏈夋晥鏈熻嚦">{{ currentQuotation.validDate }}</el-descriptions-item>
- <el-descriptions-item label="浠樻鏂瑰紡">{{ currentQuotation.paymentMethod }}</el-descriptions-item>
<el-descriptions-item label="浜よ揣鏈�">{{ currentQuotation.deliveryPeriod }}</el-descriptions-item>
<!-- <el-descriptions-item label="鎶ヤ环鐘舵��">-->
<!-- <el-tag :type="getStatusType(currentQuotation.status)">{{ currentQuotation.status }}</el-tag>-->
@@ -394,7 +384,6 @@
salesperson: [{ required: true, message: '璇烽�夋嫨涓氬姟鍛�', trigger: 'change' }],
quotationDate: [{ required: true, message: '璇烽�夋嫨鎶ヤ环鏃ユ湡', trigger: 'change' }],
validDate: [{ required: true, message: '璇烽�夋嫨鏈夋晥鏈�', trigger: 'change' }],
- paymentMethod: [{ required: true, message: '璇烽�夋嫨浠樻鏂瑰紡', trigger: 'change' }],
deliveryPeriod: [{ required: true, message: '璇烽�夋嫨浜よ揣鏈�', trigger: 'change' }]
}
const userList = ref([]);
diff --git a/vite.config.js b/vite.config.js
index 540ff94..fbf59c8 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -6,17 +6,11 @@
export default defineConfig(({ mode, command }) => {
const env = loadEnv(mode, process.cwd());
const { VITE_APP_ENV } = env;
- const baseUrl =
- env.VITE_APP_ENV === "development"
- ? "http://114.132.189.42:9036"
- : env.VITE_BASE_API;
- const javaUrl =
- env.VITE_APP_ENV === "development"
- ? "http://114.132.189.42:9037"
- : env.VITE_JAVA_API;
+ const baseUrl = env.VITE_APP_ENV === "development" ? "http://192.168.1.35:7003" : env.VITE_BASE_API;
+ const javaUrl = env.VITE_APP_ENV === "development" ? "http://114.132.189.42:9037" : env.VITE_JAVA_API;
return {
- define:{
- __BASE_API__: JSON.stringify(javaUrl)
+ define: {
+ __BASE_API__: JSON.stringify(javaUrl),
},
// 閮ㄧ讲鐢熶骇鐜鍜屽紑鍙戠幆澧冧笅鐨刄RL銆�
// 榛樿鎯呭喌涓嬶紝vite 浼氬亣璁句綘鐨勫簲鐢ㄦ槸琚儴缃插湪涓�涓煙鍚嶇殑鏍硅矾寰勪笂
@@ -59,7 +53,7 @@
"/dev-api": {
target: baseUrl,
changeOrigin: true,
- rewrite: (p) => p.replace(/^\/dev-api/, ""),
+ rewrite: p => p.replace(/^\/dev-api/, ""),
},
// springdoc proxy
"^/v3/api-docs/(.*)": {
@@ -74,7 +68,7 @@
{
postcssPlugin: "internal:charset-removal",
AtRule: {
- charset: (atRule) => {
+ charset: atRule => {
if (atRule.name === "charset") {
atRule.remove();
}
--
Gitblit v1.9.3