Pārlūkot izejas kodu

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

huangxw 1 mēnesi atpakaļ
vecāks
revīzija
514f15e1e8

+ 1 - 1
src/plant/port/supervise/models/individualinfo.vue

@@ -1,6 +1,6 @@
 <template>
     <view class="d-flex j-sb b-radius border-#AFDDBB bg-#FBFDFB mb-20 pd-24 p-rtv" v-for="(item, index) in modelValue?.checkBox" :key="index">
-        <view v-if="showClose" @click="handleDelete(index)" class="d-flex j-c a-c c-#FF4444 f-s-28" style="position: absolute; top: 0; right: 10rpx"> x </view>
+        <view v-if="showClose" @click="handleDelete(index)" class="d-flex j-c a-c c-#FF4444 f-s-28" style="position: absolute; top: 0; right: 10rpx">X</view>
         <view class="flex1 ov-hd">
             <view class="ov-hd tx-ov d-flex a-c">
                 <view class="c-primary f-s-24 f-w-5 bg-#EBF6EE pd4-4-12-4-6 b-radius" style="font-style: italic">{{ Number(index) + 1 < 10 ? '0' + (Number(index) + 1) : Number(index) + 1 }}</view>

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

@@ -361,9 +361,6 @@ const change = () => {
         true,
     );
 };
-setTimeout(() => {
-    paging.value?.scrollIntoViewById('selectanimalId', 30, true);
-}, 2000);
 //去操作地块页面选择地块
 const goSelectBase = (landType: string) => {
     uni.$once('updatelands', function (data) {
@@ -375,10 +372,23 @@ const goSelectBase = (landType: string) => {
 //去选择个体
 const goIndividual = () => {
     uni.$once('updateIndividual', function (data) {
+        let flag = false;
         data?.checkBox.forEach((item: any) => {
-            individualLandIds.value.checkBox.push(item);
-            form.value.animalIds.push(item);
+            //判断有没有重复的值,如果有这个就不添加,没有就添加
+            if (individualLandIds.value.checkBox.some((item2: any) => item2 === item)) {
+                console.log('????', item);
+                flag = true;
+            } else {
+                individualLandIds.value.checkBox.push(item);
+                form.value.animalIds.push(item);
+            }
         });
+        if (flag) {
+            uni.showToast({
+                title: '有重复的个体,已经帮您过滤的',
+                icon: 'none',
+            });
+        }
         paging.value?.scrollIntoViewById('selectanimalId', 30, true);
     });
     uni.$u.route({ type: 'navigateTo', url: '/tools/supervise-individual/index', params: { baseId: baseId.value, landType, taskId: form.value.taskId } });