haoxuan
2024-04-28 2adc284610bcfed355390d7fa31cf19d445e843d
src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue
@@ -18,8 +18,8 @@
        <el-button size="small" v-if="this.editConfig.title != '查看'" @click="editConfig.visible = false">取消</el-button>
        <el-button type="primary"  size="small"
          @click="saveClick('form')">确认收货</el-button>
        <!-- <el-button type="primary"  size="small"
          @click="saveOkClickAll('form')">全部合格入库</el-button> -->
        <el-button type="primary"  size="small"
          @click="saveOkClickAll('form')">全部合格入库</el-button>
      </div>
    </el-dialog>
  </div>
@@ -28,7 +28,8 @@
<script>
import {
  getPurchaseProductConfirmInfo,
  savePurchaseProductConfirm
  savePurchaseProductConfirm,
  allProductInWarehouse
} from "@/api/purchaseManage/purchase"
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
export default {
@@ -112,7 +113,7 @@
        }
      })
      if(pipeline){
        await savePurchaseProductConfirm(arr).then((res)=>{
        await savePurchaseProductConfirm(this.productTableList.tableData).then((res)=>{
          if(res.code===200){
            this.editConfig.visible=false
            this.$parent.getData()
@@ -124,7 +125,27 @@
      }
    },
    // 全部合格入库
    saveOkClickAll(){
    async saveOkClickAll(){
      let pipeline=false // 是否有大于0的收货数量
      // let rule1=false    // 本次收货是否大于未收货数量
      // let arr=[]
      this.productTableList.tableData.map((item)=>{
        if(item.nowReceiveAmount>0&&item.nowReceiveAmount<=item.notReceiveAmount){
          pipeline=true
          // arr.push(item)
        }
      })
      if(pipeline){
        await allProductInWarehouse(this.productTableList.tableData).then((res)=>{
          if(res.code===200){
            this.editConfig.visible=false
            this.$parent.getData()
            this.$message.success("确认入库质检成功!")
          }
        })
      }else{
        this.$message.warning("本次收货数量不能为0且不能超出未收货数量 ")
      }
    },
    saveParams() {