zuozhengqing
2024-03-26 a99b4aeb7e61be31a7dad81719a4e2102b284963
采购管理:到货确认添加全部合格入库
4个文件已修改
63 ■■■■ 已修改文件
src/api/purchaseManage/purchase.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/components/TestingAll.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/index.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/purchaseManage/purchase.js
@@ -179,3 +179,11 @@
    data
  })
}
// 全部合格入库
export function allProductInWarehouse(data) {
  return request({
    url: "/api/purchase/allProductInWarehouse",
    method: "post",
    data
  })
}
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 {
@@ -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() {
src/views/purchaseManage/purchase/components/TestingAll.vue
@@ -2,9 +2,9 @@
  <div class="add-quotation">
    <el-dialog :visible.sync="editConfig.visible" width="70%" append-to-body custom-class="iframe-dialog">
      <el-header>
        <el-button type="primary" v-if="this.editConfig.title != '查看'" size="small"
        <el-button type="primary" :disabled="isDisabled"  size="small"
          @click="saveClick()">批量合格入库</el-button>
        <el-button type="primary" v-if="this.editConfig.title != '查看'" size="small"
        <el-button type="primary" :disabled="isDisabled"  size="small"
          @click="saveNoClick()">批量不合格</el-button>
      </el-header>
      <el-form ref="form" :model="editConfig.infomation" label-position="right" label-width="130px" size="mini"
@@ -18,8 +18,8 @@
              <template slot="tableButton">
                <el-table-column label="操作" width="120" align="center">
                  <template slot-scope="scope">
                    <el-button type="text" size="small" @click="saveClick(scope.row)"
                  <template slot-scope="scope"  v-if="scope.row.status==1" >
                    <el-button type="text"  size="small" @click="saveClick(scope.row)"
                      style="margin-right: 5px">合格</el-button>
                    <el-button type="text" size="small" @click="saveNoClick(scope.row)"
                      style="margin-right: 5px">不合格</el-button>
@@ -100,6 +100,7 @@
      thatTimes: [],
      selectList: [],
      qualityStatusList: getDataByType("qualityStatus"),
      isDisabled:false,
    }
  },
  created() {
@@ -221,8 +222,12 @@
    async getPurchaseQualityInspectionInfo(params) {
      await getPurchaseQualityInspectionInfo(params).then((res) => {
        this.timeList = []
        this.isDisabled=true // 判断有没有待质检的
        res.data.map((item) => {
          this.timeList.push({ id: item.createTime, name: item.createTime })
          if(item.status===1){
            this.isDisabled=false
          }
        })
        this.setTableForm()
        this.productTableList.tableData = res.data
src/views/purchaseManage/purchase/index.vue
@@ -166,9 +166,9 @@
  data() {
    // 产品信息
    const productColumn = [
      { label: "产品编号", prop: "number", default: true },
      { label: "产品名称", prop: "name" },
      { label: "规格", prop: "specifications" },
      { label: "产品编号", prop: "productId", default: true },
      { label: "产品名称", prop: "productName" },
      { label: "规格", prop: "specs" },
      { label: "型号", prop: "modelNumber" },
      { label: "采购数量", prop: "amount" },
      { label: "已发货数量", prop: "sendAmount" },
@@ -250,7 +250,7 @@
      showCol: ["采购单号", "采购单名称", "单据类型", "供应商名称", "采购数量", "收货仓库", "经办人", "制单人"],
      tableBottomColumn: [],
      showBottomCol: [],
      TabsIndex: "0",
      TabsIndex: 0,
      productTableList: {},
      // 产品信息
      productColumn: productColumn,
@@ -369,7 +369,8 @@
            this.pagerOptions.totalCount = res.data.total
            if (res.data.total > 0) {
              this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {}
              this.tableRowClick(this.selectRow)
              // this.tableRowClick(this.selectRow)
              this.getProductInventoryInfo(this.selectRow)
            }
          }
        })
@@ -687,7 +688,7 @@
        })
      } else if (this.TabsIndex == 1 && row.status == 1) {
        this.productTableList.tableInfomation = []
      } else if(this.TabsIndex==1 && row.status==7||row.status==8){
      } else if(this.TabsIndex==1 && row.status==7||this.TabsIndex==1&&row.status==8){
        getPurchaseQualityInspectionInfo({
            purchaseNumber: row.number,
          }).then((res)=>{