|
@@ -5,6 +5,22 @@
|
5
|
5
|
<div class="flex-item flex-h">
|
6
|
6
|
<el-button size="mini" type="danger">营业</el-button>
|
7
|
7
|
</div>
|
|
8
|
+ <ul>
|
|
9
|
+ <li>
|
|
10
|
+ <!-- <span>选择案场:</span> -->
|
|
11
|
+ <el-select v-model="CaseId" placeholder="请选择">
|
|
12
|
+ <el-option
|
|
13
|
+ v-for="item in cases"
|
|
14
|
+ :key="item.CaseId"
|
|
15
|
+ :label="item.CaseName"
|
|
16
|
+ :value="item.CaseId">
|
|
17
|
+ </el-option>
|
|
18
|
+ </el-select>
|
|
19
|
+ </li>
|
|
20
|
+ </ul>
|
|
21
|
+ <el-button
|
|
22
|
+ size="mini"
|
|
23
|
+ type="primary" @click="GetOrdersList({ caseid: CaseId })">搜索</el-button>
|
8
|
24
|
</div>
|
9
|
25
|
<div class="moreFilter"></div>
|
10
|
26
|
</div>
|
|
@@ -14,47 +30,39 @@
|
14
|
30
|
<div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;">
|
15
|
31
|
<i class="iconfont icon-yinchenglogo" style="font-size:70px;color:red;position: relative;bottom: 20px;margin-right:10px;"></i>
|
16
|
32
|
<div style="display:inline-block;">
|
17
|
|
- <span style="display:block;font-size:20px;font-weight:700;">A区域1号桌</span>
|
18
|
|
- <span style="display:block;margin-top:10px">下单时间:21:30:39</span>
|
19
|
|
- <span style="display:block;margin-top:10px">已等待:<span style="color:red;font-weight:700;">30:29</span></span>
|
|
33
|
+ <span style="display:block;font-size:20px;font-weight:700;">{{item.AreaName}}</span>
|
|
34
|
+ <span style="display:block;margin-top:10px">下单时间:{{toolClass.dateFormat(item.CreateDate)}}</span>
|
|
35
|
+ <span style="display:block;margin-top:10px">已等待:<span style="color:red;font-weight:700;">{{leftTimes[item.OrdersId]}}</span></span>
|
20
|
36
|
</div>
|
21
|
37
|
</div>
|
22
|
|
- <div style="padding:10px 20px 5px;border-bottom:1px solid #cccccc;">
|
23
|
|
- <div>卡布奇诺</div>
|
24
|
|
- <div style="margin-top:8px;">
|
25
|
|
- <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">热</span>
|
26
|
|
- <span style="display:inline-block;width:20%;text-align:right">x 1</span>
|
27
|
|
- </div>
|
28
|
|
- <div style="margin-top:8px;">
|
29
|
|
- <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">冷</span>
|
30
|
|
- <span style="display:inline-block;width:20%;text-align:right">x 2</span>
|
|
38
|
+ <div style="padding:10px 20px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
|
|
39
|
+ <div style="display:flex;justify-content: space-between;align-items: center;"><span>{{item1.GoodsName}}</span><span style="display:inline-block;width:20%;text-align:right" v-if='!item1.SpecName'>x {{item1.Number}}</span></div>
|
|
40
|
+ <div style="margin-top:8px;" v-if='item1.SpecName'>
|
|
41
|
+ <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">{{item1.SpecName}}</span>
|
|
42
|
+ <span style="display:inline-block;width:20%;text-align:right">x {{item1.Number}}</span>
|
31
|
43
|
</div>
|
32
|
44
|
</div>
|
33
|
|
- <div style="padding:10px 20px;border-bottom:1px solid #cccccc">备注:请赶快制作</div>
|
34
|
|
- <div style="padding:10px 20px;">下单人:xxxxx</div>
|
|
45
|
+ <div style="padding:10px 20px;border-bottom:1px solid #cccccc">备注:{{item.Remark}}</div>
|
|
46
|
+ <div style="padding:10px 20px;">下单人:{{item.UserName}}</div>
|
35
|
47
|
</div>
|
36
|
48
|
<div class="print-area" :class="'item' + index" style="width:180px;">
|
37
|
49
|
<div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;">
|
38
|
50
|
<div style="display:inline-block;">
|
39
|
51
|
<img class="topIcon" style="display:block;width:60%;margin:0 0 20px 10px;" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt="">
|
40
|
|
- <span style="display:block;font-size:20px;font-weight:700;"> <img width='25px' height="25px" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt=""> A区域1号桌</span>
|
41
|
|
- <span style="display:block;margin-top:10px;font-size:12px;">下单时间:21:30:39</span>
|
42
|
|
- <span style="display:block;margin-top:10px;font-size:12px;">已等待:<span style="color:red;font-weight:700;">30:29</span></span>
|
|
52
|
+ <span style="display:block;font-size:20px;font-weight:700;"> <img width='25px' height="25px" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt=""> {{item.AreaName}}</span>
|
|
53
|
+ <span style="display:block;margin-top:10px;font-size:12px;">下单时间:{{toolClass.dateFormat(item.CreateDate)}}</span>
|
|
54
|
+ <span style="display:block;margin-top:10px;font-size:12px;">已等待:<span style="color:red;font-weight:700;">{{leftTimes[item.OrdersId]}}</span></span>
|
43
|
55
|
</div>
|
44
|
56
|
</div>
|
45
|
|
- <div style="padding:10px 20px 5px;border-bottom:1px solid #cccccc;">
|
46
|
|
- <div>卡布奇诺</div>
|
47
|
|
- <div style="margin-top:8px;">
|
48
|
|
- <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">热</span>
|
49
|
|
- <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">x 1</span>
|
50
|
|
- </div>
|
51
|
|
- <div style="margin-top:8px;">
|
52
|
|
- <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">冷</span>
|
53
|
|
- <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">x 2</span>
|
|
57
|
+ <div style="padding:10px 20px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
|
|
58
|
+ <div style="display:flex;justify-content: space-between;align-items: center;"><span>{{item1.GoodsName}}</span><span style="display:inline-block;width:20%;text-align:right" v-if='!item1.SpecName'>x {{item1.Number}}</span></div>
|
|
59
|
+ <div style="margin-top:8px;" v-if='item1.SpecName'>
|
|
60
|
+ <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{item1.SpecName}}</span>
|
|
61
|
+ <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">x {{item1.Number}}</span>
|
54
|
62
|
</div>
|
55
|
63
|
</div>
|
56
|
|
- <div style="padding:10px 20px;border-bottom:1px solid #cccccc">备注:请赶快制作</div>
|
57
|
|
- <div style="padding:10px 20px;">下单人:xxxxx</div>
|
|
64
|
+ <div style="padding:10px 20px;border-bottom:1px solid #cccccc">备注:{{item.Remark}}</div>
|
|
65
|
+ <div style="padding:10px 20px;">下单人:{{item.UserName}}</div>
|
58
|
66
|
</div>
|
59
|
67
|
<div class="btns">
|
60
|
68
|
<span @click="cancel">取消</span>
|
|
@@ -66,13 +74,14 @@
|
66
|
74
|
</template>
|
67
|
75
|
|
68
|
76
|
<script>
|
69
|
|
-import { createNamespacedHelpers, mapState } from 'vuex'
|
|
77
|
+import { createNamespacedHelpers, mapState, mapActions } from 'vuex'
|
70
|
78
|
|
71
|
79
|
import { getLodop } from '@/util/LodopFuncs'
|
72
|
80
|
|
|
81
|
+import { formatTimeBySeconds } from '@/util/util'
|
|
82
|
+
|
73
|
83
|
const { mapState: mapOrderState, mapActions: mapOrderActions } = createNamespacedHelpers('goodsorder')
|
74
|
84
|
|
75
|
|
-const baseUrl = process.env.NODE_ENV === 'development' ? 'ws://192.168.0.148:8078/admin' : 'ws://cdkj.ycjcjy.com/admin' // 'ws://cdkj.ycjcjy.com/admin'
|
76
|
85
|
var LODOP
|
77
|
86
|
export default {
|
78
|
87
|
name: '',
|
|
@@ -85,32 +94,66 @@ export default {
|
85
|
94
|
pagesize: 10, // 请求数据量
|
86
|
95
|
},
|
87
|
96
|
currentList: [],
|
88
|
|
- list: [1]
|
|
97
|
+ leftTimes: {},
|
89
|
98
|
}
|
90
|
99
|
},
|
91
|
|
- components: {
|
|
100
|
+ computed: {
|
92
|
101
|
...mapOrderState({
|
93
|
|
- orders: x => x.ordersList
|
|
102
|
+ list: x => (x.ordersList || {}).list || [],
|
94
|
103
|
}),
|
95
|
104
|
...mapState({
|
96
|
105
|
cases: x => x.app.cases.list,
|
97
|
|
- defaultCaseId: x => x.app.cases.default
|
98
|
|
- })
|
|
106
|
+ defaultCaseId: x => x.app.cases.default,
|
|
107
|
+ userInfo: x => x.app.user
|
|
108
|
+ }),
|
|
109
|
+ CaseId: {
|
|
110
|
+ get () {
|
|
111
|
+ return this.caseid || this.defaultCaseId
|
|
112
|
+ },
|
|
113
|
+ set (val) {
|
|
114
|
+ this.caseid = val
|
|
115
|
+ }
|
|
116
|
+ }
|
99
|
117
|
},
|
100
|
|
- mounted () {
|
101
|
|
- this.GetOrdersList()
|
|
118
|
+ created () {
|
|
119
|
+ this.updateSystemInfo().then(() => {
|
|
120
|
+ this.initWebSocket()
|
|
121
|
+ this.GetOrdersList({ caseid: this.CaseId }).then(() => {
|
|
122
|
+ setInterval(() => {
|
|
123
|
+ const now = (new Date()).valueOf()
|
|
124
|
+ this.leftTimes = this.list.reduce((acc, it) => {
|
|
125
|
+ const showDT = now - ((new Date(it.CreateDate)).valueOf())
|
|
126
|
+
|
|
127
|
+ return { ...acc, [`${it.OrdersId}`]: formatTimeBySeconds(showDT) }
|
|
128
|
+ }, {})
|
|
129
|
+ }, 1000)
|
|
130
|
+ })
|
|
131
|
+ })
|
102
|
132
|
},
|
103
|
133
|
methods: {
|
|
134
|
+ timeOut (c) {
|
|
135
|
+ let cTime = new Date(c).valueOf()
|
|
136
|
+ let time = new Date().valueOf()
|
|
137
|
+ let s = parseInt((time - cTime) / 1000)
|
|
138
|
+ let m = parseInt(s / 60)
|
|
139
|
+ s = s - m * 60
|
|
140
|
+ m = m < 10 ? '0' + m : m
|
|
141
|
+ s = s < 10 ? '0' + s : s
|
|
142
|
+ return `${m} : ${s}`
|
|
143
|
+ },
|
104
|
144
|
...mapOrderActions([
|
105
|
145
|
'GetOrdersList',
|
106
|
146
|
]),
|
|
147
|
+ ...mapActions([
|
|
148
|
+ 'updateSystemInfo'
|
|
149
|
+ ]),
|
107
|
150
|
submit (cl) {
|
108
|
151
|
this.$confirm('确定完成此饮品?', '提示', {
|
109
|
152
|
confirmButtonText: '确定',
|
110
|
153
|
cancelButtonText: '取消',
|
111
|
154
|
type: 'warning'
|
112
|
155
|
}).then((res) => {
|
113
|
|
- // this.printPdf(cl)
|
|
156
|
+ this.printPdf(cl)
|
114
|
157
|
}).catch((res) => {
|
115
|
158
|
this.$message({
|
116
|
159
|
type: 'info',
|
|
@@ -143,18 +186,25 @@ export default {
|
143
|
186
|
})
|
144
|
187
|
})
|
145
|
188
|
},
|
146
|
|
- initWebSocket (code) {
|
147
|
|
- const wsuri = `${baseUrl}/websocket/${code}`
|
|
189
|
+ initWebSocket () {
|
|
190
|
+ console.log(this.user)
|
|
191
|
+ let caseid = this.defaultCaseId
|
|
192
|
+ let id = this.userInfo.UserId
|
|
193
|
+ // const wsuri = `${window.location.origin.replace('http', 'ws')}/api/common/MQ/websocket/${caseid}/${id}`
|
|
194
|
+ const wsuri = `ws://192.168.0.11/api/guest/MQ/websocket/${caseid}/${id}`
|
148
|
195
|
try {
|
149
|
196
|
this.websock = new WebSocket(wsuri)
|
150
|
197
|
} catch (e) {
|
151
|
198
|
console.log(e)
|
152
|
199
|
}
|
|
200
|
+ this.websock.onopen = console.log
|
153
|
201
|
this.websock.onmessage = this.websocketonmessage
|
154
|
|
- this.websock.onclose = this.websocketclose
|
|
202
|
+ this.websock.onclose = console.log
|
155
|
203
|
},
|
156
|
204
|
websocketonmessage (e) {
|
|
205
|
+ console.log(e)
|
157
|
206
|
// const redata = JSON.parse(e.data)
|
|
207
|
+ this.list = JSON.parse(e.data).data.refreshOnlineGoodsOrders
|
158
|
208
|
}
|
159
|
209
|
}
|
160
|
210
|
}
|