Browse Source

Merge branch 'dev' of http://172.16.100.139/new-business/drp-web into dev

DongZ 1 year ago
parent
commit
29ac65aa9e

+ 10 - 0
src/api/purchase/supAtttachment.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 物料分工详情
+export function referFile(params) {
+  return request({
+    url: `/refer/file/${params.code}`,
+    method: 'get',
+    params,
+  })
+}

+ 15 - 0
src/views/purchase/SupAtttachment/columns.js

@@ -0,0 +1,15 @@
+export default function useColumns() {
+  // const SearchColumns = [];
+  const TableColumns = [
+    {
+      item: { key: "name", title: "名称", width: "auto" },
+      attr: {},
+    },
+    // {
+    //   item: { key: "", title: "" },
+    //   attr: {},
+    // },
+
+  ];
+  return { TableColumns };
+}

+ 96 - 0
src/views/purchase/SupAtttachment/index.vue

@@ -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>