소스 검색

修改页面

lisy 1 주 전
부모
커밋
fd31645a33

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

@@ -165,5 +165,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;
 }

+ 6 - 0
src/pages.json

@@ -131,6 +131,12 @@
                     "style": {
                         "navigationBarTitleText": "创建种养殖任务"
                     }
+                },
+                {
+                    "path": "por-torganism/index",
+                    "style": {
+                        "navigationBarTitleText": "选择动植物类型"
+                    }
                 }
             ]
         },

+ 1 - 1
src/pages/plant/base/index.vue

@@ -151,7 +151,7 @@
         </view>
     </ut-confirm-dialog>
     <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/plant/addBase.png" mode="widthFix" style="height: 60px; width: 60px" @click="showDeleteDialog = true"></image>
     </ut-suspension>
 </template>
 <script setup lang="ts">

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

@@ -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>

+ 107 - 0
src/plant/port/por-torganism/index.vue

@@ -0,0 +1,107 @@
+<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>
+                <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="">
+                        <view class="mb-20">
+                            <text class="c-#333 f-s-34 f-w-5 mr-5">{{ item?.varietyName }}</text>
+                            <text class="c-#666 f-s-24">{{ 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">{{ item?.genusLatinName }}</text>
+                        </view>
+                        <view class="">
+                            <text class="c-#666 f-s-24">产出:</text>
+                            <text class="c-#666 f-s-24">{{ 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>
+                </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="navigateBackOrHome()">取消</up-button>
+                <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 () => {
+    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);
+    console.log(res);
+    uni.$emit('updateBiologicalname', { msg: res });
+    uni.navigateBack({ delta: 1 });
+};
+onMounted(() => {
+    getSpecies();
+});
+</script>

+ 63 - 0
src/plant/port/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>

+ 124 - 48
src/plant/port/port-create/index.vue

@@ -10,7 +10,7 @@
                     <view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-24 pb-16"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈舍/组培架。</view>
                 </view>
                 <view class="bg-#fff pd-24 mb-20 pt-0">
-                    <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="deawerData">
+                    <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="baseId">
                         <view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="openDrawer">
                             <view class=""></view>
                             <view class="f-s-34 c-primary">请选择种养殖所在的基地</view>
@@ -22,45 +22,63 @@
                 </view>
                 <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
                 <view class="bg-#fff pd-24 mb-20">
-                    <ut-action-sheet v-model="form.queryType" :tabs="pt_task_type" title="选择任务类型">
+                    <ut-action-sheet v-model="form.taskType" :tabs="pt_task_type" title="选择任务类型">
                         <up-form-item borderBottom label="任务类型" required prop="taskType">
                             <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="pt_org_type" title="选择溯源级别">
-                        <up-form-item borderBottom label="溯源级别" required prop="orgType">
-                            <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.mgMethod) }}</view>
+                    <ut-action-sheet v-model="form.mgMethod" :tabs="mg_method" title="选择溯源级别">
+                        <up-form-item borderBottom label="溯源级别" required prop="mgMethod">
+                            <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(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>
-                    <up-form-item borderBottom label="符合要求" required prop="gapFlag">
-                        <view v-if="form.queryType2" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.queryType1) }}</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>
-                    <up-form-item borderBottom label="动物名称" required prop="plantBase">
-                        <view class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
+                    <ut-action-sheet v-model="form.gapFlag" :tabs="task_gap_flag" title="选择符合要求">
+                        <up-form-item borderBottom label="符合要求" required prop="gapFlag">
+                            <view v-if="form.gapFlag" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(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>
+                            </template>
+                        </up-form-item>
+                    </ut-action-sheet>
+                    <up-form-item borderBottom label="动物名称" required prop="varietyId">
+                        <view v-if="!Biological" @click="$u.route({ type: 'navigateTo', url: '/plant/port/por-torganism/index' })" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
                             <view class=""></view>
                             <view class="f-s-34 c-primary">请选择养植的动物名称</view>
                         </view>
+                        <view v-if="Biological" class="pd-30 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
+                            <up-icon @click="Biological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
+                            <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>
                     </up-form-item>
-                    <up-form-item borderBottom label="养殖批号" required prop="plantBase">
+                    <up-form-item borderBottom label="养殖批号" required prop="plantationCode">
                         <view class="d-flex a-c j-sb w-100%">
-                            <up-input v-model="form.queryType3" placeholder="请输入养殖批号" border="none"></up-input>
-                            <up-button class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
+                            <view class="flex1 c-#999">请生成养殖批号</view>
+                            <view class="flex1 c-#333">{{ form.plantationCode }}</view>
+                            <up-button @click="randomCode" class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
                         </view>
                     </up-form-item>
-                    <up-form-item label="请选择养殖技术规程文件" prop="environmentInfo.report" borderBottom>
-                        <ut-upload v-model="form.queryType4" :max-count="9" valueType="array" accept="file"></ut-upload>
+                    <up-form-item label="请选择养殖技术规程文件" prop="technicalFile" borderBottom>
+                        <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
                     </up-form-item>
-                    <ut-action-sheet v-model="form.queryType5" :tabs="pt_task_type" title="选择任务类型">
-                        <up-form-item borderBottom label="任务类型" required prop="baseType">
-                            <view v-if="form.queryType1" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.baseType) }}</view>
+                    <ut-action-sheet v-model="form.plantationMethod" :tabs="feeding_method" title="选择养殖方式">
+                        <up-form-item borderBottom label="养殖方式" required prop="plantationMethod">
+                            <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(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>
@@ -68,47 +86,53 @@
                         </up-form-item>
                     </ut-action-sheet>
                     <up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
-                        <ut-datetime-picker v-model="form.queryType6.startDate" mode="date" dateFields="month">
+                        <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="month">
                             <view class="d-flex mr-20">
-                                <up-input v-model="form.queryType6.startDate" placeholder="请选择养殖开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
+                                <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择养殖开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                 <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
                             </view>
                         </ut-datetime-picker>
-                        <ut-datetime-picker v-model="form.queryType6.endDate" mode="date" dateFields="month">
+                        <ut-datetime-picker v-model="form.queryType6.plannedEndDate" mode="date" dateFields="month">
                             <view class="d-flex">
-                                <up-input v-model="form.queryType6.endDate" placeholder="请选择养殖结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
+                                <up-input v-model="form.queryType6.plannedEndDate" placeholder="请选择养殖结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                 <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
                             </view>
                         </ut-datetime-picker>
                     </up-form-item>
-                    <up-form-item borderBottom label="养殖面积" required prop="plantBaseArea">
+                    <up-form-item borderBottom label="养殖面积" required prop="plantingAmount">
                         <view class="d-flex a-c j-sb w-100%">
-                            <up-input style="padding-left: 0" v-model="form.plantBaseArea" placeholder="请输入养殖批号" border="none"></up-input>
+                            <up-input style="padding-left: 0" v-model="form.plantingAmount" placeholder="请输入养殖面积" border="none"></up-input>
                             <view class="c-#333 f-s-32 f-w-5">平方米</view>
                         </view>
                     </up-form-item>
-                    <up-form-item borderBottom label="养殖区域" required prop="BreedingArea">
+                    <up-form-item borderBottom label="养殖区域" required prop="breedScale">
                         <view class="d-flex a-c j-sb w-100%">
-                            <up-input v-model="form.BreedingArea" placeholder="请输入养殖区域" border="none"></up-input>
+                            <up-input v-model="form.breedScale" placeholder="请输入养殖区域" border="none"></up-input>
                             <view class="c-#333 f-s-32 f-w-5">个</view>
                         </view>
                     </up-form-item>
-                    <up-form-item borderBottom label="养殖量" required prop="orgType">
-                        <up-input v-model="form.breedingVolume" placeholder="请输入养殖区域" border="none"></up-input>
-                        <ut-action-sheet v-model="form.breedingVolume" :tabs="pt_org_type" title="选择单位">
+                    <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="选择单位">
                             <view class="d-flex a-c">
-                                <view v-if="form.queryType1" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_org_type, form.queryType1) }}</view>
+                                <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-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="BreedingArea">
-                        <up-input v-model="form.BreedingArea" placeholder="请输入备注" border="none"></up-input>
+                    <up-form-item borderBottom label="备注" required prop="remark">
+                        <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
                     </up-form-item>
                 </view>
             </up-form>
         </view>
+        <template #bottom>
+            <view class="pd-24 d-flex j-c gap-20 base-bottom-wrap">
+                <up-button type="primary" @click="navigateBackOrHome()">暂存</up-button>
+                <up-button type="primary" @click="save()">提交</up-button>
+            </view>
+        </template>
     </z-paging>
 
     <!-- 添加drawer组件 -->
@@ -119,30 +143,57 @@
 import { ref } from 'vue';
 import Drawer from './models/drawer.vue';
 import Baseinfo from './models/baseinfo.vue';
+import { useClientRequest } from '@/utils/request';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_task_type, pt_org_type, yes_no } = toRefs<any>(proxy?.useDict('pt_task_type', 'pt_org_type', 'yes_no'));
+const { scale_unit, feeding_method, mg_method, task_gap_flag, pt_task_type, pt_org_type, yes_no } = toRefs<any>(proxy?.useDict('scale_unit', 'feeding_method', 'mg_method', 'task_gap_flag', 'pt_task_type', 'pt_org_type', 'yes_no'));
 const form = ref({
     deawerData: null,
     baseId: '',
     taskType: '',
+    gapFlag: '',
     mgMethod: '',
-    queryType: '',
-    queryType1: '',
-    queryType2: '',
-    queryType3: '',
-    queryType4: '',
-    queryType5: '',
+    varietyId: '',
+    plantationCode: '',
+    plantationMethod: '',
+
+    technicalFile: '',
+    plantingUnit: '平方米',
+    breedScale: '',
     queryType6: {
-        startDate: '',
-        endDate: '',
+        plannedStartDate: '',
+        plannedEndDate: '',
+    },
+    plant: {
+        plantingMgAmount: '',
+        plantingMgUnit: '',
     },
-    plantBaseArea: '',
+    plantingAmount: '',
     BreedingArea: '',
     breedingVolume: '',
+    remark: '',
+});
+const rules = reactive({
+    baseId: [{ required: true, message: '请选择种养殖所在的基地' }],
+    taskType: [{ required: true, message: '请选择任务类型' }],
+    mgMethod: [{ required: true, message: '请选择溯源级别' }],
+    gapFlag: [{ required: true, message: '请选择符合要求' }],
+    varietyId: [{ required: true, message: '请选择养植的动物名称' }],
+    plantationCode: [{ required: true, message: '请输入养殖批号' }],
+    technicalFile: [{ required: true, message: '请选择养殖技术规程文件' }],
+    plantationMethod: [{ required: true, message: '请选择养殖方式' }],
+    'queryType6.plannedStartDate': [{ required: true, message: '请选择养殖开始时间' }],
+    'queryType6.plannedEndDate': [{ required: true, message: '请选择养殖结束时间' }],
+    plantingAmount: [{ required: true, message: '请输入养殖面积' }],
+    breedScale: [{ required: true, message: '请输入养殖区域' }],
+    'plant.plantingMgAmount': [{ required: true, message: '请输入养殖量' }],
+    'plant.plantingMgUnit': [{ required: true, message: '请选择养殖量单位' }],
+    remark: [{ required: true, message: '请输入备注' }],
 });
 const paging = ref<unknown>('paging');
 const list = ref<unknown>([]);
-
+setTimeout(() => {
+    console.log(form.value?.technicalFile, 'technicalFile');
+}, 10000);
 // 控制抽屉显示状态
 const drawerVisible = ref(false);
 
@@ -171,6 +222,7 @@ const deawerData = ref<any>(null);
 function onDrawerConfirm(data: any) {
     console.log('收到基地选择数据:', data);
     deawerData.value = data;
+    form.value.baseId = data.data?.baseId;
     // 这里可以将数据赋值给表单的相应字段
     // 例如:form.value.plantBase = data.baseName;
     // 可以根据需要添加其他处理逻辑
@@ -179,8 +231,32 @@ function onDrawerConfirm(data: any) {
 function handleBaseinfoClose() {
     deawerData.value = null;
 }
-
+const Biological = ref<any>(null);
+//随机生成
+const randomCode = () => {
+    let plType = '';
+    if (+form.value.taskType == 1) {
+        plType = 'P';
+    } else if (+form.value.taskType == 2) {
+        plType = 'F';
+    } else {
+        plType = 'C';
+    }
+    const code = useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', { plType: plType, linkType: plType });
+    form.value.plantationCode = code.data;
+};
+//完成提交表单
+const save = () => {
+    console.log(form.value);
+};
 onLoad((options) => {
     form.value.taskType = options?.taskType;
 });
+onMounted(() => {
+    //更新动植物名称
+    uni.$on('updateBiologicalname', function (data) {
+        Biological.value = data.msg;
+        form.value.varietyId = data.msg.id;
+    });
+});
 </script>

+ 7 - 4
src/plant/port/port-create/models/baseinfo.vue

@@ -6,8 +6,9 @@
 
         <!-- 标签显示: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="label mr-10">获评{{ modeValue?.medicineName }}GAP基地</view>
+            <view v-if="+modeValue?.swyqRes && !+modeValue?.gapFlag" class="label mr-10">获评{{ modeValue?.swyqVarietyName }}三无一全基地</view>
+            <view v-if="+modeValue?.gapFlag && +modeValue?.swyqRes" class="label">获评{{ modeValue?.medicineName }}GAP基地和{{ modeValue?.swyqVarietyName }}三无一全基地</view>
         </view>
 
         <view class="pt-8 pb-8">
@@ -40,12 +41,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对象

+ 16 - 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">
@@ -69,6 +70,7 @@ const medicineName = ref<string>('');
 const swyqVarietyName = ref<string>('');
 // 右侧地块数据
 const mixData = ref<any[]>([]);
+const showtitle = ref(true);
 // 当前选择基地
 const baseID = ref(-1);
 // 请求的次数
@@ -78,14 +80,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 +107,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 +129,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 +223,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 +237,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 +252,7 @@ watch(
         mixData.value.forEach((item) => {
             allCheckboxNames.value.push(item.id);
         });
+        showtitle.value = true;
     }
 );
 onMounted(() => {