|
@@ -0,0 +1,96 @@
|
|
|
+<!-- 供应商附件管理 -->
|
|
|
+<script>
|
|
|
+import { referFile } from "@/api/purchase/supAtttachment";
|
|
|
+import useColumns from "./columns";
|
|
|
+export default {
|
|
|
+ name: "SupAtttachment",
|
|
|
+ components: {
|
|
|
+ ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ const page = this.$init.page();
|
|
|
+ const { TableColumns } = useColumns();
|
|
|
+ return {
|
|
|
+ page,
|
|
|
+ size: "mini",
|
|
|
+ TableColumns,
|
|
|
+ loading: false,
|
|
|
+ tableData: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getList(params) {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ let { code, msg, rows, total } = await referFile(params);
|
|
|
+ if (code == 200) {
|
|
|
+ this.tableData = rows;
|
|
|
+ this.page.total = total;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 下载
|
|
|
+ useDownload(row) {
|
|
|
+ window.open(row.url, "_self");
|
|
|
+ },
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ let { code } = this.$route.query;
|
|
|
+ await this.getList({ ...this.page, code });
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <el-card
|
|
|
+ v-loading="loading"
|
|
|
+ :body-style="{
|
|
|
+ height: '100%',
|
|
|
+ padding: 0,
|
|
|
+ display: 'flex',
|
|
|
+ 'flex-direction': 'column',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-super-ux-table
|
|
|
+ v-model="tableData"
|
|
|
+ :size="size"
|
|
|
+ :page="page"
|
|
|
+ :columns="TableColumns"
|
|
|
+ index
|
|
|
+ pagination
|
|
|
+ storage-key="SupAtttachmentSuperTable"
|
|
|
+ @row-dblclick="useDownload"
|
|
|
+ @pagination="getList(page)"
|
|
|
+ >
|
|
|
+ <ux-table-column fixed="right" title="操作" align="center" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :href="scope.row.url"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-download"
|
|
|
+ >下载</el-link
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </ux-table-column>
|
|
|
+ </el-super-ux-table>
|
|
|
+ </el-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+.el-card {
|
|
|
+ width: calc(100% - 32px);
|
|
|
+ height: calc(100vh - 32px);
|
|
|
+ margin: 16px;
|
|
|
+ padding: 16px;
|
|
|
+ border-radius: 8px;
|
|
|
+}
|
|
|
+
|
|
|
+.el-button-group + .el-button-group {
|
|
|
+ margin: 0 0 0 8px;
|
|
|
+}
|
|
|
+</style>
|