From f2d05ad289280fec72e58372723db68c6d72a866 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周三, 19 6月 2024 18:43:46 +0800
Subject: [PATCH] PDA问题- 出库执行

---
 yiqi_pda/api/outBound/index.js              |    9 ++++
 yiqi_pda/pages/outBound/index.vue           |   87 ++++++++++++++++++++++++++++++++++++++++---
 yiqi_pda/pages/outBound/modules/content.vue |   23 +++++++++--
 3 files changed, 108 insertions(+), 11 deletions(-)

diff --git a/yiqi_pda/api/outBound/index.js b/yiqi_pda/api/outBound/index.js
index 7d11888..3d531ef 100644
--- a/yiqi_pda/api/outBound/index.js
+++ b/yiqi_pda/api/outBound/index.js
@@ -18,3 +18,12 @@
   })
 }
 
+
+// 鍑哄簱缁熻 /api/pdaservice/getOutBoundWorkPieceInfoCount
+export function getOutBoundWorkPieceInfoCount(data) {
+  return request({
+    url:  `/api/pdaservice/getOutBoundWorkPieceInfoCount`,
+    method: 'post',
+    data
+  })
+}
diff --git a/yiqi_pda/pages/outBound/index.vue b/yiqi_pda/pages/outBound/index.vue
index de99da2..27c1cda 100644
--- a/yiqi_pda/pages/outBound/index.vue
+++ b/yiqi_pda/pages/outBound/index.vue
@@ -1,12 +1,14 @@
 <template>
 	<default-header-page-layout ref="page" title="鍑哄簱鎵ц">
+		
 		<view class="page-frame with-action-user-row" :style="{height:pageBodyHeight+'px'}" v-if="pageBodyHeight">
 			<action-user-row />
-			<view class="with-action-user-row-page-content">
-				<scan-input-form-item  :inputFocus="inputFocus" v-model="OP80NewCode" class="forma-item" label="OP80鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�"  :msg="msg" :msg-type="msgType"
-					@search="onSearchContainter" @clear="onClearContainter" />
+			<scan-input-form-item  :inputFocus="inputFocus" v-model="OP80NewCode" class="forma-item" :label="baseTitile"  :msg="msg" :msg-type="msgType"
+				@search="onSearchContainter" @clear="onClearContainter" />
+			<view class="with-action-user-row-page-content"  >
+				
 			
-			<Content @deleteData="deleteData" :workPieceData="workPieceData" />
+			<Content @deleteData="deleteData" :workPieceData="workPieceData"  />
 			</view>
 			<modalPwd  @reflesh="reflesh" ref="pwdRef"/>
 		</view>
@@ -26,6 +28,7 @@
 	import ScanInputFormItem from './modules/ScanInputFormItem.vue'
 	import Content from './modules/content.vue'
 	import modalPwd from './modules/modalPwd.vue'
+	import Vue from 'vue'
 	import {
 		parseDic,
 		$alert,
@@ -33,7 +36,8 @@
 	} from '@/static/js/utils/index.js'
 	import {
 		getWorkPieceByOP80NewCode,
-		outBoundWorkPiece
+		outBoundWorkPiece,
+		getOutBoundWorkPieceInfoCount
 	} from '@/api/outBound/index.js'
 	import {listbycode} from '@/api/common/index.js'
 	export default {
@@ -47,8 +51,13 @@
 		},
 		data() {
 			return {
+				barHeight: '',
+				ckNumToday:"0",//浠婂ぉ鎬诲嚭搴撴暟
+				baseTitile:'鎵弿鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�',//鎵弿鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�
+				title:'',
 				pageBodyHeight: 0,
 				initInterVal: null,
+				myInterval: null,
 				msg: '',
 				msgType: 'error',
 				OP80NewCode: '',
@@ -59,8 +68,21 @@
 			}
 		},
 		onLoad() {
+			var _this=this;
+			_this._getOutBoundWorkPieceInfoCount();
+			this.myInterval=setInterval(function(){ _this._getOutBoundWorkPieceInfoCount();}, 1000*10);
+			//this.myInterval=setInterval(this.myFun(), 3000);
 		},
 		methods: {
+			// 鑾峰彇宸ヤ欢淇℃伅
+			async _getOutBoundWorkPieceInfoCount(OP80NewCode) {
+				try{
+					let {data}=await getOutBoundWorkPieceInfoCount(null)
+					this.ckNumToday =data;
+				}catch(e){
+				}
+				this.setMsg();
+			},
 			// 鑾峰彇宸ヤ欢淇℃伅
 			async onSearchContainter(OP80NewCode) {
 				this.inputFocus=false
@@ -84,6 +106,11 @@
 					//TODO handle the exception
 					console.log(e);
 				}
+				//this.msg = " 鎵爜鏁�:"+this.workPieceData.length+"    浠婃棩鍑哄簱鏁�:";
+				this.setMsg();
+			},
+			setMsg(){
+				this.msg = " 鎵爜鏁�:"+this.workPieceData.length+"    浠婃棩鍑哄簱鏁�:"+this.ckNumToday;
 			},
 			initFocus(num){
 				setTimeout(()=>{
@@ -107,6 +134,7 @@
 			},
 			deleteData(opt){
 				this.workPieceData=this.workPieceData.filter(item=>item.workPieceID!=opt.workPieceID)
+				this.setMsg();
 			},
 			reflesh(){
 				this.OP80NewCode = ''
@@ -134,6 +162,7 @@
 			/* 椤甸潰鍒濆鍖栬幏鍙栭〉闈ody楂樺害鐨勫畾鏃跺櫒 */
 			startInitInterval(callback) {
 				this.initInterVal = setInterval(() => {
+					//console.log('bbb')
 					if (this.pageBodyHeight) {
 						this.clearInitInterval()
 						callback && callback()
@@ -145,25 +174,71 @@
 			/* 娓呴櫎瀹氭椂鍣� */
 			clearInitInterval() {
 				try {
+					//alert('鎵ц');
 					clearInterval(this.initInterVal)
 					this.initInterVal = null
 				} catch (e) {
 					//TODO handle the exception
 				}
 			},
+			clearInitInterval2() {
+				try {
+					clearInterval(this.myInterval)
+					this.myInterval = null
+				} catch (e) {
+					//TODO handle the exception
+				}
+			},
 			comfirmUpdate() {
 				this.$refs.pwdRef.showModal(this.barDetail);
+			},
+			myFun(){
+				console.log('aaaa')
 			}
 		},
 		onReady() {
+			this.setMsg();
+			
 			this.startInitInterval(() => {
 				/* 椤甸潰鍒濆鍖栧悗闇�瑕佹墽琛岀殑浠g爜鍦ㄨ繖杈硅皟鐢� */
 				// this.listbycode()
+				
 			})
 		},
+		mounted() {
+			// 璁剧疆fixed瀹氫綅
+			//this.barHeight = Vue.prototype.CustomBar || 45
+			this.barHeight =  Vue.prototype.CustomBar
+		},
 		onUnload() {
+			//alert(11); 椤甸潰绂诲紑鏃�
 			this.clearInitInterval()
-		}
+			this.clearInitInterval2();
+		},
+		//鐩戝惉鍘熺敓杩斿洖閿�
+		onBackPress(e) {
+			// 姝ゅ涓�瀹氳return涓簍rue锛屽惁鍒欓〉闈笉浼氳繑鍥炲埌鎸囧畾璺緞
+			if(1!=1){
+				return false //鍙繑鍥�
+			}else{
+				uni.showModal({
+				title: '鎻愮ず',
+				content: '鏄惁纭杩斿洖锛�',
+				showCancel: true,
+				cancelColor: '#333333',
+				success: (res => {
+						if (res.confirm) {
+							uni.redirectTo({
+								url: '/pages/home/index'
+							})
+						} else if (res.cancel) {
+		
+						}
+					})
+				});
+				return true
+			}
+		},
 	}
 </script>
 
diff --git a/yiqi_pda/pages/outBound/modules/content.vue b/yiqi_pda/pages/outBound/modules/content.vue
index 9585b90..23fb066 100644
--- a/yiqi_pda/pages/outBound/modules/content.vue
+++ b/yiqi_pda/pages/outBound/modules/content.vue
@@ -9,7 +9,7 @@
 				<view class="flex_status">{{item.qualityStateName}}</view>
 			</view>
 			<view class="content_flex">
-				<view class="flex_color" style="width: 100%;">宸ヤ欢Id: {{item.workPieceID}}</view>
+				<view class="flex_color" style="width: 100%;">宸ヤ欢鍙�: {{item.workPieceID}}</view>
 				<!-- <view class="flex_color" style="text-align: right;">褰撳墠宸ュ簭: {{item.workingProcedureCurrent}}</view> -->
 			</view>
 			<view class="content_flex">
@@ -19,7 +19,7 @@
 				<view class="flex_color" style="width: 100%;">褰撳墠宸ュ簭: {{item.workingProcedureCurrent}}</view>
 			</view>
 			<view class="content_flex">
-				<view class="flex_color" style="width: 100%;">璁惧Id: {{item.equipmentID}}</view>
+				<view class="flex_color" style="width: 100%;">璁惧缂栧彿: {{item.equipmentID}}</view>
 			</view>
 		</view>
 	</u-swipe-action-item>
@@ -37,7 +37,7 @@
 		data() {
 			return {
 				options: [{
-					text: "鍒犻櫎",
+					text: "绉婚櫎",
 					style: {
 						background: '#F08202'
 					}
@@ -46,8 +46,21 @@
 		},
 		methods:{
 			actionClick(opt){
-				console.log('鍒犻櫎',opt);
-				this.$emit('deleteData',this.workPieceData[opt.name])
+				uni.showModal({
+				title: '鎻愮ず',
+				content: '鏄惁纭绉婚櫎宸ヤ欢鍙�"'+this.workPieceData[opt.name].workPieceID+'"锛�',
+				showCancel: true,
+				cancelColor: '#333333',
+				success: (res => {
+						if (res.confirm) {
+							console.log('绉婚櫎',opt);
+							this.$emit('deleteData',this.workPieceData[opt.name])
+						} else if (res.cancel) {
+						
+						}
+					})
+				});
+				
 			}
 		}
 	}

--
Gitblit v1.9.3