ezhizao_zx hai 1 ano
pai
achega
af6c5b996e

+ 24 - 4
components/dialog-lotReporting/dialog-lotReporting.vue

@@ -1,6 +1,6 @@
 <template>
 	<dialog-base class="dialog-body" ref="baseDialog" title="添加批次报工">
-		<view style="overflow: auto;height: 800rpx;">
+		<view style="overflow: auto;">
 			<!-- <view v-for="(item, index) in lotData" :key="index" class="list-item"> -->
 				<view class="item-info uni-row">
 					<text class="label">批次号</text>
@@ -20,9 +20,11 @@
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">当前序</text>
-					<view class="label right uni-row">{{ item['process'] ? item['process'].processAlias : '-' }}
-						(<view style="color:  #1684fc;" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表&nbsp;
-						</view>)
+					<view class="label right uni-row" style="display: flex; flex-direction: row; flex-wrap: wrap;">
+						<view>{{ item['process'] ? item['process'].processAlias : '-' }}
+						</view>
+						<view style="color:  #1684fc;" @click.stop="handleClickProcessList(item)">(&nbsp;工艺列表&nbsp;)
+						</view>
 					</view>
 				</view>
 				<view class="item-info uni-row">
@@ -110,6 +112,23 @@
 	const item = ref({})
 	const showRight = ref(null) // 抽屉
 	function open(data) {
+		// if (data === 'test') {
+		// 	baseDialog.value.open()
+		// 	lotData.value = [{
+		// 		lotCode: '测试',
+		// 		process: { processAlias: '测试长数据结果' }
+		// 	}, {
+		// 		lotCode: '测试',
+		// 		process: { processAlias: '测试长数据结果' }
+		// 	}, {
+		// 		lotCode: '测试',
+		// 		process: { processAlias: '测试长数据结果' }
+		// 	}]
+		// 	item.value = {
+		// 		lotCode: '测试',
+		// 		process: { processAlias: '测试长数据结果' }
+		// 	}
+		// } else {
 		lotData.value = data.items
 		item.value = data.items[0]
 		// lotData.value.map(v => v.lotCode).join(",")
@@ -122,6 +141,7 @@
 		curDaywork.value = {}
 		deptList.value = []
 		init()
+		// }
 	}
 
 	function init() {

+ 1 - 0
pages/fastProductionPlan/index.vue

@@ -242,6 +242,7 @@
 	}
 
 	function handleContinue() {
+		// lotReporting.value.open('test')
 		handleAdd()
 	}
 	

+ 34 - 6
pages/sorting/form.vue

@@ -22,15 +22,17 @@
 			<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
 				<view class="title uni-row">
 					<text>检查标准-{{ item.checkStandard }}</text>
-					<uni-icons type="trash" size="24" color="#fc6565" @click="handleDelUnfit(index)" />
+					<uni-icons v-if="Number(dayworkItem.status) < 3" type="trash" size="24" color="#fc6565" @click="handleDelUnfit(index)" />
 				</view>
 				<!-- <view class="standard">检查标准:{{ item.checkStandard }}</view> -->
 				<view class="result uni-row">
 					<view class="label">检查结果</view>
-					<input v-model="item.reason" placeholder="请输入检查结果" />
+					<input v-if="Number(dayworkItem.status) < 3" v-model="item.reason" placeholder="请输入检查结果" />
+					<span v-else>{{ item.reason }}</span>
 					<view class="label" style="text-align: right; padding-right: 16rpx;">数量</view>
-					<input class="number" type="number" v-model="item.rejectNum" placeholder=""
+					<input v-if="Number(dayworkItem.status) < 3" class="number" type="number" v-model="item.rejectNum"
 						@blur="rejectNumberChange" />
+					<span v-else>{{ item.rejectNum }}</span>
 				</view>
 			</view>
 		</view>
@@ -58,13 +60,16 @@
 		<view class="daywork-container">
 			<view class="result uni-row">
 				<view class="label">合格量</view>
-				<input type="number" placeholder="请输入合格量" v-model="dayworkItem.qualifiedNum" />
+				<input v-if="Number(dayworkItem.status) < 3" type="number" placeholder="请输入合格量" v-model="dayworkItem.qualifiedNum" />
+				<span v-else>{{ dayworkItem.qualifiedNum }}</span>
 				<view class="label" style="text-align: right; padding-right: 24rpx">废品量</view>
-				<input type="number" placeholder="请输入废品量" v-model="dayworkItem.rejectNum" />
+				<input v-if="Number(dayworkItem.status) < 3" type="number" placeholder="请输入废品量" v-model="dayworkItem.rejectNum" />
+				<span v-else>{{ dayworkItem.rejectNum }}</span>
 			</view>
 			<view class="remark uni-row">
 				<view class="label">备注</view>
-				<textarea v-model="dayworkItem.remark" />
+				<textarea v-if="Number(dayworkItem.status) < 3" v-model="dayworkItem.remark" />
+				<span v-else>{{ dayworkItem.remark }}</span>
 			</view>
 
 			<view class="btns-container uni-row" v-if="Number(dayworkItem.status) < 3">
@@ -286,8 +291,28 @@
 		dayworkItem.value.qualifiedNum = dayworkItem.value.prodNum - dayworkItem.value.rejectNum
 		console.log(dayworkItem.value)
 	}
+	
+	const validHandle = () => {
+		for(let i = 0; i < unfitInfos.value.length; i++) {
+			const e = unfitInfos.value[i]
+			if (e.rejectNum == null || e.rejectNum == 0) {
+				uni.showToast({
+					icon: 'none',
+					title: `第${i + 1}条不合格信息未输入不合格数量`
+				})
+				return false
+			}
+		}
+		return true
+		// unfitInfos.value.forEach((e, i) => {
+		// 	if (e.name)
+		// })
+	}
 
 	const handleFinishDaywork = () => {
+		if (!validHandle()) {
+			return
+		}
 		const saveData = {
 			rejectList: unfitInfos.value,
 			consult: consultations.value,
@@ -309,6 +334,9 @@
 		})
 	}
 	const handleUpdateDaywork = () => {
+		if (!validHandle()) {
+			return
+		}
 		const saveData = {
 			rejectList: unfitInfos.value,
 			consult: consultations.value,