小小儁爺
2025-10-30 b01acc5451b09593762522e9baff2615120696ec
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">
@@ -154,8 +155,8 @@
          <el-table-column
            type="selection"
            width="50"
            :selectable="selected"
          />
<!--          :selectable="selected"-->
          <el-table-column
            prop="rowNum"
            width="50"
@@ -202,7 +203,7 @@
          </el-table-column>
          <el-table-column
            prop="saleOrderCode"
            label="销售订单"
            label="销售订单/预测单"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="160"
@@ -405,12 +406,20 @@
                  />
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="工单关闭" placement="top">
                <el-tooltip class="item" effect="dark" :content="row.status!=='CLOSED'?'工单关闭':'工单启动'" 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)"
                  />
                  <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>
@@ -2036,7 +2045,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'
@@ -2488,7 +2497,8 @@
      this.dialogVisibleTask = false
    },
    handleSelectionChange(val) {
      this.multipleSelection = val.map(i => i.wo_code)
      // this.multipleSelection = val.map(i => i.wo_code)
      this.multipleSelection = val
    },
    selected(row, index) {
@@ -2585,15 +2595,18 @@
    },
    // 工单关闭事件
    async orderClose(row) {
      this.$confirm('是否确认删除?', '提示', {
      this.$confirm('是否确认关闭?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        if (row) { // 行关闭工单
          this.multipleSelection = [row.wo_code]
        let data = null
        if (row) { // 行启动工单
          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) {
@@ -2606,6 +2619,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)