|
@@ -22,7 +22,7 @@
|
|
/></el-form-item>
|
|
/></el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12"
|
|
<el-col :span="12"
|
|
- ><el-form-item label="服务费" prop="service_charge">
|
|
|
|
|
|
+ ><el-form-item label="服务费" prop="service_charge" style="padding-bottom:1px">
|
|
<digital-input
|
|
<digital-input
|
|
:values="ruleForm.service_charge"
|
|
:values="ruleForm.service_charge"
|
|
:placeholder="'服务费'"
|
|
:placeholder="'服务费'"
|
|
@@ -53,7 +53,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12"
|
|
<el-col :span="12"
|
|
- ><el-form-item label="服务费比例" prop="service_proportion">
|
|
|
|
|
|
+ ><el-form-item label="服务费比例" prop="service_proportion" style="padding-bottom:1px">
|
|
<digital-input
|
|
<digital-input
|
|
:values="ruleForm.service_proportion"
|
|
:values="ruleForm.service_proportion"
|
|
:placeholder="'服务费比例'"
|
|
:placeholder="'服务费比例'"
|
|
@@ -196,15 +196,12 @@ export default {
|
|
platform_name,
|
|
platform_name,
|
|
} = this.sitem;
|
|
} = this.sitem;
|
|
|
|
|
|
-
|
|
|
|
- console.log(this.sitem)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
this.cgd_charge = cgd_charge;
|
|
this.cgd_charge = cgd_charge;
|
|
this.price = price;
|
|
this.price = price;
|
|
const service = status + "" === "0" ? expect_service : service_charge;
|
|
const service = status + "" === "0" ? expect_service : service_charge;
|
|
const proportion =
|
|
const proportion =
|
|
status + "" === "0" ? expect_service_proportion : service_proportion;
|
|
status + "" === "0" ? expect_service_proportion : service_proportion;
|
|
|
|
+
|
|
this.is_determine_price = is_determine_price;
|
|
this.is_determine_price = is_determine_price;
|
|
this.ruleForm = {
|
|
this.ruleForm = {
|
|
id: id,
|
|
id: id,
|
|
@@ -225,21 +222,21 @@ export default {
|
|
const { code, label } = e;
|
|
const { code, label } = e;
|
|
this.ruleForm.companyCode = code ? [code] : [];
|
|
this.ruleForm.companyCode = code ? [code] : [];
|
|
this.ruleForm.companyName = label ? label : "";
|
|
this.ruleForm.companyName = label ? label : "";
|
|
- this.$refs.ruleForm.validateField("companyCode");
|
|
|
|
|
|
+ this.$refs.ruleForm && this.$refs.ruleForm.validateField("companyCode");
|
|
},
|
|
},
|
|
platform_codesearchChange(e) {
|
|
platform_codesearchChange(e) {
|
|
- console.log(e);
|
|
|
|
const { id, label } = e;
|
|
const { id, label } = e;
|
|
this.ruleForm.platform_id = id;
|
|
this.ruleForm.platform_id = id;
|
|
this.ruleForm.platform_name = label ? label : "";
|
|
this.ruleForm.platform_name = label ? label : "";
|
|
- this.$refs.ruleForm.validateField("platform_id");
|
|
|
|
|
|
+ this.$refs.ruleForm && this.$refs.ruleForm.validateField("platform_id");
|
|
},
|
|
},
|
|
async number_change(e, key) {
|
|
async number_change(e, key) {
|
|
|
|
+ console.log(e,key)
|
|
if(Number(this.ruleForm[key]) === e) {
|
|
if(Number(this.ruleForm[key]) === e) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.ruleForm[key] = e + "" || "0";
|
|
this.ruleForm[key] = e + "" || "0";
|
|
- this.$refs.ruleForm.validateField(key);
|
|
|
|
|
|
+ this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
|
|
await this.num(key);
|
|
await this.num(key);
|
|
},
|
|
},
|
|
async num(key) {
|
|
async num(key) {
|
|
@@ -253,12 +250,14 @@ export default {
|
|
} else {
|
|
} else {
|
|
cgdAdd = this.cgd_charge * 1;
|
|
cgdAdd = this.cgd_charge * 1;
|
|
}
|
|
}
|
|
|
|
+
|
|
if (key === "service_charge") {
|
|
if (key === "service_charge") {
|
|
serAdd = this.ruleForm.service_charge ?? "0" * 1;
|
|
serAdd = this.ruleForm.service_charge ?? "0" * 1;
|
|
}
|
|
}
|
|
if (key === "service_proportion") {
|
|
if (key === "service_proportion") {
|
|
rate = this.ruleForm.service_proportion ?? "0" * 1;
|
|
rate = this.ruleForm.service_proportion ?? "0" * 1;
|
|
}
|
|
}
|
|
|
|
+
|
|
if (is_sale && key === "service_charge") {
|
|
if (is_sale && key === "service_charge") {
|
|
if (qrdAdd <= serAdd) {
|
|
if (qrdAdd <= serAdd) {
|
|
this.$message.error("服务费不能大于等于销售单价!");
|
|
this.$message.error("服务费不能大于等于销售单价!");
|
|
@@ -271,6 +270,7 @@ export default {
|
|
rate = accMul(accSub(1, accDiv(cgdAdd, qrdAdd)), 100);
|
|
rate = accMul(accSub(1, accDiv(cgdAdd, qrdAdd)), 100);
|
|
await this.set_number_change("service_proportion", rate);
|
|
await this.set_number_change("service_proportion", rate);
|
|
}
|
|
}
|
|
|
|
+
|
|
if (is_sale && key === "service_proportion") {
|
|
if (is_sale && key === "service_proportion") {
|
|
if (rate === 100) {
|
|
if (rate === 100) {
|
|
this.$message.error("服务费比例不能等于100!");
|
|
this.$message.error("服务费比例不能等于100!");
|
|
@@ -289,6 +289,7 @@ export default {
|
|
await this.set_number_change("service_proportion", rate);
|
|
await this.set_number_change("service_proportion", rate);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ return
|
|
if (!is_sale && key === "service_proportion") {
|
|
if (!is_sale && key === "service_proportion") {
|
|
if (rate === 100) {
|
|
if (rate === 100) {
|
|
this.$message.error("服务费比例不能等于100!");
|
|
this.$message.error("服务费比例不能等于100!");
|
|
@@ -304,7 +305,7 @@ export default {
|
|
},
|
|
},
|
|
async set_number_change(key, value) {
|
|
async set_number_change(key, value) {
|
|
this.ruleForm[key] = value + "" || "0";
|
|
this.ruleForm[key] = value + "" || "0";
|
|
- this.$refs.ruleForm.validateField(key);
|
|
|
|
|
|
+ this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
|
|
},
|
|
},
|
|
async submitForm() {
|
|
async submitForm() {
|
|
console.log(this.ruleForm)
|
|
console.log(this.ruleForm)
|