diff --git a/src/api/common/user.js b/src/api/common/user.js new file mode 100644 index 0000000..0ad5564 --- /dev/null +++ b/src/api/common/user.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +// 根据岗位查询用户信息 +export function getUserByPost(query) { + return request({ + url: '/userPost/getUser', + method: 'get', + params: query + }) +} diff --git a/src/views/biosafety/deworm/index.vue b/src/views/biosafety/deworm/index.vue index 8581e40..28589db 100644 --- a/src/views/biosafety/deworm/index.vue +++ b/src/views/biosafety/deworm/index.vue @@ -2,7 +2,7 @@
- +
- - + + + {{ item.label }} + + + 搜索 重置 @@ -165,10 +170,15 @@ - - - - + + + + + {{ item.label }} + + +
@@ -269,10 +279,15 @@ - - - - + + + + + {{ item.label }} + + +
@@ -345,6 +360,7 @@ import { searchEarNumbers } from '@/api/common/sheep' import request from '@/utils/request' import { parseTime } from '@/utils/ruoyi' + import { getUserByPost } from '@/api/common/user' const { proxy } = getCurrentInstance() const { sheep_gender } = proxy.useDict('sheep_gender') @@ -355,6 +371,8 @@ const total = ref(0) const dewormList = ref([]) const daterangeDatetime = ref([]) + const technicalOptions = ref([]) + const queryParams = reactive({ pageNum: 1, @@ -729,6 +747,27 @@ function handleAddDetail() { usageDetails.value.push({ mediId: null, dosage: 0, unit: null, usageId: null,manufacturer:null,batchNumber:null }) } + // 获取技术员列表 + const fetchTechnicalList = () => { + getUserByPost({ postCode: "techs" }) + .then(res => { + if (res.code === 200 && Array.isArray(res.data)) { + technicalOptions.value = res.data.map(item => ({ + // value: item.userId, + value: item.nickName, + label: item.nickName, + // postName: item.postName, // 保留用于下拉显示 + // postCode: item.postCode // 保留用于逻辑判断 + })) + console.log(technicalOptions.value); + + } else { + technicalOptions.value = [] + ElMessage.warning(res.msg || '获取技术员列表失败') + } + }) + + } /* ------------------ 初始化 ------------------ */ onMounted(() => { @@ -747,6 +786,8 @@ listMedicine().then(res => { medicines.value = res.rows.map(item => ({ value: item.id, label: item.name })) }) + fetchTechnicalList() + })