祖安之光
2025-11-13 2405410a2df3178ebacdc241522fa9aaf28f4a34
src/views/work/qualityInfo/inventoryRecord/components/editDialog.vue
@@ -163,6 +163,7 @@
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)
@@ -208,7 +209,7 @@
  if(isAdmin){
    state.companyList = companyList
  }
  await getUserList()
  await getUserList(companyId)
  await getMaterials(companyId)
  state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
  state.form.companyId = companyId
@@ -384,19 +385,13 @@
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)
  }