Ver código fonte

附件测试2

qinzhipeng_v 5 anos atrás
pai
commit
2ee799ea13

+ 3 - 8
src/views/Platform/bugManage/bugCreate.vue

@@ -281,15 +281,10 @@ export default {
       for (var a of this.fileList) {
         this.fileDbList.push({ 'name': a.name, 'url': 'http:' + a.response.url })
       }
-      if (this.fileDbList === '') {
-        this.dis = true
-        // this.$message({ showClose: true, message: '上传文件夹为空', type: 'success' })
-      } else {
-        this.accessory = JSON.stringify(this.fileDbList)
-        this.dis = false
-        this.$message({ showClose: true, message: '文件上传成功', type: 'success' })
+      this.accessory = JSON.stringify(this.fileDbList)
+      this.dis = false
+      this.$message({ showClose: true, message: '文件上传成功', type: 'success' })
       // }, 500)
-      }
     },
     async bugListSelect() {
       await bugGetEnum().then(res => {

+ 15 - 7
src/views/Platform/bugManage/bugUpdate.vue

@@ -163,7 +163,9 @@
         </div>
         <div class="cla">
           <el-table :data="uptataKey" fit style="width: 100%;">
-            <el-table-column type="index" width="50" />
+            <el-table-column label="" min-width="50">
+              <template slot-scope="scope">{{ scope.row.index }}</template>
+            </el-table-column>
             <el-table-column label="" min-width="150">
               <template slot-scope="scope">{{ scope.row.name }}</template>
             </el-table-column>
@@ -319,9 +321,11 @@ export default {
       bugGet(this.$route.query.id).then(res => {
         this.form = res.data
         var str = res.data.accessory
-        var obj = JSON.parse(str.split('{}')[0])
-        for (var a of obj) {
-          this.uptataKey.push(a)
+        if (str !== '') {
+          var obj = JSON.parse(str.split('{}')[0])
+          for (var a of obj) {
+            this.uptataKey.push(a)
+          }
         }
         this.platformTypeStr = this.bizOptions.filter(value => value.code === this.form.bizId)[0].child
         if (this.form.clientType) {
@@ -392,9 +396,13 @@ export default {
         }
       }))
     },
-    handleDelContractList(index) {
-      console.log(index)
-      this.uptataKey.splice(index, 1)
+    handleDelContractList(val) {
+      for (var i = 0; i <= this.uptataKey.length; i++) {
+        if (val.name === this.uptataKey[i].name) {
+          this.uptataKey.splice(i, 1)
+        }
+      }
+      console.log(this.uptataKey)
     },
     // 提交表单并且返回刷新
     createFormData(form) {