| | |
| | | <u--input type="password" v-model="userInfo.password" border="none" placeholder="请输入密码" clearable></u--input> |
| | | </u-form-item> |
| | | <u-form-item required label="账号状态" prop="isEnabled" borderBottom> |
| | | <u-switch v-model="userInfo.isEnabled" size="50"></u-switch> |
| | | <u-switch v-model="userInfo.isEnabled" size="50" @change="handleSwitchchange"></u-switch> |
| | | </u-form-item> |
| | | </u--form> |
| | | <u-button type="primary" text="提交" customStyle="margin-top: 50px" @click="submit"></u-button> |
| | |
| | | |
| | | }, |
| | | |
| | | async handleSwitchchange(e){ |
| | | if(this.userInfo.id){ |
| | | // 账号的启用,禁用 |
| | | const { |
| | | code,data |
| | | } = await this.$http.request('get', '/api/supplierSub/page/isEnable', { |
| | | params: { |
| | | id:this.userInfo.id |
| | | } |
| | | }) |
| | | if (code == 0) { |
| | | uni.$u.toast('状态修改成功!'); |
| | | } else { |
| | | this.userInfo.isEnabled=!e |
| | | uni.$u.toast('状态修改失败!'); |
| | | } |
| | | // 还是需要将状态信息重新获取下 |
| | | // const {code2,data2} =await this.getSubAccountById() |
| | | // if(code2==0){ |
| | | // this.userInfo.isEnabled=data2.isEnabled |
| | | // } |
| | | } |
| | | }, |
| | | |
| | | async getSubAccountById(){ |
| | | return await this.$http.request('get', '/api/supplierSub/getById', { |
| | | params: { |
| | | id:this.userInfo.id |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | |
| | | }, |
| | | } |
| | | </script> |