浏览代码

修改页面

lisy 1 月之前
父节点
当前提交
11de0dc043

+ 13 - 0
src/pages.json

@@ -164,6 +164,12 @@
                         "navigationBarTitleText": "添加种植管理记录"
                     }
                 },
+                {
+                    "path": "supervise/supervise-breeding-create/index",
+                    "style": {
+                        "navigationBarTitleText": "添加繁育管理记录"
+                    }
+                },
                 {
                     "path": "supervise/supervise-plant-detail/index",
                     "style": {
@@ -305,6 +311,13 @@
                     "style": {
                         "navigationBarTitleText": "选择操作地块"
                     }
+                },
+                // 选择操作个体
+                {
+                    "path": "supervise-individual/index",
+                    "style": {
+                        "navigationBarTitleText": "选择操作个体"
+                    }
                 }
             ]
         },

+ 1 - 2
src/pages/plant/port/index.vue

@@ -152,14 +152,13 @@ const onRefresh = () => {
 };
 //选择创建类型
 const showDeleteDialog = ref(false);
-const basetype = ref();
+const basetype = ref('1');
 const handlechose = (item: string) => {
     basetype.value = item;
 };
 // 处理取消
 const handleDeleteCancel = () => {
     showDeleteDialog.value = false;
-    basetype.value = null;
 };
 const handlechoseConfirm = () => {
     uni.$u.route({ type: 'navigateTo', url: '/plant/port/port-create/index', params: { taskType: basetype.value } });

+ 4 - 4
src/pages/plant/port/models/task.vue

@@ -124,16 +124,16 @@
                         <text class="f-s-26">种源信息</text>
                     </view>
                 </up-button>
-                <up-button v-if="data?.lands[0]?.landType == '3'" :customStyle="customStyle2">
+                <up-button v-if="data?.lands[0]?.landType == '3'" :customStyle="customStyle2" @click="$emit('toSupervise')">
                     <view class="d-flex a-c j-c">
                         <image class="w-28 h-24" src="/static/images/plant/port/Task_Breeding_management.png" mode="widthFix" />
-                        <text class="f-s-26"> 繁育管理 </text>
+                        <text class="f-s-26">繁育管理</text>
                     </view>
                 </up-button>
-                <up-button v-else :customStyle="customStyle2">
+                <up-button v-else :customStyle="customStyle2" @click="$emit('toSupervise')">
                     <view class="d-flex a-c j-c">
                         <image class="w-28 h-24" src="/static/images/plant/port/Task_Breeding_management.png" mode="widthFix" />
-                        <text class="f-s-26"> 种植管理 </text>
+                        <text class="f-s-26">种植管理</text>
                     </view>
                 </up-button>
                 <up-button :customStyle="customStyle3">

+ 47 - 20
src/plant/port/port-create/index.vue

@@ -89,7 +89,7 @@
                         </ut-action-sheet>
                         <view class="h-1" id="queryType6pppp"></view>
                         <up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
-                            <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
+                            <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day" @change="changeStartTime">
                                 <view class="d-flex mr-20">
                                     <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择养殖开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                     <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
@@ -161,7 +161,7 @@
                                 <up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
                             </up-radio-group>
                         </up-form-item>
-                        <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
+                        <!-- <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
                             <view v-if="!Enterprise" @click="$u.route({ type: 'navigateTo', url: '/plant/port/por-torganism/index' })" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
                                 <view class=""></view>
                                 <view class="f-s-34 c-primary">请选择委托企业</view>
@@ -175,6 +175,11 @@
                                     <text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
                                 </view>
                             </view>
+                        </up-form-item> -->
+                        <up-form-item borderBottom label="供应商" prop="delegateInfo">
+                            <view class="flex1">
+                                <ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
+                            </view>
                         </up-form-item>
                         <ut-action-sheet v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
                             <up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
@@ -227,7 +232,7 @@
                         </ut-action-sheet>
                         <view class="h-1" id="queryType6pppp"></view>
                         <up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
-                            <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
+                            <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day" @change="changeStartTime">
                                 <view class="d-flex mr-20">
                                     <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择养殖开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                     <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
@@ -362,7 +367,7 @@
                         </up-form-item>
                         <view class="h-1" id="queryType6pppp"></view>
                         <up-form-item :borderBottom="false" label="种植时间" required prop="queryType6">
-                            <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
+                            <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day" @change="changeStartTime">
                                 <view class="d-flex mr-20">
                                     <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择种植开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                     <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
@@ -477,7 +482,7 @@
                                 <up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
                             </up-radio-group>
                         </up-form-item>
-                        <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
+                        <!-- <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
                             <view v-if="!Enterprise" @click="$u.route({ type: 'navigateTo', url: '/plant/port/por-torganism/index' })" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
                                 <view class=""></view>
                                 <view class="f-s-34 c-primary">请选择委托企业</view>
@@ -491,6 +496,11 @@
                                     <text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
                                 </view>
                             </view>
+                        </up-form-item> -->
+                        <up-form-item borderBottom label="供应商" prop="delegateInfo">
+                            <view class="flex1">
+                                <ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
+                            </view>
                         </up-form-item>
                         <ut-action-sheet v-if="+deawerData?.data[0]?.landType == 3" v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
                             <up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
@@ -543,7 +553,7 @@
                         </ut-action-sheet>
                         <view class="h-1" id="queryType6pppp"></view>
                         <up-form-item :borderBottom="false" label="繁育日期" required prop="queryType6">
-                            <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
+                            <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day" @change="changeStartTime">
                                 <view class="d-flex mr-20">
                                     <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择种植开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                     <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
@@ -743,6 +753,7 @@ import Baseinfo from './models/baseinfo.vue';
 import { useClientRequest } from '@/utils/request';
 import type { TaskType, YesNoType, TimeRange, PlantInfo, DelegateInfo, InoculationInfo, LandInfo, BaseSelectData, PlantationTaskForm, FormRuleItem, FormRules } from './models/types';
 import Drawer_laboratory from './models/drawer_laboratory.vue';
+import ContactUnitInput from '@/models/contact-unit-input/contact-unit-input.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pt_feed_amount_unit, pt_planting_mg_unit, pt_inoculation_unit, pt_inoculation_dosage_unit, pt_transplant_method, pt_plantation_type, pt_sowing_method, pt_area_unit, pt_plantation_method, pt_reproduction_type, pt_scale_unit, pt_feeding_method, pt_mg_method, pt_task_gap_flag, pt_task_type, pt_org_type, yes_no } = toRefs<any>(
     proxy?.useDict('pt_feed_amount_unit', 'pt_planting_mg_unit', 'pt_inoculation_unit', 'pt_inoculation_dosage_unit', 'pt_transplant_method', 'pt_plantation_type', 'pt_sowing_method', 'pt_area_unit', 'pt_plantation_method', 'pt_reproduction_type', 'pt_scale_unit', 'pt_feeding_method', 'pt_mg_method', 'pt_task_gap_flag', 'pt_task_type', 'pt_org_type', 'yes_no'),
@@ -772,7 +783,8 @@ const form = ref<PlantationTaskForm>({
     plantingAmount: '',
     remark: null,
     delegateFlag: '0',
-    delegateInfo: { cusId: '1795009980763025410', crediteCode: '91530102MACA96MJ9H', cusName: '演示企业' },
+    delegateInfo: { cpyid: '', cusCode: '', cusName: '' },
+    delegate: {},
     plantationType: null,
     sowingMethod: null,
     transplantMethod: null,
@@ -785,6 +797,11 @@ const form = ref<PlantationTaskForm>({
     },
     cultureMediumFormula: null,
 });
+const changeStartTime = () => {
+    if (!form.value?.queryType6?.plannedEndDate) {
+        form.value.queryType6.plannedEndDate = form.value.queryType6.plannedStartDate;
+    }
+};
 //单个溯源都数组
 const animalIds = ref<any>([]);
 const animalId = ref();
@@ -838,7 +855,7 @@ const validateBreedingTime = (rule: any, value: any, callback: any) => {
     }
     const startDate = new Date(plannedStartDate);
     const endDate = new Date(plannedEndDate);
-    if (endDate <= startDate) {
+    if (endDate < startDate) {
         callback(new Error('养殖结束时间必须晚于开始时间'));
         return;
     }
@@ -874,16 +891,8 @@ const validateDelegateInfo = (rule: any, value: any, callback: any) => {
         callback(new Error('请选择委托企业'));
         return;
     }
-    const { cusId, crediteCode, cusName } = value;
-    if (!cusId) {
-        callback(new Error('请选择委托企业'));
-        return;
-    }
-    if (!crediteCode) {
-        callback(new Error('请选择委托企业'));
-        return;
-    }
-    if (!cusName) {
+    const { cpyid, crediteCode, cusName } = value;
+    if (!cpyid) {
         callback(new Error('请选择委托企业'));
         return;
     }
@@ -1094,6 +1103,8 @@ const save = () => {
             console.log('开始提交');
             await upFormRef.value?.validate();
             console.log('校验完成');
+            form.value.delegateInfo.cusName = form.value?.delegate.cusName;
+            form.value.delegateInfo.cusCode = form.value?.delegate.cusCode;
             const params = {
                 ...form.value,
                 ...form.value.queryType6,
@@ -1101,7 +1112,6 @@ const save = () => {
                 ...form.value.inoculation,
                 animalIds: animalIds.value,
             };
-            console.log(params);
 
             const res = await useClientRequest.post('/plt-api/app/plantationTask/saveTask', params);
             if (res.code == 200) {
@@ -1135,6 +1145,11 @@ const saveDraft = () => {
                 ...form.value.inoculation,
                 animalIds: animalIds.value,
             };
+            if (form.value?.delegate?.cusCode) {
+                form.value.delegateInfo.cusName = form.value?.delegate?.cusName;
+                form.value.delegateInfo.cusCode = form.value?.delegate?.cusCode;
+            }
+            console.log('暂存参数:', params);
             const res = await useClientRequest.post('/plt-api/app/plantationTask/draftTask', params);
             if (res.code == 200) {
                 uni.showToast({
@@ -1146,7 +1161,9 @@ const saveDraft = () => {
                     uni.navigateBack();
                 }, 1000);
             }
-        } catch (error: any) {}
+        } catch (error: any) {
+            console.log(error, 'error');
+        }
     });
 };
 //确认添加个体
@@ -1295,6 +1312,12 @@ const getCache = async (taskType: TaskType | null) => {
         plantingMgAmount: res.data.plantingMgAmount,
         plantingMgUnit: res.data.plantingMgUnit,
     };
+    form.value.delegate = {
+        cusCode: form.value.delegateInfo?.cusCode,
+        cusName: form.value.delegateInfo?.cusName,
+    };
+    console.log(form.value.delegate);
+
     if (res.data.animalIds) {
         animalIds.value = res.data.animalIds;
     }
@@ -1354,6 +1377,10 @@ const getInfo = async (taskId: any) => {
         plantingMgAmount: res.data.plantingMgAmount,
         plantingMgUnit: res.data.plantingMgUnit,
     };
+    form.value.delegate = {
+        cusCode: form.value.delegateInfo?.cusCode,
+        cusName: form.value.delegateInfo?.cusName,
+    };
     if (res.data.animalIds) {
         animalIds.value = res.data.animalIds;
     }

+ 4 - 3
src/plant/port/port-create/models/types.ts

@@ -32,8 +32,8 @@ export interface PlantInfo {
  * 委托企业信息接口
  */
 export interface DelegateInfo {
-    cusId: string;
-    crediteCode: string;
+    cpyid: string;
+    cusCode: string;
     cusName: string;
 }
 
@@ -104,7 +104,8 @@ export interface PlantationTaskForm {
     remark: string | null;
     // 条件字段(根据任务类型可选)
     delegateFlag?: YesNoType; // 仅种苗繁育和种畜繁育
-    delegateInfo?: DelegateInfo; // 仅种苗繁育和种畜繁育
+    delegateInfo: DelegateInfo; // 仅种苗繁育和种畜繁育
+    delegate: any;
     plantationType?: any; // 仅种植和种苗繁育,当reproductionType=2时
     sowingMethod?: any; // 仅种植和种苗繁育,当reproductionType=2时
     transplantMethod?: any; // 仅种植和种苗繁育,当reproductionType=2时

+ 44 - 10
src/plant/port/port-supervise/index.vue

@@ -7,7 +7,7 @@
             <Task_card :data="taskDate" />
             <view class="d-flex a-c j-sb pt-20 pb-20">
                 <view class="startline-title mb-16">管理记录</view>
-                <view class="bg-#37A954 radius-10 pd4-10-20-10-20 d-flex a-c" style="width: max-content" @click="$u.route({ type: 'navigateTo', url: '/plant/port/supervise/supervise-plant-create/index', params: { baseId: taskDate?.baseId, taskId: taskId, add: 1, id: taskDate?.id } })">
+                <view class="bg-#37A954 radius-10 pd4-10-20-10-20 d-flex a-c" style="width: max-content" @click="addManagementRecord()">
                     <up-icon name="plus" color="#fff" size="24rpx"></up-icon>
                     <view class="c-#fff f-s-22">添加管理记录</view>
                 </view>
@@ -18,7 +18,7 @@
                 <up-swipe-action-item v-for="(item, index) in list" :key="index" :name="item?.id" :options="options2" class="mb-20" @click="clickTempSwipe">
                     <view class="bg-#fff b-radius pd-24" @click="gotoDetail(item)">
                         <view class="d-flex a-c j-sb">
-                            <view class="f-s-34 f-w-5 pb-10" v-if="item?.opMethod !== '99'">{{ selectDictLabel(pt_op_method, item?.opMethod) }}</view>
+                            <view class="f-s-34 f-w-5 pb-10" v-if="item?.opMethod !== '99'">{{ selectDictLabel(+taskDate.lands[0]?.landType == 1 ? pt_op_method : pt_breed_op_method, item?.opMethod) }}</view>
                             <view class="f-s-34 f-w-5 pb-10" v-else>{{ item?.cusOp }}</view>
                             <view class="d-flex a-c">
                                 <view class="f-s-22 c-#666">{{ item?.activityStart }}</view>
@@ -34,9 +34,9 @@
                             <view class="c-#666 f-s-28">记录人:</view>
                             <view class="c-#333 f-s-28 f-w-5">{{ item?.mgName }}</view>
                         </view>
-                        <view class="d-flex pd4-8-0-8-0">
+                        <view v-if="item?.targetType == '1'" class="d-flex pd4-8-0-8-0">
                             <view class="c-#666 f-s-28 w-s-no">操作地块:</view>
-                            <view class="c-#333 f-s-28 f-w-5" v-if="+item?.landFlag">全部{{ taskDate.lands[0]?.landType == 1 ? '地块' : taskDate.lands[0]?.landType == 2 ? '圈舍' : '培养架' }}</view>
+                            <view class="c-#333 f-s-28 f-w-5" v-if="+item?.landFlag">全部{{ +taskDate.lands[0]?.landType == 1 ? '地块' : +taskDate.lands[0]?.landType == 2 ? '圈舍' : '培养架' }}</view>
                             <view class="c-#333 f-s-28 f-w-5 d-flex a-c w-s-no tx-ov ov-hd" v-else>
                                 <view v-for="(data, indexs) in item?.lands">
                                     <text v-if="indexs !== 0">、</text>
@@ -44,6 +44,13 @@
                                 </view>
                             </view>
                         </view>
+                        <view v-else class="d-flex pd4-8-0-8-0">
+                            <view class="c-#666 f-s-28 w-s-no">操作个体:</view>
+                            <view v-for="(data, indexs) in item?.animalIds">
+                                <text v-if="indexs !== 0">、</text>
+                                <text class="c-#333 f-s-28 f-w-5">{{ data }}</text>
+                            </view>
+                        </view>
                         <view v-if="item?.remark" class="d-flex pd4-8-0-8-0">
                             <view class="c-#666 f-s-28 w-s-no">备注:</view>
                             <view class="c-#333 f-s-28 f-w-5 w-s-no tx-ov ov-hd">{{ item?.remark }}</view>
@@ -59,7 +66,7 @@
 import { useClientRequest } from '@/utils/request';
 import Task_card from './models/task_card.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_op_method } = toRefs<any>(proxy?.useDict('pt_op_method'));
+const { pt_op_method, pt_breed_op_method } = toRefs<any>(proxy?.useDict('pt_op_method', 'pt_breed_op_method'));
 const paging = ref();
 const list = ref<any>([]);
 const taskId = ref('');
@@ -72,12 +79,30 @@ const query = async (pageNo: number, pageSize: number) => {
         pageNo,
         pageSize,
         ...from.value,
+        taskId: taskId.value,
     });
     if (res) {
         const { rows } = res;
         paging.value.complete(rows);
     }
 };
+const addManagementRecord = () => {
+    console.log(taskDate?.value);
+    if (taskDate?.value?.taskType == '1') {
+        uni.$u.route({
+            type: 'navigateTo',
+            url: '/plant/port/supervise/supervise-plant-create/index',
+            params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 1, id: taskDate?.value?.id },
+        });
+    } else if (taskDate?.value?.taskType == '11') {
+        uni.$u.route({
+            type: 'navigateTo',
+            url: '/plant/port/supervise/supervise-breeding-create/index',
+            //参数说明 baseId:基地id,taskId:任务id,add:1新增,id:任务id,landType:地块类型
+            params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 1, id: taskDate?.value?.id, landType: taskDate?.value?.lands[0]?.landType, variety: taskDate?.value?.variety },
+        });
+    }
+};
 const changeSeach = async () => {
     paging.value.reload();
 };
@@ -124,11 +149,20 @@ const clickTempSwipe = async (event: object) => {
             console.error('删除任务失败:', error);
         }
     } else {
-        uni.$u.route({
-            type: 'navigateTo',
-            url: `/plant/port/supervise/supervise-plant-create/index`,
-            params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 0, id: name },
-        });
+        if (taskDate?.value?.taskType == '1') {
+            uni.$u.route({
+                type: 'navigateTo',
+                url: `/plant/port/supervise/supervise-plant-create/index`,
+                params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 0, id: name },
+            });
+        } else if (taskDate?.value?.taskType == '11') {
+            uni.$u.route({
+                type: 'navigateTo',
+                url: '/plant/port/supervise/supervise-breeding-create/index',
+                //参数说明 baseId:基地id,taskId:任务id,add:1新增,id:任务id,landType:地块类型
+                params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 0, id: name, landType: taskDate?.value?.lands[0]?.landType },
+            });
+        }
     }
 };
 const gotoDetail = async (item: any) => {

+ 39 - 0
src/plant/port/port-supervise/models/task_card.vue

@@ -70,6 +70,45 @@
             </view>
         </view>
     </view>
+    <!-- 种苗繁育 -->
+    <view class="" v-if="data?.taskType === '11'" @click="$emit('click')">
+        <view class="b-radius bg-#fff pd-10 p-rtv">
+            <image class="w-112 h-34" src="/static/images/plant/port/Task_Seedling_breeding.png" mode="widthFix" style="position: absolute; top: 0; left: 0" />
+            <view class="d-flex j-ed f-s-22 c-#666">{{ data?.plannedStartDate }}至{{ data?.plannedEndDate }}</view>
+            <view class="d-flex a-ed pd-16 pt-8 pb-8">
+                <view class="c-#333 f-s-34 f-w-5 mr-6">{{ data?.variety }}</view>
+                <view class="c-#666 f-s-26">{{ data?.genusName }}</view>
+            </view>
+            <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                <view class="c-#666 w-s-no">繁育批号:</view>
+                <view class="c-#333 f-w-5">{{ data?.plantationCode }}</view>
+            </view>
+            <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
+                <view class="c-#666 w-s-no">基地:</view>
+                <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd d-flex a-c">
+                    {{ data?.baseRef?.baseInfo?.address }}基地
+                    <text v-if="data?.landIds.length == 0">全部地块</text>
+                    <view v-else>
+                        <text v-for="(item, index) in data?.baseRef?.baseInfo?.landList" :key="index"><text v-if="index != 0">、</text> {{ item?.landName }}</text>
+                    </view>
+                </view>
+            </view>
+            <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
+                <view v-if="data?.lands[0]?.landType == '3'" class="d-flex a-c w-50%">
+                    <view class="c-#666 w-s-no">接种数量:</view>
+                    <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">{{ data?.inoculationAmount }}{{ data?.inoculationUnit }}</view>
+                </view>
+                <view v-else class="d-flex a-c w-50%">
+                    <view class="c-#666 w-s-no">种植面积:</view>
+                    <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">{{ data?.plantingAmount }}{{ data?.plantingUnit }}</view>
+                </view>
+                <view class="d-flex a-c w-50%">
+                    <view class="c-#666 w-s-no">繁育量:</view>
+                    <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">{{ data?.plantingMgAmount }}{{ data?.plantingMgUnit }}</view>
+                </view>
+            </view>
+        </view>
+    </view>
 </template>
 <script setup lang="ts">
 const props = defineProps<{ data: any }>();

+ 57 - 0
src/plant/port/supervise/models/individualinfo.vue

@@ -0,0 +1,57 @@
+<template>
+    <view class="d-flex j-sb b-radius border-#AFDDBB bg-#FBFDFB mb-20 pd-24 p-rtv" v-for="(item, index) in modelValue?.checkBox" :key="index">
+        <view v-if="showClose" @click="handleDelete(index)" class="d-flex j-c a-c c-#FF4444 f-s-28" style="position: absolute; top: 0; right: 10rpx"> x </view>
+        <view class="flex1 ov-hd">
+            <view class="ov-hd tx-ov d-flex a-c">
+                <view class="c-primary f-s-24 f-w-5 bg-#EBF6EE pd4-4-12-4-6 b-radius" style="font-style: italic">{{ Number(index) + 1 < 10 ? '0' + (Number(index) + 1) : Number(index) + 1 }}</view>
+                <view class="w-10"></view>
+                <view class="c-#333 f-w-5 f-s-34 tx-ov ov-hd">{{ modelValue?.variety }}</view>
+            </view>
+            <view class="d-flex a-c pt-10">
+                <text class="c-#666 f-s-24 tx-ov ov-hd">{{ item }}</text>
+            </view>
+        </view>
+    </view>
+</template>
+<script setup lang="ts">
+import { ref } from 'vue';
+const props = withDefaults(
+    defineProps<{
+        modelValue: any;
+        landIds?: any[];
+        showClose?: boolean;
+    }>(),
+    {
+        showClose: true,
+    },
+);
+
+const emit = defineEmits<{
+    'update:modelValue': [value: any];
+    'update:landIds': [value: any[]];
+}>();
+
+const handleDelete = (index: number) => {
+    if (!props.modelValue || !props.modelValue.checkBox) return;
+
+    // 创建新的checkBox数组,移除指定索引的元素
+    const newCheckBox = [...props.modelValue.checkBox];
+    newCheckBox.splice(index, 1);
+
+    // 创建新的对象,保持其他属性不变
+    const newValue = {
+        ...props.modelValue,
+        checkBox: newCheckBox,
+    };
+
+    // 触发更新事件
+    emit('update:modelValue', newValue);
+
+    // 同时更新landIds,确保与checkBox保持一致
+    if (props.landIds && Array.isArray(props.landIds)) {
+        const newLandIds = [...props.landIds];
+        newLandIds.splice(index, 1);
+        emit('update:landIds', newLandIds);
+    }
+};
+</script>

+ 429 - 0
src/plant/port/supervise/supervise-breeding-create/index.vue

@@ -0,0 +1,429 @@
+<template>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom>
+        <template #top>
+            <ut-navbar title="添加管理记录" :fixed="false"></ut-navbar>
+        </template>
+        <view class="pt-24">
+            <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
+                <view class="startline-title pl-24 ml-24 mb-16">管理记录信息</view>
+                <view class="bg-#fff pd-24 mb-20">
+                    <!-- 操作日期 -->
+                    <view class="h-1" id="operationDatepppp"></view>
+                    <up-form-item :borderBottom="false" label="操作日期" required prop="operationDate">
+                        <ut-datetime-picker v-model="form.operationDate.activityStart" mode="date" dateFields="day" @change="changeStartTime">
+                            <view class="d-flex mr-20">
+                                <up-input v-model="form.operationDate.activityStart" placeholder="请选择操作开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
+                            </view>
+                        </ut-datetime-picker>
+                        <ut-datetime-picker v-model="form.operationDate.activityEnd" mode="date" dateFields="day">
+                            <view class="d-flex">
+                                <up-input v-model="form.operationDate.activityEnd" placeholder="请选择操作结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
+                            </view>
+                        </ut-datetime-picker>
+                    </up-form-item>
+                    <!-- 操作类型-组培架 -->
+                    <ut-action-sheet v-if="landType == '3'" v-model="form.opMethod" :tabs="pt_breed_op_method" title="选择操作类型" mode="custom">
+                        <up-form-item borderBottom label="操作类型" required prop="opMethod" id="opMethodpppp">
+                            <view v-if="form.opMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_breed_op_method, form.opMethod) }}</view>
+                            <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择操作类型</view>
+                            <template #right>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                            </template>
+                        </up-form-item>
+                    </ut-action-sheet>
+                    <!-- 操作类型-地块 -->
+                    <ut-action-sheet v-else v-model="form.opMethod" :tabs="pt_op_method" title="选择操作类型" mode="custom">
+                        <up-form-item borderBottom label="操作类型" required prop="opMethod" id="opMethodpppp">
+                            <view v-if="form.opMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_op_method, form.opMethod) }}</view>
+                            <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择操作类型</view>
+                            <template #right>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                            </template>
+                        </up-form-item>
+                    </ut-action-sheet>
+                    <!-- 自填操作类型 -->
+                    <up-form-item v-if="form.opMethod == '99'" borderBottom label="自填操作类型" required prop="cusOp" id="cusOppppp">
+                        <up-input v-model="form.cusOp" placeholder="请输入自填操作类型" border="none"></up-input>
+                    </up-form-item>
+                    <!-- 操作对象 -->
+                    <up-form-item v-if="landType == '3'" borderBottom label="操作对象" required prop="targetType" id="targetTypeppppp">
+                        <up-radio-group v-model="form.targetType">
+                            <up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in pt_breed_op_object" :key="index" :label="item.label" :name="item.value"></up-radio>
+                        </up-radio-group>
+                    </up-form-item>
+                    <!-- 操作组地块 -->
+                    <up-form-item v-if="landType !== '3'" :borderBottom="false" label="操作组地块" required prop="landIds" id="baseIdpppp">
+                        <view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="goSelectBase(landType || '')">
+                            <view class=""></view>
+                            <view class="f-s-34 c-primary">请选择操作组地块</view>
+                        </view>
+                        <view class="w-100%" v-else>
+                            <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="'1'" />
+                        </view>
+                    </up-form-item>
+                    <!-- 操作组培架 -->
+                    <up-form-item v-if="form.targetType == '1' && landType == '3'" :borderBottom="false" label="操作组培架" required prop="landIds" id="landIdspppp">
+                        <view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="goSelectBase(landType)">
+                            <view class=""></view>
+                            <view class="f-s-34 c-primary">请选择操作组培架</view>
+                        </view>
+                        <view class="w-100%" v-else>
+                            <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="'1'" />
+                        </view>
+                    </up-form-item>
+                    <!-- 操作个体选择 -->
+                    <up-form-item v-if="form.targetType == '2' && landType == '3'" :borderBottom="false" label="操作个体选择" required prop="animalIds" id="animalIdspppp">
+                        <view class="flex1">
+                            <Individualinfo v-if="individualLandIds?.checkBox?.length > 0" v-model="individualLandIds" v-model:landIds="form.animalIds" />
+                            <view class="w-100% gap-20 d-flex a-c" id="selectanimalId">
+                                <view class="w-50% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="showDeleteDialog = true">
+                                    <view class=""></view>
+                                    <view class="f-s-34 c-primary">手动输入添加</view>
+                                </view>
+                                <view class="w-50% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="goIndividual()">
+                                    <view class=""></view>
+                                    <view class="f-s-34 c-primary">从任务中快速选择</view>
+                                </view>
+                            </view>
+                        </view>
+                    </up-form-item>
+                    <!-- 操作方式 -->
+                    <up-form-item borderBottom label="操作方式" prop="opRemark" id="opRemarkpppp">
+                        <up-input v-model="form.opRemark" placeholder="如:人工锄草、机械中耕、喷雾器叶面喷施等" border="none"></up-input>
+                    </up-form-item>
+                    <!-- 记录人 -->
+                    <up-form-item borderBottom label="记录人" required prop="mgName" id="mgNamepppp">
+                        <up-input v-model="form.mgName" placeholder="请输入记录人" border="none"></up-input>
+                    </up-form-item>
+                    <!-- 是否使用物料 -->
+                    <up-form-item borderBottom label="是否使用物料" required prop="inputFlag" id="inputFlagpppp">
+                        <view class="d-flex flex-cln">
+                            <view v-if="!+isAdd" class="c-#B52B21 f-s-24">因物料修改涉及退库操作,不支持修改物料信息如有错误,请删除此条管理记录,重新添加。</view>
+                            <up-radio-group v-model="form.inputFlag">
+                                <up-radio :disabled="!+isAdd" :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
+                            </up-radio-group>
+                        </view>
+                    </up-form-item>
+                    <!-- 使用物料 -->
+                    <up-form-item v-if="+form.inputFlag" borderBottom label="使用物料" required prop="inputFlag" id="inputFlagpppp">
+                        <view v-if="!Material" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="goMaterial()">
+                            <view class=""></view>
+                            <view class="f-s-34 c-primary">请选择此次农事使用的物料</view>
+                        </view>
+                        <view v-else class="w-100%">
+                            <Materialinfo :showClose="true" />
+                        </view>
+                    </up-form-item>
+                    <!-- 备注 -->
+                    <up-form-item borderBottom label="备注/说明" prop="remark" id="remarkpppp">
+                        <up-input v-model="form.remark" placeholder="如:“防治阔叶杂草”、“花期追肥”" border="none"></up-input>
+                    </up-form-item>
+                    <up-form-item label="过程图片" prop="imgs" borderBottom id="imgspppp">
+                        <ut-upload v-model="form.imgs" :max-count="9" accept="image"></ut-upload>
+                    </up-form-item>
+                    <up-form-item label="过程视频" prop="videos" borderBottom id="videospppp">
+                        <ut-upload v-model="form.videos" :max-count="9" accept="video"></ut-upload>
+                    </up-form-item>
+                </view>
+            </up-form>
+        </view>
+        <template #bottom>
+            <view class="pd-24 d-flex j-c gap-20 base-bottom-wrap">
+                <up-button v-if="+isAdd" type="primary" @click="save()">确认添加</up-button>
+                <up-button v-else type="primary" @click="change()">确认修改</up-button>
+            </view>
+        </template>
+    </z-paging>
+    <ut-confirm-dialog v-model:show="showDeleteDialog" width="75vw" title="添加个体标识" :confirmText="'确认'" :cancelText="'取消'" @confirm="handleAddConfirm" @cancel="handleAddCancel">
+        <view class="">
+            <view class="c-#333 f-s-28">个体标识号</view>
+            <view class="">
+                <up-input placeholder="请输入个体标识号" v-model="animalId" border="bottom"></up-input>
+            </view>
+        </view>
+    </ut-confirm-dialog>
+</template>
+<script setup lang="ts">
+import { ref, reactive, computed, getCurrentInstance, type ComponentInternalInstance } from 'vue';
+import { useClientRequest } from '@/utils/request';
+import { useInfoStore } from '@/store';
+import Baseinfo from '../models/baseinfo.vue';
+import Materialinfo from '../models/materialinfo.vue';
+import Individualinfo from '../models/individualinfo.vue';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { yes_no, pt_breed_op_method, pt_op_method, pt_breed_op_object } = toRefs<any>(proxy?.useDict('yes_no', 'pt_breed_op_method', 'pt_op_method', 'pt_breed_op_object'));
+const deawerData = ref();
+const infoStore = useInfoStore();
+// 表单数据
+const form = ref({
+    taskId: '',
+    //管理类型 1-农事管理 2-投料
+    activityType: '1',
+    operationDate: {
+        activityStart: null as string | null,
+        activityEnd: null as string | null,
+    },
+    //作用对象类型 1-地块 2-动物
+    targetType: null as string | null,
+    opMethod: null as string | null,
+    cusOp: null as string | null,
+    //操作地块
+    landIds: [],
+    animalIds: [] as any,
+    opRemark: '',
+    mgName: infoStore.userInfo?.name,
+    //是否使用物料
+    inputFlag: '0' as '0' | '1',
+    //物料列表
+    inputs: [],
+    remark: '',
+    imgs: null as string | null,
+    videos: null as string | null,
+    landFlag: '0' as '0' | '1',
+});
+const baseId = ref('');
+const Material = ref();
+//判断是新增还是修改
+const isAdd = ref(true);
+//判断基地的类型
+const landType = ref<string>();
+//个体信息数组
+const individualLandIds = ref<any>({});
+//打开添加个体
+const showDeleteDialog = ref(false);
+const animalId = ref<any>([]);
+//个体名称
+const variety = ref<any>();
+const handleAddCancel = () => {
+    showDeleteDialog.value = false;
+    animalId.value = '';
+};
+const handleAddConfirm = () => {
+    individualLandIds.value.checkBox.push(animalId.value);
+    animalId.value = '';
+    showDeleteDialog.value = false;
+    form.value.animalIds = individualLandIds.value.checkBox;
+};
+// 自定义校验函数:操作日期校验
+const validateOperationDate = (rule: any, value: any, callback: any) => {
+    if (!value) {
+        callback(new Error('请选择操作日期'));
+        return;
+    }
+    const { activityStart, activityEnd } = value;
+    if (!activityStart) {
+        callback(new Error('请选择操作开始时间'));
+        return;
+    }
+    if (!activityEnd) {
+        callback(new Error('请选择操作结束时间'));
+        return;
+    }
+    const start = new Date(activityStart);
+    const end = new Date(activityEnd);
+    if (end < start) {
+        callback(new Error('操作结束时间必须晚于开始时间'));
+        return;
+    }
+    callback();
+};
+//
+const changeStartTime = () => {
+    if (!form.value?.operationDate?.activityEnd) {
+        form.value.operationDate.activityEnd = form.value.operationDate.activityStart;
+    }
+};
+// 自定义校验函数:自填操作类型校验(当opMethod为99时必填)
+const validateCusOp = (rule: any, value: any, callback: any) => {
+    if (form.value.opMethod === '99' && !value) {
+        callback(new Error('请输入自填操作类型'));
+        return;
+    }
+    callback();
+};
+
+// 表单验证规则
+const rules = reactive({
+    operationDate: [{ validator: validateOperationDate, trigger: 'blur' }],
+    opMethod: [{ required: true, message: '请选择操作类型' }],
+    cusOp: [{ validator: validateCusOp, trigger: 'blur' }],
+    opRemark: [{ required: false, message: '请输入操作方式' }],
+    mgName: [{ required: true, message: '请输入记录人' }],
+    inputFlag: [{ required: true, message: '请选择是否使用物料' }],
+    remark: [{ required: false, message: '请输入备注' }],
+});
+
+const paging = ref();
+const list = ref();
+const upFormRef = ref<any>();
+const query = async (pageNo: number, pageSize: number) => {
+    const res = await useClientRequest.get('/plt-api/app/plantationTask/list', {
+        pageNo,
+        pageSize,
+    });
+    // return res.data;
+};
+const handleBaseinfoClose = () => {
+    deawerData.value = null;
+};
+// 提交表单
+const save = () => {
+    uni.$u.debounce(
+        async () => {
+            try {
+                console.log('开始提交管理记录');
+                await upFormRef.value?.validate();
+                console.log('校验完成');
+                const params = {
+                    ...form.value,
+                    ...form.value.operationDate,
+                    landFlag: deawerData?.value?.aloneChecked ? '1' : '0',
+                };
+
+                console.log('提交参数:', params);
+
+                // 这里需要根据实际 API 进行调整
+                const res = await useClientRequest.post('/plt-api/app/plantationActivity/saveActivity', params);
+                if (res.code == 200) {
+                    uni.showToast({
+                        title: '提交成功',
+                        icon: 'success',
+                        duration: 2000,
+                    });
+                    setTimeout(() => {
+                        //发送emit
+                        uni.$emit('updatesuperviselist');
+                        uni.navigateBack({
+                            delta: 1,
+                        });
+                    }, 1000);
+                }
+            } catch (error: any) {
+                console.log('表单验证错误:', error);
+                // 滚动到第一个错误字段
+                if (error && error[0]?.field) {
+                    const firstErrorField = error[0].field + 'pppp';
+                    paging.value?.scrollIntoViewById(firstErrorField, 30, true);
+                }
+                return;
+            }
+        },
+        1000,
+        true,
+    );
+};
+//修改提交表单
+const change = () => {
+    uni.$u.debounce(
+        async () => {
+            try {
+                console.log('开始提交管理记录');
+                await upFormRef.value?.validate();
+                console.log('校验完成');
+
+                const params = {
+                    ...form.value,
+                    ...form.value.operationDate,
+                    landFlag: deawerData?.value?.aloneChecked ? '1' : '0',
+                };
+
+                console.log('提交参数:', params);
+
+                // 这里需要根据实际 API 进行调整
+                const res = await useClientRequest.post('/plt-api/app/plantationActivity/updateActivity', params);
+                if (res.code == 200) {
+                    uni.showToast({
+                        title: '提交成功',
+                        icon: 'success',
+                        duration: 2000,
+                    });
+                    setTimeout(() => {
+                        //发送emit
+                        uni.$emit('updatesuperviselist');
+                        uni.navigateBack({
+                            delta: 1,
+                        });
+                    }, 1000);
+                }
+            } catch (error: any) {
+                console.log('表单验证错误:', error);
+                // 滚动到第一个错误字段
+                if (error && error[0]?.field) {
+                    const firstErrorField = error[0].field + 'pppp';
+                    paging.value?.scrollIntoViewById(firstErrorField, 30, true);
+                }
+                return;
+            }
+        },
+        1000,
+        true,
+    );
+};
+setTimeout(() => {
+    paging.value?.scrollIntoViewById('selectanimalId', 30, true);
+}, 2000);
+//去操作地块页面选择地块
+const goSelectBase = (landType: string) => {
+    uni.$once('updatelands', function (data) {
+        deawerData.value = data;
+        form.value.landIds = deawerData.value.checkBox;
+    });
+    uni.$u.route({ type: 'navigateTo', url: '/tools/supervise-plot/index', params: { baseId: baseId.value, landType } });
+};
+//去选择个体
+const goIndividual = () => {
+    uni.$once('updateIndividual', function (data) {
+        data?.checkBox.forEach((item: any) => {
+            individualLandIds.value.checkBox.push(item);
+            form.value.animalIds.push(item);
+        });
+        paging.value?.scrollIntoViewById('selectanimalId', 30, true);
+    });
+    uni.$u.route({ type: 'navigateTo', url: '/tools/supervise-individual/index', params: { baseId: baseId.value, landType, taskId: form.value.taskId } });
+};
+//去选择物料
+const goMaterial = () => {
+    if (!+isAdd.value) {
+        return;
+    }
+};
+onLoad(async (options: any) => {
+    baseId.value = options?.baseId;
+    form.value.taskId = options?.taskId;
+    isAdd.value = options?.add;
+    landType.value = options?.landType;
+    variety.value = options?.variety;
+    individualLandIds.value = {
+        checkBox: [],
+        variety: variety.value,
+    };
+    if (landType.value == '3') {
+        form.value.targetType = '1';
+    }
+    if (!+isAdd.value) {
+        const res = await useClientRequest.get(`/plt-api/app/plantationActivity/getInfo/${options.id}`);
+        if (!res || res.code !== 200) return;
+        form.value = res.data;
+        form.value.operationDate = {
+            activityStart: res.data.activityStart,
+            activityEnd: res.data.activityEnd,
+        };
+        deawerData.value = {
+            ...res.data.baseInfo,
+            area: res?.data?.baseInfo?.gapInfo?.area,
+            areaUnit: res?.data?.baseInfo?.gapInfo?.areaUnit,
+            adcodeName: res?.data?.baseInfo?.gapInfo?.adcodeName,
+            medicineName: res?.data?.baseInfo?.gapInfo?.medicineName,
+            aloneChecked: res?.data?.inputFlag == '1' ? true : false,
+            data: res.data.lands,
+            checkBox: res.data.landIds,
+        };
+        individualLandIds.value = {
+            checkBox: res.data.animalIds,
+            variety: variety.value,
+        };
+    }
+});
+</script>

+ 7 - 3
src/plant/port/supervise/supervise-plant-create/index.vue

@@ -10,7 +10,7 @@
                     <!-- 操作日期 -->
                     <view class="h-1" id="operationDatepppp"></view>
                     <up-form-item :borderBottom="false" label="操作日期" required prop="operationDate">
-                        <ut-datetime-picker v-model="form.operationDate.activityStart" mode="date" dateFields="day">
+                        <ut-datetime-picker v-model="form.operationDate.activityStart" mode="date" dateFields="day" @change="changeStartTime">
                             <view class="d-flex mr-20">
                                 <up-input v-model="form.operationDate.activityStart" placeholder="请选择操作开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                 <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
@@ -152,7 +152,7 @@ const validateOperationDate = (rule: any, value: any, callback: any) => {
     }
     const start = new Date(activityStart);
     const end = new Date(activityEnd);
-    if (end <= start) {
+    if (end < start) {
         callback(new Error('操作结束时间必须晚于开始时间'));
         return;
     }
@@ -178,7 +178,11 @@ const rules = reactive({
     inputFlag: [{ required: true, message: '请选择是否使用物料' }],
     remark: [{ required: false, message: '请输入备注' }],
 });
-
+const changeStartTime = () => {
+    if (!form.value?.operationDate?.activityEnd) {
+        form.value.operationDate.activityEnd = form.value.operationDate.activityStart;
+    }
+};
 const paging = ref();
 const list = ref();
 const upFormRef = ref<any>();

+ 19 - 5
src/plant/port/supervise/supervise-plant-detail/index.vue

@@ -10,23 +10,31 @@
             </view>
             <view class="pt-16 pb-16 info-border-bottom">
                 <text class="c-#666 f-s-30">操作类型:</text>
-                <text class="c-#333 f-s-30">{{ selectDictLabel(pt_op_method, data?.opMethod) }}</text>
+                <text class="c-#333 f-s-30">{{ selectDictLabel(data?.baseInfo?.baseType === '1' ? pt_op_method : data?.baseInfo?.baseType === '3' ? pt_breed_op_method : '', data?.opMethod) }}</text>
             </view>
             <view v-if="data?.opMethod === '99'" class="pt-16 pb-16 info-border-bottom">
                 <text class="c-#666 f-s-30">自定义操作类型:</text>
                 <text class="c-#333 f-s-30">{{ data?.cusOp }}</text>
             </view>
-            <view class="pt-16 pb-16 info-border-bottom d-flex flex-cln">
+            <view v-if="data?.baseInfo?.baseType !== '1'" class="pt-16 pb-16 info-border-bottom">
+                <text class="c-#666 f-s-30">操作对象:</text>
+                <text class="c-#333 f-s-30">{{ selectDictLabel(data?.baseInfo?.baseType === '3' ? pt_breed_op_object : data?.baseInfo?.baseType === '2' ? pt_breed_op_method : '', data?.targetType) }}</text>
+            </view>
+            <view v-if="data?.baseInfo?.baseType == '1'" class="pt-16 pb-16 info-border-bottom d-flex flex-cln">
                 <text class="c-#666 f-s-30 pb-10">操作地块:</text>
                 <Baseinfo :modeValue="deawerData" :baseType="'1'" :showClose="false" />
             </view>
+            <view v-if="data?.baseInfo?.baseType == '3' && data?.targetType == '2'" class="pt-16 pb-16 info-border-bottom d-flex flex-cln">
+                <text class="c-#666 f-s-30 pb-10">操作个体:</text>
+                <Individualinfo v-model="individualLandIds" v-model:landIds="data.animalIds" :showClose="false" />
+            </view>
             <view class="pt-16 pb-16 info-border-bottom">
                 <text class="c-#666 f-s-30">操作方式:</text>
-                <text class="c-#333 f-s-30">{{ data?.opRemark }}</text>
+                <text class="c-#333 f-s-30">{{ data?.opRemark || '-' }}</text>
             </view>
             <view class="pt-16 pb-16 info-border-bottom">
                 <text class="c-#666 f-s-30">记录人:</text>
-                <text class="c-#333 f-s-30">{{ data?.mgName }}</text>
+                <text class="c-#333 f-s-30">{{ data?.mgName || '-' }}</text>
             </view>
             <view class="pt-16 pb-16 info-border-bottom">
                 <text class="c-#666 f-s-30">是否使用物料:</text>
@@ -54,13 +62,15 @@
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
 import Baseinfo from '../models/baseinfo.vue';
+import Individualinfo from '../models/individualinfo.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { yes_no, pt_op_method } = toRefs<any>(proxy?.useDict('yes_no', 'pt_op_method'));
+const { yes_no, pt_op_method, pt_breed_op_method, pt_breed_op_object } = toRefs<any>(proxy?.useDict('yes_no', 'pt_op_method', 'pt_breed_op_method', 'pt_breed_op_object'));
 const list = ref<any>([]);
 const data = ref<any>();
 const paging = ref();
 const ID = ref('');
 const deawerData = ref<any>({});
+const individualLandIds = ref<any>([]);
 const query = async () => {
     const res = await useClientRequest.get(`/plt-api/app/plantationActivity/getInfo/${ID.value}`);
     if (!res || res.code !== 200) return;
@@ -74,6 +84,10 @@ const query = async () => {
         aloneChecked: res?.data?.inputFlag == '1' ? true : false,
         data: res.data.lands,
     };
+    individualLandIds.value = {
+        checkBox: res.data.animalIds,
+        variety: res.data.variety,
+    };
 };
 onMounted(() => {
     query();

+ 125 - 0
src/tools/supervise-individual/index.vue

@@ -0,0 +1,125 @@
+<template>
+    <z-paging ref="paging" v-model="list" paging-class="paging-btm-shadow" bgColor="#f7f7f7" safe-area-inset-bottom>
+        <template #top>
+            <ut-navbar title="选择个体选择" :fixed="false"></ut-navbar>
+        </template>
+        <view class="startline-title pl-24 ml-24 mb-16">请选择个体选择</view>
+        <view class="pd-24">
+            <ut-search ref="searchRef" v-model="keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜索标识号名称" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+            <view class="pd-10"></view>
+            <up-checkbox-group v-model="checkboxValue">
+                <template v-if="filteredLands.length > 0">
+                    <view class="d-flex w-100% j-sb b-radius bg-#fff mb-20 pd-24" v-for="(item, index) in filteredLands" :key="index" :name="item">
+                        <view class="flex1 ov-hd">
+                            <view class="ov-hd tx-ov d-flex a-c">
+                                <view class="c-primary f-s-24 f-w-5 bg-#EBF6EE pd4-4-12-4-6 b-radius" style="font-style: italic">{{ Number(index) + 1 < 10 ? '0' + (Number(index) + 1) : Number(index) + 1 }}</view>
+                                <view class="w-10"></view>
+                                <view class="c-#333 f-w-5 f-s-34 tx-ov ov-hd">{{ variety }}</view>
+                            </view>
+                            <view class="d-flex a-c pt-10">
+                                <text class="c-#666 f-s-24 tx-ov ov-hd">{{ item }}</text>
+                            </view>
+                        </view>
+                        <view class="d-flex j-c a-c">
+                            <view class="">
+                                <up-checkbox activeColor="#37A954" label="" :name="item" shape="circle"></up-checkbox>
+                            </view>
+                        </view>
+                    </view>
+                </template>
+                <template v-else>
+                    <view class="d-flex j-c a-c pd-40">
+                        <ut-empty :show="true" text="暂无搜索结果" />
+                    </view>
+                </template>
+            </up-checkbox-group>
+        </view>
+        <template #bottom>
+            <view class="pd-24 bg-#fff">
+                <view class="b-radius bg-#fff d-flex a-c j-sb">
+                    <view class="d-flex c-primary f-s-26">
+                        <text>已选择:</text>
+                        <text>{{ checkboxValue.length }}</text>
+                        <text>个地块</text>
+                    </view>
+                    <view class="d-flex a-c">
+                        <view class="c-#333 f-s-28 mr-10">全选</view>
+                        <up-checkbox usedAlone activeColor="#37A954" :checked="isAllSelected" @change="handleSelectAll" shape="circle"></up-checkbox>
+                    </view>
+                </view>
+                <view class="d-flex gap-20">
+                    <up-button @click="cancel()">取消</up-button>
+                    <up-button type="primary" @click="save()">确认选择</up-button>
+                </view>
+            </view>
+        </template>
+    </z-paging>
+</template>
+<script lang="ts" setup>
+import { ref, computed } from 'vue';
+import { useClientRequest } from '@/utils/request';
+const paging = ref();
+const list = ref([]);
+//基地信息
+const modeValue = ref();
+const keyword = ref('');
+// 品种信息
+const variety = ref();
+//地块信息
+const lands = ref<any>([]);
+// 过滤后的地块信息
+const filteredLands = computed(() => {
+    if (!keyword.value) return lands.value;
+    checkboxValue.value = [];
+    return lands.value.filter((item: any) => item && item.toString().toLowerCase().includes(keyword.value.toLowerCase()));
+});
+const changeSeach = async () => {
+    // 搜索时清空选中状态
+    checkboxValue.value = [];
+};
+const checkboxValue = ref<string[]>([]);
+const handleSelectAll = () => {
+    if (isAllSelected.value) {
+        checkboxValue.value = []; // 全选状态下点击 → 清空
+    } else {
+        checkboxValue.value = filteredLands.value.map((item: any) => item); // 非全选状态下点击 → 全选
+    }
+};
+const isAllSelected = computed(() => {
+    return filteredLands.value.length > 0 && checkboxValue.value.length === filteredLands.value.length;
+});
+onLoad(async (options: any) => {
+    const res = await useClientRequest.get(`/plt-api/app/plantationTask/getInfo/${options?.taskId}`);
+    lands.value = res?.data?.animalIds;
+    variety.value = res?.data?.variety;
+    // 初始选中状态为空
+    checkboxValue.value = [];
+});
+const cancel = () => {
+    uni.navigateBack({
+        delta: 1,
+    });
+};
+// 确认选择
+const save = () => {
+    if (checkboxValue.value.length === 0) {
+        return uni.showToast({
+            title: '请选择个体',
+            icon: 'none',
+        });
+    }
+    // 我希望这个能返回 data: { medicineName: string; swyqMedicineName: string; checkBox: any[]; data: any[]; aloneChecked: boolean; baseName: string; area?: string; gapFlag: number; swyqRes: number; areaUnit: string; adcodeName: string; address: string })
+    uni.$emit('updateIndividual', {
+        variety: variety.value,
+        aloneChecked: isAllSelected.value,
+        checkBox: checkboxValue.value,
+    });
+    uni.navigateBack({
+        delta: 1,
+    });
+};
+
+onUnload(() => {
+    uni.$off('updateIndividual');
+});
+</script>

+ 13 - 6
src/tools/supervise-plot/index.vue

@@ -1,7 +1,7 @@
 <template>
     <z-paging ref="paging" v-model="list" paging-class="paging-btm-shadow" bgColor="#f7f7f7" safe-area-inset-bottom>
         <template #top>
-            <ut-navbar title="选择操作地块" :fixed="false"></ut-navbar>
+            <ut-navbar :title="title" :fixed="false"></ut-navbar>
         </template>
         <view class="startline-title pl-24 ml-24 mb-16">基地信息</view>
         <view class="pd-26 bg-#fff mb-20">
@@ -23,15 +23,15 @@
                 </view>
             </view>
         </view>
-        <view class="startline-title pl-24 ml-24 mb-16">请选择所操作的地块</view>
+        <view class="startline-title pl-24 ml-24 mb-16">请{{ title }}</view>
         <view class="pd-24">
-            <ut-search ref="searchRef" v-model="keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜索地块名称" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
-            <view class="pd-20"></view>
+            <ut-search ref="searchRef" v-model="keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜索关键字" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+            <view class="pd-10"></view>
             <up-checkbox-group v-model="checkboxValue">
                 <view class="d-flex w-100% j-sb b-radius bg-#fff mb-20 pd-24" v-for="(item, index) in lands" :key="index" :name="item?.id">
                     <view class="flex1 ov-hd">
                         <view class="ov-hd tx-ov d-flex a-c">
-                            <view class="c-primary f-s-24 f-w-5 mr-10 bg-#EBF6EE pd4-4-6-4-6 b-radius" style="font-style: italic">{{ Number(index) + 1 < 10 ? '0' + (Number(index) + 1) : Number(index) + 1 }}</view>
+                            <view class="c-primary f-s-24 f-w-5 mr-10 bg-#EBF6EE pd4-4-12-4-6 b-radius" style="font-style: italic">{{ Number(index) + 1 < 10 ? '0' + (Number(index) + 1) : Number(index) + 1 }}</view>
                             <view class="c-#333 f-w-5 f-s-34 tx-ov ov-hd">{{ item?.landName }}</view>
                         </view>
                         <view class="d-flex a-c">
@@ -63,7 +63,7 @@
                     </view>
                     <view class="d-flex a-c">
                         <view class="c-#333 f-s-28 mr-10">全选</view>
-                        <up-checkbox usedAlone activeColor="#37A954" :checked="isAllSelected" @change="handleSelectAll"></up-checkbox>
+                        <up-checkbox usedAlone activeColor="#37A954" :checked="isAllSelected" @change="handleSelectAll" shape="circle"></up-checkbox>
                     </view>
                 </view>
                 <view class="d-flex gap-20">
@@ -82,6 +82,8 @@ const list = ref([]);
 //基地信息
 const modeValue = ref();
 const keyword = ref('');
+//标题
+const title = ref('选择操作地块');
 //地块信息
 const lands = ref<any>([]);
 const changeSeach = async () => {
@@ -106,6 +108,11 @@ onLoad(async (options: any) => {
     const res = await useClientRequest.get(`/plt-api/app/base/getInfoAllById/${options?.baseId}`);
     modeValue.value = res?.data?.baseInfo;
     lands.value = res?.data?.landInfoList;
+    if (options?.landType == '3') {
+        title.value = '选择操作组培架';
+    } else {
+        title.value = '选择操作地块';
+    }
     // 初始选中状态为空
     checkboxValue.value = [];
 });