| | |
| | | <span>{{ parseTime(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
|
| | | <el-table-column label="操作" align="center" width="380" class-name="small-padding fixed-width">
|
| | | <template #default="scope">
|
| | | <!-- <el-tooltip content="修改" placement="top" v-if="scope.row.userId !== 1"> -->
|
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
|
| | |
| | | <!-- <el-tooltip content="重置支付密码" placement="top" v-if="scope.row.userId !== 1">
|
| | | <el-button link type="danger" icon="Key" @click="handlePayPwd(scope.row)" v-hasPermi="['system:user:resetPwd']"></el-button>
|
| | | </el-tooltip> -->
|
| | | <el-button link type="success" icon="Key" @click="handlerDept(scope.row)" v-hasPermi="['system:user:resetPwd']">分管机构</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
| | | </div>
|
| | | </template>
|
| | | </el-dialog>
|
| | | <!-- 多机构绑定 -->
|
| | | <el-dialog title="分管机构" v-model="openDialog" width="400px" append-to-body>
|
| | | <el-tree :data="treeData" ref="depttree" :default-expanded-keys="defaultKeys" :props="{label: 'deptName', value: 'deptId', children: 'child' }" node-key="deptId" :default-checked-keys="defaultKeys" show-checkbox>
|
| | |
|
| | | </el-tree>
|
| | | <template #footer>
|
| | | <div class="dialog-footer">
|
| | | <el-button type="primary" @click="submitFileFormSave">确 定</el-button>
|
| | | <el-button @click="openDialog = false">取 消</el-button>
|
| | | </div>
|
| | | </template>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script setup name="User">
|
| | | import { getToken } from "@/utils/auth";
|
| | | import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser, addUser, deptTreeSelect, resetPayPwd,updateUserProfile } from "@/api/system/user";
|
| | |
|
| | | import { batchUserDeptView,batchUserDeptTree,batchUserDeptSave } from '@/api/system/company/company'
|
| | | const router = useRouter();
|
| | | const { proxy } = getCurrentInstance();
|
| | | const { sys_normal_disable, sys_user_sex } = proxy.useDict("sys_normal_disable", "sys_user_sex");
|
| | |
| | |
|
| | | getDeptTree();
|
| | | // getList();
|
| | | const openDialog = ref(false)
|
| | | const userInfo = reactive({
|
| | | userId: "",
|
| | |
|
| | | })
|
| | | const treeData = ref([])
|
| | | const defaultKeys = ref([])
|
| | | const depttree = ref()
|
| | | function handlerDept(item) {
|
| | | userInfo.userId = item.userId
|
| | | openDialog.value = true
|
| | | batchUserDeptTreeHttp(item.deptId)
|
| | | batchUserDeptViewHttp(userInfo.userId)
|
| | | }
|
| | | function batchUserDeptViewHttp(userId) {
|
| | | batchUserDeptView({userId}).then(val => {
|
| | | defaultKeys.value = val.data.deptIds
|
| | | })
|
| | | }
|
| | | function batchUserDeptTreeHttp(deptId) {
|
| | | batchUserDeptTree({deptId}).then(val => {
|
| | | val.data.child.forEach(item => {
|
| | | // item.disabled = true
|
| | | if(item.deptId == deptId) {
|
| | | item.disabled = true
|
| | | }
|
| | | })
|
| | | treeData.value = [val.data]
|
| | | })
|
| | | }
|
| | | function submitFileFormSave() {
|
| | | userInfo.deptIds = depttree.value.getCheckedKeys()
|
| | | batchUserDeptSave(userInfo).then(val => {
|
| | | if(val.code == 200){
|
| | | openDialog.value = false
|
| | | }
|
| | | })
|
| | | }
|
| | | </script>
|