|
@@ -45,12 +45,11 @@
|
|
|
class="items">
|
|
class="items">
|
|
|
{{ itm.label }}:{{ item[itm.prop] }}
|
|
{{ itm.label }}:{{ item[itm.prop] }}
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
- <view
|
|
|
|
|
- class="items">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <view class="items">
|
|
|
可用库存:{{ item.number }} {{item.unit}}
|
|
可用库存:{{ item.number }} {{item.unit}}
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -61,11 +60,14 @@
|
|
|
</checkbox-group>
|
|
</checkbox-group>
|
|
|
|
|
|
|
|
|
|
|
|
|
- <u-empty v-if='list.length == 0' style='margin-top: 20vh;' iconSize='150' textSize='32' text='暂无数据'>
|
|
|
|
|
- </u-empty>
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <u-empty v-if='list.length == 0' style='margin-top: 20vh;' iconSize='150' textSize='32' text='暂无数据'>
|
|
|
|
|
+ </u-empty>
|
|
|
|
|
|
|
|
</u-list>
|
|
</u-list>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -76,8 +78,8 @@
|
|
|
</checkbox>
|
|
</checkbox>
|
|
|
</view>
|
|
</view>
|
|
|
<view>
|
|
<view>
|
|
|
- <u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen" @click="jumpAdd">
|
|
|
|
|
- <view > 选择( {{ checkListLen }} ) </view>
|
|
|
|
|
|
|
+ <u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen" @click="jumpAdd">
|
|
|
|
|
+ <view> 选择( {{ checkListLen }} ) </view>
|
|
|
</u-button>
|
|
</u-button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -112,7 +114,7 @@
|
|
|
|
|
|
|
|
seletedAll: false, //全选状态
|
|
seletedAll: false, //全选状态
|
|
|
memoList: [],
|
|
memoList: [],
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
pid: null, // 上个页面id
|
|
pid: null, // 上个页面id
|
|
|
storageKey: null
|
|
storageKey: null
|
|
|
}
|
|
}
|
|
@@ -127,20 +129,20 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
- this.pid = option.id
|
|
|
|
|
- if(option.storageKey) {
|
|
|
|
|
|
|
+ this.pid = option.id
|
|
|
|
|
+ if (option.storageKey) {
|
|
|
this.storageKey = option.storageKey
|
|
this.storageKey = option.storageKey
|
|
|
- this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey )) || []
|
|
|
|
|
|
|
+ this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.getTreeList()
|
|
this.getTreeList()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
onUnload() {
|
|
onUnload() {
|
|
|
- if(this.storageKey) {
|
|
|
|
|
- uni.removeStorage(this.storageKey)
|
|
|
|
|
|
|
+ if (this.storageKey) {
|
|
|
|
|
+ uni.removeStorage(this.storageKey)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
@@ -185,7 +187,7 @@
|
|
|
|
|
|
|
|
getTreeList() {
|
|
getTreeList() {
|
|
|
let params = {
|
|
let params = {
|
|
|
- ids: [1, 5, 7, 8, 10, 14, ]
|
|
|
|
|
|
|
+ ids: [1, 5, 7, 8, 10, 14, 4]
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
treeByPid(params).then(res => {
|
|
treeByPid(params).then(res => {
|
|
@@ -211,10 +213,10 @@
|
|
|
this.list.push(
|
|
this.list.push(
|
|
|
...res.list.map(i => {
|
|
...res.list.map(i => {
|
|
|
const checked =
|
|
const checked =
|
|
|
- this.memoList.findIndex(itm => itm.id === i.id) > -1
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.memoList.findIndex(itm => itm.id === i.id) > -1
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
- checked,
|
|
|
|
|
|
|
+ checked,
|
|
|
...i
|
|
...i
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -227,28 +229,28 @@
|
|
|
this.list[index].checked = !this.list[index].checked
|
|
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(
|
|
const idx = this.memoList.findIndex(
|
|
|
- item => item.id === this.list[index].id
|
|
|
|
|
|
|
+ item => item.id === this.list[index].id
|
|
|
)
|
|
)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (this.list[index].checked) {
|
|
if (this.list[index].checked) {
|
|
|
- if (idx === -1) {
|
|
|
|
|
- this.memoList.push(this.list[index])
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (idx === -1) {
|
|
|
|
|
+ this.memoList.push(this.list[index])
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- if (idx > -1) {
|
|
|
|
|
- this.memoList.splice(idx, 1)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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()
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|