haoxuan
2024-02-28 fb20919d312b7f3bf81805eda670f42fa2d18e39
src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -327,9 +327,11 @@
          <div class="product-view">
            <CommonFormTableView
              :show-summary="showSummary"
              :addTypeIdMultiple="true"
              :product-table-list="productTableList"
              @inputContent="inputContent"
              @addProductClick="addProductClick"
              @getSelectArray="getSelectArray"
              @emptyProductClick="emptyProductClick"
              @recalculateProductClick="recalculateProductClick"
              @clearupProduct="clearupProduct"
@@ -1000,17 +1002,28 @@
    },
    // 产品新增
    addProductClick() {
      this.productId++
      this.tableData.push({
        productId: this.productId,
        id: 0,
        amount: 0,
        desc: "",
        name: "",
        number: "",
        price: 0,
        total: 0
      })
      // this.productId++
      // this.tableData.push({
      //   productId: this.productId,
      //   id: 0,
      //   amount: 0,
      //   desc: "",
      //   name: "",
      //   number: "",
      //   price: 0,
      //   total: 0
      // })
      // this.showSummary.show = true
    },
    // 新增方式修改
    getSelectArray(val) {
      if (val.length > 0) {
        val.map((item, index) => {
          item.productId = this.tableData.length + index + 1
        })
      }
      this.tableData = this.tableData.concat(val)
      this.productTableList.tableData = this.tableData
      this.showSummary.show = true
    },
    //  产品清空