|
@@ -25,6 +25,7 @@
|
25
|
25
|
<div class="moreFilter"></div>
|
26
|
26
|
</div>
|
27
|
27
|
<div class="order-list-box">
|
|
28
|
+ <print-list :print-list="printList" v-if="printList.length>0" @printed="clearPrintList" />
|
28
|
29
|
<div style='position:relative;' v-for="(item,index) in ordersList" :key="index">
|
29
|
30
|
<div>
|
30
|
31
|
<div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;display:flex;align-items: center;">
|
|
@@ -46,7 +47,6 @@
|
46
|
47
|
<div style="padding:10px 20px;border-bottom:1px solid #cccccc;white-space: normal;">备注:{{item.Remark}}</div>
|
47
|
48
|
<div style="padding:10px 20px;">下单人:{{item.UserName}}</div>
|
48
|
49
|
</div>
|
49
|
|
- <print-list :print-list="printList" :lodop="lodop" @printed="clearPrintList" />
|
50
|
50
|
<div class="btns">
|
51
|
51
|
<span @click="cancel(item.OrdersId,index)">取消</span>
|
52
|
52
|
<span @click="submit(item.OrdersId,index)">确定</span>
|
|
@@ -58,7 +58,6 @@
|
58
|
58
|
|
59
|
59
|
<script>
|
60
|
60
|
import { createNamespacedHelpers, mapState, mapActions } from 'vuex'
|
61
|
|
-import { getLodop } from '@/util/LodopFuncs'
|
62
|
61
|
import { formatTimeBySeconds } from '@/util/util'
|
63
|
62
|
import { replaceURLParams } from '@/util/ajax'
|
64
|
63
|
import XWebSocket from '@/util/websocket'
|
|
@@ -73,7 +72,6 @@ export default {
|
73
|
72
|
},
|
74
|
73
|
data () {
|
75
|
74
|
return {
|
76
|
|
- lodop: null,
|
77
|
75
|
ws: null,
|
78
|
76
|
wsID: '',
|
79
|
77
|
printList: [],
|
|
@@ -129,11 +127,6 @@ export default {
|
129
|
127
|
autoConnect: true,
|
130
|
128
|
})
|
131
|
129
|
},
|
132
|
|
- mounted () {
|
133
|
|
- this.lodop = getLodop()
|
134
|
|
- this.lodop.PRINT_INIT('城咖啡订单')
|
135
|
|
- this.lodop.SET_PRINT_PAGESIZE(3, 480, 40, '')
|
136
|
|
- },
|
137
|
130
|
beforeDestroyed () {
|
138
|
131
|
this.ws.close()
|
139
|
132
|
},
|
|
@@ -152,7 +145,8 @@ export default {
|
152
|
145
|
this.GetOrdersList({ caseid: this.CaseId }).then(list => {
|
153
|
146
|
// 打印新单
|
154
|
147
|
if (list) {
|
155
|
|
- this.printList = list.map(x => x.IsIntimidate === 0)
|
|
148
|
+ this.printList = list.filter(x => x.IsIntimidate === 0)
|
|
149
|
+ console.log(this.printList)
|
156
|
150
|
}
|
157
|
151
|
|
158
|
152
|
// 开张, 则实时监控新单
|
|
@@ -265,9 +259,9 @@ export default {
|
265
|
259
|
receviedNewOrders (e) {
|
266
|
260
|
const newOrders = JSON.parse(e.data).data.refreshOnlineGoodsOrders
|
267
|
261
|
if (!newOrders || !newOrders.length) return
|
268
|
|
- const newList = this.ordersList.concat(newOrders)
|
|
262
|
+
|
269
|
263
|
// 放入待制作队列
|
270
|
|
- this.updateList({ list: newList })
|
|
264
|
+ this.updateList(this.ordersList.concat(newOrders))
|
271
|
265
|
|
272
|
266
|
// 放入待打队列
|
273
|
267
|
const ps = newOrders.filter(x => x.IsIntimidate === 0).map((orders) => {
|
|
@@ -283,7 +277,9 @@ export default {
|
283
|
277
|
})
|
284
|
278
|
})
|
285
|
279
|
|
286
|
|
- Promise.all(ps).then((its = []) => this.printList.concat(its.filter(x => x)))
|
|
280
|
+ Promise.all(ps).then((its = []) => {
|
|
281
|
+ this.printList.concat(its.filter(x => x))
|
|
282
|
+ })
|
287
|
283
|
},
|
288
|
284
|
open () {
|
289
|
285
|
if (!this.CaseId) {
|