From fab6326bf9df3c6db59718bad8f42b0212c73a9e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 06 一月 2026 15:59:45 +0800
Subject: [PATCH] 双奇点迁移仓库
---
src/views/index.vue | 30
src/views/procurementManagement/procurementInvoiceLedger/index.vue | 2
src/views/basicData/supplierManage/index.vue | 3
multiple/config.json | 418 ----
src/views/basicData/product/index.vue | 18
src/views/inventoryManagement/stockManagement/components/FormDiaPurchase.vue | 147 +
src/api/inventoryManagement/stockIn.js | 95 +
src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue | 303 +++
src/views/procurementManagement/paymentEntry/index.vue | 3
src/views/salesManagement/salesLedger/index.vue | 115
multiple/assets/logo/SQDLogo.png | 0
src/api/inventoryManagement/stockManage.js | 20
src/views/salesManagement/invoiceLedger/index.vue | 10
src/views/basicData/customerFile/index.vue | 3
src/views/inventoryManagement/receiptManagement/index.vue | 1013 ++++++-----
src/components/Upload/FileUpload.vue | 6
src/views/inventoryManagement/stockManagement/index.vue | 591 ++++--
src/views/equipmentManagement/calibration/index.vue | 3
src/views/basicData/product/ImportExcel/index.vue | 14
src/views/inventoryManagement/dispatchLog/index.vue | 503 +++--
src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue | 230 +
src/views/salesManagement/receiptPayment/index.vue | 3
src/views/productionManagement/productionCosting/index.vue | 2
src/views/inventoryManagement/issueManagement/index.vue | 305 ++
multiple/assets/favicon/SQDico.ico | 0
src/components/PIMTable/PIMTable.vue | 5
src/views/procurementManagement/paymentLedger/index.vue | 21
src/views/procurementManagement/procurementLedger/index.vue | 22
src/api/salesManagement/salesLedger.js | 8
src/views/productionManagement/productionReporting/index.vue | 1
src/views/collaborativeApproval/notificationManagement/index.vue | 2
src/views/customerService/feedbackRegistration/index.vue | 2
src/views/productionManagement/productionOrder/index.vue | 2
package.json | 1
src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue | 401 ++++
src/views/personnelManagement/contractManagement/filesDia.vue | 1
multiple/assets/screen/SQDView.png | 0
src/views/inventoryManagement/receiptManagement/components/formDia.vue | 398 ++++
src/views/collaborativeApproval/noticeManagement/index.vue | 10
src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue | 156 +
src/views/inventoryManagement/stockManagement/components/FormDiaProduction.vue | 147 +
src/views/productionManagement/productionReporting/components/formDia.vue | 18
42 files changed, 3,492 insertions(+), 1,540 deletions(-)
diff --git a/multiple/assets/favicon/SQDico.ico b/multiple/assets/favicon/SQDico.ico
new file mode 100644
index 0000000..cd34955
--- /dev/null
+++ b/multiple/assets/favicon/SQDico.ico
Binary files differ
diff --git a/multiple/assets/logo/SQDLogo.png b/multiple/assets/logo/SQDLogo.png
new file mode 100644
index 0000000..271f835
--- /dev/null
+++ b/multiple/assets/logo/SQDLogo.png
Binary files differ
diff --git a/multiple/assets/screen/SQDView.png b/multiple/assets/screen/SQDView.png
new file mode 100644
index 0000000..f53a22f
--- /dev/null
+++ b/multiple/assets/screen/SQDView.png
Binary files differ
diff --git a/multiple/config.json b/multiple/config.json
index 9fb34b8..a760667 100644
--- a/multiple/config.json
+++ b/multiple/config.json
@@ -3,419 +3,19 @@
"env": {
"VITE_APP_TITLE": "鑺浜戯紙绠$悊淇℃伅绯荤粺锛�"
},
- "screen": "screen/JZYJView.png",
- "logo": "logo/HYSNLogo.png",
- "favicon": "favicon/HYSNico.ico"
+ "screen": "screen/SQDView.png",
+ "logo": "logo/SQDLogo.png",
+ "favicon": "favicon/SQDico.ico"
},
- "TEST": {
+ "SQD": {
"env": {
- "VITE_APP_TITLE": "涓皬浼佷笟鏁板瓧鍖栬浆鍨嬩簩绾у椁愬寘",
- "VITE_BASE_API": "http://114.132.189.42:9036",
- "VITE_JAVA_API": "http://114.132.189.42:9037"
- },
- "screen": "screen/HYSNView.png",
- "logo": "logo/ZGLTLogo.png",
- "favicon": "favicon/favicon.ico"
- },
- "LC": {
- "env": {
- "VITE_APP_TITLE": "涓皬浼佷笟鏁板瓧鍖栬浆鍨嬩簩绾у椁愬寘",
- "VITE_BASE_API": "http://114.132.189.42:9036",
- "VITE_JAVA_API": "http://114.132.189.42:9037"
- },
- "screen": "screen/HYSNView.png",
- "logo": "logo/LCLogo.png",
- "favicon": "favicon/favicon.ico"
- },
- "WDSY": {
- "env": {
- "VITE_APP_TITLE": "浼熷痉瀹炰笟淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:8068",
- "VITE_JAVA_API": "http://114.132.189.42:8085"
- },
- "screen": "screen/WDSYView.png",
- "logo": "logo/WDSYLogo.png",
- "favicon": "favicon/WDSYico.ico"
- },
- "JZYJ": {
- "env": {
- "VITE_APP_TITLE": "鍩烘櫤娌逛簳淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:8078",
- "VITE_JAVA_API": "http://114.132.189.42:8086"
- },
- "screen": "screen/JZYJView.png",
- "logo": "logo/JZYJLogo.png",
- "favicon": "favicon/JZYJico.ico"
- },
- "ZQHX": {
- "env": {
- "VITE_APP_TITLE": "涓己鎭掑叴淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:1234",
- "VITE_JAVA_API": "http://114.132.189.42:8080"
- },
- "screen": "screen/ZQHXView.png",
- "logo": "logo/ZQHXLogo.png",
- "favicon": "favicon/ZQHXico.ico"
- },
- "XYHB": {
- "env": {
- "VITE_APP_TITLE": "瀹e惫鐜繚淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9052",
- "VITE_JAVA_API": "http://114.132.189.42:9051"
- },
- "screen": "screen/XYHBView.png",
- "logo": "logo/XYHBLogo.png",
- "favicon": "favicon/XYHBico.ico"
- },
- "BHMY": {
- "env": {
- "VITE_APP_TITLE": "鍗氬畯鐓や笟淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9070",
- "VITE_JAVA_API": "http://114.132.189.42:9069"
- },
- "screen": "screen/ZQHXView.png",
- "logo": "logo/BHMYLogo.png",
- "favicon": "favicon/BHMY.ico"
- },
- "HHKJ": {
- "env": {
- "VITE_APP_TITLE": "鎭掓櫀绉戞妧淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9046",
- "VITE_JAVA_API": "http://114.132.189.42:9047"
- },
- "screen": "screen/HHKJView.png",
- "logo": "logo/HHKJLogo.png",
- "favicon": "favicon/HHKJIco.ico"
- },
- "RZNY": {
- "env": {
- "VITE_APP_TITLE": "閿愭嫨鑳芥簮淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9058",
- "VITE_JAVA_API": "http://114.132.189.42:9057"
- },
- "screen": "screen/RZNYView.png",
- "logo": "logo/RZNYLogo.png",
- "favicon": "favicon/RZNY.ico"
- },
- "TJXM": {
- "env": {
- "VITE_APP_TITLE": "娉版睙娲楃叅淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9064",
- "VITE_JAVA_API": "http://114.132.189.42:9063"
- },
- "screen": "screen/TJXMView.png",
- "logo": "logo/TJXMLogo.png",
- "favicon": "favicon/TJXM.ico"
- },
- "HYSN": {
- "env": {
- "VITE_APP_TITLE": "寮樹篃姘存偿淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9034",
- "VITE_JAVA_API": "http://114.132.189.42:9035"
- },
- "screen": "screen/HYSNView.png",
- "logo": "logo/HYSNLogo.png",
- "favicon": "favicon/HYSNico.ico"
- },
- "JYHJ": {
- "env": {
- "VITE_APP_TITLE": "閲戦拱榛勯噾淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9030",
- "VITE_JAVA_API": "http://114.132.189.42:9031"
- },
- "screen": "screen/HYSNView.png",
- "logo": "logo/JYHJLogo.png",
- "favicon": "favicon/JYHJico.ico"
- },
- "DHDC": {
- "env": {
- "VITE_APP_TITLE": "鏁︾厡榧庤瘹淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9032",
- "VITE_JAVA_API": "http://114.132.189.42:9033"
- },
- "screen": "screen/DHDCView.png",
- "logo": "logo/DHDCLogo.png",
- "favicon": "favicon/DHDCico.ico"
- },
- "MXSC": {
- "env": {
- "VITE_APP_TITLE": "闂藉叴鐭虫潗淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9048",
- "VITE_JAVA_API": "http://114.132.189.42:9049"
- },
- "screen": "screen/MXSCBack.png",
- "logo": "logo/MXSCLogo.png",
- "favicon": "favicon/MXSCIco.ico"
- },
- "CJNY": {
- "env": {
- "VITE_APP_TITLE": "鍒涘法鑳芥簮淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9038",
- "VITE_JAVA_API": "http://114.132.189.42:9039"
- },
- "screen": "screen/MXSCBack.png",
- "logo": "logo/CJNYLogo.png",
- "favicon": "favicon/CJNYico.ico"
- },
- "JSMY": {
- "env": {
- "VITE_APP_TITLE": "閲戠煶鐓や笟淇℃伅绠$悊绯荤粺",
+ "VITE_APP_TITLE": "澶╂触鍙屽鐐圭鐞嗙郴缁�",
"VITE_BASE_API": "http://114.132.189.42:9042",
- "VITE_JAVA_API": "http://114.132.189.42:9043"
+ "VITE_JAVA_API": "http://114.132.189.42:9044"
},
- "screen": "screen/MXSCBack.png",
- "logo": "logo/JSMYLogo.png",
- "favicon": "favicon/JSMYico.ico"
- },
- "JSYNY": {
- "env": {
- "VITE_APP_TITLE": "閿︾洓婧愯兘婧愪俊鎭鐞嗙郴缁�",
- "VITE_BASE_API": "http://114.132.189.42:9074",
- "VITE_JAVA_API": "http://114.132.189.42:9073"
- },
- "screen": "screen/HYSNView.png",
- "logo": "logo/JSYNYLogo.png",
- "favicon": "favicon/JSYNYico.ico"
- },
- "CMNY": {
- "env": {
- "VITE_APP_TITLE": "鍒涢摥鑳芥簮淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9088",
- "VITE_JAVA_API": "http://114.132.189.42:9087"
- },
- "screen": "screen/DHDCView.png",
- "logo": "logo/CMNYLogo.png",
- "favicon": "favicon/CMNYico.ico"
- },
- "HCKX": {
- "env": {
- "VITE_APP_TITLE": "娴峰窛寮�蹇冮鍝佷俊鎭鐞嗙郴缁�",
- "VITE_BASE_API": "http://114.132.189.42:9090",
- "VITE_JAVA_API": "http://114.132.189.42:9089"
- },
- "screen": "screen/HCKXView.png",
- "logo": "logo/HCKXLogo.png",
- "favicon": "favicon/HCKXico.ico"
- },
- "JLSN": {
- "env": {
- "VITE_APP_TITLE": "閿﹂緳姘存偿淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9094",
- "VITE_JAVA_API": "http://114.132.189.42:9093"
- },
- "screen": "screen/JLSNView.png",
- "logo": "logo/JLSNLogo.png",
- "favicon": "favicon/JLSNico.ico"
- },
- "BDSM": {
- "env": {
- "VITE_APP_TITLE": "鍗氳揪鍟嗚锤淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9096",
- "VITE_JAVA_API": "http://114.132.189.42:9095"
- },
- "screen": "screen/BDSMView.png",
- "logo": "logo/BDSMLogo.png",
- "favicon": "favicon/BDSMico.ico"
- },
- "HXGY": {
- "env": {
- "VITE_APP_TITLE": "姹囨槦閽欎笟淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9098",
- "VITE_JAVA_API": "http://114.132.189.42:9097"
- },
- "screen": "screen/HXGYView.png",
- "logo": "logo/HXGYLogo.png",
- "favicon": "favicon/HXGYico.ico"
- },
- "ZDXM": {
- "env": {
- "VITE_APP_TITLE": "鏄痉鍨嬬叅淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9100",
- "VITE_JAVA_API": "http://114.132.189.42:9096"
- },
- "screen": "screen/ZDXMView.png",
- "logo": "logo/ZDXMLogo.png",
- "favicon": "favicon/ZDXMico.ico"
- },
- "HSX": {
- "env": {
- "VITE_APP_TITLE": "婀熸按宄″啘涓氬彂灞曚俊鎭鐞嗙郴缁�",
- "VITE_BASE_API": "http://114.132.189.42:9101",
- "VITE_JAVA_API": "http://114.132.189.42:9098"
- },
- "screen": "screen/HSXView.png",
- "logo": "logo/HSXLogo.png",
- "favicon": "favicon/HSXico.ico"
- },
- "NYDL": {
- "env": {
- "VITE_APP_TITLE": "鍗楁磱鐢电紗浜ч摼閫氫俊鎭鐞嗙郴缁�",
- "VITE_BASE_API": "http://114.132.189.42:9036",
- "VITE_JAVA_API": "http://114.132.189.42:9037"
- },
- "screen": "screen/NYDLView.png",
- "logo": "logo/NYDLLogo.png",
- "favicon": "favicon/NYDLico.ico"
- },
- "HCMY": {
- "env": {
- "VITE_APP_TITLE": "娴╂垚鐓や笟淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9103",
- "VITE_JAVA_API": "http://114.132.189.42:9094"
- },
- "screen": "screen/HCMYView.png",
- "logo": "logo/HCMYLogo.png",
- "favicon": "favicon/HCMYico.ico"
- },
- "HGJJ": {
- "env": {
- "VITE_APP_TITLE": "姹囧浗娲佸噣鍨嬬叅淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9107",
- "VITE_JAVA_API": "http://114.132.189.42:9090"
- },
- "screen": "screen/HGJJView.png",
- "logo": "logo/HGJJLogo.png",
- "favicon": "favicon/HGJJico.ico"
- },
- "MKZS": {
- "env": {
- "VITE_APP_TITLE": "妯″嚡鍐嶇敓淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9111",
- "VITE_JAVA_API": "http://114.132.189.42:9086"
- },
- "screen": "screen/MKZSView.png",
- "logo": "logo/MKZSLogo.png",
- "favicon": "favicon/MKZSico.ico"
- },
- "HSMY": {
- "env": {
- "VITE_APP_TITLE": "鍗庨『闀佷笟淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9115",
- "VITE_JAVA_API": "http://114.132.189.42:9082"
- },
- "screen": "screen/HSMYView.png",
- "logo": "logo/HSMYLogo.png",
- "favicon": "favicon/HSMYico.ico"
- },
- "DHHB": {
- "env": {
- "VITE_APP_TITLE": "涓规捣鐜繚淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9117",
- "VITE_JAVA_API": "http://114.132.189.42:9080"
- },
- "screen": "screen/DHHBView.png",
- "logo": "logo/DHHBLogo.png",
- "favicon": "favicon/DHHBico.ico"
- },
- "PHMK": {
- "env": {
- "VITE_APP_TITLE": "鏅鐓ょ熆淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9119",
- "VITE_JAVA_API": "http://114.132.189.42:9078"
- },
- "screen": "screen/PHMKView.png",
- "logo": "logo/PHMKLogo.png",
- "favicon": "favicon/PHMKico.ico"
- },
- "TYMK": {
- "env": {
- "VITE_APP_TITLE": "閫氭簮鐓ょ熆淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9121",
- "VITE_JAVA_API": "http://114.132.189.42:9076"
- },
- "screen": "screen/TYMKView.png",
- "logo": "logo/TYMKLogo.png",
- "favicon": "favicon/TYMKico.ico"
- },
- "LQM": {
- "env": {
- "VITE_APP_TITLE": "鑰佺惇楹﹂鍝佷俊鎭鐞嗙郴缁�",
- "VITE_BASE_API": "http://114.132.189.42:9123",
- "VITE_JAVA_API": "http://114.132.189.42:9074"
- },
- "screen": "screen/LQMView.png",
- "logo": "logo/LQMLogo.png",
- "favicon": "favicon/LQMico.ico"
- },
- "ZYRQ": {
- "env": {
- "VITE_APP_TITLE": "浼楁簮鐕冩皵淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9123",
- "VITE_JAVA_API": "http://114.132.189.42:9031"
- },
- "screen": "screen/ZYRQView.png",
- "logo": "logo/ZYRQLogo.png",
- "favicon": "favicon/ZYRQico.ico"
- },
- "RTSW": {
- "env": {
- "VITE_APP_TITLE": "娑︽嘲鐢熺墿淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9066",
- "VITE_JAVA_API": "http://114.132.189.42:9064"
- },
- "screen": "screen/RTSWView.png",
- "logo": "logo/RTSWLogo.png",
- "favicon": "favicon/RTSWico.ico"
- },
- "HXSJ": {
- "env": {
- "VITE_APP_TITLE": "鍗庣幒鐮傛祮淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9066",
- "VITE_JAVA_API": "http://114.132.189.42:9062"
- },
- "screen": "screen/HXSJView.png",
- "logo": "logo/HXSJLogo.png",
- "favicon": "favicon/HXSJico.ico"
- },
- "QLMC": {
- "env": {
- "VITE_APP_TITLE": "绁佽繛鐗у満淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9066",
- "VITE_JAVA_API": "http://114.132.189.42:9060"
- },
- "screen": "screen/QLMCView.png",
- "logo": "logo/QLMCLogo.png",
- "favicon": "favicon/QLMCico.ico"
- },
- "AYNM": {
- "env": {
- "VITE_APP_TITLE": "瀹変綉鍐滅墽淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9066",
- "VITE_JAVA_API": "http://114.132.189.42:9058"
- },
- "screen": "screen/AYNMView.png",
- "logo": "logo/AYNMLogo.png",
- "favicon": "favicon/AYNMico.ico"
- },
- "JMSL": {
- "env": {
- "VITE_APP_TITLE": "閲戣寕濉戞枡鍖呰淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9066",
- "VITE_JAVA_API": "http://114.132.189.42:9058"
- },
- "screen": "screen/JMSLView.png",
- "logo": "logo/JMSLLogo.png",
- "favicon": "favicon/JMSLico.ico"
- },
- "TJKH": {
- "env": {
- "VITE_APP_TITLE": "澶╂触鍑崕淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9066",
- "VITE_JAVA_API": "http://114.132.189.42:9058"
- },
- "screen": "screen/TJKHView.png",
- "logo": "logo/TJKHLogo.png",
- "favicon": "favicon/TJKHico.ico"
- },
- "DZYS": {
- "env": {
- "VITE_APP_TITLE": "涓滄辰鍗板埛淇℃伅绠$悊绯荤粺",
- "VITE_BASE_API": "http://114.132.189.42:9066",
- "VITE_JAVA_API": "http://114.132.189.42:9046"
- },
- "screen": "screen/DZYSView.png",
- "logo": "logo/DZYSLogo.png",
- "favicon": "favicon/DZYSico.ico"
+ "screen": "screen/SQDView.png",
+ "logo": "logo/SQDLogo.png",
+ "favicon": "favicon/SQDico.ico"
},
"screen": "/src/assets/images/login-background.png",
"logo": "/src/assets/logo/logo.png",
diff --git a/package.json b/package.json
index e80e1e7..fcfbd99 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
"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/inventoryManagement/stockIn.js b/src/api/inventoryManagement/stockIn.js
index 5e104f7..5ce4570 100644
--- a/src/api/inventoryManagement/stockIn.js
+++ b/src/api/inventoryManagement/stockIn.js
@@ -9,6 +9,41 @@
});
};
+// 鏌ヨ鐢熶骇鍏ュ簱淇℃伅鍒楄〃
+export const getStockInPageByProduction = (params) => {
+ return request({
+ url: "/stockin/listPageByProduction",
+ method: "get",
+ params,
+ });
+};
+
+// 鍑哄簱鍙拌处-鏌ヨ鑷畾涔夊叆搴撲俊鎭垪琛�
+export const getStockInPageByCustom = (params) => {
+ return request({
+ url: "/stockmanagement/listPageByCustom",
+ method: "get",
+ params,
+ });
+};
+// 鍏ュ簱绠$悊-鏌ヨ鑷畾涔夊叆搴撲俊鎭垪琛�
+export const getInPageByCustom = (params) => {
+ return request({
+ url: "/stockin/listPageByCustom",
+ method: "get",
+ params,
+ });
+};
+
+// 鍑哄簱鍙拌处-鏌ヨ鐢熶骇鍑哄簱淇℃伅鍒楄〃
+export const getStockInPageByProduct = (params) => {
+ return request({
+ url: "/stockmanagement/listPageByProduct",
+ method: "get",
+ params,
+ });
+};
+
// 淇敼鍏ュ簱瀛樹俊鎭�
export const updateStockIn = (data) => {
return request({
@@ -26,6 +61,14 @@
data,
});
};
+// 淇敼鏉愭枡搴撳瓨淇℃伅
+export const updateManagementByCustom = (data) => {
+ return request({
+ url: "/stockin/updateManagementByCustom ",
+ method: "post",
+ data,
+ });
+};
// 鏂板鍟嗗搧鍏ュ簱淇℃伅
export function addSutockIn(data) {
@@ -36,11 +79,46 @@
})
}
+// 鏂板鑷畾涔夊叆搴撲俊鎭�
+export function addStockInCustom(data) {
+ return request({
+ url: '/stockin/addCustom',
+ method: 'post',
+ data: data
+ })
+}
+
+// 缂栬緫鑷畾涔夊叆搴撲俊鎭�
+export function updateStockInCustom(data) {
+ return request({
+ url: '/stockin/updateCustom',
+ method: 'post',
+ data: data
+ })
+}
+// 缂栬緫鎴愬搧鍏ュ簱淇℃伅
+export function updateProduct(data) {
+ return request({
+ url: '/stockin/update',
+ method: 'post',
+ data: data
+ })
+}
+
// 鍒犻櫎鍏ュ簱淇℃伅
export function delStockIn(ids) {
return request({
url: '/stockin/del',
method: 'post',
+ data: ids
+ })
+}
+
+// 鍒犻櫎鑷畾涔夊叆搴撲俊鎭�
+export function delStockInCustom(ids) {
+ return request({
+ url: '/stockin/deleteCustom',
+ method: 'delete',
data: ids
})
}
@@ -63,6 +141,23 @@
})
}
+// 鑷畾涔夊叆搴�-璇︽儏
+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/stockManage.js b/src/api/inventoryManagement/stockManage.js
index bb2081b..4f5d957 100644
--- a/src/api/inventoryManagement/stockManage.js
+++ b/src/api/inventoryManagement/stockManage.js
@@ -9,6 +9,24 @@
});
};
+// 鏌ヨ鐢熶骇鍏ュ簱搴撳瓨淇℃伅鍒楄〃
+export const getStockManagePageByProduction = (params) => {
+ return request({
+ url: "/stockin/listPageCopyByProduction",
+ method: "get",
+ params,
+ });
+};
+
+// 鏌ヨ鑷畾涔夊叆搴撳簱瀛樹俊鎭垪琛�
+export const getStockManagePageByCustom = (params) => {
+ return request({
+ url: "/stockin/listPageCopyByCustom",
+ method: "get",
+ params,
+ });
+};
+
// 淇敼搴撳瓨淇℃伅
export const updateStockManage = (data) => {
@@ -38,7 +56,7 @@
})
}
-//鍑哄簱鎺ュ彛
+// 鍑哄簱绠$悊-棰嗙敤鎺ュ彛
export const stockOut = (data) => {
return request({
url: '/stockmanagement/stockout',
diff --git a/src/api/salesManagement/salesLedger.js b/src/api/salesManagement/salesLedger.js
index 6548927..3a2fa22 100644
--- a/src/api/salesManagement/salesLedger.js
+++ b/src/api/salesManagement/salesLedger.js
@@ -109,11 +109,3 @@
params: query,
});
}
-// 閿�鍞彴璐﹂〉闈㈠彂璐э紝鏌ヨ搴撳瓨鏄惁鍏呰冻
-export function getProductInventory(query) {
- return request({
- url: "/sales/ledger/getProductInventory",
- method: "get",
- params: query,
- });
-}
\ No newline at end of file
diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index 1fa1695..12d73ad 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -204,6 +204,7 @@
</el-table-column>
</el-table>
<pagination
+ v-if="isShowPage"
:total="page.total"
:layout="page.layout"
:page="page.current"
@@ -267,6 +268,10 @@
type: Boolean,
default: false,
},
+ isShowPage: {
+ type: Boolean,
+ default: true,
+ },
isShowSummary: {
type: Boolean,
default: false,
diff --git a/src/components/Upload/FileUpload.vue b/src/components/Upload/FileUpload.vue
index 1ac0344..65c6374 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"]);
+const emits = defineEmits(["success", "remove", "downloadTemplate"]);
const uploadRef = ref();
const fileList = ref([]);
@@ -85,7 +85,7 @@
type="primary"
link
class="reset-margin"
- @click="props.downloadTemplate()"
+ @click="emits('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 2d53a72..94168c4 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -306,6 +306,9 @@
clickFun: (row) => {
openForm("edit", row);
},
+ disabled: (row) => {
+ return row.maintainer !== userStore.nickName
+ }
},
],
},
diff --git a/src/views/basicData/product/ImportExcel/index.vue b/src/views/basicData/product/ImportExcel/index.vue
index c25d254..fe77420 100644
--- a/src/views/basicData/product/ImportExcel/index.vue
+++ b/src/views/basicData/product/ImportExcel/index.vue
@@ -5,12 +5,13 @@
<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="false"
+ :showTip="true"
@success="handleFileSuccess"
+ @downloadTemplate="downloadTemplate"
/>
<template #footer>
<div class="dialog-footer">
@@ -22,11 +23,12 @@
</template>
<script setup>
-import { reactive } from "vue";
+import { reactive, ref, getCurrentInstance } from "vue";
import { getToken } from "@/utils/auth.js";
import { FileUpload } from "@/components/Upload";
import { ElMessage } from "element-plus";
+const { proxy } = getCurrentInstance();
defineOptions({
name: "浜у搧缁存姢瀵煎叆",
});
@@ -44,6 +46,7 @@
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/system/supplier/import",
+ updateSupport: true,
});
// 鐐瑰嚮瀵煎叆
const handleImport = () => {
@@ -51,6 +54,11 @@
upload.title = "浜у搧瀵煎叆";
};
+// 涓嬭浇妯℃澘
+const downloadTemplate = () =>{
+ proxy.download("/basic/product/downloadTemplate", {}, "浜у搧瀵煎叆妯℃澘.xlsx");
+}
+
const submitFileForm = () => {
fileUploadRef.value.uploadApi();
};
diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index b88d678..68e8221 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="璇疯緭鍏ヤ骇鍝侀珮搴�"
clearable
@keydown.enter.prevent
/>
@@ -155,10 +155,10 @@
</el-row>
<el-row>
<el-col :span="24">
- <el-form-item label="鍗曚綅锛�" prop="unit">
+ <el-form-item label="楂樺害鍗曚綅锛�" prop="unit">
<el-input
v-model="modelForm.unit"
- placeholder="璇疯緭鍏ュ崟浣�"
+ placeholder="璇疯緭鍏ラ珮搴﹀崟浣�"
clearable
@keydown.enter.prevent
/>
@@ -205,11 +205,11 @@
const expandedKeys = ref([]);
const tableColumn = ref([
{
- label: "瑙勬牸鍨嬪彿",
+ label: "浜у搧楂樺害",
prop: "model",
},
{
- label: "鍗曚綅",
+ label: "楂樺害鍗曚綅",
prop: "unit",
},
{
@@ -281,7 +281,7 @@
form.value.productName = data.productName;
}
};
-// 鎵撳紑瑙勬牸鍨嬪彿寮规
+// 鎵撳紑浜у搧楂樺害寮规
const openModelDia = (type, data) => {
modelOperationType.value = type;
modelDia.value = true;
diff --git a/src/views/basicData/supplierManage/index.vue b/src/views/basicData/supplierManage/index.vue
index 5d55907..82a1d57 100644
--- a/src/views/basicData/supplierManage/index.vue
+++ b/src/views/basicData/supplierManage/index.vue
@@ -299,6 +299,9 @@
clickFun: (row) => {
openForm("edit", row);
},
+ disabled: (row) => {
+ return row.maintainUserName !== userStore.nickName
+ }
},
],
},
diff --git a/src/views/collaborativeApproval/noticeManagement/index.vue b/src/views/collaborativeApproval/noticeManagement/index.vue
index 77bc697..5fbc927 100644
--- a/src/views/collaborativeApproval/noticeManagement/index.vue
+++ b/src/views/collaborativeApproval/noticeManagement/index.vue
@@ -624,6 +624,7 @@
color: #606266;
line-height: 1.6;
font-size: 14px;
+ word-wrap: break-word;
}
.card-footer {
@@ -704,6 +705,15 @@
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 {
text-align: center;
padding: 60px 20px;
diff --git a/src/views/collaborativeApproval/notificationManagement/index.vue b/src/views/collaborativeApproval/notificationManagement/index.vue
index 37c13cf..8e1b792 100644
--- a/src/views/collaborativeApproval/notificationManagement/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/index.vue
@@ -549,6 +549,7 @@
clickFun: (row) => {
publishNotification(row);
},
+ // disabled: (row) => row.status === "published"
},
{
name: "鎾ゅ洖",
@@ -556,6 +557,7 @@
clickFun: (row) => {
revokeNotification(row);
},
+ // disabled: (row) => row.status !== "published"
}
]
}
diff --git a/src/views/customerService/feedbackRegistration/index.vue b/src/views/customerService/feedbackRegistration/index.vue
index 3d97ef8..0825aac 100644
--- a/src/views/customerService/feedbackRegistration/index.vue
+++ b/src/views/customerService/feedbackRegistration/index.vue
@@ -121,7 +121,7 @@
openForm("edit", row);
},
disabled: (row) => {
- return row.status !== 1
+ return row.checkUserId !== userStore.id || row.status !== 1
}
},
],
diff --git a/src/views/equipmentManagement/calibration/index.vue b/src/views/equipmentManagement/calibration/index.vue
index affce9d..7dfd405 100644
--- a/src/views/equipmentManagement/calibration/index.vue
+++ b/src/views/equipmentManagement/calibration/index.vue
@@ -142,6 +142,9 @@
type: "text",
clickFun: (row) => {
openCalibrationDia("edit", row);
+ },
+ disabled: (row) => {
+ return row.userId !== userStore.id
}
},
],
diff --git a/src/views/index.vue b/src/views/index.vue
index 2888b16..8292b85 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -24,11 +24,11 @@
<div class="data-num">
<div>
<div class="data-desc">鏈湀閿�鍞/鍏�</div>
- <div class="data-value">{{businessInfo.monthSaleMoney}}</div>
+ <div class="data-value" :title="businessInfo.monthSaleMoney">{{businessInfo.monthSaleMoney}}</div>
</div>
<div>
<div class="data-desc">鏈紑绁ㄩ噾棰�/鍏�</div>
- <div class="data-value">{{businessInfo.monthSaleHaveMoney}}</div>
+ <div class="data-value" :title="businessInfo.monthSaleHaveMoney">{{businessInfo.monthSaleHaveMoney}}</div>
</div>
</div>
@@ -38,24 +38,24 @@
<div class="data-num">
<div>
<div class="data-desc">鏈湀閲囪喘棰�/鍏�</div>
- <div class="data-value">{{businessInfo.monthPurchaseMoney}}</div>
+ <div class="data-value" :title="businessInfo.monthPurchaseMoney">{{businessInfo.monthPurchaseMoney}}</div>
</div>
<div>
<div class="data-desc">寰呬粯娆鹃噾棰�/鍏�</div>
- <div class="data-value">{{businessInfo.monthPurchaseHaveMoney}}</div>
+ <div class="data-value" :title="businessInfo.monthPurchaseHaveMoney">{{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">{{businessInfo.inventoryNum}}</div>
+ <div class="data-value" :title="businessInfo.inventoryNum">{{businessInfo.inventoryNum}}</div>
</div>
<div>
<div class="data-desc">浠婃棩鍏ュ簱/浠�</div>
- <div class="data-value">{{businessInfo.todayInventoryNum}}</div>
+ <div class="data-value" :title="businessInfo.todayInventoryNum">{{businessInfo.todayInventoryNum}}</div>
</div>
</div>
</div>
@@ -287,7 +287,7 @@
formatter: function (params) {
// 鍔ㄦ�佺敓鎴愭彁绀轰俊鎭紝鍩轰簬鏁版嵁椤圭殑 name 灞炴��
const description = params.name === '鏈湀鍥炴閲戦' ? '鏈湀鍥炴閲戦' : '搴旀敹娆鹃噾棰�';
- return `${description} ${formatNumber(params.value)}鍏� ${params.percent}%`;
+ return `${description} ${formattedNumber(params.value)}鍏� ${params.percent}%`;
},
position: 'right'
})
@@ -365,6 +365,13 @@
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) => {
@@ -425,7 +432,7 @@
xAxis2.value[0].data = monthName.map(item => item.replace(/~/g, '\n~'));
lineSeries.value = [
{
- name: '寮�绁�',
+ name: '鍥炴',
type: 'line',
data: receiptAmount,
stack: 'Total',
@@ -454,7 +461,7 @@
showSymbol: true,
},
{
- name: '鍥炴',
+ name: '寮�绁�',
type: 'line',
data: invoiceAmount,
stack: 'Total',
@@ -602,6 +609,9 @@
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 3eb5758..a58c62e 100644
--- a/src/views/inventoryManagement/dispatchLog/index.vue
+++ b/src/views/inventoryManagement/dispatchLog/index.vue
@@ -1,144 +1,208 @@
<template>
<div class="app-container">
- <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"
- />
- <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>
- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
- <el-button type="primary" plain @click="handlePrint">鎵撳嵃</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"
- min-width="250"
- show-overflow-tooltip
- />
- <el-table-column
- label="渚涘簲鍟嗗悕绉�"
- prop="supplierName"
- width="250"
- show-overflow-tooltip
- />
- <el-table-column
- label="浜у搧澶х被"
- prop="productCategory"
- width="100"
- show-overflow-tooltip
- />
- <el-table-column
- label="瑙勬牸鍨嬪彿"
- prop="specificationModel"
- width="100"
- 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="100"
- show-overflow-tooltip
- />
- <el-table-column
- label="鍚◣鎬讳环(鍏�)"
- prop="taxInclusiveTotalPrice"
- width="100"
- show-overflow-tooltip
- />
- <el-table-column
- label="绋庣巼(%)"
- prop="taxRate"
- width="100"
- show-overflow-tooltip
- />
- <el-table-column
- label="涓嶅惈绋庢�讳环(鍏�)"
- prop="taxExclusiveTotalPrice"
- width="180"
- show-overflow-tooltip
- />
- <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)"
- >缂栬緫</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-tabs v-model="activeTab" @tab-change="handleTabChange">
+ <!-- <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>
+ <el-button type="primary" plain @click="handlePrint">鎵撳嵃</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" min-width="120" 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="unitPrice" width="150"></el-table-column>
+ <el-table-column label="鎬讳环(鍏�)" prop="totalPrice" width="150"></el-table-column>
+ <el-table-column label="鍑哄簱浜�" prop="createBy" width="80" show-overflow-tooltip />
+ </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-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="primary" plain @click="handlePrint">鎵撳嵃</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="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>
+ <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 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="primary" plain @click="handlePrint">鎵撳嵃</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="浜у搧鍥剧墖" 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>
+ <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>
<!-- 鎵撳嵃棰勮寮圭獥 -->
<el-dialog
@@ -163,7 +227,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>
@@ -176,7 +240,7 @@
<div>
<span class="label">瀹㈡埛鍚嶇О锛�</span>
- <span class="value">{{ item.supplierName || '寮犵埍鏈�' }}</span>
+ <span class="value">{{ item.supplierName }}</span>
</div>
</div>
<div class="info-row">
@@ -190,32 +254,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 || '鏍囧噯' }}</td>
- <td>{{ item.unit || '鍧�' }}</td>
+ <td>{{ item.productCategory || '' }}</td>
+ <td>{{ item.specificationModel || '' }}{{ item.unit || '' }}</td>
<td>{{ item.taxInclusiveUnitPrice || '0' }}</td>
- <td>{{ item.inboundNum || '2000' }}</td>
- <td>{{ item.taxInclusiveTotalPrice || '0' }}</td>
+ <td>{{ item.inboundNum || '0' }}</td>
+ <td>{{ item.boxNum || '0' }}</td>
+ <td>{{ item.cartonSpecifications || '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>
@@ -258,17 +322,23 @@
<script setup>
import pagination from "@/components/PIMTable/Pagination.vue";
-import { ref } from "vue";
+import { ref, reactive, toRefs, onMounted, getCurrentInstance } from "vue";
import { ElMessageBox } from "element-plus";
import useUserStore from "@/store/modules/user";
import {
getStockOutPage,
delStockOut,
} from "@/api/inventoryManagement/stockOut.js";
+import {
+ 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 selectedRows = ref([]);
const tableLoading = ref(false);
const page = reactive({
@@ -285,7 +355,9 @@
const data = reactive({
searchForm: {
supplierName: "",
- timeStr: "",
+ customerName: "",
+ productCategory:'',
+ timeStr: getCurrentDate(),
},
form: {
supplierId: null,
@@ -322,18 +394,56 @@
};
const getList = () => {
tableLoading.value = true;
- getStockOutPage({ ...searchForm.value, ...page })
+ const params = { ...page }
+ if (activeTab.value === 'production') {
+ params.customerName = searchForm.value.customerName
+ params.timeStr = searchForm.value.timeStr
+ } else {
+ params.supplierName = searchForm.value.supplierName
+ params.timeStr = searchForm.value.timeStr
+ }
+ params.productCategory = searchForm.value.productCategory
+
+ // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勬帴鍙�
+ const apiCall = activeTab.value === 'production'
+ ? getStockInPageByProduct(params)
+ : activeTab.value === 'manual'
+ ? getStockInPageByCustom(params)
+ : getStockOutPage(params)
+
+ apiCall
.then((res) => {
tableLoading.value = false;
tableData.value = res.data.records;
tableData.value.map((item) => {
item.children = [];
+ // 鍓嶇璁$畻鎬讳环
+ const inboundNum = Number(item.inboundNum) || 0;
+ if (activeTab.value === 'production') {
+ // 鎴愬搧鍑哄簱锛氭�讳环 = unitPrice 脳 inboundNum
+ const unitPrice = Number(item.unitPrice) || 0;
+ item.totalPrice = (unitPrice * inboundNum).toFixed(2);
+ } else {
+ // 鍘熸枡鍜屾潗鏂欏嚭搴擄細鎬讳环 = taxInclusiveUnitPrice 脳 inboundNum
+ const taxInclusiveUnitPrice = Number(item.taxInclusiveUnitPrice) || 0;
+ item.taxInclusiveTotalPrice = (taxInclusiveUnitPrice * inboundNum).toFixed(2);
+ }
});
total.value = res.data.total;
})
.catch(() => {
tableLoading.value = false;
});
+};
+
+const handleTabChange = () => {
+ page.current = 1
+ searchForm.value.supplierName = ''
+ searchForm.value.customerName = ''
+ searchForm.value.timeStr = getCurrentDate() // 閲嶇疆涓哄綋鍓嶆棩鏈�
+ selectedRows.value = []
+ searchForm.value.productCategory = ''
+ getList()
};
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -361,7 +471,14 @@
type: "warning",
})
.then(() => {
- proxy.download("/stockmanagement/export", {}, "鍑哄簱鍙拌处.xlsx");
+ // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+ let exportUrl = "/stockmanagement/export"
+ if (activeTab.value === 'production') {
+ exportUrl = "/stockmanagement/exportone"
+ } else if (activeTab.value === 'manual') {
+ exportUrl = "/stockmanagement/exportTwo"
+ }
+ proxy.download(exportUrl, {}, "鍑哄簱鍙拌处.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
@@ -554,7 +671,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>
@@ -566,49 +683,41 @@
</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 || '鏍囧噯'}</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>
+ <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>
<div class="footer-section">
<div class="footer-row">
@@ -862,4 +971,12 @@
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 d8ce8f8..d283332 100644
--- a/src/views/inventoryManagement/issueManagement/index.vue
+++ b/src/views/inventoryManagement/issueManagement/index.vue
@@ -1,67 +1,188 @@
<template>
<div class="app-container">
- <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"
- />
- <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>
- <!-- <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" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鎵规" prop="inboundBatches" width="160" show-overflow-tooltip />
- <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="240" show-overflow-tooltip />
- <el-table-column label="浜у搧澶х被" prop="productCategory" width="100" show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200" 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 label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
- <el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" show-overflow-tooltip />
- <el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
- <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(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-tabs v-model="activeTab" @tab-change="handleTabChange">
+ <!-- <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>
+ </div>
+ </div>
+ <div class="table_list">
+ <el-table :data="tableData" border v-loading="tableLoading"
+ :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="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>
+ </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-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>
+ </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" 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 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>
+ </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="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"
+ 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%"
+ :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="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 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>
+ </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-tabs>
<el-dialog v-model="dialogFormVisible" :title="'鏂板鍑哄簱'" 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="0.01" :min="0" style="width: 100%" v-model="form.inboundQuantity" placeholder="璇疯緭鍏�" clearable />
+ <el-input-number :step="1" :min="0" :max="currentRowNum" style="width: 100%" v-model="form.inboundQuantity" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
<el-form-item label="鍑哄簱鏃ユ湡锛�" 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-select v-model="form.nickName" placeholder="璇烽�夋嫨" clearable>
+ <el-select v-model="form.nickName" filterable
+ default-first-option
+ :reserve-keyword="false" placeholder="璇烽�夋嫨" clearable>
<el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
</el-select>
</el-form-item>
@@ -78,18 +199,21 @@
<script setup>
import pagination from '@/components/PIMTable/Pagination.vue'
-import { ref } from 'vue'
+import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
import { userListNoPageByTenantId } from "@/api/system/user.js";
import {
- getStockInPage
+ getStockInPage,
+ getStockInPageByProduction,
+ getStockInPageByCustom, getInPageByCustom
} from "@/api/inventoryManagement/stockIn.js";
import {
getStockManagePage,
delStockManage,
stockOut,
} from "@/api/inventoryManagement/stockManage.js";
+const javaApiUrl = __BASE_API__;
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
@@ -106,14 +230,17 @@
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const dialogFormVisible = ref(false)
+const activeTab = ref('purchase')
const data = reactive({
searchForm: {
supplierName: '',
- inboundQuantity:'',
+ customerName: '',
+ inboundQuantity:0,
inboundTime:'',
nickName: '',
userId: '',
- timeStr: '',
+ productCategory:'',
+ timeStr: getCurrentDate(),
},
form: {
productrecordId: '',
@@ -139,14 +266,40 @@
}
const getList = () => {
tableLoading.value = true
- getStockInPage({ ...searchForm.value, ...page }).then(res => {
+ const params = { ...page }
+ if (activeTab.value === 'production') {
+ params.customerName = searchForm.value.customerName
+ params.timeStr = searchForm.value.timeStr
+ } else {
+ params.supplierName = searchForm.value.supplierName
+ params.timeStr = searchForm.value.timeStr
+ }
+ params.productCategory = searchForm.value.productCategory
+ let apiCall
+ if (activeTab.value === 'production') {
+ apiCall = getStockInPageByProduction(params)
+ } else if (activeTab.value === 'manual') {
+ apiCall = getInPageByCustom(params)
+ } else {
+ apiCall = getStockInPage(params)
+ }
+ apiCall.then(res => {
tableLoading.value = false
tableData.value = res.data.records
total.value = res.data.total
- console.log('res', res.data.records)
}).catch(() => {
tableLoading.value = false
})
+}
+
+const handleTabChange = () => {
+ page.current = 1
+ searchForm.value.supplierName = ''
+ searchForm.value.customerName = ''
+ searchForm.value.timeStr = getCurrentDate() // 閲嶇疆涓哄綋鍓嶆棩鏈�
+ selectedRows.value = []
+ searchForm.value.productCategory = ''
+ getList()
}
const findNodeById = (nodes, productId) => {
@@ -190,7 +343,7 @@
// 鍒濆鍖栬〃鍗曟暟鎹�
form.value = {
productrecordId: '',
- inboundQuantity: '', // 鍑哄簱鏁伴噺娓呯┖
+ inboundQuantity: 0, // 鍑哄簱鏁伴噺娓呯┖
inboundTime: getCurrentDate(), // 榛樿褰撳墠鏃ユ湡
nickName: '', // 榛樿褰撳墠鐢ㄦ埛
}
@@ -208,16 +361,24 @@
const submitForm = () => {
let num = Number(form.value.inboundQuantity)
if(num <= 0 || num > currentRowNum.value){
- return proxy.$modal.msgWarning("璇峰~鍏ユ湁鏁堟暟瀛�")
+ return proxy.$modal.msgWarning("璇峰~鍐欏嚭搴撴暟閲�")
+ }
+ if(!form.value.nickName){
+ return proxy.$modal.msgWarning("璇烽�夋嫨鍑哄簱浜�")
+ }
+ if(!form.value.inboundTime){
+ return proxy.$modal.msgWarning("璇烽�夋嫨鍑哄簱鏃堕棿")
}
proxy.$refs["formRef"].validate(valid => {
if (valid && currentRowId.value) {
+ const typeMap = { production: 2, purchase: 1, manual: 3 }
const outData = {
id: currentRowId.value, // 鍘熷璁板綍ID
- salesLedgerProductId: salesLedgerProductId.value,
+ salesLedgerProductId: activeTab.value === 'manual' ? 0 : salesLedgerProductId.value,
quantity: form.value.inboundQuantity, // 鍑哄簱鏁伴噺
time: form.value.inboundTime, // 鍑哄簱鏃堕棿
- userId: form.value.nickName // 鎿嶄綔浜�
+ userId: form.value.nickName, // 鎿嶄綔浜�
+ type: typeMap[activeTab.value] // 鍑哄簱绫诲瀷锛氶噰璐�1锛岀敓浜�2锛岃嚜瀹氫箟3
}
console.log(outData)
@@ -247,7 +408,14 @@
type: 'warning',
}
).then(() => {
- proxy.download("/stockin/export", {}, '鍏ュ簱鍙拌处.xlsx')
+ // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+ let exportUrl = "/stockmanagement/export"
+ if (activeTab.value === 'production') {
+ exportUrl = "/stockmanagement/exportOne"
+ } else if (activeTab.value === 'manual') {
+ exportUrl = "/stockmanagement/exportTwo"
+ }
+ proxy.download(exportUrl, {}, '鍑哄簱鍙拌处.xlsx')
}).catch(() => {
proxy.$modal.msg("宸插彇娑�")
})
@@ -290,4 +458,11 @@
})
</script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+ .barcode-img{
+ width: 80px;
+ height: 80px;
+ border-radius: 5px;
+ background-color: #F5F5F5;
+ }
+</style>
diff --git a/src/views/inventoryManagement/receiptManagement/components/formDia.vue b/src/views/inventoryManagement/receiptManagement/components/formDia.vue
new file mode 100644
index 0000000..09b9fef
--- /dev/null
+++ b/src/views/inventoryManagement/receiptManagement/components/formDia.vue
@@ -0,0 +1,398 @@
+<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">
+ <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="鎬讳环(鍏�)"
+ :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>
+</template>
+
+<script setup>
+import { ref, reactive, toRefs, getCurrentInstance } from 'vue'
+import useUserStore from '@/store/modules/user'
+import {
+ updateStockIn,
+ addSutockIn,
+ selectProductRecordListByPuechaserId
+} from "@/api/inventoryManagement/stockIn.js";
+import { purchaseListPage } from "@/api/procurementManagement/procurementLedger.js";
+
+const userStore = useUserStore()
+const { proxy } = getCurrentInstance()
+const emit = defineEmits(['close', 'success'])
+
+const operationType = ref('')// 鎿嶄綔绫诲瀷: 'add' 鎴� 'edit'
+const dialogFormVisible = ref(false)// 寮规鏄剧ず鐘舵��
+const productList = ref([]);// 浜у搧鍒楄〃鏁版嵁
+const loadingProducts = ref(false);// 浜у搧鍔犺浇鐘舵��
+const selectedRows = ref([]) // 浜у搧琛ㄦ牸閫変腑琛�
+const purchaseOptions = ref([])
+const loadingPurchaseOptions = ref(false)
+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" }]
+ }
+})
+const { form, rules } = toRefs(data)
+
+// 鍔ㄦ�佽绠楀璇濇鏍囬
+const getDialogTitle = () => {
+ return operationType.value === 'add' ? '鏂板鍏ュ簱' : '缂栬緫鍏ュ簱'
+}
+
+const formatPurchaseOption = (item = {}) => {
+ 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;
+ }
+};
+
+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();
+};
+
+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 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 formattedNumber = (row, column, cellValue) => {
+ 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 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
+ }
+}
+
+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')
+}
+
+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),
+ 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
+ }
+}
+
+const closeDia = () => {
+ proxy.$refs.formRef.resetFields()
+ dialogFormVisible.value = false
+ emit('close')
+}
+
+const handleSelectionChange = (selection) => {
+ 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}`;
+}
+
+function getCurrentDate() {
+ 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
+ }
+ }
+}
+
+defineExpose({
+ openDialog,
+})
+</script>
+
+<style scoped lang="scss"></style>
+
+
+
diff --git a/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue b/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
new file mode 100644
index 0000000..016fef6
--- /dev/null
+++ b/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
@@ -0,0 +1,401 @@
+<template>
+ <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '鏂板鑷畾涔夊叆搴�' : '缂栬緫鑷畾涔夊叆搴�'" width="70%"
+ @close="closeDia">
+ <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
+ <div style="margin-bottom: 10px;" v-if="operationType === 'add'">
+ <el-button type="primary" @click="addProductRow">鏂板</el-button>
+ </div>
+ <el-table
+ :data="productList"
+ border
+ v-loading="loadingProducts"
+ >
+ <el-table-column
+ align="center"
+ label="搴忓彿"
+ type="index"
+ width="60"
+ />
+ <el-table-column label="浜у搧鍥剧墖" align="center" prop="productCategory" width="100">
+ <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>
+ </template>
+ </el-table-column>
+ <el-table-column label="浜у搧鍚嶇О" prop="productCategory" width="200">
+ <template #default="scope">
+ <el-input v-model="scope.row.productCategory" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" />
+ </template>
+ </el-table-column>
+ <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="200">
+ <template #default="scope">
+ <el-input v-model="scope.row.specificationModel" placeholder="璇疯緭鍏ヤ骇鍝侀珮搴�" />
+ </template>
+ </el-table-column>
+ <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="200">
+ <template #default="scope">
+ <el-input v-model="scope.row.cartonSpecifications" placeholder="璇疯緭鍏ョ焊绠辫鏍�" />
+ </template>
+ </el-table-column>
+ <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.inboundNum" @change="() => calculateTotalPrice(scope.row)" />
+ </template>
+ </el-table-column>
+ <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="150">
+ <template #default="scope">
+ <el-input-number :step="1" :min="0" style="width: 100%" v-model="scope.row.boxNum" @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
+ v-model="scope.row.inboundDate"
+ type="date"
+ placeholder="璇烽�夋嫨鍏ュ簱鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ style="width: 100%"
+ />
+ </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="鎿嶄綔" width="80" v-if="operationType === 'add'">
+ <template #default="scope">
+ <el-button type="danger" size="small" @click="removeProductRow(scope.$index)">鍒犻櫎</el-button>
+ </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>
+</template>
+
+<script setup>
+import { ref, reactive, toRefs, getCurrentInstance } from 'vue'
+import useUserStore from '@/store/modules/user'
+import {
+ 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)// 寮规鏄剧ず鐘舵��
+const productList = ref([]);// 浜у搧鍒楄〃鏁版嵁
+const loadingProducts = ref(false);// 浜у搧鍔犺浇鐘舵��
+const loading = ref(false);
+
+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}`;
+}
+
+function getCurrentDate() {
+ return formatDateTime(new Date(), false);
+}
+
+const itemTypeOptions = [
+ { label: '鐗╂枡', value: '鐗╂枡' },
+ { label: '鍘熸枡', value: '鍘熸枡' },
+ { label: '鎴愬搧', value: '鎴愬搧' },
+ { label: '鍏朵粬', value: '鍏朵粬' },
+]
+
+const taxRateOptions = [
+ { label: '1', value: 1 },
+ { label: '6', value: 6 },
+ { label: '13', value: 13 },
+]
+
+const data = reactive({
+ form: {
+ id: null,
+ supplierId: null, // 渚涘簲鍟咺D
+ supplierName: '', // 渚涘簲鍟嗗悕绉�
+ recorderId: userStore.userId, // 褰曞叆浜篒D
+ recorderName: userStore.name, // 褰曞叆浜哄鍚�
+ entryDate: getCurrentDate(), // 褰曞叆鏃ユ湡
+ remark: '', // 澶囨敞
+ },
+ rules: {
+ supplierName: [{ required: true, message: "璇疯緭鍏ヤ緵搴斿晢鍚嶇О", trigger: "blur" }]
+ }
+})
+const { form, rules } = toRefs(data)
+
+// 鏂板浜у搧琛�
+const addProductRow = () => {
+ productList.value.push({
+ id: null,
+ productCategory: '',
+ specificationModel: '',
+ cartonSpecifications:'',
+ supplierName: form.value.supplierName || '',
+ itemType: '',
+ inboundNum: 0,
+ inboundDate: '',
+ quantityStock: 0,
+ taxInclusiveUnitPrice: 0,
+ taxInclusiveTotalPrice: 0,
+ taxRate: null,
+ taxExclusiveTotalPrice: 0,
+ boxNum: 0,
+ });
+};
+
+// 鍒犻櫎浜у搧琛�
+const removeProductRow = (index) => {
+ productList.value.splice(index, 1);
+};
+
+// 璁$畻鎬讳环锛堟牴鎹暟閲忋�佸崟浠峰拰鍚◣鍗曚环锛�
+const calculateTotalPrice = (row) => {
+ // 璁$畻鏅�氭�讳环锛歲uantityStock * taxInclusiveUnitPrice
+ const quantity = Number(row.quantityStock || 0);
+ const taxInclusiveUnitPrice = Number(row.taxInclusiveUnitPrice || 0);
+ row.taxInclusiveTotalPrice = quantity * taxInclusiveUnitPrice;
+ calculateExclusivePrice(row);
+};
+
+// 璁$畻涓嶅惈绋庢�讳环锛堟牴鎹惈绋庢�讳环鍜岀◣鐜囷級
+const calculateExclusivePrice = (row) => {
+ const taxInclusiveTotalPrice = Number(row.taxInclusiveTotalPrice || 0);
+ const taxRate = Number(row.taxRate || 0);
+ row.taxExclusiveTotalPrice = taxInclusiveTotalPrice / (1 + taxRate / 100);
+};
+
+const submitForm = async () => {
+ try {
+ await proxy.$refs.formRef.validate()
+
+ if (!productList.value.length) {
+ proxy.$modal.msgError('璇疯嚦灏戞坊鍔犱竴鏉′骇鍝佹暟鎹�')
+ return
+ }
+
+ // 楠岃瘉鑷畾涔夋坊鍔犵殑鏁版嵁蹇呭~瀛楁
+ for (let i = 0; i < productList.value.length; i++) {
+ const product = productList.value[i];
+ if (!product.productCategory || !product.specificationModel) {
+ 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`)
+ return
+ }
+ if (!product.inboundDate) {
+ proxy.$modal.msgError(`绗�${i + 1}琛岃閫夋嫨鍏ュ簱鏃ユ湡`)
+ return
+ }
+
+ }
+
+ const payloadList = productList.value.map(product => ({
+ id: product.id ?? null,
+ inboundNum: Number(product.inboundNum),
+ productCategory: product.productCategory,
+ specificationModel: product.specificationModel,
+ supplierName: product.supplierName || form.value.supplierName,
+ itemType: product.itemType,
+ inboundDate: formatDateTime(product.inboundDate, false),
+ taxRate: Number(product.taxRate || 0),
+ 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') {
+ const editPayload = payloadList[0]
+ await updateStockInCustom(editPayload)
+ } else {
+ await addStockInCustom(payloadList)
+ }
+
+ proxy.$modal.msgSuccess(operationType.value === 'edit' ? '缂栬緫鑷畾涔夊叆搴撴垚鍔�' : '鏂板鑷畾涔夊叆搴撴垚鍔�')
+ 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
+ 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) => {
+ operationType.value = type
+ dialogFormVisible.value = true
+
+ if (type === 'add') {
+ form.value = {
+ id: null,
+ supplierId: null,
+ supplierName: '',
+ recorderId: userStore.userId,
+ recorderName: userStore.name,
+ entryDate: getCurrentDate(),
+ remark: ''
+ }
+ productList.value = []
+ } else {
+ // 缂栬緫妯″紡锛氬皢琛屾暟鎹~鍏呭埌琛ㄦ牸涓互鏀寔淇敼
+ form.value = {
+ id: row?.id ?? null,
+ supplierId: row?.supplierId ?? null,
+ supplierName: row?.supplierName ?? '',
+ recorderId: userStore.userId,
+ recorderName: userStore.name,
+ entryDate: getCurrentDate(),
+ remark: row?.remark ?? ''
+ }
+ productList.value = [{
+ id: row?.id ?? null,
+ productCategory: row?.productCategory ?? '',
+ specificationModel: row?.specificationModel ?? '',
+ supplierName: row?.supplierName ?? '',
+ itemType: row?.itemType ?? '',
+ inboundNum: Number(row?.inboundNum ?? row?.inboundQuantity ?? 0),
+ inboundDate: row?.inboundDate ?? row?.createTime ?? '',
+ quantityStock: Number(row?.quantityStock ?? 0),
+ taxRate: Number(row?.taxRate ?? 0),
+ 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 ?? '',
+ }]
+ }
+}
+
+defineExpose({
+ openDialog,
+})
+</script>
+
+<style scoped lang="scss">
+ .upload-img{
+ width: 80px;
+ height: 80px;
+ object-fit: contain;
+ }
+</style>
+
diff --git a/src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue b/src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue
new file mode 100644
index 0000000..460d785
--- /dev/null
+++ b/src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue
@@ -0,0 +1,303 @@
+<template>
+ <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '鏂板鑷畾涔夊叆搴�' : '缂栬緫鑷畾涔夊叆搴�'" width="70%"
+ @close="closeDia">
+ <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
+ <div style="margin-bottom: 10px;" v-if="operationType === 'add'">
+ <el-button type="primary" @click="addProductRow">鏂板</el-button>
+ </div>
+ <el-table
+ :data="productList"
+ border
+ v-loading="loadingProducts"
+ >
+ <el-table-column
+ align="center"
+ label="搴忓彿"
+ type="index"
+ width="60"
+ />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" width="200">
+ <template #default="scope">
+ <el-input v-model="scope.row.productCategory" placeholder="璇疯緭鍏ヤ骇鍝佸ぇ绫�" />
+ </template>
+ </el-table-column>
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200">
+ <template #default="scope">
+ <el-input v-model="scope.row.specificationModel" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" />
+ </template>
+ </el-table-column>
+ <el-table-column label="鍗曚綅" prop="unit" width="100">
+ <template #default="scope">
+ <el-input v-model="scope.row.unit" placeholder="璇疯緭鍏ュ崟浣�" />
+ </template>
+ </el-table-column>
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="150">
+ <template #default="scope">
+ <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="inboundDate" width="180">
+ <template #default="scope">
+ <el-date-picker
+ v-model="scope.row.inboundDate"
+ type="date"
+ placeholder="璇烽�夋嫨鍏ュ簱鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ style="width: 100%"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column label="鍗曚环(鍏�)" prop="unitPrice" width="150">
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.unitPrice" @change="() => calculateTotalPrice(scope.row)" />
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鎬讳环(鍏�)"
+ prop="totalPrice"
+ 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>
+ </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>
+</template>
+
+<script setup>
+import { ref, reactive, toRefs, getCurrentInstance } from 'vue'
+import useUserStore from '@/store/modules/user'
+import {
+ addStockInCustom, updateProduct
+} from "@/api/inventoryManagement/stockIn.js";
+
+const userStore = useUserStore()
+const { proxy } = getCurrentInstance()
+const emit = defineEmits(['close', 'success'])
+
+const operationType = ref('')// 鎿嶄綔绫诲瀷: 'add' 鎴� 'edit'
+const dialogFormVisible = ref(false)// 寮规鏄剧ず鐘舵��
+const productList = ref([]);// 浜у搧鍒楄〃鏁版嵁
+const loadingProducts = ref(false);// 浜у搧鍔犺浇鐘舵��
+const loading = ref(false);
+
+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}`;
+}
+
+function getCurrentDate() {
+ return formatDateTime(new Date(), false);
+}
+
+const itemTypeOptions = [
+ { label: '鐗╂枡', value: '鐗╂枡' },
+ { label: '鍘熸枡', value: '鍘熸枡' },
+ { label: '鎴愬搧', value: '鎴愬搧' },
+ { label: '鍏朵粬', value: '鍏朵粬' },
+]
+
+const taxRateOptions = [
+ { label: '1', value: 1 },
+ { label: '6', value: 6 },
+ { label: '13', value: 13 },
+]
+
+const data = reactive({
+ form: {
+ id: null,
+ supplierId: null, // 渚涘簲鍟咺D
+ supplierName: '', // 渚涘簲鍟嗗悕绉�
+ recorderId: userStore.userId, // 褰曞叆浜篒D
+ recorderName: userStore.name, // 褰曞叆浜哄鍚�
+ entryDate: getCurrentDate(), // 褰曞叆鏃ユ湡
+ remark: '', // 澶囨敞
+ },
+ rules: {
+ supplierName: [{ required: true, message: "璇疯緭鍏ヤ緵搴斿晢鍚嶇О", trigger: "blur" }]
+ }
+})
+const { form, rules } = toRefs(data)
+
+// 鏂板浜у搧琛�
+const addProductRow = () => {
+ productList.value.push({
+ id: null,
+ productCategory: '',
+ specificationModel: '',
+ unit: '',
+ supplierName: form.value.supplierName || '',
+ itemType: '',
+ inboundNum: 0,
+ inboundDate: '',
+ quantityStock: 0,
+ unitPrice: 0,
+ totalPrice: 0,
+ taxRate: null,
+ taxExclusiveTotalPrice: 0,
+ });
+};
+
+// 鍒犻櫎浜у搧琛�
+const removeProductRow = (index) => {
+ productList.value.splice(index, 1);
+};
+
+// 璁$畻鎬讳环锛堟牴鎹暟閲忋�佸崟浠峰拰鍚◣鍗曚环锛�
+const calculateTotalPrice = (row) => {
+ // 璁$畻鏅�氭�讳环锛歩nboundNum * unitPrice
+ const quantity = Number(row.inboundNum || 0);
+ const unitPrice = Number(row.unitPrice || 0);
+ row.totalPrice = quantity * unitPrice;
+ calculateExclusivePrice(row);
+};
+
+// 璁$畻涓嶅惈绋庢�讳环锛堟牴鎹惈绋庢�讳环鍜岀◣鐜囷級
+const calculateExclusivePrice = (row) => {
+ const totalPrice = Number(row.totalPrice || 0);
+ const taxRate = Number(row.taxRate || 0);
+ row.taxExclusiveTotalPrice = totalPrice / (1 + taxRate / 100);
+};
+
+const submitForm = async () => {
+ try {
+ await proxy.$refs.formRef.validate()
+
+ if (!productList.value.length) {
+ proxy.$modal.msgError('璇疯嚦灏戞坊鍔犱竴鏉′骇鍝佹暟鎹�')
+ return
+ }
+
+ // 楠岃瘉鑷畾涔夋坊鍔犵殑鏁版嵁蹇呭~瀛楁
+ for (let i = 0; i < productList.value.length; i++) {
+ const product = productList.value[i];
+ if (!product.productCategory || !product.specificationModel || !product.unit) {
+ 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 => ({
+ id: product.id ?? null,
+ 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),
+ taxRate: Number(product.taxRate || 0),
+ taxExclusiveTotalPrice: Number(product.taxExclusiveTotalPrice || 0),
+ unitPrice: Number(product.unitPrice || 0),
+ }));
+ loading.value = true
+ if (operationType.value === 'edit') {
+ const editPayload = payloadList[0]
+ await updateProduct(editPayload)
+ } else {
+ await addStockInCustom(payloadList)
+ }
+
+ proxy.$modal.msgSuccess(operationType.value === 'edit' ? '缂栬緫鑷畾涔夊叆搴撴垚鍔�' : '鏂板鑷畾涔夊叆搴撴垚鍔�')
+ 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
+ productList.value = []
+ emit('close')
+}
+
+const openDialog = async (type, row) => {
+ operationType.value = type
+ dialogFormVisible.value = true
+
+ if (type === 'add') {
+ form.value = {
+ id: null,
+ supplierId: null,
+ supplierName: '',
+ recorderId: userStore.userId,
+ recorderName: userStore.name,
+ entryDate: getCurrentDate(),
+ remark: ''
+ }
+ productList.value = []
+ } else {
+ // 缂栬緫妯″紡锛氬皢琛屾暟鎹~鍏呭埌琛ㄦ牸涓互鏀寔淇敼
+ form.value = {
+ id: row?.id ?? null,
+ supplierId: row?.supplierId ?? null,
+ supplierName: row?.supplierName ?? '',
+ recorderId: userStore.userId,
+ recorderName: userStore.name,
+ entryDate: getCurrentDate(),
+ remark: row?.remark ?? ''
+ }
+ productList.value = [{
+ 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),
+ inboundDate: row?.inboundDate ?? row?.createTime ?? '',
+ taxRate: Number(row?.taxRate ?? 0),
+ unitPrice: Number(row?.unitPrice ?? 0),
+ taxExclusiveTotalPrice: Number(row?.taxExclusiveTotalPrice ?? 0),
+ dollarPrice: Number(row?.dollarPrice ?? 0),
+ }]
+ }
+}
+
+defineExpose({
+ openDialog,
+})
+</script>
+
+<style scoped lang="scss"></style>
+
diff --git a/src/views/inventoryManagement/receiptManagement/index.vue b/src/views/inventoryManagement/receiptManagement/index.vue
index 3db10d7..16af5cd 100644
--- a/src/views/inventoryManagement/receiptManagement/index.vue
+++ b/src/views/inventoryManagement/receiptManagement/index.vue
@@ -1,129 +1,224 @@
<template>
<div class="app-container">
- <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"
- />
- <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>
- <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" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鎵规" prop="inboundBatches" width="160" show-overflow-tooltip />
- <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="240" show-overflow-tooltip />
- <el-table-column label="浜у搧澶х被" prop="productCategory" width="100" show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200" 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="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
- <el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" show-overflow-tooltip />
- <el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
- <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);">缂栬緫</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-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '鏂板鍏ュ簱' : '缂栬緫鍏ュ簱'" 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
- remote
- :remote-method="loadPurchaseOptions"
- :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">
+ <el-tabs v-model="activeTab" @tab-change="handleTabChange">
+ <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 type="primary" @click="openForm('add', 'purchase')">鏂板鍏ュ簱</el-button>
+ <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" 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">
- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" />
+ <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
</template>
</el-table-column>
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="120" />
- <el-table-column
- label="鍚◣鍗曚环(鍏�)"
- prop="taxInclusiveUnitPrice"
- :formatter="formattedNumber"
- width="150"
- />
- <el-table-column
- label="鍚◣鎬讳环(鍏�)"
- prop="taxInclusiveTotalPrice"
- :formatter="formattedNumber"
- width="150"
- />
- <el-table-column
- label="涓嶅惈绋庢�讳环(鍏�)"
- prop="taxExclusiveTotalPrice"
- :formatter="formattedNumber"
- width="150"
- />
- </el-table>
- </el-form>
+ <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 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>
+ <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 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 type="primary" @click="openForm('add', 'manual')">鏂板鍏ュ簱</el-button>
+ <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="浜у搧鍥剧墖" 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 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>
+ <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>
+
+ <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 type="primary" @click="submitForm">纭</el-button>
- <el-button @click="closeDia">鍙栨秷</el-button>
+ <el-button @click="closeBarcodeDia">鍏抽棴</el-button>
</div>
</template>
</el-dialog>
@@ -132,31 +227,38 @@
<script setup>
import pagination from '@/components/PIMTable/Pagination.vue'
-import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
+import { ref, reactive, toRefs, onMounted, getCurrentInstance, nextTick } from 'vue'
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
+import dayjs from 'dayjs'
+const javaApiUrl = __BASE_API__;
import {
- getStockInPage,
- updateStockIn,
- addSutockIn,
- delStockIn,
- selectProductRecordListByPuechaserId
+ getStockInPage,
+ getStockInPageByProduction,
+ delStockIn,
+ delStockInCustom, getInPageByCustom,
+ stockinDetail,detailManagementByCustom
} from "@/api/inventoryManagement/stockIn.js";
-import { purchaseListPage } from "@/api/procurementManagement/procurementLedger.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";
-const userStore = useUserStore()
+// 鑾峰彇褰撳墠鏃ユ湡
+function getCurrentDate() {
+ return dayjs().format('YYYY-MM-DD')
+}
+
const { proxy } = getCurrentInstance()
const tableData = ref([])
const selectedRows = ref([])
-const userList = ref([])
-
-const purchaseOptions = ref([])
-const loadingPurchaseOptions = ref(false)
-
-
-const loading = ref(false);
const tableLoading = ref(false)
+const formDia = ref()
+const formDiaManual = ref()
+const formDiaProduct = ref()
+const activeTab = ref('purchase') // 褰撳墠婵�娲荤殑 tab
const page = reactive({
current: 1,
@@ -164,107 +266,15 @@
})
const total = ref(0)
-// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
-const operationType = ref('')// 鎿嶄綔绫诲瀷: 'add' 鎴� 'edit'
-const dialogFormVisible = ref(false)// 寮规鏄剧ず鐘舵��
-const productList = ref([]);// 浜у搧鍒楄〃鏁版嵁
-const loadingProducts = ref(false);// 浜у搧鍔犺浇鐘舵��
-const productSelectedRows = ref([]) // 浜у搧琛ㄦ牸閫変腑琛�
const data = reactive({
searchForm: {
supplierName: '',
- timeStr: '',
+ customerName: '',
+ productCategory:'',
+ timeStr: getCurrentDate(),
},
- 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 { searchForm, form, rules } = toRefs(data)
-
-const formatPurchaseOption = (item = {}) => {
- 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;
- }
-};
-
-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();
-};
-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 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 formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
-};
+const { searchForm } = toRefs(data)
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
@@ -278,281 +288,320 @@
}
const getList = () => {
tableLoading.value = true
- getStockInPage({ ...searchForm.value, ...page }).then(res => {
+ const params = { ...page }
+
+ // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷浼犻�掍笉鍚岀殑鏌ヨ鍙傛暟
+ if (activeTab.value === 'production') {
+ params.customerName = searchForm.value.customerName
+ params.timeStr = searchForm.value.timeStr
+ } else {
+ params.supplierName = searchForm.value.supplierName
+ params.timeStr = searchForm.value.timeStr
+ }
+ params.productCategory = searchForm.value.productCategory
+
+ // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勬帴鍙�
+ const apiCall = activeTab.value === 'production'
+ ? getStockInPageByProduction(params)
+ : activeTab.value === 'manual'
+ ? getInPageByCustom(params)
+ : getStockInPage(params)
+
+ apiCall.then(res => {
tableLoading.value = false
tableData.value = res.data.records
+
+ // 鍓嶇璁$畻鎬讳环锛氭�讳环 = unitPrice * inboundNum
+ tableData.value = tableData.value.map(item => {
+ // 浣跨敤鍏ュ簱鏁伴噺璁$畻鎬讳环
+ const inboundNum = Number(item.inboundNum) || 0
+ const unitPrice = Number(item.unitPrice) || 0
+ const taxInclusiveUnitPrice = Number(item.taxInclusiveUnitPrice) || 0
+
+ // 鏍规嵁鏍囩椤电被鍨嬭绠椾笉鍚岀殑鎬讳环
+ if (activeTab.value === 'production') {
+ // 鎴愬搧搴撳瓨锛氭�讳环 = unitPrice * 鍏ュ簱鏁伴噺
+ item.totalPrice = (unitPrice * inboundNum).toFixed(2)
+ } else {
+ // 鍘熸枡鍜屾潗鏂欏簱瀛橈細鍚◣鎬讳环 = taxInclusiveUnitPrice * 鍏ュ簱鏁伴噺
+ item.taxInclusiveTotalPrice = (taxInclusiveUnitPrice * inboundNum).toFixed(2)
+ }
+
+ return item
+ })
+
total.value = res.data.total
- console.log('tableData:', tableData.value)
}).catch(() => {
tableLoading.value = false
})
}
-
-// 璋冪敤selectProductRecordListByPuechaserId杩欎釜鏂规硶鏍规嵁鍚堝悓鏌ヨ鍒癷d锛屽啀璋冪敤getProductRecordByhetong杩欎釜鏂规硶鏍规嵁id鏌ヨ鍒颁骇鍝佽鍗曡褰�
-// 鏂板鏍规嵁鍚堝悓鍙锋煡璇骇鍝佽褰曠殑鏂规硶
-const fetchProductsByContract = async () =>
-{
- if (!form.value.purchaseContractNumber) {
- proxy.$modal.msgWarning('璇烽�夋嫨鍚堝悓鍙�')
- return
- }
- try {
- loadingProducts.value = true
- // 鏍规嵁鍚堝悓鏌ヨ浜у搧璁板綍
- const productRes = await selectProductRecordListByPuechaserId({
- purchaseContractNumber: form.value.purchaseContractNumber
- });
- console.log('productRes:', productRes)
- if (!productRes.data || productRes.data.length === 0) {
- proxy.$modal.msgWarning('璇ュ悎鍚屼笅娌℃湁浜у搧璁板綍')
- productList.value = [];
- return
- }
- // 澶勭悊浜у搧鏁版嵁锛屾坊鍔犳湰娆″叆搴撴暟閲忓瓧娈�
- productList.value = productRes.data.map(item => ({
- ...item,
- quantityStock: 0,
- originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? 0),
- }))
- } catch (error) {
- console.error('鏌ヨ浜у搧璁板綍澶辫触:', error)
- proxy.$modal.msgError('鏌ヨ浜у搧璁板綍澶辫触')
- productList.value = [];
- } finally {
- loadingProducts.value = false
- }
+// 鍒囨崲 tab
+const handleTabChange = (tabName) => {
+ page.current = 1
+ // 鍒囨崲 tab 鏃舵竻绌烘悳绱㈡潯浠�
+ searchForm.value.supplierName = ''
+ searchForm.value.customerName = ''
+ searchForm.value.timeStr = getCurrentDate() // 閲嶇疆涓哄綋鍓嶆棩鏈�
+ searchForm.value.productCategory = ''
+ getList()
}
-
// 鎵撳紑寮规
- const openForm = 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
- // 鏍规嵁鍚堝悓鍙峰姞杞藉搴旂殑浜у搧鍒楄〃锛堝亣璁� getProductByContract 鏄彲鐢ㄦ帴鍙o級
- 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),
- 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
- }
+const openForm = async (type, row, tabType) => {
+ if(barcodeDia.value)return
+ const currentTab = tabType || activeTab.value
+ await nextTick(() => {
+ if (currentTab === 'manual') {
+ formDiaManual.value?.openDialog(type, row)
+ } else if (currentTab === 'production') {
+ formDiaProduct.value?.openDialog(type, row)
+ }else {
+ formDia.value?.openDialog(type, row)
}
- }
+ })
+}
- 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()
- getList() // 鍒锋柊鍒楄〃
- }
-
-// 鎻愪氦琛ㄥ崟
- 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.msgError('鏈鍏ュ簱鏁伴噺闇�澶т簬0锛屼笖涓嶈兘瓒呰繃寰呭叆搴撴暟閲�')
- return
- }
-
- // 鍑嗗鎻愪氦鏁版嵁 - 淇敼涓哄悗绔渶瑕佺殑鏍煎紡
- const stockInData = {
- // 鍏ュ簱鍗曞熀鏈俊鎭�
- ...form.value,
- inboundTime: formatDateTime(form.value.inboundTime),
- nickName: userStore.nickName,
- details: selectedRows.value.map(product => ({
- id: product.id,
- // id: product.salesLedgerProductId,
- inboundQuantity: Number(product.quantityStock)
- })),
- };
- // 璋冪敤API
- loading.value = true
- await addSutockIn(stockInData)
-
- proxy.$modal.msgSuccess('鏂板鍏ュ簱鎴愬姛')
- closeDia()
- getList() // 鍒锋柊鍒楄〃
-
- } catch (error) {
- console.error('鎻愪氦澶辫触:', error)
- if (!error.errors) {
- proxy.$modal.msgError('鎿嶄綔澶辫触锛岃閲嶈瘯')
- }
- } finally {
- loading.value = false
- }
- }
-
-// 鍏抽棴寮规
- const closeDia = () => {
- proxy.$refs.formRef.resetFields()
- dialogFormVisible.value = false
-
- }
// 琛ㄦ牸閫夋嫨鏁版嵁
- const handleSelectionChange = (selection) => {
- // 杩囨护鎺夊瓙鏁版嵁
- selectedRows.value = selection.filter(item => item.id);
- }
+const handleSelectionChange = (selection) => {
+ selectedRows.value = selection.filter(item => item.id)
+}
- const expandedRowKeys = ref([])
+const expandedRowKeys = ref([])
// 涓昏〃鍚堣鏂规硶
- const summarizeMainTable = (param) => {
- return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']);
- };
+const summarizeMainTable = (param) => {
+ return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice'])
+}
// 瀵煎嚭
- const handleOut = () => {
- ElMessageBox.confirm(
- '鏄惁纭瀵煎嚭锛�',
- '瀵煎嚭', {
- confirmButtonText: '纭',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- }
- ).then(() => {
- proxy.download("/stockin/export", {}, '鍏ュ簱鍙拌处.xlsx')
- }).catch(() => {
- proxy.$modal.msg("宸插彇娑�")
- })
- }
+const handleOut = () => {
+ ElMessageBox.confirm('鏄惁纭瀵煎嚭锛�', '瀵煎嚭', {
+ confirmButtonText: '纭',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+ let exportUrl = "/stockin/export"
+ if (activeTab.value === 'production') {
+ exportUrl = "/stockin/exportOne"
+ } else if (activeTab.value === 'manual') {
+ exportUrl = "/stockin/exportTwo"
+ }
+ proxy.download(exportUrl, {}, '鍏ュ簱鍙拌处.xlsx')
+ }).catch(() => {
+ proxy.$modal.msg("宸插彇娑�")
+ })
+}
+
// 鍒犻櫎
- const handleDelete = () => {
- let ids = []
- if (selectedRows.value.length > 0) {
- // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
- const unauthorizedData = selectedRows.value.filter(item => item.createUser !== userStore.id);
- if (unauthorizedData.length > 0) {
- proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
- return;
- }
- ids = selectedRows.value.map(item => item.id);
+const handleDelete = () => {
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning('璇烽�夋嫨鏁版嵁')
+ return
+ }
+ const ids = selectedRows.value.map(item => item.id)
+
+ ElMessageBox.confirm('閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�', '鍒犻櫎', {
+ confirmButtonText: '纭',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ // 鏍规嵁褰撳墠 tab 绫诲瀷閫夋嫨涓嶅悓鐨勫垹闄ゆ帴鍙e拰type鍙傛暟
+ let deleteApi, deleteParams
+
+ if (activeTab.value === 'production') {
+ // 鎴愬搧鍒犻櫎锛宼ype浼�2
+ deleteApi = delStockIn
+ deleteParams = { ids, type: 2 }
+ } else if (activeTab.value === 'purchase') {
+ // 鍘熸枡鍒犻櫎锛宼ype浼�1
+ deleteApi = delStockIn
+ deleteParams = { ids, type: 1 }
} else {
- proxy.$modal.msgWarning('璇烽�夋嫨鏁版嵁')
+ // 鏉愭枡鍏ュ簱
+ deleteApi = delStockInCustom
+ deleteParams = [...ids]
+ }
+
+ deleteApi(deleteParams).then(() => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
+ getList()
+ }).catch(() => {
+ proxy.$modal.msgError("鍒犻櫎澶辫触")
+ })
+ }).catch(() => {
+ proxy.$modal.msg("宸插彇娑�")
+ })
+}
+
+
+// 浜岀淮鐮佺浉鍏冲彉閲�
+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
}
- ElMessageBox.confirm(
- '閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�',
- '瀵煎嚭', {
- confirmButtonText: '纭',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- }
- ).then(() => {
- delStockIn({ids:ids}).then(res => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
- getList()
- })
- }).catch(() => {
- proxy.$modal.msg("宸插彇娑�")
- })
- }
-
-// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
-// 淇敼涓烘洿閫氱敤鐨勬棩鏈熸椂闂存牸寮忓寲鍑芥暟
-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}`; // 淇濇寔鍘熸湁 getCurrentDate 鍔熻兘
- }
-
- // 鏂板鏃堕棿閮ㄥ垎鏍煎紡鍖�
- 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}`;
-}
-
-// 淇濇寔鍘熸湁 getCurrentDate 鐨勫吋瀹规��
-function getCurrentDate() {
- return formatDateTime(new Date(), false);
-}
-
-
-
-
- onMounted(() => {
- getList()
+ 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"></style>
+<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>
+
+
+
diff --git a/src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue b/src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue
new file mode 100644
index 0000000..5e948fb
--- /dev/null
+++ b/src/views/inventoryManagement/stockManagement/components/FormDiaManual.vue
@@ -0,0 +1,156 @@
+<template>
+ <el-dialog :model-value="dialogFormVisible" :title="operationType === 'add' ? '鏂板鏉愭枡搴撳瓨' : '缂栬緫鏉愭枡搴撳瓨'" width="70%"
+ @update:model-value="$emit('update:dialogFormVisible', $event)" @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="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-input disabled v-model="form.specificationModel" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <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-form-item label="鐗╁搧绫诲瀷锛�" prop="itemType">
+ <el-input disabled v-model="form.itemType" placeholder="璇疯緭鍏�" clearable />
+ </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" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
+ type="date" placeholder="璇烽�夋嫨" clearable />
+ </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>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <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-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-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, watch } from 'vue'
+
+const props = defineProps({
+ dialogFormVisible: Boolean,
+ operationType: String,
+ formData: Object
+})
+
+const emit = defineEmits(['update:dialogFormVisible', 'submit', 'close'])
+
+const formRef = ref()
+
+const data = reactive({
+ form: {
+ productCategory: '',
+ specificationModel: '',
+ unit: '',
+ itemType: '',
+ createTime: '',
+ inboundNum: '',
+ totalInboundNum: '',
+ inboundNum0: '',
+ taxInclusiveUnitPrice: '',
+ taxInclusiveTotalPrice: ''
+ },
+ rules: {
+ productCategory: [{ required: true, message: '璇疯緭鍏ヤ骇鍝佸ぇ绫�', trigger: 'blur' }],
+ specificationModel: [{ required: true, message: '璇疯緭鍏ヨ鏍煎瀷鍙�', trigger: 'blur' }],
+ unit: [{ required: true, message: '璇疯緭鍏ュ崟浣�', trigger: 'blur' }],
+ itemType: [{ required: true, message: '璇疯緭鍏ョ墿鍝佺被鍨�', trigger: 'blur' }],
+ createTime: [{ required: true, message: '璇烽�夋嫨鍏ュ簱鏃堕棿', trigger: 'change' }],
+ inboundNum: [{ required: true, message: '璇疯緭鍏ュ簱瀛樻暟閲�', trigger: 'blur' }],
+ taxInclusiveUnitPrice: [{ required: true, message: '璇疯緭鍏ュ崟浠�', trigger: 'blur' }]
+ }
+})
+
+const { form, rules } = toRefs(data)
+
+// 璁$畻鎬讳环锛氭�讳环 = 鍗曚环 脳 鍓╀綑搴撳瓨
+const calculateTotalPrice = () => {
+ const unitPrice = parseFloat(form.value.taxInclusiveUnitPrice) || 0
+ const stockQuantity = parseFloat(form.value.inboundNum) || 0 // 搴撳瓨鏁伴噺
+ const outboundQuantity = parseFloat(form.value.totalInboundNum) || 0 // 宸插嚭搴撴暟閲�
+ const remainingStock = stockQuantity - outboundQuantity // 鍓╀綑搴撳瓨
+ form.value.taxInclusiveTotalPrice = (unitPrice * remainingStock).toFixed(2)
+}
+
+// 鐩戝惉formData鍙樺寲
+watch(() => props.formData, (newVal) => {
+ if (newVal) {
+ form.value = { ...newVal }
+ // 鏁版嵁鍙樺寲鍚庨噸鏂拌绠楁�讳环
+ calculateTotalPrice()
+ }
+}, { immediate: true })
+
+// 鎻愪氦琛ㄥ崟
+const submitForm = () => {
+ formRef.value.validate(valid => {
+ if (valid) {
+ emit('submit', form.value)
+ }
+ })
+}
+
+// 鍏抽棴寮规
+const closeDia = () => {
+ emit('close')
+ emit('update:dialogFormVisible', false)
+}
+
+</script>
+
+<style scoped lang="scss">
+.dialog-footer {
+ text-align: center;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/inventoryManagement/stockManagement/components/FormDiaProduction.vue b/src/views/inventoryManagement/stockManagement/components/FormDiaProduction.vue
new file mode 100644
index 0000000..1653307
--- /dev/null
+++ b/src/views/inventoryManagement/stockManagement/components/FormDiaProduction.vue
@@ -0,0 +1,147 @@
+<template>
+ <el-dialog :model-value="dialogFormVisible" :title="operationType === 'add' ? '鏂板鎴愬搧搴撳瓨' : '缂栬緫鎴愬搧搴撳瓨'" width="70%"
+ @update:model-value="$emit('update:dialogFormVisible', $event)" @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="productCategory">
+ <el-input disabled v-model="form.productCategory" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <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-input disabled v-model="form.unit" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍏ュ簱鏃堕棿锛�" prop="createTime">
+ <el-date-picker style="width: 100%" v-model="form.createTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
+ type="date" placeholder="璇烽�夋嫨" clearable />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="搴撳瓨鏁伴噺锛�" prop="inboundNum">
+ <el-input v-model="form.inboundNum" placeholder="璇疯緭鍏�" clearable @input="calculateTotalPrice" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="宸插嚭搴撴暟閲忥細" prop="totalInboundNum">
+ <el-input disabled v-model="form.totalInboundNum" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="寰呭嚭搴撴暟閲忥細" prop="inboundNum0">
+ <el-input disabled v-model="form.inboundNum0" placeholder="璇疯緭鍏�" clearable />
+ </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="totalPrice">
+ <el-input disabled v-model="form.totalPrice" placeholder="鑷姩璁$畻" clearable />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </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, watch } from 'vue'
+
+const props = defineProps({
+ dialogFormVisible: Boolean,
+ operationType: String,
+ formData: Object
+})
+
+const emit = defineEmits(['update:dialogFormVisible', 'submit', 'close'])
+
+const formRef = ref()
+
+const data = reactive({
+ form: {
+ productCategory: '',
+ specificationModel: '',
+ unit: '',
+ createTime: '',
+ inboundNum: '',
+ totalInboundNum: '',
+ inboundNum0: '',
+ unitPrice: '',
+ totalPrice: ''
+ },
+ rules: {
+ productCategory: [{ required: true, message: '璇疯緭鍏ヤ骇鍝佸ぇ绫�', trigger: 'blur' }],
+ specificationModel: [{ required: true, message: '璇疯緭鍏ヨ鏍煎瀷鍙�', trigger: 'blur' }],
+ unit: [{ required: true, message: '璇疯緭鍏ュ崟浣�', trigger: 'blur' }],
+ createTime: [{ required: true, message: '璇烽�夋嫨鍏ュ簱鏃堕棿', trigger: 'change' }],
+ inboundNum: [{ required: true, message: '璇疯緭鍏ュ簱瀛樻暟閲�', trigger: 'blur' }],
+ unitPrice: [{ required: true, message: '璇疯緭鍏ュ崟浠�', trigger: 'blur' }]
+ }
+})
+
+const { form, rules } = toRefs(data)
+
+// 璁$畻鎬讳环锛氭�讳环 = 鍗曚环 脳 鍓╀綑搴撳瓨
+const calculateTotalPrice = () => {
+ const unitPrice = parseFloat(form.value.unitPrice) || 0
+ const stockQuantity = parseFloat(form.value.inboundNum) || 0 // 搴撳瓨鏁伴噺
+ const outboundQuantity = parseFloat(form.value.totalInboundNum) || 0 // 宸插嚭搴撴暟閲�
+ const remainingStock = stockQuantity - outboundQuantity // 鍓╀綑搴撳瓨
+ form.value.totalPrice = (unitPrice * remainingStock).toFixed(2)
+}
+
+// 鐩戝惉formData鍙樺寲
+watch(() => props.formData, (newVal) => {
+ if (newVal) {
+ form.value = { ...newVal }
+ // 鏁版嵁鍙樺寲鍚庨噸鏂拌绠楁�讳环
+ calculateTotalPrice()
+ }
+}, { immediate: true })
+
+// 鎻愪氦琛ㄥ崟
+const submitForm = () => {
+ formRef.value.validate(valid => {
+ if (valid) {
+ emit('submit', form.value)
+ }
+ })
+}
+
+// 鍏抽棴寮规
+const closeDia = () => {
+ emit('close')
+ emit('update:dialogFormVisible', false)
+}
+
+</script>
+
+<style scoped lang="scss">
+.dialog-footer {
+ text-align: center;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/inventoryManagement/stockManagement/components/FormDiaPurchase.vue b/src/views/inventoryManagement/stockManagement/components/FormDiaPurchase.vue
new file mode 100644
index 0000000..5da2eee
--- /dev/null
+++ b/src/views/inventoryManagement/stockManagement/components/FormDiaPurchase.vue
@@ -0,0 +1,147 @@
+<template>
+ <el-dialog :model-value="dialogFormVisible" :title="operationType === 'add' ? '鏂板鍘熸枡搴撳瓨' : '缂栬緫鍘熸枡搴撳瓨'" width="70%"
+ @update:model-value="$emit('update:dialogFormVisible', $event)" @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="productCategory">
+ <el-input disabled v-model="form.productCategory" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <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-input disabled v-model="form.unit" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍏ュ簱鏃堕棿锛�" prop="createTime">
+ <el-date-picker style="width: 100%" v-model="form.createTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
+ type="date" placeholder="璇烽�夋嫨" clearable />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="搴撳瓨鏁伴噺锛�" prop="inboundNum">
+ <el-input v-model="form.inboundNum" placeholder="璇疯緭鍏�" clearable @input="calculateTotalPrice" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="宸插嚭搴撴暟閲忥細" prop="totalInboundNum">
+ <el-input disabled v-model="form.totalInboundNum" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="寰呭嚭搴撴暟閲忥細" prop="inboundNum0">
+ <el-input disabled v-model="form.inboundNum0" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ <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-row>
+ <el-row :gutter="30">
+ <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">
+ <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, watch } from 'vue'
+
+const props = defineProps({
+ dialogFormVisible: Boolean,
+ operationType: String,
+ formData: Object
+})
+
+const emit = defineEmits(['update:dialogFormVisible', 'submit', 'close'])
+
+const formRef = ref()
+
+const data = reactive({
+ form: {
+ productCategory: '',
+ specificationModel: '',
+ unit: '',
+ createTime: '',
+ inboundNum: '',
+ totalInboundNum: '',
+ inboundNum0: '',
+ taxInclusiveUnitPrice: '',
+ taxInclusiveTotalPrice: ''
+ },
+ rules: {
+ productCategory: [{ required: true, message: '璇疯緭鍏ヤ骇鍝佸ぇ绫�', trigger: 'blur' }],
+ specificationModel: [{ required: true, message: '璇疯緭鍏ヨ鏍煎瀷鍙�', trigger: 'blur' }],
+ unit: [{ required: true, message: '璇疯緭鍏ュ崟浣�', trigger: 'blur' }],
+ createTime: [{ required: true, message: '璇烽�夋嫨鍏ュ簱鏃堕棿', trigger: 'change' }],
+ inboundNum: [{ required: true, message: '璇疯緭鍏ュ簱瀛樻暟閲�', trigger: 'blur' }],
+ taxInclusiveUnitPrice: [{ required: true, message: '璇疯緭鍏ュ惈绋庡崟浠�', trigger: 'blur' }]
+ }
+})
+
+const { form, rules } = toRefs(data)
+
+// 璁$畻鎬讳环锛氬惈绋庢�讳环 = 鍚◣鍗曚环 脳 鍓╀綑搴撳瓨
+const calculateTotalPrice = () => {
+ const unitPrice = parseFloat(form.value.taxInclusiveUnitPrice) || 0
+ const stockQuantity = parseFloat(form.value.inboundNum) || 0 // 搴撳瓨鏁伴噺
+ const outboundQuantity = parseFloat(form.value.totalInboundNum) || 0 // 宸插嚭搴撴暟閲�
+ const remainingStock = stockQuantity - outboundQuantity // 鍓╀綑搴撳瓨
+ form.value.taxInclusiveTotalPrice = (unitPrice * remainingStock).toFixed(2)
+}
+
+// 鐩戝惉formData鍙樺寲
+watch(() => props.formData, (newVal) => {
+ if (newVal) {
+ form.value = { ...newVal }
+ // 鏁版嵁鍙樺寲鍚庨噸鏂拌绠楁�讳环
+ calculateTotalPrice()
+ }
+}, { immediate: true })
+
+// 鎻愪氦琛ㄥ崟
+const submitForm = () => {
+ formRef.value.validate(valid => {
+ if (valid) {
+ emit('submit', form.value)
+ }
+ })
+}
+
+// 鍏抽棴寮规
+const closeDia = () => {
+ emit('close')
+ emit('update:dialogFormVisible', false)
+}
+
+</script>
+
+<style scoped lang="scss">
+.dialog-footer {
+ text-align: center;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/inventoryManagement/stockManagement/index.vue b/src/views/inventoryManagement/stockManagement/index.vue
index f80aa94..95247bc 100644
--- a/src/views/inventoryManagement/stockManagement/index.vue
+++ b/src/views/inventoryManagement/stockManagement/index.vue
@@ -1,152 +1,201 @@
<template>
<div class="app-container">
- <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"
- />
- <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>
- <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="supplierName" width="240" show-overflow-tooltip />
- <el-table-column label="浜у搧澶х被" prop="productCategory" width="100" show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200" show-overflow-tooltip />
- <el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
- <el-table-column label="搴撳瓨鏁伴噺" prop="inboundNum0" width="100" show-overflow-tooltip />
- <el-table-column label="搴撳瓨棰勮鏁伴噺" prop="warnNum" width="130" show-overflow-tooltip />
- <el-table-column label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
- <el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="100" show-overflow-tooltip />
- <el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
- <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);">缂栬緫</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-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '鏂板搴撳瓨' : '缂栬緫搴撳瓨'" width="70%"
- @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="supplierName">
- <el-input disabled v-model="form.supplierName" placeholder="璇疯緭鍏�" clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="浜у搧澶х被锛�" prop="productId">
- <el-select disabled v-model="form.productCategory" placeholder="璇烽�夋嫨" clearable filterable>
- <el-option v-for="item in productList" :key="item.id" :label="item.productName"
- :value="item.productName" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="productManageId">
- <el-select disabled v-model="form.specificationModel" placeholder="璇峰厛閫夋嫨浜у搧澶х被" clearable filterable :disabled="!form.productCategory">
- <el-option v-for="item in productModelList" :key="item.id" :label="item.model"
- :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍗曚綅锛�" prop="customerId">
- <el-input disabled v-model="form.unit" placeholder="璇疯緭鍏�" clearable />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="搴撳瓨鏃堕棿锛�" prop="projectName">
- <el-date-picker style="width: 100%" v-model="form.updateTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
- type="date" placeholder="璇烽�夋嫨" clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍏ュ簱鏃堕棿锛�" prop="projectName">
- <el-date-picker style="width: 100%" v-model="form.createTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
- type="date" placeholder="璇烽�夋嫨" clearable />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
-
- <el-col :span="12">
- <el-form-item label="鍚◣鍗曚环锛�" prop="customerId">
- <el-input disabled v-model="form.taxInclusiveUnitPrice" placeholder="璇疯緭鍏�" clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍚◣鎬讳环锛�" prop="customerContractNo">
- <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="customerId">
- <el-input disabled v-model="form.taxRate" placeholder="璇疯緭鍏�" clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="涓嶅惈绋庢�讳环锛�" prop="entryDate">
- <el-input disabled v-model="form.taxExclusiveTotalPrice" placeholder="璇疯緭鍏�" clearable />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍑哄簱浜猴細" prop="entryPerson">
- <el-select v-model="form.createUser" placeholder="璇烽�夋嫨" clearable>
- <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
- </el-select>
- </el-form-item>
- </el-col>
-<!-- <el-col :span="12">-->
-<!-- <el-form-item label="搴撳瓨棰勮鏁伴噺锛�" prop="warnNum">-->
-<!-- <el-input v-model="form.warnNum" placeholder="璇疯緭鍏ユ渶浣庡簱瀛�" clearable />-->
-<!-- </el-form-item>-->
-<!-- </el-col>-->
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
- <el-button @click="closeDia">鍙栨秷</el-button>
+ <el-tabs v-model="activeTab" @tab-change="handleTabChange">
+ <!-- <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>
+ </div>
</div>
- </template>
- </el-dialog>
+ <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="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>
+ <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);">缂栬緫</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">
+ <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 />
+ <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="浜у搧鍥剧墖" 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">
+ <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-tabs>
+
+ <!-- 鎴愬搧搴撳瓨寮规 -->
+ <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" />
+
+ <!-- 鏉愭枡搴撳瓨寮规 -->
+ <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>
@@ -155,16 +204,22 @@
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,
+ getStockManagePageByCustom,
delStockManage,
} from "@/api/inventoryManagement/stockManage.js";
import {
- updateManagement,updateStockIn
+ updateManagement, updateManagementByCustom, updateStockIn
} from "@/api/inventoryManagement/stockIn.js";
+const javaApiUrl = __BASE_API__;
-
+// 瀵煎叆涓変釜鐙珛鐨勫脊妗嗙粍浠�
+import FormDiaProduction from './components/FormDiaProduction.vue'
+import FormDiaPurchase from './components/FormDiaPurchase.vue'
+import FormDiaManual from './components/FormDiaManual.vue'
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
@@ -185,15 +240,22 @@
const loading = ref(false);
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref('')
-const dialogFormVisible = ref(false)
+const activeTab = ref('purchase')
+
+// 涓変釜鐙珛鐨勫脊妗嗘樉绀虹姸鎬�
+const productionDialogVisible = ref(false)
+const purchaseDialogVisible = ref(false)
+const manualDialogVisible = ref(false)
+
const data = reactive({
searchForm: {
- supplierName: '',
- timeStr: '',
+ // supplierName: '',
+ productCategory: '',
+ customerName: '',
},
form: {
supplierId: null,
- supplierName: '',
+ // supplierName: '',
productId: null,
productName: '',
userId: userStore.userId,
@@ -202,6 +264,7 @@
model: '',
unit: '',
productrecordId: null,
+ unitPrice: '', // 娣诲姞鎴愬搧搴撳瓨鐨勫崟浠峰瓧娈�
taxInclusiveUnitPrice: '',
taxInclusiveTotalPrice: '',
taxRate: '',
@@ -210,15 +273,16 @@
inboundBatch: '',
stockQuantity: '',
boundTime: '',
- warnNum: '', // 鏂板鏈�浣庡簱瀛樺瓧娈�
+ warnNum: '', // 鏂板鏈�浣庡簱瀛樺瓧娈�
salesLedgerProductId: null,
},
rules: {
- supplierName: [{ required: true, message: '璇疯緭鍏ヤ緵搴斿晢鍚嶇О', trigger: 'blur' }],
+ // supplierName: [{ required: true, message: '璇疯緭鍏ヤ緵搴斿晢鍚嶇О', trigger: 'blur' }],
productCategory: [{ required: true, message: '璇烽�夋嫨浜у搧澶х被', trigger: 'change' }],
specificationModel: [{ required: true, message: '璇疯緭鍏ヨ鏍煎瀷鍙�', trigger: 'blur' }],
unit: [{ required: true, message: '璇疯緭鍏ュ崟浣�', trigger: 'blur' }],
stockQuantity: [{ required: true, message: '璇疯緭鍏ュ嚭搴撴暟閲�', trigger: 'blur' }],
+ unitPrice: [{ required: true, message: '璇疯緭鍏ュ崟浠�', trigger: 'blur' }], // 娣诲姞鎴愬搧搴撳瓨鍗曚环鐨勯獙璇佽鍒�
taxInclusiveUnitPrice: [{ required: true, message: '璇疯緭鍏ュ惈绋庡崟浠�', trigger: 'blur' }],
taxInclusiveTotalPrice: [{ required: true, message: '璇疯緭鍏ュ惈绋庢�讳环', trigger: 'blur' }],
taxRate: [{ required: true, message: '璇疯緭鍏ョ◣鐜�', trigger: 'blur' }],
@@ -226,7 +290,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)
@@ -242,17 +306,75 @@
page.size = obj.limit;
getList()
}
+const buildQueryParams = () => {
+ const params = {
+ ...page,
+ }
+ params.productCategory = searchForm.value.productCategory
+ if (activeTab.value === 'production') {
+ params.customerName = searchForm.value.customerName
+ } else {
+ // params.supplierName = searchForm.value.supplierName
+ }
+ return params
+}
+
const getList = () => {
tableLoading.value = true
- getStockManagePage({ ...searchForm.value, ...page }).then(res => {
+ const params = buildQueryParams()
+ let apiCall
+ if (activeTab.value === 'production') {
+ apiCall = getStockManagePageByProduction(params)
+ } else if (activeTab.value === 'manual') {
+ apiCall = getStockManagePageByCustom(params)
+ } else {
+ apiCall = getStockManagePage(params)
+ }
+ 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') {
+ // 鎴愬搧搴撳瓨锛氭�讳环 = 鍗曚环 脳 鍓╀綑搴撳瓨
+ const unitPrice = parseFloat(item.unitPrice) || 0
+ item.totalPrice = (unitPrice * remainingStock).toFixed(2)
+ } else if (activeTab.value === 'purchase') {
+ // 鍘熸枡搴撳瓨锛氬惈绋庢�讳环 = 鍚◣鍗曚环 脳 鍓╀綑搴撳瓨
+ const taxInclusiveUnitPrice = parseFloat(item.taxInclusiveUnitPrice) || 0
+ item.taxInclusiveTotalPrice = (taxInclusiveUnitPrice * remainingStock).toFixed(2)
+ } else if (activeTab.value === 'manual') {
+ // 鏉愭枡搴撳瓨锛氬惈绋庢�讳环 = 鍚◣鍗曚环 脳 鍓╀綑搴撳瓨
+ const taxInclusiveUnitPrice = parseFloat(item.taxInclusiveUnitPrice) || 0
+ item.taxInclusiveTotalPrice = (taxInclusiveUnitPrice * remainingStock).toFixed(2)
+ }
+
+ return item
+ })
+
total.value = res.data.total
// 鏁版嵁鍔犺浇瀹屾垚鍚庢鏌ュ簱瀛�
// checkStockAndCreatePurchase();
}).catch(() => {
tableLoading.value = false
})
+}
+
+// 鍒囨崲 tab
+const handleTabChange = () => {
+ page.current = 1
+ // searchForm.value.supplierName = ''
+ searchForm.value.customerName = ''
+ selectedRows.value = []
+ searchForm.value.productCategory = ''
+ getList()
}
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -288,9 +410,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;
@@ -300,23 +422,63 @@
})
}
form.value.entryDate = getCurrentDate() // 璁剧疆榛樿褰曞叆鏃ユ湡涓哄綋鍓嶆棩鏈�
- dialogFormVisible.value = true
+
+ // 鏍规嵁褰撳墠鏍囩椤垫樉绀哄搴旂殑寮规
+ if (activeTab.value === 'production') {
+ productionDialogVisible.value = true
+ } else if (activeTab.value === 'purchase') {
+ purchaseDialogVisible.value = true
+ } else if (activeTab.value === 'manual') {
+ manualDialogVisible.value = true
+ }
}
// 鎻愪氦琛ㄥ崟
-const submitForm = () => {
- console.log(form.value)
- proxy.$refs["formRef"].validate(valid => {
- if (valid) {
+const submitForm = (submittedData) => {
+ console.log('瀛愮粍浠舵彁浜ょ殑鏁版嵁:', submittedData)
- updateManagement(form.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
- closeDia()
- getList()
- // 鎻愪氦鍚庢鏌ュ簱瀛樺苟灏濊瘯鍒涘缓璇疯喘鍗�
- // checkStockAndCreatePurchase();
- })
- }
+ // 浣跨敤瀛愮粍浠舵彁浜ょ殑鏁版嵁锛岃�屼笉鏄埗缁勪欢鐨刦orm瀵硅薄
+ const submitData = { ...submittedData }
+
+ // 鏍规嵁褰撳墠鏍囩椤电Щ闄ゅ搴旂殑鎬讳环瀛楁
+ if (activeTab.value === 'production') {
+ // 鎴愬搧搴撳瓨锛氱Щ闄ゆ�讳环瀛楁
+ delete submitData.totalPrice
+ } else if (activeTab.value === 'purchase') {
+ // 鍘熸枡搴撳瓨锛氱Щ闄ゅ惈绋庢�讳环瀛楁
+ delete submitData.taxInclusiveTotalPrice
+ } else if (activeTab.value === 'manual') {
+ // 鏉愭枡搴撳瓨锛氱Щ闄ゅ惈绋庢�讳环瀛楁
+ delete submitData.taxInclusiveTotalPrice
+ }
+
+ // 绉婚櫎鍏朵粬鍙兘鐨勬�讳环瀛楁
+ delete submitData.taxExclusiveTotalPrice
+
+ console.log('鎻愪氦缁欏悗绔殑鏁版嵁锛堝凡绉婚櫎鎬讳环瀛楁锛�:', submitData)
+ submitData.inboundNum = parseFloat(submitData.inboundNum) || 0
+ // 鏍规嵁褰撳墠鏍囩椤佃皟鐢ㄤ笉鍚岀殑鎻愪氦鎺ュ彛
+ let apiCall
+ if (activeTab.value === 'production') {
+ // 鎴愬搧搴撳瓨浣跨敤 updateManagement 鎺ュ彛
+ apiCall = updateManagement(submitData)
+ } else if (activeTab.value === 'manual') {
+ // 鏉愭枡搴撳瓨浣跨敤 updateManagementByCustom 鎺ュ彛
+ apiCall = updateManagementByCustom(submitData)
+ } else {
+ // 鍘熸枡搴撳瓨浣跨敤 updateManagementByCustom 鎺ュ彛
+ apiCall = updateManagementByCustom(submitData)
+ }
+
+ apiCall.then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
+ closeDia()
+ getList()
+ // 鎻愪氦鍚庢鏌ュ簱瀛樺苟灏濊瘯鍒涘缓璇疯喘鍗�
+ // checkStockAndCreatePurchase();
+ }).catch(error => {
+ console.error('鎻愪氦澶辫触:', error)
+ proxy.$modal.msgError("鎻愪氦澶辫触锛岃閲嶈瘯")
})
}
// 妫�鏌ュ簱瀛樺苟鍒涘缓璇疯喘鍗�
@@ -344,7 +506,9 @@
// 鍏抽棴寮规
const closeDia = () => {
proxy.resetForm("formRef")
- dialogFormVisible.value = false
+ productionDialogVisible.value = false
+ purchaseDialogVisible.value = false
+ manualDialogVisible.value = false
}
// 瀵煎嚭
@@ -357,7 +521,15 @@
type: 'warning',
}
).then(() => {
- proxy.download("/stockin/exportCopy", {}, '搴撳瓨淇℃伅.xlsx')
+ const exportParams = buildQueryParams()
+ // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+ let exportUrl = "/stockin/exportCopy"
+ if (activeTab.value === 'production') {
+ exportUrl = "/stockin/exportCopyOne"
+ } else if (activeTab.value === 'manual') {
+ exportUrl = "/stockin/exportCopyTwo"
+ }
+ proxy.download(exportUrl, exportParams, '搴撳瓨淇℃伅.xlsx')
}).catch(() => {
proxy.$modal.msg("宸插彇娑�")
})
@@ -366,12 +538,6 @@
const handleDelete = () => {
let ids = []
if (selectedRows.value.length > 0) {
- // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
- const unauthorizedData = selectedRows.value.filter(item => item.createUser !== userStore.id);
- if (unauthorizedData.length > 0) {
- proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
- return;
- }
ids = selectedRows.value.map(item => item.id);
} else {
proxy.$modal.msgWarning('璇烽�夋嫨鏁版嵁')
@@ -385,7 +551,7 @@
type: 'warning',
}
).then(() => {
- delStockManage({ids:ids}).then(res => {
+ delStockManage({ ids: ids }).then(res => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
getList()
})
@@ -401,16 +567,54 @@
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(() => {
+ // // 缁勪欢鍗歌浇鏃舵竻闄ゅ畾鏃跺櫒
+ // clearInterval(intervalId);
+ // });
+})
+onUnmounted(() => {
+ // 绉婚櫎閿洏鐩戝惉浜嬩欢
+ document.removeEventListener('keypress', scanBarcode)
+ console.log('缁勪欢鍗歌浇')
})
</script>
@@ -423,4 +627,17 @@
:deep(.row-low-stock:hover > td) {
background-color: #fcd4d4;
}
-</style>
+
+.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 f752496..050c7b6 100644
--- a/src/views/personnelManagement/contractManagement/filesDia.vue
+++ b/src/views/personnelManagement/contractManagement/filesDia.vue
@@ -28,6 +28,7 @@
:tableData="tableData"
:tableLoading="tableLoading"
:isSelection="true"
+ :isShowPage="false"
@selection-change="handleSelectionChange"
height="500"
>
diff --git a/src/views/procurementManagement/paymentEntry/index.vue b/src/views/procurementManagement/paymentEntry/index.vue
index 658b027..4da6ac9 100644
--- a/src/views/procurementManagement/paymentEntry/index.vue
+++ b/src/views/procurementManagement/paymentEntry/index.vue
@@ -104,6 +104,7 @@
size="small"
@click="changeEditType(scope.row)"
v-if="!scope.row.editType"
+ :disabled="scope.row.registrant !== userStore.nickName"
>缂栬緫</el-button
>
<el-button
@@ -112,6 +113,7 @@
size="small"
@click="saveReceiptPayment(scope.row)"
v-if="scope.row.editType"
+ :disabled="scope.row.registrant !== userStore.nickName"
>淇濆瓨</el-button
>
<el-button
@@ -119,6 +121,7 @@
type="primary"
size="small"
@click="handleDelete(scope.row)"
+ :disabled="scope.row.registrant !== userStore.nickName"
>鍒犻櫎</el-button
>
</template>
diff --git a/src/views/procurementManagement/paymentLedger/index.vue b/src/views/procurementManagement/paymentLedger/index.vue
index 741e6ac..14bcaf4 100644
--- a/src/views/procurementManagement/paymentLedger/index.vue
+++ b/src/views/procurementManagement/paymentLedger/index.vue
@@ -86,7 +86,8 @@
:tableLoading="tableLoadingSon"
:isShowSummary="isShowSummarySon"
:summaryMethod="summarizeMainTable1"
- height="calc(100vh - 18.5em)"
+ :isShowPage="false"
+ height="calc(100vh - 18.5em)"
>
<template #payableAmountSlot="{ row }">
<el-text type="danger">
@@ -94,14 +95,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>
@@ -245,8 +246,6 @@
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 f939be4..6290804 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 disabled 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,34 +51,43 @@
const { proxy } = getCurrentInstance()
defineOptions({
- name: "鏉ョエ鍙拌处琛ㄥ崟",
+ name: "鏉ョエ鍙拌处琛ㄥ崟",
});
-const temFutureTickets = ref(0)
+const temFutureTickets = ref(0) // 鍒濆鏈潵绁ㄦ暟
+const initialTicketsNum = ref(0) // 鍒濆鏉ョエ鏁�
+const initialTicketsAmount = ref(0) // 鍒濆鏉ョエ閲戦
+const quantity = 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.toFixed(2);
- form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice;
- form.futureTickets = data.futureTickets;
- temFutureTickets.value = data.futureTickets;
- }
+ 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;
+ form.ticketRegistrationId = data.ticketRegistrationId;
+ // 鑾峰彇鎬绘暟閲忥紝濡傛灉鏁版嵁涓湁 quantity 瀛楁鍒欎娇鐢紝鍚﹀垯浣跨敤鏉ョエ鏁�+鏈潵绁ㄦ暟
+ quantity.value = data.quantity || (Number(data.ticketsNum || 0) + Number(data.futureTickets || 0));
+ }
};
const inputTicketsNum = (val) => {
@@ -87,15 +96,44 @@
proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
return;
}
- if (Number(form.ticketsNum) > Number(temFutureTickets.value)) {
- proxy.$modal.msgWarning("寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
- form.ticketsNum = temFutureTickets.value
+
+ 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);
}
// 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
- const ticketsAmount = Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice);
- const futureTickets = Number(temFutureTickets.value) - Number(form.ticketsNum);
- form.futureTickets = Number(futureTickets.toFixed(2));
+ 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));
form.ticketsAmount = Number(ticketsAmount.toFixed(2));
};
const inputTicketsAmount = (val) => {
@@ -105,23 +143,53 @@
return;
}
- 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))
+ 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;
return;
}
// 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
- const ticketsNum = Number(val) / Number(form.taxInclusiveUnitPrice);
- form.ticketsNum = Number(ticketsNum.toFixed(2));
+ 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));
};
defineExpose({
- load,
- form,
- resetForm,
+ load,
+ form,
+ resetForm,
});
</script>
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index b33e3e4..439837b 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -82,12 +82,14 @@
type="primary"
text
@click="openEdit(row)"
+ :disabled="row.issUerId !== userStore.id"
>
缂栬緫
</el-button>
<el-button
type="primary"
text
+ :disabled="row.issUerId !== userStore.id"
@click="handleDelete(row)"
>
鍒犻櫎
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 571e7ab..fff44de 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -39,7 +39,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>
@@ -146,7 +146,7 @@
<el-table-column
fixed="right"
label="鎿嶄綔"
- min-width="150"
+ min-width="100"
align="center"
>
<template #default="scope">
@@ -155,15 +155,16 @@
type="primary"
size="small"
@click="openForm('edit', scope.row)"
+ :disabled="scope.row.receiptPaymentAmount>0 || scope.row.recorderName !== userStore.nickName"
>缂栬緫</el-button
>
- <el-button
- link
- type="success"
- size="small"
- @click="showQRCode(scope.row)"
- >鐢熸垚浜岀淮鐮�</el-button
- >
+<!-- <el-button-->
+<!-- link-->
+<!-- type="success"-->
+<!-- size="small"-->
+<!-- @click="showQRCode(scope.row)"-->
+<!-- >鐢熸垚浜岀淮鐮�</el-button-->
+<!-- >-->
</template>
</el-table-column>
@@ -225,8 +226,6 @@
v-model="form.supplierId"
placeholder="璇烽�夋嫨"
clearable
- filterable
- allow-create
>
<el-option
v-for="item in supplierList"
@@ -1155,6 +1154,7 @@
const getModels = (value) => {
if (value) {
productForm.value.productCategory = findNodeById(productOptions.value, value) || "";
+ productForm.value.productId = value;
modelList({ id: value }).then((res) => {
modelOptions.value = res;
});
diff --git a/src/views/productionManagement/productionCosting/index.vue b/src/views/productionManagement/productionCosting/index.vue
index 76e7414..71e4a12 100644
--- a/src/views/productionManagement/productionCosting/index.vue
+++ b/src/views/productionManagement/productionCosting/index.vue
@@ -171,7 +171,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/basic/customer/export", {}, "鐢熶骇鏍哥畻.xlsx");
+ proxy.download("/salesLedger/productionAccounting/export", {}, "鐢熶骇鏍哥畻.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 9928d46..f35670a 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -78,7 +78,7 @@
width:300
},
{
- label: "浠樻鐘舵��",
+ label: "鐢熶骇鐘舵��",
prop: "status",
dataType: "tag",
formatType: (params) => {
diff --git a/src/views/productionManagement/productionReporting/components/formDia.vue b/src/views/productionManagement/productionReporting/components/formDia.vue
index 89f6c76..3986865 100644
--- a/src/views/productionManagement/productionReporting/components/formDia.vue
+++ b/src/views/productionManagement/productionReporting/components/formDia.vue
@@ -31,7 +31,7 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="寰呯敓浜ф暟閲忥細" prop="pendingNum">
- <el-input v-model="form.pendingNum" placeholder="璇疯緭鍏�" clearable disabled/>
+ <el-input :value="form.pendingNum !== undefined && form.pendingNum !== null ? Number(form.pendingNum).toFixed(2) : ''" placeholder="璇疯緭鍏�" clearable disabled/>
</el-form-item>
</el-col>
</el-row>
@@ -88,6 +88,7 @@
const userList = ref([])
const dialogFormVisible = ref(false);
const operationType = ref('')
+const pendingFinishNum = ref(0) // 澶栭儴浼犲叆鐨勫緟鐢熶骇鏁伴噺锛堝墿浣欏彲鎶ュ伐鏁伴噺锛�
const data = reactive({
form: {
successNum: "",
@@ -110,14 +111,21 @@
userList.value = res.data;
});
form.value = {...row}
+ pendingFinishNum.value = Number(row?.pendingFinishNum || 0)
+ // 灏嗗緟鐢熶骇鏁伴噺甯﹀叆琛ㄥ崟锛屾柟渚垮睍绀轰笌鏍¢獙锛屼繚鐣欎袱浣嶅皬鏁�
+ form.value.pendingNum = Number(pendingFinishNum.value.toFixed(2))
}
const changeNum = (value) => {
- if (value > form.value.schedulingNum) {
- form.value.finishedNum = form.value.schedulingNum;
- proxy.$modal.msgWarning('鏈鐢熶骇鏁伴噺涓嶅彲澶т簬鎺掍骇鏁伴噺')
+ const maxPending = Number(pendingFinishNum.value) || 0
+ // 涓婇檺锛氫笉鑳借秴杩囧緟鐢熶骇鏁伴噺
+ if (Number(value) > maxPending) {
+ form.value.finishedNum = Number(maxPending.toFixed(2));
+ proxy.$modal.msgWarning('鏈鐢熶骇鏁伴噺涓嶅彲澶т簬寰呯敓浜ф暟閲�')
}
- form.value.pendingNum = form.value.schedulingNum - form.value.finishedNum;
+ // 閲嶆柊璁$畻鍓╀綑寰呯敓浜ф暟閲忥紝淇濈暀涓や綅灏忔暟
+ const finishedNum = Number(form.value.finishedNum) || 0
+ form.value.pendingNum = Number((maxPending - finishedNum).toFixed(2));
}
// 鎻愪氦浜у搧琛ㄥ崟
const submitForm = () => {
diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index 996a00b..42a0c4f 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -112,6 +112,7 @@
size="small"
@click="changeEditType(scope.row)"
v-if="!scope.row.editType"
+ :disabled="scope.row.parentStatus === 3"
>缂栬緫</el-button
>
<el-button
diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index 8352dc6..cfea002 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 HH:mm:ss"
+ <el-date-picker style="width: 100%" v-model="searchForm.createTimeStart" value-format="YYYY-MM-DD"
format="YYYY-MM-DD" type="date" placeholder="璇烽�夋嫨" clearable @change="handleQuery" />
</el-form-item>
<el-form-item label="涓嶆樉绀烘湁鍙戠エ琛�">
@@ -49,15 +49,15 @@
@click="handleFile(scope.row.commonFiles)">
鏌ョ湅闄勪欢
</el-button>
- <el-button v-else link type="primary" @click="handleDownload(scope.row)">
+ <el-button v-else link type="primary" @click="handleDownload(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">
涓婁紶
</el-button>
</template>
</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)">缂栬緫</el-button>
- <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row)">鍒犻櫎</el-button>
+ <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>
</template>
</el-table-column>
</el-table>
@@ -229,7 +229,7 @@
return parseFloat(cellValue).toFixed(2);
};
const formatDate = (row, column, cellValue) => {
- return dayjs(cellValue).format("YYYY-MM-DD HH:mm:ss");
+ return dayjs(cellValue).format("YYYY-MM-DD");
};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
diff --git a/src/views/salesManagement/receiptPayment/index.vue b/src/views/salesManagement/receiptPayment/index.vue
index 26f089b..995bd24 100644
--- a/src/views/salesManagement/receiptPayment/index.vue
+++ b/src/views/salesManagement/receiptPayment/index.vue
@@ -122,6 +122,7 @@
size="small"
@click="changeEditType(scope.row)"
v-if="!scope.row.editType"
+ :disabled="scope.row.registrant !== userStore.nickName"
>缂栬緫</el-button
>
<el-button
@@ -130,6 +131,7 @@
size="small"
@click="saveReceiptPayment(scope.row)"
v-if="scope.row.editType"
+ :disabled="scope.row.registrant !== userStore.nickName"
>淇濆瓨</el-button
>
<el-button
@@ -137,6 +139,7 @@
type="primary"
size="small"
@click="delReceiptRecord(scope.row)"
+ :disabled="scope.row.registrant !== userStore.nickName"
>鍒犻櫎</el-button
>
</template>
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 94af430..cfdf052 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -47,14 +47,18 @@
<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" />
- <el-table-column label="鍗曚綅" prop="unit" />
- <el-table-column label="鏁伴噺" prop="quantity" />
+ <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="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="taxInclusiveTotalPrice" :formatter="formattedNumber" />
+ <el-table-column label="涓嶅惈绋庢�讳环(缇庡厓)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
</el-table>
</template>
</el-table-column>
@@ -72,7 +76,7 @@
<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" @click="openForm('edit', scope.row)">缂栬緫</el-button>
+ <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('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>
@@ -163,14 +167,18 @@
: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" />
- <el-table-column label="鍗曚綅" prop="unit" />
+ <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="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>
@@ -214,7 +222,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> -->
@@ -225,7 +233,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>
@@ -234,7 +242,7 @@
</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>
@@ -250,7 +258,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" />
@@ -258,20 +266,19 @@
</el-col>
<el-col :span="12">
<el-form-item label="鏁伴噺锛�" prop="quantity">
- <el-input-number :step="0.1" :min="0" v-model="productForm.quantity" placeholder="璇疯緭鍏�" clearable
- :precision="2"
+ <el-input-number :min="0" v-model="productForm.quantity" placeholder="璇疯緭鍏�" clearable
@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>
@@ -317,7 +324,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>
@@ -459,7 +466,7 @@
import pagination from "@/components/PIMTable/Pagination.vue";
import {onMounted, ref} from "vue";
import { addShippingInfo } from "@/api/salesManagement/deliveryLedger.js";
-import {ElMessage, ElMessageBox} from "element-plus";
+import { ElMessageBox } from "element-plus";
import useUserStore from "@/store/modules/user";
import { userListNoPage } from "@/api/system/user.js";
import FileList from "./fileList.vue";
@@ -472,7 +479,7 @@
delLedger,
addOrUpdateSalesLedgerProduct,
delProduct,
- delLedgerFile, getProductInventory,
+ delLedgerFile,
} from "@/api/salesManagement/salesLedger.js";
import { modelList, productTreeList } from "@/api/basicData/product.js";
import useFormData from "@/hooks/useFormData.js";
@@ -551,6 +558,7 @@
taxInclusiveTotalPrice: "",
taxExclusiveTotalPrice: "",
invoiceType: "",
+ cartonSpecifications:'',
},
productRules: {
productCategory: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -563,6 +571,7 @@
taxInclusiveUnitPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
+ cartonSpecifications: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
taxInclusiveTotalPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
@@ -644,7 +653,7 @@
tableLoading.value = false;
});
};
-// 鑾峰彇浜у搧澶х被tree鏁版嵁
+// 鑾峰彇浜у搧鍚嶇Оtree鏁版嵁
const getProductOptions = () => {
productTreeList().then((res) => {
productOptions.value = convertIdToValue(res);
@@ -656,6 +665,7 @@
// 鑾峰彇tree瀛愭暟鎹�
const getModels = (value) => {
productForm.value.productCategory = findNodeById(productOptions.value, value);
+ productForm.value.productId = value;
modelList({ id: value }).then((res) => {
modelOptions.value = res;
});
@@ -868,6 +878,7 @@
}else{
productData.value[productIndex.value] = { ...productForm.value }
}
+ console.log('productData',productData)
closeProductDia();
}
}
@@ -1166,7 +1177,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>
@@ -1393,10 +1404,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);
@@ -1422,10 +1433,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);
@@ -1454,10 +1465,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);
@@ -1486,10 +1497,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);
@@ -1524,16 +1535,12 @@
// 鎵撳紑鍙戣揣寮规
const openDeliveryForm = (row) => {
- getProductInventory({ salesLedgerId: row.id, type:1 }).then((res) => {
- currentDeliveryRow.value = row;
- deliveryForm.value = {
- shippingDate: getCurrentDate(),
- shippingCarNumber: "",
- };
- deliveryFormVisible.value = true;
- }).catch(err => {
- ElMessage.error(err.msg);
- });
+ currentDeliveryRow.value = row;
+ deliveryForm.value = {
+ shippingDate: getCurrentDate(),
+ shippingCarNumber: "",
+ };
+ deliveryFormVisible.value = true;
};
// 鎻愪氦鍙戣揣琛ㄥ崟
--
Gitblit v1.9.3