shish 2 лет назад
Родитель
Сommit
94176251b6

+ 7 - 0
ghs/src/service/purchase-order/index.js

@@ -2,6 +2,13 @@ import { BaseService, Service } from '@/cool';
 @Service('purchase-order')
 export class PurchaseOrderService extends BaseService {
 
+	addPrintNumFn(data){
+		return this.request({
+			url: '/add-print-num',
+			params: data
+		});		
+	}
+
 	printPaper(data){
 		return this.request({
 			url: '/print-paper',

+ 4 - 4
ghs/src/views/in/change.vue

@@ -58,11 +58,11 @@
 
 
 
-				<el-button type="primary" @click="printOrder()" v-if="info.status != 5">打小票</el-button>
-				<el-button disabled v-else>打小票</el-button>
+				<el-button type="primary" @click="printOrder()" v-if="info.status != 5">打小票({{ info.printNum }})</el-button>
+				<el-button disabled v-else>打小票({{ info.printNum }})</el-button>
 
-				<el-button type="primary" @click="printPaper()" v-if="info.status != 5">打多联</el-button>
-				<el-button disabled v-else>打多联</el-button>
+				<el-button type="primary" @click="printPaper()" v-if="info.status != 5">打多联({{ info.printNum }})</el-button>
+				<el-button disabled v-else>打多联({{ info.printNum }})</el-button>
 
 				<el-button @click="goBackFn" plain>返回</el-button>
 

+ 31 - 9
ghs/src/views/in/list.vue

@@ -91,11 +91,11 @@
 
         <el-button @click.stop="detailShowFn(scope.row)" size="small" type="success">详情</el-button>
 
-        <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打多联</el-button>
-        <el-button @click.stop="printPaper(scope.row)" size="small" type="primary" v-else>打多联</el-button>
+        <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打多联({{ scope.row.printNum }})</el-button>
+        <el-button @click.stop="printPaper(scope.row)" size="small" type="primary" v-else>打多联({{ scope.row.printNum }})</el-button>
 
-        <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打小票</el-button>
-        <el-button @click.stop="printOrder(scope.row)" size="small" type="primary" v-else>打小票</el-button>
+        <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打小票({{ scope.row.printNum }})</el-button>
+        <el-button @click.stop="printOrder(scope.row)" size="small" type="primary" v-else>打小票({{ scope.row.printNum }})</el-button>
 
         <el-button @click.stop="cancelOrder(scope.row)" size="small" type="primary" v-if="scope.row.status == 3 || scope.row.status == 2 || scope.row.status == 1">取消</el-button>
         <el-button size="small" v-else>取消</el-button>
@@ -252,19 +252,41 @@ export default {
       this.$router.push({path:'/in/change',query})
     },
     printPaper(info){
-			this.$service.purchaseOrder.printPaper({ id: info.id }).then(res => {
+      if(info.printNum>1){
+        this.$confirm('已打过,确认要补打?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+          this.toPrint(info)
+        })
+      }else{
+        this.toPrint(info)
+      }
+    },
+    toPrint(info){
+        this.$service.purchaseOrder.printPaper({ id: info.id }).then(res => {
         let printData = res.printData ? res.printData : ''
         let str = res.template ? res.template : ''
         let template = JSON.parse(str)
         hiprint.init();
         var hiprintTemplate = new hiprint.PrintTemplate({template:template});
         hiprintTemplate.print(printData)
-			})
+			  })
+        this.$service.purchaseOrder.addPrintNumFn({id:info.id}).then(data => {
+          info.printNum++
+        })
     },
     printOrder(item){
-      this.$service.purchaseOrder.printBill({id:item.id}).then(data => {
+      if(item.printNum>1){
+        this.$confirm('已打过,确认要补打?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+          this.$service.purchaseOrder.printBill({id:item.id}).then(data => {
+            item.printNum++
+            this.$notify({ title: '已打印', message: '操作成功', type: 'success'})
+          })
+        })
+      }else{
+        this.$service.purchaseOrder.printBill({id:item.id}).then(data => {
+          item.printNum++
           this.$notify({ title: '已打印', message: '操作成功', type: 'success'})
-      })
+        })
+      }
     },
     cancelOrder(item){
 			this.$confirm('确认取消?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
@@ -387,7 +409,7 @@ export default {
             op: {
               visible: true,
               props: {
-                width: 410,
+                width: 420,
                 align: 'center',
                 fixed: 'right',
                 label: '操作'

+ 2 - 2
ghs/vue.config.js

@@ -3,13 +3,13 @@ const path = require('path');
 const isProduction = process.env.NODE_ENV === 'production';
 
 //http和https切换请修改这里,修改后需要重新运行npm run serve shish 2021.4.12
-const proxyTarget = 'https://api.shop.wixhb.com';
+const proxyTarget = 'http://api.shop.hzghd.com';
 
 function resolve(dir) {
 	return path.join(__dirname, dir);
 }
 
-let hostUrl = 'https://img.wixhb.com/';
+let hostUrl = 'http://img.hzghd.com/';
 
 const cdn = {
 	dev: {

+ 3 - 3
ghsApp/src/config.js

@@ -1,4 +1,4 @@
 export const ProjectName = 'ghs'
-export const APIHOST = 'https://api.shop.wixhb.com'
-export const IMGHOST = 'https://img.wixhb.com'
-export const CURRENT_ENV = 'production'
+export const APIHOST = 'https://api.shop.hzghd.com'
+export const IMGHOST = 'https://img.hzghd.com'
+export const CURRENT_ENV = 'dev'

+ 8 - 7
ghsApp/src/manifest.json

@@ -62,7 +62,7 @@
                     "entitlements" : {
                         "com.apple.developer.associated-domains" : [ "applinks:fronttg.wixhb.com" ]
                     }
-                }
+                }          
             },
             /* SDK配置 */
             "sdkConfigs" : {
@@ -172,19 +172,20 @@
     "quickapp" : {},
     /* 小程序特有相关 线上(销花宝) wxcf32b3f0684c2433 开发(花掌柜) wx21b7c3ef12082099 */
     "mp-weixin" : {
-        "appid" : "wxcf32b3f0684c2433",
+        "appid" : "wx21b7c3ef12082099",
         "setting" : {
             "urlCheck" : false
         },
-        "optimization" : {
-            "subPackages" : true
-        },
         "usingComponents" : true,
         "permission" : {
             "scope.userLocation" : {
                 "desc" : "请点击确定"
             }
-        }
+        },
+        "optimization" : {
+            "subPackages" : true
+        },
+        "lazyCodeLoading":"requiredComponents"
     },
     "mp-alipay" : {
         "usingComponents" : true
@@ -213,7 +214,7 @@
             "port" : 81,
             "proxy" : {
                 "/api" : {
-                    "target" : "http://api.shop.wixhb.com",
+                    "target" : "http://api.shop.hzghd.com",
                     "secure" : false,
                     "changeOrigin" : true,
                     "pathRewrite" : {