|
|
@@ -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 } });
|