“linengliang”
2023-11-18 ad78578ae893565ff723a22c3e2a165d5ccf534d
src/views/eam/RepairOrderList.vue
@@ -36,7 +36,7 @@
                allow-clear
                placeholder="请选择工单状态"
                :triggerChange="true"
                dictCode="repair_order_status"
                dictCode="true_repair_status"
                v-model="queryParam.status"
              />
            </a-form-item>
@@ -147,6 +147,22 @@
              />
            </a-form-item>
          </a-col>
          <a-col
            :xl="6"
            :lg="7"
            :md="8"
            :sm="24"
          >
            <a-form-item label="维修状态">
              <j-dict-select-tag
                allow-clear
                placeholder="请选择维修状态"
                :triggerChange="true"
                dictCode="repair_status"
                v-model="queryParam.repairOrderUda1"
              />
            </a-form-item>
          </a-col>
          </a-row>
          <!-- <a-row :gutter="24">
            <a-col 
@@ -248,6 +264,7 @@
        :loading="loading"
        @change="handleTableChange"
        :customRow="clickThenSelect"
        :rowClassName="tableRowClass"
      >
        <span slot="jell" slot-scope="text">
            <j-ellipsis :value="text" :length="8" />
@@ -442,6 +459,7 @@
    </repair-order-excute-drawer>
    <fault-report-repair
      ref="FaultReportRepair"
      @ok="modalFormOk"
    ></fault-report-repair>
  </a-card>
</template>
@@ -464,16 +482,7 @@
import FaultDescriptionList from './FaultDescriptionList'
import FaultReportRepair from './modules/repairorder/moudles/select/FaultReportRepair.vue'
import store from '@/store'
import {
  ACCESS_TOKEN,
  USER_NAME,
  USER_INFO,
  USER_AUTH,
  SYS_BUTTON_AUTH,
  UI_CACHE_DB_DICT_DATA,
  TENANT_ID,
  CACHE_INCLUDED_ROUTES
} from '@/store/mutation-types'
import dayjs from 'dayjs'
export default {
  name: "RepairOrderList",
  mixins: [JeecgListMixin],
@@ -492,6 +501,14 @@
    FaultDescriptionList,
    FaultReportRepair,
    store
  },
  mounted(){
    let intervalId = setInterval(() => {
        this.loadData();
    }, 600*1000); // 1000毫秒,即1秒
    onUnmounted(() => {
      clearInterval(intervalId);
    });
  },
  data() {
    return {
@@ -518,6 +535,14 @@
          title: '状态',
          align: "center",
          dataIndex: 'status_dictText'
        },
        {
          title: '维修状态',
          align: "center",
          dataIndex: 'repairOrderUda1_dictText',
          customRender:function (t,r,index) {
              return t===null||r.repairOrderUda1===null?'/':t;
          }
        },
        {
          title: '单据号',
@@ -578,16 +603,26 @@
          align: "center",
          dataIndex: 'responsibilityId_dictText'
        },
        {
          title: '派工方式',
          align: "center",
          dataIndex: 'dispatchMethod_dictText'
        },
        // {
        //   title: '派工方式',
        //   align: "center",
        //   dataIndex: 'dispatchMethod_dictText'
        // },
        // {
        //   title: '特种设备',
        //   align: "center",
        //   dataIndex: 'specificEquipment_dictText'
        // },
        {
          title: '故障时间',
          align: "center",
          dataIndex: 'faultTime'
        },
        {
          title: '报修人',
          align: "center",
          dataIndex: 'errUda2'
        },
        {
          title: '故障描述',
          align: "center",
@@ -617,11 +652,6 @@
          dataIndex: 'preventiveMeasure'
        },
        // {
        //   title: '故障时间',
        //   align: "center",
        //   dataIndex: 'faultTime'
        // },
        // {
        //   title: '故障照片',
        //   align: "center",
        //   dataIndex: 'photo',
@@ -637,31 +667,31 @@
        //   align: "center",
        //   dataIndex: 'workingHourQuota'
        // },
        {
          title: '实际工时',
          align: "center",
          dataIndex: 'actualHour'
        },
        {
          title: '计划开始时间',
          align: "center",
          dataIndex: 'planStartTime'
        },
        {
          title: '计划结束时间',
          align: "center",
          dataIndex: 'planEndTime'
        },
        {
          title: '实际开始时间',
          align: "center",
          dataIndex: 'actualStartTime'
        },
        {
          title: '实际结束时间',
          align: "center",
          dataIndex: 'actualEndTime'
        },
        // {
        //   title: '实际工时',
        //   align: "center",
        //   dataIndex: 'actualHour'
        // },
        // {
        //   title: '计划开始时间',
        //   align: "center",
        //   dataIndex: 'planStartTime'
        // },
        // {
        //   title: '计划结束时间',
        //   align: "center",
        //   dataIndex: 'planEndTime'
        // },
        // {
        //   title: '实际开始时间',
        //   align: "center",
        //   dataIndex: 'actualStartTime'
        // },
        // {
        //   title: '实际结束时间',
        //   align: "center",
        //   dataIndex: 'actualEndTime'
        // },
        {
          title: '创建人',
          align: "center",
@@ -915,12 +945,30 @@
    },
    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()) {
          return 'error'
        } else if(dayjs(record.faultTime).add(7,'day')<dayjs()){
          return 'primary'
        }
      }
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.error {
  color: red;
  font-weight: bold;
}
.primary {
  color: rgb(255, 0, 251);
  font-weight: bold;
}
</style>