快乐的昕的电脑
2025-09-25 804e83c35e6c23ac93bdd459eaf758769a8cd122
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<template>
    <view class="page">
 
        <view class="top-right">
            <button class="refresh-btn" @click="refresh">刷新</button>
        </view>
        <!-- 中间状态部分,上下结构 -->
        <view class="middle-section">
            <view class="item" style="height: 100px;">
                <h4>说明:多工单模式时调机送检是统一的</h4>
            </view>
            <view class="item">
                <button class="btn-disabled">调机开始(=换模完成)</button>
                <input class="txt-inp" v-model="maStartTime" placeholder="点击换模完成时写入" disabled="true" />
            </view>
            <view class="item" v-if="!maShoutTime">
                <button @click="stateCheck(1)" class="btn-blue">送检呼叫(点击按钮|清零机台面板数)</button>
                <input class="txt-inp" v-model="maShoutTime" placeholder="点击按钮带出时间" disabled="true" />
            </view>
            <view class="item" v-else>
                <button class="btn-disabled">送检呼叫(点击按钮|清零机台面板数)</button>
                <input class="txt-inp" v-model="maShoutTime" placeholder="点击按钮带出时间" disabled="true" />
            </view>
            <view class="item">
                <button class="btn-disabled">调机完成(=检验通过)</button>
                <input class="txt-inp" v-model="maEndTime" placeholder="首次首检确认通过写入" disabled="true" />
            </view>
        </view>
 
        <!-- 底部保存/取消按钮 -->
        <view class="bottom-section">
            <button class="save-btn" v-if="!maEndTime" @click="save">保存并生效</button>
            <!-- <button class="save-btn" @click="save">保存并生效</button> -->
            <button class="btn-disabled" v-else  >保存并生效</button>
            <button class="cancel-btn" @click="cancel">取消</button>
        </view>
 
    </view>
</template>
 
<script>
    export default {
        props: {
            orderNo: String,
            orderId: Number,
            machineNo: String
        },
        data() {
            return {
                maShoutTime: '',
                maStartTime: '',
                maEndTime: '',
                statusForm: {},
                flag: -1,
            }
        },
        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.findByOrderId();
        },
        methods: {
            refresh() {
                this.findByOrderId(); // This will reload the data for the current order
            },
            save() {
                if (!this.statusForm.id) {
                    this.$showMessage("id为空,不允许推送");
                    return;
                }
 
                this.$post({
                    url: "/MesOrderSta/ChangeMachineTime",
                    data: {
                        maShoutTime: this.maShoutTime,
                        id: this.statusForm.id,
                        orderId: this.orderId,
                        machineNo: this.machineNo,
                        flag: this.flag
                    }
                }).then(res => {
                    if (res.data.tbBillList) {
                        this.$showMessage("呼叫成功");
                        this.findByOrderId();
                    } else {
                        this.$showMessage("呼叫失败");
                        this.cancel();
                    }
                })
            },
            cancel() {
                this.maShoutTime = this.statusForm.maShoutTime;
            },
            stateCheck(item) {
                switch (item) {
                    case 0:
                        break;
                    case 1:
                        this.maShoutTime = this.$getDate('yyyy-mm-dd hh24:mi:ss');
                        break;
                    case 2:
                        break;
                }
                this.flag = item;
            },
            findByOrderId() {
                this.$post({
                    url: "/MesOrderSta/FindByOrderNo",
                    data: {
                        orderId: this.orderId,
                        orderNo: this.orderNo
                    }
                }).then(res => {
                    this.statusForm = res.data.tbBillList;
                    this.maShoutTime = res.data.tbBillList.maShoutTime;
                    this.maStartTime = res.data.tbBillList.maStartTime;
                    this.maEndTime = res.data.tbBillList.maEndTime;
                })
            }
        }
    };
</script>
 
<style scoped>
    /* 页面撑满窗体 */
    .page {
        padding: 2vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        box-sizing: border-box;
        height: 100%;
    }
 
    .top-right {
        position: absolute;
        top: 10px;
        right: 50px;
        z-index: 1000;
    }
 
    .refresh-btn {
        padding: 10px;
        background-color: #00A2E9;
        color: white;
        border: none;
        font-size: 1.5vw;
        border-radius: 5px;
    }
 
 
    label {
        margin-right: 1vw;
        font-size: 1.6vw;
        /* Larger font for labels */
    }
 
    input {
        padding: 1vh;
        font-size: 1.5vw;
        /* Larger font size for inputs */
        border: 1px solid #ccc;
        width: 100%;
        /* Full width for inputs */
        margin-top: 1vh;
        box-sizing: border-box;
    }
 
    /* 中间状态部分,上下布局 */
    .middle-section {
        display: flex;
        flex-direction: column;
        margin-bottom: 4vh;
    }
 
    .item {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 2vh;
    }
 
    button {
        width: 100%;
        /* Full-width 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;
    }
 
    .btn-blue {
        background-color: #00A2E9;
        color: white;
    }
 
    input {
        margin-top: 10px;
        padding: 10px;
        font-size: 14px;
        border: 1px solid #ccc;
        width: 100%;
        /* 输入框撑满宽度 */
    }
 
    /* 底部保存/取消按钮 */
    .bottom-section {
        display: flex;
        justify-content: space-between;
        margin-top: 4vh;
    }
 
    .save-btn,
    .cancel-btn {
        width: 48%;
        /* Half-width buttons */
        padding: 1.5vh;
        background-color: #00A2E9;
        color: white;
        font-size: 1.6vw;
        /* Larger font size for save/cancel buttons */
        border: none;
        text-align: center;
    }
 
    .txt-inp {
        height: 8vh;
        padding: 1vh;
        font-size: 1.5vw;
        /* Increased font size for input fields in middle section */
        width: 100%;
        /* Full width for middle section inputs */
        box-sizing: border-box;
    }
</style>