shish 1 год назад
Родитель
Сommit
0d57550471
3 измененных файлов с 61 добавлено и 17 удалено
  1. 21 0
      ghs/src/service/live-order/index.js
  2. 1 1
      ghs/src/views/member/list.vue
  3. 39 16
      ghs/src/views/order/live-list.vue

+ 21 - 0
ghs/src/service/live-order/index.js

@@ -40,5 +40,26 @@ export class LiveOrderService extends BaseService {
 		});
 		});
 	}
 	}
 
 
+	printOrder(data) {
+		return this.request({
+			url: '/print-order',
+			params: data
+		});
+	}
+
+	changeDate(data) {
+		return this.request({
+			url: '/change-date',
+			params: data
+		});
+	}
+
+	convertOrder(data) {
+		return this.request({
+			url: '/convert-order',
+			params: data
+		});
+	}
+
 }
 }
 export default new LiveOrderService();
 export default new LiveOrderService();

+ 1 - 1
ghs/src/views/member/list.vue

@@ -483,7 +483,7 @@ export default {
 						},
 						},
 						{
 						{
 							prop: 'seatSnName',
 							prop: 'seatSnName',
-							label: '货位名',
+							label: '货位名',
 							align: 'center',
 							align: 'center',
 							width: 100
 							width: 100
 						},
 						},

+ 39 - 16
ghs/src/views/order/live-list.vue

@@ -25,12 +25,24 @@
             <i class="el-icon-success" style="color:green;font-size:18px;"></i>
             <i class="el-icon-success" style="color:green;font-size:18px;"></i>
           </span>
           </span>
       </template>
       </template>
+      
+      <template #table-column-printOrder="{scope}">
+          <span v-if="scope.row.printOrder==0" @click="printA4(scope.row)" style="cursor: pointer;">
+            打印
+          </span>
+          <span v-else>
+            <i class="el-icon-success" style="color:green;font-size:18px;"></i>
+          </span>
+      </template>
 
 
-      <template #slot-column-option="{scope}">
+      <template #table-column-addTime="{scope}">
+          <i class="el-icon-remove-outline" style="font-size:15px;cursor: pointer;" @click="changeDate(scope.row,0)"></i>
+          <span style="margin-left:10px;margin-right:10px;">{{ scope.row.addTime }}</span>
+          <i class="el-icon-circle-plus-outline" style="font-size:15px;cursor: pointer;" @click="changeDate(scope.row,1)"></i>
+      </template>
 
 
+      <template #slot-column-option="{scope}">
         <el-button @click.stop="showDetail(scope.row)" size="small" type="success">详情</el-button>
         <el-button @click.stop="showDetail(scope.row)" size="small" type="success">详情</el-button>
-        <el-button @click.stop="printOrder(scope.row)" size="small" type="primary" style="margin-left:40px;">打A4</el-button>
-
       </template>
       </template>
 
 
       <template #slot-search-option="{scope}">
       <template #slot-search-option="{scope}">
@@ -45,7 +57,7 @@
       </template>
       </template>
 
 
 			<template #slot-export-order>
 			<template #slot-export-order>
-				<el-button type="primary" size="mini" style="margin-left:10px;" @click="exportData()">导出数据</el-button>
+				<el-button type="primary" size="mini" style="margin-left:50px;" @click="toOrder()">转订单</el-button>
 			</template>
 			</template>
 
 
     </x-crud>
     </x-crud>
@@ -141,6 +153,11 @@ export default {
     })
     })
 	},
 	},
   methods: {
   methods: {
+    changeDate(info,flag){
+      this.$service.liveOrder.changeDate({ id: info.id,flag:flag }).then(res => {
+        this.refreshData()
+      })
+    },
     renewAddCustom(data){
     renewAddCustom(data){
       this.showDetail(data)
       this.showDetail(data)
     },
     },
@@ -193,17 +210,15 @@ export default {
     init() {
     init() {
       this.$store.dispatch('getUsage');
       this.$store.dispatch('getUsage');
     },
     },
-    printOrder(info){
-			this.$service.order.info({ id: info.id }).then(res => {
+    printA4(info){
+			this.$service.liveOrder.printOrder({ id: info.id }).then(res => {
         let printData = res.printData ? res.printData : ''
         let printData = res.printData ? res.printData : ''
         let str = res.template ? res.template:''
         let str = res.template ? res.template:''
         let template = JSON.parse(str)
         let template = JSON.parse(str)
         hiprint.init();
         hiprint.init();
         var hiprintTemplate = new hiprint.PrintTemplate({template:template});
         var hiprintTemplate = new hiprint.PrintTemplate({template:template});
         hiprintTemplate.print(printData)
         hiprintTemplate.print(printData)
-        this.$service.order.addPrintNum({id:info.id}).then(data => {
-          this.refreshData()
-        })
+        info.printOrder = 1
 			})
 			})
     },
     },
 		getStaff(e){
 		getStaff(e){
@@ -222,8 +237,10 @@ export default {
       }
       }
       this.refreshData()
       this.refreshData()
     },
     },
-		exportData(){
-      this.$message.error('开发中')
+		toOrder(){
+      this.$service.liveOrder.convertOrder().then(res => {
+        this.$message.success('提交成功,3分钟后查看订单');
+      })
 		},
 		},
     onLoad({ ctx, app }) {
     onLoad({ ctx, app }) {
       this.app = app;
       this.app = app;
@@ -271,6 +288,12 @@ export default {
                 align: 'center',
                 align: 'center',
                 width: '100'
                 width: '100'
               },
               },
+              {
+                prop: 'switchOrder',
+                label: '已转订单',
+                align: 'center',
+                width: '100'
+              },
               {
               {
                 prop: 'staffName',
                 prop: 'staffName',
                 label: '开单人',
                 label: '开单人',
@@ -278,16 +301,16 @@ export default {
                 width: '120'
                 width: '120'
               },
               },
               {
               {
-                prop: 'switchOrder',
-                label: '已转订单',
+                prop: 'printOrder',
+                label: '打印',
                 align: 'center',
                 align: 'center',
-                width: '100'
+                width: '90'
               },
               },
               {
               {
                 prop: 'addTime',
                 prop: 'addTime',
                 label: '创建时间',
                 label: '创建时间',
                 align: 'center',
                 align: 'center',
-                width: 180
+                width: 210
               },
               },
               {
               {
                 prop: 'updateTime',
                 prop: 'updateTime',
@@ -312,7 +335,7 @@ export default {
             op: {
             op: {
               visible: true,
               visible: true,
               props: {
               props: {
-                width: 350,
+                width: 240,
                 align: 'center',
                 align: 'center',
                 fixed: 'right',
                 fixed: 'right',
                 label: '操作'
                 label: '操作'