Bläddra i källkod

taber和navbar修改

huangxw 1 månad sedan
förälder
incheckning
253b02435f

+ 4 - 1
src/components/ut-navbar/ut-navbar.vue

@@ -3,13 +3,14 @@
         <up-navbar :fixed="fixed" :border="border">
             <template #left>
                 <slot name="left">
-                    <view class="d-flex a-c">
+                    <view class="d-flex a-c" v-if="isLeftBack">
                         <up-icon v-if="showBack" name="arrow-left" size="40rpx" color="#333" @click="handleBackClick"></up-icon>
                         <up-icon v-else name="home" size="40rpx" color="#333" @click="handleHomeClick"></up-icon>
                         <slot name="leftText">
                             <text class="f-s-38 c-#333 f-w-500 ml-20">{{ leftText }}</text>
                         </slot>
                     </view>
+                    <span v-else></span>
                 </slot>
             </template>
             <template #center>
@@ -38,6 +39,7 @@ const props = withDefaults(
         leftText?: string;
         // 是否有面包屑
         breadcrumb?: boolean;
+        isLeftBack?: boolean;
     }>(),
     {
         title: '',
@@ -46,6 +48,7 @@ const props = withDefaults(
         homeUrl: '/pages/index/index',
         leftText: '',
         breadcrumb: true,
+        isLeftBack: true,
     }
 );
 

+ 12 - 70
src/components/ut-tabar/ut-tabar.vue

@@ -1,92 +1,34 @@
 <template>
-    <up-popup v-model:show="showStorage" title="仓储与放行" bgColor="#F7F7F7" round="0" zIndex="1000" closeable>
-        <view class="min-h-600">
-            <view class="c-#333 f-s-34 f-w-500 pd-24">仓储与放行</view>
-            <view class="pd2-10-24">
-                <up-grid :border="false" :column="3" gap="10rpx">
-                    <up-grid-item>
-                        <view class="pd2-10-0 d-flex flex-cln a-c j-c" @click="showStorage = false;$u.route({ url: '/plant/storage/storage-room/list/index' })">
-                            <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
-                                <image class="w-72 h-72" src="@/static/images/plant/storage/nav_kfgl_icon.png" mode="widthFix" />
-                            </view>
-                            <view class="c-#333 f-s-28 text-center">库房管理</view>
-                        </view>
-                    </up-grid-item>
-                    <up-grid-item>
-                        <view class="pd2-10-0 d-flex flex-cln a-c j-c">
-                            <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
-                                <image class="w-72 h-72" src="@/static/images/plant/storage/nav_nzk_icon.png" mode="widthFix" />
-                            </view>
-                            <view class="c-#333 f-s-28 text-center">农资库</view>
-                        </view>
-                    </up-grid-item>
-                    <up-grid-item>
-                        <view class="pd2-10-0 d-flex flex-cln a-c j-c" @click="showStorage = false;$u.route({ url: '/plant/storage/seed-source/list/index' })">
-                            <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
-                                <image class="w-72 h-72" src="@/static/images/plant/storage/nav_zyk_icon.png" mode="widthFix" />
-                            </view>
-                            <view class="c-#333 f-s-28 text-center">种源库</view>
-                        </view>
-                    </up-grid-item>
-                    <up-grid-item>
-                        <view class="pd2-10-0 d-flex flex-cln a-c j-c">
-                            <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
-                                <image class="w-72 h-72" src="@/static/images/plant/storage/nav_xhk_icon.png" mode="widthFix" />
-                            </view>
-                            <view class="c-#333 f-s-28 text-center">鲜货库</view>
-                        </view>
-                    </up-grid-item>
-                    <up-grid-item>
-                        <view class="pd2-10-0 d-flex flex-cln a-c j-c">
-                            <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
-                                <image class="w-72 h-72" src="@/static/images/plant/storage/nav_zjpk_icon.png" mode="widthFix" />
-                            </view>
-                            <view class="c-#333 f-s-28 text-center">中间品库</view>
-                        </view>
-                    </up-grid-item>
-                    <up-grid-item>
-                        <view class="pd2-10-0 d-flex flex-cln a-c j-c">
-                            <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
-                                <image class="w-72 h-72" src="@/static/images/plant/storage/nav_cpk_icon.png" mode="widthFix" />
-                            </view>
-                            <view class="c-#333 f-s-28 text-center">成品库</view>
-                        </view>
-                    </up-grid-item>
-                </up-grid>
-            </view>
-            <view class="h-210"></view>
-        </view>
-    </up-popup>
     <view class="w-100%" style="position: fixed; bottom: 0; left: 0; z-index: 1100">
         <view class="p-rtv" style="height: 210rpx">
             <image class="w-100%" src="/static/images/plant/bottombg.png" mode="widthFix" style="position: absolute; bottom: 0; left: 0; z-index: -1" />
             <view class="d-flex h-140 w-100% j-sa" style="position: absolute; bottom: 0; left: 0">
                 <view class="d-flex a-c flex1 j-sa">
                     <view @click="showStorage = false;$u.route({ type: 'switchTab', url: '/pages/plant/base/index' })" class="c-#999 f-s-24 d-flex flex-cln j-c a-c">
-                        <image v-if="activeTab === 'base' && !showStorage" class="w-80 h-80" src="/static/images/plant/bottomBaseActive.png" mode="widthFix" />
+                        <image v-if="activeTab === 'base'" class="w-80 h-80" src="/static/images/plant/bottomBaseActive.png" mode="widthFix" />
                         <image v-else class="w-80 h-80" src="/static/images/plant/bottomBase.png" mode="widthFix" />
-                        <view class="text-center" :class="activeTab === 'base' && !showStorage ? 'c-primary f-w-5' : ''">基地</view>
+                        <view class="text-center" :class="activeTab === 'base' ? 'c-primary f-w-5' : ''">基地</view>
                     </view>
                     <view @click="showStorage = false;$u.route({ type: 'switchTab', url: '/pages/plant/port/index' })" class="c-#999 f-s-24 d-flex flex-cln j-c a-c">
-                        <image v-if="activeTab === 'planting' && !showStorage" class="w-80 h-80" src="/static/images/plant/bottomPlantingBreedingActive.png" mode="widthFix" />
+                        <image v-if="activeTab === 'planting'" class="w-80 h-80" src="/static/images/plant/bottomPlantingBreedingActive.png" mode="widthFix" />
                         <image v-else class="w-80 h-80" src="/static/images/plant/bottomPlantingBreeding.png" mode="widthFix" />
-                        <view class="text-center" :class="activeTab === 'planting' && !showStorage ? 'c-primary f-w-5' : ''">种养殖</view>
+                        <view class="text-center" :class="activeTab === 'planting' ? 'c-primary f-w-5' : ''">种养殖</view>
                     </view>
                 </view>
-                <view class="w-126 d-flex a-c j-c p-rtv" @click="showStorage = !showStorage">
-                    <image v-if="!showStorage" class="w-80 h-80" src="/static/images/plant/bottomWarehouse.png" mode="widthFix" style="position: absolute; top: -40rpx" />
-                    <image v-else class="w-80 h-80" src="/static/images/plant/bottomWarehouseActive.png" mode="widthFix" style="position: absolute; top: -40rpx" />
+                <view class="w-126 d-flex a-c j-c p-rtv" @click="$u.route({ type: 'switchTab', url: '/pages/plant/storage/index' })">
+                    <image v-if="activeTab === 'storage'" class="w-80 h-80" src="/static/images/plant/bottomWarehouseActive.png" mode="widthFix" style="position: absolute; top: -40rpx" />
+                    <image  v-else class="w-80 h-80" src="/static/images/plant/bottomWarehouse.png" mode="widthFix" style="position: absolute; top: -40rpx" />
                 </view>
                 <view class="d-flex a-c flex1 j-sa">
                     <view class="c-#999 f-s-24 d-flex flex-cln j-c a-c">
-                        <image v-if="activeTab === 'processing' && !showStorage" class="w-80 h-80" src="/static/images/plant/bottomProcessingPackagingActive.png" mode="widthFix" />
+                        <image v-if="activeTab === 'processing'" class="w-80 h-80" src="/static/images/plant/bottomProcessingPackagingActive.png" mode="widthFix" />
                         <image v-else class="w-80 h-80" src="/static/images/plant/bottomProcessingPackaging.png" mode="widthFix" />
-                        <view class="text-center" :class="activeTab === 'processing'  && !showStorage ? 'c-primary f-w-5' : ''">加工包装</view>
+                        <view class="text-center" :class="activeTab === 'processing' ? 'c-primary f-w-5' : ''">加工包装</view>
                     </view>
-                    <view class="c-#999 f-s-24 d-flex flex-cln j-c a-c">
-                        <image v-if="activeTab === 'more' && !showStorage" class="w-80 h-80" src="/static/images/plant/bottomMoreActive.png" mode="widthFix" />
+                    <view @click="$u.route({ type: 'switchTab', url: '/pages/plant/more/index' })" class="c-#999 f-s-24 d-flex flex-cln j-c a-c">
+                        <image v-if="activeTab === 'more'" class="w-80 h-80" src="/static/images/plant/bottomMoreActive.png" mode="widthFix" />
                         <image v-else class="w-80 h-80" src="/static/images/plant/bottomMore.png" mode="widthFix" />
-                        <view class="text-center" :class="activeTab === 'more' && !showStorage ? 'c-primary f-w-5' : ''">更多</view>
+                        <view class="text-center" :class="activeTab === 'more' ? 'c-primary f-w-5' : ''">更多</view>
                     </view>
                 </view>
             </view>

+ 20 - 0
src/pages.json

@@ -17,6 +17,20 @@
                 "navigationBarTitleText": "种植端基地"
             }
         },
+        // 种植端仓储与放行
+        {
+            "path": "pages/plant/storage/index",
+            "style": {
+                "navigationBarTitleText": "种植端仓储与放行"
+            }
+        },
+        // 种植端更多
+        {
+            "path": "pages/plant/more/index",
+            "style": {
+                "navigationBarTitleText": "种植端更多"
+            }
+        },
         //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
         {
             "path": "pages/index/index",
@@ -284,6 +298,12 @@
             },
             {
                 "pagePath": "pages/plant/port/index"
+            },
+            {
+                "pagePath": "pages/plant/storage/index"
+            },
+            {
+                "pagePath": "pages/plant/more/index"
             }
         ]
     },

+ 22 - 0
src/pages/plant/more/index.vue

@@ -0,0 +1,22 @@
+<template>
+    <z-paging ref="paging" bgColor="#fff">
+        <template #top>
+            <ut-navbar title="更多" :fixed="false" :isLeftBack="false" :breadcrumb="false"></ut-navbar>
+        </template>
+        <view class="base-content pd-20">
+            <up-grid :border="false" :column="3" gap="10rpx">
+                <up-grid-item>
+                    <view class="pd2-10-0 d-flex flex-cln a-c j-c" @click="$u.route({ url: '/plant/storage/storage-room/list/index' })">
+                        <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
+                            <image class="w-72 h-72" src="@/static/images/plant/storage/nav_kfgl_icon.png" mode="widthFix" />
+                        </view>
+                        <view class="c-#333 f-s-28 text-center">往来单位管理</view>
+                    </view>
+                </up-grid-item>
+            </up-grid>
+        </view>
+    </z-paging>
+    <ut-tabar activeTab="more"></ut-tabar>
+</template>
+<script setup lang="ts"></script>
+<style lang="scss" scoped></style>

+ 62 - 0
src/pages/plant/storage/index.vue

@@ -0,0 +1,62 @@
+<template>
+    <z-paging ref="paging" bgColor="#fff">
+        <template #top>
+            <ut-navbar title="仓储与放行" :fixed="false" :isLeftBack="false" :breadcrumb="false"></ut-navbar>
+        </template>
+        <view class="base-content pd-20">
+            <up-grid :border="false" :column="3" gap="10rpx">
+                <up-grid-item>
+                    <view class="pd2-10-0 d-flex flex-cln a-c j-c" @click="$u.route({ url: '/plant/storage/storage-room/list/index' })">
+                        <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
+                            <image class="w-72 h-72" src="@/static/images/plant/storage/nav_kfgl_icon.png" mode="widthFix" />
+                        </view>
+                        <view class="c-#333 f-s-28 text-center">库房管理</view>
+                    </view>
+                </up-grid-item>
+                <up-grid-item>
+                    <view class="pd2-10-0 d-flex flex-cln a-c j-c">
+                        <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
+                            <image class="w-72 h-72" src="@/static/images/plant/storage/nav_nzk_icon.png" mode="widthFix" />
+                        </view>
+                        <view class="c-#333 f-s-28 text-center">农资库</view>
+                    </view>
+                </up-grid-item>
+                <up-grid-item>
+                    <view class="pd2-10-0 d-flex flex-cln a-c j-c" @click="$u.route({ url: '/plant/storage/seed-source/list/index' })">
+                        <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
+                            <image class="w-72 h-72" src="@/static/images/plant/storage/nav_zyk_icon.png" mode="widthFix" />
+                        </view>
+                        <view class="c-#333 f-s-28 text-center">种源库</view>
+                    </view>
+                </up-grid-item>
+                <up-grid-item>
+                    <view class="pd2-10-0 d-flex flex-cln a-c j-c">
+                        <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
+                            <image class="w-72 h-72" src="@/static/images/plant/storage/nav_xhk_icon.png" mode="widthFix" />
+                        </view>
+                        <view class="c-#333 f-s-28 text-center">鲜货库</view>
+                    </view>
+                </up-grid-item>
+                <up-grid-item>
+                    <view class="pd2-10-0 d-flex flex-cln a-c j-c">
+                        <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
+                            <image class="w-72 h-72" src="@/static/images/plant/storage/nav_zjpk_icon.png" mode="widthFix" />
+                        </view>
+                        <view class="c-#333 f-s-28 text-center">中间品库</view>
+                    </view>
+                </up-grid-item>
+                <up-grid-item>
+                    <view class="pd2-10-0 d-flex flex-cln a-c j-c">
+                        <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
+                            <image class="w-72 h-72" src="@/static/images/plant/storage/nav_cpk_icon.png" mode="widthFix" />
+                        </view>
+                        <view class="c-#333 f-s-28 text-center">成品库</view>
+                    </view>
+                </up-grid-item>
+            </up-grid>
+        </view>
+    </z-paging>
+    <ut-tabar activeTab="storage"></ut-tabar>
+</template>
+<script setup lang="ts"></script>
+<style lang="scss" scoped></style>

+ 4 - 1
src/plant/storage/seed-source/add/index.vue

@@ -91,7 +91,10 @@ const form = ref<SeedSourceAddTypeEnum>({
     storeType: '2',
     seedInfoList: [],
     warehouses: [],
-    instoreBizInfo: {},
+    instoreBizInfo: {
+        motherFatherFlag: '',
+        idFlag: '0',
+    },
 });
 const rules = reactive({});
 

+ 65 - 34
src/plant/storage/seed-source/info-edit/index.vue

@@ -54,10 +54,10 @@
                     </up-form-item>
                 </ut-action-sheet>
                 <ut-action-sheet :tabs="pt_mother_father_flag" mode="custom" title="父母本情况"
-                    v-model="form.motherFatherFlag">
-                    <up-form-item borderBottom label="父母本情况" required prop="motherFatherFlag">
-                        <view v-if="form.motherFatherFlag" class="f-s-30 c-333 f-w-5 flex1">{{
-                            selectDictLabel(pt_mother_father_flag, form.motherFatherFlag) }}</view>
+                    v-model="form.instoreBizInfo.motherFatherFlag">
+                    <up-form-item borderBottom label="父母本情况" prop="motherFatherFlag">
+                        <view v-if="form.instoreBizInfo.motherFatherFlag" class="f-s-30 c-333 f-w-5 flex1">{{
+                            selectDictLabel(pt_mother_father_flag, form.instoreBizInfo.motherFatherFlag) }}</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>
@@ -66,60 +66,78 @@
                 </ut-action-sheet>
                 <template>
                     <!-- 父本品种 -->
-                    <up-form-item borderBottom label="父本品种" prop="fatherVarietyId">
+                    <up-form-item v-if="form?.instoreBizInfo?.motherFatherFlag == '2'" borderBottom label="父本品种" prop="fatherVarietyId">
                         <view class="flex1">
-                            <up-button v-if="!form.fatherVarietyId" @click="selectFatherVarietyId" type="primary" plain>
+                            <up-button v-if="!form.instoreBizInfo.fatherVarietyId" @click="selectFatherVarietyId"
+                                type="primary" plain>
                                 <image class="w-36 h-36 mr-10" src="@/static/images/common/select_push_icon.png"
                                     mode="widthFix" />
                                 <span>请选择父本品种</span>
                             </up-button>
                             <view v-else class="bg-#FBFDFB card-info-block pd-24 p-rtv">
                                 <view class="mb-16">
-                                    <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.fatherVarietyInfo?.varietyName
+                                    <span class="f-s-34 c-#333 f-w-5 mr-16">{{
+                                        form?.instoreBizInfo?.fatherVarietyInfo?.varietyName }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.fatherVarietyInfo?.latinName
                                         }}</span>
-                                    <span class="f-s-24 c-#666">{{ form?.fatherVarietyInfo?.latinName }}</span>
                                 </view>
                                 <view class="mb-16">
-                                    <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.fatherVarietyInfo?.genusName
+                                    <span class="f-s-28 c-#333 f-w-5 mr-16">{{
+                                        form?.instoreBizInfo?.fatherVarietyInfo?.genusName
                                         }}</span>
-                                    <span class="f-s-24 c-#666">{{ form?.fatherVarietyInfo?.genusLatinName }}</span>
+                                    <span class="f-s-24 c-#666">{{
+                                        form?.instoreBizInfo?.fatherVarietyInfo?.genusLatinName }}</span>
                                 </view>
-                                <view class="f-s-24 c-#666">产出:{{ form?.fatherVarietyInfo?.medicineName }}</view>
+                                <view class="f-s-24 c-#666">产出:{{ form?.instoreBizInfo?.fatherVarietyInfo?.medicineName
+                                    }}</view>
                                 <view class="close-icon pd-16"
-                                    @click="form.fatherVarietyId = ''; form.fatherVarietyInfo = null;">
+                                    @click="form.instoreBizInfo.fatherVarietyId = ''; form.instoreBizInfo.fatherVarietyInfo = null;">
                                     <up-icon color="#F81242" name="close" size="32rpx"></up-icon>
                                 </view>
                             </view>
                         </view>
                     </up-form-item>
                     <!-- 母本品种 -->
-                    <up-form-item borderBottom label="母本品种" prop="motherVarietyId">
+                    <up-form-item borderBottom label="母本品种" prop="instoreBizInfo.motherVarietyId">
                         <view class="flex1">
-                            <up-button v-if="!form.motherVarietyId" @click="selectMotherVarietyId" type="primary" plain>
+                            <up-button v-if="!form.instoreBizInfo.motherVarietyId" @click="selectMotherVarietyId"
+                                type="primary" plain>
                                 <image class="w-36 h-36 mr-10" src="@/static/images/common/select_push_icon.png"
                                     mode="widthFix" />
                                 <span>请选择母本品种</span>
                             </up-button>
                             <view v-else class="bg-#FBFDFB card-info-block pd-24 p-rtv mt-16">
                                 <view class="mb-16">
-                                    <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.motherVarietyInfo?.varietyName
-                                        }}</span>
-                                    <span class="f-s-24 c-#666">{{ form?.motherVarietyInfo?.latinName }}</span>
+                                    <span class="f-s-34 c-#333 f-w-5 mr-16">{{
+                                        form?.instoreBizInfo?.motherVarietyInfo?.varietyName }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.motherVarietyInfo?.latinName }}</span>
                                 </view>
                                 <view class="mb-16">
-                                    <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.motherVarietyInfo?.genusName
-                                        }}</span>
-                                    <span class="f-s-24 c-#666">{{ form?.motherVarietyInfo?.genusLatinName }}</span>
+                                    <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.motherVarietyInfo?.genusName }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.motherVarietyInfo?.genusLatinName }}</span>
                                 </view>
-                                <view class="f-s-24 c-#666">产出:{{ form?.motherVarietyInfo?.medicineName }}</view>
-                                <view class="close-icon pd-16"
-                                    @click="form.motherVarietyId = ''; form.motherVarietyInfo = null;">
+                                <view class="f-s-24 c-#666">产出:{{ form?.instoreBizInfo?.motherVarietyInfo?.medicineName }}</view>
+                                <view class="close-icon pd-16" @click="form.instoreBizInfo.motherVarietyId = ''; form.instoreBizInfo.motherVarietyInfo = null;">
                                     <up-icon color="#F81242" name="close" size="32rpx"></up-icon>
                                 </view>
                             </view>
                         </view>
                     </up-form-item>
                 </template>
+                <up-form-item label="繁衍世代" prop="instoreBizInfo.genCount">
+                    <up-input v-model="form.instoreBizInfo.genCount" placeholder="请输入繁衍世代" border="none" clearable />
+                    <template #right>
+                        <view @click.stop>
+                            <ut-action-sheet v-model="form.unit" :tabs="pt_materail_unit" mode="custom" title="选择单位">
+                                <!-- 可点击选择单位 -->
+                                <view class="d-flex pd-10" style="">
+                                    <span>{{ form.unit || '代' }}</span>
+                                    <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                </view>
+                            </ut-action-sheet>
+                        </view>
+                    </template>
+                </up-form-item>
                 <up-form-item borderBottom label="受托单位" prop="entrustId">
                     <up-input v-model="form.entrustId" placeholder="请输入受托单位" border="none" clearable></up-input>
                 </up-form-item>
@@ -130,7 +148,7 @@
                     <up-input v-model="form.capacity" placeholder="请输入入库量" border="none" clearable />
                     <template #right>
                         <view @click.stop>
-                            <ut-action-sheet v-model="form.unit" :tabs="pt_materail_unit" mode="custom" title="选择单位">
+                            <ut-action-sheet v-model="form.unit" :tabs="pt_seed_unit" mode="custom" title="选择单位">
                                 <!-- 可点击选择单位 -->
                                 <view class="d-flex pd-10" style="">
                                     <span>{{ form.unit || '株' }}</span>
@@ -164,10 +182,18 @@
                 </up-form-item>
 
                 <!-- 个体标识:此处仅占位,后续可改为多选列表 -->
-                <up-form-item borderBottom label="是否有个体标识" prop="animalIds">
-                    
+                <up-form-item borderBottom label="是否有个体标识" prop="instoreBizInfo.idFlag" required>
+                    <up-radio-group v-model="form.instoreBizInfo.idFlag">
+                        <up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index"
+                            :label="item.label" :name="item.value"></up-radio>
+                    </up-radio-group>
                 </up-form-item>
-
+                <!-- 个体标识:此处仅占位,后续可改为多选列表 -->
+                <template v-if="+form?.instoreBizInfo?.idFlag">
+                    <up-form-item borderBottom label="个体标识号" prop="instoreBizInfo.animals" required>
+                        <AnimalsInput v-model="form.instoreBizInfo.animals"></AnimalsInput>
+                    </up-form-item>
+                </template>
                 <!-- 媒体与附件 -->
                 <up-form-item borderBottom label="种源图片" prop="imgs">
                     <ut-upload v-model="form.imgs" :max-count="9"></ut-upload>
@@ -219,18 +245,23 @@
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
 import { seedInfoListType } from '../models/type';
+import AnimalsInput from '../models/animals-input.vue';
+
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_seed_type, pt_seed_source, pt_materail_unit, pt_mother_father_flag } = toRefs<any>(proxy?.useDict('pt_seed_type', 'pt_seed_source', 'pt_materail_unit', 'pt_mother_father_flag'));
+const { pt_seed_type, pt_seed_source, pt_materail_unit, pt_mother_father_flag, pt_seed_unit, pt_fungus_code_type, pt_breeding_materials, yes_no } = toRefs<any>(proxy?.useDict('pt_seed_type', 'pt_seed_source', 'pt_materail_unit', 'pt_mother_father_flag', 'pt_op_method', 'pt_seed_unit', 'pt_fungus_code_type', 'pt_breeding_materials', 'yes_no'));
 const paging = ref<any>(null);
 const upFormRef = ref<any>(null);
 const form = ref<seedInfoListType>({
     imgs: [],
-    vedios: [],
     spCert: [],
     newSpCert: [],
     importCert: [],
     seedCheckCert: [],
     unit: '株',
+    instoreBizInfo: {
+        motherFatherFlag: '',
+        idFlag: '1',
+    },
 });
 const rules = reactive({});
 
@@ -276,8 +307,8 @@ const selectVarietyId = () => {
 };
 const selectFatherVarietyId = () => {
     uni.$once('updateBiologicalname', function (data) {
-        form.value.fatherVarietyId = data.msg.id;
-        form.value.fatherVarietyInfo = data.msg;
+        form.value.instoreBizInfo.fatherVarietyId = data.msg.id;
+        form.value.instoreBizInfo.fatherVarietyInfo = data.msg;
     });
     uni.$u.route({
         type: 'navigateTo',
@@ -289,8 +320,8 @@ const selectFatherVarietyId = () => {
 };
 const selectMotherVarietyId = () => {
     uni.$once('updateBiologicalname', function (data) {
-        form.value.motherVarietyId = data.msg.id;
-        form.value.motherVarietyInfo = data.msg;
+        form.value.instoreBizInfo.motherVarietyId = data.msg.id;
+        form.value.instoreBizInfo.motherVarietyInfo = data.msg;
     });
     uni.$u.route({
         type: 'navigateTo',
@@ -303,7 +334,7 @@ const selectMotherVarietyId = () => {
 const did = ref('');
 onLoad((optins: any) => {
     if (optins.id) {
-        // 编辑加载详
+        // 编辑加载详
         did.value = optins.id;
     } else {
     }

+ 50 - 7
src/plant/storage/seed-source/list/index.vue

@@ -6,11 +6,11 @@
 
         <view class="pd3-24-24-0">
             <view class="mb-20">
-                <ut-tabs mode="subsection" :tabs="tabs" v-model="form.queryType"></ut-tabs>
+                <ut-tabs mode="subsection" :tabs="tabs"></ut-tabs>
             </view>
             <view class="d-flex a-c">
                 <view class="min-w-170 flex1">
-                    <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
+                    <ut-action-sheet :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>
@@ -23,7 +23,15 @@
             </view>
             <view></view>
         </view>
-        <view class="pd-24 bg-#f7f7f7"> </view>
+        <view class="pd-24 bg-#f7f7f7">
+            <up-swipe-action>
+                <up-swipe-action-item v-for="(item, index) in list" :key="index" :name="item?.id" :options="optionsActionTemp" @click="clickTempSwipe" class="mb-20 b-radius">
+                    <view class="b-radius bg-#fff pd-20 p-rtv" @click.stop="$u.route({ url: '/plant/storage/seed-source/detail/index', params: { id: item.id } })">
+                        <view>{{ item?.variety }}</view>
+                    </view>
+                </up-swipe-action-item>
+            </up-swipe-action>
+        </view>
 
         <template #empty>
             <view class="d-flex flex-cln a-c" style="margin-top: -200rpx">
@@ -40,8 +48,8 @@ import { useClientRequest } from '@/utils/request';
 import SourceBottom from './model/source-bottom.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pt_task_type } = toRefs<any>(proxy?.useDict('pt_task_type'));
-const list = ref<unknown[]>();
-const form = ref({ queryType: 'seed', keyword: '' });
+const list = ref<any[]>();
+const form = ref({ keyword: '' });
 const paging = ref();
 const tabs = ref([
     { label: '有库存', value: 'seed' },
@@ -57,13 +65,48 @@ const query = async (pageNum: number, pageSize: number) => {
         pageSize,
         ...form.value,
     };
-    const res = await useClientRequest.get('/plt-api/app/plantationTask/list', params);
+    const res = await useClientRequest.get('/plt-api/app/storageSeed/page', params);
     if (res) {
         const { rows } = res;
         paging.value.complete(rows);
     }
 };
-
+// 暂存项左滑删除配置
+const optionsActionTemp = reactive([
+    {
+        text: '删除',
+        style: {
+            backgroundColor: '#f56c6c',
+        },
+    },
+]);
+// 暂存项删除点击(本地移除)
+const clickTempSwipe = async (event: object) => {
+    const { name, index } = event as any;
+    if (index === 0) {
+        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);
+        }
+    }
+};
 const onRefresh = () => {
     paging.value.reload();
 };

+ 162 - 0
src/plant/storage/seed-source/models/animals-input.vue

@@ -0,0 +1,162 @@
+<template>
+    <view class="flex1">
+        <view>
+            <up-swipe-action>
+                <template v-for="(item, index) in list" :key="index">
+                    <up-swipe-action-item class="mb-20" :options="options" @click="clickPlotSwipe($event, item, index)">
+                        <view class="ul-block-item pd-24">
+                            {{ item.animalId }}
+                        </view>
+                    </up-swipe-action-item>
+                </template>
+            </up-swipe-action>
+        </view>
+        <view class="d-flex">
+            <up-button class="flex1 mr-20" color="#18BECA" plain @click="onScan">
+                <image class="w-36 h-36 mr-10" src="@/static/images/common/scan_icon_o.png" mode="widthFix" />
+                <span>扫一扫添加</span>
+            </up-button>
+            <up-button @click="onAddClick" class="flex1" color="#37A954" plain>
+                <image class="w-36 h-36 mr-10" src="@/static/images/common/edit_icon.png" mode="widthFix" />
+                <span>手动输入添加</span>
+            </up-button>
+        </view>
+    </view>
+    <ut-confirm-dialog title="添加个体标识" v-model:show="showPop" width="680rpx">
+        <view>
+            <up-form ref="upFormRef" :model="form" :rules="rules" labelWidth="auto" class="p-rtv" labelPosition="top">
+                <up-form-item label="个体标识号" border-bottom prop="animalId" required>
+                    <up-input v-model="form.animalId" border="none" :maxlength="200" clearable placeholder="请输入个体标识号"></up-input>
+                </up-form-item>
+            </up-form>
+        </view>
+        <template #footer>
+            <view class="d-flex j-c pd-30">
+                <up-button @click="showPop = false" class="mr-30" style="color: #333" color="#F2F2F2">取消</up-button>
+                <up-button @click="onConfirm" type="primary">确认</up-button>
+            </view>
+        </template>
+    </ut-confirm-dialog>
+</template>
+<script setup lang="ts">
+const props = defineProps({
+    modelValue: {
+        type: Array,
+        default: () => [],
+    },
+});
+const upFormRef = ref();
+const rules = reactive({
+    animalId: [{ required: true, message: '请输入个体标识号', trigger: 'blur' }],
+});
+const showPop = ref(false);
+const form = ref({
+    animalId: '',
+});
+// -1 表示新增,其它为编辑的下标
+const editIndex = ref<number>(-1);
+const emit = defineEmits(['update:modelValue']);
+const list = ref<any[]>(props.modelValue);
+const options = ref([
+    {
+        text: '编辑',
+        name: 'edit',
+        style: {
+            backgroundColor: '#37a954',
+            color: '#fff',
+        },
+    },
+    {
+        text: '删除',
+        name: 'delete',
+        style: {
+            backgroundColor: '#FF3B30',
+            color: '#fff',
+        },
+    },
+]);
+const clickPlotSwipe = (e: any, item: any, index: number) => {
+    console.log(e);
+    
+    if (e.index == 0) {
+        // 编辑个体标识
+        console.log('编辑个体标识', item, index);
+        editIndex.value = index;
+        form.value.animalId = item?.animalId || '';
+        showPop.value = true;
+    } else if (e.index == 1) {
+        // 删除个体标识
+        list.value.splice(index, 1);
+        emit('update:modelValue', [...list.value]);
+        
+    }
+};
+const onConfirm = async () => {
+    try {
+        // uview-plus 的 up-form 暴露 validate 方法
+        await upFormRef.value?.validate();
+        if (editIndex.value > -1) {
+            // 编辑模式:更新当前项
+            list.value[editIndex.value] = { ...list.value[editIndex.value], ...form.value };
+        } else {
+            // 新增模式:追加一项
+            list.value.push({ ...form.value });
+        }
+        emit('update:modelValue', [...list.value]);
+        showPop.value = false;
+        form.value.animalId = '';
+        editIndex.value = -1;
+    } catch (e) {
+        // 校验不通过
+    }
+};
+// 手动新增按钮点击
+const onAddClick = () => {
+    editIndex.value = -1;
+    form.value.animalId = '';
+    showPop.value = true;
+};
+
+// 扫一扫添加
+const onScan = () => {
+    // #ifdef MP-WEIXIN
+    uni.scanCode({
+        onlyFromCamera: true,
+        success: (res) => {
+            const code = (res.result || '').trim();
+            if (!code) return;
+            // 直接追加到列表
+            list.value.push({ animalId: code });
+            emit('update:modelValue', [...list.value]);
+        },
+        fail: () => {},
+    });
+    // #endif
+    // 其他端如 H5/App 可按需再做兼容
+};
+watch(
+    () => props.modelValue,
+    (newVal) => {
+        list.value = newVal;
+    },
+);
+</script>
+<script lang="ts">
+export default {
+    options: {
+        // 微信小程序中 options 选项
+        multipleSlots: true, //  在组件定义时的选项中启动多slot支持,默认启用
+        styleIsolation: 'shared', //  启动样式隔离。当使用页面自定义组件,希望父组件影响子组件样式时可能需要配置。具体配置选项参见:微信小程序自定义组件的样式
+        addGlobalClass: true, //  表示页面样式将影响到自定义组件,但自定义组件中指定的样式不会影响页面。这个选项等价于设置 styleIsolation: apply-shared
+        virtualHost: true, //  将自定义节点设置成虚拟的,更加接近Vue组件的表现。我们不希望自定义组件的这个节点本身可以设置样式、响应 flex 布局等,而是希望自定义组件内部的第一层节点能够响应 flex 布局或者样式由自定义组件本身完全决定
+    },
+};
+</script>
+<style lang="scss" scoped>
+.ul-block-item {
+    border-radius: 16rpx;
+    border: 1px solid #AFDDBB;
+    // 字体数字可换行
+    word-break: break-all;
+}
+</style>

+ 13 - 0
src/plant/storage/seed-source/models/type.ts

@@ -74,6 +74,7 @@ export interface seedInfoListType {
     seedCheckCert?: AccesseryDTO[];
 
     [property: string]: any;
+    instoreBizInfo: instoreBizInfoType;
 }
 export interface AccesseryDTO {
     /**
@@ -107,4 +108,16 @@ export interface instoreBizInfoType {
     instoreMg?: string;
     /** 备注 */
     remark?: string;
+    /** 父母本情况 */
+    motherFatherFlag: string;
+    /** 父本品种ID */
+    fatherVarietyId?: string;
+        /** 母本品种ID */
+    motherVarietyId?: string;
+    fatherVarietyInfo?: any;
+    motherVarietyInfo?: any;
+    idFlag: string;
+    animals?: any[];
+    [property: string]: any;
+
 }

BIN
src/static/images/common/edit_icon.png


BIN
src/static/images/common/scan_icon_o.png