2 Commits ee2362cbed ... 415128796f

Autor SHA1 Mensaje Fecha
  lisy 415128796f Merge branch 'master' of http://git.yujin.shuziyunyao.com/yujin/forestry-wx hace 2 semanas
  lisy b9fd8b8c6a 修改页面 hace 2 semanas

+ 22 - 25
src/pages/plant/port/index.vue

@@ -5,26 +5,24 @@
                 <template #left><view class=""></view></template>
             </ut-navbar>
         </template>
-        <up-sticky :offset-top="0">
-            <view class="d-flex a-c pd-26 pb-0 bg-#f7f7f7">
-                <view class="min-w-170 flex1">
-                    <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]" @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>
-                            <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
-                        </view>
-                    </ut-action-sheet>
-                </view>
-                <view class="h-86 pl-20 w-100%">
-                    <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜批次号、品种名、基地名" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
-                </view>
+        <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="选择原料类型">
+                    <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>
+                        <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
+                    </view>
+                </ut-action-sheet>
             </view>
-            <view class="pd-26 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 class="h-86 pl-20 w-100%">
+                <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜批次号、品种名、基地名" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
             </view>
-        </up-sticky>
+        </view>
+        <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-26 pt-0">
+        <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">
@@ -65,7 +63,7 @@
             </view>
         </view>
         <!-- 种苗繁育 -->
-        <view class="pd-26 pt-0">
+        <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">
@@ -106,7 +104,7 @@
             </view>
         </view>
         <!-- 种植 -->
-        <view class="pd-26 pt-0">
+        <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">
@@ -147,7 +145,7 @@
             </view>
         </view>
         <!-- 种畜繁育 -->
-        <view class="pd-26 pt-0">
+        <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">
@@ -187,10 +185,6 @@
                 </view>
             </view>
         </view>
-        <up-button open-type="share" :customStyle="{ borderColor: 'rgba(0,0,0,0)', padding: '0 10rpx', height: '36rpx' }">
-            <image class="small-icon mr-5" style="width: 28rpx" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images/common/share_icon.png" mode="widthFix" />
-            <span class="f-s-24">分享</span>
-        </up-button>
         <view class="h-210" v-if="list?.length"></view>
         <view v-if="list?.length" :style="{ height: `${safeAreaBottom}px` }"></view>
         <template #empty>
@@ -273,6 +267,7 @@ const customStyle1 = reactive({
     background: '#ECFFF1',
     border: '2rpx solid #9BD4A9',
     borderRadius: '10rpx',
+    height: '76rpx',
 });
 const customStyle2 = reactive({
     color: '#18BECA',
@@ -280,6 +275,7 @@ const customStyle2 = reactive({
     background: '#E5FDFF',
     border: '2rpx solid #93E8EE',
     borderRadius: '10rpx',
+    height: '76rpx',
 });
 const customStyle3 = reactive({
     color: '#FC8834',
@@ -287,6 +283,7 @@ const customStyle3 = reactive({
     background: '#FFFAF3',
     border: '2rpx solid #FFD499',
     borderRadius: '10rpx',
+    height: '76rpx',
 });
 const onRefresh = () => {
     paging.value.reload();
@@ -303,7 +300,7 @@ const handleDeleteCancel = () => {
     basetype.value = null;
 };
 const handlechoseConfirm = () => {
-    uni.$u.route({ type: 'navigateTo', url: '/plant/port/port-create/index', params: { baseType: basetype.value } });
+    uni.$u.route({ type: 'navigateTo', url: '/plant/port/port-create/index', params: { taskType: basetype.value } });
 };
 </script>
 <style lang="scss" scoped>

+ 19 - 17
src/plant/port/port-create/index.vue

@@ -3,28 +3,28 @@
         <template #top>
             <ut-navbar title="创建种养殖任务" :fixed="false"></ut-navbar>
         </template>
-        <view class="pt-26">
+        <view class="pt-24">
             <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
-                <view class="startline-title pl-24 ml-26 mb-16">基地信息</view>
-                <view class="bg-#fff pd-26">
-                    <view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-26 pb-16"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈舍/组培架。</view>
+                <view class="startline-title pl-24 ml-24 mb-16">基地信息</view>
+                <view class="bg-#fff pd-24">
+                    <view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-24 pb-16"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈舍/组培架。</view>
                 </view>
-                <view class="bg-#fff pd-26 mb-20 pt-0">
-                    <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="plantBase">
-                        <view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-26 b-radius bg-#FBFDFB border-#AFDDBB" @click="openDrawer">
+                <view class="bg-#fff pd-24 mb-20 pt-0">
+                    <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="deawerData">
+                        <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>
                         </view>
                         <view class="w-100%" v-else>
-                            <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="form.baseType" />
+                            <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="form.taskType" />
                         </view>
                     </up-form-item>
                 </view>
-                <view class="startline-title pl-24 ml-26 mb-16">种养殖信息</view>
-                <view class="bg-#fff pd-26 mb-20">
+                <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="选择任务类型">
-                        <up-form-item borderBottom label="任务类型" required prop="baseType">
-                            <view class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_type, form.baseType) }}</view>
+                        <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.queryType1" :tabs="pt_org_type" title="选择溯源级别">
@@ -44,7 +44,7 @@
                         </template>
                     </up-form-item>
                     <up-form-item borderBottom label="动物名称" required prop="plantBase">
-                        <view class="w-100% d-flex a-c j-c pd-26 b-radius bg-#FBFDFB border-#AFDDBB">
+                        <view 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>
@@ -112,7 +112,7 @@
     </z-paging>
 
     <!-- 添加drawer组件 -->
-    <Drawer v-if="drawerVisible" :baseType="form.baseType" v-model="drawerVisible" @open="onDrawerOpen" @close="onDrawerClose" @confirm="onDrawerConfirm" />
+    <Drawer v-if="drawerVisible" :baseType="form.taskType" v-model="drawerVisible" @open="onDrawerOpen" @close="onDrawerClose" @confirm="onDrawerConfirm" />
 </template>
 
 <script setup lang="ts">
@@ -122,7 +122,9 @@ import Baseinfo from './models/baseinfo.vue';
 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 form = ref({
-    baseType: '',
+    deawerData: null,
+    baseId: '',
+    taskType: '',
     queryType: '',
     queryType1: '',
     queryType2: '',
@@ -163,6 +165,7 @@ function onDrawerClose() {
     console.log('抽屉关闭了');
 }
 const deawerData = ref<any>(null);
+
 // 处理抽屉确认事件
 function onDrawerConfirm(data: any) {
     console.log('收到基地选择数据:', data);
@@ -177,7 +180,6 @@ function handleBaseinfoClose() {
 }
 
 onLoad((options) => {
-    console.log(options?.baseType, '??????');
-    form.value.baseType = options?.baseType;
+    form.value.taskType = options?.taskType;
 });
 </script>

+ 1 - 1
src/plant/port/port-create/models/baseinfo.vue

@@ -45,7 +45,7 @@ interface ModeValue {
     aloneChecked?: boolean;
     data?: any[];
     // 保留原有字段以保持向后兼容
-    adultBearArea?: string;
+    checkBox?: any[];
 }
 
 // 接收modeValue对象

+ 2 - 1
src/plant/port/port-create/models/drawer.vue

@@ -78,7 +78,7 @@ const emit = defineEmits<{
     (e: 'update:modelValue', value: boolean): void;
     (e: 'open'): void;
     (e: 'close'): void;
-    (e: 'confirm', data: { data: any[]; aloneChecked: boolean; baseName: string; area?: string; gapFlag: number; swyqRes: number; areaUnit: string; adcodeName: string; address: string }): 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; // 新增
 }>();
 // 处理关闭事件
 function handleClose() {
@@ -220,6 +220,7 @@ const confirm = () => {
             gapFlag: selectedBase.gapFlag,
             swyqRes: selectedBase.swyqRes,
             data: data,
+            checkBox: checkBox.value,
         });
     }