licp
2024-12-20 1be3383c74a57bdbdbad8f19a888cb212cbb7027
完成不符合项迁移
已修改1个文件
已添加1个文件
220 ■■■■■ 文件已修改
src/components/do/a7-nonconforming-item/qualityInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/a7-nonconforming-item.vue 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a7-nonconforming-item/qualityInfo.vue
@@ -4,7 +4,7 @@
               :visible.sync="formDia"
               title="不符合工作控制单"
               width="80%" @close="closeProcessingDia">
      <div style="height: 660px; overflow-y: auto">
      <div style="height: 85vh; overflow-y: auto">
        <table border="1" cellspacing="10" class="tables">
          <tr>
            <td class="first-title" rowspan="8">
src/components/view/a7-nonconforming-item.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,218 @@
<template>
  <div>
    <div>
      <div class="view-title">
        <span>不符合项</span>
      </div>
      <div class="search-background">
        <span class="search-group">
          <span style="width: 120px">发生部门:</span>
          <el-input v-model="searchForm.occurrenceDepartment" clearable size="small"></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"
                :height="'calc(100vh - 23em)'"
                :table-data="tableData"
                :table-loading="tableLoading"
                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>
    <quality-info v-if="qualityInfo" ref="qualityInfo"></quality-info>
  </div>
</template>
<script>
import ZTTable from '../caorui/ZTTable/index.vue';
import TableCard from '../caorui/TableCard/index.vue';
import QualityInfo from '../do/a7-nonconforming-item/qualityInfo.vue';
export default {
  name: 'a7-nonconforming-item',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { QualityInfo, TableCard, ZTTable },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        occurrenceDepartment: '',
      },
      tableColumn: [
        {
          label: '发生部门',
          prop: 'occurrenceDepartment',
          minWidth: '100'
        },
        {
          label: '部门负责人',
          prop: 'headDepartment',
          minWidth: '100'
        },
        {
          label: '发现途径',
          prop: 'findWay',
          minWidth: '100'
        },
        {
          label: '详细记录',
          prop: 'recordDetail',
          minWidth: '100'
        },
        {
          label: '依据和条款号',
          prop: 'recordAccording',
          minWidth: '100'
        },
        {
          label: '发现部门',
          prop: 'foundDepartment',
          minWidth: '100'
        },
        {
          label: '被监督人',
          prop: 'supervisedUserName',
          minWidth: '100'
        },
        {
          dataType: 'action',
          minWidth: '60',
          label: '操作',
          operation: [
            {
              name: '查看',
              type: 'text',
              clickFun: (row) => {
                this.viewInfo(row);
              },
            },
            {
              name: '导出',
              type: 'text',
              clickFun: (row) => {
                this.openDownloadDia(row);
              },
            },
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 20,
        current: 1,
      },
      total: 0,
      qualityInfo: false,
    };
  },
  mounted() {
    this.searchList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表
    searchList() {
      const entity = {
        occurrenceDepartment: this.searchForm.occurrenceDepartment,
      }
      const page = this.page
      this.tableLoading = true
      this.$axios.post(this.$api.qualitySupervise.pageSuperviseDetailAccording, { 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
      })
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm() {
      this.searchForm.occurrenceDepartment = '';
      this.searchList()
    },
    viewInfo (row) {
      this.qualityInfo = true
      this.$nextTick(() => {
        this.$refs.qualityInfo.openDia(row)
      })
    },
    // å¯¼å‡º
    openDownloadDia (row) {
      this.$axios.get( this.$api.qualitySupervise.superviseDetailAccordingExport+ '?superviseDetailsId=' + row.superviseDetailsId,{responseType: "blob"}).then(res => {
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '不符合项导出' + '.docx';
        link.click();
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // åˆ†é¡µ
    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>