zhaowei
2 天以前 19aff1ac87030b21d2b01cdca5d5604c840ba7c0
src/views/eam/base/EamMaintenanceStandardList.vue
@@ -44,29 +44,31 @@
      <!-- 操作按钮区域 -->
      <div class="table-operator">
        <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
        <a-button v-has="'standard:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader"
                  :action="inspectionImportExcel"
                  @change="handleImportExcel">
          <a-button type="primary" icon="import">点检标准导入</a-button>
          <a-button v-has="'standard:pointInspection'" type="primary" icon="import">点检标准导入</a-button>
        </a-upload>
        <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)">
        <a-button v-has="'standard:pointInspectionDownload'" type="primary" icon="download"
                  @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)">
          点检标准模板下载
        </a-button>
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader"
                  :action="secondMaintenanceImportExcel"
                  @change="handleImportExcel">
          <a-button type="primary" icon="import">二保标准导入</a-button>
          <a-button v-has="'standard:secondMaintenance'" type="primary" icon="import">二保标准导入</a-button>
        </a-upload>
        <a-button type="primary" icon="download"
        <a-button v-has="'standard:secondMaintenanceDownload'" type="primary" icon="download"
                  @click="handleTemplateXlsDownload(url.secondMaintenanceXlsDownloadUrl)">二保标准模板下载
        </a-button>
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader"
                  :action="thirdMaintenanceImportExcel"
                  @change="handleImportExcel">
          <a-button type="primary" icon="import">三保标准导入</a-button>
          <a-button v-has="'standard:ThirdMaintenance'" type="primary" icon="import">三保标准导入</a-button>
        </a-upload>
        <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)">
        <a-button v-has="'standard:ThirdMaintenanceDownload'" type="primary" icon="download"
                  @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)">
          三保标准模板下载
        </a-button>
        <a-dropdown v-if="selectedRowKeys.length > 0">
@@ -90,51 +92,74 @@
        <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"
        class="j-table-force-nowrap"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        :customRow='clickThenSelect'
        @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}" :customRow='clickThenSelect'
               @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a v-if="record.standardStatus === 'WAIT_SUBMIT'" @click.stop="handleEdit(record)">编辑</a>
          <template v-if="record.standardStatus === 'START'">
             <a-divider type="vertical"/>
             <a @click.stop="handleUpgrade(record)">升版</a>
          </template>
          <a v-has="'standard:upgrade'" v-if="record.standardStatus === 'START'"
             @click.stop="handleUpgrade(record)">升版</a>
          <template v-if="record.standardStatus === 'WAIT_SUBMIT'">
             <a-divider type="vertical"/>
              <a v-has="'standard:edit'" @click.stop="handleEdit(record)">编辑</a>
              <a-divider v-has="'standard:edit'" type="vertical"/>
              <a-popconfirm title="确定提交吗?" @confirm="() => startProcess(record.id)">
                  <a v-has="'standard:saveFlow'" @click.stop="event=>event.stopPropagation()">提交</a>
              </a-popconfirm>
              <a-divider v-has="'standard:saveFlow'" type="vertical"/>
              <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a @click="event=>event.stopPropagation()">删除</a>
                  <a v-has="'standard:del'" @click.stop="event=>event.stopPropagation()">删除</a>
              </a-popconfirm>
          </template>
          <template v-if="record.standardStatus != 'WAIT_SUBMIT'">
            <a-divider v-has="'standard:delete'" type="vertical" v-if="record.standardStatus=='START'"/>
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a v-has="'standard:delete'" @click.stop="event=>event.stopPropagation()">删除</a>
          </a-popconfirm>
          </template>
        </span>
      </a-table>
      <a-tabs defaultActiveKey="1">
        <a-tab-pane tab='保养标准明细项' key="1">
          <div class="table-operator" style="margin:-16px">
            <eam-maintenance-standard-detail-list ref="standardDetailRef" :standardId="standardId"/>
          </div>
        </a-tab-pane>
      <a-tabs defaultActiveKey="1" v-if="selectionRows.length===1">
        <template v-if="selectionRows[0]&&selectionRows[0].maintenanceCategory=='POINT_INSPECTION'">
          <a-tab-pane tab="日点检" key="1">
            <eam-maintenance-standard-detail-list :standardId="standardId" :pageSelectionRow="selectionRows[0]"
                                                  filterKey="DAY_INSPECTION"/>
          </a-tab-pane>
          <a-tab-pane tab="周点检" key="2" forceRender>
            <eam-maintenance-standard-detail-list :standardId="standardId" :pageSelectionRow="selectionRows[0]"
                                                  filterKey="WEEK_INSPECTION"/>
          </a-tab-pane>
        </template>
        <template v-if="selectionRows[0]&&selectionRows[0].maintenanceCategory=='SECOND_MAINTENANCE'">
          <a-tab-pane tab="操作工" key="1">
            <eam-maintenance-standard-detail-list :standardId="standardId" :pageSelectionRow="selectionRows[0]"
                                                  filterKey="OPERATOR_MAINTENANCE"/>
          </a-tab-pane>
          <a-tab-pane tab="维修工" key="2" forceRender>
            <eam-maintenance-standard-detail-list :standardId="standardId" :pageSelectionRow="selectionRows[0]"
                                                  filterKey="REPAIRER_MAINTENANCE"/>
          </a-tab-pane>
        </template>
        <a-tab-pane tab="三保" key="1" v-if="selectionRows[0]&&selectionRows[0].maintenanceCategory=='THIRD_MAINTENANCE'">
          <eam-maintenance-standard-detail-list :standardId="standardId"
                                                :pageSelectionRow="selectionRows[0]"/>
        </a-tab-pane>
      </a-tabs>
    </div>
    <!-- table区域-end -->
    <!-- 表单区域 -->
    <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"></eamMaintenanceStandard-modal>
    <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"/>
  </a-card>
</template>
@@ -143,7 +168,7 @@
  import EamMaintenanceStandardModal from './modules/EamMaintenanceStandardModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import EamMaintenanceStandardDetailList from '@views/eam/base/modules/EamMaintenanceStandardDetailList'
  import { deleteAction, templateXlsDownload } from '@api/manage'
  import { deleteAction, getAction, templateXlsDownload } from '@api/manage'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
@@ -233,16 +258,14 @@
          list: '/eam/maintenanceStandard/list',
          delete: '/eam/maintenanceStandard/delete',
          deleteBatch: '/eam/maintenanceStandard/deleteBatch',
          startProcess: '/eam/maintenanceStandard/saveEamMaintenanceStandardProcess',
          exportXlsUrl: 'eam/maintenanceStandard/exportXls',
          inspectionImportExcel: 'eam/maintenanceStandard/inspectionImportExcel',
          weekMaintenanceImportExcel: 'eam/maintenanceStandard/weekMaintenanceImportExcel',
          secondMaintenanceImportExcel: 'eam/maintenanceStandard/secondMaintenanceImportExcel',
          thirdMaintenanceImportExcel: 'eam/maintenanceStandard/thirdMaintenanceImportExcel',
          inspectionXlsDownloadUrl: '导入模板/点检标准导入模板_v1.0.xlsx',
          weekMaintenanceXlsDownloadUrl: '导入模板/周保标准导入模板_v1.0.xlsx',
          secondMaintenanceXlsDownloadUrl: '导入模板/二保标准导入模板_v1.0.xlsx',
          thirdMaintenanceXlsDownloadUrl: '导入模板/三保标准导入模板_v1.0.xlsx',
          abolish: '/eam/maintenanceStandard/abolish'
          inspectionImportExcel: '/eam/maintenanceStandard/importPointInspection',
          secondMaintenanceImportExcel: '/eam/maintenanceStandard/importSecondMaintenanceStandard',
          thirdMaintenanceImportExcel: '/eam/maintenanceStandard/importThirdMaintenanceStandard',
          inspectionXlsDownloadUrl: '导入模板/设备点检标准导入模板.xlsx',
          secondMaintenanceXlsDownloadUrl: '导入模板/生产设备二级保养规范.docx',
          thirdMaintenanceXlsDownloadUrl: '导入模板/生产设备三级保养规范.docx'
        },
        standardId: '-1'
      }
@@ -250,9 +273,6 @@
    computed: {
      inspectionImportExcel: function() {
        return `${window._CONFIG['domianURL']}/${this.url.inspectionImportExcel}`
      },
      weekMaintenanceImportExcel: function() {
        return `${window._CONFIG['domianURL']}/${this.url.weekMaintenanceImportExcel}`
      },
      secondMaintenanceImportExcel: function() {
        return `${window._CONFIG['domianURL']}/${this.url.secondMaintenanceImportExcel}`
@@ -269,7 +289,9 @@
        title: '操作',
        dataIndex: 'action',
        align: 'center',
        scopedSlots: { customRender: 'action' }
        scopedSlots: { customRender: 'action' },
        width: 200,
        fixed: 'right'
      }
      this.columns = [...this.columns, operationColumn]
      this.loadData(1)
@@ -308,6 +330,33 @@
        templateXlsDownload(url)
      },
      /**
       * 点击发起流程触发
       * @param id 列表行记录ID
       */
      startProcess(id) {
        this.loading = true
        const that = this
        getAction(this.url.startProcess, { id })
          .then(res => {
            if (res.success) {
              that.$notification.success({
                message: '消息',
                description: res.message
              })
              that.loadData()
            } else {
              that.$notification.warning({
                message: '消息',
                description: res.message
              })
            }
          })
          .finally(() => {
            that.loading = false
          })
      },
      handleUpgrade(record) {
        //升版
        this.$refs.modalForm.upgrade(record)
@@ -315,6 +364,40 @@
        this.$refs.modalForm.disableSubmit = false
      },
      batchDel() {
        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.deleteBatch, { 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
              })
          }
        })
      },
      searchReset() {
        this.standardId = '-1'
        this.queryParam = {}