From 2b05362eba2f989b7857349cc9a3a1c12f8181b6 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周五, 26 9月 2025 11:35:50 +0800
Subject: [PATCH] 222

---
 yiqi_pda/pages/outBound/index.vue |  190 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 153 insertions(+), 37 deletions(-)

diff --git a/yiqi_pda/pages/outBound/index.vue b/yiqi_pda/pages/outBound/index.vue
index de99da2..39e268a 100644
--- a/yiqi_pda/pages/outBound/index.vue
+++ b/yiqi_pda/pages/outBound/index.vue
@@ -1,19 +1,22 @@
 <template>
-	<default-header-page-layout ref="page" title="鍑哄簱鎵ц">
+	<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 />
+			<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">
-				<scan-input-form-item  :inputFocus="inputFocus" v-model="OP80NewCode" class="forma-item" label="OP80鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�"  :msg="msg" :msg-type="msgType"
-					@search="onSearchContainter" @clear="onClearContainter" />
-			
-			<Content @deleteData="deleteData" :workPieceData="workPieceData" />
+
+
+				<Content @deleteData="deleteData" :workPieceData="workPieceData" />
 			</view>
-			<modalPwd  @reflesh="reflesh" ref="pwdRef"/>
+			<modalPwd @reflesh="reflesh" ref="pwdRef" />
 		</view>
 		<template v-slot:footer>
 			<view class="bottom-btns-row">
 				<view class="btn-frame right-btn-frame">
-					<u-button :disabled="workPieceData.length<1" type="primary" text="纭鍑哄簱" @click="outBoundConfirm"></u-button>
+					<u-button :disabled="workPieceData.length<1" type="primary" text="纭鍏ュ簱"
+						@click="outBoundConfirm"></u-button>
 				</view>
 			</view>
 		</template>
@@ -26,6 +29,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,9 +37,12 @@
 	} from '@/static/js/utils/index.js'
 	import {
 		getWorkPieceByOP80NewCode,
-		outBoundWorkPiece
+		outBoundWorkPiece,
+		getOutBoundWorkPieceInfoCount
 	} from '@/api/outBound/index.js'
-	import {listbycode} from '@/api/common/index.js'
+	import {
+		listbycode
+	} from '@/api/common/index.js'
 	export default {
 		name: 'baseInPage',
 		components: {
@@ -47,49 +54,98 @@
 		},
 		data() {
 			return {
+				barHeight: '',
+				ckNumToday: "0", //浠婂ぉ鎬诲叆搴撴暟
+				baseTitile: '鎵弿鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�', //鎵弿鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�
+				title: '',
 				pageBodyHeight: 0,
 				initInterVal: null,
+				myInterval: null,
 				msg: '',
 				msgType: 'error',
 				OP80NewCode: '',
-				workPieceData:[],
+				workPieceData: [],
 				workPieceStatus: [],
-				inputFocus:true,
+				inputFocus: true,
 				// codeLength:1
 			}
 		},
 		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
-				this.initFocus(100);
+				//debugger
+				if (OP80NewCode.length != 21) {
+					this.initFocus(100);
+					// uni.showToast({
+					// 	title: '宸ヤ欢鐮佹垨鎴愬搧鐮侀暱搴︿笉姝g‘',
+					// 	icon: 'error',
+					// 	duration: 2000,
+					// 	mask: true
+					// });
+					return;
+				}
+				
+				this.inputFocus = false
 				const param = {
 					OP80NewCode: OP80NewCode
 				}
-				try{
-					let {data}=await getWorkPieceByOP80NewCode(param)
-					if(!this.workPieceData.some(item=>item.workPieceID==data.workPieceID)) {
+				try {
+					let data={};
+					data.addTime = new Date();
+					data.workPieceID=OP80NewCode;
+					data.oP80NewCode=OP80NewCode;
+					if (!this.workPieceData.some(item => item.workPieceID == data.workPieceID)) {
+						data.addTime = new Date();
 						this.workPieceData.push(data)
 					}
+					//椤哄簭璋冭浆锛屾帓搴�
+					this.workPieceData.sort((a, b) => b.addTime - a.addTime);
+
+					this.OP80NewCode = ''; //姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆�
+					this.initFocus(100);
 					//console.log(this.workPieceData,'dsts');
 					// setTimeout(()=>{
 					// 	this.OP80NewCode = '' ;//姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆�
 					// 	this.inputFocus=true
 					// },100)
-				}catch(e){
+				} catch (e) {
 					//debugger
 					this.initFocus(100);
 					//TODO handle the exception
 					console.log(e);
 				}
+				//this.msg = " 鎵爜鏁�:"+this.workPieceData.length+"    浠婃棩鍏ュ簱鏁�:";
+				this.setMsg();
 			},
-			initFocus(num){
-				setTimeout(()=>{
-					this.OP80NewCode = '' ;//姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆�
-					this.inputFocus=true
-				},num)
+			setMsg() {
+				this.msg = " 鎵爜鏁�:" + this.workPieceData.length + "    浠婃棩鍏ュ簱鏁�:" + this.ckNumToday;
+			},
+			initFocus(num) {
+				setTimeout(() => {
+					this.OP80NewCode = ''; //姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆�
+					this.inputFocus = true
+				}, num)
 			},
 			// 鑾峰彇鎵爜闀垮害
 			// async listbycode(){
@@ -100,40 +156,54 @@
 			// 		//TODO handle the exception
 			// 		console.log(e);
 			// 	}
-				
+
 			// },
 			onClearContainter() {
 				this.OP80NewCode = ''
 			},
-			deleteData(opt){
-				this.workPieceData=this.workPieceData.filter(item=>item.workPieceID!=opt.workPieceID)
+			deleteData(opt) {
+				this.workPieceData = this.workPieceData.filter(item => item.workPieceID != opt.workPieceID)
+				this.setMsg();
 			},
-			reflesh(){
+			reflesh() {
 				this.OP80NewCode = ''
-				this.workPieceData=[]
+				this.workPieceData = []
+				setTimeout(() => {
+					this._getOutBoundWorkPieceInfoCount();
+					this.setMsg();
+				}, 1000)
 			},
-			outBoundConfirm(){
+			outBoundConfirm() {
+				this.$refs.pwdRef.showModal(this.workPieceData)
+				
+				/*
 				// 瀛樺湪闈炴垚鍝�
-				const flag=this.workPieceData.some(item=>item.workPieceState!=10)
-				if(flag) {
+				const flag = this.workPieceData.some(item => item.workPieceState != 10)
+				if (flag) {
 					uni.showModal({
-						title:'鎻愮ず',
-						content:'褰撳墠宸ヤ欢瀛樺湪闈炴垚鍝侊紝纭畾寮哄埗鍑哄簱鍚楋紵',
-						success:(value)=>{
-							const {confirm,cancel}=value
-							if(confirm) {
+						title: '鎻愮ず',
+						content: '褰撳墠宸ヤ欢瀛樺湪闈炴垚鍝侊紝纭畾寮哄埗鍏ュ簱鍚楋紵',
+						success: (value) => {
+							const {
+								confirm,
+								cancel
+							} = value
+							if (confirm) {
 								this.$refs.pwdRef.showModal(this.workPieceData)
 							}
 						}
 					})
-				}else{
+				} else {
 					this.$refs.pwdRef.showModal(this.workPieceData)
 				}
 				
+				//*/
+
 			},
 			/* 椤甸潰鍒濆鍖栬幏鍙栭〉闈ody楂樺害鐨勫畾鏃跺櫒 */
 			startInitInterval(callback) {
 				this.initInterVal = setInterval(() => {
+					//console.log('bbb')
 					if (this.pageBodyHeight) {
 						this.clearInitInterval()
 						callback && callback()
@@ -145,25 +215,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>
 

--
Gitblit v1.9.3