@@ -154,7 +156,7 @@ import { listRanch } from '@/api/produce/manage_sheep/trans_group'
import { listSheepfold_management as listSheepfold } from '@/api/fileManagement/sheepfold_management'
import { getToken } from '@/utils/auth'
import { UploadFilled } from '@element-plus/icons-vue'
-
+import { getUserByPost } from '@/api/common/user'
const { proxy } = getCurrentInstance()
const form = ref({
@@ -178,6 +180,27 @@ const formRef = ref(null)
const sheepfoldOptions = ref([])
const varietyOptions = ref([])
const ranchOptions = ref([])
+// 技术员下拉选项
+const technicalOptions = ref([])
+
+// 获取技术员列表(岗位编码:techs)
+const fetchTechnicalList = () => {
+ getUserByPost({ postCode: "techs" })
+ .then(res => {
+ if (res.code === 200 && Array.isArray(res.data)) {
+ technicalOptions.value = res.data.map(item => ({
+ value: item.nickName,
+ label: item.nickName
+ }))
+ } else {
+ technicalOptions.value = []
+ }
+ })
+ .catch(() => {
+ technicalOptions.value = []
+ })
+}
+
const rules = {
earNumber: [
{ required: true, message: '请输入耳号', trigger: 'blur' },
@@ -380,6 +403,7 @@ onMounted(() => {
loadSheepTypeList()
loadRanchList()
getVarietyOptions()
+ fetchTechnicalList()
})
diff --git a/src/views/produce/manage_sheep/changeComment/index.vue b/src/views/produce/manage_sheep/changeComment/index.vue
index bab1b93..037fba8 100644
--- a/src/views/produce/manage_sheep/changeComment/index.vue
+++ b/src/views/produce/manage_sheep/changeComment/index.vue
@@ -64,8 +64,9 @@
-->
-
+
+
+
@@ -152,14 +153,17 @@
-
+
-
+
+
+
@@ -179,6 +183,7 @@ import { listSheepfold_management as listSheepfold } from '@/api/fileManagement/
import dayjs from 'dayjs'
import { nextTick } from 'vue'
import { Plus, Delete, ArrowUp, ArrowDown } from '@element-plus/icons-vue'
+import { getUserByPost } from '@/api/common/user'
const { proxy } = getCurrentInstance()
const changeCommentList = ref([])
@@ -198,6 +203,27 @@ const isExpanded = ref(false) // 折叠状态
const defaultShowCount = 2 // 默认展示条数
const batchTags = ref([]) // 本次要新增的多条耳号
const batchSheep = ref([]) // 对应的羊只对象
+// 技术员下拉选项
+const technicalOptions = ref([])
+
+// 获取技术员列表(岗位编码:techs)
+const fetchTechnicalList = () => {
+ getUserByPost({ postCode: "techs" })
+ .then(res => {
+ if (res.code === 200 && Array.isArray(res.data)) {
+ technicalOptions.value = res.data.map(item => ({
+ value: item.nickName,
+ label: item.nickName
+ }))
+ } else {
+ technicalOptions.value = []
+ }
+ })
+ .catch(() => {
+ technicalOptions.value = []
+ })
+}
+
/* 计算:控制实际展示的耳号 */
const displayedEarTags = computed(() => {
const list = queryParams.value.manageTagsList
@@ -489,10 +515,9 @@ function clearBatchTags() {
form.value.oldComment = ''
}
-/* 计算属性:实时显示已选数量(可选) */
-const batchCount = computed(() => batchTags.value.length)
onMounted(() => {
getSheepfoldOptions();
+ fetchTechnicalList();
getList();
});
diff --git a/src/views/produce/manage_sheep/changeEar/index.vue b/src/views/produce/manage_sheep/changeEar/index.vue
index 01ed427..869f539 100644
--- a/src/views/produce/manage_sheep/changeEar/index.vue
+++ b/src/views/produce/manage_sheep/changeEar/index.vue
@@ -59,8 +59,9 @@
style="max-width: 160px;" />
-
+
+
+
@@ -155,10 +156,13 @@
-
+
-
+
+
+
{
+ getUserByPost({ postCode: "techs" })
+ .then(res => {
+ if (res.code === 200 && Array.isArray(res.data)) {
+ technicalOptions.value = res.data.map(item => ({
+ value: item.nickName,
+ label: item.nickName
+ }))
+ } else {
+ technicalOptions.value = []
+ }
+ })
+ .catch(() => {
+ technicalOptions.value = []
+ })
+}
const changeEarList = ref([])
const open = ref(false)
const loading = ref(true)
@@ -240,9 +264,6 @@ const data = reactive({
],
eventDate: [
{ required: true, message: "请选择事件日期", trigger: "change" }
- ],
- comment: [
- { required: true, message: "请输入备注", trigger: "blur" }
]
}
})
@@ -417,7 +438,6 @@ function fetchOldTag() {
if (!earNumber || earType === null) {
form.value.oldTag = '';
form.value.sheepId = null;
- form.value.comment = '';
return;
}
@@ -429,20 +449,16 @@ function fetchOldTag() {
if (!sheep || !sheep.id) {
form.value.oldTag = '';
form.value.sheepId = null;
- form.value.comment = '';
proxy.$modal.warning("未找到对应的羊只");
return;
}
form.value.oldTag = oldTag;
form.value.sheepId = sheep.id;
-
- form.value.comment = sheep.comment || '';
}).catch(error => {
console.error("查询失败:", error);
form.value.oldTag = '';
form.value.sheepId = null;
- form.value.comment = '';
proxy.$modal.error("查询耳号失败,请重试");
});
}
@@ -531,6 +547,7 @@ function removeEarNumber(tag) {
onMounted(() => {
getSheepfoldOptions();
getList();
+ fetchTechnicalList();
});
diff --git a/src/views/produce/manage_sheep/changeVariety/index.vue b/src/views/produce/manage_sheep/changeVariety/index.vue
index 0582db4..28aeedc 100644
--- a/src/views/produce/manage_sheep/changeVariety/index.vue
+++ b/src/views/produce/manage_sheep/changeVariety/index.vue
@@ -67,8 +67,9 @@
-->
-
+
+
+
@@ -156,7 +157,7 @@
-
+
@@ -168,10 +169,13 @@
:disabled="!isAdd" />
-
+
+
+
-
-
+
+
@@ -191,8 +195,28 @@ import { listVariety } from '@/api/fileManagement/variety'
import dayjs from 'dayjs'
import { nextTick } from 'vue'
import { Plus, Delete, ArrowUp, ArrowDown } from '@element-plus/icons-vue'
+import { getUserByPost } from '@/api/common/user'
const { proxy } = getCurrentInstance()
+// 技术员下拉选项
+const technicalOptions = ref([])
+// 获取技术员列表(岗位编码:techs)
+const fetchTechnicalList = () => {
+ getUserByPost({ postCode: "techs" })
+ .then(res => {
+ if (res.code === 200 && Array.isArray(res.data)) {
+ technicalOptions.value = res.data.map(item => ({
+ value: item.nickName,
+ label: item.nickName
+ }))
+ } else {
+ technicalOptions.value = []
+ }
+ })
+ .catch(() => {
+ technicalOptions.value = []
+ })
+}
const changeVarietyList = ref([])
const open = ref(false)
const loading = ref(true)
@@ -384,7 +408,7 @@ function submitForm() {
varietyNew: form.value.varietyNew,
eventDate: form.value.eventDate,
technician: form.value.technician,
- comment: sheep.comment || ""
+ comment: form.value.comment || ''
}
return addChangeVariety(submitData)
})
@@ -513,7 +537,6 @@ async function onManageTagsBlur() {
if (!batchTags.value.length) { // 全部无效
form.value.varietyOld = ""
form.value.sheepId = null
- form.value.comment = ""
return
}
@@ -524,7 +547,6 @@ async function onManageTagsBlur() {
const firstSheep = batchSheep.value[0]
form.value.varietyOld = firstSheep.varietyName || ""
form.value.sheepId = firstSheep.id
- form.value.comment = firstSheep.comment || ""
}
// 删除单个批量耳号
@@ -551,6 +573,7 @@ function clearBatchTags() {
onMounted(() => {
loadVarietyOptions();
getSheepfoldOptions();
+ fetchTechnicalList();
getList();
});
diff --git a/src/views/produce/manage_sheep/trans_group/index.vue b/src/views/produce/manage_sheep/trans_group/index.vue
index 0b2455c..0d26029 100644
--- a/src/views/produce/manage_sheep/trans_group/index.vue
+++ b/src/views/produce/manage_sheep/trans_group/index.vue
@@ -77,7 +77,8 @@
-
+
+
@@ -95,15 +96,15 @@
新增
+ v-hasPermi="['produce:trans_group:add']">新增
删除
+ v-hasPermi="['produce:trans_group:remove']">删除
导出
+ v-hasPermi="['produce:trans_group:export']">导出
@@ -129,7 +130,7 @@
+ v-hasPermi="['produce:trans_group:remove']">
删除
@@ -200,7 +201,12 @@
style="width: 100%" required />
-
+
+
+
+
+
+
@@ -210,8 +216,6 @@