| | |
| | | <template> |
| | | <view class="page"> |
| | | |
| | | <view> |
| | | <h4>说æ:å¤å·¥åæ¨¡å¼æ¶æ¢æ¨¡æ¯ç»ä¸ç</h4> |
| | | </view> |
| | | <view class="refresh-btn" @click="handleRefresh">å·æ°</view> |
| | | <!-- é¡¶é¨è¡¨åé¨å --> |
| | | <!-- é¡¶é¨Tabæ ï¼å¦æéè¦å¯ä¿çï¼ --> |
| | | <!-- åå
·éæ©åº --> |
| | | <view class="top-section"> |
| | | <view class="form-group"> |
| | | <label>模å
·ç¼å·ï¼</label> |
| | | <input class="input" v-model="order.moldId" placeholder="å·¥å带åº" disabled="true" /> |
| | | <label>éæ©åå
·ç¼å·ï¼</label> |
| | | <select v-model="selectedToolNo"> |
| | | <option v-for="tool in toolList" :key="tool.no" :value="tool.no">{{ tool.no }} | {{ tool.name }}</option> |
| | | </select> |
| | | <button class="btn-blue" @click="showToolDialog = true">åå
·ç®å½</button> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label>ä½¿ç¨æ¬¡æ°ï¼</label> |
| | | <input class="input" v-model="order.moldInseptionQty" placeholder="模å
·å¸¦åº" disabled="true" /> |
| | | <label>åå
·åç§°ï¼</label> |
| | | <input class="input" v-model="toolName" placeholder="åå
·å¸¦åº" disabled /> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label>æéä¿å
»æ¬¡æ°ï¼</label> |
| | | <input class="input" v-model="order.modlLifeWorning" placeholder="模å
·å¸¦åº" disabled="true" /> |
| | | <label>è§æ ¼åå·ï¼</label> |
| | | <input class="input" v-model="toolModel" placeholder="åå
·å¸¦åº" disabled /> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- ä¸é´ç¶æé¨åï¼ä¸ä¸ç»æ --> |
| | | <view class="middle-section"> |
| | | <view class="item"> |
| | | <button class="btn-disabled">æ¢æ¨¡å¼å§ï¼=åå·¥åå®å·¥ï¼</button> |
| | | <input class="txt-inp" v-model="startTime" placeholder="è¾å
¥æ¢æ¨¡å¼å§æ¶é´" /> |
| | | </view> |
| | | <view class="item"> |
| | | <button @click="stateCheck(1)" class="btn-blue">æ¢æ¨¡å®æï¼ç¹å»æé®ï¼</button> |
| | | <input class="txt-inp" v-model="endTime" placeholder="ç¹å»æ¢æ¨¡å®æåå
¥" /> |
| | | <!-- åå
·ç®å½å¼¹çª --> |
| | | <view v-if="showToolDialog" class="dialog-overlay"> |
| | | <view class="dialog"> |
| | | <view class="form-group"> |
| | | <input v-model="searchKey" placeholder="è¾å
¥åå
·ç¼ç ãåç§°æ¨¡ç³æç´¢" class="input" /> |
| | | <button class="btn-blue" @click="searchTool">æç´¢</button> |
| | | </view> |
| | | <view class="tool-list"> |
| | | <button v-for="tool in filteredTools" :key="tool.no" class="tool-btn" @click="selectTool(tool)"> |
| | | {{ tool.no }} | {{ tool.name }} |
| | | </button> |
| | | </view> |
| | | <view class="dialog-actions"> |
| | | <button class="btn-blue" @click="confirmTool">ç¡®å®</button> |
| | | <button class="btn-disabled" @click="showToolDialog = false">åæ¶</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- åºé¨ä¿å/åæ¶æé® --> |
| | | <!-- åå
·ä½¿ç¨è®°å½è¡¨æ ¼ --> |
| | | <view class="table-section"> |
| | | <table> |
| | | <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 v-for="item in toolRecords" :key="item.id"> |
| | | <td>{{ item.no }}</td> |
| | | <td>{{ item.name }}</td> |
| | | <td>{{ item.upTime }}</td> |
| | | <td>{{ item.upCount }}</td> |
| | | <td>{{ item.downTime }}</td> |
| | | <td>{{ item.downCount }}</td> |
| | | <td>{{ item.useCount }}</td> |
| | | <td>{{ item.useLimit }}</td> |
| | | <td>{{ item.lifePercent }}</td> |
| | | <td>{{ item.lifeWarn }}</td> |
| | | <td :class="item.warnStatus === 'è¦å' ? 'warn' : ''">{{ item.warnStatus }}</td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </view> |
| | | |
| | | <!-- ä¸ä¸åæé® --> |
| | | <view class="bottom-section"> |
| | | <button class="save-btn" @click="save">ä¿åå¹¶çæ</button> |
| | | <button class="save-btn" @click="handleUpTool">ä¸åæäº¤</button> |
| | | <button class="save-btn" @click="handleDownTool">ä¸åæäº¤</button> |
| | | <button class="cancel-btn" @click="cancel">åæ¶</button> |
| | | </view> |
| | | |
| | | <!-- 说æ --> |
| | | <view class="tool-desc"> |
| | | <p style="color:red;">å½åå·¥åä¸ï¼æ¢äºå 次åï¼å°±ä¼äº§çå æ¡æ°æ®ãä¸åæ¶é´ãä¸åæ¶é´å¨è¡¨ä¸è½çå°ã</p> |
| | | <p style="color:red;">ä¸åæ¶é´åå¯¹åºæ¶é´ç¨ç产计æ°å¨å¹é
ï¼æ¥åºå½æ¶çç产æ°ï¼ç´¯è®¡è®¡æ°ï¼ã</p> |
| | | <p style="color:red;">å¯¿å½æ¯é¢è¦å¼å¨åå
·ä¸ï¼é»è®¤ç»ä¸ã</p> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | orderNo: String, |
| | | orderId: Number, |
| | | machineNo: String |
| | | }, |
| | | data() { |
| | | return { |
| | | startTime: '', |
| | | endTime: '', |
| | | order: {}, |
| | | statusForm: {} |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | // let machine = uni.getStorageSync('machine'); |
| | | // let orderId = uni.getStorageSync('orderId'); |
| | | // let orderNo = uni.getStorageSync('orderNo'); |
| | | |
| | | // if (orderId) { |
| | | // this.orderId = orderId; |
| | | // } else { |
| | | // if (!this.orderId) { |
| | | // this.orderId = uni.getStorageSync('id'); |
| | | // } |
| | | |
| | | // } |
| | | |
| | | // if (orderNo) { |
| | | // this.orderNo = orderNo; |
| | | // } else { |
| | | // if (!this.orderNo) { |
| | | // this.orderNo = uni.getStorageSync('daa001'); |
| | | // } |
| | | // } |
| | | |
| | | // if (machine) { |
| | | // this.machineNo = machine; |
| | | // } else { |
| | | // if (!this.machineNo) { |
| | | // this.machineNo = uni.getStorageSync('machineNo'); |
| | | // } |
| | | // } |
| | | |
| | | if (!this.orderId && !this.orderNo) { |
| | | return; |
| | | } |
| | | |
| | | this.getOrderById(); |
| | | |
| | | this.findByOrderId(); |
| | | toolList: [ |
| | | // ç¤ºä¾æ°æ®ï¼å®é
åºä»å端æ¥å£è·å |
| | | { no: 'T22050338', name: 'm1.5åéé¿å', model: 'xxx' }, |
| | | { no: 'T22050337', name: 'm0.546åéé¿å', model: 'yyy' } |
| | | ], |
| | | selectedToolNo: '', |
| | | toolName: '', |
| | | toolModel: '', |
| | | showToolDialog: false, |
| | | searchKey: '', |
| | | filteredTools: [], |
| | | toolRecords: [ |
| | | // ç¤ºä¾æ°æ®ï¼å®é
åºä»å端æ¥å£è·å |
| | | { id: 1, no: 'T22050338', name: 'm1.5åéé¿å', upTime: '7-13 9:00', upCount: 15, downTime: '7-13 19:00', downCount: 3115, useCount: 3100, useLimit: 8888, lifePercent: '34.88%', lifeWarn: '90%', warnStatus: 'æ£å¸¸' } |
| | | ] |
| | | }; |
| | | }, |
| | | methods: { |
| | | |
| | | handleRefresh() { |
| | | this.getOrderById(); |
| | | this.findByOrderId(); |
| | | searchTool() { |
| | | this.filteredTools = this.toolList.filter(t => |
| | | t.no.includes(this.searchKey) || t.name.includes(this.searchKey) |
| | | ); |
| | | }, |
| | | |
| | | save() { |
| | | if (!this.statusForm.id) { |
| | | this.$showMessage("id为空ï¼ä¸å
许æ¨é"); |
| | | return; |
| | | } |
| | | |
| | | this.$post({ |
| | | url: "/MesOrderSta/ChangeMoldTime", |
| | | data: { |
| | | changeMoldStartTime: this.startTime, |
| | | changeMoldEndTime: this.endTime, |
| | | id: this.statusForm.id, |
| | | orderId: this.orderId, |
| | | machineNo: this.machineNo, |
| | | flag: this.flag |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList) { |
| | | this.$showMessage("ä¿åæå"); |
| | | this.findByOrderId(); |
| | | |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: 'ä¿åæå', |
| | | duration: 30001, |
| | | }); |
| | | |
| | | } else { |
| | | this.$showMessage("ä¿å失败"); |
| | | this.cancel(); |
| | | } |
| | | }) |
| | | selectTool(tool) { |
| | | this.selectedToolNo = tool.no; |
| | | this.toolName = tool.name; |
| | | this.toolModel = tool.model; |
| | | }, |
| | | confirmTool() { |
| | | this.showToolDialog = false; |
| | | }, |
| | | handleUpTool() { |
| | | // ä¸åæäº¤é»è¾ï¼è°ç¨å端æ¥å£ |
| | | this.$showMessage('ä¸åæäº¤æåï¼ç¤ºä¾ï¼'); |
| | | }, |
| | | handleDownTool() { |
| | | // ä¸åæäº¤é»è¾ï¼è°ç¨å端æ¥å£ |
| | | this.$showMessage('ä¸åæäº¤æåï¼ç¤ºä¾ï¼'); |
| | | }, |
| | | cancel() { |
| | | this.startTime = this.statusForm.changeMoldStartTime; |
| | | this.endTime = this.statusForm.changeMoldEndTime; |
| | | }, |
| | | getOrderById() { |
| | | this.$post({ |
| | | url: "/Womdaa/GetWomdaaById", |
| | | data: { |
| | | orderId: this.orderId, |
| | | orderNo: this.orderNo |
| | | } |
| | | }).then(res => { |
| | | this.order = res.data.tbBillList; |
| | | }) |
| | | }, |
| | | findByOrderId() { |
| | | this.$post({ |
| | | url: "/MesOrderSta/FindByOrderNo", |
| | | data: { |
| | | orderId: this.orderId, |
| | | orderNo: this.orderNo |
| | | } |
| | | }).then(res => { |
| | | this.statusForm = res.data.tbBillList; |
| | | this.startTime = res.data.tbBillList.changeMoldStartTime; |
| | | this.endTime = res.data.tbBillList.changeMoldEndTime; |
| | | }) |
| | | }, |
| | | stateCheck(item) { |
| | | switch (item) { |
| | | case 0: |
| | | this.startTime = this.$getDate('yyyy-mm-dd hh24:mi:ss'); |
| | | this.endTime = this.statusForm.changeMoldEndTime; |
| | | break; |
| | | case 1: |
| | | this.startTime = this.statusForm.changeMoldStartTime; |
| | | this.endTime = this.$getDate('yyyy-mm-dd hh24:mi:ss'); |
| | | break; |
| | | } |
| | | this.flag = item; |
| | | this.selectedToolNo = ''; |
| | | this.toolName = ''; |
| | | this.toolModel = ''; |
| | | } |
| | | }, |
| | | mounted() { |
| | | // å®é
åºä»å端å è½½åå
·ç®å½å使ç¨è®°å½ |
| | | this.filteredTools = this.toolList; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* é¡µé¢ææ»¡çªä½ */ |
| | | .page { |
| | | padding: 2vh; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .refresh-btn { |
| | | position: absolute; |
| | | top: -5px; |
| | | right: 40px; |
| | | background-color: #00A2E9; |
| | | color: white; |
| | | padding: 10px 15px; |
| | | font-size: 35px; |
| | | border-radius: 5px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .refresh-btn:disabled { |
| | | background-color: #ccc; |
| | | } |
| | | |
| | | /* é¡¶é¨è¡¨åé¨å */ |
| | | .top-section { |
| | | /* display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 2vh; */ |
| | | display: flex; |
| | | margin-bottom: 2vh; |
| | | flex-direction: row; |
| | | flex-wrap: nowrap; |
| | | align-content: center; |
| | | justify-content: space-between; |
| | | align-items: baseline; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 2vh; |
| | | } |
| | | |
| | | .form-group { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-right: 2vw; |
| | | margin-bottom: 1.5vh; |
| | | } |
| | | |
| | | label { |
| | | /* margin-right: 1vw; |
| | | font-size: 1.6vw; */ |
| | | /* Larger font size for labels */ |
| | | float: left; |
| | | /* margin-right: 1vw; */ |
| | | font-size: 1.6vw; |
| | | margin-top: 24px; |
| | | } |
| | | |
| | | .input { |
| | | padding: 1vh; |
| | | font-size: 1.5vw; |
| | | /* Larger font size for input fields */ |
| | | border: 1px solid #ccc; |
| | | width: 20vw; |
| | | /* Set relative width for input fields */ |
| | | } |
| | | |
| | | /* ä¸é´ç¶æé¨åï¼ä¸ä¸å¸å± */ |
| | | .middle-section { |
| | | display: flex; |
| | | flex-direction: column; |
| | | margin-bottom: 4vh; |
| | | } |
| | | |
| | | .item { |
| | | display: flex; |
| | | flex-direction: row; |
| | | /* Arrange items vertically */ |
| | | align-items: flex-start; |
| | | margin-bottom: 2vh; |
| | | } |
| | | |
| | | button { |
| | | width: 100%; |
| | | /* Full width for buttons */ |
| | | padding: 1.5vh; |
| | | font-size: 1.5vw; |
| | | /* Larger font size for buttons */ |
| | | border: none; |
| | | text-align: center; |
| | | } |
| | | |
| | | .btn-disabled { |
| | | background-color: #ccc; |
| | | color: white; |
| | | width: 16vw; |
| | | } |
| | | |
| | | .btn-blue { |
| | | background-color: #00A2E9; |
| | | color: white; |
| | | border: none; |
| | | padding: 8px 18px; |
| | | margin-left: 10px; |
| | | border-radius: 5px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | input { |
| | | margin-top: 10px; |
| | | padding: 10px; |
| | | font-size: 14px; |
| | | .btn-disabled { |
| | | background-color: #ccc; |
| | | color: white; |
| | | border: none; |
| | | padding: 8px 18px; |
| | | margin-left: 10px; |
| | | border-radius: 5px; |
| | | cursor: not-allowed; |
| | | } |
| | | |
| | | .dialog-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0,0,0,0.3); |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .dialog { |
| | | background: #fff; |
| | | padding: 2vh 2vw; |
| | | border-radius: 8px; |
| | | width: 60vw; |
| | | } |
| | | |
| | | .tool-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin: 1vh 0; |
| | | } |
| | | |
| | | .tool-btn { |
| | | margin: 5px 10px 5px 0; |
| | | padding: 8px 16px; |
| | | background: #f5f5f5; |
| | | border: 1px solid #ccc; |
| | | width: 100%; |
| | | /* è¾å
¥æ¡ææ»¡å®½åº¦ */ |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | /* åºé¨ä¿å/åæ¶æé® */ |
| | | .bottom-section { |
| | | .dialog-actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 4vh; |
| | | margin-bottom: 4vh; |
| | | margin-top: 2vh; |
| | | } |
| | | |
| | | .save-btn, |
| | | .cancel-btn { |
| | | width: 48%; |
| | | /* Half-width buttons */ |
| | | .table-section { |
| | | margin: 2vh 0; |
| | | overflow-x: auto; |
| | | } |
| | | |
| | | table { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | } |
| | | |
| | | th, td { |
| | | border: 1px solid #ccc; |
| | | padding: 8px 4px; |
| | | text-align: center; |
| | | font-size: 1vw; |
| | | } |
| | | |
| | | .warn { |
| | | color: red; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .bottom-section { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | margin-top: 2vh; |
| | | } |
| | | |
| | | .save-btn, .cancel-btn { |
| | | width: 28%; |
| | | padding: 1.5vh; |
| | | background-color: #00A2E9; |
| | | color: white; |
| | | font-size: 1.6vw; |
| | | /* Larger font size for save/cancel buttons */ |
| | | font-size: 1.2vw; |
| | | border: none; |
| | | text-align: center; |
| | | border-radius: 5px; |
| | | } |
| | | |
| | | .txt-inp { |
| | | height: 8vh; |
| | | padding: 1vh; |
| | | font-size: 1.5vw; |
| | | /* Increased font size */ |
| | | width: 100%; |
| | | /* Full width for input in middle section */ |
| | | box-sizing: border-box; |
| | | .cancel-btn { |
| | | background-color: #ccc; |
| | | color: #333; |
| | | } |
| | | |
| | | .tool-desc { |
| | | margin-top: 2vh; |
| | | } |
| | | </style> |