diff --git a/src/pages/modules/finished/finished-instore.vue b/src/pages/modules/finished/finished-instore.vue index f08240b..0222058 100644 --- a/src/pages/modules/finished/finished-instore.vue +++ b/src/pages/modules/finished/finished-instore.vue @@ -112,8 +112,8 @@ export default { next() }, activated () { - if (this.$store.getters.materObj !== '') { - this.dataList.push(JSON.parse(this.$store.getters.materObj)) + if (this.$store.getters.materArr.length > 0) { + this.dataList = [...this.dataList, ...this.$store.getters.materArr] } }, created () { diff --git a/src/pages/modules/finished/select-finished-mater.vue b/src/pages/modules/finished/select-finished-mater.vue index 6323e21..68e7340 100644 --- a/src/pages/modules/finished/select-finished-mater.vue +++ b/src/pages/modules/finished/select-finished-mater.vue @@ -29,15 +29,16 @@
- - + +
-
+
+ @@ -50,7 +51,10 @@ - + + @@ -73,39 +77,68 @@ import {dateTimeFtt} from '@config/utils.js' export default { data () { return { + page: 1, + size: '30', + busy: false, + desc: '', val1: '', val2: '', date: [new Date((new Date().getTime() - 6 * 24 * 60 * 60 * 1000)), new Date((new Date().getTime()))], - dataList: [{sale_code: '030301010037'}], - pkId: '', - pkObj: {} + dataList: [{sale_code: '030301010037', checked: false}, {sale_code: '030301010038', checked: false}], + checkArr: [] } }, created () { this._getMaterial() }, methods: { - // 查询 + // grid async _getMaterial () { + this.page = 1 + this.busy = false + this.desc = '' let res = await getMaterial(this.date !== null ? dateTimeFtt(this.date[0]) : '', this.date !== null ? dateTimeFtt(this.date[1]) : '', this.val1, this.val2) + this.dataList = [] + res.data.map(el => { + this.$set(el, 'checked', false) + }) this.dataList = [...res.data] + if (res.data.length < 30) { + this.busy = true + this.desc = '已加载全部数据' + } }, - toRadio (e) { - this.pkId = this.pkId === e.sale_code ? '' : e.sale_code - this.pkObj = this.pkId === e.sale_code ? e : {} + async loadMore () { + this.busy = true + this.page++ + let res = await getMaterial(this.date !== null ? dateTimeFtt(this.date[0]) : '', this.date !== null ? dateTimeFtt(this.date[1]) : '', this.val1, this.val2) + res.data.map(el => { + this.$set(el, 'checked', false) + }) + this.dataList = [...this.dataList, ...res.data] + if (res.data.length < 30) { + this.busy = true + this.desc = '已加载全部数据' + } else { + this.busy = false + } + }, + colseUp () { + this.$router.push('/finishedinstore') }, toSure () { - this.$store.dispatch('setMaterObj', JSON.stringify(this.pkObj)) - this.$router.push('/finishedinstore') + if (this.checkArr.length === 0) { + return + } + this.$store.dispatch('setMaterArr', this.checkArr) + this.colseUp() }, - clear () { - this.val1 = '' - this.val2 = '' - this.pkId = '' - this.pkObj = {} + clearUp () { + this.checkArr = [] }, - close () { - this.$router.push('/finishedinstore') + toRadio (e) { + e.checked = !e.checked + this.checkArr = this.dataList.filter(i => { return i.checked === true }) } } }
选择 序号 日期 单据号
+ + {{i + 1}} {{e.create_time}} {{e.sale_code}}