loulijun2021
2023-10-31 8dbe181109f38dd729b3376e79d756000479a295
1.新增 订单批量下达
已修改3个文件
173 ■■■■ 文件已修改
src/api/WorkOrder.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mouldManager/mouldList.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/workOrder/produceOrderList.vue 155 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/WorkOrder.js
@@ -18,6 +18,14 @@
  })
}
export function MarkBatchSaveErpOrder(data) {
  return request({
    url: 'WorkOrder/MarkBatchSaveErpOrder',
    method: 'post',
    data
  })
}
// ERP订单关闭
export function ClosedErpOrder(data) {
  return request({
@@ -224,6 +232,7 @@
    data
  })
}
// 生产执行,报工审核列表数据查询接口
export function MesOrderStepReportVerifySearch(data) {
  return request({
src/views/mouldManager/mouldList.vue
@@ -168,6 +168,15 @@
            </template>
          </el-table-column>
          <el-table-column
            prop="location_name"
            label="库位名称"
            sortable="custom"
          >
            <template slot-scope="{row}">
              {{ row.location_name ? row.location_name : '/' }}
            </template>
          </el-table-column>
          <el-table-column
            prop="is_part"
            label="产品关联"
            sortable="custom"
src/views/workOrder/produceOrderList.vue
@@ -12,15 +12,10 @@
        <div style="display: flex">
          <el-button
            v-waves
            icon="el-icon-switch-button"
            @click="orderClose"
          >关闭订单
          </el-button>
          <el-button
            v-waves
            icon="el-icon-delete"
            @click="orderDel"
          >删除订单
            type="primary"
            icon="el-icon-bottom"
            @click="batchHandle"
          >批量下达
          </el-button>
        </div>
@@ -150,25 +145,27 @@
          :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"-->
          <!--          />-->
          <!--          @row-click="rowClick"-->
          <el-table-column
            type="selection"
            width="50"
            fixed
          >
            <template slot-scope="{row}">
              <el-radio
                v-model="radioSelectedId"
                :label="row.id"
                style="color: transparent;padding-left: 10px;"
              />
              <!--              @change.native="getCurrentRow(row.id)"-->
            </template>
          </el-table-column>
            :selectable="selected"
          />
          <!--          <el-table-column-->
          <!--            width="50"-->
          <!--            fixed-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <el-radio-->
          <!--                v-model="radioSelectedId"-->
          <!--                :label="row.id"-->
          <!--                style="color: transparent;padding-left: 10px;"-->
          <!--              />-->
          <!--              &lt;!&ndash;              @change.native="getCurrentRow(row.id)"&ndash;&gt;-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <el-table-column
            prop="rowNum"
            width="50"
@@ -323,7 +320,7 @@
          <el-table-column
            label="操作"
            fixed="right"
            width="80"
            width="120"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
@@ -334,6 +331,23 @@
                    :style="{color:$store.state.settings.theme}"
                    style="cursor: pointer;margin-left: 5px"
                    @click="edit('edit',row)"
                  />
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="订单关闭" placement="top">
                  <i
                    class="el-icon-switch-button"
                    :style="{color:$store.state.settings.theme}"
                    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
                    class="el-icon-delete"
                    :style="{color:$store.state.settings.theme}"
                    style="cursor: pointer;margin-left: 15px"
                    @click="orderDel(row.id)"
                  />
                </el-tooltip>
              </div>
@@ -444,7 +458,13 @@
import { handleDatetime } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import { ClosedErpOrder, DeleteErpOrder, ErpOrderSearch, MarkSaveErpOrder } from '@/api/WorkOrder'
import {
  ClosedErpOrder,
  DeleteErpOrder,
  ErpOrderSearch,
  MarkBatchSaveErpOrder,
  MarkSaveErpOrder
} from '@/api/WorkOrder'
import { SeaveSearchErpOrder } from '@/api/ErpSyncMes'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
@@ -544,7 +564,8 @@
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7
        }
      }
      },
      multipleSelection: []
      // expireTimeOption: {
      //   disabledDate(time) {
@@ -659,20 +680,17 @@
      this.getErpOrderSearch()
    },
    // 单选框选中获取当前行信息
    getCurrentRow(id) {
      this.radioSelectedId = id
    },
    rowClick(row) {
      this.radioSelectedId = row.id
    },
    // getCurrentRow(id) {
    //   this.radioSelectedId = id
    // },
    // rowClick(row) {
    //   this.radioSelectedId = row.id
    // },
    // 订单删除
    orderDel() {
      if (this.radioSelectedId.length < 1) {
        return this.$message.info('请先选择订单!')
      }
    orderDel(id) {
      this.tableData.forEach(item => {
        if (item.id === this.radioSelectedId) {
        if (item.id === id) {
          if (item.status === 'CLOSED') {
            return this.$message.info('此订单已关闭,无法删除!')
          } else {
@@ -681,7 +699,7 @@
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              DeleteErpOrder({ erpordercode: item.wo, erporderid: this.radioSelectedId }).then(res => {
              DeleteErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => {
                if (res.code === '200') {
                  this.$message.success('订单删除成功!')
                  this.getErpOrderSearch()
@@ -695,12 +713,9 @@
      })
    },
    // 订单关闭
    async orderClose() {
      if (this.radioSelectedId.length < 1) {
        return this.$message.info('请先选择订单!')
      }
    async orderClose(id) {
      this.tableData.forEach(item => {
        if (item.id === this.radioSelectedId) {
        if (item.id === id) {
          if (item.status !== 'NEW') {
            return this.$message.info('此订单非新订单,无法关闭!')
          } else {
@@ -709,7 +724,7 @@
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              ClosedErpOrder({ erpordercode: item.wo, erporderid: this.radioSelectedId }).then(res => {
              ClosedErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => {
                if (res.code === '200') {
                  this.$message.success('订单关闭成功!')
                  this.getErpOrderSearch()
@@ -722,6 +737,54 @@
        }
      })
    },
    batchHandle() {
      this.$confirm('是否批量下达?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        if (this.multipleSelection.length === 0) {
          return this.$message.info('请先选择订单!')
        }
        // console.log(JSON.parse(JSON.stringify(this.multipleSelection)))
        const data = []
        this.multipleSelection.forEach(i => {
          data.push({
            'erporderid': i.id,
            'sbid': i.sbid,
            'erpordercode': i.wo,
            'partcode': i.partcode,
            'wkshopcode': i.wkshp_code,
            'warehousecode': i.stck_code,
            'erpqty': i.qty,
            'markqty': i.qty,
            'ordernum': 1,
            'relse_qty': i.qty,
            'saleordercode': i.saleOrderCode,
            // 'saleOrderDeliveryDate': i.saleOrderDeliveryDate
            'saleOrderDeliveryDate': handleDatetime(new Date()) + ' 00:00:00'
          })
        })
        // console.log(JSON.parse(JSON.stringify(data)))
        MarkBatchSaveErpOrder(data).then(res => {
          if (res.code === '200') {
            this.multipleSelection = []
            this.$message.success('批量下达成功!')
            this.getErpOrderSearch()
          } else {
            this.$message.error('批量下达失败!')
          }
        })
      }).catch(() => {
        this.$message.info('已取消下达!')
      })
    },
    selected(row, index) {
      return row.status === 'NEW'
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    // 新增按钮
    add(operation) {
      this.operation = operation