Forráskód Böngészése

增加打印按钮

shish 2 hónapja
szülő
commit
5de94f4d7f
1 módosított fájl, 19 hozzáadás és 1 törlés
  1. 19 1
      ghs/src/views/order/components/order-detail.vue

+ 19 - 1
ghs/src/views/order/components/order-detail.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="order-detail">
-		<el-drawer :visible.sync="showOrderDetail" size="1100px" :before-close="closeFn" custom-class="order-draw-wrap" direction="ltr" @close="closeTrigger">
+		<el-drawer :visible.sync="showOrderDetail" size="1050px" :before-close="closeFn" custom-class="order-draw-wrap" direction="ltr" @close="closeTrigger">
 			<div class="order-manage-wrap" v-if="!$util.isEmpty(data)">
 				<div class="card-wrap" style="margin-top:0px;">
 					<div class="card-tit">备注</div>
@@ -36,6 +36,11 @@
 									<span @click="modifyItemRemark(scope.row)" style="cursor: pointer;"><i class="el-icon-edit" style="color:#409eff;font-size:17px;cursor:pointer;" slot="reference"></i>{{ scope.row.remark }}</span>
 								</template>
 							</el-table-column>
+							<el-table-column label="操作">
+								<template slot-scope="scope">
+									<el-button v-if="Number(scope.row.dishNum)>0" @click.stop="printTree(scope.row)" size="small" type="primary" style="margin:0 auto;">打印</el-button>
+								</template>
+							</el-table-column>
 						</el-table>
 					</div>
 				</div>
@@ -75,6 +80,19 @@ export default {
 				})
 			})
 		},
+		printTree(info){
+			this.$service.order.info({ id: info.id,printType:1 }).then(res => {
+				let printData = res.printData ? res.printData : ''
+				let str = res.template ? res.template:''
+				let template = JSON.parse(str)
+				var hiprintTemplate = new hiprint.PrintTemplate({template:template});
+				hiprintTemplate.print(printData)
+				//增加打印次数
+				this.$service.order.addPrintNum({id:info.id}).then(data => {
+					this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name })
+				})
+			})
+		},
 		modifyRemark(){
 			this.$service.order.modifyRemark({ id: this.orderOperate.id,remark:this.data[0].remark }).then(res => {
 				this.$message.success('修改成功')