qushaowei
2024-01-11 240c74ffb2b98faddf76648116ca9eeb61ee2cde
src/views/eam/EquipmentListOfAll.vue
@@ -1,12 +1,19 @@
<template>
  <a-card :bordered="false" title="所有设备">
  <a-card
    :bordered="false"
    title="所有设备"
  >
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24" style="margin-bottom: 1%;">
          <a-col
          :span="24"
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
          >
        <a-row
          :gutter="24"
          style="margin-bottom: 1%;"
        >
          <a-col :span="24">
          <a-form-item 
          label="统一编号群"
          :labelCol="labelCol"
@@ -34,9 +41,7 @@
              />
            </a-form-item>
          </a-col>
          <a-col
          :span="6"
          >
          <a-col :span="6">
            <a-form-item 
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
@@ -48,9 +53,7 @@
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col
          :span="6"
          >
          <a-col :span="6">
            <a-form-item 
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
@@ -223,7 +226,12 @@
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
            <j-date  style="width: 100%;" placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.warrantyStart"></j-date>
              <j-date
                style="width: 100%;"
                placeholder="请选择开始日期"
                class="query-group-cust"
                v-model="queryParam.warrantyStart"
              ></j-date>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
@@ -232,7 +240,12 @@
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
            <j-date style="width: 100%;" placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.warrantyEnd"></j-date>
              <j-date
                style="width: 100%;"
                placeholder="请选择结束日期"
                class="query-group-cust"
                v-model="queryParam.warrantyEnd"
              ></j-date>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -251,20 +264,64 @@
        @click="searchReset"
        icon="reload"
      >重置</a-button>
      <a-button @click="handleAdd" type="primary" icon="plus" v-has="'equipmentAccount:add&delete&import&Edit'">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('设备台账')" v-has="'equipmentAccount:outport'">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import"  v-has="'equipmentAccount:add&delete&import&Edit'">导入</a-button>
      <a-button
        @click="handleAdd"
        type="primary"
        icon="plus"
        v-has="'equipmentAccount:add&delete&import&Edit'"
      >新增</a-button>
      <a-button
        type="primary"
        icon="download"
        @click="handleExportXls('设备台账')"
        v-has="'equipmentAccount:outport'"
      >导出</a-button>
      <a-upload
        name="file"
        :showUploadList="false"
        :multiple="false"
        :headers="tokenHeader"
        :action="importExcelUrl"
        @change="handleImportExcel"
      >
        <a-button
          type="primary"
          icon="import"
          v-has="'equipmentAccount:add&delete&import&Edit'"
        >导入</a-button>
      </a-upload>
      <a-button :disabled="selectedRowKeys.length==0" @click="handleUpdateABC" type="primary" icon="font-colors" v-has="'equipmentAccount:add&delete&import&Edit'">ABC标识变更</a-button>
      <a-button :disabled="selectedRowKeys.length==0" @click="handleUpdateWarranty" type="primary" icon="calendar" v-has="'equipmentAccount:add&delete&import&Edit'">质保期变更</a-button>
      <a-button  @click="handleUpdateKeyEquipment" type="primary" icon="calendar" v-has="'equipmentAccount:add&delete&import&Edit'">设置关键设备标识</a-button>
      <a-button
        :disabled="selectedRowKeys.length==0"
        @click="handleUpdateABC"
        type="primary"
        icon="font-colors"
        v-has="'equipmentAccount:add&delete&import&Edit'"
      >ABC标识变更</a-button>
      <a-button
        :disabled="selectedRowKeys.length==0"
        @click="handleUpdateWarranty"
        type="primary"
        icon="calendar"
        v-has="'equipmentAccount:add&delete&import&Edit'"
      >质保期变更</a-button>
      <a-button
        @click="handleUpdateKeyEquipment"
        type="primary"
        icon="calendar"
        v-has="'equipmentAccount:add&delete&import&Edit'"
      >设置关键设备标识</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
      <div
        class="ant-alert ant-alert-info"
        style="margin-bottom: 16px;"
      >
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
        <a
          style="margin-left: 24px"
          @click="onClearSelected"
        >清空</a>
      </div>
      <a-table
@@ -279,24 +336,48 @@
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}"
        :customRow="clickThenSelect"
        @change="handleTableChange">
        @change="handleTableChange"
      >
        <template slot="htmlSlot" slot-scope="text">
        <template
          slot="htmlSlot"
          slot-scope="text"
        >
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        <template
          slot="imgSlot"
          slot-scope="text,record"
        >
          <span
            v-if="!text"
            style="font-size: 12px;font-style: italic;"
          >无图片</span>
          <img
            v-else
            :src="getImgView(text)"
            :preview="record.id"
            height="25px"
            alt=""
            style="max-width:80px;font-size: 12px;font-style: italic;"
          />
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
        <template
          slot="fileSlot"
          slot-scope="text"
        >
          <span
            v-if="!text"
            style="font-size: 12px;font-style: italic;"
          >无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            @click="downloadFile(text)"
          >
            下载
          </a-button>
        </template>
@@ -411,10 +492,16 @@
            <a-menu-item>
              <a @click="equipmentResumeShow(record)">设备履历</a>
            </a-menu-item>
            <a-menu-item v-has="'accountSons:add&edit&delete&submit'" v-if="record.processParameters==1">
              <a-menu-item
                v-has="'accountSons:add&edit&delete&submit'"
                v-if="record.processParameters==1"
              >
              <a @click="editProcess(record)">工艺参数维护</a>
            </a-menu-item>
            <a-menu-item v-has="'accountSons:add&edit&delete&submit'" v-if="record.precisionParameters==1">
              <a-menu-item
                v-has="'accountSons:add&edit&delete&submit'"
                v-if="record.precisionParameters==1"
              >
              <a @click="editPrecision(record)">精度参数维护</a>
            </a-menu-item>
            <a-menu-item  v-has="'equipmentAccount:add&delete&import&Edit'">
@@ -443,46 +530,100 @@
    ></equipment-resume-drawer>
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="工艺参数" key="1" >
      <a-tab-pane
        tab="工艺参数"
        key="1"
      >
        <EquipmentProcessParametersList 
        :mainId="selectedMainId" 
        :isOpen="isOpenProcess"
        />
      </a-tab-pane>
      <a-tab-pane tab="设备精度" key="2" forceRender>
      <a-tab-pane
        tab="设备精度"
        key="2"
        forceRender
      >
        <EquipmentPrecisionParametersList 
        :isOpen="isOpenPrecision"
        :mainId="precisionParametersTemplateId" />
          :mainId="precisionParametersTemplateId"
        />
      </a-tab-pane>
      <a-tab-pane tab="设备文档" key="3" forceRender>
      <a-tab-pane
        tab="设备文档"
        key="3"
        forceRender
      >
        <EquipmentDocumentList :mainId="selectedMainId" />
      </a-tab-pane>
      <a-tab-pane tab="备件" key="4" forceRender>
      <a-tab-pane
        tab="备件"
        key="4"
        forceRender
      >
        <EquipmentSpareParts :mainId="selectedMainId" />
      </a-tab-pane>
      <a-tab-pane tab="ABC标识变更记录" key="5" forceRender>
      <a-tab-pane
        tab="ABC标识变更记录"
        key="5"
        forceRender
      >
        <equipment-update-ABC-list :mainId="selectedMainId" />
      </a-tab-pane>
      <a-tab-pane tab="质保期变更" key="6" forceRender>
      <a-tab-pane
        tab="质保期变更"
        key="6"
        forceRender
      >
        <equipment-update-warranty-list :mainId="selectedMainId" />
      </a-tab-pane>
      <a-tab-pane tab="日保标准" key="7" forceRender>
      <a-tab-pane
        tab="日保标准"
        key="7"
        forceRender
      >
        <daily-maintenance-list :mainId="selectedMainId"></daily-maintenance-list>
      </a-tab-pane>
      <a-tab-pane tab="二保标准" key="8" forceRender>
      <a-tab-pane
        tab="二保标准"
        key="8"
        forceRender
      >
        <second-maintenance-list :mainId="selectedMainId"></second-maintenance-list>
      </a-tab-pane>
      <a-tab-pane tab="三保标准" key="9" forceRender>
      <a-tab-pane
        tab="三保标准"
        key="9"
        forceRender
      >
        <third-maintenance-list :mainId="selectedMainId"></third-maintenance-list>
      </a-tab-pane>
    </a-tabs>
    <equipment-modal ref="modalForm" @ok="modalFormOk" :caytegoryParam="caytegoryParam"></equipment-modal>
    <equipment-modal
      ref="modalForm"
      @ok="modalFormOk"
      :caytegoryParam="caytegoryParam"
    ></equipment-modal>
    <process-edit-model ref ="processEditModel"></process-edit-model>
    <precision-edit-model ref ="precisionEditModel"></precision-edit-model>
    <aBC-update-edit-model @ok="modalFormOk" :updateList="selectionRows" ref="updateABC"></aBC-update-edit-model>
    <warranty-update-model  :updateList="selectionRows"  ref="updateWarranty"></warranty-update-model>
    <EquipmentSparePartsModal ref="modalFormSpareParts" @ok="modalFormOk" />
    <key-equipment-update-model @ok="modalFormOk" :updateList="selectionRows" ref="keyEquipmentUpdate"></key-equipment-update-model>
    <aBC-update-edit-model
      @ok="modalFormOk"
      :updateList="selectionRows"
      ref="updateABC"
    ></aBC-update-edit-model>
    <warranty-update-model
      :updateList="selectionRows"
      ref="updateWarranty"
    ></warranty-update-model>
    <EquipmentSparePartsModal
      ref="modalFormSpareParts"
      @ok="modalFormOk"
    />
    <key-equipment-update-model
      @ok="modalFormOk"
      :updateList="selectionRows"
      ref="keyEquipmentUpdate"
    ></key-equipment-update-model>
  </a-card>
</template>
@@ -788,8 +929,8 @@
        /* 分页参数 */
        ipagination:{
          current: 1,
          pageSize: 5,
          pageSizeOptions: ['5', '10', '50'],
        pageSize: 20,
        pageSizeOptions: ['5', '10', '20', '50'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " 共" + total + "条"
          },
@@ -975,5 +1116,5 @@
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
@import '~@assets/less/common.less';
</style>