diff --git a/pages/zw/ll-instore.vue b/pages/zw/ll-instore.vue
index 9bfcaf9..f0c0c69 100644
--- a/pages/zw/ll-instore.vue
+++ b/pages/zw/ll-instore.vue
@@ -3,15 +3,6 @@
-
@@ -59,7 +50,7 @@
- | 选择 |
+ |
点位码 |
托盘码 |
批次号 |
@@ -86,8 +77,10 @@
+
-
+
+
@@ -111,10 +104,9 @@
dataList: [],
// dataList: [
// {site_code: 's01', vehicle_code: 'v01', checked: false},
- // {site_code: 's02', vehicle_code: 'v02', checked: false},
- // {site_code: 's03', vehicle_code: 'v03', checked: false},
// {site_code: 's04', vehicle_code: 'v04', checked: false}
// ],
+ allCheck: false,
checkedArr: [],
pkId: '',
currentData: {},
@@ -126,21 +118,10 @@
this.title = options.title
this.id = options.id
},
- onShow() {
- if (this.$store.getters.dataList !== []) {
- this.dataList = this.$store.getters.publicArr
- }
- },
created () {
this._getInBillList()
},
methods: {
- handleAdd () {
- this.dataList.map(el => {
- this.$set(el, 'checked', false)
- })
- this.$store.dispatch('setPublicArr', this.dataList)
- },
// async _getPlate () {
// try {
// let res = await getPlate(this.val1)
@@ -164,26 +145,37 @@
this.pkId = this.pkId === e.site_code ? '' : e.site_code
this.pkObj = this.pkId === e.site_code ? e : {}
},
+ toAllCheck () {
+ this.allCheck = !this.allCheck
+ this.dataList.map(el => {
+ el.checked = this.allCheck
+ })
+ },
+ toAllCheck () {
+ this.allCheck = !this.allCheck
+ this.dataList.map(el => {
+ el.checked = this.allCheck
+ })
+ },
toCheck (e) {
e.checked = !e.checked
this.checkedArr = this.dataList.filter(el => el.checked === true)
- if (this.checkedArr.length > 0) {
- this.dataList.map(el => {
- this.$set(el, 'checked', false)
- })
- e.checked = !e.checked
- }
+ this.allCheck = this.checkedArr.length === this.dataList.length
},
clearUp () {
this.dataList = []
this.checkedArr = []
},
async _getInBillList () {
+ this.toAllCheck()
try {
let res = await getInBillList()
if (res.code === '200') {
- this.dataList = [...this.dataList, ...res.data]
- this.handleAdd()
+ this.dataList = [...res.data]
+ this.allCheck = true
+ this.dataList.map(el => {
+ el.checked = this.allCheck
+ })
} else {
uni.showToast({
title: res.message,