loulijun2021
2024-04-15 752670ad623900bd8ffdbfd68d2a0e34f4d623ed
src/views/workOrder/workOrderClose.vue
@@ -3,7 +3,8 @@
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup">
        <el-button v-waves icon="el-icon-switch-button" type="success" @click="orderClose()">工单关闭</el-button>
        <el-button v-waves icon="el-icon-switch-button" type="danger" @click="orderClose()">工单关闭</el-button>
        <el-button v-waves icon="el-icon-thumb" type="success" @click="orderOpen()">工单启动</el-button>
      </div>
      <div class="bodyTopFormGroup">
@@ -136,6 +137,7 @@
      </div>
      <div class="elTableDiv">
        <!--        @row-click="rowClick"-->
        <el-table
          ref="tableDataRef"
          class="tableFixed"
@@ -148,17 +150,16 @@
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
          @row-click="rowClick"
          @selection-change="handleSelectionChange"
        >
          <el-table-column
            type="selection"
            width="50"
            :selectable="selected"
          />
          <!--          :selectable="selected"-->
          <el-table-column
            prop="rowNum"
            width="50"
            width="80"
            label="序号"
            fixed
          />
@@ -347,10 +348,20 @@
                <el-tooltip class="item" effect="dark" content="工单关闭" placement="top">
                  <i
                    v-if="row.status!=='CLOSED'"
                    class="el-icon-switch-button"
                    style="cursor: pointer;margin-left: 15px"
                    :style="{color:$store.state.settings.theme}"
                    :style="{color:'red'}"
                    @click.stop="orderClose(row)"
                  />
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="工单启动" placement="top">
                  <i
                    v-if="row.status==='CLOSED'"
                    class="el-icon-thumb"
                    style="cursor: pointer;margin-left: 15px"
                    :style="{color:$store.state.settings.theme}"
                    @click.stop="orderOpen(row)"
                  />
                </el-tooltip>
@@ -1976,7 +1987,7 @@
  AddUpdateMesOrder, DeleteMesOrder,
  MesBadOrderSearch, MesOrderDistribution,
  MesOrderClosedSearch,
  UpdateMesOrderStepSearch, MesOrderBitchClosedSeave
  UpdateMesOrderStepSearch, MesOrderBitchClosedSeave, MesOrderBitchReverseClosedSeave
} from '@/api/WorkOrder'
import { PartSelect } from '@/api/ProductModel'
import { PrentOrganization, PrentOrganizationNoCompany, StepData } from '@/api/GeneralBasicData'
@@ -2423,7 +2434,7 @@
      this.dialogVisibleTask = false
    },
    handleSelectionChange(val) {
      this.multipleSelection = val.map(i => i.wo_code)
      this.multipleSelection = val
    },
    selected(row, index) {
@@ -2520,15 +2531,19 @@
    },
    // 工单关闭事件
    async orderClose(row) {
      this.$confirm('是否确认删除?', '提示', {
      this.$confirm('是否确认关闭?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        let data = null
        if (row) { // 行关闭工单
          this.multipleSelection = [row.wo_code]
          data = [row.wo_code]
        } else {
          data = this.multipleSelection.filter(i => i.status !== 'CLOSED').map(i => i.wo_code)
        }
        MesOrderBitchClosedSeave(this.multipleSelection).then(res => {
        MesOrderBitchClosedSeave(data).then(res => {
          if (res.code === '200') {
            this.$notify.success('关闭成功!')
            // if (this.form.page > 1 && this.tableData.length === 1) {
@@ -2541,6 +2556,33 @@
        this.$notify.info('已取消删除!')
      })
    },
    // 工单启动事件
    async orderOpen(row) {
      this.$confirm('是否确认启动?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        let data = null
        if (row) { // 行启动工单
          data = [row.wo_code]
        } else {
          data = this.multipleSelection.filter(i => i.status === 'CLOSED').map(i => i.wo_code)
        }
        MesOrderBitchReverseClosedSeave(data).then(res => {
          if (res.code === '200') {
            this.$notify.success('启动成功!')
            // if (this.form.page > 1 && this.tableData.length === 1) {
            //   this.form.page--
            // }
            this.getMesOrderClosedSearch()
          }
        })
      }).catch(() => {
        this.$notify.info('已取消删除!')
      })
    },
    // 对话框产品信息值改变
    partcodeChangeDialog(val) {
      console.log(val)