Browse Source

种源列表

lisy 1 month ago
parent
commit
2310c8d456

+ 2 - 2
src/pages.json

@@ -195,7 +195,7 @@
                     }
                 },
                 {
-                    "path": "port-Information/index",
+                    "path": "port-listinfo/index",
                     "style": {
                         "navigationBarTitleText": "种源信息列表"
                     }
@@ -277,7 +277,7 @@
                         "navigationBarTitleText": "库存损耗登记"
                     }
                 },
-                // 农资库 
+                // 农资库
                 {
                     "path": "agro-product/list/index",
                     "style": {

+ 3 - 3
src/pages/index/index.vue

@@ -12,7 +12,7 @@
                     <button class="logout-btn" @click="handleLogout">退出登录</button>
                 </view>
                 <view v-else class="login-prompt">
-                    <text class="prompt-text">请先登录111</text>
+                    <text class="prompt-text">请先登录</text>
                     <button class="login-btn" @click="goToLogin">前往登录123</button>
                 </view>
             </view>
@@ -38,7 +38,7 @@ import { useUserStore } from '@/store/modules/user';
 import { checkAuth, logoutAndRedirect } from '@/utils/routeGuard';
 // const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 // const { class_type } = toRefs<any>(proxy?.useDict('class_type'));
-const title = ref('Hello');
+const title = ref('Hello - HMR Test');
 const paging = ref<any>(null);
 
 // Store
@@ -165,7 +165,7 @@ const handleLogout = async (): Promise<void> => {
 
         .logout-btn {
             padding: 12rpx 24rpx;
-            background: #F74C30;
+            background: #f74c30;
             color: #fff;
             border: none;
             border-radius: 8rpx;

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

@@ -15,7 +15,7 @@
                 </ut-action-sheet>
             </view>
             <view class="h-86 pl-20 w-100%">
-                <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" @change="changeSeach" margin="0" :border="false" placeholder="搜批次号、品种名、基地名" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
             </view>
         </view>
         <view class="pd-24 bg-#f7f7f7" :style="{ width: windowInfo ? windowInfo.screenWidth - 26 + 'px' : '100%' }">
@@ -24,7 +24,7 @@
         <view class="pd-24">
             <up-swipe-action>
                 <up-swipe-action-item v-for="(item, index) in list" :key="index" :name="item?.id" :options="subCurrent === 0 ? options2 : options" class="mb-20" @click="clickTempSwipe">
-                    <task :data="item" @click="$u.route({ type: 'navigateTo', url: '/plant/port/port-detail/index', params: { id: item?.id } })" @toSupervise="$u.route({ type: 'navigateTo', url: '/plant/port/port-supervise/index', params: { id: item?.id } })" @toInformation="$u.route({ type: 'navigateTo', url: '/plant/port/port-Information/index', params: { id: item?.id } })" />
+                    <task :data="item" :status="form?.status" @click="$u.route({ type: 'navigateTo', url: '/plant/port/port-detail/index', params: { id: item?.id } })" @toSupervise="$u.route({ type: 'navigateTo', url: '/plant/port/port-supervise/index', params: { id: item?.id } })" @toInformation="$u.route({ type: 'navigateTo', url: '/plant/port/port-listinfo/index', params: { id: item?.id } })" />
                 </up-swipe-action-item>
             </up-swipe-action>
         </view>

+ 5 - 1
src/pages/plant/port/models/task.vue

@@ -3,6 +3,7 @@
     <view class="" v-if="data.taskType === '2'">
         <view class="b-radius bg-#fff pd-10 p-rtv">
             <image class="w-80 h-34" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/port/Task_Breeding.png" mode="widthFix" style="position: absolute; top: 0; left: 0" />
+            <image v-if="+status == 9" class="w-98 h-98" src="/static/images/plant/port/over.png" mode="widthFix" style="position: absolute; top: 50rpx; right: 20rpx" />
             <view class="d-flex j-ed f-s-22 c-#666">{{ data?.plannedStartDate }}至{{ data?.plannedEndDate }}</view>
             <view class="d-flex a-ed pd-16 pt-8 pb-8">
                 <view class="c-#333 f-s-34 f-w-5 mr-6">{{ data?.variety }}</view>
@@ -71,6 +72,7 @@
     <view class="" v-if="data.taskType === '11'" @click="$emit('click')">
         <view class="b-radius bg-#fff pd-10 p-rtv">
             <image class="w-112 h-34" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/port/Task_Seedling_breeding.png" mode="widthFix" style="position: absolute; top: 0; left: 0" />
+            <image v-if="+status == 9" class="w-98 h-98" src="/static/images/plant/port/over.png" mode="widthFix" style="position: absolute; top: 50rpx; right: 20rpx" />
             <view class="d-flex j-ed f-s-22 c-#666">{{ data?.plannedStartDate }} 至 {{ data?.plannedEndDate }}</view>
             <view class="d-flex a-ed pd-16 pt-8 pb-8">
                 <view class="c-#333 f-s-34 f-w-5 mr-6">{{ data?.variety }}</view>
@@ -149,6 +151,7 @@
     <view class="" v-if="data.taskType === '1'" @click="$emit('click')">
         <view class="b-radius bg-#fff pd-10 p-rtv">
             <image class="w-80 h-34" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/port/Task_Planting.png" mode="widthFix" style="position: absolute; top: 0; left: 0" />
+            <image v-if="+status == 9" class="w-98 h-98" src="/static/images/plant/port/over.png" mode="widthFix" style="position: absolute; top: 50rpx; right: 20rpx" />
             <view class="d-flex j-ed f-s-22 c-#666">{{ data?.plannedStartDate }}至{{ data?.plannedEndDate }}</view>
             <view class="d-flex a-ed pd-16 pt-8 pb-8">
                 <view class="c-#333 f-s-34 f-w-5 mr-6">{{ data?.variety }}</view>
@@ -217,6 +220,7 @@
     <view class="" v-if="data.taskType === '21'" @click="$emit('click')">
         <view class="b-radius bg-#fff pd-10 p-rtv">
             <image class="w-112 h-34" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/port/Task_Breeding_Livestock.png" mode="widthFix" style="position: absolute; top: 0; left: 0" />
+            <image v-if="+status == 9" class="w-98 h-98" src="/static/images/plant/port/over.png" mode="widthFix" style="position: absolute; top: 50rpx; right: 20rpx" />
             <view class="d-flex j-ed f-s-22 c-#666">{{ data?.plannedStartDate }}至{{ data?.plannedEndDate }}</view>
             <view class="d-flex a-ed pd-16 pt-8 pb-8">
                 <view class="c-#333 f-s-34 f-w-5 mr-6">{{ data?.variety }}</view>
@@ -283,7 +287,7 @@
     </view>
 </template>
 <script setup lang="ts">
-const props = defineProps<{ data: any }>();
+const props = defineProps<{ data: any; status: any }>();
 
 //按钮样式
 const customStyle1 = reactive({

+ 4 - 4
src/plant/port/port-create/index.vue

@@ -176,9 +176,9 @@
                                 </view>
                             </view>
                         </up-form-item> -->
-                        <up-form-item borderBottom label="供应商" prop="delegateInfo">
+                        <up-form-item borderBottom label="委托企业" prop="delegateInfo">
                             <view class="flex1">
-                                <ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
+                                <ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '1' }" title="选择委托企业" placeholder="请选择委托企业信息"></ContactUnitInput>
                             </view>
                         </up-form-item>
                         <ut-action-sheet v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
@@ -497,9 +497,9 @@
                                 </view>
                             </view>
                         </up-form-item> -->
-                        <up-form-item borderBottom label="供应商" prop="delegateInfo">
+                        <up-form-item borderBottom label="委托企业" prop="delegateInfo">
                             <view class="flex1">
-                                <ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
+                                <ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '1' }" title="选择委托企业" placeholder="请选择委托企业信息"></ContactUnitInput>
                             </view>
                         </up-form-item>
                         <ut-action-sheet v-if="+deawerData?.data[0]?.landType == 3" v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">

+ 0 - 234
src/plant/port/port-information/index.vue

@@ -1,234 +0,0 @@
-<template>
-    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom empty-view-text="该任务暂未关联种源信息">
-        <template #top>
-            <ut-navbar title="种源信息" :fixed="false"> </ut-navbar>
-        </template>
-        <view class="pd-24">
-            <Task_card :data="taskDate" />
-            <view class="d-flex a-c j-sb pt-20 pb-20">
-                <view class="startline-title mb-16">种源信息</view>
-                <view class="d-flex a-c gap-10">
-                    <view class="bg-#37A954 radius-10 pd4-10-20-10-20 d-flex a-c" style="width: max-content" @click="addManagementRecord()">
-                        <up-icon name="plus" color="#fff" size="24rpx"></up-icon>
-                        <view class="c-#fff f-s-22">添加种源信息</view>
-                    </view>
-                </view>
-            </view>
-            <ut-search ref="searchRef" v-model="from.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜管理类型、物料、记录人" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
-            <view class="pd-10"></view>
-            <up-swipe-action>
-                <up-swipe-action-item v-for="(item, index) in list" :key="index" :name="item?.id" :options="options2" class="mb-20" @click="clickTempSwipe">
-                    <view class="bg-#fff b-radius pd-24" @click="gotoDetail(item)">
-                        <view class="d-flex a-c j-sb">
-                            <view class="f-s-34 f-w-5 pb-10" v-if="item?.opMethod !== '99'">{{ selectDictLabel(+taskDate.baseType == 1 ? pt_op_method : +taskDate.baseType == 2 ? pt_raise_op_method : pt_breed_op_method, item?.opMethod) }}</view>
-                            <view class="f-s-34 f-w-5 pb-10" v-else>{{ item?.cusOp }}</view>
-                            <view class="d-flex a-c">
-                                <view class="f-s-22 c-#666">{{ item?.activityStart }}</view>
-                                <view class="f-s-22 c-#666">至</view>
-                                <view class="f-s-22 c-#666">{{ item?.activityEnd }}</view>
-                            </view>
-                        </view>
-                        <view class="d-flex pd4-8-0-8-0">
-                            <view class="c-#666 f-s-28 w-s-no">使用物料:</view>
-                            <view class="c-#333 f-s-28 f-w-5 w-s-no tx-ov ov-hd"></view>
-                        </view>
-                        <view v-if="item?.mgName" class="d-flex pd4-8-0-8-0">
-                            <view class="c-#666 f-s-28">记录人:</view>
-                            <view class="c-#333 f-s-28 f-w-5">{{ item?.mgName }}</view>
-                        </view>
-                        <view v-if="item?.targetType == '1'" class="d-flex pd4-8-0-8-0">
-                            <view class="c-#666 f-s-28 w-s-no">操作地块:</view>
-                            <view class="c-#333 f-s-28 f-w-5" v-if="+item?.landFlag">全部{{ +taskDate?.baseType == 1 ? '地块' : +taskDate?.baseType == 2 ? '圈舍' : '培养架' }}</view>
-                            <view class="c-#333 f-s-28 f-w-5 d-flex a-c w-s-no tx-ov ov-hd" v-else>
-                                <template v-if="item?.lands?.length == 0">
-                                    <text>{{ '-' }}</text>
-                                </template>
-                                <view v-else v-for="(data, indexs) in item?.lands">
-                                    <text v-if="indexs !== 0">、</text>
-                                    <text>{{ data?.landName }}</text>
-                                </view>
-                            </view>
-                        </view>
-                        <view v-else class="d-flex pd4-8-0-8-0">
-                            <view class="c-#666 f-s-28 w-s-no">操作个体:</view>
-                            <template v-if="item?.animalIds?.length == 0">
-                                <text>{{ '-' }}</text>
-                            </template>
-                            <view v-else v-for="(data, indexs) in item?.animalIds">
-                                <text v-if="indexs !== 0">、</text>
-                                <text class="c-#333 f-s-28 f-w-5">{{ data }}</text>
-                            </view>
-                        </view>
-                        <view v-if="item?.remark" class="d-flex pd4-8-0-8-0">
-                            <view class="c-#666 f-s-28 w-s-no">备注:</view>
-                            <view class="c-#333 f-s-28 f-w-5 w-s-no tx-ov ov-hd">{{ item?.remark }}</view>
-                        </view>
-                    </view>
-                </up-swipe-action-item>
-            </up-swipe-action>
-        </view>
-    </z-paging>
-</template>
-<script setup lang="ts">
-import { useClientRequest } from '@/utils/request';
-import Task_card from './models/task_card.vue';
-const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_op_method, pt_breed_op_method, pt_raise_op_method } = toRefs<any>(proxy?.useDict('pt_op_method', 'pt_breed_op_method', 'pt_raise_op_method'));
-const paging = ref();
-const list = ref<any>([]);
-const taskId = ref('');
-const taskDate = ref<any>();
-const from = ref({
-    keyword: '',
-    activityType: '',
-});
-const list1 = reactive([
-    { name: '全部', value: '' },
-    { name: '管理记录', value: 1 },
-    { name: '投料记录', value: 2 },
-]);
-const changeType = (tabItem: any) => {
-    from.value.activityType = tabItem.value;
-    paging.value.reload();
-};
-const query = async (pageNo: number, pageSize: number) => {
-    const res = await useClientRequest.get('/plt-api/app/plantationActivity/list', {
-        pageNo,
-        pageSize,
-        ...from.value,
-        taskId: taskId.value,
-    });
-    if (res) {
-        const { rows } = res;
-        paging.value.complete(rows);
-    }
-};
-// 添加种源信息
-const addManagementRecord = () => {
-    uni.$u.route({
-        type: 'navigateTo',
-        url: '/tools/species-info/index',
-    });
-};
-//添加投入物料记录
-const addInputMaterialRecord = () => {
-    console.log('添加投入物料记录');
-    uni.$u.route({
-        type: 'navigateTo',
-        url: '/plant/port/supervise/supervise-material-create/index',
-        params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 1, id: taskDate?.value?.id },
-    });
-};
-const changeSeach = async () => {
-    paging.value.reload();
-};
-const options2 = reactive([
-    {
-        text: '删除',
-        style: {
-            backgroundColor: '#F74C30',
-            width: '80rpx',
-            fontSize: '28rpx',
-        },
-    },
-    {
-        text: '编辑',
-        style: {
-            backgroundColor: '#37A954',
-            width: '80rpx',
-            fontSize: '28rpx',
-        },
-    },
-]);
-const clickTempSwipe = async (event: object) => {
-    const { name, index } = event as any;
-    // 在list中id找到对应的name
-    const activityType = list.value.find((item: any) => item.id === name)?.activityType;
-    list.value.forEach((item: any) => {});
-    if (index === 0) {
-        try {
-            const res = await uni.showModal({
-                title: '删除提示',
-                content: '删除后,将不能恢复,请谨慎操作!若已使用物料,删除后物料将自动退回相应仓库。',
-                confirmColor: '#f56c6c',
-            });
-            if (!res.confirm) return;
-            await uni.showLoading({
-                title: '删除中...',
-                mask: true,
-            });
-            await useClientRequest.get(`/plt-api/app/plantationActivity/deleteActivity/${name}`);
-            uni.hideLoading();
-            uni.showToast({
-                title: '删除成功',
-                icon: 'success',
-            });
-            paging.value?.reload();
-        } catch (error) {
-            console.error('删除任务失败:', error);
-        }
-    } else {
-        if (activityType == '2') {
-            uni.$u.route({
-                type: 'navigateTo',
-                url: '/plant/port/supervise/supervise-material-create/index',
-                params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 0, id: name },
-            });
-        } else if (taskDate?.value?.taskType == '1') {
-            uni.$u.route({
-                type: 'navigateTo',
-                url: `/plant/port/supervise/supervise-plant-create/index`,
-                params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 0, id: name },
-            });
-        } else if (taskDate?.value?.taskType == '11' || taskDate?.value?.taskType == '21') {
-            uni.$u.route({
-                type: 'navigateTo',
-                url: '/plant/port/supervise/supervise-breeding-create/index',
-                //参数说明 baseId:基地id,taskId:任务id,add:1新增,id:任务id,landType:地块类型
-                params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 0, id: name, landType: taskDate?.value?.baseType },
-            });
-        } else {
-            uni.$u.route({
-                type: 'navigateTo',
-                url: '/plant/port/supervise/supervise-raising-create/index',
-                //参数说明 baseId:基地id,taskId:任务id,add:1新增,id:任务id,landType:地块类型
-                params: { baseId: taskDate?.value?.baseId, taskId: taskId.value, add: 0, id: name, landType: taskDate?.value?.baseType },
-            });
-        }
-    }
-};
-const gotoDetail = async (item: any) => {
-    if (item?.activityType == '2') {
-        uni.$u.route({
-            type: 'navigateTo',
-            url: `/plant/port/supervise/supervise-material-detail/index`,
-            params: {
-                id: item?.id,
-            },
-        });
-    } else if (item?.activityType == '1') {
-        uni.$u.route({
-            type: 'navigateTo',
-            url: `/plant/port/supervise/supervise-plant-detail/index`,
-            params: {
-                id: item?.id,
-            },
-        });
-    }
-};
-onMounted(async () => {
-    const res = await useClientRequest.get(`/plt-api/app/plantationTask/getInfo/${taskId.value}`, {
-        pageNo: 1,
-        pageSize: 10,
-    });
-    taskDate.value = res.data;
-});
-onLoad((options: any) => {
-    taskId.value = options?.id;
-    //接收 uni.$emit('updatesuperviselist');
-    uni.$on('updatesuperviselist', () => {
-        paging.value?.reload();
-    });
-});
-</script>

+ 169 - 0
src/plant/port/port-listinfo/index.vue

@@ -0,0 +1,169 @@
+<template>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom empty-view-text="该任务暂未关联种源信息">
+        <template #top>
+            <ut-navbar title="种源信息" :fixed="false"> </ut-navbar>
+        </template>
+        <view class="pd-24">
+            <Task_card :data="taskDate" />
+            <view class="d-flex a-c j-sb pt-20 pb-20">
+                <view class="startline-title mb-16">种源信息</view>
+                <view class="d-flex a-c gap-10">
+                    <view class="bg-#37A954 radius-10 pd4-10-20-10-20 d-flex a-c" style="width: max-content" @click="addManagementRecord()">
+                        <up-icon name="plus" color="#fff" size="24rpx"></up-icon>
+                        <view class="c-#fff f-s-22">添加种源信息</view>
+                    </view>
+                </view>
+            </view>
+            <ut-search ref="searchRef" v-model="from.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜管理类型、物料、记录人" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+            <view class="pd-10"></view>
+            <up-swipe-action>
+                <up-swipe-action-item v-for="(item, index) in list" :key="index" :name="item?.id" :options="options2" class="mb-20" @click="clickTempSwipe">
+                    <view class="bg-#fff b-radius pd-24" @click="gotoDetail(item)">
+                        <view class="d-flex a-c j-sb">
+                            <view class="d-flex a-c">
+                                <view class="f-s-34 f-w-5 pb-10 mr-10">{{ item?.seedInfo?.variety }}</view>
+                                <view class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, item?.seedInfo?.seedType) }}</view>
+                            </view>
+                            <view class="d-flex a-c">
+                                <view class="f-s-22 c-#666">{{ item?.seedInfo?.updateTime || item?.seedInfo?.createTime }}</view>
+                            </view>
+                        </view>
+                        <view class="d-flex pd4-8-0-8-0">
+                            <view class="c-#666 f-s-28 w-s-no">入库批号:</view>
+                            <view class="c-#333 f-s-28 f-w-5 w-s-no tx-ov ov-hd">{{ item?.seedInfo?.batchCode }}</view>
+                        </view>
+                        <view class="d-flex pd4-8-0-8-0">
+                            <view class="c-#666 f-s-28 w-s-no">供应商:</view>
+                            <view class="c-#333 f-s-28 f-w-5 w-s-no tx-ov ov-hd">{{ item?.seedInfo?.supplierInfo?.cusName || '-' }}</view>
+                        </view>
+                        <view class="d-flex pd4-8-0-8-0">
+                            <view class="c-primary f-s-28 w-s-no">投入量:</view>
+                            <view class="c-primary f-s-28 f-w-5 w-s-no tx-ov ov-hd">{{ item?.amount }}{{ item?.seedInfo?.unit }}</view>
+                        </view>
+                        <view class="d-flex pd4-8-0-8-0">
+                            <view class="c-#666 f-s-28 w-s-no">备注/说明:</view>
+                            <view class="c-#333 f-s-28 f-w-5 w-s-no tx-ov ov-hd">{{ item?.remark || '-' }}</view>
+                        </view>
+                        <view class="d-flex">
+                            <view class="pd2-4-0 f-s-24 w-40%">
+                                <span class="c-#666">记录人:</span>
+                                <span class="c-#666">{{ item?.seedInfo?.createByName || '-' }}</span>
+                            </view>
+                            <view class="pd2-4-0 f-s-24 flex1">
+                                <span class="c-#666">操作时间:</span>
+                                <span class="c-#666">{{ item?.seedInfo?.updateTime || item?.seedInfo?.createTime }}</span>
+                            </view>
+                        </view>
+                    </view>
+                </up-swipe-action-item>
+            </up-swipe-action>
+        </view>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import Task_card from './models/task_card.vue';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_seed_type, pt_breed_op_method, pt_raise_op_method } = toRefs<any>(proxy?.useDict('pt_seed_type', 'pt_breed_op_method', 'pt_raise_op_method'));
+const paging = ref();
+const list = ref<any>([]);
+const taskId = ref('');
+const taskDate = ref<any>();
+const from = ref({
+    keyword: '',
+    activityType: '',
+});
+const query = async (pageNo: number, pageSize: number) => {
+    const res = await useClientRequest.get(`/plt-api/app/seedInfo/getSeedInfoList/${taskId.value}`, {
+        pageNo,
+        pageSize,
+        ...from.value,
+        taskId: taskId.value,
+    });
+    console.log(res, 'res');
+
+    if (res) {
+        const { data } = res;
+        paging.value.complete(data);
+    }
+};
+// 添加种源信息
+const addManagementRecord = () => {
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/species-info/index',
+        params: { taskId: taskId.value },
+    });
+};
+
+const changeSeach = async () => {
+    paging.value.reload();
+};
+const options2 = reactive([
+    {
+        text: '删除',
+        style: {
+            backgroundColor: '#F74C30',
+            width: '80rpx',
+            fontSize: '28rpx',
+        },
+    },
+]);
+const clickTempSwipe = async (event: object) => {
+    const { name, index } = event as any;
+    try {
+        const res = await uni.showModal({
+            title: '删除提示',
+            content: '删除后,删除的物料将自动退回相应库存。不能恢复,请谨慎操作!',
+            confirmColor: '#f56c6c',
+        });
+        if (!res.confirm) return;
+        await uni.showLoading({
+            title: '删除中...',
+            mask: true,
+        });
+        await useClientRequest.get(`/plt-api/app/seedInfo/deleteSeedInfo/${name}`);
+        uni.hideLoading();
+        uni.showToast({
+            title: '删除成功',
+            icon: 'success',
+        });
+        paging.value?.reload();
+    } catch (error) {
+        console.error('删除任务失败:', error);
+    }
+};
+const gotoDetail = async (item: any) => {
+    if (item?.activityType == '2') {
+        uni.$u.route({
+            type: 'navigateTo',
+            url: `/plant/port/supervise/supervise-material-detail/index`,
+            params: {
+                id: item?.id,
+            },
+        });
+    } else if (item?.activityType == '1') {
+        uni.$u.route({
+            type: 'navigateTo',
+            url: `/plant/port/supervise/supervise-plant-detail/index`,
+            params: {
+                id: item?.id,
+            },
+        });
+    }
+};
+onMounted(async () => {
+    const res = await useClientRequest.get(`/plt-api/app/plantationTask/getInfo/${taskId.value}`, {
+        pageNo: 1,
+        pageSize: 10,
+    });
+    taskDate.value = res.data;
+});
+onLoad((options: any) => {
+    taskId.value = options?.id;
+    //接收 uni.$emit('updatesuperviselist');
+    uni.$on('updatesuperviselist', () => {
+        paging.value?.reload();
+    });
+});
+</script>

+ 0 - 0
src/plant/port/port-information/models/task_card.vue → src/plant/port/port-listinfo/models/task_card.vue


+ 0 - 1
src/plant/port/supervise/models/materialinfo.vue

@@ -49,7 +49,6 @@
 </template>
 <script setup lang="ts">
 import { ref, watch, computed } from 'vue';
-
 // 从外部获取数据
 const props = defineProps<{
     showClose?: boolean;

+ 37 - 1
src/plant/port/supervise/supervise-breeding-create/index.vue

@@ -100,7 +100,7 @@
                     <!-- 是否使用物料 -->
                     <up-form-item borderBottom label="是否使用物料" required prop="inputFlag" id="inputFlagpppp">
                         <view class="d-flex flex-cln">
-                            <view v-if="!isAdd" class="c-#B52B21 f-s-24">因物料修改涉及退库操作,不支持修改物料信息如有错误,请删除此条管理记录,重新添加。</view>
+                            <view v-if="!isAdd" class="c-#F19F18 f-s-24">因物料修改涉及退库操作,不支持修改!物料信息如有错误,请删除此条管理记录,重新添加。</view>
                             <up-radio-group v-model="form.inputFlag">
                                 <up-radio :disabled="!isAdd" :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
                             </up-radio-group>
@@ -245,7 +245,42 @@ const validateCusOp = (rule: any, value: any, callback: any) => {
     }
     callback();
 };
+// 自定义inputs校验函数
+const validateInputs = (rule: any, value: any, callback: any) => {
+    // value 应该是 inputs 数组
+    if (!value || !Array.isArray(value) || value.length === 0) {
+        callback(new Error('请至少添加一个物料并填写用量'));
+        return;
+    }
+
+    // 检查每个物料
+    for (const item of value) {
+        if (!item || typeof item !== 'object') {
+            callback(new Error('物料数据格式错误'));
+            return;
+        }
+
+        const { id, inputAmount } = item;
+
+        if (!id) {
+            callback(new Error('物料ID缺失'));
+            return;
+        }
 
+        if (inputAmount === undefined || inputAmount === null || inputAmount === '') {
+            callback(new Error('请填写物料用量'));
+            return;
+        }
+
+        const amount = Number(inputAmount);
+        if (isNaN(amount) || amount <= 0) {
+            callback(new Error('物料用量必须大于0'));
+            return;
+        }
+    }
+
+    callback();
+};
 // 表单验证规则
 const rules = reactive({
     operationDate: [{ validator: validateOperationDate, trigger: 'blur' }],
@@ -255,6 +290,7 @@ const rules = reactive({
     mgName: [{ required: true, message: '请输入记录人' }],
     inputFlag: [{ required: true, message: '请选择是否使用物料' }],
     remark: [{ required: false, message: '请输入备注' }],
+    inputs: [{ validator: validateInputs, trigger: 'blur' }],
 });
 
 const paging = ref();

+ 40 - 1
src/plant/port/supervise/supervise-material-create/index.vue

@@ -12,7 +12,7 @@
                     <!-- 使用物料 -->
                     <up-form-item borderBottom label="使用物料" required prop="inputs" id="inputsgpppp">
                         <view class="d-flex flex-cln w-100%">
-                            <view v-if="!isAdd" class="c-#B52B21 f-s-24">因物料修改涉及退库操作,不支持修改物料信息如有错误,请删除此条管理记录,重新添加。</view>
+                            <view v-if="!isAdd" class="c-#F19F18 f-s-24">因物料修改涉及退库操作,不支持修改!物料信息如有错误,请删除此条管理记录,重新添加。</view>
                             <view class="w-100%">
                                 <Materialinfo :showClose="isAdd" v-model:datas="MaterialData" v-model:inputs="form.inputs" />
                             </view>
@@ -77,11 +77,50 @@ const baseId = ref('');
 const Material = ref();
 //判断是新增还是修改
 const isAdd = ref(true);
+
+// 自定义inputs校验函数
+const validateInputs = (rule: any, value: any, callback: any) => {
+    // value 应该是 inputs 数组
+    if (!value || !Array.isArray(value) || value.length === 0) {
+        callback(new Error('请至少添加一个物料并填写用量'));
+        return;
+    }
+
+    // 检查每个物料
+    for (const item of value) {
+        if (!item || typeof item !== 'object') {
+            callback(new Error('物料数据格式错误'));
+            return;
+        }
+
+        const { id, inputAmount } = item;
+
+        if (!id) {
+            callback(new Error('物料ID缺失'));
+            return;
+        }
+
+        if (inputAmount === undefined || inputAmount === null || inputAmount === '') {
+            callback(new Error('请填写物料用量'));
+            return;
+        }
+
+        const amount = Number(inputAmount);
+        if (isNaN(amount) || amount <= 0) {
+            callback(new Error('物料用量必须大于0'));
+            return;
+        }
+    }
+
+    callback();
+};
 // 表单验证规则
 const rules = reactive({
     mgName: [{ required: true, message: '请输入记录人' }],
     remark: [{ required: false, message: '请输入备注' }],
+    inputs: [{ validator: validateInputs, trigger: 'blur' }],
 });
+
 const paging = ref();
 const list = ref();
 const upFormRef = ref<any>();

+ 1 - 1
src/plant/port/supervise/supervise-plant-create/index.vue

@@ -58,7 +58,7 @@
                     <!-- 是否使用物料 -->
                     <up-form-item borderBottom label="是否使用物料" required prop="inputFlag" id="inputFlagpppp">
                         <view class="d-flex flex-cln">
-                            <view v-if="!+isAdd" class="c-#B52B21 f-s-24">因物料修改涉及退库操作,不支持修改物料信息如有错误,请删除此条管理记录,重新添加。</view>
+                            <view v-if="!isAdd" class="c-#F19F18 f-s-24">因物料修改涉及退库操作,不支持修改!物料信息如有错误,请删除此条管理记录,重新添加。</view>
                             <up-radio-group v-model="form.inputFlag">
                                 <up-radio :disabled="!+isAdd" :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
                             </up-radio-group>

+ 37 - 1
src/plant/port/supervise/supervise-raising-create/index.vue

@@ -80,7 +80,7 @@
                     <!-- 是否使用物料 -->
                     <up-form-item borderBottom label="是否使用物料" required prop="inputFlag" id="inputFlagpppp">
                         <view class="d-flex flex-cln">
-                            <view v-if="!+isAdd" class="c-#B52B21 f-s-24">因物料修改涉及退库操作,不支持修改物料信息如有错误,请删除此条管理记录,重新添加。</view>
+                            <view v-if="!isAdd" class="c-#F19F18 f-s-24">因物料修改涉及退库操作,不支持修改!物料信息如有错误,请删除此条管理记录,重新添加。</view>
                             <up-radio-group v-model="form.inputFlag">
                                 <up-radio :disabled="!+isAdd" :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
                             </up-radio-group>
@@ -225,7 +225,42 @@ const validateCusOp = (rule: any, value: any, callback: any) => {
     }
     callback();
 };
+// 自定义inputs校验函数
+const validateInputs = (rule: any, value: any, callback: any) => {
+    // value 应该是 inputs 数组
+    if (!value || !Array.isArray(value) || value.length === 0) {
+        callback(new Error('请至少添加一个物料并填写用量'));
+        return;
+    }
+
+    // 检查每个物料
+    for (const item of value) {
+        if (!item || typeof item !== 'object') {
+            callback(new Error('物料数据格式错误'));
+            return;
+        }
+
+        const { id, inputAmount } = item;
+
+        if (!id) {
+            callback(new Error('物料ID缺失'));
+            return;
+        }
 
+        if (inputAmount === undefined || inputAmount === null || inputAmount === '') {
+            callback(new Error('请填写物料用量'));
+            return;
+        }
+
+        const amount = Number(inputAmount);
+        if (isNaN(amount) || amount <= 0) {
+            callback(new Error('物料用量必须大于0'));
+            return;
+        }
+    }
+
+    callback();
+};
 // 表单验证规则
 const rules = reactive({
     operationDate: [{ validator: validateOperationDate, trigger: 'blur' }],
@@ -236,6 +271,7 @@ const rules = reactive({
     inputFlag: [{ required: true, message: '请选择是否使用物料' }],
     remark: [{ required: false, message: '请输入备注' }],
     targetType: [{ required: true, message: '请选择作用对象类型' }],
+    inputs: [{ validator: validateInputs, trigger: 'blur' }],
 });
 
 const paging = ref();

+ 0 - 0
src/static/images/plant/port/已结束.png → src/static/images/plant/port/over.png


+ 225 - 7
src/tools/species-info/index.vue

@@ -1,37 +1,136 @@
 <template>
     <z-paging ref="paging" v-model="list" paging-class="paging-btm-shadow" bgColor="#f7f7f7" safe-area-inset-bottom @query="query">
         <template #top>
-            <ut-navbar title="请选择任务所使用的种源信息" :fixed="false"></ut-navbar>
+            <ut-navbar leftText="请选择任务所使用的种源信息" :fixed="false"></ut-navbar>
         </template>
         <view class="d-flex a-c pd-24 pb-0 bg-#f7f7f7">
             <view class="min-w-170 flex1">
-                <ut-action-sheet v-model="form.taskType" :tabs="[{ label: '全部', value: '' }, ...pt_seed_instore_type]" @change="changeSeach" title="选择原料类型">
+                <ut-action-sheet v-model="form.instoreType" :tabs="[{ label: '全部', value: '' }, ...pt_seed_instore_type]" @change="changeSeach" 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(pt_seed_instore_type, form.taskType) || '全部' }}</view>
+                        <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ selectDictLabel(pt_seed_instore_type, form.instoreType) || '全部' }}</view>
                         <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
                     </view>
                 </ut-action-sheet>
             </view>
             <view class="h-86 pl-20 w-100%">
-                <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" @change="changeSeach" margin="0" :border="false" placeholder="搜批次号、品种名、基地名" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
             </view>
         </view>
         <template v-for="(item, index) in list" :key="index">
-            <info-card />
+            <info-card :item="item" :selected="selectedItems.has(item.id)" @click="toggleSelection(item)" />
+        </template>
+        <template #bottom>
+            <view class="pd-20 d-flex">
+                <up-button type="primary" @click="open">确认选择</up-button>
+            </view>
         </template>
     </z-paging>
+    <up-popup v-if="show" :show="show" :round="10" mode="bottom" @close="close" @open="open" closeable>
+        <scroll-view style="height: 80vh" scroll-y>
+            <view class="d-flex a-c pd-24">
+                <view class="f-s-34 f-w-5 c-#333">关联种源信息</view>
+                <view class="bg-#37A954 radius-10 pd4-10-20-10-20 d-flex a-c" style="width: max-content">
+                    <up-icon name="plus" color="#fff" size="24rpx"></up-icon>
+                    <view class="c-#fff f-s-22">添加种源关联信息</view>
+                </view>
+            </view>
+            <view class="pd-24">
+                <up-form class="p-rtv" labelPosition="top" :model="formDate" :rules="rules" labelWidth="auto" ref="upFormRef">
+                    <up-form-item :borderBottom="false" required label="种源投入时间" prop="useDate" id="useDatepppp">
+                        <ut-datetime-picker v-model="formDate.useDate" mode="date" dateFields="day" style="width: 100%">
+                            <view class="d-flex">
+                                <up-input v-model="formDate.useDate" placeholder="默认种养殖开始时间但可修改" border="bottom"></up-input>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
+                            </view>
+                        </ut-datetime-picker>
+                    </up-form-item>
+                    <up-form-item :borderBottom="false" prop="inputs" id="inputspppp">
+                        <view class="d-flex flex-cln" style="width: 100%">
+                            <template v-for="(item, index) in Array.from(selectedItems.values())" :key="index">
+                                <souceinfo showClose :data="item" :index="index" v-model:inputs="formDate.inputs[index]" @close="handleSourceClose" />
+                            </template>
+                        </view>
+                    </up-form-item>
+                    <up-form-item :borderBottom="false" label="备注/说明" prop="remark">
+                        <up-textarea v-model="formDate.remark" placeholder="请输入备注/说明" border="bottom"></up-textarea>
+                    </up-form-item>
+                </up-form>
+            </view>
+            <view class="pd-20 d-flex">
+                <up-button type="primary" @click="saveSeedInfo">确认添加</up-button>
+            </view>
+        </scroll-view>
+    </up-popup>
 </template>
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
 import InfoCard from './models/info-card.vue';
+import Souceinfo from './models/souceinfo.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pt_seed_instore_type } = toRefs<any>(proxy?.useDict('pt_seed_instore_type'));
-const list = ref([]);
+interface SeedItem {
+    id: number | string;
+    [key: string]: any;
+}
+
+const list = ref<SeedItem[]>([]);
 const paging = ref();
 const form = ref({
     keyword: '',
-    taskType: '',
+    instoreType: '',
 });
+//表单
+const formDate = ref({
+    useDate: '',
+    inputs: [] as any,
+    remark: '',
+});
+
+// 自定义inputs校验函数
+const validateInputs = (rule: any, value: any, callback: any) => {
+    // value 应该是 inputs 数组
+    if (!value || !Array.isArray(value) || value.length === 0) {
+        callback(new Error('请至少添加一个种源并填写用量'));
+        return;
+    }
+
+    // 检查每个物料
+    for (const item of value) {
+        if (!item || typeof item !== 'object') {
+            callback(new Error('种源数据格式错误'));
+            return;
+        }
+
+        const { seedId, amount } = item;
+        console.log(item, 'item');
+
+        if (!seedId) {
+            callback(new Error('种源ID缺失'));
+            return;
+        }
+
+        if (amount === undefined || amount === null || amount === '') {
+            callback(new Error('请填写种源用量'));
+            return;
+        }
+
+        const amounts = Number(amount);
+        if (isNaN(amounts) || amounts <= 0) {
+            callback(new Error('种源用量必须大于0'));
+            return;
+        }
+    }
+
+    callback();
+};
+// 表单验证规则
+const rules = ref({
+    useDate: [{ required: true, message: '请选择种源投入时间' }],
+    inputs: [{ validator: validateInputs, trigger: 'blur' }],
+    remark: [{ required: false, message: '请填写备注/说明' }],
+});
+
+const selectedItems = ref(new Map<string | number, SeedItem>());
 const query = async (pageNo: number, pageSize: number) => {
     const params = {
         pageNo,
@@ -45,6 +144,125 @@ const query = async (pageNo: number, pageSize: number) => {
 const changeSeach = () => {
     paging.value.reload();
 };
+
+const toggleSelection = (item: SeedItem) => {
+    const newMap = new Map(selectedItems.value);
+
+    if (newMap.has(item.id)) {
+        // 取消选择
+        newMap.delete(item.id);
+        formDate.value.inputs = formDate.value.inputs.filter((inputItem: any) => inputItem.seedId !== item.id);
+    } else {
+        // 防止重复添加
+        if (!formDate.value.inputs.some((inputItem: any) => inputItem.seedId === item.id)) {
+            formDate.value.inputs.push({
+                taskId: taskId.value,
+                seedId: item.id,
+                amount: '',
+            });
+        }
+        newMap.set(item.id, item);
+    }
+
+    selectedItems.value = newMap;
+    console.log('当前选中的种子:', Array.from(newMap.keys()));
+    console.log('表单数据:', formDate.value.inputs);
+};
+
+// 创建响应式数据
+const show = ref(false);
+// 定义方法
+const open = () => {
+    // 打开逻辑,比如设置 show 为 true
+    show.value = true;
+    // 获取所有选中的完整对象
+    const selectedArray = Array.from(selectedItems.value.values());
+    console.log('选中的完整项目:', selectedArray);
+    // 这里可以使用 selectedArray 进行后续处理
+};
+
+const close = () => {
+    // 关闭逻辑,设置 show 为 false
+    show.value = false;
+    // console.log('close');
+};
+
+// 处理种源信息关闭事件
+const handleSourceClose = (index: number) => {
+    // 根据索引找到对应的项目
+    const selectedArray = Array.from(selectedItems.value.values());
+    if (index >= 0 && index < selectedArray.length) {
+        const item = selectedArray[index];
+        console.log(item, 'item');
+
+        const newMap = new Map(selectedItems.value);
+
+        // 从 selectedItems 中删除对应的项目
+        newMap.delete(item.id);
+        selectedItems.value = newMap;
+
+        // 从 formDate.inputs 中删除对应的数据
+        // 注意:由于删除后数组索引会变化,我们需要根据 seedId 来过滤
+        formDate.value.inputs = formDate.value.inputs.filter((input: any) => input.seedId !== item.id);
+    }
+};
+const upFormRef = ref();
+//校验表单然后提交
+const saveSeedInfo = async () => {
+    uni.$u.debounce(
+        async () => {
+            try {
+                console.log('开始校验');
+                console.log(formDate.value, 'formDate.value');
+                await upFormRef.value?.validate();
+                console.log('校验完成');
+
+                formDate.value.inputs.forEach((item: any) => {
+                    // 正确赋值方式
+                    item.taskId = taskId.value;
+                    item.remark = formDate.value.remark;
+                    item.useDate = formDate.value.useDate;
+                });
+                console.log(formDate.value.inputs);
+
+                const params = [...formDate.value.inputs];
+
+                console.log('提交参数:', params);
+
+                // 这里需要根据实际 API 进行调整
+                const res = await useClientRequest.post('/plt-api/app/seedInfo/saveSeedInfoBatch', params);
+                if (res.code == 200) {
+                    uni.showToast({
+                        title: '提交成功',
+                        icon: 'success',
+                        duration: 2000,
+                    });
+                    setTimeout(() => {
+                        //发送emit
+                        uni.$emit('updatesuperviselist');
+                        uni.navigateBack({
+                            delta: 1,
+                        });
+                    }, 1000);
+                }
+            } catch (error: any) {
+                console.log('表单验证错误:', error);
+                // 滚动到第一个错误字段
+                if (error && error[0]?.field) {
+                    const firstErrorField = error[0].field + 'pppp';
+                    paging.value?.scrollIntoViewById(firstErrorField, 30, true);
+                }
+                return;
+            }
+        },
+        1000,
+        true,
+    );
+};
+const taskId = ref('');
+onLoad((options: any) => {
+    taskId.value = options?.taskId;
+});
 </script>
 <style lang="scss" scoped>
 .search-select-item {

+ 90 - 34
src/tools/species-info/models/info-card.vue

@@ -1,51 +1,107 @@
 <template>
-    <view class="pd-24 pb-10">
-        <view class="b-radius bg-#fff pd-10 p-rtv">
-            <image class="w-80 h-34" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/port/Task_Planting.png" mode="widthFix" style="position: absolute; top: 0; left: 0" />
-            <view class="d-flex j-ed f-s-22 c-#666">2026-02-04 </view>
-            <view class="d-flex j-sb">
-                <view class="d-flex a-ed pd-16 pt-8 pb-8">
-                    <view class="c-#333 f-s-34 f-w-5 mr-6">{{ data?.seedName }}</view>
-                    <view class="c-#666 f-s-26">种苗</view>
+    <view class="pd-24 pb-10 select-item" @click="$emit('click')">
+        <view class="b-radius bg-#fff pd-20 p-rtv noactive" :class="{ active: selected }">
+            <view class="d-flex j-sb a-c li-item-head mb-16">
+                <view class="li-left-tag" :class="{ [`bg-${selectDictListClass(pt_seed_instore_type, item?.instoreType)}`]: true }">{{ selectDictLabel(pt_seed_instore_type, item?.instoreType) }}</view>
+                <view class="f-s-22 c-#666 pt-10">{{ item?.updateTime || item?.createTime }}</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?.variety }}</span>
+                    <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, item?.seedType) }}</span>
                 </view>
-                <view class="">
-                    <view v-if="true" class="c-primary bg-#EBF6EE radius-34 pd4-4-12-4-12 f-s-24">已检验</view>
-                    <view v-else class="c-#F74C30 bg-#F9ECEA radius-34 pd4-4-12-4-12 f-s-24">未检验</view>
+                <view>
+                    <view v-if="item?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检验</view>
+                    <view v-else class="tag-span c-danger bg-#F9ECEA">未检验</view>
                 </view>
             </view>
-            <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
-                <view class="c-#666 w-s-no">入库批号:</view>
-                <view class="c-#333 f-w-5">12312312312312312312</view>
+            <view class="pd2-4-0 f-s-28">
+                <span class="c-#666 w-s-no">入库批号:</span>
+                <span class="c-#333 f-w-500">{{ item?.batchCode }}</span>
             </view>
-            <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
-                <view class="c-#666 w-s-no">采收批号:</view>
-                <view class="c-#333 f-w-5">12312312312312312312</view>
+            <!-- <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">溯源批号:</span>
+                            <span class="c-#333 f-w-500">暂无</span>
+                        </view> -->
+            <view v-if="['A3', 'A4'].includes(item?.fungusCodeType)" class="pd2-4-0 f-s-28">
+                <span class="c-#666 w-s-no">菌种/菌株编号:</span>
+                <span class="c-#333 f-w-500">{{ selectDictLabel(pt_fungus_code_type, item?.fungusCodeType) }}/{{ item?.fungusCode }}</span>
             </view>
-            <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
-                <view class="c-#666 w-s-no">供应商:</view>
-                <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">阿萨德看见阿萨德那些支持你</view>
+            <view class="pd2-4-0 f-s-28">
+                <span class="c-#666 w-s-no">供应商:</span>
+                <span class="c-#333 f-w-500">{{ item?.supplierInfo?.cusName || '-' }}</span>
             </view>
-            <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
-                <view class="c-#666 w-s-no">存放库房:</view>
-                <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">ask滴哦i i哦啪啪</view>
+            <view class="pd2-4-0 f-s-28">
+                <span class="c-#666 w-s-no">存放库房:</span>
+                <span class="c-#333 f-w-500"></span>
             </view>
-            <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
-                <view class="c-#666 w-s-no">入库量:</view>
-                <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">阿萨德看见阿萨德那些支持你</view>
+            <view class="pd2-4-0 f-s-28">
+                <span class="c-#666 w-s-no">入库量:</span>
+                <span class="c-#333 f-w-500">{{ item?.capacity }}{{ item?.unit }}</span>
             </view>
-            <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
-                <view class="d-flex a-c w-50%">
-                    <view class="c-#666 w-s-no">出库量:</view>
-                    <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">阿萨德看见阿萨德那些支持你</view>
+            <view class="d-flex">
+                <view v-if="item?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                    <span class="c-#666">出库量:</span>
+                    <span class="c-#333 f-w-500">{{ item?.inputAmount || '0' }}{{ item?.unit }}</span>
                 </view>
-                <view class="d-flex a-c w-50%">
-                    <view class="c-#666 w-s-no">剩余量:</view>
-                    <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">ask滴哦i i哦啪啪</view>
+                <view v-if="item?.restAmount" class="pd2-4-0 f-s-28 flex1">
+                    <span class="c-primary">剩余量:</span>
+                    <span class="c-primary f-w-500">{{ item?.restAmount || '0' }}{{ item?.unit }}</span>
                 </view>
             </view>
+            <!-- 选中图标 -->
+            <image v-if="selected" class="w-40 h-40 checked-icon" src="/static/images/common/btn_checked_icon.png" mode="widthFix" />
         </view>
     </view>
 </template>
 <script setup lang="ts">
-const props = defineProps<{ data: any }>();
+import { selectDictListClass } from '@/utils/ruoyi';
+const props = defineProps<{
+    item: any;
+    selected?: boolean;
+}>();
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_seed_instore_type, pt_seed_type, pt_fungus_code_type } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_seed_type', 'pt_fungus_code_type'));
 </script>
+<style lang="scss">
+.search-select-item {
+    height: 86rpx;
+    background-color: #fff;
+    border-radius: 10rpx;
+    box-sizing: border-box;
+    padding: 12rpx;
+}
+.tag-span {
+    padding: 4rpx 12rpx;
+    font-size: 20rpx;
+    border-radius: 18rpx;
+}
+.li-item-head {
+    margin-left: -24rpx;
+    margin-top: -24rpx;
+}
+.li-left-tag {
+    padding: 6rpx 16rpx;
+    color: #fff;
+    border-radius: 16rpx 0 16rpx 0;
+    font-size: 20rpx;
+    font-weight: 500;
+}
+
+.select-item {
+    .noactive {
+        border: 1rpx solid transparent;
+    }
+    .active {
+        background-color: #ebf6ee;
+        position: relative;
+        border: 1rpx solid #37a954;
+    }
+
+    .checked-icon {
+        position: absolute;
+        right: 0rpx;
+        bottom: 0rpx;
+    }
+}
+</style>

+ 94 - 0
src/tools/species-info/models/souceinfo.vue

@@ -0,0 +1,94 @@
+<template>
+    <view class="bg-#FBFDFB border-#AFDDBB pd-24 b-radius mb-10">
+        <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(index)"> × </view>
+        <view class="d-flex a-c pb-10">
+            <view class="c-primary pd-4 bg-#E7F4EA radius-10" style="font-style: italic">{{ index + 1 < 10 ? '0' + (index + 1) : index + 1 }}</view>
+            <view class="c-#333 f-s-34 f-w-5 ml-10 mr-10">{{ data?.variety }}</view>
+            <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, data?.seedType) }}</span>
+        </view>
+        <view class="pt-6 pb-6 d-flex a-c">
+            <view class="c-#666 f-s-28"> 入库批次号:</view>
+            <view class="c-#333 f-s-28 f-w-5">{{ data?.batchCode }}</view>
+        </view>
+        <view class="pt-6 pb-6 d-flex a-c">
+            <view class="c-#666 f-s-28"> 供应商:</view>
+            <view class="c-#333 f-s-28 f-w-5">{{ data?.supplier }}</view>
+        </view>
+        <view class="pt-6 pb-6 d-flex a-c">
+            <view class="c-#666 f-s-28 w-s-no"> 所在库房:</view>
+            <view class="c-#333 f-s-28 f-w-5">{{ data?.warehouses }}</view>
+        </view>
+        <view class="pt-6 pb-6 d-flex mb-12" v-if="showClose">
+            <view class="w-50% d-flex a-c">
+                <view class="c-#666 f-s-28"> 入库量:</view>
+                <view class="c-#333 f-s-28 f-w-5">{{ data?.capacity }}{{ data?.unit }}</view>
+            </view>
+            <view class="w-50% d-flex a-c">
+                <view class="c-#666 f-s-28"> 剩余量:</view>
+                <view class="c-primary f-s-28 f-w-5">{{ data?.restAmount }}{{ data?.unit }}</view>
+            </view>
+        </view>
+        <up-line color="#AFDDBB" style="margin-left: -24rpx; margin-right: -24rpx; width: auto"></up-line>
+        <view class="f-s-28 c-#666 pt-16">本次使用量:</view>
+        <view class="pt-6 pb-6 d-flex a-c">
+            <view class="flex1 mr-10">
+                <up-input v-model="inputsModel.amount" placeholder="请输入本次使用量" border="bottom" style="padding-left: 0" type="number">
+                    <template #suffix>
+                        <view class="c-#333 f-s-28 f-w-5">{{ data?.unit }}</view>
+                    </template>
+                </up-input>
+            </view>
+            <view class="">
+                <up-checkbox label="全部使用" usedAlone v-model:checked="hasChecked" @change="handleUseAllChange"></up-checkbox>
+            </view>
+        </view>
+    </view>
+</template>
+<script setup lang="ts">
+import { ref, watch, computed, nextTick } from 'vue';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_seed_instore_type, pt_seed_type, pt_fungus_code_type } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_seed_type', 'pt_fungus_code_type'));
+// 从外部获取数据
+const props = defineProps<{
+    showClose?: boolean;
+    index: number;
+    data: any;
+}>();
+
+const emit = defineEmits<{
+    close: [index: number];
+}>();
+
+const inputsModel = defineModel<any>('inputs', { default: () => {} });
+
+// 处理关闭事件
+const handleClose = (index: number) => {
+    emit('close', index);
+};
+// 建立一个计算属性 如果props.data.restAmount 等于或者大于inputsModel.amount 那么就为true
+const hasChecked = computed(() => {
+    return +inputsModel?.value.amount >= +props.data.restAmount;
+});
+const handleUseAllChange = () => {
+    console.log('点击');
+
+    if (!hasChecked.value) {
+        inputsModel.value.amount = props.data.restAmount;
+    }
+};
+watch(
+    () => inputsModel.value?.amount,
+    (val) => {
+        if (val === undefined || val === null) return;
+
+        const numVal = Number(val);
+        if (!isNaN(numVal) && numVal > props.data.restAmount) {
+            // 使用 nextTick 确保 UI 更新
+            nextTick(() => {
+                inputsModel.value.amount = props.data.restAmount;
+            });
+        }
+    },
+    { flush: 'post' },
+);
+</script>

+ 10 - 0
vite.config.ts

@@ -52,6 +52,16 @@ export default async () => {
             },
             // 启动端口
             port: 9090,
+            // HMR 配置
+            hmr: {
+                overlay: true, // 显示错误覆盖层
+                clientPort: 9090, // 客户端端口
+            },
+            watch: {
+                // 增加文件监视限制
+                usePolling: false,
+                interval: 100,
+            },
         },
     });
 };