|
|
@@ -39,7 +39,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="折扣(%):" prop="discountrate">
|
|
|
- <el-input type="number" size="small" v-model="form.discountrate" placeholder="请输入0-100%" @change="discountrateChange"></el-input>
|
|
|
+ <el-input size="small" v-model="form.discountrate" placeholder="请输入0-100%" @change="discountrateChange"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -139,7 +139,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="折扣(%):" prop="discountrate" >
|
|
|
- <el-input type="number" size="small" v-model="form.discountrate" placeholder="请输入0-100%" @change="discountrateChange"></el-input>
|
|
|
+ <el-input size="small" v-model="form.discountrate" placeholder="请输入0-100%" @change="discountrateChange"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -244,7 +244,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="折扣(%):" prop="discountrate" >
|
|
|
- <el-input type="number" size="small" v-model="form.discountrate" placeholder="请输入0-100%" @change="discountrateChange"></el-input>
|
|
|
+ <el-input size="small" v-model="form.discountrate" placeholder="请输入0-100%" @change="discountrateChange"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -348,7 +348,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="折扣(%):" prop="discountrate" >
|
|
|
- <el-input type="number" size="small" v-model="form.discountrate" placeholder="请输入0-100%" @change="discountrateChange"></el-input>
|
|
|
+ <el-input size="small" v-model="form.discountrate" placeholder="请输入0-100%" @change="discountrateChange"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -576,12 +576,12 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24" v-if="form.calculatemodel==1">
|
|
|
<el-form-item label="订单金额比例(%):" prop="orderratio" >
|
|
|
- <el-input type="number" size="small" v-model.number="form.orderratio" placeholder="请输入0-100%" @change="orderratioChange"></el-input>
|
|
|
+ <el-input size="small" v-model.number="form.orderratio" placeholder="请输入0-100%" @change="orderratioChange"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24" v-if="form.calculatemodel==2">
|
|
|
<el-form-item label="居间产品折扣(%):" prop="productdiscount">
|
|
|
- <el-input type="number" size="small" v-model.number="form.productdiscount" placeholder="请输入0-100%" @change="productdiscountChange"></el-input>
|
|
|
+ <el-input size="small" v-model.number="form.productdiscount" placeholder="请输入0-100%" @change="productdiscountChange"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -635,7 +635,9 @@ export default {
|
|
|
callback()
|
|
|
}
|
|
|
var NumberSize = (rule, value, callback) => {
|
|
|
- if (+value > 100 || +value <= 0 && value) {
|
|
|
+ if (isNaN(parseFloat(value))){
|
|
|
+ return callback(new Error('输入不合法,请输入数值'))
|
|
|
+ }else if (+value > 100 || +value <= 0 && value) {
|
|
|
return callback(new Error('折扣范围(1-100%)'));
|
|
|
}
|
|
|
callback()
|
|
|
@@ -730,13 +732,15 @@ export default {
|
|
|
{ required: true, message: '请填写签约时间', trigger: 'change' },
|
|
|
],
|
|
|
productdiscount: [
|
|
|
- { message: '必须为数字', type:'number', trigger: 'change' },
|
|
|
+ /* { message: '必须为数字', type:'number', trigger: 'change' },*/
|
|
|
+ { pattern:/^[0-9]+\.{0,1}[0-9]{0,4}$/,message: '输入不合法,请输入数值',trigger: 'change'},
|
|
|
{ required: true, message: '请填写折扣', trigger: 'blur' },
|
|
|
/*{ validator: checkNumber, trigger: 'blur'},*/
|
|
|
{ validator: NumberSize, trigger: 'blur'}
|
|
|
],
|
|
|
orderratio: [
|
|
|
- { message: '必须为数字', type:'number', trigger: 'change' },
|
|
|
+ /* { message: '必须为数字', type:'number', trigger: 'change' },*/
|
|
|
+ { pattern:/^[0-9]+\.{0,1}[0-9]{0,4}$/,message: '输入不合法,请输入数值',trigger: 'change'},
|
|
|
{ required: true, message: '请填写折扣', trigger: 'blur' },
|
|
|
/* { validator: checkNumber, trigger: 'blur'},*/
|
|
|
{ validator: NumberSize, trigger: 'blur'}
|
|
|
@@ -746,6 +750,7 @@ export default {
|
|
|
],
|
|
|
discountrate: [
|
|
|
/* { validator: checkNumber, trigger: 'blur'},*/
|
|
|
+ { pattern:/^[0-9]+\.{0,1}[0-9]{0,4}$/,message: '输入不合法,请输入数值',trigger: 'change'},
|
|
|
{ validator: NumberSize, trigger: 'blur'}
|
|
|
],
|
|
|
},
|
|
|
@@ -870,6 +875,11 @@ export default {
|
|
|
"id":20221121185302,
|
|
|
"content": this.form
|
|
|
})
|
|
|
+ if (res.code == 0){
|
|
|
+ this.form.discountrate = this.form.discountrate * 100
|
|
|
+ this.form.productdiscount = this.form.productdiscount * 100
|
|
|
+ this.form.orderratio = this.form.orderratio * 100
|
|
|
+ }
|
|
|
this.tool.showMessage(res,() => {
|
|
|
this.$store.commit('setLoading',false)
|
|
|
this.$refs.form.resetFields()
|
|
|
@@ -885,6 +895,11 @@ export default {
|
|
|
"id":20221121185302,
|
|
|
"content": this.form
|
|
|
})
|
|
|
+ if (res.code == 0){
|
|
|
+ this.form.discountrate = this.form.discountrate * 100
|
|
|
+ this.form.productdiscount = this.form.productdiscount * 100
|
|
|
+ this.form.orderratio = this.form.orderratio * 100
|
|
|
+ }
|
|
|
this.tool.showMessage(res,() => {
|
|
|
this.$store.commit('setLoading',false)
|
|
|
this.$refs.form.resetFields()
|
|
|
@@ -909,6 +924,11 @@ export default {
|
|
|
"id":20221121185302,
|
|
|
"content": this.form
|
|
|
})
|
|
|
+ if (res.code == 0){
|
|
|
+ this.form.discountrate = this.form.discountrate * 100
|
|
|
+ this.form.productdiscount = this.form.productdiscount * 100
|
|
|
+ this.form.orderratio = this.form.orderratio * 100
|
|
|
+ }
|
|
|
this.tool.showMessage(res,() => {
|
|
|
this.$store.commit('setLoading',false)
|
|
|
this.$refs.form.resetFields()
|
|
|
@@ -1118,13 +1138,22 @@ export default {
|
|
|
console.log(this.payTypeData,'处理后数据')
|
|
|
},
|
|
|
discountrateChange(){
|
|
|
- this.form.discountrate = Math.round(this.form.discountrate * 100)/100
|
|
|
+ let discountrate = parseFloat(this.form.discountrate)
|
|
|
+ if (!isNaN(discountrate)){
|
|
|
+ this.form.discountrate = Math.round(this.form.discountrate * 100)/100
|
|
|
+ }
|
|
|
},
|
|
|
orderratioChange(){
|
|
|
- this.form.orderratio = Math.round(this.form.orderratio * 100)/100
|
|
|
+ let orderratio = parseFloat(this.form.orderratio)
|
|
|
+ if (!isNaN(orderratio)){
|
|
|
+ this.form.orderratio = Math.round(this.form.orderratio * 100)/100
|
|
|
+ }
|
|
|
},
|
|
|
productdiscountChange(){
|
|
|
- this.form.productdiscount = Math.round(this.form.productdiscount * 100)/100
|
|
|
+ let productdiscount = parseFloat(this.form.productdiscount)
|
|
|
+ if (!isNaN(productdiscount)){
|
|
|
+ this.form.productdiscount = Math.round(this.form.productdiscount * 100)/100
|
|
|
+ }
|
|
|
},
|
|
|
/*获取客户负责人*/
|
|
|
async queryCustomerLeader(id){
|