Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/admin into dev

许成详 6 years ago
parent
commit
0ebce5bd5f

+ 36
- 2
src/pages/system/dataStatistics/goodsOrderList/index.vue View File

91
         <td v-if="index%2 !== 0" colspan="2">
91
         <td v-if="index%2 !== 0" colspan="2">
92
           <el-button
92
           <el-button
93
           size="mini"
93
           size="mini"
94
-          type="success">重打</el-button>
94
+          type="success" @click="printPdf(`item${(index + 1) / 2}`)">重打</el-button>
95
         </td>
95
         </td>
96
+        <div v-if="index%2 !== 0" class="print-area" :class="'item' + (index + 1) / 2" style="width:180px;left:0;position: absolute;opacity: 0;">
97
+          <div style="padding:0px 10px 5px;border-bottom:2px solid #cccccc;">
98
+            <div style="display:inline-block;">
99
+              <img class="topIcon" style="display:block;width:60%;margin:0 0 20px 0px;" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt="">
100
+              <span style="display:block;font-size:20px;font-weight:700;text-align: center;">{{returnListItem(goodsOrderList, index).AreaName}}{{returnListItem(goodsOrderList, index).TableNo}}</span>
101
+            </div>
102
+          </div>
103
+          <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;" v-for="(subItem,subIndex) in returnListItem(goodsOrderList, index).Details" :key="subIndex">
104
+            <div style="font-size:12px;"><span style="display:inline-block;width:75%;text-align:left;">{{subItem.GoodsName}}</span><span style="display:inline-block;width:22%;text-align:right;font-size:12px;" v-if='!subItem.SpecName'>× {{subItem.Number}}</span></div>
105
+            <div style="margin-top:8px;" v-if='subItem.SpecName'>
106
+              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{subItem.SpecName}}</span>
107
+              <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">× {{subItem.Number}}</span>
108
+            </div>
109
+          </div>
110
+          <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;">
111
+            <div style="font-size:12px;">下单人:{{returnListItem(goodsOrderList, index).CustomerName}}</div>
112
+            <span style="display:block;margin-top:10px;font-size:12px;">下单时间:{{toolClass.dateFormat(returnListItem(goodsOrderList, index).CreateDate)}}</span>
113
+          </div>
114
+          <div style="padding:10px 10px;font-size:12px;">备注:{{returnListItem(goodsOrderList, index).Remark}}</div>
115
+          <div style="text-align: right;font-size: 12px;">城的空间.诚咖啡</div>
116
+          <div style="height:10px"></div>
117
+        </div>
96
       </tr>
118
       </tr>
97
     </table>
119
     </table>
98
     <el-pagination
120
     <el-pagination
107
 
129
 
108
 <script>
130
 <script>
109
 import { mapState, createNamespacedHelpers } from 'vuex'
131
 import { mapState, createNamespacedHelpers } from 'vuex'
132
+import { getLodop } from '@/util/LodopFuncs'
110
 import tableSearch from '@/components/tableSearch/index'
133
 import tableSearch from '@/components/tableSearch/index'
111
 const { mapState: mapStaState, mapActions: mapStaActions } = createNamespacedHelpers('sta')
134
 const { mapState: mapStaState, mapActions: mapStaActions } = createNamespacedHelpers('sta')
112
-
135
+var LODOP
113
 export default {
136
 export default {
114
   name: '',
137
   name: '',
115
   data () {
138
   data () {
214
         this.total = res.total
237
         this.total = res.total
215
       })
238
       })
216
     },
239
     },
240
+    printPdf (cl) {
241
+      this.CreateOneFormPage(cl)
242
+      LODOP.PRINT()
243
+      // LODOP.PREVIEW()
244
+    },
245
+    CreateOneFormPage (cl) {
246
+      LODOP = getLodop()
247
+      LODOP.PRINT_INIT('订单')
248
+      LODOP.SET_PRINT_PAGESIZE(3, 480, 40, '')
249
+      LODOP.ADD_PRINT_HTM(0, 0, document.getElementsByClassName(cl)[0].offsetWidth, document.getElementsByClassName(cl)[0].offsetHeight, document.getElementsByClassName(cl)[0].innerHTML)
250
+    },
217
     exportExcel () {
251
     exportExcel () {
218
       window.location.href = `${this.toolClass.ReplaceOrg(this.$api.statistics.goodsOrderExcel.url)}?token=${localStorage.getItem('JWT')}`
252
       window.location.href = `${this.toolClass.ReplaceOrg(this.$api.statistics.goodsOrderExcel.url)}?token=${localStorage.getItem('JWT')}`
219
     },
253
     },

+ 11
- 9
src/pages/system/newOrder/newOrderList/index.vue View File

30
           <div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;">
30
           <div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;">
31
             <i class="iconfont icon-yinchenglogo" style="font-size:70px;color:red;position: relative;bottom: 20px;margin-right:10px;"></i>
31
             <i class="iconfont icon-yinchenglogo" style="font-size:70px;color:red;position: relative;bottom: 20px;margin-right:10px;"></i>
32
             <div style="display:inline-block;">
32
             <div style="display:inline-block;">
33
-              <span style="display:block;font-size:20px;font-weight:700;">{{item.AreaName}}</span>
33
+              <span style="display:block;font-size:20px;font-weight:700;">{{item.AreaName + item.TableNo}}</span>
34
               <span style="display:block;margin-top:10px">下单时间:{{toolClass.dateFormat(item.CreateDate)}}</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>
35
               <span style="display:block;margin-top:10px">已等待:<span style="color:red;font-weight:700;">{{leftTimes[item.OrdersId]}}</span></span>
36
             </div>
36
             </div>
37
           </div>
37
           </div>
38
           <div style="padding:10px 20px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
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>
39
+            <div style="display:flex;justify-content: space-between;align-items: center;padding-right: 10px;"><span>{{item1.GoodsName}}</span><span style="display:inline-block;width:20%;text-align:right" v-if='!item1.SpecName'>× {{item1.Number}}</span></div>
40
             <div style="margin-top:8px;" v-if='item1.SpecName'>
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>
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">× {{item1.Number}}</span>
42
               <span style="display:inline-block;width:20%;text-align:right">× {{item1.Number}}</span>
53
             </div>
53
             </div>
54
           </div>
54
           </div>
55
           <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
55
           <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
56
-            <div style="display:flex;justify-content: space-between;align-items: center;font-size:12px;"><span>{{item1.GoodsName}}</span><span style="display:inline-block;width:20%;text-align:right;font-size:12px;" v-if='!item1.SpecName'>x {{item1.Number}}</span></div>
56
+            <div style="font-size:12px;"><span style="display:inline-block;width:75%;text-align:left;">{{item1.GoodsName}}</span><span style="display:inline-block;width:22%;text-align:right;font-size:12px;" v-if='!item1.SpecName'>× {{item1.Number}}</span></div>
57
             <div style="margin-top:8px;" v-if='item1.SpecName'>
57
             <div style="margin-top:8px;" v-if='item1.SpecName'>
58
               <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{item1.SpecName}}</span>
58
               <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{item1.SpecName}}</span>
59
               <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">× {{item1.Number}}</span>
59
               <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">× {{item1.Number}}</span>
138
         })
138
         })
139
         return
139
         return
140
       }
140
       }
141
-      this.getBusinessStatus(this.caseid)
142
       clearInterval(this.interval)
141
       clearInterval(this.interval)
143
       this.GetOrdersList({ caseid: this.caseid }).then(() => {
142
       this.GetOrdersList({ caseid: this.caseid }).then(() => {
144
-        if (this.business) {
145
-          this.initWebSocket()
146
-        }
143
+        this.getBusinessStatus(this.caseid).then(() => {
144
+          if (this.businessStatus) {
145
+            this.initWebSocket()
146
+          }
147
+        })
147
         this.interval = setInterval(() => {
148
         this.interval = setInterval(() => {
148
           const now = (new Date()).valueOf()
149
           const now = (new Date()).valueOf()
149
           this.leftTimes = this.list.reduce((acc, it) => {
150
           this.leftTimes = this.list.reduce((acc, it) => {
176
       'updateSystemInfo'
177
       'updateSystemInfo'
177
     ]),
178
     ]),
178
     submit (id) {
179
     submit (id) {
179
-      console.log(id)
180
       this.$confirm('确定完成此饮品?', '提示', {
180
       this.$confirm('确定完成此饮品?', '提示', {
181
         confirmButtonText: '确定',
181
         confirmButtonText: '确定',
182
         cancelButtonText: '取消',
182
         cancelButtonText: '取消',
262
         })
262
         })
263
         return
263
         return
264
       }
264
       }
265
-      this.openBusiness(this.caseid)
265
+      this.openBusiness(this.caseid).then(() => {
266
+        this.init()
267
+      })
266
     },
268
     },
267
     close () {
269
     close () {
268
       if (!this.caseid) {
270
       if (!this.caseid) {

+ 4
- 3
src/pages/system/newOrder/newOrderList/page.scss View File

1
 .order-list-box{
1
 .order-list-box{
2
   padding: 50px;
2
   padding: 50px;
3
-  border-radius: 3px;
4
   overflow: scroll;
3
   overflow: scroll;
5
-  width: auto;
6
-  height: 600px;
4
+  width: 100%;
7
   margin-top: 10px;
5
   margin-top: 10px;
6
+  box-sizing: border-box;
7
+  white-space: nowrap;
8
   >div{
8
   >div{
9
     display: inline-block;
9
     display: inline-block;
10
     width:300px;
10
     width:300px;
11
     margin:20px;
11
     margin:20px;
12
     box-shadow: 0px 2px 10px 0px rgba(193, 204, 217, 0.5);
12
     box-shadow: 0px 2px 10px 0px rgba(193, 204, 217, 0.5);
13
     padding-bottom: 10px;
13
     padding-bottom: 10px;
14
+    vertical-align: top;
14
   }
15
   }
15
   .print-area{
16
   .print-area{
16
     position: absolute;
17
     position: absolute;

+ 0
- 20
src/util/ajax.js View File

9
     localStorage.setItem('JWT', headers.authorization)
9
     localStorage.setItem('JWT', headers.authorization)
10
     JWT = headers.authorization
10
     JWT = headers.authorization
11
   }
11
   }
12
-  console.log(JWT)
13
   return JWT ? JWT : localStorage.getItem('JWT') // eslint-disable-line
12
   return JWT ? JWT : localStorage.getItem('JWT') // eslint-disable-line
14
 }
13
 }
15
 
14
 
59
   console.log(error)
58
   console.log(error)
60
 })
59
 })
61
 
60
 
62
-// Axios.interceptors.response.use((res) => {
63
-//   // return new Promise((resolve, reject) => {
64
-//   //   if (res.data.code === 200) {
65
-//   //     resolve(res.data.result)
66
-//   //   } else if (res.data.code === 401) {
67
-//   //     router.push({ name: 'login' })
68
-//   //     reject(res.data)
69
-//   //   } else {
70
-//   //     Message({
71
-//   //       message: res.data.message,
72
-//   //       type: 'error'
73
-//   //     })
74
-//   //     reject(res.data)
75
-//   //   }
76
-//   // })
77
-// }, (error) => {
78
-//   console.log(error)
79
-// })
80
-
81
 const ajax = (...args) => {
61
 const ajax = (...args) => {
82
   return new Promise((resolve, reject) => {
62
   return new Promise((resolve, reject) => {
83
     Axios(...args).then(({ data, headers }) => {
63
     Axios(...args).then(({ data, headers }) => {