快乐的昕的电脑
2025-10-16 52bbf8ee3d126998c5c625a3aab234b1fdcb2362
修改:规范历史时间到秒
已修改3个文件
103 ■■■■■ 文件已修改
.vs/前端2/CopilotIndices/17.14.878.3237/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
.vs/前端2/CopilotIndices/17.14.878.3237/SemanticSymbols.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
components/WorkOrderPrint.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/ǰ¶Ë2/CopilotIndices/17.14.878.3237/SemanticSymbols.db
Binary files differ
.vs/ǰ¶Ë2/CopilotIndices/17.14.878.3237/SemanticSymbols.db-wal
Binary files differ
components/WorkOrderPrint.vue
@@ -215,29 +215,30 @@
                reportingHistory: []
            }
        },
        computed: {
            calculatedCurrentCount() { return (this.productionCount || 0) - (this.initialValue || 0); },
            calculatedTotalProduction() { return (this.kgQty || 0); }, // è‹¥éœ€è¦æ¢å¤ä¹‹å‰é€»è¾‘可改为 (this.kgQty||0)+this.calculatedCurrentCount
            calculatedDefectiveCount() { return this.calculatedTotalProduction - (this.sQuantity || 0); },
            planQtyDisplay() { return this.order.planQty || this.order.planQuantity || this.order.daa008 || 0; },
            staffDisplay() {
                if (!this.staffNo) return '';
                const segs = this.staffNo.split(':');
                return segs.length > 1 ? `${segs[0]} ${segs[1]}` : this.staffNo;
            },
            filteredUsers() {
                if (!this.userSearch) return this.users;
                const kw = this.userSearch.trim().toLowerCase();
                return this.users.filter(u => u.toLowerCase().includes(kw));
            }
        },
        created() {
            this.initializeData();
            this.fetchData(true);
            this.init();
            this.getXS0101();
            this.updateNowTime();
            this.nowTimeTimer = setInterval(this.updateNowTime, 60000);
        computed: {
            calculatedCurrentCount() { return (this.productionCount || 0) - (this.initialValue || 0); },
            calculatedTotalProduction() { return (this.kgQty || 0); }, // è‹¥éœ€æ¢å¤æ—§é€»è¾‘可用 (this.kgQty||0)+this.calculatedCurrentCount
            calculatedDefectiveCount() { return this.calculatedTotalProduction - (this.sQuantity || 0); },
            planQtyDisplay() { return this.order.planQty || this.order.planQuantity || this.order.daa008 || 0; },
            staffDisplay() {
                if (!this.staffNo) return '';
                const segs = this.staffNo.split(':');
                return segs.length > 1 ? `${segs[0]} ${segs[1]}` : this.staffNo;
            },
            filteredUsers() {
                if (!this.userSearch) return this.users;
                const kw = this.userSearch.trim().toLowerCase();
                return this.users.filter(u => u.toLowerCase().includes(kw));
            }
        },
        created() {
            this.initializeData();
            this.fetchData(true);
            this.init();
            this.getXS0101();
            this.updateNowTime();
            // ç§’级刷新;如不需动态跳秒可改为 60000
            this.nowTimeTimer = setInterval(this.updateNowTime, 1000);
        },
        beforeDestroy() { if (this.nowTimeTimer) clearInterval(this.nowTimeTimer); },
        methods: {
@@ -247,27 +248,28 @@
                return segs.length > 1 ? `${segs[0]} ${segs[1]}` : u;
            },
            selectUser(u) { this.staffNo = u; this.isShowUserSelect = false; this.userSearch = ''; },
            updateNowTime() {
                const d = new Date(), p = n => n.toString().padStart(2, '0');
                this.nowTime = `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`;
            },
            initializeData() {
                this.productionCount = this.printedCount = this.defectiveCount = 0;
                this.icount = 1; this.bqty = 0; this.sQuantity = 0; this.kgQty = 0;
                this.initialValue = 0; this.qqty = 0;
                this.isGeneratingBarcode = false; this.lastGenerateTime = 0; this.generateRequestId = null;
            },
            resetGenerateState() {
                this.isGeneratingBarcode = false; this.generateRequestId = null; this.lastGenerateTime = 0;
                this.$showMessage("已重置条码生成状态");
            },
            refresh() {
                this.$sendPostRequest({
                    url: "http://192.168.0.94:9095/Numerical/RefreshDev",
                    data: { machineNo: this.order.machineNo },
                    contentType: "application/json"
                }).then(r => { r.code == 200 ? this.fetchData(true) : this.$showMessage("同步失败"); });
            },
            /* ä¿®æ”¹ï¼šå¢žåŠ ç§’ */
            updateNowTime() {
                const d = new Date(), p = n => n.toString().padStart(2, '0');
                this.nowTime = `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
            },
            initializeData() {
                this.productionCount = this.printedCount = this.defectiveCount = 0;
                this.icount = 1; this.bqty = 0; this.sQuantity = 0; this.kgQty = 0;
                this.initialValue = 0; this.qqty = 0;
                this.isGeneratingBarcode = false; this.lastGenerateTime = 0; this.generateRequestId = null;
            },
            resetGenerateState() {
                this.isGeneratingBarcode = false; this.generateRequestId = null; this.lastGenerateTime = 0;
                this.$showMessage("已重置条码生成状态");
            },
            refresh() {
                this.$sendPostRequest({
                    url: "http://192.168.0.94:9095/Numerical/RefreshDev",
                    data: { machineNo: this.order.machineNo },
                    contentType: "application/json"
                }).then(r => { r.code == 200 ? this.fetchData(true) : this.$showMessage("同步失败"); });
            },
            onDaa003Change(v) {
                let o = this.lineList[this.DAA003List.indexOf(v)];
                this.orderId = o.id; this.orderNo = o.daa001;
@@ -290,8 +292,17 @@
                }
            },
            /* æ–°å¢žï¼šèŽ·å–åŽ†å²æŠ¥å·¥è®°å½• */
            getReportingHistory() {
                if (!this.orderNo) { this.reportingHistory = []; return; }
            /* ä¿®æ”¹ï¼šè§„范历史时间到秒 */
            getReportingHistory() {
                if (!this.orderNo) { this.reportingHistory = []; return; }
                const fmtSec = v => {
                    if (!v) return '';
                    // å…¼å®¹åŽç«¯å¯èƒ½è¿”回的不同格式
                    const d = new Date(typeof v === 'string' ? v.replace(/-/g, '/') : v);
                    if (isNaN(d.getTime())) return v; // æ— æ³•解析则原样返回
                    const p = n => n.toString().padStart(2, '0');
                    return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
                };
                this.$post({
                    url: "/Womdaa/GetByBillNoBG",
                    data: { billNo: this.orderNo, machineNo: this.machineNo || null }