gaoluyang
2025-03-21 f9d1ac78b245cb672342e96cf0e905b812352651
src/views/CNAS/process/method/methodVerification/index.vue
@@ -7,31 +7,20 @@
            <el-input size="small" placeholder="请输入" clearable v-model="searchForm.methodName"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="searchList">查 询</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">重 置</el-button>
            <el-button type="primary" size="mini" @click="searchList">查询</el-button>
            <el-button size="mini" @click="resetSearchForm">重置</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button size="medium" type="primary" @click="openFormDia('add')">新 增</el-button>
        <el-button size="small" type="primary" @click="openFormDia('add')">新 增</el-button>
      </div>
    </div>
    <div class="table">
      <div>
        <TableCard :showForm="false" :showTitle="false">
          <template v-slot:table>
            <limsTable
              :column="tableColumn"
              :height="'calc(100vh - 23em)'"
              :table-data="tableData"
              :table-loading="tableLoading"
              style="padding: 0 15px;margin-bottom: 16px"
              :page="page"
              @pagination="pagination">
            </limsTable>
          </template>
        </TableCard>
      </div>
      <limsTable :column="tableColumn" :height="'calc(100vh - 23em)'" :table-data="tableData"
                 :table-loading="tableLoading" :page="page"
                 @pagination="pagination">
      </limsTable>
    </div>
    <formDIa v-if="formDIa" ref="formDIa" :operationType="operationType" @closeDia="closeDia"></formDIa>
  </div>
@@ -39,14 +28,13 @@
<script>
import limsTable from '@/components/Table/lims-table.vue'
import TableCard from '@/views/CNAS/externalService/serviceAndSupplyPro/component/index.vue';
import formDIa from './component/formDIa.vue';
import { delMethodVerify, exportMethodVerify, pagesMethodVerify } from '@/api/cnas/process/method/methodVerification'
export default {
  name: 'a7-method-verification',
  name: 'MethodVerification',
  // import 引入的组件需要注入到对象中才能使用
  components: { TableCard, limsTable, formDIa },
  components: { limsTable, formDIa },
  data() {
    // 这里存放数据
    return {
@@ -110,6 +98,7 @@
      page: {
        size: 20,
        current: 1,
        total: 0
      },
      total: 0,
      formDIa: false,
@@ -129,9 +118,9 @@
      }
      const page = this.page
      this.tableLoading = true
      pagesMethodVerify({...page,...entity}).then(res => {
      pagesMethodVerify({ ...page, ...entity }).then(res => {
        this.tableLoading = false
        if (res.code === 200){
        if (res.code === 200) {
          this.tableData = res.data.records
          this.page.total = res.data.total
        }
@@ -141,16 +130,16 @@
      })
    },
    // 删除
    deleteRow (row) {
    deleteRow(row) {
      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.tableLoading = true
        delMethodVerify({methodVerifyId: row.methodVerifyId}).then(res => {
        delMethodVerify({ methodVerifyId: row.methodVerifyId }).then(res => {
          this.tableLoading = false
          if (res.code === 200){
          if (res.code === 200) {
            this.$message.success('删除成功')
            this.searchList()
          }
@@ -165,7 +154,7 @@
      this.searchForm.methodName = '';
      this.searchList()
    },
    openFormDia (type, row) {
    openFormDia(type, row) {
      this.formDIa = true
      this.operationType = type
      this.$nextTick(() => {
@@ -174,15 +163,14 @@
    },
    // 导出
    downLoadPost(row) {
      exportMethodVerify({methodVerifyId:row.methodVerifyId}).then(res => {
      exportMethodVerify({ methodVerifyId: row.methodVerifyId }).then(res => {
        this.outLoading = false
        const blob = new Blob([res],{ type: 'application/msword' });
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '标准(方法)确认记录.docx')
        this.$message.success('导出成功')
      })
    },
    // 关闭弹框
    closeDia () {
    closeDia() {
      this.formDIa = false
      this.searchList()
    },