Quellcode durchsuchen

新建事件图片问题

seimin vor 11 Monaten
Ursprung
Commit
7f76ba93ff
1 geänderte Dateien mit 33 neuen und 5 gelöschten Zeilen
  1. 33 5
      pages/assign/assign.vue

+ 33 - 5
pages/assign/assign.vue

@@ -62,7 +62,7 @@
62 62
           <view class="title select"><text class="required newicon newicon-bitian"></text>转派对象:</view>
63 63
           <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择转派对象" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select>
64 64
         </view>
65
-        <view class="form_item_column">
65
+        <!-- <view class="form_item_column">
66 66
           <view class="form_item">
67 67
             <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
68 68
             <view class="value">
@@ -75,7 +75,7 @@
75 75
               <text class="imgTips ellipsis">(支持JPG/PNG格式图片,单张大小10M以内)</text>
76 76
             </view>
77 77
           </view>
78
-        </view>
78
+        </view> -->
79 79
       </template>
80 80
     </scroll-view>
81 81
     <view class="foot_common_btns">
@@ -154,6 +154,33 @@
154 154
   // 处理图片
155 155
   const handlerImgRef = ref(null)
156 156
   
157
+  // 上传报修图片
158
+  function handlerImgSuccessNew(){
159
+    let requestList = [];
160
+    
161
+    // 报修图片
162
+    dataInfo.incidentData.repairImgList.forEach(v => {
163
+      let repairOrderImg$ = repairOrderImg(v);
164
+      requestList.push(repairOrderImg$);
165
+    })
166
+    
167
+    Promise.all(requestList).then(resList => {
168
+      uni.hideLoading();
169
+      console.log(resList);
170
+      incidentBuildStore.clearIncidentBuildData();
171
+      uni.showToast({
172
+      	icon: 'none',
173
+        title: '建单成功',
174
+        mask: true,
175
+      });
176
+      setTimeout(() => {
177
+        uni.reLaunch({
178
+          url: '/pages/incidentList/incidentList',
179
+        })
180
+      }, 1500)
181
+    })
182
+  }
183
+  
157 184
   // 上传处理图片成功
158 185
   function handlerImgSuccess(e){
159 186
     dataInfo.handlerImgList.forEach(v => {
@@ -680,7 +707,7 @@
680 707
       mask: true,
681 708
     });
682 709
     
683
-    if(dataInfo.handlerImgList.length){
710
+    if(dataInfo.handlerImgList.length || dataInfo.incidentData.repairImgList.length){
684 711
       // 有图片
685 712
       let handlerOrder$ = handlerOrder();
686 713
       let requestList = [handlerOrder$];
@@ -757,7 +784,7 @@
757 784
       mask: true,
758 785
     });
759 786
     
760
-    if(dataInfo.handlerImgList.length){
787
+    if(dataInfo.incidentData.repairImgList.length){
761 788
       // 有图片
762 789
       let assignOrder$ = assignOrder();
763 790
       let requestList = [assignOrder$];
@@ -766,7 +793,8 @@
766 793
         console.log(resList);
767 794
         if(resList[0].state == 200){
768 795
           dataInfo.incidentId = resList[0].data.id;
769
-          handlerImgRef.value.upload();
796
+          // handlerImgRef.value.upload();
797
+          handlerImgSuccessNew();
770 798
         }else{
771 799
           uni.showToast({
772 800
             icon: 'none',