shish hace 2 años
padre
commit
58191b4b31
Se han modificado 2 ficheros con 42 adiciones y 11 borrados
  1. 7 1
      ghs/src/service/order/index.js
  2. 35 10
      ghs/src/views/order/list.vue

+ 7 - 1
ghs/src/service/order/index.js

@@ -87,6 +87,12 @@ export class OrderService extends BaseService {
 		return baseUrl + `/order/down?id=${id}&all=${all}&token=${store.state.user.token}`;
 	}
 
-}
+	cloudPrintOrder(data) {
+		return this.request({
+			url: '/cloud-print-order',
+			params: data
+		});
+	}
 
+}
 export default new OrderService();

+ 35 - 10
ghs/src/views/order/list.vue

@@ -66,11 +66,18 @@
       </template>
 
       <template #slot-column-option="{scope}">
+        <el-button v-if="scope.row.status != 1 && scope.row.status != 5" @click.stop="beginPrint(scope.row)" size="small" type="primary">打小票</el-button>
+        <el-button v-else size="small">打小票</el-button>
+
         <el-button v-if="scope.row.status != 1 && scope.row.status != 5" @click.stop="printOrder(scope.row)" size="small" type="primary">打A4</el-button>
-        <el-button v-else disabled size="small">打A4</el-button>
+        <el-button v-else size="small">打A4</el-button>
         <el-button @click.stop="detailShowFn(scope.row)" size="small" type="success">详情</el-button>
-        <el-button @click.stop="down(scope.row)" size="small" type="primary">下载</el-button>
-        <el-button @click.stop="allDown(scope.row)" size="small" type="primary">全部下载</el-button>
+        
+        <el-button @click.stop="down(scope.row)" size="small" type="primary" v-if="scope.row.status!=5 && scope.row.status!=1">下载</el-button>
+        <el-button size="small" v-else>下载</el-button>
+
+        <el-button @click.stop="allDown(scope.row)" size="small" type="primary" v-if="scope.row.status!=5 && scope.row.status!=1 && scope.row.sameTimeIdsNum>1">全部下载</el-button>
+        <el-button size="small" v-else>全部下载</el-button>
       </template>
 
       <template #slot-order-book="{scope}">
@@ -224,6 +231,24 @@ export default {
       // this.$store.dispatch('getCategory');
       this.$store.dispatch('getUsage');
     },
+    beginPrint(item){
+      if(item.printNum && Number(item.printNum)>0){
+          this.$confirm('请检查是否发过货,确认补打?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { 
+            this.printBilling(item)
+          })
+      }else{
+        this.printBilling(item)
+      }
+    },
+    printBilling(item){
+      this.$service.order.cloudPrintOrder({id:item.id}).then(data => {
+          if(data.hasNoPrint && data.hasNoPrint == 1){
+            this.$confirm('请先设置打印小票机', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { })
+          }else{
+            this.$notify({ title: '已打小票', message: '操作成功', type: 'success'})
+          }
+      })
+    },
     printOrder(info){
 			this.$service.order.info({ id: info.id }).then(res => {
         let printData = res.printData ? res.printData : ''
@@ -298,7 +323,7 @@ export default {
                 prop: 'customMobile',
                 label: '手机号',
                 align: 'center',
-                width: '110'
+                width: '100'
               },
               {
                 prop: 'bigNum',
@@ -314,15 +339,15 @@ export default {
               },
               {
                 prop: 'book',
-                label: '预订',
+                label: '预订',
                 align: 'center',
-                width: '70'
+                width: '50'
               },
               {
                 prop: 'sendTimeWant',
                 label: '预订发货',
                 align: 'center',
-                width: '90'
+                width: '75'
               },
               {
                 prop: 'sameTimeIdsNum',
@@ -359,13 +384,13 @@ export default {
                 prop: 'addTime',
                 label: '开单时间',
                 align: 'center',
-                width: 110
+                width: 90
               },
               {
                 prop: 'status',
                 label: '状态',
                 align: 'center',
-                width: 90
+                width: 70
               }
             ],
             on: {
@@ -384,7 +409,7 @@ export default {
             op: {
               visible: true,
               props: {
-                width: 350,
+                width: 430,
                 align: 'center',
                 fixed: 'right',
                 label: '操作'