Просмотр исходного кода

检测档案增加附件下载功能、检测记录归档优化

cfort 2 лет назад
Родитель
Сommit
07638dda67

+ 12 - 3
src/views/platform/bpmn/bpmInstHis/record/component/testingRecord.vue

@@ -93,9 +93,9 @@
                                                 v-for="i in fileList"
                                                 :key="i.id"
                                                 class="operate-item"
-                                                @click="preview(i)"
                                             >
-                                                <i class="el-icon-tickets"></i>{{ i.fileName }}.{{ i.ext }}
+                                                <span @click="preview(i)"><i class="el-icon-tickets" ></i>{{ i.fileName }}.{{ i.ext }}</span>
+                                                <i class="el-icon-download" @click="download(i)"></i>
                                             </div>
                                         </div>
                                     </el-popover>
@@ -150,6 +150,7 @@
 <script>
     import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
     import { previewFile } from '@/api/platform/file/attachment'
+    import { downloadFile } from '@/business/platform/file/utils'
     import PopupManager from '@/utils/popup'
     import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
     const searchList = [
@@ -331,7 +332,7 @@
             getTesting (row) {
                 const { wei_tuo_id_, yang_pin_bian_hao, xiu_gai_bao_gao_b } = row
                 this.testingList = []
-                const sql = `select b.id_ as id, a.defkey_ as number, a.jian_ce_xiang_mu_ as projectName from t_mjjcnlfw a, t_lhjczb b where a.id_ = b.jian_ce_xiang_mu_ and b.wei_tuo_id_ = '${wei_tuo_id_}' and b.yang_pin_bian_hao = '${yang_pin_bian_hao}' and find_in_set(b.jian_ce_xiang_mu_, '${xiu_gai_bao_gao_b}')`
+                const sql = `select b.id_ as id, a.defkey_ as number, a.jian_ce_xiang_mu_ as projectName, max(b.create_time_) from t_mjjcnlfw a, t_lhjczb b where a.id_ = b.jian_ce_xiang_mu_ and b.wei_tuo_id_ = '${wei_tuo_id_}' and b.yang_pin_bian_hao = '${yang_pin_bian_hao}' and find_in_set(b.jian_ce_xiang_mu_, '${xiu_gai_bao_gao_b}') group by b.jian_ce_xiang_mu_`
                 curdPost('sql', sql).then(res => {
                     this.testingList = res.variables && res.variables.data
                     // console.log(this.testingList)
@@ -428,6 +429,9 @@
                     query: this.fileOption
                 })
                 window.open(routeData.href);
+            },
+            download (file) {
+                downloadFile(file)
             }
         }
     }
@@ -506,5 +510,10 @@
     .operate-item {
         cursor: pointer;
         color: #85ce61;
+        .el-icon-download {
+            float: right;
+            font-size: 16px;
+            color: #409eff;
+        }
     }
 </style>