Parcourir la source

Merge remote-tracking branch 'origin/qirui-v2' into qirui-v2

dongfeng il y a 10 mois
Parent
commit
ff5da5551a

+ 1 - 10
src/views/componentsDVP/dvpPlan/editModal/editTableRow.vue

@@ -157,7 +157,6 @@
                   action=""
                   :customRequest='editUploadFile'
                   :file-list="fileList"
-                  :remove='editRemoveFile'
               >
                 <p class="ant-upload-drag-icon">
                   <a-icon type="inbox"/>
@@ -368,7 +367,7 @@ export default {
       this.$api.planTestSave(data).then( res => {
         if (res.flag) {
           this.$message.success(res.message);
-          this.$emit("closeEditRowModal");
+          this.cancel();
           this.$emit("initData");
         } else {
           this.$message.error(res.message);
@@ -409,14 +408,6 @@ export default {
       });
     },
 
-    /**
-     * 实验报告,文件删除
-     * @param file 文件
-     */
-    editRemoveFile(file) {
-      this.fileList = [];
-    },
-
     /**
      * 取消按钮
      */

+ 13 - 0
src/views/componentsDVP/dvpPlan/index.vue

@@ -851,6 +851,19 @@ export default {
       this.$refs.editTableRow.editParam.planEndTime = val.planEndTime;
       this.$refs.editTableRow.editParam.isEquivalent = val.isEquivalent;
       this.$refs.editTableRow.isUpload = !!val.materialInventoryId;
+      // 材料清单回显
+      if (val.isUpload && val.isUpload === 1) {
+        let fileList = {
+          uid: val.materialInventoryId,
+          name: val.materialInventoryName,
+          status: 'done',
+          fileName: val.materialInventoryName,
+          fileSize: val.materialInventorySize,
+          filePath: val.materialInventoryPath,
+          newFileName: val.materialInventoryNewName
+        };
+        this.$refs.editTableRow.fileList.push(fileList);
+      }
       this.$refs.editTableRow.initData();
       this.isEditRow = true;
     },

+ 10 - 3
src/views/componentsDVP/verify/dvpVerify.vue

@@ -212,6 +212,7 @@
                 :placeholder="$t('global-btn.please-select') + $t('verity.dvp.test.start.date')"
                 class="width100"
                 valueFormat="YYYY-MM-DD"
+                :disabled-date='handleDisabledStartTime'
                 @change='changeStartTime'
                 v-model="editParam.testStartTime"
               />
@@ -225,7 +226,7 @@
                 class="width100"
                 valueFormat="YYYY-MM-DD"
                 @change='changeEndTime'
-                :disabled-date='handleDisabledTime'
+                :disabled-date='handleDisabledEndTime'
                 v-model="editParam.testEndTime"
               />
             </a-form-item>
@@ -883,13 +884,19 @@ export default {
     // 上传试验报告
     uploadTest() {
       this.$refs.testReport.visible = true;
+    },
+    /**
+     * 处理试验结束时间不能早于开始时间
+     * @param current
+     */
+    handleDisabledStartTime(current) {
+      return current && current < moment().subtract(1,"day").endOf('day');
     },
 		/**
 		 * 处理试验结束时间不能早于开始时间
 		 * @param current
 		 */
-		handleDisabledTime(current) {
-			// Can not select days before today and today
+		handleDisabledEndTime(current) {
 			return current && current < moment(this.editParam.testStartTime).endOf('day');
 		},
   }

+ 8 - 6
src/views/fullVehicle/dvpPlan/index.vue

@@ -104,10 +104,10 @@
           <a-button @click='saveDvpPlan' type="primary" class="mr10" :disabled="isLook || applyButtonFlag">
             {{ $t('global-btn.new') }}
           </a-button>
-          <!-- 导入 -->
-          <a-button :disabled="isLook || applyButtonFlag" @click='importFile' type="primary" class="mr10">
-            {{ $t('global-btn.import') }}
-          </a-button>
+          <!-- todo 导入-->
+<!--          <a-button :disabled="isLook || applyButtonFlag" @click='importFile' type="primary" class="mr10">-->
+<!--            {{ $t('global-btn.import') }}-->
+<!--          </a-button>-->
           <!-- 导出 -->
           <a-button @click='exportFile'>
             {{ $t('global-btn.export') }}
@@ -502,7 +502,7 @@ export default {
       this.applyTableData = [];
     },
     /**
-     * 导入
+     * todo 导入
      */
     importFile() {
 
@@ -633,6 +633,8 @@ export default {
               })
               _that.pagination.total = res.data.total;
             }
+          } else {
+            _that.pagination.total = 0;
           }
         }
       }).finally(() => {
@@ -661,7 +663,7 @@ export default {
       this.$api.deleteTest(data).then(res => {
         if (res.flag){
           this.initData();
-          this.$message.success(_this.$t('plan.dvp.operation-succeeded'), 1);
+          this.$message.success(this.$t('plan.dvp.operation-succeeded'), 1);
         }
       });
     },