From 03627defbc56d0498e7778523da255eb972db6a4 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期四, 04 十二月 2025 10:25:03 +0800
Subject: [PATCH] 删除 安装包

---
 qrcodeScaner/pages/mainView/mainView.vue |  330 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 330 insertions(+), 0 deletions(-)

diff --git a/qrcodeScaner/pages/mainView/mainView.vue b/qrcodeScaner/pages/mainView/mainView.vue
new file mode 100644
index 0000000..c1c5e60
--- /dev/null
+++ b/qrcodeScaner/pages/mainView/mainView.vue
@@ -0,0 +1,330 @@
+<template>
+  <view>
+	<uni-section class="mb-10" :title="'鐢ㄦ埛鍚嶇О锛�'+store.user.userName">
+	  <template v-slot:right>
+	    鐝粍锛歿{store.user.address || ''}}
+	  </template>
+	</uni-section>
+	</view>
+  <view class="content">
+		
+		<uni-row>
+							<uni-col :span="12">
+								<button @click="scannerGetGlassInfo" type="primary" size="mini">鐜荤拑淇℃伅</button>
+							</uni-col>
+							<uni-col :span="12">
+							  <button @click="scanerCode" type="primary" size="mini">鎵爜鎶ュ伐</button>
+							</uni-col>
+					     <uni-col :span="12">
+					      <button  type="primary" size="mini" @click="quantityCompletion1">褰撶彮浜ч噺</button>
+					    </uni-col>
+							<uni-col :span="12">
+								<navigator  url="/pages/ReportingWorkList/ReportingWorkList" open-type="navigate" >
+									<button type="primary" size="mini">鎶ュ伐璁板綍</button>
+								</navigator>
+							 </uni-col>
+							 
+							 
+							 <uni-col :span="12">
+							 	<button @click="glassFinishToStore" type="primary"  size="mini">鎴愬搧鍏ュ簱</button>
+							 </uni-col>
+							 <uni-col :span="12">
+							   <button  type="primary" size="mini">鎴愬搧鍑哄簱</button>
+							 </uni-col>
+							 
+							 
+					   <!-- <uni-col :span="24" v-if="store.user.permissions.includes('qualityInspectionReview.edit')">
+								<navigator url="/pages/ReviewReporitingWork/ReviewReporitingWork" open-type="navigate">
+										<button type="primary" size="mini">璐ㄦ瀹℃牳</button>
+								</navigator>
+					    </uni-col> -->
+							<!-- <uni-col :span="24">
+								<uni-data-select
+									placeholder="鎶ヨ〃"
+									v-model="report"
+									:localdata="reports"
+									@change="changePage"
+								></uni-data-select>
+							</uni-col> -->
+							
+							<uni-col :span="12">
+								<uni-data-select
+									placeholder="宸ュ簭"
+									v-model="process"
+									:disabled="flag"
+									:localdata="processList"
+									@change="changeProcess"
+								></uni-data-select>
+							</uni-col>
+							
+							<uni-col :span="12">
+								<uni-data-select
+									placeholder="璇烽�夋嫨璁惧"
+									v-model="device"
+									:localdata="store.deviceList"
+									@change="change"
+								></uni-data-select>
+							</uni-col>
+					    <uni-col :span="24">
+					      <navigator url="/pages/index/index" open-type="reLaunch">
+					        <button type='warn' size="mini">閫�鍑�</button>
+					      </navigator>
+					    </uni-col>
+					  </uni-row>
+		
+  	<!-- <view class="text-area">
+  		
+  	</view> -->
+		<view>
+			<!-- 鎻愮ず淇℃伅寮圭獥 -->
+			<uni-popup ref="message" type="message">
+				<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
+			</uni-popup>
+		</view>
+  </view>
+    
+	
+</template>
+
+<script setup>
+import userInfo from '@/stores/userInfo'
+import { onLoad } from '@dcloudio/uni-app'
+	import request from '@/utils/request'
+	import mpaasScan from '@/utils/scanner.js'
+import { ref, watch,onUnmounted, warn } from 'vue'
+	const store=userInfo()
+	const message= ref(null)
+	const type=ref('center')
+	const msgType=ref(null)
+	const messageText=ref('')
+	let device = ref(null)
+	let report = ref(null)
+	const reports = ref([
+		{value:'orderList',text:'璁㈠崟鎶ヨ〃'},
+		{value:'deliveryList',text:'鍙戣揣鎶ヨ〃'},
+		{value:'originalGlassList',text:'鍘熺墖搴撳瓨'}
+	])
+	
+	let process = ref(null)
+	let processList = ref([])
+	let flag = ref(false)
+	
+	
+	const Intent = plus.android.importClass('android.content.Intent')
+	const IntentFilter = plus.android.importClass('android.content.IntentFilter')
+	
+	const main = plus.android.runtimeMainActivity()
+	// pda瀹氫箟鐨勫箍鎾悕绉�
+	const SCANACTION = "android.intent.ACTION_SCAN_OUTPUT"
+	
+	var filter = new IntentFilter()
+	filter.addAction(SCANACTION)
+	
+	// 鎺ユ敹
+	var receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
+	    onReceive: onReceive
+	})
+	
+	function onReceive(context, intent) {
+		const page =getCurrentPages()[getCurrentPages().length - 1]
+		//鍒ゆ柇褰撳墠椤甸潰鏄惁鍦ㄤ富椤�
+		if(page.route!=='pages/mainView/mainView'){
+			return
+		}
+	    if (intent.getAction() === SCANACTION) {
+	        const code = intent.getStringExtra("barcode");
+					uni.navigateTo({
+					 	url: `/pages/glassInfo/glassInfo?projectNo=${code}`
+					 }) 
+	        // 鎵弿淇℃伅澶勭悊
+	        //uni.$emit('scan', code)
+	    }
+	}
+	const getDeviceList = async()=> {
+		if(store.choiceDevice.value!=null){
+			device.value = store.choiceDevice.value
+			return
+		}
+		await request.post(`/reportingWork/selectEquipmentByProcess/${process.value}`).then((res) => {
+			if(res.code==='200'){
+				let deviceList = []
+				res.data.forEach((item,index)=>{
+							deviceList.push({
+								value:item['id'],
+								text:item['basicName']
+							})
+							
+				})
+				store.deviceList = deviceList
+			}
+		})
+	}
+	
+	const getProcessList = async()=> {
+		const regex =/^\s*$/
+		//褰撳伐搴忎负绌烘椂鍒欒繘琛屾煡璇㈠伐搴�
+		if(!(store.user.address == null || regex.test(store.user.address))){
+			return 
+		}
+		request.get(`/basicData/BasicDataByType/product/process`).then(res => {
+			let processArr = []
+			res.data.forEach((item,index)=>{
+						processArr.push({
+							value:item['basicName'],
+							text:item['basicName']
+						})
+						
+			})
+			processList.value = processArr
+		})
+	}
+	
+	const changeProcess = () => {
+		
+		store.deviceList = []
+		device.value = null
+		if(process.value == null || process.value=="" ) return
+		getDeviceList()
+	}
+	
+	
+	const change = (e) => {
+		store.deviceList.forEach((item,index)=>{
+			if(item.value===e){
+				store.choiceDevice = item
+			}
+		}) 
+	}
+	
+	
+	onLoad(async (option)=>{
+		if(store.user.userName === null){
+			uni.reLaunch({
+			  url: `/pages/index/index`
+			})
+			return
+		}
+		if(store.user.address == null || store.user.address==""){
+			await getProcessList()
+		}else{
+			flag.value = true
+			process.value = store.user.address
+			await getDeviceList()
+		}
+		
+		
+		main.registerReceiver(receiver, filter)
+		//鍒ゆ柇鏄惁鏄姤宸ュ悗杩斿洖
+			/* if(!option.state){
+				return
+			}
+			msgType.value = option.state */
+			
+	})
+	onUnmounted(()=>{
+		main.unregisterReceiver(receiver); 
+	})
+	/* watch(msgType,(newVal)=>{
+		switch (newVal) {
+		  case 'success':  
+					setTimeout(()=>{
+						messageToggle(msgType,'鎶ュ伐鎴愬姛')
+					},500)
+					
+		  break;
+		}
+	}) */
+	
+	
+	const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
+	const scannerGetGlassInfo = () =>{
+		if(uni.getSystemInfoSync().platform==='android'){
+			
+			mpaasScan().then(val => {
+				uni.navigateTo({
+						url: `/pages/glassInfo/glassInfo?projectNo=${val}`
+				})
+			})
+			
+		}else{
+			uni.navigateTo({
+				url: `/pages/glassInfo/glassInfo?projectNo=25031302009005`
+			})
+		}
+	} 
+		
+	const scanerCode = () => {
+		if(device.value === null){
+			messageToggle('warn','鏈�夋嫨璁惧锛岃閫夋嫨鎶ュ伐璁惧锛�')
+			return
+		}
+		
+		if(uni.getSystemInfoSync().platform==='android'){
+			mpaasScan().then(val => {
+				uni.navigateTo({
+									url: `/pages/reportingWork/reportingWork?processId=${val}&process=${process.value}`
+				})
+			})
+			
+						
+		}else{
+      uni.navigateTo({
+        url: `/pages/reportingWork/reportingWork?processId=NG24111542A012/1`
+      })
+		}
+	}
+	
+	const glassFinishToStore = () => {
+		mpaasScan().then(val => {
+			uni.navigateTo({
+					url: `/pages/glassFinishToStore/glassFinishToStore?processId=${val}`
+			})
+		})
+	}
+	
+	
+
+	
+	
+	//鎵撳紑鎻愮ず妗�
+	const messageToggle = (type,msg) => {
+		msgType.value = type
+		messageText.value = msg
+		message.value.open()
+	}
+	
+	//鎵撳紑褰撶彮浜ч噺
+	const quantityCompletion1 = () => {
+		uni.navigateTo({
+		  url: `/pages/QuantityCompletion/QuantityCompletion`
+		})
+	}
+	
+	const changePage = () => {
+		uni.navigateTo({
+		  url: `/pages/statement/${report.value}`
+		})
+	}
+		
+</script>
+
+<style>
+	 
+   .uni-col {
+     margin-bottom: 20px;
+     text-align: center;
+   }
+	 .content {
+	 	display: flex;
+	 	flex-direction: column;
+	 	align-items: center;
+	 	justify-content: center;
+	 }
+	 
+	 .text-area {
+	 	display: flex;
+	 	justify-content: center;
+	 	padding-bottom: 1rem;
+		margin-top: -10rem;
+	 }
+</style>

--
Gitblit v1.8.0