bug
jiangping
2023-12-06 1f4e7d0f73a73e7350cf5a1df279d5f30904c5d5
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
<template>
    <div class="content_list_item">
        <van-skeleton :loading="loading" title :row="8" :row-width="['100%', '100%', '100%', '100%', '100%', '100%']" />
        <div class="content_list_item_top" v-show="!loading">
            <div class="content_list_item_top_left">
                <span v-if="props.info.mmodel">{{props.info.mmodel.name}} | {{props.info.procedureName}}</span>
                <div class="type backgreen" v-if="props.info.type === 0">正常</div>
                <div class="type backyellow" v-if="props.info.type === 2">返工返修</div>
            </div>
            <div class="content_list_item_top_right">
                <span class="yellow" v-if="props.info.status === 0">已创建</span>
                <span class="green" v-if="props.info.status === 1">已备料</span>
                <span v-if="props.info.status === 2">已完工检</span>
                <span class="purple" v-if="props.info.status === 3">已检验</span>
                <span v-if="props.info.status === 4">已报工</span>
                <span v-if="props.info.status === 5">已入库</span>
                <span v-if="props.info.status === 6">已取消</span>
                <span class="green" v-if="props.info.status === 7">进行中</span>
            </div>
        </div>
        <div class="content_list_item_code" v-show="!loading">工单编号:{{props.info.code}}</div>
 
        <div class="content_list_item_content" v-show="!loading">
            <div class="content_list_item_content_item">
                <div class="content_list_item_content_item_label">物料编码:</div>
                <div class="content_list_item_content_item_nr" v-if="props.info.mmodel">{{props.info.mmodel.code}}</div>
            </div>
            <div class="content_list_item_content_item">
                <div class="content_list_item_content_item_label">计划开工:</div>
                <div class="content_list_item_content_item_nr">{{props.info.planDate}}</div>
            </div>
            <div class="content_list_item_content_item">
                <div class="content_list_item_content_item_label">生产批次:</div>
                <div class="content_list_item_content_item_nr">{{props.info.batch}}</div>
            </div>
            <div class="content_list_item_content_item">
                <div class="content_list_item_content_item_label">计划数量:</div>
                <div class="content_list_item_content_item_nr" v-if="props.info.umodel">{{props.info.planNum}}{{props.info.umodel.name}}</div>
            </div>
 
            <div class="content_list_item_content_item">
                <div class="content_list_item_content_item_label">生产设备:</div>
                <div class="content_list_item_content_item_nr" v-if="props.info.pgmodel">{{props.info.pgmodel.code}}&nbsp;-&nbsp;{{props.info.pgmodel.name}}</div>
<!--                <div class="content_list_item_content_item_nr" v-if="props.info.pgmodel">{{props.info.pgmodel.code}}</div>-->
            </div>
            <div class="content_list_item_content_item">
                <div class="content_list_item_content_item_label">生产人员:</div>
                <div class="content_list_item_content_item_nrs">
                    <template v-for="(item, index) in props.info.proUserList" :key="index">{{item.proUserDepartName}}<template v-if="index !== props.info.proUserList.length - 1">&nbsp;/&nbsp;</template></template>
                </div>
            </div>
        </div>
        <div class="content_list_item_yq" @click="jumpGY" v-show="!loading && tips">
            <div class="content_list_item_yq_left">
                <span>工艺要求:</span>
                <span>{{tips}}</span>
            </div>
            <van-icon name="arrow" color="#666666" size="16" />
        </div>
    </div>
</template>
 
<script setup lang="ts">
    import { defineProps, ref, watch } from 'vue'
    import { getListByWorkOrderId } from '@/apis/WorkOrderAPI'
    import { useRouter } from "vue-router"
 
    let loading = ref<boolean>(true)
    const router = useRouter()
    let tips = ref<string>('')  // 工艺要求
 
    // 详情数据
    const props = defineProps({
        info: {
            type: Object,
            required: true
        }
    })
 
    // 根据工单id查工艺卡
    const getListByWorkOrderIdInfo = () => {
        getListByWorkOrderId({ workOrderId: props.info.id })
            .then(res => {
                if (res.code === 200) {
                    tips.value = res.data.tips
                }
            })
            .finally(() => {
                loading.value = false
            })
    }
 
    // 跳转查工艺
    const jumpGY = () => {
        router.push({ name: 'checkTheProcess', query: { id: props.info.id } })
    }
 
    watch(() => props.info, async (news) => {
        if (JSON.stringify(news) !== "{}") {
            await getListByWorkOrderIdInfo()
        }
    }, { immediate: true })
</script>
 
<style lang="scss" scoped>
    .content_list_item {
        padding: 30px;
        display: flex;
        flex-direction: column;
        background: #ffffff;
        .van-skeleton {
            padding: 0 !important;
        }
        .content_list_item_top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            .content_list_item_top_left {
                width: 85%;
                display: flex;
                align-items: center;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                .type {
                    padding: 5px 10px;
                    border-radius: 10px;
                    color: white;
                    margin-left: 10px;
                }
                span {
                    font-size: 32px;
                    font-weight: 500;
                    color: #333333;
                    max-width: 100%;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    -o-text-overflow: ellipsis;
                }
            }
            .content_list_item_top_right {
                font-size: 26px;
                font-weight: 400;
                color: #666666;
                flex-shrink: 0;
                .purple {
                    color: $nav-color !important;
                }
                .green {
                    color: $nav-stateColor6 !important;
                }
                .yellow {
                    color: $nav-stateColor1 !important;
                }
            }
        }
        .content_list_item_code {
            font-size: 24px;
            font-weight: 400;
            color: #666666;
            margin: 24px 0;
            span {
                font-size: 24px;
                font-weight: 400;
                color: #666666;
                margin: 24px 0;
            }
        }
        .content_list_item_content {
            padding: 24px 30px;
            background: #F7F7F7;
            border-radius: 16px;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            .content_list_item_content_item {
                width: 100%;
                display: flex;
                margin-top: 24px;
                &:nth-child(1) {
                    margin-top: 0 !important;
                }
                .content_list_item_content_item_label {
                    font-size: 24px;
                    font-weight: 400;
                    color: #666666;
                    flex-shrink: 0;
                }
                .content_list_item_content_item_nrs {
                    flex: 1;
                    font-size: 24px;
                    font-weight: 400;
                    color: #222222;
                    margin-right: 10px;
                    display: flex;
                    word-break: break-word;
                }
                .content_list_item_content_item_nr {
                    flex: 1;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    -o-text-overflow:ellipsis;
                    word-wrap: break-word;
                    font-size: 24px;
                    font-weight: 400;
                    color: #222222;
                    margin-right: 10px;
                }
            }
        }
        .content_list_item_yq {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 30px;
            .content_list_item_yq_left {
                display: flex;
                span {
                    font-size: 26px;
                    font-weight: 400;
                    &:nth-child(1) {
                        color: #666666;
                        flex-shrink: 0;
                    }
                    &:nth-child(2) {
                        color: #222222;
                    }
                }
            }
        }
    }
</style>