gaoluyang
9 小时以前 29be8639dc16b5d82bddc6099b1fa5cdca75f77a
src/views/CNAS/process/method/standardMethodsChange/index.vue
@@ -4,7 +4,7 @@
      <div style="display: flex;">
        <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
          <span style="width: 88px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">标准方法</span>
          <el-input size="small" placeholder="请输入" clearable v-model="searchForm.methodName"
          <el-input size="small" placeholder="请输入" clearable v-model="searchForm.standardName"
                    @keyup.enter="searchList"></el-input>
        </div>
        <div style="line-height: 30px;">
@@ -17,51 +17,54 @@
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'"
                  @pagination="pagination" :page="page" :tableLoading="tableLoading"></lims-table>
      <limsTable :column="tableColumn" :height="'calc(100vh - 23em)'" :table-data="tableData"
                 :table-loading="tableLoading" :page="page"
                 @pagination="pagination">
      </limsTable>
    </div>
    <formDIaChange v-if="formDIa" ref="formDIa" :operationType="operationType" @closeDia="closeDia"></formDIaChange>
    <component :is="'formDIa'" v-if="formDIa" ref="formDIa" :operationType="operationType" :verify-type="0"
               @closeDia="closeDia" />
  </div>
</template>
<script>
import formDIaChange from './component/formDIaChange.vue';
import limsTable from '@/components/Table/lims-table.vue'
import {
  delMethodVerify,
  exportMethodVerify,
  pagesMethodVerify
} from '@/api/cnas/process/method/standardMethodsChange'
import formDIa from '../methodVerification/component/formDIa.vue'
import { delMethodVerify, exportMethodVerify, pagesMethodVerify } from '@/api/cnas/process/method/methodVerification'
export default {
  name: 'StandardMethodschange',
  // import 引入的组件需要注入到对象中才能使用
  components: { limsTable, formDIaChange },
  name: 'StandardMethodsChange',
  components: { limsTable, formDIa },
  data() {
    // 这里存放数据
    return {
      searchForm: {
        methodName: '',
        standardName: '',
        operationType: 0,
      },
      options: [
        { label: '上半年', value: '1' },
        { label: '下半年', value: '2' },
      ],
      tableColumn: [
        {
          label: '标准方法',
          prop: 'methodName',
          minWidth: '100'
          minWidth: '120'
        },
        {
          label: '验证原因',
          label: '变更原因',
          prop: 'verifyReason',
          minWidth: '100'
          minWidth: '120'
        },
        {
          label: '主要技术变化',
          prop: 'technologyChange',
          minWidth: '120'
        },
        {
          label: '确认时间',
          prop: 'confirmDate',
          minWidth: '100'
        },
        {
          label: '创建时间',
          prop: 'createTime',
          minWidth: '100'
        },
        {
@@ -69,6 +72,13 @@
          minWidth: '60',
          label: '操作',
          operation: [
            {
              name: '详情',
              type: 'text',
              clickFun: (row) => {
                this.openFormDia('view', row);
              },
            },
            {
              name: '编辑',
              type: 'text',
@@ -91,16 +101,15 @@
                this.deleteRow(row);
              },
            }
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 10,
        size: 20,
        current: 1,
        total: 0,
        total: 0
      },
      formDIa: false,
      operationType: '',
@@ -109,16 +118,16 @@
  mounted() {
    this.searchList()
  },
  // 方法集合
  methods: {
    // 查询列表
    searchList() {
      const entity = {
        methodName: this.searchForm.methodName,
        standardName: this.searchForm.standardName,
        operationType: this.searchForm.operationType,
      }
      const page = this.page
      this.tableLoading = true
      pagesMethodVerify({ ... this.page, ...entity }).then(res => {
      pagesMethodVerify({ ...page, ...entity }).then(res => {
        this.tableLoading = false
        if (res.code === 200) {
          this.tableData = res.data.records
@@ -151,7 +160,7 @@
    },
    // 重置查询条件
    resetSearchForm() {
      this.searchForm.methodName = '';
      this.searchForm.standardName = '';
      this.searchList()
    },
    openFormDia(type, row) {
@@ -161,19 +170,17 @@
        this.$refs.formDIa.openDia(row)
      })
    },
    // 导出
    downLoadPost(row) {
      exportMethodVerify({ methodVerifyId: row.methodVerifyId }).then(res => {
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '标准方法变更记录.docx')
      })
    },
    // 关闭弹框
    closeDia() {
      this.formDIa = false
      this.searchList()
    },
    // 导出
    downLoadPost(row) {
      this.outLoading = true
      exportMethodVerify({ methodVerifyId: row.methodVerifyId }).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '标准(方法)确认记录.docx')
      })
    },
    // 分页切换
    pagination(page) {