Crunchy
2025-04-29 e5454b769d44a34af423bf87ac8a740bf8c20341
src/views/CNAS/externalService/supplierManage/index.vue
@@ -7,28 +7,25 @@
            <el-input v-model="searchForm.supplierName" clearable size="small"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="getTableData">查 询</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">重 置</el-button>
            <el-button type="primary" size="mini" @click="getTableData">查询</el-button>
            <el-button size="mini" @click="resetSearchForm">重置</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button size="medium" @click="exportExcel">导 出</el-button>
        <el-button size="medium" type="primary" @click="showDialog('add')">新 增</el-button>
<!--        <el-button size="medium" @click="exportExcel">导 出</el-button>-->
        <el-button size="small" type="primary" @click="showDialog('add')">新 增</el-button>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
        :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <form-dia ref="formDia" v-if="formDia" @closeDia="closeDia"></form-dia>
  </div>
</template>
<script>
// import ZTTable from "../caorui/ZTTable/index.vue";
// import TableCard from "../caorui/TableCard/index.vue";
// import axios from "axios";
import FormDia from "../supplierManage/component/formDia.vue";
import limsTable from '@/components/Table/lims-table.vue'
import {
@@ -38,7 +35,7 @@
} from '@/api/cnas/externalService/supplierManage/supplierManage'
export default {
  name: "a6-supplier-manage-new",
  name: "SupplierManage",
  // import 引入的组件需要注入到对象中才能使用
  components: {
    limsTable,
@@ -114,20 +111,20 @@
    // 获取表格数据
    async getTableData() {
      this.tableLoading = true;
      selectQualifiedSupplierManagementPage(this.searchForm).then(res => {
          this.tableLoading = false;
          if(res.code === 200) {
            this.tableData = res.data.records;
            this.page.total = res.data.total
          }
      selectQualifiedSupplierManagementPage({...this.searchForm, ...this.page}).then(res => {
        this.tableLoading = false;
        if (res.code === 200) {
          this.tableData = res.data.records;
          this.page.total = res.data.total
        }
      }).catch(err => {
        this.tableLoading = false
      })
    },
    // 重置
    resetSearchForm () {
      this.pagination.current = 1
      this.pagination.pageSize = 20
    resetSearchForm() {
      this.page.current = 1
      this.page.size = 10
      this.searchForm.supplierName = ''
      this.getTableData()
    },
@@ -144,18 +141,18 @@
      })
    },
    // 关闭弹框
    closeDia () {
    closeDia() {
      this.formDia = false
      this.getTableData()
    },
    // 删除记录
    deleteRow (row) {
    deleteRow(row) {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        delSupplierManagement({supplierManagementId:row.supplierManagementId}).then(res => {
        delSupplierManagement({ supplierManagementId: row.supplierManagementId }).then(res => {
          if (res.code === 200) {
            this.$message.success('删除成功!')
            this.getTableData()
@@ -170,10 +167,9 @@
    },
    // 导出excel
    async exportExcel() {
      exportSupplierManagement({deviceId:this.clickNodeVal.value}).then(res => {
      exportSupplierManagement({ deviceId: this.clickNodeVal.value }).then(res => {
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, '合格供应商.xlsx')
        this.$message.success('导出成功')
      })
    }
  },