Pārlūkot izejas kodu

图片上传缓存的问题

Shan9312 2 mēneši atpakaļ
vecāks
revīzija
cde6cd8b17

BIN
dist-现代-3.zip


BIN
dist-现代牧业-2.zip


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.html


+ 24 - 19
src/views/maintenance/maintain/index.vue

@@ -1263,14 +1263,14 @@ export default {
     },
   
     handlePicChange(file, fileList) {
-     
+     this.handlePicSuccess()
       // console.log(this.seeTemp)
     },
     handlePicSuccess(response, file, fileList) {
       console.log('文件上传成功时的钩子response', response, )
       console.log('文件上传成功时的钩子file', file)
       console.log('fileList', fileList)
-
+  
       //3张图片时,关闭新增的按钮
       if (fileList.length == 3) {
         document.getElementById('uploadPic').lastChild.style.display = "none"
@@ -1288,8 +1288,8 @@ export default {
         console.log("333")
         this.seeTemp.scenePhoto3 = response.execresult.LastInsertId.toString()
       }
-      console.log('this.picArr1', this.picArr1)
-      console.log('this.seeTemp', this.seeTemp)
+     this.fileList = fileList;
+     console.log(this.fileList,'上传成功后的数组')
       // 上传成功后 在调用图片保定合同的接口
       this.handleSaveImg(1)
     },
@@ -1905,16 +1905,14 @@ export default {
       this.No2 = false
       this.dialogFormVisible_maintainComplete = true
       this.listAdd = []
-
-    //  this.handleDelALlImg(row);
     },
     // 如果有历史记录则删除所图图片
-    async handleDelALlImg(row){
-      const obj = row != undefined ? row : this.seeTemp
-      if((obj.picId1 != '' || obj.picId1 != '-1' ) ||  (obj.picId2 != '' || obj.picId2 != '-1' ) || (obj.picId3 != '' || obj.picId3 != '-1'  ) ){
-        const obj = { name: "upkeepImage", parammaps: { id: this.seeTemp.id, picId1: '-1' , picId2: '-1', picId3: '-1' }}
+    async handleDelALlImg(){
+      console.log('完成保养确认---删除图片',this.maintainCompleteTemp)
+      if((this.maintainCompleteTemp.picId1 != '' ||   this.maintainCompleteTemp.picId1 != '-1' ) ){
+        const obj = { name: "upkeepImage", parammaps: { id:  this.maintainCompleteTemp.id, picId1: '-1' , picId2: '-1', picId3: '-1' }}
         const { data, code } = await saveImgIds(obj)
-        console.log(data,code,'完成保养删除历史了')
+        console.log(data,code,'删除历史了')
       }
     },
     changeIsOldProducts(val) {
@@ -2003,13 +2001,12 @@ export default {
       if (this.maintainCompleteTemp.laidcou == 0) {
         if (this.maintainCompleteTemp.isOldProducts == 0) {
           console.log('否')
+          this.handleDelALlImg()
           this.requestParam.name = 'completeUpkeep'
           this.requestParam.parammaps = {}
           this.requestParam.parammaps.id = this.maintainCompleteTemp.id
           PostDataByName(this.requestParam).then((response) => {
             if (response.msg !== 'fail') {
-
-
               //如果有设备记录仪的权限
               if(this.maintainCompleteTemp.isVideoBtnShow == '1'){
                 // 临时注释
@@ -2108,6 +2105,7 @@ export default {
                 this.postDataPramas.data[1] = { 'name': 'completeUpkeep', 'type': 'e', 'parammaps': {
                   id: this.maintainCompleteTemp.id
                 }}
+
                 ExecDataByConfig(this.postDataPramas).then(response => {
                   console.log('完成维修-是-保存发送参数', this.postDataPramas)
                   if (response.msg === 'fail') {
@@ -2118,10 +2116,12 @@ export default {
                       duration: 2000
                     })
                   } else {
+                    this.handleDelALlImg()
                     this.dialogFormVisible_maintainComplete = false
                     this.dialogFormVisible_See = false
                     this.get_table_data()
                     this.getPendingList()
+                   
                     this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
                   }
                 })
@@ -2145,18 +2145,23 @@ export default {
     // 保养审核
     handleExamine(row) {
       console.log('点击了保养审核', row, this.seeTemp, this.fileList)
-      const obj = row != undefined ? row : this.seeTemp
-      if(!this.fileList.length && obj.SHStatue == 2){
-        this.$notify({ title: '提示', message: '请上传保养图片', type: 'warning', duration: 3000 })
-        return
-      }
-       
+     
       if (row == undefined) {
+        console.log('里面审核')
         this.examineTemp = this.seeTemp
         this.$set(this.seeTemp, 'isStatue', 3)
         this.$set(this.seeTemp, 'workflowNote', '')
         this.$set(this.examineTemp, 'scores', '')
+        if(( this.seeTemp.scenePhoto1 == '-1' || this.seeTemp.scenePhoto1 == '' ) || !this.fileList.length ){
+          this.$notify({ title: '提示', message: '请上传保养图片', type: 'warning', duration: 3000 })
+          return
+        }
       } else {
+        console.log('外面审核')
+        if((row.picId1 == '' ||  row.picId1 == '-1' )){
+        this.$notify({ title: '提示', message: '请上传保养图片', type: 'warning', duration: 3000 })
+        return
+        }
         this.examineTemp = Object.assign({}, row)
         this.$set(this.examineTemp, 'isStatue', 3)
         this.$set(this.examineTemp, 'workflowNote', '')

+ 9 - 3
src/views/report/spotCheck/index.vue

@@ -77,6 +77,7 @@
         v-loading="loading"
         element-loading-text="数据正在加载..."
         ref="table"
+        :default-sort= "{prop: 'spotDetectionRate', order: 'ascending'}"
       >
         <template v-for="(item, index) in tableHeader">
           <el-table-column
@@ -93,11 +94,13 @@
           <el-table-column
             v-else="item.prop == 'spotDetectionRate'"
             :key="index"
+            sortable
             show-overflow-tooltip
             :prop="item.prop"
             :label="item.label"
             :width="item.width"
             align="center"
+            
             :render-header="renderColumnHeader"
           >
           </el-table-column>
@@ -190,7 +193,7 @@ export default {
         {
         label: '点检率',
         prop: 'spotDetectionRate',
-        width: '120'
+        width: '160'
         }
     ]
     }
@@ -326,5 +329,8 @@ methods: {
     // white-space: pre;
     white-space: pre-wrap; // 也行。
   }
-  </style>
-  
+
+  /deep/.el-table .caret-wrapper{
+    top: -15px!important;
+  }
+  </style>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels