|
@@ -65,17 +65,25 @@
|
|
|
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="期望服务费比例" prop="expect_service_proportion" label-width="125px">
|
|
|
- <el-input :disabled="type === 'view'" v-model="ruleForm.expect_service_proportion" placeholder="服务费比例"
|
|
|
+ <!-- <el-input :disabled="type === 'view'" v-model="ruleForm.expect_service_proportion" placeholder="服务费比例"
|
|
|
@input="handleProportionrChange">
|
|
|
- <!-- <template #append>%</template> -->
|
|
|
- </el-input>
|
|
|
+ <template #append>%</template>
|
|
|
+ </el-input> -->
|
|
|
+
|
|
|
+ <digital-input :values="ruleForm.expect_service_proportion" :placeholder="'销售价'" :min="0" :disabled="type === 'view' || is_noble"
|
|
|
+ :max="100000000000" :position="'right'" :precision="2" :size="'mini'" :controls="false" :append="'%'"
|
|
|
+ @reschange="handleProportionrChange" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="期望服务费" prop="expect_service" label-width="95px">
|
|
|
- <el-input :disabled="type === 'view'" v-model="ruleForm.expect_service" placeholder="期望服务费"
|
|
|
- @input="handleExpectChange" />
|
|
|
+ <!-- <el-input :disabled="type === 'view'" v-model="ruleForm.expect_service" placeholder="期望服务费"
|
|
|
+ @input="handleExpectChange" /> -->
|
|
|
+
|
|
|
+ <digital-input :values="ruleForm.expect_service" :placeholder="'销售价'" :min="0" :disabled="type === 'view' || is_noble"
|
|
|
+ :max="100000000000" :position="'right'" :precision="2" :size="'mini'" :controls="false" :append="'元'"
|
|
|
+ @reschange="handleExpectChange" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -979,12 +987,12 @@ export default {
|
|
|
|
|
|
//没有期望服务费存在服务费比例 重新计算期望服务费
|
|
|
if(!Number(expect_service) && Number(expect_service_proportion)){
|
|
|
- this.handleProportionrChange();
|
|
|
+ this.handleProportionrChange(expect_service_proportion);
|
|
|
}
|
|
|
|
|
|
- //没有期望服务费存在服务费比例 重新计算服务费比例
|
|
|
- if(!Number(expect_service_proportion) && Number(expect_service)){
|
|
|
- this.handleExpectChange();
|
|
|
+ //没有期望服务费存在服务费比例或者两个都存在 以期望服务费计算服务费比例
|
|
|
+ if(!Number(expect_service_proportion) && Number(expect_service) || Number(expect_service_proportion) && Number(expect_service)){
|
|
|
+ this.handleExpectChange(expect_service);
|
|
|
}
|
|
|
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
@@ -1047,6 +1055,9 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleProportionrChange(e) {
|
|
|
+ this.ruleForm.expect_service_proportion = e;
|
|
|
+ this.$refs.ruleForm.validateField("expect_service_proportion");
|
|
|
+
|
|
|
const { price, cgd_charge, is_determine_price, expect_service_proportion } = this.ruleForm;
|
|
|
const prop = is_determine_price === '1' ? 'price' : 'cgd_charge';
|
|
|
|
|
@@ -1064,7 +1075,10 @@ export default {
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
|
|
|
- handleExpectChange() {
|
|
|
+ handleExpectChange(e) {
|
|
|
+ this.ruleForm.expect_service = e;
|
|
|
+ this.$refs.ruleForm.validateField("expect_service");
|
|
|
+
|
|
|
const { price, cgd_charge, is_determine_price, expect_service } = this.ruleForm;
|
|
|
if (!expect_service) return
|
|
|
|
|
@@ -1080,6 +1094,8 @@ export default {
|
|
|
|
|
|
this.ruleForm.expect_service_proportion = Number(this.ruleForm[prop]) === 0 || !this.ruleForm[prop] ? '0' : accMul(accDiv(expect_service, this.ruleForm[prop]),100)
|
|
|
this.$refs.ruleForm.validate('expect_service_proportion');
|
|
|
+
|
|
|
+ console.log( this.ruleForm.expect_service_proportion);
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
|