|
|
@@ -31,12 +31,12 @@
|
|
|
<view class="p-rtv d-flex a-c mb-6">
|
|
|
<view class="flex1 ov-hd f-s-32 c-333 d-flex a-ed">
|
|
|
<text class="mr-12 up-line-1 f-w-5">{{ name }}</text>
|
|
|
- <text class="c-999 f-s-24">{{ setCipByNum(phone, 3, 4) || '-' }}</text>
|
|
|
+ <text class="c-999 f-s-24">{{ setCipByNum(phone ?? null, 3, 4) || '-' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="f-s-22 mr-10 b-radius pt-4 pb-4 pl-10 pr-10 c-primary"
|
|
|
- style="width: max-content; background-color: #b7e8bc">
|
|
|
- {{ cpyname }}
|
|
|
+ <view class="f-s-22 mr-10 radius-30 pt-4 pb-4 pl-10 pr-10 c-primary bg-#b7e8bc"
|
|
|
+ style="width: max-content;">
|
|
|
+ {{ currentCpyName }}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -80,7 +80,7 @@
|
|
|
</view>
|
|
|
<view class="d-flex a-c pt-20 pb-20 pl-16 pr-16 bg-#f7f7f7">
|
|
|
<view class="min-w-170 flex1">
|
|
|
- <ut-action-sheet v-model="form.type" :tabs="[{ label: '全部', value: '' }]"
|
|
|
+ <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]"
|
|
|
@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">{{ '全部' }}
|
|
|
@@ -92,7 +92,7 @@
|
|
|
</view>
|
|
|
<view class="h-86 pl-20 w-100%">
|
|
|
<ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0"
|
|
|
- :border="false" :placeholder="form.placeholder" bgColor="#fff" height="86rpx"
|
|
|
+ :border="false" placeholder="搜基地名称、编号、地址、负责人" bgColor="#fff" height="86rpx"
|
|
|
borderRadius="10rpx"></ut-search>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -100,43 +100,42 @@
|
|
|
<view class="pd-16">
|
|
|
<template>
|
|
|
<view v-for="(item, index) in list" :key="index" class="b-radius bg-#fff pd-20 mb-20">
|
|
|
- <view class="c-333 f-s-34 pd-5 f-w-5">德钦县拖顶乡洛沙村各加尼拉基地</view>
|
|
|
- <view class="c-ccc f-s-24 pd-5 pt-0">DQTDLSC00156768951001</view>
|
|
|
+ <view class="c-333 f-s-34 pd-5 f-w-5">{{ item?.baseName }}</view>
|
|
|
+ <view class="c-ccc f-s-24 pd-5 pt-0">{{ item?.baseCode }}</view>
|
|
|
<view class="d-flex a-c">
|
|
|
<view class="c-333 f-s-28 pd-5">
|
|
|
<text class="c-#666">基地面积:</text>
|
|
|
- <text class="f-w-5">12000亩</text>
|
|
|
+ <text class="f-w-5">{{ item?.gapInfo?.area || '-'}}</text>
|
|
|
</view>
|
|
|
<view class="flex1"></view>
|
|
|
<view class="c-333 f-s-28 pd-5">
|
|
|
<text class="c-#666">建设时间:</text>
|
|
|
- <text class="f-w-5">2003年</text>
|
|
|
+ <text class="f-w-5">{{ item?.buildDate|| '-' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="c-333 f-s-28 pd-5">
|
|
|
<text class="c-#666">基地地址:</text>
|
|
|
- <text class="f-w-5">云南省红河州个旧市卡房镇田心村小田心村268号</text>
|
|
|
+ <text class="f-w-5">{{ item?.gapInfo?.address|| '-' }}</text>
|
|
|
</view>
|
|
|
<view class="c-333 f-s-28 pd-5 d-flex">
|
|
|
<text class="c-#666 w-s-no">当前在地品种:</text>
|
|
|
- <text
|
|
|
- class="ov-hd tx-ov w-s-no f-w-5">三七、天麻、徐长卿、白及、徐长卿、白及、三七、天麻、徐长卿、白及、徐长卿、白及</text>
|
|
|
- <text class="flex1 w-s-no f-w-5">等120个品种</text>
|
|
|
+ <text class="ov-hd tx-ov w-s-no f-w-5">{{item.plantingVarieties?.map(items => items.variety).join('、') || '-'}}</text>
|
|
|
+ <text v-if="item.plantingVarieties?.length" class="flex1 w-s-no f-w-5">等{{item.plantingVarieties?.length}}个品种</text>
|
|
|
</view>
|
|
|
<view class="pd-10"></view>
|
|
|
<view class="p-rtv">
|
|
|
<up-image width="100%"
|
|
|
- src="https://img1.baidu.com/it/u=436536502,2810995452&fm=253&fmt=auto&app=120&f=JPEG?w=820&h=500"
|
|
|
+ :src="item.gapInfo?.basePic"
|
|
|
mode="widthFix"> </up-image>
|
|
|
<view class="pl-20 pr-20 pt-10 pb-10 bg-#00000080 c-#ccc f-s-20"
|
|
|
style="position: absolute; bottom: 140rpx; right: 0; border-radius: 10rpx 0 0 10rpx">
|
|
|
- 李思思负责</view>
|
|
|
+ {{item?.contactName}}负责</view>
|
|
|
<view class="pl-20 pr-20 pt-10 pb-10 bg-#00000080 c-#ccc f-s-20"
|
|
|
style="position: absolute; bottom: 80rpx; right: 0; border-radius: 10rpx 0 0 10rpx">
|
|
|
公司+合作社</view>
|
|
|
<view class="pl-20 pr-20 pt-10 pb-10 bg-#00000080 c-#ccc f-s-20"
|
|
|
style="position: absolute; bottom: 20rpx; right: 0; border-radius: 10rpx 0 0 10rpx">
|
|
|
- 经度:E64.63 纬度:N27.7385</view>
|
|
|
+ 经度:E{{ item?.gapInfo?.lng }} 纬度:N{{ item?.gapInfo?.lat }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -153,29 +152,112 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
</z-paging>
|
|
|
+ <ut-confirm-dialog v-model:show="showDeleteDialog" width="80vw" title="请选择要添加到基地类型" :confirmText="'确认选择'" :cancelText="'取消'" @confirm="handlechoseConfirm" @cancel="handleDeleteCancel">
|
|
|
+ <view class="" v-for="item in pt_base_type" :key="item?.value">
|
|
|
+ <view style="border: 1rpx solid;" :style="{'backgroundColor': item?.value == basetype ? '#EBF6EE' : '#f7f7f7','borderColor':item?.value == basetype ? '#37A954' : 'transparent'}" class="pr-30 d-flex a-c mb-20 radius-100" @click="handlechose(item.value)" >
|
|
|
+ <view class="radius-50% mg-8">
|
|
|
+ <up-avatar size="90rpx":src="item?.avatar || 'https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images/common/avatar.png'" class="mr-20"></up-avatar>
|
|
|
+ </view>
|
|
|
+ <view class="c-#333 f-s-34">
|
|
|
+ {{ item?.label }}
|
|
|
+ </view>
|
|
|
+ <view class="flex1"></view>
|
|
|
+ <view class="d-flex">
|
|
|
+ <img v-if="basetype === item.value" class="w-30 h-30" src="/static/images/plant/chooseSuccessfully.png" mode="widthFix" alt="" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </ut-confirm-dialog>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
import { useClientRequest } from '@/utils/request';
|
|
|
import { setCipByNum } from '@/utils/public';
|
|
|
-interface navbar {
|
|
|
- bottom: number;
|
|
|
- height: number;
|
|
|
- left: number;
|
|
|
- right: number;
|
|
|
- top: number;
|
|
|
- width: number;
|
|
|
- id: string;
|
|
|
- dataset?: any
|
|
|
+import { useInfoStore } from '@/store'
|
|
|
+import { computed,ref } from 'vue';
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+const { pt_base_type } = toRefs<any>(proxy?.useDict('pt_base_type'));
|
|
|
+const infoStore = useInfoStore()
|
|
|
+// 获取用户信息
|
|
|
+const avatar = computed(() => infoStore.userInfo?.avatar || '')
|
|
|
+const name = computed(() => infoStore.userInfo?.name || '')
|
|
|
+const phone = computed(() => infoStore.userInfo?.phone || '')
|
|
|
+const currentCpyName = computed(() => infoStore.userInfo?.currentCpyName || '')
|
|
|
+// 证书文件类型
|
|
|
+interface CertFile {
|
|
|
+ fileName: string;
|
|
|
+ url: string;
|
|
|
+ fileSize: number;
|
|
|
+}
|
|
|
+// 差异信息类型
|
|
|
+interface GapInfo {
|
|
|
+ id: number;
|
|
|
+ sourceType: string;
|
|
|
+ gapBaseName: string;
|
|
|
+ sn: string;
|
|
|
+ medicineName: string;
|
|
|
+ medicineId: number;
|
|
|
+ area: number;
|
|
|
+ basePic: string;
|
|
|
+ lng: number;
|
|
|
+ lat: number;
|
|
|
+ adcode: string;
|
|
|
+ address: string;
|
|
|
+ ratedDate: string; // 格式: "YYYY-MM-DD"
|
|
|
+ certFile: CertFile[];
|
|
|
+ res: string;
|
|
|
+ auditor: number;
|
|
|
+ msg: string;
|
|
|
+}
|
|
|
+
|
|
|
+// 种植品种类型
|
|
|
+interface PlantingVariety {
|
|
|
+ baseId: number;
|
|
|
+ varietyId: string;
|
|
|
+ variety: string;
|
|
|
+}
|
|
|
+
|
|
|
+// 坐标点类型
|
|
|
+interface Coordinate {
|
|
|
+ lng: number;
|
|
|
+ lat: number;
|
|
|
+}
|
|
|
+
|
|
|
+// 主数据类型
|
|
|
+interface BaseData {
|
|
|
+ id: number;
|
|
|
+ baseName: string;
|
|
|
+ baseCode?: string;
|
|
|
+ baseType?: string;
|
|
|
+ adcode?: string;
|
|
|
+ buildDate?: string; // 格式: "YYYY-MM-DD"
|
|
|
+ orgType: string;
|
|
|
+ contactId: number;
|
|
|
+ contactTel: string;
|
|
|
+ contactName?:string
|
|
|
+ lng: number;
|
|
|
+ lat: number;
|
|
|
+ basePic: string;
|
|
|
+ address: string;
|
|
|
+ area: number;
|
|
|
+ gapFlag: string;
|
|
|
+ gapInfo: GapInfo;
|
|
|
+ cpyid: number;
|
|
|
+ appid: number;
|
|
|
+ partnerId: number;
|
|
|
+ createBy: number;
|
|
|
+ updateBy: number;
|
|
|
+ createTime: string; // ISO 8601 格式
|
|
|
+ updateTime: string; // ISO 8601 格式
|
|
|
+ hide: string;
|
|
|
+ plantingVarieties: PlantingVariety[];
|
|
|
+ coordinates: Coordinate[][]; // 二维坐标数组
|
|
|
}
|
|
|
const instance = getCurrentInstance();
|
|
|
-const list = ref([]);
|
|
|
+const list = ref<BaseData[]>();
|
|
|
const paging = ref();
|
|
|
const bubble = ref(uni.getMenuButtonBoundingClientRect());
|
|
|
-const avatar = ref();
|
|
|
-const name = ref('神奇大侠');
|
|
|
-const phone = ref('17708862791');
|
|
|
-const cpyname = ref('智慧溯源有限公司');
|
|
|
-const form = ref({ type: '', placeholder: '搜基地名称、编号、地址、负责人', keyword: '' });
|
|
|
+
|
|
|
+const form = ref({ queryType: '', keyword: '' });
|
|
|
const speciesArray = ref([]);
|
|
|
const navBarBgColor = ref('transparent');
|
|
|
const stickyTop = ref(0);
|
|
|
@@ -200,7 +282,6 @@ const query = async (pageNum: number, pageSize: number) => {
|
|
|
...form.value,
|
|
|
};
|
|
|
const res = await useClientRequest.get('/plt-api/app/base/pageList', params);
|
|
|
- console.log(res);
|
|
|
const { rows } = res;
|
|
|
paging.value.complete(rows);
|
|
|
};
|
|
|
@@ -208,13 +289,26 @@ const query = async (pageNum: number, pageSize: number) => {
|
|
|
const getSpecies = async () => {
|
|
|
const res = await useClientRequest.get('/plt-api/app/cpyVariety/list');
|
|
|
if (res.code === 200) {
|
|
|
- console.log(res);
|
|
|
speciesArray.value = res.data.map((item) => item.varietyName)
|
|
|
}
|
|
|
};
|
|
|
+const showDeleteDialog = ref(true);
|
|
|
+const basetype = ref();
|
|
|
+const handlechose = (item:string) => {
|
|
|
+ basetype.value = item;
|
|
|
+};
|
|
|
+
|
|
|
+// 处理删除取消
|
|
|
+const handleDeleteCancel = () => {
|
|
|
+ showDeleteDialog.value = false;
|
|
|
+ basetype.value = null;
|
|
|
+};
|
|
|
+const handlechoseConfirm = ()=>{
|
|
|
+ uni.$u.route({ type: 'navigateTo', url: '/plant/base/base-edit/index' ,params: { basetype: basetype.value} })
|
|
|
+}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- const querys = uni.createSelectorQuery().in(instance.proxy);
|
|
|
+ const querys = uni.createSelectorQuery().in(instance?.proxy);
|
|
|
querys
|
|
|
.select('#topup-navbar')
|
|
|
.boundingClientRect((data: any) => {
|