lisy 5 dní pred
rodič
commit
ef2a905eb5

+ 6 - 0
src/pages.json

@@ -131,6 +131,12 @@
                     "style": {
                         "navigationBarTitleText": "创建种养殖任务"
                     }
+                },
+                {
+                    "path": "port-detail/index",
+                    "style": {
+                        "navigationBarTitleText": "种养殖任务列表"
+                    }
                 }
             ]
         },

+ 9 - 193
src/pages/plant/port/index.vue

@@ -7,9 +7,9 @@
         </template>
         <view class="d-flex a-c pd-24 pb-0 bg-#f7f7f7">
             <view class="min-w-170 flex1">
-                <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
+                <ut-action-sheet v-model="form.taskType" :tabs="[{ label: '全部', value: '' }, ...pt_task_type]" @change="onRefresh" title="选择原料类型">
                     <view class="d-flex search-select-item a-c">
-                        <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }} </view>
+                        <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ selectDictLabel(pt_task_type, form.taskType) || '全部' }}</view>
                         <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
                     </view>
                 </ut-action-sheet>
@@ -21,170 +21,9 @@
         <view class="pd-24 bg-#f7f7f7" :style="{ width: windowInfo ? windowInfo.screenWidth - 26 + 'px' : '100%' }">
             <up-subsection :list="subList" :current="subCurrent" @change="sectionChange" style="width: 100%; height: 100rpx; background-color: #fff" inactive-color="#999" active-color="#37A954" fontSize="36rpx" mode="subsection"></up-subsection>
         </view>
-        <!-- 养殖 -->
-        <view class="pd-24 pt-0">
-            <view class="b-radius bg-#fff pd-10">
-                <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </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"> 美洲大蠊</view>
-                    <view class="c-#666 f-s-26">虫卵属蓝棵</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">1231231231232</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">1231231231232</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">123112312312312312312312312312312312312312312323</view>
-                    <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
-                </view>
-                <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
-                    <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">20亩</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">120000</view>
-                    </view>
-                </view>
-                <view class="pd-16 pt-8 pb-8">
-                    <up-line color="#f7f7f7"></up-line>
-                </view>
-                <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
-                    <up-button :customStyle="customStyle1">种源信息</up-button>
-                    <up-button :customStyle="customStyle2">饲养管理</up-button>
-                    <up-button :customStyle="customStyle3">采收管理</up-button>
-                </view>
-            </view>
-        </view>
-        <!-- 种苗繁育 -->
-        <view class="pd-24 pt-0">
-            <view class="b-radius bg-#fff pd-10">
-                <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </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"> 美洲大蠊</view>
-                    <view class="c-#666 f-s-26">虫卵属蓝棵</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">1231231231232</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">1231231231232</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">123112312312312312312312312312312312312312312323</view>
-                    <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
-                </view>
-                <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
-                    <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">20亩</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">120000</view>
-                    </view>
-                </view>
-                <view class="pd-16 pt-8 pb-8">
-                    <up-line color="#f7f7f7"></up-line>
-                </view>
-                <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
-                    <up-button :customStyle="customStyle1">种源信息</up-button>
-                    <up-button :customStyle="customStyle2">种植管理</up-button>
-                    <up-button :customStyle="customStyle3">采收管理</up-button>
-                </view>
-            </view>
-        </view>
-        <!-- 种植 -->
-        <view class="pd-24 pt-0">
-            <view class="b-radius bg-#fff pd-10">
-                <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </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"> 美洲大蠊</view>
-                    <view class="c-#666 f-s-26">虫卵属蓝棵</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">1231231231232</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">1231231231232</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">123112312312312312312312312312312312312312312323</view>
-                    <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
-                </view>
-                <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
-                    <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">20亩</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">120000</view>
-                    </view>
-                </view>
-                <view class="pd-16 pt-8 pb-8">
-                    <up-line color="#f7f7f7"></up-line>
-                </view>
-                <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
-                    <up-button :customStyle="customStyle1">种源信息</up-button>
-                    <up-button :customStyle="customStyle2">种植管理</up-button>
-                    <up-button :customStyle="customStyle3">采收管理</up-button>
-                </view>
-            </view>
-        </view>
-        <!-- 种畜繁育 -->
-        <view class="pd-24 pt-0">
-            <view class="b-radius bg-#fff pd-10">
-                <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </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"> 美洲大蠊</view>
-                    <view class="c-#666 f-s-26">虫卵属蓝棵</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">1231231231232</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">1231231231232</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">123112312312312312312312312312312312312312312323</view>
-                    <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
-                </view>
-                <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
-                    <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">20亩</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">120000</view>
-                    </view>
-                </view>
-                <view class="pd-16 pt-8 pb-8">
-                    <up-line color="#f7f7f7"></up-line>
-                </view>
-                <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
-                    <up-button :customStyle="customStyle1">种源信息</up-button>
-                    <up-button :customStyle="customStyle2">饲养管理</up-button>
-                    <up-button :customStyle="customStyle3">采收管理</up-button>
-                </view>
-            </view>
-        </view>
+        <template v-for="(item, index) in list" :key="index">
+            <task :data="item" @click="$u.route({ type: 'navigateTo', url: '/plant/port/port-detail/index', params: { id: item?.id } })" />
+        </template>
         <view class="h-210" v-if="list?.length"></view>
         <view v-if="list?.length" :style="{ height: `${safeAreaBottom}px` }"></view>
         <template #empty>
@@ -198,7 +37,7 @@
         </template>
     </z-paging>
     <ut-suspension v-if="sus?.left" :imageWidth="60" :imageHeight="60" :x="sus?.left" :y="sus?.bottom" :inertia="false" :snap-threshold="40">
-        <image src="/static/images/plant/addBase.png" mode="widthFix" class="w-120 h-120" @click="showDeleteDialog = true"></image>
+        <image src="/static/images/common/btn_add_logo.png" mode="widthFix" class="w-120 h-120" @click="showDeleteDialog = true"></image>
     </ut-suspension>
     <ut-confirm-dialog v-model:show="showDeleteDialog" width="80vw" title="请选择要创建的任务类型" :confirmText="'确认选择'" :cancelText="'取消'" @confirm="handlechoseConfirm" @cancel="handleDeleteCancel">
         <view class="" v-for="item in pt_task_type" :key="item?.value">
@@ -220,6 +59,7 @@
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
 import { onShareAppMessage } from '@dcloudio/uni-app';
+import Task from './models/task.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pt_task_type } = toRefs<any>(proxy?.useDict('pt_task_type'));
 setTimeout(() => {
@@ -227,7 +67,7 @@ setTimeout(() => {
 }, 2000);
 
 const list = ref<unknown[]>();
-const form = ref({ queryType: '', keyword: '' });
+const form = ref({ taskType: '', keyword: '' });
 const paging = ref();
 const windowInfo = uni.getWindowInfo();
 const safeAreaBottom = windowInfo.safeAreaInsets.bottom;
@@ -260,31 +100,7 @@ const query = async (pageNum: number, pageSize: number) => {
         paging.value.complete(rows);
     }
 };
-//按钮样式
-const customStyle1 = reactive({
-    color: '#37A954',
-    boxShadow: 'inset 0 0 10px #D7F5DF',
-    background: '#ECFFF1',
-    border: '2rpx solid #9BD4A9',
-    borderRadius: '10rpx',
-    height: '76rpx',
-});
-const customStyle2 = reactive({
-    color: '#18BECA',
-    boxShadow: 'inset 0 0 10px #C7F5F8',
-    background: '#E5FDFF',
-    border: '2rpx solid #93E8EE',
-    borderRadius: '10rpx',
-    height: '76rpx',
-});
-const customStyle3 = reactive({
-    color: '#FC8834',
-    boxShadow: 'inset 0 0 10px #FFEED7',
-    background: '#FFFAF3',
-    border: '2rpx solid #FFD499',
-    borderRadius: '10rpx',
-    height: '76rpx',
-});
+
 const onRefresh = () => {
     paging.value.reload();
 };

+ 313 - 0
src/pages/plant/port/models/task.vue

@@ -0,0 +1,313 @@
+<template>
+    <!-- 养殖 -->
+    <view class="pd-24 pt-0" v-if="data.taskType === '2'" @click="$emit('click')">
+        <view class="b-radius bg-#fff pd-10 p-rtv">
+            <image class="w-80 h-34" src="/static/images/plant/port/Task_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 v-if="data?.seedCodeList.length !== 0">
+                    <view class="c-#333 f-w-5" v-for="item in data?.seedCodeList" :key="item">{{ item }}</view>
+                </view>
+                <view v-else>
+                    <view class="c-#666">暂无完善种源信息</view>
+                </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 class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
+            </view>
+            <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
+                <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?.breedScale }}{{ data?.breedScaleUnit }}</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 class="pd-16 pt-8 pb-8">
+                <up-line color="#f7f7f7"></up-line>
+            </view>
+            <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
+                <up-button :customStyle="customStyle1">
+                    <view class="d-flex a-c j-c">
+                        <image class="w-28 h-24" src="/static/images/plant/port/Task_Species_source_information.png" mode="widthFix" />
+                        <text class="f-s-26">种源信息</text>
+                    </view>
+                </up-button>
+                <up-button :customStyle="customStyle2">
+                    <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>
+                    </view>
+                </up-button>
+                <up-button :customStyle="customStyle3">
+                    <view class="d-flex a-c j-c">
+                        <image class="w-28 h-24" src="/static/images/plant/port/Task_Harvest_management.png" mode="widthFix" />
+                        <text class="f-s-26">采收管理</text>
+                    </view>
+                </up-button>
+            </view>
+        </view>
+    </view>
+    <!-- 种苗繁育 -->
+    <view class="pd-24 pt-0" 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 v-if="data?.seedCodeList.length !== 0">
+                    <view class="c-#333 f-w-5" v-for="item in data?.seedCodeList" :key="item">{{ item }}</view>
+                </view>
+                <view v-else>
+                    <view class="c-#666">暂无完善种源信息</view>
+                </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 class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></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 class="pd-16 pt-8 pb-8">
+                <up-line color="#f7f7f7"></up-line>
+            </view>
+            <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
+                <up-button :customStyle="customStyle1">
+                    <view class="d-flex a-c j-c">
+                        <image class="w-28 h-24" src="/static/images/plant/port/Task_Species_source_information.png" mode="widthFix" />
+                        <text class="f-s-26">种源信息</text>
+                    </view>
+                </up-button>
+                <up-button v-if="data?.lands[0]?.landType == '3'" :customStyle="customStyle2">
+                    <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>
+                    </view>
+                </up-button>
+                <up-button v-else :customStyle="customStyle2">
+                    <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>
+                    </view>
+                </up-button>
+                <up-button :customStyle="customStyle3">
+                    <view class="d-flex a-c j-c">
+                        <image class="w-28 h-24" src="/static/images/plant/port/Task_Harvest_management.png" mode="widthFix" />
+                        <text class="f-s-26">采收管理</text>
+                    </view>
+                </up-button>
+            </view>
+        </view>
+    </view>
+    <!-- 种植 -->
+    <view class="pd-24 pt-0" v-if="data.taskType === '1'" @click="$emit('click')">
+        <view class="b-radius bg-#fff pd-10 p-rtv">
+            <image class="w-80 h-34" src="/static/images/plant/port/Task_Planting.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 v-if="data?.seedCodeList.length !== 0">
+                    <view class="c-#333 f-w-5" v-for="item in data?.seedCodeList" :key="item">{{ item }}</view>
+                </view>
+                <view v-else>
+                    <view class="c-#666">暂无完善种源信息</view>
+                </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 class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
+            </view>
+            <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
+                <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?.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 class="pd-16 pt-8 pb-8">
+                <up-line color="#f7f7f7"></up-line>
+            </view>
+            <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
+                <up-button :customStyle="customStyle1">
+                    <view class="d-flex a-c j-c">
+                        <image class="w-28 h-24" src="/static/images/plant/port/Task_Species_source_information.png" mode="widthFix" />
+                        <text class="f-s-26">种源信息</text>
+                    </view>
+                </up-button>
+                <up-button :customStyle="customStyle2">
+                    <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>
+                    </view>
+                </up-button>
+                <up-button :customStyle="customStyle3">
+                    <view class="d-flex a-c j-c">
+                        <image class="w-28 h-24" src="/static/images/plant/port/Task_Harvest_management.png" mode="widthFix" />
+                        <text class="f-s-26">采收管理</text>
+                    </view>
+                </up-button>
+            </view>
+        </view>
+    </view>
+    <!-- 种畜繁育 -->
+    <view class="pd-24 pt-0" v-if="data.taskType === '21'" @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_Breeding_Livestock.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 v-if="data?.seedCodeList.length !== 0">
+                    <view class="c-#333 f-w-5" v-for="item in data?.seedCodeList" :key="item">{{ item }}</view>
+                </view>
+                <view v-else>
+                    <view class="c-#666">暂无完善种源信息</view>
+                </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 class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
+            </view>
+            <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
+                <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?.breedScale }}{{ data?.breedScaleUnit }}</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 class="pd-16 pt-8 pb-8">
+                <up-line color="#f7f7f7"></up-line>
+            </view>
+            <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
+                <up-button :customStyle="customStyle1">
+                    <view class="d-flex a-c j-c">
+                        <image class="w-28 h-24" src="/static/images/plant/port/Task_Species_source_information.png" mode="widthFix" />
+                        <text class="f-s-26">种源信息</text>
+                    </view>
+                </up-button>
+                <up-button :customStyle="customStyle2">
+                    <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>
+                    </view>
+                </up-button>
+                <up-button :customStyle="customStyle3">
+                    <view class="d-flex a-c j-c">
+                        <image class="w-28 h-24" src="/static/images/plant/port/Task_Harvest_management.png" mode="widthFix" />
+                        <text class="f-s-26">采收管理</text>
+                    </view>
+                </up-button>
+            </view>
+        </view>
+    </view>
+</template>
+<script setup lang="ts">
+const props = defineProps<{ data: any }>();
+
+//按钮样式
+const customStyle1 = reactive({
+    color: '#37A954',
+    boxShadow: 'inset 0 0 10px #D7F5DF',
+    background: '#ECFFF1',
+    border: '2rpx solid #9BD4A9',
+    borderRadius: '10rpx',
+    height: '76rpx',
+});
+const customStyle2 = reactive({
+    color: '#18BECA',
+    boxShadow: 'inset 0 0 10px #C7F5F8',
+    background: '#E5FDFF',
+    border: '2rpx solid #93E8EE',
+    borderRadius: '10rpx',
+    height: '76rpx',
+});
+const customStyle3 = reactive({
+    color: '#FC8834',
+    boxShadow: 'inset 0 0 10px #FFEED7',
+    background: '#FFFAF3',
+    border: '2rpx solid #FFD499',
+    borderRadius: '10rpx',
+    height: '76rpx',
+});
+</script>

+ 135 - 76
src/plant/port/port-create/index.vue

@@ -1,7 +1,7 @@
 <template>
     <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" safe-area-inset-bottom>
         <template #top>
-            <ut-navbar title="创建种养殖任务" :fixed="false"></ut-navbar>
+            <up-navbar title="创建种养殖任务" :fixed="false"></up-navbar>
         </template>
         <view class="pt-24">
             <!-- 养殖 -->
@@ -29,18 +29,18 @@
                                 <view class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_type, form.taskType) }}</view>
                             </up-form-item>
                         </ut-action-sheet>
-                        <ut-action-sheet v-model="form.mgMethod" :tabs="mg_method" title="选择溯源级别">
+                        <ut-action-sheet v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
                             <up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
-                                <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(mg_method, form.mgMethod) }}</view>
+                                <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_mg_method, form.mgMethod) }}</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-model="form.gapFlag" :tabs="task_gap_flag" title="选择符合要求">
+                        <ut-action-sheet v-model="form.gapFlag" :tabs="pt_task_gap_flag" title="选择符合要求">
                             <up-form-item borderBottom label="符合要求" required prop="gapFlag" id="gapFlagpppp">
-                                <view v-if="form.gapFlag" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(task_gap_flag, form.gapFlag) }}</view>
+                                <view v-if="form.gapFlag" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_gap_flag, form.gapFlag) }}</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>
@@ -78,9 +78,9 @@
                         <up-form-item label="请选择养殖技术规程文件" prop="technicalFile" borderBottom id="technicalFilepppp">
                             <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
                         </up-form-item>
-                        <ut-action-sheet v-model="form.plantationMethod" :tabs="feeding_method" title="选择养殖方式">
+                        <ut-action-sheet v-model="form.plantationMethod" :tabs="pt_feeding_method" title="选择养殖方式">
                             <up-form-item borderBottom label="养殖方式" required prop="plantationMethod" id="plantationMethodpppp">
-                                <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(feeding_method, form.plantationMethod) }}</view>
+                                <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_feeding_method, form.plantationMethod) }}</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>
@@ -117,15 +117,15 @@
                         <view class="h-1" id="plantpppp"></view>
                         <up-form-item borderBottom label="养殖量" required prop="plant">
                             <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入养殖量" border="none"></up-input>
-                            <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="planting_mg_unit" title="选择单位">
+                            <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="pt_planting_mg_unit" title="选择单位">
                                 <view class="d-flex a-c">
-                                    <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(planting_mg_unit, form.plant?.plantingMgUnit) }}</view>
+                                    <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_planting_mg_unit, form.plant?.plantingMgUnit) }}</view>
                                     <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
                                     <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
                                 </view>
                             </ut-action-sheet>
                         </up-form-item>
-                        <up-form-item borderBottom label="备注" required prop="remark" id="remarkpppp">
+                        <up-form-item borderBottom label="备注" prop="remark" id="remarkpppp">
                             <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
                         </up-form-item>
                     </view>
@@ -176,9 +176,9 @@
                                 </view>
                             </view>
                         </up-form-item>
-                        <ut-action-sheet v-model="form.mgMethod" :tabs="mg_method" title="选择溯源级别">
+                        <ut-action-sheet v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
                             <up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
-                                <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(mg_method, form.mgMethod) }}</view>
+                                <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_mg_method, form.mgMethod) }}</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>
@@ -216,9 +216,9 @@
                         <up-form-item label="请选择养殖技术规程文件" prop="technicalFile" borderBottom id="technicalFilepppp">
                             <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
                         </up-form-item>
-                        <ut-action-sheet v-model="form.plantationMethod" :tabs="feeding_method" title="选择养殖方式">
+                        <ut-action-sheet v-model="form.plantationMethod" :tabs="pt_feeding_method" title="选择养殖方式">
                             <up-form-item borderBottom label="养殖方式" prop="plantationMethod" id="plantationMethodpppp">
-                                <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(feeding_method, form.plantationMethod) }}</view>
+                                <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_feeding_method, form.plantationMethod) }}</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>
@@ -255,15 +255,15 @@
                         <view class="h-1" id="plantpppp"></view>
                         <up-form-item borderBottom label="养殖量" required prop="plant">
                             <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入养殖量" border="none"></up-input>
-                            <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="planting_mg_unit" title="选择单位">
+                            <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="pt_planting_mg_unit" title="选择单位">
                                 <view class="d-flex a-c">
-                                    <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(planting_mg_unit, form.plant?.plantingMgUnit) }}</view>
+                                    <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_planting_mg_unit, form.plant?.plantingMgUnit) }}</view>
                                     <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
                                     <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
                                 </view>
                             </ut-action-sheet>
                         </up-form-item>
-                        <up-form-item borderBottom label="备注" required prop="remark" id="remarkpppp">
+                        <up-form-item borderBottom label="备注" prop="remark" id="remarkpppp">
                             <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
                         </up-form-item>
                     </view>
@@ -294,9 +294,9 @@
                                 <view class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_type, form.taskType) }}</view>
                             </up-form-item>
                         </ut-action-sheet>
-                        <ut-action-sheet v-model="form.gapFlag" :tabs="task_gap_flag" title="选择符合要求">
+                        <ut-action-sheet v-model="form.gapFlag" :tabs="pt_task_gap_flag" title="选择符合要求">
                             <up-form-item borderBottom label="符合要求" required prop="gapFlag" id="gapFlagpppp">
-                                <view v-if="form.gapFlag" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(task_gap_flag, form.gapFlag) }}</view>
+                                <view v-if="form.gapFlag" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_gap_flag, form.gapFlag) }}</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>
@@ -334,9 +334,9 @@
                         <up-form-item label="请选择种植技术规程文件" prop="technicalFile" borderBottom id="technicalFilepppp">
                             <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
                         </up-form-item>
-                        <ut-action-sheet v-model="form.plantationMethod" :tabs="plantation_method" title="选择种植方式">
+                        <ut-action-sheet v-model="form.plantationMethod" :tabs="pt_plantation_method" title="选择种植方式">
                             <up-form-item borderBottom label="种植方式" prop="plantationMethod" id="plantationMethodpppp">
-                                <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(plantation_method, form.plantationMethod) }}</view>
+                                <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_plantation_method, form.plantationMethod) }}</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>
@@ -352,9 +352,9 @@
                         <view class="h-1" id="plantpppp"></view>
                         <up-form-item borderBottom label="种植量" required prop="plant">
                             <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入种植量" border="none"></up-input>
-                            <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="scale_unit" title="选择单位">
+                            <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="pt_scale_unit" title="选择单位">
                                 <view class="d-flex a-c">
-                                    <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(scale_unit, form.plant?.plantingMgUnit) }}</view>
+                                    <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_scale_unit, form.plant?.plantingMgUnit) }}</view>
                                     <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
                                     <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
                                 </view>
@@ -375,36 +375,36 @@
                                 </view>
                             </ut-datetime-picker>
                         </up-form-item>
-                        <ut-action-sheet v-model="form.reproductionType" :tabs="reproduction_type" title="选择繁殖方式">
+                        <ut-action-sheet v-model="form.reproductionType" :tabs="pt_reproduction_type" title="选择繁殖方式">
                             <up-form-item borderBottom label="繁殖方式" required prop="reproductionType" id="reproductionTypepppp">
-                                <view v-if="form.reproductionType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(reproduction_type, form.reproductionType) }}</view>
+                                <view v-if="form.reproductionType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_reproduction_type, form.reproductionType) }}</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-if="+form.reproductionType == 2" v-model="form.plantationType" :tabs="plantation_type" title="选择种植类型">
+                        <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.plantationType" :tabs="pt_plantation_type" title="选择种植类型">
                             <up-form-item borderBottom label="种植类型" prop="plantationType" id="plantationTypepppp">
-                                <view v-if="form.plantationType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(plantation_type, form.plantationType) }}</view>
+                                <view v-if="form.plantationType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_plantation_type, form.plantationType) }}</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-if="+form.reproductionType == 2" v-model="form.sowingMethod" :tabs="sowing_method" title="选择播种方法">
+                        <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.sowingMethod" :tabs="pt_sowing_method" title="选择播种方法">
                             <up-form-item borderBottom label="播种方法" prop="sowingMethod" id="sowingMethodpppp">
-                                <view v-if="form.sowingMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(sowing_method, form.sowingMethod) }}</view>
+                                <view v-if="form.sowingMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_sowing_method, form.sowingMethod) }}</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-if="+form.reproductionType == 2" v-model="form.transplantMethod" :tabs="transplant_method" title="选择移栽方法">
+                        <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.transplantMethod" :tabs="pt_transplant_method" title="选择移栽方法">
                             <up-form-item borderBottom label="移栽方法" prop="transplantMethod" id="transplantMethodpppp">
-                                <view v-if="form.transplantMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(transplant_method, form.transplantMethod) }}</view>
+                                <view v-if="form.transplantMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_transplant_method, form.transplantMethod) }}</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>
@@ -432,7 +432,7 @@
                                 </view>
                             </view>
                         </up-form-item>
-                        <up-form-item borderBottom label="备注" required prop="remark" id="remarkpppp">
+                        <up-form-item borderBottom label="备注" prop="remark" id="remarkpppp">
                             <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
                         </up-form-item>
                     </view>
@@ -455,6 +455,15 @@
                                 <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="form.taskType" />
                             </view>
                         </up-form-item>
+                        <up-form-item :borderBottom="false" label="具体位置" required prop="baseId" id="baseIdpppp">
+                            <view v-if="!laboratory" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="openLaboratory">
+                                <view class=""></view>
+                                <view class="f-s-34 c-primary">请选择具体位置</view>
+                            </view>
+                            <view class="w-100%" v-else>
+                                <laboratory :modeValue="laboratory" @close="handleLaboratoryClose" :baseType="form.taskType" />
+                            </view>
+                        </up-form-item>
                     </view>
                     <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
                     <view class="bg-#fff pd-24 mb-20">
@@ -483,9 +492,9 @@
                                 </view>
                             </view>
                         </up-form-item>
-                        <ut-action-sheet v-if="+deawerData?.data[0]?.landType == 3" v-model="form.mgMethod" :tabs="mg_method" title="选择溯源级别">
+                        <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">
-                                <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(mg_method, form.mgMethod) }}</view>
+                                <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_mg_method, form.mgMethod) }}</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>
@@ -523,9 +532,9 @@
                         <up-form-item label="请选择繁育技术规程文件" prop="technicalFile" borderBottom id="technicalFilepppp">
                             <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
                         </up-form-item>
-                        <ut-action-sheet v-model="form.plantationMethod" :tabs="plantation_method" title="选择繁育方式">
+                        <ut-action-sheet v-model="form.plantationMethod" :tabs="pt_plantation_method" title="选择繁育方式">
                             <up-form-item borderBottom label="繁育方式" prop="plantationMethod" id="plantationMethodpppp">
-                                <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(plantation_method, form.plantationMethod) }}</view>
+                                <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_plantation_method, form.plantationMethod) }}</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>
@@ -556,9 +565,9 @@
                         <up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="接种数量" required prop="inoculation.inoculationAmount" id="inoculationpppp">
                             <view class="d-flex a-c j-sb w-100%">
                                 <up-input style="padding-left: 0" v-model="form.inoculation.inoculationAmount" placeholder="请输入接种数量" border="none"></up-input>
-                                <ut-action-sheet v-model="form.inoculation.inoculationUnit" :tabs="inoculation_unit" title="选择单位">
+                                <ut-action-sheet v-model="form.inoculation.inoculationUnit" :tabs="pt_inoculation_unit" title="选择单位">
                                     <view class="d-flex a-c">
-                                        <view v-if="form.inoculation?.inoculationUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(inoculation_unit, form.inoculation?.inoculationUnit) }}</view>
+                                        <view v-if="form.inoculation?.inoculationUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_inoculation_unit, form.inoculation?.inoculationUnit) }}</view>
                                         <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
                                         <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
                                     </view>
@@ -568,28 +577,28 @@
                         <up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="接种剂量" required prop="inoculation.inoculationDosage" id="inoculationpppp">
                             <view class="d-flex a-c j-sb w-100%">
                                 <up-input style="padding-left: 0" v-model="form.inoculation.inoculationDosage" placeholder="请输入接种剂量" border="none"></up-input>
-                                <ut-action-sheet v-model="form.inoculation.inoculationDosageUnit" :tabs="inoculation_dosage_unit" title="选择单位">
+                                <ut-action-sheet v-model="form.inoculation.inoculationDosageUnit" :tabs="pt_inoculation_dosage_unit" title="选择单位">
                                     <view class="d-flex a-c">
-                                        <view v-if="form.inoculation?.inoculationDosageUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(inoculation_dosage_unit, form.inoculation?.inoculationDosageUnit) }}</view>
+                                        <view v-if="form.inoculation?.inoculationDosageUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_inoculation_dosage_unit, form.inoculation?.inoculationDosageUnit) }}</view>
                                         <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
                                         <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
                                     </view>
                                 </ut-action-sheet>
-                                <view v-if="form.inoculation?.inoculationUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(inoculation_unit, form.inoculation?.inoculationUnit) }}</view>
+                                <view v-if="form.inoculation?.inoculationUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_inoculation_unit, form.inoculation?.inoculationUnit) }}</view>
                             </view>
                         </up-form-item>
                         <view class="h-1" id="plantpppp"></view>
                         <up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="繁育量" prop="plant">
                             <view class="d-flex a-c j-sb w-100%">
                                 <view class="f-s-30 c-333 f-w-5 w-100">{{ plantingMgAmount }}</view>
-                                <view v-if="plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(inoculation_dosage_unit, plantingMgUnit) }}</view>
+                                <view v-if="plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_inoculation_dosage_unit, plantingMgUnit) }}</view>
                             </view>
                         </up-form-item>
                         <up-form-item v-else borderBottom label="繁育量" required prop="plant">
                             <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入繁育量" border="none"></up-input>
-                            <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="feed_amount_unit" title="选择单位">
+                            <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="pt_feed_amount_unit" title="选择单位">
                                 <view class="d-flex a-c">
-                                    <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(feed_amount_unit, form.plant?.plantingMgUnit) }}</view>
+                                    <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_feed_amount_unit, form.plant?.plantingMgUnit) }}</view>
                                     <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
                                     <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
                                 </view>
@@ -616,36 +625,36 @@
                                 </view>
                             </view>
                         </up-form-item>
-                        <ut-action-sheet v-model="form.reproductionType" :tabs="reproduction_type" title="选择繁殖方式">
+                        <ut-action-sheet v-model="form.reproductionType" :tabs="pt_reproduction_type" title="选择繁殖方式">
                             <up-form-item borderBottom label="选择繁殖方式" required prop="reproductionType" id="reproductionTypepppp">
-                                <view v-if="form.reproductionType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(reproduction_type, form.reproductionType) }}</view>
+                                <view v-if="form.reproductionType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_reproduction_type, form.reproductionType) }}</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-if="+form.reproductionType == 2" v-model="form.plantationType" :tabs="plantation_type" title="选择种植类型">
+                        <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.plantationType" :tabs="pt_plantation_type" title="选择种植类型">
                             <up-form-item borderBottom label="种植类型" required prop="plantationType" id="plantationTypepppp">
-                                <view v-if="form.plantationType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(plantation_type, form.plantationType) }}</view>
+                                <view v-if="form.plantationType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_plantation_type, form.plantationType) }}</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-if="+form.reproductionType == 2" v-model="form.sowingMethod" :tabs="sowing_method" title="选择播种方法">
+                        <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.sowingMethod" :tabs="pt_sowing_method" title="选择播种方法">
                             <up-form-item borderBottom label="播种方法" required prop="sowingMethod" id="sowingMethodpppp">
-                                <view v-if="form.sowingMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(sowing_method, form.sowingMethod) }}</view>
+                                <view v-if="form.sowingMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_sowing_method, form.sowingMethod) }}</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-if="+form.reproductionType == 2" v-model="form.transplantMethod" :tabs="transplant_method" title="选择移栽方法">
+                        <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.transplantMethod" :tabs="pt_transplant_method" title="选择移栽方法">
                             <up-form-item borderBottom label="移栽方法" required prop="transplantMethod" id="transplantMethodpppp">
-                                <view v-if="form.transplantMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(transplant_method, form.transplantMethod) }}</view>
+                                <view v-if="form.transplantMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_transplant_method, form.transplantMethod) }}</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>
@@ -673,7 +682,7 @@
                                 </view>
                             </view>
                         </up-form-item>
-                        <up-form-item borderBottom label="备注" required prop="remark" id="remarkpppp">
+                        <up-form-item borderBottom label="备注" prop="remark" id="remarkpppp">
                             <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
                         </up-form-item>
                     </view>
@@ -724,6 +733,7 @@
     </ut-confirm-dialog>
     <!-- 添加drawer组件 -->
     <Drawer v-if="drawerVisible" :baseType="form.taskType" v-model="drawerVisible" @open="onDrawerOpen" @close="onDrawerClose" @confirm="onDrawerConfirm" />
+    <Drawer_laboratory v-if="laboratoryVisible" :baseId="form?.baseId" :landIds="form?.landIds" v-model="laboratoryVisible" @open="openLaboratory" @close="handleLaboratoryClose" @confirm="handleLaboratoryConfirm" />
 </template>
 
 <script setup lang="ts">
@@ -732,9 +742,10 @@ import Drawer from './models/drawer.vue';
 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';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { feed_amount_unit, planting_mg_unit, inoculation_unit, inoculation_dosage_unit, transplant_method, plantation_type, sowing_method, area_unit, plantation_method, reproduction_type, scale_unit, feeding_method, mg_method, task_gap_flag, pt_task_type, pt_org_type, yes_no } = toRefs<any>(
-    proxy?.useDict('feed_amount_unit', 'planting_mg_unit', 'inoculation_unit', 'inoculation_dosage_unit', 'transplant_method', 'plantation_type', 'sowing_method', 'area_unit', 'plantation_method', 'reproduction_type', 'scale_unit', 'feeding_method', 'mg_method', 'task_gap_flag', 'pt_task_type', 'pt_org_type', 'yes_no')
+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')
 );
 const form = ref<PlantationTaskForm>({
     deawerData: null,
@@ -954,7 +965,7 @@ const rules = reactive({
     plantingAmount: [{ required: true, message: '请输入养殖面积' }],
     breedScale: [{ required: true, message: '请输入养殖区域' }],
     plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
-    remark: [{ required: true, message: '请输入备注' }],
+    remark: [{ required: false, message: '请输入备注' }],
 });
 const rules1 = reactive({
     baseId: [{ required: true, message: '请选择种养殖所在的基地' }],
@@ -970,7 +981,7 @@ const rules1 = reactive({
     plantingAmount: [{ required: true, message: '请输入养殖面积' }],
     breedScale: [{ required: true, message: '请输入养殖区域' }],
     plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
-    remark: [{ required: true, message: '请输入备注' }],
+    remark: [{ required: false, message: '请输入备注' }],
 });
 const rules2 = reactive({
     baseId: [{ required: true, message: '请选择种植所在的基地' }],
@@ -983,7 +994,7 @@ const rules2 = reactive({
     queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
     plantingAmount: [{ required: true, message: '请输入种植面积' }],
     plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
-    remark: [{ required: true, message: '请输入备注' }],
+    remark: [{ required: false, message: '请输入备注' }],
     preCropId: [{ required: false, message: '请选择前茬植物' }],
     reproductionType: [{ required: true, message: '请选择选择繁殖方式' }],
 });
@@ -1002,7 +1013,7 @@ const rules3 = reactive({
     plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
     'inoculation.inoculationAmount': [{ validator: validateinoculation, trigger: 'blur' }],
     'inoculation.inoculationDosage': [{ validator: validateInoculationDosage, trigger: 'blur' }],
-    remark: [{ required: true, message: '请输入备注' }],
+    remark: [{ required: false, message: '请输入备注' }],
     preCropId: [{ required: false, message: '请选择前茬植物' }],
     reproductionType: [{ required: true, message: '请选择选择繁殖方式' }],
 });
@@ -1087,8 +1098,11 @@ const save = () => {
                 ...form.value,
                 ...form.value.queryType6,
                 ...form.value.plant,
+                ...form.value.inoculation,
                 animalIds: animalIds.value,
             };
+            console.log(params);
+
             const res = await useClientRequest.post('/plt-api/app/plantationTask/saveTask', params);
             if (res.code == 200) {
                 uni.showToast({
@@ -1116,10 +1130,10 @@ const saveDraft = () => {
         try {
             const params = {
                 ...form.value,
-                plannedStartDate: form.value.queryType6.plannedStartDate,
-                plannedEndDate: form.value.queryType6.plannedEndDate,
-                plantingMgAmount: form.value.plant.plantingMgAmount,
-                plantingMgUnit: form.value.plant.plantingMgUnit,
+                ...form.value.queryType6,
+                ...form.value.plant,
+                ...form.value.inoculation,
+                animalIds: animalIds.value,
             };
             const res = await useClientRequest.post('/plt-api/app/plantationTask/draftTask', params);
             if (res.code == 200) {
@@ -1158,9 +1172,7 @@ const handleDeleteConfirm = () => {
 const handleDeleteCancel = () => {
     animalId.value = null;
 };
-
 const clickSwipe = async (name: any, index: number) => {
-    console.log(name, index);
     if (name?.index == 0) {
         const res = await uni.showModal({
             title: '删除提示',
@@ -1186,25 +1198,46 @@ const clickSwipe = async (name: any, index: number) => {
 };
 // 如果是组培实验室的话,繁育量是一个计算属性
 const plantingMgAmount = computed(() => {
-    if (+deawerData.value.data[0]?.landType == 3) {
-        const inoculationAmount = form.value.inoculation?.inoculationAmount;
-        const inoculationDosage = form.value.inoculation?.inoculationDosage;
-        if (inoculationAmount && inoculationDosage) {
-            form.value.plant.plantingMgAmount = +inoculationAmount * +inoculationDosage;
-            return form.value.plant.plantingMgAmount || '';
-        }
+    // 安全访问嵌套属性
+    if (Number(deawerData.value?.data?.[0]?.landType) !== 3) {
+        return '';
+    }
+
+    const inoculationAmount = Number(form.value?.inoculation?.inoculationAmount);
+    const inoculationDosage = Number(form.value?.inoculation?.inoculationDosage);
+
+    // 如果任一值为无效数字,返回空字符串
+    if (!inoculationAmount || !inoculationDosage || isNaN(inoculationAmount) || isNaN(inoculationDosage)) {
         return '';
     }
-    return '';
+
+    const result = inoculationAmount * inoculationDosage;
+    // 返回计算结果,保持数字类型或空字符串
+    return isNaN(result) ? '' : result;
 });
 // 如果是组培实验室的话,繁育量单位是一个计算属性
 const plantingMgUnit = computed(() => {
-    if (form.value.taskType === 11) {
+    if (Number(deawerData.value?.data?.[0]?.landType) == 3) {
         form.value.plant.plantingMgUnit = form.value.inoculation?.inoculationDosageUnit || null;
         return form.value.plant.plantingMgUnit;
     }
     return null;
 });
+const laboratory = ref<any>();
+// 控制抽屉显示状态
+const laboratoryVisible = ref(false);
+// 处理实验室的关闭
+function handleLaboratoryClose() {
+    laboratory.value = null;
+}
+// 处理实验室的打开
+function openLaboratory() {
+    laboratoryVisible.value = true;
+}
+// 处理抽屉确认事件
+function handleLaboratoryConfirm(data: any) {
+    console.log('收到基地选择数据:', data);
+}
 onLoad((options) => {
     form.value.taskType = options?.taskType;
     if (+options?.taskType == 1 || +options?.taskType == 11) {
@@ -1223,6 +1256,8 @@ const gotoTorganism = (type: number) => {
     if (type == 1) {
         uni.$once('updateBiologicalname', function (data) {
             Biological.value = data.msg;
+            console.log(Biological.value);
+
             form.value.varietyId = data.msg.id;
         });
     } else {
@@ -1238,7 +1273,9 @@ const gotoTorganism = (type: number) => {
 // 查看是否有缓存的信息
 const getCache = async (taskType: TaskType | null) => {
     const res = await useClientRequest.get(`/plt-api/app/plantationTask/getDraft/${taskType}`);
+    if (!res.data) return;
     form.value = res.data;
+
     form.value.queryType6 = {
         plannedStartDate: res.data.plannedStartDate,
         plannedEndDate: res.data.plannedEndDate,
@@ -1253,6 +1290,19 @@ const getCache = async (taskType: TaskType | null) => {
         plantingMgAmount: res.data.plantingMgAmount,
         plantingMgUnit: res.data.plantingMgUnit,
     };
+    if (res.data.animalIds) {
+        animalIds.value = res.data.animalIds;
+    }
+    if (res.data.preCropCode) {
+        PreBiological.value = {};
+        const Bio = await useClientRequest.get(`/plt-api/app/medicine/getMedicineByCode/${res.data.preCropCode}`);
+        PreBiological.value = Bio.data;
+    }
+    if (res.data.varietyCode) {
+        Biological.value = {};
+        const Bio = await useClientRequest.get(`/plt-api/app/medicine/getMedicineByCode/${res.data.varietyCode}`);
+        Biological.value = Bio.data;
+    }
     // 判断有没有基地,然后去获取基地数据
     if (res.data.baseId) {
         deawerData.value = {};
@@ -1262,11 +1312,20 @@ const getCache = async (taskType: TaskType | null) => {
         // adcodeName
         deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
         if (res.data.landIds.length == 0) {
-            deawerData.value.aloneChecked = '';
+            deawerData.value.aloneChecked = true;
             const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
             deawerData.value.data = landIds.rows;
+        } else {
+            deawerData.value.aloneChecked = false;
+            deawerData.value.data = [];
+            const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
+            //找到res.data.landIds和landIds.rows中的id相同的项
+            landIds.rows.forEach((i: any) => {
+                if (res.data.landIds.find((t: any) => t == i.id)) {
+                    deawerData.value.data.push(i);
+                }
+            });
         }
-        console.log(deawerData.value);
     }
 };
 onMounted(() => {

+ 19 - 11
src/plant/port/port-create/models/baseinfo.vue

@@ -1,7 +1,7 @@
 <template>
     <view class="border-#AFDDBB pd-26 pb-10 pt-10 bg-#FBFDFB p-rtv">
         <!-- 关闭按钮 -->
-        <view class="c-#F81242 f-s-30 ab2-10-20" style="position: absolute; right: 10rpx; top: 0rpx" @click="handleClose"> × </view>
+        <view v-if="showClose" class="c-#F81242 f-s-30 ab2-10-20" style="position: absolute; right: 10rpx; top: 0rpx" @click="handleClose"> × </view>
         <!-- 标签显示:GAP和三无一全 -->
         <view v-if="+modeValue?.gapFlag || +modeValue?.swyqRes" class="pt-8 pb-8 d-flex pr-20 pl-20" style="width: max-content; margin-top: -10rpx; margin-left: -26rpx; background: linear-gradient(90deg, #5eba75, #c6e391); border-bottom-right-radius: 88rpx">
             <view v-if="+modeValue?.gapFlag && !+modeValue?.swyqRes" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.medicineName }}GAP基地</view>
@@ -19,15 +19,15 @@
         </view>
         <view style="margin-left: -26rpx; margin-right: -26rpx; border-bottom: 1rpx solid #d4ecda"></view>
         <view class="pt-16 pb-8">
-            <text v-if="+modeValue?.data[0]?.landType == 1" class="c-#666 f-s-28">地块信息:</text>
-            <text v-if="+modeValue?.data[0]?.landType == 2" class="c-#666 f-s-28">圈舍信息:</text>
-            <text v-if="+modeValue?.data[0]?.landType == 3" class="c-#666 f-s-28">培养架信息:</text>
+            <text v-if="+modeValue?.data?.[0]?.landType == 1" class="c-#666 f-s-28">地块信息:</text>
+            <text v-if="+modeValue?.data?.[0]?.landType == 2" class="c-#666 f-s-28">圈舍信息:</text>
+            <text v-if="+modeValue?.data?.[0]?.landType == 3" class="c-#666 f-s-28">培养架信息:</text>
             <text v-if="!modeValue?.aloneChecked" class="c-#333 f-s-28 f-w-5">{{ modeValue?.data?.length }}个</text>
-            <text v-if="modeValue?.aloneChecked" class="c-#333 f-s-28 f-w-5">该基地所有{{ +modeValue?.data[0]?.landType == 1 ? '地块' : +modeValue?.data[0]?.landType == 2 ? '圈舍' : '培养架' }}</text>
+            <text v-if="modeValue?.aloneChecked" class="c-#333 f-s-28 f-w-5">该基地所有{{ +modeValue?.data?.[0]?.landType == 1 ? '地块' : +modeValue?.data?.[0]?.landType == 2 ? '圈舍' : '培养架' }}</text>
         </view>
         <view v-if="!modeValue?.aloneChecked" class="pt-8 pb-8" v-for="(item, index) in modeValue?.data" :key="index">
             <text class="c-#666 f-s-28 mr-20">{{ item?.landName }}:</text>
-            <text v-if="+modeValue?.data[0]?.landType == 3" class="c-#333 f-s-28 f-w-5">{{ item?.capacityAmount }}{{ item?.capacityUnit }}</text>
+            <text v-if="+modeValue?.data?.[0]?.landType == 3" class="c-#333 f-s-28 f-w-5">{{ item?.capacityAmount }}{{ item?.capacityUnit }}</text>
             <text v-else class="c-#333 f-s-28 f-w-5">{{ item?.area }}{{ item?.areaUnit }}</text>
         </view>
     </view>
@@ -51,11 +51,19 @@ interface ModeValue {
 }
 
 // 接收modeValue对象
-const props = defineProps<{
-    modeValue?: ModeValue;
-    baseType: string;
-}>();
-
+const props = withDefaults(
+    defineProps<{
+        modeValue?: ModeValue;
+        baseType: string;
+        showClose?: boolean;
+    }>(),
+    {
+        showClose: true,
+    }
+);
+setTimeout(() => {
+    console.log(props?.modeValue);
+}, 1000);
 // 定义emit事件
 const emit = defineEmits<{
     (e: 'update:modeValue', value: ModeValue | null): void;

+ 356 - 0
src/plant/port/port-create/models/drawer_laboratory.vue

@@ -0,0 +1,356 @@
+<template>
+    <up-popup :show="modelValue" mode="right" @close="handleClose" @open="handleOpen">
+        <up-navbar :fixed="false" bgColor="transparent">
+            <template #left>
+                <view class="c-#333 f-s-34 f-w-5">请选择放置的具体位置</view>
+            </template>
+        </up-navbar>
+        <view class="w-700 d-flex flex-cln" id="scroll">
+            <view class="d-flex">
+                <scroll-view class="w-50% bg-#f7f7f7 c-#fff" :style="`height: calc(100vh - 70px - ${top}px)`" scroll-y="true">
+                    <view v-for="(item, index) in list" :key="index" class="border-#E6E6E6 pd-20 title" :class="{ activeTitle: activeBase == index }" @click="changeBase(index, item)">
+                        <view class="">
+                            <view class="base mb-20">{{ item?.landName }}</view>
+                            <view class="area">
+                                <text class="mr-10">{{ item?.layers }}层</text>
+                                <text>每层{{ item?.capacityAmount }}{{ item?.capacityUnit }}</text>
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
+                <up-virtual-list v-if="mixData.length > 0" :listData="mixData" :itemHeight="60" :height="600" :buffer="8" class="mt-10">
+                    <template #default="{ item }">
+                        <view class="custom-checkbox" :class="{ 'custom-checkbox--checked': item.selected }" @click="handleCustomCheckboxClick(item.id)">
+                            <view class="custom-checkbox__inner">
+                                <text v-if="item.selected" class="custom-checkbox__icon">✓</text>
+                                <text class="custom-checkbox__label">{{ item.landName }}</text>
+                            </view>
+                        </view>
+                    </template>
+                </up-virtual-list>
+                <!-- <scroll-view class="w-50% pd-16" :style="`height: calc(100vh - 70px - ${top}px)`" scroll-y="true">
+                    <view v-if="mixData.length > 0" class="custom-checkbox custom-checkbox--all" @click="handleAllCheckboxChange(!aloneChecked)">
+                        <view class="custom-checkbox__inner">
+                            <text v-if="aloneChecked" class="custom-checkbox__icon">✓</text>
+                            <text class="custom-checkbox__label">全选</text>
+                        </view>
+                    </view>
+                    <view v-if="mixData.length == 0 && showtitle" class="">请先在左侧添加选择组培架,选择后此处将会展示具体信息。</view>
+                </scroll-view> -->
+            </view>
+            <view class="w-700 bg-#fff h-100 d-flex a-c gap-20 pt-20 pb-20" style="position: fixed; bottom: 0; right: 0">
+                <up-button @click="handleClose" style="margin-left: 20rpx">取消</up-button>
+                <up-button type="primary" @click="confirm" style="margin-right: 20rpx">确定</up-button>
+            </view>
+        </view>
+    </up-popup>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { ref, reactive, watch, computed } from 'vue';
+const instance = getCurrentInstance();
+const props = defineProps<{
+    modelValue: boolean;
+    baseId?: string | null;
+    landIds?: Array<string | null>;
+}>();
+setTimeout(() => {
+    console.log(props?.baseId);
+}, 2000);
+const form = ref({
+    baseId: props.baseId,
+    landIds: props.landIds || [],
+});
+// 左侧地块列表数据
+const list = ref<any[]>([]);
+// 右侧架子数据
+const mixData = ref<any[]>([]);
+const showtitle = ref(true);
+// 当前选择地块
+const landId = ref(-1);
+// 定义emit事件:通知父组件状态变化
+const emit = defineEmits<{
+    (e: 'update:modelValue', value: boolean): void;
+    (e: 'open'): void;
+    (e: 'close'): void;
+    (e: 'confirm', 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 }): void; // 新增
+}>();
+// 处理关闭事件
+function handleClose() {
+    emit('update:modelValue', false);
+    emit('close');
+}
+// 处理打开事件
+function handleOpen() {
+    emit('open');
+}
+// 切换基地>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+const activeBase = ref(-1);
+const changeBase = (index: number, item: any) => {
+    if (activeBase.value == index) return;
+    activeBase.value = index;
+    //创建右侧的架数据
+    mixData.value = [];
+    const layersCount = Number(item.layers);
+    // 解析 capacityAmount 为数字
+    const capacityCount = Number(item.capacityAmount);
+
+    // 创建两个序列数组
+    const layersArray = Array.from(
+        { length: layersCount || 0 },
+        (_, index) => index + 1 // 生成 1-10
+    );
+
+    const capacityArray = Array.from(
+        { length: capacityCount || 0 },
+        (_, index) => index + 1 // 生成 1-capacityCount
+    );
+    // 双重循环使用 flatMap
+    const newData = layersArray.flatMap((layer) =>
+        capacityArray.map((capacity) => ({
+            id: `${layer}-${capacity}`,
+            landName: `${layer}-${capacity}`,
+            selected: false, // 添加 selected 字段,初始为 false
+        }))
+    );
+    mixData.value = newData;
+    setTimeout(() => {
+        console.log(mixData.value);
+    }, 2000);
+
+    landId.value = item.id;
+    aloneChecked.value = false;
+};
+// 选择checkbox>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+const aloneChecked = ref(false);
+
+// 自定义复选框点击事件处理
+const handleCustomCheckboxClick = (id: string) => {
+    const item = mixData.value.find((item) => item.id === id);
+    if (item) {
+        item.selected = !item.selected;
+        updateAllCheckedState();
+    }
+};
+
+// 全选框change事件处理
+const handleAllCheckboxChange = (value: boolean) => {
+    aloneChecked.value = value;
+    mixData.value.forEach((item) => {
+        item.selected = value;
+    });
+};
+
+// 更新全选框状态
+const updateAllCheckedState = () => {
+    const allSelected = mixData.value.every((item) => item.selected);
+    aloneChecked.value = allSelected;
+};
+const top = ref(0);
+// 虚拟列表高度
+const virtualListHeight = ref(0);
+// 获取地块信息
+const getBaseInfo = async (pageNum: number, pageSize: number) => {
+    const params = {
+        pageNum,
+        pageSize,
+        ...form.value,
+    };
+    const res = await useClientRequest.post('/plt-api/app/baseLandInfo/chooseLandPageList', params);
+    if (res) {
+        const { data } = res;
+        list.value = data;
+    }
+};
+// 提交
+const confirm = () => {
+    if (landId.value == -1) {
+        uni.showToast({
+            title: '请选择基地',
+            icon: 'none',
+        });
+        return;
+    } else {
+        // 检查是否有选中的项
+        const selectedItems = mixData.value.filter((item) => item.selected);
+        if (selectedItems.length == 0) {
+            uni.showToast({
+                title: '请选择地块',
+                icon: 'none',
+            });
+            return;
+        }
+    }
+
+    // 通过 landId 查找选中的地块
+    const selectedBase = list.value.find((item) => item.id === landId.value);
+    // 获取选中的数据项
+    const selectedData = mixData.value.filter((item) => item.selected);
+    // 获取选中的ID数组
+    const selectedIds = selectedData.map((item) => item.id);
+
+    if (selectedBase) {
+        // 抛出对象给父组件
+        emit('confirm', {
+            baseName: selectedBase.baseName,
+            area: selectedBase.gapInfo?.area,
+            areaUnit: selectedBase.gapInfo?.areaUnit,
+            adcodeName: selectedBase.gapInfo?.adcodeName,
+            address: selectedBase.gapInfo?.address,
+            aloneChecked: aloneChecked.value,
+            gapFlag: selectedBase.gapFlag,
+            swyqRes: selectedBase.swyqRes,
+            swyqMedicineName: selectedBase.swyqMedicineName,
+            medicineName: selectedBase.gapInfo?.medicineName,
+            data: selectedData,
+            checkBox: selectedIds,
+        });
+    }
+
+    // 关闭抽屉
+    emit('update:modelValue', false);
+    emit('close');
+};
+
+onMounted(() => {
+    const querys = uni.createSelectorQuery().in(instance?.proxy);
+    querys
+        .select('#scroll')
+        .boundingClientRect((data: any) => {
+            top.value = data.top;
+
+            // 获取屏幕高度并计算固定高度
+            const systemInfo = uni.getSystemInfoSync();
+            const screenHeight = systemInfo.windowHeight;
+            const calculatedHeight = screenHeight - 70 - data.top - 60;
+            virtualListHeight.value = Math.max(calculatedHeight, 100); // 确保最小高度为100px
+        })
+        .exec();
+    getBaseInfo(1, 100);
+});
+</script>
+<style scoped lang="scss">
+:deep(.u-border-bottom) {
+    border-color: transparent !important;
+}
+.title {
+    .base {
+        font-size: 28rpx;
+        color: #333;
+        font-weight: 500;
+        margin-right: 20rpx;
+        word-break: break-all;
+    }
+    .area {
+        font-size: 24rpx;
+        color: #999;
+    }
+    .label {
+        font-size: 24rpx;
+        color: #37a954;
+        border-radius: 100rpx;
+        background-color: #e3efe6;
+        width: max-content;
+        padding-left: 14rpx;
+        padding-right: 14rpx;
+        padding-top: 6rpx;
+        padding-bottom: 6rpx;
+    }
+}
+.activeTitle {
+    background-color: #37a954;
+    .base {
+        font-size: 28rpx;
+        color: #fff;
+        font-weight: 500;
+        margin-right: 20rpx;
+    }
+    .area {
+        font-size: 24rpx;
+        color: #ebf6ee;
+    }
+    .label {
+        font-size: 24rpx;
+        color: #fff;
+        border-radius: 100rpx;
+        background-color: #5fba76;
+        width: max-content;
+        padding-left: 14rpx;
+        padding-right: 14rpx;
+        padding-top: 6rpx;
+        padding-bottom: 6rpx;
+    }
+}
+:deep(.u-checkbox-label--left) {
+    flex-direction: row-reverse !important;
+}
+:deep(.u-checkbox__icon-wrap) {
+    margin-right: 0 !important;
+    margin-left: 10px;
+}
+
+/* 自定义复选框样式 */
+.custom-checkbox {
+    display: flex;
+    align-items: center;
+    padding: 16rpx 20rpx;
+    margin-bottom: 10rpx;
+    border: 2rpx solid #dcdfe6;
+    border-radius: 8rpx;
+    background-color: #fff;
+    transition: all 0.3s ease;
+    cursor: pointer;
+}
+
+.custom-checkbox:hover {
+    border-color: #37a954;
+}
+
+.custom-checkbox--checked {
+    border-color: #37a954;
+    background-color: #f0f9f4;
+}
+
+.custom-checkbox--all {
+    margin-bottom: 20rpx;
+    border-color: #37a954;
+    background-color: #f0f9f4;
+    font-weight: 500;
+}
+
+.custom-checkbox__inner {
+    display: flex;
+    align-items: center;
+    width: 100%;
+}
+
+.custom-checkbox__icon {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 32rpx;
+    height: 32rpx;
+    margin-right: 16rpx;
+    border-radius: 4rpx;
+    background-color: #37a954;
+    color: #fff;
+    font-size: 24rpx;
+    font-weight: bold;
+}
+
+.custom-checkbox__label {
+    font-size: 28rpx;
+    color: #333;
+    flex: 1;
+}
+
+.custom-checkbox--checked .custom-checkbox__label {
+    color: #37a954;
+    font-weight: 500;
+}
+
+.custom-checkbox--all .custom-checkbox__label {
+    color: #37a954;
+    font-weight: 600;
+}
+</style>

+ 337 - 0
src/plant/port/port-detail/index.vue

@@ -0,0 +1,337 @@
+<template>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" safe-area-inset-bottom>
+        <template #top>
+            <ut-navbar title="种养殖任务详情" :fixed="false"></ut-navbar>
+        </template>
+        <template>
+            <view class="startline-title pl-24 ml-24 mb-16">基地信息</view>
+            <view class="bg-#fff pd-24 mb-20 pt-0">
+                <Baseinfo v-if="deawerData" :modeValue="deawerData" :baseType="form.taskType" :showClose="false" />
+            </view>
+            <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
+            <view class="bg-#fff pd-24 mb-20 pt-0">
+                <view class="pt-16 pb-16 info-border-bottom">
+                    <text class="c-#666 f-s-30">任务类型:</text>
+                    <text class="c-#333 f-s-30 f-w-5">{{ selectDictLabel(pt_task_type, form.taskType) }}</text>
+                </view>
+                <!-- 种植字段显示(仅当 taskType == 1 时显示) -->
+                <template v-if="form.taskType == 1">
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <text class="c-#666 f-s-30">符合要求:</text>
+                        <text class="c-#333 f-s-30 f-w-5">{{ form.gapFlag ? selectDictLabel(pt_task_gap_flag, form.gapFlag) : '--' }}</text>
+                    </view>
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <view class="c-#666 f-s-30 mb-20">植物名称:</view>
+                        <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
+                            </view>
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
+                            </view>
+                            <view class="">
+                                <text class="c-#666 f-s-24">产出:</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
+                            </view>
+                        </view>
+                    </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 f-w-5">{{ form.plantationCode || '--' }}</text>
+                    </view>
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <view class="c-#666 f-s-30 mb-20">种植技术规程:</view>
+                        <ut-album v-if="form.technicalFile?.length > 0" :urls="form.technicalFile"></ut-album>
+                        <text v-else class="c-#333 f-s-30 f-w-5">{{ '--' }}</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 f-w-5">{{ form.plantationMethod ? selectDictLabel(pt_feeding_method, form.plantationMethod) : '--' }}</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 f-w-5">{{ `${form.plannedStartDate} 至 ${form.plannedEndDate}` }}</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 f-w-5">{{ form.plantingAmount ? `${form.plantingAmount}${form.plantingUnit || ''}` : '--' }}</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 f-w-5">{{ form.reproductionType ? selectDictLabel(pt_reproduction_type, form.reproductionType) : '--' }}</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 f-w-5">{{ form.plantationType ? selectDictLabel(pt_plantation_type, form.plantationType) : '--' }}</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 f-w-5">{{ form.sowingMethod ? selectDictLabel(pt_sowing_method, form.sowingMethod) : '--' }}</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 f-w-5">{{ form.transplantMethod ? selectDictLabel(pt_transplant_method, form.transplantMethod) : '--' }}</text>
+                    </view>
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <view class="c-#666 f-s-30 mb-20">前茬植物:</view>
+                        <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-34 f-w-5 mr-5">{{ PreBiological?.varietyName }}</text>
+                                <text class="c-#666 f-s-24">{{ PreBiological?.latinName }}</text>
+                            </view>
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-28 f-w-5 mr-5">{{ PreBiological?.genusName }}</text>
+                                <text class="c-#666 f-s-24">{{ PreBiological?.genusLatinName }}</text>
+                            </view>
+                            <view class="">
+                                <text class="c-#666 f-s-24">产出:</text>
+                                <text class="c-#666 f-s-24">{{ PreBiological?.medicineName }}</text>
+                            </view>
+                        </view>
+                    </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 f-w-5">{{ form.remark || '--' }}</text>
+                    </view>
+                </template>
+                <!-- 养殖字段显示(仅当 taskType == 2 时显示) -->
+                <template v-if="form.taskType == 2">
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <text class="c-#666 f-s-30">溯源级别:</text>
+                        <text class="c-#333 f-s-30 f-w-5">{{ form.mgMethod ? selectDictLabel(pt_mg_method, form.mgMethod) : '--' }}</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 f-w-5">{{ form.gapFlag ? selectDictLabel(pt_task_gap_flag, form.gapFlag) : '--' }}</text>
+                    </view>
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <view class="c-#666 f-s-30 mb-20">动物名称:</view>
+                        <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
+                            </view>
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
+                            </view>
+                            <view class="">
+                                <text class="c-#666 f-s-24">产出:</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
+                            </view>
+                        </view>
+                    </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 f-w-5">{{ form.plantationCode || '--' }}</text>
+                    </view>
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <view class="c-#666 f-s-30 mb-20">养殖技术规程:</view>
+                        <ut-album v-if="form.technicalFile?.length > 0" :urls="form.technicalFile"></ut-album>
+                        <text v-else class="c-#333 f-s-30 f-w-5">{{ '--' }}</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 f-w-5">{{ form.plantationMethod ? selectDictLabel(pt_feeding_method, form.plantationMethod) : '--' }}</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 f-w-5">{{ `${form.plannedStartDate} 至 ${form.plannedEndDate}` }}</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 f-w-5">{{ form.plantingAmount ? `${form.plantingAmount}${form.plantingUnit || ''}` : '--' }}</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 f-w-5">{{ form.breedScale ? `${form.breedScale}个` : '--' }}</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 f-w-5">{{ form?.plantingMgAmount ? `${form.plantingMgAmount}${form?.plantingMgUnit ? selectDictLabel(pt_planting_mg_unit, form.plantingMgUnit) : ''}` : '--' }}</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 f-w-5">{{ form.remark || '--' }}</text>
+                    </view>
+                </template>
+                <!-- 种畜繁育字段显示(仅当 taskType == 21 时显示) -->
+                <template v-if="form.taskType == 21">
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <text class="c-#666 f-s-30">是否代繁育:</text>
+                        <text class="c-#333 f-s-30 f-w-5">{{ form.delegateFlag ? selectDictLabel(yes_no, form.delegateFlag) : '--' }}</text>
+                    </view>
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <view class="c-#666 f-s-30 mb-20">委托企业:</view>
+                        <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
+                            <view class="">
+                                <text class="c-#333 f-s-34 f-w-5 mr-5">{{ form?.delegateInfo?.cusName }}</text>
+                            </view>
+                            <view class="">
+                                <text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
+                            </view>
+                        </view>
+                    </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 f-w-5">{{ form.mgMethod ? selectDictLabel(pt_mg_method, form.mgMethod) : '--' }}</text>
+                    </view>
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <view class="c-#666 f-s-30 mb-20">动物名称:</view>
+                        <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
+                            </view>
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
+                            </view>
+                            <view class="">
+                                <text class="c-#666 f-s-24">产出:</text>
+                                <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
+                            </view>
+                        </view>
+                    </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 f-w-5">{{ form.plantationCode || '--' }}</text>
+                    </view>
+                    <view class="pt-16 pb-16 info-border-bottom">
+                        <view class="c-#666 f-s-30 mb-20">养殖繁育技术规程:</view>
+                        <ut-album v-if="form.technicalFile?.length > 0" :urls="form.technicalFile"></ut-album>
+                        <text v-else class="c-#333 f-s-30 f-w-5">{{ '--' }}</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 f-w-5">{{ form.plantationMethod ? selectDictLabel(pt_feeding_method, form.plantationMethod) : '--' }}</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 f-w-5">{{ `${form.plannedStartDate} 至 ${form.plannedEndDate}` }}</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 f-w-5">{{ form.plantingAmount ? `${form.plantingAmount}${form.plantingUnit || ''}` : '--' }}</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 f-w-5">{{ form.breedScale ? `${form.breedScale}个` : '--' }}</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 f-w-5">{{ form?.plantingMgAmount ? `${form.plantingMgAmount}${form?.plantingMgUnit ? selectDictLabel(pt_planting_mg_unit, form.plantingMgUnit) : ''}` : '--' }}</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 f-w-5">{{ form.remark || '--' }}</text>
+                    </view>
+                </template>
+            </view>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import Baseinfo from '../port-create/models/baseinfo.vue';
+import { useClientRequest } from '@/utils/request';
+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')
+);
+const params = ref();
+const paging = ref();
+const list = ref();
+const form = ref<any>({
+    deawerData: null,
+    baseId: null,
+    landIds: [],
+    taskType: null,
+    gapFlag: null,
+    mgMethod: null,
+    varietyId: null,
+    plantationCode: null,
+    plantationMethod: null,
+    reproductionType: null,
+    technicalFile: [],
+    plantingUnit: null,
+    breedScale: null,
+    queryType6: {
+        plannedStartDate: null,
+        plannedEndDate: null,
+    },
+    plant: {
+        plantingMgAmount: null,
+        plantingMgUnit: null,
+    },
+    plantingAmount: '',
+    remark: null,
+    delegateFlag: '0',
+    delegateInfo: { cusId: '1795009980763025410', crediteCode: '91530102MACA96MJ9H', cusName: '演示企业' },
+    plantationType: null,
+    sowingMethod: null,
+    transplantMethod: null,
+    preCropId: null,
+    inoculation: {
+        inoculationAmount: null,
+        inoculationUnit: null,
+        inoculationDosage: null,
+        inoculationDosageUnit: null,
+    },
+    cultureMediumFormula: null,
+});
+const deawerData = ref(null);
+const animalIds = ref();
+// 所选动植物
+const Biological = ref<any>(null);
+const PreBiological = ref<any>(null);
+const getCache = async () => {
+    const res = await useClientRequest.get<any>(`/plt-api/app/plantationTask/getInfo/${params.value}`);
+    if (!res.data) return;
+    form.value = res.data;
+    if (res.data.animalIds) {
+        animalIds.value = res.data.animalIds;
+    }
+    if (res.data.preCropCode) {
+        PreBiological.value = {};
+        const Bio = await useClientRequest.get(`/plt-api/app/medicine/getMedicineByCode/${res.data.preCropCode}`);
+        PreBiological.value = Bio.data;
+    }
+    if (res.data.varietyCode) {
+        Biological.value = {};
+        const Bio = await useClientRequest.get(`/plt-api/app/medicine/getMedicineByCode/${res.data.varietyCode}`);
+        Biological.value = Bio.data;
+    }
+    // 判断有没有基地,然后去获取基地数据
+    if (res.data.baseId) {
+        deawerData.value = {};
+        deawerData.value.baseName = res.data.baseRef.baseName;
+        deawerData.value.areaUnit = res.data.baseRef.baseInfo.areaUnit;
+        deawerData.value.address = res.data.baseRef.baseInfo.address;
+        // adcodeName
+        deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
+        if (res.data.landIds.length == 0) {
+            deawerData.value.aloneChecked = true;
+            const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
+            deawerData.value.data = landIds.rows;
+        } else {
+            deawerData.value.aloneChecked = false;
+            deawerData.value.data = [];
+            const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
+            //找到res.data.landIds和landIds.rows中的id相同的项
+            landIds.rows.forEach((i: any) => {
+                if (res.data.landIds.find((t: any) => t == i.id)) {
+                    deawerData.value.data.push(i);
+                }
+            });
+        }
+    }
+};
+onMounted(() => {
+    getCache();
+});
+onLoad((options: any) => {
+    params.value = options?.id;
+});
+</script>

+ 0 - 0
src/static/images/plant/port/任务-养殖.png → src/static/images/plant/port/Task_Breeding.png


+ 0 - 0
src/static/images/plant/port/任务-种畜繁育.png → src/static/images/plant/port/Task_Breeding_Livestock.png


+ 0 - 0
src/static/images/plant/port/饲养管理.png → src/static/images/plant/port/Task_Breeding_management.png


+ 0 - 0
src/static/images/plant/port/采收管理.png → src/static/images/plant/port/Task_Harvest_management.png


+ 0 - 0
src/static/images/plant/port/任务-种植.png → src/static/images/plant/port/Task_Planting.png


+ 0 - 0
src/static/images/plant/port/任务-种苗繁育.png → src/static/images/plant/port/Task_Seedling_breeding.png


+ 0 - 0
src/static/images/plant/port/种源信息.png → src/static/images/plant/port/Task_Species_source_information.png