| | |
| | | if (value) { |
| | | callback(); |
| | | } else { |
| | | callback(new Error('执法人员不能为空')) |
| | | callback() |
| | | } |
| | | } |
| | | const checkNumber = (rule, value, callback) => { |
| | | if (value) { |
| | | callback(); |
| | | } else { |
| | | callback(new Error('执法人员编号不能为空')) |
| | | callback() |
| | | } |
| | | } |
| | | return { |
| | |
| | | rules: { |
| | | contactWay: [ |
| | | { |
| | | required: true, trigger: 'blur', validator: checkPhone |
| | | required: false, trigger: 'blur', validator: checkPhone |
| | | } |
| | | ], |
| | | dispatchOpinion: [ |
| | |
| | | { required: true, trigger: 'change', validator: checkPerson } |
| | | ], |
| | | lawEnforcerName: [ |
| | | { required: true, trigger: 'change', validator: checkNumber } |
| | | { required: false, trigger: 'change', validator: checkNumber } |
| | | ], |
| | | }, |
| | | carOptions: [ |
| | |
| | | this.dispatch.lawEnforcer = ''; |
| | | this.dispatch.enforcementTeam = ''; |
| | | await this.getTeamList(id); |
| | | await this.getDepartUserList(id); |
| | | if(this.squadronOptions.length===0){ |
| | | await this.getDepartUserList(id); |
| | | } |
| | | }, |
| | | // 中队更改 |
| | | async handleMidChange(id) { |
| | |
| | | }, |
| | | // 人员更改 |
| | | async handlePerChange(id){ |
| | | await this.getLawUser(id); |
| | | let obj = await this.getLawUser(id); |
| | | this.dispatch.lawEnforcerName = obj.nickName; |
| | | this.dispatch.contactWay = obj.mobile; |
| | | }, |
| | | // 获取执法人员信息 |
| | | async getLawUser(id){ |
| | | let obj = {} |
| | | await this.$axios({ |
| | | method:'get', |
| | | url:`sccg/admin/${id}` |
| | | }) |
| | | .then(res=>{ |
| | | console.log(res); |
| | | obj = res.data; |
| | | }) |
| | | return obj; |
| | | } |
| | | } |
| | | } |