zhangherong
2025-03-04 fe7c43f16b81a6352b74d3cac84c891000f41659
src/views/eam/DailyInspectionOrderList.vue
@@ -1,7 +1,7 @@
<template>
  <a-card
    :bordered="false"
    title="自主维护点检工单"
    title=""
  >
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
@@ -14,44 +14,74 @@
            :md="6"
            :sm="8"
          >
            <a-form-item label="点检工单编码">
            <a-form-item label="统一编号">
              <a-input
                placeholder="请输入点检工单编码"
                v-model="queryParam.num"
                placeholder="请输入统一编号"
                v-model="queryParam.equipmentNum"
              ></a-input>
            </a-form-item>
          </a-col>
          <!-- <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="点检方法名称">
              <j-input
                placeholder="请输入点检方法名称"
                v-model="queryParam.name"
              ></j-input>
            </a-form-item>
          </a-col> -->
          <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            <a-form-item label="保养工单编码">
              <a-input
                placeholder="请输入保养工单编码"
                v-model="queryParam.num"
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="6">
            <a-form-item
              label="使用部门"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
              <j-dict-select-tag
                dictCode="sys_depart,depart_name,id"
                placeholder="请输入使用部门"
                v-model="queryParam.useDepartId"
              />
            </a-form-item>
          </a-col>
          <a-col :span="6">
            <a-form-item
              label="状态"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <j-dict-select-tag
                dictCode="daily_inspection_standard_status"
                placeholder="请选择状态"
                v-model="queryParam.status"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="6">
            <a-form-item
              label="责任班组"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <j-dict-select-tag
                dictCode="mom_base_team,name,id,status='1' and del_flag='0'"
                placeholder="请选择责任班组"
                v-model="queryParam.teamId"
              />
            </a-form-item>
          </a-col>
          <a-col :span="7">
            <a-form-item label="点检时间">
              <a-range-picker
                style="width: 100%;"
                format="YYYY-MM-DD HH:mm:ss"
                v-model="finishTime"
                @change="timeChange"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
@@ -66,6 +96,18 @@
        icon="plus"
        v-has="'dailyInspectionOrder:add'"
      >新增</a-button>
      <a-button
        type="primary"
        @click="searchQuery"
        icon="search"
        style="margin-left: 8px"
      >查询</a-button>
      <a-button
        type="info"
        @click="searchReset"
        icon="reload"
        style="margin-left: 8px"
      >重置</a-button>
      <!-- <a-button
        type="primary"
        icon="download"
@@ -120,6 +162,7 @@
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange"
        :rowClassName="tableRowClass"
      >
        <!-- :rowSelection="rowSelection" -->
        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
@@ -297,6 +340,7 @@
import InspectionOrderExeModal from './modules/dailyInspectionOrder/InspectionOrderExeModal'
import DailyInspectionOrderExeDrawer from './modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer'
import { getAction, postAction, requestPut } from '@/api/manage'
import moment from 'moment'
export default {
  name: 'DailyInspectionOrderList',
@@ -309,7 +353,8 @@
  },
  data() {
    return {
      description: '日常点检工单',
      description: '自主维护点检工单',
      finishTime: [],
      // 表头
      columns: [
        {
@@ -330,9 +375,21 @@
          scopedSlots: { customRender: 'num' }
        },
        {
          title: '统一编码',
          align: "center",
          dataIndex: 'equipmentNum'
        },
        {
          title: '状态',
          align: "center",
          width: 100,
          dataIndex: 'statusName'
        },
        {
          title: '点检周期',
          align: "center",
          width: 100,
          dataIndex: 'inspectionCycleName'
        },
        // {
        //   title: '点检日期',
@@ -355,11 +412,7 @@
        //   align: "center",
        //   dataIndex: 'inspectionDeadline',
        // },
        {
          title: '统一编码',
          align: "center",
          dataIndex: 'equipmentNum'
        },
        {
          title: '设备名称',
          align: "center",
@@ -397,11 +450,7 @@
        //   align: "center",
        //   dataIndex: 'inspectionStandardNum'
        // },
        {
          title: '点检周期',
          align: "center",
          dataIndex: 'inspectionCycleName'
        },
        // {
        //   title: '派工方式',
        //   align: "center",
@@ -443,11 +492,11 @@
        //   align: "center",
        //   dataIndex: 'createBy'
        // },
        {
          title: '创建日期',
          align: "center",
          dataIndex: 'createTime',
        },
        // {
        //   title: '创建日期',
        //   align: "center",
        //   dataIndex: 'createTime',
        // },
        {
          title: '操作',
@@ -506,7 +555,7 @@
    },
    handleOrderExe(record) {
      this.$refs.DailyInspectionOrderExeDrawer.visible = true
      this.$refs.DailyInspectionOrderExeDrawer.title = '日常点检工单执行'
      this.$refs.DailyInspectionOrderExeDrawer.title = '自主维护点检执行'
      this.$refs.DailyInspectionOrderExeDrawer.handleShow(record)
      if (record.status === '3') {
        this.$refs.DailyInspectionOrderExeDrawer.buttonDistable = true//保存、暂存、报工
@@ -591,10 +640,53 @@
      })
    },
    searchReset() {
      this.queryParam = {}
      this.finishTime = []
      this.loadData(1);
    },
    timeChange() {
      this.queryParam.inspectionStartTime = moment(this.finishTime[0]).format("YYYY-MM-DD HH:mm:ss")
      this.queryParam.inspectionEndTime = moment(this.finishTime[1]).format("YYYY-MM-DD HH:mm:ss")
    },
    //预警颜色
    tableRowClass(record, index) {
      if (("1" == record.status || "2" == record.status) && "1日" == record.inspectionCycleName) {
        if (record.redWarningTime < record.currentDateTime) {
          return 'error'
        }
      }
    },
  }
}
</script>
<style scoped>
<style>
@import '~@assets/less/common.less';
.frozenRowClass {
  color: #c9c9c9;
  font-weight: bold;
}
.success {
  color: green;
}
.error {
  color: red;
  font-weight: bold;
}
.yellow {
  color: rgba(255, 255, 0, 0.443);
  font-weight: bold;
}
.fontweight {
  font-weight: bold;
}
.ant-table-tbody .red {
  background-color: red !important;
}
</style>