zenglf
2023-08-19 8611a1ba1696e76cced04ff5d658ba138a05dafd
src/views/eam/modules/repairorder/repairOrderExcuteDrawer.vue
@@ -170,7 +170,10 @@
                </a-form-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
            <a-row
              hidden
              :gutter="24"
            >
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
@@ -234,18 +237,18 @@
                :repairOrderId="repairOrder.id"
                :repairOrderStatus="repairOrder.status"
              ></actual-material-edit-table> -->
              <RepairOrderActualMaterialList :mainId="repairOrder"/>
              <RepairOrderActualMaterialList :mainId="repairOrder" />
            </a-tab-pane>
            <a-tab-pane
              tab='实际工时'
              key="2"
              class="hightColor"
            >
              <!-- <actual-work-hours-edit-table
              <RepairOrderActualWorkHoursList
                :repairOrderId="repairOrder.id"
                :repairOrderStatus="repairOrder.status"
              ></actual-work-hours-edit-table> -->
              <RepairOrderActualWorkHoursList :mainId="repairOrder"/>
                :teamId="repairOrder.teamId"
              />
            </a-tab-pane>
            <a-tab-pane
              tab='故障分析'
@@ -256,7 +259,7 @@
                :repairOrderId="repairOrder.id"
                :repairOrderStatus="repairOrder.status"
              ></fault-analysis-edit-table> -->
              <RepairOrderFaultAnalysisList :mainId="repairOrder"/>
              <RepairOrderFaultAnalysisList :mainId="repairOrder" />
            </a-tab-pane>
          </a-tabs>
        </a-card>
@@ -332,7 +335,7 @@
  mounted() {
    this.$bus.$on('closeDrawer', (data) => {
      this.visible = false;
      this.handleCancel()
    })
  },
@@ -357,40 +360,117 @@
      this.visible = false;
      //this.repairOrder.id = "-1"
    },
    handleStart(record) {
      putAction(this.url.orderStart, this.repairOrder).then(res => {
        if (res.result) {
          this.$message.success('开工成功');
          this.repairOrder.status = '3'
          this.$emit('loadData');
        } else {
          this.$message.error('开工出现异常')
        }
    // handleStart(record) {
    //   putAction(this.url.orderStart, this.repairOrder).then(res => {
    //     if (res.result) {
    //       this.$message.success('开工成功');
    //       this.repairOrder.status = '3'
    //       this.$emit('loadData');
    //     } else {
    //       this.$message.error('开工出现异常')
    //     }
    //   })
    // },
    //开工
    handleStart() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '维修工单开工',
        content: '提示:开工后无法撤回,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          putAction(that.url.orderStart, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('开工成功');
              that.repairOrder.status = '3'
              that.$emit('loadData');
            } else {
              that.$message.error('开工出现异常')
            }
          }).finally(() => {
            that.confirmLoading = false;
            // that.close();
          })
        },
      })
    },
    // handleReport() {
    //   putAction(this.url.orderReport, this.repairOrder).then(res => {
    //     if (res.result) {
    //       this.$message.success('报工成功');
    //       this.repairOrder.status = '4'
    //       this.$emit('loadData');
    //     } else {
    //       this.$message.error('报工出现异常')
    //     }
    //   })
    // },
    //报工
    handleReport() {
      putAction(this.url.orderReport, this.repairOrder).then(res => {
        if (res.result) {
          this.$message.success('报工成功');
          this.repairOrder.status = '4'
          this.$emit('loadData');
        } else {
          this.$message.error('报工出现异常')
        }
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '维修工单报工',
        content: '提示:报工后维修完工,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          putAction(that.url.orderReport, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('报工成功');
              that.repairOrder.status = '4'
              that.$emit('loadData');
            } else {
              that.$message.error('报工出现异常')
            }
          }).finally(() => {
            that.confirmLoading = false;
            //
          })
        },
      })
    },
    // handleRevoke() {
    //   putAction(this.url.orderRevoke, this.repairOrder).then(res => {
    //     if (res.result) {
    //       this.$message.success('撤销成功');
    //       this.repairOrder.status = '3'
    //       this.$emit('loadData');
    //     } else {
    //       this.$message.error('撤销出现异常')
    //     }
    //   })
    // },
    //撤销
    handleRevoke() {
      putAction(this.url.orderRevoke, this.repairOrder).then(res => {
        if (res.result) {
          this.$message.success('撤销成功');
          this.repairOrder.status = '3'
          this.$emit('loadData');
        } else {
          this.$message.error('撤销出现异常')
        }
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '完工撤销',
        content: '提示:完工撤销后可继续报工操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          putAction(that.url.orderRevoke, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('撤销成功');
              that.repairOrder.status = '3'
              that.$emit('loadData');
            } else {
              that.$message.error('撤销出现异常')
            }
          }).finally(() => {
            that.confirmLoading = false;
            // that.close();
          })
        },
      })
    },
  },
}