licp
2024-12-19 eef11aea39d1a40eefdd4a782ed3212a3c4bbca2
完成7.2方法t验证迁移
已修改1个文件
已添加1个文件
223 ■■■■■ 文件已修改
src/components/do/a7-method-verification/formDIa.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/a7-method-verification.vue 221 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a7-method-verification/formDIa.vue
@@ -443,7 +443,7 @@
  margin-top: 2vh !important;
}
>>>.el-dialog__body {
  max-height: 720px;
  max-height: 75vh;
  overflow-y: auto;
}
.tables {
src/components/view/a7-method-verification.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,221 @@
<template>
  <div>
    <div>
      <div class="view-title">
        <span>方法验证</span>
        <span>
          <el-button size="medium" type="primary" @click="openFormDia('add')">新 å¢ž</el-button>
        </span>
      </div>
      <div class="search-background">
        <span class="search-group">
          <span style="width: 120px">标准方法:</span>
          <el-input size="small" v-model="searchForm.methodName" clearable></el-input>
        </span>
        <span class="search-group">
          <el-button size="medium"  @click="resetSearchForm">重 ç½®</el-button>
          <el-button size="medium" type="primary" @click="searchList">查 è¯¢</el-button>
        </span>
      </div>
      <div class="table">
        <div>
          <TableCard :showForm="false" :showTitle="false">
            <template v-slot:table>
              <ZTTable
                :column="tableColumn"
                :table-data="tableData"
                :table-loading="tableLoading"
                :height="'calc(100vh - 23em)'"
                style="padding: 0 15px;margin-bottom: 16px">
              </ZTTable>
            </template>
          </TableCard>
          <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
                         :total="total" layout="->,total, sizes, prev, pager, next, jumper"
                         @size-change="handleSizeChange"
                         @current-change="handleCurrentChange">
          </el-pagination>
        </div>
      </div>
    </div>
    <formDIa ref="formDIa" v-if="formDIa" :operationType="operationType" @closeDia="closeDia"></formDIa>
  </div>
</template>
<script>
import ZTTable from '../caorui/ZTTable/index.vue';
import TableCard from '../caorui/TableCard/index.vue';
import formDIa from '../do/a7-method-verification/formDIa.vue';
export default {
  name: 'a7-method-verification',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { TableCard, ZTTable, formDIa },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        methodName: '',
        operationType: 1,
      },
      options: [
        { label: '上半年', value: '1' },
        { label: '下半年', value: '2' },
      ],
      tableColumn: [
        {
          label: '标准方法',
          prop: 'methodName',
          minWidth: '100'
        },
        {
          label: '验证原因',
          prop: 'verifyReason',
          minWidth: '100'
        },
        {
          label: '主要技术变化',
          prop: 'technologyChange',
          minWidth: '100'
        },
        {
          dataType: 'action',
          minWidth: '60',
          label: '操作',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openFormDia('edit', row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.deleteRow(row);
              },
            }
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 20,
        current: 1,
      },
      total: 0,
      formDIa: false,
      operationType: '',
    };
  },
  mounted() {
    this.searchList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表
    searchList() {
      const entity = {
        methodName: this.searchForm.methodName,
        operationType: this.searchForm.operationType,
      }
      const page = this.page
      this.tableLoading = true
      this.$axios.post(this.$api.processMethodVerify.pagesMethodVerify, { entity, page }, {
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true
      }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data.records
        this.total = res.data.total
      }).catch(err => {
        console.log('err---', err);
        this.tableLoading = false
      })
    },
    // åˆ é™¤
    deleteRow (row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.tableLoading = true
        this.$axios.get(this.$api.processMethodVerify.delMethodVerify + '?methodVerifyId=' + row.methodVerifyId).then(res => {
          this.tableLoading = false
          if (res.code === 201) return
          this.$message.success('删除成功')
          this.searchList()
        }).catch(err => {
          this.tableLoading = false
          console.log('err---', err);
        })
      })
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm() {
      this.searchForm.methodName = '';
      this.searchList()
    },
    openFormDia (type, row) {
      this.formDIa = true
      this.operationType = type
      this.$nextTick(() => {
        this.$refs.formDIa.openDia(row)
      })
    },
    // å…³é—­å¼¹æ¡†
    closeDia () {
      this.formDIa = false
      this.searchList()
    },
    // åˆ†é¡µ
    handleSizeChange(val) {
      this.page.size = val;
      this.searchList();
    },
    handleCurrentChange(val) {
      this.page.current = val;
      this.searchList();
    },
  }
};
</script>
<style scoped>
.view-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding-left: 20px;
}
.search-background {
  width: 100%;
  height: 80px;
  line-height: 80px;
  background-color: #ffffff;
  display: flex;
}
.search-group {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.table {
  margin-top: 20px;
  background-color: #ffffff;
  padding-top: 20px;
}
</style>