Blame view

pages-sub/daily/maintain-manage/add-record.vue 33.7 KB
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
1
  <template>
d433e7f6   刘淇   工单
2
3
    <view class="page-container">
      <view class="inspect-form-content commonPageLRpadding">
de549a92   刘淇   养护。动态表单
4
5
6
        <up-form label-position="left" :model="inspectForm" ref="inspectFormRef" label-width="140rpx">
          <!-- ========== 动态表单区域 ========== -->
          <template v-for="item in dynamicFields" :key="item.fieldCode">
ee792d52   刘淇   动态表单
7
8
9
10
11
12
13
14
            <up-form-item
              :label="item.fieldName"
              :prop="item.fieldCode"
              :required="item.required === 1"
              class="form-item"
              @click="openPickerIfNeeded(item)"
            >
              <!-- type1 数值:u-number-box -->
de549a92   刘淇   养护。动态表单
15
              <view v-if="item.fieldType === 1" class="number-box-wrap">
ee792d52   刘淇   动态表单
16
17
18
19
                <u-number-box
                  v-model="inspectForm[item.fieldCode]"
                  min="1"
                  step="1"
de549a92   刘淇   养护。动态表单
20
                  :max="item.length ? 10 ** Number(item.length) - 1 : null"
ee792d52   刘淇   动态表单
21
22
23
24
                  :placeholder="`请输入${item.fieldName}${item.unit ? item.unit : ''}`"
                  @change="valChange(item)"
                  class="large-number-box"
                ></u-number-box>
de549a92   刘淇   养护。动态表单
25
26
                <text class="unit-text" v-if="item.unit">{{ item.unit }}</text>
              </view>
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
27
  
ee792d52   刘淇   动态表单
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
              <!-- type2 文本 -->
              <up-input
                v-else-if="item.fieldType === 2"
                v-model="inspectForm[item.fieldCode]"
                :maxlength="item.length || 50"
                :placeholder="`请输入${item.fieldName}`"
              ></up-input>
  
              <!-- type3 枚举多选 multiple=1 -->
              <u-checkbox-group v-else-if="item.fieldType === 3 && item.multiple === 1" v-model="inspectForm[item.fieldCode]">
                <u-checkbox
                  v-for="opt in item.selectOptions"
                  :key="opt.value"
                  :label="opt.label"
                  :name="opt.value"
                ></u-checkbox>
de549a92   刘淇   养护。动态表单
44
              </u-checkbox-group>
ee792d52   刘淇   动态表单
45
46
47
48
49
50
51
52
53
54
  
              <!-- type3 枚举单选 multiple=0 -->
              <up-input
                v-else-if="item.fieldType === 3"
                v-model="labelMap[item.fieldCode]"
                readonly
                disabled-color="#ffffff"
                :placeholder="`请选择${item.fieldName}`"
                border="none"
              >
de549a92   刘淇   养护。动态表单
55
56
57
58
                <template #right>
                  <up-icon name="arrow-right" size="16"></up-icon>
                </template>
              </up-input>
ee792d52   刘淇   动态表单
59
  
de549a92   刘淇   养护。动态表单
60
61
              <!-- type4 日期时间 -->
              <view v-else-if="item.fieldType === 4" @click.stop="openDatePicker(item)" class="date-input-wrap">
ee792d52   刘淇   动态表单
62
63
64
65
66
67
                <up-input
                  v-model="inspectForm[item.fieldCode]"
                  disabled
                  placeholder="点击选择时间"
                  border="none"
                ></up-input>
de549a92   刘淇   养护。动态表单
68
              </view>
ee792d52   刘淇   动态表单
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
  
              <!-- type5 布尔单选 是/否 -->
              <u-radio-group v-else-if="item.fieldType === 5" v-model="inspectForm[item.fieldCode]">
                <u-radio label="是" name="是"></u-radio>
                <u-radio label="否" name="否"></u-radio>
              </u-radio-group>
  
              <!-- ===================== type6 弹窗选择 ===================== -->
              <up-input
                v-else-if="item.fieldType === 6"
                :model-value="getType6ShowLabel(item)"
                readonly
                disabled-color="#ffffff"
                :placeholder="`请选择${item.fieldName}`"
                border="none"
              >
                <template #right>
                  <up-icon name="arrow-right" size="16"></up-icon>
                </template>
              </up-input>
  
              <!-- type7 图片上传 -->
              <up-upload
                v-else-if="item.fieldType === 7"
                :file-list="fileListMap[item.fieldCode] || []"
                @after-read="(event) => uploadFieldFiles(item, event)"
                @delete="(event) => deleteFieldFile(item, event)"
                multiple
                :max-count="pickCountOf(item, 5)"
                upload-text="上传图片"
                class="upload-wrap"
              ></up-upload>
  
              <!-- type8 附件 -->
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
103
              <view v-else-if="item.fieldType === 8" class="file-wrap">
ee792d52   刘淇   动态表单
104
105
106
107
108
                <view
                  v-for="(file, idx) in fileListMap[item.fieldCode] || []"
                  :key="idx"
                  class="file-row"
                >
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
109
                  <text class="file-name">{{ file.name || fileNameOf(file.url) }}</text>
ee792d52   刘淇   动态表单
110
                  <text class="file-del" @click.stop="deleteFieldFile(item, {index: idx})">删除</text>
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
111
                </view>
ee792d52   刘淇   动态表单
112
113
114
115
116
117
118
                <up-button
                  size="small"
                  type="primary"
                  plain
                  :text="fileButtonText(item)"
                  @click.stop="chooseFieldFiles(item)"
                ></up-button>
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
119
              </view>
ee792d52   刘淇   动态表单
120
121
122
123
124
125
126
127
128
129
  
              <!-- type9 关联记录 单选 -->
              <up-input
                v-else-if="item.fieldType === 9"
                v-model="labelMap[item.fieldCode]"
                readonly
                disabled-color="#ffffff"
                :placeholder="`请选择${item.fieldName}`"
                border="none"
              >
de549a92   刘淇   养护。动态表单
130
131
132
133
                <template #right>
                  <up-icon name="arrow-right" size="16"></up-icon>
                </template>
              </up-input>
ee792d52   刘淇   动态表单
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  
              <!-- type10 URL链接 -->
              <up-input
                v-else-if="item.fieldType === 10"
                v-model.trim="inspectForm[item.fieldCode]"
                placeholder="请输入链接(http/https开头)"
              ></up-input>
  
              <!-- type11 地理位置 -->
              <up-input
                v-else-if="item.fieldType === 11"
                v-model="labelMap[item.fieldCode]"
                readonly
                disabled-color="#ffffff"
                placeholder="点击选择位置"
                border="none"
              >
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
151
152
153
154
                <template #right>
                  <up-icon name="arrow-right" size="16"></up-icon>
                </template>
              </up-input>
ee792d52   刘淇   动态表单
155
156
157
  
              <!-- 物料附加数量输入框 type3 + optionSource=5 -->
              <view v-if="item.fieldType === 3 && item.optionSource === 5" class="qty-row qty-row-material">
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
158
                <text class="qty-label">领用数量</text>
ee792d52   刘淇   动态表单
159
160
161
162
163
                <u-number-box
                  v-model="qtyMap[item.fieldCode]"
                  min="0"
                  step="1"
                ></u-number-box>
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
164
              </view>
de549a92   刘淇   养护。动态表单
165
166
167
            </up-form-item>
          </template>
          <!-- ========== 动态表单结束 ========== -->
ee792d52   刘淇   动态表单
168
169
170
171
172
173
174
175
176
  
          <!-- 养护描述 -->
          <up-form-item prop="remark" label="养护描述">
            <up-textarea
              v-model.trim="inspectForm.remark"
              placeholder="请输入养护描述"
              maxlength="200"
              count
            ></up-textarea>
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
177
          </up-form-item>
ee792d52   刘淇   动态表单
178
179
180
181
182
183
184
185
186
187
188
189
  
          <!-- 图片上传 -->
          <up-form-item label="上传图片" prop="images" required>
            <up-upload
              :file-list="imageList"
              @after-read="uploadImages"
              @delete="deleteImage"
              @on-exceed="handleExceed"
              multiple
              :max-count="3"
              upload-text="上传图片"
            ></up-upload>
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
190
          </up-form-item>
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
191
192
        </up-form>
      </view>
ee792d52   刘淇   动态表单
193
  
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
194
      <!-- 底部提交按钮 -->
ee792d52   刘淇   动态表单
195
196
197
198
199
200
201
      <view class="fixed-bottom-wrap">
        <up-button
          type="primary"
          text="提交"
          @click="submitInspect"
          style="width:100%;height:88rpx;font-size:32rpx;border-radius:0"
        ></up-button>
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
202
      </view>
ee792d52   刘淇   动态表单
203
204
205
206
207
208
209
210
211
212
213
  
      <!-- 日期选择弹窗 -->
      <up-datetime-picker
        :show="datePickerShow"
        v-model="datePickerValue"
        mode="datetime"
        close-on-click-overlay
        @confirm="onDateConfirm"
        @cancel="onDateClose"
      ></up-datetime-picker>
  
de549a92   刘淇   养护。动态表单
214
      <!-- ActionSheet 底部选择弹窗 -->
ee792d52   刘淇   动态表单
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
      <up-action-sheet
        :show="actionSheetShow"
        :actions="actionSheetOptions"
        @select="onActionSheetSelect"
        @close="actionSheetShow = false"
        cancel-text="取消"
      ></up-action-sheet>
  
      <!-- ===================== type6 全屏弹窗 ===================== -->
      <up-popup
        :show="popupType6.show"
        round="0"
        close-on-click-overlay="false"
        @close="closeType6Popup"
        style="height:100%;width:100%"
      >
        <view class="popup-header">
          <text class="popup-title">{{ popupType6.fieldItem?.fieldName || '选择项目' }}</text>
          <up-icon name="close" size="32rpx" @click="closeType6Popup"></up-icon>
        </view>
        <!-- tabs -->
        <up-tabs
          v-model="popupType6.activeTab"
          :list="popupType6.tabs"
          @change="onTabChange"
          swipeable="false"
        ></up-tabs>
        <view class="popup-body">
          <view class="left-sidebar">
            <view
              v-for="subItem in popupType6.subMenuList"
              :key="subItem.key"
              class="sidebar-item"
              :class="{active: popupType6.activeSubKey === subItem.key}"
              @click="popupType6.activeSubKey = subItem.key; filterRightList()"
            >
              {{ subItem.label }}
            </view>
          </view>
          <view class="right-content">
            <view class="list-item" v-for="row in popupType6.rightList" :key="row.value">
              <!-- multiple:0 = 多选checkbox; multiple:1 = 单选radio -->
              <view v-if="popupType6.multiple === 0">
                <u-checkbox
                  v-model="inspectForm[popupType6.fieldCode]"
                  :name="row.value"
                  :disabled="isType6OptionLocked(row)"
                ></u-checkbox>
              </view>
              <u-radio
                v-else
                v-model="inspectForm[popupType6.fieldCode]"
                :label="row.value"
              ></u-radio>
  
              <text class="row-label">{{ row.label }}</text>
  
              <!-- needQuantity 数量输入框 -->
              <u-number-box
                v-if="popupType6.extConfig?.needQuantity === true"
                v-model="qtyMap[popupType6.fieldCode][row.value]"
                min="0"
                step="1"
                size="small"
              ></u-number-box>
            </view>
            <!-- 数量提示,仅多选 multiple:0 才显示 -->
            <view
              class="tip-text"
              v-if="popupType6.multiple === 0 && popupType6.extConfig?.maxCount"
            >
              已选:{{ (inspectForm[popupType6.fieldCode] || []).length }} / {{ popupType6.extConfig.maxCount }}
            </view>
          </view>
        </view>
        <view class="popup-footer">
          <up-button type="primary" text="确定" @click="confirmType6Select"></up-button>
        </view>
      </up-popup>
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
294
295
296
    </view>
  </template>
  
ee792d52   刘淇   动态表单
297
298
299
  
  
  
d433e7f6   刘淇   工单
300
301
302
  <script lang="ts">
  import { uploadImages } from '@/common/utils/upload'
  import { maintainCreate } from "@/api/maintain-manage/maintain-manage"
ee792d52   刘淇   动态表单
303
304
  import { getByType, getOptionsByCode, getMaterialByCode, workRecordSubmit } from "@/api/common"
  
d433e7f6   刘淇   工单
305
306
307
  export default {
    data() {
      return {
ee792d52   刘淇   动态表单
308
        imageList: [],
d433e7f6   刘淇   工单
309
310
311
        initProgress: 0,
        inspectForm: {
          remark: '',
d433e7f6   刘淇   工单
312
        },
de549a92   刘淇   养护。动态表单
313
        labelMap: {},
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
314
        fileListMap: {},
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
315
        qtyMap: {},
ee792d52   刘淇   动态表单
316
        paramsOptions: {},
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
317
        clientSeq: '',
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
318
        commitId: null,
d433e7f6   刘淇   工单
319
320
321
322
        inspectFormRules: {
          images: [
            {
              required: true,
ee792d52   刘淇   动态表单
323
              message: '最少上传1张图片',
d433e7f6   刘淇   工单
324
325
              trigger: 'change',
              validator: (rule, value, callback) => {
ee792d52   刘淇   动态表单
326
327
328
329
330
331
                const hasSuccess = this.imageList.some(item => item.status === 'success')
                const count = this.imageList.filter(item => item.status === 'success').length
                if (!hasSuccess || count < 1) {
                  callback(new Error('最少上传1张图片'))
                } else if (count > 3) {
                  callback(new Error('最多上传3张图片'))
d433e7f6   刘淇   工单
332
333
334
335
336
                } else {
                  callback()
                }
              }
            }
ee792d52   刘淇   动态表单
337
          ]
de549a92   刘淇   养护。动态表单
338
        },
ee792d52   刘淇   动态表单
339
340
        dynamicFields: [],
  
de549a92   刘淇   养护。动态表单
341
        datePickerShow: false,
ee792d52   刘淇   动态表单
342
        datePickerValue: new Date().getTime(),
de549a92   刘淇   养护。动态表单
343
        currentDateFieldCode: '',
ee792d52   刘淇   动态表单
344
345
346
347
348
349
350
  
        actionSheetShow: false,
        actionSheetOptions: [],
        actionSheetFieldItem: null,
  
        // ===== type6弹窗状态 =====
        popupType6: {
50ad810a   王彪总   业务线 小程序不用写死,从后端接口获取
351
352
          show: false,
          fieldCode: '',
ee792d52   刘淇   动态表单
353
354
355
356
357
358
359
          fieldItem: null,
          activeTab: 0,
          tabs: [],
          activeSubKey: '',
          subMenuList: [],
          allRawData: [],
          rightList: []
d433e7f6   刘淇   工单
360
361
362
363
364
        }
      }
    },
    onLoad(option) {
      console.log('页面参数:', option)
ee792d52   刘淇   动态表单
365
      this.paramsOptions = option
de549a92   刘淇   养护。动态表单
366
      const { businessType, planTypeId } = option
ee792d52   刘淇   动态表单
367
368
      const workTypeId = planTypeId
      this.loadDynamicFields(businessType, workTypeId)
d433e7f6   刘淇   工单
369
370
371
    },
    onReady() {
      this.$refs.inspectFormRef.setRules(this.inspectFormRules)
ee792d52   刘淇   动态表单
372
      console.log('表单规则加载完成')
d433e7f6   刘淇   工单
373
374
    },
    methods: {
ee792d52   刘淇   动态表单
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
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
524
525
526
527
528
529
530
531
532
533
      // 获取type6展示文本
      getType6ShowLabel(item) {
        const val = this.inspectForm[item.fieldCode]
        const optList = item.selectOptions || []
        if (item.multiple === 0) {
          // multiple:0 多选,数组
          if (!val || val.length === 0) return ''
          const nameArr = optList.filter(o => val.includes(o.value)).map(o => o.label)
          return nameArr.join('、')
        } else {
          // multiple:1 单选,单个值
          if (!val) return ''
          const findOpt = optList.find(o => o.value === val)
          return findOpt ? findOpt.label : ''
        }
      },
  
      // 打开type6弹窗
      openType6Popup(item) {
        this.popupType6.fieldItem = item
        this.popupType6.fieldCode = item.fieldCode
        this.popupType6.allRawData = this.mockLargeTreeData(item.selectOptions || [])
        this.popupType6.tabs = [
          { label: '机电设备', value: 0 },
          { label: '消防器材', value: 1 },
          { label: '给排水', value: 2 },
          { label: '照明系统', value: 3 },
          { label: '安防监控', value: 4 }
        ]
        this.popupType6.activeTab = 0
        this.onTabChange(0)
        this.popupType6.show = true
      },
  
      mockLargeTreeData(baseOpts) {
        const tree = [
          {
            tabIndex: 0,
            subMenu: [
              { key: 'sub01', label: '水泵类' },
              { key: 'sub02', label: '风机类' },
              { key: 'sub03', label: '控制柜' },
              { key: 'sub04', label: '换热器' },
            ],
            items: [
              { subKey: 'sub01', value: 'p001', label: '立式离心泵A' },
              { subKey: 'sub01', value: 'p002', label: '卧式增压泵B' },
              { subKey: 'sub01', value: 'p003', label: '潜污泵C' },
              { subKey: 'sub02', value: 'f001', label: '排烟风机1号' },
              { subKey: 'sub02', value: 'f002', label: '正压送风机' },
              { subKey: 'sub03', value: 'c001', label: '动力控制柜#1' },
              { subKey: 'sub03', value: 'c002', label: 'PLC控制柜#2' },
              { subKey: 'sub04', value: 'h001', label: '板式换热器' },
            ]
          },
          {
            tabIndex: 1,
            subMenu: [
              { key: 'sub11', label: '灭火器' },
              { key: 'sub12', label: '消火栓' },
              { key: 'sub13', label: '烟感温感' },
            ],
            items: [
              { subKey: 'sub11', value: 'xf001', label: '4kg干粉灭火器' },
              { subKey: 'sub11', value: 'xf002', label: '二氧化碳灭火器' },
              { subKey: 'sub12', value: 'xf010', label: '室内消火栓箱' },
              { subKey: 'sub13', value: 'xf020', label: '光电烟感探测器' },
              { subKey: 'sub13', value: 'xf021', label: '温度探测器' },
            ]
          },
          {
            tabIndex: 2,
            subMenu: [
              { key: 'sub21', label: '阀门' },
              { key: 'sub22', label: '管道配件' },
            ],
            items: [
              { subKey: 'sub21', value: 'w001', label: 'DN100闸阀' },
              { subKey: 'sub21', value: 'w002', label: '止回阀' },
              { subKey: 'sub22', value: 'w010', label: '柔性接头' },
            ]
          },
          {
            tabIndex: 3,
            subMenu: [
              { key: 'sub31', label: 'LED灯具' },
              { key: 'sub32', label: '应急照明' },
            ],
            items: [
              { subKey: 'sub31', value: 'l001', label: 'LED平板灯 300*600' },
              { subKey: 'sub32', value: 'l002', label: '消防应急灯' },
            ]
          },
          {
            tabIndex: 4,
            subMenu: [
              { key: 'sub41', label: '摄像头' },
              { key: 'sub42', label: '门禁' },
            ],
            items: [
              { subKey: 'sub41', value: 'a001', label: '枪机摄像头' },
              { subKey: 'sub41', value: 'a002', label: '半球摄像机' },
              { subKey: 'sub42', value: 'a010', label: '刷卡门禁主机' },
            ]
          }
        ]
        return tree
      },
  
      onTabChange(tabVal) {
        const tabData = this.popupType6.allRawData.find(item => item.tabIndex === tabVal)
        if (!tabData) return
        this.popupType6.subMenuList = tabData.subMenu
        this.popupType6.activeSubKey = tabData.subMenu[0].key
        this.filterRightList()
      },
  
      filterRightList() {
        const tabData = this.popupType6.allRawData.find(item => item.tabIndex === this.popupType6.activeTab)
        if (!tabData) return
        this.popupType6.rightList = tabData.items.filter(it => it.subKey === this.popupType6.activeSubKey)
      },
  
      // 多选maxCount禁用判断,仅 multiple:0(多选)启用
      isType6OptionLocked(opt) {
        const item = this.popupType6.fieldItem
        if (item.multiple !== 0) return false
        const max = item.extConfig?.maxCount
        if (!max) return false
        const selectedArr = this.inspectForm[item.fieldCode] || []
        if (selectedArr.length >= max && !selectedArr.includes(opt.value)) {
          return true
        }
        return false
      },
  
      confirmType6Select() {
        this.$refs.inspectFormRef.validateField(this.popupType6.fieldCode)
        this.popupType6.show = false
      },
      closeType6Popup() {
        this.popupType6.show = false
      },
  
      openPickerIfNeeded(item) {
        if (item.fieldType === 6) {
          return this.openType6Popup(item)
        }
        if (item.fieldType === 3 && item.multiple !== 1) {
          return this.openActionSheet(item)
        }
        if (item.fieldType === 9) {
          return this.openActionSheet(item)
        }
        if (item.fieldType === 11) {
          return this.openLocationPicker(item)
        }
      },
  
de549a92   刘淇   养护。动态表单
534
      valChange(item) {
de549a92   刘淇   养护。动态表单
535
536
        this.$refs.inspectFormRef.validateField(item.fieldCode)
      },
ee792d52   刘淇   动态表单
537
  
de549a92   刘淇   养护。动态表单
538
      openDatePicker(field) {
de549a92   刘淇   养护。动态表单
539
540
        this.currentDateFieldCode = field.fieldCode
        const val = this.inspectForm[field.fieldCode]
ee792d52   刘淇   动态表单
541
        this.datePickerValue = val ? new Date(val).getTime() : new Date().getTime()
de549a92   刘淇   养护。动态表单
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
        this.datePickerShow = true
        uni.hideKeyboard()
      },
      onDateConfirm(e) {
        const ts = e.value
        const d = new Date(ts)
        const y = d.getFullYear()
        const m = String(d.getMonth() + 1).padStart(2, '0')
        const day = String(d.getDate()).padStart(2, '0')
        const h = String(d.getHours()).padStart(2, '0')
        const mi = String(d.getMinutes()).padStart(2, '0')
        const s = String(d.getSeconds()).padStart(2, '0')
        this.inspectForm[this.currentDateFieldCode] = `${y}-${m}-${day} ${h}:${mi}:${s}`
        this.datePickerShow = false
        this.$refs.inspectFormRef.validateField(this.currentDateFieldCode)
      },
      onDateClose() {
        this.datePickerShow = false
      },
ee792d52   刘淇   动态表单
561
562
563
564
565
566
567
568
  
      openActionSheet(item) {
        this.actionSheetFieldItem = item
        this.actionSheetOptions = (item.selectOptions || []).map(opt => ({
          name: opt.label,
          value: opt.value
        }))
        this.actionSheetShow = true
de549a92   刘淇   养护。动态表单
569
      },
ee792d52   刘淇   动态表单
570
571
572
573
574
      onActionSheetSelect(selected) {
        const fieldItem = this.actionSheetFieldItem
        const fieldCode = fieldItem.fieldCode
        if (fieldItem.fieldType === 9) {
          this.inspectForm[fieldCode] = { id: selected.value, name: selected.name }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
575
        } else {
ee792d52   刘淇   动态表单
576
          this.inspectForm[fieldCode] = selected.value
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
577
        }
ee792d52   刘淇   动态表单
578
579
        this.labelMap[fieldCode] = selected.name
        this.actionSheetShow = false
de549a92   刘淇   养护。动态表单
580
581
        this.$refs.inspectFormRef.validateField(fieldCode)
      },
ee792d52   刘淇   动态表单
582
583
  
      openLocationPicker(item) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
584
585
586
587
588
        uni.chooseLocation({
          success: (res) => {
            this.inspectForm[item.fieldCode] = {
              lng: res.longitude,
              lat: res.latitude,
ee792d52   刘淇   动态表单
589
              address: res.address
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
590
            }
ee792d52   刘淇   动态表单
591
            this.labelMap[item.fieldCode] = res.address || `${res.latitude},${res.longitude}`
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
592
593
594
            this.$refs.inspectFormRef.validateField(item.fieldCode)
          },
          fail: (err) => {
ee792d52   刘淇   动态表单
595
596
597
            console.error('位置选择失败', err)
            if (err.errMsg.indexOf('auth deny') > -1) {
              uni.showToast({ title: '请开启位置权限', icon: 'none' })
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
598
599
600
601
            }
          }
        })
      },
ee792d52   刘淇   动态表单
602
603
  
      // 加载动态字段 & 初始化inspectForm
de549a92   刘淇   养护。动态表单
604
605
      async loadDynamicFields(businessType: string, workTypeId: string) {
        if (!businessType || !workTypeId) {
ee792d52   刘淇   动态表单
606
          uni.showToast({ title: '缺少参数', icon: 'none' })
de549a92   刘淇   养护。动态表单
607
608
          return
        }
ee792d52   刘淇   动态表单
609
610
       
         const bizType = 3
de549a92   刘淇   养护。动态表单
611
        try {
ee792d52   刘淇   动态表单
612
          const res = await getByType({ businessType, bizType,workTypeId })
de549a92   刘淇   养护。动态表单
613
614
          let fields = res.fields || []
          fields.sort((a, b) => a.sort - b.sort)
ee792d52   刘淇   动态表单
615
616
          this.dynamicFields = fields
  
de549a92   刘淇   养护。动态表单
617
          for (const field of fields) {
ee792d52   刘淇   动态表单
618
619
620
621
622
623
624
625
            if (field.fieldType === 6) {
              // multiple:0=多选(数组), multiple:1=单选(单个值null)
              if (field.multiple === 0) {
                this.inspectForm[field.fieldCode] = []
              } else {
                this.inspectForm[field.fieldCode] = null
              }
            } else if (field.fieldType === 3 && field.multiple === 1) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
626
627
628
629
630
              this.inspectForm[field.fieldCode] = []
            } else if (field.fieldType === 7 || field.fieldType === 8) {
              this.inspectForm[field.fieldCode] = []
            } else if (field.fieldType === 9 || field.fieldType === 11) {
              this.inspectForm[field.fieldCode] = null
de549a92   刘淇   养护。动态表单
631
            } else {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
632
              this.inspectForm[field.fieldCode] = ''
de549a92   刘淇   养护。动态表单
633
            }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
634
            this.labelMap[field.fieldCode] = ''
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
635
636
            if (field.fieldType === 7 || field.fieldType === 8) {
              this.fileListMap[field.fieldCode] = []
de549a92   刘淇   养护。动态表单
637
            }
ee792d52   刘淇   动态表单
638
            if (field.fieldType === 3 || field.fieldType === 6) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
639
              if (field.optionSource === 1 && Array.isArray(field.options)) {
ee792d52   刘淇   动态表单
640
641
642
643
644
645
646
                field.selectOptions = field.options.map(opt => ({
                  label: opt.label,
                  value: String(opt.value)
                }))
              } else if (field.optionSource === 5) {
                const matRes = await getMaterialByCode({ businessType, bizType, fieldCode: field.fieldCode,workTypeId })
                field.selectOptions = (matRes.list || []).map(mat => ({
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
647
                  label: mat.materialName,
ee792d52   刘淇   动态表单
648
                  value: String(mat.materialId)
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
649
                }))
de549a92   刘淇   养护。动态表单
650
              } else {
ee792d52   刘淇   动态表单
651
652
653
654
655
                const optRes = await getOptionsByCode({ businessType, bizType, fieldCode: field.fieldCode,workTypeId })
                field.selectOptions = (optRes.list || []).map(opt => ({
                  label: opt.label,
                  value: String(opt.value)
                }))
de549a92   刘淇   养护。动态表单
656
657
              }
            }
ee792d52   刘淇   动态表单
658
            // 初始化数量映射
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
659
            if (field.fieldType === 6 && this.needQty(field)) {
ee792d52   刘淇   动态表单
660
              const qtyObj = {}
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
661
              ;(field.selectOptions || []).forEach(opt => {
ee792d52   刘淇   动态表单
662
                qtyObj[opt.value] = ''
de549a92   刘淇   养护。动态表单
663
              })
ee792d52   刘淇   动态表单
664
              this.qtyMap[field.fieldCode] = qtyObj
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
665
            }
ee792d52   刘淇   动态表单
666
            if (field.fieldType === 3 && field.optionSource === 5) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
667
668
              this.qtyMap[field.fieldCode] = 0
            }
ee792d52   刘淇   动态表单
669
            // 构建表单校验规则
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
670
            if (field.required === 1) {
ee792d52   刘淇   动态表单
671
              this.inspectFormRules[field.fieldCode] = this.buildRequiredRule(field)
de549a92   刘淇   养护。动态表单
672
673
            }
          }
de549a92   刘淇   养护。动态表单
674
675
676
677
          this.$nextTick(() => {
            this.$refs.inspectFormRef.setRules(this.inspectFormRules)
          })
        } catch (err) {
ee792d52   刘淇   动态表单
678
679
          console.error('加载动态表单失败', err)
          uni.showToast({ title: '加载表单失败', icon: 'none' })
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
680
681
        }
      },
ee792d52   刘淇   动态表单
682
683
  
      needQty(item) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
684
685
        return !!(item.extConfig && item.extConfig.needQuantity === true)
      },
ee792d52   刘淇   动态表单
686
687
688
      pickCountOf(item, defaultNum) {
        const max = item.extConfig?.maxCount
        return max || defaultNum
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
689
      },
ee792d52   刘淇   动态表单
690
691
692
      fileButtonText(item) {
        const exts = this.extListOf(item)
        return exts.length ? `选择文件(${exts.join(',')})` : '选择文件'
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
693
      },
ee792d52   刘淇   动态表单
694
695
      extListOf(item) {
        return []
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
696
      },
ee792d52   刘淇   动态表单
697
      fileNameOf(url) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
698
        if (!url) return ''
ee792d52   刘淇   动态表单
699
        const path = String(url).split('?')[0]
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
700
701
        const name = path.substring(path.lastIndexOf('/') + 1)
        try {
ee792d52   刘淇   动态表单
702
703
704
          return decodeURIComponent(name)
        } catch {
          return name
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
705
        }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
706
      },
ee792d52   刘淇   动态表单
707
708
  
      buildRequiredRule(field) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
709
        const type = field.fieldType
ee792d52   刘淇   动态表单
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
        const action = type === 6 ? '请选择' : type === 7 || type === 8 ? '请上传' : '请填写'
        return {
          required: true,
          trigger: 'change',
          validator: (rule, value, callback) => {
            let pass = false
            if (type === 6) {
              if (field.multiple === 0) {
                // 多选:数组非空
                pass = Array.isArray(value) && value.length > 0
              } else {
                // 单选:value不为空
                pass = !!value
              }
            } else if (type === 7 || type === 8) {
              pass = Array.isArray(value) && value.length > 0
            } else {
              pass = !!value
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
728
            }
ee792d52   刘淇   动态表单
729
            pass ? callback() : callback(new Error(`${action}${field.fieldName}`))
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
730
731
          }
        }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
732
      },
ee792d52   刘淇   动态表单
733
734
735
736
737
738
739
740
741
742
  
      // 图片上传
      async uploadImages(event) {
        const file = event.file
        const res = await uploadImages(file)
        this.imageList.push({
          url: res.url,
          status: 'success'
        })
        this.$refs.inspectFormRef.validateField('images')
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
743
      },
ee792d52   刘淇   动态表单
744
745
746
747
      deleteImage(event) {
        const index = event.index
        this.imageList.splice(index, 1)
        this.$refs.inspectFormRef.validateField('images')
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
748
      },
ee792d52   刘淇   动态表单
749
750
      handleExceed() {
        uni.showToast({ title: '最多上传3张图片', icon: 'none' })
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
751
      },
ee792d52   刘淇   动态表单
752
753
754
  
      uploadFieldFiles(item, event) {
        // 附件上传逻辑
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
755
      },
ee792d52   刘淇   动态表单
756
757
758
759
760
761
762
      deleteFieldFile(item, event) {
        const idx = event.index
        this.fileListMap[item.fieldCode].splice(idx, 1)
        this.syncFileValue(item)
        this.$refs.inspectFormRef.validateField(item.fieldCode)
      },
      chooseFieldFiles(item) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
763
        uni.chooseMessageFile({
ee792d52   刘淇   动态表单
764
765
          count: this.pickCountOf(item,5),
          type: 'file',
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
766
          success: (res) => {
ee792d52   刘淇   动态表单
767
768
769
770
771
772
773
774
775
            const files = res.tempFiles
            files.forEach(tempFile => {
              this.fileListMap[item.fieldCode].push({
                name: tempFile.name,
                url: tempFile.path
              })
            })
            this.syncFileValue(item)
            this.$refs.inspectFormRef.validateField(item.fieldCode)
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
776
777
          },
          fail: (err) => {
ee792d52   刘淇   动态表单
778
            console.error('选择附件失败', err)
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
779
780
781
          }
        })
      },
ee792d52   刘淇   动态表单
782
      syncFileValue(item) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
783
        const list = this.fileListMap[item.fieldCode] || []
ee792d52   刘淇   动态表单
784
        this.inspectForm[item.fieldCode] = list.map(file => file.url)
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
785
      },
ee792d52   刘淇   动态表单
786
  
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
787
      buildDynamicFields() {
ee792d52   刘淇   动态表单
788
        const fields = []
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
789
790
791
792
793
794
795
        for (const item of this.dynamicFields) {
          const code = item.fieldCode
          const value = this.inspectForm[code]
          const type = item.fieldType
          if (type === 9 || type === 11) {
            if (!value) continue
          } else if (type === 6 || type === 7 || type === 8) {
ee792d52   刘淇   动态表单
796
797
            if ((!value) || (Array.isArray(value) && value.length === 0)) continue
          } else if (!value) continue
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
798
799
800
  
          if (type === 1) {
            fields.push({ fieldCode: code, valueNumber: Number(value) })
ee792d52   刘淇   动态表单
801
          } else if (type === 3 && item.optionSource === 5) {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
802
            const qty = Number(this.qtyMap[code] || 0)
ee792d52   刘淇   动态表单
803
804
805
806
807
            const matched = (item.selectOptions || []).find(opt => opt.value === String(value))
            const row = { fieldCode: code, valueText: String(value) }
            if (qty > 0 && matched) {
              row.materialId = matched.value
              row.materialName = matched.label
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
808
809
810
811
              row.quantity = qty
            }
            fields.push(row)
          } else if (type === 3) {
ee792d52   刘淇   动态表单
812
813
814
815
816
            if (item.multiple === 1) {
              fields.push({ fieldCode: code, valueText: (value || []).join(',') })
            } else {
              fields.push({ fieldCode: code, valueText: String(value) })
            }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
817
          } else if (type === 6) {
ee792d52   刘淇   动态表单
818
819
820
821
822
823
824
825
            let selected = []
            if (item.multiple === 0) {
              // multiple=0 多选,数组
              selected = (item.selectOptions || []).filter(opt => (value || []).includes(opt.value))
            } else {
              // multiple=1 单选,单个值
              selected = (item.selectOptions || []).filter(opt => opt.value === value)
            }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
826
            if (this.needQty(item)) {
ee792d52   刘淇   动态表单
827
              const qtyObj = this.qtyMap[code] || {}
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
828
829
830
              fields.push({
                fieldCode: code,
                valueText: JSON.stringify(selected.map(opt => {
ee792d52   刘淇   动态表单
831
832
                  const raw = qtyObj[opt.value]
                  const rowItem = { value: opt.value, label: opt.label }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
833
                  if (raw !== '' && raw !== null && raw !== undefined) {
ee792d52   刘淇   动态表单
834
                    rowItem.quantity = Number(raw)
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
835
                  }
ee792d52   刘淇   动态表单
836
                  return rowItem
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
837
838
839
                }))
              })
            } else {
ee792d52   刘淇   动态表单
840
841
842
843
844
              if (item.multiple === 0) {
                fields.push({ fieldCode: code, valueText: JSON.stringify((value || []).map(v => String(v))) })
              } else {
                fields.push({ fieldCode: code, valueText: JSON.stringify(String(value)) })
              }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
845
846
847
848
849
850
            }
          } else if (type === 7 || type === 8) {
            fields.push({ fieldCode: code, valueText: JSON.stringify(value) })
          } else if (type === 9) {
            fields.push({ fieldCode: code, valueText: JSON.stringify([{ id: value.id, name: value.name }]) })
          } else if (type === 11) {
ee792d52   刘淇   动态表单
851
            fields.push({ fieldCode: code, valueText: JSON.stringify({ lng: value.lng, lat: value.lat, address: value.address }) })
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
852
          } else {
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
853
854
855
856
857
            fields.push({ fieldCode: code, valueText: String(value) })
          }
        }
        return fields
      },
ee792d52   刘淇   动态表单
858
  
d433e7f6   刘淇   工单
859
      async submitInspect() {
d433e7f6   刘淇   工单
860
861
        try {
          await this.$refs.inspectFormRef.validate()
ee792d52   刘淇   动态表单
862
          uni.showLoading({ title: '提交中' })
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
863
          if (!this.clientSeq) {
ee792d52   刘淇   动态表单
864
            this.clientSeq = Date.now().toString() + '-' + Math.random().toString(16).slice(2,10)
d433e7f6   刘淇   工单
865
          }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
866
867
          if (!this.commitId) {
            const submitData = {
ee792d52   刘淇   动态表单
868
              planNo: this.paramsOptions.planNo,
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
869
              imgHost: "1",
ee792d52   刘淇   动态表单
870
              beginImg: this.imageList.map(img => img.url),
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
871
              commonUserList: [],
ee792d52   刘淇   动态表单
872
              remark: this.inspectForm.remark.trim()
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
873
            }
ee792d52   刘淇   动态表单
874
875
            const createRes = await maintainCreate(submitData)
            this.commitId = createRes.id
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
876
          }
ee792d52   刘淇   动态表单
877
878
879
880
881
882
883
884
885
886
          const dynamicValues = this.buildDynamicFields()
          await workRecordSubmit({
            businessType: this.paramsOptions.businessType,
            planTypeId: this.paramsOptions.planTypeId,
            bizType:3,
            recordId: this.commitId,
            clientSeq: this.clientSeq,
            remark: this.inspectForm.remark.trim(),
            fields: dynamicValues
          })
d433e7f6   刘淇   工单
887
          uni.hideLoading()
ee792d52   刘淇   动态表单
888
889
890
891
892
          uni.showToast({ title: '提交成功' })
          setTimeout(()=>{
            uni.reLaunch({url:'/pages/index/index'})
          },1000)
        } catch (err) {
d433e7f6   刘淇   工单
893
          uni.hideLoading()
ee792d52   刘淇   动态表单
894
895
896
          console.error('提交失败', err)
          if (Array.isArray(err)) return
          const msg = err?.msg || '提交失败,请重试'
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
897
          if (this.commitId) {
ee792d52   刘淇   动态表单
898
899
900
            uni.showToast({ title: `已创建工单,动态字段提交失败:${msg}`, icon: 'none' })
          } else {
            uni.showToast({ title: msg, icon: 'none' })
d433e7f6   刘淇   工单
901
902
          }
        }
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
903
904
905
906
907
      }
    }
  }
  </script>
  
ee792d52   刘淇   动态表单
908
909
910
  
  
  
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
911
  <style lang="scss" scoped>
de549a92   刘淇   养护。动态表单
912
  .page-container {
ee792d52   刘淇   动态表单
913
914
    min-height: 100vh;
    background-color: #f5f5f5;
de549a92   刘淇   养护。动态表单
915
916
    padding-bottom: 120rpx;
  }
d433e7f6   刘淇   工单
917
  .inspect-form-content {
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
918
    background: #fff;
d433e7f6   刘淇   工单
919
920
    padding: 20rpx;
    margin-bottom: 20rpx;
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
921
  }
de549a92   刘淇   养护。动态表单
922
923
924
  .date-input-wrap {
    width: 100%;
  }
ee792d52   刘淇   动态表单
925
  .fixed-bottom-wrap {
de549a92   刘淇   养护。动态表单
926
927
928
929
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
ee792d52   刘淇   动态表单
930
    background: #fff;
de549a92   刘淇   养护。动态表单
931
  }
de549a92   刘淇   养护。动态表单
932
933
934
935
936
937
  .large-number-box {
    :deep(.u-number-box__input) {
      width: 264rpx !important;
      height: 72rpx;
      font-size: 32rpx;
    }
ee792d52   刘淇   动态表单
938
939
    :deep(.u-number-box__minus),
    :deep(.u-number-box__plus) {
de549a92   刘淇   养护。动态表单
940
941
942
943
944
945
946
      height: 72rpx;
    }
  }
  .number-box-wrap {
    display: flex;
    align-items: center;
    gap: 16rpx;
fb13622a   刘淇   养护计划列表 样式 差去一个卡片的头部
947
  }
ee792d52   刘淇   动态表单
948
949
950
951
  .unit-text {
    font-size: 28rpx;
    color: #333;
  }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
952
953
954
955
956
957
958
959
960
961
962
963
964
965
  .multi-wrap {
    width: 100%;
    .multi-hint {
      display: block;
      margin-top: 8rpx;
      font-size: 24rpx;
      color: #909399;
    }
    .qty-list {
      margin-top: 16rpx;
      padding-left: 20rpx;
      border-left: 4rpx solid #f0f0f0;
    }
  }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
  .qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16rpx;
    padding: 8rpx 0;
    .qty-label {
      flex: 1;
      min-width: 0;
      font-size: 28rpx;
      color: #333;
    }
  }
  .qty-row-material {
    margin-top: 12rpx;
    padding-top: 12rpx;
    border-top: 1rpx solid #f0f0f0;
  }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
984
985
986
987
988
989
  .file-wrap {
    width: 100%;
    .file-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
ee792d52   刘淇   动态表单
990
991
      gap:16rpx;
      padding:8rpx 0;
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
992
      .file-name {
ee792d52   刘淇   动态表单
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
        flex:1;
        min-width:0;
        font-size:28rpx;
        color:#333;
        overflow:hidden;
        white-space:nowrap;
        text-overflow:ellipsis;
      }
      .file-del {
        font-size:26rpx;
        color:#f56c6c;
      }
    }
  }
  
  // type6弹窗样式
  .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30rpx;
    .popup-title {
      font-size: 34rpx;
      font-weight: bold;
    }
  }
  .popup-body {
    display: flex;
    flex: 1;
    height: calc(100vh - 220rpx);
    .left-sidebar {
      width: 220rpx;
      background: #f6f7f8;
      overflow-y: auto;
      .sidebar-item {
        padding: 24rpx 16rpx;
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
1029
1030
        font-size: 28rpx;
        color: #333;
ee792d52   刘淇   动态表单
1031
1032
1033
1034
        &.active {
          background: #fff;
          color: #007aff;
        }
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
1035
      }
ee792d52   刘淇   动态表单
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
    }
    .right-content {
      flex: 1;
      background: #fff;
      padding: 20rpx;
      overflow-y: auto;
      .list-item {
        display: flex;
        align-items: center;
        gap:20rpx;
        padding:20rpx 0;
        border-bottom:1rpx solid #eee;
        .row-label {
          flex:1;
          font-size:28rpx;
        }
      }
      .tip-text {
        margin-top: 20rpx;
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
1055
        font-size: 26rpx;
ee792d52   刘淇   动态表单
1056
        color:#999;
71518877   王彪总   业务线 小程序不用写死,从后端接口获取
1057
1058
1059
      }
    }
  }
ee792d52   刘淇   动态表单
1060
1061
1062
  .popup-footer {
    padding:24rpx;
  }
d433e7f6   刘淇   工单
1063
  </style>
ee792d52   刘淇   动态表单