haoxuan
2024-04-28 094d2dcab7e057e5c4f5f96c30c164795a8d96cc
src/views/purchaseManage/purchase/components/AddPurchase.vue
@@ -230,6 +230,7 @@
          <div class="basic-info-title" style="display: flex">产品信息</div>
          <div class="product-view">
            <CommonFormTableView
              ref="tableRef"
              :detailEnter="editCommonConfig.detailEnter"
              :show-summary="showSummary"
              :recalculateShow="false"
@@ -338,7 +339,7 @@
<script>
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
import BomDialog from "@/components/makepager/BomDialog"
import { getProductList } from "@/api/productManage/product"
import { getProductListTwo } from "@/api/productManage/product"
import {
  addPurchase,
  updatePurchase,
@@ -636,7 +637,7 @@
              }
            } else {
              // 编辑
              getProductList({
              getProductListTwo({
                supplierId: this.editConfig.infomation.supplierId,
                page: 1,
                pageSize: 100
@@ -754,18 +755,20 @@
    },
    // 选择供应商
    async handleSelectClient(value, item) {
      this.$refs.tableRef.supplierId=item.id
      this.productTableList.supplierId = item.id
      if (value === "client") {
        this.supplierId = item.id
        this.editConfig.infomation.supplierId = item.id
      }
      await getProductList({
      await getProductListTwo({
        supplierId: item.id,
        page: 1,
        pageSize: 100
      }).then((res) => {
        if (res.code === 200) {
          this.productTableList.tableProductList = res.data.list
          this.$refs.tableRef.productList=res.data.list
          console.log(this.productTableList.tableProductList, "pop")
        }
      })
@@ -774,12 +777,14 @@
      this.editSelectSupplierConfig.editVisible = true
    },
    async selClient(row) {
      await getProductList({
      this.$refs.tableRef.supplierId=row.id
      await getProductListTwo({
        supplierId: row.id,
        page: 1,
        pageSize: 100
      }).then((res) => {
        if (res.code === 200) {
          this.$refs.tableRef.productList=res.data.list
          this.productTableList.tableProductList = res.data.list
        }
      })
@@ -789,11 +794,22 @@
      this.editConfig.infomation.supplierId = row.id
    },
    // 清除已选择用户
    clearupClient(value) {
    async clearupClient(value) {
      if (value == "client") {
        this.$refs.tableRef.supplierId=null
        this.$set(this.editConfig.infomation, "supplierName", "")
        this.supplierId = null
        this.$forceUpdate()
        await getProductListTwo({
        page: 1,
        pageSize: 100
      }).then((res) => {
        if (res.code === 200) {
          this.productTableList.tableProductList = res.data.list
          this.$refs.tableRef.productList=res.data.list
          console.log(this.productTableList.tableProductList, "pop")
        }
      })
      }
    },
    setTableForm() {