Bladeren bron

公装主管任务

zhujindu 7 maanden geleden
bovenliggende
commit
3028ebb961

+ 17 - 8
src/components/deleteUploadImg2.vue

@@ -40,6 +40,11 @@ export default {
       type: Boolean,
       default: true,
     },
+    // 是否请求接口删除
+    isDelete: {
+      type: Boolean,
+      default: true,
+    },
   },
   data() {
     return {
@@ -51,14 +56,18 @@ export default {
       var fileName = {
         fileId: collectionItemId,
       };
-      removeSummaryPhoto(fileName).then((res) => {
-        if (res.code == 200) {
-          this.$toast('删除成功!');
-          this.imgs.splice(index, 1);
-        } else {
-          this.$toast('删除失败!');
-        }
-      });
+      if (this.isDelete) {
+        removeSummaryPhoto(fileName).then((res) => {
+          if (res.code == 200) {
+            this.$toast('删除成功!');
+            this.imgs.splice(index, 1);
+          } else {
+            this.$toast('删除失败!');
+          }
+        });
+      } else {
+        this.imgs.splice(index, 1);
+      }
     },
     previewsImg(index) {
       var arrimg = [];

+ 2 - 7
src/components/uploadVTask.vue

@@ -51,13 +51,8 @@ export default {
       type: String,
       default: '',
     },
-    // 是否允许补填
-    writeAgain: {
-      type: String,
-      default: '0',
-    },
     // 是否补填
-    isWriteAgain: {
+    allowWriteAgain: {
       type: Boolean,
       default: false,
     },
@@ -179,7 +174,7 @@ export default {
         forbidClick: true,
       });
       // 允许补填 添加上补填标识
-      if (this.writeAgain == '1' && this.isWriteAgain) {
+      if (this.allowWriteAgain) {
         form.isWriteAgain = '1';
       }
       addPhotov(form).then((res) => {

+ 1 - 0
src/components/zRadio2.vue

@@ -48,6 +48,7 @@ export default {
       this.$emit('zSelectVal', datalist);
     },
     radioclick() {
+      if (this.disabled) return;
       if (!this.radioChange) {
         this.zradioc = '';
       }

+ 1 - 1
src/views/week/VisitSummaryAdd.vue

@@ -62,7 +62,7 @@
               <p style="margin-top: 0">
                 <span style="font-size: 12px; color: #888">{{ item.remark }}</span>
               </p>
-              <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
+              <delete-upload-img :imgs="item.fileInfoList" :isDelete="false"></delete-upload-img>
               <upload-img
                 :uploadid="uploadid2"
                 @newimgarr="newimgarr1"

+ 1 - 15
src/views/week/VisitSummaryDetail.vue

@@ -100,23 +100,9 @@ export default {
       //
     };
   },
-  created() {
+  activated() {
     this.powerGrade = localStorage.getItem('powerGrade');
     this.getDetailById();
-  },
-  watch: {
-    $route(to, from) {
-      this.powerGrade = localStorage.getItem('powerGrade');
-      if (to.path == '/dailyDetails') {
-        this.getDetailById();
-      }
-      // &&from.path=="/dailyApprovalList"
-      // if(to.path=="/dailyDetails"&&from.path=="/myHistoricalDaily"){
-      //   this.getDetailById()
-      // }
-    },
-  },
-  activated() {
     this.num = 0;
     this.userTodayPlanNum();
   },

+ 9 - 9
src/views/week/componVisitSummary.vue

@@ -13,7 +13,7 @@
             v-model="item.answerValue"
             :placeholder="item.customName"
             type="number"
-            :disabled="item.writeAgain == '0'"
+            :disabled="!item.allowWriteAgain"
             @input="numberFn(item, index)"></van-field>
         </div>
         <div v-if="item.answerType == 'rq'" class="formLabel z-cell">
@@ -29,7 +29,7 @@
             name="calendar"
             placeholder="点击选择日期"
             readonly
-            :disabled="item.writeAgain == '0'"
+            :disabled="!item.allowWriteAgain"
             @click="showCalendarClick(index)" />
           <p
             style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right"></p>
@@ -45,18 +45,18 @@
               <span style="font-size: 12px; color: #888">{{ item.remark }}</span>
             </p>
             <delete-upload-img
+              :isDelete="false"
               :imgs="item.fileInfoList"
-              :isEdit="item.writeAgain == '1' ? true : false"></delete-upload-img>
+              :isEdit="!item.allowWriteAgain"></delete-upload-img>
             <upload-img
-              v-if="item.writeAgain == '1'"
+              v-if="!item.allowWriteAgain"
               :uploadid="uploadid2"
               @newimgarr="newimgarr1"
               imgText="上传照片"
               :indexImg="index"
               :customId="item.customId"
               :summaryId="item.summaryId"
-              :writeAgain="item.writeAgain"
-              :isWriteAgain="true"
+              :allowWriteAgain="item.allowWriteAgain"
               @click="imgClick(item, index)"></upload-img>
           </van-row>
         </div>
@@ -67,7 +67,7 @@
             </template>
           </van-cell>
           <van-field
-            :disabled="item.writeAgain == '0'"
+            :disabled="!item.allowWriteAgain"
             v-model="item.answerValue"
             :formatter="formatter"
             :placeholder="item.customName"></van-field>
@@ -96,7 +96,7 @@
             </template>
           </van-cell>
           <z-checkbox
-            :disabled="item.writeAgain == '0'"
+            :disabled="!item.allowWriteAgain"
             :answerType="item.answerType"
             :checkboxval="item.answerValue"
             :collectionType="item.customOptionList"
@@ -111,7 +111,7 @@
             </template>
           </van-cell>
           <z-radio
-            :disabled="item.writeAgain == '0'"
+            :disabled="!item.allowWriteAgain"
             :answerType="item.answerType"
             :collectionType="item.collectionType"
             :radio="item.answerValue"