shish 3 лет назад
Родитель
Сommit
f203bbdd42
1 измененных файлов с 41 добавлено и 6 удалено
  1. 41 6
      ghsApp/src/pagesPurchase/info.vue

+ 41 - 6
ghsApp/src/pagesPurchase/info.vue

@@ -236,6 +236,7 @@ import productMins from "@/mixins/product";
 import TuiListCell from "@/components/plugin/list-cell";
 import ModalModule from "@/components/plugin/modal"
 import { print } from '@/api/product';
+import { getPrint } from "@/api/shop";
 export default {
 	name: "info",
 	components: {
@@ -256,7 +257,8 @@ export default {
 			printItemId:0,
 			printType:0,
 			printLabelShow:false,
-			printNum:''
+			printNum:'',
+			wcPrintNum:1
 		};
 	},
 	onPullDownRefresh() {
@@ -266,11 +268,36 @@ export default {
 	},
 	methods: {
 		printBillFn(info){
-			uni.showLoading({mask:true})
-			printBill({id:info.id}).then((res) => {
-				info.printNum++
-				uni.hideLoading()
-			})
+			if(this.wcPrintNum > 1){
+				let arr = ['请选择','机器1']
+				if(this.wcPrintNum == 2){
+					arr = ['请选择','机器1','机器2']
+				}
+				if(this.wcPrintNum == 3){
+					arr = ['请选择','机器1','机器2','机器3']
+				}
+				uni.showActionSheet({
+					itemList: arr,
+					success: function (res) {
+						if(res.tapIndex == 0){
+							return false
+						}
+						let order = res.tapIndex
+						uni.showLoading({mask:true})
+						printBill({id:info.id,order:order}).then((res) => {
+							info.printNum++
+							uni.hideLoading()
+						})
+					}
+				});
+
+			}else{
+				uni.showLoading({mask:true})
+				printBill({id:info.id}).then((res) => {
+					info.printNum++
+					uni.hideLoading()
+				})
+			}
 		},
 		dialogInputConfirm(val) {
 			let that=this;
@@ -384,6 +411,14 @@ export default {
 			}
 			const { data } = await getPurchaseDetailApi(orderSn);
 			this.detailInfo = data;
+
+			let that = this
+			getPrint().then(res=>{
+				if(res.code == 1){
+					that.wcPrintNum = res.data.wcPrintNum ? Number(res.data.wcPrintNum) : 1
+				}
+			})
+
 		}
 	}
 };