qushaowei
2023-11-18 eb48d3bada053e26def2a94d46dbe115a5a7bb2f
src/views/eam/DailyInspectionOrderList.vue
@@ -1,7 +1,7 @@
<template>
  <a-card
    :bordered="false"
    title="日保周保工单"
    title="自主维护点检工单"
  >
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
@@ -129,11 +129,11 @@
          slot-scope="text, record"
        >
          <a-popconfirm
            title="确定下发工单吗?"
            title="确定接收工单吗?"
            @confirm="() => handleOrderIssue(record)"
            v-has="'dailyInspectionOrder:issue'"
          >
            <a v-if="record.status == '1'">下发</a>
            <a v-if="record.status == '1'">接收</a>
          </a-popconfirm>
          <a-divider
            v-if="record.status == '1'"
@@ -150,7 +150,7 @@
            v-if="record.status == '2'"
            type="vertical"
          />
          <a-popconfirm
          <!-- <a-popconfirm
            title="确定恢复工单吗?"
            @confirm="() => handleOrderRecover(record)"
            v-has="'dailyInspectionOrder:recover'"
@@ -160,8 +160,8 @@
          <a-divider
            v-if="record.status == '7'"
            type="vertical"
          />
          <a-popconfirm
          /> -->
          <!-- <a-popconfirm
            title="确定作废工单吗?"
            @confirm="() => handleOrderCancel(record)"
            v-has="'dailyInspectionOrder:recover'"
@@ -171,7 +171,7 @@
          <a-divider
            v-if="record.status == '2'"
            type="vertical"
          />
          /> -->
          <a-popconfirm
            title="确定领取工单吗?"
            @confirm="() => handleOrderGet(record)"
@@ -179,12 +179,12 @@
          >
            <a v-if="record.status == '2' && record.assignMode == '1'">领取</a>
          </a-popconfirm>
          <a
          <!-- <a
            v-if="record.status == '2' && record.assignMode == '2'  "
            @click="handleAssignOrder(record)"
            v-has="'dailyInspectionOrder:assign'"
          >派工</a>
          <a
          >派工</a> -->
          <!-- <a
            v-if="record.status == '2'&& record.assignMode == '3'  && record.inspectionUserName != null  "
            @click="handleAssignOrder(record)"
            v-has="'dailyInspectionOrder:assign'"
@@ -193,7 +193,7 @@
            v-if="record.status == '3'"
            @click="handleAssignOrder(record)"
            v-has="'dailyInspectionOrder:assign'"
          >改派</a>
          >改派</a>-->
          <a-divider
            v-if="record.status == '2'"
            type="vertical"
@@ -209,6 +209,17 @@
          >执行</a>
          <a-divider
            v-if="record.status === '3' || record.status === '4' "
            type="vertical"
          />
          <a-popconfirm
            title="维修人确认完工吗?"
            @confirm="() => handleOrderRepairConfirm(record)"
            v-has="'dailyInspectionOrder:repairConfirm'"
          >
            <a v-if="record.status == '5'">维修确认</a>
          </a-popconfirm>
          <a-divider
            v-if="record.status == '5'"
            type="vertical"
          />
          <a
@@ -244,7 +255,7 @@
          slot-scope="text, record"
        >
          <a
            v-if="record.status === '3' || record.status === '4' ||record.status === '5'  ||record.status === '7' "
            v-if="record.status === '3' || record.status === '4' ||record.status === '5'  ||record.status === '6' "
            class="lot"
            @click="handleOrderExe(record)"
          >{{record.num}}</a>
@@ -311,11 +322,7 @@
            return parseInt(index) + 1;
          }
        },
        {
          title: '状态',
          align: "center",
          dataIndex: 'statusName'
        },
        {
          title: '点检工单号',
          align: "center",
@@ -323,28 +330,33 @@
          scopedSlots: { customRender: 'num' }
        },
        {
          title: '点检日期',
          title: '状态',
          align: "center",
          dataIndex: 'inspectionDate',
          customRender: function (text) {
            return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
          }
          dataIndex: 'statusName'
        },
        // {
        //   title: '点检日期',
        //   align: "center",
        //   dataIndex: 'inspectionDate',
        //   customRender: function (text) {
        //     return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
        //   }
        // },
        // {
        //   title: '点检时间',
        //   align: "center",
        //   dataIndex: 'inspectionTime',
        //   // customRender: function (text) {
        //   //   return !text ? "" : (text.length > 10 ? text.substr(11, 20) : text)
        //   // }
        // },
        // {
        //   title: '截止时间',
        //   align: "center",
        //   dataIndex: 'inspectionDeadline',
        // },
        {
          title: '点检时间',
          align: "center",
          dataIndex: 'inspectionTime',
          customRender: function (text) {
            return !text ? "" : (text.length > 10 ? text.substr(11, 20) : text)
          }
        },
        {
          title: '截止时间',
          align: "center",
          dataIndex: 'inspectionDeadline',
        },
        {
          title: '设备编码',
          title: '统一编码',
          align: "center",
          dataIndex: 'equipmentNum'
        },
@@ -359,7 +371,7 @@
          dataIndex: 'equipmentModel'
        },
        {
          title: '对象部门',
          title: '使用部门',
          align: "center",
          dataIndex: 'useDepartName'
        },
@@ -368,45 +380,45 @@
          align: "center",
          dataIndex: 'teamName'
        },
        {
          title: '开工条件',
          align: "center",
          dataIndex: 'startWorkCondition',
          customRender: (text) => {
            if (text == '1') {
              return "是";
            } else if (text == '0') {
              return "否";
            }
          },
        },
        {
          title: '点检标准编码',
          align: "center",
          dataIndex: 'inspectionStandardNum'
        },
        // {
        //   title: '开工条件',
        //   align: "center",
        //   dataIndex: 'startWorkCondition',
        //   customRender: (text) => {
        //     if (text == '1') {
        //       return "是";
        //     } else if (text == '0') {
        //       return "否";
        //     }
        //   },
        // },
        // {
        //   title: '点检标准编码',
        //   align: "center",
        //   dataIndex: 'inspectionStandardNum'
        // },
        {
          title: '点检周期',
          align: "center",
          dataIndex: 'inspectionCycleName'
        },
        {
          title: '派工方式',
          align: "center",
          dataIndex: 'assignModeName'
        },
        {
          title: '点检结果',
          align: "center",
          dataIndex: 'result'
        },
        // {
        //   title: '派工方式',
        //   align: "center",
        //   dataIndex: 'assignModeName'
        // },
        // {
        //   title: '点检结果',
        //   align: "center",
        //   dataIndex: 'result'
        // },
        {
          title: '点检人',
          align: "center",
          dataIndex: 'inspectionUserName'
        },
        {
          title: '完成时间',
          title: '点检时间',
          align: "center",
          dataIndex: 'actualEndTime',
          // customRender: function (text) {
@@ -414,10 +426,23 @@
          // }
        },
        {
          title: '创建人',
          title: '维修确认人',
          align: "center",
          dataIndex: 'createBy'
          dataIndex: 'repairConfirmPerson'
        },
        {
          title: '确认时间',
          align: "center",
          dataIndex: 'repairConfirmDate',
          // customRender: function (text) {
          //   return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
          // }
        },
        // {
        //   title: '创建人',
        //   align: "center",
        //   dataIndex: 'createBy'
        // },
        {
          title: '创建日期',
          align: "center",
@@ -495,7 +520,7 @@
        this.$refs.DailyInspectionOrderExeDrawer.buttonDistable = true
        this.$refs.DailyInspectionOrderExeDrawer.revocationDistable = false
        this.$refs.DailyInspectionOrderExeDrawer.SWbuttonDistable = true
      } else if (record.status === '7') {
      } else if (record.status === '6') {
        this.$refs.DailyInspectionOrderExeDrawer.buttonDistable = true
        this.$refs.DailyInspectionOrderExeDrawer.revocationDistable = true
        this.$refs.DailyInspectionOrderExeDrawer.SWbuttonDistable = true
@@ -540,15 +565,15 @@
        }
      })
    },
    //作废
    handleOrderCancel(record) {
    //维修确认
    handleOrderRepairConfirm(record) {
      const that = this;
      requestPut(that.url.edit, { id: record.id, status: '7' }).then((res) => {
      requestPut(that.url.edit, { id: record.id, status: '6' }).then((res) => {
        if (res.success) {
          that.$message.success("工单作废成功!")
          that.$message.success("工单完工成功!")
          that.loadData()
        } else {
          that.$message.warning("工单作废失败!")
          that.$message.warning("工单完工失败!")
        }
      })
    },