1、保养规范页面按照新需求进行调整并开发
2、点检工单页面调整字段展示名称
已修改9个文件
2037 ■■■■ 文件已修改
src/api/manage.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins/JeecgListMixin.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/EamMaintenanceStandardList.vue 454 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue 226 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/modules/EamMaintenanceStandardModal.vue 450 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/EamEquipmentLedger.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/modules/EamEquipmentModal.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/EamInspectionOrderList.vue 750 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamInspectionOrderModal.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/manage.js
@@ -224,3 +224,11 @@
   return;
  }
}
export function templateXlsDownload(fileUrl) {
  let downloadUrl = getFileAccessHttpUrl(fileUrl)
  if (downloadUrl) {
    window.open(downloadUrl)
  }
}
src/mixins/JeecgListMixin.js
@@ -233,6 +233,7 @@
            description:res.message
          });
          that.loadData();
          that.clearSelected()
        } else {
          // that.$message.warning(res.message);
          that.$notification.warning({
src/views/eam/base/EamMaintenanceStandardList.vue
@@ -1,37 +1,38 @@
<template>
  <a-card :bordered="false">
    <template v-if="isDisplayOperation">
      <!-- 查询区域 -->
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :xl="4" :lg="7" :md="8" :sm="24">
              <a-form-item label="标准编码">
                <a-input placeholder="请输入标准编码" v-model="queryParam.standardCode"></a-input>
              <a-form-item label="规范编码">
                <a-input placeholder="请输入规范编码" v-model="queryParam.standardCode"/>
              </a-form-item>
            </a-col>
            <a-col :xl="4" :lg="7" :md="8" :sm="24">
              <a-form-item label="标准名称">
                <a-input placeholder="请输入标准名称" v-model="queryParam.standardName"></a-input>
              <a-form-item label="规范名称">
                <a-input placeholder="请输入规范名称" v-model="queryParam.standardName"/>
              </a-form-item>
            </a-col>
            <a-col :xl="4" :lg="7" :md="8" :sm="24">
              <a-form-item label="设备编号">
                <lx-search-equipment-select placeholder="请输入设备编号或名称搜索" v-model="queryParam.equipmentId"></lx-search-equipment-select>
            <a-col :xl="5" :lg="7" :md="8" :sm="24">
              <a-form-item label="统一编码">
                <lx-search-equipment-select placeholder="请输入统一编码或名称搜索" v-model="queryParam.equipmentId"/>
              </a-form-item>
            </a-col>
            <a-col :xl="4" :lg="7" :md="8" :sm="24">
              <a-form-item label="保养分类">
                <j-dict-select-tag dict-code="maintenance_category" placeholder="请选择保养分类" v-model="queryParam.maintenanceCategory" />
                <j-dict-select-tag dict-code="maintenance_category" placeholder="请选择保养分类"
                                   v-model="queryParam.maintenanceCategory"/>
              </a-form-item>
            </a-col>
            <a-col :xl="4" :lg="7" :md="8" :sm="24">
              <a-form-item label="标准状态">
                <j-dict-select-tag dict-code="maintenance_standard_status" placeholder="请选择标准状态" v-model="queryParam.standardStatus" />
              <a-form-item label="规范状态">
                <j-dict-select-tag dict-code="maintenance_standard_status" placeholder="请选择规范状态"
                                   v-model="queryParam.standardStatus"/>
              </a-form-item>
            </a-col>
            <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-col :xl="3" :lg="7" :md="8" :sm="24">
              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
@@ -44,21 +45,30 @@
      <!-- 操作按钮区域 -->
      <div class="table-operator">
        <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="inspectionImportExcel"
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader"
                  :action="inspectionImportExcel"
                  @change="handleImportExcel">
          <a-button type="primary" icon="import">点检标准导入</a-button>
        </a-upload>
        <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)">点检标准模板下载</a-button>
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="secondMaintenanceImportExcel"
        <a-button 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-upload>
        <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.secondMaintenanceXlsDownloadUrl)">二保标准模板下载</a-button>
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader" :action="thirdMaintenanceImportExcel"
        <a-button 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-upload>
        <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)">三保标准模板下载</a-button>
        <a-button type="primary" icon="download" @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)">
          三保标准模板下载
        </a-button>
        <a-dropdown v-if="selectedRowKeys.length > 0">
          <a-menu slot="overlay">
            <a-menu-item key="1" @click="batchDel">
@@ -72,8 +82,6 @@
        </a-dropdown>
      </div>
    </template>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation">
@@ -95,33 +103,23 @@
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        :customRow='clickThenSelect'
        @change="handleTableChange">
        <template slot="referenceFile" slot-scope="text, record, index">
          <a v-if="text && text !== ''" @click.stop="handlePreview(record)">预览</a>
        </template>
        <span slot="action" slot-scope="text, record">
          <a v-if="record.standardStatus === 'NORMAL'" @click.stop="handleEdit(record)">编辑</a>
          <a v-if="record.standardStatus === 'WAIT_SUBMIT'" @click.stop="handleEdit(record)">编辑</a>
          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
              <a-menu-item v-if="record.standardStatus === 'NORMAL'">
                <a @click.stop="handleUpgrade(record)">升版</a>
              </a-menu-item>
              <a-menu-item v-if="record.standardStatus === 'NORMAL'">
                <a-popconfirm title="确定作废吗?" @confirm="() => handleAbolish(record.id)">
                  <a>作废</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
          <template v-if="record.standardStatus === 'START'">
             <a-divider type="vertical"/>
             <a @click.stop="handleUpgrade(record)">升版</a>
          </template>
          <template v-if="record.standardStatus === 'WAIT_SUBMIT'">
             <a-divider type="vertical"/>
              <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a @click="event=>event.stopPropagation()">删除</a>
              </a-popconfirm>
          </template>
        </span>
      </a-table>
      <a-tabs defaultActiveKey="1">
@@ -137,219 +135,191 @@
    <!-- 表单区域 -->
    <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"></eamMaintenanceStandard-modal>
    <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
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 LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  import '@/assets/less/TableExpand.less'
  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 LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
export default {
  name: 'EamMaintenanceStandardList',
  mixins: [JeecgListMixin],
  props: {
    isDisplayOperation: {
      type: Boolean,
      default: true
    }
  },
  components: {
    LxSearchEquipmentSelect,
    EamMaintenanceStandardModal,
    EamMaintenanceStandardDetailList
  },
  data() {
    return {
      description: '保养标准管理页面',
      disableMixinCreated: true,
      // 表头
      columns: [
        {
          title: '标准编码',
          align: 'center',
          dataIndex: 'standardCode'
        },
        {
          title: '标准名称',
          align: 'center',
          dataIndex: 'standardName'
        },
        {
          title: '文件编号',
          align: 'center',
          dataIndex: 'fileCode'
        },
        {
          title: '保养周期(天)',
          align: 'center',
          dataIndex: 'maintenancePeriod'
        },
        {
          title: '初始日期',
          align: 'center',
          dataIndex: 'initialDate'
        },
        {
          title: '保养分类',
          align: 'center',
          dataIndex: 'maintenanceCategory_dictText'
        },
        {
          title: '设备编号',
          align: 'center',
          dataIndex: 'equipmentId_dictText'
        },
        {
          title: '标准状态',
          align: 'center',
          dataIndex: 'standardStatus_dictText'
        },
        {
          title: '版本',
          align: 'center',
          dataIndex: 'standardVersion'
        },
        {
          title: '参考文件',
          align: 'center',
          dataIndex: 'referenceFile',
          scopedSlots: { customRender: 'referenceFile' }
        }
      ],
      url: {
        list: '/eam/maintenanceStandard/list',
        delete: '/eam/maintenanceStandard/delete',
        deleteBatch: '/eam/maintenanceStandard/deleteBatch',
        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',
      },
      fileUrl: '',
      standardId: '-1'
    }
  },
  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}`
    },
    thirdMaintenanceImportExcel: function() {
      return `${window._CONFIG['domianURL']}/${this.url.thirdMaintenanceImportExcel}`
    }
  },
  created() {
    if (!this.isDisplayOperation) {
      return
    }
    const operationColumn = {
      title: '操作',
      dataIndex: 'action',
      align: 'center',
      scopedSlots: { customRender: 'action' }
    }
    this.columns = [...this.columns, operationColumn]
    this.loadData(1)
  },
  methods: {
    handlePreview: function(record) {
      if (record.referenceFile) {
        try {
          let file = JSON.parse(record.referenceFile)
          this.$refs.lxFilePreview.preview(file.filePath)
        } catch (e) {
          console.error(e)
          this.$message.error(e.message)
        }
      } else {
        this.$message.warning('参考文件为空!')
  export default {
    name: 'EamMaintenanceStandardList',
    mixins: [JeecgListMixin],
    props: {
      isDisplayOperation: {
        type: Boolean,
        default: true
      }
    },
    clickThenSelect(record) {
    components: {
      LxSearchEquipmentSelect,
      EamMaintenanceStandardModal,
      EamMaintenanceStandardDetailList
    },
    data() {
      return {
        style: {
          cursor: 'pointer'
        },
        on: {
          click: () => {
            this.onSelectChange(record.id.split(','), [record])
        description: '保养规范页面',
        disableMixinCreated: true,
        // 表头
        columns: [
          {
            title: '统一编码',
            align: 'center',
            dataIndex: 'equipmentCode'
          },
          {
            title: '设备名称',
            align: 'center',
            dataIndex: 'equipmentName'
          },
          {
            title: '设备型号',
            align: 'center',
            dataIndex: 'equipmentModel'
          },
          {
            title: '保养分类',
            align: 'center',
            dataIndex: 'maintenanceCategory_dictText',
            width: 100
          },
          {
            title: '规范编码',
            align: 'center',
            dataIndex: 'standardCode',
            width: 150
          },
          {
            title: '规范名称',
            align: 'center',
            dataIndex: 'standardName'
          },
          {
            title: '保养周期',
            align: 'center',
            dataIndex: 'maintenancePeriod',
            width: 100
          },
          {
            title: '保养周期单位',
            align: 'center',
            dataIndex: 'periodUnit',
            width: 120
          },
          {
            title: '初始日期',
            align: 'center',
            dataIndex: 'initialDate',
            width: 100
          },
          {
            title: '规范状态',
            align: 'center',
            dataIndex: 'standardStatus_dictText'
          },
          {
            title: '规范版本',
            align: 'center',
            dataIndex: 'standardVersion',
            width: 100
          }
        }
        ],
        url: {
          list: '/eam/maintenanceStandard/list',
          delete: '/eam/maintenanceStandard/delete',
          deleteBatch: '/eam/maintenanceStandard/deleteBatch',
          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'
        },
        standardId: '-1'
      }
    },
    onClearSelected() {
      this.selectedRowKeys = []
      this.selectionRows = []
      this.standardId = '-1'
    },
    onSelectChange(selectedRowKeys, selectionRows) {
      this.selectedRowKeys = selectedRowKeys
      this.selectionRows = selectionRows
      if (selectedRowKeys.length === 1) {
        this.standardId = selectedRowKeys[0]
      } else {
        this.standardId = '-1'
    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}`
      },
      thirdMaintenanceImportExcel: function() {
        return `${window._CONFIG['domianURL']}/${this.url.thirdMaintenanceImportExcel}`
      }
    },
    searchReset() {
      this.standardId = '-1'
      this.queryParam = {}
      this.loadData(1)
    },
    handleTemplateXlsDownload(url) {
      templateXlsDownload(url)
    },
    handleAbolish: function (id) {
      if(!this.url.abolish){
        this.$message.error("请设置url.abolish属性!")
    created() {
      if (!this.isDisplayOperation) {
        return
      }
      var that = this;
      deleteAction(that.url.abolish, {id: id}).then((res) => {
        if (res.success) {
          //重新计算分页问题
          that.reCalculatePage(1)
          // that.$message.success(res.message);
          that.$notification.success({
            message:'消息',
            description:res.message
          });
          that.loadData();
        } else {
          // that.$message.warning(res.message);
          that.$notification.warning({
            message:'消息',
            description:res.message
          });
      const operationColumn = {
        title: '操作',
        dataIndex: 'action',
        align: 'center',
        scopedSlots: { customRender: 'action' }
      }
      this.columns = [...this.columns, operationColumn]
      this.loadData(1)
    },
    methods: {
      clickThenSelect(record) {
        return {
          style: {
            cursor: 'pointer'
          },
          on: {
            click: () => {
              this.onSelectChange(record.id.split(','), [record])
            }
          }
        }
      });
    },
    handleUpgrade(record) {
      //升版
      this.$refs.modalForm.upgrade(record);
      this.$refs.modalForm.title = "升版";
      this.$refs.modalForm.disableSubmit = false;
    },
      },
      onClearSelected() {
        this.selectedRowKeys = []
        this.selectionRows = []
        this.standardId = '-1'
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectionRows = selectionRows
        if (selectedRowKeys.length === 1) {
          this.standardId = selectedRowKeys[0]
        } else {
          this.standardId = '-1'
        }
      },
      handleTemplateXlsDownload(url) {
        templateXlsDownload(url)
      },
      handleUpgrade(record) {
        //升版
        this.$refs.modalForm.upgrade(record)
        this.$refs.modalForm.title = '升版'
        this.$refs.modalForm.disableSubmit = false
      },
      searchReset() {
        this.standardId = '-1'
        this.queryParam = {}
        this.loadData(1)
      }
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
</script>
src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue
@@ -21,131 +21,123 @@
</template>
<script>
import '@/assets/less/TableExpand.less'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@api/manage'
  import '@/assets/less/TableExpand.less'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction } from '@api/manage'
export default {
  name: 'EamMaintenanceStandardDetailList',
  mixins: [JeecgListMixin],
  props: {
    standardId: {
      type: String,
      required: true,
      default: '-1'
    }
  },
  data() {
    return {
      description: '保养标准明细管理页面',
      // 表头
      columns: [
        {
          title: '序号',
          align: 'center',
          dataIndex: 'itemCode',
          width: 60,
        },
        {
          title: '部位',
          align: 'center',
          dataIndex: 'itemPart',
          width: 200,
          ellipsis: true,
        },
        {
          title: '保养项',
          align: 'center',
          dataIndex: 'itemName',
          ellipsis: true,
        },
        {
          title: '保养要求',
          align: 'center',
          dataIndex: 'itemDemandAlias',
          ellipsis: true,
        },
        {
          title: '检查标准或要求',
          align: 'center',
          dataIndex: 'itemDemand',
          ellipsis: true,
        },
        {
          title: '检查方法',
          align: 'center',
          dataIndex: 'checkMethod',
          ellipsis: true,
        }
      ],
      url: {
        list: '/eam/eamMaintenanceStandardDetail/list'
  export default {
    name: 'EamMaintenanceStandardDetailList',
    mixins: [JeecgListMixin],
    props: {
      standardId: {
        type: String,
        required: true,
        default: '-1'
      }
    }
  },
  watch: {
    standardId: {
      immediate: true,
      handler(val) {
        if(val) {
          this.loadData(1)
        }else {
          this.clearList();
    },
    data() {
      return {
        description: '保养标准明细管理页面',
        // 表头
        columns: [
          {
            title: '序号',
            align: 'center',
            dataIndex: 'itemCode',
            width: 60
          },
          {
            title: '部位',
            align: 'center',
            dataIndex: 'itemPart',
            ellipsis: true
          },
          {
            title: '保养项分类',
            align: 'center',
            dataIndex: 'itemCategory_dictText',
            ellipsis: true
          },
          {
            title: '保养项目',
            align: 'center',
            dataIndex: 'itemName',
            ellipsis: true
          },
          {
            title: '保养规范或要求',
            align: 'center',
            dataIndex: 'itemDemand',
            ellipsis: true
          }
        ],
        url: {
          list: '/eam/eamMaintenanceStandardDetail/list'
        }
      }
    }
  },
  created() {
  },
  computed: {
  },
  methods: {
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!')
        return
    },
    watch: {
      standardId: {
        immediate: true,
        handler(val) {
          if (val) {
            this.loadData(1)
          } else {
            this.clearList()
          }
        }
      }
      if(this.standardId && this.standardId === '-1'){
        this.clearList();
        return;
      }
      //加载数据 若传入参数1则加载第一页的内容
      if (arg === 1) {
    },
    created() {
    },
    computed: {},
    methods: {
      loadData(arg) {
        if (!this.url.list) {
          this.$message.error('请设置url.list属性!')
          return
        }
        if (this.standardId && this.standardId === '-1') {
          this.clearList()
          return
        }
        //加载数据 若传入参数1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1
        }
        let params = this.getQueryParams()//查询条件
        if (!params) {
          return false
        }
        this.dataSource = []
        params.standardId = this.standardId
        this.loading = true
        getAction(this.url.list, params).then((res) => {
          if (res.success) {
            // console.log(res)
            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
            this.dataSource = res.result.records || res.result
            if (res.result.total) {
              this.ipagination.total = res.result.total
            } else {
              this.ipagination.total = 0
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          } else {
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      clearList() {
        this.dataSource = []
        this.selectedRowKeys = []
        this.ipagination.current = 1
      }
      let params = this.getQueryParams()//查询条件
      if (!params) {
        return false
      }
      this.dataSource = []
      params.standardId = this.standardId
      this.loading = true
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          // console.log(res)
          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          this.dataSource = res.result.records || res.result
          if (res.result.total) {
            this.ipagination.total = res.result.total
          } else {
            this.ipagination.total = 0
          }
          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    },
    clearList() {
      this.dataSource = []
      this.selectedRowKeys = []
      this.ipagination.current = 1
    },
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
  @import '~@assets/less/common.less';
</style>
src/views/eam/base/modules/EamMaintenanceStandardModal.vue
@@ -8,75 +8,67 @@
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item prop="standardCode" label="规范编码">
              <a-input placeholder="编码系统自动生成" v-model="model.standardCode" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item prop="standardName" label="规范名称">
              <a-input placeholder="请输入规范名称" v-model="model.standardName"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item prop="equipmentId" label="统一编码">
              <lx-search-equipment-select placeholder="请输入统一编码或名称搜索" v-model="model.equipmentId" :disabled="!editable"/>
            </a-form-model-item>
          </a-col>
        </a-row>
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="标准编码">
              <a-input placeholder="编码系统自动生成" v-model="model.standardCode" disabled />
            <a-form-model-item prop="maintenanceCategory" label="保养分类">
              <j-dict-select-tag dict-code="maintenance_category" placeholder="请选择保养分类"
                                 @change="handleMaintenanceCategoryChange"
                                 v-model="model.maintenanceCategory" :disabled="!editable"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="标准名称">
              <a-input placeholder="请输入标准名称" v-model="model.standardName" />
            <a-form-model-item label="保养周期单位">
              <a-input readOnly v-model="model.periodUnit" placeholder="根据保养分类自动带出"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceCategory" label="保养分类">
              <j-dict-select-tag dict-code="maintenance_category" placeholder="请选择保养分类" v-model="model.maintenanceCategory" :disabled="editable" />
            <a-form-model-item prop="maintenancePeriod" label="保养周期">
              <a-input-number v-model="model.maintenancePeriod" placeholder="请输入保养周期" :min="1" :precision="0"
                              style="width: 100%"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileCode" label="文件编号">
              <a-input placeholder="请输入保养标准文件编号" v-model="model.fileCode"/>
            <a-form-model-item prop="initialDate" label="初始日期">
              <a-date-picker placeholder="请选择初始日期" v-model="model.initialDate" value-format="YYYY-MM-DD"
                             style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialDate" label="初始日期">
              <a-date-picker placeholder="请选择初始日期" v-model="model.initialDate" format="YYYY-MM-DD" style="width: 100%" :disabled="editable"/>
            <a-form-model-item label="规范状态">
              <j-dict-select-tag dict-code="maintenance_standard_status" placeholder="根据流程进度自动带出"
                                 v-model="model.standardStatus" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="保养周期">
              <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" style="width: 100%"/>
            <a-form-model-item label="规范版本">
              <a-input-number v-model="model.standardVersion" placeholder="根据流程进度自动带出" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备编号">
              <lx-search-equipment-select placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId" :disabled="editable"></lx-search-equipment-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardStatus" label="标准状态">
              <j-dict-select-tag dict-code="maintenance_standard_status" v-model="model.standardStatus" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardVersion" label="标准版本">
              <a-input-number v-model="model.standardVersion" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item
              label="参考文件"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="fileList">
              <lx-upload :returnUrl="false"
                         :multiple="false"
                         v-model="model.fileList"
                         biz="EamMaintenanceStandard">
              </lx-upload>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <j-vxe-table
            ref="editableDetailTable"
@@ -91,7 +83,20 @@
            :loading="detail.loading"
            :dataSource="detail.dataSource"
            :columns="detail.columns"
            style="margin-top: 8px;"/>
            style="margin-top: 8px;">
            <template v-slot:itemPart="props">
              <a-textarea v-model="props.row.itemPart" allowClear @change="$refs.editableDetailTable.validateTable()"
                          :placeholder="model.maintenanceCategory!='THIRD_MAINTENANCE'?'仅三保需要维护':'请输入部位'" :rows="1"
                          autoSize :disabled="model.maintenanceCategory!='THIRD_MAINTENANCE'"/>
            </template>
            <template v-slot:itemCategory="props">
              <j-dict-select-tag v-model="props.row.itemCategory" :dict-code="encodedDictCode"
                                 @change="$refs.editableDetailTable.validateTable()"
                                 :placeholder="getItemCategoryPlaceholder"
                                 :disabled="!Boolean(model.maintenanceCategory)||model.maintenanceCategory=='THIRD_MAINTENANCE'"/>
            </template>
          </j-vxe-table>
        </a-row>
      </a-form-model>
    </a-spin>
@@ -99,55 +104,56 @@
</template>
<script>
import { getAction, httpAction } from '@/api/manage'
  import { getAction, httpAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect'
  export default {
    name: "EamMaintenanceStandardModal",
    name: 'EamMaintenanceStandardModal',
    mixins: [JVxeTableModelMixin],
    components: {
      LxSearchEquipmentSelect,
      LxSearchEquipmentSelect
    },
    data () {
    data() {
      return {
        title:"操作",
        title: '操作',
        visible: false,
        model: {},
        editable: false,
        editable: true,
        upgradeFlag: false,
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
          sm: { span: 7 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
          sm: { span: 16 }
        },
        confirmLoading: false,
        spinning: false,
        validatorRules: {
          standardName: [
            { required: true, message: '请输入标准名称!' }
            { required: true, message: '请输入规范名称', trigger: 'change' }
          ],
          maintenanceCategory: [
            { required: true, message: '请选择保养分类!' }
            { required: true, message: '请选择保养分类', trigger: 'change' }
          ],
          initialDate: [
            { required: true, message: '请选择初始日期!' }
            { required: true, message: '请选择初始日期', trigger: 'change' }
          ],
          maintenancePeriod: [
            { required: true, message: '请输入保养周期,单位:天!' }
            { required: true, message: '请输入保养周期', trigger: 'change' }
          ],
          equipmentId: [
            { required: true, message: '请选择设备!' }
            { required: true, message: '请输入统一编码或名称搜索', trigger: 'change' }
          ]
        },
        url: {
          add: "/eam/maintenanceStandard/add",
          edit: "/eam/maintenanceStandard/edit",
          detail: "/eam/eamMaintenanceStandardDetail/queryList",
          upgrade: '/eam/maintenanceStandard/upgrade',
          add: '/eam/maintenanceStandard/add',
          edit: '/eam/maintenanceStandard/edit',
          detail: '/eam/eamMaintenanceStandardDetail/queryList',
          upgrade: '/eam/maintenanceStandard/upgrade'
        },
        detail: {
          loading: false,
@@ -156,169 +162,249 @@
            {
              title: 'ID',
              key: 'id',
              type: JVXETypes.hidden,
              type: JVXETypes.hidden
            },
            {
              title: 'standardId',
              key: 'standardId',
              type: JVXETypes.hidden,
              type: JVXETypes.hidden
            },
            {
              title: '序号',
              title: '项目序号',
              key: 'itemCode',
              type: JVXETypes.inputNumber,
              align:"center",
              width: 100,
              align: 'center',
              placeholder: '请输入项目序号',
              width: 150,
              validateRules: [
                {required : true, unique: true, message: '序号不能重复'}
                { required: true, message: '请输入项目序号' },
                { unique: true, message: '项目序号不能重复' }
              ]
            },
            {
              title: '部位',
              key: 'itemPart',
              type: JVXETypes.textarea,
              align:"center",
              type: JVXETypes.slot,
              slotName: 'itemPart',
              placeholder: '请输入部位',
              align: 'center',
              validateRules: [{ handler: this.itemPartValidate }]
            },
            {
              title: '保养项',
              title: '保养项分类',
              key: 'itemCategory',
              type: JVXETypes.slot,
              slotName: 'itemCategory',
              align: 'center',
              validateRules: [{ handler: this.itemCategoryValidate }]
            },
            {
              title: '保养项目',
              key: 'itemName',
              placeholder: '请输入保养项目',
              type: JVXETypes.textarea,
              align:"center",
              align: 'center',
              validateRules: [
                {required : true, message: '保养项不能为空!'}
                { required: true, message: '请输入保养项目' }
              ]
            },
            {
              title: '保养要求',
              key: 'itemDemandAlias',
              type: JVXETypes.textarea,
              align:"center",
            },
            {
              title: '检查标准或要求',
              title: '保养规范或要求',
              key: 'itemDemand',
              placeholder: '请输入保养规范或要求',
              type: JVXETypes.textarea,
              align:"center",
              align: 'center',
              validateRules: [
                {required : true, message: "保养要求不能为空!"}
                { required: true, message: '请输入保养规范或要求' }
              ]
            },
            {
              title: '检查方法',
              key: 'checkMethod',
              type: JVXETypes.textarea,
              align:"center",
            },
            }
          ],
          toolbarConfig: {
            // prefix 前缀;suffix 后缀
            slot: ['prefix', 'suffix'],
            // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮
            btn: ['add', 'remove', 'clearSelection']
          },
          }
        }
      }
    },
    created () {
    computed: {
      getItemCategoryPlaceholder() {
        if (!Boolean(this.model.maintenanceCategory)) return '请选择保养分类'
        else {
          if (this.model.maintenanceCategory != 'THIRD_MAINTENANCE') return '请选择保养项分类'
          else return '三保无需维护'
        }
      },
      encodedDictCode() {
        let suffix
        if (!Boolean(this.model.maintenanceCategory) || this.model.maintenanceCategory === 'THIRD_MAINTENANCE') return
        else suffix = this.model.maintenanceCategory.split('_')[1]
        const dictCode = `sys_dict_item,item_text,item_value,item_value like '%${suffix}' and dict_id='1940598438685134850'`
        return encodeURIComponent(dictCode)
      }
    },
    methods: {
      add () {
        this.model = {};
        this.visible = true;
        this.editable = false;
        this.upgradeFlag = false;
        this.detail.dataSource = [];
      add() {
        this.model = {}
        this.visible = true
        this.editable = true
        this.upgradeFlag = false
        this.detail.dataSource = []
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
        this.editable = true;
        this.upgradeFlag = false;
        this.detail.dataSource = [];
        if(record && record.referenceFile) {
          let obj = JSON.parse(record.referenceFile);
          this.model.fileList = [obj];
        }else {
          this.model.fieldList = [];
        }
        this.loadDetail(record.id);
      },
      upgrade(record) {
        this.model = Object.assign({}, record);
        this.visible = true;
        this.editable = true;
        this.upgradeFlag = true;
        this.detail.dataSource = [];
        if(record && record.referenceFile) {
          let obj = JSON.parse(record.referenceFile);
          this.model.fileList = [obj];
        }else {
          this.model.fieldList = [];
        }
        this.loadDetail(record.id);
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      async handleOk () {
        const that = this;
        let errMap = await that.$refs.editableDetailTable.validateTable();
        if(errMap){
          this.$message.warning("数据校验失败!");
          return;
        }
        // 触发表单验证
         this.$refs.form.validate(valid => {
          if (valid) {
            let tableData = that.$refs.editableDetailTable.getTableData();
            let removeData = that.$refs.editableDetailTable.getDeleteData();
            that.model.tableDetailList = [...tableData];
            that.model.removeDetailList = [...removeData];
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              if(this.upgradeFlag) {
                httpurl+=this.url.upgrade;
              }else {
                httpurl+=this.url.edit;
      edit(record) {
        this.model = Object.assign({}, record)
        this.visible = true
        this.editable = false
        this.upgradeFlag = false
        this.detail.dataSource = []
        this.loadDetail(record.id)
      },
      upgrade(record) {
        this.model = Object.assign({}, record)
        this.visible = true
        this.editable = false
        this.upgradeFlag = true
        this.detail.dataSource = []
        this.loadDetail(record.id)
      },
      /**
       * 保养分类值改变时同时改变保养周期单位以及保养项分类
       * @param value 保养分类值
       */
      handleMaintenanceCategoryChange(value) {
        switch (value) {
          case 'THIRD_MAINTENANCE':
            this.model.periodUnit = '年'
            break
          case 'SECOND_MAINTENANCE':
            this.model.periodUnit = '月'
            break
          case 'POINT_INSPECTION':
            this.model.periodUnit = '天'
            break
          default:
            delete this.model.periodUnit
        }
        const tableData = this.$refs.editableDetailTable.getTableData()
        tableData.forEach(item => {
          if (value !== 'THIRD_MAINTENANCE') delete item.itemPart
          delete item.itemCategory
        })
        this.detail.dataSource = [...tableData]
        console.log('tableData', tableData)
      },
      /**
       * 保养部位校验
       * @param cellValue 输入值
       * @param callback 回调函数
       */
      itemPartValidate({ cellValue }, callback) {
        if (this.model.maintenanceCategory === 'THIRD_MAINTENANCE') {
          if (cellValue) callback(true)
          else callback(false, '请选择${title}')
        } else {
          callback(true)
        }
      },
      /**
       * 保养项分类校验
       * @param cellValue 输入值
       * @param callback 回调函数
       */
      itemCategoryValidate({ cellValue }, callback) {
        if (this.model.maintenanceCategory === 'THIRD_MAINTENANCE') {
          callback(true)
        } else {
          if (cellValue) callback(true)
          else callback(false, '请选择${title}')
        }
      },
      // 提交事件
      async handleOk() {
        const that = this
        let errMap = await that.$refs.editableDetailTable.validateTable()
        if (errMap) return false
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            let tableData = that.$refs.editableDetailTable.getTableData()
            let removeData = that.$refs.editableDetailTable.getDeleteData()
            that.model.tableDetailList = [...tableData]
            that.model.removeDetailList = [...removeData]
            that.confirmLoading = that.spinning = true
            let httpUrl = ''
            let method = ''
            if (!this.model.id) {
              httpUrl += this.url.add
              method = 'post'
            } else {
              if (this.upgradeFlag) {
                httpUrl += this.url.upgrade
              } else {
                httpUrl += this.url.edit
              }
              method = 'put';
              method = 'put'
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
                that.close();
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
          }else{
             return false;
            httpAction(httpUrl, this.model, method)
              .then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.$emit('ok')
                  that.close()
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.confirmLoading = that.spinning = false
              })
          } else {
            return false
          }
        })
      },
      handleCancel () {
      handleCancel() {
        this.close()
      },
      close() {
        this.$emit('close')
        this.visible = false
        this.$refs.form.clearValidate()
      },
      //加载详情数据
      loadDetail(standardId) {
        this.detail.dataSource = [];
        this.spinning = true
        this.detail.dataSource = []
        if (standardId) {
          getAction(this.url.detail, { standardId: standardId }).then(res => {
            if (res.success) {
              this.detail.dataSource = [...res.result];
            }
          })
          getAction(this.url.detail, { standardId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      }
@@ -326,6 +412,12 @@
  }
</script>
<style lang="less" scoped>
<style scoped lang="less">
  /deep/ .ant-select-dropdown-menu {
    text-align: left;
  }
  /deep/ textarea.ant-input {
    resize: none;
  }
</style>
src/views/eam/equipment/EamEquipmentLedger.vue
@@ -92,19 +92,9 @@
        style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onSelectChange([])">清空</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">
        <!--统一编码-->
        <template slot="equipmentCode" slot-scope="text">
          <a href="#" @click="handleDetail(record)" style="display: inline-block;height: 100%">{{text}}</a>
@@ -139,6 +129,7 @@
          <a @click.stop="handleEdit(record)">编辑</a>
          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
@@ -298,7 +289,7 @@
          {
            title: '维修班组',
            align: 'center',
            dataIndex: 'repairDepartOrgCode'
            dataIndex: 'repairDepartOrgCode_dictText'
          },
          {
            title: '安全配置',
@@ -441,7 +432,7 @@
            dataIndex: 'nextThirdMaintenance'
          },
          {
            title: '三保周期',
            title: '三保周期(年)',
            align: 'center',
            dataIndex: 'thirdMaintenancePeriod'
          },
@@ -456,7 +447,7 @@
            dataIndex: 'nextTechnologyCheck'
          },
          {
            title: '技术鉴定周期',
            title: '技术鉴定周期(年)',
            align: 'center',
            dataIndex: 'technologyCheckPeriod'
          },
@@ -541,7 +532,4 @@
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
</script>
src/views/eam/equipment/modules/EamEquipmentModal.vue
@@ -24,7 +24,7 @@
                </a-col>
                <a-col :span="customSpan">
                  <a-form-model-item prop="equipmentCode" label="统一编码">
                    <a-input placeholder="请输入统一编码" v-model="model.equipmentCode"/>
                    <a-input placeholder="请输入统一编码" v-model="model.equipmentCode" :disabled="!editable"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
@@ -35,7 +35,7 @@
                <a-col :span="customSpan">
                  <a-form-model-item prop="factoryOrgCode" label="使用部门">
                    <a-tree-select v-model="model.factoryOrgCode" style="width: 100%" show-search
                                   :tree-data="productionTreeData"
                                   :tree-data="productionTreeData" :disabled="!editable"
                                   :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                                   placeholder="请选择使用部门" allow-clear treeNodeFilterProp="title"
                                   :replaceFields="{key:'orgCode',value:'orgCode'}"
@@ -47,7 +47,7 @@
              <a-row>
                <a-col :span="customSpan">
                  <a-form-model-item prop="equipmentCategory" label="所属分类">
                    <j-dict-select-tag dict-code="equipment_category" placeholder="请选择所属分类"
                    <j-dict-select-tag dict-code="equipment_category" placeholder="请选择所属分类" :disabled="!editable"
                                       v-model="model.equipmentCategory"/>
                  </a-form-model-item>
                </a-col>
@@ -216,7 +216,8 @@
              <a-row>
                <a-col :span="customSpan">
                  <a-form-model-item label="本次三保日期">
                    <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD" style="width:100%"/>
                    <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD"
                                   :disabled="!editable" style="width:100%"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
@@ -225,14 +226,15 @@
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
                  <a-form-model-item label="三保周期">
                    <a-input-number placeholder="请输入三保周期" v-model="model.thirdMaintenancePeriod" :min="0"
                  <a-form-model-item label="三保周期(年)">
                    <a-input-number placeholder="请输入三保周期(年)" v-model="model.thirdMaintenancePeriod" :min="1"
                                    style="width: 100%"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
                  <a-form-model-item label="本次技术鉴定日期">
                    <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD" style="width:100%"/>
                    <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD"
                                   :disabled="!editable" style="width:100%"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
@@ -244,8 +246,8 @@
                  </a-form-model-item>
                </a-col>
                <a-col :span="customSpan">
                  <a-form-model-item label="技术鉴定周期">
                    <a-input-number placeholder="请输入技术鉴定周期" v-model="model.technologyCheckPeriod" :min="0"
                  <a-form-model-item label="技术鉴定周期(年)">
                    <a-input-number placeholder="请输入技术鉴定周期(年)" v-model="model.technologyCheckPeriod" :min="1"
                                    style="width: 100%"/>
                  </a-form-model-item>
                </a-col>
@@ -355,7 +357,7 @@
    },
    methods: {
      add() {
        this.editable = false
        this.editable = true
        //初始化默认值
        this.model = {
          operationSystem: 1,
@@ -365,7 +367,7 @@
      },
      edit(record) {
        this.editable = true
        this.editable = false
        this.model = Object.assign({}, record)
        this.visible = true
      },
@@ -376,32 +378,34 @@
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            let httpurl = ''
            let httpUrl = ''
            let method = ''
            if (!this.model.id) {
              httpurl += this.url.add
              httpUrl += this.url.add
              method = 'post'
            } else {
              httpurl += this.url.edit
              httpUrl += this.url.edit
              method = 'put'
            }
            httpAction(httpurl, this.model, method).then((res) => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.$emit('ok')
                that.close()
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.confirmLoading = false
            })
            httpAction(httpUrl, this.model, method)
              .then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.$emit('ok')
                  that.close()
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.confirmLoading = false
              })
          } else {
            return false
          }
src/views/eam/maintenance/EamInspectionOrderList.vue
@@ -10,12 +10,7 @@
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
          <a-col
            :xl="4"
            :lg="7"
            :md="8"
            :sm="24"
          >
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="工单号">
              <a-input
                placeholder="请输入工单号"
@@ -23,69 +18,27 @@
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col
            :xl="4"
            :lg="7"
            :md="8"
            :sm="24"
          >
            <a-form-item label="设备编号">
              <lx-search-equipment-select
                placeholder="请输入设备编号或名称搜索"
                v-model="queryParam.equipmentId"
              ></lx-search-equipment-select>
          <a-col :xl="5" :lg="7" :md="8" :sm="24">
            <a-form-item label="统一编码">
              <lx-search-equipment-select placeholder="请输入统一编码或名称搜索" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col
            :xl="6"
            :lg="7"
            :md="8"
            :sm="24"
          >
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="计划点检日期">
              <a-range-picker
                v-model="queryParam.inspectionDateRange"
                @change="onInspectionDateChange"
                format="YYYY-MM-DD"
                value-format="YYYY-MM-DD"
              />
              <a-range-picker v-model="queryParam.inspectionDateRange" @change="onInspectionDateChange"
                              format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>
            </a-form-item>
          </a-col>
          <a-col
            :xl="4"
            :lg="7"
            :md="8"
            :sm="24"
          >
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="点检状态">
              <j-dict-select-tag
                placeholder="请选择点检状态"
                dict-code="inspection_status"
                v-model="queryParam.inspectionStatus"
              />
              <j-dict-select-tag placeholder="请选择点检状态" dict-code="inspection_status"
                                 v-model="queryParam.inspectionStatus"/>
            </a-form-item>
          </a-col>
          <a-col
            :xl="4"
            :lg="7"
            :md="8"
            :sm="24"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="info"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
@@ -94,431 +47,374 @@
    <!-- 查询区域-END -->
    <!-- 操作按钮区域 -->
    <div
      class="table-operator"
      v-if="isDisplayOperation"
    >
      <a-button
        @click="handleAdd"
        type="primary"
        icon="plus"
        v-if="isShowAuth('eam:inspection:add')"
      >新增</a-button>
    <div class="table-operator" v-if="isDisplayOperation">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item
            key="1"
            v-if="isShowAuth('eam:inspection:abolish')"
            @click="batchZf('ABOLISH')"
          >
            <a-icon type="snippets" />
          <a-menu-item key="1" @click="batchZf('ABOLISH')">
            <a-icon type="snippets"/>
            作废
          </a-menu-item>
          <a-menu-item
            key="2"
            v-if="isShowAuth('eam:inspection:collect')"
            @click="batchLq('UNDER_INSPECTION')"
          >
            <a-icon type="form" />
          <a-menu-item key="2" @click="batchLq('UNDER_INSPECTION')">
            <a-icon type="form"/>
            领取
          </a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作
          <a-icon type="down" />
          <a-icon type="down"/>
        </a-button>
      </a-dropdown>
    </div>
    <!-- table区域-begin -->
    <div>
      <div
        class="ant-alert ant-alert-info"
        style="margin-bottom: 16px;"
        v-if="isDisplayOperation"
      >
        <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 class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation">
        <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"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange"
      >
      <a-table ref="table" size="middle" :scroll="{x:true}" bordered rowKey="id" :columns="columns"
               :dataSource="dataSource" :pagination="ipagination" :loading="loading"
               :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" class="j-table-force-nowrap"
               @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <template v-if=" record.inspectionStatus === 'WAIT_INSPECTION'">
            <a @click="handleEdit(record)">编辑</a>
        <span
          slot="action"
          slot-scope="text, record"
        >
          <a
            @click="handleEdit(record)"
            v-if="isShowAuth('eam:inspection:edit') && record.inspectionStatus === 'WAIT_INSPECTION'"
          >编辑</a>
          <a-divider type="vertical"/>
          <a-divider
            type="vertical"
            v-if="isShowAuth('eam:inspection:edit') && record.inspectionStatus === 'WAIT_INSPECTION'"
          />
          <a-popconfirm
            title="确定领取吗?"
            v-if="isShowAuth('eam:inspection:collect') && record.inspectionStatus === 'WAIT_INSPECTION'"
            @confirm="() => handleInspection(record.id)"
          >
          <a-popconfirm title="确定领取吗?" @confirm="() => handleInspection(record.id)">
            <a>领取</a>
          </a-popconfirm>
          <a-divider
            type="vertical"
            v-if="isShowAuth('eam:inspection:collect') && record.inspectionStatus === 'WAIT_INSPECTION'"
          />
          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item v-if="isShowAuth('eam:inspection:abolish') && record.inspectionStatus === 'WAIT_INSPECTION'">
                <a-popconfirm
                  title="确定作废吗?"
                  @confirm="() => handleOrReceive(record.id)"
                >
              <a-menu-item>
                <a-popconfirm title="确定作废吗?" @confirm="() => handleOrReceive(record.id)">
                  <a>作废</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
          </template>
          <a-divider
            v-if="record.inspectionStatus === 'COMPLETE'"
            type="vertical"
          />
          <a
            v-if="record.inspectionStatus === 'COMPLETE'"
            @click="handlePrint(record)"
          >打印</a>
          <a v-else @click="handleDetail(record)">详情</a>
          <template v-if="record.inspectionStatus === 'COMPLETE'">
            <a-divider type="vertical"/>
             <a @click="handlePrint(record)">打印</a>
          </template>
        </span>
      </a-table>
    </div>
    <eam-inspection-order-modal
      ref="modalForm"
      @ok="modalFormOk"
    ></eam-inspection-order-modal>
    <eam-inspection-order-modal ref="modalForm" @ok="modalFormOk"/>
    <inspection-order-handle
      ref="modalFormXq"
      :selectShenpiData="selectInspectionOrderXqData"
    />
    <inspection-order-handle ref="modalFormXq" :selectShenpiData="selectInspectionOrderXqData"/>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import EamInspectionOrderModal from './modules/EamInspectionOrderModal'
import { deleteAction, getAction } from '@api/manage'
import InspectionOrderHandle from '../../flowable/workflow/InspectionOrder/InspectionOrderHandle'
import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import EamInspectionOrderModal from './modules/EamInspectionOrderModal'
  import { deleteAction, getAction } from '@api/manage'
  import InspectionOrderHandle from '../../flowable/workflow/InspectionOrder/InspectionOrderHandle'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
export default {
  name: 'EamInspectionOrderList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    InspectionOrderHandle,
    EamInspectionOrderModal,
    LxSearchEquipmentSelect,
  },
  props: {
    isDisplayOperation: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      description: 'eam_inspection_order管理页面',
      disableMixinCreated: true,
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
  export default {
    name: 'EamInspectionOrderList',
    mixins: [JeecgListMixin, mixinDevice],
    components: {
      InspectionOrderHandle,
      EamInspectionOrderModal,
      LxSearchEquipmentSelect
    },
    props: {
      isDisplayOperation: {
        type: Boolean,
        default: true
      }
    },
    data() {
      return {
        description: 'eam_inspection_order管理页面',
        disableMixinCreated: true,
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '工单号',
            align: 'center',
            dataIndex: 'orderNum'
          },
          {
            title: '统一编码',
            align: 'center',
            dataIndex: 'equipmentCode'
          },
          {
            title: '设备名称',
            align: 'center',
            dataIndex: 'equipmentName'
          },
          {
            title: '规范名称',
            align: 'center',
            dataIndex: 'standardId_dictText'
          },
          {
            title: '点检日期',
            align: 'center',
            dataIndex: 'inspectionDate',
            customRender: function(text) {
              return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
            }
          },
          {
            title: '点检过期日期',
            align: 'center',
            dataIndex: 'expirationTime',
            customRender: function(text) {
              return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
            }
          },
          {
            title: '创建方式',
            align: 'center',
            dataIndex: 'creationMethod_dictText'
          },
          {
            title: '点检状态',
            align: 'center',
            dataIndex: 'inspectionStatus_dictText'
          },
          {
            title: '点检人',
            align: 'center',
            dataIndex: 'operator_dictText'
          },
          {
            title: '点检时间',
            align: 'center',
            dataIndex: 'operateTime'
          },
          {
            title: '管理员确认',
            align: 'center',
            dataIndex: 'confirmUser_dictText'
          },
          {
            title: '确认时间',
            align: 'center',
            dataIndex: 'confirmTime'
          },
          {
            title: '确认意见',
            align: 'center',
            dataIndex: 'confirmComment'
          }
        ],
        url: {
          list: '/eam/eamInspectionOrder/list',
          cancelInspectionOrder: '/eam/eamInspectionOrder/cancelInspectionOrder',
          deleteBatch: '/eam/eamInspectionOrder/deleteBatch',
          exportXlsUrl: '/eam/eamInspectionOrder/exportXls',
          importExcelUrl: 'eam/eamInspectionOrder/importExcel',
          receiveInspectionOrder: 'eam/eamInspectionOrder/receiveInspectionOrder',
          cancelOrReceive: 'eam/eamInspectionOrder/cancelOrReceive'
        },
        {
          title: '工单号',
          align: 'center',
          dataIndex: 'orderNum'
        },
        {
          title: '设备编号',
          align: 'center',
          dataIndex: 'equipmentCode'
        },
        {
          title: '设备名称',
          align: 'center',
          dataIndex: 'equipmentName'
        },
        {
          title: '标准名称',
          align: 'center',
          dataIndex: 'standardId_dictText'
        },
        {
          title: '点检日期',
          align: 'center',
          dataIndex: 'inspectionDate',
          customRender: function (text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '点检过期日期',
          align: 'center',
          dataIndex: 'expirationTime',
          customRender: function (text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '创建方式',
          align: 'center',
          dataIndex: 'creationMethod_dictText'
        },
        {
          title: '点检状态',
          align: 'center',
          dataIndex: 'inspectionStatus_dictText'
        },
        {
          title: '点检人',
          align: 'center',
          dataIndex: 'operator_dictText'
        },
        {
          title: '点检时间',
          align: 'center',
          dataIndex: 'operateTime',
        },
        {
          title: '管理员确认',
          align: 'center',
          dataIndex: 'confirmUser_dictText'
        },
        {
          title: '确认时间',
          align: 'center',
          dataIndex: 'confirmTime',
        },
        {
          title: '确认意见',
          align: 'center',
          dataIndex: 'confirmComment',
        }
      ],
      url: {
        list: '/eam/eamInspectionOrder/list',
        cancelInspectionOrder: '/eam/eamInspectionOrder/cancelInspectionOrder',
        deleteBatch: '/eam/eamInspectionOrder/deleteBatch',
        exportXlsUrl: '/eam/eamInspectionOrder/exportXls',
        importExcelUrl: 'eam/eamInspectionOrder/importExcel',
        receiveInspectionOrder: 'eam/eamInspectionOrder/receiveInspectionOrder',
        cancelOrReceive: 'eam/eamInspectionOrder/cancelOrReceive'
        dictOptions: {},
        superFieldList: [],
        selectInspectionOrderXqData: {}
      }
    },
    created() {
      if (!this.isDisplayOperation) {
        return
      }
      const operationColumn = {
        title: '操作',
        dataIndex: 'action',
        align: 'center',
        fixed: 'right',
        width: 200,
        scopedSlots: { customRender: 'action' }
      }
      this.columns = [...this.columns, operationColumn]
      this.loadData(1)
    },
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    methods: {
      initDictConfig() {
      },
      dictOptions: {},
      superFieldList: [],
      selectInspectionOrderXqData: {}
    }
  },
  created() {
    if (!this.isDisplayOperation) {
      return
    }
    const operationColumn = {
      title: '操作',
      dataIndex: 'action',
      align: 'center',
      fixed: 'right',
      width: 200,
      scopedSlots: { customRender: 'action' }
    }
    this.columns = [...this.columns, operationColumn]
    this.loadData(1)
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {
    initDictConfig() {
    },
    //详情
    handleDetail: function (record) {
      this.selectInspectionOrderXqData = Object.assign({}, record)
      this.$refs.modalFormXq.visible = true
      this.$refs.modalFormXq.title = '详情'
      this.$refs.modalFormXq.disableSubmit = true
      this.$refs.modalFormXq.getAllApproveData(record)
      this.$refs.modalFormXq.getBasicInformation({ ...record, dataId: record.id })
    },
    handleInspection(id) {
      if (!this.url.receiveInspectionOrder) {
        this.$message.error('请设置url.receiveInspectionOrder!')
        return
      }
      var that = this
      getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => {
        if (res.success) {
          that.$notification.success({
            message: '消息',
            description: res.message
          })
          that.loadData()
        } else {
          // that.$message.warning(res.message);
          that.$notification.warning({
            message: '消息',
            description: res.message
          })
        }
      })
    },
    handleOrReceive(id) {
      if (!this.url.cancelInspectionOrder) {
        this.$message.error('请设置url.cancelInspectionOrder!')
        return
      }
      var that = this
      getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => {
        if (res.success) {
          that.$notification.success({
            message: '消息',
            description: res.message
          })
          that.loadData()
        } else {
          // that.$message.warning(res.message);
          that.$notification.warning({
            message: '消息',
            description: res.message
          })
        }
      })
    },
    batchZf(type) {
      if (this.selectedRowKeys.length <= 0) {
        this.$notification.warning({
          message: '消息',
          description: '请选择一条记录'
        })
      } else {
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ','
      //详情
      handleDetail: function(record) {
        this.selectInspectionOrderXqData = Object.assign({}, record)
        this.$refs.modalFormXq.visible = true
        this.$refs.modalFormXq.title = '详情'
        this.$refs.modalFormXq.disableSubmit = true
        this.$refs.modalFormXq.getAllApproveData(record)
        this.$refs.modalFormXq.getBasicInformation({ ...record, dataId: record.id })
      },
      handleInspection(id) {
        if (!this.url.receiveInspectionOrder) {
          this.$message.error('请设置url.receiveInspectionOrder!')
          return
        }
        var that = this
        this.$confirm({
          title: '确认作废',
          content: '是否作废选中数据,只有待点检状态的数据才可作废成功?',
          onOk: function () {
            that.loading = true
            getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => {
              if (res.success) {
                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
        getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => {
          if (res.success) {
            that.$notification.success({
              message: '消息',
              description: res.message
            })
            that.loadData()
          } else {
            // that.$message.warning(res.message);
            that.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        })
      }
    },
    batchLq(type) {
      if (this.selectedRowKeys.length <= 0) {
        this.$notification.warning({
          message: '消息',
          description: '请选择一条记录'
        })
      } else {
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ','
      },
      handleOrReceive(id) {
        if (!this.url.cancelInspectionOrder) {
          this.$message.error('请设置url.cancelInspectionOrder!')
          return
        }
        var that = this
        this.$confirm({
          title: '确认领取',
          content: '是否领取选中数据,只有待点检状态的数据才可领取成功?',
          onOk: function () {
            that.loading = true
            getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => {
              if (res.success) {
                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
        getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => {
          if (res.success) {
            that.$notification.success({
              message: '消息',
              description: res.message
            })
            that.loadData()
          } else {
            // that.$message.warning(res.message);
            that.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        })
      }
    },
    onInspectionDateChange: function (value, dateString) {
      this.queryParam.inspectionDateBegin = dateString[0]
      this.queryParam.inspectionDateEnd = dateString[1]
    },
      },
      batchZf(type) {
        if (this.selectedRowKeys.length <= 0) {
          this.$notification.warning({
            message: '消息',
            description: '请选择一条记录'
          })
        } 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
              getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => {
                if (res.success) {
                  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
              })
            }
          })
        }
      },
      batchLq(type) {
        if (this.selectedRowKeys.length <= 0) {
          this.$notification.warning({
            message: '消息',
            description: '请选择一条记录'
          })
        } 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
              getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => {
                if (res.success) {
                  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
              })
            }
          })
        }
      },
      onInspectionDateChange: function(value, dateString) {
        this.queryParam.inspectionDateBegin = dateString[0]
        this.queryParam.inspectionDateEnd = dateString[1]
      },
    handlePrint(record) {
      let href = `${window._CONFIG['domianURL']}/jmreport/view/1094871242505912320?id=` + record.id + `&equipmentId=` + record.equipmentId + `&inspectionDate=` + record.inspectionDate; //网站链接
      window.open(href, "_blank");
    },
      handlePrint(record) {
        let href = `${window._CONFIG['domianURL']}/jmreport/view/1094871242505912320?id=` + record.id + `&equipmentId=` + record.equipmentId + `&inspectionDate=` + record.inspectionDate //网站链接
        window.open(href, '_blank')
      }
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
  @import '~@assets/less/common.less';
</style>
src/views/eam/maintenance/modules/EamInspectionOrderModal.vue
@@ -1,40 +1,31 @@
<template>
  <j-modal
    :title="title"
    :width="1200"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    centered
    :mask-closable="false"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen centered
           :mask-closable="false" @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item prop="standardCode" label="工单号">
              <a-input placeholder="工单号自动生成" v-model="model.orderNum" readOnly/>
              <a-input placeholder="工单号自动生成" v-model="model.orderNum" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item prop="equipmentId" label="设备编号">
              <MaintenanceEquipmentSelect placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId"
            <a-form-model-item prop="equipmentId" label="统一编码">
              <MaintenanceEquipmentSelect placeholder="请输入统一编码或名称搜索" v-model="model.equipmentId"
                                          :maintenanceCategory="maintenanceCategory" :disabled="disabled"
                                          @autocompleteForm="autocompleteForm"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item prop="standardName" label="标准名称">
            <a-form-model-item prop="standardName" label="规范名称">
              <a-input placeholder="选择设备后自动带出" readOnly v-model="model.standardName"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item prop="standardCode" label="标准编码">
            <a-form-model-item prop="standardCode" label="规范编码">
              <a-input placeholder="选择设备后自动带出" readOnly v-model="model.standardCode"/>
            </a-form-model-item>
          </a-col>
@@ -73,19 +64,9 @@
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <j-vxe-table
            ref="editableDetailTable"
            :rowNumber="true"
            :rowSelection="true"
            :bordered="true"
            :alwaysEdit="true"
            :toolbar="true"
            keep-source
            :height="300"
            :loading="detail.loading"
            :dataSource="detail.dataSource"
            :columns="detail.columns"
            style="margin-top: 8px;"/>
          <j-vxe-table ref="editableDetailTable" :rowNumber="true" :rowSelection="true" :bordered="true"
                       :alwaysEdit="true" :toolbar="true" keep-source :height="300" :loading="detail.loading"
                       :dataSource="detail.dataSource" :columns="detail.columns" style="margin-top: 8px;"/>
        </a-row>
      </a-form-model>
    </a-spin>
@@ -123,16 +104,16 @@
        disabled: false,
        validatorRules: {
          // standardName: [
          //   { required: true, message: '请输入标准名称!' }
          //   { required: true, message: '请输入规范名称!' }
          // ],
          inspectionDate: [
            { required: true, message: '请选择点检日期!' }
            { required: true, message: '请选择点检日期', trigger: 'change' }
          ],
          // maintenancePeriod: [
          //   { required: true, message: '请输入保养周期,单位:天!' }
          // ],
          equipmentId: [
            { required: true, message: '请选择设备!' }
            { required: true, message: '请选择设备', trigger: 'change' }
          ]
        },
        url: {
@@ -157,7 +138,8 @@
              width: '10%',
              align: 'center',
              validateRules: [
                { required: true, unique: true, message: '序号不能重复' }
                { required: true, message: '请输入${title}' },
                { unique: true, message: '序号不能重复' }
              ]
            },
            {
@@ -167,7 +149,7 @@
              width: '20%',
              align: 'center',
              validateRules: [
                { required: true, message: '保养项不能为空!' }
                { required: true, message: '请输入${title}' }
              ]
            },
            {
@@ -177,14 +159,12 @@
              width: '30%',
              align: 'center',
              validateRules: [
                { required: true, message: '保养要求不能为空!' }
                { required: true, message: '请输入${title}' }
              ]
            }
          ]
        }
      }
    },
    created() {
    },
    methods: {
      add() {