huangxw 1 ماه پیش
والد
کامیت
d61bc6c47c

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

@@ -102,7 +102,7 @@ $colors: (
     // 警告
     warning: #e6a23c,
     // 失败
-    danger: #f56c6c,
+    danger: #F74C30,
     // 钱红色
     money-red: #f4403b,
     // 会员绿

+ 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/plant/base/gap-base-info/index.vue

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

+ 2 - 2
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) {

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

@@ -828,7 +828,7 @@ const options1 = reactive([
     {
         text: '删除',
         style: {
-            backgroundColor: '#f56c6c',
+            backgroundColor: '#F74C30',
         },
     },
     {
@@ -1194,7 +1194,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

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

+ 117 - 11
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>
@@ -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,10 @@
 import { useClientRequest } from '@/utils/request';
 import { SeedSourceAddTypeEnum } from '../models/type';
 import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { generateUniqueId } from '@/utils/public';
+
 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 +136,22 @@ const form = ref<SeedSourceAddTypeEnum>({
     seedInfoList: [],
     warehouses: [],
     instoreBizInfo: {
-        motherFatherFlag: '',
-        idFlag: '0',
+       instoreDate: '',
+       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 +166,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();
@@ -132,7 +195,7 @@ const submitForm = async () => {
             }
         },
         500,
-        true
+        true,
     );
 };
 // 点击随机生成服务端生成唯一的批号
@@ -153,6 +216,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 +226,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 +261,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>

+ 191 - 71
src/plant/storage/seed-source/info-edit/index.vue

@@ -1,11 +1,12 @@
 <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>
@@ -15,6 +16,7 @@
                         </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>

+ 54 - 9
src/plant/storage/seed-source/list/index.vue

@@ -6,11 +6,11 @@
 
         <view class="pd3-24-24-0">
             <view class="mb-20">
-                <ut-tabs mode="subsection" :tabs="tabs"></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="选择原料类型">
+                    <ut-action-sheet v-model="form.instoreType" :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
                         <view class="d-flex search-select-item a-c">
                             <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }} </view>
                             <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
@@ -27,7 +27,46 @@
             <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 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>
@@ -47,13 +86,13 @@
 import { useClientRequest } from '@/utils/request';
 import SourceBottom from './model/source-bottom.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_task_type } = toRefs<any>(proxy?.useDict('pt_task_type'));
+const { 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 +115,7 @@ const optionsActionTemp = reactive([
     {
         text: '删除',
         style: {
-            backgroundColor: '#f56c6c',
+            backgroundColor: '#F74C30',
         },
     },
 ]);
@@ -88,7 +127,7 @@ const clickTempSwipe = async (event: object) => {
             const res = await uni.showModal({
                 title: '删除提示',
                 content: '确定删除该基地吗?',
-                confirmColor: '#f56c6c',
+                confirmColor: '#F74C30',
             });
             if (!res.confirm) return;
             await uni.showLoading({
@@ -107,6 +146,7 @@ const clickTempSwipe = async (event: object) => {
         }
     }
 };
+
 const onRefresh = () => {
     paging.value.reload();
 };
@@ -119,4 +159,9 @@ const onRefresh = () => {
     box-sizing: border-box;
     padding: 12rpx;
 }
+.tag-span {
+    padding: 4rpx 12rpx;
+    font-size: 20rpx;
+    border-radius: 18rpx;
+}
 </style>

+ 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;
+}

+ 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) {