lisy 4 өдөр өмнө
parent
commit
e2fb3eb48a

+ 7 - 7
src/components/ut-navbar/ut-navbar.vue

@@ -73,23 +73,23 @@ function handleHomeClick() {
     emit('home');
     uni.switchTab({ url: props.homeUrl });
 }
-const breads = ref<any[]>([])
+const breads = ref<any[]>([]);
 const initPages = () => {
-    const pages = getCurrentPages()
+    const pages = getCurrentPages();
     // 获取当前页面
-    const currentPage: any = pages[pages.length - 1]
+    const currentPage: any = pages[pages.length - 1];
     if (props.title || props.leftText) {
         pagesStore.setPageTitle(currentPage.route, props.title || props.leftText);
     }
     breads.value = pages.map((item: any) => {
-        const route = item.route;        
+        const route = item.route;
         return {
             title: pagesStore.mapPages.get(route)?.title || '未命名页面',
             route,
-        }
-    })
+        };
+    });
 };
 onMounted(() => {
-  initPages();
+    initPages();
 });
 </script>

+ 2 - 2
src/config.ts

@@ -14,9 +14,9 @@ interface ProjectConfig {
 
 const config: ProjectConfig = {
     baseUrl: import.meta.env.VITE_API_BASE_URL || 'http://localhost:3000',
-    clientId: '20251229',
+    clientId: '20260119',
     tenantId: '000000',
-    appid: '1942409637969063940'
+    appid: '1942409637969063940',
 };
 
 export default config;

+ 1 - 1
src/manifest.json

@@ -56,7 +56,7 @@
     "quickapp": {},
     /* 小程序特有相关 */
     "mp-weixin": {
-        "appid": "wxd52c8780db580e84",
+        "appid": "wxf11517e71e36169f",
         "setting": {
             "urlCheck": false,
             "minified": true

+ 55 - 4
src/pages/plant/port/index.vue

@@ -21,9 +21,13 @@
         <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>
-        <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="pd-24">
+            <up-swipe-action>
+                <up-swipe-action-item v-for="(item, index) in list" :key="index" :options="options2" class="mb-20" @click="clickTempSwipe">
+                    <task :data="item" @click="$u.route({ type: 'navigateTo', url: '/plant/port/port-detail/index', params: { id: item?.id } })" />
+                </up-swipe-action-item>
+            </up-swipe-action>
+        </view>
         <view class="h-210" v-if="list?.length"></view>
         <view v-if="list?.length" :style="{ height: `${safeAreaBottom}px` }"></view>
         <template #empty>
@@ -100,7 +104,24 @@ const query = async (pageNum: number, pageSize: number) => {
         paging.value.complete(rows);
     }
 };
-
+const options2 = reactive([
+    {
+        text: '复制任务',
+        style: {
+            backgroundColor: '#37A954',
+            width: '80rpx',
+            fontSize: '28rpx',
+        },
+    },
+    {
+        text: '结束任务',
+        style: {
+            backgroundColor: '#F74C30',
+            width: '80rpx',
+            fontSize: '28rpx',
+        },
+    },
+]);
 const onRefresh = () => {
     paging.value.reload();
 };
@@ -118,6 +139,32 @@ const handleDeleteCancel = () => {
 const handlechoseConfirm = () => {
     uni.$u.route({ type: 'navigateTo', url: '/plant/port/port-create/index', params: { taskType: basetype.value } });
 };
+const clickTempSwipe = async (event: object) => {
+    const { name, index } = event as any;
+    if (index === 1) {
+        try {
+            const res = await uni.showModal({
+                title: '结束提示',
+                content: '确定结束该任务吗?',
+                confirmColor: '#f56c6c',
+            });
+            if (!res.confirm) return;
+            await uni.showLoading({
+                title: '结束中...',
+                mask: true,
+            });
+            // await useClientRequest.get(`/plt-api/app/base/delById/${name}`);
+            uni.hideLoading();
+            uni.showToast({
+                title: '结束成功',
+                icon: 'success',
+            });
+            paging.value?.reload();
+        } catch (error) {
+            console.error('结束任务失败:', error);
+        }
+    }
+};
 </script>
 <style lang="scss" scoped>
 // @import '@/assets/styles/theme.scss';
@@ -134,4 +181,8 @@ const handlechoseConfirm = () => {
 :deep(.u-subsection__item) {
     border: 1px solid transparent !important;
 }
+:deep(.u-swipe-action-item__right__button__wrapper__text) {
+    line-height: 1.6 !important;
+    white-space: normal;
+}
 </style>

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

@@ -1,6 +1,6 @@
 <template>
     <!-- 养殖 -->
-    <view class="pd-24 pt-0" v-if="data.taskType === '2'" @click="$emit('click')">
+    <view class="" 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>
@@ -68,7 +68,7 @@
         </view>
     </view>
     <!-- 种苗繁育 -->
-    <view class="pd-24 pt-0" v-if="data.taskType === '11'" @click="$emit('click')">
+    <view class="" v-if="data.taskType === '11'" @click="$emit('click')">
         <view class="b-radius bg-#fff pd-10 p-rtv">
             <image class="w-112 h-34" src="/static/images/plant/port/Task_Seedling_breeding.png" mode="widthFix" style="position: absolute; top: 0; left: 0" />
             <view class="d-flex j-ed f-s-22 c-#666">{{ data?.plannedStartDate }} 至 {{ data?.plannedEndDate }}</view>
@@ -146,7 +146,7 @@
         </view>
     </view>
     <!-- 种植 -->
-    <view class="pd-24 pt-0" v-if="data.taskType === '1'" @click="$emit('click')">
+    <view class="" 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>
@@ -214,7 +214,7 @@
         </view>
     </view>
     <!-- 种畜繁育 -->
-    <view class="pd-24 pt-0" v-if="data.taskType === '21'" @click="$emit('click')">
+    <view class="" 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>

+ 81 - 12
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>
-            <up-navbar title="创建种养殖任务" :fixed="false"></up-navbar>
+            <ut-navbar title="创建种养殖任务" :fixed="false"></ut-navbar>
         </template>
         <view class="pt-24">
             <!-- 养殖 -->
@@ -710,7 +710,7 @@
         </view>
         <template #bottom>
             <view class="pd-24 d-flex j-c gap-20 base-bottom-wrap">
-                <up-button type="primary" @click="saveDraft()">暂存</up-button>
+                <up-button type="warning" @click="saveDraft()">暂存</up-button>
                 <up-button type="primary" @click="save()">提交</up-button>
             </view>
         </template>
@@ -1238,17 +1238,22 @@ function openLaboratory() {
 function handleLaboratoryConfirm(data: any) {
     console.log('收到基地选择数据:', data);
 }
+const taskId = ref();
 onLoad((options) => {
-    form.value.taskType = options?.taskType;
-    if (+options?.taskType == 1 || +options?.taskType == 11) {
-        form.value.plantingUnit = '亩';
-        if (+options?.taskType == 11) {
-            form.value.gapFlag = 0;
-        }
+    if (!options?.taskType && options?.taskId) {
+        taskId.value = options?.taskId;
     } else {
-        form.value.plantingUnit = '平方米';
-        if (+options?.taskType == 21) {
-            form.value.gapFlag = 0;
+        form.value.taskType = options?.taskType;
+        if (+options?.taskType == 1 || +options?.taskType == 11) {
+            form.value.plantingUnit = '亩';
+            if (+options?.taskType == 11) {
+                form.value.gapFlag = 0;
+            }
+        } else {
+            form.value.plantingUnit = '平方米';
+            if (+options?.taskType == 21) {
+                form.value.gapFlag = 0;
+            }
         }
     }
 });
@@ -1308,6 +1313,66 @@ const getCache = async (taskType: TaskType | null) => {
         deawerData.value = {};
         deawerData.value.baseName = res.data.baseRef.baseName;
         deawerData.value.areaUnit = res.data.baseRef.baseInfo.areaUnit;
+        deawerData.value.area = res.data.baseRef.baseInfo.area;
+        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);
+                }
+            });
+        }
+    }
+};
+// 获取详细数据
+const getInfo = async (taskId: any) => {
+    const res = await useClientRequest.get<any>(`/plt-api/app/plantationTask/getInfo/${taskId}`);
+    if (!res.data) return;
+    form.value = res.data;
+
+    form.value.queryType6 = {
+        plannedStartDate: res.data.plannedStartDate,
+        plannedEndDate: res.data.plannedEndDate,
+    };
+    form.value.inoculation = {
+        inoculationAmount: res.data.inoculationAmount,
+        inoculationDosage: res.data.inoculationDosage,
+        inoculationUnit: res.data.inoculationUnit,
+        inoculationDosageUnit: res.data.inoculationDosageUnit,
+    };
+    form.value.plant = {
+        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 = {};
+        deawerData.value.baseName = res.data.baseRef.baseName;
+        deawerData.value.areaUnit = res.data.baseRef.baseInfo.areaUnit;
+        deawerData.value.area = res.data.baseRef.baseInfo.area;
         deawerData.value.address = res.data.baseRef.baseInfo.address;
         // adcodeName
         deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
@@ -1329,6 +1394,10 @@ const getCache = async (taskType: TaskType | null) => {
     }
 };
 onMounted(() => {
-    getCache(form.value.taskType);
+    if (taskId.value) {
+        getInfo(taskId.value);
+    } else {
+        getCache(form.value.taskType);
+    }
 });
 </script>

+ 147 - 8
src/plant/port/port-detail/index.vue

@@ -4,8 +4,10 @@
             <ut-navbar title="种养殖任务详情" :fixed="false"></ut-navbar>
         </template>
         <template>
+            <!-- <up-alert :title="'备注' + form?.remark" type = "warning" ></up-alert> -->
             <view class="startline-title pl-24 ml-24 mb-16">基地信息</view>
-            <view class="bg-#fff pd-24 mb-20 pt-0">
+            <view class="bg-#fff pd-24 mb-20">
+                <view v-if="form?.remark" class="pd4-16-20-16-20 bg-#EBF6EE c-primary f-s-30 f-w-5 b-radius mb-24">备注:{{ form?.remark }}</view>
                 <Baseinfo v-if="deawerData" :modeValue="deawerData" :baseType="form.taskType" :showClose="false" />
             </view>
             <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
@@ -76,7 +78,7 @@
                     </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 v-if="PreBiological" 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>
@@ -90,6 +92,7 @@
                                 <text class="c-#666 f-s-24">{{ PreBiological?.medicineName }}</text>
                             </view>
                         </view>
+                        <view v-else class="">--</view>
                     </view>
                     <view class="pt-16 pb-16 info-border-bottom">
                         <text class="c-#666 f-s-30">备注:</text>
@@ -229,6 +232,138 @@
                         <text class="c-#333 f-s-30 f-w-5">{{ form.remark || '--' }}</text>
                     </view>
                 </template>
+                <!-- 种苗繁育字段显示(仅当 taskType == 11 时显示) -->
+                <template v-if="form.taskType == 11">
+                    <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 v-if="+deawerData?.data[0]?.landType == 1" 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.inoculationAmount ? `${form.inoculationAmount}${form?.inoculationUnit}` : '--' }}</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_inoculation_dosage_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.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 v-if="PreBiological" 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 v-else class="">--</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>
+            </view>
+            <template v-if="animalIds?.length > 0">
+                <view class="startline-title pl-24 ml-24 mb-16">个体标识信息</view>
+                <view class="bg-#fff pd-24 mb-20">
+                    <template v-for="(item, index) in animalIds" :key="index">
+                        <view class="pd-34 border-#37A954 mb-20 d-flex flex-cln b-radius">
+                            <text>{{ +index + 1 }}</text>
+                            <text>{{ item }}</text>
+                        </view>
+                    </template>
+                </view>
+            </template>
+            <view class="pd-24">
+                <view class="d-flex j-c pd-10">
+                    <view class="mr-10 c-#ccc f-s-24">
+                        <text>最新操作人:</text>
+                        <text>{{ form?.updateByName || form?.createByName }}</text>
+                    </view>
+                    <view class="c-#ccc f-s-24">
+                        <text>最新操作时间:</text>
+                        <text>{{ form?.updateTime || form?.createTime }}</text>
+                    </view>
+                </view>
+                <view class="">
+                    <up-button type="primary" class="b-radius" @click="handlechoseConfirm">修改</up-button>
+                </view>
             </view>
         </template>
     </z-paging>
@@ -240,7 +375,6 @@ 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>({
@@ -281,13 +415,14 @@ const form = ref<any>({
     },
     cultureMediumFormula: null,
 });
-const deawerData = ref(null);
+const deawerData = ref<any>(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}`);
+const taskId = ref();
+const getInfo = async () => {
+    const res = await useClientRequest.get<any>(`/plt-api/app/plantationTask/getInfo/${taskId.value}`);
     if (!res.data) return;
     form.value = res.data;
     if (res.data.animalIds) {
@@ -308,6 +443,7 @@ const getCache = async () => {
         deawerData.value = {};
         deawerData.value.baseName = res.data.baseRef.baseName;
         deawerData.value.areaUnit = res.data.baseRef.baseInfo.areaUnit;
+        deawerData.value.area = res.data.baseRef.baseInfo.area;
         deawerData.value.address = res.data.baseRef.baseInfo.address;
         // adcodeName
         deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
@@ -328,10 +464,13 @@ const getCache = async () => {
         }
     }
 };
+const handlechoseConfirm = () => {
+    uni.$u.route({ type: 'navigateTo', url: '/plant/port/port-create/index', params: { taskId: taskId.value } });
+};
 onMounted(() => {
-    getCache();
+    getInfo();
 });
 onLoad((options: any) => {
-    params.value = options?.id;
+    taskId.value = options?.id;
 });
 </script>

+ 1 - 0
src/tools/por-torganism/index.vue

@@ -113,5 +113,6 @@ onMounted(() => {
 });
 onUnload(() => {
     console.log('????');
+    uni.$off('updateBiologicalname');
 });
 </script>