165 lines
3.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<!--XXX 2025-04-06 工单报工打印标签后扫标签报工版本 -->
<view>
<uni-card>
<view class="report-form-item">
<view class="report-form-label">工单号</view>
<view class="report-form-value">{{ formData.fkWorkorder }}</view>
</view>
<view class="report-form-item">
<view class="report-form-label">产品编号</view>
<view class="report-form-value">{{ formData.productionCode }}</view>
</view>
<view class="report-form-item">
<view class="report-form-label">产品名称</view>
<view class="report-form-value">{{ formData.productionName }}</view>
</view>
<view class="report-form-item">
<view class="report-form-label">规格</view>
<view class="report-form-value">{{ formData.specification }}</view>
</view>
</uni-card>
<!-- 模板显示 -->
<step1Vue ref="step1Ref" v-if="step === 1" :formData="formData" @next="next"></step1Vue>
<step2Vue ref="step2Ref" v-if="step === 2" :formData="formData" @submit="submit"></step2Vue>
<!-- 初次进入校验 -->
<view>
<uni-popup ref="dialogRef" type="dialog">
<uni-popup-dialog
:title="dialog.title"
:content="dialog.content"
:type="dialog.type"
cancelText="关闭"
confirmText="确认"
@confirm="dialogConfirm"
@close="dialogClose"
></uni-popup-dialog>
</uni-popup>
</view>
</view>
</template>
<script>
import step1Vue from './step1.vue';
import step2Vue from './step2.vue';
// 工单相关报工基础Api
export default {
components:{
step1Vue,
step2Vue
},
onLoad: function (option) {
this.$nextTick(() => {
this.formData = JSON.parse(JSON.stringify(option));
if(this.step === 1 && this.formData.fkWorkorder){
this.$refs.step1Ref.getFirstLabel(this.formData.fkWorkorder)
this.$refs.step1Ref.getEndLabel(this.formData.fkWorkorder)
}
});
},
data() {
return {
loading: false,
step1Ref:null,
step2Ref:null,
dialogRef: null,
dialog: {
title: '操作提醒',
content: '',
type: 'warn'
},
// 工单信息
formData: {
id: null,
finishNum: 0
},
// 操作步骤
step: 1
};
},
methods: {
next() {
this.step = 2;
},
submit() {
this.step = 1;
},
dialogConfirm() {
this.dialogClose();
},
dialogClose() {
this.$refs.dialogRef.close();
}
}
};
</script>
<style scoped>
.report-form-item {
display: flex;
}
.report-form-label {
width: 80px;
font-size: 14px;
}
.report-form-value {
font-size: 16px;
}
.report-box {
height: 30vh;
display: flex;
flex-direction: column;
align-items: center;
}
.report-box-title {
font-size: 18px;
font-weight: 700;
text-align: center;
}
.report-box-parts-list {
width: 86vw;
height: 48vh;
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
will-change: scroll-position;
}
.reprot-box-parts-list-item {
padding: 5px;
margin: 0px; /* 添加外边距 */
width: calc(100% - 10px); /* 调整宽度以适应内边距 */
height: 50px;
border: 1px solid #c1c1c1; /* 调整边框颜色为更柔和的灰色 */
display: flex;
flex-direction: row;
transition: background-color 0.3s ease; /* 添加过渡效果 */
}
.reprot-box-parts-list-item:hover {
background-color: #f5f5f5; /* 添加悬停效果 */
}
.reprot-box-parts-list-item-left {
width: 75%;
height: 100%;
display: flex;
flex-direction: column;
}
.reprot-box-parts-list-item-title {
font-size: 18px;
font-weight: 600;
}
.reprot-box-parts-list-item-content {
font-size: 14px;
}
.reprot-box-parts-list-item-right {
width: 25%;
height: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
</style>