|
@@ -15,7 +15,7 @@
|
|
|
<input v-model="keyWord" placeholder="请输入关键字搜索" class="searchInput" />
|
|
<input v-model="keyWord" placeholder="请输入关键字搜索" class="searchInput" />
|
|
|
|
|
|
|
|
<view>
|
|
<view>
|
|
|
- <u-button @click="getList" type="success" class="u-reset-button" text="搜索">
|
|
|
|
|
|
|
+ <u-button @click="getList" type="success" size="small" class="u-reset-button" text="搜索">
|
|
|
</u-button>
|
|
</u-button>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -105,13 +105,15 @@
|
|
|
list: [],
|
|
list: [],
|
|
|
|
|
|
|
|
seletedAll: false, //全选状态
|
|
seletedAll: false, //全选状态
|
|
|
- checkListLen: 0,
|
|
|
|
|
|
|
+ memoList: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
//选择的列表长度
|
|
//选择的列表长度
|
|
|
computed: {
|
|
computed: {
|
|
|
-
|
|
|
|
|
|
|
+ checkListLen() {
|
|
|
|
|
+ return this.memoList.length
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -123,7 +125,32 @@
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
_seletedAll() {
|
|
_seletedAll() {
|
|
|
- this.seletedAll = !this.seletedAll
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (!this.seletedAll) {
|
|
|
|
|
+ this.seletedAll = true
|
|
|
|
|
+
|
|
|
|
|
+ this.list.map(item => {
|
|
|
|
|
+ this.$set(item, 'checked', true)
|
|
|
|
|
+ const idx = this.memoList.findIndex(itm => itm.id === item.id)
|
|
|
|
|
+ if (idx === -1) {
|
|
|
|
|
+ this.memoList.push(item)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.seletedAll = false
|
|
|
|
|
+ this.list.map(item => {
|
|
|
|
|
+ this.$set(item, 'checked', false)
|
|
|
|
|
+
|
|
|
|
|
+ const idx = this.memoList.findIndex(itm => itm.id === item.id)
|
|
|
|
|
+ if (idx > -1) {
|
|
|
|
|
+ this.memoList.splice(idx, 1)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
openTreePicker() {
|
|
openTreePicker() {
|
|
@@ -161,16 +188,40 @@
|
|
|
pageeLedgerMain(param).then(res => {
|
|
pageeLedgerMain(param).then(res => {
|
|
|
this.list.push(
|
|
this.list.push(
|
|
|
...res.list.map(i => {
|
|
...res.list.map(i => {
|
|
|
|
|
+ const checked =
|
|
|
|
|
+ this.memoList.findIndex(itm => itm.id === i.id) > -1
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
- checked: false,
|
|
|
|
|
|
|
+ checked,
|
|
|
...i
|
|
...i
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //勾选
|
|
|
|
|
+ selectVal(e, val, index) {
|
|
|
|
|
+ this.list[index].checked = !this.list[index].checked
|
|
|
|
|
+
|
|
|
|
|
+ this.seletedAll = !this.list.some(item => !item.checked)
|
|
|
|
|
+
|
|
|
|
|
+ const idx = this.memoList.findIndex(
|
|
|
|
|
+ item => item.id === this.list[index].id
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ if (this.list[index].checked) {
|
|
|
|
|
+ if (idx === -1) {
|
|
|
|
|
+ this.memoList.push(this.list[index])
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (idx > -1) {
|
|
|
|
|
+ this.memoList.splice(idx, 1)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -186,11 +237,11 @@
|
|
|
|
|
|
|
|
.searchBox {
|
|
.searchBox {
|
|
|
background-color: #dedede;
|
|
background-color: #dedede;
|
|
|
- height: 100rpx;
|
|
|
|
|
|
|
+ height: 90rpx;
|
|
|
padding: 0 20rpx;
|
|
padding: 0 20rpx;
|
|
|
|
|
|
|
|
input {
|
|
input {
|
|
|
- height: 80rpx;
|
|
|
|
|
|
|
+ height: 70rpx;
|
|
|
width: 540rpx;
|
|
width: 540rpx;
|
|
|
background: #f9f9f9 !important;
|
|
background: #f9f9f9 !important;
|
|
|
padding-left: 10rpx;
|
|
padding-left: 10rpx;
|
|
@@ -252,7 +303,7 @@
|
|
|
|
|
|
|
|
.items {
|
|
.items {
|
|
|
width: 50%;
|
|
width: 50%;
|
|
|
- margin-top: 6rpx;
|
|
|
|
|
|
|
+ margin-top: 6rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|