Houjie
2025-07-07 0a48655d2162b709ecb80d249a4085971add6140
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
<template>
    <view class="container">
        <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
            <block slot="backText">返回</block>
            <block slot="content">详情</block>
        </cu-custom>
        <view class="container">
 
 
            <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext">
                <uni-group top="1">
                    <view class="divider"><text>基本信息</text></view>
                    <uni-forms-item name="num" label="工单号:">
                        <uni-easyinput v-model="formData.equipmentCode" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="inspectionStatus_dictText" label="工单状态:">
                        <uni-easyinput v-model="formData.inspectionStatus_dictText" :disabled="true" />
                    </uni-forms-item>
                    
                    <uni-forms-item required name="num" label="设备编码:">
                        <uni-easyinput v-model="formData.equipmentCode" :disabled="true" />
                    </uni-forms-item>
 
                    <uni-forms-item name="remark" label="标准名称:">
                        <uni-easyinput v-model="formData.equipmentName" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="remark" label="保养日期:">
                        <uni-easyinput v-model="formData.equipmentModel" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="outNum" label="保养人:">
                        <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="outNum" label="保养周期:">
                        <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="outNum" label="备注:">
                        <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="outNum" label="保养图片:">
                        <view class="grid col-4 grid-square flex-sub">
                            <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage"
                                :data-url="imgList[index]">
                                <image :src="imgList[index]" mode="aspectFill"></image>
                                <view class="cu-tag bg-red radius" @tap.stop="DelImg" :data-index="index">
                                    <text class='cuIcon-close'></text>
                                </view>
                            </view>
                            <view class="solids" @tap="ChooseImage" v-if="imgList.length<1">
                                <text class='cuIcon-cameraadd'></text>
                            </view>
                        </view>
 
                    </uni-forms-item>
                    <view class="divider"><text>班组长确认</text></view>
                    <uni-forms-item name="outNum" required label="确认类型:">
                        <uni-data-select :localdata="formData.msListCategory" popup-title="请选择" @change="changeType"
                            :clear="false">
                        </uni-data-select>
                    </uni-forms-item>
                    <uni-forms-item name="outNum" required label="确认意见:">
                        <uni-easyinput type="textarea" v-model="formData.ttitle" placeholder="请输入内容"></uni-easyinput>
                    </uni-forms-item>
 
                </uni-group>
            </uni-forms>
            <view class="divider"><text>保养项信息</text></view>
            <!-- <view class="text-gray margin-bottom-lg">—————————— 保养项信息 ——————————</view> -->
            <uni-card margin="10px" spacing="1px" v-for="(item,index) in partTakeAdviceDetailList" :key="index">
 
 
                <view class="flex">
                    <view class="flex-sub text-light bg-white padding-xs margin-xs radius">行号:</view>
                    <view class="flex-sub bg-white padding-xs margin-xs radius text-right">{{index+1}}
                    </view>
                </view>
                <view class="flex">
                    <view class="flex-sub text-light bg-white padding-xs margin-xs radius">保养项:</view>
                    <view class="flex-sub bg-white padding-xs margin-xs text-bold radius text-right">
                        {{item.title}}
                    </view>
                </view>
                <view class="flex">
                    <view class="flex-sub text-light bg-white  padding-xs margin-xs radius">是否报修:</view>
                    <view class="flex-sub bg-white padding-xs     text-right margin-xs radius">
                        <uni-data-select :localdata="item.type"/>
                    </view>
                </view>
                <view class="flex">
                    <view class="flex-sub text-light bg-white padding-xs margin-xs radius">子保养项:</view>
                    <view class="flex-sub bg-white padding-xs margin-xs radius text-right"
                        v-if="item.small!=null && item.small.length>10">
                        {{(item.small).toString().substr(0,10)+'...'}}
                    </view>
 
                    <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else>
                        {{item.small}}
                    </view>
                </view>
                <view class="flex">
                    <view class="flex-sub text-light bg-white  padding-xs margin-xs radius">保养要求:</view>
                    <view class="flex-sub bg-white padding-xs margin-xs radius text-right"
                        v-if="item.yaoqiu!=null && item.yaoqiu.length>10">
                        {{(item.yaoqiu).toString().substr(0,10)+'...'}}
                    </view>
 
                    <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else>
                        {{item.yaoqiu}}
                    </view>
                </view>
 
                <view class="flex">
                    <view class="flex-sub text-light bg-white  padding-xs margin-xs radius">保养结果:</view>
                    <view class="flex-sub bg-white padding-xs     text-right margin-xs radius">
                        <uni-data-select :localdata="item.restle" />
 
                    </view>
                </view>
 
                <view class="flex">
                    <view class="flex-sub text-light bg-white  padding-xs margin-xs radius">异常描述:</view>
                    <view class="flex-sub bg-white padding-xs     text-right margin-xs radius">
                        <uni-easyinput v-model="item.desc" :disabled="true" />
                    </view>
                </view>
 
                
 
            </uni-card>
 
 
        </view>
    </view>
</template>
 
<script>
    import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
    export default {
        mixins: [MescrollMixin], // 使用mixin
        data() {
            return {
                scrollLeft: 0,
                searchValue: '',
                imgList: [],
                uploadUrl: "/sys/common/upload",
                formData: {},
                partTakeAdviceDetailList: [{
                    title: "机床空气过滤",
                    small: "外壳及管路",
                    yaoqiu: "过滤网,过滤棉完好,无油",
                    restle: [{
                            text: "正常",
                            value: 0
                        },
                        {
                            text: "异常",
                            value: 1
                        }
                    ],
                    type: [{
                            text: "是",
                            value: 0
                        },
                        {    
                            text: "否",
                            value: 1
                        }
                    ]
 
                }],
                NavBarColor: this.NavBarColor,
                url: {
                    stallList: "/eam/equipment/queryById"
                },
                id: '',
                upOption: {
                    page: {
                        num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
                        size: 10 // 每页数据的数量
                    },
                    noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
                    empty: {
                        tip: '~ 暂无数据 ~', // 提示
                    },
                    loading: '',
                    text: '全部',
                    isShowNoMore: false,
                    textNoMore: '我是有底线的 >_<'
                },
                styles: {
                    color: '#2979FF',
                    borderColor: '#2979FF'
                },
                msg1Count: 0,
                msg2Count: 0,
                msg1Title: ""
            }
        },
        computed: {
            top() {
                return this.CustomBar * 2 + 160
            },
            style() {
                var StatusBar = this.StatusBar;
                var CustomBar = this.CustomBar;
                var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
                return style
            },
        },
 
 
        onShow() {
 
        },
 
        onLoad: function(option) {
            const annItem = JSON.parse(decodeURIComponent(option.item));
            this.id = annItem.id
        },
        created() {
            this.upCallback()
        },
        methods: {
            ChooseImage() {
                var that = this;
                uni.chooseImage({
                    count: 4, //默认9
                    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
                    sourceType: ['album'], //从相册选择
                    success: (res) => {
                        that.$http.upload(that.uploadUrl, {
                                filePath: res.tempFilePaths[0],
                                name: 'file'
                            })
                            .then(res => {
                                that.myFormData.avatar = res.data.message;
                            })
                            .catch(err => {
                                that.$tip.error(err.data.message)
                            });
                        this.imgList = res.tempFilePaths
                    }
                });
            },
            ViewImage(e) {
                uni.previewImage({
                    urls: this.imgList,
                    current: e.currentTarget.dataset.url
                });
            },
            DelImg(e) {
                uni.showModal({
                    title: '提示',
                    content: '确定要删除这段回忆吗?',
                    cancelText: '再看看',
                    confirmText: '再见',
                    success: res => {
                        if (res.confirm) {
                            this.imgList.splice(e.currentTarget.dataset.index, 1)
                        }
                    }
                })
            },
 
            upCallback() {
                this.$http.get(this.url.stallList, {
                    params: {
                        pageNo: 999,
                        pageSize: 1,
                        order: 'asc',
                        column: 'createTime',
                        id: this.id
 
                    },
 
                }).then(res => {
                    this.announcement1 = res.data.result
                    console.log("url", res)
                    //设置列表数据
                    if (res.data.success) {
                        console.log("res", res.data.result.equipmentCode)
                        this.formData = this.announcement1
                    }
                }).catch(() => {
                    //联网失败, 结束加载
                })
            },
 
 
 
            /* 检索 */
            getSera(res) {
                if (keyword == 0) {
                    this.$http.get(this.url.stallList, {
                        params: {
                            pageNo: 1,
                            pageSize: 999,
                            order: "desc",
                            column: "createTime",
                            equipmentCode: res
                        }
                    }).then(res => {
                        //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
 
                        this.announcement1 = res.data.result.records
                        this.mescroll.endSuccess(this.announcement1.length);
                        console.log("url", res)
                        //设置列表数据
                        if (res.data.success) {
                            console.log("res", res.data)
                            this.msg1Count = res.data.result.total
                            this.msg1Title = "通知(" + res.data.result.total + ")";
                            for (let annItem of this.announcement1) {
                                this.msgList.push(annItem)
                            }
                        }
                        if (page.num == 1) {
                            this.msgList = []; //如果是第一页需手动制空列表
                            this.msgList = this.msgList.concat(this.announcement1); //追加新数据
                        }
 
                    }).catch(() => {
                        //联网失败, 结束加载
                        this.mescroll.endErr();
                    })
                }
            },
 
            mescrollInit(mescroll) {
                console.log('mescrollInit')
                this.mescroll = mescroll;
            },
        },
 
    }
</script>
 
<style>
        .divider {
            display: flex;
            align-items: center;
            text-align: center;
            color: gray;
            /* 文字颜色 */
            margin: 20px 0;
            /* 上下间距 */
        }
    
        .divider::before,
        .divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid gray;
            /* 横线颜色 */
            margin: 0 16px;
            /* 横线与文字之间的间距 */
        }
    
        .divider text {
            white-space: nowrap;
            /* 防止文字换行 */
        }
    .is-hover {
        color: rgba(255, 255, 255, 0.6);
        background-color: #55aaff;
        border-color: #55aaff;
    }
 
 
 
    .content {
        margin-top: 5px;
    }
 
    .content scroll-view {
        scrollIndicator: "none"
    }
 
    .popupView {
        margin-top: 85px;
        height: auto;
    }
</style>