whj 1 سال پیش
والد
کامیت
c2447d7744

+ 1 - 1
src/views/idle-assets/modules/BaseForm.vue

@@ -65,7 +65,7 @@
       <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
     </template>
     <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
-    <UpLoad ref="upLoad" @upLoad="handleUpLoadOk"/>
+    <UpLoad ref="upLoad" />
   </a-modal>
 </template>
 

+ 21 - 3
src/views/idle-assets/modules/Detail.vue

@@ -17,7 +17,9 @@
       bordered
       :data-source="modal.sbUnusedDetailVOS"
     >
-
+      <template #action="record">
+        <a @click="handleView(record)">查看图片</a>
+      </template>
     </a-table>
     <title-divider title="审核流程" width="90px"></title-divider>
     <a-steps :current="modal.sbUnusedVerifyRecordVOS.length-1" direction="vertical">
@@ -28,6 +30,7 @@
       <a-button @click="handleCancel">返回</a-button>
     </div>
     <AuditForm ref="auditForm" @ok="handleOk"/>
+    <UpLoad ref="upLoad" />
 
   </a-card>
 </template>
@@ -36,6 +39,7 @@
 import { getUnusedInfo } from '@/api/idle-assets/idle-assets'
 import AuditForm from './AuditForm.vue'
 import DetailList from '@/components/tools/DetailList'
+import UpLoad from './UpLoad'
 const DetailListItem = DetailList.Item
 
 export default {
@@ -43,7 +47,8 @@ export default {
   components: {
     AuditForm,
     DetailList,
-    DetailListItem
+    DetailListItem,
+    UpLoad
   },
   data () {
     return {
@@ -74,8 +79,17 @@ export default {
           title: '所属车间',
           dataIndex: 'positionName',
           key: 'positionName'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          checked: true,
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
         }
-      ]
+      ],
+      previewVisible: false,
+      previewImage: ''
     }
   },
   created () {
@@ -103,7 +117,11 @@ export default {
         sbUnusedVerifyRecordVOS: [],
         sbUnusedDetailVOS: []
       }
+    },
+    handleView (record) {
+      this.$refs.upLoad.base(record, true)
     }
+
   }
 }
 </script>

+ 11 - 2
src/views/idle-assets/modules/UpLoad.vue

@@ -8,6 +8,7 @@
       @preview="handlePreview"
       accept="image/*"
       :headers="headers"
+      :disabled="disabled"
     >
       <div>
         <a-icon type="plus" />
@@ -37,13 +38,21 @@ export default {
       modal: {},
       headers: {
         Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
-      }
+      },
+      disabled: false
     }
   },
   methods: {
-    base (record) {
+    base (record, disabled = false) {
+      this.disabled = disabled
       this.visible = true
       this.modal = record
+      if (disabled) {
+        this.defaultApplicationFileList = this.BaseTool.UPLOAD.transImg(record.usedFileList.map((item, i) => {
+          item.id = i
+          return item
+        }))
+      }
       if (!record.sbFileList) {
         record.sbFileList = []
         return