| | |
| | | |
| | | }) |
| | | } |
| | | //查看家庭信息 |
| | | export function getAllFamilys(){ |
| | | return request({ |
| | | url: '/family/all' , |
| | | method: 'get', |
| | | |
| | | }) |
| | | } |
| | |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="家庭号"> |
| | | <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择家庭号" /> |
| | | <el-select v-model="fid" placeholder="请选择家庭号"> |
| | | <el-option |
| | | v-for="item in famiInfo" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | |
| | | ></el-option> |
| | | </el-select> |
| | | |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user"; |
| | | import { listUser, getUser, delUser, addUser, updateUser, getAllFamilys,resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | |
| | | initPassword: undefined, |
| | | // 日期范围 |
| | | dateRange: [], |
| | | //家庭号 |
| | | famiInfo:[], |
| | | fid: undefined, |
| | | // 岗位选项 |
| | | postOptions: [], |
| | | // 角色选项 |
| | | roleOptions: [], |
| | | // 表单参数 |
| | | |
| | | form: {}, |
| | | defaultProps: { |
| | | children: "children", |
| | |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.getFamlilyInfo(); |
| | | this.getDeptTree(); |
| | | this.getConfigKey("sys.user.initPassword").then(response => { |
| | | this.initPassword = response.msg; |
| | | }); |
| | | }, |
| | | methods: { |
| | | getFamlilyInfo(){ |
| | | let _this = this |
| | | getAllFamilys().then(response => { |
| | | console.log(response.data) |
| | | _this.famiInfo = response.data |
| | | }) |
| | | }, |
| | | /** 查询用户列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | |
| | | submitForm: function() { |
| | | this.$refs["form"].validate(valid => { |
| | | alert(valid) |
| | | alert(this.fid) |
| | | if (valid) { |
| | | if (this.form.userId != undefined) { |
| | | updateUser(this.form).then(response => { |
| | |
| | | }); |
| | | }, |
| | | methods: { |
| | | /** 查看家庭号 */ |
| | | getFamilyInfo() |
| | | { |
| | | |
| | | }, |
| | | /** 查询用户列表 */ |
| | | getList() { |
| | | this.loading = true; |