ソースを参照

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

lisy 2 週間 前
コミット
83631d035c

+ 16 - 10
src/components/ut-album/ut-album.vue

@@ -75,8 +75,11 @@ const inputValue = computed(() => (props.modelValue !== null && props.modelValue
 // 解析后缀,识别文件类型
 const getTypeByUrl = (url) => {
     if (!url) return 'file';
-    const u = (url.split('?')[0] || '').toLowerCase();
-    const ext = (u.split('.').pop() || '').trim();
+    // 清理可能包裹的引号并取无查询参数的部分
+    const cleaned = String(url).trim().replace(/^['"]+|['"]+$/g, '');
+    const u = (cleaned.split('?')[0] || '').toLowerCase();
+    // 提取扩展名并去除非字母数字的尾随字符(如引号)
+    let ext = (u.split('.').pop() || '').trim().replace(/[^a-z0-9]+$/g, '');
     const imgExt = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'];
     const videoExt = ['mp4', 'mov', 'avi', 'mkv', 'webm', 'm4v'];
     if (imgExt.includes(ext)) return 'image';
@@ -96,23 +99,26 @@ const items = computed(() => {
         let size = undefined;
         let coverUrl = '';
         if (typeof raw === 'string') {
-            url = raw;
+            url = String(raw).trim().replace(/^['"]+|['"]+$/g, '');
         } else if (typeof raw === 'object') {
-            url = raw[props.keyName] || raw.url || '';
+            url = String(raw[props.keyName] || raw.url || '').trim().replace(/^['"]+|['"]+$/g, '');
             name = raw[props.nameKey] || raw.name || '';
             size = raw[props.sizeKey] || raw.size;
-            coverUrl = raw[props.coverKey] || raw.coverUrl || '';
+            coverUrl = String(raw[props.coverKey] || raw.coverUrl || '').trim().replace(/^['"]+|['"]+$/g, '');
         }
         if (!url) return;
         const originalUrl = (url.split('?')[0] || url);
         const type = getTypeByUrl(originalUrl);
+        
         out.push({ type, url, originalUrl, name, size, coverUrl });
     };
-    if (Array.isArray(v)) {
-        v.forEach(pushItem);
-    } else {
-        pushItem(v);
-    }
+        if (Array.isArray(v)) {
+            v.forEach(pushItem);
+        } else if (typeof v === 'string') {
+            v.split(',').forEach((s) => pushItem(s));
+        } else {
+            pushItem(v);
+        }
     return out;
 });
 

+ 6 - 2
src/components/ut-upload/ut-upload.vue

@@ -280,7 +280,7 @@ function emitCurrentValue() {
     const urls = validList.map((i) => i.url).filter(Boolean);
     let out: any;
     if (props.valueType === 'string') {
-        out = urls[0] || '';
+        out = props.multiple ? urls.join(',') : (urls[0] || '');
     } else if (props.valueType === 'array') {
         out = validList;
     } else {
@@ -298,7 +298,11 @@ watch(
         }
         if (props.valueType === 'string') {
             if (typeof val === 'string') {
-                fileList.value = val ? [{ url: val }] : [];
+                const parts = val
+                    .split(',')
+                    .map((s) => String(s).trim().replace(/^['"]+|['"]+$/g, ''))
+                    .filter((s) => !!s);
+                fileList.value = parts.map((u) => ({ url: u }));
             }
         } else if (props.valueType === 'array') {
             if (Array.isArray(val)) {

+ 7 - 0
src/pages.json

@@ -100,6 +100,13 @@
                     "style": {
                         "navigationBarTitleText": "标记三无一全基地"
                     }
+                },
+                // 标记三无一全基地详情
+                {
+                    "path": "mark-swyq-base-detail/index",
+                    "style": {
+                        "navigationBarTitleText": "三无一全基地详情"
+                    }
                 }
             ]
         },

+ 19 - 1
src/plant/base/base-detail/index.vue

@@ -299,7 +299,25 @@
             <template #bottom>
                 <view class="pd-20 d-flex">
                     <template v-if="!+form.baseInfo?.tempFlag">
-                        <up-button class="mr-20" color="#18BECA">去标记为三无一全基地{{ '>' }}</up-button>
+                        <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/mark-swyq-base/index', params: { id: did } })" v-if="!form?.baseInfo?.swyqRes" class="mr-20" color="#18BECA">去标记为三无一全基地{{ '>' }}</up-button>
+                        <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/mark-swyq-base-detail/index', params: { id: did } })" v-if="['2'].includes(form?.baseInfo?.swyqRes)" class="mr-20" color="#FC333F">
+                            <view>
+                                <view>标记为三无一全基地</view>
+                                <view>未通过{{ '>' }}</view>
+                            </view>
+                        </up-button>
+                        <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/mark-swyq-base-detail/index', params: { id: did } })" v-if="['0'].includes(form?.baseInfo?.swyqRes)" class="mr-20" color="#F4A91A">
+                            <view>
+                                <view>标记为三无一全基地</view>
+                                <view>待审核{{ '>' }}</view>
+                            </view>
+                        </up-button>
+                        <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/mark-swyq-base-detail/index', params: { id: did } })" v-if="['1'].includes(form?.baseInfo?.swyqRes)" class="mr-20" color="#AECEBF">
+                            <view>
+                                <view>标记为三无一全基地</view>
+                                <view>已通过{{ '>' }}</view>
+                            </view>
+                        </up-button>
                     </template>
                     <up-button @click="$u.route({ type: 'redirect', url: '/plant/base/base-edit/index', params: { id: did } })" type="primary">修改</up-button>
                 </view>

+ 0 - 381
src/plant/base/gap-base-info-detai/index.vue

@@ -1,381 +0,0 @@
-<template>
-    <view class="ksqulc">
-        <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" refresher-only @onRefresh="onRefresh" scroll-with-animation>
-            <template #top>
-                <ut-navbar title="基地详情" :fixed="false" border></ut-navbar>
-                <view class="bg-fff mb-20">
-                    <view class="pd-5"></view>
-                    <ut-tabs v-model="activeTab" :tabs="tabs" mode="btw" @change="changeActiveTab"></ut-tabs>
-                </view>
-            </template>
-            <view class="p-rtv">
-                <!-- 基本信息 -->
-                <view ref="baseRef" class="pd-24" id="base12345">
-                    <view class="startline-title">基本信息</view>
-                </view>
-                <view class="pd-24 bg-#fff mb-10">
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地类型:</span>
-                        <span class="c-#333">{{ selectDictLabel(pt_base_type, form?.baseInfo?.baseType) || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地名称:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.baseName || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地编号:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.baseCode || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">建设时间:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.buildDate || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地组织方式:</span>
-                        <span class="c-#333">{{ selectDictLabel(pt_org_type, form?.baseInfo?.orgType) || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地负责人:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.contactName || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">联系电话:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.contactTel || '-' }}</span>
-                    </view>
-                    <template v-if="['1', '2'].includes(form?.baseInfo?.baseType)">
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">是否为GAP基地:</span>
-                            <span class="c-#333">{{ selectDictLabel(yes_no, form?.baseInfo?.gapFlag) || '-' }}</span>
-                        </view>
-                        <view v-if="form?.baseInfo?.gapId" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">关联GAP信息:</view>
-                            <view class="bg-#FBFDFB pd-24 p-rtv flex1 radius-10 gap-info-card">
-                                <view class="f-s-32 f-w-500 c-#333">{{ form?.baseInfo?.gapInfo?.gapBaseName || '-' }}</view>
-                                <view class="f-s-24 c-#ccc mb-10">{{ form?.baseInfo?.gapInfo?.ratedDate }}获评</view>
-                                <view class="d-flex gap-10 flex-wrap">
-                                    <view class="w-330 f-s-28">
-                                        <span class="c-#666">申报品种:</span>
-                                        <span class="c-#333 f-w-500">{{ form?.baseInfo?.gapInfo?.medicineName }}</span>
-                                    </view>
-                                    <view class="w-290 f-s-28">
-                                        <span class="c-#666">基地面积:</span>
-                                        <span class="c-#333 f-w-500">{{ form?.baseInfo?.gapInfo?.area }}{{ form?.baseInfo?.gapInfo?.areaUnit }}</span>
-                                    </view>
-                                    <view class="f-s-28">
-                                        <span class="c-#666">基地地址:</span>
-                                        <span class="c-#333 f-w-500">{{ form?.baseInfo?.gapInfo?.adcodeName }} {{ form?.baseInfo?.gapInfo?.address || '-' }}</span>
-                                    </view>
-                                </view>
-                            </view>
-                        </view>
-                    </template>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地所在地区:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.adcodeName || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">详细地址:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.address || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <view class="f-s-30 c-#666 mb-10">基地范围:</view>
-                        <view class="bg-#f7f7f7 d-flex ov-hd p-rtv">
-                            <image @click="previewImage([form?.baseInfo?.gapInfo?.basePic])" class="w-full" v-if="form?.baseInfo?.gapInfo?.basePic" preview :src="form?.baseInfo?.gapInfo?.basePic" mode="'widthFix'"></image>
-                            <view v-else class="w-full h-120 d-flex a-c j-c c-999">暂无基地范围</view>
-                        </view>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地面积:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.area || '-' }}{{ form?.baseInfo?.gapInfo?.areaUnit || mapUnitByBaseType[form?.baseInfo?.baseType || '1'] }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地经纬度:</span>
-                        <span class="c-#333">E{{ form?.baseInfo?.gapInfo?.lng || '-' }}, N{{ form?.baseInfo?.gapInfo?.lat || '-' }}</span>
-                    </view>
-                </view>
-                <view class="h-1" id="plot12345"></view>
-                <!-- 地块/圈舍/组培架信息 -->
-                <view ref="plotRef" class="pd-24">
-                    <view class="startline-title" v-if="form?.baseInfo?.baseType == '1'">地块信息</view>
-                    <view class="startline-title" v-else-if="form?.baseInfo?.baseType == '2'">圈舍信息</view>
-                    <view class="startline-title" v-else-if="form?.baseInfo?.baseType == '3'">组培架信息</view>
-                </view>
-                <view class="pd-24 bg-#fff mb-10">
-                    <template v-if="Array.isArray(form?.landInfoList) && form.landInfoList.length">
-                        <view v-for="(item, index) in form.landInfoList" :key="index" class="plot-item pd-24 mb-20">
-                            <view class="d-flex mb-16">
-                                <view class="f-s-32 f-w-5 c-#333 flex1 mr-10">{{ item?.landName || '-' }}</view>
-                                <view v-if="item?.contactName" class="f-s-24 c-#333">负责人:{{ item?.contactName }}</view>
-                            </view>
-                            <template v-if="form?.baseInfo?.baseType == '3'">
-                                <view class="d-flex flex-wrap gap-10">
-                                    <view class="f-s-28 c-#666 w-310">
-                                        <span>层数:</span>
-                                        <span class="c-#333 f-w-5">{{ item?.layers || '-' }}</span>
-                                    </view>
-                                    <view class="f-s-28 c-#666 w-310">
-                                        <span>每层容量:</span>
-                                        <span class="c-#333 f-w-5">{{ item?.capacityAmount || '-' }}{{ item?.capacityUnit || '-' }}</span>
-                                    </view>
-                                    <view class="f-s-28 c-#666 w-310">
-                                        <span>总容量:</span>
-                                        <span class="c-#333 f-w-5">{{ (item?.capacityAmount || 0) * (item?.layers || 0) || '-' }}{{ item?.capacityUnit || '-' }}</span>
-                                    </view>
-                                    <view class="f-s-28 c-#666 w-310">
-                                        <span v-if="item?.lightType" class="mr-10">{{ selectDictLabel(pt_light_type, item?.lightType) }}</span>
-                                        <span v-if="item?.tempeStatus">{{ +item?.tempeStatus ? '有独立温控' : '无独立温控' }}</span>
-                                    </view>
-                                </view>
-                            </template>
-                            <template v-else>
-                                <view class="f-s-28 c-#666">
-                                    <span>面积:</span>
-                                    <span class="c-#333 f-w-5">{{ item?.area || '-' }}{{ item?.areaUnit || '-' }}</span>
-                                </view>
-                            </template>
-                        </view>
-                    </template>
-                    <view v-else class="c-999 f-s-28">暂无信息</view>
-                </view>
-                <!-- 选址依据及环境信息 -->
-                <view  class="pd-24">
-                    <view class="startline-title">选址依据及环境信息</view>
-                </view>
-                <view class="h-1" id="environment12345"></view>
-                <!-- 基地类型 1:种植基地 -->
-                <template v-if="form?.baseInfo?.baseType == '1'">
-                    <view class="pd-24 bg-#fff mb-10">
-                        <view class="f-s-32 c-#333 f-w-600">选址依据</view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">是否道地产区:</span>
-                            <span class="c-#333">{{ selectDictLabel(yes_no, form?.environmentInfo?.daoStatus) || '-' }}</span>
-                        </view>
-                        <view v-if="form?.environmentInfo?.adaptFile?.length" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">基地选址依据/标准:</view>
-                            <ut-album :urls="form?.environmentInfo?.adaptFile"></ut-album>
-                        </view>
-                        <view v-if="form?.environmentInfo?.accordFile?.length" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">适应性证明材料:</view>
-                            <ut-album :urls="form?.environmentInfo?.accordFile"></ut-album>
-                        </view>
-                    </view>
-                    <view class="pd-24 bg-#fff mb-10">
-                        <view class="f-s-32 c-#333 f-w-600">环境信息</view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">土壤类型:</span>
-                            <span class="c-#333">{{ selectDictLabel(pt_soil_type, form?.environmentInfo?.soilType) || '-' }}</span>
-                        </view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">土壤质地:</span>
-                            <span class="c-#333">{{ selectDictLabel(pt_soil_texture, form?.environmentInfo?.soilTexture) || '-' }}</span>
-                        </view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">有机质含量:</span>
-                            <span class="c-#333">{{ form?.environmentInfo?.organic || '-' }}</span>
-                        </view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">土壤PH值:</span>
-                            <span class="c-#333">{{ form?.environmentInfo?.soilPh || '-' }}</span>
-                        </view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">水源类型:</span>
-                            <span class="c-#333">{{ selectDictLabel(pt_water_type, form?.environmentInfo?.waterType) || '-' }}</span>
-                        </view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">无霜期:</span><span class="c-#333">{{ form?.environmentInfo?.notFrost || '-' }}<text v-if="form?.environmentInfo?.notFrost">天</text></span>
-                        </view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年降水量:</span><span class="c-#333">{{ form?.environmentInfo?.precipitation || '-' }}<text v-if="form?.environmentInfo?.precipitation">mm</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年平均气温:</span><span class="c-#333">{{ form?.environmentInfo?.avgTem || '-' }}<text v-if="form?.environmentInfo?.avgTem">℃</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年绝对最高气温:</span><span class="c-#333">{{ form?.environmentInfo?.maxTem || '-' }}<text v-if="form?.environmentInfo?.maxTem">℃</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年绝对最低气温:</span><span class="c-#333">{{ form?.environmentInfo?.minTem || '-' }}<text v-if="form?.environmentInfo?.minTem">℃</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年日照时数:</span><span class="c-#333">{{ form?.environmentInfo?.sunshineHours || '-' }}<text v-if="form?.environmentInfo?.sunshineHours">小时</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">海拔:</span><span class="c-#333">{{ form?.environmentInfo?.altitude || '-' }}<text v-if="form?.environmentInfo?.altitude">米</text></span></view
-                        >
-                        <view v-if="form?.environmentInfo?.report?.length" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">水、土壤、大气等环评报告:</view>
-                            <ut-album :urls="form?.environmentInfo?.report"></ut-album>
-                        </view>
-                        <view v-if="form?.environmentInfo?.basePic" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">基地图片:</view>
-                            <ut-album :urls="form?.environmentInfo?.basePic"></ut-album>
-                        </view>
-                        <view v-if="form?.environmentInfo?.baseVoice?.length" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">基地视频:</view>
-                            <ut-album :urls="form?.environmentInfo?.baseVoice"></ut-album>
-                        </view>
-                    </view>
-                </template>
-
-                <!-- 基地类型 2:养殖基地 -->
-                <template v-else-if="form?.baseInfo?.baseType == '2'">
-                    <view class="pd-24 bg-#fff mb-10">
-                        <view class="f-s-32 c-#333 f-w-600">选址依据</view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom">
-                            <span class="c-#666">是否道地产区:</span>
-                            <span class="c-#333">{{ selectDictLabel(yes_no, form?.environmentInfo?.daoStatus) || '-' }}</span>
-                        </view>
-                        <view v-if="form?.environmentInfo?.adaptFile?.length" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">基地选址依据/标准:</view>
-                            <ut-album :urls="form?.environmentInfo?.adaptFile"></ut-album>
-                        </view>
-                        <view v-if="form?.environmentInfo?.accordFile?.length" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">适应性证明材料:</view>
-                            <ut-album :urls="form?.environmentInfo?.accordFile"></ut-album>
-                        </view>
-                    </view>
-                    <view class="pd-24 bg-#fff mb-10">
-                        <view class="f-s-32 c-#333 f-w-600">环境信息</view>
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">水源类型:</span><span class="c-#333">{{ selectDictLabel(pt_water_type, form?.environmentInfo?.waterType) || '-' }}</span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">无霜期:</span><span class="c-#333">{{ form?.environmentInfo?.notFrost || '-' }}<text v-if="form?.environmentInfo?.notFrost">天</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年降水量:</span><span class="c-#333">{{ form?.environmentInfo?.precipitation || '-' }}<text v-if="form?.environmentInfo?.precipitation">mm</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年平均气温:</span><span class="c-#333">{{ form?.environmentInfo?.avgTem || '-' }}<text v-if="form?.environmentInfo?.avgTem">℃</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年绝对最高气温:</span><span class="c-#333">{{ form?.environmentInfo?.maxTem || '-' }}<text v-if="form?.environmentInfo?.maxTem">℃</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年绝对最低气温:</span><span class="c-#333">{{ form?.environmentInfo?.minTem || '-' }}<text v-if="form?.environmentInfo?.minTem">℃</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">年日照时数:</span><span class="c-#333">{{ form?.environmentInfo?.sunshineHours || '-' }}<text v-if="form?.environmentInfo?.sunshineHours">小时</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">海拔:</span><span class="c-#333">{{ form?.environmentInfo?.altitude || '-' }}<text v-if="form?.environmentInfo?.altitude">米</text></span></view
-                        >
-                        <view v-if="form?.environmentInfo?.report?.length" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">水、大气等环评报告:</view>
-                            <ut-album :urls="form?.environmentInfo?.report"></ut-album>
-                        </view>
-                        <view v-if="form?.environmentInfo?.basePic" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">基地图片:</view>
-                            <ut-album :urls="form?.environmentInfo?.basePic"></ut-album>
-                        </view>
-                        <view v-if="form?.environmentInfo?.baseVoice?.length" class="f-s-30 pd2-16-0 info-border-bottom">
-                            <view class="c-#666 mb-10">基地视频:</view>
-                            <ut-album :urls="form?.environmentInfo?.baseVoice"></ut-album>
-                        </view>
-                    </view>
-                </template>
-                <!-- 基地类型 3:组培基地 -->
-                <template v-else-if="form?.baseInfo?.baseType == '3'">
-                    <view class="pd-24 bg-#fff mb-10">
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">温度:</span><span class="c-#333">{{ form?.environmentInfo?.avgTem || '-' }}<text v-if="form?.environmentInfo?.avgTem">℃</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">湿度:</span><span class="c-#333">{{ form?.environmentInfo?.humidity || '-' }}<text v-if="form?.environmentInfo?.humidity">%</text></span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">洁净度:</span><span class="c-#333">{{ form?.environmentInfo?.clean || '-' }}</span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">光照:</span><span class="c-#333">{{ form?.environmentInfo?.light || '-' }}</span></view
-                        >
-                        <view class="f-s-30 pd2-16-0 info-border-bottom"
-                            ><span class="c-#666">光照周期:</span><span class="c-#333">{{ form?.environmentInfo?.lightCycle || '-' }}</span></view
-                        >
-                    </view>
-                </template>
-           
-            </view>
-            <template #bottom>
-                <view class="pd-20 d-flex">
-                    <template v-if="!+form.baseInfo?.tempFlag">
-                        <up-button class="mr-20" color="#18BECA">去标记为三无一全基地{{ '>' }}</up-button>
-                    </template>
-                    <up-button @click="$u.route({ type: 'redirect', url: '/plant/base/base-edit/index', params: { id: did } })" type="primary">修改</up-button>
-                </view>
-            </template>
-        </z-paging>
-    </view>
-</template>
-<script setup lang="ts">
-import { useClientRequest } from '@/utils/request';
-import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
-const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { yes_no, pt_org_type, pt_base_type, pt_water_type, pt_soil_type, pt_soil_texture, pt_light_type, pt_capacity_unit } = toRefs<any>(proxy?.useDict('yes_no', 'pt_org_type', 'pt_base_type', 'pt_water_type', 'pt_soil_type', 'pt_soil_texture', 'pt_light_type', 'pt_capacity_unit'));
-const tabs = reactive([
-    { label: '基本信息', value: 'base' },
-    { label: '地块信息', value: 'plot' },
-    { label: '选址依据及环境信息', value: 'environment' },
-]);
-const activeTab = ref('base');
-const paging = ref<any>(null);
-const mapUnitByBaseType: any = {
-    '1': '亩',
-    '2': '平方米',
-    '3': '平方米',
-};
-const form = ref<any>({});
-
-const changeActiveTab = (value: any) => {
-    const v = typeof value === 'string' ? value : value?.value;
-    const id = `${v}12345`;
-    paging.value?.scrollIntoViewById(id, 30, true);
-};
-const did = ref('');
-// 根据id获取基地详情
-const getDetailById = async (id: string) => {
-    const res = await useClientRequest.get(`/plt-api/app/base/getInfoAllById/${id}`);
-    if (res && res.code === 200) {
-        form.value = res.data || {};
-    }
-};
-const onRefresh = () => {
-    getDetailById(did.value);
-    paging.value?.complete();
-};
-// 判断节点是否在可视区域内如果在则切换tab createIntersectionObserver
-
-onLoad((options: any) => {
-    did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
-    getDetailById(did.value);
-});
-</script>
-<style lang="scss" scoped>
-.z-paging-wrap {
-    position: absolute;
-    right: 0;
-    top: 0;
-    bottom: 0;
-    left: 0;
-}
-
-.btn-aree-center {
-    position: absolute;
-    top: 0;
-    right: 0;
-    bottom: 0;
-    left: 0;
-}
-
-.plot-item {
-    border: 1rpx solid rgba($u-primary, 0.4);
-    border-radius: 10rpx;
-}
-.gap-info-card {
-    border: 1rpx solid rgba($u-primary, 0.4);
-}
-.ksqulc {
-    position: relative;
-    height: 100vh;
-}
-</style>

+ 134 - 0
src/plant/base/gap-base-info-detail/index.vue

@@ -0,0 +1,134 @@
+<template>
+    <view class="ksqulc">
+        <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" refresher-only @onRefresh="onRefresh" scroll-with-animation>
+            <template #top>
+                <ut-navbar leftText="GAP基地获评信息详情" :fixed="false" border></ut-navbar>
+            </template>
+            <view class="p-rtv">
+                <!-- 基本信息 -->
+                <image class="gap_res_image w-160 h-160" :src="`/static/images/plant/base/gap_res${form.res}.png`" mode="widthFix" />
+                <view class="pd-24 bg-#fff mb-10">
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地类型:</span>
+                        <span class="c-#333">{{ selectDictLabel(pt_base_type, form?.gapBaseType) || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地名称:</span>
+                        <span class="c-#333">{{ form?.gapBaseName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">获评品种:</span>
+                        <span class="c-#333">{{ form?.medicineName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">获评时间:</span>
+                        <span class="c-#333">{{ form?.ratedDate || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地所在地区:</span>
+                        <span class="c-#333">{{ form?.adcodeName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">详细地址:</span>
+                        <span class="c-#333">{{ form?.address || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <view class="f-s-30 c-#666 mb-10">基地范围:</view>
+                        <view class="bg-#f7f7f7 d-flex ov-hd p-rtv">
+                            <image class="w-full" v-if="form?.basePic" :src="form?.basePic" mode="widthFix" @click="previewBasePic"></image>
+                            <view v-else class="w-full h-120 d-flex a-c j-c c-999">暂无基地范围</view>
+                        </view>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地面积:</span>
+                        <span class="c-#333">{{ form?.area || '-' }}{{ form?.areaUnit || '亩' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地经纬度:</span>
+                        <span class="c-#333">E{{ form?.lng || '-' }}, N{{ form?.lat || '-' }}</span>
+                    </view>
+                    <view v-if="form?.certFile" class="f-s-30 pd2-16-0 info-border-bottom">
+                        <view class="f-s-30 c-#666 mb-10">官方公示证明材料</view>
+                        <ut-album :urls="form?.certFile"></ut-album>
+                    </view>
+                    <view v-if="form?.url" class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">官方公示网址:</span>
+                        <span class="c-#333">{{ form?.url || '-' }}</span>
+                    </view>
+                </view>
+            </view>
+            <template v-if="form.res == '2'" #bottom>
+                <view class="pd-20 d-flex">
+                    <up-button @click="$u.route({ type: 'redirect', url: '/plant/base/gap-base-info-edit/index', params: { id: did } })" type="primary">修改</up-button>
+                </view>
+            </template>
+        </z-paging>
+    </view>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_base_type } = toRefs<any>(proxy?.useDict('pt_base_type'));
+const paging = ref<any>(null);
+const form = ref<any>({});
+const did = ref('');
+
+// 获取详情(GAP获评信息)
+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 onRefresh = () => {
+    getDetailById(did.value);
+    paging.value?.complete();
+};
+
+// 页面入参解析并加载
+onLoad((options: any) => {
+    did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
+    getDetailById(did.value);
+});
+
+// 预览基地范围图片
+const previewBasePic = () => {
+    const url = form.value?.basePic;
+    if (!url) return;
+    uni.previewImage({ urls: [url], current: 0 });
+};
+</script>
+<style lang="scss" scoped>
+.z-paging-wrap {
+    position: absolute;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    left: 0;
+}
+
+.btn-aree-center {
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+}
+
+.plot-item {
+    border: 1rpx solid rgba($u-primary, 0.4);
+    border-radius: 10rpx;
+}
+.gap-info-card {
+    border: 1rpx solid rgba($u-primary, 0.4);
+}
+
+.gap_res_image {
+    position: absolute;
+    right: 30rpx;
+    top: 30rpx;
+}
+</style>

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

@@ -29,7 +29,7 @@
                     <!-- 选择获评品种 -->
                     <view class="h-1" id="medicineIdpppp"></view>
                     <up-form-item @click="selectMedicine" borderBottom label="获评品种" required prop="medicineId">
-                        <view v-if="form.medicineId" class="f-s-30 c-333 f-w-5 flex1">{{ form.contactName }}</view>
+                        <view v-if="form.medicineId" class="f-s-30 c-333 f-w-5 flex1">{{ form.medicineName }}</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>
@@ -217,7 +217,7 @@ const submitForm = async () => {
                 await upFormRef.value?.validate();
             } catch (error: any) {
                 // 滚动到第一个错误字段
-                const firstErrorField = error && error[0].prop;
+                const firstErrorField = error && error[0].prop + 'pppp';
                 paging.value?.scrollIntoViewById(firstErrorField, 30, true);
                 return;
             }
@@ -234,6 +234,7 @@ const submitForm = async () => {
                     title: '提交成功',
                     icon: 'success',
                 });
+                uni.$emit('gapBaseInfoUpdated');
                 // 返回上一页
                 setTimeout(() => {
                     uni.navigateBack();
@@ -287,7 +288,7 @@ const mapDrawArea = async () => {
 const selectMedicine = () => {
     uni.$on('medicineSelected', (medicine: any) => {
         form.value.medicineId = medicine.id;
-        form.value.contactName = medicine.medicineName;
+        form.value.medicineName = medicine.varietyName;
         uni.$off('medicineSelected');
     });
     uni.$u.route({

+ 41 - 14
src/plant/base/gap-base-info/index.vue

@@ -4,7 +4,7 @@
             <ut-navbar title="GAP基地信息" :fixed="false" border></ut-navbar>
             <view class="d-flex a-c pd-25">
                 <view class="min-w-170 flex1">
-                    <ut-action-sheet v-model="form.type" :tabs="tabs" @change="onRefresh" title="选择基地类型">
+                    <ut-action-sheet v-model="form.res" :tabs="tabs" @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>
@@ -20,8 +20,8 @@
             <template>
                 <view class="pl-25 pr-25">
                     <up-swipe-action>
-                        <up-swipe-action-item v-for="item in list" :name="item?.id" :key="item?.id" :options="optionsAction" @click="clickSwipe" class="mb-20 b-radius">
-                            <view class="b-radius bg-#fff pd-20 p-rtv">
+                        <up-swipe-action-item v-for="item in list" :name="item?.id" :key="item?.id" :disabled="item?.res !== '2'" :options="optionsAction" @click="clickSwipe" class="mb-20 b-radius">
+                            <view @click.stop="clickItem(item)" class="b-radius bg-#fff pd-20 p-rtv">
                                 <view class="c-#333 f-s-34 f-w-5 pb-5">{{ item?.gapBaseName }}</view>
                                 <view class="c-#999 f-s-24 pb-20">{{ item?.ratedDate }}获评</view>
                                 <view class="d-flex pb-5">
@@ -36,7 +36,7 @@
                                 </view>
                                 <view class="pb-20">
                                     <text class="c-#666 f-s-28">基地地址:</text>
-                                    <text class="c-#333 f-s-28 f-w-5">{{ item?.address }}</text>
+                                    <text class="c-#333 f-s-28 f-w-5">{{ item?.adcodeName }}{{ item?.address }}</text>
                                 </view>
                                 <view v-if="+item?.res == 2" class="pl-5 pr-5 pt-20 pb-20 border-top-#f7f7f7 c-#FC333F">
                                     <text class="f-s-28">审核不通过原因:</text>
@@ -82,9 +82,9 @@ const list = ref<any[]>([]);
 const placeholder = ref('搜基地名称、品种、基地地址');
 const tabs = ref([
     { label: '全部', value: '' },
-    { label: '有效', value: '0' },
-    { label: '审核不通过', value: '1' },
-    { label: '待审核', value: '2' },
+    { label: '有效', value: '1' },
+    { label: '审核不通过', value: '2' },
+    { label: '待审核', value: '0' },
 ]);
 // 判断是否是云南的企业
 const isYunnanCompany = (): boolean => {
@@ -94,7 +94,7 @@ const isYunnanCompany = (): boolean => {
 const address = computed(() => isYunnanCompany());
 const form = ref({
     keyword: '',
-    type: '',
+    res: '',
 });
 
 const query = async (pageNum: number, pageSize: number) => {
@@ -103,17 +103,14 @@ const query = async (pageNum: number, pageSize: number) => {
         pageSize,
         ...form.value,
     };
-    // const res = await cpyList(params);
-    ///app/gapCertificationInfo/pageList
     const res = await useClientRequest.get<any>('/plt-api/app/gapCertificationInfo/pageList', params);
+    if (!res || res.code !== 200) return;
     const { rows } = res;
     paging.value.complete(rows);
 };
 const onRefresh = () => {
     paging.value.reload();
 };
-// 处理地块数据
-const showAction = ref(false);
 const optionsAction = reactive([
     {
         text: '删除',
@@ -122,9 +119,39 @@ const optionsAction = reactive([
         },
     },
 ]);
-const clickSwipe = (index: object) => {
-    console.log(index);
+const clickSwipe = async (event: object) => {
+    const { name, index } = event as any;
+    if (index === 0) {
+        // 删除
+        const res = await uni.showModal({
+            title: '提示',
+            content: '确定删除该GAP基地信息吗?',
+        });
+        console.log(res);
+        
+        if (res.confirm) {
+            const delRes = await useClientRequest.get(`/plt-api/app/gapCertificationInfo/delById/${name}`);
+            if (delRes && delRes.code === 200) {
+                uni.showToast({ title: '删除成功', icon: 'none' });
+                onRefresh();
+            }
+        }
+    }
 };
+const clickItem = (item: any) => {
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/plant/base/gap-base-info-detail/index',
+        params: {
+            id: item?.id,
+        },
+    });
+};
+onMounted(() => {
+    uni.$on('gapBaseInfoUpdated', () => {
+        onRefresh();
+    });
+});
 </script>
 <style lang="scss" scoped>
 // @import '@/assets/styles/theme.scss';

+ 154 - 0
src/plant/base/mark-swyq-base-detail/index.vue

@@ -0,0 +1,154 @@
+<template>
+    <view class="ksqulc">
+        <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" refresher-only @onRefresh="onRefresh" scroll-with-animation>
+            <template #top>
+                <ut-navbar title="标记为三无一全基地" :fixed="false" border></ut-navbar>
+            </template>
+            <view class="p-rtv">
+                <view ref="baseRef" class="pd-24" id="base12345">
+                    <view class="startline-title">证明材料</view>
+                </view>
+                <view class="pd-24 bg-#fff mb-10 p-rtv">
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">获评品种:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.swyqVarietyName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">获评时间:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.swyqRatedDate || '-' }}</span>
+                    </view>
+                    <view v-if="form?.baseInfo?.swyqCertFile" class="f-s-30 pd2-16-0 info-border-bottom">
+                        <view class="f-s-30 c-#666 mb-10">官方公示证明材料</view>
+                        <ut-album :urls="form?.baseInfo?.swyqCertFile"></ut-album>
+                    </view>
+                    <view v-if="form?.baseInfo?.swyqUrl" class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">官方公示网址:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.swyqUrl || '-' }}</span>
+                    </view>
+                </view>
+                <view ref="baseRef" class="pd-24" id="base12345">
+                    <view class="startline-title">所标记的基本信息如下</view>
+                </view>
+                <view class="pd-24 bg-#fff mb-10">
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地名称:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.baseName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地类型:</span>
+                        <span class="c-#333">{{ selectDictLabel(pt_base_type, form?.baseInfo?.baseType) || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <view class="f-s-30 c-#666 mb-10">基地范围:</view>
+                        <view class="bg-#f7f7f7 d-flex ov-hd p-rtv">
+                            <image @click="previewImage([form?.baseInfo?.gapInfo?.basePic])" class="w-full" v-if="form?.baseInfo?.gapInfo?.basePic" preview :src="form?.baseInfo?.gapInfo?.basePic" mode="'widthFix'"></image>
+                            <view v-else class="w-full h-120 d-flex a-c j-c c-999">暂无基地范围</view>
+                        </view>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地面积:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.area || '-' }}{{ form?.baseInfo?.gapInfo?.areaUnit || mapUnitByBaseType[form?.baseInfo?.baseType || '1'] }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地所在地区:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.adcodeName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">详细地址:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.address || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地经纬度:</span>
+                        <span class="c-#333">E{{ form?.baseInfo?.gapInfo?.lng || '-' }}, N{{ form?.baseInfo?.gapInfo?.lat || '-' }}</span>
+                    </view>
+                </view>
+            </view>
+            <template #bottom>
+                <view class="pd-20">
+                    <view></view>
+                    <up-button type="primary">去修改</up-button>
+                </view>
+            </template>
+        </z-paging>
+    </view>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { yes_no, pt_org_type, pt_base_type, pt_water_type, pt_soil_type, pt_soil_texture, pt_light_type, pt_capacity_unit } = toRefs<any>(proxy?.useDict('yes_no', 'pt_org_type', 'pt_base_type', 'pt_water_type', 'pt_soil_type', 'pt_soil_texture', 'pt_light_type', 'pt_capacity_unit'));
+const tabs = reactive([
+    { label: '基本信息', value: 'base' },
+    { label: '地块信息', value: 'plot' },
+    { label: '选址依据及环境信息', value: 'environment' },
+]);
+const activeTab = ref('base');
+const paging = ref<any>(null);
+const mapUnitByBaseType: any = {
+    '1': '亩',
+    '2': '平方米',
+    '3': '平方米',
+};
+const form = ref<any>({});
+const formSwyq = ref<any>({
+    swyqVarietyId: '',
+    swyqVarietyName: '',
+    swyqRatedDate: '',
+    swyqCertFile: '',
+    swyqUrl: '',
+});
+const rulesSwyq = reactive<any>({
+    swyqVarietyId: [{ required: true, message: '请选择获评品种', trigger: 'blur' }],
+    swyqRatedDate: [{ required: true, message: '请选择获评三无一全基地时间', trigger: 'blur' }],
+    swyqCertFile: [{ required: true, message: '请上传官方公示证明材料', trigger: 'blur' }],
+    swyqUrl: [{ required: true, message: '请输入官方公示网址', trigger: 'blur' }],
+});
+
+const did = ref('');
+// 根据id获取基地详情
+const getDetailById = async (id: string) => {
+    const res = await useClientRequest.get(`/plt-api/app/base/getInfoAllById/${id}`);
+    if (res && res.code === 200) {
+        form.value = res.data || {};
+    }
+};
+const onRefresh = () => {
+    getDetailById(did.value);
+    paging.value?.complete();
+};
+// 判断节点是否在可视区域内如果在则切换tab createIntersectionObserver
+
+onLoad((options: any) => {
+    did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
+    getDetailById(did.value);
+});
+</script>
+<style lang="scss" scoped>
+.z-paging-wrap {
+    position: absolute;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    left: 0;
+}
+
+.btn-aree-center {
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+}
+
+.plot-item {
+    border: 1rpx solid rgba($u-primary, 0.4);
+    border-radius: 10rpx;
+}
+.gap-info-card {
+    border: 1rpx solid rgba($u-primary, 0.4);
+}
+.ksqulc {
+    position: relative;
+    height: 100vh;
+}
+</style>

+ 240 - 2
src/plant/base/mark-swyq-base/index.vue

@@ -1,3 +1,241 @@
 <template>
-    
-</template>
+    <view class="ksqulc">
+        <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" refresher-only @onRefresh="onRefresh" scroll-with-animation>
+            <template #top>
+                <ut-navbar title="标记为三无一全基地" :fixed="false" border></ut-navbar>
+            </template>
+            <view class="p-rtv">
+                <view ref="baseRef" class="pd-24" id="base12345">
+                    <view class="startline-title">证明材料</view>
+                </view>
+                <view class="pd-24 bg-#fff mb-10">
+                    <up-form class="p-rtv" labelPosition="top" :model="formSwyq" :rules="rulesSwyq" labelWidth="auto" ref="upFormRef">
+                        <!-- 校验定位:基地类型 -->
+                        <!-- 基地信息部分 -->
+                        <view>
+                            <!-- 选择获评品种 -->
+                            <view class="h-1" id="swyqVarietyIdpppp"></view>
+                            <up-form-item @click="selectMedicine" borderBottom label="获评品种" required prop="swyqVarietyId">
+                                <view v-if="formSwyq.swyqVarietyId" class="f-s-30 c-333 f-w-5 flex1">{{ formSwyq.swyqVarietyName }}</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>
+                            <!-- 校验定位:建设时间 -->
+                            <view class="h-1" id="swyqRatedDatepppp"></view>
+                            <ut-datetime-picker v-model="formSwyq.swyqRatedDate" mode="date" dateFields="day">
+                                <up-form-item borderBottom label="获评三无一全基地时间" required prop="swyqRatedDate">
+                                    <up-input v-model="formSwyq.swyqRatedDate" 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>
+                            <!-- 官方公示证明材料 -->
+                            <view class="h-1" id="swyqCertFilepppp"></view>
+                            <up-form-item borderBottom required prop="swyqCertFile">
+                                <view class="flex1">
+                                    <view style="margin-bottom: 10rpx">
+                                        <span class="c-666 f-s-30">官方公示证明材料</span>
+                                        <span class="f-s-26 c-999">(可上传9张)</span>
+                                    </view>
+                                    <ut-upload v-model="formSwyq.swyqCertFile" :max-count="9"></ut-upload>
+                                </view>
+                            </up-form-item>
+                            <!-- 官方公示网址 -->
+                            <view class="h-1" id="swyqUrlpppp"></view>
+                            <up-form-item borderBottom label="官方公示网址" prop="swyqUrl" required>
+                                <up-input v-model="formSwyq.swyqUrl" placeholder="请输入官方公示网址" border="none" clearable></up-input>
+                            </up-form-item>
+                        </view>
+                    </up-form>
+                </view>
+                <view ref="baseRef" class="pd-24" id="base12345">
+                    <view class="startline-title">所标记的基本信息如下,请核对</view>
+                </view>
+                <view class="pd-24 bg-#fff mb-10">
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地名称:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.baseName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地类型:</span>
+                        <span class="c-#333">{{ selectDictLabel(pt_base_type, form?.baseInfo?.baseType) || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <view class="f-s-30 c-#666 mb-10">基地范围:</view>
+                        <view class="bg-#f7f7f7 d-flex ov-hd p-rtv">
+                            <image @click="previewImage([form?.baseInfo?.gapInfo?.basePic])" class="w-full" v-if="form?.baseInfo?.gapInfo?.basePic" preview :src="form?.baseInfo?.gapInfo?.basePic" mode="'widthFix'"></image>
+                            <view v-else class="w-full h-120 d-flex a-c j-c c-999">暂无基地范围</view>
+                        </view>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地面积:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.area || '-' }}{{ form?.baseInfo?.gapInfo?.areaUnit || mapUnitByBaseType[form?.baseInfo?.baseType || '1'] }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地所在地区:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.adcodeName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">详细地址:</span>
+                        <span class="c-#333">{{ form?.baseInfo?.gapInfo?.address || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">基地经纬度:</span>
+                        <span class="c-#333">E{{ form?.baseInfo?.gapInfo?.lng || '-' }}, N{{ form?.baseInfo?.gapInfo?.lat || '-' }}</span>
+                    </view>
+                </view>
+            </view>
+            <template #bottom>
+                <view class="pd-20 d-flex">
+                    <up-button type="primary" @click="submitForm">确认并提交</up-button>
+                </view>
+            </template>
+        </z-paging>
+    </view>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { yes_no, pt_org_type, pt_base_type, pt_water_type, pt_soil_type, pt_soil_texture, pt_light_type, pt_capacity_unit } = toRefs<any>(proxy?.useDict('yes_no', 'pt_org_type', 'pt_base_type', 'pt_water_type', 'pt_soil_type', 'pt_soil_texture', 'pt_light_type', 'pt_capacity_unit'));
+const tabs = reactive([
+    { label: '基本信息', value: 'base' },
+    { label: '地块信息', value: 'plot' },
+    { label: '选址依据及环境信息', value: 'environment' },
+]);
+const activeTab = ref('base');
+const paging = ref<any>(null);
+const mapUnitByBaseType: any = {
+    '1': '亩',
+    '2': '平方米',
+    '3': '平方米',
+};
+const form = ref<any>({});
+const formSwyq = ref<any>({
+    swyqVarietyId: undefined,
+    swyqVarietyName: '',
+    swyqRatedDate: '',
+    swyqCertFile: '',
+    swyqUrl: '',
+});
+const rulesSwyq = reactive<any>({
+    swyqVarietyId: [{ type: 'number', required: true, message: '请选择获评品种', trigger: 'change' }],
+    swyqRatedDate: [{ required: true, message: '请选择获评三无一全基地时间', trigger: 'change' }],
+    swyqCertFile: [{ required: true, message: '请上传官方公示证明材料', trigger: 'change' }],
+    swyqUrl: [{ required: true, message: '请输入官方公示网址', trigger: 'change' }],
+});
+// 改成去选择获评品种页面
+const selectMedicine = () => {
+    uni.$on('medicineSelected', (medicine: any) => {
+        console.log(medicine);
+        
+        formSwyq.value.swyqVarietyId = medicine.id;
+        formSwyq.value.swyqVarietyName = medicine.varietyName;
+        uni.$off('medicineSelected');
+    });
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/select-medicine/index',
+        params: {
+            singleSelect: true,
+        },
+    });
+};
+const did = ref('');
+// 根据id获取基地详情
+const getDetailById = async (id: string) => {
+    const res = await useClientRequest.get(`/plt-api/app/base/getInfoAllById/${id}`);
+    if (res && res.code === 200) {
+        form.value = res.data || {};
+    }
+};
+const onRefresh = () => {
+    getDetailById(did.value);
+    paging.value?.complete();
+};
+const upFormRef = ref<any>(null);
+const submitForm = async () => {
+    uni.$u.debounce(
+        async () => {
+            try {
+                await upFormRef.value?.validate();
+            } catch (error: any) {
+                console.log(error);
+                
+                // 滚动到第一个错误字段
+                const firstErrorField = error && error[0].prop + 'pppp';
+                paging.value?.scrollIntoViewById(firstErrorField, 30, true);
+                return;
+            }
+            // 提交表单
+            uni.showLoading({
+                title: '提交中...',
+            });
+            try {
+                const res = await useClientRequest.post('/plt-api/app/base/addSwyqBase', {
+                    ...formSwyq.value,
+                    id: did.value,
+                });
+                uni.hideLoading();
+                if (!res || res !== 200) return;
+                uni.hideLoading();
+                uni.showToast({
+                    title: '提交成功',
+                    icon: 'success',
+                });
+                uni.$emit('swyqBaseInfoUpdated');
+                // 返回上一页
+                uni.$u.route({
+                    type: 'redirect',
+                    url: '/plant/base/mark-swyq-base-detail/index',
+                    params: {
+                        id: did.value,
+                    },
+                });
+            } catch (error) {
+                uni.hideLoading();
+            }
+        },
+        500,
+        true
+    );
+};
+// 判断节点是否在可视区域内如果在则切换tab createIntersectionObserver
+
+onLoad((options: any) => {
+    did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
+    getDetailById(did.value);
+});
+</script>
+<style lang="scss" scoped>
+.z-paging-wrap {
+    position: absolute;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    left: 0;
+}
+
+.btn-aree-center {
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+}
+
+.plot-item {
+    border: 1rpx solid rgba($u-primary, 0.4);
+    border-radius: 10rpx;
+}
+.gap-info-card {
+    border: 1rpx solid rgba($u-primary, 0.4);
+}
+.ksqulc {
+    position: relative;
+    height: 100vh;
+}
+</style>

+ 0 - 0
src/static/images/plant/待审核.png → src/static/images/plant/base/gap_res0.png


+ 0 - 0
src/static/images/plant/有效.png → src/static/images/plant/base/gap_res1.png


+ 0 - 0
src/static/images/plant/未通过.png → src/static/images/plant/base/gap_res2.png


+ 3 - 0
src/utils/ruoyi.ts

@@ -413,6 +413,9 @@ export const recursiveDecodeURIComponentSimple = (obj: any): any => {
 };
 // 将url提取参数
 export const getUrlParams = (url: string): Record<string, string> => {
+    if (!url || typeof url !== 'string') {
+        return {};
+    }
     const params: Record<string, string> = {};
     const queryString = url.split('?')[1];
     if (!queryString) {