zenglf
2023-10-24 575a75a0519e53ceec6bb5d31f682124596c3bae
src/views/mdc/base/modules/mdcPassRate/mdcPassRateList.vue
@@ -1,5 +1,5 @@
<template>
  <a-card :bordered="false" class="device_list">
  <div :bordered="false" class="device_list">
    <!-- 查询区域 -->
    <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -35,6 +35,7 @@
    <div class="table-operator" style="display: inline;">
      <a-button @click="handleAdd" type="primary" icon="plus">新增
      </a-button>
      <a-button type="primary" icon="download" @click="importTemplate('合格率模板')">导入模板</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('合格率管理')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
      <a-button type="primary" icon="import">导入</a-button>
@@ -84,7 +85,7 @@
    <!--<device-repair-model></device-repair-model>-->
    <mdc-pass-rate-modal  ref="modalForm" @ok="modalFormOk"></mdc-pass-rate-modal>
    <mdc-pass-rate-edit  ref="modalFormedit" @ok="modalFormOk"></mdc-pass-rate-edit>
  </a-card>
  </div>
</template>
<script>
@@ -195,8 +196,8 @@
          delete: '/mdc/mdcPassRate/delete',
          deleteBatch: '/mdc/mdcPassRate/deleteBatch',
          getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid',
          exportXlsUrl: "/mdc/mdcStandardProcessDuration/exportXls",
          importExcelUrl: "/mdc/mdcStandardProcessDuration/importExcel",
          exportXlsUrl: "/mdc/mdcPassRate/exportXls",
          importExcelUrl: "/mdc/mdcPassRate/importExcel",
        }
      }
    },
@@ -239,6 +240,15 @@
      },
    },
    methods: {
      importTemplate(fileName){
        var a = document.createElement("a");
        a.href = "/static/合格率管理.xls";
        a.download = "合格率管理.xls";
        a.style.display = "none";
        document.body.appendChild(a);
        a.click();
        a.remove();
      },
      dateParamChange(v1, v2) {
        // console.log(v1,v2)
        this.queryParam.startTime = v2[0]
@@ -318,7 +328,11 @@
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() => {
          this.loading = false
@@ -363,7 +377,11 @@
              this.ipagination.total = 0;
            }
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() => {
          this.loading = false
@@ -401,7 +419,11 @@
              this.ipagination.total = 0;
            }
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() => {
          this.loading = false
@@ -443,7 +465,11 @@
              this.ipagination.total = 0;
            }
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() => {
          this.loading = false
@@ -477,7 +503,11 @@
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() => {
          this.loading = false
@@ -499,10 +529,18 @@
          if (res.success) {
            //重新计算分页问题
            that.reCalculatePage(1)
            that.$message.success(res.message);
            // that.$message.success(res.message);
            that.$notification.success({
              message:'消息',
              description:res.message
            });
            that.searchQuery();
          } else {
            that.$message.warning(res.message);
            // that.$message.warning(res.message);
            that.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        });
      },
@@ -512,7 +550,11 @@
          return
        }
        if (this.selectedRowKeys.length <= 0) {
          this.$message.warning('请选择一条记录!');
          // this.$message.warning('请选择一条记录!');
          this.$notification.warning({
            message:'消息',
            description:"请选择一条记录"
          });
          return;
        } else {
          var ids = "";
@@ -529,11 +571,19 @@
                if (res.success) {
                  //重新计算分页问题
                  that.reCalculatePage(that.selectedRowKeys.length)
                  that.$message.success(res.message);
                  // that.$message.success(res.message);
                  that.$notification.success({
                    message:'消息',
                    description:res.message
                  });
                  that.loadData();
                  that.onClearSelected();
                } else {
                  that.$message.warning(res.message);
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message:'消息',
                    description:res.message
                  });
                }
              }).finally(() => {
                that.loading = false;
@@ -572,7 +622,11 @@
              _this.equipment = res.result
              _this.searchQuery()
            } else {
              _this.$message.warning('请配置设备!')
              // _this.$message.warning('请配置设备!')
              _this.$notification.warning({
                message:'消息',
                description:'请联系管理员,开放设备权限!'
              });
            }
          }
        })
@@ -591,7 +645,7 @@
        param.equipmentId = this.queryParams.equipmentId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        console.log("导出参数",param)
        // console.log("导出参数",param)
        downFile(this.url.exportXlsUrl,param).then((data)=>{
          if (!data) {
            this.$message.warning("文件下载失败")