qushaowei
2024-01-02 745073a5e189bc8c37e1358f0e36dbd7e500a9d0
src/views/eam/DailyMaintenanceStandardList.vue
@@ -1,6 +1,6 @@
<template>
  <a-card
    title="日常保养标准"
    title="周期性保养标准"
    :bordered='false'
  >
    <div class='table-page-search-wrapper'>
@@ -89,7 +89,8 @@
        @click='handleAdd'
        type='primary'
        icon='plus'
      >新增</a-button>
        v-has="'dailyMaintenanceStandard:add'"
      >编制</a-button>
      <a-button
        type='primary'
        @click='searchQuery'
@@ -101,6 +102,19 @@
        icon='reload'
        style='margin-left: 8px'
      >重置</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>
    </div>
    <!-- table区域-begin -->
@@ -121,7 +135,7 @@
        size='middle'
        bordered
        rowKey='id'
        :scroll="{ x: 'calc(1400px + 50%)', y: 900 }"
        :scroll="{ x: 'calc(2300px + 50%)', y: 900 }"
        :columns='columns'
        :dataSource='dataSource'
        :pagination='ipagination'
@@ -158,26 +172,49 @@
          slot-scope="text, record"
        >
          <a
            v-if="record.versionStatus == '2'"
            @click="handleRevise(record)"
          >升版</a>
          <a
            v-if="record.versionStatus == '1'"
            @click="handleTakeEffect(record)"
          >生效</a>
            v-show="record.versionStatus == '1' && record.approvalStatus == '1' "
            @click="handleAuditApproval(record)"
            v-has="'dailyMaintenanceStandard:audit'"
          >审核</a>
          <a-divider type="vertical" />
          <a
            v-if="record.versionStatus == '1'"
            v-show="record.versionStatus == '1' && record.approvalStatus == '4'"
            @click="handleAuditApproval(record)"
            v-has="'dailyMaintenanceStandard:againAudit'"
          >重新审核</a>
          <a-divider type="vertical" />
          <a
            v-show="record.versionStatus == '1'&& record.approvalStatus == '3' "
            @click="handleAuditApproval(record)"
            v-has="'dailyMaintenanceStandard:approval'"
          >审批</a>
          <a-divider type="vertical" />
          <a
            v-show="record.versionStatus == '1' && (record.approvalStatus == '1' || record.approvalStatus == '2')"
            @click="handleEdit(record)"
            v-has="'dailyMaintenanceStandard:edit'"
          >编辑</a>
          <a-divider type="vertical" />
          <a-popconfirm
            v-if="record.versionStatus == '1'"
            v-show="record.versionStatus == '1' && (record.approvalStatus == '1' || record.approvalStatus == '2')"
            title="确定删除吗?"
            @confirm="() => handleDelete(record.id)"
            v-has="'dailyMaintenanceStandard:delete'"
          >
            <a>删除</a>
          </a-popconfirm>
          <a-divider type="vertical" />
          <a
            v-show="record.versionStatus != '1'"
            @click="handleRevise(record)"
            v-has="'dailyMaintenanceStandard:revise'"
          >升版</a>
          <a-divider type="vertical" />
          <a
            v-show="record.versionStatus == '2'"
            @click="handleTakeEffect(record)"
            v-has="'dailyMaintenanceStandard:loseEfficacy'"
          >失效</a>
        </span>
      </a-table>
@@ -196,7 +233,7 @@
            <daily-maintenance-standard-detail :maintenanceStandardId='maintenanceStandardId' />
          </div>
        </a-tab-pane>
        <a-tab-pane
        <!-- <a-tab-pane
          tab='计划用料'
          key="2"
        >
@@ -228,7 +265,7 @@
          >
            <maintenance-standard-work-instruction :maintenanceStandardId='maintenanceStandardId' />
          </div>
        </a-tab-pane>
        </a-tab-pane> -->
      </a-tabs>
    </div>
@@ -237,6 +274,11 @@
      ref='modalForm'
      @ok='modalFormOk'
    ></daily-maintenance-standard-modal>
    <audit-approval-modal
      ref='auditApprovalModal'
      @ok='modalFormOk'
    ></audit-approval-modal>
  </a-card>
</template>
@@ -250,6 +292,7 @@
import MaintenanceStandardSafetyRequirement from '@/views/eam/modules/dailyMaintenanceStandard/MaintenanceStandardSafetyRequirement'
import DailyMaintenanceStandardModal from './modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal'
import MaintenanceStandardWorkInstruction from '@/views/eam/modules/dailyMaintenanceStandard/MaintenanceStandardWorkInstruction'
import AuditApprovalModal from './modules/dailyMaintenanceStandard/AuditApprovalModal'
import '@/assets/less/TableExpand.less'
export default {
@@ -260,7 +303,8 @@
    DailyMaintenanceStandardModal,
    MaintenanceStandardPlanningMaterial,
    MaintenanceStandardSafetyRequirement,
    MaintenanceStandardWorkInstruction
    MaintenanceStandardWorkInstruction,
    AuditApprovalModal
  },
  data() {
    return {
@@ -276,23 +320,22 @@
          }
        },
        {
          title: '版本',
          align: 'center',
          dataIndex: 'version',
        },
        {
          title: '版本状态',
          align: 'center',
          dataIndex: 'versionStatusName',
        },
        {
          title: '标准编码',
          align: 'center',
          dataIndex: 'num',
        },
        {
          title: '设备编码',
          title: '标准类型',
          align: 'center',
          dataIndex: 'maintenanceTypeName',
        },
        {
          title: '签审状态',
          align: 'center',
          dataIndex: 'approvalStatusName',
        },
        {
          title: '统一编码',
          align: 'center',
          dataIndex: 'equipmentNum',
        },
@@ -307,45 +350,95 @@
          dataIndex: 'equipmentModel',
        },
        {
          title: '对象部门',
          title: '使用部门',
          align: 'center',
          dataIndex: 'useDepartName',
        },
        {
          title: '派工方式',
          align: 'center',
          dataIndex: 'assignModeName',
        },
        {
          title: '责任班组',
          align: 'center',
          dataIndex: 'teamName',
        },
        // {
        //   title: '特种设备',
        //   align: 'center',
        //   dataIndex: 'specificEquipment',
        // },
        {
          title: '特种设备',
          title: '审核意见',
          align: 'center',
          dataIndex: 'specificEquipment',
          dataIndex: 'auditFeedback',
        },
        {
          title: '创建人',
          title: '审批意见',
          align: 'center',
          dataIndex: 'createBy',
          dataIndex: 'approvalFeedback',
        },
        {
          title: '创建日期',
          title: '编制人',
          align: 'center',
          dataIndex: 'writePerson',
        },
        {
          title: '审核人',
          align: 'center',
          dataIndex: 'auditPerson',
        },
        {
          title: '审批人',
          align: 'center',
          dataIndex: 'approvalPerson',
        },
        {
          title: '失效人',
          align: 'center',
          dataIndex: 'loseEfficacyPerson',
        },
        {
          title: '编制日期',
          align: 'center',
          dataIndex: 'createTime',
          width: 150,
        },
        {
          title: '更新人',
          title: '生效时间',
          align: 'center',
          dataIndex: 'updateBy',
          dataIndex: 'takeEffectTime',
          width: 150,
        },
        {
          title: '更新日期',
          title: '失效时间',
          align: 'center',
          dataIndex: 'updateTime',
          dataIndex: 'loseEfficacyTime',
          width: 150,
        },
        {
          title: '版本',
          align: 'center',
          dataIndex: 'version',
        },
        {
          title: '版本状态',
          align: 'center',
          dataIndex: 'versionStatusName',
        },
        // {
        //   title: '创建人',
        //   align: 'center',
        //   dataIndex: 'createBy',
        // },
        // {
        //   title: '更新人',
        //   align: 'center',
        //   dataIndex: 'updateBy',
        // },
        // {
        //   title: '更新日期',
        //   align: 'center',
        //   dataIndex: 'updateTime',
        // },
        {
          title: '操作',
          dataIndex: 'action',
@@ -360,6 +453,7 @@
        delete: '/eam/maintenanceStandard/delete',
        deleteBatch: '/eam/maintenanceStandard/deleteBatch',
        versionTakeEffect: "/eam/maintenanceStandard/versionTakeEffect",
        importExcelUrl: "/eam/maintenanceStandard/importExcelOfTwoMaintenance",
      },
      /* 分页参数 */
      ipagination: {
@@ -375,6 +469,11 @@
      },
      maintenanceStandardId: '-1',
      queryParam: { type: 'daily' }
    }
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
  watch: {
@@ -449,6 +548,12 @@
      this.$refs.modalForm.isRevise = false;
    },
    //审核审批
    handleAuditApproval: function (record) {
      this.$refs.auditApprovalModal.showModals(record);
      this.$refs.auditApprovalModal.title = "审核";
    },
    //升版
    handleRevise: function (record) {
      this.$refs.modalForm.edit(record);
@@ -457,22 +562,22 @@
      this.$refs.modalForm.isRevise = true;
    },
    //生效
    //失效
    handleTakeEffect(record) {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '日常保养标准版本生效!',
        content: '提示:版本生效后上一版本将自动失效,请谨慎操作!',
        title: '保养标准版本失效!',
        content: '提示:版本失效后将禁止使用,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.versionTakeEffect, { id: record.id, num: record.num, versionStatus: '2' }).then((res) => {
          requestPut(that.url.versionTakeEffect, { id: record.id, num: record.num, versionStatus: '3' }).then((res) => {
            if (res.success) {
              that.$message.success("版本生效成功!")
              that.$message.success("版本失效成功!")
              that.loadData(1)
            } else {
              that.$message.warning("版本生效失败!")
              that.$message.warning("版本失效失败!")
            }
          }).finally(() => {
            that.confirmLoading = false;