shish пре 3 година
родитељ
комит
a11b98317e
1 измењених фајлова са 58 додато и 12 уклоњено
  1. 58 12
      ghsApp/src/pagesPurchase/info.vue

+ 58 - 12
ghsApp/src/pagesPurchase/info.vue

@@ -211,16 +211,31 @@
 			<view v-if="detailInfo.status == 3" @click="changePrice()" class="admin-button-com big blue" style="margin-right:45upx;margin-left:55upx;">入库和改价</view>
 		</view>
 
+		<modal-module :show="printLabelShow" @click="dialogInputConfirm" :maskClosable="true" title="数量" padding="30rpx 30rpx" >
+		<template v-slot:content>
+			<div class="app-modal-input-wrap">
+			<div class="inp-list-line">
+				<div class="line-input">
+				<input type="number" ref="input" style="width:61.8%;text-align:center;" v-model="printNum" :adjust-position="false" class="inp-input" @focus="printNum=''" />
+				</div>
+			</div>
+			</div>
+		</template>
+		</modal-module>
+
 	</view>
 </template>
 <script>
 import { getPurchaseDetailApi,updateRemark,printAll,printItem,confirmPutIn,cancelPutIn } from "@/api/purchase";
 import productMins from "@/mixins/product";
 import TuiListCell from "@/components/plugin/list-cell";
+import ModalModule from "@/components/plugin/modal"
+import { print } from '@/api/product';
 export default {
 	name: "info",
 	components: {
-		TuiListCell
+		TuiListCell,
+		ModalModule
 	},
 	mixins: [productMins],
 	data() {
@@ -232,7 +247,11 @@ export default {
 				name: ""
 			},
 			detailInfo: {},
-			loading: false
+			loading: false,
+			printItemId:0,
+			printType:0,
+			printLabelShow:false,
+			printNum:''
 		};
 	},
 	onPullDownRefresh() {
@@ -241,6 +260,43 @@ export default {
 		})
 	},
 	methods: {
+		dialogInputConfirm(val) {
+			let that=this;
+			if (val.index == 0) {
+				that.printLabelShow = false
+				return
+			}
+			let currentNum = this.printNum
+			let itemId = this.printItemId
+			if (currentNum == null) {
+				that.$msg('请填写数量')
+				return
+			}
+			if (currentNum <= 0) {
+				that.$msg('数量不能小于1')
+				return
+			}
+			if (itemId == 0) {
+				that.$msg('打印的花材id出错')
+				that.printLabelShow = false
+				return
+			}
+			print({id:itemId,num:currentNum,type:this.printType}).then(res=>{
+				if(res.code == 1){
+					that.printLabelShow = false
+					uni.showToast({ title: '操作成功', duration: 1500 })
+				} else if(res.code == 0){
+					that.printLabelShow = false
+					that.$msg(res.msg)
+				}
+			})
+		},
+		printLabel(item,type){
+			this.printType = type
+			this.printItemId = item.itemId
+			this.printLabelShow = true
+			this.printNum = item.itemNum
+		},
 		changePrice(){
 			this.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+this.detailInfo.orderSn+"&id="+this.detailInfo.id+"&status="+this.detailInfo.status})
 		},
@@ -273,16 +329,6 @@ export default {
 		goRefund(info){
 			this.$util.pageTo({url:'/pagesPurchase/refund?orderSn='+info.orderSn})
 		},
-		printLabel(item,type){
-			let that = this
-			that.$util.confirmModal({content:'确认打印'},() => {
-				printItem({id:item.id,type:type}).then(res=>{
-					if(res.code == 1){
-						that.$msg(res.msg)
-					}	
-				})
-			})
-		},
 		printAllLabel(item,type){
 			let that = this
 			that.$util.confirmModal({content:'确认打印'},() => {