huangbin 4 năm trước cách đây
mục cha
commit
97534bb5a4

+ 1 - 1
src/common/setup/table/event.ts

@@ -15,7 +15,7 @@ export function getTableEvent<T>(param: TableEventCB) {
         return {
             onClick: () => {  // 表格点击
                 selectedRow.value = record
-                expandedRowKeys.value = (record as any).key
+                expandedRowKeys.value = [(record as any).key]
                 param.clickCB && param.clickCB()
             },
             // onDblclick: () => { // 双击

+ 1 - 1
src/views/platinum/platinum_recharge_withdrawal_review/list/recharge/compoments/common-detail/index.vue

@@ -48,7 +48,7 @@ export default defineComponent({
                     { label: '名称', value: formatValue(data.accountname) },
                     { label: '账户类型', value: data.userinfotype === 1 ? '个人' : '企业' },
                     { label: '充值金额', value: formatValue(data.amount) },
-                    { label: '凭证', value: formatValue(getImgName(data.certificatephotourl)), className: 'blue' },
+                    { label: '凭证', value: '查看', className: 'blue' },
                     { label: '申请时间', value: formatValue(data.updatetime) },
                 ];
                 getDesList(list);

+ 30 - 0
src/views/platinum/platinum_recharge_withdrawal_review/list/recharge/index.vue

@@ -23,10 +23,25 @@
         <template #applystatus="{ }">
           <a>{{ getTableListStatus() }}</a>
         </template>
+        <template #certificatephotourl="{ record}">
+          <template v-if="record.certificatephotourl">
+            <a v-for="(item, index) in getUrl(record.certificatephotourl)"
+               :key="item"
+               @click.stop="getVisibleImg(record.certificatephotourl, index)">{{item}}</a>
+          </template>
+          <span v-else></span>
+        </template>
       </a-table>
     </contextMenu>
     <ControlModal :selectedRow="selectedRow"
                   @refresh="getTableList" />
+    <a-modal :visible="previewVisible"
+             :footer="null"
+             @cancel="cancelImg">
+      <img alt="预览附件"
+           style="width: 100%"
+           :src="previewImage" />
+    </a-modal>
   </div>
 </template>
 
@@ -38,6 +53,7 @@ import Filter from '../../compoments/filter/index.vue';
 import ControlModal from './compoments/controlModal/index.vue';
 import { handleTableStatus, inOrOutStatus } from '../../setup';
 import { BtnList as BtnListType } from '@/common/components/buttonList/interface';
+import { handlePreviewImg } from '@/common/setup/upload';
 
 export default defineComponent({
     name: 'platinum_recharge_review_tab',
@@ -63,6 +79,15 @@ export default defineComponent({
             }
             return firstBtn.filter((e: BtnListType) => arr.includes(e.lable));
         }
+        // 预览附件
+        const { previewVisible, previewImage, cancelImg, previewImg } = handlePreviewImg();
+        function getUrl(value: string): string[] {
+            return value.split(',').map((el, i) => `附件${i + 1}`);
+        }
+        function getVisibleImg(value: string, i: number) {
+            const str = value.split(',')[i];
+            previewImg(str);
+        }
         function getTableList() {
             queryTable(queryAccountInOutApply, { querytype: 2, applystatus: tableStatus.value });
         }
@@ -77,8 +102,13 @@ export default defineComponent({
             getTableList,
             getBtnListAction,
             getTableListStatus,
+            previewVisible,
+            previewImage,
+            getVisibleImg,
+            cancelImg,
             columns,
             search,
+            getUrl,
             expandedRowKeys,
             selectedRow,
             Rowclick,