huangxw 1 mese fa
parent
commit
955cd20629

+ 63 - 8
src/components/ut-action-sheet/ut-action-sheet.vue

@@ -18,7 +18,10 @@
                         <ut-row gap="16rpx">
                             <template v-for="(item, index) in options" :key="index">
                                 <ut-col :span="item.span">
-                                    <view class="">{{ item?.name }}</view>
+                                    <view @click="clickCol(item)" class="ut-custom-item-sheet p-rtv"
+                                        :class="{ 'active': checkeds[item.value] }">{{ item?.name }}
+                                        <image v-if="checkeds[item.value]" class="w-40 h-40 checked-icon" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-lm/price/checked1.png" mode="widthFix" />
+                                    </view>
                                 </ut-col>
                             </template>
                         </ut-row>
@@ -59,10 +62,7 @@ const props = defineProps({
         default: false, // 只有自定义弹窗模式下生效
     },
 });
-
 const options = computed(() => {
-    console.log(props.tabs);
-
     return props.tabs.map((item: any) => {
         return {
             name: item.label,
@@ -73,7 +73,7 @@ const options = computed(() => {
 });
 const showModel = ref(false);
 const emit = defineEmits(['close', 'confirm', 'open', 'update:show', 'update:modelValue', 'change']);
-const checkeds = ref({});
+const checkeds = ref<any>({});
 const close = () => {
     showModel.value = false;
     // 如果有初始值,恢复初始值
@@ -81,7 +81,28 @@ const close = () => {
     emit('update:show', false);
     emit('close');
 };
-
+const clickCol = (item: any) => {
+    // 判断是单选还是多选
+    if (props.multiple) {
+        // 多选
+        if (checkeds.value[item.value]) {
+            // 取消选择
+            delete checkeds.value[item.value];
+        } else {
+            // 选择
+            checkeds.value[item.value] = true;
+        }
+    } else {
+        // 单选
+        checkeds.value = {
+            [item.value]: true,
+        }
+        emit('update:modelValue', item.value);
+        emit('change', item.value);
+        close();
+    }
+    
+};
 // 未选择之前的
 const initialCheckeds = ref({});
 const selectChange = (item: any) => {
@@ -92,7 +113,20 @@ const selectChange = (item: any) => {
 };
 watch(
     () => props.modelValue,
-    (newVal) => {},
+    (newVal: any) => { 
+        // 初始化已选择项
+        let selected: any = {};
+        if (props.multiple && Array.isArray(newVal)) {
+            newVal.forEach((val: any) => {
+                selected[val] = true;
+            });
+        } else if (!props.multiple && newVal != null) {
+            selected = {
+                [newVal as string]: true,
+            };
+        }
+        checkeds.value = selected;
+    },
     { immediate: true }
 );
 onMounted(() => {
@@ -100,4 +134,25 @@ onMounted(() => {
     console.log(props.tabs);
 });
 </script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.ut-custom-item-sheet {
+    padding: 18rpx 6rpx;
+    border: 1rpx solid #F7F7F7;
+    background-color: #F7F7F7;
+    border-radius: 10rpx;
+    text-align: center;
+    font-size: 30rpx;
+    color: #333;
+
+    &.active {
+        border-color: #37A954;
+        background-color: #E6F4F0;
+        color: #37A954;
+    }
+}
+.checked-icon {
+    position: absolute;
+    right: 0;
+    bottom: 0;
+}
+</style>

+ 0 - 2
src/components/ut-col/ut-col.vue

@@ -23,8 +23,6 @@ const rowContext = inject<any>(ROW_INJECT_KEY, null);
 const colStyle = computed(() => {
 	const styles: Record<string, string> = {};
 	if (!rowContext) return styles;
-    console.log(rowContext.gap);
-	
 	const columns = Number(unref(rowContext.columns) || 0);
 	const gap = Number(unref(rowContext.gap) || 0);
 	const span = props.span || 0;

+ 1 - 1
src/config.ts

@@ -14,7 +14,7 @@ interface ProjectConfig {
 
 const config: ProjectConfig = {
     baseUrl: import.meta.env.VITE_API_BASE_URL || 'http://localhost:3000',
-    clientId: '20251229',
+    clientId: '20260119',
     tenantId: '000000',
     appid: '1942409637969063940'
 };

+ 1 - 1
src/manifest.json

@@ -56,7 +56,7 @@
     "quickapp": {},
     /* 小程序特有相关 */
     "mp-weixin": {
-        "appid": "wxd52c8780db580e84",
+        "appid": "wxf11517e71e36169f",
         "setting": {
             "urlCheck": false,
             "minified": true

+ 13 - 13
src/plant/base/base-edit/index.vue

@@ -33,7 +33,7 @@
                 <!-- 校验定位:建设时间 -->
                 <view class="h-1" id="buildDatepppp"></view>
                 <ut-datetime-picker v-model="form.baseInfo.buildDate" mode="date" dateFields="month">
-                    <up-form-item borderBottom label="建设时间" required prop="baseInfo.buildDate">
+                    <up-form-item borderBottom label="建设时间" prop="baseInfo.buildDate">
                         <up-input v-model="form.baseInfo.buildDate" placeholder="请选择基地建设年份" border="none" clearable></up-input>
                         <template #right>
                             <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
@@ -42,7 +42,7 @@
                 </ut-datetime-picker>
                 <!-- 选择基地组织方式 -->
                 <view class="h-1" id="orgTypepppp"></view>
-                <ut-action-sheet v-model="form.baseInfo.orgType" :tabs="pt_org_type" title="选择基地组织方式">
+                <ut-action-sheet v-model="form.baseInfo.orgType" :tabs="pt_org_type" mode="custom" title="选择基地组织方式">
                     <up-form-item borderBottom label="基地组织方式" required prop="baseInfo.orgType">
                         <view v-if="form.baseInfo.orgType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.baseInfo.orgType) }}</view>
                         <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择基地组织方式</view>
@@ -54,7 +54,7 @@
                 <!-- 选择基地负责人 -->
                 <!-- 校验定位:基地负责人 -->
                 <view class="h-1" id="contactIdpppp"></view>
-                <up-form-item @click="selectCpyMember" borderBottom label="基地负责人" required prop="baseInfo.contactId">
+                <up-form-item @click="selectCpyMember" borderBottom label="基地负责人" prop="baseInfo.contactId">
                     <view v-if="form.baseInfo.contactId" class="f-s-30 c-333 f-w-5 flex1">{{ form.baseInfo.contactName }}</view>
                     <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择基地负责人</view>
                     <template #right>
@@ -63,7 +63,7 @@
                 </up-form-item>
                 <!-- 填写基地联系电话 -->
                 <view class="h-1" id="contactTelpppp"></view>
-                <up-form-item borderBottom label="基地联系电话" required prop="baseInfo.contactTel">
+                <up-form-item borderBottom label="基地联系电话" prop="baseInfo.contactTel">
                     <up-input v-model="form.baseInfo.contactTel" placeholder="请输入基地联系电话" border="none" clearable></up-input>
                 </up-form-item>
                 <!-- 是否Gap基地 -->
@@ -164,7 +164,7 @@
                     <up-form-item borderBottom prop="baseInfo.gapInfo.address">
                         <up-input v-model="form.baseInfo.gapInfo.address" placeholder="请填写村级以下的具体地址信息" border="none" clearable></up-input>
                     </up-form-item>
-                    <up-form-item v-if="['1', '2'].includes(form.baseInfo.baseType)" borderBottom prop="baseInfo.gapInfo.basePic" required>
+                    <up-form-item v-if="['1', '2'].includes(form.baseInfo.baseType)" borderBottom prop="baseInfo.gapInfo.basePic">
                         <view class="flex1 ov-hd">
                             <view class="d-flex a-c mb-10" style="margin-bottom: 5px">
                                 <view class="f-s-30 c-#666">基地范围</view>
@@ -204,7 +204,7 @@
                     <!-- 基地经纬度 -->
                     <view class="h-1" id="lngpppp"></view>
                     <view class="h-1" id="latpppp"></view>
-                    <up-form-item required label="基地经纬度" class="form-item-wrap-column">
+                    <up-form-item label="基地经纬度" class="form-item-wrap-column">
                         <view class="d-flex" style="margin-top: -10px">
                             <up-form-item prop="baseInfo.gapInfo.lng">
                                 <up-input v-model="form.baseInfo.gapInfo.lng" border="bottom" placeholder="70-150内的经度数值" clearable></up-input>
@@ -337,7 +337,7 @@
                 <view class="pd-24 bg-#fff mb-10">
                     <view class="f-s-32 c-#333 f-w-600">环境信息</view>
                     <!-- 土壤类型选择 -->
-                    <ut-action-sheet v-model="form.environmentInfo.soilType" :tabs="pt_soil_type" title="选择土壤类型">
+                    <ut-action-sheet v-model="form.environmentInfo.soilType" :tabs="pt_soil_type" mode="custom" title="选择土壤类型">
                         <up-form-item borderBottom label="土壤类型" prop="soilType">
                             <view v-if="form.environmentInfo.soilType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_soil_type, form.environmentInfo.soilType) }}</view>
                             <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择土壤类型</view>
@@ -347,7 +347,7 @@
                         </up-form-item>
                     </ut-action-sheet>
                     <!-- 字典 -->
-                    <ut-action-sheet v-model="form.environmentInfo.soilTexture" :tabs="pt_soil_texture" title="选择土壤质地">
+                    <ut-action-sheet v-model="form.environmentInfo.soilTexture" :tabs="pt_soil_texture" mode="custom" title="选择土壤质地">
                         <up-form-item borderBottom label="土壤质地" prop="soilTexture">
                             <view v-if="form.environmentInfo.soilTexture" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_soil_texture, form.environmentInfo.soilTexture) }}</view>
                             <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择土壤质地</view>
@@ -362,7 +362,7 @@
                     <up-form-item label="土壤PH值" prop="environmentInfo.soilPh" borderBottom>
                         <up-input v-model="form.environmentInfo.soilPh" placeholder="请输入土壤PH值" border="none" clearable></up-input>
                     </up-form-item>
-                    <ut-action-sheet v-model="form.environmentInfo.waterType" :tabs="pt_water_type" title="选择水源类型">
+                    <ut-action-sheet v-model="form.environmentInfo.waterType" :tabs="pt_water_type" mode="custom" title="选择水源类型">
                         <up-form-item borderBottom label="水源类型" prop="waterType">
                             <view v-if="form.environmentInfo.waterType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_water_type, form.environmentInfo.waterType) }}</view>
                             <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择水源类型</view>
@@ -621,16 +621,16 @@ const options = ref([
 const rules = reactive({
     'baseInfo.baseName': [{ required: true, message: '请输入基地名称' }],
     'baseInfo.baseCode': [{ required: true, message: '请输入基地编号' }],
-    'baseInfo.buildDate': [{ required: true, message: '请选择建设时间' }],
+    // 'baseInfo.buildDate': [{ required: true, message: '请选择建设时间' }],
     'baseInfo.orgType': [{ required: true, message: '请选择基地组织方式' }],
-    'baseInfo.contactId': [{ required: true, message: '请选择基地负责人' }],
+    // 'baseInfo.contactId': [{ required: true, message: '请选择基地负责人' }],
     'baseInfo.contactTel': [{ required: true, message: '请输入基地联系电话' }],
     'baseInfo.gapInfo.adcode': [{ required: true, message: '请选择基地具体地址' }],
     'baseInfo.gapFlag': [{ required: true, message: '请选择是否为Gap基地' }],
     'baseInfo.gapInfo.basePic': [{ required: true, message: '请绘制基地范围' }],
     'baseInfo.gapInfo.area': [{ required: true, message: '请输入基地面积' }],
-    'baseInfo.gapInfo.lng': [{ required: true, message: '请输入基地经纬度' }],
-    'baseInfo.gapInfo.lat': [{ required: true, message: '请输入基地经纬度' }],
+    // 'baseInfo.gapInfo.lng': [{ required: true, message: '请输入基地经纬度' }],
+    // 'baseInfo.gapInfo.lat': [{ required: true, message: '请输入基地经纬度' }],
 });
 // saveInfo和submitForm防抖
 // 暂存基地信息

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

@@ -111,7 +111,7 @@ const submitForm = async () => {
                 title: '提交中...',
             });
             try {
-                const res = did.value ? await useClientRequest.post(`/plt-api/app/gapCertificationInfo/update`, form.value) : await useClientRequest.post('/plt-api/app/gapCertificationInfo/add', form.value);
+                const res =  await useClientRequest.post('/plt-api/app/storageSeed/batchInstore', form.value);
                 uni.hideLoading();
                 if (!res || res !== 200) return;
                 uni.hideLoading();

+ 179 - 18
src/plant/storage/seed-source/info-edit/index.vue

@@ -1,38 +1,144 @@
 <template>
-    <z-paging class="" ref="paging" bgColor="#fff" paging-class="paging-btm-shadow" safe-area-inset-bottom scroll-with-animation>
+    <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>
         </template>
         <view class="pd-24">
             <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
                 <!-- 基本信息 -->
-                <ut-action-sheet :tabs="pt_seed_type" mode="custom" v-model="form.seedType">
+                <ut-action-sheet :tabs="pt_seed_type" mode="custom" title="种源类型" v-model="form.seedType">
                     <up-form-item borderBottom label="种源类型" required prop="seedType">
-                        <up-input v-model="form.seedType" placeholder="请输入种源类型" border="none" clearable></up-input>
+                        <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>
                 <up-form-item borderBottom label="物种基原" required prop="varietyId">
-                    <up-input v-model="form.varietyId" placeholder="请输入物种基原" border="none" clearable></up-input>
+                    <view class="flex1">
+                        <up-button v-if="!form.varietyId" @click="selectVarietyId" type="primary" plain>
+                            <image class="w-36 h-36 mr-10" src="@/static/images/common/select_push_icon.png"
+                                mode="widthFix" />
+                            <span>请选择物种基原</span>
+                        </up-button>
+                        <view v-else class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                            <view class="mb-16">
+                                <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.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>
-                <up-form-item borderBottom label="种源来源" required prop="seedSource">
-                    <up-input v-model="form.seedSource" placeholder="请输入种源来源" border="none" clearable></up-input>
-                </up-form-item>
+                <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>
+                <ut-action-sheet :tabs="pt_mother_father_flag" mode="custom" title="父母本情况"
+                    v-model="form.motherFatherFlag">
+                    <up-form-item borderBottom label="父母本情况" required prop="motherFatherFlag">
+                        <view v-if="form.motherFatherFlag" class="f-s-30 c-333 f-w-5 flex1">{{
+                            selectDictLabel(pt_mother_father_flag, form.motherFatherFlag) }}</view>
+                        <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>
+                    <!-- 父本品种 -->
+                    <up-form-item borderBottom label="父本品种" prop="fatherVarietyId">
+                        <view class="flex1">
+                            <up-button v-if="!form.fatherVarietyId" @click="selectFatherVarietyId" type="primary" plain>
+                                <image class="w-36 h-36 mr-10" src="@/static/images/common/select_push_icon.png"
+                                    mode="widthFix" />
+                                <span>请选择父本品种</span>
+                            </up-button>
+                            <view v-else class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                                <view class="mb-16">
+                                    <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.fatherVarietyInfo?.varietyName
+                                        }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.fatherVarietyInfo?.latinName }}</span>
+                                </view>
+                                <view class="mb-16">
+                                    <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.fatherVarietyInfo?.genusName
+                                        }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.fatherVarietyInfo?.genusLatinName }}</span>
+                                </view>
+                                <view class="f-s-24 c-#666">产出:{{ form?.fatherVarietyInfo?.medicineName }}</view>
+                                <view class="close-icon pd-16"
+                                    @click="form.fatherVarietyId = ''; form.fatherVarietyInfo = null;">
+                                    <up-icon color="#F81242" name="close" size="32rpx"></up-icon>
+                                </view>
+                            </view>
+                        </view>
+                    </up-form-item>
+                    <!-- 母本品种 -->
+                    <up-form-item borderBottom label="母本品种" prop="motherVarietyId">
+                        <view class="flex1">
+                            <up-button v-if="!form.motherVarietyId" @click="selectMotherVarietyId" type="primary" plain>
+                                <image class="w-36 h-36 mr-10" src="@/static/images/common/select_push_icon.png"
+                                    mode="widthFix" />
+                                <span>请选择母本品种</span>
+                            </up-button>
+                            <view v-else class="bg-#FBFDFB card-info-block pd-24 p-rtv mt-16">
+                                <view class="mb-16">
+                                    <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.motherVarietyInfo?.varietyName
+                                        }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.motherVarietyInfo?.latinName }}</span>
+                                </view>
+                                <view class="mb-16">
+                                    <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.motherVarietyInfo?.genusName
+                                        }}</span>
+                                    <span class="f-s-24 c-#666">{{ form?.motherVarietyInfo?.genusLatinName }}</span>
+                                </view>
+                                <view class="f-s-24 c-#666">产出:{{ form?.motherVarietyInfo?.medicineName }}</view>
+                                <view class="close-icon pd-16"
+                                    @click="form.motherVarietyId = ''; form.motherVarietyInfo = null;">
+                                    <up-icon color="#F81242" name="close" size="32rpx"></up-icon>
+                                </view>
+                            </view>
+                        </view>
+                    </up-form-item>
+                </template>
                 <up-form-item borderBottom label="受托单位" prop="entrustId">
                     <up-input v-model="form.entrustId" placeholder="请输入受托单位" border="none" clearable></up-input>
                 </up-form-item>
 
                 <!-- 入库数量与单位 -->
-                <up-form-item borderBottom label="入库量" prop="capacity">
-                    <up-input v-model="form.capacity" type="number" placeholder="请输入入库量" border="none" clearable></up-input>
-                </up-form-item>
-                <up-form-item borderBottom label="计量单位" prop="unit">
-                    <up-input v-model="form.unit" placeholder="请输入计量单位" border="none" clearable></up-input>
+
+                <up-form-item label="入库量" prop="capacity" required borderBottom>
+                    <up-input v-model="form.capacity" placeholder="请输入入库量" border="none" clearable />
+                    <template #right>
+                        <view @click.stop>
+                            <ut-action-sheet v-model="form.unit" :tabs="pt_materail_unit" mode="custom" title="选择单位">
+                                <!-- 可点击选择单位 -->
+                                <view class="d-flex pd-10" style="">
+                                    <span>{{ form.unit || '株' }}</span>
+                                    <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                </view>
+                            </ut-action-sheet>
+                        </view>
+                    </template>
                 </up-form-item>
 
                 <!-- 检验报告与供应商信息 -->
@@ -59,7 +165,7 @@
 
                 <!-- 个体标识:此处仅占位,后续可改为多选列表 -->
                 <up-form-item borderBottom label="是否有个体标识" prop="animalIds">
-                    <up-input v-model="form.animalIds" placeholder="如有个体标识,请稍后补充明细" border="none" disabled></up-input>
+                    
                 </up-form-item>
 
                 <!-- 媒体与附件 -->
@@ -75,10 +181,12 @@
                     <up-input v-model="form.adcode" placeholder="请输入种源产地行政编码" border="none" clearable></up-input>
                 </up-form-item>
                 <up-form-item borderBottom label="繁殖材料" prop="generationMaterial">
-                    <up-input v-model="form.generationMaterial" placeholder="请输入繁殖材料" border="none" clearable></up-input>
+                    <up-input v-model="form.generationMaterial" placeholder="请输入繁殖材料" border="none"
+                        clearable></up-input>
                 </up-form-item>
                 <up-form-item borderBottom label="繁殖地点/采集地点" prop="generationAdcode">
-                    <up-input v-model="form.generationAdcode" placeholder="请输入繁殖/采集地点编码或名称" border="none" clearable></up-input>
+                    <up-input v-model="form.generationAdcode" placeholder="请输入繁殖/采集地点编码或名称" border="none"
+                        clearable></up-input>
                 </up-form-item>
 
                 <!-- 资质证明附件(暂按上传控件处理,可后续细化) -->
@@ -112,7 +220,7 @@
 import { useClientRequest } from '@/utils/request';
 import { seedInfoListType } from '../models/type';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_seed_type } = toRefs<any>(proxy?.useDict('pt_seed_type'));
+const { pt_seed_type, pt_seed_source, pt_materail_unit, pt_mother_father_flag } = toRefs<any>(proxy?.useDict('pt_seed_type', 'pt_seed_source', 'pt_materail_unit', 'pt_mother_father_flag'));
 const paging = ref<any>(null);
 const upFormRef = ref<any>(null);
 const form = ref<seedInfoListType>({
@@ -122,6 +230,7 @@ const form = ref<seedInfoListType>({
     newSpCert: [],
     importCert: [],
     seedCheckCert: [],
+    unit: '株',
 });
 const rules = reactive({});
 
@@ -146,10 +255,51 @@ const submitForm = async () => {
             }
         },
         500,
-        true
+        true,
     );
 };
+// 去选择物种基原
+const selectVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        console.log(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.fatherVarietyId = data.msg.id;
+        form.value.fatherVarietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择父本品种',
+        },
+    });
+};
+const selectMotherVarietyId = () => {
+    uni.$once('updateBiologicalname', function (data) {
+        form.value.motherVarietyId = data.msg.id;
+        form.value.motherVarietyInfo = data.msg;
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/por-torganism/index',
+        params: {
+            title: '选择母本品种',
+        },
+    });
+};
 const did = ref('');
 onLoad((optins: any) => {
     if (optins.id) {
@@ -159,4 +309,15 @@ onLoad((optins: any) => {
     }
 });
 </script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.card-info-block {
+    border: 1rpx solid #afddbb;
+    border-radius: 10rpx;
+}
+
+.close-icon {
+    position: absolute;
+    top: 0rpx;
+    right: 0rpx;
+}
+</style>

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


+ 11 - 1
src/tools/por-torganism/index.vue

@@ -2,7 +2,7 @@
     <z-paging ref="paging" v-model="list" bgColor="#fff" @query="query" :auto="false" safe-area-inset-bottom>
         <template #top>
             <view class="">
-                <up-navbar title="选择动植物名称" @leftClick="navigateBackOrHome()" :fixed="false"></up-navbar>
+                <up-navbar :title="title" @leftClick="navigateBackOrHome()" :fixed="false"></up-navbar>
                 <view class="pd-24">
                     <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" @change="changeSeach" margin="0" :border="false" placeholder="可输入药材名称或动植物基原名称搜索" bgColor="#f7f7f7" height="86rpx" borderRadius="16rpx"></ut-search>
                 </view>
@@ -62,6 +62,7 @@
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
 import SpeLable from './models/speLable.vue';
+import { recursiveDecodeURIComponentSimple } from '@/utils/ruoyi';
 const paging = ref();
 const list = ref<any[]>([]);
 const form = ref({
@@ -108,6 +109,15 @@ const save = () => {
     uni.$emit('updateBiologicalname', { msg: res });
     uni.navigateBack({ delta: 1 });
 };
+const title = ref('选择动植物名称');
+onLoad((options) => {
+    console.log(options);
+    
+    const decodedOptions = recursiveDecodeURIComponentSimple(options);
+    if (decodedOptions?.title) {
+        title.value = decodedOptions?.title || '选择动植物名称';
+    }
+});
 onMounted(() => {
     getSpecies();
 });