|
|
@@ -11,7 +11,6 @@
|
|
|
|
|
|
|
|
|
<view class="top-wrapper">
|
|
|
-
|
|
|
<view class="searchBox rx-bc">
|
|
|
<input v-model="keyWord" placeholder="请输入关键字搜索" class="searchInput" />
|
|
|
|
|
|
@@ -61,15 +60,15 @@
|
|
|
</checkbox-group>
|
|
|
|
|
|
|
|
|
-
|
|
|
- <view v-if='list.length == 0' style='margin-top: 20vh;'>
|
|
|
+
|
|
|
+ <view v-if='list.length == 0' style='margin-top: 20vh;' >
|
|
|
<u-empty iconSize='150' textSize='32' text='暂无数据'>
|
|
|
</u-empty>
|
|
|
</view>
|
|
|
|
|
|
</u-list>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</view>
|
|
|
|
|
|
@@ -115,10 +114,11 @@
|
|
|
classificationList: [],
|
|
|
treePickerShow: false,
|
|
|
list: [],
|
|
|
+
|
|
|
|
|
|
seletedAll: false, //全选状态
|
|
|
memoList: [],
|
|
|
-
|
|
|
+
|
|
|
isType: null,
|
|
|
|
|
|
pid: null, // 上个页面id
|
|
|
@@ -193,115 +193,107 @@
|
|
|
},
|
|
|
|
|
|
getTreeList() {
|
|
|
- let params = {
|
|
|
+ let params = {
|
|
|
ids: [1, 5, 7, 8, 10, 14]
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
treeByPid(params).then(res => {
|
|
|
this.classificationList = res
|
|
|
- console.log(res)
|
|
|
this.confirm([res[0].id], res[0].name)
|
|
|
})
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- confirm(id, name) {
|
|
|
- this.categoryLevelId = id
|
|
|
- this.getList()
|
|
|
- },
|
|
|
+ confirm(id, name) {
|
|
|
+ this.categoryLevelId = id
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
|
|
|
- getList() {
|
|
|
- let param = {
|
|
|
- categoryLevelId: this.categoryLevelId,
|
|
|
- keyWord: this.keyWord,
|
|
|
- pageNum: 1,
|
|
|
- size: -1,
|
|
|
- dimension: 1
|
|
|
- }
|
|
|
- this.list = []
|
|
|
- if(this.isType == 'pick') {
|
|
|
-
|
|
|
- pageeLedgerMain(param).then(res => {
|
|
|
- this.list.push(
|
|
|
- ...res.list.map(i => {
|
|
|
- const checked =
|
|
|
- this.memoList.findIndex(itm => itm.id === i.id) > -1
|
|
|
-
|
|
|
- const warehouseId = i.pathIds && i.pathIds.split(',')[0]
|
|
|
-
|
|
|
- return {
|
|
|
- checked,
|
|
|
- warehouseId,
|
|
|
- ...i,
|
|
|
- instanceId: i.id,
|
|
|
- categoryId: i.assetId,
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- )
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ getList() {
|
|
|
+ let param = {
|
|
|
+ categoryLevelId: this.categoryLevelId,
|
|
|
+ keyWord: this.keyWord,
|
|
|
+ pageNum: 1,
|
|
|
+ size: -1,
|
|
|
+ dimension: 1
|
|
|
+ }
|
|
|
+ this.list = []
|
|
|
+ if(this.isType == 'pick') {
|
|
|
+
|
|
|
+ pageeLedgerMain(param).then(res => {
|
|
|
+ this.list.push(
|
|
|
+ ...res.list.map(i => {
|
|
|
+ const checked =
|
|
|
+ this.memoList.findIndex(itm => itm.id === i.id) > -1
|
|
|
+
|
|
|
+ const warehouseId = i.pathIds && i.pathIds.split(',')[0]
|
|
|
+
|
|
|
+ return {
|
|
|
+ checked,
|
|
|
+ warehouseId,
|
|
|
+ ...i,
|
|
|
+ instanceId: i.id,
|
|
|
+ categoryId: i.assetId,
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ )
|
|
|
+ })
|
|
|
+
|
|
|
+ } else if(this.isType == 'feed') {
|
|
|
+
|
|
|
+ assetPage(param).then(res => {
|
|
|
+ this.list.push(
|
|
|
+ ...res.list.map(i => {
|
|
|
+ const checked =
|
|
|
+ this.memoList.findIndex(itm => itm.id === i.id) > -1
|
|
|
+
|
|
|
+ const warehouseId = i.pathIds && i.pathIds.split(',')[0]
|
|
|
+
|
|
|
+ return {
|
|
|
+ checked,
|
|
|
+ warehouseId,
|
|
|
+ ...i,
|
|
|
+ instanceId: i.id,
|
|
|
+ categoryId: i.assetId,
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ )
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- if(this.isType == 'feed') {
|
|
|
-
|
|
|
- assetPage(param).then(res => {
|
|
|
- this.list.push(
|
|
|
- ...res.list.map(i => {
|
|
|
- const checked =
|
|
|
- this.memoList.findIndex(itm => itm.id === i.id) > -1
|
|
|
-
|
|
|
- const warehouseId = i.pathIds && i.pathIds.split(',')[0]
|
|
|
-
|
|
|
- return {
|
|
|
- checked,
|
|
|
- warehouseId,
|
|
|
- ...i,
|
|
|
- instanceId: i.id,
|
|
|
- categoryId: i.assetId,
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- )
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- //勾选
|
|
|
- selectVal(e, val, index) {
|
|
|
- this.list[index].checked = !this.list[index].checked
|
|
|
+ //勾选
|
|
|
+ selectVal(e, val, index) {
|
|
|
+ this.list[index].checked = !this.list[index].checked
|
|
|
|
|
|
- this.seletedAll = !this.list.some(item => !item.checked)
|
|
|
+ this.seletedAll = !this.list.some(item => !item.checked)
|
|
|
|
|
|
- const idx = this.memoList.findIndex(
|
|
|
- item => item.id === this.list[index].id
|
|
|
- )
|
|
|
+ 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)
|
|
|
+ if (this.list[index].checked) {
|
|
|
+ if (idx === -1) {
|
|
|
+ this.memoList.push(this.list[index])
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (idx > -1) {
|
|
|
+ this.memoList.splice(idx, 1)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
- },
|
|
|
-
|
|
|
- //跳转回添加页面
|
|
|
- jumpAdd() {
|
|
|
- uni.$emit('setSelectList', this.memoList, this.pid)
|
|
|
- uni.navigateBack()
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
+ //跳转回添加页面
|
|
|
+ jumpAdd() {
|
|
|
+ uni.$emit('setSelectList', this.memoList, this.pid)
|
|
|
+ uni.navigateBack()
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|