ezhizao_zx 8 ماه پیش
والد
کامیت
b793282b42
2فایلهای تغییر یافته به همراه26 افزوده شده و 104 حذف شده
  1. 18 5
      components/dialog-reject/dialog-reject.vue
  2. 8 99
      pages/auxiliaryDaywork/form.vue

+ 18 - 5
components/dialog-reject/dialog-reject.vue

@@ -10,7 +10,9 @@
 				<input class="input" @input="handleInputRejectNum(item)" style="width: 20%;" v-model="item.rejectNum"
 					placeholder="废品量" />
 				<uni-data-select style="margin-left: 40rpx;width: 70%;" v-model="item.reason" :localdata="reasonList"
-					@change="handleReasonChange(item)"></uni-data-select>
+					@change="handleReasonChange(item)" :clear="false"></uni-data-select>
+				<!-- <zxz-uni-data-select v-model="item.reason" filterable :localdata="reasonList" placeholder="请选择废品原因"
+					@change="handleReasonChange(item)"></zxz-uni-data-select> -->
 
 				<uni-icons class="icon-gear" type="close" size="40" color="red"
 					@click="handleDeleteWasteInfo(index)"></uni-icons>
@@ -87,7 +89,12 @@
 			...data,
 		};
 		dayworkItemInfo.value = data
-		wasteInfo.value = data.rejectList == null ? [] : data.rejectList
+		// wasteInfo.value = data.rejectList == null ? [] : data.rejectList
+		// wasteInfo.value = [{
+		// 	reason: '2',
+		// 	rejectNum: 2
+		// }]
+		// console.log(data)
 		// console.log("数据data", workInfo);
 		//查看是否为首序
 		// console.log(store.dayworkInfo.id)
@@ -137,6 +144,10 @@
 					text: res.data[i].dictLabel
 				}
 			}
+			wasteInfo.value = dayworkItemInfo.value.rejectList == null ? [] : dayworkItemInfo.value.rejectList.map(
+				e => ({
+					...e
+				}))
 		}).catch(err => {
 			console.log('189 err')
 		})
@@ -231,13 +242,15 @@
 		wasteInfo.value.splice(index, 1);
 	}
 
-  function submitReject () {
-    // 提交到父组件
+	function submitReject() {
+		// 提交到父组件
 		emit('resflushItem', wasteInfo.value);
 		close()
-  }
+	}
 
 	function handleReasonChange(item) {
+		// console.log(typeof item)
+		// console.log(item)
 		if (wasteInfo.value.filter(waste => waste.reason == item.reason).length > 1) {
 			wasteInfo.value.splice(wasteInfo.value.indexOf(item), 1);
 			uni.showToast({

+ 8 - 99
pages/auxiliaryDaywork/form.vue

@@ -281,23 +281,6 @@
 		console.log(auxiliaryDayworkItem.value)
 	}
 
-	//查询咨询列表
-	function getInspecion() {
-		auxiliaryDayworkItem.value = store.processInspection
-		selectInspecion(auxiliaryDayworkItem.value).then(res => {
-			console.log("咨询", res);
-			if (res.code == 200) {
-				console.log("res", res);
-			} else {
-				uni.showToast({
-					icon: 'none',
-					title: res.msg,
-					duration: 2000
-				})
-			}
-		});
-	}
-
 	//结束报工按钮
 	function endWork() {
 		let unf = unfitInfos.value;
@@ -305,7 +288,7 @@
 			if (unf[i].rejectNum > unf[i].prodNum) {
 				uni.showToast({
 					icon: 'none',
-					title: '检查量不能大于投产量'
+					title: '废品量不能大于合格量'
 				})
 				return
 			}
@@ -317,8 +300,6 @@
 		})
 		auxiliaryDayworkItem.value.rejectNum = sumReject
 		endSave();
-
-
 	}
 
 	// 暂停报工按钮
@@ -347,11 +328,8 @@
 		finishedDaywork(auxiliaryDayworkItem.value).then(res => {
 			if (res.code == 200) {
 				let index = 0;
-
 				for (let i = 0; i < pages.length; i++) {
-
 					if (pages[i].$page.fullPath == "/pages/auxiliaryDaywork/index") {
-
 						index = pages.length - i - 1;
 					}
 				}
@@ -410,14 +388,6 @@
 			}
 		});
 	}
-	//咨询样式
-	function selectType(item) {
-		for (var i = 0; i < consul.length; i++) {
-			if (item.status == consul[i].value) {
-				return consul[i].type
-			}
-		}
-	}
 
 	function addReject(row, index) {
 		// console.log('reject', row)
@@ -426,77 +396,16 @@
 	}
 
 	function handleResFlushItem(data) {
-		currentItem.value.rejectList = data
-	}
-
-	const addWasteInfo = (data) => {
-		const info = {
-			title: data.title,
-			checkStandard: data.standard
-		}
-		unfitInfos.value.push(info)
-	}
-	const addConsultation = (data) => {
-		console.log(data)
-		let info = data
-		info.forEach(item => {
-			item.status = 0
-		})
-		consultations.value = info
-		isEventTriggered.value = true; // 更新标志位状态
-	}
-
-	/***************************** 定义了一些事件 *****************************/
-	// 添加不合格信息
-	const handleAddWaste = () => {
-		let info = {}
-		unfitInfos.value.push(info)
-
-		// 监听事件,暂时不用,后续会使用
-		// uni.$once('addWasteInfoEvent', (data) => {
-		// 	addWasteInfo(data)
-		// })
-		// uni.navigateTo({
-		// 	url: "/pages/processInspection/options"
-		// })
-	}
-	// 删除不合格信息
-	const handleDelWaste = (index) => {
-		uni.showModal({
-			title: '提示',
-			content: '确定删除该项?',
-			success: function(res) {
-				if (res.confirm) {
-					unfitInfos.value.splice(index, 1)
-					rejectNumberChange()
-				} else if (res.cancel) {
-					return
-				}
-			}
+		currentItem.value.rejectList = data.filter(e => e.reason != null && e.reason != '')
+		let rejectNum = 0
+		currentItem.value.rejectList.forEach(l => {
+			rejectNum += Number(l.rejectNum)
 		})
+		currentItem.value.rejectNum = rejectNum
+		rejectNumberChange()
+		// console.log(currentItem.value)
 	}
 
-	// 咨询
-	const handleAddConsultation = () => {
-		isEventTriggered.value = false;
-		// 监听事件
-		uni.$once('wasteConsultationEvent', (data) => {
-			if (!isEventTriggered.value) {
-				// 如果事件尚未触发,则执行事件触发逻辑
-				addConsultation(data)
-			}
-		})
-
-		uni.navigateTo({
-			url: "/pages/outsourcedInspection/consultation",
-			success: (res) => {
-				// 通过eventChannel向被打开页面传送数据
-				res.eventChannel.emit("outsourcedInspectionConsultation", {
-					data: auxiliaryDayworkItem.value.lot
-				})
-			}
-		})
-	}
 </script>
 
 <style lang="scss">