5 Commits 053bd556a2 ... 00ce8984fb

Autor SHA1 Mensagem Data
  lisy 00ce8984fb Merge branch 'master' of http://git.yujin.shuziyunyao.com/yujin/forestry-wx 1 semana atrás
  lisy 0813bee228 修改页面 1 semana atrás
  lisy 585c92d505 Merge branch 'master' of http://git.yujin.shuziyunyao.com/yujin/forestry-wx 1 semana atrás
  lisy e50700a15f 修改页面 1 semana atrás
  lisy fd31645a33 修改页面 1 semana atrás

+ 6 - 1
src/assets/styles/public.scss

@@ -167,5 +167,10 @@ $colors: (
     height: 38rpx;
 }
 .info-border-bottom {
-    border-bottom: 1rpx solid #F2F2F2;
+    border-bottom: 1rpx solid #f2f2f2;
+}
+.base-bottom-wrap {
+    position: relative;
+    box-shadow: 6rpx 0px 27rpx 0px rgba(#2a6d52, 0.3);
+    background-color: #fff;
 }

+ 7 - 1
src/pages.json

@@ -138,7 +138,7 @@
         {
             "root": "plant/storage",
             "pages": [
-               // 库房管理
+                // 库房管理
                 {
                     "path": "storage-room/list/index",
                     "style": {
@@ -202,6 +202,12 @@
                     "style": {
                         "navigationBarTitleText": "选择GAP获评信息"
                     }
+                },
+                {
+                    "path": "por-torganism/index",
+                    "style": {
+                        "navigationBarTitleText": "选择动植物类型"
+                    }
                 }
             ]
         },

+ 21 - 21
src/pages/plant/port/index.vue

@@ -30,25 +30,25 @@
                     <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-#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-#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-#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-#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-#666 w-s-no">养殖量</view>
                         <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
                     </view>
                 </view>
@@ -71,25 +71,25 @@
                     <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-#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-#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-#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-#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-#666 w-s-no">繁育量</view>
                         <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
                     </view>
                 </view>
@@ -112,25 +112,25 @@
                     <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-#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-#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-#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-#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-#666 w-s-no">种植量</view>
                         <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
                     </view>
                 </view>
@@ -153,25 +153,25 @@
                     <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-#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-#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-#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-#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-#666 w-s-no">养殖量</view>
                         <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
                     </view>
                 </view>
@@ -254,7 +254,7 @@ const query = async (pageNum: number, pageSize: number) => {
         pageSize,
         ...form.value,
     };
-    const res = await useClientRequest.get('/plt-api/app/base/pageList', params);
+    const res = await useClientRequest.get('/plt-api/app/plantationTask/list', params);
     if (res) {
         const { rows } = res;
         paging.value.complete(rows);

Diferenças do arquivo suprimidas por serem muito extensas
+ 869 - 120
src/plant/port/port-create/index.vue


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

@@ -1,15 +1,14 @@
 <template>
-    <view class="border-#AFDDBB pd-26 pb-8 bg-#FBFDFB p-rtv">
+    <view class="border-#AFDDBB pd-26 pb-10 pt-10 bg-#FBFDFB p-rtv">
         <!-- 关闭按钮 -->
-        <view class="c-#F81242 f-s-30 ab2-10-20" @click="handleClose"> × </view>
-        <view class="c-#333 f-s-34 f-w-5 pt-8 pb-8 pr-16">{{ modeValue?.baseName }}</view>
-
+        <view 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" style="position: absolute; left: 0; top: 0">
-            <view v-if="modeValue?.gapFlag && Number(modeValue.gapFlag) === 1" class="label mr-10">GAP</view>
-            <view v-if="modeValue?.swyqRes && Number(modeValue.swyqRes) === 1" class="label">三无一全</view>
+        <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>
+            <view v-if="+modeValue?.swyqRes && !+modeValue?.gapFlag" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.swyqVarietyName }}三无一全基地</view>
+            <view v-if="+modeValue?.gapFlag && +modeValue?.swyqRes" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.medicineName }}GAP基地和{{ modeValue?.swyqVarietyName }}三无一全基地</view>
         </view>
-
+        <view class="c-#333 f-s-34 f-w-5 pt-8 pb-8 pr-16">{{ modeValue?.baseName }}</view>
         <view class="pt-8 pb-8">
             <text class="c-#666 f-s-28">基地面积:</text>
             <text class="c-#333 f-s-28 f-w-5">{{ modeValue?.area }}{{ modeValue?.areaUnit }}</text>
@@ -40,12 +39,14 @@ interface ModeValue {
     areaUnit?: string;
     address?: string;
     adcodeName?: string;
-    gapFlag?: number | string;
-    swyqRes?: number | string;
+    gapFlag?: any;
+    swyqRes?: any;
     aloneChecked?: boolean;
     data?: any[];
     // 保留原有字段以保持向后兼容
     checkBox?: any[];
+    medicineName: string | null;
+    swyqVarietyName: string | null;
 }
 
 // 接收modeValue对象

+ 17 - 4
src/plant/port/port-create/models/drawer.vue

@@ -30,9 +30,10 @@
                 <scroll-view class="w-50% pd-16" :style="`height: calc(100vh - ${top}px)`" scroll-y="true">
                     <up-checkbox v-if="mixData.length > 0" label="全选" labelColor="#333" name="agree" usedAlone :checked="aloneChecked" @change="handleAllCheckboxChange"></up-checkbox>
                     <!-- 复选框组包含全选框 -->
-                    <up-checkbox-group activeColor="#37a954" :modelValue="checkBox" @change="handleCheckboxGroupChange" iconPlacement="right" placement="column">
+                    <up-checkbox-group v-if="mixData.length > 0" activeColor="#37a954" :modelValue="checkBox" @change="handleCheckboxGroupChange" iconPlacement="right" placement="column">
                         <up-checkbox v-for="(item, index) in mixData" :key="index" :name="item?.id" :label="item?.landName"></up-checkbox>
                     </up-checkbox-group>
+                    <view v-if="mixData.length == 0 && showtitle" class="">请先在左侧添加选择基地,选择后此处将会展示地块/圈舍/组培架信息。</view>
                 </scroll-view>
             </view>
             <view v-if="medicineName || swyqVarietyName" class="w-700 c-primary bg-#EBF6EE f-s-24" style="position: fixed; bottom: 140rpx; right: 0">
@@ -60,6 +61,7 @@ const form = ref({
     tempFlag: 0,
     gapFlag: '',
     swyqRes: '',
+    plBaseType: props.baseType,
 });
 // 左侧基地列表数据
 const list = ref<any[]>([]);
@@ -69,6 +71,7 @@ const medicineName = ref<string>('');
 const swyqVarietyName = ref<string>('');
 // 右侧地块数据
 const mixData = ref<any[]>([]);
+const showtitle = ref(true);
 // 当前选择基地
 const baseID = ref(-1);
 // 请求的次数
@@ -78,14 +81,13 @@ const emit = defineEmits<{
     (e: 'update:modelValue', value: boolean): void;
     (e: 'open'): void;
     (e: 'close'): void;
-    (e: 'confirm', data: { checkBox: any[]; data: any[]; aloneChecked: boolean; baseName: string; area?: string; gapFlag: number; swyqRes: number; areaUnit: string; adcodeName: string; address: string }): void; // 新增
+    (e: 'confirm', data: { medicineName: string; swyqVarietyName: 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');
@@ -106,8 +108,10 @@ const changeSelect = (index: number) => {
         form.value.gapFlag = '';
         form.value.swyqRes = '1';
     }
+    baseID.value = -1;
     pageNum.value = 1;
     list.value = [];
+    mixData.value = [];
     medicineName.value = '';
     swyqVarietyName.value = '';
     allCheckboxNames.value = [];
@@ -126,6 +130,7 @@ const activeBase = ref(-1);
 const changeBase = (index: number, item: any) => {
     if (activeBase.value == index) return;
     activeBase.value = index;
+    mixData.value = [];
     baseID.value = item.id;
     medicineName.value = '';
     swyqVarietyName.value = '';
@@ -219,6 +224,8 @@ const confirm = () => {
             aloneChecked: aloneChecked.value,
             gapFlag: selectedBase.gapFlag,
             swyqRes: selectedBase.swyqRes,
+            swyqVarietyName: selectedBase.swyqVarietyName,
+            medicineName: selectedBase.gapInfo?.medicineName,
             data: data,
             checkBox: checkBox.value,
         });
@@ -231,8 +238,13 @@ const confirm = () => {
 watch(
     () => baseID.value,
     async () => {
+        if (baseID.value == -1) {
+            showtitle.value = true;
+            return;
+        }
+        showtitle.value = false;
         const res = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: baseID.value });
-        console.log(res);
+        mixData.value = [];
         const { rows } = res;
         mixData.value = rows;
         allCheckboxNames.value = [];
@@ -241,6 +253,7 @@ watch(
         mixData.value.forEach((item) => {
             allCheckboxNames.value.push(item.id);
         });
+        showtitle.value = true;
     }
 );
 onMounted(() => {

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

@@ -0,0 +1,115 @@
+<template>
+    <z-paging ref="paging" v-model="list" bgColor="#fff" @query="query" :auto="false" safe-area-inset-bottom>
+        <template #top>
+            <view class="">
+                <up-navbar title="选择动植物名称" @leftClick="navigateBackOrHome()" :fixed="false"></up-navbar>
+                <view class="pd-24">
+                    <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" @change="changeSeach" margin="0" :border="false" placeholder="可输入药材名称或动植物基原名称搜索" bgColor="#f7f7f7" height="86rpx" borderRadius="16rpx"></ut-search>
+                </view>
+            </view>
+        </template>
+        <view class="pd-24" v-if="!showSearch">
+            <template v-if="speArray.length">
+                <view class="f-s-32 c-#333 f-w-5 mb-20">主营品种</view>
+                <view class="d-flex a-c f-w-w">
+                    <spe-lable class="mr-20 mb-20" v-for="(item, index) in speArray" :key="index" :text="item?.medicineName" size="30rpx" :id="item?.id" @click="changeSpe(item?.medicineName)" />
+                </view>
+            </template>
+            <template>
+                <ut-empty></ut-empty>
+                <view class="d-flex flex-cln j-c a-c">
+                    <view class="c-#ccc f-s-28">您可以直接搜索,或前往<text class="c-primary">基地-主营品种配置</text>页面进行</view>
+                    <view class="c-#ccc f-s-28">主营品种配置,配置后下次即可快捷选择。</view>
+                </view>
+            </template>
+        </view>
+        <view class="pd-24" v-if="showSearch">
+            <view class="f-s-32 c-#333 f-w-5 mb-20">搜索结果</view>
+            <view class="pd-30 d-flex bg-#FBFDFB border-#37A954 b-radius mb-20" v-for="(item, index) in list" :key="index">
+                <up-radio-group v-model="radiovalue1">
+                    <view class="d-flex w-100%">
+                        <view class="">
+                            <view class="mb-20 ov-hd tx-ov">
+                                <text class="c-#333 f-s-34 f-w-5 mr-5">{{ item?.varietyName }}</text>
+                                <text class="c-#666 f-s-24 tx-ov ov-hd">{{ item?.latinName }}</text>
+                            </view>
+                            <view class="mb-20">
+                                <text class="c-#333 f-s-28 f-w-5 mr-5">{{ item?.genusName }}</text>
+                                <text class="c-#666 f-s-24 tx-ov ov-hd">{{ item?.genusLatinName }}</text>
+                            </view>
+                            <view class="">
+                                <text class="c-#666 f-s-24">产出:</text>
+                                <text class="c-#666 f-s-24 tx-ov ov-hd">{{ item?.medicineName }}</text>
+                            </view>
+                        </view>
+                        <view class="flex1"></view>
+                        <view class="d-flex j-c a-c">
+                            <up-radio activeColor="#37A954" label="" :name="item?.id"></up-radio>
+                        </view>
+                    </view>
+                </up-radio-group>
+            </view>
+        </view>
+        <template #bottom v-if="showSearch">
+            <view class="pd-24 d-flex j-c gap-20 base-bottom-wrap">
+                <up-button type="primary" @click="save()">确认选择</up-button>
+            </view>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import SpeLable from './models/speLable.vue';
+const paging = ref();
+const list = ref<any[]>([]);
+const form = ref({
+    keyword: '',
+});
+const speArray = ref<any[]>([]);
+const showSearch = ref(false);
+const query = async (pageNo: number, pageSize: number) => {
+    const params = {
+        pageNo,
+        pageSize,
+        ...form.value,
+    };
+    const res = await useClientRequest.get('/plt-api/app/cpyVariety/pageList', params);
+    const { rows } = res;
+    paging.value.complete(rows);
+};
+const changeSeach = () => {
+    if (!form.value?.keyword) {
+        showSearch.value = false;
+    } else {
+        showSearch.value = true;
+    }
+    paging.value.reload();
+};
+const changeSpe = (data: string) => {
+    form.value.keyword = data;
+    changeSeach();
+};
+const getSpecies = async () => {
+    console.log('getSpecies');
+    if (form.value?.keyword) {
+        return;
+    }
+    const res = await useClientRequest.get('/plt-api/app/cpyVariety/list');
+    if (res.code === 200) {
+        speArray.value = res.data;
+    }
+};
+const radiovalue1 = ref('苹果');
+const save = () => {
+    const res = list.value.find((item) => item.id === radiovalue1.value);
+    if (!res) return;
+    uni.$emit('updateBiologicalname', { msg: res });
+    uni.navigateBack({ delta: 1 });
+};
+onMounted(() => {
+    getSpecies();
+});
+onUnload(() => {
+    console.log('????');
+});
+</script>

+ 63 - 0
src/tools/por-torganism/models/speLable.vue

@@ -0,0 +1,63 @@
+<template>
+    <view class="spe-label" :style="{ backgroundColor }" @click="handleClick">
+        <text class="label-text" :style="{ color: textColor, fontSize: size }">{{ text }}</text>
+    </view>
+</template>
+
+<script setup lang="ts">
+const props = defineProps({
+    text: {
+        type: String,
+        required: true,
+    },
+    textColor: {
+        type: String,
+        default: '#333',
+    },
+    backgroundColor: {
+        type: String,
+        default: '#f7f7f7',
+    },
+    size: {
+        type: String,
+        default: '26rpx',
+    },
+    id: {
+        type: [String, Number],
+        required: true,
+    },
+});
+
+const emit = defineEmits<{
+    click: [text: string];
+}>();
+
+const handleClick = () => {
+    emit('click', props.text);
+};
+</script>
+
+<style lang="scss" scoped>
+.spe-label {
+    position: relative;
+    display: inline-flex;
+    align-items: center;
+    justify-content: center;
+    padding: 10rpx 32rpx;
+    border-radius: 8rpx;
+    min-height: 40rpx;
+    cursor: pointer;
+}
+
+.label-text {
+    font-size: 24rpx;
+    line-height: 1.4;
+}
+
+.close-icon {
+    position: absolute;
+    top: -8rpx;
+    right: -8rpx;
+    cursor: pointer;
+}
+</style>

+ 3 - 0
src/tools/select-cpy-member/index.vue

@@ -49,6 +49,9 @@ const onRefresh = () => {
         console.error('Error refreshing address list:', e);
     }
 };
+onUnload(() => {
+    uni.$off('selectCpyMember');
+});
 </script>
 <style lang="scss" scoped>
 .select-item-card {

+ 12 - 9
src/tools/select-gap-info/index.vue

@@ -36,10 +36,10 @@
             </view>
         </view>
 
-            <template #empty >
-                <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx" image="/static/images/plant/noEmptyBase.png">暂无获评GAP基地信息~</ut-empty>
-                <view class="f-s-28 c-#ccc w-600 text-center">如已获评GAP信息,请前往<span class="c-primary">基地-GAP基地获评信息</span>添加后再来选择若未获评GAP基地,可前往各地官方渠道进行GAP基地申报</view>
-            </template>
+        <template #empty>
+            <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx" image="/static/images/plant/noEmptyBase.png">暂无获评GAP基地信息~</ut-empty>
+            <view class="f-s-28 c-#ccc w-600 text-center">如已获评GAP信息,请前往<span class="c-primary">基地-GAP基地获评信息</span>添加后再来选择若未获评GAP基地,可前往各地官方渠道进行GAP基地申报</view>
+        </template>
         <template #bottom>
             <view class="pd-20 d-flex">
                 <up-button type="primary" @click="confirmSelect">确认选择</up-button>
@@ -54,7 +54,7 @@ const list = ref<any[]>([]);
 const form = ref({
     keyword: '',
     res: '1',
-    gapBaseType: ''
+    gapBaseType: '',
 });
 const query = async (pageNum: number, pageSize: number) => {
     const res = await useClientRequest.get('/plt-api/app/gapCertificationInfo/pageList', {
@@ -72,14 +72,14 @@ const clickItem = (item: any) => {
 };
 // 确认选择
 const confirmSelect = () => {
-    const selectedItem = list.value.find(item => item.id === checkedId.value);
+    const selectedItem = list.value.find((item) => item.id === checkedId.value);
     if (selectedItem) {
         uni.$emit('selectGapInfo', selectedItem);
         uni.navigateBack();
     } else {
         uni.showToast({
             title: '请选择一项GAP基地获评信息',
-            icon: 'none'
+            icon: 'none',
         });
     }
 };
@@ -93,7 +93,10 @@ const onRefresh = () => {
 onLoad((options: any) => {
     form.value.res = options?.res || '1';
     form.value.gapBaseType = options?.baseType || '';
-})
+});
+onUnload(() => {
+    uni.$off('selectGapInfo');
+});
 </script>
 <style lang="scss" scoped>
 .select-item-card {
@@ -107,7 +110,7 @@ onLoad((options: any) => {
     }
     &.active {
         border-color: $u-primary;
-        background-color: #EBF6EE;
+        background-color: #ebf6ee;
     }
 }
 </style>

+ 5 - 2
src/tools/select-medicine/index.vue

@@ -9,7 +9,7 @@
         <view class="base-content pd-20">
             <view :class="{ active: item.id === checkedId }" v-for="(item, index) in list" :key="item.id" @click="clickItem(item)" class="bg-fff mb-10 pd-20 select-item-card">
                 <view class="f-s-30 c-#333 f-w-600">{{ item?.varietyName }}</view>
-                    <view class="f-s-28 c-#999">{{ item.latinName }}</view>
+                <view class="f-s-28 c-#999">{{ item.latinName }}</view>
             </view>
         </view>
     </z-paging>
@@ -25,7 +25,7 @@ const query = async (pageNum: number, pageSize: number) => {
     const res = await useClientRequest.get('/plt-api/app/cpyVariety/pageList', {
         ...form.value,
         pageNum: pageNum,
-        pageSize: pageSize
+        pageSize: pageSize,
     });
     if (res.code == 200) {
         paging.value.complete(res.rows || []);
@@ -44,6 +44,9 @@ const onRefresh = () => {
         console.error('Error refreshing address list:', e);
     }
 };
+onUnload(() => {
+    uni.$off('medicineSelected');
+});
 </script>
 <style lang="scss" scoped>
 .select-item-card {

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff