1、产品质量隐患确认表批量打印及导出功能
2、调整点检和二保批量打印功能代码
已添加1个文件
已修改5个文件
536 ■■■■■ 文件已修改
src/views/eam/maintenance/EamInspectionOrderList.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamInspectionOrderBatchPrintModal.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamSecondMaintenanceOrderBatchPrintModal.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/EamReportProductHazardsList.vue 140 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamProductHazardsBatchPrintModal.vue 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/EamInspectionOrderList.vue
@@ -60,14 +60,15 @@
      <!--</a-button>-->
      <!--</a-dropdown>-->
      <a-button type="primary" icon="delete" @click="batchZf('ABOLISH')" v-has="'eam:inspection:abolish'"
                :disabled="selectedRowKeys.length===0">批量作废
      </a-button>
      <a-button type="primary" icon="form" @click="batchLq('UNDER_INSPECTION')" v-has="'eam:inspection:collect'"
                :disabled="selectedRowKeys.length===0">批量领取
      </a-button>
      <a-button type="primary" icon="monitor" @click="handleBatchPrint" :disabled="selectedRowKeys.length===0">批量预览
      </a-button>
      <a-button type="danger" icon="delete" @click="batchZf('ABOLISH')" v-has="'eam:inspection:abolish'"
                :disabled="selectedRowKeys.length===0">批量作废
      </a-button>
    </div>
    <!-- table区域-begin -->
src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue
@@ -41,21 +41,20 @@
      <a-button v-has="'secondMaintenanceOrder:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button v-has="'secondMaintenanceOrder:batchAdd'" @click="handleBatchAdd" type="primary" icon="plus">批量新增
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchAbolish'" @click="handlerBatchAbolish" type="primary"
                icon="delete" :disabled="selectedRowKeys.length===0">
        æ‰¹é‡ä½œåºŸ
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchCollect'" @click="handlerBatchCollect" type="primary" icon="form"
                :disabled="selectedRowKeys.length===0">
        æ‰¹é‡é¢†å–
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchRestore'" @click="handlerBatchRestore" type="primary"
                :disabled="selectedRowKeys.length===0"
                icon="reload">
        æ‰¹é‡è¿˜åŽŸ
      <a-button @click="handleBatchPrint" type="primary" icon="monitor" :disabled="selectedRowKeys.length===0">批量预览
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchAdd'" @click="handleBatchPrint" type="primary" icon="monitor"
                :disabled="selectedRowKeys.length===0">批量预览
      <a-button v-has="'secondMaintenanceOrder:batchAbolish'" @click="handlerBatchAbolish" type="danger"
                icon="delete" :disabled="selectedRowKeys.length===0">
        æ‰¹é‡ä½œåºŸ
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchRestore'" @click="handlerBatchRestore"
                :disabled="selectedRowKeys.length===0" icon="reload">
        æ‰¹é‡è¿˜åŽŸ
      </a-button>
      <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
@@ -446,102 +445,68 @@
      //批量还原
      handlerBatchRestore() {
        if (!this.url.restoreBatch) {
          this.$message.error('请设置url.restoreBatch属性!')
          return
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ','
        }
        if (this.selectedRowKeys.length <= 0) {
          // this.$message.warning('请选择一条记录!');
          this.$notification.warning({
            message: '消息',
            description: '请选择一条记录'
          })
          return
        } else {
          var ids = ''
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ','
        var that = this
        this.$confirm({
          title: '确认还原',
          content: '是否还原选中数据,只有作废状态的数据才可还原成功?',
          onOk: function() {
            that.loading = true
            deleteAction(that.url.restoreBatch, { ids: ids }).then((res) => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.loadData()
                that.onClearSelected()
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.loading = false
            })
          }
          var that = this
          this.$confirm({
            title: '确认还原',
            content: '是否还原选中数据,只有作废状态的数据才可还原成功?',
            onOk: function() {
              that.loading = true
              deleteAction(that.url.restoreBatch, { ids: ids }).then((res) => {
                if (res.success) {
                  //重新计算分页问题
                  that.reCalculatePage(that.selectedRowKeys.length)
                  // that.$message.success(res.message);
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.loadData()
                  that.onClearSelected()
                } else {
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              }).finally(() => {
                that.loading = false
              })
            }
          })
        }
        })
      },
      //批量领取
      handlerBatchCollect() {
        if (!this.url.collectBatch) {
          this.$message.error('请设置url.abolishBatch属性!')
          return
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ','
        }
        if (this.selectedRowKeys.length <= 0) {
          // this.$message.warning('请选择一条记录!');
          this.$notification.warning({
            message: '消息',
            description: '请选择一条记录'
          })
          return
        } else {
          var ids = ''
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ','
        var that = this
        this.$confirm({
          title: '确认领取',
          content: '是否领取选中数据,只有待保养状态的数据才可领取成功?',
          onOk: function() {
            that.loading = true
            deleteAction(that.url.collectBatch, { ids: ids }).then((res) => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.loadData()
                that.onClearSelected()
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.loading = false
            })
          }
          var that = this
          this.$confirm({
            title: '确认领取',
            content: '是否领取选中数据,只有待保养状态的数据才可领取成功?',
            onOk: function() {
              that.loading = true
              deleteAction(that.url.collectBatch, { ids: ids }).then((res) => {
                if (res.success) {
                  //重新计算分页问题
                  that.reCalculatePage(that.selectedRowKeys.length)
                  // that.$message.success(res.message);
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.loadData()
                  that.onClearSelected()
                } else {
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              }).finally(() => {
                that.loading = false
              })
            }
          })
        }
        })
      },
      // æ‰¹é‡æ‰“印
src/views/eam/maintenance/modules/EamInspectionOrderBatchPrintModal.vue
@@ -111,7 +111,7 @@
    <template slot="footer">
      <a-button @click="handleCancel">关闭</a-button>
      <a-button type="primary" @click="handleImport">导出</a-button>
      <a-button type="primary" @click="handleExportToExcel">导出</a-button>
      <a-button type="primary" v-print="'#dataTable'">打印</a-button>
    </template>
  </j-modal>
@@ -153,7 +153,8 @@
          })
      },
      handleImport() {
      // å¯¼å‡ºåˆ°Excel
      handleExportToExcel() {
        document.querySelectorAll('table.import-table').forEach(element => {
          console.log('element', element.id)
          $(element).table2excel({
src/views/eam/maintenance/modules/EamSecondMaintenanceOrderBatchPrintModal.vue
@@ -98,7 +98,7 @@
    <template slot="footer">
      <a-button @click="handleCancel">关闭</a-button>
      <a-button type="primary" @click="handleImport">导出</a-button>
      <a-button type="primary" @click="handleExportToExcel">导出</a-button>
      <a-button type="primary" v-print="'#dataTable'">打印</a-button>
    </template>
  </j-modal>
@@ -140,7 +140,8 @@
          })
      },
      handleImport() {
      // å¯¼å‡ºåˆ°Excel
      handleExportToExcel() {
        document.querySelectorAll('table.import-table').forEach(element => {
          console.log('element', element.id)
          $(element).table2excel({
src/views/eam/repair/EamReportProductHazardsList.vue
@@ -35,38 +35,22 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
<!--      <a-button @click="handleAdd" type="primary" icon="plus">新增</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>-->
<!--      </a-upload>-->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> æ‰¹é‡æ“ä½œ <a-icon type="down" /></a-button>
      </a-dropdown>
      <a-button @click="handleBatchPrint" type="primary" icon="monitor" :disabled="selectedRowKeys.length===0">批量预览
      </a-button>
      <a-button icon="delete" type="danger" @click="batchDel" :disabled="selectedRowKeys.length===0">批量删除</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{
        selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :scroll="{x:'max-content'}"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
               :pagination="ipagination" :loading="loading" :scroll="{x:'max-content'}"
               :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange">
      <span slot="action" slot-scope="text, record">
          <template v-if="record.confirmStatus==='PENDING_SUBMIT'">
@@ -94,7 +78,10 @@
    <!--审批窗口-->
    <report-product-hazards-approval-modal ref="reportProductHazardsApprovalModal"
                                              :selectShenpiData="selectedRowData"/>
                                           :selectShenpiData="selectedRowData"/>
    <!--批量打印弹窗-->
    <eam-product-hazards-batch-print-modal ref="batchPrintModal"/>
  </a-card>
</template>
@@ -102,15 +89,17 @@
  import '@/assets/less/TableExpand.less'
  import EamReportProductHazardsModal from './modules/EamReportProductHazardsModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import {getAction} from "@api/manage";
  import { getAction } from '@api/manage'
  import ReportProductHazardsApprovalModal
    from "@views/flowable/workflow/repairOrder/ReportProductHazardsApprovalModal.vue";
  import LxSearchEquipmentSelect from "@views/eam/equipment/modules/LxSearchEquipmentSelect.vue";
    from '@views/flowable/workflow/repairOrder/ReportProductHazardsApprovalModal.vue'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  import EamProductHazardsBatchPrintModal from './modules/EamProductHazardsBatchPrintModal'
  export default {
    name: "EamReportProductHazardsList",
    mixins:[JeecgListMixin],
    name: 'EamReportProductHazardsList',
    mixins: [JeecgListMixin],
    components: {
      EamProductHazardsBatchPrintModal,
      LxSearchEquipmentSelect,
      ReportProductHazardsApprovalModal,
      EamReportProductHazardsModal
@@ -124,7 +113,7 @@
        type: Object
      }
    },
    data () {
    data() {
      return {
        description: '产品安全隐患确认管理页面',
        disableMixinCreated: true,
@@ -181,74 +170,74 @@
            align: 'center',
            dataIndex: 'quantity'
          },
               {
          {
            title: '操作工',
            align:"center",
            align: 'center',
            dataIndex: 'confirmer_dictText'
           },
               {
          },
          {
            title: '操作工确认时间',
            align:"center",
            align: 'center',
            dataIndex: 'confirmTime'
           },
               {
          },
          {
            title: '产品损失情况',
            align:"center",
            align: 'center',
            dataIndex: 'productLoss_dictText'
           },
               {
          },
          {
            title: '产品损失质量影响分析',
            align:"center",
            align: 'center',
            dataIndex: 'qualityAnalysis',
            scopedSlots: { customRender: 'qualityAnalysis' }
           },
               {
          },
          {
            title: '主管工艺',
            align:"center",
            align: 'center',
            dataIndex: 'technologist_dictText'
           },
               {
          },
          {
            title: '主管工艺确认时间',
            align:"center",
            align: 'center',
            dataIndex: 'technologistTime'
           },
               {
          },
          {
            title: '主管工艺确认意见',
            align:"center",
            align: 'center',
            dataIndex: 'technologistComment'
           },
               {
          },
          {
            title: '部级领导',
            align:"center",
            align: 'center',
            dataIndex: 'deputyDepartment_dictText'
           },
               {
          },
          {
            title: '部级领导确认时间',
            align:"center",
            align: 'center',
            dataIndex: 'deputyDepartmentTime'
           },
               {
          },
          {
            title: '部级领导确认意见',
            align:"center",
            align: 'center',
            dataIndex: 'deputyDepartmentComment'
           },
           {
          },
          {
            title: 'HF编码',
            align: 'center',
            dataIndex: 'hfCode'
           },
          }
        ],
        selectedRowData: {},
            url: {
          list: "/eam/eamReportProductHazards/list",
          delete: "/eam/eamReportProductHazards/delete",
          deleteBatch: "/eam/eamReportProductHazards/deleteBatch",
          exportXlsUrl: "eam/eamReportProductHazards/exportXls",
          importExcelUrl: "eam/eamReportProductHazards/importExcel",
          submit:"/eam/eamReportProductHazards/submit",
       },
    }
  },
        url: {
          list: '/eam/eamReportProductHazards/list',
          delete: '/eam/eamReportProductHazards/delete',
          deleteBatch: '/eam/eamReportProductHazards/deleteBatch',
          exportXlsUrl: 'eam/eamReportProductHazards/exportXls',
          importExcelUrl: 'eam/eamReportProductHazards/importExcel',
          submit: '/eam/eamReportProductHazards/submit'
        }
      }
    },
    created() {
      if (!this.isDisplayOperation) this.queryParam = Object.assign({}, this.propsQueryParam)
      else {
@@ -289,6 +278,11 @@
          })
      },
      // æ‰¹é‡æ‰“印
      handleBatchPrint() {
        this.$refs.batchPrintModal.handlePreview(this.selectedRowKeys.join())
      },
      /**
       * ç‚¹å‡»è¯¦æƒ…时触发时触发
       * @param record
src/views/eam/repair/modules/EamProductHazardsBatchPrintModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,218 @@
<template>
  <j-modal title="预览(仅可预览已完成工单)" :width="948" :visible="visible" switchFullscreen centered
           :mask-closable="false" @cancel="handleCancel" cancelText="关闭">
    <a-spin :spinning="spinning" style="height: 100%">
      <div id="dataTable">
        <div v-for="dataItem in dataSource" class="table-container">
          <div style="page-break-before:always"></div>
          <table class="import-table" :id="dataItem.equipmentCode">
            <thead>
            <tr>
              <td colspan="12" style="border: none">
                <div style="text-align: right">{{dataItem.hfCode}}</div>
              </td>
            </tr>
            </thead>
            <tbody>
            <tr style="height: 48px;">
              <th colspan="12" style="border: none;font-size: 20px">产品质量隐患确认表</th>
            </tr>
            <tr>
              <td colspan="6" style="border: none;padding-left: 20px">
                <div style="text-align: left">使用单位:{{dataItem.factoryName}}</div>
              </td>
              <td colspan="6" style="border: none;padding-right: 20px">
                <div style="text-align: right">
                  {{dataItem.confirmTime.split('-')[0]}} å¹´ {{dataItem.confirmTime.split('-')[1]}} æœˆ
                  {{dataItem.confirmTime.split('-')[2]}} æ—¥
                </div>
              </td>
            </tr>
            <tr>
              <td colspan="2">设备名称</td>
              <td colspan="2">{{dataItem.equipmentName}}</td>
              <td colspan="2">设备型号</td>
              <td colspan="2">{{dataItem.equipmentModel}}</td>
              <td colspan="2">统一编号</td>
              <td colspan="2">{{dataItem.equipmentCode}}</td>
            </tr>
            <tr>
              <td colspan="2">加工零件号</td>
              <td colspan="2">{{dataItem.processingPart}}</td>
              <td colspan="2">批次号</td>
              <td colspan="2">{{dataItem.batchNumber}}</td>
              <td colspan="2">件数</td>
              <td colspan="2">{{dataItem.quantity}}</td>
            </tr>
            <tr>
              <td colspan="2" style="text-align: left;padding: 5px">设备故障现象描述</td>
              <td colspan="10" style="text-align: left;padding: 5px">
                <div style="text-align: left" v-html="dataItem.faultDescription.replace(/\n/g,'<br/>')"></div>
                <br/><br/>
                <div style="text-align: right;padding-right: 20px">操作人员签字:{{dataItem.confirmer_dictText}}</div>
              </td>
            </tr>
            <tr>
              <td colspan="2" style="text-align: left;padding: 5px">设备故障对产品质量影响分析</td>
              <td colspan="10" style="padding: 5px">
                <div style="text-align: left">产品损失情况:{{+dataItem.technologistResult===1?'是(√)否()':'是()否(√)'}}</div>
                <div style="text-align: left">产品损失质量影响分析:</div>
                <div style="text-align: left" v-html="dataItem.qualityAnalysis.replace(/\n/g,'<br/>')"></div>
                <br/><br/>
                <div style="text-align: right;padding-right: 20px">主管工艺签字:{{dataItem.technologist_dictText}}</div>
              </td>
            </tr>
            <tr>
              <td colspan="12" style="padding: 5px">
                <div style="text-align:left;">{{dataItem.deputyDepartmentComment}}</div>
                <br/><br/>
                <div style="text-align: right;padding-right: 20px">签字(副部级以上领导):{{dataItem.deputyDepartment_dictText}}
                </div>
                <br/>
                <div style="text-align: right;padding-right: 20px">
                  {{dataItem.deputyDepartmentTime.split('-')[0]}} å¹´ {{dataItem.deputyDepartmentTime.split('-')[1]}} æœˆ
                  {{dataItem.deputyDepartmentTime.split('-')[2]}} æ—¥
                </div>
              </td>
            </tr>
            </tbody>
          </table>
        </div>
      </div>
    </a-spin>
    <template slot="footer">
      <a-button @click="handleCancel">关闭</a-button>
      <a-button type="primary" @click="handleImport">导出</a-button>
      <a-button type="primary" v-print="'#dataTable'">打印</a-button>
    </template>
  </j-modal>
</template>
<script>
  import { getAction } from '@/api/manage'
  import $ from 'jquery'
  import '@/components/table2excel/table2excel'
  export default {
    name: 'EamProductHazardsBatchPrintModal',
    data() {
      return {
        visible: false,
        spinning: false,
        dataSource: [
          {
            hfCode: 'HF-16548ASDSADA',
            equipmentName: '手打十点多',
            equipmentModel: '6500P',
            equipmentCode: '2125400',
            factoryName: '燃机厂',
            maintenanceDateFormatted: '2025å¹´5月20日'
          }
        ],
        url: {
          list: '/eam/eamReportProductHazards/batchExport'
        }
      }
    },
    methods: {
      /**
       * æ‰¹é‡é¢„览
       * @param ids String ä¸»é¡µé¢åˆ—表勾选ids
       */
      handlePreview(ids) {
        this.visible = true
        this.spinning = true
        this.dataSource = []
        const that = this
        getAction(this.url.list, { ids })
          .then(res => {
            if (res.success) that.dataSource = res.result
          })
          .finally(() => {
            that.spinning = false
          })
      },
      // å¯¼å‡ºåˆ°Excel
      handleImport() {
        document.querySelectorAll('table.import-table').forEach(item => {
          $(item).table2excel({
            exclude: '.noExl',
            name: 'Excel Document Name',
            filename: '产品质量隐患确认表-' + item.id,
            exclude_img: true,
            fileext: '.xls',
            exclude_links: true,
            exclude_inputs: false
          })
        })
      },
      handleCancel() {
        this.close()
      },
      close() {
        this.$emit('close')
        this.visible = false
        if (this.$refs.form) this.$refs.form.clearValidate()
      }
    }
  }
</script>
<style scoped lang="less">
  /deep/ .ant-modal {
    height: 90%;
    overflow: hidden;
    .ant-modal-content {
      height: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
      }
      .ant-modal-body {
        flex: 1;
        overflow: auto;
      }
    }
  }
  .table-container:not(:last-child) {
    margin-bottom: 20px;
  }
  table {
    width: 100%;
    text-align: center;
    table-layout: fixed;
    td, th {
      border: 1px solid #000;
    }
    td.vertical-display {
      transform: rotate(360deg);
      writing-mode: vertical-lr;
      letter-spacing: 5px;
      padding: 10px 0;
    }
  }
</style>