Browse Source

新建事件图片问题

seimin 11 months ago
parent
commit
7f76ba93ff
1 changed files with 33 additions and 5 deletions
  1. 33 5
      pages/assign/assign.vue

+ 33 - 5
pages/assign/assign.vue

@@ -62,7 +62,7 @@
62
           <view class="title select"><text class="required newicon newicon-bitian"></text>转派对象:</view>
62
           <view class="title select"><text class="required newicon newicon-bitian"></text>转派对象:</view>
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>
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
         </view>
64
         </view>
65
-        <view class="form_item_column">
65
+        <!-- <view class="form_item_column">
66
           <view class="form_item">
66
           <view class="form_item">
67
             <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
67
             <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
68
             <view class="value">
68
             <view class="value">
@@ -75,7 +75,7 @@
75
               <text class="imgTips ellipsis">(支持JPG/PNG格式图片,单张大小10M以内)</text>
75
               <text class="imgTips ellipsis">(支持JPG/PNG格式图片,单张大小10M以内)</text>
76
             </view>
76
             </view>
77
           </view>
77
           </view>
78
-        </view>
78
+        </view> -->
79
       </template>
79
       </template>
80
     </scroll-view>
80
     </scroll-view>
81
     <view class="foot_common_btns">
81
     <view class="foot_common_btns">
@@ -154,6 +154,33 @@
154
   // 处理图片
154
   // 处理图片
155
   const handlerImgRef = ref(null)
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
   function handlerImgSuccess(e){
185
   function handlerImgSuccess(e){
159
     dataInfo.handlerImgList.forEach(v => {
186
     dataInfo.handlerImgList.forEach(v => {
@@ -680,7 +707,7 @@
680
       mask: true,
707
       mask: true,
681
     });
708
     });
682
     
709
     
683
-    if(dataInfo.handlerImgList.length){
710
+    if(dataInfo.handlerImgList.length || dataInfo.incidentData.repairImgList.length){
684
       // 有图片
711
       // 有图片
685
       let handlerOrder$ = handlerOrder();
712
       let handlerOrder$ = handlerOrder();
686
       let requestList = [handlerOrder$];
713
       let requestList = [handlerOrder$];
@@ -757,7 +784,7 @@
757
       mask: true,
784
       mask: true,
758
     });
785
     });
759
     
786
     
760
-    if(dataInfo.handlerImgList.length){
787
+    if(dataInfo.incidentData.repairImgList.length){
761
       // 有图片
788
       // 有图片
762
       let assignOrder$ = assignOrder();
789
       let assignOrder$ = assignOrder();
763
       let requestList = [assignOrder$];
790
       let requestList = [assignOrder$];
@@ -766,7 +793,8 @@
766
         console.log(resList);
793
         console.log(resList);
767
         if(resList[0].state == 200){
794
         if(resList[0].state == 200){
768
           dataInfo.incidentId = resList[0].data.id;
795
           dataInfo.incidentId = resList[0].data.id;
769
-          handlerImgRef.value.upload();
796
+          // handlerImgRef.value.upload();
797
+          handlerImgSuccessNew();
770
         }else{
798
         }else{
771
           uni.showToast({
799
           uni.showToast({
772
             icon: 'none',
800
             icon: 'none',