yuantianjiao 6 years ago
parent
commit
1d9b836bab

+ 216
- 0
src/pages/system/newOrder/monthOrder/index.vue View File

@@ -0,0 +1,216 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click='addMajorProjects'>新增</el-button>
7
+        </div>
8
+        <ul>
9
+          <li>
10
+            <span>选择案场:</span>
11
+            <el-select v-model="tableSearch.caseId" placeholder="请选择">
12
+              <el-option
13
+              value=""
14
+              >
15
+              </el-option>
16
+              <el-option
17
+                v-for="item in caseList"
18
+                :key="item.CaseId"
19
+                :label="item.CaseName"
20
+                :value="item.CaseId">
21
+              </el-option>
22
+            </el-select>
23
+          </li>
24
+        </ul>
25
+        <el-button
26
+          size="mini"
27
+          type="primary" @click="search">搜索</el-button>
28
+      </div>
29
+      <div class="moreFilter"></div>
30
+    </div>
31
+    <div class="system-table-box">
32
+      <el-table
33
+        :data="tableData"
34
+        stripe
35
+        style="width: 100%">
36
+        <el-table-column
37
+          prop="Name"
38
+          label="案场">
39
+        </el-table-column>
40
+        <el-table-column
41
+          prop="Title"
42
+          label="月份">
43
+        </el-table-column>
44
+        <el-table-column
45
+          prop="CaseName"
46
+          label="规定次数">
47
+        </el-table-column>
48
+        <el-table-column
49
+          prop="CreateDate"
50
+          label="实际次数">
51
+        </el-table-column>
52
+        <el-table-column
53
+          prop="CreateDate"
54
+          label="超出次数">
55
+        </el-table-column>
56
+        <el-table-column
57
+          prop="CreateDate"
58
+          label="剩余次数">
59
+        </el-table-column>
60
+        <el-table-column label="操作" width="450">
61
+          <template slot-scope="scope">
62
+            <el-button
63
+              size="mini"
64
+              type="primary"
65
+              @click="deleteItem(scope.$index, scope.row)">导出Excel</el-button>
66
+          </template>
67
+        </el-table-column>
68
+      </el-table>
69
+    </div>
70
+    <el-pagination
71
+      @current-change="handleCurrentChange"
72
+      :current-page.sync="postData.currentPage"
73
+      :page-size="postData.pageSize"
74
+      layout="prev, pager, next, jumper"
75
+      :total="postData.total">
76
+    </el-pagination>
77
+  </div>
78
+</template>
79
+
80
+<script>
81
+import { mapState, mapActions } from 'vuex'
82
+
83
+export default {
84
+  name: '',
85
+  data () {
86
+    return {
87
+      postData: {
88
+        currentPage: 1, // 当前页码
89
+        pageSize: 10,
90
+        total: 0,
91
+      },
92
+      tableSearch: { // 表格搜索条件
93
+        key: '', // 搜索关键字
94
+        caseId: '', // 案场id
95
+      },
96
+      tableData: []
97
+    }
98
+  },
99
+  computed: {
100
+    ...mapState({
101
+      OrgId: x => x.app.user.OrgId,
102
+      caseList: x => x.app.cases.list,
103
+      defaultCaseId: x => x.app.cases.default
104
+    })
105
+  },
106
+  components: {
107
+    // tableSearch,
108
+  },
109
+  created () {
110
+    this.updateSystemInfo().then(() => {
111
+      // this.tableSearch.caseId = this.defaultCaseId
112
+      this.getList()
113
+    })
114
+  },
115
+  methods: {
116
+    ...mapActions(['updateSystemInfo']),
117
+    handleCurrentChange (val) {
118
+      this.postData.currentPage = val
119
+      this.getList()
120
+    },
121
+    showItem (index, row) { // 前台显示
122
+      this.editIsAllCourse(row)
123
+    },
124
+    editItem (index, row) { // 编辑
125
+      console.log(index, row)
126
+      this.$router.push({ name: 'editIndexCase', query: { id: row.CmsCaseId } })
127
+    },
128
+    // copyItemUrl (index, row) { // 复制专题链接
129
+    //   console.log(index, row)
130
+    //   window.clipboardData.setData('Text', row.Title)
131
+    // },
132
+    deleteItem (index, row) { // 删除
133
+      console.log(index, row)
134
+      this.$confirm('确认删除此项目专题?', '提示', {
135
+        confirmButtonText: '确定',
136
+        cancelButtonText: '取消',
137
+        type: 'warning'
138
+      }).then(() => {
139
+        this.deleteInfo(row.CmsCaseId)
140
+      }).catch(() => {
141
+        this.$message({
142
+          type: 'info',
143
+          message: '已取消删除'
144
+        })
145
+      })
146
+    },
147
+    searchList (key) { // 搜索列表
148
+      this.tableSearch.key = key
149
+      this.getList()
150
+    },
151
+    addMajorProjects () {
152
+      this.$router.push({ name: 'addIndexCase' })
153
+    },
154
+    getList () {
155
+      this.tableData = []
156
+      this.$ajax(this.$api.cms.case.url, {
157
+        method: this.$api.cms.case.method,
158
+        queryData: {
159
+          page: this.postData.currentPage,
160
+          pagesize: this.postData.pageSize,
161
+          caseid: this.tableSearch.caseId,
162
+          name: this.tableSearch.key
163
+        }
164
+      }).then(res => {
165
+        for (let i = 0; i < res.list.length; i++) {
166
+          res.list[i].CreateDate = this.toolClass.dateFormat(res.list[i].CreateDate)
167
+        }
168
+        this.tableData = res.list
169
+        this.postData.total = res.pagenum
170
+        this.postData.currentPage = res.page
171
+      }).catch(msg => {
172
+
173
+      })
174
+    },
175
+    deleteInfo (id) {
176
+      this.$ajax(this.$api.cms.deleteCase.url, {
177
+        method: this.$api.cms.deleteCase.method,
178
+        urlData: {
179
+          id: id
180
+        }
181
+      }).then(res => {
182
+        this.$message({
183
+          type: 'success',
184
+          message: '删除成功!'
185
+        })
186
+        this.getList()
187
+      }).catch(msg => {
188
+
189
+      })
190
+    },
191
+    editIsAllCourse (data) {
192
+      console.log(data)
193
+      let api = data.Status === 1 ? this.$api.cms.caseHide : this.$api.cms.caseShow
194
+      this.$ajax(api.url, {
195
+        method: api.method,
196
+        urlData: {
197
+          id: data.CmsCaseId
198
+        }
199
+      }).then(res => {
200
+        this.$message({
201
+          message: '编辑成功',
202
+          type: 'success',
203
+          duration: 1000
204
+        })
205
+        this.getList()
206
+      }).catch(msg => {
207
+
208
+      })
209
+    },
210
+  }
211
+}
212
+</script>
213
+
214
+<!-- Add "scoped" attribute to limit CSS to this component only -->
215
+<style lang="scss" scoped>
216
+</style>

+ 45
- 49
src/pages/system/newOrder/newOrderList/index.vue View File

@@ -9,8 +9,8 @@
9 9
       <div class="moreFilter"></div>
10 10
     </div>
11 11
     <div class="order-list-box">
12
-      <div v-for="(item,index) in list" :key="index">
13
-        <div class="print-area" :class="'item' + index">
12
+      <div style='position:relative;' v-for="(item,index) in list" :key="index">
13
+        <div>
14 14
           <div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;">
15 15
             <i class="iconfont icon-yinchenglogo" style="font-size:70px;color:red;position: relative;bottom: 20px;margin-right:10px;"></i>
16 16
             <div style="display:inline-block;">
@@ -30,37 +30,27 @@
30 30
               <span style="display:inline-block;width:20%;text-align:right">x 2</span>
31 31
             </div>
32 32
           </div>
33
-          <div style="padding:10px 20px 5px;border-bottom:1px solid #cccccc;">
34
-            <div>卡布奇诺</div>
35
-            <div style="margin-top:8px;">
36
-              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">热</span>
37
-              <span style="display:inline-block;width:20%;text-align:right">x 1</span>
38
-            </div>
39
-            <div style="margin-top:8px;">
40
-              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">冷</span>
41
-              <span style="display:inline-block;width:20%;text-align:right">x 2</span>
42
-            </div>
43
-          </div>
44
-          <div style="padding:10px 20px 5px;border-bottom:1px solid #cccccc;">
45
-            <div>卡布奇诺</div>
46
-            <div style="margin-top:8px;">
47
-              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">热</span>
48
-              <span style="display:inline-block;width:20%;text-align:right">x 1</span>
49
-            </div>
50
-            <div style="margin-top:8px;">
51
-              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">冷</span>
52
-              <span style="display:inline-block;width:20%;text-align:right">x 2</span>
33
+          <div style="padding:10px 20px;border-bottom:1px solid #cccccc">备注:请赶快制作</div>
34
+          <div style="padding:10px 20px;">下单人:xxxxx</div>
35
+        </div>
36
+        <div class="print-area" :class="'item' + index" style="width:180px;">
37
+          <div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;">
38
+            <div style="display:inline-block;">
39
+              <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>
53 43
             </div>
54 44
           </div>
55 45
           <div style="padding:10px 20px 5px;border-bottom:1px solid #cccccc;">
56 46
             <div>卡布奇诺</div>
57 47
             <div style="margin-top:8px;">
58
-              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">热</span>
59
-              <span style="display:inline-block;width:20%;text-align:right">x 1</span>
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>
60 50
             </div>
61 51
             <div style="margin-top:8px;">
62
-              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc">冷</span>
63
-              <span style="display:inline-block;width:20%;text-align:right">x 2</span>
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>
64 54
             </div>
65 55
           </div>
66 56
           <div style="padding:10px 20px;border-bottom:1px solid #cccccc">备注:请赶快制作</div>
@@ -90,7 +80,7 @@ export default {
90 80
         pagesize: 10, // 请求数据量
91 81
       },
92 82
       currentList: [],
93
-      list: [1, 2, 3, 4, 5]
83
+      list: [1]
94 84
     }
95 85
   },
96 86
   components: {
@@ -100,21 +90,43 @@ export default {
100 90
   },
101 91
   methods: {
102 92
     submit (cl) {
103
-      this.printPdf(cl)
93
+      this.$confirm('确定完成此饮品?', '提示', {
94
+        confirmButtonText: '确定',
95
+        cancelButtonText: '取消',
96
+        type: 'warning'
97
+      }).then((res) => {
98
+        // this.printPdf(cl)
99
+      }).catch((res) => {
100
+        this.$message({
101
+          type: 'info',
102
+          message: '已取消'
103
+        })
104
+      })
104 105
     },
105 106
     printPdf (cl) {
106 107
       this.CreateOneFormPage(cl)
107
-      //        LODOP.PRINT();
108
-      LODOP.PREVIEW()
108
+      LODOP.PRINT()
109
+      // LODOP.PREVIEW()
109 110
     },
110 111
     CreateOneFormPage (cl) {
111 112
       LODOP = getLodop()
112 113
       LODOP.PRINT_INIT('订单')
113
-      LODOP.SET_PRINT_PAGESIZE(0, document.getElementsByClassName(cl)[0].offsetWidth * 10 / 4 + 100, document.getElementsByClassName(cl)[0].offsetHeight * 10 / 4 + 120, 'CreateCustomPage')
114
+      LODOP.SET_PRINT_PAGESIZE(3, 480, 40, '')
114 115
       LODOP.ADD_PRINT_HTM(0, 0, document.getElementsByClassName(cl)[0].offsetWidth, document.getElementsByClassName(cl)[0].offsetHeight, document.getElementsByClassName(cl)[0].innerHTML)
115 116
     },
116 117
     cancel () {
117
-
118
+      this.$confirm('确定取消此饮品?', '提示', {
119
+        confirmButtonText: '确定',
120
+        cancelButtonText: '取消',
121
+        type: 'warning'
122
+      }).then((res) => {
123
+        // this.cancel()
124
+      }).catch((res) => {
125
+        this.$message({
126
+          type: 'info',
127
+          message: '已取消'
128
+        })
129
+      })
118 130
     },
119 131
     initWebSocket (code) {
120 132
       const wsuri = `${baseUrl}/websocket/${code}`
@@ -127,23 +139,7 @@ export default {
127 139
       this.websock.onclose = this.websocketclose
128 140
     },
129 141
     websocketonmessage (e) {
130
-      const redata = JSON.parse(e.data)
131
-      if (redata.code === '1') {
132
-        this.$toast({
133
-          message: '核销成功',
134
-          position: 'center',
135
-          duration: 1000
136
-        })
137
-        setTimeout(() => {
138
-          this.$router.go(-1)
139
-        }, 1000)
140
-      } else {
141
-        // this.$toast({
142
-        //   message: redata.message,
143
-        //   position: 'center',
144
-        //   duration: 1000
145
-        // })
146
-      }
142
+      // const redata = JSON.parse(e.data)
147 143
     }
148 144
   }
149 145
 }

+ 6
- 0
src/pages/system/newOrder/newOrderList/page.scss View File

@@ -14,6 +14,12 @@
14 14
     box-shadow: 0px 2px 10px 0px rgba(193, 204, 217, 0.5);
15 15
     padding-bottom: 10px;
16 16
   }
17
+  .print-area{
18
+    position: absolute;
19
+    z-index: -1;
20
+    top: 0;
21
+    left: 0;
22
+  }
17 23
   .btns{
18 24
     display: flex;
19 25
     justify-content: center;

+ 6
- 0
src/pages/system/page.js View File

@@ -80,6 +80,7 @@ import frontEndUserList from './dataStatistics/frontEndUserList/index' // 课程
80 80
 
81 81
 import newOrder from './newOrder/index' // 商品订单系统
82 82
 import newOrderList from './newOrder/newOrderList/index' // 新订单列表
83
+import monthOrder from './newOrder/monthOrder/index' // 月订单列表
83 84
 
84 85
 export default {
85 86
   router: [
@@ -426,6 +427,11 @@ export default {
426 427
           name: 'newOrderList',
427 428
           component: newOrderList,
428 429
           children: []
430
+        }, { // 月订单列表
431
+          path: 'monthOrder',
432
+          name: 'monthOrder',
433
+          component: monthOrder,
434
+          children: []
429 435
         }]
430 436
       }, { // 数据统计
431 437
         path: 'dataStatistics',