Browse Source

2023-5-26

codeMan 2 years ago
parent
commit
6e3ca87bd0

+ 2 - 1
src/HDrpManagement/workReport/modules/aside/index.vue

@@ -17,7 +17,7 @@
           class="list-item" 
           :style="currentIndex == item.sys_workreportid ? '--borderColor:#3874F6' : '--borderColor:#cccccc'" 
           v-for="item in list" 
-          :key="item.sys_workreportid" 
+          :key="'item' + item.sys_workreportid" 
           @click="itemClick(item)"
         >
           <div class="item-left">
@@ -191,6 +191,7 @@ export default {
   line-height: 30px;
   border-radius: 50%;
   margin-right: 10px;
+  color: #ffffff;
 }
 .list .list-item .item-left .item-info {}
 .list .list-item .item-left .item-info .item-info_top {

+ 38 - 6
src/HDrpManagement/workReport/modules/createReport/index.vue

@@ -27,9 +27,16 @@
             </p>
           </div>
         </template>
+        <upload
+          ref="upload"
+          :folderid="folderid"
+          @onSuccess="onSuccess"
+          :bindData="bindData"
+          type="button">
+        </upload>
       </div>
       <div class="fixed__btn__panel">
-        <el-button class="normal-btn-width" type="primary" size="small" @click="submitForm">创 建</el-button>
+        <el-button class="normal-btn-width" :loading="loading" type="primary" size="small" @click="submitForm">创 建</el-button>
         <!-- <el-button class="normal-btn-width" size="small" @click="resetForm">重 置</el-button> -->
       </div>
     </el-drawer>
@@ -37,13 +44,20 @@
 </template>
 
 <script>
+import upload from '@/SManagement/orderclue/components/upload'
+import { log } from '@antv/g2plot/lib/utils'
 export default {
+  components:{upload},
   data () {
     return {
       modelList:[],
+      loading:false,
       drawer:false,
       detail:'',
-      currentModel:{}
+      currentModel:{},
+      bindData:{},
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      uploadIndex:0,
     }
   },
   methods: {
@@ -94,12 +108,30 @@ export default {
           },
       })
       this.tool.showMessage(res,() => {
-        this.drawer = false
-        res.data.name = res.data.createby
-        this.$emit('onSuccess',res.data)
+        this.bindData = {
+          "ownertable": 'sys_workreport',
+          "ownerid": res.data.sys_workreportid,
+          "usetype": 'default',
+        }
+        this.loading = true
+        let index = 0
+        this.$refs['upload'].toUpload(() => {
+          if (!index) this.uploadIndex = this.$refs.upload.fileList.length
+          index++
+          if (this.uploadIndex == index) {
+            this.loading = false
+            this.drawer = false
+            res.data.name = res.data.createby
+            this.$emit('onSuccess',res.data)
+          }
+          
+        })
       })
       console.log(res);
-    }
+    },
+    onSuccess () {
+
+    } 
   },
   created () {
     this.getModelList()

+ 22 - 3
src/HDrpManagement/workReport/modules/reportContent/index.vue

@@ -11,13 +11,22 @@
           <p v-for="(item2,index) in item.content[0].content" style="font-size:12px">{{ item2 }}</p>
         </div>
       </div>
+      <file-item 
+        :marginRight="10"
+        :rowCount="5"
+        :isDownLoad="true" 
+        :fileData="detail.attinfos"
+        @deleteSuccess="deleteFile">
+      </file-item>
     </div>
     <el-empty description="暂无数据" size="mini" v-else></el-empty>
   </div>
 </template>
 
 <script>
+import FileItem from '@/SManagement/orderclue/components/file/index2'
 export default {
+  components:{FileItem},
   data () {
     return {
       detail:{}
@@ -33,15 +42,25 @@ export default {
         },
       })
       this.detail = res.data
+      this.detail.attinfos = this.fileType.fileList(this.detail.attinfos)
       if (this.detail.items) {
         this.detail.items.forEach(item => {
           if (item.content.length) {
-            item.content[0].content = item.content[0].content.split('\n')
+            item.content[0].content = item.content[0].content.split('/n')
           }
         })
       }
-      console.log(this.detail);
-    }
+    },
+    deleteFile (data) {
+      this.detail.forEach(item => {
+        item.attinfo.forEach((item2,index) => {
+          if(item2.linksid == data.linksid) {
+            item.attinfo.splice(index,1)
+          }
+        })
+      })
+      
+    },
   }
 }
 </script>