|
@@ -2,51 +2,51 @@
|
|
|
<view class="ksqulc">
|
|
<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>
|
|
<z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" refresher-only @onRefresh="onRefresh" scroll-with-animation>
|
|
|
<template #top>
|
|
<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>
|
|
</template>
|
|
|
<view class="p-rtv">
|
|
<view class="p-rtv">
|
|
|
<view ref="baseRef" class="pd-24" id="base12345">
|
|
<view ref="baseRef" class="pd-24" id="base12345">
|
|
|
<view class="startline-title">证明材料</view>
|
|
<view class="startline-title">证明材料</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="pd-24 bg-#fff mb-10">
|
|
<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>
|
|
|
<!-- 选择获评品种 -->
|
|
<!-- 选择获评品种 -->
|
|
|
- <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>
|
|
<view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择获评品种</view>
|
|
|
<template #right>
|
|
<template #right>
|
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
</template>
|
|
</template>
|
|
|
</up-form-item>
|
|
</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>
|
|
<template #right>
|
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
</template>
|
|
</template>
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
</ut-datetime-picker>
|
|
</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 class="flex1">
|
|
|
<view style="margin-bottom: 10rpx">
|
|
<view style="margin-bottom: 10rpx">
|
|
|
<span class="c-666 f-s-30">官方公示证明材料</span>
|
|
<span class="c-666 f-s-30">官方公示证明材料</span>
|
|
|
<span class="f-s-26 c-999">(可上传9张)</span>
|
|
<span class="f-s-26 c-999">(可上传9张)</span>
|
|
|
</view>
|
|
</view>
|
|
|
- <ut-upload v-model="formSwyq.swyqCertFile" :max-count="9"></ut-upload>
|
|
|
|
|
|
|
+ <ut-upload v-model="formRes.certFile" :max-count="9"></ut-upload>
|
|
|
</view>
|
|
</view>
|
|
|
</up-form-item>
|
|
</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>
|
|
</up-form-item>
|
|
|
</view>
|
|
</view>
|
|
|
</up-form>
|
|
</up-form>
|
|
@@ -100,7 +100,7 @@
|
|
|
import { useClientRequest } from '@/utils/request';
|
|
import { useClientRequest } from '@/utils/request';
|
|
|
import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
|
|
import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
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([
|
|
const tabs = reactive([
|
|
|
{ label: '基本信息', value: 'base' },
|
|
{ label: '基本信息', value: 'base' },
|
|
|
{ label: '地块信息', value: 'plot' },
|
|
{ label: '地块信息', value: 'plot' },
|
|
@@ -114,26 +114,25 @@ const mapUnitByBaseType: any = {
|
|
|
'3': '平方米',
|
|
'3': '平方米',
|
|
|
};
|
|
};
|
|
|
const form = ref<any>({});
|
|
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>({
|
|
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 = () => {
|
|
const selectMedicine = () => {
|
|
|
uni.$on('medicineSelected', (medicine: any) => {
|
|
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.$off('medicineSelected');
|
|
|
});
|
|
});
|
|
|
uni.$u.route({
|
|
uni.$u.route({
|
|
@@ -148,14 +147,15 @@ const did = ref('');
|
|
|
// 根据id获取基地详情
|
|
// 根据id获取基地详情
|
|
|
const getDetailById = async (id: string) => {
|
|
const getDetailById = async (id: string) => {
|
|
|
const res = await useClientRequest.get(`/plt-api/app/base/getInfoAllById/${id}`);
|
|
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 = () => {
|
|
const onRefresh = () => {
|
|
|
getDetailById(did.value);
|
|
getDetailById(did.value);
|
|
@@ -178,11 +178,12 @@ const submitForm = async () => {
|
|
|
title: '提交中...',
|
|
title: '提交中...',
|
|
|
});
|
|
});
|
|
|
try {
|
|
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,
|
|
id: did.value,
|
|
|
}) : await useClientRequest.post('/plt-api/app/base/addSwyqBase', {
|
|
}) : await useClientRequest.post('/plt-api/app/base/addSwyqBase', {
|
|
|
- ...formSwyq.value,
|
|
|
|
|
|
|
+ ...formRes.value,
|
|
|
|
|
+ id: did.value,
|
|
|
});
|
|
});
|
|
|
if (!res || res.code !== 200) return;
|
|
if (!res || res.code !== 200) return;
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
@@ -196,9 +197,10 @@ const submitForm = async () => {
|
|
|
// 返回上一页
|
|
// 返回上一页
|
|
|
uni.$u.route({
|
|
uni.$u.route({
|
|
|
type: 'redirect',
|
|
type: 'redirect',
|
|
|
- url: '/plant/base/mark-swyq-base-detail/index',
|
|
|
|
|
|
|
+ url: '/plant/base/mark-base-detail/index',
|
|
|
params: {
|
|
params: {
|
|
|
id: did.value,
|
|
id: did.value,
|
|
|
|
|
+ type: formRes.value.type,
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -210,9 +212,9 @@ const submitForm = async () => {
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
// 判断节点是否在可视区域内如果在则切换tab createIntersectionObserver
|
|
// 判断节点是否在可视区域内如果在则切换tab createIntersectionObserver
|
|
|
-
|
|
|
|
|
onLoad((options: any) => {
|
|
onLoad((options: any) => {
|
|
|
did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
|
|
did.value = options?.id || getUrlParams(recursiveDecodeURIComponent(options?.q))?.id || '';
|
|
|
|
|
+ formRes.value.type = options?.type || getUrlParams(recursiveDecodeURIComponent(options?.q))?.type || '';
|
|
|
getDetailById(did.value);
|
|
getDetailById(did.value);
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|