qushaowei
2024-01-11 240c74ffb2b98faddf76648116ca9eeb61ee2cde
src/views/eam/RepairOrderList.vue
@@ -8,14 +8,17 @@
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
      <a-row :gutter="24" style="margin-bottom: 1%;">
        <a-row
          :gutter="24"
          style="margin-bottom: 1%;"
        >
          <a-col
            :xl="24"
            :lg="7"
            :md="8"
            :sm="24"
          >
          <a-form-item label="统一编号群">
            <a-form-item label="统一编号群">
              <a-textarea
                placeholder="请输入所有统一编码,须用空格隔开,否则可能查询出错误信息"
                v-model="queryParam.nums"
@@ -82,28 +85,27 @@
            </span>
          </a-col> -->
          <a-col
              :xl="6"
              :lg="7"
              :md="8"
              :sm="24"
            >
              <a-form-item label="设备名称">
                <a-input
                  placeholder="请输入设备名称"
                  v-model="queryParam.equipmentName"
                ></a-input>
              </a-form-item>
            </a-col>
        </a-row>
          <a-row :gutter="24">
            <a-col
            :xl="6"
              :lg="7"
              :md="8"
              :sm="24">
            <a-form-item
            label="设备所属分类"
            >
            :lg="7"
            :md="8"
            :sm="24"
          >
            <a-form-item label="设备名称">
              <a-input
                placeholder="请输入设备名称"
                v-model="queryParam.equipmentName"
              ></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col
            :xl="6"
            :lg="7"
            :md="8"
            :sm="24"
          >
            <a-form-item label="设备所属分类">
              <j-dict-select-tag
                dictCode="mom_eam_equipment_category,name,id"
                placeholder="请输入搜索条件并选择"
@@ -111,15 +113,13 @@
              />
            </a-form-item>
          </a-col>
          <a-col
          :xl="6"
          <a-col
            :xl="6"
            :lg="7"
              :md="8"
              :sm="24"
            :md="8"
            :sm="24"
          >
            <a-form-item
              label="工区"
            >
            <a-form-item label="工区">
              <j-dict-select-tag
                allow-clear
                placeholder="请选择资工区"
@@ -130,14 +130,12 @@
            </a-form-item>
          </a-col>
          <a-col
          :xl="6"
            :xl="6"
            :lg="7"
              :md="8"
              :sm="24"
            :md="8"
            :sm="24"
          >
            <a-form-item
              label="是否关键设备"
            >
            <a-form-item label="是否关键设备">
              <j-dict-select-tag
                allow-clear
                placeholder="请选择是否关键设备"
@@ -163,8 +161,8 @@
              />
            </a-form-item>
          </a-col>
          </a-row>
          <!-- <a-row :gutter="24">
        </a-row>
        <!-- <a-row :gutter="24">
            <a-col 
            :xl="6"
            :lg="7"
@@ -187,16 +185,16 @@
    </div>
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-dropdown>
      <!-- <a-dropdown>
        <a-menu slot="overlay">
          <!-- <a-menu-item
          <a-menu-item
            key="1"
            @click="handleAddPre(1)"
          ><a-icon type="smile" />自建</a-menu-item> -->
          <!-- <a-menu-item
          ><a-icon type="smile" />自建</a-menu-item>
          <a-menu-item
            key="2"
            @click="handleAddPre(2)"
          ><a-icon type="copy" />参照故障报修单</a-menu-item> -->
          ><a-icon type="copy" />参照故障报修单</a-menu-item>
          <a-menu-item
            key="2"
            @click="handleAddPre(3)"
@@ -206,7 +204,7 @@
          type="primary"
          icon="plus"
        >新增</a-button>
      </a-dropdown>
      </a-dropdown> -->
      <a-button
        type="primary"
@@ -226,10 +224,10 @@
        :disabled="selectionRows.length==0"
      >派工</a-button>
      <a-button
          type="primary"
          icon="plus"
          @click="getReports"
          v-has="'repair:accept'"
        type="primary"
        icon="plus"
        @click="getReports"
        v-has="'repair:accept'"
      >领取</a-button>
      <!-- <a-button type="primary" icon="download" @click="handleExportXls('维修工单')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
@@ -258,7 +256,6 @@
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{ x: 'calc(2700px + 50%)', y: 900 }"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
@@ -266,17 +263,32 @@
        @change="handleTableChange"
        :customRow="clickThenSelect"
        :rowClassName="tableRowClass"
        :scroll="{ x: 'calc(1700px + 50%)', y: 900 }"
      >
        <span slot="jell" slot-scope="text">
            <j-ellipsis :value="text" :length="8" />
        <span
          slot="jell"
          slot-scope="text"
        >
          <j-ellipsis
            :value="text"
            :length="8"
          />
        </span>
        <span
          slot="specificEquipment"
          slot-scope="text"
        >
        <a-icon type="check" style="color: chartreuse;" v-if="text==='0'" />
        <a-icon type="close" v-else style="color:red;"/>
      </span>
          <a-icon
            type="check"
            style="color: chartreuse;"
            v-if="text==='0'"
          />
          <a-icon
            type="close"
            v-else
            style="color:red;"
          />
        </span>
        <span
          slot="num"
          slot-scope="text, record"
@@ -285,8 +297,14 @@
            v-if="record.status === '3' || record.status === '4' ||record.status === '5'  ||record.status === '7' "
            class="lot"
            @click="handleOrderExe(record)"
          ><j-ellipsis :value="text" :length="15"/></a>
          <span v-else> <j-ellipsis :value="text" :length="15"/></span>
          ><j-ellipsis
              :value="text"
              :length="15"
            /></a>
          <span v-else> <j-ellipsis
              :value="text"
              :length="15"
            /></span>
        </span>
        <span
          slot="action"
@@ -425,10 +443,9 @@
        tab="实际用料"
        key="6"
        forceRender
        v-if="false"
      >
      <!-- v-if="!sonsAddStatus&&selectedRowKeys.length!=0" -->
        <!-- v-if="!sonsAddStatus&&selectedRowKeys.length!=0" -->
        <RepairOrderActualMaterialList :mainId="repairOrderActualMaterialMainId" />
      </a-tab-pane>
      <a-tab-pane
@@ -510,10 +527,10 @@
    FaultReportRepair,
    store
  },
  mounted(){
  mounted() {
    let intervalId = setInterval(() => {
        this.loadData();
    }, 600*1000); // 1000毫秒,即1秒
      this.loadData();
    }, 600 * 1000); // 1000毫秒,即1秒
  },
  data() {
    return {
@@ -534,6 +551,7 @@
          title: '关键设备',
          align: "center",
          dataIndex: 'specificEquipment',
          width: 90,
          scopedSlots: { customRender: 'specificEquipment' }
        },
        {
@@ -545,8 +563,8 @@
          title: '维修状态',
          align: "center",
          dataIndex: 'repairOrderUda1_dictText',
          customRender:function (t,r,index) {
              return t===null||r.repairOrderUda1===null?'/':t;
          customRender: function (t, r, index) {
            return t === null || r.repairOrderUda1 === null ? '/' : t;
          }
        },
        {
@@ -599,8 +617,8 @@
          title: '维修班组',
          align: "center",
          dataIndex: 'teamId_dictText',
          scopedSlots: {
            customRender: 'jell'
          scopedSlots: {
            customRender: 'jell'
          }
        },
        {
@@ -632,8 +650,8 @@
          title: '故障描述',
          align: "center",
          dataIndex: 'faultDescription',
          scopedSlots: {
            customRender: 'jell'
          scopedSlots: {
            customRender: 'jell'
          }
        },
        // {
@@ -712,9 +730,10 @@
          dataIndex: 'action',
          align: "center",
          fixed: "right",
          width: 230,
          width: 130,
          scopedSlots: { customRender: 'action' },
        }
      ],
      url: {
        list: "/eam/repairOrder/list",
@@ -731,8 +750,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 + "条"
        },
@@ -948,16 +967,16 @@
      this.onClearSelected()
      this.$refs.FaultDescriptionList.faultId = '-1'
    },
    getReports(){
         this.$refs.FaultReportRepair.title = '故障报修单';
         this.$refs.FaultReportRepair.loadData();
         this.$refs.FaultReportRepair.visible = true;
    getReports() {
      this.$refs.FaultReportRepair.title = '故障报修单';
      this.$refs.FaultReportRepair.loadData();
      this.$refs.FaultReportRepair.visible = true;
    },
    tableRowClass(record, index) {
      if ("2" === record.status) {
        if (record.specificEquipment==='0'&&dayjs(record.faultTime).add(12,'hour')<dayjs()) {
        if (record.specificEquipment === '0' && dayjs(record.faultTime).add(12, 'hour') < dayjs()) {
          return 'error'
        } else if(dayjs(record.faultTime).add(7,'day')<dayjs()){
        } else if (dayjs(record.faultTime).add(7, 'day') < dayjs()) {
          return 'primary'
        }
      }