zouyu
2023-12-28 f135e67b7a6733796aaa855198a8b97f2894c5c7
src/views/warehouse/pallettransports/index.vue
@@ -113,7 +113,7 @@
              <!-- <el-button type="warning" v-if="permissions.warehouse_pallettransports_detail_library" round
                @click="openDetailLocationDialog">一键至库位</el-button> -->
              <el-button type="success" v-if="permissions.warehouse_pallettransports_detail_execute" round
                @click="executeMove">执 行</el-button>
                @click="updateStockFun">执 行</el-button>
            </div>
          </div>
          <div>
@@ -136,7 +136,7 @@
              
              <el-table-column prop="transfer_quantity" label="移库数量" align="center">
                <template slot-scope="scope">
                  <el-input v-model="scope.row.transfer_quantity"  border="none"></el-input>
                  <el-input v-model="scope.row.transfer_quantity" @change="moveLocation(scope.row)" :disabled = "scope.row.state == '02submitted' "  border="none"></el-input>
                </template>
              </el-table-column>
@@ -206,6 +206,7 @@
  delPalletTransportsDetailObj,
  executeMoveLocation,
  selectAll,
  updateStock,
} from '@/api/warehouse/pallettransports'
import { getByPalletTransId } from '@/api/plan/operationtask'
import ttable from '@/views/common/ztt-table.vue'
@@ -221,6 +222,7 @@
export default {
  data() {
    return {
      forbidden:false,
      partDesc: null,
      ajaxFun: palletTransportsFetchList,
      currPalletTransportsRow: null,
@@ -649,7 +651,7 @@
        return{
          partNo:el.partNo,
          partDesc: el.partDesc,
          transferQuantity: el.surplusQuantity,
          transferQuantity: 0,
          toIfsLocationNo:el.toIfsLocationNo,
          toIfsLocationName: el.toIfsLocationName,
          transportsId: el.transportsId,
@@ -674,6 +676,7 @@
                      ele.surplusQuantity = 0
                  }
                })
                this.getPalletTransportsMaterialData()
              } else {
                this.$message.error('添加移库明细失败')
              }
@@ -744,6 +747,32 @@
        }
      })
    },
    //改变
    moveLocation(val){
      console.log(val,"---->");
      let num = Number(val.transfer_quantity)
      this.palletTransportsDetailMultipleSelection.forEach(el =>{
                        console.log(el.transfer_quantity);
                        el.transfer_quantity = num
      })
      console.log(this.palletTransportsDetailMultipleSelection,"--->123");
    },
    updateStockFun(){
      let data = []
      data = this.palletTransportsDetailMultipleSelection.map(el =>{
          return {
              id:el.id,
              transferQuantity:el.transfer_quantity
          }
      })
      updateStock(data).then((res) =>{
        if(res.data.code===0){
          this.getPalletTransportsMaterialData()
          this.executeMove()
        }
      })
    },
    // 执行移库
    executeMove() {
      if (
@@ -758,7 +787,6 @@
            flag = false
          }
        })
        console.log("-----------",flag,ids);
        if (flag) {
          executeMoveLocation(ids).then((response) => {
            const resData = response.data
@@ -782,6 +810,7 @@
      } else {
        this.$message.error('请选择移库明细')
      }
    },
    selectDetailLocationCallback() {
      this.getPalletTransportsDetailData()