2764b83e
刘淇
分配养护员
|
1
2
3
4
5
6
7
|
<template>
<view class="page-container">
<view class="work-order-form-content commonPageLRpadding">
<up-form
label-position="left"
:model="workOrderForm"
ref="workOrderFormRef"
|
5059c4dd
刘淇
养护员提交养护工单
|
8
|
labelWidth="170rpx"
|
2764b83e
刘淇
分配养护员
|
9
|
>
|
dacff5e3
刘淇
养护员退回
|
10
|
<!-- 1. 工单编号(只读展示,从缓存获取) -->
|
2764b83e
刘淇
分配养护员
|
11
12
13
14
15
16
17
18
19
20
21
22
|
<up-form-item
label="工单编号"
border-bottom
>
<up-input
v-model="workOrderForm.orderNo"
border="none"
readonly
placeholder="暂无工单编号"
></up-input>
</up-form-item>
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<!-- 2. 作业类型(决定加载哪套动态字段配置:数据中心/业务类型字段配置 配置归属=工单) -->
<up-form-item
label="作业类型"
prop="workTypeName"
required
border-bottom
@click="openWorkTypeSheet(); hideKeyboard()"
>
<up-input
v-model="workOrderForm.workTypeName"
disabled
disabled-color="#ffffff"
placeholder="请选择作业类型"
border="none"
></up-input>
<template #right>
<up-icon name="arrow-right" size="16"></up-icon>
</template>
</up-form-item>
<!-- 3. 共同处理人(支持多选) -->
|
2764b83e
刘淇
分配养护员
|
44
45
46
47
48
49
50
|
<up-form-item
label="共同处理人"
prop="coProcessorName"
border-bottom
@click="handleActionSheetOpen('coProcessor'); hideKeyboard()"
>
<up-input
|
371cf0eb
刘淇
流程节点
|
51
|
v-model="workOrderForm.coProcessorNameStr"
|
2764b83e
刘淇
分配养护员
|
52
53
|
disabled
disabled-color="#ffffff"
|
5059c4dd
刘淇
养护员提交养护工单
|
54
|
placeholder="请选择共同处理人"
|
2764b83e
刘淇
分配养护员
|
55
56
57
58
59
60
61
|
border="none"
></up-input>
<template #right>
<up-icon name="arrow-right" size="16"></up-icon>
</template>
</up-form-item>
|
fa775c6b
刘淇
养护计划调整
|
62
|
<!-- 3. 处理建议(处理情况描述,必填) -->
|
2764b83e
刘淇
分配养护员
|
63
|
<up-form-item
|
5059c4dd
刘淇
养护员提交养护工单
|
64
|
label="处理情况"
|
2764b83e
刘淇
分配养护员
|
65
66
67
68
|
prop="reason"
required
>
<up-textarea
|
fa775c6b
刘淇
养护计划调整
|
69
|
placeholder="请输入处理情况描述(必填,最多200字)"
|
2764b83e
刘淇
分配养护员
|
70
71
72
|
v-model.trim="workOrderForm.reason"
count
maxlength="200"
|
5059c4dd
刘淇
养护员提交养护工单
|
73
|
rows="5"
|
2764b83e
刘淇
分配养护员
|
74
75
76
77
|
@blur="() => workOrderFormRef.validateField('reason')"
></up-textarea>
</up-form-item>
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
<!-- 4. 动态字段:按「业务类型(busiLine) + 作业类型」加载数据中心配置的工单填报项 -->
<view class="dynamic-field-block" v-if="workOrderForm.workTypeId">
<view class="dynamic-field-title">作业填报</view>
<work-field-form
ref="workFieldFormRef"
:business-type="workOrderForm.businessType"
:biz-type="1"
:work-type-id="workOrderForm.workTypeId"
@loaded="onDynamicFieldsLoaded"
></work-field-form>
<view class="dynamic-field-empty" v-if="dynamicFieldCount === 0">
<text>该作业类型暂无需填报项</text>
</view>
</view>
|
5059c4dd
刘淇
养护员提交养护工单
|
93
94
95
96
97
98
99
100
101
|
<!-- Tabs标签栏(图片切换:开始、进行中、结束、人员、材料)- 改造后 -->
<view class="tabs-wrap " style="margin-top: 30rpx;">
<up-tabs
v-model="activeTab"
:list="tabList"
line-width="40rpx"
active-color="#1989fa"
inactive-color="#666666"
@change = "imgTabChange"
|
e6a04285
刘淇
单图情况 宽高70*70
|
102
|
|
5059c4dd
刘淇
养护员提交养护工单
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
>
<!-- 使用content插槽自定义每个tab的内容,添加红色*号 -->
<template #content="{ item, index }">
<view class="tab-item-content">
<!-- 给索引0(开始)和索引2(结束)添加红色*号 -->
<text v-if="index === 0 || index === 2" class="required-star">*</text>
<text class="tab-text">{{ item.name }}</text>
</view>
</template>
</up-tabs>
<view class="tab-content" style="padding-top: 20rpx; background: #fff; padding-bottom: 20rpx;">
<!-- 开始阶段图片上传 -->
<view v-if="activeTab == 0">
<up-form-item prop="startImgs">
<up-upload
|
6c3b6516
刘淇
快速工单 加上业务线
|
118
|
:file-list="startImgs.rawImgList.value|| []"
|
5059c4dd
刘淇
养护员提交养护工单
|
119
120
121
122
123
124
125
126
127
128
129
130
131
|
@after-read="startImgs.uploadImgs"
@delete="startImgs.deleteImg"
multiple
:max-count="startImgs.uploadConfig.maxCount"
:upload-text="startImgs.uploadConfig.uploadText"
:size-type="startImgs.uploadConfig.sizeType"
></up-upload>
</up-form-item>
</view>
<!-- 进行中阶段图片上传 -->
<view v-if="activeTab == 1">
<up-form-item prop="processingImgs">
<up-upload
|
6c3b6516
刘淇
快速工单 加上业务线
|
132
|
:file-list="processingImgs.rawImgList.value|| []"
|
5059c4dd
刘淇
养护员提交养护工单
|
133
134
135
136
137
138
139
140
141
142
143
144
145
|
@after-read="processingImgs.uploadImgs"
@delete="processingImgs.deleteImg"
multiple
:max-count="processingImgs.uploadConfig.maxCount"
:upload-text="processingImgs.uploadConfig.uploadText"
:size-type="processingImgs.uploadConfig.sizeType"
></up-upload>
</up-form-item>
</view>
<!-- 结束阶段图片上传 -->
<view v-if="activeTab == 2">
<up-form-item prop="endImgs">
<up-upload
|
6c3b6516
刘淇
快速工单 加上业务线
|
146
|
:file-list="endImgs.rawImgList.value|| []"
|
5059c4dd
刘淇
养护员提交养护工单
|
147
148
149
150
151
152
153
154
155
156
157
158
159
|
@after-read="endImgs.uploadImgs"
@delete="endImgs.deleteImg"
multiple
:max-count="endImgs.uploadConfig.maxCount"
:upload-text="endImgs.uploadConfig.uploadText"
:size-type="endImgs.uploadConfig.sizeType"
></up-upload>
</up-form-item>
</view>
<!-- 人员配置图片上传 -->
<view v-if="activeTab == 3">
<up-form-item prop="personImgs">
<up-upload
|
6c3b6516
刘淇
快速工单 加上业务线
|
160
|
:file-list="personImgs.rawImgList.value|| []"
|
5059c4dd
刘淇
养护员提交养护工单
|
161
162
163
164
165
166
167
168
169
170
171
172
173
|
@after-read="personImgs.uploadImgs"
@delete="personImgs.deleteImg"
multiple
:max-count="personImgs.uploadConfig.maxCount"
:upload-text="personImgs.uploadConfig.uploadText"
:size-type="personImgs.uploadConfig.sizeType"
></up-upload>
</up-form-item>
</view>
<!-- 材料使用图片上传 -->
<view v-if="activeTab == 4">
<up-form-item prop="materialImgs">
<up-upload
|
6c3b6516
刘淇
快速工单 加上业务线
|
174
|
:file-list="materialImgs.rawImgList.value|| []"
|
5059c4dd
刘淇
养护员提交养护工单
|
175
176
177
178
179
180
181
182
183
|
@after-read="materialImgs.uploadImgs"
@delete="materialImgs.deleteImg"
multiple
:max-count="materialImgs.uploadConfig.maxCount"
:upload-text="materialImgs.uploadConfig.uploadText"
:size-type="materialImgs.uploadConfig.sizeType"
></up-upload>
</up-form-item>
</view>
|
fa775c6b
刘淇
养护计划调整
|
184
|
</view>
|
2764b83e
刘淇
分配养护员
|
185
|
</view>
|
fa775c6b
刘淇
养护计划调整
|
186
|
</up-form>
|
2764b83e
刘淇
分配养护员
|
187
188
|
</view>
|
fa775c6b
刘淇
养护计划调整
|
189
|
<!-- 底部提交按钮(保留,按需可移除) -->
|
2764b83e
刘淇
分配养护员
|
190
191
192
193
194
195
196
197
|
<view class="fixed-bottom-btn-wrap">
<up-button
type="primary"
text="提交工单"
@click="submitWorkOrder"
></up-button>
</view>
|
fa775c6b
刘淇
养护计划调整
|
198
|
<!-- 通用下拉弹窗(仅用于共同处理人多选) -->
|
2764b83e
刘淇
分配养护员
|
199
200
201
202
203
204
205
|
<up-action-sheet
:show="showActionSheet"
:actions="currentActionSheetData.list"
:title="currentActionSheetData.title"
@close="handleActionSheetClose"
@select="handleActionSheetSelect"
></up-action-sheet>
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
206
207
208
209
210
211
212
213
214
215
|
<!-- 作业类型选择弹窗(字典 maintain_type) -->
<up-action-sheet
:show="showWorkTypeSheet"
:actions="workTypeOptions"
title="请选择作业类型"
cancel-text="取消"
@close="showWorkTypeSheet = false"
@select="onWorkTypeSelect"
></up-action-sheet>
|
2764b83e
刘淇
分配养护员
|
216
217
218
219
|
</view>
</template>
<script setup>
|
fa775c6b
刘淇
养护计划调整
|
220
221
|
import { ref, reactive, watch } from 'vue'
import { onLoad, onReady, onShow } from '@dcloudio/uni-app';
|
2764b83e
刘淇
分配养护员
|
222
|
import { useUploadImgs } from '@/common/utils/useUploadImgs'
|
5059c4dd
刘淇
养护员提交养护工单
|
223
|
import { getYlWorkersPage, universalApproval } from '@/api/work-order-manage/work-order-manage'
|
28e3b4f3
王彪总
业务线 小程序不用写死,从后端接口获取
|
224
|
import { workRecordSubmit, getConfiguredWorkTypes } from '@/api/common'
|
5059c4dd
刘淇
养护员提交养护工单
|
225
|
import { nextStepMap } from '@/common/utils/common'
|
fa775c6b
刘淇
养护计划调整
|
226
|
import { useUserStore } from '@/pinia/user';
|
fa775c6b
刘淇
养护计划调整
|
227
|
const userStore = useUserStore();
|
2764b83e
刘淇
分配养护员
|
228
|
|
fa775c6b
刘淇
养护计划调整
|
229
230
|
// 表单Ref
const workOrderFormRef = ref(null)
|
2764b83e
刘淇
分配养护员
|
231
|
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
232
233
234
235
236
237
238
239
240
241
242
243
244
245
|
// 作业填报动态表单Ref(components/work-field-form)
const workFieldFormRef = ref(null)
// 作业类型选择弹窗
const showWorkTypeSheet = ref(false)
// 作业类型选项:字典 maintain_type(打开弹窗时取,避免字典异步加载导致首次为空)
const workTypeOptions = ref([])
// 当前作业类型下的动态字段数量(0 时给「无需填报」提示)
const dynamicFieldCount = ref(0)
// 动态字段提交幂等流水号:同一页面生命周期内保持不变,网络重试只落一条记录
let workRecordClientSeq = ''
|
28e3b4f3
王彪总
业务线 小程序不用写死,从后端接口获取
|
246
247
248
249
250
251
252
253
254
|
// 来源列表页标识(work-order/regional/ai),提交后回到用户进入时的列表
let fromPage = 'work-order'
// 来源标识 -> 列表页路径
const BACK_URL_MAP = {
'work-order': '/pages-sub/problem/work-order-manage/index',
'regional': '/pages-sub/problem/regional-order-manage/index',
'ai': '/pages-sub/problem/ai-manage/index'
}
|
fa775c6b
刘淇
养护计划调整
|
255
|
// 页面状态
|
2764b83e
刘淇
分配养护员
|
256
257
258
259
|
const showActionSheet = ref(false)
const currentActionSheetData = reactive({
type: '',
list: [],
|
fa775c6b
刘淇
养护计划调整
|
260
|
title: '',
|
2764b83e
刘淇
分配养护员
|
261
|
})
|
2764b83e
刘淇
分配养护员
|
262
|
|
fa775c6b
刘淇
养护计划调整
|
263
264
|
// Tabs配置(图片切换用)
const activeTab = ref(0)
|
2764b83e
刘淇
分配养护员
|
265
266
267
268
269
270
271
272
|
const tabList = ref([
{ name: '开始' },
{ name: '进行中' },
{ name: '结束' },
{ name: '人员' },
{ name: '材料' }
])
|
fa775c6b
刘淇
养护计划调整
|
273
274
|
// 共同处理人列表
const coProcessorList = ref([])
|
2764b83e
刘淇
分配养护员
|
275
|
|
371cf0eb
刘淇
流程节点
|
276
|
// 工单表单数据(修改:新增coProcessorName数组,coProcessorNameStr用于页面展示)
|
2764b83e
刘淇
分配养护员
|
277
|
const workOrderForm = reactive({
|
6c3b6516
刘淇
快速工单 加上业务线
|
278
|
busiLine:'',
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
279
280
281
|
businessType:'', // 业务类型(由 busiLine 首段得出,用于加载动态字段配置)
workTypeId:'', // 作业类型ID(字典 maintain_type,用于加载动态字段配置)
workTypeName:'', // 作业类型名称(页面展示)
|
5059c4dd
刘淇
养护员提交养护工单
|
282
283
|
workerDataId:'',
taskId:'', // 任务id
|
fa775c6b
刘淇
养护计划调整
|
284
|
orderNo: '', // 工单编号
|
371cf0eb
刘淇
流程节点
|
285
286
287
|
coProcessorId: [], // 共同处理人ID数组(多选,改为数组格式)
coProcessorName: [], // 共同处理人名称数组(多选,数组格式,用于提交)
coProcessorNameStr: '', // 共同处理人名称字符串(用于页面输入框展示)
|
fa775c6b
刘淇
养护计划调整
|
288
289
290
291
292
293
294
|
reason: '', // 处理情况描述
})
// ========== 图片上传配置(5个Tab分别配置,均限制3张,与参考示例一致) ==========
// 开始阶段图片
const startImgs = useUploadImgs({
maxCount: 3,
|
5059c4dd
刘淇
养护员提交养护工单
|
295
|
uploadText: '选择开始照片',
|
fa775c6b
刘淇
养护计划调整
|
296
297
298
299
300
301
302
|
sizeType: ['compressed'],
formRef: workOrderFormRef,
fieldName: 'startImgs'
})
// 进行中阶段图片
const processingImgs = useUploadImgs({
maxCount: 3,
|
5059c4dd
刘淇
养护员提交养护工单
|
303
|
uploadText: '选择进行中照片',
|
fa775c6b
刘淇
养护计划调整
|
304
305
306
307
308
309
310
|
sizeType: ['compressed'],
formRef: workOrderFormRef,
fieldName: 'processingImgs'
})
// 结束阶段图片
const endImgs = useUploadImgs({
maxCount: 3,
|
5059c4dd
刘淇
养护员提交养护工单
|
311
|
uploadText: '选择结束照片',
|
fa775c6b
刘淇
养护计划调整
|
312
313
314
|
sizeType: ['compressed'],
formRef: workOrderFormRef,
fieldName: 'endImgs'
|
2764b83e
刘淇
分配养护员
|
315
|
})
|
fa775c6b
刘淇
养护计划调整
|
316
317
318
|
// 人员配置图片
const personImgs = useUploadImgs({
maxCount: 3,
|
5059c4dd
刘淇
养护员提交养护工单
|
319
|
uploadText: '选择人员照片',
|
fa775c6b
刘淇
养护计划调整
|
320
321
322
323
324
325
326
|
sizeType: ['compressed'],
formRef: workOrderFormRef,
fieldName: 'personImgs'
})
// 材料使用图片
const materialImgs = useUploadImgs({
maxCount: 3,
|
5059c4dd
刘淇
养护员提交养护工单
|
327
|
uploadText: '选择材料照片',
|
fa775c6b
刘淇
养护计划调整
|
328
329
330
331
332
|
sizeType: ['compressed'],
formRef: workOrderFormRef,
fieldName: 'materialImgs'
})
|
6c3b6516
刘淇
快速工单 加上业务线
|
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
|
// // ========== 核心修复:监听每个上传实例的响应式数组变化,解决u-upload不刷新问题 ==========
// watch(() => startImgs.rawImgList.value, (newVal) => {
// startImgs.imgList = newVal
// }, { deep: true })
//
// watch(() => processingImgs.rawImgList.value, (newVal) => {
// processingImgs.imgList = newVal
// }, { deep: true })
//
// watch(() => endImgs.rawImgList.value, (newVal) => {
// endImgs.imgList = newVal
// }, { deep: true })
//
// watch(() => personImgs.rawImgList.value, (newVal) => {
// personImgs.imgList = newVal
// }, { deep: true })
//
// watch(() => materialImgs.rawImgList.value, (newVal) => {
// materialImgs.imgList = newVal
// }, { deep: true })
|
2764b83e
刘淇
分配养护员
|
353
|
|
fa775c6b
刘淇
养护计划调整
|
354
|
// 表单校验规则(新增5个图片字段校验,复用上传校验规则)
|
2764b83e
刘淇
分配养护员
|
355
|
const workOrderFormRules = reactive({
|
fa775c6b
刘淇
养护计划调整
|
356
|
orderNo: [
|
2764b83e
刘淇
分配养护员
|
357
358
|
{ type: 'string', trigger: ['change'] }
],
|
fa775c6b
刘淇
养护计划调整
|
359
360
361
362
|
reason: [
{ type: 'string', required: true, message: '请输入处理情况描述', trigger: ['change', 'blur'] },
{ type: 'string', max: 200, message: '处理情况描述最多200字', trigger: ['change', 'blur'] }
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
363
364
365
|
],
workTypeName: [
{ type: 'string', required: true, message: '请选择作业类型', trigger: ['change'] }
|
dacff5e3
刘淇
养护员退回
|
366
|
]
|
2764b83e
刘淇
分配养护员
|
367
368
|
})
|
dacff5e3
刘淇
养护员退回
|
369
|
// 生命周期 - 从本地缓存获取完整工单数据
|
2764b83e
刘淇
分配养护员
|
370
|
onLoad((options) => {
|
dacff5e3
刘淇
养护员退回
|
371
372
373
374
375
376
377
378
379
380
381
|
try {
// 1. 校验tempKey是否缺失
if (!options || !options.tempKey) {
uni.showToast({
title: '缺失工单缓存Key,无法加载数据',
icon: 'none',
duration: 3000
});
console.error('onLoad异常:options或tempKey缺失');
return;
}
|
5059c4dd
刘淇
养护员提交养护工单
|
382
|
|
dacff5e3
刘淇
养护员退回
|
383
|
const { tempKey } = options;
|
28e3b4f3
王彪总
业务线 小程序不用写死,从后端接口获取
|
384
385
|
// 来源列表页:养护员实施可能从工单管理、区域工单、AI 工单进入,提交后回原列表
fromPage = options.from || 'work-order';
|
dacff5e3
刘淇
养护员退回
|
386
387
388
389
390
391
392
393
394
395
|
let orderItem = {};
// 2. 读取缓存并校验缓存数据是否有效
orderItem = uni.getStorageSync(tempKey) || {};
if (JSON.stringify(orderItem) === '{}') {
uni.showToast({
title: '工单缓存数据为空,请重新进入',
icon: 'none',
duration: 3000
});
console.error('onLoad异常:工单缓存数据为空');
|
dacff5e3
刘淇
养护员退回
|
396
397
|
return;
}
|
5059c4dd
刘淇
养护员提交养护工单
|
398
|
|
dacff5e3
刘淇
养护员退回
|
399
400
|
// 可选:读取后移除缓存,避免冗余数据
uni.removeStorageSync(tempKey);
|
5059c4dd
刘淇
养护员提交养护工单
|
401
|
|
dacff5e3
刘淇
养护员退回
|
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
|
// 3. 填充基础表单数据(存在则赋值,不存在则提示)
if (!orderItem.id) {
uni.showToast({
title: '缺失工单ID,数据异常',
icon: 'none',
duration: 2000
});
console.warn('工单数据缺失:id');
}
if (!orderItem.taskId) {
uni.showToast({
title: '缺失任务ID,提交可能失败',
icon: 'none',
duration: 2000
});
console.warn('工单数据缺失:taskId');
}
if (!orderItem.orderNo) {
uni.showToast({
title: '缺失工单编号,数据异常',
icon: 'none',
duration: 2000
});
console.warn('工单数据缺失:orderNo');
}
workOrderForm.workerDataId = orderItem.id || '';
workOrderForm.taskId = orderItem.taskId || '';
workOrderForm.orderNo = orderItem.orderNo || '';
workOrderForm.reason = orderItem.handleResult || ''; // 处理情况回显
|
6c3b6516
刘淇
快速工单 加上业务线
|
432
|
workOrderForm.busiLine = orderItem.busiLine
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
433
434
435
436
437
438
|
// 业务线可能是逗号分隔多值(如 "yl,hj"),字段配置按单值定位,取首段
workOrderForm.businessType = String(orderItem.busiLine || '').split(',')[0].trim()
// 来源数据若已带作业类型则回显(工单主表当前无该字段,通常为空,由用户手选)
if (orderItem.workTypeId) {
workOrderForm.workTypeId = orderItem.workTypeId
workOrderForm.workTypeName = uni.$dict.getDictLabel('maintain_type', orderItem.workTypeId) || ''
|
28e3b4f3
王彪总
业务线 小程序不用写死,从后端接口获取
|
439
|
} else {
|
cd63e10a
王彪总
业务线 小程序不用写死,从后端接口获取
|
440
441
442
443
444
445
446
447
448
|
// 先按工单名「大类/小类」的小类匹配作业类型(如 秩序管理/经营秩序 -> 2014 经营秩序)
const matchedWorkType = matchWorkTypeByOrderName(orderItem.orderName)
if (matchedWorkType) {
workOrderForm.workTypeId = matchedWorkType.value
workOrderForm.workTypeName = matchedWorkType.label
} else {
// 兜底:该业务线只配了一个作业类型的字段时自动选中,进页即可看到填报项
loadDefaultWorkType()
}
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
449
|
}
|
371cf0eb
刘淇
流程节点
|
450
|
// 共同处理人(如有数据则回显,转换为数组格式)
|
dacff5e3
刘淇
养护员退回
|
451
|
if (orderItem.coHandlers && orderItem.coHandlersName) {
|
371cf0eb
刘淇
流程节点
|
452
453
454
455
456
457
458
459
460
461
|
// 处理ID:如果是字符串(逗号分隔),转为数组;本身是数组则直接赋值
workOrderForm.coProcessorId = Array.isArray(orderItem.coHandlers)
? orderItem.coHandlers
: (orderItem.coHandlers.split(',').filter(Boolean) || []);
// 处理名称:同理,转为数组格式(用于提交),并拼接为字符串(用于展示)
workOrderForm.coProcessorName = Array.isArray(orderItem.coHandlersName)
? orderItem.coHandlersName
: (orderItem.coHandlersName.split(',').filter(Boolean) || []);
// 拼接名称为字符串,用于输入框展示
workOrderForm.coProcessorNameStr = workOrderForm.coProcessorName.join(',');
|
dacff5e3
刘淇
养护员退回
|
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
|
} else {
console.warn('工单数据提示:无共同处理人信息');
}
// 4. 回显各类图片:使用 useUploadImgs 内置 setImgList 方法(自动添加 status: 'success')
// 校验图片字段是否存在,不存在则赋值空数组,避免报错
const startImgsArr = orderItem.startImgs || [];
const processingImgsArr = orderItem.processingImgs || [];
const endImgsArr = orderItem.endImgs || [];
const personImgsArr = orderItem.personImgs || [];
const materialImgsArr = orderItem.materialImgs || [];
// 图片回显前校验数组有效性
if (!Array.isArray(startImgsArr)) {
uni.showToast({
title: '开始图片数据格式异常',
icon: 'none',
duration: 2000
});
console.error('开始图片异常:非数组格式');
}
if (!Array.isArray(endImgsArr)) {
uni.showToast({
title: '结束图片数据格式异常',
icon: 'none',
duration: 2000
});
console.error('结束图片异常:非数组格式');
}
startImgs.setImgList(startImgsArr);
processingImgs.setImgList(processingImgsArr);
endImgs.setImgList(endImgsArr);
personImgs.setImgList(personImgsArr);
materialImgs.setImgList(materialImgsArr);
// 5. 校验必填图片(开始/结束)是否为空,提前提示
if (startImgsArr.length === 0) {
uni.showToast({
title: '开始图片为空,请补充上传',
icon: 'none',
duration: 2000
});
console.warn('工单提示:开始图片数组为空');
}
if (endImgsArr.length === 0) {
uni.showToast({
title: '结束图片为空,请补充上传',
icon: 'none',
duration: 2000
});
console.warn('工单提示:结束图片数组为空');
}
console.log('工单数据初始化完成:', workOrderForm);
} catch (error) {
uni.showToast({
title: '工单数据加载失败,请重试',
icon: 'none',
duration: 3000
});
console.error('获取工单缓存数据失败:', error);
|
dacff5e3
刘淇
养护员退回
|
524
|
}
|
2764b83e
刘淇
分配养护员
|
525
526
|
})
|
fa775c6b
刘淇
养护计划调整
|
527
|
// 生命周期 - 初始化表单规则
|
2764b83e
刘淇
分配养护员
|
528
|
onReady(() => {
|
dacff5e3
刘淇
养护员退回
|
529
530
531
532
533
534
535
536
537
|
// 校验表单实例是否存在
if (!workOrderFormRef.value) {
uni.showToast({
title: '表单实例初始化失败',
icon: 'none',
duration: 2000
});
console.error('onReady异常:workOrderFormRef.value 为空');
return;
|
2764b83e
刘淇
分配养护员
|
538
|
}
|
dacff5e3
刘淇
养护员退回
|
539
|
workOrderFormRef.value.setRules(workOrderFormRules)
|
2764b83e
刘淇
分配养护员
|
540
541
|
})
|
fa775c6b
刘淇
养护计划调整
|
542
|
// 生命周期 - 加载共同处理人列表
|
2764b83e
刘淇
分配养护员
|
543
|
onShow(async () => {
|
2764b83e
刘淇
分配养护员
|
544
545
546
|
await loadCoProcessorList()
})
|
fa775c6b
刘淇
养护计划调整
|
547
|
// 加载共同处理人列表
|
2764b83e
刘淇
分配养护员
|
548
549
550
|
const loadCoProcessorList = async () => {
try {
uni.showLoading({ title: '获取处理人列表中...' })
|
2764b83e
刘淇
分配养护员
|
551
|
const queryData = {
|
6c3b6516
刘淇
快速工单 加上业务线
|
552
553
|
// roleCode: 'yl_worker',
busiLine: workOrderForm.busiLine,
|
2764b83e
刘淇
分配养护员
|
554
555
556
557
|
pageNo: 1,
pageSize: 100
}
const res = await getYlWorkersPage(queryData)
|
dacff5e3
刘淇
养护员退回
|
558
559
560
561
562
563
564
565
566
567
568
569
570
571
|
// 校验接口返回数据是否有效
if (!res || !res.list) {
uni.showToast({
title: '获取处理人列表失败(无数据)',
icon: 'none',
duration: 2000
});
console.error('loadCoProcessorList异常:接口返回无有效数据');
coProcessorList.value = [];
uni.hideLoading();
return;
}
|
2764b83e
刘淇
分配养护员
|
572
573
|
uni.hideLoading()
|
fa775c6b
刘淇
养护计划调整
|
574
|
if (res.list && res.list.length > 0) {
|
dacff5e3
刘淇
养护员退回
|
575
576
577
578
579
580
581
582
583
584
585
586
|
coProcessorList.value = res.list.map(item => {
// 校验列表项是否含必填字段
if (!item.id || !item.nickname) {
console.warn('处理人列表项异常:缺失id或nickname', item);
return null;
}
return {
name: item.nickname,
value: item.id,
id: item.id
}
}).filter(Boolean); // 过滤null项
|
2764b83e
刘淇
分配养护员
|
587
588
|
} else {
coProcessorList.value = []
|
8ddc6f6e
刘淇
登录 修改样式
|
589
590
591
592
593
|
// uni.showToast({
// title: '暂无共同处理人数据',
// icon: 'none',
// duration: 1000
// });
|
dacff5e3
刘淇
养护员退回
|
594
|
console.warn('loadCoProcessorList提示:处理人列表为空');
|
2764b83e
刘淇
分配养护员
|
595
596
597
|
}
} catch (err) {
uni.hideLoading()
|
dacff5e3
刘淇
养护员退回
|
598
599
600
601
602
|
uni.showToast({
title: '获取处理人列表失败,请重试',
icon: 'none',
duration: 3000
});
|
2764b83e
刘淇
分配养护员
|
603
|
console.error('获取共同处理人列表失败:', err)
|
2764b83e
刘淇
分配养护员
|
604
605
606
607
|
coProcessorList.value = []
}
}
|
fa775c6b
刘淇
养护计划调整
|
608
|
// 打开通用下拉弹窗(仅共同处理人)
|
2764b83e
刘淇
分配养护员
|
609
|
const handleActionSheetOpen = (type) => {
|
dacff5e3
刘淇
养护员退回
|
610
611
612
613
614
615
616
617
618
619
620
621
|
// 校验弹窗类型是否为支持的类型
if (type !== 'coProcessor') {
uni.showToast({
title: '不支持该弹窗类型',
icon: 'none',
duration: 2000
});
console.error('handleActionSheetOpen异常:不支持的弹窗类型', type);
return;
}
// 共同处理人列表为空时,提示并返回
|
2764b83e
刘淇
分配养护员
|
622
|
if (type === 'coProcessor' && coProcessorList.value.length === 0) {
|
dacff5e3
刘淇
养护员退回
|
623
624
625
626
627
628
|
uni.showToast({
title: '暂无共同处理人可选',
icon: 'none',
duration: 2000
});
console.warn('handleActionSheetOpen提示:共同处理人列表为空');
|
2764b83e
刘淇
分配养护员
|
629
630
631
|
return
}
|
fa775c6b
刘淇
养护计划调整
|
632
|
// 弹窗配置映射(仅保留共同处理人)
|
2764b83e
刘淇
分配养护员
|
633
634
635
|
const configMap = {
coProcessor: {
title: '请选择共同处理人',
|
fa775c6b
刘淇
养护计划调整
|
636
|
list: coProcessorList.value,
|
2764b83e
刘淇
分配养护员
|
637
638
639
640
641
642
643
644
645
|
}
}
currentActionSheetData.type = type
currentActionSheetData.title = configMap[type].title
currentActionSheetData.list = configMap[type].list
showActionSheet.value = true
}
|
fa775c6b
刘淇
养护计划调整
|
646
|
// 关闭通用下拉弹窗
|
2764b83e
刘淇
分配养护员
|
647
648
|
const handleActionSheetClose = () => {
showActionSheet.value = false
|
dacff5e3
刘淇
养护员退回
|
649
|
// 重置弹窗数据,避免残留
|
2764b83e
刘淇
分配养护员
|
650
651
652
653
654
|
currentActionSheetData.type = ''
currentActionSheetData.list = []
currentActionSheetData.title = ''
}
|
371cf0eb
刘淇
流程节点
|
655
|
// 下拉弹窗选择事件(修改:支持多选,存储名称和ID为数组)
|
2764b83e
刘淇
分配养护员
|
656
|
const handleActionSheetSelect = (e) => {
|
dacff5e3
刘淇
养护员退回
|
657
658
659
660
661
662
663
664
665
666
667
668
|
// 校验事件参数是否有效
if (!e || !e.name || !e.id) {
uni.showToast({
title: '选择处理人失败(参数异常)',
icon: 'none',
duration: 2000
});
console.error('handleActionSheetSelect异常:e参数缺失name或id', e);
showActionSheet.value = false;
return;
}
|
2764b83e
刘淇
分配养护员
|
669
|
const { type } = currentActionSheetData
|
371cf0eb
刘淇
流程节点
|
670
|
// 多选场景(仅共同处理人,存储数组格式)
|
fa775c6b
刘淇
养护计划调整
|
671
|
if (type === 'coProcessor') {
|
371cf0eb
刘淇
流程节点
|
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
|
// 若已选中该处理人,移除(实现切换选择);未选中则添加
const idIndex = workOrderForm.coProcessorId.findIndex(id => id === e.id);
if (idIndex > -1) {
// 移除已选中的ID和名称
workOrderForm.coProcessorId.splice(idIndex, 1);
workOrderForm.coProcessorName.splice(idIndex, 1);
} else {
// 添加新选中的ID和名称(数组格式)
workOrderForm.coProcessorId.push(e.id);
workOrderForm.coProcessorName.push(e.name);
}
// 拼接名称数组为字符串,用于输入框展示
workOrderForm.coProcessorNameStr = workOrderForm.coProcessorName.join(',');
|
dacff5e3
刘淇
养护员退回
|
687
688
689
690
691
692
|
// 校验表单实例是否存在,再执行字段校验
if (workOrderFormRef.value) {
workOrderFormRef.value?.validateField('coProcessorName')
} else {
console.warn('handleActionSheetSelect提示:表单实例不存在,跳过字段校验');
}
|
2764b83e
刘淇
分配养护员
|
693
694
695
696
|
}
showActionSheet.value = false
}
|
fa775c6b
刘淇
养护计划调整
|
697
698
|
// 图片切换选择
const imgTabChange = (item)=> {
|
dacff5e3
刘淇
养护员退回
|
699
700
701
702
703
704
705
706
707
708
|
// 校验切换参数是否有效
if (!item || item.index === undefined || item.index === null) {
uni.showToast({
title: '图片标签切换失败(参数异常)',
icon: 'none',
duration: 2000
});
console.error('imgTabChange异常:item参数缺失index', item);
return;
}
|
fa775c6b
刘淇
养护计划调整
|
709
|
activeTab.value = item.index
|
2764b83e
刘淇
分配养护员
|
710
711
|
}
|
fa775c6b
刘淇
养护计划调整
|
712
|
// 隐藏键盘
|
2764b83e
刘淇
分配养护员
|
713
714
715
716
|
const hideKeyboard = () => {
uni.hideKeyboard()
}
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
|
// 打开作业类型选择弹窗
const openWorkTypeSheet = () => {
// up-action-sheet 用 name 展示,value 作为回传值
workTypeOptions.value = uni.$dict.getDictSimpleList('maintain_type')
.map(item => ({ name: item.label, value: item.value }))
if (workTypeOptions.value.length === 0) {
uni.showToast({
title: '暂无作业类型字典数据',
icon: 'none',
duration: 2000
})
return
}
showWorkTypeSheet.value = true
}
// 选择作业类型:驱动动态字段按「业务类型 + 作业类型」重新加载
const onWorkTypeSelect = (e) => {
showWorkTypeSheet.value = false
if (!e || e.value === undefined || e.value === null || e.value === '') {
return
}
workOrderForm.workTypeId = e.value
workOrderForm.workTypeName = e.name
dynamicFieldCount.value = 0
if (workOrderFormRef.value) {
workOrderFormRef.value.validateField('workTypeName')
}
}
// 动态字段加载完成(count=0 时页面提示「暂无需填报项」)
const onDynamicFieldsLoaded = (count) => {
dynamicFieldCount.value = count || 0
}
|
28e3b4f3
王彪总
业务线 小程序不用写死,从后端接口获取
|
752
|
/**
|
cd63e10a
王彪总
业务线 小程序不用写死,从后端接口获取
|
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
|
* 按工单名匹配作业类型:工单名格式「大类/小类」,小类与字典 maintain_type 的 label 同名
* (如 秩序管理/经营秩序 -> 2014 经营秩序),命中即自动带出,养护员仍可在弹窗里手改。
* @param {String} orderName 工单名,如「秩序管理/经营秩序」
* @returns {{value: String, label: String}|null} 未命中返回 null
*/
const matchWorkTypeByOrderName = (orderName) => {
const subName = String(orderName || '').split('/').pop().trim()
if (!subName) {
return null
}
const dictList = uni.$dict.getDictSimpleList('maintain_type') || []
return dictList.find(item => item.label === subName) || null
}
/**
* 兜底自动带出作业类型:该业务线下只有一个作业类型配置了填报项时直接选中,
|
28e3b4f3
王彪总
业务线 小程序不用写死,从后端接口获取
|
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
|
* 动态字段块随之渲染(v-if 绑在 workTypeId 上),用户不用先猜该选哪个作业类型。
* 配了多个时不自动选,交给用户手选。
*/
const loadDefaultWorkType = async () => {
if (!workOrderForm.businessType) {
return
}
try {
const list = await getConfiguredWorkTypes({
businessType: workOrderForm.businessType,
bizType: 1
})
if (!Array.isArray(list) || list.length !== 1) {
return
}
const only = list[0]
workOrderForm.workTypeId = only.workTypeId
workOrderForm.workTypeName = only.workTypeName
|| uni.$dict.getDictLabel('maintain_type', only.workTypeId)
|| ''
dynamicFieldCount.value = 0
} catch (error) {
console.warn('获取已配置填报项的作业类型失败:', error)
}
}
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
795
796
797
|
// 动态字段提交幂等流水号(后端按 userId+clientSeq 去重)
const genClientSeq = () => `${Date.now()}-${Math.random().toString(16).slice(2, 10)}`
|
371cf0eb
刘淇
流程节点
|
798
|
// 提交工单(修改:将coProcessorName数组一并传入提交参数)
|
2764b83e
刘淇
分配养护员
|
799
800
|
const submitWorkOrder = async () => {
try {
|
dacff5e3
刘淇
养护员退回
|
801
802
803
804
805
806
807
808
809
810
811
812
|
// ========== 前置校验:表单实例是否存在 ==========
if (!workOrderFormRef.value) {
uni.showToast({
title: '表单实例异常,无法提交',
icon: 'none',
duration: 2000
});
console.error('submitWorkOrder异常:workOrderFormRef.value 为空');
return;
}
// ========== 开始/结束图片必填校验 ==========
|
5059c4dd
刘淇
养护员提交养护工单
|
813
814
815
|
const startImgUrls = startImgs.getSuccessImgUrls(); // 开始阶段图片URL数组
const endImgUrls = endImgs.getSuccessImgUrls(); // 结束阶段图片URL数组
|
dacff5e3
刘淇
养护员退回
|
816
817
818
819
|
// 打印日志验证(可选,用于排查)
console.log('开始图片有效URL:', startImgUrls);
console.log('结束图片有效URL:', endImgUrls);
|
5059c4dd
刘淇
养护员提交养护工单
|
820
|
// 判断开始图片是否为空
|
dacff5e3
刘淇
养护员退回
|
821
|
if (!Array.isArray(startImgUrls) || startImgUrls.length === 0) {
|
5059c4dd
刘淇
养护员提交养护工单
|
822
823
824
825
826
|
uni.showToast({
title: '请至少上传1张开始阶段图片',
icon: 'none',
duration: 2000
});
|
dacff5e3
刘淇
养护员退回
|
827
|
console.warn('submitWorkOrder校验失败:开始图片为空');
|
5059c4dd
刘淇
养护员提交养护工单
|
828
829
830
831
|
return; // 终止提交流程
}
// 判断结束图片是否为空
|
dacff5e3
刘淇
养护员退回
|
832
|
if (!Array.isArray(endImgUrls) || endImgUrls.length === 0) {
|
5059c4dd
刘淇
养护员提交养护工单
|
833
834
835
836
837
|
uni.showToast({
title: '请至少上传1张结束阶段图片',
icon: 'none',
duration: 2000
});
|
dacff5e3
刘淇
养护员退回
|
838
|
console.warn('submitWorkOrder校验失败:结束图片为空');
|
5059c4dd
刘淇
养护员提交养护工单
|
839
840
|
return; // 终止提交流程
}
|
5059c4dd
刘淇
养护员提交养护工单
|
841
|
|
dacff5e3
刘淇
养护员退回
|
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
|
// ========== 处理情况必填校验(兜底,防止表单校验失效) ==========
if (!workOrderForm.reason || workOrderForm.reason.trim().length === 0) {
uni.showToast({
title: '请输入处理情况描述',
icon: 'none',
duration: 2000
});
console.warn('submitWorkOrder校验失败:处理情况为空');
return;
}
if (workOrderForm.reason.trim().length > 200) {
uni.showToast({
title: '处理情况描述不能超过200字',
icon: 'none',
duration: 2000
});
console.warn('submitWorkOrder校验失败:处理情况超过200字');
return;
}
// ========== 原有表单校验 ==========
|
2764b83e
刘淇
分配养护员
|
863
864
|
await workOrderFormRef.value.validate()
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
|
// ========== 作业类型 + 动态字段校验 ==========
if (!workOrderForm.workTypeId) {
uni.showToast({
title: '请选择作业类型',
icon: 'none',
duration: 2000
});
console.warn('submitWorkOrder校验失败:作业类型为空');
return;
}
let dynamicValues = []
if (workFieldFormRef.value) {
// 校验失败时 reject 字段数组(uview-plus 已提示),交给外层 catch 忽略
await workFieldFormRef.value.validate()
dynamicValues = workFieldFormRef.value.getValues()
}
|
dacff5e3
刘淇
养护员退回
|
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
|
// ========== 校验核心提交参数 ==========
if (!workOrderForm.taskId) {
uni.showToast({
title: '缺失任务ID,无法提交',
icon: 'none',
duration: 2000
});
console.error('submitWorkOrder异常:taskId 为空');
return;
}
if (!workOrderForm.workerDataId) {
uni.showToast({
title: '缺失工单ID,无法提交',
icon: 'none',
duration: 2000
});
console.error('submitWorkOrder异常:workerDataId 为空');
return;
}
|
5059c4dd
刘淇
养护员提交养护工单
|
902
|
// 构造所有图片URL(原有代码不变)
|
fa775c6b
刘淇
养护计划调整
|
903
|
const allImgs = {
|
dacff5e3
刘淇
养护员退回
|
904
905
906
907
908
|
startImgs: startImgUrls,
processingImgs: processingImgs.getSuccessImgUrls() || [],
endImgs: endImgUrls,
personImgs: personImgs.getSuccessImgUrls() || [],
materialImgs: materialImgs.getSuccessImgUrls() || []
|
fa775c6b
刘淇
养护计划调整
|
909
910
|
}
|
371cf0eb
刘淇
流程节点
|
911
|
// 构造提交参数(修改:添加coProcessorName数组一并提交)
|
2764b83e
刘淇
分配养护员
|
912
|
const submitData = {
|
5059c4dd
刘淇
养护员提交养护工单
|
913
914
|
taskId: workOrderForm.taskId,
taskKey:'ylWorker',
|
dacff5e3
刘淇
养护员退回
|
915
916
|
operateType: nextStepMap['ylWorker']?.operateTypePass || '', // 兜底:防止nextStepMap缺失属性
workerDataId: Number(workOrderForm.workerDataId) || '',
|
5059c4dd
刘淇
养护员提交养护工单
|
917
|
handleResult: workOrderForm.reason.trim(),
|
371cf0eb
刘淇
流程节点
|
918
919
|
coHandlers: workOrderForm.coProcessorId || [], // ID数组
coHandlersName: workOrderForm.coProcessorName || [], // 名称数组(一并提交)
|
fa775c6b
刘淇
养护计划调整
|
920
921
922
923
924
|
startImgs: allImgs.startImgs,
processingImgs: allImgs.processingImgs,
endImgs: allImgs.endImgs,
personImgs: allImgs.personImgs,
materialImgs: allImgs.materialImgs,
|
5059c4dd
刘淇
养护员提交养护工单
|
925
|
problemsImgs:[]
|
2764b83e
刘淇
分配养护员
|
926
|
}
|
dacff5e3
刘淇
养护员退回
|
927
|
|
371cf0eb
刘淇
流程节点
|
928
929
930
|
// 打印提交参数,验证coProcessorName是否为数组
console.log('提交参数(含名称数组):', submitData);
|
dacff5e3
刘淇
养护员退回
|
931
932
933
934
935
936
937
938
939
940
|
// 校验operateType是否有效
if (!submitData.operateType) {
uni.showToast({
title: '提交类型异常,无法提交',
icon: 'none',
duration: 2000
});
console.error('submitWorkOrder异常:operateType 为空');
return;
}
|
2764b83e
刘淇
分配养护员
|
941
|
|
2764b83e
刘淇
分配养护员
|
942
|
uni.showLoading({ title: '提交中...' })
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
|
// ========== 先落作业填报(动态字段),再走审批流转 ==========
// 值按「业务类型 + 作业类型」的字段配置落库;同一工单重复实施时后端按 (bizType,bizId) 覆盖原记录并红冲旧物料
if (dynamicValues.length > 0) {
if (!workRecordClientSeq) {
workRecordClientSeq = genClientSeq()
}
await workRecordSubmit({
businessType: workOrderForm.businessType,
bizType: 1,
bizId: Number(workOrderForm.workerDataId),
workTypeId: Number(workOrderForm.workTypeId),
clientSeq: workRecordClientSeq,
remark: workOrderForm.reason.trim(),
fields: dynamicValues
})
}
|
5059c4dd
刘淇
养护员提交养护工单
|
961
|
const res = await universalApproval(submitData)
|
dacff5e3
刘淇
养护员退回
|
962
963
964
965
966
967
968
969
970
971
972
973
974
|
// 校验接口返回结果
if (!res) {
uni.hideLoading();
uni.showToast({
title: '工单提交失败(接口无返回)',
icon: 'none',
duration: 3000
});
console.error('submitWorkOrder异常:universalApproval接口无有效返回');
return;
}
|
2764b83e
刘淇
分配养护员
|
975
|
uni.hideLoading()
|
fa775c6b
刘淇
养护计划调整
|
976
|
|
2764b83e
刘淇
分配养护员
|
977
978
979
980
981
982
|
uni.showToast({
title: '工单提交成功',
icon: 'success',
duration: 1000
})
|
28e3b4f3
王彪总
业务线 小程序不用写死,从后端接口获取
|
983
|
// 延迟跳转:来源列表页在 onShow 中不做刷新,用 reLaunch 重建页面保证待办数据最新
|
2764b83e
刘淇
分配养护员
|
984
|
setTimeout(() => {
|
4fa8cf12
刘淇
巡查员结束工单
|
985
|
uni.reLaunch({
|
28e3b4f3
王彪总
业务线 小程序不用写死,从后端接口获取
|
986
|
url: BACK_URL_MAP[fromPage] || BACK_URL_MAP['work-order']
|
2764b83e
刘淇
分配养护员
|
987
988
989
990
991
|
})
}, 1000)
} catch (error) {
uni.hideLoading()
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
992
993
994
|
// 本次提交失败后重置流水号:下次重试允许按最新填报值覆盖原记录(后端按 bizType+bizId 覆盖,不会重复建单)
workRecordClientSeq = ''
|
dacff5e3
刘淇
养护员退回
|
995
|
// 区分校验失败和接口失败,仅接口失败时提示(校验失败已有内置提示)
|
2764b83e
刘淇
分配养护员
|
996
|
if (!Array.isArray(error)) {
|
2764b83e
刘淇
分配养护员
|
997
998
999
1000
|
uni.showToast({
title: '提交失败,请重试',
icon: 'none',
duration: 2000
|
dacff5e3
刘淇
养护员退回
|
1001
1002
1003
1004
|
});
console.error('工单提交失败:', error)
} else {
console.warn('工单提交校验失败:', error);
|
2764b83e
刘淇
分配养护员
|
1005
1006
1007
1008
1009
1010
|
}
}
}
</script>
<style lang="scss" scoped>
|
fa775c6b
刘淇
养护计划调整
|
1011
|
// 页面容器样式
|
2764b83e
刘淇
分配养护员
|
1012
1013
|
.page-container {
min-height: 100vh;
|
dacff5e3
刘淇
养护员退回
|
1014
|
padding-bottom: 100rpx; // 给底部按钮留空间
|
2764b83e
刘淇
分配养护员
|
1015
1016
|
}
|
fa775c6b
刘淇
养护计划调整
|
1017
|
// 表单内容容器
|
2764b83e
刘淇
分配养护员
|
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
|
.work-order-form-content {
background: #fff;
padding-bottom: 30rpx;
}
// Tabs容器样式
.tabs-wrap {
background: #fff;
}
|
dacff5e3
刘淇
养护员退回
|
1028
|
// Tab自定义内容样式(红色*号)
|
5059c4dd
刘淇
养护员提交养护工单
|
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
|
.tab-item-content {
display: flex;
align-items: center;
}
.required-star {
color: #f53f3f; // 红色必填标识
margin-right: 4rpx; // 与文字保持小间距
font-weight: bold;
}
|
dd60ac14
王彪总
业务线 小程序不用写死,从后端接口获取
|
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
|
// 作业填报(动态字段)区块
.dynamic-field-block {
margin-top: 10rpx;
.dynamic-field-title {
padding: 20rpx 0 10rpx;
font-size: 30rpx;
font-weight: 600;
color: #303133;
border-bottom: 1rpx solid #f0f0f0;
}
.dynamic-field-empty {
padding: 30rpx 0;
text-align: center;
font-size: 26rpx;
color: #999;
}
}
|
e6a04285
刘淇
单图情况 宽高70*70
|
1060
|
|
2764b83e
刘淇
分配养护员
|
1061
|
</style>
|