| | |
| | | </view> |
| | | |
| | | <view class="flex-row gap-lg"> |
| | | <!-- å½åæ¥å·¥äººé¨åç§»å°å·¦è¾¹ --> |
| | | <view class="current-user-section fill-width"> |
| | | <text>å½åæ¥å·¥äººï¼</text> |
| | | <text class="current-user-name">{{ staffDisplay || 'æªéæ©' }}</text> |
| | | <button class="select-user-btn" @click="isShowUserSelect = true">é人</button> |
| | | </view> |
| | | |
| | | <!-- ä¸è¯æ°éé¨åç§»å°å³è¾¹ --> |
| | | <view class="print-section flex-grow"> |
| | | <view class="barcode-info"> |
| | | <view class="user-select"> |
| | |
| | | <button class="details-btn" @click="confirmCustomAmount">确认æäº¤</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="current-user-section fill-width"> |
| | | <text>å½åæ¥å·¥äººï¼</text> |
| | | <text class="current-user-name">{{ staffDisplay || 'æªéæ©' }}</text> |
| | | <button class="select-user-btn" @click="isShowUserSelect = true">é人</button> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | <button class="save-btn" @click="save">ä¿åå¹¶çæ</button> |
| | | <button class="cancel-btn" @click="cancel">åæ¶</button> |
| | | </view>--> |
| | | |
| | | <!-- ä¿çæ§å¼¹çª --> |
| | | <view v-if="isShow" class="overlay"> |
| | | <view class="popup"> |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | //è¯åæ°å®æ¶è®¡ç® |
| | | realTimeDefectiveCount() { |
| | | // ä¼å
ç¨è¾å
¥æ¡çå¼ï¼å¦åç¨æ¥å£æ°æ® |
| | | const val = Number(this.customAmount); |
| | | if (!isNaN(val) && this.customAmount !== '') return val; |
| | | return this.calculatedDefectiveCount; |
| | | }, |
| | | realTimeOkCount() { |
| | | // è¯åæ° = æ¥å·¥æ°ï¼è®¡ç®ï¼ - ä¸è¯æ° |
| | | const total = (this.order.currentCjNum || 0) - (this.order.initCjNum || 0); |
| | | return total - this.realTimeDefectiveCount; |
| | | }, |
| | | 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); |
| | | //è¯åæ°å®æ¶è®¡ç® |
| | | realTimeDefectiveCount() { |
| | | // ä¼å
ç¨è¾å
¥æ¡çå¼ï¼å¦åç¨æ¥å£æ°æ® |
| | | const val = Number(this.customAmount); |
| | | if (!isNaN(val) && this.customAmount !== '') return val; |
| | | return this.calculatedDefectiveCount; |
| | | }, |
| | | realTimeOkCount() { |
| | | // è¯åæ° = æ¥å·¥æ°ï¼è®¡ç®ï¼ - ä¸è¯æ° |
| | | const total = (this.order.currentCjNum || 0) - (this.order.initCjNum || 0); |
| | | return total - this.realTimeDefectiveCount; |
| | | }, |
| | | 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: { |
| | |
| | | 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())}:${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/RefreshDevBycl", |
| | | 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/RefreshDevBycl", |
| | | 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; |
| | |
| | | } |
| | | }, |
| | | /* æ°å¢ï¼è·åå岿¥å·¥è®°å½ */ |
| | | /* ä¿®æ¹ï¼è§èå岿¶é´å°ç§ */ |
| | | 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 } |
| | | /* ä¿®æ¹ï¼è§èå岿¶é´å°ç§ */ |
| | | 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 } |
| | | }).then(res => { |
| | | const list = res?.data?.tbBillList || res?.data || []; |
| | | this.reportingHistory = list.map(r => { |
| | | // 便®ä½ æ°æ®åºåæ®µåæ å°ï¼ä¸é¢å段åæå¸¸è§å½å举ä¾ï¼éè¦æå®é
æ¹ï¼ |
| | | return { |
| | | bgDate: r.bgDate || '', // æ¥å·¥æ¶é´ |
| | | staff: (r.staffNo ? (r.staffNo + ' ' + (r.staffName || '')) : (r.staffName || '')),//æ¥å·¥äºº |
| | | orderNo: r.billNo,//å·¥åå· |
| | | machineNo: r.machineNo ,//æºå°å· |
| | | initialValue: r.csQty ?? 0,//åå§ééæ° |
| | | productionCount: r.cjQty ?? 0,//æ¥å·¥æ¶ééæ° |
| | | totalProduction: (r.cjQty - r.csQty) ?? 0,//æ¥å·¥æ°ï¼è®¡ç®ï¼ |
| | | BfQty: r.bfQty,//ä¸è¯æ° |
| | | OkQty: r.okQty//è¯åæ°ï¼è®¡ç®ï¼ |
| | | bgDate: r.bgDate || '', // æ¥å·¥æ¶é´ |
| | | staff: (r.staffNo ? (r.staffNo + ' ' + (r.staffName || '')) : (r.staffName || '')),//æ¥å·¥äºº |
| | | orderNo: r.billNo,//å·¥åå· |
| | | machineNo: r.machineNo,//æºå°å· |
| | | initialValue: r.csQty ?? 0,//åå§ééæ° |
| | | productionCount: r.cjQty ?? 0,//æ¥å·¥æ¶ééæ° |
| | | totalProduction: (r.cjQty - r.csQty) ?? 0,//æ¥å·¥æ°ï¼è®¡ç®ï¼ |
| | | BfQty: r.bfQty,//ä¸è¯æ° |
| | | OkQty: r.okQty//è¯åæ°ï¼è®¡ç®ï¼ |
| | | } |
| | | }); |
| | | }).catch(() => { this.reportingHistory = []; }); |
| | |
| | | this.user = this.user === u ? null : u; |
| | | this.staffNo = this.user; |
| | | }, |
| | | //éæ©æ¥å·¥äºº |
| | | //éæ©æ¥å·¥äºº |
| | | confirmCustomAmount() { |
| | | if (!this.customAmount || isNaN(Number(this.customAmount))) { this.$showMessage('请è¾å
¥ææçæ°é'); return; } |
| | | if (!this.staffNo) { this.$showMessage('è¯·éæ©æ¥å·¥äºº'); return; } |
| | |
| | | const amount = Number(this.customAmount); |
| | | this.$post({ |
| | | url: "/MesInvItemBarcodes/AddBFToBarcodes", |
| | | data: { |
| | | orderNo: this.orderNo, |
| | | orderId: this.orderId, |
| | | bf: amount, |
| | | staffNo: staffNo, |
| | | initCjNum: this.order.initCjNum, // åå§ééæ° |
| | | currentCjNum: this.order.currentCjNum // æ¥å·¥æ¶ééæ° |
| | | } |
| | | data: { |
| | | orderNo: this.orderNo, |
| | | orderId: this.orderId, |
| | | bf: amount, |
| | | staffNo: staffNo, |
| | | initCjNum: this.order.initCjNum, // åå§ééæ° |
| | | currentCjNum: this.order.currentCjNum // æ¥å·¥æ¶ééæ° |
| | | } |
| | | }).then(res => { |
| | | if (res.status == 1) { this.$showMessage(res.message); return; } |
| | | this.$showMessage('æ¥åºæ°éå¡«åæå'); |