Jelajahi Sumber

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

huangxw 1 bulan lalu
induk
melakukan
1182637dde

+ 2 - 2
src/pages/plant/base/index.vue

@@ -326,7 +326,7 @@ const getSpecies = async () => {
     }
 };
 const showDeleteDialog = ref(false);
-const basetype = ref();
+const basetype = ref('1');
 const handlechose = (item: string) => {
     basetype.value = item;
 };
@@ -334,7 +334,7 @@ const handlechose = (item: string) => {
 // 处理取消
 const handleDeleteCancel = () => {
     showDeleteDialog.value = false;
-    basetype.value = null;
+    basetype.value = '1';
 };
 const handlechoseConfirm = () => {
     uni.$u.route({ type: 'navigateTo', url: '/plant/base/base-edit/index', params: { baseType: basetype.value } });

+ 8 - 5
src/plant/port/supervise-create/index.vue

@@ -12,13 +12,13 @@
                     <!-- 操作日期 -->
                     <view class="h-1" id="operationDatepppp"></view>
                     <up-form-item :borderBottom="false" label="操作日期" required prop="operationDate">
-                        <ut-datetime-picker v-model="form.operationDate.startDate" mode="datetime" dateFields="day">
+                        <ut-datetime-picker v-model="form.operationDate.startDate" mode="date" dateFields="day">
                             <view class="d-flex mr-20">
                                 <up-input v-model="form.operationDate.startDate" placeholder="请选择操作开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                 <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
                             </view>
                         </ut-datetime-picker>
-                        <ut-datetime-picker v-model="form.operationDate.endDate" mode="datetime" dateFields="day">
+                        <ut-datetime-picker v-model="form.operationDate.endDate" mode="date" dateFields="day">
                             <view class="d-flex">
                                 <up-input v-model="form.operationDate.endDate" placeholder="请选择操作结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
                                 <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
@@ -80,10 +80,11 @@
 <script setup lang="ts">
 import { ref, reactive, computed, getCurrentInstance, type ComponentInternalInstance } from 'vue';
 import { useClientRequest } from '@/utils/request';
-
+import { useInfoStore } from '@/store';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { yes_no } = toRefs<any>(proxy?.useDict('yes_no'));
 const deawerData = ref();
+const infoStore = useInfoStore();
 // 表单数据
 const form = ref({
     operationDate: {
@@ -92,7 +93,7 @@ const form = ref({
     },
     operationType: null as string | null,
     operationMethod: '',
-    recorder: '',
+    recorder: infoStore.userInfo?.name,
     useMaterial: '0' as '0' | '1',
     remark: '',
 });
@@ -159,7 +160,9 @@ const query = async (pageNo: number, pageSize: number) => {
     });
     // return res.data;
 };
-
+const handleBaseinfoClose = () => {
+    deawerData.value = null;
+};
 // 提交表单
 const save = () => {
     uni.$u.debounce(

+ 95 - 0
src/plant/port/supervise-create/models/baseinfo.vue

@@ -0,0 +1,95 @@
+<template>
+    <view class="border-#AFDDBB pd-26 pb-10 pt-10 bg-#FBFDFB p-rtv">
+        <!-- 关闭按钮 -->
+        <view v-if="showClose" class="c-#F81242 f-s-36 ab2-10-10 pl-20 pr-10" style="position: absolute; right: 10rpx; top: 0rpx" @click="handleClose"> × </view>
+        <!-- 标签显示:GAP和三无一全 -->
+        <view v-if="+modeValue?.gapFlag || +modeValue?.swyqRes" class="pt-8 pb-8 d-flex pr-20 pl-20" style="width: max-content; margin-top: -10rpx; margin-left: -26rpx; background: linear-gradient(90deg, #5eba75, #c6e391); border-bottom-right-radius: 88rpx">
+            <view v-if="+modeValue?.gapFlag && !+modeValue?.swyqRes" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.medicineName }}GAP基地</view>
+            <view v-if="+modeValue?.swyqRes && !+modeValue?.gapFlag" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.swyqMedicineName }}三无一全基地</view>
+            <view v-if="+modeValue?.gapFlag && +modeValue?.swyqRes" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.medicineName }}GAP基地和{{ modeValue?.swyqMedicineName }}三无一全基地</view>
+        </view>
+        <view class="c-#333 f-s-34 f-w-5 pt-8 pb-8 pr-16">{{ modeValue?.baseName }}</view>
+        <view class="pt-8 pb-8">
+            <text class="c-#666 f-s-28">基地面积:</text>
+            <text class="c-#333 f-s-28 f-w-5">{{ modeValue?.area }}{{ modeValue?.areaUnit }}</text>
+        </view>
+        <view class="pt-8 pb-8">
+            <text class="c-#666 f-s-28">基地地址:</text>
+            <text class="c-#333 f-s-28 f-w-5">{{ modeValue?.adcodeName }}{{ modeValue?.address }}</text>
+        </view>
+        <view style="margin-left: -26rpx; margin-right: -26rpx; border-bottom: 1rpx solid #d4ecda"></view>
+        <view class="pt-16 pb-8">
+            <text v-if="+modeValue?.data?.[0]?.landType == 1" class="c-#666 f-s-28">地块信息:</text>
+            <text v-if="+modeValue?.data?.[0]?.landType == 2" class="c-#666 f-s-28">圈舍信息:</text>
+            <text v-if="+modeValue?.data?.[0]?.landType == 3" class="c-#666 f-s-28">培养架信息:</text>
+            <text v-if="!modeValue?.aloneChecked" class="c-#333 f-s-28 f-w-5">{{ modeValue?.data?.length }}个</text>
+            <text v-if="modeValue?.aloneChecked" class="c-#333 f-s-28 f-w-5">该基地所有{{ +modeValue?.data?.[0]?.landType == 1 ? '地块' : +modeValue?.data?.[0]?.landType == 2 ? '圈舍' : '培养架' }}</text>
+        </view>
+        <view v-if="!modeValue?.aloneChecked" class="pt-8 pb-8" v-for="(item, index) in modeValue?.data" :key="index">
+            <text class="c-#666 f-s-28 mr-20">{{ item?.landName }}:</text>
+            <text v-if="+modeValue?.data?.[0]?.landType == 3" class="c-#333 f-s-28 f-w-5">{{ item?.capacityAmount }}{{ item?.capacityUnit }}</text>
+            <text v-else class="c-#333 f-s-28 f-w-5">{{ item?.area }}{{ item?.areaUnit }}</text>
+        </view>
+    </view>
+</template>
+<script setup lang="ts">
+// 定义props接口
+interface ModeValue {
+    baseName?: string;
+    area?: string | number;
+    areaUnit?: string;
+    address?: string;
+    adcodeName?: string;
+    gapFlag?: any;
+    swyqRes?: any;
+    aloneChecked?: boolean;
+    data?: any[];
+    // 保留原有字段以保持向后兼容
+    checkBox?: any[];
+    medicineName: string | null;
+    swyqMedicineName: string | null;
+}
+
+// 接收modeValue对象
+const props = withDefaults(
+    defineProps<{
+        modeValue?: ModeValue;
+        baseType: string;
+        showClose?: boolean;
+    }>(),
+    {
+        showClose: true,
+    },
+);
+setTimeout(() => {
+    console.log(props?.modeValue);
+}, 1000);
+// 定义emit事件
+const emit = defineEmits<{
+    (e: 'update:modeValue', value: ModeValue | null): void;
+    (e: 'close'): void;
+}>();
+
+// 处理关闭
+const handleClose = () => {
+    // 触发事件清空modeValue
+    console.log('?');
+
+    emit('update:modeValue', null);
+    emit('close');
+};
+</script>
+
+<style scoped lang="scss">
+.label {
+    font-size: 24rpx;
+    color: #37a954;
+    border-radius: 100rpx;
+    background-color: #e3efe6;
+    width: max-content;
+    padding-left: 14rpx;
+    padding-right: 14rpx;
+    padding-top: 6rpx;
+    padding-bottom: 6rpx;
+}
+</style>