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/reportingWork/reportingWork - 副本.vue |  612 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 612 insertions(+), 0 deletions(-)

diff --git "a/qrcodeScaner/pages/reportingWork/reportingWork - \345\211\257\346\234\254.vue" "b/qrcodeScaner/pages/reportingWork/reportingWork - \345\211\257\346\234\254.vue"
new file mode 100644
index 0000000..ed0efbb
--- /dev/null
+++ "b/qrcodeScaner/pages/reportingWork/reportingWork - \345\211\257\346\234\254.vue"
@@ -0,0 +1,612 @@
+<template>
+	<view class='main'>
+    
+		<view class="flex-item title_main">
+			<uni-section :title="'娴佺▼鍗″彿:'+processId" type="line">
+				<template v-slot:right>
+									<button @click='reviewReportForWork' v-if='!reportState' size='mini'>瀹℃牳</button>
+									<button :loading="buttonLoading" @click="saveReportForWork" v-if='reportState'  size='mini'>鎶ュ伐</button>
+				</template>
+			</uni-section>
+			
+			
+			
+		</view>
+		<view class="flex-item table_main">
+			<uni-table  border stripe  style='width:100%;overflow-y: auto;'>
+				<uni-tr>
+						<uni-th width='48' align="center">搴忓彿</uni-th>
+						<uni-th width='48' align="center">灏忕墖</uni-th>
+						<uni-th width='50' align="center">瀹�</uni-th>
+						<uni-th width='50' align="center">楂�</uni-th>
+						<uni-th width='50' align="center">鎬绘暟</uni-th>
+						<uni-th 
+						@click="cleanAllFinish" 
+						width='50' 
+						align="center" 
+						style="background-color: #409eff;color: black;"
+						>瀹屽伐</uni-th>
+						<uni-th width='50' align="center">娆$牬</uni-th>
+				</uni-tr>
+					
+				<uni-tr v-for="(item,index) in processList">
+						<uni-td>{{item.order_number}}</uni-td>
+						<uni-td>{{item.technology_number}}</uni-td>
+						<uni-td>{{item.child_width}}</uni-td>
+						<uni-td>{{item.child_height}}</uni-td>
+						<uni-td>{{item.quantity}}</uni-td>
+						<uni-td>
+							<!-- @keyboardheightchange  @blur-->
+							<input type="number" v-model='item.completedQuantity'
+								:disabled="!reportState"
+								@confirm="changeFinishNum(item)"
+								@blur="changeFinishNum(item)"
+							/>
+						</uni-td>
+						<uni-td>
+							<input type="number" v-model='item.breakageQuantity'
+								@confirm='changeBreakNum(item,index)'
+								@blur="changeBreakNum(item,index)"
+								:disabled="!reportState"
+							/>
+						</uni-td>
+				</uni-tr>
+			</uni-table>
+		</view>
+		<!-- <view class="flex-item uni-bg-blue">C</view> -->  
+		
+	</view>
+	
+	<!-- 娆$牬寮瑰嚭灞� -->
+	<uni-popup class='breakInfo' ref="popup" :mask-click="false" >
+		<view class="flex-item foot_main">
+			<uni-row>
+				<uni-col class='break_col' :span='24' >绗瑊{damageShowRow}}琛�</uni-col>
+			</uni-row>
+			<uni-row>
+				<uni-col class='break_col' :span='8' >娆$牬绫诲瀷:</uni-col>
+				<uni-col class='break_col' :span='16'>
+					<uni-data-select
+					       v-model="damageDetail.breakageType"
+					       :localdata="breakageType"
+					     />
+				</uni-col>
+			</uni-row>
+			<uni-row>
+				<uni-col class='break_col' :span='8' >娆$牬鍘熷洜:</uni-col>
+				<uni-col class='break_col' :span='16' >
+					<uni-data-select
+								 v-model="damageDetail.breakageReason"
+								 :localdata="breakageReason"
+							 />
+				</uni-col>
+			</uni-row>
+			<uni-row>
+				<uni-col class='break_col' :span='8' >璐d换宸ュ簭:</uni-col>
+				<uni-col class='break_col' :span='16'>
+					<uni-data-select
+					       v-model="damageDetail.responsibleProcess"
+					       :localdata="responsibleProcess"
+								 @change='changeResponsibleProcess'
+					     />
+				</uni-col>
+			</uni-row>
+			<uni-row>
+				<uni-col class='break_col' :span='8' >璐d换璁惧:</uni-col>
+				<uni-col class='break_col' :span='16'>
+					<uni-data-select
+					       v-model="damageDetail.responsibleEquipment"
+					       :localdata="responsibleEquipment"
+					     />
+				</uni-col>
+			</uni-row>
+			<uni-row>
+				<uni-col class='break_col' :span='8' >璐d换鐝粍:</uni-col>
+				<uni-col class='break_col' :span='16'>
+					<uni-data-select
+					       v-model="damageDetail.responsibleTeam"
+					       :localdata="responsibleTeam"
+					     />
+				</uni-col>
+			</uni-row>
+			<uni-row>
+				<uni-col class='break_col' :span='8' >鍙埄鐢�:</uni-col>
+				<uni-col class='break_col' :span='16'>
+					 <checkbox-group @change='changeAvailable($event)'>
+					   <checkbox :value="1" />
+					 </checkbox-group>
+				</uni-col>
+			</uni-row>
+			<uni-row>
+				<uni-col class='break_col' :span='8' >杩斿洖宸ュ簭:</uni-col>
+				<uni-col class='break_col' :span='16'>
+					 <uni-data-select
+					        v-model="damageDetail.returnProcess"
+					        :localdata="backProcess"
+					      />
+				</uni-col>
+			</uni-row>
+			<uni-row>
+				<uni-col class='break_col' :span='8' >璐d换淇℃伅:</uni-col>
+				<uni-col class='break_col' :span='16'>
+					<input v-model="damageDetail.responsiblePersonnel" />
+				</uni-col>
+			</uni-row>
+		</view>
+		<view>
+			
+			<uni-row>
+				<uni-col :span='12'>
+					<button @click="close(0)">鍙栨秷</button>
+				</uni-col>
+				<uni-col :span='12'>
+					<button type="primary" @click="close(1)">纭畾</button>
+				</uni-col>
+			</uni-row>
+		</view>
+	</uni-popup>
+	
+	<!-- 鎻愮ず寮圭獥 -->
+	<view>
+		<!-- 鎻愮ず绐楃ず渚� -->
+		<uni-popup ref="alertDialog" type="dialog">
+			<uni-popup-dialog type="warn" 
+				cancelText="鍐嶆鎶ュ伐" 
+				confirmText="纭瀹屾垚" 
+				title="閫氱煡" 
+				content="娴佺▼鍗℃暟閲忚繕鏈叏閮ㄦ姤瀹�!" 
+				@confirm="dialogConfirm"
+				@close="dialogClose" />
+		</uni-popup>
+	</view>
+	<view>
+		<!-- 鎻愮ず淇℃伅寮圭獥 -->
+		<uni-popup ref="message" type="message">
+			<uni-popup-message :type="msgType" :message="messageText" :duration="3000"></uni-popup-message>
+		</uni-popup>
+	</view>
+</template>
+
+<script setup>
+import { computed, onMounted,ref, watch } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+import userInfo from '@/stores/userInfo'
+import request from '@/utils/request'
+	const store=userInfo()
+  let processId = ref(null)
+	let process = ref(null)
+	let reportState = ref(false)
+	let damageShowFlag = ref(false)
+	let damageShowRow = ref(0)
+	let processTitle = ref(null)
+	let processList = ref([])
+	let buttonLoading = ref(true)
+	const alertDialog = ref(null)
+	const message = ref(null)
+	const popup = ref(null)
+	const type=ref('center')
+	const msgType=ref('success')
+	const messageText=ref('')
+	
+	//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
+	const titleSelectJson = ref({
+	  historyDevice:[],
+	  historyTeams:[],
+	  historyProcess:[],
+	  breakageType:[],
+	  breakageReason:[]
+	})
+
+	//瀹氫箟鐮存崯鏄庣粏	
+	const damageDetail = ref({
+		breakageQuantity: null,//鐮存崯鏁伴噺
+		available: null,//鍙埄鐢�
+		returnProcess: null,//杩斿洖宸ュ簭
+		breakageType: null,//鐮存崯绫诲瀷
+		breakageReason: null,//鍘熷洜
+		responsibleProcess: null,//璐d换宸ュ簭
+		responsibleEquipment: null,//璐d换璁惧
+		responsibleTeam: null,//璐d换鐝粍
+		responsiblePersonnel: null//璐d换淇℃伅
+	})
+	
+
+	
+	onLoad(async (option)=>{
+		processId.value = option.processId
+		process.value = option.process
+		await getProcessCardList(option.processId,option.process)
+		buttonLoading.value = false
+		if(store.choiceDevice.value===null){
+			messageToggle('warn','鏈�夋嫨璁惧锛屾姤宸ヨ澶囧皢浠ユ墜鏈哄舰寮忔姤宸ワ紒')
+		}
+	})
+	//鏌ヨ娴佺▼鍗�
+	const getProcessCardList = (processId,process1) => {
+		const processIdList = processId.split('/')
+		const reportType = 2//鎶ュ伐鏄惁鏌ヨ鏍峰搧璁㈠崟2鏌ヨ锛�1涓嶆煡璇�
+		request.post(`/reportingWork/addSelectLastWork/${processIdList[0]}/${processIdList[1]}/${process1}/${reportType}`)
+		.then((res) => {
+		    if (res.code == 200) {
+					processList.value = res.data.Detail
+					res.data.data.processId = processId
+					processTitle.value = res.data.data
+					//鍘嗗彶鐝粍
+					titleSelectJson.value.historyTeams= res.data.historyTeams
+					titleSelectJson.value.historyTeams.unshift(
+						{
+							basic_name:store.user.userName,
+							process:process.value
+						}
+					) 
+					//鍘嗗彶璁惧
+					titleSelectJson.value.historyDevice = res.data.historyDevice
+					//鍘嗗彶宸ュ簭
+					titleSelectJson.value.historyProcess =  res.data.historyProcess
+					//娆$牬绫诲瀷
+					titleSelectJson.value.breakageType =  res.data.breakageType
+					//娆$牬鍘熷洜
+					titleSelectJson.value.breakageReason =  res.data.breakageReason
+					if(res.data.data.reviewedState==1){
+						reportState.value=true
+					}
+		    }
+		}).catch(err => {
+			uni.showModal({
+				title: '鎻愮ず',
+				content: err,
+				showCancel:false
+			});
+		})
+	}
+	//鎶ュ伐淇濆瓨
+	const saveReportForWork = () => {
+		if(finishNum.value===0){
+			messageToggle('error','瀹屽伐鏁伴噺鎴栨鐮存暟閲忚嚦灏戝ぇ浜�0')
+			return
+		}
+		let notSame = null
+		
+		for(let i in processList.value){
+			if(processList.value[i].breakageQuantity!== undefined && processList.value[i].breakageQuantity!==null && processList.value[i].breakageQuantity!==''){
+				if(processList.value[i].damageDetails === undefined){
+					messageToggle('error',`搴忓彿'${processList.value[i].order_number}'鏈娴嬪埌娆$牬鏁版嵁`)
+					return
+				}else{
+					if(processList.value[i].damageDetails[0].breakageQuantity*1!==processList.value[i].breakageQuantity*1){
+						messageToggle('error',`搴忓彿'${processList.value[i].order_number}'娆$牬鏁伴噺涓嶅尮閰峘)
+						return
+					}
+				}
+			}else{
+				delete processList.value[i].breakageQuantity
+			}
+			
+			
+		}
+		
+		
+		const hasConflict = processList.value.some((item, index) => {
+		    // 妫�鏌ュ綋鍓嶅厓绱犱箣鍚庢槸鍚︽湁鐩稿悓 id 浣嗕笉鍚� num 鐨勫璞�
+		    return processList.value.slice(index + 1).some(other => {
+					if(other.order_number === item.order_number 
+							&& other.completedQuantity !== item.completedQuantity
+								|| other.quantity<other.completedQuantity){
+									
+							notSame = other
+							return true
+						}
+				}
+		    )
+		})
+		if(hasConflict){
+			messageToggle('error',`搴忓彿'${notSame.order_number}'鍚屽簭鍙峰畬宸ヤ笉鐩稿悓鎴栨暟閲忚秴杩囨�绘暟`)
+			return
+		}
+		
+		
+		buttonLoading.value = true
+		processTitle.value.teamsGroupsName = store.user.userName
+		processTitle.value.deviceName =store.choiceDevice.text ||'phone'
+		processTitle.value.deviceId =store.choiceDevice.value ||''
+		processTitle.value.creatorId = store.user.userId
+		processTitle.value.creator = store.user.userName
+		const requestData = {
+		    title:processTitle.value,
+		    detail:processList.value,
+		    type:0,//瀹℃牳鐘舵��
+		    userId:store.user.userId,
+		    userName:store.user.userName,
+				class:"",
+		    qualityInsStatus:2//璺ㄥ伐搴忚川妫�瀹℃牳锛�1涓嶉渶瑕侊紝2闇�瑕�
+		  }
+		request.post(`/reportingWork/saveReportingWork`,requestData).then(res =>{
+		    if(res.code == 200){
+					//messageToggle('success','鎴愬姛')
+					if(allQuantity.value>finishNum.value){
+						alertDialog.value.open()
+					}else{
+						uni.reLaunch({
+						  url: `/pages/mainView/mainView?state=success`
+						})
+					}
+					
+		    }else{
+		      const errorObj = JSON.parse(res.msg)
+		      const msg = t('reportingWorks.pleaseNumber1')+"锛�"+errorObj.orderNumber+'\n'
+		          +t('reportingWorks.pleaseNumber2')+'锛�'+errorObj.technologyNumber+'\n'
+		          +t('reportingWorks.pleaseNumber3')+'锛�'+errorObj.processNum+'<'+
+		          +t('reportingWorks.pleaseNumber4')+'锛�'+errorObj.sumNum+'\n'
+		          +t('reportingWorks.pleaseNumber5')
+					messageToggle('error',msg)
+		    }
+		  }).catch(err => {
+				uni.showModal({
+					title: '鎻愮ず',
+					content: err,
+					showCancel:false
+				});
+			}).finally(() => {
+				buttonLoading.value = false
+			})
+	}
+	
+	//寮瑰嚭妗嗙‘璁�
+	const dialogConfirm = () => {
+		uni.reLaunch({
+		  url: `/pages/mainView/mainView?state=success`
+		})
+	}
+	const dialogClose = () => {
+		uni.redirectTo({
+			url: `/pages/reportingWork/reportingWork?processId=${processId.value}`
+		});
+	}
+	
+	//涓嬪伐搴忓鏍�
+	const reviewReportForWork = () => {
+		const reportWork = {
+		    process: processTitle.value.previousProcess,
+		    processId:processId.value,
+		    thisProcess:processTitle.value.thisProcess,
+		    technologyStr:processId.value.split('/')[1],
+		    userName:store.user.userName
+		}
+		request.post("/reportingWork/reviewReportingWork",reportWork).then((res) =>{
+			if(res.code === '200'){
+				uni.redirectTo({
+					url: `/pages/reportingWork/reportingWork?processId=${processId.value}`
+				})
+			}
+		}).catch(err => {
+			uni.showModal({
+				title: '鎻愮ず',
+				content: err,
+				showCancel:false
+			});
+		})
+	}
+	//姝ゆ祦绋嬪崱鐩墠鎬绘暟閲�
+	const allQuantity = computed( () => {
+		let sum = 0
+		processList.value.forEach( item => {
+			let quantity = item.quantity*1 || 0
+			sum += quantity
+		})
+		return sum
+	})
+	// 瀹屽伐娆$牬鎬绘暟閲�
+	const finishNum = computed( () => {
+		let sum = 0
+		processList.value.forEach( item => {
+			let finish = item.completedQuantity*1 || 0
+			let breakNum = item.breakageQuantity*1 || 0
+			sum += finish
+			sum += breakNum
+		})
+		return sum
+	})
+	//鎵撳紑鎻愮ず妗�
+	const messageToggle = (type,msg) => {
+		msgType.value = type
+		messageText.value = msg
+		message.value.open()
+	}
+	//鍒ゆ柇鍙埄鐢�
+	const backProcess = ref([])
+	const changeAvailable = (e) => {
+		backProcess.value = []
+		if(e.detail.value.length){
+			damageDetail.value.available = 1
+			titleSelectJson.value.historyProcess.forEach( item => {
+				backProcess.value.push({
+					value:item.basic_category,
+					text:item.basic_category
+				})
+			})
+		}else{
+			damageDetail.value.available = null
+			damageDetail.value.returnProcess = null
+		}
+	}
+  //璐d换宸ュ簭
+	const responsibleProcess = computed(()=>{
+		let list = []
+		titleSelectJson.value.historyProcess.forEach( item => {
+			list.push({
+				value:item.basic_category,
+				text:item.basic_category
+			})
+		})
+		return list
+	})
+	//璁$畻灞炴�� 娆$牬绫诲瀷
+	const breakageType = computed(()=>{
+		let list = []
+		titleSelectJson.value.breakageType.forEach( item => {
+			list.push({
+				value:item.basic_name,
+				text:item.basic_name
+			})
+		})
+		return list
+	})
+	
+	//璁$畻灞炴�� 娆$牬鍘熷洜
+	const breakageReason = computed(()=>{
+		let list = []
+		titleSelectJson.value.breakageReason.forEach( item => {
+			list.push({
+				value:item.basic_name,
+				text:item.basic_name
+			})
+		})
+		return list
+	})
+	
+ 	//璐d换璁惧 responsibleEquipment
+	const responsibleEquipment = ref([])
+	const responsibleTeam = ref([])
+	const changeResponsibleProcess = () =>{
+		responsibleEquipment.value = []
+		responsibleTeam.value = []
+		damageDetail.value.responsibleEquipment = null
+		damageDetail.value.responsibleTeam = null
+		titleSelectJson.value.historyDevice.forEach( item => {
+			if(item.basic_category===damageDetail.value.responsibleProcess){
+				responsibleEquipment.value.push({
+					value:item.basic_name,
+					text:item.basic_name
+				})
+			}
+		})
+		titleSelectJson.value.historyTeams.forEach( item => {
+			if(item.process===damageDetail.value.responsibleProcess){
+				responsibleTeam.value.push({
+					value:item.basic_name,
+					text:item.basic_name
+				})
+			}
+		})
+	}
+	// 瀹屽伐鏀瑰彉
+	const changeFinishNum = (row) => {
+		damageShowFlag.value = false
+		const finishNum = row.completedQuantity*1 || 0
+		const breakNum = row.breakageQuantity*1 || 0
+		if((row.quantity-finishNum-breakNum)<0){
+			row.completedQuantity = null
+			return
+		}
+		processList.value.forEach(item => {
+			if(item.order_number == row.order_number && finishNum<=item.quantity){
+				item.completedQuantity = finishNum
+			}
+		})
+	}
+	const changeBreakNum = (row,index) => {
+		const finishNum = row.completedQuantity*1 || 0
+		const breakNum = row.breakageQuantity*1 || 0
+		if((row.quantity-breakNum)<0){
+			row.breakageQuantity = null
+			return
+		}
+		row.completedQuantity = row.quantity-breakNum
+		if(processList.value[index].damageDetails){
+			damageDetail.value = processList.value[index].damageDetails[0]
+		}else{
+			for(let index in damageDetail.value){
+				damageDetail.value[index] = null
+			}
+		}
+		
+		if(breakNum*1>0){
+			damageDetail.value.breakageQuantity = breakNum*1
+			damageShowRow.value = index+1
+			popup.value.open()
+		}else{
+			delete processList.value[index].damageDetails
+			for(let index in damageDetail.value){
+				damageDetail.value[index] = null
+			}
+		}
+		
+	}
+	
+	const rules = {
+		breakageType: '璇烽�夋嫨娆$牬绫诲瀷',
+		breakageReason:'璇烽�夋嫨娆$牬鍘熷洜',
+		responsibleProcess:'璇烽�夋嫨璐d换宸ュ簭',
+		responsibleEquipment:'璇烽�夋嫨璐d换璁惧',
+		responsibleTeam:'璇烽�夋嫨璐d换鐝粍',
+		returnProcess:'鍙埄鐢ㄥ凡鍕鹃�夛紝璇烽�夋嫨杩斿洖宸ュ簭'
+	}
+	
+	const close = (type) => {
+		//鍒ゆ柇鏄惁鏄‘瀹�
+		if(type===1){
+			for(let item in rules){
+				//鍒ゆ柇閫変腑鍙埄鐢ㄥ拰涓嬫媺妗嗘槸鍚︿负绌�
+				if(!damageDetail.value[item] && item!=='returnProcess'){
+					messageToggle('error',rules[item])
+					return
+				}else if(item==='returnProcess' && !damageDetail.value[item] && damageDetail.value['available']){
+					messageToggle('error',rules[item])
+					return
+				}
+			}
+			//姣忚鐮存崯璧嬪��
+			processList.value[damageShowRow.value-1].damageDetails = [
+				JSON.parse(JSON.stringify(damageDetail.value))
+			]
+		}else{
+			delete processList.value[damageShowRow.value-1].breakageQuantity
+			delete processList.value[damageShowRow.value-1].damageDetails
+		}
+		popup.value.close()
+	}
+	
+	const cleanAllFinish = () => {
+		processList.value.forEach(item => {
+			item.completedQuantity = 0
+		})
+	}
+	
+
+</script>
+
+<style>
+	.main{
+		width: 100vw;
+		height: 93.5vh
+	}
+	.flex-item{
+		/* flex-direction: column;
+		background-color: aliceblue; */
+	}
+	.title_main{
+		width: 100vw;
+		height: 12vh;
+	}
+	.table_main{
+		width: 100vw;
+		height: 80vh;
+		margin: 0 auto;
+	}
+	.foot_main{
+		width: 96vw;
+		margin: 0 auto;
+		background-color: white;
+	}
+	
+	.uni-row{
+		text-align: center;
+	}
+	.break_col{
+		height: 35px;
+		border:1px solid black;
+	}
+	.breakInfo{
+		width: 96vw;
+	}
+</style>

--
Gitblit v1.8.0