haoxuan
2023-10-17 c58678b4bed3394da8cc90cd6e2c580da4741dde
src/views/sales/quotation/AddQuotationDialog.vue
@@ -356,12 +356,13 @@
      editConfig: this.editCommonConfig,
      rules: {
        number: [{ required: true, message: "请输入", trigger: "blur" }],
        quotationName: [{ required: true, message: "请输入", trigger: "blur" }],
        quotation_status_id: [{ required: true, message: "请选择", trigger: "change" }],
        sale_chance_name: [{ required: true, message: "请选择销售机会", trigger: "blur" }],
        sale_chance_name: [{ required: true, validator: this.checkChance, trigger: "change" }],
        member_id: [{ required: true, message: "请选择负责人", trigger: "change" }]
      },
      memberOptions: [],
      quotationStatusOptions: [{ id: 1, name: "不知道" }], // 报价单状态
      quotationStatusOptions: [], // 报价单状态
      currencyOptions: [{ id: 1, name: "人民币" }], // 币种
      approvalWorkflowOptions: [], // 审批流程
      productTableList: {},
@@ -442,6 +443,7 @@
    // 保存
    saveClick(formName) {
      this.$refs[formName].validate((valid) => {
        this.validateFormNumber()
        if (valid) {
          for (let i = 0; i < this.tableData.length; i++) {
            if (this.tableData[i].name.length === 0) {
@@ -495,7 +497,7 @@
      let data = this.editConfig.infomation
      let params = {
        id: this.editConfig.title === "新建" ? 0 : data.id,
        quotationName: this.quotationName || "",
        quotationName: data.quotationName || "",
        conditions: data.conditions || "",
        file: data.file || "",
        member_id: data.member_id || 0,
@@ -505,7 +507,8 @@
        validity_date: data.validity_date || "",
        products: this.tableData,
        codeStandID: data.ID,
        codeRule: this.codeRule
        codeRule: this.codeRule,
        client_id: this.clientId || 0
      }
      return params
    },
@@ -659,6 +662,14 @@
    clearupProduct(data) {
      this.tableData = data
      this.productTableList.tableData = this.tableData
    },
    // 订单编码单独校验
    checkChance(rule, value, callback) {
      if (this.editConfig.infomation.sale_chance_name && this.editConfig.infomation.sale_chance_name.length > 0) {
        callback()
      } else {
        callback(new Error("请选择销售机会"))
      }
    }
  }
}