Forráskód Böngészése

Merge branch 'master' of http://git.yujin.shuziyunyao.com/yujin/forestry-wx

lisy 1 hónapja
szülő
commit
1d41193b7c
34 módosított fájl, 3582 hozzáadás és 148 törlés
  1. 3 1
      src/assets/styles/public.scss
  2. 2 2
      src/components/ut-search/ut-search.vue
  3. 71 0
      src/pages.json
  4. 1 1
      src/pages/index/index.vue
  5. 2 2
      src/pages/plant/base/index.vue
  6. 2 2
      src/pages/plant/port/index.vue
  7. 1 1
      src/pages/plant/storage/index.vue
  8. 3 1
      src/plant/base/gap-base-info-edit/index.vue
  9. 1 1
      src/plant/base/gap-base-info/index.vue
  10. 3 3
      src/plant/contact-unit/unit-list/index.vue
  11. 2 2
      src/plant/port/port-create/index.vue
  12. 1 1
      src/plant/port/port-supervise/index.vue
  13. 280 0
      src/plant/storage/agro-product/add/index.vue
  14. 335 0
      src/plant/storage/agro-product/detail/index.vue
  15. 292 0
      src/plant/storage/agro-product/info-edit/index.vue
  16. 617 0
      src/plant/storage/agro-product/info-update/index.vue
  17. 178 0
      src/plant/storage/agro-product/list/index.vue
  18. 106 0
      src/plant/storage/agro-product/list/model/agro-bottom.vue
  19. 3 0
      src/plant/storage/agro-product/loss-register/index.vue
  20. 162 0
      src/plant/storage/agro-product/models/animals-input.vue
  21. 124 0
      src/plant/storage/agro-product/models/type.ts
  22. 3 0
      src/plant/storage/agro-product/stock-list/index.vue
  23. 124 15
      src/plant/storage/seed-source/add/index.vue
  24. 334 2
      src/plant/storage/seed-source/detail/index.vue
  25. 192 72
      src/plant/storage/seed-source/info-edit/index.vue
  26. 617 0
      src/plant/storage/seed-source/info-update/index.vue
  27. 81 14
      src/plant/storage/seed-source/list/index.vue
  28. 1 1
      src/plant/storage/seed-source/list/model/source-bottom.vue
  29. 3 0
      src/plant/storage/seed-source/loss-register/index.vue
  30. 15 11
      src/plant/storage/seed-source/models/type.ts
  31. 3 0
      src/plant/storage/seed-source/stock-list/index.vue
  32. 1 11
      src/plant/storage/storage-room/detail/index.vue
  33. 2 2
      src/plant/storage/storage-room/list/index.vue
  34. 17 3
      src/utils/ruoyi.ts

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

@@ -96,13 +96,15 @@ $colors: (
     gl: #affec2,
     // 主题色
     primary: #37a954,
+
+    info: #B8B4A7,
     light-black: #4d4d4d,
     // 成功
     success: #67c23a,
     // 警告
     warning: #e6a23c,
     // 失败
-    danger: #f56c6c,
+    danger: #F74C30,
     // 钱红色
     money-red: #f4403b,
     // 会员绿

+ 2 - 2
src/components/ut-search/ut-search.vue

@@ -3,7 +3,7 @@
     <view class="search-input d-flex a-c" :class="{ 'up-border': border }" :style="{ margin, background: bgColor, height, borderRadius }">
         <u-input v-model="value" ref="searchInputRef" cursor cursorColor="#333" clearable type="text" :focus="focused" border="none" @change="inputSearch" @clear="clear" @confirm="search" confirmType="search" :fontSize="fontSize" :maxlength="maxlength" :placeholder="placeholder">
             <template #suffix>
-                <view @click.stop="search" class="d-flex j-c a-c" style="padding: 0 16rpx">
+                <view @click.stop="search" class="d-flex j-c a-c" style="padding: 0 12rpx">
                     <image class="search_icon" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/search_icon.png" mode="widthFix" />
                 </view>
             </template>
@@ -92,7 +92,7 @@ defineExpose({
 .search-input {
     height: 86rpx;
     background-color: #fff;
-    padding-left: 20rpx;
+    padding-left: 16rpx;
 }
 
 .search_icon {

+ 71 - 0
src/pages.json

@@ -227,6 +227,7 @@
                         "navigationBarTitleText": "库房详情"
                     }
                 },
+
                 // 种源库
                 {
                     "path": "seed-source/list/index",
@@ -254,6 +255,76 @@
                     "style": {
                         "navigationBarTitleText": "添加种源信息"
                     }
+                },
+                // 修改种源信息,单条
+                {
+                    "path": "seed-source/info-update/index",
+                    "style": {
+                        "navigationBarTitleText": "修改种源信息"
+                    }
+                },
+                // 种源出入库清单
+                {
+                    "path": "seed-source/stock-list/index",
+                    "style": {
+                        "navigationBarTitleText": "种源出入库清单"
+                    }
+                },
+                // 库存耗损登记
+                {
+                    "path": "seed-source/loss-register/index",
+                    "style": {
+                        "navigationBarTitleText": "库存损耗登记"
+                    }
+                },
+                // 农资库 
+                {
+                    "path": "agro-product/list/index",
+                    "style": {
+                        "navigationBarTitleText": "农资库"
+                    }
+                },
+                // 新增农资入库
+                {
+                    "path": "agro-product/add/index",
+                    "style": {
+                        "navigationBarTitleText": "新增农资入库"
+                    }
+                },
+                // 添加农资信息
+                {
+                    "path": "agro-product/info-edit/index",
+                    "style": {
+                        "navigationBarTitleText": "添加农资信息"
+                    }
+                },
+                // 农资详情
+                {
+                    "path": "agro-product/detail/index",
+                    "style": {
+                        "navigationBarTitleText": "农资详情"
+                    }
+                },
+                // 修改农资信息,单条
+                {
+                    "path": "agro-product/info-update/index",
+                    "style": {
+                        "navigationBarTitleText": "修改农资信息"
+                    }
+                },
+                // 农资出入库清单
+                {
+                    "path": "agro-product/stock-list/index",
+                    "style": {
+                        "navigationBarTitleText": "农资出入库清单"
+                    }
+                },
+                // 农资库存耗损登记
+                {
+                    "path": "agro-product/loss-register/index",
+                    "style": {
+                        "navigationBarTitleText": "农资库存损耗登记"
+                    }
                 }
             ]
         },

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

@@ -165,7 +165,7 @@ const handleLogout = async (): Promise<void> => {
 
         .logout-btn {
             padding: 12rpx 24rpx;
-            background: #f56c6c;
+            background: #F74C30;
             color: #fff;
             border: none;
             border-radius: 8rpx;

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

@@ -345,7 +345,7 @@ const optionsActionTemp = reactive([
     {
         text: '删除',
         style: {
-            backgroundColor: '#f56c6c',
+            backgroundColor: '#F74C30',
         },
     },
 ]);
@@ -358,7 +358,7 @@ const clickTempSwipe = async (event: object) => {
             const res = await uni.showModal({
                 title: '删除提示',
                 content: '确定删除该基地吗?',
-                confirmColor: '#f56c6c',
+                confirmColor: '#F74C30',
             });
             if (!res.confirm) return;
             await uni.showLoading({

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

@@ -169,7 +169,7 @@ const clickTempSwipe = async (event: object) => {
         const res = await uni.showModal({
             title: '恢复提示',
             content: '确定恢复该任务吗?',
-            confirmColor: '#f56c6c',
+            confirmColor: '#F74C30',
         });
         if (!res.confirm) return;
         await uni.showLoading({
@@ -189,7 +189,7 @@ const clickTempSwipe = async (event: object) => {
             const res = await uni.showModal({
                 title: '结束提示',
                 content: '确定结束该任务吗?',
-                confirmColor: '#f56c6c',
+                confirmColor: '#F74C30',
             });
             if (!res.confirm) return;
             await uni.showLoading({

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

@@ -14,7 +14,7 @@
                     </view>
                 </up-grid-item>
                 <up-grid-item>
-                    <view class="pd2-10-0 d-flex flex-cln a-c j-c">
+                    <view class="pd2-10-0 d-flex flex-cln a-c j-c" @click="$u.route({ url: '/plant/storage/agro-product/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="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/storage/nav_nzk_icon.png" mode="widthFix" />
                         </view>

+ 3 - 1
src/plant/base/gap-base-info-edit/index.vue

@@ -200,7 +200,9 @@ const submitForm = async () => {
                 uni.$emit('gapBaseInfoUpdated');
                 // 返回上一页
                 setTimeout(() => {
-                    uni.navigateBack();
+                    uni.navigateBack({
+                        delta: 1,
+                    });
                 }, 1500);
             } catch (error) {
                 uni.hideLoading();

+ 1 - 1
src/plant/base/gap-base-info/index.vue

@@ -118,7 +118,7 @@ const optionsAction = reactive([
     {
         text: '删除',
         style: {
-            backgroundColor: '#f56c6c',
+            backgroundColor: '#F74C30',
         },
     },
 ]);

+ 3 - 3
src/plant/contact-unit/unit-list/index.vue

@@ -84,7 +84,7 @@ const optionsAction = reactive([
     {
         text: '删除',
         style: {
-            backgroundColor: '#f56c6c',
+            backgroundColor: '#F74C30',
         },
     },
 ]);
@@ -95,7 +95,7 @@ const clickSwipe = async (event: object) => {
         const res = await uni.showModal({
             title: '删除提示',
             content: '删除后不可撤回,请谨慎操作!',
-            confirmColor: '#f56c6c',
+            confirmColor: '#F74C30',
         });
         console.log(res);
         if (res.confirm) {
@@ -140,7 +140,7 @@ onMounted(() => {
     margin-top: -24rpx;
 }
 .li-left-tag {
-    padding: 4rpx 12rpx;
+    padding: 6rpx 16rpx;
     background-color: #ebf6ee;
     color: #37a954;
     border-radius: 16rpx 0 16rpx 0;

+ 2 - 2
src/plant/port/port-create/index.vue

@@ -829,7 +829,7 @@ const options1 = reactive([
     {
         text: '删除',
         style: {
-            backgroundColor: '#f56c6c',
+            backgroundColor: '#F74C30',
         },
     },
     {
@@ -1195,7 +1195,7 @@ const clickSwipe = async (name: any, index: number) => {
         const res = await uni.showModal({
             title: '删除提示',
             content: '删除后不可撤回,请谨慎操作!',
-            confirmColor: '#f56c6c',
+            confirmColor: '#F74C30',
         });
         if (!res.confirm) return;
         await uni.showLoading({

+ 1 - 1
src/plant/port/port-supervise/index.vue

@@ -178,7 +178,7 @@ const clickTempSwipe = async (event: object) => {
             const res = await uni.showModal({
                 title: '删除提示',
                 content: '删除后,将不能恢复,请谨慎操作!若已使用物料,删除后物料将自动退回相应仓库。',
-                confirmColor: '#f56c6c',
+                confirmColor: '#F74C30',
             });
             if (!res.confirm) return;
             await uni.showLoading({

+ 280 - 0
src/plant/storage/agro-product/add/index.vue

@@ -0,0 +1,280 @@
+<template>
+    <z-paging class="" ref="paging" bgColor="#f7f7f7" paging-class="paging-btm-shadow" safe-area-inset-bottom scroll-with-animation>
+        <template #top>
+            <ut-navbar :title="did ? '编辑农资入库' : '新增农资入库'" :fixed="false" border></ut-navbar>
+        </template>
+        <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
+            <!-- 农资信息 -->
+            <view class="pd-24">
+                <view class="startline-title">农资信息</view>
+            </view>
+            <view class="pd-24 bg-#fff">
+                <!-- TODO: 后续按 seedInfoList 设计农资信息明细,此处先留空结构避免表单错误 -->
+                <up-form-item borderBottom label="添加农资信息" required prop="seedInfoList">
+                    <view class="flex1">
+                        <template v-for="(item, index) in form.seedInfoList" :key="index">
+                            <view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-12">
+                                <view class="d-flex flex1 mb-10">
+                                    <view class="flex1">
+                                        <span class="f-s-34 c-#333 f-w-500 mr-10">{{ uidMapData[item]?.varietyInfo?.varietyName }}</span>
+                                        <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, uidMapData[item]?.seedType) }}</span>
+                                    </view>
+                                    <view class="pr-60">
+                                        <view v-if="uidMapData[item]?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检</view>
+                                        <view v-else class="tag-span c-danger bg-#F9ECEA">未检</view>
+                                    </view>
+                                </view>
+                                <view class="d-flex">
+                                    <view class="flex1 f-s-28 pr-10 pd2-4-0">
+                                        <span class="c-#666">来源:</span>
+                                        <span class="c-#333 f-w-500">{{ selectDictLabel(pt_seed_source, uidMapData[item]?.seedSource) }}</span>
+                                    </view>
+                                    <view class="flex1 f-s-28 pd2-4-0">
+                                        <span class="c-#666">入库量:</span>
+                                        <span class="c-#333 f-w-500">{{ uidMapData[item]?.capacity }}{{ uidMapData[item]?.unit }}</span>
+                                    </view>
+                                </view>
+                                <view class="d-flex">
+                                    <view class="flex1 ov-hd">
+                                        <view class="f-s-28 pr-10 pd2-4-0">
+                                            <span class="c-#666">供应商:</span>
+                                            <span class="c-#333 f-w-500">{{ uidMapData[item]?.supplierInfo?.cusName }}</span>
+                                        </view>
+                                        <view class="f-s-28 pr-10 pd2-4-0">
+                                            <span class="c-#666">受托单位:</span>
+                                            <span class="c-#333 f-w-500">{{ uidMapData[item]?.entrustInfo?.cusName }}</span>
+                                        </view>
+                                    </view>
+                                    <view class="d-flex a-ed" @click="navigateToAddAgroProduct(item, 'edit')">
+                                        <view class="pd-10 c-primary f-s-20">去编辑{{ '>' }}</view>
+                                    </view>
+                                </view>
+                                <view class="close-icon pd-16" @click.stop="deleteRow(index, item)">
+                                    <up-icon color="#F81242" name="close" size="32rpx"></up-icon>
+                                </view>
+                            </view>
+                        </template>
+
+                        <up-button type="primary" plain @click="navigateToAddAgroProduct('', 'add')">
+                            <up-icon class="mr-10" name="plus" color="#37A954"></up-icon>
+                            <span>添加农资入库信息</span>
+                        </up-button>
+                    </view>
+                </up-form-item>
+            </view>
+            <view class="pd-24">
+                <view class="startline-title">入库信息</view>
+            </view>
+            <view class="pd-24 bg-#fff">
+                <!-- 入库类型 -->
+                <up-form-item borderBottom label="入库类型" required prop="instoreType">
+                    <view v-if="form.instoreType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_instore_type, form.instoreType) }}</view>
+                    <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择入库类型</view>
+                </up-form-item>
+                <!-- 入库日期 -->
+                <view class="h-1" id="instoreDatepppp"></view>
+                <ut-datetime-picker v-model="form.instoreBizInfo.instoreDate" :maxDate="new Date()" mode="date">
+                    <up-form-item borderBottom label="入库日期" required prop="instoreBizInfo.instoreDate">
+                        <up-input v-model="form.instoreBizInfo.instoreDate" readonly placeholder="请选择入库日期" border="none" clearable></up-input>
+                        <template #right>
+                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                        </template>
+                    </up-form-item>
+                </ut-datetime-picker>
+                <!-- 入库批号 -->
+                <up-form-item borderBottom label="入库批号" required prop="batchCode">
+                    <up-input v-model="form.batchCode" placeholder="请输入入库批号" border="none" clearable></up-input>
+                    <template #right>
+                        <up-button @click="generateBatchCode" type="primary" :customStyle="formItemBtnStyle">随机生成</up-button>
+                    </template>
+                </up-form-item>
+                <!-- 库房类型 -->
+                <up-form-item borderBottom label="库房类型" prop="storeType" required>
+                    <view v-if="form.storeType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_warehouse_type, form.storeType) }}</view>
+                    <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择库房类型</view>
+                </up-form-item>
+                <!-- 存放库房(具体库房/货架信息稍后补充为选择器) -->
+                <up-form-item borderBottom label="存放库房" prop="storeCode">
+                    <up-input v-model="form.storeCode" placeholder="请输入存放库房或编码" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 入库人 -->
+                <up-form-item borderBottom label="入库人" required prop="instoreBizInfo.instoreMg">
+                    <up-input v-model="form.instoreBizInfo.instoreMg" placeholder="请输入入库人" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 入库备注 -->
+                <up-form-item borderBottom label="入库备注" prop="instoreBizInfo.remark">
+                    <up-textarea v-model="form.instoreBizInfo.remark" placeholder="请输入入库备注" autoHeight></up-textarea>
+                </up-form-item>
+            </view>
+        </up-form>
+        <template #bottom>
+            <view class="pd-20 d-flex">
+                <up-button @click="submitForm" type="primary">确认入库</up-button>
+            </view>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { SeedSourceAddTypeEnum } from '../models/type';
+import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { generateUniqueId } from '@/utils/public';
+import { parseTime } from '@/utils/ruoyi';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_seed_instore_type, pt_warehouse_type, 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, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', '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', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
+// 表单与分页等基础状态(参考 base-edit 风格)
+const paging = ref<any>(null);
+const upFormRef = ref<any>(null);
+const showArea = ref(false);
+const form = ref<SeedSourceAddTypeEnum>({
+    instoreType: '2',
+    storeType: '1',
+    seedInfoList: [],
+    warehouses: [],
+    instoreBizInfo: {
+       instoreDate: parseTime(new Date(), '{y}-{m}-{d}'),
+       instoreMg: '',
+       remark: '',
+    },
+});
+const rules = reactive({
+    seedInfoList: [{ required: true, message: '请添加农资信息', type: 'array', min: 1 }],
+    instoreType: [{ required: true, message: '请选择入库类型' }],
+    'instoreBizInfo.instoreDate': [{ required: true, message: '请选择入库日期' }],
+    batchCode: [{ required: true, message: '请输入入库批号' }],
+    'instoreBizInfo.instoreMg': [{ required: true, message: '请输入入库人' }],
+});
+
+const submitForm = async () => {
+    console.log(form.value);
+    
+    uni.$u.debounce(
+        async () => {
+            try {
+                await upFormRef.value?.validate();
+            } catch (error: any) {
+                // 滚动到第一个错误字段
+                const firstErrorField = error && error[0].prop + 'pppp';
+                paging.value?.scrollIntoViewById(firstErrorField, 30, true);
+                return;
+            }
+            // 提交表单
+            uni.showLoading({
+                title: '提交中...',
+            });
+            const params = form.value.seedInfoList.map((uid) => {
+                return {
+                    ...uidMapData.value[uid],
+                    ...form.value,
+                    instoreBizInfo: {
+                        ...form.value.instoreBizInfo,
+                        ...uidMapData.value[uid]?.instoreBizInfo,
+                    }
+                };
+            })
+            try {
+                const res = await useClientRequest.post('/plt-api/app/storageSeed/batchInstore', params);
+                uni.hideLoading();
+                if (!res || res !== 200) return;
+                uni.hideLoading();
+                uni.showToast({
+                    title: '提交成功',
+                    icon: 'success',
+                });
+                uni.$emit('refreshStorageRoomList');
+                // 返回上一页
+                setTimeout(() => {
+                    uni.navigateBack({
+                        delta: 1,
+                    });
+                }, 1500);
+            } catch (error) {
+                uni.hideLoading();
+            }
+        },
+        500,
+        true,
+    );
+};
+// 点击随机生成服务端生成唯一的批号
+const generateBatchCode = async () => {
+    uni.showLoading({
+        title: '生成中...',
+    });
+    const res = await useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', {
+        plType: 'M',
+        linkType: 'I',
+    });
+    if (res && res.code === 200) {
+        uni.hideLoading();
+        form.value.batchCode = res.data;
+        uni.showToast({
+            title: '批号生成成功',
+            icon: 'success',
+        });
+    }
+};
+const did = ref('');
+const getDetailById = async (id: string) => {
+    if (!id) return;
+    const res = await useClientRequest.get(`/plt-api/app/gapCertificationInfo/getInfoById/${id}`);
+    if (res && res.code === 200) {
+        form.value = {
+            ...res.data,
+        };
+    }
+};
+const uidMapData = ref({} as any);
+// 添加农资入库跳转
+const navigateToAddAgroProduct = (uid = '', mode = 'add') => {
+    uni.$on('submitForm', (data: any) => {
+        uidMapData.value[data.uid] = data.form;
+        if (data?.mode == 'add') {
+            form.value.seedInfoList.push(data.uid);
+        }
+        uni.$off('submitForm');
+    });
+    uni.navigateTo({
+        url: '/plant/storage/agro-product/info-edit/index',
+        success(res) {
+            res.eventChannel.emit('optionsParam', {
+                uid: uid || generateUniqueId(),
+                mode: mode,
+                form: uid ? uidMapData.value[uid] : {}
+            });
+        }
+    });
+};
+const deleteRow = (index: number, uid: string) => {
+    form.value.seedInfoList.splice(index, 1);
+    delete uidMapData.value[uid];
+};
+// 编辑时加载详情
+onLoad((optins: any) => {
+    if (optins.id) {
+        // 编辑加载详
+        did.value = optins.id;
+        getDetailById(optins.id);
+    } else {
+    }
+});
+</script>
+<style lang="scss" scoped>
+.card-info-block {
+    border: 1rpx solid #afddbb;
+    border-radius: 10rpx;
+}
+
+.tag-span {
+    padding: 4rpx 12rpx;
+    font-size: 20rpx;
+    border-radius: 18rpx;
+}
+.close-icon {
+    position: absolute;
+    top: 0;
+    right: 0;
+    z-index: 10;
+}
+</style>

+ 335 - 0
src/plant/storage/agro-product/detail/index.vue

@@ -0,0 +1,335 @@
+<template>
+    <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" scroll-with-animation>
+        <template #top>
+            <ut-navbar title="种源详情" :fixed="false" border></ut-navbar>
+        </template>
+
+        <template>
+            <view class="pd-24 d-flex a-c">
+                <view class="flex1 ov-hd">
+                    <view class="startline-title">库存信息</view>
+                </view>
+                <view>
+                    <up-button type="primary" :customStyle="formItemBtnStyle">
+                        <span>查看出入库记录</span>
+                    </up-button>
+                </view>
+            </view>
+            <view class="bg-#fff pd-24">
+                <view class="d-flex j-sb a-c li-item-head mb-16">
+                    <view class="li-left-tag" :class="{ [`bg-${selectDictListClass(pt_seed_instore_type, form?.instoreType)}`]: true }">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) }}</view>
+                    <view class="f-s-22 c-#666">{{ form?.updateTime || form?.createTime }}</view>
+                </view>
+                <view class="mb-10">
+                    <span class="f-s-34 c-#333 f-w-500 mr-10">{{ form?.variety }}</span>
+                    <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, form?.seedType) }}</span>
+                </view>
+                <view class="pd2-4-0 f-s-28">
+                    <span class="c-#666">入库批号:</span>
+                    <span class="c-#333 f-w-500">{{ form?.batchCode }}</span>
+                </view>
+                <!-- <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">溯源批号:</span>
+                            <span class="c-#333 f-w-500">暂无</span>
+                        </view> -->
+                <view v-if="['A3', 'A4'].includes(form?.fungusCodeType)" class="pd2-4-0 f-s-28">
+                    <span class="c-#666">菌种/菌株编号:</span>
+                    <span class="c-#333 f-w-500">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</span>
+                </view>
+                <view class="pd2-4-0 f-s-28">
+                    <span class="c-#666">供应商:</span>
+                    <span class="c-#333 f-w-500">{{ form?.supplier }}</span>
+                </view>
+                <view class="pd2-4-0 f-s-28">
+                    <span class="c-#666">入库量:</span>
+                    <span class="c-#333 f-w-500">{{ form?.capacity }}{{ form?.unit }}</span>
+                </view>
+                <view class="d-flex">
+                    <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                        <span class="c-#666">出库量:</span>
+                        <span class="c-#333 f-w-500">{{ form?.inputAmount || '0' }}{{ form?.unit }}</span>
+                    </view>
+                    <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                        <span class="c-primary">剩余量:</span>
+                        <span class="c-primary f-w-500">{{ form?.restAmount || '0' }}{{ form?.unit }}</span>
+                    </view>
+                </view>
+            </view>
+            <view class="pd-24">
+                <view class="startline-title">种源信息</view>
+            </view>
+            <view class="bg-#fff pd-24">
+                <!-- 种源信息详情 -->
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源类型:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_type, form?.seedType) || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">物种基原:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="mb-10">
+                            <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.varietyName }}</span>
+                            <span class="f-s-24 c-#666">{{ form?.varietyInfo?.latinName }}</span>
+                        </view>
+                        <view>
+                            <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.genusName }}</span>
+                            <span class="f-s-24 c-#666">{{ form?.varietyInfo?.genusLatinName }}</span>
+                        </view>
+                    </view>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">具体品种/品系名称:</span>
+                    <span class="c-#333 f-w-600">{{ form?.seedName || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源来源:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_source, form?.seedSource) || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom" v-if="form?.instoreBizInfo?.motherFatherFlag">
+                    <span class="c-#666">父母本情况:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_mother_father_flag, form?.instoreBizInfo?.motherFatherFlag) || '-' }}</span>
+                </view>
+                <view v-if="form?.instoreBizInfo?.motherFatherFlag == '2' && form?.instoreBizInfo?.fatherVarietyInfo" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">父本品种:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="mb-10">
+                            <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>
+                        </view>
+                        <view>
+                            <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?.instoreBizInfo?.fatherVarietyInfo?.genusLatinName }}</span>
+                        </view>
+                    </view>
+                </view>
+                <view v-if="form?.instoreBizInfo?.motherVarietyInfo" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">母本品种:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="mb-10">
+                            <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>
+                            <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>
+                </view>
+                <template v-if="['A3', 'A4'].includes(form?.seedType as string)">
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">{{ genCountMap[form?.seedType as 'A3' | 'A4'] }}:</span>
+                        <span class="c-#333 f-w-600">
+                            {{ form?.instoreBizInfo?.genCount || '-' }}
+                            <text v-if="form?.instoreBizInfo?.genUnit">{{ selectDictLabel(pt_gen_unit, form?.instoreBizInfo?.genUnit) }}</text>
+                        </span>
+                    </view>
+                </template>
+                <template v-else>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">繁衍世代:</span>
+                        <span class="c-#333 f-w-600">
+                            {{ form?.instoreBizInfo?.genCount || '-' }}
+                            <text v-if="form?.instoreBizInfo?.genUnit">{{ selectDictLabel(pt_gen_unit, form?.instoreBizInfo?.genUnit) }}</text>
+                        </span>
+                    </view>
+                </template>
+                <view v-if="form?.entrustId" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">受托单位:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="f-s-34 c-#333 f-w-500">{{ form?.entrustInfo?.cusName }}</view>
+                        <view class="f-s-24 c-#666">{{ form?.entrustInfo?.cusCode }}</view>
+                    </view>
+                </view>
+                <view v-if="form?.examinReport && form?.examinReport.length" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">检验报告:</view>
+                    <ut-album :urls="form?.examinReport"></ut-album>
+                </view>
+                <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">供应商:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="f-s-34 c-#333 f-w-500">{{ form?.supplierInfo?.cusName }}</view>
+                        <view class="f-s-24 c-#666">{{ form?.supplierInfo?.cusCode }}</view>
+                    </view>
+                </view>
+                <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">供应商是否是生产商:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.supplierProducerFlag) || '-' }}</span>
+                </view>
+                <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">生产商:</span>
+                    <span class="c-#333 f-w-600">{{ form?.producer || '-' }}</span>
+                </view>
+                <view v-if="['A4', 'A8'].includes(form?.seedType as string)" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">{{ selectDictLabel(pt_seed_type, form?.seedType as string) }}编号:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom" v-if="form?.instoreBizInfo?.idFlag">
+                    <span class="c-#666">是否有个体标识:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.instoreBizInfo?.idFlag) || '-' }}</span>
+                </view>
+                <view v-if="form?.instoreBizInfo?.animals && form?.instoreBizInfo?.animals.length" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">个体标识号:</view>
+                    <template v-for="(animal, index) in form?.instoreBizInfo?.animals" :key="index">
+                        <view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-10 f-s-28 c-#333 f-w-500">
+                            {{ animal.animalId }}
+                        </view>
+                    </template>
+                </view>
+                <view v-if="form?.instoreBizInfo?.storageMethod" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">保藏方法:</span>
+                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.storageMethod || '-' }}</span>
+                </view>
+                <view v-if="form?.imgs" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">种源图片:</view>
+                    <ut-album :urls="form?.imgs"></ut-album>
+                </view>
+                <view v-if="form?.vedios" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">种源视频:</view>
+                    <ut-album :urls="form?.vedios"></ut-album>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源产地:</span>
+                    <span class="c-#333 f-w-600">{{ form?.adcodeName || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">繁殖材料:</span>
+                    <span class="c-#333 f-w-600">{{ form?.generationMaterial ? selectDictLabels(pt_breeding_materials, form?.generationMaterial, ',') : '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">繁殖地点/采集地点:</span>
+                    <span class="c-#333 f-w-600">{{ form?.generationAdcodeName || '-' }}</span>
+                </view>
+                <view v-if="form?.spCert && form?.spCert.length" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">物种鉴定证书:</view>
+                    <ut-album :urls="form?.spCert"></ut-album>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源检疫证号:</span>
+                    <span class="c-#333 f-w-600">{{ form?.seedCheckSn || '-' }}</span>
+                </view>
+                <view v-if="form?.seedCheckCert && form?.seedCheckCert.length" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">种源检疫证书:</view>
+                    <ut-album :urls="form?.seedCheckCert"></ut-album>
+                </view>
+            </view>
+            <view class="pd-24">
+                <view class="startline-title">入库信息</view>
+            </view>
+            <view class="bg-#fff pd-24">
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源级别:</span>
+                    <span class="c-#333 f-w-600">{{ form?.seedLevel || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库类型:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库日期:</span>
+                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreDate || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库批号:</span>
+                    <span class="c-#333 f-w-600">{{ form?.batchCode || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">库房类型:</span>
+                    <span class="c-#333 f-w-600">种源库</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">存放库房:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_warehouse_type, form?.warehouseType) || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库人:</span>
+                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreMg || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库备注:</span>
+                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.remark || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">最后修改人:</span>
+                    <span class="c-#333 f-w-600">{{ form?.operatorName || form?.updateByName || form?.createByName || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">最后修改时间:</span>
+                    <span class="c-#333 f-w-600">{{ form?.operateTime || form?.updateTime || form?.createTime || '-' }}</span>
+                </view>
+            </view>
+        </template>
+        <template #bottom>
+            <view class="pd-24 d-flex a-c">
+                <up-button type="primary" @click="clickEdit">修改</up-button>
+            </view>
+        </template>
+    </z-paging>
+</template>
+
+<script setup lang="ts">
+import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { useClientRequest } from '@/utils/request';
+import { selectDictListClass } from '@/utils/ruoyi';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+const { pt_seed_instore_type, pt_warehouse_type, 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, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', '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', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
+const paging = ref<any>(null);
+const form = ref<any>({});
+const did = ref('');
+
+// 繁衍世代显示文案
+const genCountMap = reactive({
+    A4: '累计扩繁代数',
+    A3: '继代培养次数',
+});
+
+// 获取详情(仓库信息)
+const getDetailById = async (id: string) => {
+    if (!id) return;
+    const res = await useClientRequest.get(`/plt-api/app/storageSeed/getById/${id}`);
+    if (res && res.code === 200) {
+        form.value = res.data || {};
+    }
+};
+
+const onRefresh = () => {
+    getDetailById(did.value);
+    paging.value?.complete();
+};
+const clickEdit = () => {
+    uni.$on('seed-source-detail-refresh', () => {
+        getDetailById(did.value);
+        uni.$off('seed-source-detail-refresh');
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/plant/storage/seed-source/info-update/index',
+        params: {
+            id: did.value,
+        },
+    });
+};
+// 页面入参解析并加载
+onLoad((options: any) => {
+    did.value = options?.id || '';
+    getDetailById(did.value);
+});
+</script>
+
+<style lang="scss" scoped>
+.card-info-block {
+    border: 1rpx solid #afddbb;
+    border-radius: 10rpx;
+}
+.li-item-head {
+    margin-left: -24rpx;
+    margin-top: -24rpx;
+}
+.li-left-tag {
+    padding: 6rpx 16rpx;
+    color: #fff;
+    border-radius: 0 0 16rpx 0;
+    font-size: 20rpx;
+    font-weight: 500;
+}
+</style>

+ 292 - 0
src/plant/storage/agro-product/info-edit/index.vue

@@ -0,0 +1,292 @@
+<template>
+    <z-paging class="" ref="paging" bgColor="#fff" paging-class="paging-btm-shadow" safe-area-inset-bottom scroll-with-animation>
+        <template #top>
+            <ut-navbar :title="optionsParam?.mode == 'edit' ? '编辑种源入库信息' : '添加种源入库信息'" :fixed="false" border></ut-navbar>
+        </template>
+        <view class="pd-24">
+            <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
+                <!-- 基本信息 -->
+                <view class="h-1" id="materialNamepppp"></view>
+                <up-form-item borderBottom label="产品名称" prop="materialName" required>
+                    <up-input v-model="form.materialName" placeholder="请输入产品名称" border="none" clearable></up-input>
+                </up-form-item>
+                <view class="h-1" id="materialTypepppp"></view>
+                <ut-action-sheet :tabs="pt_material_type" mode="custom" title="农资类别" v-model="form.materialType">
+                    <up-form-item borderBottom label="农资类别" required prop="materialType">
+                        <view v-if="form.materialType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_material_type, form.materialType) }}</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>
+
+                <!-- 入库数量与单位 -->
+                <view class="h-1" id="capacitypppp"></view>
+                <up-form-item label="入库量" prop="capacity" required class="form-item-bottom-padding-0">
+                    <div class="flex1 d-flex">
+                        <div class="flex1 ov-hd">
+                            <up-form-item prop="capacity" border-bottom class="form-item-top-padding-0">
+                                <up-input v-model="form.capacity" placeholder="请输入入库量" border="none" clearable></up-input>
+                            </up-form-item>
+                        </div>
+                        <div class="pd-5"></div>
+                        <div class="min-w-200">
+                            <ut-action-sheet v-model="form.unit" :tabs="pt_materail_unit" mode="custom" title="选择单位">
+                                <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
+                                    <view class="flex1" style="line-height: 24px">
+                                        <view v-if="form.unit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_materail_unit, form.unit) }}</view>
+                                        <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                    </view>
+                                    <template #right>
+                                        <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                    </template>
+                                </up-form-item>
+                            </ut-action-sheet>
+                        </div>
+                    </div>
+                </up-form-item>
+                <view class="h-1" id="sourceTypepppp"></view>
+                <ut-action-sheet :tabs="pt_source_type" mode="custom" title="农资来源" v-model="form.sourceType">
+                    <up-form-item borderBottom label="农资来源" required prop="sourceType">
+                        <view v-if="form.sourceType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_source_type, form.sourceType) }}</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>
+                <template v-if="['1'].includes(form.sourceType as string)">
+                    <up-form-item borderBottom label="供应商" prop="supplierId" required>
+                        <view class="flex1">
+                            <ContactUnitInput v-model="form.supplierId" v-model:info="form.supplierInfo" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
+                        </view>
+                    </up-form-item>
+                    <up-form-item borderBottom label="供应商是否是生产商" prop="supplierProducerFlag">
+                        <up-radio-group v-model="form.supplierProducerFlag">
+                            <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>
+                    <up-form-item borderBottom label="生产商" prop="producer">
+                        <up-input v-model="form.producer" placeholder="请输入生产商名称" border="none" clearable></up-input>
+                    </up-form-item>
+                </template>
+                <up-form-item borderBottom label="生产批号" prop="productCode">
+                    <up-input v-model="form.productCode" placeholder="请输入生产批号" border="none" clearable></up-input>
+                </up-form-item>
+                <ut-datetime-picker v-model="form.productDate" :maxDate="new Date()" mode="date">
+                    <up-form-item borderBottom label="生产日期" prop="productDate">
+                        <up-input v-model="form.productDate" readonly placeholder="请选择生产日期" border="none" clearable></up-input>
+                        <template #right>
+                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                        </template>
+                    </up-form-item>
+                </ut-datetime-picker>
+                <up-form-item borderBottom label="品牌" prop="brand">
+                    <up-input v-model="form.brand" placeholder="请输入品牌" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 登记证号 肥料和农药才有登记证号 -->
+                <template v-if="['1', '2'].includes(form.materialType as string)">
+                    <up-form-item borderBottom label="登记证号" prop="materialCode">
+                        <up-input v-model="form.materialCode" placeholder="请输入登记证号" border="none" clearable></up-input>
+                    </up-form-item>
+                </template>
+                <!-- 媒体与附件 -->
+                <up-form-item borderBottom label="农资图片" prop="imgs">
+                    <ut-upload v-model="form.imgs" :max-count="9" valueType="string"></ut-upload>
+                </up-form-item>
+                <up-form-item borderBottom label="农资视频" prop="vedios">
+                    <ut-upload v-model="form.vedios" :max-count="3" accept="video" valueType="string"></ut-upload>
+                </up-form-item>
+                <!-- 检验报告 -->
+                <up-form-item borderBottom label="检验报告" prop="examinReport">
+                    <ut-upload v-model="form.examinReport" :max-count="50" valueType="array" accept="image,file"></ut-upload>
+                </up-form-item>
+            </up-form>
+        </view>
+        <template #bottom>
+            <view class="pd-20 d-flex">
+                <up-button @click="submitForm" type="primary">保存</up-button>
+            </view>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { seedInfoListType } from '../models/type';
+import AnimalsInput from '../models/animals-input.vue';
+import ContactUnitInput from '@/models/contact-unit-input/contact-unit-input.vue';
+import PickerAreaInput from '@/models/picker-area-input/picker-area-input.vue';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_material_type, pt_source_type, pt_materail_unit, pt_mother_father_flag, pt_fungus_code_type, pt_breeding_materials, yes_no, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_material_type', 'pt_source_type','pt_mother_father_flag', 'pt_op_method', 'pt_materail_unit', 'pt_fungus_code_type', 'pt_breeding_materials', 'yes_no', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
+const paging = ref<any>(null);
+const selectContactUnitShow = ref(false);
+const upFormRef = ref<any>(null);
+const form = ref<seedInfoListType>({
+    imgs: undefined,
+    vedios: undefined,
+    spCert: [],
+    newSpCert: [],
+    importCert: [],
+    seedCheckCert: [],
+    unit: '',
+    adcode: '',
+    instoreBizInfo: {
+        motherFatherFlag: '',
+        idFlag: '1',
+        genUnit: '',
+    },
+    generationMaterial: '',
+});
+const rules = reactive({
+    seedType: [{ required: true, message: '请选择种源类型' }],
+    varietyId: [{ required: true, message: '请选择物种基原' }],
+    seedSource: [{ required: true, message: '请选择种源来源' }],
+    'instoreBizInfo.motherFatherFlag': [{ required: true, message: '请选择父母本情况' }],
+    'instoreBizInfo.genCount': [
+        {
+            asyncValidator: (rule: any, value: any) => {
+                if (['A3', 'A4'].includes(form.value.seedType as string)) {
+                    if (!value) {
+                        return Promise.reject('请输入' + genCountMap[form.value.seedType as 'A3' | 'A4']);
+                    }
+                }
+                return Promise.resolve();
+            },
+        },
+    ],
+    'instoreBizInfo.genUnit': [
+        {
+            asyncValidator: (rule: any, value: any) => {
+                if (['A3', 'A4'].includes(form.value.seedType as string)) {
+                    if (!value) {
+                        return Promise.reject('请选择单位');
+                    }
+                }
+                return Promise.resolve();
+            },
+        },
+    ],
+    entrustId: [{ required: true, message: '请选择受托单位' }],
+    capacity: [{ required: true, message: '请输入入库量' }],
+    unit: [{ required: true, message: '请选择单位' }],
+    supplierId: [{ required: true, message: '请选择供应商' }],
+    fungusCodeType: [{ required: true, message: '请选择编号类型' }],
+    fungusCode: [{ required: true, message: '请输入编号' }],
+    'instoreBizInfo.idFlag': [{ required: true, message: '请选择是否有个体标识' }],
+    'instoreBizInfo.animals': [{ type: 'array', required: true, message: '请输入个体标识号' }],
+});
+// 繁衍世代对象
+const genCountMap = reactive({
+    A4: '累计扩繁代数',
+    A3: '继代培养次数',
+});
+const submitForm = async () => {
+    console.log(form.value);
+    uni.$u.debounce(
+        async () => {
+            try {
+                await upFormRef.value?.validate();
+            } catch (error: any) {
+                // 滚动到第一个错误字段
+                const firstErrorField = error && error[0].prop + 'pppp';
+                paging.value?.scrollIntoViewById(firstErrorField, 30, true);
+                return;
+            }
+            // 提交表单
+            uni.$emit('submitForm', {
+                ...optionsParam.value,
+                form: { ...form.value, uid: optionsParam.value?.uid || '' },
+            });
+            uni.navigateBack({
+                delta: 1,
+            });
+            try {
+            } catch (error) {
+                uni.hideLoading();
+            }
+        },
+        500,
+        true,
+    );
+};
+// 去选择物种基原
+const selectVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.varietyId = data.msg.id;
+        form.value.varietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择物种基原',
+        },
+    });
+};
+const selectFatherVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.instoreBizInfo.fatherVarietyId = data.msg.id;
+        form.value.instoreBizInfo.fatherVarietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择父本品种',
+        },
+    });
+};
+const selectMotherVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.instoreBizInfo.motherVarietyId = data.msg.id;
+        form.value.instoreBizInfo.motherVarietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择母本品种',
+        },
+    });
+};
+const optionsParam = ref({} as any);
+onLoad((options: any) => {
+    const instance: any = getCurrentInstance()?.proxy;
+    const eventChannel = instance?.getOpenerEventChannel();
+    eventChannel.on('optionsParam', (data: any) => {
+        console.log(data);
+        optionsParam.value = {
+            uid: data?.uid || '',
+            mode: data?.mode || 'add',
+        };
+        form.value = {
+            ...form.value,
+            ...data?.form,
+        };
+    });
+});
+</script>
+<style lang="scss" scoped>
+.card-info-block {
+    border: 1rpx solid #afddbb;
+    border-radius: 10rpx;
+}
+
+.close-icon {
+    position: absolute;
+    top: 0rpx;
+    right: 0rpx;
+}
+:deep(.form-item-top-padding-0) {
+    > .u-form-item__body {
+        padding-top: 0rpx;
+    }
+}
+:deep(.form-item-bottom-padding-0) {
+    > .u-form-item__body {
+        padding-bottom: 0rpx;
+    }
+}
+</style>

+ 617 - 0
src/plant/storage/agro-product/info-update/index.vue

@@ -0,0 +1,617 @@
+<template>
+    <z-paging class="" ref="paging" bgColor="#f7f7f7" paging-class="paging-btm-shadow" safe-area-inset-bottom scroll-with-animation>
+        <template #top>
+            <ut-navbar :title="did ? '编辑种源入库' : '新增种源入库'" :fixed="false" border></ut-navbar>
+        </template>
+        <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
+            <!-- 种源信息(复制自 info-edit 字段与顺序) -->
+            <view class="pd-24">
+                <view class="startline-title">种源信息</view>
+            </view>
+            <view class="pd-24 bg-#fff">
+                <!-- 基本信息 -->
+                <view class="h-1" id="seedTypepppp"></view>
+                <ut-action-sheet :tabs="pt_seed_type" mode="custom" title="种源类型" v-model="form.seedType">
+                    <up-form-item borderBottom label="种源类型" required prop="seedType">
+                        <view v-if="form.seedType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_type, form.seedType) }}</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>
+                <view class="h-1" id="varietyIdpppp"></view>
+                <up-form-item borderBottom label="物种基原" required prop="varietyId">
+                    <view class="flex1">
+                        <up-button v-if="!form.varietyId" @click="selectVarietyId" type="primary" plain>
+                            <image class="w-36 h-36 mr-10" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/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?.varietyInfo?.varietyName }}</span>
+                                <span class="f-s-24 c-#666">{{ form?.varietyInfo?.latinName }}</span>
+                            </view>
+                            <view class="mb-16">
+                                <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.genusName }}</span>
+                                <span class="f-s-24 c-#666">{{ form?.varietyInfo?.genusLatinName }}</span>
+                            </view>
+                            <view class="f-s-24 c-#666">产出:{{ form?.varietyInfo?.medicineName }}</view>
+                            <view
+                                class="close-icon pd-16"
+                                @click="
+                                    form.varietyId = '';
+                                    form.varietyInfo = null;
+                                "
+                            >
+                                <up-icon color="#F81242" name="close" size="32rpx"></up-icon>
+                            </view>
+                        </view>
+                    </view>
+                </up-form-item>
+                <up-form-item borderBottom label="具体品种/品系名称" prop="seedName">
+                    <up-input v-model="form.seedName" placeholder="请输入具体品种/品系名称" border="none" clearable></up-input>
+                </up-form-item>
+                <view class="h-1" id="seedSourcepppp"></view>
+                <ut-action-sheet :tabs="pt_seed_source" mode="custom" title="种源来源" v-model="form.seedSource">
+                    <up-form-item borderBottom label="种源来源" required prop="seedSource">
+                        <view v-if="form.seedSource" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_source, form.seedSource) }}</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>
+                <view class="h-1" id="motherFatherFlagpppp"></view>
+                <ut-action-sheet :tabs="pt_mother_father_flag" mode="custom" title="父母本情况" v-model="form.instoreBizInfo.motherFatherFlag">
+                    <template v-if="['A3', 'A4'].includes(form.seedType as string) || ['3'].includes(form.seedSource as string)">
+                        <up-form-item borderBottom label="父母本情况" prop="instoreBizInfo.motherFatherFlag" required>
+                            <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>
+                            </template>
+                        </up-form-item>
+                    </template>
+                    <template v-else>
+                        <up-form-item borderBottom label="父母本情况">
+                            <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>
+                            </template>
+                        </up-form-item>
+                    </template>
+                </ut-action-sheet>
+                <template>
+                    <!-- 父本品种 -->
+                    <up-form-item v-if="form?.instoreBizInfo?.motherFatherFlag == '2'" borderBottom label="父本品种" prop="fatherVarietyId">
+                        <view class="flex1">
+                            <up-button v-if="!form.instoreBizInfo.fatherVarietyId" @click="selectFatherVarietyId" type="primary" plain>
+                                <image class="w-36 h-36 mr-10" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/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?.instoreBizInfo?.fatherVarietyInfo?.varietyName }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.fatherVarietyInfo?.latinName }}</span>
+                                </view>
+                                <view class="mb-16">
+                                    <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?.instoreBizInfo?.fatherVarietyInfo?.genusLatinName }}</span>
+                                </view>
+                                <view class="f-s-24 c-#666">产出:{{ form?.instoreBizInfo?.fatherVarietyInfo?.medicineName }}</view>
+                                <view
+                                    class="close-icon pd-16"
+                                    @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="instoreBizInfo.motherVarietyId">
+                        <view class="flex1">
+                            <up-button v-if="!form.instoreBizInfo.motherVarietyId" @click="selectMotherVarietyId" type="primary" plain>
+                                <image class="w-36 h-36 mr-10" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/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?.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?.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?.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>
+                <view class="h-1" id="genCountpppp"></view>
+                <view class="h-1" id="genUnitpppp"></view>
+                <template v-if="['A3', 'A4'].includes(form.seedType as string)">
+                    <up-form-item :label="`${genCountMap[form.seedType as 'A3' | 'A4']}`" required class="form-item-bottom-padding-0">
+                        <view class="d-flex flex1">
+                            <view class="flex1 ov-hd">
+                                <up-form-item prop="instoreBizInfo.genCount" border-bottom class="form-item-top-padding-0">
+                                    <up-input v-model="form.instoreBizInfo.genCount" :placeholder="`请输入${genCountMap[form.seedType as 'A3' | 'A4']}`" border="none" clearable></up-input>
+                                </up-form-item>
+                            </view>
+                            <view class="pd-5"></view>
+                            <view class="min-w-200">
+                                <ut-action-sheet v-model="form.instoreBizInfo.genUnit" :tabs="pt_gen_unit" mode="custom" title="选择单位">
+                                    <up-form-item prop="instoreBizInfo.genUnit" border-bottom class="form-item-top-padding-0">
+                                        <view class="flex1" style="line-height: 24px">
+                                            <view v-if="form.instoreBizInfo.genUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_gen_unit, form.instoreBizInfo.genUnit) }}</view>
+                                            <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                        </view>
+                                        <template #right>
+                                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                        </template>
+                                    </up-form-item>
+                                </ut-action-sheet>
+                            </view>
+                        </view>
+                    </up-form-item>
+                </template>
+                <template v-else>
+                    <up-form-item label="繁衍世代" class="form-item-bottom-padding-0">
+                        <view class="d-flex flex1">
+                            <view class="flex1 ov-hd">
+                                <up-form-item border-bottom class="form-item-top-padding-0">
+                                    <up-input v-model="form.instoreBizInfo.genCount" placeholder="请输入繁衍世代" border="none" clearable></up-input>
+                                </up-form-item>
+                            </view>
+                            <view class="pd-5"></view>
+                            <view class="min-w-200">
+                                <ut-action-sheet v-model="form.instoreBizInfo.genUnit" :tabs="pt_gen_unit" mode="custom" title="选择单位">
+                                    <up-form-item border-bottom class="form-item-top-padding-0">
+                                        <view class="flex1" style="line-height: 24px">
+                                            <view v-if="form.instoreBizInfo.genUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_gen_unit, form.instoreBizInfo.genUnit) }}</view>
+                                            <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                        </view>
+                                        <template #right>
+                                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                        </template>
+                                    </up-form-item>
+                                </ut-action-sheet>
+                            </view>
+                        </view>
+                    </up-form-item>
+                </template>
+
+                <view class="h-1" id="entrustIdpppp"></view>
+                <up-form-item borderBottom label="受托单位" prop="entrustId" required>
+                    <view class="flex1">
+                        <ContactUnitInput v-model="form.entrustId" v-model:info="form.entrustInfo" :params="{ cpyType: '2' }" title="选择受托单位" placeholder="请选择受托单位信息"></ContactUnitInput>
+                    </view>
+                </up-form-item>
+
+                <!-- 入库数量与单位 -->
+                <view class="h-1" id="capacitypppp"></view>
+                <up-form-item label="入库量" prop="capacity" required class="form-item-bottom-padding-0">
+                    <div class="flex1 d-flex">
+                        <div class="flex1 ov-hd">
+                            <up-form-item prop="capacity" border-bottom class="form-item-top-padding-0">
+                                <up-input v-model="form.capacity" placeholder="请输入入库量" border="none" clearable></up-input>
+                            </up-form-item>
+                        </div>
+                        <div class="pd-5"></div>
+                        <div class="min-w-200">
+                            <ut-action-sheet v-model="form.unit" :tabs="pt_seed_unit" mode="custom" title="选择单位">
+                                <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
+                                    <view class="flex1" style="line-height: 24px">
+                                        <view v-if="form.unit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_seed_unit, form.unit) }}</view>
+                                        <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                    </view>
+                                    <template #right>
+                                        <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                    </template>
+                                </up-form-item>
+                            </ut-action-sheet>
+                        </div>
+                    </div>
+                </up-form-item>
+                <!-- 检验报告与供应商信息 -->
+                <up-form-item borderBottom label="检验报告" prop="examinReport">
+                    <ut-upload v-model="form.examinReport" :max-count="50" valueType="array" accept="image,file"></ut-upload>
+                </up-form-item>
+                <template v-if="['2', '3'].includes(form.seedSource as string)">
+                    <up-form-item borderBottom label="供应商" prop="supplierId" required>
+                        <view class="flex1">
+                            <ContactUnitInput v-model="form.supplierId" v-model:info="form.supplierInfo" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
+                        </view>
+                    </up-form-item>
+                    <up-form-item borderBottom label="供应商是否是生产商" prop="supplierProducerFlag">
+                        <up-radio-group v-model="form.supplierProducerFlag">
+                            <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>
+                    <up-form-item borderBottom label="生产商" prop="producer">
+                        <up-input v-model="form.producer" placeholder="请输入生产商名称" border="none" clearable></up-input>
+                    </up-form-item>
+                </template>
+                <!-- 菌种编码信息 -->
+                <up-form-item required v-if="['A4', 'A8'].includes(form.seedType as string)" :label="`${selectDictLabel(pt_seed_type, form.seedType as string)}编号`" class="form-item-bottom-padding-0">
+                    <view class="d-flex flex1">
+                        <view class="flex1">
+                            <ut-action-sheet v-model="form.fungusCodeType" :tabs="pt_fungus_code_type" mode="custom" title="选择单位">
+                                <up-form-item prop="fungusCodeType" border-bottom class="form-item-top-padding-0">
+                                    <view class="flex1" style="line-height: 24px">
+                                        <view v-if="form.fungusCodeType" class="f-s-30 c-333 f-w-5">{{ selectDictLabel(pt_fungus_code_type, form.fungusCodeType) }}</view>
+                                        <view v-else class="f-s-30 c-ccc f-w-4">选择编号类型</view>
+                                    </view>
+                                    <template #right>
+                                        <up-icon class="pr-20" size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                    </template>
+                                </up-form-item>
+                            </ut-action-sheet>
+                        </view>
+                        <view class="pd-5"></view>
+                        <view class="flex1">
+                            <up-form-item prop="fungusCode" border-bottom class="form-item-top-padding-0">
+                                <up-input v-model="form.fungusCode" placeholder="输入数字小数点" border="none" clearable></up-input>
+                            </up-form-item>
+                        </view>
+                    </view>
+                </up-form-item>
+                <!-- 个体标识:此处仅占位,后续可改为多选列表 -->
+                <view class="h-1" id="instoreBizInfo.idFlagpppp"></view>
+                <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">
+                    <view class="h-1" id="instoreBizInfo.animalspppp"></view>
+                    <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="instoreBizInfo.storageMethod">
+                    <up-input v-model="form.instoreBizInfo.storageMethod" placeholder="请输入保藏方法" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 媒体与附件 -->
+                <up-form-item borderBottom label="种源图片" prop="imgs">
+                    <ut-upload v-model="form.imgs" :max-count="9" valueType="string"></ut-upload>
+                </up-form-item>
+                <up-form-item borderBottom label="种源视频" prop="vedios">
+                    <ut-upload v-model="form.vedios" :max-count="3" accept="video" valueType="string"></ut-upload>
+                </up-form-item>
+
+                <!-- 种源产地 -->
+                <PickerAreaInput v-model="form.adcode" v-model:full-name="form.adcodeName" title="选择种源产地">
+                    <up-form-item borderBottom label="种源产地" prop="adcode">
+                        <view v-if="form.adcode" class="f-s-30 c-333 f-w-5 flex1">{{ form.adcodeName }}</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>
+                </PickerAreaInput>
+                <ut-action-sheet :tabs="pt_breeding_materials" mode="custom" title="繁殖材料" multiple v-model="form.generationMaterial">
+                    <up-form-item borderBottom label="繁殖材料" prop="generationMaterial">
+                        <view v-if="form.generationMaterial" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabels(pt_breeding_materials, form.generationMaterial, ',') }}</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>
+
+                <PickerAreaInput v-model="form.generationAdcode" v-model:full-name="form.generationAdcodeName" :maxLevel="4" title="选择繁殖地点/采集地点">
+                    <up-form-item borderBottom label="繁殖地点/采集地点" prop="generationAdcode">
+                        <view v-if="form.generationAdcode" class="f-s-30 c-333 f-w-5 flex1">{{ form.generationAdcodeName }}</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>
+                </PickerAreaInput>
+                <!-- 资质证明附件(暂按上传控件处理,可后续细化) -->
+                <up-form-item borderBottom label="物种鉴定证书" prop="spCert">
+                    <ut-upload v-model="form.spCert" :max-count="9" valueType="array" accept="file"></ut-upload>
+                </up-form-item>
+                <!-- 检疫信息 -->
+                <up-form-item borderBottom label="种源检疫证号" prop="seedCheckSn">
+                    <up-input v-model="form.seedCheckSn" placeholder="请输入种源检疫证号" border="none" clearable></up-input>
+                </up-form-item>
+                <up-form-item borderBottom label="种源检疫证书" prop="seedCheckCert">
+                    <ut-upload v-model="form.seedCheckCert" :max-count="9" valueType="array" accept="file"></ut-upload>
+                </up-form-item>
+            </view>
+
+            <view class="pd-24">
+                <view class="startline-title">入库信息</view>
+            </view>
+            <view class="pd-24 bg-#fff">
+                <!-- 种源级别 -->
+                <up-form-item borderBottom label="种源级别" prop="seedLevel">
+                    <up-input v-model="form.seedLevel" placeholder="请输入种源级别" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 入库类型 -->
+                <up-form-item borderBottom label="入库类型" required prop="instoreType">
+                    <view v-if="form.instoreType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_instore_type, form.instoreType) }}</view>
+                    <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择入库类型</view>
+                </up-form-item>
+                <!-- 入库日期 -->
+                <view class="h-1" id="instoreDatepppp"></view>
+                <ut-datetime-picker v-model="form.instoreBizInfo.instoreDate" :maxDate="new Date()" mode="date">
+                    <up-form-item borderBottom label="入库日期" required prop="instoreBizInfo.instoreDate">
+                        <up-input v-model="form.instoreBizInfo.instoreDate" placeholder="请选择入库日期" border="none" clearable></up-input>
+                        <template #right>
+                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                        </template>
+                    </up-form-item>
+                </ut-datetime-picker>
+                <!-- 入库批号 -->
+                <up-form-item borderBottom label="入库批号" required prop="batchCode">
+                    <up-input v-model="form.batchCode" placeholder="请输入入库批号" border="none" clearable></up-input>
+                    <template #right>
+                        <up-button @click="generateBatchCode" type="primary" :customStyle="formItemBtnStyle">随机生成</up-button>
+                    </template>
+                </up-form-item>
+                <!-- 库房类型 -->
+                <up-form-item borderBottom label="库房类型" prop="storeType" required>
+                    <view v-if="form.storeType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_warehouse_type, form.storeType) }}</view>
+                    <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择库房类型</view>
+                </up-form-item>
+                <!-- 存放库房(具体库房/货架信息稍后补充为选择器) -->
+                <up-form-item borderBottom label="存放库房" prop="storeCode">
+                    <up-input v-model="form.storeCode" placeholder="请输入存放库房或编码" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 入库人 -->
+                <up-form-item borderBottom label="入库人" required prop="instoreBizInfo.instoreMg">
+                    <up-input v-model="form.instoreBizInfo.instoreMg" placeholder="请输入入库人" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 入库备注 -->
+                <up-form-item borderBottom label="入库备注" prop="instoreBizInfo.remark">
+                    <up-textarea v-model="form.instoreBizInfo.remark" placeholder="请输入入库备注" autoHeight></up-textarea>
+                </up-form-item>
+            </view>
+        </up-form>
+        <template #bottom>
+            <view class="pd-20 d-flex">
+                <up-button @click="submitForm" type="primary">保存</up-button>
+            </view>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { seedInfoListType } from '../models/type';
+import AnimalsInput from '../models/animals-input.vue';
+import ContactUnitInput from '@/models/contact-unit-input/contact-unit-input.vue';
+import PickerAreaInput from '@/models/picker-area-input/picker-area-input.vue';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_seed_instore_type, pt_warehouse_type, 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, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(
+    proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', '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', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'),
+);
+const paging = ref<any>(null);
+const upFormRef = ref<any>(null);
+// 单条种源信息 + 入库信息的合并表单
+const form = ref<seedInfoListType | any>({
+    imgs: undefined,
+    vedios: undefined,
+    spCert: [],
+    newSpCert: [],
+    importCert: [],
+    seedCheckCert: [],
+    unit: '',
+    adcode: '',
+    instoreBizInfo: {
+        motherFatherFlag: '',
+        idFlag: '1',
+        genUnit: '',
+        instoreDate: '',
+        instoreMg: '',
+        remark: '',
+    },
+    generationMaterial: '',
+    instoreType: '2',
+    storeType: '2',
+});
+const rules = reactive({
+    // 种源信息校验(来自 info-edit)
+    seedType: [{ required: true, message: '请选择种源类型' }],
+    varietyId: [{ required: true, message: '请选择物种基原' }],
+    seedSource: [{ required: true, message: '请选择种源来源' }],
+    'instoreBizInfo.motherFatherFlag': [{ required: true, message: '请选择父母本情况' }],
+    'instoreBizInfo.genCount': [
+        {
+            asyncValidator: (rule: any, value: any) => {
+                if (['A3', 'A4'].includes(form.value.seedType as string)) {
+                    if (!value) {
+                        return Promise.reject('请输入' + genCountMap[form.value.seedType as 'A3' | 'A4']);
+                    }
+                }
+                return Promise.resolve();
+            },
+        },
+    ],
+    'instoreBizInfo.genUnit': [
+        {
+            asyncValidator: (rule: any, value: any) => {
+                if (['A3', 'A4'].includes(form.value.seedType as string)) {
+                    if (!value) {
+                        return Promise.reject('请选择单位');
+                    }
+                }
+                return Promise.resolve();
+            },
+        },
+    ],
+    entrustId: [{ required: true, message: '请选择受托单位' }],
+    capacity: [{ required: true, message: '请输入入库量' }],
+    unit: [{ required: true, message: '请选择单位' }],
+    supplierId: [{ required: true, message: '请选择供应商' }],
+    fungusCodeType: [{ required: true, message: '请选择编号类型' }],
+    fungusCode: [{ required: true, message: '请输入编号' }],
+    'instoreBizInfo.idFlag': [{ required: true, message: '请选择是否有个体标识' }],
+    'instoreBizInfo.animals': [{ type: 'array', required: true, message: '请输入个体标识号' }],
+    // 入库信息校验(来自 add)
+    instoreType: [{ required: true, message: '请选择入库类型' }],
+    'instoreBizInfo.instoreDate': [{ required: true, message: '请选择入库日期' }],
+    batchCode: [{ required: true, message: '请输入入库批号' }],
+    'instoreBizInfo.instoreMg': [{ required: true, message: '请输入入库人' }],
+});
+// 繁衍世代对象
+const genCountMap = reactive({
+    A4: '累计扩繁代数',
+    A3: '继代培养次数',
+});
+
+// 提交:当前页面改为单条种源信息,直接提交合并后的对象
+const submitForm = async () => {
+    uni.$u.debounce(
+        async () => {
+            try {
+                await upFormRef.value?.validate();
+            } catch (error: any) {
+                const firstErrorField = error && error[0].prop + 'pppp';
+                paging.value?.scrollIntoViewById(firstErrorField, 30, true);
+                return;
+            }
+            uni.showLoading({
+                title: '提交中...',
+            });
+            try {
+                // 这里使用单条入库接口,后端若仍要求 batch,可根据需要包装成数组
+                const res = await useClientRequest.post('/plt-api/app/storageSeed/batchInstore', [form.value]);
+                uni.hideLoading();
+                if (!res || res !== 200) return;
+                uni.showToast({
+                    title: '提交成功',
+                    icon: 'success',
+                });
+                uni.$emit('seed-source-detail-refresh');
+                uni.$emit('refreshStorageRoomList');
+                setTimeout(() => {
+                    uni.navigateBack({
+                        delta: 1,
+                    });
+                }, 1500);
+            } catch (error) {
+                uni.hideLoading();
+            }
+        },
+        500,
+        true,
+    );
+};
+// 点击随机生成服务端生成唯一的批号(与 add 一致)
+const generateBatchCode = async () => {
+    uni.showLoading({
+        title: '生成中...',
+    });
+    const res = await useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', {
+        plType: 'S',
+        linkType: 'I',
+    });
+    if (res && res.code === 200) {
+        uni.hideLoading();
+        form.value.batchCode = res.data;
+        uni.showToast({
+            title: '批号生成成功',
+            icon: 'success',
+        });
+    }
+};
+
+// 选择物种、父母本逻辑保持与 info-edit 一致
+const selectVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.varietyId = data.msg.id;
+        form.value.varietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择物种基原',
+        },
+    });
+};
+const selectFatherVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.instoreBizInfo.fatherVarietyId = data.msg.id;
+        form.value.instoreBizInfo.fatherVarietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择父本品种',
+        },
+    });
+};
+const selectMotherVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.instoreBizInfo.motherVarietyId = data.msg.id;
+        form.value.instoreBizInfo.motherVarietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择母本品种',
+        },
+    });
+};
+const did = ref('');
+// 获取详情(仓库信息)
+const getDetailById = async (id: string) => {
+    if (!id) return;
+    const res = await useClientRequest.get(`/plt-api/app/storageSeed/getById/${id}`);
+    if (res && res.code === 200) {
+        form.value = {
+            ...form.value,
+            ...res.data,
+        };
+    }
+};
+
+// 页面入参解析并加载
+onLoad((options: any) => {
+    did.value = options?.id || '';
+    getDetailById(did.value);
+});
+</script>
+<style lang="scss" scoped>
+.card-info-block {
+    border: 1rpx solid #afddbb;
+    border-radius: 10rpx;
+}
+
+.tag-span {
+    padding: 4rpx 12rpx;
+    font-size: 20rpx;
+    border-radius: 18rpx;
+}
+.close-icon {
+    position: absolute;
+    top: 0;
+    right: 0;
+    z-index: 10;
+}
+</style>

+ 178 - 0
src/plant/storage/agro-product/list/index.vue

@@ -0,0 +1,178 @@
+<template>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query">
+        <template #top>
+            <ut-navbar title="农资库" :fixed="false"></ut-navbar>
+        </template>
+
+        <view class="pd3-24-24-0">
+            <view class="mb-20">
+                <ut-tabs mode="subsection" v-model="form.restFlag" :tabs="tabs" @change="onRefresh"></ut-tabs>
+            </view>
+            <view class="h-86">
+                <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>
+        <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 class="d-flex j-sb a-c li-item-head mb-16">
+                            <view class="li-left-tag" :class="{ [`bg-${selectDictListClass(pt_seed_instore_type, item?.instoreType)}`]: true }">{{ selectDictLabel(pt_seed_instore_type, item?.instoreType) }}</view>
+                            <view class="f-s-22 c-#666">{{ item?.updateTime || item?.createTime }}</view>
+                        </view>
+                        <view class="d-flex flex1 mb-10">
+                            <view class="flex1">
+                                <span class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.variety }}</span>
+                                <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, item?.seedType) }}</span>
+                            </view>
+                            <view>
+                                <view v-if="item?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检验</view>
+                                <view v-else class="tag-span c-danger bg-#F9ECEA">未检验</view>
+                            </view>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">入库批号:</span>
+                            <span class="c-#333 f-w-500">{{ item?.batchCode }}</span>
+                        </view>
+                        <!-- <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">溯源批号:</span>
+                            <span class="c-#333 f-w-500">暂无</span>
+                        </view> -->
+                        <view v-if="['A3', 'A4'].includes(item?.fungusCodeType)" class="pd2-4-0 f-s-28">
+                            <span class="c-#666">菌种/菌株编号:</span>
+                            <span class="c-#333 f-w-500">{{ selectDictLabel(pt_fungus_code_type, item?.fungusCodeType) }}/{{ item?.fungusCode }}</span>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">供应商:</span>
+                            <span class="c-#333 f-w-500">{{ item?.supplier }}</span>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">入库量:</span>
+                            <span class="c-#333 f-w-500">{{ item?.capacity }}{{ item?.unit }}</span>
+                        </view>
+                        <view class="d-flex">
+                            <view v-if="item?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                                <span class="c-#666">出库量:</span>
+                                <span class="c-#333 f-w-500">{{ item?.inputAmount || '0' }}{{ item?.unit }}</span>
+                            </view>
+                            <view v-if="item?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                                <span class="c-danger">剩余量:</span>
+                                <span class="c-danger f-w-500">{{ item?.restAmount || '0' }}{{ item?.unit }}</span>
+                            </view>
+                        </view>
+                    </view>
+                </up-swipe-action-item>
+            </up-swipe-action>
+        </view>
+
+        <template #empty>
+            <view class="d-flex flex-cln a-c" style="margin-top: -200rpx">
+                <ut-empty class="mg-at" color="#ccc" size="28rpx">暂无农资信息,点击下方+号新增吧</ut-empty>
+            </view>
+        </template>
+        <template #bottom>
+            <agro-bottom></agro-bottom>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import AgroBottom from './model/agro-bottom.vue';
+import { selectDictListClass } from '@/utils/ruoyi';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_seed_instore_type, pt_warehouse_type, 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, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', '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', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
+const list = ref<any[]>();
+const form = ref({ keyword: '', restFlag: '1', instoreType: '' });
+const paging = ref();
+const tabs = ref([
+    { label: '有库存', value: '1' },
+    { label: '无库存', value: '0' },
+]);
+
+const changeSeach = () => {
+    paging.value.reload();
+};
+const query = async (pageNum: number, pageSize: number) => {
+    const params = {
+        pageNum,
+        pageSize,
+        ...form.value,
+    };
+    const res = await useClientRequest.get('/plt-api/app/material/list', params);
+    if (res) {
+        const { rows } = res;
+        paging.value.complete(rows);
+    }
+};
+// 暂存项左滑删除配置
+const optionsActionTemp = reactive([
+    {
+        text: '删除',
+        style: {
+            backgroundColor: '#F74C30',
+        },
+    },
+]);
+// 暂存项删除点击(本地移除)
+const clickTempSwipe = async (event: object) => {
+    const { name, index } = event as any;
+    if (index === 0) {
+        try {
+            const res = await uni.showModal({
+                title: '删除提示',
+                content: '确定删除种源信息吗?',
+                confirmColor: '#F74C30',
+            });
+            if (!res.confirm) return;
+            await uni.showLoading({
+                title: '删除中...',
+                mask: true,
+            });
+            await useClientRequest.get(`/plt-api/app/storageSeed/removeById/${name}`);
+            uni.hideLoading();
+            uni.showToast({
+                title: '删除成功',
+                icon: 'success',
+            });
+            paging.value?.reload();
+        } catch (error) {
+            console.error('删除暂存种源信息失败:', error);
+        }
+    }
+};
+
+const onRefresh = () => {
+    paging.value.reload();
+};
+onMounted(() => {
+
+    uni.$on('refreshStorageRoomList', () => {
+        onRefresh();
+    });
+});
+</script>
+<style lang="scss" scoped>
+.search-select-item {
+    height: 86rpx;
+    background-color: #fff;
+    border-radius: 10rpx;
+    box-sizing: border-box;
+    padding: 12rpx;
+}
+.tag-span {
+    padding: 4rpx 12rpx;
+    font-size: 20rpx;
+    border-radius: 18rpx;
+}
+.li-item-head {
+    margin-left: -24rpx;
+    margin-top: -24rpx;
+}
+.li-left-tag {
+    padding: 6rpx 16rpx;
+    color: #fff;
+    border-radius: 16rpx 0 16rpx 0;
+    font-size: 20rpx;
+    font-weight: 500;
+}
+</style>

+ 106 - 0
src/plant/storage/agro-product/list/model/agro-bottom.vue

@@ -0,0 +1,106 @@
+<template>
+    <view class="source-bottom p-rtv">
+        <view class="source-top-view h-49"></view>
+        <view class="source-bottom-view pt-49 text-center bg-#fff pt-60" :style="{ opacity: btnStyle == 'close' ? 0 : 1 }">
+             <view style="opacity: 0;">{{ mapTextBtn[btnStyle] }}</view>
+       
+        </view>
+        <view @click="clickBtnBall" class="source-center-view d-flex flex-cln a-c j-c">
+            <view class="source-btn-ball d-flex a-c j-c" :class="{ [`btn-deg-${btnStyle}`]: true }" :style="{ backgroundImage: 'url(https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/storage/add_c_btn.png)' }"></view>
+            <view class="c-primary f-s-28 pt-6">{{ mapTextBtn[btnStyle] }}</view>
+            
+        </view>
+        <view class="bg-#fff" :style="{ height: safeAreaBottom + 'px' }"></view>
+        <view class="bottom-circle-line" :class="{ 'bottom-circle-line-active': btnStyle == 'close' }" :style="{ bottom: safeAreaBottom + 'px' }">
+            <view class="bottom-circle d-flex" :style="{ backgroundImage: 'url(https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/storage/send_btm_bg_c.png)' }">
+                <view class="flex1 d-flex flex-cln a-c pt-100 pl-30">
+                    <view>
+                        <image class="w-68 h-68" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/storage/xzhwk_icon_sd.png" mode="widthFix" />
+                    </view>
+                    <view class="f-s-28 c-#333">下载货位卡</view>
+                    <view class="f-s-22 c-#999">库存结余清晰</view>
+                </view>
+                <view class="d-flex flex-cln a-c pt-24">
+                   
+                </view>
+                <view class="flex1 d-flex flex-cln a-c pt-100 pr-30" @click="clickBtnBall();$u.route({ url: '/plant/storage/agro-product/add/index' })">
+                     <view>
+                        <image class="w-68 h-68" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/storage/xzfsyrk_icon_sd.png" mode="widthFix" />
+                    </view>
+                    <view class="f-s-28 c-#333">新增农资入库</view>
+                    <view class="f-s-22 c-#999">适合无法溯源的农资</view>
+                </view>
+                </view>
+        </view>
+    </view>
+</template>
+<script setup lang="ts">
+const windowInfo = uni.getWindowInfo();
+const safeAreaBottom = windowInfo.safeAreaInsets.bottom;
+const btnStyle = ref('add')
+const mapTextBtn = ref<any>({
+    add: '新增农资信息',
+    close: '关闭',
+});
+const clickBtnBall = () => {
+    btnStyle.value = btnStyle.value === 'add' ? 'close' : 'add';
+}
+</script>
+
+<style scoped lang="scss">
+.source-center-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    margin: auto;
+    width: 200rpx;
+    z-index: 99;
+    .source-btn-ball {
+        width: 98rpx;
+        height: 98rpx;
+        border-radius: 50%;
+        background-size: contain;
+        background-position: center;
+        background-repeat: no-repeat;
+    }
+}
+.bottom-circle-line {
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    height: 1rpx;
+    opacity: 0;
+    transform: translateY(80rpx);
+    pointer-events: none;
+    transition: opacity 0.3s ease, transform 0.3s ease;
+}
+.bottom-circle-line-active {
+    opacity: 1;
+    transform: translateY(0);
+    pointer-events: auto;
+}
+.source-bottom-view {
+    box-shadow: 0px 0px 6rpx 0px #F1F6F4;
+    transition: all 0.3s ease;
+}
+.bottom-circle {
+    position: absolute;
+    width: 750rpx;
+    height: 750rpx;
+    border-radius: 50%;
+    left: 0;
+    bottom: -375rpx;
+    background-size: contain;
+    background-position: top;
+}
+.btn-deg-add {
+    transform: rotate(0);
+    transition: transform 0.3s ease;
+}
+.btn-deg-close {
+    transform: rotate(135deg);
+    transition: transform 0.3s ease;
+}
+</style>

+ 3 - 0
src/plant/storage/agro-product/loss-register/index.vue

@@ -0,0 +1,3 @@
+<template>
+    <view>损耗登记</view>
+</template>

+ 162 - 0
src/plant/storage/agro-product/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="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/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="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/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>

+ 124 - 0
src/plant/storage/agro-product/models/type.ts

@@ -0,0 +1,124 @@
+/**
+ * 入库信息类
+ */
+export interface SeedSourceAddTypeEnum {
+    // 种信息数组
+    seedInfoList: string[];
+    /** 种源级别 */
+    seedLevel?: string;
+    /** 入库类型 */
+    instoreType: string;
+    /** 入库批号 */
+    batchCode?: string;
+    /** 库房类型 */
+    storeType?: string;
+    /** 库房类型 */
+    storeCode?: string;
+    /** 存放库房 */
+    warehouses?: warehousesType[];
+    /**
+     * 入库业务传输对象
+     */
+    instoreBizInfo: instoreBizInfoType1;
+     [property: string]: any;
+}
+// 种源信息返回体
+export interface seedInfoListType {
+    /** 种源类型 */
+    seedType?: string;
+    /** 物种基原 */
+    varietyId?: string;
+    /** 具体品种/品系名称 */
+    seedName?: string;
+    /** 种源来源 */
+    seedSource?: string;
+    /** 受托单位 */
+    entrustId?: string;
+    /** 入库量 */
+    capacity?: number;
+    /** 计量单位 */
+    unit?: string;
+    /** 检验报告 */
+    examinReport?: AccesseryDTO;
+    /** 供应商 */
+    supplierId?: string;
+    /** 供应商名称 */
+    supplier?: string;
+    /** 生产商名称 */
+    producer?: string;
+    /** 菌种/菌株编号 */
+    fungusCode?: string;
+    /** 菌种编码类型 */
+    fungusCodeType?: string;
+    /** 是否有个体标识 */
+    animalIds?: string[];
+    /** 种源图片 */
+    imgs?: string;
+    /** 种源视频 */
+    vedios?: string;
+    /** 种源产地 */
+    adcode?: string;
+    /** 繁殖材料 */
+    generationMaterial?: string;
+    /** 繁殖地点/采集地点 */
+    generationAdcode?: string;
+    /** 物种鉴定证书 */
+    spCert?: AccesseryDTO[];
+    /** 种源检疫证号 */
+    seedCheckSn?: string;
+     /** 种源检疫证书 */
+    seedCheckCert?: AccesseryDTO[];
+    uid?: string;
+    [property: string]: any;
+    instoreBizInfo: instoreBizInfoType;
+}
+export interface AccesseryDTO {
+    /**
+     * 文件名称
+     */
+    fileName?: string;
+    /**
+     * 文件大小
+     */
+    fileSize?: number;
+    /**
+     * 文件URL
+     */
+    url?: string;
+    [property: string]: any;
+}
+// 存放库房对象
+export interface warehousesType {
+    /** 仓库id */
+    warehouseId?: string;
+    /** 货架id */
+    shelfId?: string;
+}
+/**
+ * 入库业务传输对象
+ */
+export interface instoreBizInfoType {
+   
+    /** 父母本情况 */
+    motherFatherFlag: string;
+    /** 父本品种ID */
+    fatherVarietyId?: string;
+        /** 母本品种ID */
+    motherVarietyId?: string;
+    fatherVarietyInfo?: any;
+    motherVarietyInfo?: any;
+    idFlag: string;
+    animals?: any[];
+    storageMethod?: string;
+    genUnit?: string;
+    [property: string]: any;
+}
+export interface instoreBizInfoType1 {
+ /** 入库日期 */
+    instoreDate?: string;
+    /** 入库人 */
+    instoreMg?: string;
+    /** 备注 */
+    remark?: string;
+    [property: string]: any;
+}

+ 3 - 0
src/plant/storage/agro-product/stock-list/index.vue

@@ -0,0 +1,3 @@
+<template>
+    <view>出入库清单</view>
+</template>

+ 124 - 15
src/plant/storage/seed-source/add/index.vue

@@ -12,8 +12,50 @@
                 <!-- TODO: 后续按 seedInfoList 设计种源信息明细,此处先留空结构避免表单错误 -->
                 <up-form-item borderBottom label="添加种源信息" required prop="seedInfoList">
                     <view class="flex1">
-                        <template v-for="(item, index) in form.seedInfoList" :key="index"></template>
-                        <up-button type="primary" plain @click="$u.route({ url: '/plant/storage/seed-source/info-edit/index' })">
+                        <template v-for="(item, index) in form.seedInfoList" :key="index">
+                            <view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-12">
+                                <view class="d-flex flex1 mb-10">
+                                    <view class="flex1">
+                                        <span class="f-s-34 c-#333 f-w-500 mr-10">{{ uidMapData[item]?.varietyInfo?.varietyName }}</span>
+                                        <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, uidMapData[item]?.seedType) }}</span>
+                                    </view>
+                                    <view class="pr-60">
+                                        <view v-if="uidMapData[item]?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检</view>
+                                        <view v-else class="tag-span c-danger bg-#F9ECEA">未检</view>
+                                    </view>
+                                </view>
+                                <view class="d-flex">
+                                    <view class="flex1 f-s-28 pr-10 pd2-4-0">
+                                        <span class="c-#666">来源:</span>
+                                        <span class="c-#333 f-w-500">{{ selectDictLabel(pt_seed_source, uidMapData[item]?.seedSource) }}</span>
+                                    </view>
+                                    <view class="flex1 f-s-28 pd2-4-0">
+                                        <span class="c-#666">入库量:</span>
+                                        <span class="c-#333 f-w-500">{{ uidMapData[item]?.capacity }}{{ uidMapData[item]?.unit }}</span>
+                                    </view>
+                                </view>
+                                <view class="d-flex">
+                                    <view class="flex1 ov-hd">
+                                        <view class="f-s-28 pr-10 pd2-4-0">
+                                            <span class="c-#666">供应商:</span>
+                                            <span class="c-#333 f-w-500">{{ uidMapData[item]?.supplierInfo?.cusName }}</span>
+                                        </view>
+                                        <view class="f-s-28 pr-10 pd2-4-0">
+                                            <span class="c-#666">受托单位:</span>
+                                            <span class="c-#333 f-w-500">{{ uidMapData[item]?.entrustInfo?.cusName }}</span>
+                                        </view>
+                                    </view>
+                                    <view class="d-flex a-ed" @click="navigateToAddSeedSource(item, 'edit')">
+                                        <view class="pd-10 c-primary f-s-20">去编辑{{ '>' }}</view>
+                                    </view>
+                                </view>
+                                <view class="close-icon pd-16" @click.stop="deleteRow(index, item)">
+                                    <up-icon color="#F81242" name="close" size="32rpx"></up-icon>
+                                </view>
+                            </view>
+                        </template>
+
+                        <up-button type="primary" plain @click="navigateToAddSeedSource('', 'add')">
                             <up-icon class="mr-10" name="plus" color="#37A954"></up-icon>
                             <span>点击添加种源入库</span>
                         </up-button>
@@ -37,7 +79,7 @@
                 <view class="h-1" id="instoreDatepppp"></view>
                 <ut-datetime-picker v-model="form.instoreBizInfo.instoreDate" :maxDate="new Date()" mode="date">
                     <up-form-item borderBottom label="入库日期" required prop="instoreBizInfo.instoreDate">
-                        <up-input v-model="form.instoreBizInfo.instoreDate" placeholder="请选择入库日期" border="none" clearable></up-input>
+                        <up-input v-model="form.instoreBizInfo.instoreDate" readonly placeholder="请选择入库日期" border="none" clearable></up-input>
                         <template #right>
                             <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
                         </template>
@@ -51,7 +93,7 @@
                     </template>
                 </up-form-item>
                 <!-- 库房类型 -->
-                <up-form-item borderBottom label="库房类型" prop="storeType">
+                <up-form-item borderBottom label="库房类型" prop="storeType" required>
                     <view v-if="form.storeType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_warehouse_type, form.storeType) }}</view>
                     <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择库房类型</view>
                 </up-form-item>
@@ -80,8 +122,11 @@
 import { useClientRequest } from '@/utils/request';
 import { SeedSourceAddTypeEnum } from '../models/type';
 import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { generateUniqueId } from '@/utils/public';
+import { parseTime } from '@/utils/ruoyi';
+
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_seed_instore_type, pt_warehouse_type } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type'));
+const { pt_seed_instore_type, pt_warehouse_type, 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, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', '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', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
 // 表单与分页等基础状态(参考 base-edit 风格)
 const paging = ref<any>(null);
 const upFormRef = ref<any>(null);
@@ -92,13 +137,22 @@ const form = ref<SeedSourceAddTypeEnum>({
     seedInfoList: [],
     warehouses: [],
     instoreBizInfo: {
-        motherFatherFlag: '',
-        idFlag: '0',
+       instoreDate: parseTime(new Date(), '{y}-{m}-{d}'),
+       instoreMg: '',
+       remark: '',
     },
 });
-const rules = reactive({});
+const rules = reactive({
+    seedInfoList: [{ required: true, message: '请添加种源信息', type: 'array', min: 1 }],
+    instoreType: [{ required: true, message: '请选择入库类型' }],
+    'instoreBizInfo.instoreDate': [{ required: true, message: '请选择入库日期' }],
+    batchCode: [{ required: true, message: '请输入入库批号' }],
+    'instoreBizInfo.instoreMg': [{ required: true, message: '请输入入库人' }],
+});
 
 const submitForm = async () => {
+    console.log(form.value);
+    
     uni.$u.debounce(
         async () => {
             try {
@@ -113,8 +167,18 @@ const submitForm = async () => {
             uni.showLoading({
                 title: '提交中...',
             });
+            const params = form.value.seedInfoList.map((uid) => {
+                return {
+                    ...uidMapData.value[uid],
+                    ...form.value,
+                    instoreBizInfo: {
+                        ...form.value.instoreBizInfo,
+                        ...uidMapData.value[uid]?.instoreBizInfo,
+                    }
+                };
+            })
             try {
-                const res =  await useClientRequest.post('/plt-api/app/storageSeed/batchInstore', form.value);
+                const res = await useClientRequest.post('/plt-api/app/storageSeed/batchInstore', params);
                 uni.hideLoading();
                 if (!res || res !== 200) return;
                 uni.hideLoading();
@@ -122,17 +186,19 @@ const submitForm = async () => {
                     title: '提交成功',
                     icon: 'success',
                 });
-                uni.$emit('gapBaseInfoUpdated');
+                uni.$emit('refreshStorageRoomList');
                 // 返回上一页
                 setTimeout(() => {
-                    uni.navigateBack();
+                    uni.navigateBack({
+                        delta: 1,
+                    });
                 }, 1500);
             } catch (error) {
                 uni.hideLoading();
             }
         },
         500,
-        true
+        true,
     );
 };
 // 点击随机生成服务端生成唯一的批号
@@ -141,7 +207,7 @@ const generateBatchCode = async () => {
         title: '生成中...',
     });
     const res = await useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', {
-        plType: 'S',
+        plType: 'Z',
         linkType: 'I',
     });
     if (res && res.code === 200) {
@@ -153,6 +219,7 @@ const generateBatchCode = async () => {
         });
     }
 };
+const did = ref('');
 const getDetailById = async (id: string) => {
     if (!id) return;
     const res = await useClientRequest.get(`/plt-api/app/gapCertificationInfo/getInfoById/${id}`);
@@ -162,7 +229,32 @@ const getDetailById = async (id: string) => {
         };
     }
 };
-const did = ref('');
+const uidMapData = ref({} as any);
+// 添加种源入库跳转
+const navigateToAddSeedSource = (uid = '', mode = 'add') => {
+    uni.$on('submitForm', (data: any) => {
+        uidMapData.value[data.uid] = data.form;
+        if (data?.mode == 'add') {
+            form.value.seedInfoList.push(data.uid);
+        }
+        uni.$off('submitForm');
+    });
+    uni.navigateTo({
+        url: '/plant/storage/seed-source/info-edit/index',
+        success(res) {
+            res.eventChannel.emit('optionsParam', {
+                uid: uid || generateUniqueId(),
+                mode: mode,
+                form: uid ? uidMapData.value[uid] : {}
+            });
+        }
+    });
+};
+const deleteRow = (index: number, uid: string) => {
+    form.value.seedInfoList.splice(index, 1);
+    delete uidMapData.value[uid];
+};
+// 编辑时加载详情
 onLoad((optins: any) => {
     if (optins.id) {
         // 编辑加载详
@@ -172,4 +264,21 @@ onLoad((optins: any) => {
     }
 });
 </script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.card-info-block {
+    border: 1rpx solid #afddbb;
+    border-radius: 10rpx;
+}
+
+.tag-span {
+    padding: 4rpx 12rpx;
+    font-size: 20rpx;
+    border-radius: 18rpx;
+}
+.close-icon {
+    position: absolute;
+    top: 0;
+    right: 0;
+    z-index: 10;
+}
+</style>

+ 334 - 2
src/plant/storage/seed-source/detail/index.vue

@@ -1,3 +1,335 @@
 <template>
-    <view>xx</view>
-</template>
+    <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" scroll-with-animation>
+        <template #top>
+            <ut-navbar title="种源详情" :fixed="false" border></ut-navbar>
+        </template>
+
+        <template>
+            <view class="pd-24 d-flex a-c">
+                <view class="flex1 ov-hd">
+                    <view class="startline-title">库存信息</view>
+                </view>
+                <view>
+                    <up-button type="primary" :customStyle="formItemBtnStyle">
+                        <span>查看出入库记录</span>
+                    </up-button>
+                </view>
+            </view>
+            <view class="bg-#fff pd-24">
+                <view class="d-flex j-sb a-c li-item-head mb-16">
+                    <view class="li-left-tag" :class="{ [`bg-${selectDictListClass(pt_seed_instore_type, form?.instoreType)}`]: true }">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) }}</view>
+                    <view class="f-s-22 c-#666">{{ form?.updateTime || form?.createTime }}</view>
+                </view>
+                <view class="mb-10">
+                    <span class="f-s-34 c-#333 f-w-500 mr-10">{{ form?.variety }}</span>
+                    <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, form?.seedType) }}</span>
+                </view>
+                <view class="pd2-4-0 f-s-28">
+                    <span class="c-#666">入库批号:</span>
+                    <span class="c-#333 f-w-500">{{ form?.batchCode }}</span>
+                </view>
+                <!-- <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">溯源批号:</span>
+                            <span class="c-#333 f-w-500">暂无</span>
+                        </view> -->
+                <view v-if="['A3', 'A4'].includes(form?.fungusCodeType)" class="pd2-4-0 f-s-28">
+                    <span class="c-#666">菌种/菌株编号:</span>
+                    <span class="c-#333 f-w-500">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</span>
+                </view>
+                <view class="pd2-4-0 f-s-28">
+                    <span class="c-#666">供应商:</span>
+                    <span class="c-#333 f-w-500">{{ form?.supplier }}</span>
+                </view>
+                <view class="pd2-4-0 f-s-28">
+                    <span class="c-#666">入库量:</span>
+                    <span class="c-#333 f-w-500">{{ form?.capacity }}{{ form?.unit }}</span>
+                </view>
+                <view class="d-flex">
+                    <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                        <span class="c-#666">出库量:</span>
+                        <span class="c-#333 f-w-500">{{ form?.inputAmount || '0' }}{{ form?.unit }}</span>
+                    </view>
+                    <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                        <span class="c-primary">剩余量:</span>
+                        <span class="c-primary f-w-500">{{ form?.restAmount || '0' }}{{ form?.unit }}</span>
+                    </view>
+                </view>
+            </view>
+            <view class="pd-24">
+                <view class="startline-title">种源信息</view>
+            </view>
+            <view class="bg-#fff pd-24">
+                <!-- 种源信息详情 -->
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源类型:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_type, form?.seedType) || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">物种基原:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="mb-10">
+                            <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.varietyName }}</span>
+                            <span class="f-s-24 c-#666">{{ form?.varietyInfo?.latinName }}</span>
+                        </view>
+                        <view>
+                            <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.genusName }}</span>
+                            <span class="f-s-24 c-#666">{{ form?.varietyInfo?.genusLatinName }}</span>
+                        </view>
+                    </view>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">具体品种/品系名称:</span>
+                    <span class="c-#333 f-w-600">{{ form?.seedName || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源来源:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_source, form?.seedSource) || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom" v-if="form?.instoreBizInfo?.motherFatherFlag">
+                    <span class="c-#666">父母本情况:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_mother_father_flag, form?.instoreBizInfo?.motherFatherFlag) || '-' }}</span>
+                </view>
+                <view v-if="form?.instoreBizInfo?.motherFatherFlag == '2' && form?.instoreBizInfo?.fatherVarietyInfo" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">父本品种:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="mb-10">
+                            <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>
+                        </view>
+                        <view>
+                            <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?.instoreBizInfo?.fatherVarietyInfo?.genusLatinName }}</span>
+                        </view>
+                    </view>
+                </view>
+                <view v-if="form?.instoreBizInfo?.motherVarietyInfo" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">母本品种:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="mb-10">
+                            <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>
+                            <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>
+                </view>
+                <template v-if="['A3', 'A4'].includes(form?.seedType as string)">
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">{{ genCountMap[form?.seedType as 'A3' | 'A4'] }}:</span>
+                        <span class="c-#333 f-w-600">
+                            {{ form?.instoreBizInfo?.genCount || '-' }}
+                            <text v-if="form?.instoreBizInfo?.genUnit">{{ selectDictLabel(pt_gen_unit, form?.instoreBizInfo?.genUnit) }}</text>
+                        </span>
+                    </view>
+                </template>
+                <template v-else>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">繁衍世代:</span>
+                        <span class="c-#333 f-w-600">
+                            {{ form?.instoreBizInfo?.genCount || '-' }}
+                            <text v-if="form?.instoreBizInfo?.genUnit">{{ selectDictLabel(pt_gen_unit, form?.instoreBizInfo?.genUnit) }}</text>
+                        </span>
+                    </view>
+                </template>
+                <view v-if="form?.entrustId" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">受托单位:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="f-s-34 c-#333 f-w-500">{{ form?.entrustInfo?.cusName }}</view>
+                        <view class="f-s-24 c-#666">{{ form?.entrustInfo?.cusCode }}</view>
+                    </view>
+                </view>
+                <view v-if="form?.examinReport && form?.examinReport.length" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">检验报告:</view>
+                    <ut-album :urls="form?.examinReport"></ut-album>
+                </view>
+                <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">供应商:</view>
+                    <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                        <view class="f-s-34 c-#333 f-w-500">{{ form?.supplierInfo?.cusName }}</view>
+                        <view class="f-s-24 c-#666">{{ form?.supplierInfo?.cusCode }}</view>
+                    </view>
+                </view>
+                <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">供应商是否是生产商:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.supplierProducerFlag) || '-' }}</span>
+                </view>
+                <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">生产商:</span>
+                    <span class="c-#333 f-w-600">{{ form?.producer || '-' }}</span>
+                </view>
+                <view v-if="['A4', 'A8'].includes(form?.seedType as string)" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">{{ selectDictLabel(pt_seed_type, form?.seedType as string) }}编号:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom" v-if="form?.instoreBizInfo?.idFlag">
+                    <span class="c-#666">是否有个体标识:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.instoreBizInfo?.idFlag) || '-' }}</span>
+                </view>
+                <view v-if="form?.instoreBizInfo?.animals && form?.instoreBizInfo?.animals.length" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">个体标识号:</view>
+                    <template v-for="(animal, index) in form?.instoreBizInfo?.animals" :key="index">
+                        <view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-10 f-s-28 c-#333 f-w-500">
+                            {{ animal.animalId }}
+                        </view>
+                    </template>
+                </view>
+                <view v-if="form?.instoreBizInfo?.storageMethod" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">保藏方法:</span>
+                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.storageMethod || '-' }}</span>
+                </view>
+                <view v-if="form?.imgs" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">种源图片:</view>
+                    <ut-album :urls="form?.imgs"></ut-album>
+                </view>
+                <view v-if="form?.vedios" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">种源视频:</view>
+                    <ut-album :urls="form?.vedios"></ut-album>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源产地:</span>
+                    <span class="c-#333 f-w-600">{{ form?.adcodeName || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">繁殖材料:</span>
+                    <span class="c-#333 f-w-600">{{ form?.generationMaterial ? selectDictLabels(pt_breeding_materials, form?.generationMaterial, ',') : '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">繁殖地点/采集地点:</span>
+                    <span class="c-#333 f-w-600">{{ form?.generationAdcodeName || '-' }}</span>
+                </view>
+                <view v-if="form?.spCert && form?.spCert.length" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">物种鉴定证书:</view>
+                    <ut-album :urls="form?.spCert"></ut-album>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源检疫证号:</span>
+                    <span class="c-#333 f-w-600">{{ form?.seedCheckSn || '-' }}</span>
+                </view>
+                <view v-if="form?.seedCheckCert && form?.seedCheckCert.length" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view class="c-#666 mb-10">种源检疫证书:</view>
+                    <ut-album :urls="form?.seedCheckCert"></ut-album>
+                </view>
+            </view>
+            <view class="pd-24">
+                <view class="startline-title">入库信息</view>
+            </view>
+            <view class="bg-#fff pd-24">
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源级别:</span>
+                    <span class="c-#333 f-w-600">{{ form?.seedLevel || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库类型:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库日期:</span>
+                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreDate || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库批号:</span>
+                    <span class="c-#333 f-w-600">{{ form?.batchCode || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">库房类型:</span>
+                    <span class="c-#333 f-w-600">种源库</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">存放库房:</span>
+                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_warehouse_type, form?.warehouseType) || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库人:</span>
+                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreMg || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">入库备注:</span>
+                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.remark || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">最后修改人:</span>
+                    <span class="c-#333 f-w-600">{{ form?.operatorName || form?.updateByName || form?.createByName || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">最后修改时间:</span>
+                    <span class="c-#333 f-w-600">{{ form?.operateTime || form?.updateTime || form?.createTime || '-' }}</span>
+                </view>
+            </view>
+        </template>
+        <template #bottom>
+            <view class="pd-24 d-flex a-c">
+                <up-button type="primary" @click="clickEdit">修改</up-button>
+            </view>
+        </template>
+    </z-paging>
+</template>
+
+<script setup lang="ts">
+import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { useClientRequest } from '@/utils/request';
+import { selectDictListClass } from '@/utils/ruoyi';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+const { pt_seed_instore_type, pt_warehouse_type, 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, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', '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', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
+const paging = ref<any>(null);
+const form = ref<any>({});
+const did = ref('');
+
+// 繁衍世代显示文案
+const genCountMap = reactive({
+    A4: '累计扩繁代数',
+    A3: '继代培养次数',
+});
+
+// 获取详情(仓库信息)
+const getDetailById = async (id: string) => {
+    if (!id) return;
+    const res = await useClientRequest.get(`/plt-api/app/storageSeed/getById/${id}`);
+    if (res && res.code === 200) {
+        form.value = res.data || {};
+    }
+};
+
+const onRefresh = () => {
+    getDetailById(did.value);
+    paging.value?.complete();
+};
+const clickEdit = () => {
+    uni.$on('seed-source-detail-refresh', () => {
+        getDetailById(did.value);
+        uni.$off('seed-source-detail-refresh');
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/plant/storage/seed-source/info-update/index',
+        params: {
+            id: did.value,
+        },
+    });
+};
+// 页面入参解析并加载
+onLoad((options: any) => {
+    did.value = options?.id || '';
+    getDetailById(did.value);
+});
+</script>
+
+<style lang="scss" scoped>
+.card-info-block {
+    border: 1rpx solid #afddbb;
+    border-radius: 10rpx;
+}
+.li-item-head {
+    margin-left: -24rpx;
+    margin-top: -24rpx;
+}
+.li-left-tag {
+    padding: 6rpx 16rpx;
+    color: #fff;
+    border-radius: 0 0 16rpx 0;
+    font-size: 20rpx;
+    font-weight: 500;
+}
+</style>

+ 192 - 72
src/plant/storage/seed-source/info-edit/index.vue

@@ -1,20 +1,22 @@
 <template>
     <z-paging class="" ref="paging" bgColor="#fff" paging-class="paging-btm-shadow" safe-area-inset-bottom scroll-with-animation>
         <template #top>
-            <ut-navbar :title="did ? '编辑种源入库信息' : '添加种源入库信息'" :fixed="false" border></ut-navbar>
+            <ut-navbar :title="optionsParam?.mode == 'edit' ? '编辑种源入库信息' : '添加种源入库信息'" :fixed="false" border></ut-navbar>
         </template>
         <view class="pd-24">
             <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
                 <!-- 基本信息 -->
+                <view class="h-1" id="seedTypepppp"></view>
                 <ut-action-sheet :tabs="pt_seed_type" mode="custom" title="种源类型" v-model="form.seedType">
                     <up-form-item borderBottom label="种源类型" required prop="seedType">
                         <view v-if="form.seedType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_type, form.seedType) }}</view>
-                        <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择基地类型</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>
+                <view class="h-1" id="varietyIdpppp"></view>
                 <up-form-item borderBottom label="物种基原" required prop="varietyId">
                     <view class="flex1">
                         <up-button v-if="!form.varietyId" @click="selectVarietyId" type="primary" plain>
@@ -46,6 +48,7 @@
                 <up-form-item borderBottom label="具体品种/品系名称" prop="seedName">
                     <up-input v-model="form.seedName" placeholder="请输入具体品种/品系名称" border="none" clearable></up-input>
                 </up-form-item>
+                <view class="h-1" id="seedSourcepppp"></view>
                 <ut-action-sheet :tabs="pt_seed_source" mode="custom" title="种源来源" v-model="form.seedSource">
                     <up-form-item borderBottom label="种源来源" required prop="seedSource">
                         <view v-if="form.seedSource" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_source, form.seedSource) }}</view>
@@ -55,14 +58,26 @@
                         </template>
                     </up-form-item>
                 </ut-action-sheet>
+                <view class="h-1" id="motherFatherFlagpppp"></view>
                 <ut-action-sheet :tabs="pt_mother_father_flag" mode="custom" title="父母本情况" 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>
-                        </template>
-                    </up-form-item>
+                    <template v-if="['A3', 'A4'].includes(form.seedType as string) || ['3'].includes(form.seedSource as string)">
+                        <up-form-item borderBottom label="父母本情况" prop="instoreBizInfo.motherFatherFlag" required>
+                            <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>
+                            </template>
+                        </up-form-item>
+                    </template>
+                    <template v-else>
+                        <up-form-item borderBottom label="父母本情况">
+                            <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>
+                            </template>
+                        </up-form-item>
+                    </template>
                 </ut-action-sheet>
                 <template>
                     <!-- 父本品种 -->
@@ -124,20 +139,60 @@
                         </view>
                     </up-form-item>
                 </template>
-                <up-form-item label="繁衍世代" prop="instoreBizInfo.genCount" border-bottom>
-                    <up-input v-model="form.instoreBizInfo.genCount" border="none" placeholder="请输入繁衍世代" clearable />
-                    <template #right>
-                        <view @click.stop>
-                            <ut-action-sheet v-model="form.genUnit" :tabs="pt_gen_unit" mode="custom" title="选择单位">
-                                <!-- 可点击选择单位 -->
-                                <view class="d-flex pd-10" style="">
-                                    <span>{{ form.genUnit || '代' }}</span>
-                                    <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
-                                </view>
-                            </ut-action-sheet>
+                <view class="h-1" id="genCountpppp"></view>
+                <view class="h-1" id="genUnitpppp"></view>
+                <template v-if="['A3', 'A4'].includes(form.seedType as string)">
+                    <up-form-item :label="`${genCountMap[form.seedType as 'A3' | 'A4']}`" required class="form-item-bottom-padding-0">
+                        <view class="d-flex flex1">
+                            <view class="flex1 ov-hd">
+                                <up-form-item prop="instoreBizInfo.genCount" border-bottom class="form-item-top-padding-0">
+                                    <up-input v-model="form.instoreBizInfo.genCount" :placeholder="`请输入${genCountMap[form.seedType as 'A3' | 'A4']}`" border="none" clearable></up-input>
+                                </up-form-item>
+                            </view>
+                            <view class="pd-5"></view>
+                            <view class="min-w-200">
+                                <ut-action-sheet v-model="form.instoreBizInfo.genUnit" :tabs="pt_gen_unit" mode="custom" title="选择单位">
+                                    <up-form-item prop="instoreBizInfo.genUnit" border-bottom class="form-item-top-padding-0">
+                                        <view class="flex1" style="line-height: 24px">
+                                            <view v-if="form.instoreBizInfo.genUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_gen_unit, form.instoreBizInfo.genUnit) }}</view>
+                                            <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                        </view>
+                                        <template #right>
+                                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                        </template>
+                                    </up-form-item>
+                                </ut-action-sheet>
+                            </view>
                         </view>
-                    </template>
-                </up-form-item>
+                    </up-form-item>
+                </template>
+                <template v-else>
+                    <up-form-item label="繁衍世代" class="form-item-bottom-padding-0">
+                        <view class="d-flex flex1">
+                            <view class="flex1 ov-hd">
+                                <up-form-item border-bottom class="form-item-top-padding-0">
+                                    <up-input v-model="form.instoreBizInfo.genCount" placeholder="请输入繁衍世代" border="none" clearable></up-input>
+                                </up-form-item>
+                            </view>
+                            <view class="pd-5"></view>
+                            <view class="min-w-200">
+                                <ut-action-sheet v-model="form.instoreBizInfo.genUnit" :tabs="pt_gen_unit" mode="custom" title="选择单位">
+                                    <up-form-item border-bottom class="form-item-top-padding-0">
+                                        <view class="flex1" style="line-height: 24px">
+                                            <view v-if="form.instoreBizInfo.genUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_gen_unit, form.instoreBizInfo.genUnit) }}</view>
+                                            <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                        </view>
+                                        <template #right>
+                                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                        </template>
+                                    </up-form-item>
+                                </ut-action-sheet>
+                            </view>
+                        </view>
+                    </up-form-item>
+                </template>
+
+                <view class="h-1" id="entrustIdpppp"></view>
                 <up-form-item borderBottom label="受托单位" prop="entrustId" required>
                     <view class="flex1">
                         <ContactUnitInput v-model="form.entrustId" v-model:info="form.entrustInfo" :params="{ cpyType: '2' }" title="选择受托单位" placeholder="请选择受托单位信息"></ContactUnitInput>
@@ -145,36 +200,56 @@
                 </up-form-item>
 
                 <!-- 入库数量与单位 -->
-                <up-form-item label="入库量" prop="capacity" required borderBottom>
-                    <up-input v-model="form.capacity" placeholder="请输入入库量" border="none" clearable />
-                    <template #right>
-                        <view @click.stop>
+                <view class="h-1" id="capacitypppp"></view>
+                <up-form-item label="入库量" prop="capacity" required class="form-item-bottom-padding-0">
+                    <div class="flex1 d-flex">
+                        <div class="flex1 ov-hd">
+                            <up-form-item prop="capacity" border-bottom class="form-item-top-padding-0">
+                                <up-input v-model="form.capacity" placeholder="请输入入库量" border="none" clearable></up-input>
+                            </up-form-item>
+                        </div>
+                        <div class="pd-5"></div>
+                        <div class="min-w-200">
                             <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>
-                                    <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
-                                </view>
+                                <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
+                                    <view class="flex1" style="line-height: 24px">
+                                        <view v-if="form.unit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_seed_unit, form.unit) }}</view>
+                                        <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                    </view>
+                                    <template #right>
+                                        <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                    </template>
+                                </up-form-item>
                             </ut-action-sheet>
-                        </view>
-                    </template>
+                        </div>
+                    </div>
                 </up-form-item>
                 <!-- 检验报告与供应商信息 -->
                 <up-form-item borderBottom label="检验报告" prop="examinReport">
-                    <ut-upload v-model="form.seedCheckCert" :max-count="50" valueType="array" accept="image,file"></ut-upload>
-                </up-form-item>
-                <up-form-item borderBottom label="供应商" prop="supplierId">
-                    <view class="flex1">
-                        <ContactUnitInput v-model="form.supplierId" v-model:info="form.supplierInfo" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
-                    </view>
+                    <ut-upload v-model="form.examinReport" :max-count="50" valueType="array" accept="image,file"></ut-upload>
                 </up-form-item>
+                <template v-if="['2', '3'].includes(form.seedSource as string)">
+                    <up-form-item borderBottom label="供应商" prop="supplierId" required>
+                        <view class="flex1">
+                            <ContactUnitInput v-model="form.supplierId" v-model:info="form.supplierInfo" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
+                        </view>
+                    </up-form-item>
+                    <up-form-item borderBottom label="供应商是否是生产商" prop="supplierProducerFlag">
+                        <up-radio-group v-model="form.supplierProducerFlag">
+                            <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>
+                    <up-form-item borderBottom label="生产商" prop="producer">
+                        <up-input v-model="form.producer" placeholder="请输入生产商名称" border="none" clearable></up-input>
+                    </up-form-item>
+                </template>
                 <!-- 菌种编码信息 -->
-                <up-form-item label="菌种/菌株编号" class="form-item-bottom-padding-0">
+                <up-form-item required v-if="['A4', 'A8'].includes(form.seedType as string)" :label="`${selectDictLabel(pt_seed_type, form.seedType as string)}编号`" class="form-item-bottom-padding-0">
                     <view class="d-flex flex1">
                         <view class="flex1">
                             <ut-action-sheet v-model="form.fungusCodeType" :tabs="pt_fungus_code_type" mode="custom" title="选择单位">
                                 <up-form-item prop="fungusCodeType" border-bottom class="form-item-top-padding-0">
-                                    <view class="flex1" style="line-height: 24px;">
+                                    <view class="flex1" style="line-height: 24px">
                                         <view v-if="form.fungusCodeType" class="f-s-30 c-333 f-w-5">{{ selectDictLabel(pt_fungus_code_type, form.fungusCodeType) }}</view>
                                         <view v-else class="f-s-30 c-ccc f-w-4">选择编号类型</view>
                                     </view>
@@ -192,16 +267,8 @@
                         </view>
                     </view>
                 </up-form-item>
-                <up-form-item borderBottom label="供应商是否是生产商" prop="supplierProducerFlag">
-                    <up-radio-group v-model="form.supplierProducerFlag">
-                        <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>
-                <up-form-item borderBottom label="生产商" prop="producer">
-                    <up-input v-model="form.producer" placeholder="请输入生产商名称" border="none" clearable></up-input>
-                </up-form-item>
-
                 <!-- 个体标识:此处仅占位,后续可改为多选列表 -->
+                <view class="h-1" id="instoreBizInfo.idFlagpppp"></view>
                 <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>
@@ -209,6 +276,7 @@
                 </up-form-item>
                 <!-- 个体标识:此处仅占位,后续可改为多选列表 -->
                 <template v-if="+form?.instoreBizInfo?.idFlag">
+                    <view class="h-1" id="instoreBizInfo.animalspppp"></view>
                     <up-form-item borderBottom label="个体标识号" prop="instoreBizInfo.animals" required>
                         <AnimalsInput v-model="form.instoreBizInfo.animals"></AnimalsInput>
                     </up-form-item>
@@ -219,10 +287,10 @@
                 </up-form-item>
                 <!-- 媒体与附件 -->
                 <up-form-item borderBottom label="种源图片" prop="imgs">
-                    <ut-upload v-model="form.imgs" :max-count="9"></ut-upload>
+                    <ut-upload v-model="form.imgs" :max-count="9" valueType="string"></ut-upload>
                 </up-form-item>
                 <up-form-item borderBottom label="种源视频" prop="vedios">
-                    <ut-upload v-model="form.vedios" :max-count="3" accept="video" valueType="array"></ut-upload>
+                    <ut-upload v-model="form.vedios" :max-count="3" accept="video" valueType="string"></ut-upload>
                 </up-form-item>
 
                 <!-- 种源产地 -->
@@ -287,22 +355,64 @@ const paging = ref<any>(null);
 const selectContactUnitShow = ref(false);
 const upFormRef = ref<any>(null);
 const form = ref<seedInfoListType>({
-    imgs: [],
+    imgs: undefined,
+    vedios: undefined,
     spCert: [],
     newSpCert: [],
     importCert: [],
     seedCheckCert: [],
-    unit: '',
+    unit: '',
     adcode: '',
     instoreBizInfo: {
         motherFatherFlag: '',
         idFlag: '1',
-        genUnit: '',
+        genUnit: '',
     },
     generationMaterial: '',
 });
-const rules = reactive({});
-
+const rules = reactive({
+    seedType: [{ required: true, message: '请选择种源类型' }],
+    varietyId: [{ required: true, message: '请选择物种基原' }],
+    seedSource: [{ required: true, message: '请选择种源来源' }],
+    'instoreBizInfo.motherFatherFlag': [{ required: true, message: '请选择父母本情况' }],
+    'instoreBizInfo.genCount': [
+        {
+            asyncValidator: (rule: any, value: any) => {
+                if (['A3', 'A4'].includes(form.value.seedType as string)) {
+                    if (!value) {
+                        return Promise.reject('请输入' + genCountMap[form.value.seedType as 'A3' | 'A4']);
+                    }
+                }
+                return Promise.resolve();
+            },
+        },
+    ],
+    'instoreBizInfo.genUnit': [
+        {
+            asyncValidator: (rule: any, value: any) => {
+                if (['A3', 'A4'].includes(form.value.seedType as string)) {
+                    if (!value) {
+                        return Promise.reject('请选择单位');
+                    }
+                }
+                return Promise.resolve();
+            },
+        },
+    ],
+    entrustId: [{ required: true, message: '请选择受托单位' }],
+    capacity: [{ required: true, message: '请输入入库量' }],
+    unit: [{ required: true, message: '请选择单位' }],
+    supplierId: [{ required: true, message: '请选择供应商' }],
+    fungusCodeType: [{ required: true, message: '请选择编号类型' }],
+    fungusCode: [{ required: true, message: '请输入编号' }],
+    'instoreBizInfo.idFlag': [{ required: true, message: '请选择是否有个体标识' }],
+    'instoreBizInfo.animals': [{ type: 'array', required: true, message: '请输入个体标识号' }],
+});
+// 繁衍世代对象
+const genCountMap = reactive({
+    A4: '累计扩繁代数',
+    A3: '继代培养次数',
+});
 const submitForm = async () => {
     console.log(form.value);
     uni.$u.debounce(
@@ -316,8 +426,12 @@ const submitForm = async () => {
                 return;
             }
             // 提交表单
-            uni.showLoading({
-                title: '提交中...',
+            uni.$emit('submitForm', {
+                ...optionsParam.value,
+                form: { ...form.value, uid: optionsParam.value?.uid || '' },
+            });
+            uni.navigateBack({
+                delta: 1,
             });
             try {
             } catch (error) {
@@ -331,8 +445,6 @@ const submitForm = async () => {
 // 去选择物种基原
 const selectVarietyId = () => {
     uni.$once('updateBiologicalname', function (data) {
-        console.log(data);
-
         form.value.varietyId = data.msg.id;
         form.value.varietyInfo = data.msg;
     });
@@ -370,13 +482,21 @@ const selectMotherVarietyId = () => {
         },
     });
 };
-const did = ref('');
-onLoad((optins: any) => {
-    if (optins.id) {
-        // 编辑加载详情
-        did.value = optins.id;
-    } else {
-    }
+const optionsParam = ref({} as any);
+onLoad((options: any) => {
+    const instance: any = getCurrentInstance()?.proxy;
+    const eventChannel = instance?.getOpenerEventChannel();
+    eventChannel.on('optionsParam', (data: any) => {
+        console.log(data);
+        optionsParam.value = {
+            uid: data?.uid || '',
+            mode: data?.mode || 'add',
+        };
+        form.value = {
+            ...form.value,
+            ...data?.form,
+        };
+    });
 });
 </script>
 <style lang="scss" scoped>
@@ -391,13 +511,13 @@ onLoad((optins: any) => {
     right: 0rpx;
 }
 :deep(.form-item-top-padding-0) {
-   >.u-form-item__body {
+    > .u-form-item__body {
         padding-top: 0rpx;
-   }
+    }
 }
 :deep(.form-item-bottom-padding-0) {
-   >.u-form-item__body {
+    > .u-form-item__body {
         padding-bottom: 0rpx;
-   }
+    }
 }
 </style>

+ 617 - 0
src/plant/storage/seed-source/info-update/index.vue

@@ -0,0 +1,617 @@
+<template>
+    <z-paging class="" ref="paging" bgColor="#f7f7f7" paging-class="paging-btm-shadow" safe-area-inset-bottom scroll-with-animation>
+        <template #top>
+            <ut-navbar :title="did ? '编辑种源入库' : '新增种源入库'" :fixed="false" border></ut-navbar>
+        </template>
+        <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
+            <!-- 种源信息(复制自 info-edit 字段与顺序) -->
+            <view class="pd-24">
+                <view class="startline-title">种源信息</view>
+            </view>
+            <view class="pd-24 bg-#fff">
+                <!-- 基本信息 -->
+                <view class="h-1" id="seedTypepppp"></view>
+                <ut-action-sheet :tabs="pt_seed_type" mode="custom" title="种源类型" v-model="form.seedType">
+                    <up-form-item borderBottom label="种源类型" required prop="seedType">
+                        <view v-if="form.seedType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_type, form.seedType) }}</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>
+                <view class="h-1" id="varietyIdpppp"></view>
+                <up-form-item borderBottom label="物种基原" required prop="varietyId">
+                    <view class="flex1">
+                        <up-button v-if="!form.varietyId" @click="selectVarietyId" type="primary" plain>
+                            <image class="w-36 h-36 mr-10" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/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?.varietyInfo?.varietyName }}</span>
+                                <span class="f-s-24 c-#666">{{ form?.varietyInfo?.latinName }}</span>
+                            </view>
+                            <view class="mb-16">
+                                <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.genusName }}</span>
+                                <span class="f-s-24 c-#666">{{ form?.varietyInfo?.genusLatinName }}</span>
+                            </view>
+                            <view v-if="form?.varietyInfo?.medicineName" class="f-s-24 c-#666">产出:{{ form?.varietyInfo?.medicineName }}</view>
+                            <view
+                                class="close-icon pd-16"
+                                @click="
+                                    form.varietyId = '';
+                                    form.varietyInfo = null;
+                                "
+                            >
+                                <up-icon color="#F81242" name="close" size="32rpx"></up-icon>
+                            </view>
+                        </view>
+                    </view>
+                </up-form-item>
+                <up-form-item borderBottom label="具体品种/品系名称" prop="seedName">
+                    <up-input v-model="form.seedName" placeholder="请输入具体品种/品系名称" border="none" clearable></up-input>
+                </up-form-item>
+                <view class="h-1" id="seedSourcepppp"></view>
+                <ut-action-sheet :tabs="pt_seed_source" mode="custom" title="种源来源" v-model="form.seedSource">
+                    <up-form-item borderBottom label="种源来源" required prop="seedSource">
+                        <view v-if="form.seedSource" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_source, form.seedSource) }}</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>
+                <view class="h-1" id="motherFatherFlagpppp"></view>
+                <ut-action-sheet :tabs="pt_mother_father_flag" mode="custom" title="父母本情况" v-model="form.instoreBizInfo.motherFatherFlag">
+                    <template v-if="['A3', 'A4'].includes(form.seedType as string) || ['3'].includes(form.seedSource as string)">
+                        <up-form-item borderBottom label="父母本情况" prop="instoreBizInfo.motherFatherFlag" required>
+                            <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>
+                            </template>
+                        </up-form-item>
+                    </template>
+                    <template v-else>
+                        <up-form-item borderBottom label="父母本情况">
+                            <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>
+                            </template>
+                        </up-form-item>
+                    </template>
+                </ut-action-sheet>
+                <template>
+                    <!-- 父本品种 -->
+                    <up-form-item v-if="form?.instoreBizInfo?.motherFatherFlag == '2'" borderBottom label="父本品种" prop="fatherVarietyId">
+                        <view class="flex1">
+                            <up-button v-if="!form.instoreBizInfo.fatherVarietyId" @click="selectFatherVarietyId" type="primary" plain>
+                                <image class="w-36 h-36 mr-10" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/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?.instoreBizInfo?.fatherVarietyInfo?.varietyName }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.fatherVarietyInfo?.latinName }}</span>
+                                </view>
+                                <view class="mb-16">
+                                    <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?.instoreBizInfo?.fatherVarietyInfo?.genusLatinName }}</span>
+                                </view>
+                                <view v-if="form?.varietyInfo?.medicineName" class="f-s-24 c-#666">产出:{{ form?.instoreBizInfo?.fatherVarietyInfo?.medicineName }}</view>
+                                <view
+                                    class="close-icon pd-16"
+                                    @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="instoreBizInfo.motherVarietyId">
+                        <view class="flex1">
+                            <up-button v-if="!form.instoreBizInfo.motherVarietyId" @click="selectMotherVarietyId" type="primary" plain>
+                                <image class="w-36 h-36 mr-10" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/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?.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?.instoreBizInfo?.motherVarietyInfo?.genusName }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.motherVarietyInfo?.genusLatinName }}</span>
+                                </view>
+                                <view v-if="form?.varietyInfo?.medicineName" 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>
+                <view class="h-1" id="genCountpppp"></view>
+                <view class="h-1" id="genUnitpppp"></view>
+                <template v-if="['A3', 'A4'].includes(form.seedType as string)">
+                    <up-form-item :label="`${genCountMap[form.seedType as 'A3' | 'A4']}`" required class="form-item-bottom-padding-0">
+                        <view class="d-flex flex1">
+                            <view class="flex1 ov-hd">
+                                <up-form-item prop="instoreBizInfo.genCount" border-bottom class="form-item-top-padding-0">
+                                    <up-input v-model="form.instoreBizInfo.genCount" :placeholder="`请输入${genCountMap[form.seedType as 'A3' | 'A4']}`" border="none" clearable></up-input>
+                                </up-form-item>
+                            </view>
+                            <view class="pd-5"></view>
+                            <view class="min-w-200">
+                                <ut-action-sheet v-model="form.instoreBizInfo.genUnit" :tabs="pt_gen_unit" mode="custom" title="选择单位">
+                                    <up-form-item prop="instoreBizInfo.genUnit" border-bottom class="form-item-top-padding-0">
+                                        <view class="flex1" style="line-height: 24px">
+                                            <view v-if="form.instoreBizInfo.genUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_gen_unit, form.instoreBizInfo.genUnit) }}</view>
+                                            <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                        </view>
+                                        <template #right>
+                                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                        </template>
+                                    </up-form-item>
+                                </ut-action-sheet>
+                            </view>
+                        </view>
+                    </up-form-item>
+                </template>
+                <template v-else>
+                    <up-form-item label="繁衍世代" class="form-item-bottom-padding-0">
+                        <view class="d-flex flex1">
+                            <view class="flex1 ov-hd">
+                                <up-form-item border-bottom class="form-item-top-padding-0">
+                                    <up-input v-model="form.instoreBizInfo.genCount" placeholder="请输入繁衍世代" border="none" clearable></up-input>
+                                </up-form-item>
+                            </view>
+                            <view class="pd-5"></view>
+                            <view class="min-w-200">
+                                <ut-action-sheet v-model="form.instoreBizInfo.genUnit" :tabs="pt_gen_unit" mode="custom" title="选择单位">
+                                    <up-form-item border-bottom class="form-item-top-padding-0">
+                                        <view class="flex1" style="line-height: 24px">
+                                            <view v-if="form.instoreBizInfo.genUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_gen_unit, form.instoreBizInfo.genUnit) }}</view>
+                                            <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                        </view>
+                                        <template #right>
+                                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                        </template>
+                                    </up-form-item>
+                                </ut-action-sheet>
+                            </view>
+                        </view>
+                    </up-form-item>
+                </template>
+
+                <view class="h-1" id="entrustIdpppp"></view>
+                <up-form-item borderBottom label="受托单位" prop="entrustId" required>
+                    <view class="flex1">
+                        <ContactUnitInput v-model="form.entrustId" v-model:info="form.entrustInfo" :params="{ cpyType: '2' }" title="选择受托单位" placeholder="请选择受托单位信息"></ContactUnitInput>
+                    </view>
+                </up-form-item>
+
+                <!-- 入库数量与单位 -->
+                <view class="h-1" id="capacitypppp"></view>
+                <up-form-item label="入库量" prop="capacity" required class="form-item-bottom-padding-0">
+                    <div class="flex1 d-flex">
+                        <div class="flex1 ov-hd">
+                            <up-form-item prop="capacity" border-bottom class="form-item-top-padding-0">
+                                <up-input v-model="form.capacity" placeholder="请输入入库量" border="none" clearable></up-input>
+                            </up-form-item>
+                        </div>
+                        <div class="pd-5"></div>
+                        <div class="min-w-200">
+                            <ut-action-sheet v-model="form.unit" :tabs="pt_seed_unit" mode="custom" title="选择单位">
+                                <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
+                                    <view class="flex1" style="line-height: 24px">
+                                        <view v-if="form.unit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_seed_unit, form.unit) }}</view>
+                                        <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                    </view>
+                                    <template #right>
+                                        <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                    </template>
+                                </up-form-item>
+                            </ut-action-sheet>
+                        </div>
+                    </div>
+                </up-form-item>
+                <!-- 检验报告与供应商信息 -->
+                <up-form-item borderBottom label="检验报告" prop="examinReport">
+                    <ut-upload v-model="form.examinReport" :max-count="50" valueType="array" accept="image,file"></ut-upload>
+                </up-form-item>
+                <template v-if="['2', '3'].includes(form.seedSource as string)">
+                    <up-form-item borderBottom label="供应商" prop="supplierId" required>
+                        <view class="flex1">
+                            <ContactUnitInput v-model="form.supplierId" v-model:info="form.supplierInfo" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
+                        </view>
+                    </up-form-item>
+                    <up-form-item borderBottom label="供应商是否是生产商" prop="supplierProducerFlag">
+                        <up-radio-group v-model="form.supplierProducerFlag">
+                            <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>
+                    <up-form-item borderBottom label="生产商" prop="producer">
+                        <up-input v-model="form.producer" placeholder="请输入生产商名称" border="none" clearable></up-input>
+                    </up-form-item>
+                </template>
+                <!-- 菌种编码信息 -->
+                <up-form-item required v-if="['A4', 'A8'].includes(form.seedType as string)" :label="`${selectDictLabel(pt_seed_type, form.seedType as string)}编号`" class="form-item-bottom-padding-0">
+                    <view class="d-flex flex1">
+                        <view class="flex1">
+                            <ut-action-sheet v-model="form.fungusCodeType" :tabs="pt_fungus_code_type" mode="custom" title="选择单位">
+                                <up-form-item prop="fungusCodeType" border-bottom class="form-item-top-padding-0">
+                                    <view class="flex1" style="line-height: 24px">
+                                        <view v-if="form.fungusCodeType" class="f-s-30 c-333 f-w-5">{{ selectDictLabel(pt_fungus_code_type, form.fungusCodeType) }}</view>
+                                        <view v-else class="f-s-30 c-ccc f-w-4">选择编号类型</view>
+                                    </view>
+                                    <template #right>
+                                        <up-icon class="pr-20" size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                    </template>
+                                </up-form-item>
+                            </ut-action-sheet>
+                        </view>
+                        <view class="pd-5"></view>
+                        <view class="flex1">
+                            <up-form-item prop="fungusCode" border-bottom class="form-item-top-padding-0">
+                                <up-input v-model="form.fungusCode" placeholder="输入数字小数点" border="none" clearable></up-input>
+                            </up-form-item>
+                        </view>
+                    </view>
+                </up-form-item>
+                <!-- 个体标识:此处仅占位,后续可改为多选列表 -->
+                <view class="h-1" id="instoreBizInfo.idFlagpppp"></view>
+                <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">
+                    <view class="h-1" id="instoreBizInfo.animalspppp"></view>
+                    <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="instoreBizInfo.storageMethod">
+                    <up-input v-model="form.instoreBizInfo.storageMethod" placeholder="请输入保藏方法" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 媒体与附件 -->
+                <up-form-item borderBottom label="种源图片" prop="imgs">
+                    <ut-upload v-model="form.imgs" :max-count="9" valueType="string"></ut-upload>
+                </up-form-item>
+                <up-form-item borderBottom label="种源视频" prop="vedios">
+                    <ut-upload v-model="form.vedios" :max-count="3" accept="video" valueType="string"></ut-upload>
+                </up-form-item>
+
+                <!-- 种源产地 -->
+                <PickerAreaInput v-model="form.adcode" v-model:full-name="form.adcodeName" title="选择种源产地">
+                    <up-form-item borderBottom label="种源产地" prop="adcode">
+                        <view v-if="form.adcode" class="f-s-30 c-333 f-w-5 flex1">{{ form.adcodeName }}</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>
+                </PickerAreaInput>
+                <ut-action-sheet :tabs="pt_breeding_materials" mode="custom" title="繁殖材料" multiple v-model="form.generationMaterial">
+                    <up-form-item borderBottom label="繁殖材料" prop="generationMaterial">
+                        <view v-if="form.generationMaterial" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabels(pt_breeding_materials, form.generationMaterial, ',') }}</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>
+
+                <PickerAreaInput v-model="form.generationAdcode" v-model:full-name="form.generationAdcodeName" :maxLevel="4" title="选择繁殖地点/采集地点">
+                    <up-form-item borderBottom label="繁殖地点/采集地点" prop="generationAdcode">
+                        <view v-if="form.generationAdcode" class="f-s-30 c-333 f-w-5 flex1">{{ form.generationAdcodeName }}</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>
+                </PickerAreaInput>
+                <!-- 资质证明附件(暂按上传控件处理,可后续细化) -->
+                <up-form-item borderBottom label="物种鉴定证书" prop="spCert">
+                    <ut-upload v-model="form.spCert" :max-count="9" valueType="array" accept="file"></ut-upload>
+                </up-form-item>
+                <!-- 检疫信息 -->
+                <up-form-item borderBottom label="种源检疫证号" prop="seedCheckSn">
+                    <up-input v-model="form.seedCheckSn" placeholder="请输入种源检疫证号" border="none" clearable></up-input>
+                </up-form-item>
+                <up-form-item borderBottom label="种源检疫证书" prop="seedCheckCert">
+                    <ut-upload v-model="form.seedCheckCert" :max-count="9" valueType="array" accept="file"></ut-upload>
+                </up-form-item>
+            </view>
+
+            <view class="pd-24">
+                <view class="startline-title">入库信息</view>
+            </view>
+            <view class="pd-24 bg-#fff">
+                <!-- 种源级别 -->
+                <up-form-item borderBottom label="种源级别" prop="seedLevel">
+                    <up-input v-model="form.seedLevel" placeholder="请输入种源级别" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 入库类型 -->
+                <up-form-item borderBottom label="入库类型" required prop="instoreType">
+                    <view v-if="form.instoreType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_instore_type, form.instoreType) }}</view>
+                    <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择入库类型</view>
+                </up-form-item>
+                <!-- 入库日期 -->
+                <view class="h-1" id="instoreDatepppp"></view>
+                <ut-datetime-picker v-model="form.instoreBizInfo.instoreDate" :maxDate="new Date()" mode="date">
+                    <up-form-item borderBottom label="入库日期" required prop="instoreBizInfo.instoreDate">
+                        <up-input v-model="form.instoreBizInfo.instoreDate" placeholder="请选择入库日期" border="none" clearable></up-input>
+                        <template #right>
+                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                        </template>
+                    </up-form-item>
+                </ut-datetime-picker>
+                <!-- 入库批号 -->
+                <up-form-item borderBottom label="入库批号" required prop="batchCode">
+                    <up-input v-model="form.batchCode" placeholder="请输入入库批号" border="none" clearable></up-input>
+                    <template #right>
+                        <up-button @click="generateBatchCode" type="primary" :customStyle="formItemBtnStyle">随机生成</up-button>
+                    </template>
+                </up-form-item>
+                <!-- 库房类型 -->
+                <up-form-item borderBottom label="库房类型" prop="storeType" required>
+                    <view v-if="form.storeType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_warehouse_type, form.storeType) }}</view>
+                    <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择库房类型</view>
+                </up-form-item>
+                <!-- 存放库房(具体库房/货架信息稍后补充为选择器) -->
+                <up-form-item borderBottom label="存放库房" prop="storeCode">
+                    <up-input v-model="form.storeCode" placeholder="请输入存放库房或编码" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 入库人 -->
+                <up-form-item borderBottom label="入库人" required prop="instoreBizInfo.instoreMg">
+                    <up-input v-model="form.instoreBizInfo.instoreMg" placeholder="请输入入库人" border="none" clearable></up-input>
+                </up-form-item>
+                <!-- 入库备注 -->
+                <up-form-item borderBottom label="入库备注" prop="instoreBizInfo.remark">
+                    <up-textarea v-model="form.instoreBizInfo.remark" placeholder="请输入入库备注" autoHeight></up-textarea>
+                </up-form-item>
+            </view>
+        </up-form>
+        <template #bottom>
+            <view class="pd-20 d-flex">
+                <up-button @click="submitForm" type="primary">保存</up-button>
+            </view>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { seedInfoListType } from '../models/type';
+import AnimalsInput from '../models/animals-input.vue';
+import ContactUnitInput from '@/models/contact-unit-input/contact-unit-input.vue';
+import PickerAreaInput from '@/models/picker-area-input/picker-area-input.vue';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_seed_instore_type, pt_warehouse_type, 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, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(
+    proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', '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', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'),
+);
+const paging = ref<any>(null);
+const upFormRef = ref<any>(null);
+// 单条种源信息 + 入库信息的合并表单
+const form = ref<seedInfoListType | any>({
+    imgs: undefined,
+    vedios: undefined,
+    spCert: [],
+    newSpCert: [],
+    importCert: [],
+    seedCheckCert: [],
+    unit: '',
+    adcode: '',
+    instoreBizInfo: {
+        motherFatherFlag: '',
+        idFlag: '1',
+        genUnit: '',
+        instoreDate: '',
+        instoreMg: '',
+        remark: '',
+    },
+    generationMaterial: '',
+    instoreType: '2',
+    storeType: '2',
+});
+const rules = reactive({
+    // 种源信息校验(来自 info-edit)
+    seedType: [{ required: true, message: '请选择种源类型' }],
+    varietyId: [{ required: true, message: '请选择物种基原' }],
+    seedSource: [{ required: true, message: '请选择种源来源' }],
+    'instoreBizInfo.motherFatherFlag': [{ required: true, message: '请选择父母本情况' }],
+    'instoreBizInfo.genCount': [
+        {
+            asyncValidator: (rule: any, value: any) => {
+                if (['A3', 'A4'].includes(form.value.seedType as string)) {
+                    if (!value) {
+                        return Promise.reject('请输入' + genCountMap[form.value.seedType as 'A3' | 'A4']);
+                    }
+                }
+                return Promise.resolve();
+            },
+        },
+    ],
+    'instoreBizInfo.genUnit': [
+        {
+            asyncValidator: (rule: any, value: any) => {
+                if (['A3', 'A4'].includes(form.value.seedType as string)) {
+                    if (!value) {
+                        return Promise.reject('请选择单位');
+                    }
+                }
+                return Promise.resolve();
+            },
+        },
+    ],
+    entrustId: [{ required: true, message: '请选择受托单位' }],
+    capacity: [{ required: true, message: '请输入入库量' }],
+    unit: [{ required: true, message: '请选择单位' }],
+    supplierId: [{ required: true, message: '请选择供应商' }],
+    fungusCodeType: [{ required: true, message: '请选择编号类型' }],
+    fungusCode: [{ required: true, message: '请输入编号' }],
+    'instoreBizInfo.idFlag': [{ required: true, message: '请选择是否有个体标识' }],
+    'instoreBizInfo.animals': [{ type: 'array', required: true, message: '请输入个体标识号' }],
+    // 入库信息校验(来自 add)
+    instoreType: [{ required: true, message: '请选择入库类型' }],
+    'instoreBizInfo.instoreDate': [{ required: true, message: '请选择入库日期' }],
+    batchCode: [{ required: true, message: '请输入入库批号' }],
+    'instoreBizInfo.instoreMg': [{ required: true, message: '请输入入库人' }],
+});
+// 繁衍世代对象
+const genCountMap = reactive({
+    A4: '累计扩繁代数',
+    A3: '继代培养次数',
+});
+
+// 提交:当前页面改为单条种源信息,直接提交合并后的对象
+const submitForm = async () => {
+    uni.$u.debounce(
+        async () => {
+            try {
+                await upFormRef.value?.validate();
+            } catch (error: any) {
+                const firstErrorField = error && error[0].prop + 'pppp';
+                paging.value?.scrollIntoViewById(firstErrorField, 30, true);
+                return;
+            }
+            uni.showLoading({
+                title: '提交中...',
+            });
+            try {
+                // 这里使用单条入库接口,后端若仍要求 batch,可根据需要包装成数组
+                const res = await useClientRequest.post('/plt-api/app/storageSeed/edit', form.value);
+                uni.hideLoading();
+                if (!res || res !== 200) return;
+                uni.showToast({
+                    title: '提交成功',
+                    icon: 'success',
+                });
+                uni.$emit('seed-source-detail-refresh');
+                uni.$emit('refreshStorageRoomList');
+                setTimeout(() => {
+                    uni.navigateBack({
+                        delta: 1,
+                    });
+                }, 1500);
+            } catch (error) {
+                uni.hideLoading();
+            }
+        },
+        500,
+        true,
+    );
+};
+// 点击随机生成服务端生成唯一的批号(与 add 一致)
+const generateBatchCode = async () => {
+    uni.showLoading({
+        title: '生成中...',
+    });
+    const res = await useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', {
+        plType: 'S',
+        linkType: 'I',
+    });
+    if (res && res.code === 200) {
+        uni.hideLoading();
+        form.value.batchCode = res.data;
+        uni.showToast({
+            title: '批号生成成功',
+            icon: 'success',
+        });
+    }
+};
+
+// 选择物种、父母本逻辑保持与 info-edit 一致
+const selectVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.varietyId = data.msg.id;
+        form.value.varietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择物种基原',
+        },
+    });
+};
+const selectFatherVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.instoreBizInfo.fatherVarietyId = data.msg.id;
+        form.value.instoreBizInfo.fatherVarietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择父本品种',
+        },
+    });
+};
+const selectMotherVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.instoreBizInfo.motherVarietyId = data.msg.id;
+        form.value.instoreBizInfo.motherVarietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择母本品种',
+        },
+    });
+};
+const did = ref('');
+// 获取详情(仓库信息)
+const getDetailById = async (id: string) => {
+    if (!id) return;
+    const res = await useClientRequest.get(`/plt-api/app/storageSeed/getById/${id}`);
+    if (res && res.code === 200) {
+        form.value = {
+            ...form.value,
+            ...res.data,
+        };
+    }
+};
+
+// 页面入参解析并加载
+onLoad((options: any) => {
+    did.value = options?.id || '';
+    getDetailById(did.value);
+});
+</script>
+<style lang="scss" scoped>
+.card-info-block {
+    border: 1rpx solid #afddbb;
+    border-radius: 10rpx;
+}
+
+.tag-span {
+    padding: 4rpx 12rpx;
+    font-size: 20rpx;
+    border-radius: 18rpx;
+}
+.close-icon {
+    position: absolute;
+    top: 0;
+    right: 0;
+    z-index: 10;
+}
+</style>

+ 81 - 14
src/plant/storage/seed-source/list/index.vue

@@ -6,13 +6,13 @@
 
         <view class="pd3-24-24-0">
             <view class="mb-20">
-                <ut-tabs mode="subsection" :tabs="tabs"></ut-tabs>
+                <ut-tabs mode="subsection" v-model="form.restFlag" :tabs="tabs" @change="onRefresh"></ut-tabs>
             </view>
             <view class="d-flex a-c">
-                <view class="min-w-170 flex1">
-                    <ut-action-sheet :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
+                <view class="min-w-230 flex1">
+                    <ut-action-sheet v-model="form.instoreType" :tabs="[{ label: '全部', value: '' }, ...pt_seed_instore_type]" mode="custom" @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>
+                            <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ selectDictLabel(pt_seed_instore_type, form.instoreType) || '全部' }} </view>
                             <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
                         </view>
                     </ut-action-sheet>
@@ -27,7 +27,50 @@
             <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 class="d-flex j-sb a-c li-item-head mb-16">
+                            <view class="li-left-tag" :class="{ [`bg-${selectDictListClass(pt_seed_instore_type, item?.instoreType)}`]: true }">{{ selectDictLabel(pt_seed_instore_type, item?.instoreType) }}</view>
+                            <view class="f-s-22 c-#666">{{ item?.updateTime || item?.createTime }}</view>
+                        </view>
+                        <view class="d-flex flex1 mb-10">
+                            <view class="flex1">
+                                <span class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.variety }}</span>
+                                <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, item?.seedType) }}</span>
+                            </view>
+                            <view>
+                                <view v-if="item?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检验</view>
+                                <view v-else class="tag-span c-danger bg-#F9ECEA">未检验</view>
+                            </view>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">入库批号:</span>
+                            <span class="c-#333 f-w-500">{{ item?.batchCode }}</span>
+                        </view>
+                        <!-- <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">溯源批号:</span>
+                            <span class="c-#333 f-w-500">暂无</span>
+                        </view> -->
+                        <view v-if="['A3', 'A4'].includes(item?.fungusCodeType)" class="pd2-4-0 f-s-28">
+                            <span class="c-#666">菌种/菌株编号:</span>
+                            <span class="c-#333 f-w-500">{{ selectDictLabel(pt_fungus_code_type, item?.fungusCodeType) }}/{{ item?.fungusCode }}</span>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">供应商:</span>
+                            <span class="c-#333 f-w-500">{{ item?.supplier }}</span>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">入库量:</span>
+                            <span class="c-#333 f-w-500">{{ item?.capacity }}{{ item?.unit }}</span>
+                        </view>
+                        <view class="d-flex">
+                            <view v-if="item?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                                <span class="c-#666">出库量:</span>
+                                <span class="c-#333 f-w-500">{{ item?.inputAmount || '0' }}{{ item?.unit }}</span>
+                            </view>
+                            <view v-if="item?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                                <span class="c-danger">剩余量:</span>
+                                <span class="c-danger f-w-500">{{ item?.restAmount || '0' }}{{ item?.unit }}</span>
+                            </view>
+                        </view>
                     </view>
                 </up-swipe-action-item>
             </up-swipe-action>
@@ -46,14 +89,15 @@
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
 import SourceBottom from './model/source-bottom.vue';
+import { selectDictListClass } from '@/utils/ruoyi';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_task_type } = toRefs<any>(proxy?.useDict('pt_task_type'));
+const { pt_seed_instore_type, pt_warehouse_type, 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, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', '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', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
 const list = ref<any[]>();
-const form = ref({ keyword: '' });
+const form = ref({ keyword: '', restFlag: '1', instoreType: '' });
 const paging = ref();
 const tabs = ref([
-    { label: '有库存', value: 'seed' },
-    { label: '无库存', value: 'seedling' },
+    { label: '有库存', value: '1' },
+    { label: '无库存', value: '0' },
 ]);
 
 const changeSeach = () => {
@@ -76,7 +120,7 @@ const optionsActionTemp = reactive([
     {
         text: '删除',
         style: {
-            backgroundColor: '#f56c6c',
+            backgroundColor: '#F74C30',
         },
     },
 ]);
@@ -87,15 +131,15 @@ const clickTempSwipe = async (event: object) => {
         try {
             const res = await uni.showModal({
                 title: '删除提示',
-                content: '确定删除该基地吗?',
-                confirmColor: '#f56c6c',
+                content: '确定删除种源信息吗?',
+                confirmColor: '#F74C30',
             });
             if (!res.confirm) return;
             await uni.showLoading({
                 title: '删除中...',
                 mask: true,
             });
-            await useClientRequest.get(`/plt-api/app/base/delById/${name}`);
+            await useClientRequest.get(`/plt-api/app/storageSeed/removeById/${name}`);
             uni.hideLoading();
             uni.showToast({
                 title: '删除成功',
@@ -103,13 +147,20 @@ const clickTempSwipe = async (event: object) => {
             });
             paging.value?.reload();
         } catch (error) {
-            console.error('删除暂存基地失败:', error);
+            console.error('删除暂存种源信息失败:', error);
         }
     }
 };
+
 const onRefresh = () => {
     paging.value.reload();
 };
+onMounted(() => {
+
+    uni.$on('refreshStorageRoomList', () => {
+        onRefresh();
+    });
+});
 </script>
 <style lang="scss" scoped>
 .search-select-item {
@@ -119,4 +170,20 @@ const onRefresh = () => {
     box-sizing: border-box;
     padding: 12rpx;
 }
+.tag-span {
+    padding: 4rpx 12rpx;
+    font-size: 20rpx;
+    border-radius: 18rpx;
+}
+.li-item-head {
+    margin-left: -24rpx;
+    margin-top: -24rpx;
+}
+.li-left-tag {
+    padding: 6rpx 16rpx;
+    color: #fff;
+    border-radius: 16rpx 0 16rpx 0;
+    font-size: 20rpx;
+    font-weight: 500;
+}
 </style>

+ 1 - 1
src/plant/storage/seed-source/list/model/source-bottom.vue

@@ -27,7 +27,7 @@
                     <view class="f-s-28 c-#333">新增溯源入库</view>
                     <view class="f-s-22 c-#999">适合贴有溯源码的种源</view>
                 </view>
-                <view class="flex1 d-flex flex-cln a-c pt-160 pr-30" @click="$u.route({ url: '/plant/storage/seed-source/add/index' })">
+                <view class="flex1 d-flex flex-cln a-c pt-160 pr-30" @click="clickBtnBall();$u.route({ url: '/plant/storage/seed-source/add/index' });">
                      <view>
                         <image class="w-68 h-68" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/storage/xzfsyrk_icon_sd.png" mode="widthFix" />
                     </view>

+ 3 - 0
src/plant/storage/seed-source/loss-register/index.vue

@@ -0,0 +1,3 @@
+<template>
+    <view>损耗登记</view>
+</template>

+ 15 - 11
src/plant/storage/seed-source/models/type.ts

@@ -3,7 +3,7 @@
  */
 export interface SeedSourceAddTypeEnum {
     // 种信息数组
-    seedInfoList?: seedInfoListType[];
+    seedInfoList: string[];
     /** 种源级别 */
     seedLevel?: string;
     /** 入库类型 */
@@ -19,7 +19,7 @@ export interface SeedSourceAddTypeEnum {
     /**
      * 入库业务传输对象
      */
-    instoreBizInfo: instoreBizInfoType;
+    instoreBizInfo: instoreBizInfoType1;
      [property: string]: any;
 }
 // 种源信息返回体
@@ -53,9 +53,9 @@ export interface seedInfoListType {
     /** 是否有个体标识 */
     animalIds?: string[];
     /** 种源图片 */
-    imgs?: AccesseryDTO[];
+    imgs?: string;
     /** 种源视频 */
-    vedios?: AccesseryDTO[];
+    vedios?: string;
     /** 种源产地 */
     adcode?: string;
     /** 繁殖材料 */
@@ -68,7 +68,7 @@ export interface seedInfoListType {
     seedCheckSn?: string;
      /** 种源检疫证书 */
     seedCheckCert?: AccesseryDTO[];
-
+    uid?: string;
     [property: string]: any;
     instoreBizInfo: instoreBizInfoType;
 }
@@ -98,12 +98,7 @@ export interface warehousesType {
  * 入库业务传输对象
  */
 export interface instoreBizInfoType {
-    /** 入库日期 */
-    instoreDate?: string;
-    /** 入库人 */
-    instoreMg?: string;
-    /** 备注 */
-    remark?: string;
+   
     /** 父母本情况 */
     motherFatherFlag: string;
     /** 父本品种ID */
@@ -118,3 +113,12 @@ export interface instoreBizInfoType {
     genUnit?: string;
     [property: string]: any;
 }
+export interface instoreBizInfoType1 {
+ /** 入库日期 */
+    instoreDate?: string;
+    /** 入库人 */
+    instoreMg?: string;
+    /** 备注 */
+    remark?: string;
+    [property: string]: any;
+}

+ 3 - 0
src/plant/storage/seed-source/stock-list/index.vue

@@ -0,0 +1,3 @@
+<template>
+    <view>出入库清单</view>
+</template>

+ 1 - 11
src/plant/storage/storage-room/detail/index.vue

@@ -128,15 +128,5 @@ onLoad((options: any) => {
 </script>
 
 <style lang="scss" scoped>
-.z-paging-wrap {
-    position: absolute;
-    right: 0;
-    top: 0;
-    bottom: 0;
-    left: 0;
-}
-.plot-item {
-    border: 1rpx solid rgba($u-primary, 0.4);
-    border-radius: 10rpx;
-}
+
 </style>

+ 2 - 2
src/plant/storage/storage-room/list/index.vue

@@ -95,7 +95,7 @@ const optionsAction = reactive([
     {
         text: '删除',
         style: {
-            backgroundColor: '#f56c6c',
+            backgroundColor: '#F74C30',
         },
     },
     // 添加货位
@@ -113,7 +113,7 @@ const clickSwipe = async (event: object) => {
         const res = await uni.showModal({
             title: '删除提示',
             content: '删除后不可撤回,请谨慎操作!',
-            confirmColor: '#f56c6c',
+            confirmColor: '#F74C30',
         });
         console.log(res);
         if (res.confirm) {

+ 17 - 3
src/utils/ruoyi.ts

@@ -1,7 +1,7 @@
 // 日期格式化
-export function parseTime(time: any, pattern?: string) {
+export function parseTime(time: any, pattern?: string): string {
     if (arguments.length === 0 || !time) {
-        return null;
+        return '';
     }
     const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}';
     let date;
@@ -435,4 +435,18 @@ export const previewImage = (urls: string | string[], current?: string) => {
         urls: urlList,
         current: current || urlList[0],
     });
-};
+};
+
+export const selectDictListClass = (datas: any, value: number | string) => {
+    if (value === undefined) {
+        return '';
+    }
+    let className = '';
+    Object.keys(datas).some((key) => {
+        if (datas[key].value == '' + value) {
+            className = datas[key].elTagType || '';
+            return true;
+        }
+    });
+    return className;
+}