提现设置增加校验
This commit is contained in:
		
							parent
							
								
									79e7e5f087
								
							
						
					
					
						commit
						1a56534d28
					
				| @ -1,7 +1,7 @@ | |||||||
| <template> | <template> | ||||||
|   <div class="layout"> |   <div class="layout"> | ||||||
| 
 | 
 | ||||||
|     <Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate"> |     <Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate"> | ||||||
|       <FormItem label="提现审核是否开启"> |       <FormItem label="提现审核是否开启"> | ||||||
|         <i-switch v-model="formValidate.apply" style="margin-top:7px;"><span slot="open">开</span> |         <i-switch v-model="formValidate.apply" style="margin-top:7px;"><span slot="open">开</span> | ||||||
|           <span slot="close">关</span> |           <span slot="close">关</span> | ||||||
| @ -36,12 +36,8 @@ export default { | |||||||
|   data() { |   data() { | ||||||
|     return { |     return { | ||||||
|       result:"", |       result:"", | ||||||
|       formValidate: { // 表单数据 |       ruleValidate: {}, // 验证规则 | ||||||
|         apply: true, |       formValidate: {},// 表单数据 | ||||||
|         minPrice: "", |  | ||||||
|         type: "", |  | ||||||
|         wechatAppId: "", |  | ||||||
|       }, |  | ||||||
| 
 | 
 | ||||||
|       switchTitle: "提现审核是否开启", // 切换title |       switchTitle: "提现审核是否开启", // 切换title | ||||||
|     }; |     }; | ||||||
| @ -72,7 +68,29 @@ export default { | |||||||
|     // 实例化数据 |     // 实例化数据 | ||||||
|     init() { |     init() { | ||||||
|       this.result = JSON.parse(this.res); |       this.result = JSON.parse(this.res); | ||||||
|  |       Object.keys(this.result).map((item) => { | ||||||
|  |         this.result[item] += ""; | ||||||
|  |       }); | ||||||
|       this.$set(this, "formValidate", { ...this.result }); |       this.$set(this, "formValidate", { ...this.result }); | ||||||
|  |       Object.keys(this.formValidate).forEach((item) => { | ||||||
|  |         this.ruleValidate[item] = [ | ||||||
|  |           { | ||||||
|  |             required: true, | ||||||
|  |             message: "请填写必填项", | ||||||
|  |             trigger: "blur", | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             validator: (rule, value, callback) => { | ||||||
|  |               if (value < 0) { | ||||||
|  |                 callback(new Error("不能输入负数!")); | ||||||
|  |               } else { | ||||||
|  |                 callback(); | ||||||
|  |               } | ||||||
|  |             }, | ||||||
|  |             trigger: "change", | ||||||
|  |           }, | ||||||
|  |         ]; | ||||||
|  |       }); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 chc
						chc