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>
@@ -751,18 +751,27 @@
    moveLocation(val){
      console.log(val,"---->");
      let num = Number(val.transfer_quantity)
      if (val.state !="02submitted") {
            if(num >= 0){
              updateStock({id:val.id,transferQuantity:num}).then((res) =>{
              console.log(res,"------>1");
            this.getPalletTransportsMaterialData()
          })
        }else{
        this.$message.error('移库不能小于0')
      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()
        }
      }else{
        this.$message.error('移库已经执行')
      }
      })
    },
    // 执行移库
    executeMove() {
@@ -778,7 +787,6 @@
            flag = false
          }
        })
        console.log("-----------",flag,ids);
        if (flag) {
          executeMoveLocation(ids).then((response) => {
            const resData = response.data
@@ -802,6 +810,7 @@
      } else {
        this.$message.error('请选择移库明细')
      }
    },
    selectDetailLocationCallback() {
      this.getPalletTransportsDetailData()