| | |
| | | "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": "宣屹ç¯ä¿ä¿¡æ¯ç®¡çç³»ç»", |
| | | "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", |
| | |
| | | "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", |
| | |
| | | }); |
| | | }; |
| | | |
| | | // æ¥è¯¢ç产å
¥åºä¿¡æ¯å表 |
| | | 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({ |
| | |
| | | data, |
| | | }); |
| | | }; |
| | | // ä¿®æ¹ææåºåä¿¡æ¯ |
| | | export const updateManagementByCustom = (data) => { |
| | | return request({ |
| | | url: "/stockin/updateManagementByCustom ", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }; |
| | | |
| | | // æ°å¢ååå
¥åºä¿¡æ¯ |
| | | export function addSutockIn(data) { |
| | |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢èªå®ä¹å
¥åºä¿¡æ¯ |
| | | 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 |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | // èªå®ä¹å
¥åº-详æ
|
| | | 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 |
| | | }) |
| | | } |
| | | |
| | | |
| | | // |
| | | |
| | |
| | | }); |
| | | }; |
| | | |
| | | // æ¥è¯¢ç产å
¥åºåºåä¿¡æ¯å表 |
| | | 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) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | //åºåºæ¥å£ |
| | | // åºåºç®¡ç-é¢ç¨æ¥å£ |
| | | export const stockOut = (data) => { |
| | | return request({ |
| | | url: '/stockmanagement/stockout', |
| | |
| | | params: query, |
| | | }); |
| | | } |
| | | // éå®å°è´¦é¡µé¢åè´§ï¼æ¥è¯¢åºåæ¯å¦å
è¶³ |
| | | export function getProductInventory(query) { |
| | | return request({ |
| | | url: "/sales/ledger/getProductInventory", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-if="isShowPage" |
| | | :total="page.total" |
| | | :layout="page.layout" |
| | | :page="page.current" |
| | |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | isShowPage: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | isShowSummary: { |
| | | type: Boolean, |
| | | default: false, |
| | |
| | | }); |
| | | |
| | | const props = defineProps({ |
| | | downloadTemplate: Function, |
| | | // downloadTemplate: Function, |
| | | showTips: Boolean, |
| | | accept: { |
| | | type: String, |
| | |
| | | default: 1, |
| | | }, |
| | | }); |
| | | const emits = defineEmits(["success", "remove"]); |
| | | const emits = defineEmits(["success", "remove", "downloadTemplate"]); |
| | | |
| | | const uploadRef = ref(); |
| | | const fileList = ref([]); |
| | |
| | | type="primary" |
| | | link |
| | | class="reset-margin" |
| | | @click="props.downloadTemplate()" |
| | | @click="emits('downloadTemplate')" |
| | | > |
| | | <span style="font-size: 12px; font-weight: normal">ä¸è½½æ¨¡æ¿</span> |
| | | </el-button> |
| | |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.maintainer !== userStore.nickName |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | <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"> |
| | |
| | | </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: "产åç»´æ¤å¯¼å
¥", |
| | | }); |
| | |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // ä¸ä¼ çå°å |
| | | url: import.meta.env.VITE_APP_BASE_API + "/system/supplier/import", |
| | | updateSupport: true, |
| | | }); |
| | | // ç¹å»å¯¼å
¥ |
| | | const handleImport = () => { |
| | |
| | | upload.title = "产å导å
¥"; |
| | | }; |
| | | |
| | | // ä¸è½½æ¨¡æ¿ |
| | | const downloadTemplate = () =>{ |
| | | proxy.download("/basic/product/downloadTemplate", {}, "产å导å
¥æ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | const submitFileForm = () => { |
| | | fileUploadRef.value.uploadApi(); |
| | | }; |
| | |
| | | <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 |
| | |
| | | </el-dialog> |
| | | <el-dialog |
| | | v-model="modelDia" |
| | | title="è§æ ¼åå·" |
| | | title="产åé«åº¦" |
| | | width="400px" |
| | | @close="closeModelDia" |
| | | @keydown.enter.prevent |
| | |
| | | > |
| | | <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 |
| | | /> |
| | |
| | | </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 |
| | | /> |
| | |
| | | const expandedKeys = ref([]); |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "è§æ ¼åå·", |
| | | label: "产åé«åº¦", |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | label: "é«åº¦åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | |
| | | form.value.productName = data.productName; |
| | | } |
| | | }; |
| | | // æå¼è§æ ¼åå·å¼¹æ¡ |
| | | // æå¼äº§åé«åº¦å¼¹æ¡ |
| | | const openModelDia = (type, data) => { |
| | | modelOperationType.value = type; |
| | | modelDia.value = true; |
| | |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.maintainUserName !== userStore.nickName |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | color: #606266; |
| | | line-height: 1.6; |
| | | font-size: 14px; |
| | | word-wrap: break-word; |
| | | } |
| | | |
| | | .card-footer { |
| | |
| | | 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; |
| | |
| | | clickFun: (row) => { |
| | | publishNotification(row); |
| | | }, |
| | | // disabled: (row) => row.status === "published" |
| | | }, |
| | | { |
| | | name: "æ¤å", |
| | |
| | | clickFun: (row) => { |
| | | revokeNotification(row); |
| | | }, |
| | | // disabled: (row) => row.status !== "published" |
| | | } |
| | | ] |
| | | } |
| | |
| | | openForm("edit", row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.status !== 1 |
| | | return row.checkUserId !== userStore.id || row.status !== 1 |
| | | } |
| | | }, |
| | | ], |
| | |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openCalibrationDia("edit", row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.userId !== userStore.id |
| | | } |
| | | }, |
| | | ], |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | formatter: function (params) { |
| | | // å¨æçææç¤ºä¿¡æ¯ï¼åºäºæ°æ®é¡¹ç name 屿§ |
| | | const description = params.name === 'æ¬æåæ¬¾éé¢' ? 'æ¬æåæ¬¾éé¢' : 'åºæ¶æ¬¾éé¢'; |
| | | return `${description} ${formatNumber(params.value)}å
${params.percent}%`; |
| | | return `${description} ${formattedNumber(params.value)}å
${params.percent}%`; |
| | | }, |
| | | position: 'right' |
| | | }) |
| | |
| | | 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) => { |
| | |
| | | xAxis2.value[0].data = monthName.map(item => item.replace(/~/g, '\n~')); |
| | | lineSeries.value = [ |
| | | { |
| | | name: 'å¼ç¥¨', |
| | | name: '忬¾', |
| | | type: 'line', |
| | | data: receiptAmount, |
| | | stack: 'Total', |
| | |
| | | showSymbol: true, |
| | | }, |
| | | { |
| | | name: '忬¾', |
| | | name: 'å¼ç¥¨', |
| | | type: 'line', |
| | | data: invoiceAmount, |
| | | stack: 'Total', |
| | |
| | | color: #FFFFFF; |
| | | } |
| | | .data-value { |
| | | max-width: 100px; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | font-size: 18px; |
| | | font-weight: 500; |
| | | margin: 10px 0; |
| | |
| | | <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 |
| | |
| | | <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> |
| | | |
| | |
| | | <div> |
| | | |
| | | <span class="label">客æ·åç§°ï¼</span> |
| | | <span class="value">{{ item.supplierName || 'å¼ ç±æ' }}</span> |
| | | <span class="value">{{ item.supplierName }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="info-row"> |
| | |
| | | <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> |
| | |
| | | |
| | | <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({ |
| | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | supplierName: "", |
| | | timeStr: "", |
| | | customerName: "", |
| | | productCategory:'', |
| | | timeStr: getCurrentDate(), |
| | | }, |
| | | form: { |
| | | supplierId: null, |
| | |
| | | }; |
| | | 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() |
| | | }; |
| | | |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | |
| | | 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("已忶"); |
| | |
| | | <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> |
| | | |
| | |
| | | </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"> |
| | |
| | | page-break-after: avoid; |
| | | } |
| | | } |
| | | .barcode-img{ |
| | | width: 80px; |
| | | height: 80px; |
| | | border-radius: 5px; |
| | | background-color: #F5F5F5; |
| | | } |
| | | </style> |
| | | |
| | | |
| | |
| | | <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> |
| | |
| | | |
| | | <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() |
| | |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | 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: '', |
| | |
| | | } |
| | | 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) => { |
| | |
| | | // åå§åè¡¨åæ°æ® |
| | | form.value = { |
| | | productrecordId: '', |
| | | inboundQuantity: '', // åºåºæ°éæ¸
空 |
| | | inboundQuantity: 0, // åºåºæ°éæ¸
空 |
| | | inboundTime: getCurrentDate(), // é»è®¤å½åæ¥æ |
| | | nickName: '', // é»è®¤å½åç¨æ· |
| | | } |
| | |
| | | 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) |
| | | |
| | |
| | | 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("已忶") |
| | | }) |
| | |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| | | <style scoped lang="scss"> |
| | | .barcode-img{ |
| | | width: 80px; |
| | | height: 80px; |
| | | border-radius: 5px; |
| | | background-color: #F5F5F5; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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, // ä¾åºåID |
| | | supplierName: '', // ä¾åºååç§° |
| | | inboundTime: '', // å
¥åºæ¶é´ |
| | | inboundBatch: '', // å
¥åºæ¹æ¬¡ |
| | | recorderId: userStore.userId, // å½å
¥äººID |
| | | 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> |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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, // ä¾åºåID |
| | | supplierName: '', // ä¾åºååç§° |
| | | recorderId: userStore.userId, // å½å
¥äººID |
| | | 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) => { |
| | | // è®¡ç®æ®éæ»ä»·ï¼quantityStock * 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> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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, // ä¾åºåID |
| | | supplierName: '', // ä¾åºååç§° |
| | | recorderId: userStore.userId, // å½å
¥äººID |
| | | 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) => { |
| | | // è®¡ç®æ®éæ»ä»·ï¼inboundNum * 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> |
| | | |
| | |
| | | <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> |
| | |
| | | |
| | | <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, |
| | |
| | | }) |
| | | 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, // ä¾åºåID |
| | | supplierName: '', // ä¾åºååç§° |
| | | inboundTime: '', // å
¥åºæ¶é´ |
| | | inboundBatch: '', // å
¥åºæ¹æ¬¡ |
| | | recorderId: userStore.userId, // å½å
¥äººID |
| | | 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 = () => { |
| | |
| | | } |
| | | 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è¿ä¸ªæ¹æ³æ ¹æ®ååæ¥è¯¢å°idï¼åè°ç¨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 æ¯å¯ç¨æ¥å£ï¼ |
| | | 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 ç±»åéæ©ä¸åçå 餿¥å£åtypeåæ° |
| | | let deleteApi, deleteParams |
| | | |
| | | if (activeTab.value === 'production') { |
| | | // æåå é¤ï¼typeä¼ 2 |
| | | deleteApi = delStockIn |
| | | deleteParams = { ids, type: 2 } |
| | | } else if (activeTab.value === 'purchase') { |
| | | // åæå é¤ï¼typeä¼ 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> |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | 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() |
| | |
| | | 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, |
| | |
| | | model: '', |
| | | unit: '', |
| | | productrecordId: null, |
| | | unitPrice: '', // æ·»å æååºåçåä»·åæ®µ |
| | | taxInclusiveUnitPrice: '', |
| | | taxInclusiveTotalPrice: '', |
| | | taxRate: '', |
| | |
| | | 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' }], |
| | |
| | | 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) |
| | |
| | | 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() |
| | | } |
| | | |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | |
| | | 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; |
| | |
| | | }) |
| | | } |
| | | 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(); |
| | | }) |
| | | } |
| | | // 使ç¨åç»ä»¶æäº¤çæ°æ®ï¼è䏿¯ç¶ç»ä»¶çform对象 |
| | | 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("æäº¤å¤±è´¥ï¼è¯·éè¯") |
| | | }) |
| | | } |
| | | // æ£æ¥åºåå¹¶å建请è´å |
| | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | productionDialogVisible.value = false |
| | | purchaseDialogVisible.value = false |
| | | manualDialogVisible.value = false |
| | | } |
| | | |
| | | // å¯¼åº |
| | |
| | | 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("已忶") |
| | | }) |
| | |
| | | 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('è¯·éæ©æ°æ®') |
| | |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | delStockManage({ids:ids}).then(res => { |
| | | delStockManage({ ids: ids }).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | getList() |
| | | }) |
| | |
| | | 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> |
| | | |
| | |
| | | :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> |
| | |
| | | :tableData="tableData" |
| | | :tableLoading="tableLoading" |
| | | :isSelection="true" |
| | | :isShowPage="false" |
| | | @selection-change="handleSelectionChange" |
| | | height="500" |
| | | > |
| | |
| | | size="small" |
| | | @click="changeEditType(scope.row)" |
| | | v-if="!scope.row.editType" |
| | | :disabled="scope.row.registrant !== userStore.nickName" |
| | | >ç¼è¾</el-button |
| | | > |
| | | <el-button |
| | |
| | | size="small" |
| | | @click="saveReceiptPayment(scope.row)" |
| | | v-if="scope.row.editType" |
| | | :disabled="scope.row.registrant !== userStore.nickName" |
| | | >ä¿å</el-button |
| | | > |
| | | <el-button |
| | |
| | | type="primary" |
| | | size="small" |
| | | @click="handleDelete(scope.row)" |
| | | :disabled="scope.row.registrant !== userStore.nickName" |
| | | >å é¤</el-button |
| | | > |
| | | </template> |
| | |
| | | :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"> |
| | |
| | | </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> |
| | |
| | | paymentLedgerList({ |
| | | ...searchForm.value, |
| | | ...page, |
| | | detailPageNum: detailPageNum.value, // æ°å¢ |
| | | detailPageSize: detailPageSize.value, // æ°å¢ |
| | | }).then((res) => { |
| | | let result = res.data; |
| | | tableLoading.value = false; |
| | |
| | | <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> |
| | |
| | | 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) => { |
| | |
| | | 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) => { |
| | |
| | | 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> |
| | | |
| | |
| | | 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)" |
| | | > |
| | | å é¤ |
| | |
| | | <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> |
| | |
| | | <el-table-column |
| | | fixed="right" |
| | | label="æä½" |
| | | min-width="150" |
| | | min-width="100" |
| | | align="center" |
| | | > |
| | | <template #default="scope"> |
| | |
| | | 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> |
| | |
| | | v-model="form.supplierId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | filterable |
| | | allow-create |
| | | > |
| | | <el-option |
| | | v-for="item in supplierList" |
| | |
| | | const getModels = (value) => { |
| | | if (value) { |
| | | productForm.value.productCategory = findNodeById(productOptions.value, value) || ""; |
| | | productForm.value.productId = value; |
| | | modelList({ id: value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/basic/customer/export", {}, "çäº§æ ¸ç®.xlsx"); |
| | | proxy.download("/salesLedger/productionAccounting/export", {}, "çäº§æ ¸ç®.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | |
| | | width:300 |
| | | }, |
| | | { |
| | | label: "仿¬¾ç¶æ", |
| | | label: "çäº§ç¶æ", |
| | | prop: "status", |
| | | dataType: "tag", |
| | | formatType: (params) => { |
| | |
| | | <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> |
| | |
| | | const userList = ref([]) |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref('') |
| | | const pendingFinishNum = ref(0) // å¤é¨ä¼ å
¥çå¾
ç产æ°éï¼å©ä½å¯æ¥å·¥æ°éï¼ |
| | | const data = reactive({ |
| | | form: { |
| | | successNum: "", |
| | |
| | | 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 = () => { |
| | |
| | | size="small" |
| | | @click="changeEditType(scope.row)" |
| | | v-if="!scope.row.editType" |
| | | :disabled="scope.row.parentStatus === 3" |
| | | >ç¼è¾</el-button |
| | | > |
| | | <el-button |
| | |
| | | @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="䏿¾ç¤ºæå票è¡"> |
| | |
| | | @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> |
| | |
| | | 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"); |
| | | }; |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | |
| | | size="small" |
| | | @click="changeEditType(scope.row)" |
| | | v-if="!scope.row.editType" |
| | | :disabled="scope.row.registrant !== userStore.nickName" |
| | | >ç¼è¾</el-button |
| | | > |
| | | <el-button |
| | |
| | | size="small" |
| | | @click="saveReceiptPayment(scope.row)" |
| | | v-if="scope.row.editType" |
| | | :disabled="scope.row.registrant !== userStore.nickName" |
| | | >ä¿å</el-button |
| | | > |
| | | <el-button |
| | |
| | | type="primary" |
| | | size="small" |
| | | @click="delReceiptRecord(scope.row)" |
| | | :disabled="scope.row.registrant !== userStore.nickName" |
| | | >å é¤</el-button |
| | | > |
| | | </template> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | :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> |
| | |
| | | <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> --> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | </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" /> |
| | |
| | | </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> |
| | |
| | | <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> |
| | | |
| | |
| | | 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"; |
| | |
| | | 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"; |
| | |
| | | taxInclusiveTotalPrice: "", |
| | | taxExclusiveTotalPrice: "", |
| | | invoiceType: "", |
| | | cartonSpecifications:'', |
| | | }, |
| | | productRules: { |
| | | productCategory: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | |
| | | taxInclusiveUnitPrice: [ |
| | | { required: true, message: "请è¾å
¥", trigger: "blur" }, |
| | | ], |
| | | cartonSpecifications: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | taxRate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | taxInclusiveTotalPrice: [ |
| | | { required: true, message: "请è¾å
¥", trigger: "blur" }, |
| | |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | // è·å产å大类treeæ°æ® |
| | | // è·å产ååç§°treeæ°æ® |
| | | const getProductOptions = () => { |
| | | productTreeList().then((res) => { |
| | | productOptions.value = convertIdToValue(res); |
| | |
| | | // è·åtreeåæ°æ® |
| | | const getModels = (value) => { |
| | | productForm.value.productCategory = findNodeById(productOptions.value, value); |
| | | productForm.value.productId = value; |
| | | modelList({ id: value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | |
| | | }else{ |
| | | productData.value[productIndex.value] = { ...productForm.value } |
| | | } |
| | | console.log('productData',productData) |
| | | closeProductDia(); |
| | | } |
| | | } |
| | |
| | | <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> |
| | | |
| | |
| | | |
| | | // æ ¹æ®ä¸å«ç¨æ»ä»·è®¡ç®å«ç¨åä»·åæ°é |
| | | 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); |
| | |
| | | |
| | | // æ ¹æ®æ°éååè®¡ç®æ»ä»· |
| | | 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); |
| | |
| | | |
| | | // æ ¹æ®å«ç¨åä»·ååè®¡ç®æ»ä»· |
| | | 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); |
| | |
| | | |
| | | // æ ¹æ®ç¨çåå计ç®ä¸å«ç¨æ»ä»· |
| | | 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); |
| | |
| | | |
| | | // æå¼åè´§å¼¹æ¡ |
| | | 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; |
| | | }; |
| | | |
| | | // æäº¤å货表å |