| | |
| | | import {listUser} from "@/api/system/user"; |
| | | import {getWarehousingRecordDetail, updateWarehousingRecord} from "@/api/outsourcingCooperate/outsourcingCooperate"; |
| | | import {getMaterialList} from "@/api/outsourcingCooperate/outsourcingCooperate"; |
| | | import {getEmployeeRecords} from "@/api/onlineEducation/user"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | const emit = defineEmits(["getList"]); |
| | | const dialogVisible = ref(false) |
| | |
| | | if(isAdmin){ |
| | | state.companyList = companyList |
| | | } |
| | | await getUserList() |
| | | await getUserList(companyId) |
| | | await getMaterials(companyId) |
| | | state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' |
| | | state.form.companyId = companyId |
| | |
| | | const getDeptList = async ()=>{ |
| | | state.form.materialId = null |
| | | await getMaterials(state.form.companyId) |
| | | await getUserList(state.form.companyId) |
| | | } |
| | | |
| | | const getUserList = async ()=> { |
| | | const res = await listUser({pageIndex: 1,pageSize: 999}) |
| | | const getUserList = async (companyId)=> { |
| | | const res = await getEmployeeRecords({companyId: companyId}) |
| | | if(res.code == 200){ |
| | | state.userList = res.data.list?res.data.list.map(item=>{ |
| | | const user = item.id |
| | | const {id, ...data} = item |
| | | return { |
| | | ...data, |
| | | userId: user |
| | | } |
| | | }):[] |
| | | state.userList = res.data.list?res.data.list:[] |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |