loulijun2021
2024-05-07 e2655141b07ab811f755daee54680c5748e9d8e6
src/views/workOrder/produceOrderList.vue
@@ -9,15 +9,15 @@
          @click="syncERP"
        >同步ERP
        </el-button>
        <div style="display: flex">
          <el-button
            v-waves
            type="primary"
            icon="el-icon-bottom"
            @click="batchHandle"
          >批量下达
          </el-button>
        </div>
        <!--        <div style="display: flex">-->
        <!--          <el-button-->
        <!--            v-waves-->
        <!--            type="primary"-->
        <!--            icon="el-icon-bottom"-->
        <!--            @click="batchHandle"-->
        <!--          >批量下达-->
        <!--          </el-button>-->
        <!--        </div>-->
      </div>
@@ -164,11 +164,11 @@
          @selection-change="handleSelectionChange"
        >
          <!--          @row-click="rowClick"-->
          <el-table-column
            type="selection"
            width="50"
            :selectable="selected"
          />
          <!--          <el-table-column-->
          <!--            type="selection"-->
          <!--            width="50"-->
          <!--            :selectable="selected"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            width="50"-->
          <!--            fixed-->
@@ -184,7 +184,7 @@
          <!--          </el-table-column>-->
          <el-table-column
            prop="rowNum"
            width="50"
            width="80"
            fixed
            label="序号"
          />
@@ -244,6 +244,30 @@
          >
            <template slot-scope="{row}">
              <div v-if="row.partspec">{{ row.partspec }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="TopInventoryCode"
            label="顶级物料编码"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.TopInventoryCode">{{ row.TopInventoryCode }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="TopInventoryName"
            label="顶级物料名称"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.TopInventoryName">{{ row.TopInventoryName }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
@@ -340,7 +364,7 @@
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="下达" placement="top">
                <el-tooltip class="item" effect="dark" content="订单下达" placement="top">
                  <!--                <el-button v-waves type="text" @click="edit('edit',row)">下达</el-button>-->
                  <i
                    class="el-icon-bottom"
@@ -351,10 +375,21 @@
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="订单关闭" placement="top">
                  <i
                    v-if="row.status!=='CLOSED'"
                    class="el-icon-switch-button"
                    :style="{color:$store.state.settings.theme}"
                    :style="{color:'red'}"
                    style="cursor: pointer;margin-left: 15px"
                    @click="orderClose(row.id)"
                  />
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="订单启动" placement="top">
                  <i
                    v-if="row.status==='CLOSED'"
                    class="el-icon-thumb"
                    :style="{color:$store.state.settings.theme}"
                    style="cursor: pointer;margin-left: 15px"
                    @click="orderOpen(row.id)"
                  />
                </el-tooltip>
@@ -407,6 +442,15 @@
        <el-form-item label="产品规格" prop="partspec">
          <el-input v-model="dialogForm.partspec" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="顶级物料编码" prop="TopInventoryCode">
          <el-input v-model="dialogForm.TopInventoryCode" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="顶级物料名称" prop="TopInventoryName">
          <el-input v-model="dialogForm.TopInventoryName" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="生产车间" prop="wkshopname">
          <el-input v-model="dialogForm.wkshopname" disabled style="width: 200px" />
        </el-form-item>
@@ -479,7 +523,7 @@
  DeleteErpOrder,
  ErpOrderSearch,
  MarkBatchSaveErpOrder,
  MarkSaveErpOrder
  MarkSaveErpOrder, ReverseClosedErpOrder
} from '@/api/WorkOrder'
import { SeaveSearchErpOrder } from '@/api/ErpSyncMes'
import { PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
@@ -557,6 +601,10 @@
        markqty: '', // 下单数量
        ordernum: '', // 下单单数
        relse_qty: '', // 已下单数量
        idTopInventory: '', // 顶级物料id
        TopInventoryCode: '', // 顶级物料编码
        TopInventoryName: '', // 顶级物料名称
        saleOrderDeliveryDate: '' // 预计交付日期
      },
@@ -700,6 +748,7 @@
      this.form.partname = ''
      this.form.partspec = ''
      this.form.paystartdate = ''
      this.form.saleordercode = ''
      this.form.payenddate = ''
      this.form.creatuser = ''
      this.form.erpordercode = ''
@@ -743,24 +792,50 @@
    async orderClose(id) {
      this.tableData.forEach(item => {
        if (item.id === id) {
          if (item.status !== 'NEW') {
            return this.$message.info('此订单非新订单,无法关闭!')
          } else {
            this.$confirm('是否确认关闭订单?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              ClosedErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => {
                if (res.code === '200') {
                  this.$message.success('订单关闭成功!')
                  this.getErpOrderSearch()
                }
              })
            }).catch(() => {
              this.$message.info('已取消关闭!')
          // if (item.status !== 'NEW') {
          //   return this.$message.info('此订单非新订单,无法关闭!')
          // } else {
          this.$confirm('是否确认关闭订单,该订单下的所有工单将会关闭!', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            ClosedErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => {
              if (res.code === '200') {
                this.$message.success('订单关闭成功!')
                this.getErpOrderSearch()
              }
            })
          }
          }).catch(() => {
            this.$message.info('已取消关闭!')
          })
          // }
        }
      })
    },
    // 订单开启
    async orderOpen(id) {
      this.tableData.forEach(item => {
        if (item.id === id) {
          // if (item.status !== 'NEW') {
          //   return this.$message.info('此订单非新订单,无法关闭!')
          // } else {
          this.$confirm('是否确认启动订单,该订单下的所有工单将会开启!', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            ReverseClosedErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => {
              if (res.code === '200') {
                this.$message.success('订单启动成功!')
                this.getErpOrderSearch()
              }
            })
          }).catch(() => {
            this.$message.info('已取消关闭!')
          })
          // }
        }
      })
    },
@@ -848,6 +923,10 @@
        this.dialogForm.markqty = parseFloat(row.qty) - parseFloat(row.relse_qty)
        this.dialogForm.ordernum = 1
        this.dialogForm.relse_qty = row.relse_qty
        this.dialogForm.idTopInventory = row.idTopInventory
        this.dialogForm.TopInventoryCode = row.TopInventoryCode
        this.dialogForm.TopInventoryName = row.TopInventoryName
      })
    },
    // 对话框关闭事件
@@ -872,6 +951,10 @@
        markqty: '', // 下单数量
        ordernum: '', // 下单单数
        relse_qty: '', // 已下单数量
        idTopInventory: '', // 顶级物料id
        TopInventoryCode: '', // 顶级物料编码
        TopInventoryName: '', // 顶级物料名称
        saleOrderDeliveryDate: '' // 预计交付日期
      }
@@ -907,6 +990,10 @@
            'wkshopcode': this.dialogForm.wkshopcode,
            'warehousecode': this.dialogForm.warehousecode,
            'idTopInventory': this.dialogForm.idTopInventory,
            'TopInventoryCode': this.dialogForm.TopInventoryCode,
            'TopInventoryName': this.dialogForm.TopInventoryName,
            'erpqty': this.dialogForm.erpqty,
            'markqty': this.dialogForm.markqty,
            'ordernum': this.dialogForm.ordernum,