haoxuan
2023-12-22 446909448e77be9c61c072aa52178a50b8e8a292
报价单和销售明细单的产品信息新增为可以多选的功能
5个文件已修改
131 ■■■■ 已修改文件
src/components/makepager/CommonFormTableView.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/TableCommonView.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/other/commonDialog/SelectCommonDialog.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/quotation/AddQuotationDialog.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/salesDetails/AddSalesDetailsDialog.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue
@@ -201,6 +201,7 @@
      :edit-common-config="editSelCommonConfig"
      :quotationNumber="quotationNumber"
      @selClient="selClient"
      @getSelectArray="getSelectArray"
    />
  </div>
</template>
@@ -224,6 +225,11 @@
    pageName:{
      type:String,
      default:''
    },
    // 列表新增是否多选
    addTypeIdMultiple:{
      type:Boolean,
      default:false,
    },
    // 根据报价单查询产品
    quotationNumber:{
@@ -268,6 +274,7 @@
      tableList: [],
      editSelCommonConfig: {
        editVisible: false,
        isSelectBox:false,
        title: "",
        infomation: {}
      },
@@ -399,7 +406,13 @@
    },
    // 新增
    add() {
      this.$emit("addProductClick")
      if(this.addTypeIdMultiple){
        this.editSelCommonConfig.title = "产品名称"
        this.editSelCommonConfig.isSelectBox=true;
        this.editSelCommonConfig.editVisible = true
      }else{
        this.$emit("addProductClick")
      }
    },
    commonInputChange(val, prop, row,scope) {
      if (prop === "amount") {
@@ -487,6 +500,7 @@
      console.log(row, prop)
      this.productIndex = row.productId - 1
      this.editSelCommonConfig.title = "产品名称"
      this.editSelCommonConfig.isSelectBox=false;
      this.editSelCommonConfig.editVisible = true
    },
    selClient(item) {
@@ -505,6 +519,9 @@
        }
      })
    },
    getSelectArray(val){
      this.$emit("getSelectArray",val)
    },
    // 清除已选择用户
    clearupClient(row) {
      this.productIndex = row.productId - 1
src/components/makepager/TableCommonView.vue
@@ -18,8 +18,8 @@
      @row-click="tableRowClick"
      :row-class-name="tableRowClassName"
    >
      <el-table-column v-if="tableList.selectIndex" type="index" label="序号" width="50"></el-table-column>
      <el-table-column v-if="selectBox" type="selection" width="40"> </el-table-column>
      <el-table-column v-if="tableList.selectIndex" type="index" label="序号" width="50"></el-table-column>
      <el-table-column
        v-for="(item, i) in tableList.tableColumn"
        :key="i"
src/views/other/commonDialog/SelectCommonDialog.vue
@@ -31,9 +31,10 @@
        <TableCommonView
          ref="tableListRef"
          :table-list="tableList"
          :select-box="false"
          :select-box="editCommonConfig.isSelectBox"
          @selCommonClick="selNameClick"
          @selTableCol="selTableCol"
          @getSelectArray="getSelectArray"
        >
        </TableCommonView>
        <div slot="footer" class="dialog-footer">
@@ -42,6 +43,10 @@
            <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
          </div>
        </div>
      </div>
      <div slot="footer" class="dialog-footer" v-if="editCommonConfig.isSelectBox">
        <el-button type="primary" size="small" @click="saveClick()">确定</el-button>
        <el-button size="small" @click="editConfig.editVisible = false">取消</el-button>
      </div>
    </el-dialog>
  </div>
@@ -66,6 +71,7 @@
      default: () => {
        return {
          editVisible: false,
          isSelectBox:false,
          title: "",
          clientId: 0,
          client_name: "",
@@ -97,7 +103,8 @@
      keyword: "",
      keywordType: "",
      tableColumn: [],
      showCol: []
      showCol: [],
      selectArray:[],
    }
  },
  created() {
@@ -195,7 +202,7 @@
        this.searchSel = { value: "serviceNumber", label: "服务单编号" }
      } else if (this.editConfig.title === "产品名称") {
        this.tableColumn = [
          { label: "产品名称", prop: "name", isClick: true, default: true }, // 产品名称
          { label: "产品名称", prop: "name", isClick: this.editCommonConfig.isSelectBox?false:true, default: true }, // 产品名称
          { label: "产品编号", prop: "number" }
        ]
        this.showCol = ["产品名称", "产品编号"]
@@ -257,6 +264,14 @@
    selTableCol(val) {
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    },
    // 列表多选
    getSelectArray(val){
      this.selectArray=val;
    },
    saveClick(){
      this.$emit('getSelectArray',this.selectArray)
      this.editConfig.editVisible = false
    },
    // 请求数据
    async getData() {
@@ -491,6 +506,9 @@
      this.editConfig.editVisible = false
    },
    selNameClick(row) {
      if(this.editCommonConfig.isSelectBox){
        return true;
      }
      this.editConfig.editVisible = false
      if (this.editConfig.title === "销售总单") {
        this.$emit("selClient", row, "master")
src/views/sales/quotation/AddQuotationDialog.vue
@@ -250,9 +250,11 @@
            <CommonFormTableView
              :show-summary="showSummary"
              pageName="quotation"
              :addTypeIdMultiple="false"
              :product-table-list="productTableList"
              @inputContent="inputContent"
              @addProductClick="addProductClick"
              @getSelectArray="getSelectArray"
              @emptyProductClick="emptyProductClick"
              @recalculateProductClick="recalculateProductClick"
              @clearupProduct="clearupProduct"
@@ -664,21 +666,32 @@
    },
    // 产品新增
    addProductClick() {
      this.productId++
      this.tableData.push({
        productId: this.productId,
        id: 0,
        amount: 0,
        desc: "",
        name: "",
        number: "",
        price: 0,
        cost:'',
        profit:'',
        margin:'',
        total: 0,
        unit: ""
      })
      // this.productId++
      // this.tableData.push({
      //   productId: this.productId,
      //   id: 0,
      //   amount: 0,
      //   desc: "",
      //   name: "",
      //   number: "",
      //   price: 0,
      //   cost:'',
      //   profit:'',
      //   margin:'',
      //   total: 0,
      //   unit: ""
      // })
      // 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
    },
    //  产品清空
src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -407,6 +407,7 @@
              ref="commonFormTableView"
              :detail-enter="isView?true:false"
              :selectBox="false"
              :addTypeIdMultiple="false"
              :show-summary="showSummary"
              pageName="quotation"
              :isOperate="((autoCodeHeadersObj.Bjd=='yes'&&editConfig.infomation.quotation_number)||autoCodeHeadersObj.Bjd!='yes')?true:false"
@@ -414,6 +415,7 @@
              :product-table-list="productTableList"
              @inputContent="inputContent"
              @addProductClick="addProductClick"
              @getSelectArray="getSelectArray"
              @emptyProductClick="emptyProductClick"
              @clearupProduct="clearupProduct"
            ></CommonFormTableView>
@@ -995,21 +997,32 @@
    },
    // 产品新增
    addProductClick() {
      this.productId++
      this.tableData.push({
        productId: this.productId,
        id: 0,
        amount: 0,
        desc: "",
        name: "",
        number: "",
        price: 0,
        cost:'',
        profit:'',
        margin:'',
        total: 0,
        unit: ""
      })
      // this.productId++
      // this.tableData.push({
      //   productId: this.productId,
      //   id: 0,
      //   amount: 0,
      //   desc: "",
      //   name: "",
      //   number: "",
      //   price: 0,
      //   cost:'',
      //   profit:'',
      //   margin:'',
      //   total: 0,
      //   unit: ""
      // })
      // 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
    },
    //  产品清空