huangxw 4 veckor sedan
förälder
incheckning
8e7c337659

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

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

@@ -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: '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?.baseName }}</view>
-                            <view class="c-#999 f-s-24">{{ item?.ratedDate }}获评</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>
@@ -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?.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>
@@ -106,6 +106,11 @@ const query = async (pageNum: number, pageSize: number) => {
     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 () => {

+ 10 - 5
src/audit/plant/base/audit-list/models/swyq-base.vue

@@ -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?.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="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,6 +87,11 @@ 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: '',
     res: '0',