Browse Source

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

wangfei 6 years ago
parent
commit
1eb6811fe3

+ 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>
@@ -95,7 +85,7 @@ export default {
95 85
         pagesize: 10, // 请求数据量
96 86
       },
97 87
       currentList: [],
98
-      list: [1, 2, 3, 4, 5]
88
+      list: [1]
99 89
     }
100 90
   },
101 91
   components: {
@@ -115,21 +105,43 @@ export default {
115 105
       'GetOrdersList',
116 106
     ]),
117 107
     submit (cl) {
118
-      this.printPdf(cl)
108
+      this.$confirm('确定完成此饮品?', '提示', {
109
+        confirmButtonText: '确定',
110
+        cancelButtonText: '取消',
111
+        type: 'warning'
112
+      }).then((res) => {
113
+        // this.printPdf(cl)
114
+      }).catch((res) => {
115
+        this.$message({
116
+          type: 'info',
117
+          message: '已取消'
118
+        })
119
+      })
119 120
     },
120 121
     printPdf (cl) {
121 122
       this.CreateOneFormPage(cl)
122
-      //        LODOP.PRINT();
123
-      LODOP.PREVIEW()
123
+      LODOP.PRINT()
124
+      // LODOP.PREVIEW()
124 125
     },
125 126
     CreateOneFormPage (cl) {
126 127
       LODOP = getLodop()
127 128
       LODOP.PRINT_INIT('订单')
128
-      LODOP.SET_PRINT_PAGESIZE(0, document.getElementsByClassName(cl)[0].offsetWidth * 10 / 4 + 100, document.getElementsByClassName(cl)[0].offsetHeight * 10 / 4 + 120, 'CreateCustomPage')
129
+      LODOP.SET_PRINT_PAGESIZE(3, 480, 40, '')
129 130
       LODOP.ADD_PRINT_HTM(0, 0, document.getElementsByClassName(cl)[0].offsetWidth, document.getElementsByClassName(cl)[0].offsetHeight, document.getElementsByClassName(cl)[0].innerHTML)
130 131
     },
131 132
     cancel () {
132
-
133
+      this.$confirm('确定取消此饮品?', '提示', {
134
+        confirmButtonText: '确定',
135
+        cancelButtonText: '取消',
136
+        type: 'warning'
137
+      }).then((res) => {
138
+        // this.cancel()
139
+      }).catch((res) => {
140
+        this.$message({
141
+          type: 'info',
142
+          message: '已取消'
143
+        })
144
+      })
133 145
     },
134 146
     initWebSocket (code) {
135 147
       const wsuri = `${baseUrl}/websocket/${code}`
@@ -142,23 +154,7 @@ export default {
142 154
       this.websock.onclose = this.websocketclose
143 155
     },
144 156
     websocketonmessage (e) {
145
-      const redata = JSON.parse(e.data)
146
-      if (redata.code === '1') {
147
-        this.$toast({
148
-          message: '核销成功',
149
-          position: 'center',
150
-          duration: 1000
151
-        })
152
-        setTimeout(() => {
153
-          this.$router.go(-1)
154
-        }, 1000)
155
-      } else {
156
-        // this.$toast({
157
-        //   message: redata.message,
158
-        //   position: 'center',
159
-        //   duration: 1000
160
-        // })
161
-      }
157
+      // const redata = JSON.parse(e.data)
162 158
     }
163 159
   }
164 160
 }

+ 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;

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

@@ -79,6 +79,7 @@ import frontEndUserList from './dataStatistics/frontEndUserList/index' // 课程
79 79
 
80 80
 import newOrder from './newOrder/index' // 商品订单系统
81 81
 import newOrderList from './newOrder/newOrderList/index' // 新订单列表
82
+import monthOrder from './newOrder/monthOrder/index' // 月订单列表
82 83
 
83 84
 import cardAndCouponManager from './cardAndCouponManager/index' // 卡券管理
84 85
 import cardList from './cardAndCouponManager/cardManager/index' // 卡列表