yangfeng
2024-02-05 d8513d7c279f9a6ea37f25b616046d4376e8fe6a
src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -91,8 +91,17 @@
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="销售机会" prop="sale_chance_name"
                :rules="[{ required: autoCodeHeadersObj.Ywjh=='yes'?true:false, message: '请选择销售机会', trigger: 'change' }]">
                <el-form-item
                  label="销售机会"
                  prop="sale_chance_name"
                  :rules="[
                    {
                      required: autoCodeHeadersObj.Ywjh == 'yes' ? true : false,
                      message: '请选择销售机会',
                      trigger: 'change'
                    }
                  ]"
                >
                  <div class="custom-name">
                    <el-autocomplete
                      style="width: 100%"
@@ -161,8 +170,17 @@
                </el-form-item>
              </el-col> -->
              <el-col :span="12">
                <el-form-item label="销售报价单" prop="quotation_number"
                :rules="[{ required: autoCodeHeadersObj.Bjd=='yes'?true:false, message: '请选择销售报价单', trigger: 'change' }]">
                <el-form-item
                  label="销售报价单"
                  prop="quotation_number"
                  :rules="[
                    {
                      required: autoCodeHeadersObj.Bjd == 'yes' ? true : false,
                      message: '请选择销售报价单',
                      trigger: 'change'
                    }
                  ]"
                >
                  <div class="custom-name">
                    <el-autocomplete
                      v-model="editConfig.infomation.quotation_number"
@@ -412,7 +430,12 @@
              :addTypeIdMultiple="true"
              :show-summary="showSummary"
              pageName="quotation"
              :isOperate="((autoCodeHeadersObj.Bjd=='yes'&&editConfig.infomation.quotation_number)||autoCodeHeadersObj.Bjd!='yes')?true:false"
              :isOperate="
                (autoCodeHeadersObj.Bjd == 'yes' && editConfig.infomation.quotation_number) ||
                autoCodeHeadersObj.Bjd != 'yes'
                  ? true
                  : false
              "
              :quotationNumber="autoCodeHeadersObj.Bjd=='yes'?editConfig.infomation.quotation_number:''"
              :product-table-list="productTableList"
              @inputContent="inputContent"
@@ -606,13 +629,13 @@
      thatMember: {},
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() <  Date.now() - 8.64e7;
        },
          return time.getTime() < Date.now() - 8.64e7
        }
      },
      pickerOptionsBefore:{
        disabledDate(time) {
          return time.getTime() >  Date.now();
        },
          return time.getTime() > Date.now()
        }
      }
    }
  },
@@ -624,7 +647,7 @@
    this.setTableForm()
    this.getCommonData()
    this.formInfo()
    this.getUseSystemSet({modeType:'xsmx'})
    this.getUseSystemSet({ modeType: "xsmx" })
    if (this.editConfig.title === "编辑") {
      this.productTableList.tableData = this.editConfig.infomation.products
    }
@@ -692,11 +715,10 @@
          } else {
            for (let i = 0; i < this.tableData.length; i++) {
              if (this.tableData[i].cost) {
                let reg =
            /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
                let reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
                if(!reg.test(this.tableData[i].cost)){
                  this.$message.error("成本单价需要填写大于0的2位小数!")
                  return true;
                  return true
                }
              }
            }
@@ -790,7 +812,6 @@
          if (value === "全部产品") {
            // this.quotationList.map((item) => {
              // if (item.id === this.editConfig.infomation.quotationId) {
              //   this.tableData.map((item, index) => {
              //     item.productId = index + 1
              //     this.tableData.forEach((key) => {
@@ -800,7 +821,6 @@
              //       }
              //     })
              //   })
              // }
            // })
          }
@@ -963,9 +983,9 @@
            name: "",
            number: "",
            price: 0,
            cost:'',
            profit:'',
            margin:'',
            cost: "",
            profit: "",
            margin: "",
            total: 0,
            unit: ""
          }
@@ -979,14 +999,16 @@
      }
      // let productData = this.quotationList.products
      let isBjdRequird=false
      if(this.autoCodeHeadersObj.Bjd=='yes'){
      if (this.autoCodeHeadersObj.Bjd == "yes") {
        isBjdRequird=true
      }
      this.productTableList = {
        tableData: this.tableData,
        tableColumn: [
          { label: "#", prop: "productId", width: 40 },
          { label: "产品名称", prop: "name", productName: true, isRequird: true,min:110, },
          { label: "产品名称", prop: "name", productName: true, isRequird: true, min: 110 },
          { label: "规格", prop: "specs" },
          { label: "型号", prop: "type" },
          { label: "产品编号", prop: "number" },
          { label: "单位", prop: "unit" },
          { label: "销售单价", prop: "price",inputFloat: !isBjdRequird, isRequird: true },
@@ -1033,7 +1055,7 @@
          item.productId = this.tableData.length + index+1
        })
      }
      this.tableData=this.tableData.concat(val);
      this.tableData = this.tableData.concat(val)
      this.productTableList.tableData=this.tableData
      this.showSummary.show = true
    },
@@ -1049,9 +1071,9 @@
          name: "",
          number: "",
          price: 0,
          cost:'',
          profit:'',
          margin:'',
          cost: "",
          profit: "",
          margin: "",
          total: 0,
          unit: ""
        }