Selaa lähdekoodia

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

lisy 3 viikkoa sitten
vanhempi
säilyke
7610d3675e

+ 241 - 11
src/audit/plant/base/audit-detail/index.vue

@@ -1,18 +1,248 @@
 <template>
-    <template v-if="viewType == 'gapbase'">
-        <GapDetail :id="did"></GapDetail>
-    </template>
-    <template v-else-if="viewType == 'swyqbase'">
-        <SwyqDetail :id="did"></SwyqDetail>
-    </template>
+     <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 v-if="formRes?.res == '2'" class="pd-24 c-#FC333F f-s-24 bg-#F8E7E8">审核不通过理由:{{formRes?.msg}}</view>
+            <view class="p-rtv">
+                <!-- 基本信息 -->
+                <image v-if="formRes?.res !== '0'" class="gap_res_image w-160 h-160" :src="`https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/common/base_res_logo${formRes.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_form, formRes?.type) || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">获评品种:</span>
+                        <span class="c-#333">{{ formRes.medicineName || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">获评日期:</span>
+                        <span class="c-#333">{{ formRes?.ratedDate || '-' }}</span>
+                    </view>
+                    <view v-if="formRes.certFile" class="f-s-30 pd2-16-0 info-border-bottom">
+                        <view class="f-s-30 c-#666 mb-10">官方公示证明材料</view>
+                        <ut-album :urls="formRes.certFile"></ut-album>
+                    </view>
+                    <view v-if="formRes.certUrl" class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">官方公示网址:</span>
+                        <span class="c-#333">{{ formRes.certUrl || '-' }}</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">{{ 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?.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 class="w-full" v-if="form?.baseInfo?.gapInfo?.basePic" :src="form?.baseInfo?.gapInfo?.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?.baseInfo?.gapInfo?.area || '-' }}{{ form?.baseInfo?.gapInfo?.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?.baseInfo?.gapInfo?.lng || '-' }}, N{{ form?.baseInfo?.gapInfo?.lat || '-' }}</span>
+                    </view>
+                </view>
+            </view>
+            <template v-if="formRes.res == '0'" #bottom>
+                <view class="pd-20 d-flex">
+                    <up-button @click="passAudit" class="mr-30" type="primary">审核通过</up-button>
+                    <up-button @click="showNoPass = true" type="error">审核不通过</up-button>
+                </view>
+            </template>
+        </z-paging>
+        <ut-confirm-dialog v-model:show="showNoPass" width="680rpx">
+            <view>
+                <up-form ref="upFormNoPassRef" :model="formNoPass" :rules="noPassRules" labelWidth="auto" class="p-rtv" labelPosition="top">
+                    <up-form-item label="不通过原因" prop="msg" required>
+                        <up-textarea v-model="formNoPass.msg" :maxlength="200" placeholder="请输入不通过原因" auto-height></up-textarea>
+                    </up-form-item>
+                </up-form>
+            </view>
+            <template #footer>
+                <view class="d-flex j-c pd-30">
+                    <up-button @click="showNoPass = false" class="mr-30">取消</up-button>
+                    <up-button @click="noPassAudit" type="error">确认不通过</up-button>
+                </view>
+            </template>
+        </ut-confirm-dialog>
 </template>
 <script setup lang="ts">
-import GapDetail from './models/gap-detail.vue';
-import SwyqDetail from './models/swyq-detail.vue';
-const viewType = ref('');
+import { useClientRequest } from '@/utils/request';
+import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_base_type, pt_base_form } = toRefs<any>(proxy?.useDict('pt_base_type', 'pt_base_form'));
+const paging = ref<any>(null);
+const form = ref<any>({});
 const did = ref('');
+
+// 获取详情(GAP获评信息)
+const getDetailById = async (id: string) => {
+    const res = await useClientRequest.get(`/plt-api/app/base/getInfoAllById/${id}`);
+    if (!res || res.code !== 200) return;
+    form.value = res.data || {};
+    res?.data?.baseInfo?.resInfo?.forEach((item: any) => {
+        if (item?.type === formRes.value.type) {
+            formRes.value = {
+                ...item
+            }
+        }
+    });
+};
+
+const onRefresh = () => {
+    getDetailById(did.value);
+    paging.value?.complete();
+};
+
+// 预览基地范围图片
+const previewBasePic = () => {
+    const url = form.value?.gapInfo.basePic;
+    if (!url) return;
+    uni.previewImage({ urls: [url], current: 0 });
+};
+const passAudit = async () => {
+    try {
+        const res = await uni.showModal({
+            title: '通过提示',
+            content: '确认通过该基地审核吗?',
+            confirmColor: '#37A954',
+            confirmText: '确认',
+        });
+        if (!res.confirm && !res.content) return;
+        await uni.showLoading({
+            title: '通过中...',
+            mask: true,
+        });
+         const resq: any = await useClientRequest.post(`/plt-api/app/base/approvalSwyq`, {
+            targetId: did.value,
+            res: '1',
+            targetType: formRes.value.type,
+        });
+        if (!resq || resq.code !== 200) return;
+        uni.hideLoading();
+        uni.showToast({
+            title: '操作成功',
+            icon: 'success',
+        });
+        paging.value?.reload();
+        uni.$emit('refreshSwyqListAudit');
+        //返回上一页
+        uni.navigateBack({
+            delta: 1,
+        });
+    } catch (error) {
+        console.error('通过基地审核失败:', error);
+    }
+};
+const showNoPass = ref(false);
+const upFormNoPassRef = ref<any>(null);
+const noPassRules = {
+    msg: [
+        { required: true, message: '请输入不通过原因' },
+        { min: 2, max: 200, message: '不通过原因长度在2到200个字符之间' },
+    ],
+};
+const formRes = ref<any>({
+    type: '',
+    medicineCode: undefined,
+    medicineName: '',
+    ratedDate: '',
+    certFile: '',
+    certUrl: '',
+});
+const formNoPass = ref({
+    msg: '',
+});
+const noPassAudit = async () => {
+    try {
+        const valid = await upFormNoPassRef.value?.validate();
+        if (!valid) return;
+    } catch (error) {
+        return;
+    }
+    try {
+     
+        await uni.showLoading({
+            title: '提交中...',
+            mask: true,
+        });
+        await useClientRequest.post(`/plt-api/app/base/approvalSwyq`, {
+            targetId: did.value,
+            res: '2',
+            ...formNoPass.value,
+            targetType: formRes.value.type,
+        });
+        uni.hideLoading();
+        uni.showToast({
+            title: '操作成功',
+            icon: 'success',
+        });
+        showNoPass.value = false;
+        paging.value?.reload();
+        uni.$emit('refreshSwyqBaseListAudit');
+        //返回上一页
+        uni.navigateBack({
+            delta: 1,
+        });
+    } catch (error) {
+        console.error('不通过基地审核失败:', error);
+    }
+};
+
 onLoad((options: any) => {
-    viewType.value = options.viewType || '';
-    did.value = options.id || '';
+    did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
+    formRes.value.type = options?.type || getUrlParams(recursiveDecodeURIComponent(options?.q))?.type || '';
+    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);
+}
+
+.gap_res_image {
+    position: absolute;
+    right: 30rpx;
+    top: 30rpx;
+}
+</style>

+ 0 - 237
src/audit/plant/base/audit-detail/models/gap-detail.vue

@@ -1,237 +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>
-            </template>
-            <view v-if="form?.res == '2'" class="pd-24 c-#FC333F f-s-24 bg-#F8E7E8">审核不通过理由:{{form?.msg}}</view>
-            <view class="p-rtv">
-                <!-- 基本信息 -->
-                <image v-if="form?.res !== '0'" class="gap_res_image w-160 h-160" :src="`https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/common/base_res_logo${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">GAP</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 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 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">{{ 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?.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>
-            </view>
-            <template v-if="form.res == '0'" #bottom>
-                <view class="pd-20 d-flex">
-                    <up-button @click="passAudit" class="mr-30" type="primary">审核通过</up-button>
-                    <up-button @click="showNoPass = true" type="error">审核不通过</up-button>
-                </view>
-            </template>
-        </z-paging>
-        <ut-confirm-dialog v-model:show="showNoPass" width="680rpx">
-            <view>
-                <up-form ref="upFormNoPassRef" :model="formNoPass" :rules="noPassRules" labelWidth="auto" class="p-rtv" labelPosition="top">
-                    <up-form-item label="不通过原因" prop="msg" required>
-                        <up-textarea v-model="formNoPass.msg" :maxlength="200" placeholder="请输入不通过原因" auto-height></up-textarea>
-                    </up-form-item>
-                </up-form>
-            </view>
-            <template #footer>
-                <view class="d-flex j-c pd-30">
-                    <up-button @click="showNoPass = false" class="mr-30">取消</up-button>
-                    <up-button @click="noPassAudit" type="error">确认不通过</up-button>
-                </view>
-            </template>
-        </ut-confirm-dialog>
-    </view>
-</template>
-<script setup lang="ts">
-import { useClientRequest } from '@/utils/request';
-import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
-const props = defineProps({
-    id: {
-        type: String,
-        default: '',
-    },
-});
-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 () => {
-    if (!props.id) return;
-    const res = await useClientRequest.get(`/plt-api/app/gapCertificationInfo/getInfoByIdApproval/${props.id}`);
-    if (res && res.code === 200) {
-        form.value = res.data || {};
-    }
-};
-
-const onRefresh = () => {
-    getDetailById();
-    paging.value?.complete();
-};
-onMounted(() => {
-    getDetailById();
-});
-// 预览基地范围图片
-const previewBasePic = () => {
-    const url = form.value?.basePic;
-    if (!url) return;
-    uni.previewImage({ urls: [url], current: 0 });
-};
-const passAudit = async () => {
-    try {
-        const res = await uni.showModal({
-            title: '通过提示',
-            content: '确认通过该基地审核吗?',
-            confirmColor: '#37A954',
-            confirmText: '确认',
-        });
-        if (!res.confirm && !res.content) return;
-        await uni.showLoading({
-            title: '通过中...',
-            mask: true,
-        });
-        const resq = await useClientRequest.post(`/plt-api/app/gapCertificationInfo/approveGapBaseApproval`, {
-            targetId: props.id,
-            res: '1',
-        });
-        if (!resq || resq.code !== 200) return;
-        uni.hideLoading();
-        uni.showToast({
-            title: '操作成功',
-            icon: 'success',
-        });
-        paging.value?.reload();
-        uni.$emit('refreshGapBaseListAudit');
-        //返回上一页
-        uni.navigateBack({
-            delta: 1,
-        });
-    } catch (error) {
-        console.error('通过基地审核失败:', error);
-    }
-};
-const showNoPass = ref(false);
-const upFormNoPassRef = ref<any>(null);
-const noPassRules = {
-    msg: [
-        { required: true, message: '请输入不通过原因' },
-        { min: 2, max: 200, message: '不通过原因长度在2到200个字符之间' },
-    ],
-};
-const formNoPass = ref({
-    msg: '',
-});
-const noPassAudit = async () => {
-    try {
-        const valid = await upFormNoPassRef.value?.validate();
-        if (!valid) return;
-    } catch (error) {
-        return;
-    }
-    try {
-     
-        await uni.showLoading({
-            title: '提交中...',
-            mask: true,
-        });
-        const res = await useClientRequest.post(`/plt-api/app/gapCertificationInfo/approveGapBaseApproval`, {
-            targetId: props.id,
-            res: '2',
-            ...formNoPass.value,
-        });
-        if (!res || res.code !== 200) return;
-        uni.hideLoading();
-        uni.showToast({
-            title: '操作成功',
-            icon: 'success',
-        });
-        showNoPass.value = false;
-        paging.value?.reload();
-        uni.$emit('refreshGapBaseListAudit');
-        //返回上一页
-        uni.navigateBack({
-            delta: 1,
-        });
-    } catch (error) {
-        console.error('不通过基地审核失败:', error);
-    }
-};
-</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>

+ 0 - 236
src/audit/plant/base/audit-detail/models/swyq-detail.vue

@@ -1,236 +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>
-            </template>
-            <view v-if="form?.swyqRes == '2'" class="pd-24 c-#FC333F f-s-24 bg-#F8E7E8">审核不通过理由:{{form?.msg}}</view>
-            <view class="p-rtv">
-                <!-- 基本信息 -->
-                <image v-if="form?.res !== '0'" class="gap_res_image w-160 h-160" :src="`https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/common/base_res_logo${form.swyqRes}.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">三无一全</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">获评品种:</span>
-                        <span class="c-#333">{{ form?.swyqMedicineName || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">获评日期:</span>
-                        <span class="c-#333">{{ form?.swyqRatedDate || '-' }}</span>
-                    </view>
-                    <view v-if="form?.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?.swyqCertFile"></ut-album>
-                    </view>
-                    <view v-if="form?.swyqUrl" class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">官方公示网址:</span>
-                        <span class="c-#333">{{ form?.swyqUrl || '-' }}</span>
-                    </view>
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地名称:</span>
-                        <span class="c-#333">{{ form?.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?.baseType) || '-' }}</span>
-                    </view>
-
-                    <view class="f-s-30 pd2-16-0 info-border-bottom">
-                        <span class="c-#666">基地所在地区:</span>
-                        <span class="c-#333">{{ form?.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?.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 class="w-full" v-if="form?.gapInfo?.basePic" :src="form?.gapInfo?.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?.gapInfo?.area || '-' }}{{ form?.gapInfo?.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?.gapInfo?.lng || '-' }}, N{{ form?.gapInfo?.lat || '-' }}</span>
-                    </view>
-                </view>
-            </view>
-            <template v-if="form.swyqRes == '0'" #bottom>
-                <view class="pd-20 d-flex">
-                    <up-button @click="passAudit" class="mr-30" type="primary">审核通过</up-button>
-                    <up-button @click="showNoPass = true" type="error">审核不通过</up-button>
-                </view>
-            </template>
-        </z-paging>
-        <ut-confirm-dialog v-model:show="showNoPass" width="680rpx">
-            <view>
-                <up-form ref="upFormNoPassRef" :model="formNoPass" :rules="noPassRules" labelWidth="auto" class="p-rtv" labelPosition="top">
-                    <up-form-item label="不通过原因" prop="msg" required>
-                        <up-textarea v-model="formNoPass.msg" :maxlength="200" placeholder="请输入不通过原因" auto-height></up-textarea>
-                    </up-form-item>
-                </up-form>
-            </view>
-            <template #footer>
-                <view class="d-flex j-c pd-30">
-                    <up-button @click="showNoPass = false" class="mr-30">取消</up-button>
-                    <up-button @click="noPassAudit" type="error">确认不通过</up-button>
-                </view>
-            </template>
-        </ut-confirm-dialog>
-    </view>
-</template>
-<script setup lang="ts">
-import { useClientRequest } from '@/utils/request';
-import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
-const props = defineProps({
-    id: {
-        type: String,
-        default: '',
-    },
-});
-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 () => {
-    if (!props.id) return;
-    const res = await useClientRequest.get(`/plt-api/app/base/getInfoById/${props.id}`);
-    if (res && res.code === 200) {
-        form.value = res.data || {};
-    }
-};
-
-const onRefresh = () => {
-    getDetailById();
-    paging.value?.complete();
-};
-onMounted(() => {
-    getDetailById();
-});
-// 预览基地范围图片
-const previewBasePic = () => {
-    const url = form.value?.gapInfo.basePic;
-    if (!url) return;
-    uni.previewImage({ urls: [url], current: 0 });
-};
-const passAudit = async () => {
-    try {
-        const res = await uni.showModal({
-            title: '通过提示',
-            content: '确认通过该基地审核吗?',
-            confirmColor: '#37A954',
-            confirmText: '确认',
-        });
-        if (!res.confirm && !res.content) return;
-        await uni.showLoading({
-            title: '通过中...',
-            mask: true,
-        });
-         const resq: any = await useClientRequest.post(`/plt-api/app/base/approvalSwyq`, {
-            targetId: props.id,
-            res: '1',
-        });
-        if (!resq || resq.code !== 200) return;
-        uni.hideLoading();
-        uni.showToast({
-            title: '操作成功',
-            icon: 'success',
-        });
-        paging.value?.reload();
-        uni.$emit('refreshSwyqListAudit');
-        //返回上一页
-        uni.navigateBack({
-            delta: 1,
-        });
-    } catch (error) {
-        console.error('通过基地审核失败:', error);
-    }
-};
-const showNoPass = ref(false);
-const upFormNoPassRef = ref<any>(null);
-const noPassRules = {
-    msg: [
-        { required: true, message: '请输入不通过原因' },
-        { min: 2, max: 200, message: '不通过原因长度在2到200个字符之间' },
-    ],
-};
-const formNoPass = ref({
-    msg: '',
-});
-const noPassAudit = async () => {
-    try {
-        const valid = await upFormNoPassRef.value?.validate();
-        if (!valid) return;
-    } catch (error) {
-        return;
-    }
-    try {
-     
-        await uni.showLoading({
-            title: '提交中...',
-            mask: true,
-        });
-        await useClientRequest.post(`/plt-api/app/base/approvalSwyq`, {
-            targetId: props.id,
-            res: '2',
-            ...formNoPass.value,
-        });
-        uni.hideLoading();
-        uni.showToast({
-            title: '操作成功',
-            icon: 'success',
-        });
-        showNoPass.value = false;
-        paging.value?.reload();
-        uni.$emit('refreshSwyqBaseListAudit');
-        //返回上一页
-        uni.navigateBack({
-            delta: 1,
-        });
-    } catch (error) {
-        console.error('不通过基地审核失败:', error);
-    }
-};
-</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>

+ 16 - 10
src/audit/plant/base/audit-list/models/gap-base.vue

@@ -19,30 +19,30 @@
             </view>
             <view class="pd2-10-24">
                 <template v-for="(item, index) in list" :key="index">
-                    <view class="b-radius bg-#fff pd4-46-20-20-36 p-rtv mb-20" @click.stop="$u.route({ url: '/audit/plant/base/audit-detail/index', params: { id: item.id, viewType: 'gapbase' } })">
+                    <view class="b-radius bg-#fff pd4-46-20-20-36 p-rtv mb-20" @click.stop="$u.route({ url: '/audit/plant/base/audit-detail/index', params: { id: item.id, type: '1' } })">
                         <view class="mb-10">
-                            <view class="c-#333 f-s-34 f-w-5 pb-5">{{ item?.gapBaseName }}</view>
-                            <view class="c-#999 f-s-24">{{ item?.ratedDate }}获评</view>
+                            <view class="c-#333 f-s-34 f-w-5 pb-5">{{ item?.baseName }}</view>
+                            <view class="c-#999 f-s-24">{{ selectDictResInfo(form.applyType, item?.resInfo)?.ratedDate || '' }}获评</view>
                         </view>
                         <view class="d-flex pb-5">
                             <view class="w-50%">
                                 <text class="c-#666 f-s-28">获评品种:</text>
-                                <text class="c-#333 f-s-28 f-w-5">{{ item?.medicineName || '-' }}</text>
+                                <text class="c-#333 f-s-28 f-w-5">{{ selectDictResInfo(form.applyType, item?.resInfo)?.medicineName || '-' }}</text>
                             </view>
                             <view class="w-50%">
                                 <text class="c-#666 f-s-28">基地面积:</text>
-                                <text class="c-#333 f-s-28 f-w-5">{{ item?.area }}{{ item?.areaUnit || '亩' }}</text>
+                                <text class="c-#333 f-s-28 f-w-5">{{ item?.gapInfo?.area }}{{ item?.gapInfo?.areaUnit || '亩' }}</text>
                             </view>
                         </view>
                         <view class="pb-20">
                             <text class="c-#666 f-s-28">基地地址:</text>
-                            <text class="c-#333 f-s-28 f-w-5">{{ item?.adcodeName }}{{ item?.address }}</text>
+                            <text class="c-#333 f-s-28 f-w-5">{{ item?.gapInfo?.adcodeName }}{{ item?.gapInfo?.address }}</text>
                         </view>
                         <view class="d-flex">
                             <view class="flex1 ov-hd"></view>
                             <view>
                                 <up-button
-                                    v-if="item?.res == '0'"
+                                    v-if="selectDictResInfo(form.applyType, item?.resInfo)?.res == '0'"
                                     color="#306EFE"
                                     :customStyle="{
                                         fontSize: '30rpx',
@@ -64,7 +64,7 @@
                                 >
                             </view>
                         </view>
-                        <view class="status-tag" :class="{ [`bg-res-${item?.res}`]: true }">{{ selectDictLabel(tabs, item?.res) }}</view>
+                        <view class="status-tag" :class="{ [`bg-res-${selectDictResInfo(form.applyType, item?.resInfo)?.res}`]: true }">{{ selectDictLabel(tabs, selectDictResInfo(form.applyType, item?.resInfo)?.res) }}</view>
                         <image class="gap_tag_item_logo" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/audit/plant/gap_tag_item_logo.png" mode="widthFix" />
                     </view>
                 </template>
@@ -90,6 +90,7 @@ const tabs = ref([
 const form = ref({
     keyword: '',
     res: '0',
+    applyType: '1'
 });
 const query = async (pageNum: number, pageSize: number) => {
     const params = {
@@ -100,16 +101,21 @@ const query = async (pageNum: number, pageSize: number) => {
     if (pageNum === 1) {
         getBaseCount();
     }
-    const res = await useClientRequest.get<any>('/plt-api/app/gapCertificationInfo/pageListApproval', params);
+    const res = await useClientRequest.get<any>('/plt-api/app/base/querySwyqList', params);
     if (!res || res.code !== 200) return;
     const { rows } = res;
     paging.value.complete(rows);
 };
+// 获取resInfo里面的值
+const selectDictResInfo = (type: string, resInfo: any[]) => {
+    const item = resInfo.find((item) => item.type === type);
+    return item;
+};
 const typeNums = ref<Array<{ label: string; value: string }>>([]);
 // 获取统计信息
 const getBaseCount = async () => {
     try {
-        const res = await useClientRequest.get('/plt-api/app/gapCertificationInfo/gapApprovalCount', form.value);
+        const res = await useClientRequest.get('/plt-api/app/base/baseApprovalCount', form.value);
         if (res?.code === 200) {
             console.log(res);
             typeNums.value = res.data?.map((item: any) => {

+ 14 - 8
src/audit/plant/base/audit-list/models/swyq-base.vue

@@ -6,9 +6,9 @@
             <!-- 如果希望其他view跟着页面滚动,可以放在z-paging标签内 -->
             <view class="d-flex a-c pd2-10-24">
                 <view class="min-w-240 flex1">
-                    <ut-action-sheet v-model="form.swyqRes" :tabs="typeNums" @change="onRefresh" title="选择审核状态">
+                    <ut-action-sheet v-model="form.res" :tabs="typeNums" @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">{{ selectDictLabel(typeNums, form.swyqRes) || '全部' }}</view>
+                            <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ selectDictLabel(typeNums, form.res) || '全部' }}</view>
                             <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="ml-5"></up-icon>
                         </view>
                     </ut-action-sheet>
@@ -19,15 +19,15 @@
             </view>
             <view class="pd2-10-24">
                 <template v-for="(item, index) in list" :key="index">
-                    <view class="b-radius bg-#fff pd4-46-20-20-36 p-rtv mb-20" @click.stop="$u.route({ url: '/audit/plant/base/audit-detail/index', params: { id: item.id, viewType: 'swyqbase' } })">
+                    <view class="b-radius bg-#fff pd4-46-20-20-36 p-rtv mb-20" @click.stop="$u.route({ url: '/audit/plant/base/audit-detail/index', params: { id: item.id, type: '2' } })">
                         <view class="mb-10">
                             <view class="c-#333 f-s-34 f-w-5 pb-5">{{ item?.baseName }}</view>
-                            <view class="c-#999 f-s-24">{{ item?.swyqRatedDate }}获评</view>
+                            <view class="c-#999 f-s-24">{{ selectDictResInfo(form.applyType, item?.resInfo)?.ratedDate || '' }}获评</view>
                         </view>
                         <view class="d-flex pb-5">
                             <view class="w-50%">
                                 <text class="c-#666 f-s-28">获评品种:</text>
-                                <text class="c-#333 f-s-28 f-w-5">{{ item?.swyqMedicineName || '-' }}</text>
+                                <text class="c-#333 f-s-28 f-w-5">{{ selectDictResInfo(form.applyType, item?.resInfo)?.medicineName || '-' }}</text>
                             </view>
                             <view class="w-50%">
                                 <text class="c-#666 f-s-28">基地面积:</text>
@@ -42,7 +42,7 @@
                             <view class="flex1 ov-hd"></view>
                             <view>
                                 <up-button
-                                    v-if="item?.res == '0'"
+                                    v-if="selectDictResInfo(form.applyType, item?.resInfo)?.res == '0'"
                                     color="#306EFE"
                                     :customStyle="{
                                         fontSize: '30rpx',
@@ -64,7 +64,7 @@
                                 >
                             </view>
                         </view>
-                        <view class="status-tag" :class="{ [`bg-res-${item?.swyqRes}`]: true }">{{ selectDictLabel(tabs, item?.swyqRes) }}</view>
+                        <view class="status-tag" :class="{ [`bg-res-${selectDictResInfo(form.applyType, item?.resInfo)?.res}`]: true }">{{ selectDictLabel(tabs, selectDictResInfo(form.applyType, item?.resInfo)?.res) }}</view>
                         <image class="swyq_tag_item_logo" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/audit/plant/swyq_tag_item_logo.png" mode="widthFix" />
                     </view>
                 </template>
@@ -87,9 +87,15 @@ const tabs = ref([
     { label: '审核未通过', value: '2' },
     { label: '待审核', value: '0' },
 ]);
+// 获取resInfo里面的值
+const selectDictResInfo = (type: string, resInfo: any[]) => {
+    const item = resInfo.find((item) => item.type === type);
+    return item;
+};
 const form = ref({
     keyword: '',
-    swyqRes: '0',
+    res: '0',
+    applyType: '2'
 });
 const query = async (pageNum: number, pageSize: number) => {
     const params = {

+ 25 - 23
src/components/ut-action-sheet/ut-action-sheet.vue

@@ -8,31 +8,33 @@
         <view @click="showModel = true" class="flex1">
             <slot></slot>
         </view>
-        <up-popup v-model:show="showModel" mode="center" round="30rpx" :safeAreaInsetBottom="false" closeable @close="showModel = false">
-            <view class="w-700">
-                <view class="pd-24">
-                    <view class="f-s-32 c-#333 f-w-500">{{ title }}</view>
-                </view>
-                <scroll-view scroll-y style="max-height: 70vh">
-                    <view class="pd3-10-24-24">
-                        <ut-row gap="16rpx">
-                            <template v-for="(item, index) in options" :key="index">
-                                <ut-col :span="item.span">
-                                    <view @click="clickCol(item)" class="ut-custom-item-sheet p-rtv" :class="{ active: checkeds[item.value] }"
-                                        >{{ item?.remark || 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>
+        <root-portal>
+            <up-popup v-model:show="showModel" mode="center" round="30rpx" :safeAreaInsetBottom="false" closeable @close="showModel = false">
+                <view class="w-700">
+                    <view class="pd-24">
+                        <view class="f-s-32 c-#333 f-w-500">{{ title }}</view>
+                    </view>
+                    <scroll-view scroll-y style="max-height: 70vh">
+                        <view class="pd3-10-24-24">
+                            <ut-row gap="16rpx">
+                                <template v-for="(item, index) in options" :key="index">
+                                    <ut-col :span="item.span">
+                                        <view @click="clickCol(item)" class="ut-custom-item-sheet p-rtv" :class="{ active: checkeds[item.value] }"
+                                            >{{ item?.remark || 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>
+                        </view>
+                    </scroll-view>
+                    <view v-if="multiple" class="d-flex j-c pd-24">
+                        <up-button class="mr-20" @click="onCancel">取消</up-button>
+                        <up-button type="primary" @click="onConfirm">确定</up-button>
                     </view>
-                </scroll-view>
-                <view v-if="multiple" class="d-flex j-c pd-24">
-                    <up-button class="mr-20" @click="onCancel">取消</up-button>
-                    <up-button type="primary" @click="onConfirm">确定</up-button>
                 </view>
-            </view>
-        </up-popup>
+            </up-popup>
+        </root-portal>
     </template>
 </template>
 <script setup lang="ts">

+ 6 - 15
src/components/ut-datetime-picker/ut-datetime-picker.vue

@@ -11,18 +11,9 @@
         <view @click.stop="showTime = true" class="ut-datetime-picker" :class="{ 'ut-datetime-picker--border': border }">
             <slot></slot>
         </view>
-        <up-datetime-picker
-            v-model:show="showTime"
-            :minDate="minDateTs"
-            :maxDate="maxDateTs"
-            ref="datetimePickerRef"
-            :title="title"
-            v-model="form.startTime"
-            :mode="mode"
-            @cancel="cancel"
-            confirmColor="#2a6d52"
-            @confirm="confirm"
-        ></up-datetime-picker>
+        <root-portal>
+            <up-datetime-picker v-model:show="showTime" :minDate="minDateTs" :maxDate="maxDateTs" ref="datetimePickerRef" :title="title" v-model="form.startTime" :mode="mode" @cancel="cancel" confirmColor="#2a6d52" @confirm="confirm"></up-datetime-picker>
+        </root-portal>
     </template>
 </template>
 <script setup lang="ts">
@@ -52,7 +43,7 @@ const props = withDefaults(defineProps<Props>(), {
     maxDate: new Date(2050, 0, 1).getTime(),
     dateFields: 'day',
     // 留空以便按粒度自动输出:year→{y},month→{y}-{m},day→{y}-{m}-{d}
-    dateFormat: ''
+    dateFormat: '',
 });
 
 const emit = defineEmits<{
@@ -72,7 +63,7 @@ const toTs = (v: number | string | Date | undefined | null): number => {
 };
 
 const form = ref({
-    startTime: toTs(props.modelValue as any)
+    startTime: toTs(props.modelValue as any),
 });
 
 // 当使用原生 picker 的 date 模式时,格式化绑定和边界值(随粒度变化)
@@ -130,4 +121,4 @@ const onPickerChange = (e: any) => {
 const cancel = () => {
     showTime.value = false;
 };
-</script>
+</script>

+ 76 - 81
src/components/ut-picker-area/ut-picker-area.vue

@@ -1,77 +1,74 @@
 <template>
-    <u-popup :show="show" mode="bottom" round="30rpx" closeable @close="close">
-        <view class="up-picker-area d-flex flex-cln">
-            <!-- 标题 -->
-            <view class="area-title">{{ title }}</view>
-            <!-- 顶部链路 -->
-            <view class="area-breadcrumb">
-                <!-- 全国根:selectCodeMax 为空或 000000 时显示 -->
-                <template v-if="isNationRoot">
-                    <view class="crumb disabled" @click="onClickNationBreadcrumb">全国</view>
-                    <view class="sep" v-if="selectedCodes.length">/</view>
-                </template>
-                <!-- 基础链路(selectCodeMax 的完整链路),仅最后一个可点击以切换到第一页(市级) -->
-                <template v-for="(code, idx) in baseChain" :key="'base-' + code">
-                    <view class="crumb" :class="idx === baseChain.length - 1 ? '' : 'disabled'" @click="idx === baseChain.length - 1 && onClickBaseBreadcrumb()">
-                        {{ getNameByCode(code) }}
-                    </view>
-                    <view class="sep" v-if="idx < baseChain.length - 1 || selectedCodes.length">/</view>
-                </template>
-
-                <!-- 选中链路 -->
-                <template v-for="(code, idx) in selectedCodes" :key="'sel-' + code">
-                    <view class="crumb" :class="{ active: idx === currentSwiper }" @click="jumpToLevel(idx)">
-                        {{ getNameByCode(code) }}
-                    </view>
-                    <view class="sep" v-if="idx < selectedCodes.length - 1">/</view>
-                </template>
-            </view>
+    <root-portal>
+        <u-popup :show="show" mode="bottom" round="30rpx" closeable @close="close">
+            <view class="up-picker-area d-flex flex-cln">
+                <!-- 标题 -->
+                <view class="area-title">{{ title }}</view>
+                <!-- 顶部链路 -->
+                <view class="area-breadcrumb">
+                    <!-- 全国根:selectCodeMax 为空或 000000 时显示 -->
+                    <template v-if="isNationRoot">
+                        <view class="crumb disabled" @click="onClickNationBreadcrumb">全国</view>
+                        <view class="sep" v-if="selectedCodes.length">/</view>
+                    </template>
+                    <!-- 基础链路(selectCodeMax 的完整链路),仅最后一个可点击以切换到第一页(市级) -->
+                    <template v-for="(code, idx) in baseChain" :key="'base-' + code">
+                        <view class="crumb" :class="idx === baseChain.length - 1 ? '' : 'disabled'" @click="idx === baseChain.length - 1 && onClickBaseBreadcrumb()">
+                            {{ getNameByCode(code) }}
+                        </view>
+                        <view class="sep" v-if="idx < baseChain.length - 1 || selectedCodes.length">/</view>
+                    </template>
 
-            <!-- 滑动列区域 -->
-            <view class="area-body">
-                <swiper :current="currentSwiper" @change="onSwiperChange" class="area-swiper">
-                    <template v-for="(parent, colIdx) in columnParents" :key="'col-' + parent">
-                        <swiper-item>
-                            <scroll-view
-                              :id="`sv-${colIdx}`"
-                              scroll-y
-                              class="area-scroll"
-                              :scroll-into-view="scrollIntoViewArr[colIdx]"
-                            >
-                                <!-- 顶部特殊项:全国(仅全国范围且首列显示) -->
-                                <view v-if="isNationRoot && colIdx === 0" class="picker-item" :id="`area-item-0-000000`" @click="onPickNation">
-                                    <view class="name" :class="{ selected: currentValue === '000000' }">全国</view>
-                                    <up-icon v-if="currentValue === '000000'" name="checkbox-mark" color="#000" size="36rpx" />
-                                </view>
-
-                                <!-- 顶部特殊项:选择范围自身(非全国,首列显示),如 云南省 -->
-                                <view v-else-if="!isNationRoot && colIdx === 0" class="picker-item" :id="`area-item-0-${canonical6(baseRoot)}`" @click="onPickBaseRoot">
-                                    <view class="name" :class="{ selected: currentValue === baseRoot }">{{ getNameByCode(baseRoot) }}</view>
-                                    <up-icon v-if="currentValue === baseRoot" name="checkbox-mark" color="#000" size="36rpx" />
-                                </view>
-
-                                <!-- 正常子级项 -->
-                                <template v-for="item in childrenMap[parent] || []" :key="item.adcdCode">
-                                    <view class="picker-item" :id="`area-item-${colIdx}-${canonical6(item.adcdCode)}`" @click="onPick(item, colIdx)">
-                                        <view class="name" :class="{ selected: canonical6(selectedCodes[colIdx]) === canonical6(item.adcdCode) }">
-                                            {{ item.adcdName }}
-                                        </view>
-                                        <up-icon v-if="canonical6(selectedCodes[colIdx]) === canonical6(item.adcdCode)" name="checkbox-mark" color="#000" size="36rpx" />
-                                    </view>
-                                </template>
-                            </scroll-view>
-                        </swiper-item>
+                    <!-- 选中链路 -->
+                    <template v-for="(code, idx) in selectedCodes" :key="'sel-' + code">
+                        <view class="crumb" :class="{ active: idx === currentSwiper }" @click="jumpToLevel(idx)">
+                            {{ getNameByCode(code) }}
+                        </view>
+                        <view class="sep" v-if="idx < selectedCodes.length - 1">/</view>
                     </template>
-                </swiper>
-            </view>
+                </view>
+
+                <!-- 滑动列区域 -->
+                <view class="area-body">
+                    <swiper :current="currentSwiper" @change="onSwiperChange" class="area-swiper">
+                        <template v-for="(parent, colIdx) in columnParents" :key="'col-' + parent">
+                            <swiper-item>
+                                <scroll-view :id="`sv-${colIdx}`" scroll-y class="area-scroll" :scroll-into-view="scrollIntoViewArr[colIdx]">
+                                    <!-- 顶部特殊项:全国(仅全国范围且首列显示) -->
+                                    <view v-if="isNationRoot && colIdx === 0" class="picker-item" :id="`area-item-0-000000`" @click="onPickNation">
+                                        <view class="name" :class="{ selected: currentValue === '000000' }">全国</view>
+                                        <up-icon v-if="currentValue === '000000'" name="checkbox-mark" color="#000" size="36rpx" />
+                                    </view>
 
-            <!-- 底部操作 -->
-            <view class="area-footer">
-                <up-button class="btn" @click="close">取消</up-button>
-                <up-button class="btn" color="#2A6D52" @click="confirmPick">确定</up-button>
+                                    <!-- 顶部特殊项:选择范围自身(非全国,首列显示),如 云南省 -->
+                                    <view v-else-if="!isNationRoot && colIdx === 0" class="picker-item" :id="`area-item-0-${canonical6(baseRoot)}`" @click="onPickBaseRoot">
+                                        <view class="name" :class="{ selected: currentValue === baseRoot }">{{ getNameByCode(baseRoot) }}</view>
+                                        <up-icon v-if="currentValue === baseRoot" name="checkbox-mark" color="#000" size="36rpx" />
+                                    </view>
+
+                                    <!-- 正常子级项 -->
+                                    <template v-for="item in childrenMap[parent] || []" :key="item.adcdCode">
+                                        <view class="picker-item" :id="`area-item-${colIdx}-${canonical6(item.adcdCode)}`" @click="onPick(item, colIdx)">
+                                            <view class="name" :class="{ selected: canonical6(selectedCodes[colIdx]) === canonical6(item.adcdCode) }">
+                                                {{ item.adcdName }}
+                                            </view>
+                                            <up-icon v-if="canonical6(selectedCodes[colIdx]) === canonical6(item.adcdCode)" name="checkbox-mark" color="#000" size="36rpx" />
+                                        </view>
+                                    </template>
+                                </scroll-view>
+                            </swiper-item>
+                        </template>
+                    </swiper>
+                </view>
+
+                <!-- 底部操作 -->
+                <view class="area-footer">
+                    <up-button class="btn" @click="close">取消</up-button>
+                    <up-button class="btn" color="#2A6D52" @click="confirmPick">确定</up-button>
+                </view>
             </view>
-        </view>
-    </u-popup>
+        </u-popup>
+    </root-portal>
     <up-toast ref="uToastRef" />
 </template>
 
@@ -395,7 +392,6 @@ const applyModelValue = async (val: MaybeStringNumber): Promise<void> => {
     const maxCols = Math.max(0, props.maxLevel - baseL);
     const picked = full.slice(base.length, base.length + maxCols);
 
-    
     selectedCodes.value = picked;
     currentValue.value = picked.length ? picked[picked.length - 1] : baseRoot.value;
     await ensureColumnsData();
@@ -440,7 +436,7 @@ const onPick = async (item: AreaItem, colIdx: number) => {
     // 是否达到允许的最后一列(相对 baseRoot 的列数)
     const baseL = codeLevel(baseRoot.value);
     const maxCols = Math.max(0, props.maxLevel - baseL);
-    const reachedFinalColumn = (colIdx + 1) >= maxCols;
+    const reachedFinalColumn = colIdx + 1 >= maxCols;
     if (reachedFinalColumn) {
         scrollToAllSelected();
         confirmPick();
@@ -486,11 +482,11 @@ const onPickBaseRoot = async (): Promise<void> => {
 
 // 组装完整名称:包含基础链路与已选链路(全国仅返回“全国”)
 const buildFullName = (): string => {
-  if (currentValue.value === '000000') return '全国';
-  const baseNames = baseChain.value.map((code) => getNameByCode(code));
-  // 若当前值是 baseRoot 自身(选择范围自身),则不重复追加 selectedCodes
-  const selNames = selectedCodes.value.map((code) => getNameByCode(code));
-  return [...baseNames, ...selNames].filter(Boolean).join('');
+    if (currentValue.value === '000000') return '全国';
+    const baseNames = baseChain.value.map((code) => getNameByCode(code));
+    // 若当前值是 baseRoot 自身(选择范围自身),则不重复追加 selectedCodes
+    const selNames = selectedCodes.value.map((code) => getNameByCode(code));
+    return [...baseNames, ...selNames].filter(Boolean).join('');
 };
 
 const confirmPick = (): void => {
@@ -505,7 +501,7 @@ const confirmPick = (): void => {
         value: currentValue.value,
         name: getNameByCode(currentValue.value),
         fullNames: nameList.join(''),
-        fullName // 新增:完整地址名称
+        fullName, // 新增:完整地址名称
     });
     close();
 };
@@ -558,14 +554,14 @@ watch(
         currentSwiper.value = 0;
         await rebuildByInputs();
     },
-    { immediate: true }
+    { immediate: true },
 );
 
 watch(
     () => props.modelValue,
     async (nv) => {
         await applyModelValue(String(nv || ''));
-    }
+    },
 );
 
 // 每次列父集合变化时,刷新列数据并滚动
@@ -576,7 +572,7 @@ watch(
         // 定位到当前列并滚动选中项
         currentSwiper.value = Math.max(0, Math.min(currentSwiper.value, columnParents.value.length - 1));
         scrollToAllSelected();
-    }
+    },
 );
 
 // 点击顶部“全国”:切到省级并滚动到省级区域
@@ -672,7 +668,6 @@ const onClickBaseBreadcrumb = async (): Promise<void> => {
     /* 移除 will-change 与像素滚动相关样式,仅保留稳定布局 */
 }
 
-
 .picker-item {
     display: flex;
     align-items: center;

+ 1 - 1
src/components/ut-tabar/ut-tabar.vue

@@ -20,7 +20,7 @@
                     <image  v-else class="w-80 h-80" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/bottomWarehouse.png" mode="widthFix" style="position: absolute; top: -40rpx" />
                 </view>
                 <view class="d-flex a-c flex1 j-sa">
-                    <view class="c-#999 f-s-24 d-flex flex-cln j-c a-c">
+                    <view class="c-#999 f-s-24 d-flex flex-cln j-c a-c" @click="$u.route({ type: 'switchTab', url: '/pages/plant/processing/index' })">
                         <image v-if="activeTab === 'processing'" class="w-80 h-80" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/bottomProcessingPackagingActive.png" mode="widthFix" />
                         <image v-else class="w-80 h-80" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/bottomProcessingPackaging.png" mode="widthFix" />
                         <view class="text-center" :class="activeTab === 'processing' ? 'c-primary f-w-5' : ''">加工包装</view>

+ 74 - 68
src/models/select-warehouse-dialog/select-warehouse-dialog.vue

@@ -1,55 +1,57 @@
 <template>
-    <up-popup :show="show" mode="right" @close="close">
-        <view class="w-680 p-rtv" style="height: 100vh">
-            <z-paging ref="paging" v-model="list" bgColor="#fff" :fixed="false" @query="query" safe-area-inset-bottom>
-                <template #top>
-                    <up-navbar :fixed="false" border>
-                        <template #left>
-                            <view class="f-s-34 c-#333 f-w-500">{{ title }}</view>
-                        </template>
-                    </up-navbar>
-                </template>
-                <template>
-                    <view>
-                        <template v-for="item in list" :key="item?.id">
-                            <view @click="expandeds[item?.id] = !expandeds[item?.id]" class="pd-24 d-flex bg-#f7f7f7 btn-row-box a-c">
-                                <view>
-                                    <up-checkbox :label="item?.warehouseName" iconSize="36rpx" v-model:checked="aloneCheckeds[item.id]" labelSize="28rpx" name="agree" usedAlone> </up-checkbox>
+    <root-portal>
+        <up-popup :show="show" mode="right" @close="close">
+            <view class="w-680 p-rtv" style="height: 100vh">
+                <z-paging ref="paging" v-model="list" bgColor="#fff" :fixed="false" @query="query" safe-area-inset-bottom>
+                    <template #top>
+                        <up-navbar :fixed="false" border>
+                            <template #left>
+                                <view class="f-s-34 c-#333 f-w-500">{{ title }}</view>
+                            </template>
+                        </up-navbar>
+                    </template>
+                    <template>
+                        <view>
+                            <template v-for="item in list" :key="item?.id">
+                                <view @click="expandeds[item?.id] = !expandeds[item?.id]" class="pd-24 d-flex bg-#f7f7f7 btn-row-box a-c">
+                                    <view>
+                                        <up-checkbox :label="item?.warehouseName" iconSize="36rpx" v-model:checked="aloneCheckeds[item.id]" labelSize="28rpx" name="agree" usedAlone> </up-checkbox>
+                                    </view>
+                                    <view class="flex1 ov-hd j-ed d-flex">
+                                        <up-icon size="30rpx" color="#333" name="arrow-down"></up-icon>
+                                    </view>
                                 </view>
-                                <view class="flex1 ov-hd j-ed d-flex">
-                                    <up-icon size="30rpx" color="#333" name="arrow-down"></up-icon>
-                                </view>
-                            </view>
-                            <view v-show="expandeds[item?.id]" class="pd4-12-24-12-60">
-                                <SelectShelvesInput :warehouseId="item.id" :warehouseName="item.warehouseName" :expandeds="expandeds" @changeIdNameMap="changeIdNameMap">
-                                    <template #default="{ list }">
-                                        <template v-for="(sitem, index) in list" :key="sitem?.id">
-                                            <view class="pd2-6-12">
-                                                <up-checkbox :label="sitem?.shelvesName" iconSize="36rpx" v-model:checked="aloneCheckeds[item.id + '-' + sitem.id]" labelSize="28rpx" name="agree" usedAlone></up-checkbox>
-                                            </view>
+                                <view v-show="expandeds[item?.id]" class="pd4-12-24-12-60">
+                                    <SelectShelvesInput :warehouseId="item.id" :warehouseName="item.warehouseName" :expandeds="expandeds" @changeIdNameMap="changeIdNameMap">
+                                        <template #default="{ list }">
+                                            <template v-for="(sitem, index) in list" :key="sitem?.id">
+                                                <view class="pd2-6-12">
+                                                    <up-checkbox :label="sitem?.shelvesName" iconSize="36rpx" v-model:checked="aloneCheckeds[item.id + '-' + sitem.id]" labelSize="28rpx" name="agree" usedAlone></up-checkbox>
+                                                </view>
+                                            </template>
                                         </template>
-                                    </template>
-                                </SelectShelvesInput>
-                            </view>
-                        </template>
-                    </view>
-                </template>
-                <!-- 空数据处理 -->
-                <template #empty>
-                    <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx">
-                        <view>暂未设置细分库房,如由需要, </view>
-                        <view>可前往<span class="c-primary">仓储-库房管理</span>里进行设置 </view>
-                    </ut-empty>
-                </template>
-                <template #bottom>
-                    <view class="pd-24 bg-#fff d-flex">
-                        <up-button @click="close" class="mr-30" color="#F2F2F2" style="color: #333">取消</up-button>
-                        <up-button @click="confirmSelection" type="primary">确认选择</up-button>
-                    </view>
-                </template>
-            </z-paging>
-        </view>
-    </up-popup>
+                                    </SelectShelvesInput>
+                                </view>
+                            </template>
+                        </view>
+                    </template>
+                    <!-- 空数据处理 -->
+                    <template #empty>
+                        <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx">
+                            <view>暂未设置细分库房,如由需要, </view>
+                            <view>可前往<span class="c-primary">仓储-库房管理</span>里进行设置 </view>
+                        </ut-empty>
+                    </template>
+                    <template #bottom>
+                        <view class="pd-24 bg-#fff d-flex">
+                            <up-button @click="close" class="mr-30" color="#F2F2F2" style="color: #333">取消</up-button>
+                            <up-button @click="confirmSelection" type="primary">确认选择</up-button>
+                        </view>
+                    </template>
+                </z-paging>
+            </view>
+        </up-popup>
+    </root-portal>
 </template>
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
@@ -102,7 +104,7 @@ const query = async (pageNum: number, pageSize: number) => {
     paging.value?.complete(rows);
 };
 // 根据id获取名称的对象
-const idNameMap = reactive<{ [key: string]: { warehouseName?: string, shelvesName?: string, warehouseId?: string, shelfId?: string } }>({});
+const idNameMap = reactive<{ [key: string]: { warehouseName?: string; shelvesName?: string; warehouseId?: string; shelfId?: string } }>({});
 const confirmSelection = () => {
     console.log(aloneCheckeds);
     console.log(idNameMap);
@@ -125,29 +127,33 @@ const confirmSelection = () => {
     emit('confirm', values);
     close();
 };
-const changeIdNameMap = (map: { [key: string]: { shelvesName: string, warehouseName: string } }) => {
+const changeIdNameMap = (map: { [key: string]: { shelvesName: string; warehouseName: string } }) => {
     Object.assign(idNameMap, map);
 };
 const close = () => {
     emit('update:show', false);
 };
-watch(() => props.modelValue, (val) => {
-    // 初始化选中状态
-    Object.keys(aloneCheckeds).forEach((key) => {
-        delete aloneCheckeds[key];
-    });
-    val.forEach((item: any) => {
-        // warehouseId-shelfId warehouseName or warehouseId shelvesName
-        expandeds[item.warehouseId] = true;
-        aloneCheckeds[item.warehouseId + (item.shelfId ? '-' + item.shelfId : '')] = true;
-        idNameMap[item.warehouseId + (item.shelfId ? '-' + item.shelfId : '')] = {
-            warehouseName: item.warehouseName,
-            shelvesName: item.shelvesName,
-            warehouseId: item.warehouseId,
-            shelfId: item.shelfId,
-        };
-    });
-}, { immediate: true });
+watch(
+    () => props.modelValue,
+    (val) => {
+        // 初始化选中状态
+        Object.keys(aloneCheckeds).forEach((key) => {
+            delete aloneCheckeds[key];
+        });
+        val.forEach((item: any) => {
+            // warehouseId-shelfId warehouseName or warehouseId shelvesName
+            expandeds[item.warehouseId] = true;
+            aloneCheckeds[item.warehouseId + (item.shelfId ? '-' + item.shelfId : '')] = true;
+            idNameMap[item.warehouseId + (item.shelfId ? '-' + item.shelfId : '')] = {
+                warehouseName: item.warehouseName,
+                shelvesName: item.shelvesName,
+                warehouseId: item.warehouseId,
+                shelfId: item.shelfId,
+            };
+        });
+    },
+    { immediate: true },
+);
 </script>
 <style scoped lang="scss">
 .btn-row-box {

+ 15 - 5
src/pages.json

@@ -24,6 +24,13 @@
                 "navigationBarTitleText": "种植端仓储与放行"
             }
         },
+        // 种植端加工与包装
+        {
+            "path": "pages/plant/processing/index",
+            "style": {
+                "navigationBarTitleText": "种植端加工与包装"
+            }
+        },
         // 种植端更多
         {
             "path": "pages/plant/more/index",
@@ -31,7 +38,7 @@
                 "navigationBarTitleText": "种植端更多"
             }
         },
-        //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+        // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
         {
             "path": "pages/index/index",
             "style": {
@@ -110,16 +117,16 @@
                 },
                 // 标记三无一全基地
                 {
-                    "path": "mark-swyq-base/index",
+                    "path": "mark-base/index",
                     "style": {
-                        "navigationBarTitleText": "标记三无一全基地"
+                        "navigationBarTitleText": "标记基地"
                     }
                 },
                 // 标记三无一全基地详情
                 {
-                    "path": "mark-swyq-base-detail/index",
+                    "path": "mark-base-detail/index",
                     "style": {
-                        "navigationBarTitleText": "三无一全基地详情"
+                        "navigationBarTitleText": "标记基地详情"
                     }
                 }
             ]
@@ -506,6 +513,9 @@
             {
                 "pagePath": "pages/plant/storage/index"
             },
+            {
+                "pagePath": "pages/plant/processing/index"
+            },
             {
                 "pagePath": "pages/plant/more/index"
             }

+ 6 - 8
src/pages/plant/base/index.vue

@@ -119,11 +119,10 @@
                                                     <view class="pd2-10-20 bg-black-op-0.5 c-#ccc f-s-20" style="border-radius: 10rpx 0 0 10rpx; width: max-content">经度:E{{ item?.gapInfo?.lng }} 纬度:N{{ item?.gapInfo?.lat }}</view>
                                                 </view>
                                                 <view style="position: absolute; top: 20rpx; left: 0">
-                                                    <view class="base-status-gap-1" v-if="+item?.gapFlag">获评{{ item?.gapInfo?.medicineName }}GAP基地</view>
-                                                    <template v-if="item?.swyqRes">
-                                                        <view class="base-status-gap-1" v-if="item?.swyqRes == '1'">获评{{ item?.swyqMedicineName }}三无一全基地</view>
-                                                        <view class="base-status-gap-2" v-if="item?.swyqRes == '2'">标记{{ item?.swyqMedicineName }}三无一全基地未通过审核</view>
-                                                        <view class="base-status-gap-0" v-if="item?.swyqRes == '0'">标记{{ item?.swyqMedicineName }}三无一全基地待审核</view>
+                                                    <template v-for="(resq, index) in item?.resInfo" :key="index">
+                                                        <view class="base-status-gap-1" v-if="resq?.res == '1'">获评{{ resq?.medicineName }}{{ selectDictLabel(pt_base_form, resq?.type) }}基地</view>
+                                                        <view class="base-status-gap-2" v-if="resq?.res == '2'">标记{{ resq?.medicineName }}{{ selectDictLabel(pt_base_form, resq?.type) }}基地未通过审核</view>
+                                                        <view class="base-status-gap-0" v-if="resq?.res == '0'">标记{{ resq?.medicineName }}{{ selectDictLabel(pt_base_form, resq?.type) }}基地待审核</view>
                                                     </template>
                                                 </view>
                                             </view>
@@ -189,7 +188,7 @@ import { useClientRequest } from '@/utils/request';
 import { setCipByNum } from '@/utils/public';
 import { useInfoStore } from '@/store';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_base_type, pt_org_type } = toRefs<any>(proxy?.useDict('pt_base_type', 'pt_org_type'));
+const { pt_base_type, pt_org_type, pt_base_form } = toRefs<any>(proxy?.useDict('pt_base_type', 'pt_org_type', 'pt_base_form'));
 const infoStore = useInfoStore();
 // 获取用户信息
 const avatar = computed(() => infoStore.userInfo?.avatar || '');
@@ -269,8 +268,7 @@ interface BaseData {
     plantingVarieties: PlantingVariety[];
     coordinates: Coordinate[][]; // 二维坐标数组
     tempFlag?: number | string;
-    swyqRes?: string;
-    swyqMedicineName?: string;
+    resInfo?: any[];
 }
 const instance = getCurrentInstance();
 const list = ref<BaseData[]>();

+ 3 - 0
src/pages/plant/processing/index.vue

@@ -0,0 +1,3 @@
+<template>
+    <view>加工与包装</view>
+</template>

+ 32 - 24
src/plant/base/base-detail/index.vue

@@ -295,29 +295,37 @@
             </template>
         </view>
         <template #bottom>
-            <view class="pd-20 d-flex">
-                <template v-if="!+form.baseInfo?.tempFlag">
-                    <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: 'navigateTo', url: '/plant/base/base-edit/index', params: { id: did } })" type="primary">去修改</up-button>
+            <view class="pd-20">
+                <ut-row gap="10rpx">
+                    <template v-if="!+form.baseInfo?.tempFlag">
+                        <template v-for="(item, index) in form?.baseInfo?.resInfo" :key="index">
+                            <ut-col :span="15">
+                                <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/mark-base/index', params: { id: did, type: item?.type } })" v-if="!item?.res" color="#18BECA">去标记为{{ selectDictLabel(pt_base_form, item?.type) }}基地{{ '>' }}</up-button>
+                                <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/mark-base-detail/index', params: { id: did, type: item?.type } })" v-if="['2'].includes(item?.res)" color="#FC333F">
+                                    <view>
+                                        <view>标记为{{ selectDictLabel(pt_base_form, item?.type) }}基地</view>
+                                        <view>未通过{{ '>' }}</view>
+                                    </view>
+                                </up-button>
+                                <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/mark-base-detail/index', params: { id: did, type: item?.type } })" v-if="['0'].includes(item?.res)" color="#F4A91A">
+                                    <view>
+                                        <view>标记为{{ selectDictLabel(pt_base_form, item?.type) }}基地</view>
+                                        <view>待审核{{ '>' }}</view>
+                                    </view>
+                                </up-button>
+                                <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/mark-base-detail/index', params: { id: did, type: item?.type } })" v-if="['1'].includes(item?.res)" color="#AECEBF">
+                                    <view>
+                                        <view>标记为{{ selectDictLabel(pt_base_form, item?.type) }}基地</view>
+                                        <view>已通过{{ '>' }}</view>
+                                    </view>
+                                </up-button>
+                            </ut-col>
+                        </template>
+                    </template>
+                    <ut-col :span="30">
+                        <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/base-edit/index', params: { id: did } })" type="primary">去修改</up-button>
+                    </ut-col>
+                </ut-row>
             </view>
         </template>
     </z-paging>
@@ -326,7 +334,7 @@
 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 { yes_no, pt_org_type, pt_base_type, pt_water_type, pt_soil_type, pt_soil_texture, pt_light_type, pt_base_form } = 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_base_form'));
 const tabs = reactive([
     { label: '基本信息', value: 'base' },
     { label: '地块信息', value: 'plot' },

+ 25 - 96
src/plant/base/base-edit/index.vue

@@ -1,16 +1,22 @@
 <template>
     <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" scroll-with-animation>
         <template #top>
-            <ut-navbar :title="(did && !+form?.baseInfo?.tempFlag ? '编辑基地' : '添加基地')" :fixed="false" border></ut-navbar>
-            <view class="bg-fff mb-20 pd2-0-24">
+            <ut-navbar :title="did && !+form?.baseInfo?.tempFlag ? '编辑基地' : '添加基地'" :fixed="false" border></ut-navbar>
+            <view class="bg-fff pd2-0-24">
                 <view class="pd-5"></view>
                 <ut-tabs v-model="activeTab" :tabs="tabs" mode="btw" @change="changeActiveTab"></ut-tabs>
             </view>
         </template>
         <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
             <!-- 基本信息 -->
-            <view ref="baseRef" class="pd-24" id="base12345">
-                <view class="startline-title">基本信息</view>
+            <view ref="baseRef" class="pd2-18-24 d-flex j-sb a-c" id="base12345">
+                <view>
+                    <view class="startline-title">基本信息</view>
+                </view>
+                <view class="pd-10 bg-primary c-#fff radius-16 text-center" @click="selectGapInfo">
+                    <view class="f-s-24">一键复用云南GAP基地信息</view>
+                    <view class="f-s-18">仅做信息复用填写,不做GAP基地标记</view>
+                </view>
             </view>
             <view class="pd-24 bg-#fff mb-10">
                 <up-alert type="primary" fontSize="24rpx" description="注意:基地不强制与品种挂钩!基地地址以行政村为界,可成片集中或相对集中,跨村则视为另一基地(连片跨村除外)。"></up-alert>
@@ -34,7 +40,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="建设时间" prop="baseInfo.buildDate">
-                        <up-input v-model="form.baseInfo.buildDate" placeholder="请选择基地建设年份" border="none" clearable></up-input>
+                        <up-input v-model="form.baseInfo.buildDate" readonly placeholder="请选择基地建设年份" border="none" clearable></up-input>
                         <template #right>
                             <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
                         </template>
@@ -66,91 +72,6 @@
                 <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基地 -->
-                <view class="h-1" id="gapFlagpppp"></view>
-                <template v-if="['1', '2'].includes(form.baseInfo.baseType)">
-                    <up-form-item borderBottom label="是否为Gap基地" required prop="baseInfo.gapFlag">
-                        <up-radio-group v-model="form.baseInfo.gapFlag">
-                            <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>
-                    <!-- 关联的GAP获评信息 -->
-                    <template v-if="+form.baseInfo.gapFlag">
-                        <template v-if="!form.baseInfo.gapId">
-                            <up-form-item borderBottom label="关联的GAP获评信息" prop="baseInfo.gapId">
-                                <up-button @click="selectGapInfo" type="primary" plain>
-                                    <up-icon class="mr-10" name="plus" color="#37A954"></up-icon>
-                                    <span>请选择要关联的GAP基地获评信息</span>
-                                </up-button>
-                            </up-form-item>
-                        </template>
-                        <template v-else>
-                            <up-form-item borderBottom label="关联的GAP获评信息" prop="baseInfo.gapId">
-                                <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 class="card-close pd-10" @click="removeGapInfo">
-                                        <up-icon name="close" size="32rpx" color="#F81242"></up-icon>
-                                    </view>
-                                </view>
-                            </up-form-item>
-                            <up-form-item  borderBottom label="基地具体地址" required prop="baseInfo.gapInfo.adcode">
-                                <!-- <up-input v-model="form.address" placeholder="请选择基地所在省/市/县/镇(乡)" border="none" clearable></up-input> -->
-                                <view v-if="form?.baseInfo?.gapInfo?.adcode" class="f-s-30 c-ccc f-w-5 flex1">{{ form?.baseInfo?.gapInfo?.adcodeName }} </view>
-                                <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择基地所在省/市/县/镇(乡)</view>
-                            </up-form-item>
-                            <up-form-item borderBottom prop="baseInfo.gapInfo.address">
-                                <view class="f-s-30 c-#ccc f-w-5">{{ form?.baseInfo?.gapInfo?.address || '-' }}</view>
-                            </up-form-item>
-                            <up-form-item  borderBottom prop="baseInfo.gapInfo.basePic" required>
-                                <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>
-                                    </view>
-                                    <view class="bg-#ccc d-flex ov-hd p-rtv">
-                                        <image class="w-full" v-if="form.baseInfo.gapInfo?.basePic" :src="form.baseInfo.gapInfo.basePic" mode="widthFix" />
-                                        <image class="w-full h-380" v-else src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/base/select_base_gap.png" mode="widthFix" />
-                                    </view>
-                                </view>
-                            </up-form-item>
-                            <view class="h-1" id="areaPppp"></view>
-                            <up-form-item required borderBottom label="基地面积" prop="baseInfo.gapInfo.area">
-                                <view class="f-s-30 c-#ccc f-w-5">{{ form?.baseInfo?.gapInfo?.area || '-' }}</view>
-                                <template #right>
-                                    <span>{{ form.baseInfo.gapInfo.areaUnit }}</span>
-                                </template>
-                            </up-form-item>
-                            <!-- 基地经纬度 -->
-                            <view class="h-1" id="lngpppp"></view>
-                            <view class="h-1" id="latpppp"></view>
-                            <up-form-item required label="基地经纬度" class="form-item-wrap-column">
-                                <view class="d-flex" style="margin-top: -10px">
-                                    <up-form-item class="flex1" prop="baseInfo.gapInfo.lng">
-                                         <view class="f-s-30 c-#ccc flex1 f-w-5">{{ form?.baseInfo?.gapInfo?.lng || '-' }}</view>
-                                    </up-form-item>
-                                    <view class="pd-5"></view>
-                                    <up-form-item class="flex1" prop="baseInfo.gapInfo.lat">
-                                        <view class="f-s-30 c-#ccc flex1 f-w-5">{{ form?.baseInfo?.gapInfo?.lat || '-' }}</view>
-                                    </up-form-item>
-                                </view>
-                            </up-form-item>
-                        </template>
-                    </template>
-                </template>
                 <template v-if="!+form.baseInfo.gapFlag && !form.baseInfo.gapId">
                     <view class="h-1" id="adcodepppp"></view>
                     <up-form-item @click="showArea = true" borderBottom label="基地具体地址" required prop="baseInfo.gapInfo.adcode">
@@ -626,7 +547,6 @@ const rules = reactive({
     // '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: '请输入基地经纬度' }],
@@ -662,7 +582,7 @@ const saveBaseInfo = async () => {
             }
         },
         500,
-        true
+        true,
     );
 };
 const submitForm = async () => {
@@ -703,7 +623,7 @@ const submitForm = async () => {
             }
         },
         500,
-        true
+        true,
     );
 };
 
@@ -778,8 +698,18 @@ const selectCpyMember = () => {
 const selectGapInfo = () => {
     uni.$on('selectGapInfo', (item: any) => {
         console.log(item);
-        form.value.baseInfo.gapId = item.id || undefined;
-        form.value.baseInfo.gapInfo = item;
+        form.value.baseInfo.gapInfo = {
+           adcode: item.adcode,
+           adcodeName: item.adcodeName,
+           address: item.address,
+           areaUnit: item.areaUnit,
+           area: item.area,
+           basePic: item.basePic,
+           lng: item.lng,
+           lat: item.lat,
+           lnglat: `${item.lng},${item.lat}`,
+        };
+        form.value.baseInfo.coordinates = item.coordinates || [];
         uni.$off('selectGapInfo');
     });
     uni.$u.route({
@@ -868,7 +798,6 @@ const getDetailById = async (id: string) => {
         form.value = res.data || {};
     }
 };
-
 </script>
 <style lang="scss" scoped>
 .z-paging-wrap {

+ 33 - 22
src/plant/base/mark-swyq-base-detail/index.vue → src/plant/base/mark-base-detail/index.vue

@@ -2,29 +2,29 @@
     <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>
+                <ut-navbar :title="`标记为${selectDictLabel(pt_base_form, formRes.type)}基地`" :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 v-if="form" class="pd-24 bg-#fff mb-10 p-rtv">
-                    <image class="base_res_logo w-160 h-160" :src="`https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/common/base_res_logo${form?.baseInfo?.swyqRes}.png`" mode="widthFix" />
+                    <image class="base_res_logo w-160 h-160" :src="`https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/common/base_res_logo${formRes?.res}.png`" mode="widthFix" />
                     <view class="f-s-30 pd2-16-0 info-border-bottom">
                         <span class="c-#666">获评品种:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.swyqMedicineName || '-' }}</span>
+                        <span class="c-#333">{{ formRes.medicineName || '-' }}</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>
+                        <span class="c-#333">{{ formRes.ratedDate || '-' }}</span>
                     </view>
-                    <view v-if="form?.baseInfo?.swyqCertFile" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view v-if="formRes.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?.baseInfo?.swyqCertFile"></ut-album>
+                        <ut-album :urls="formRes.certFile"></ut-album>
                     </view>
-                    <view v-if="form?.baseInfo?.swyqUrl" class="f-s-30 pd2-16-0 info-border-bottom">
+                    <view v-if="formRes.certUrl" class="f-s-30 pd2-16-0 info-border-bottom">
                         <span class="c-#666">官方公示网址:</span>
-                        <span class="c-#333">{{ form?.baseInfo?.swyqUrl || '-' }}</span>
+                        <span class="c-#333">{{ formRes.certUrl || '-' }}</span>
                     </view>
                 </view>
                 <view ref="baseRef" class="pd-24" id="base12345">
@@ -64,10 +64,10 @@
                     </view>
                 </view>
             </view>
-            <template v-if="form?.baseInfo?.swyqRes == '2'" #bottom>
+            <template v-if="formRes.res == '2'" #bottom>
                 <view class="pd-20">
-                    <view v-if="form?.baseInfo?.msg" class="mb-16 c-#FC333F f-s-24">审核未通过原因:{{ form?.baseInfo?.msg || '-' }}</view>
-                    <up-button type="primary" @click="$u.route({ type: 'redirect', url: '/plant/base/mark-swyq-base/index', params: { id: did } })">去修改</up-button>
+                    <view v-if="formRes?.msg" class="mb-16 c-#FC333F f-s-24">审核未通过原因:{{ formRes?.msg || '-' }}</view>
+                    <up-button type="primary" @click="$u.route({ type: 'redirect', url: '/plant/base/mark-base/index', params: { id: did, type: formRes.type } })">去修改</up-button>
                 </view>
             </template>
         </z-paging>
@@ -77,13 +77,8 @@
 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 {  pt_base_type, pt_base_form } = toRefs<any>(proxy?.useDict( 'pt_base_type', 'pt_base_form' ));
+
 const paging = ref<any>(null);
 const mapUnitByBaseType: any = {
     '1': '亩',
@@ -91,15 +86,29 @@ const mapUnitByBaseType: any = {
     '3': '平方米',
 };
 const form = ref<any>(null);
-
+const formRes = ref<any>({
+    type: '',
+    medicineCode: undefined,
+    medicineName: '',
+    ratedDate: '',
+    certFile: '',
+    certUrl: '',
+});
 
 const did = ref('');
 // 根据id获取基地详情
+// 根据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 || {};
-    }
+    if (!res || res.code !== 200) return;
+    form.value = res.data || {};
+    res?.data?.baseInfo?.resInfo?.forEach((item: any) => {
+        if (item?.type === formRes.value.type) {
+            formRes.value = {
+                ...item
+            }
+        }
+    });
 };
 const onRefresh = () => {
     getDetailById(did.value);
@@ -107,8 +116,10 @@ const onRefresh = () => {
 };
 // 判断节点是否在可视区域内如果在则切换tab createIntersectionObserver
 
+// 判断节点是否在可视区域内如果在则切换tab createIntersectionObserver
 onLoad((options: any) => {
     did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
+    formRes.value.type = options?.type || getUrlParams(recursiveDecodeURIComponent(options?.q))?.type || '';
     getDetailById(did.value);
 });
 </script>

+ 45 - 43
src/plant/base/mark-swyq-base/index.vue → src/plant/base/mark-base/index.vue

@@ -2,51 +2,51 @@
     <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>
+                <ut-navbar :title="`标记为${selectDictLabel(pt_base_form, formRes.type)}基地`" :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">
+                    <up-form class="p-rtv" labelPosition="top" :model="formRes" :rules="rulesSwyq" labelWidth="auto" ref="upFormRef">
                         <!-- 校验定位:基地类型 -->
                         <!-- 基地信息部分 -->
                         <view>
                             <!-- 选择获评品种 -->
-                            <view class="h-1" id="swyqMedicineCodepppp"></view>
-                            <up-form-item @click="selectMedicine" borderBottom label="获评品种" required prop="swyqMedicineCode">
-                                <view v-if="formSwyq.swyqMedicineCode" class="f-s-30 c-333 f-w-5 flex1">{{ formSwyq.swyqMedicineName }}</view>
+                            <view class="h-1" id="medicineCodepppp"></view>
+                            <up-form-item @click="selectMedicine" borderBottom label="获评品种" required prop="medicineCode">
+                                <view v-if="formRes.medicineCode" class="f-s-30 c-333 f-w-5 flex1">{{ formRes.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>
                                 </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>
+                            <view class="h-1" id="ratedDatepppp"></view>
+                            <ut-datetime-picker v-model="formRes.ratedDate" mode="date" dateFields="day">
+                                <up-form-item borderBottom label="获评基地时间" required prop="ratedDate">
+                                    <up-input v-model="formRes.ratedDate" 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="h-1" id="certFilepppp"></view>
+                            <up-form-item borderBottom required prop="certFile">
                                 <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>
+                                    <ut-upload v-model="formRes.certFile" :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>
+                            <view class="h-1" id="certUrlpppp"></view>
+                            <up-form-item borderBottom label="官方公示网址" prop="certUrl" required>
+                                <up-input v-model="formRes.certUrl" placeholder="请输入官方公示网址" border="none" clearable></up-input>
                             </up-form-item>
                         </view>
                     </up-form>
@@ -100,7 +100,7 @@
 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 {  pt_base_type, pt_base_form } = toRefs<any>(proxy?.useDict( 'pt_base_type', 'pt_base_form' ));
 const tabs = reactive([
     { label: '基本信息', value: 'base' },
     { label: '地块信息', value: 'plot' },
@@ -114,26 +114,25 @@ const mapUnitByBaseType: any = {
     '3': '平方米',
 };
 const form = ref<any>({});
-const formSwyq = ref<any>({
-    swyqVarietyId: undefined,
-    swyqMedicineName: '',
-    swyqRatedDate: '',
-    swyqCertFile: '',
-    swyqUrl: '',
+const formRes = ref<any>({
+    type: '',
+    medicineCode: undefined,
+    medicineName: '',
+    ratedDate: '',
+    certFile: '',
+    certUrl: '',
 });
 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' }],
+    medicineCode: [{ required: true, message: '请选择获评品种' }],
+    ratedDate: [{ required: true, message: '请选择获评基地时间' }],
+    certFile: [{ required: true, message: '请上传官方公示证明材料' }],
+    certUrl: [{ required: true, message: '请输入官方公示网址' }],
 });
 // 改成去选择获评品种页面
 const selectMedicine = () => {
     uni.$on('medicineSelected', (medicine: any) => {
-        console.log(medicine);
-        
-        formSwyq.value.swyqMedicineCode = medicine.medicineCode;
-        formSwyq.value.swyqMedicineName = medicine.medicineName;
+        formRes.value.medicineCode = medicine.medicineCode;
+        formRes.value.medicineName = medicine.medicineName;
         uni.$off('medicineSelected');
     });
     uni.$u.route({
@@ -148,14 +147,15 @@ 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 || {};
-        formSwyq.value.swyqMedicineCode = res.data?.baseInfo?.swyqMedicineCode || undefined;
-        formSwyq.value.swyqMedicineName = res.data?.baseInfo?.swyqMedicineName || '';
-        formSwyq.value.swyqRatedDate = res.data?.baseInfo?.swyqRatedDate || '';
-        formSwyq.value.swyqCertFile = res.data?.baseInfo?.swyqCertFile || '';
-        formSwyq.value.swyqUrl = res.data?.baseInfo?.swyqUrl || '';
-    }
+    if (!res || res.code !== 200) return;
+    form.value = res.data || {};
+    res?.data?.baseInfo?.resInfo?.forEach((item: any) => {
+        if (item?.type === formRes.value.type) {
+            formRes.value = {
+                ...item
+            }
+        }
+    });
 };
 const onRefresh = () => {
     getDetailById(did.value);
@@ -178,11 +178,12 @@ const submitForm = async () => {
                 title: '提交中...',
             });
             try {
-                const res = did.value ?  await useClientRequest.post('/plt-api/app/base/updateSwyqBase', {
-                    ...formSwyq.value,
+                const res = formRes.value?.res ? await useClientRequest.post('/plt-api/app/base/updateSwyqBase', {
+                    ...formRes.value,
                     id: did.value,
                 }) : await useClientRequest.post('/plt-api/app/base/addSwyqBase', {
-                    ...formSwyq.value,
+                    ...formRes.value,
+                    id: did.value,
                 });
                 if (!res || res.code !== 200) return;
                 uni.hideLoading();
@@ -196,9 +197,10 @@ const submitForm = async () => {
                 // 返回上一页
                 uni.$u.route({
                     type: 'redirect',
-                    url: '/plant/base/mark-swyq-base-detail/index',
+                    url: '/plant/base/mark-base-detail/index',
                     params: {
                         id: did.value,
+                        type: formRes.value.type,
                     },
                 });
             } catch (error) {
@@ -210,9 +212,9 @@ const submitForm = async () => {
     );
 };
 // 判断节点是否在可视区域内如果在则切换tab createIntersectionObserver
-
 onLoad((options: any) => {
     did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
+    formRes.value.type = options?.type || getUrlParams(recursiveDecodeURIComponent(options?.q))?.type || '';
     getDetailById(did.value);
 });
 </script>

+ 58 - 13
src/plant/storage/agro-product/info-update/index.vue

@@ -1,7 +1,7 @@
 <template>
     <z-paging class="" ref="paging" bgColor="#f7f7f7" paging-class="paging-btm-shadow" safe-area-inset-bottom scroll-with-animation>
         <template #top>
-            <ut-navbar :title="did ? '编辑农资入库' : '新增农资入库'" :fixed="false" border></ut-navbar>
+            <ut-navbar :title="did && mode === 'copy' ? '新增农资入库' : did ? '编辑农资入库' : '新增农资入库'" :fixed="false" border></ut-navbar>
         </template>
         <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
             <!-- 农资信息(复制自 info-edit 字段与顺序) -->
@@ -23,13 +23,39 @@
                         </template>
                     </up-form-item>
                 </ut-action-sheet>
-
-                <!-- 入库数量与单位 -->
                 <view class="h-1" id="capacitypppp"></view>
                 <view class="h-1" id="unitpppp"></view>
-                <up-form-item label="入库量" prop="capacity" required class="form-item-bottom-padding-0">
-                    <view class="f-s-30 c-333 f-w-5 flex1">{{ form?.capacity }}{{ form?.unit }}</view>
-                </up-form-item>
+                <!-- 入库数量与单位 -->
+                <template v-if="mode === 'copy'">
+                    <up-form-item label="入库量" required class="form-item-bottom-padding-0">
+                        <div class="flex1 d-flex">
+                            <div class="flex1 ov-hd">
+                                <up-form-item prop="capacity" border-bottom class="form-item-top-padding-0">
+                                    <up-input v-model="form.capacity" placeholder="请输入入库量" border="none" clearable></up-input>
+                                </up-form-item>
+                            </div>
+                            <div class="pd-5"></div>
+                            <div class="min-w-200">
+                                <ut-action-sheet v-model="form.unit" :tabs="pt_materail_unit" mode="custom" title="选择单位">
+                                    <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
+                                        <view class="flex1" style="line-height: 24px">
+                                            <view v-if="form.unit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_materail_unit, form.unit) }}</view>
+                                            <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
+                                        </view>
+                                        <template #right>
+                                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                        </template>
+                                    </up-form-item>
+                                </ut-action-sheet>
+                            </div>
+                        </div>
+                    </up-form-item>
+                </template>
+                <template v-else>
+                    <up-form-item label="入库量" prop="capacity" required class="form-item-bottom-padding-0">
+                        <view class="f-s-30 c-333 f-w-5 flex1">{{ form?.capacity }}{{ form?.unit }}</view>
+                    </up-form-item>
+                </template>
                 <view class="h-1" id="specpppp"></view>
                 <view class="h-1" id="specUnitpppp"></view>
                 <template v-if="!['kg', 'L'].includes(form?.unit as string)">
@@ -69,7 +95,6 @@
                         </div>
                     </up-form-item>
                 </template>
-
                 <view class="h-1" id="sourceTypepppp"></view>
                 <ut-action-sheet :tabs="pt_source_type" mode="custom" title="农资来源" v-model="form.sourceType">
                     <up-form-item borderBottom label="农资来源" required prop="sourceType">
@@ -147,8 +172,17 @@
                         </template>
                     </up-form-item>
                 </ut-datetime-picker>
-                <!-- 入库批号 -->
-                <up-form-item borderBottom label="入库批号" required prop="batchCode">
+              
+                    <!-- 入库批号 -->
+                <up-form-item v-if="mode === 'copy'" borderBottom label="入库批号" required prop="batchCode">
+                    <up-input v-model="form.batchCode" placeholder="请输入入库批号" border="none" clearable></up-input>
+                    <template #right>
+                        <up-button @click="generateBatchCode" type="primary"
+                            :customStyle="formItemBtnStyle">随机生成</up-button>
+                    </template>
+                </up-form-item>
+                  <!-- 入库批号 -->
+                <up-form-item v-else borderBottom label="入库批号" required prop="batchCode">
                     <view class="f-s-30 c-333 f-w-5 flex1">{{ form.batchCode }}</view>
                 </up-form-item>
                 <!-- 库房类型 -->
@@ -280,7 +314,7 @@ const submitForm = async () => {
             });
             try {
                 // 这里使用单条入库接口,后端若仍要求 batch,可根据需要包装成数组
-                const res = await useClientRequest.post('/plt-api/app/material/edit', form.value);
+                const res = mode.value === 'copy' ? await useClientRequest.post('/plt-api/app/material/instore', form.value) : await useClientRequest.post('/plt-api/app/material/edit', form.value);
                 uni.hideLoading();
                 if (!res || res.code !== 200) return;
                 uni.showToast({
@@ -307,7 +341,7 @@ const generateBatchCode = async () => {
     uni.showLoading({
         title: '生成中...',
     });
-    const res = await useClientRequest.post('/plt-api/app/material/getBatchCode', {
+    const res = await useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', {
         plType: 'M',
         linkType: 'I',
     });
@@ -322,6 +356,7 @@ const generateBatchCode = async () => {
 };
 
 const did = ref('');
+const mode = ref('');
 // 获取详情(仓库信息)
 const getDetailById = async (id: string) => {
     if (!id) return;
@@ -331,12 +366,22 @@ const getDetailById = async (id: string) => {
             ...form.value,
             ...res.data,
         };
+        if (mode.value === 'copy') {
+            form.value.batchCode = '';
+            form.value.id = undefined;
+            form.value.instoreBizInfo.instoreDate = parseTime(new Date(), '{y}-{m}-{d}');
+            form.value.warehouses = [];
+            form.value.capacity = '';
+            form.value.spec = '';
+            form.value.specUnit = '';
+        }
     }
 };
 
 // 页面入参解析并加载
 onLoad((options: any) => {
     did.value = options?.id || '';
+    mode.value = options?.mode || '';
     getDetailById(did.value);
 });
 </script>
@@ -358,13 +403,13 @@ onLoad((options: any) => {
     z-index: 10;
 }
 :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;
     }
 }

+ 24 - 5
src/plant/storage/agro-product/list/index.vue

@@ -9,20 +9,24 @@
                 <ut-tabs mode="subsection" v-model="form.restFlag" :tabs="tabs" @change="onRefresh"></ut-tabs>
             </view>
             <view class="h-86">
-                <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜农资名称、批号、库房、供应商" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+                <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0" :border="false"
+                    placeholder="搜农资名称、批号、库房、供应商" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
             </view>
         </view>
         <view class="pd-24 bg-#f7f7f7">
             <up-swipe-action>
-                <up-swipe-action-item v-for="(item, index) in list" :key="index" :name="item?.id" :options="optionsActionTemp" @click="clickTempSwipe" class="mb-20 b-radius">
-                    <view class="b-radius bg-#fff pd3-10-24-24 p-rtv" @click.stop="$u.route({ url: '/plant/storage/agro-product/detail/index', params: { id: item.id } })">
+                <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 pd3-10-24-24 p-rtv"
+                        @click.stop="$u.route({ url: '/plant/storage/agro-product/detail/index', params: { id: item.id } })">
                         <view class="d-flex j-ed a-c mb-16">
                             <view class="f-s-22 c-#666">{{ item?.instoreBizInfo?.instoreDate }}</view>
                         </view>
                         <view class="d-flex flex1 mb-10">
                             <view class="flex1">
                                 <span class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.materialName }}</span>
-                                <span class="f-s-24 c-#666">{{ selectDictLabel(pt_material_type, item?.materialType) }}</span>
+                                <span class="f-s-24 c-#666">{{ selectDictLabel(pt_material_type, item?.materialType)
+                                    }}</span>
                             </view>
                             <view>
                                 <view v-if="item?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检验</view>
@@ -101,6 +105,12 @@ const query = async (pageNum: number, pageSize: number) => {
 };
 // 暂存项左滑删除配置
 const optionsActionTemp = reactive([
+    {
+        text: '复制',
+        style: {
+            backgroundColor: '#37A954',
+        },
+    },
     {
         text: '删除',
         style: {
@@ -112,6 +122,15 @@ const optionsActionTemp = reactive([
 const clickTempSwipe = async (event: object) => {
     const { name, index } = event as any;
     if (index === 0) {
+        uni.$u.route({
+            type: 'navigateTo',
+            url: '/plant/storage/agro-product/info-update/index',
+            params: {
+                mode: 'copy',
+                id: name,
+            },
+        });
+    } else if (index === 1) {
         try {
             const res = await uni.showModal({
                 title: '删除提示',
@@ -153,10 +172,10 @@ onMounted(() => {
     box-sizing: border-box;
     padding: 12rpx;
 }
+
 .tag-span {
     padding: 4rpx 12rpx;
     font-size: 20rpx;
     border-radius: 18rpx;
 }
-
 </style>

+ 3 - 3
src/tools/por-torganism/index.vue

@@ -25,15 +25,15 @@
         </view>
         <view class="pd-24" v-if="showSearch">
             <view class="f-s-32 c-#333 f-w-5 mb-20">搜索结果</view>
-            <view class="pd-30 d-flex bg-#FBFDFB border-#37A954 b-radius mb-20" v-for="(item, index) in list" :key="index">
+            <view class="pd-24 d-flex bg-#FBFDFB border-#37A954 b-radius mb-20" v-for="(item, index) in list" :key="index">
                 <up-radio-group v-model="radiovalue1">
                     <view @click="radiovalue1 = item?.id" class="d-flex w-100%">
                         <view class="">
-                            <view class="mb-20 ov-hd tx-ov">
+                            <view class="mb-16 ov-hd tx-ov">
                                 <text class="c-#333 f-s-34 f-w-5 mr-5">{{ item?.varietyName }}</text>
                                 <text class="c-#666 f-s-24 tx-ov ov-hd">{{ item?.latinName }}</text>
                             </view>
-                            <view class="mb-20">
+                            <view class="mb-16">
                                 <text class="c-#333 f-s-28 f-w-5 mr-5">{{ item?.genusName }}</text>
                                 <text class="c-#666 f-s-24 tx-ov ov-hd">{{ item?.genusLatinName }}</text>
                             </view>