jiangping
2025-06-06 a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea
h5/pages/workOrder/edit.vue
@@ -22,11 +22,12 @@
            <view class="la"><text class="red">*</text>工单分类</view>
            <view class="line sel_wrap" @click="showCate1 = true">
               <view class="left" :class="param.cateName ? '' : 'placeholder9'">
                  {{ param.cateName ? param.cateName : '请选择' }}</view>
                  {{ param.cateName ? param.cateName : '请选择' }}
               </view>
               <u-icon name="arrow-right" color="#999999" size="15"></u-icon>
            </view>
         </view>
         <view class="item">
         <view class="item" v-if="param.areaType == 0">
            <view class="la">上门时间</view>
            <view class="line sel_wrap" @click="showTime = true">
               <view class="left" :class="param.getDate ? '' : 'placeholder9'">{{ param.getDate ? param.getDate : '请选择' }}
@@ -51,7 +52,8 @@
                  <u-icon class="close" size="20" name="close-circle-fill" color="red"
                     @click="fileDel('fileList', i)"></u-icon>
                  <image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
                  <video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video>
                  <video v-if="item.type == 1" :show-center-play-btn="false" :src="item.fileurlFull"
                     :controls="false"></video>
               </view>
            </view>
         </view>
@@ -116,7 +118,7 @@
            showCate2: false,
            areaType: [
               [{
                     name: '室内装修',
                     name: '室内维修',
                     id: 0
                  },
                  {
@@ -143,15 +145,21 @@
               param,
               fileList
            } = this
            if (!param.projectId) return this.showToast('请选择完整的区域')
            if (!param.buildingId) return this.showToast('请选择完整的区域')
            if (!param.floorName && !param.roomNum) return this.showToast('请选择完整的区域')
            if (!param.cateName) return this.showToast('请选择工单分类')
            ywWorkorderCreate({
               ...param,
               // roomId: '',
               fileList
            }).then(res => {
               this.showToast('提交成功')
               uni.redirectTo({
                  url: '/pages/workOrder/list'
               })
               if (res && res.code == 200) {
                  this.showToast('提交成功')
                  uni.redirectTo({
                     url: '/pages/workOrder/list'
                  })
               }
            })
         },
         changeHandler(e) {
@@ -163,8 +171,8 @@
               // 微信小程序无法将picker实例传出来,只能通过ref操作
               picker = this.$refs.uPicker
            } = e
            // 当第一列值发生变化时,变化第二列(后一列)对应的选项
            console.log(index);
            // 当第一列值发生变化时,变化第二列(后一列)对应的选项
            console.log(index);
            console.log(index);
            if (columnIndex === 0) {
               // picker为选择器this实例,变化第二列对应的选项
@@ -172,13 +180,13 @@
            }
         },
         confirmCate1(e) {
            console.log(e.value[1]);
            if(e.value.length == 2){
               this.$set(this.param, 'cateId', e.value[1].id)
               this.$set(this.param, 'cateName', e.value[1].name)
               this.showCate1 = false
            }
            console.log(e.value[1]);
            if (e.value.length == 2) {
               this.$set(this.param, 'cateId', e.value[1].id)
               this.$set(this.param, 'cateName', e.value[1].name)
               this.showCate1 = false
            }
         },
         confirm0(e) {
            const item = e.value[0]
@@ -428,6 +436,9 @@
               right: -20rpx;
               top: -20rpx;
               z-index: 9999;
               background-color: #fff;
               border-radius: 50%;
               overflow: hidden;
            }
            image {
@@ -445,11 +456,12 @@
   }
   .sub_btn {
      position: fixed;
      bottom: 68rpx;
      left: 40rpx;
      // position: fixed;
      // bottom: 68rpx;
      // left: 40rpx;
      width: 670rpx;
      height: 88rpx;
      margin-top: 80rpx;
      background: $primaryColor;
      box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 104, 255, 0.3);
      border-radius: 44rpx;