<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>
|