whj 1 year ago
parent
commit
7d0b3db2cb
2 changed files with 89 additions and 3 deletions
  1. 26 3
      src/views/sb/info/SbInfoC.vue
  2. 63 0
      src/views/sb/info/modules/ListModal.vue

+ 26 - 3
src/views/sb/info/SbInfoC.vue

@@ -219,6 +219,9 @@
               <template #positionNo="text,record">
                 <a @click="showChangeLog(record)">{{ text }}</a>
               </template>
+              <template #sbMeasureLogCredential="text">
+                <a @click="$refs.listModal.base(text)">查看</a>
+              </template>
               <span slot="action" slot-scope="record">
                 <template>
                   <div>
@@ -280,6 +283,9 @@
                     <a-button type="primary" icon="plus" @click="addLogBySb(record)">新增</a-button>
                   </div>
                   <a-table :columns="childColumns1" :data-source="childMap">
+                    <template #sbMeasureLogCredential="text">
+                      <a @click="$refs.listModal.base(text)">查看</a>
+                    </template>
                   </a-table>
                 </a-card>
               </div>
@@ -304,12 +310,14 @@
     <base-form-location ref="baseFormLocation" @ok="handleOk" />
     <SbChangeLogSelectModal ref="sbChangeRecordSelectModal" @ok="handleOk" />
     <AddLogForm ref="addLogForm" @ok="handleLogOk" />
+    <ListModal ref="listModal" />
   </div>
 </template>
 
 <script>
 import { STable, Ellipsis } from '@/components'
 import BaseForm from './modules/BaseForm'
+import ListModal from './modules/ListModal'
 import AddLogForm from './modules/AddLogForm'
 import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheckBatch'
 import BaseFormStatusLog from '@/views/sb/status-log/modules/BaseForm'
@@ -350,7 +358,8 @@ export default {
     BaseFormMeasureInStore,
     BaseFormLocation,
     BaseFormStatusLog,
-    SbChangeLogSelectModal
+    SbChangeLogSelectModal,
+    ListModal
   },
   props: {
     filter: {
@@ -509,6 +518,13 @@ export default {
           width: 100,
           checked: true
         },
+        {
+          title: '文件查看',
+          checked: true,
+          dataIndex: 'sbMeasureLogCredential',
+          width: 120,
+          scopedSlots: { customRender: 'sbMeasureLogCredential' }
+        },
         {
           title: '操作时间',
           dataIndex: 'operatorTime',
@@ -726,6 +742,13 @@ export default {
           width: 200,
           dataIndex: 'content'
         },
+        {
+          title: '文件查看',
+          checked: true,
+          dataIndex: 'sbMeasureLogCredential',
+          width: 120,
+          scopedSlots: { customRender: 'sbMeasureLogCredential' }
+        },
         {
           title: '操作时间',
           checked: true,
@@ -1039,8 +1062,9 @@ export default {
       this.$refs.addLogForm.base(record)
     },
     handleLogOk (val) {
-      getLogBySbId({ sbId: val.id }).then(res => {
+      getLogBySbId({ sbId: val.sbId }).then(res => {
         this.childMap = res.data
+        this.$refs.table.refresh(true)
       })
     },
     doImport () {
@@ -1055,7 +1079,6 @@ export default {
     },
     rowClassName (record, index) {
       if (record.measureStatus === 1 && record.status !== 7) return 'orange'
-      console.log(record)
       switch (record.status) {
         case 1:
           return 'green'

+ 63 - 0
src/views/sb/info/modules/ListModal.vue

@@ -0,0 +1,63 @@
+<template>
+  <a-modal
+    title="新增"
+    :visible="visible"
+    @cancel="handleCancel"
+  >
+    <a-table :columns="columns" :data-source="list">
+      <template #action="record">
+        <a :href="record.url" download>下载</a>
+      </template>
+    </a-table>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      visible: false,
+      list: [],
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: 100,
+          checked: true,
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '文件名称',
+          checked: true,
+          width: 200,
+          dataIndex: 'name'
+        },
+        {
+          title: '下载',
+          checked: true,
+          key: 'action',
+          width: 200,
+          scopedSlots: { customRender: 'action' }
+        }
+      ]
+    }
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      console.log(record)
+      this.list = record
+    },
+    handleCancel (e) {
+      this.confirmLoading = false
+      this.visible = false
+    }
+  }
+}
+</script>
+
+<style>
+
+</style>