guoyujia 4 mesi fa
parent
commit
65a9446f4e

+ 8 - 0
api/business/dayWork.js

@@ -12,6 +12,14 @@ export function getDayWorkList(data) {
 		data: data
 	})
 }
+export function getAssistDayWorkList(data) {
+	return req.request({
+		url: '/business/daywork/assistList',
+		// header: reqHeader,
+		method: 'GET',
+		data: data
+	})
+}
 export function getDayWorkInnerList(data) {
 	return req.request({
 		url: '/business/daywork/innerList',

+ 21 - 0
api/business/dayWorkItem.js

@@ -11,6 +11,13 @@ export function getDayWorkItemList(data) {
 		data: data
 	})
 }
+export function getAssistDayWorkItemList(data) {
+	return req.request({
+		url: '/business/dayworkItem/assistList',
+		method: 'GET',
+		data: data
+	})
+}
 
 
 export function updateDayWorkItem(data) {
@@ -172,6 +179,13 @@ export function turnover(data) {
 		data: data
 	})
 }
+export function turnoverAssist(data) {
+	return req.request({
+		url: '/business/dayworkItem/turnoverAssist',
+		method: 'POST',
+		data: data
+	})
+}
 export function turnoverInner(data) {
 	return req.request({
 		url: '/business/dayworkItem/turnoverInner',
@@ -194,6 +208,13 @@ export function turnoverOutsource(data) {
 		data: data
 	})
 }
+export function turnoverOutsourceAssist(data) {
+	return req.request({
+		url: '/business/dayworkItem/turnoverOutsourceAssist',
+		method: 'POST',
+		data: data
+	})
+}
 
 export function getHandlingByCarrierCode(data) {
 	return req.request({

+ 1 - 1
components/dialog-base/dialog-base.vue

@@ -79,7 +79,7 @@
 			padding: 0 48rpx 48rpx 48rpx;
 			background-color: #FFFFFF;
 			z-index: 1002;
-			max-height: 64%;
+			max-height: 70%;
 			// overflow: auto;
 
 			.close-btn {

+ 1 - 1
components/dialog-end-work/dialog-end-work.vue

@@ -323,7 +323,7 @@
 			);
 		} else {
 			let vehicleObj = {
-				carrierCode: bindList.value[0].carrierCode
+				carrierCode: '000643'
 			};
 			let hasInFlag = false
 			for (let i = 0; i < bindList.value.length; i++) {

+ 5 - 0
components/dialog-lotReporting/dialog-lotReporting.vue

@@ -18,6 +18,11 @@
 				<text class="label">箱号</text>
 				<text class="label right">{{ item['carrierName'] }}</text>
 			</view>
+			<view class="item-info uni-row">
+				<text class="label">上序</text>
+				<view class="label right uni-row">{{ item['lastProcess'] ? item['lastProcess'].processAlias : '-' }}
+				</view>
+			</view>
 			<view class="item-info uni-row">
 				<text class="label">当前序</text>
 				<view class="label right uni-row" style="display: flex; flex-direction: row; flex-wrap: wrap;">

+ 549 - 0
components/dialog-turnoverApplicationAssist/dialog-turnoverApplicationAssist.vue

@@ -0,0 +1,549 @@
+<template>
+	<dialog-base ref="baseDialog" title="周转申请">
+		<view class="list-container">
+			<view><text style="margin: 0 0 0 5rpx;">请选择周转类型</text></view>
+			<view class="btn uni-row">
+				<view v-for="(item,index) in turnoverType"
+					:class="{ 'middle-btn': true, 'active': item.dictValue == curDayworkItem.turnoverType }"
+					@click="selectTurnoverType(item)"><text class="label"
+						style="font-size: 30rpx;">{{item.dictLabel}}</text></view>
+			</view>
+			<view class="" style="margin: 0 20rpx 20rpx 0;width: 88%;">
+				<uni-section title="请选择下序工段" title-font-size="32rpx" style="margin: 0 0 0 -16rpx;"
+					v-if="curDayworkItem.turnoverType == '1'">
+					<uni-data-select v-model="curDayworkItem.deptId" :localdata="insideDepts"
+						@change="handleChangeInside" :clear="false"
+						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
+				</uni-section>
+				<uni-section title="请选择下序工段" title-font-size="32rpx" style="margin: 0 0 0 -16rpx;"
+					v-if="curDayworkItem.turnoverType == '2'">
+					<uni-data-select v-model="curDayworkItem.deptId" :localdata="outsideDepts"
+						@change="handleChangeOutside" :clear="false"
+						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
+				</uni-section>
+			</view>
+			<view v-if="curDayworkItem.turnoverType != '3'" class="list-title uni-row">
+				<text class="label" style="margin: 0 0 0 -24rpx;">是否包装签票</text><text style="margin-left: 56rpx;"
+					class="label">否</text>
+				<switch class="switch" @change="switchChange" :checked="normalStatus"
+					style="transform: scale(0.8);align-items: center;font-size:32rpx ;"
+					color="rgba(103, 195, 55, 1.0)" />
+				<text class="label">是</text>
+			</view>
+			<view class="list-title">
+				<text class="label" style="margin: 0 0 0 -308rpx;">请选择您摆放位置</text>
+			</view>
+			<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '1'">
+				<view v-for="(item,index) in turnAreaList" class="btn">
+					<view :class="{ 'middle-btn': true, 'active': handleTurnoverDoor(item) }"
+						@click="selectTurnoverDoor(item)"><text class="label"
+							style="font-size: 30rpx;">{{item.code}}</text></view>
+				</view>
+			</view>
+			<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '2'">
+				<view v-for="(item,index) in turnoverArea" class="btn">
+					<view :class="{ 'middle-btn': true, 'active': handleTurnoverDoor(item) }"
+						@click="selectTurnoverDoorOutside(item)"><text class="label"
+							style="font-size: 30rpx;">{{item.code}}</text></view>
+				</view>
+			</view>
+			<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '3'">
+				<view v-for="(item,index) in turnoverArea" class="btn">
+					<view :class="{ 'middle-btn': true, 'active': handleTurnoverDoor(item) }"
+						@click="selectTurnoverOutsource(item)"><text class="label"
+							style="font-size: 30rpx;">{{item.code}}</text></view>
+				</view>
+			</view>
+		</view>
+		<view class="add-btn-container uni-row">
+			<button type="default" class="btn" @click="handleConfirm">确认</button>
+		</view>
+	</dialog-base>
+</template>
+
+<script setup>
+	import {
+		ref,
+		getCurrentInstance
+	} from 'vue'
+	import {
+		onLoad
+	} from '@dcloudio/uni-app'
+	import {
+		getDictInfoByType
+	} from '@/api/dict/dict.js'
+	import {
+		getTurnoverByWorkshop,
+		getOutsourceTurnoverByWorkshop
+	} from '@/api/business/workshop.js'
+	import {
+		getDayWorkItemList,
+		saveDayWorkItem,
+		turnoverAssist,
+		turnoverOutsourceAssist
+	} from '@/api/business/dayWorkItem.js'
+	import {
+		getDeptListInfo
+	} from '@/api/dept/dept.js'
+	import {
+		getTurnoverListByDeptId,
+	} from '@/api/business/turnover.js'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		timestampToTime
+	} from '@/utils/common.js'
+
+	const baseDialog = ref(null)
+	const turnoverDoorChecked = ref([])
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
+	const turnoverType = ref([])
+	const outTurnArea = ref([])
+	const turnoverArea = ref([])
+	const normalStatus = ref(false)
+	const selection = ref([])
+	const curDayworkItem = ref({
+		turnoverType: 1
+	})
+	const dayworkInfo = ref(null)
+	const deptList = ref([]) // 工段列表
+	const insideDepts = ref([]) // 车间内工段
+	const outsideDepts = ref([]) // 车间外工段
+	const turnAreaList = ref([]) // 周转区列表
+	const emit = defineEmits(['reflushDaywork']) // 自定义调用父组件方法
+
+	onLoad(() => {
+
+	})
+
+	function open(data) {
+		resetPage();
+		dayworkInfo.value = data;
+		normalStatus.value = false
+		init();
+		baseDialog.value.open();
+	}
+
+	defineExpose({
+		open
+	})
+
+	function close() {
+		baseDialog.value.close()
+		turnAreaList.value = [];
+	}
+
+	function resetPage() {
+		turnoverDoorChecked.value = []
+		turnoverType.value = []
+		turnoverArea.value = []
+		selection.value = []
+		curDayworkItem.value = {
+			turnoverType: 1
+		}
+		deptList.value = []
+		insideDepts.value = []
+		outsideDepts.value = []
+		turnAreaList.value = []
+	}
+
+	function switchChange(event) {
+		console.log(event.detail.value)
+		//是
+		if (event.detail.value) {
+			normalStatus.value = true
+			curDayworkItem.value.isNextPacking = true
+		} else {
+			//否
+			normalStatus.value = false
+			curDayworkItem.value.isNextPacking = false
+		}
+		console.log(event.detail.value, !store.isPreProcess)
+		console.log(curDayworkItem.value)
+	}
+
+	function init() {
+		console.log(dayworkInfo.value)
+		getDictInfoByType('daywork_turnover_type').then(res => {
+			turnoverType.value = res.data;
+			getTurnoverByWorkshop({
+				deptId: store.curDeptDetails.deptId
+			}).then(res => {
+				turnoverArea.value = res.data;
+			})
+		})
+		getOutsourceTurnoverByWorkshop({
+			deptCode: '170000'
+		}).then(response => {
+			outTurnArea.value = response.data
+		})
+		getDayWorkItemList({
+			dayworkId: dayworkInfo.value.id,
+			userId: store.userInfo.userId,
+			lotId: dayworkInfo.value.lotId,
+			isWasteRecycling: dayworkInfo.value.isWasteRecycling,
+			isAmend: dayworkInfo.value.isAmend,
+			processStepNumber: dayworkInfo.value.currentProcess.processStepNumber
+		}).then(res => {
+			curDayworkItem.value = {
+				...res.rows[0],
+				turnoverType: 1,
+				deptId: null
+			};
+		})
+		getDeptListInfo({
+			tenantId: store.tenantId,
+			productionPlanDetailId: store.planDetails.id,
+			lotId: dayworkInfo.value.lotId,
+			isWasteRecycling: dayworkInfo.value.isWasteRecycling,
+			isAmend: dayworkInfo.value.isAmend
+		}).then(res => {
+			for (let i = 0; i < res.data.length; i++) {
+				deptList.value = res.data;
+				console.log(deptList.value)
+				if (store.curDeptDetails.workshopId == res.data[i].workshopId) {
+					insideDepts.value.push({
+						text: res.data[i].deptName,
+						value: res.data[i].deptId,
+						data: res.data[i]
+					})
+				} else {
+					outsideDepts.value.push({
+						text: res.data[i].deptName,
+						value: res.data[i].deptId,
+						data: res.data[i]
+					})
+				}
+			}
+			console.log(insideDepts.value)
+			console.log(outsideDepts.value)
+		})
+	}
+
+	function selectTurnoverType(item) {
+		curDayworkItem.value.deptId = null
+		curDayworkItem.value.turnoverType = item.dictValue;
+		selection.value = []
+		normalStatus.value = false
+		curDayworkItem.value.isNextPacking = false
+	}
+
+	function selectTurnoverDoor(item) {
+		console.log(item, "chejiannei")
+		// turnoverDoorChecked.value = item;
+		// curDayworkItem.value.turnoverArea = item.dictValue;
+		let index = selection.value.findIndex(selectedItem => selectedItem === item);
+		if (index > -1) {
+			selection.value.splice(index, 1);
+		} else {
+			selection.value.push(item);
+		}
+	}
+
+	function selectTurnoverDoorOutside(item) {
+		console.log(item, "wai")
+		selection.value[0] = item;
+	}
+
+	function selectTurnoverOutsource(item) {
+		console.log(item, "waixie")
+		selection.value[0] = item
+	}
+
+	function handleTurnoverDoor(item) {
+		return selection.value.includes(item);
+	}
+	//校验车间内车间外
+	function handleValidate(data) {
+		console.log(data)
+		if (data.turnoverArea == "" || data.deptId == null || selection.value.length == 0) {
+			return false;
+		} else {
+			return true;
+		}
+	}
+	//校验外协
+	function handleValidateOutsource(data) {
+		console.log(data)
+		if (selection.value.length == 0) {
+			return false;
+		} else {
+			return true;
+		}
+	}
+
+	function handleConfirmOutsource() {
+		if (!handleValidateOutsource(curDayworkItem.value)) {
+			uni.showToast({
+				icon: "none",
+				title: '请选择完整信息'
+			});
+		} else {
+			const currentTime = Date.now();
+
+			// 检查是否已经过去了 2 秒
+			if (currentTime - lastRequestTimestamp.value < 2000) {
+				// 如果在 2 秒 内已经有请求发出,那么不执行
+				uni.showToast({
+					icon: 'none',
+					title: `请勿重复点击`,
+					duration: 2000
+				})
+				return;
+			}
+			lastRequestTimestamp.value = currentTime;
+			curDayworkItem.value.id = null;
+			curDayworkItem.value.processStepNumber = dayworkInfo.value.currentProcess.processStepNumber
+			curDayworkItem.value.startTime = timestampToTime(new Date());
+			curDayworkItem.value.endTime = timestampToTime(new Date());
+			curDayworkItem.value.technologicalProcessId = dayworkInfo.value.technologicalProcessId;
+			curDayworkItem.value.dayworkId = dayworkInfo.value.id;
+			curDayworkItem.value.productionPlanDetailId = dayworkInfo.value.productionPlanDetailId;
+			curDayworkItem.value.status = '4';
+			if (!store.tenantId) {
+				curDayworkItem.value.tenantId = store.userInfo.tenantId;
+			} else {
+				curDayworkItem.value.tenantId = store.tenantId;
+			}
+			//curDayworkItem.value.turnoverArea = "外协周转";
+			curDayworkItem.value.turnoverArea = selection.value.map((item) => {
+				return item.code;
+			}).join('、')
+			// 0627 将turnoverId存入dayworkItem,多选将Id进行拼接
+			curDayworkItem.value.turnoverId = selection.value.map((item) => {
+				return item.id;
+			}).join('、')
+			/**** 此处暂时为硬编码,170000为外协部门编码,根据编码查询信息 ***/
+			curDayworkItem.value.deptCode = 170000;
+			close();
+			turnoverOutsourceAssist(curDayworkItem.value).then(res => {
+				if (res.code === 200) {
+					uni.showToast({
+						icon: 'success',
+						title: '操作成功'
+					});
+					emit('reflushDaywork');
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.msg,
+						duration: 2000
+					});
+					setTimeout(() => {
+						emit('reflushDaywork')
+					}, 1000);
+				}
+			})
+		}
+	}
+
+	function handleConfirm() {
+		if (curDayworkItem.value.turnoverType == '3') {
+			handleConfirmOutsource();
+		} else {
+			const currentTime = Date.now();
+
+			// 检查是否已经过去了 2 秒
+			if (currentTime - lastRequestTimestamp.value < 2000) {
+				// 如果在 2 秒 内已经有请求发出,那么不执行
+				uni.showToast({
+					icon: 'none',
+					title: `请勿重复点击`,
+					duration: 2000
+				})
+				return;
+			}
+			lastRequestTimestamp.value = currentTime;
+			console.log(dayworkInfo.value)
+			curDayworkItem.value.id = null;
+			curDayworkItem.value.status = '4';
+			curDayworkItem.value.processStepNumber = dayworkInfo.value.currentProcess.processStepNumber
+			curDayworkItem.value.startTime = timestampToTime(new Date());
+			curDayworkItem.value.endTime = timestampToTime(new Date());
+			curDayworkItem.value.technologicalProcessId = dayworkInfo.value.technologicalProcessId;
+			curDayworkItem.value.dayworkId = dayworkInfo.value.id;
+			curDayworkItem.value.productionPlanDetailId = dayworkInfo.value.productionPlanDetailId;
+			if (!store.tenantId) {
+				curDayworkItem.value.tenantId = store.userInfo.tenantId;
+			} else {
+				curDayworkItem.value.tenantId = store.tenantId;
+			}
+
+
+
+			// 过滤出周转位置的数组,并转换成字符串
+			const newArray = selection.value.map((item) => {
+				if (item.code) {
+					return item.code;
+				} else if (item.dictLabel) {
+					return item.dictLabel;
+				} else {
+					return null;
+				}
+			})
+			const newIdArray = selection.value.map((item) => {
+				if (item.id) {
+					return item.id;
+				} else {
+					return null;
+				}
+			})
+			if (curDayworkItem.value.turnoverType == '1') {
+				curDayworkItem.value.place = newArray.join('、');
+				//0628将位置id也拼接的方式存下来
+				curDayworkItem.value.placeId = newIdArray.join('、');
+				curDayworkItem.value.turnoverArea = "车间内周转看place字段";
+			} else {
+				curDayworkItem.value.turnoverArea = newArray.join('、');
+				//0628将位置id也拼接的方式存下来
+				curDayworkItem.value.turnoverId = newIdArray.join('、');
+			}
+
+			// curDayworkItem.value.dayworkId = store.dayworkInfo.id;
+			// 设置周转下一个车间名
+			for (let i = 0; i < deptList.value.length; i++) {
+				if (deptList.value[i].deptId == curDayworkItem.value.deptId) {
+					curDayworkItem.value.deptName = deptList.value[i].deptName;
+				}
+			}
+			console.log(curDayworkItem.value);
+			// console.log(dayworkInfo.value)
+			if (!handleValidate(curDayworkItem.value)) {
+				uni.showToast({
+					icon: "none",
+					title: '请选择完整信息'
+				});
+			} else {
+				curDayworkItem.value.isNextPacking = false
+				if (normalStatus.value) {
+					curDayworkItem.value.isNextPacking = true
+				}
+
+				close();
+				turnoverAssist(curDayworkItem.value).then(res => {
+					if (res.code === 200) {
+						uni.showToast({
+							icon: 'success',
+							title: '操作成功'
+						});
+						emit('reflushDaywork');
+					} else {
+						console.log("999")
+						console.log(res.msg)
+						uni.showToast({
+							icon: 'none',
+							title: res.msg,
+							duration: 2000
+						});
+						setTimeout(() => {
+							emit('reflushDaywork')
+						}, 1000);
+
+					}
+				})
+			}
+			// emit('confirm');
+		}
+
+
+	}
+
+	function handleChangeInside() {
+		let deptInfo = deptList.value.find(item => item.deptId == curDayworkItem.value.deptId)
+		console.log(deptInfo)
+		if (deptInfo.isSortPackaging == 1) {
+			normalStatus.value = true
+		} else {
+			normalStatus.value = false
+		}
+		turnAreaList.value = [];
+		selection.value = []
+		getTurnoverListByDeptId({
+			deptId: curDayworkItem.value.deptId,
+		}).then(res => {
+			for (var i = 0; i < res.data.length; i++) {
+				if (res.data[i].status != 1) {
+					turnAreaList.value[i] = res.data[i];
+				}
+			}
+		})
+	}
+
+	function handleChangeOutside() {
+		let deptInfo = deptList.value.find(item => item.deptId == curDayworkItem.value.deptId)
+		console.log(deptInfo)
+		if (deptInfo.isSortPackaging == 1) {
+			normalStatus.value = true
+		} else {
+			normalStatus.value = false
+		}
+	}
+</script>
+
+<style lang="scss">
+	.dialog-body {
+		.list-container {
+			width: 100%;
+
+			.list-title {
+				margin-top: 24rpx;
+
+				.label {
+					font-size: 32rpx;
+				}
+			}
+
+			.turnArea {
+				flex-wrap: wrap;
+				height: auto;
+				max-height: 200rpx;
+				overflow: auto;
+			}
+
+			.btn {
+				margin-top: 24rpx;
+
+				.middle-btn {
+					margin-right: 32rpx;
+					align-items: center;
+					justify-content: center;
+					padding-left: 0;
+					height: 80rpx;
+					width: 220rpx;
+					border-radius: 8rpx;
+					background-color: #FFFFFF;
+					border: 1px solid #999999;
+					background-color: #FFFFFF;
+
+				}
+
+				.label {
+					font-size: 24rpx;
+					color: #000000;
+				}
+
+				.active {
+					border-color: #1684fc;
+					background-color: rgb(236, 245, 255);
+
+					.label {
+						color: #1684fc;
+					}
+				}
+			}
+		}
+
+		.add-btn-container {
+			margin-top: 32rpx;
+
+			.btn {
+				flex: 1;
+				background-color: rgb(255, 121, 1);
+				color: #FFFFFF;
+
+			}
+		}
+	}
+</style>

+ 14 - 0
pages.json

@@ -35,6 +35,13 @@
 				"onReachBottomDistance": 100
 			}
 		},
+		{
+			"path": "pages/assistDaywork/index",
+			"style": {
+				"navigationBarTitleText": "集中报工",
+				"onReachBottomDistance": 100
+			}
+		},
 		{
 			"path": "pages/outsourceProductionPlan/index",
 			"style": {
@@ -76,6 +83,13 @@
 
 			}
 		},
+		{
+			"path": "pages/assistReportingForWork/index",
+			"style": {
+				"navigationBarTitleText": "报工记录"
+
+			}
+		},
 		{
 			"path": "pages/reportingForInnerWork/index",
 			"style": {

+ 791 - 0
pages/assistDaywork/index.vue

@@ -0,0 +1,791 @@
+<template>
+	<view v-if="isMaskShow" class="mask">
+	</view>
+	<view class="uni-column" style=" background-color: #f5f5f5;padding: 24rpx;">
+		<view style="height: 20%;position: fixed;top:0px;left: 12px;right: 12px;z-index: 10;background-color: #f5f5f5;">
+			<view class="box-bg uni-row">
+				<view class="input-view uni-row">
+					<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
+					<input class="nav-bar-input" type="text" v-model="keywords" placeholder="请输入批次号/箱号" />
+				</view>
+				<view class="search" @click="handleSearch">
+					搜索
+				</view>
+			</view>
+			<view class="scan uni-row" style="padding: 24rpx 24rpx 0 24rpx;">
+				<view class="scan-btn " @click.stop="handleScan">扫码
+				</view>
+			</view>
+			<view class="list-title uni-row">
+				<text class="label">是否正常批次</text>
+				<text>{{ normalStatus ? '是' : '否' }}</text>
+				<switch class="switch" :checked="normalStatus" @change="switchChange" color="rgba(103, 195, 55, 1.0)" />
+			</view>
+		</view>
+		<view v-if="listData.length == 0" style="color: #999;margin: 100% auto;
+    height: 100%;
+    position: relative;
+    bottom: 0;
+    left: 0;
+    right: 0;">
+			<text>暂无批次</text>
+		</view>
+		<view v-else class="uni-column" style="margin-top: 126px;overflow: auto;height: 100%;">
+
+			<!-- 批次列表 -->
+			<view v-for="(item, index) in listData" :key="index" class="list-item"
+				@click="handleToreportingForWork(item)">
+				<view class="title-container uni-row" style="justify-content: flex-start;">
+					<view class="title uni-row">
+						<text class="label">批次号:</text>
+						<text class="label code">{{ item['lotCode'] }}</text>
+					</view>
+					<view class=" uni-row" style="margin-left: 16rpx;">
+						<view v-if="item['status'] == 1" class="tag"><text class="label">进行中</text></view>
+						<view v-else-if="item['status'] == 3" class="tag turnover "><text class="label">待领取</text>
+						</view>
+						<view v-else-if="item['status'] == 2" class="tag turnover "><text class="label">待周转</text>
+						</view>
+						<view v-else-if="item['status'] == 0" class="tag finished "><text class="label">未开始</text>
+						</view>
+						<view v-else-if="item['status'] == 4" type="default finished" class="tag finished"><text
+								class="label">已完成</text></view>
+					</view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ item['productDescription'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">材质</text>
+					<text
+						class="label right">{{ item['furnaceNoInfo'] && item['furnaceNoInfo'].firstTechnicalRequirement != '' ? item['furnaceNoInfo'].firstTechnicalRequirement + ";" + item['furnaceNoInfo'].secondTechnicalRequirement : '-' }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">箱号</text>
+					<text class="label right">{{ item['carrierName'] ? item['carrierName'] : '-' }}</text>
+				</view>
+				<!-- <view class="item-info uni-row">
+					<text class="label">总工时</text>
+					<text class="label right">{{ item['totalWorkingHours']}}</text>
+				</view> -->
+				<view class="item-info uni-row">
+					<text class="label">投入数</text>
+					<text
+						class="label right">{{ item.prevProcess == null ? item['productionQuantity']  : item['processQualifiedNum']}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">上道工序</text>
+					<text class="label right">{{ item.prevProcess ? item['prevProcess'].processAlias : '-'}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">当前工序</text>
+					<!-- <text
+						class="label right">{{ item.currentProcess ? item.prevProcess && item['currentProcess'].processAlias == item['prevProcess'].processAlias ? '-' : item['currentProcess'].processAlias : '-'}}</text> -->
+					<text
+						class="label right">{{ item.currentProcess ? item['currentProcess'].processAlias : '-'}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">下道工序</text>
+					<view class="label right uni-row">
+						{{ item.nextProcess ? item['nextProcess'].processAlias : '-' }}
+						(<view style="color:  #1684fc;" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表&nbsp;
+						</view>)
+					</view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">操作者</text>
+					<text class="label right">{{ item['allNickName'] }}</text>
+				</view>
+				<view v-if="notPreProcess" class="item-info uni-row">
+					<text class="label">所在区域</text>
+					<text class="label right">{{ item['place'] ? item['place'] : '-' }}</text>
+				</view>
+				<view
+					v-if="item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3"
+					class="item-info uni-row">
+					<text class="label">目标工段</text>
+					<text
+						class="label right">{{ item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3 ? item['dayworkItemList'][0].deptName : '-' }}</text>
+				</view>
+				<view
+					v-if="item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3"
+					class="item-info uni-row">
+					<text class="label">目标车间</text>
+					<text class="label right">{{ item['workshopName']}}</text>
+				</view>
+
+				<!-- 			<view v-if="item.protemResourceGroupDetailList && item.protemResourceGroupDetailList.length>0"
+					class="item-info uni-row">
+					<text class="label">邀请者</text>
+					<text
+						class="label right">{{ item['protemResourceGroupDetailList'] && item['protemResourceGroupDetailList'].length>0 ? item['protemResourceGroupDetailList'][0].protemCreatorName : '-' }}</text>
+				</view>
+				<view v-if="item.protemResourceGroupDetailList&& item.protemResourceGroupDetailList.length>0"
+					class="item-info uni-row">
+					<text class="label">已完成数量</text>
+					<text class="label right">{{ item['totalQuantity'] ? item['totalQuantity'] : 0 }}</text>
+				</view> -->
+				<view class="status-btn uni-row">
+					<view v-if="item['status'] == 2" class=" uni-row">
+						<button class="turnover-tag" size="mini"
+							@click.stop="handleShowTurnoverApplication(item)">周转申请</button>
+						<!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
+					</view>
+					<view v-else-if="item['status'] == 3" class=" uni-row">
+						<button class="turnover-tag" size="mini" @click.stop="handleCancelTurnover(item)"
+							style="background-color: rgba(255, 85, 85, 1);">取消周转</button>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 抽屉 -->
+		<uni-drawer ref="showRight" mode="right" :mask-click="true">
+			<view style="text-align: center; font-size: 48rpx; padding: 48rpx 0 24rpx 0;">工艺列表</view>
+			<view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
+				仅显示当前工序后面工艺
+			</view>
+			<scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
+				<view v-for="(item,index) in curProcessAfte" :key="index"
+					style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
+					<text>{{ index + 1 }}.{{item.processAlias}}</text>
+				</view>
+			</scroll-view>
+			<view><button v-if="!editStatus" class="view-end-btn" type="primary"
+					@click="handleOpenDrawing">查看本工序图纸</button></view>
+
+		</uni-drawer>
+		<dialog-turnoverApplicationAssist ref="turnoverApplicationDialog" @reflushDaywork="handleDoTurnoverAfter" />
+		<dialog-selectProduction ref="selectProduction"></dialog-selectProduction>
+	</view>
+
+</template>
+
+<script setup>
+	import {
+		normalizeProps,
+		reactive,
+		onMounted,
+		ref
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow,
+		onReachBottom
+	} from '@dcloudio/uni-app'
+	import {
+		getAssistDayWorkList,
+		showDaywork,
+		showDayworkSave,
+		turnoverDelete
+	} from '@/api/business/dayWork.js'
+	import {
+		isTakeStock
+	} from '@/api/business/taksStackLot.js'
+	import {
+		getAbnormalityLot
+	} from '@/api/business/lot.js'
+	import {
+		carrierFinishedCheck
+	} from '@/api/business/carrier.js'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		toHHmmss
+	} from '@/utils/common.js'
+	import {
+		onPullDownRefresh
+	} from "@dcloudio/uni-app"
+
+	const turnoverApplicationDialog = ref(null)
+	const selectProduction = ref(null)
+	const listData = ref([])
+	const curPlan = ref(null)
+	const bottomStatus = ref(false) // 底部按钮显示
+	const paging = ref();
+	const reqParam = ref(null);
+	const normalStatus = ref(true)
+	const isLoding = ref(false);
+	const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态	
+	const keywords = ref(null)
+	const tempList = ref([])
+	const wasteRecyclingList = ref([]) //废品回用批次
+	// 在数据中定义一个变量来控制遮罩层的显示
+	const isMaskShow = ref(false);
+	//打开图纸
+	//选中的daywork
+	const currentDaywork = ref({})
+	const editStatus = ref(false)
+	const notPreProcess = ref(true)
+	const curProcessAfte = ref([])
+	const showRight = ref(null) // 抽屉
+	const pageSize = ref(10)
+	const pageNum = ref(1)
+	const status = ref(true)
+
+
+
+	onLoad(() => {
+		curPlan.value = store.planDetails;
+		normalStatus.value = true;
+		//废品回用的领料部门如果是当前工段,也要可以开始新批次
+		//查找当前计划单下的批次废品回用是当前工段
+		// getAbnormalityLot({
+		// 	productionPlanDetailId: store.planDetails.id,
+		// 	requisitionDepartmentId: store.curDeptDetails.deptId
+		// }).then(res => {
+		// 	wasteRecyclingList.value = res.rows
+		// 	if (store.planDetails.requisitionDepartmentId == store.curDeptDetails.deptId ||
+		// 		wasteRecyclingList.value.length > 0) {
+		// 		bottomStatus.value = true;
+		// 		store.isPreProcess = true;
+		// 	} else {
+		// 		bottomStatus.value = false;
+		// 		store.isPreProcess = false;
+		// 	}
+		// })
+
+	})
+
+	// 页面下拉刷新操作
+	onPullDownRefresh(() => {
+		uni.stopPullDownRefresh();
+		reflush();
+	})
+
+
+	onShow(() => {
+		reflush();
+
+
+	})
+
+	;
+
+	function reflush() {
+		init();
+	}
+	//扫码
+	function handleScan() {
+		// 引入原生插件
+		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		if (mpaasScanModule) {
+			// 调用插件的 mpaasScan 方法
+			mpaasScanModule.mpaasScan({
+					// 扫码识别类型,参数可多选,qrCode、barCode,
+					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+					scanType: ["qrCode", "barCode"],
+					// 是否隐藏相册,默认false不隐藏
+					hideAlbum: false,
+				},
+				(ret) => {
+					console.log(ret);
+					let vehicleObj = {
+						carrierCode: ret.resp_result
+					};
+					if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+						uni.showToast({
+							icon: "none",
+							title: "请扫载具码",
+							duration: 1000
+						})
+						return;
+					}
+					keywords.value = vehicleObj.carrierCode
+					init();
+				}
+			);
+		} else {
+			// 测试时用
+			keywords.value = "000642"
+			init();
+		}
+	}
+
+	function handleShowTurnoverApplication(data) {
+		let productionPlan = {
+			id: data.productionPlanDetailId,
+			productionPlanId: data.productionPlanId,
+			productDescription: data.productDescription
+		}
+		store.planDetails = productionPlan
+		console.log(data)
+		//如果这批废了,则不能周转申请
+		if (data.isWaste == 1) {
+			uni.showToast({
+				icon: 'none',
+				title: '此批已废,不能申请周转',
+				duration: 2000
+			})
+		} else {
+			isTakeStock().then(response => {
+				if (response.data) {
+					uni.showToast({
+						icon: 'none',
+						title: '正在盘点,不能申请周转',
+						duration: 2000
+					})
+				} else {
+					let _data = data ?? {}
+					carrierFinishedCheck(data).then(res => {
+						if (res.code === 200) {
+							// 调用子组件中的方法
+							turnoverApplicationDialog.value.open(_data)
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg
+							})
+						}
+					})
+				}
+			})
+
+		}
+
+	}
+	onReachBottom(() => {
+		console.log(status.value)
+		if (status.value) {
+			pageNum.value += 1
+			uni.showLoading({
+				title: '加载中'
+			});
+			getAssistDayWorkList({
+				deptId: store.curDeptDetails.deptId,
+				keywords: keywords.value,
+				pageNum: pageNum.value,
+				pageSize: pageSize.value,
+				normalStatus: normalStatus.value
+			}).then(res => {
+				const existingIds = new Set(listData.value.map(item => item.lotCode));
+				console.log(listData.value)
+				// 过滤出那些不在 existingIds 中的项,即新数据
+				const newRows = res.data.filter(row => !existingIds.has(row.lotCode));
+				console.log(newRows)
+				tempList.value.concat(newRows)
+				// 如果有新数据,将其添加到 listData
+				if (newRows.length > 0) {
+					listData.value = listData.value.concat(newRows);
+
+					uni.hideLoading();
+				} else {
+					uni.hideLoading();
+					// 如果没有新数据,更新状态表示没有更多数据
+					status.value = false;
+				}
+			})
+		}
+		console.log(status.value)
+	})
+
+	function init() {
+		listData.value = []
+		uni.showLoading({
+			title: '加载中'
+		});
+		pageNum.value = 1
+		let reqData = {
+			deptId: store.curDeptDetails.deptId,
+			keywords: keywords.value,
+			pageNum: pageNum.value,
+			pageSize: pageSize.value,
+			normalStatus: normalStatus.value
+		};
+		// console.log(normalStatus.value)
+
+		getAssistDayWorkList(reqData).then(res => {
+			console.log(res.data)
+			if (res.code == 200) {
+				res.data.forEach(item => {
+					let quantitySum = 0;
+					item.dayworkItemList.forEach(info => {
+						if (info.status < 4 && item.currentProcess.processStepNumber == info
+							.processStepNumber) {
+							quantitySum += info.qualifiedNum;
+						}
+					});
+					item.totalQuantity = quantitySum;
+				});
+				tempList.value = res.data
+				// console.log(res)
+				listData.value = res.data
+			}
+
+			uni.hideLoading();
+		})
+	}
+
+	function handleSearch() {
+		init();
+
+	}
+
+	function handleToreportingForWork(item) {
+		if (item.requisitionDepartmentId == store.curDeptDetails.deptId) {
+			store.isPreProcess = true;
+		} else {
+			store.isPreProcess = false;
+		}
+		let productionPlan = {
+			id: item.productionPlanDetailId,
+			productionPlanId: item.productionPlanId,
+			productDescription: item.productDescription
+		}
+		store.dayworkInfo = item
+		store.planDetails = productionPlan
+		uni.navigateTo({
+			url: "/pages/assistReportingForWork/index"
+		})
+	}
+
+	function handleClickProcessList(item) {
+		let curProcessAfterList = [];
+		console.log("工序列表", item)
+		currentDaywork.value = item
+		editStatus.value = false
+		// if (item.isWasteRecycling == 1 || item.isAmend == 1) {
+		// 	editStatus.value = true
+		// } else {
+		// 	editStatus.value = false
+		// }
+		let nextIndex = 0;
+		for (let i = 0; i < item.processSequence.length; i++) {
+			if (item.nextProcess) {
+				if (item.nextProcess.processStepNumber == item.processSequence[i].processStepNumber) {
+					nextIndex = i;
+				}
+			} else {
+				nextIndex = item.processSequence.length
+			}
+		}
+		for (let i = 0; i < item.processSequence.length; i++) {
+			if (i >= nextIndex) {
+				curProcessAfterList.push(item.processSequence[i]);
+			}
+		}
+		if (item.status == 3) {
+			curProcessAfterList.splice(0, 1)
+		}
+		console.log(curProcessAfterList)
+		curProcessAfte.value = curProcessAfterList;
+		showRight.value.open();
+	}
+
+	function handleSearchCode() {
+		// console.log(normalStatus.value)
+		selectProduction.value.open(normalStatus.value);
+	}
+
+	function switchChange(event) {
+		uni.pageScrollTo({
+
+			scrollTop: 0,
+
+			duration: 100
+
+		});
+		pageNum.value = 1
+		console.log(event)
+		//异常批
+		if (normalStatus.value) {
+			normalStatus.value = false
+			init()
+		} else {
+			//正常批
+			normalStatus.value = true
+			init()
+		}
+	}
+
+	function handleOpenDrawing() {
+		console.log(currentDaywork.value, "444")
+
+		var filteredProcess = currentDaywork.value.processSequence.filter(item => item.processStepNumber == currentDaywork
+			.value.currentProcess.processStepNumber);
+
+		// 检查 filteredProcess 是否有元素,并选择第一个元素
+		if (filteredProcess.length > 0) {
+			var firstMatch = filteredProcess[0]; // 获取第一个匹配的对象
+			console.log("currentDaywork", currentDaywork.value)
+			// 对 technologicalProcessDetailId 进行URL编码
+			var encodedId = encodeURIComponent(currentDaywork.value.productId);
+			var enTechnologicalProcessId = encodeURIComponent(currentDaywork.value.technologicalProcessId);
+			var enprocessCode = encodeURIComponent(firstMatch.processCode);
+			var encodeCode = encodeURIComponent(currentDaywork.value.lotCode);
+			var enProcessAlias = encodeURIComponent(firstMatch.processAlias);
+			var enIsWasteRecycling = encodeURIComponent(currentDaywork.value.isWasteRecycling);
+			var enIsAmend = encodeURIComponent(currentDaywork.value.isAmend);
+			// 构建查询参数字符串
+			var queryParam =
+				`param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}&param6=${enIsWasteRecycling}&param7=${enIsAmend}`;
+
+			// 使用模板字符串构建完整的URL
+			var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+
+			// 导航到指定页面
+			uni.navigateTo({
+				url: navigateUrl
+			});
+		} else {
+			console.log('No process matched the current process step number.');
+		}
+	}
+
+	function handleDoTurnoverAfter() {
+		reflush();
+	}
+
+
+
+
+	function handleCancelTurnover(data) {
+		isTakeStock().then(response => {
+			if (response.data) {
+				uni.showToast({
+					icon: 'none',
+					title: '正在盘点,不能取消周转',
+					duration: 2000
+				})
+			} else {
+				isMaskShow.value = true; // 显示遮罩层
+				uni.showLoading({
+					title: '加载中'
+				});
+				turnoverDelete(data).then(res => {
+					isMaskShow.value = false
+					if (res.code == 200) {
+						uni.showToast({
+							icon: "success",
+							title: "取消成功",
+							duration: 2000
+						})
+						isLoding.value = false;
+						setTimeout(() => {
+							init(store.planDetails.id);
+						}, 1000);
+					} else {
+						uni.showToast({
+							icon: "none",
+							title: "取消失败",
+							duration: 2000
+						})
+						isLoding.value = false;
+						setTimeout(() => {
+							init(store.planDetails.id);
+						}, 1000);
+					}
+				})
+			}
+		})
+	}
+</script>
+
+<style lang="scss">
+	$nav-height: 60rpx;
+
+	/* 遮罩层样式 */
+	.mask {
+		position: fixed;
+		/* 固定定位,覆盖整个屏幕 */
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		background-color: rgba(0, 0, 0, 0.3);
+		/* 黑色背景,透明度30% */
+		display: flex;
+		justify-content: center;
+		/* 水平居中 */
+		align-items: center;
+		/* 垂直居中 */
+		z-index: 1000;
+		/* 确保遮罩层在其他元素之上 */
+	}
+
+	.box-bg {
+		width: 94%;
+		background-color: #F5F5F5;
+		padding: 5rpx 16rpx;
+		justify-content: space-around;
+		align-items: center;
+		margin: 24rpx auto 0;
+
+		.input-view {
+			width: 100%;
+			flex: 4;
+			background-color: #f8f8f8;
+			height: $nav-height;
+			border: 1rpx solid #999;
+			border-radius: 15rpx;
+			padding: 0 15rpx;
+			flex-wrap: nowrap;
+			margin: 0 10rpx 0;
+			line-height: $nav-height;
+
+			.input-uni-icon {
+				line-height: $nav-height;
+			}
+
+			.nav-bar-input {
+				width: 80%;
+				height: $nav-height;
+				line-height: $nav-height;
+				padding: 0 5rpx;
+				background-color: #f8f8f8;
+			}
+		}
+
+		.search {
+			width: 20%;
+			text-align: center;
+			color: #808080;
+		}
+	}
+
+	.list-title {
+		width: 100%;
+		margin-top: 16rpx;
+		height: 64rpx;
+		line-height: 64rpx;
+		align-items: center;
+		margin-left: 32rpx;
+
+		.label {
+
+			font-size: 32rpx;
+			margin-right: 24rpx;
+		}
+
+		.icon-gear {
+			font-size: 56rpx;
+		}
+	}
+
+	.switch {
+		margin-top: -8rpx;
+		transform: scale(0.7);
+	}
+
+	.scroll-container {
+		width: 92%;
+		margin: 24rpx auto 0 auto;
+		height: calc(90% - 100rpx);
+		overflow: scroll
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		margin-bottom: 24rpx;
+		border-radius: 24rpx;
+
+		.title-container {
+
+			margin-top: 8rpx;
+			margin-bottom: 16rpx;
+
+			.title {
+				height: 48rpx;
+				align-items: center;
+
+				.label {
+					font-size: 32rpx;
+					font-weight: bold;
+
+					&.code {
+						margin-left: 8rpx;
+					}
+				}
+			}
+
+			.tag {
+				border: 1px solid #1CE5B0;
+				background-color: #F6FFFD;
+				padding: 8rpx;
+				border-radius: 8rpx;
+
+				.label {
+					color: #1CE5B0;
+					font-size: 24rpx;
+				}
+
+				&.finished {
+					border: 1px solid #BBBBBB;
+					background-color: #F5F5F5;
+
+					.label {
+						color: #BBBBBB;
+					}
+				}
+
+				&.turnover {
+					border: 1px solid #FF7901;
+					background-color: #F6FFFD;
+
+					.label {
+						color: #FF7901;
+					}
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 220rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+
+		.status-btn {
+			justify-content: flex-end;
+			align-items: center;
+
+			.turnover-tag {
+				padding-right: 12rpx;
+				padding-left: 12rpx;
+				border-radius: 8rpx;
+				border: 1rpx solid #FF7901;
+				background-color: #FF7901;
+				font-size: 28rpx;
+				color: #FFFFFF;
+
+			}
+
+			.reporting-tag {
+				padding-right: 12rpx;
+				padding-left: 12rpx;
+				border-radius: 8rpx;
+				margin-left: 16rpx;
+				border: 1rpx solid #1684fc;
+				background-color: #1684fc;
+				font-size: 28rpx;
+				color: #FFFFFF;
+
+			}
+		}
+	}
+
+	.scan-btn {
+		height: 64rpx;
+		color: #ffffff;
+		background-color: #f47c3c;
+		align-items: center;
+		justify-content: center;
+		border-radius: 8rpx;
+		flex: 1;
+	}
+</style>

+ 505 - 0
pages/assistReportingForWork/index.vue

@@ -0,0 +1,505 @@
+<template>
+	<view class="uni-column container">
+		<view class="scroll-container">
+			<view v-for="(item, index) in listData" :key="index" class="list-item">
+				<view class="title-container">
+					<view class="title uni-row">
+						<view class="uni-row">
+							<text class="label">批次号:</text>
+							<text class="label code"> {{ item['lotCode'] }}</text>
+						</view>
+						<view style="color: #1684fc; margin-right: 0;" @click="handleOpenLonInfo">
+							<text>批次详情</text>
+						</view>
+					</view>
+					<view class="uni-row">
+						<view class="right-info uni-row"> <text class="label">工时</text>
+							<text class="label time">{{ item['taskTime'] }}</text>
+							<!-- <text class="label time">{{ item['taskTime'] }}h</text> -->
+						</view>
+						<view class="right-info uni-row" style="margin-left: 50rpx;"> <text class="label">合格数</text>
+							<text class="label number ">{{ item['qualifiedNum'] }}</text>
+						</view>
+					</view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ item['productDescription'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">操作者</text>
+					<text class="label right">{{ item['nickName'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">开始时间</text>
+					<text class="label right">{{ item['startTime'] ? item['startTime'] : '-' }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">结束时间</text>
+					<text class="label right">{{ item['endTime'] ? item['endTime'] : '-' }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">废品数</text>
+					<text class="label right">{{ item['rejectSum'] ? item['rejectSum'] : 0 }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">投入数</text>
+					<text
+						class="label right">{{store.dayworkInfo.prevProcess == null ?  store.dayworkInfo['productionQuantity'] : store.dayworkInfo['processQualifiedNum']}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">设备</text>
+					<text class="label right">{{ item['equipmentDetailCode']}}</text>
+				</view>
+				<view v-if="item['status'] == 1" class="status-btn uni-row ">
+					<button class="finished-turnover-tag" size="mini"
+						@click.stop="handleShowEndWorkDialog(item)">结束报工</button>
+				</view>
+			</view>
+		</view>
+		<view class="bottom uni-row">
+			<button class="bottom-btn left-btn" @click="handleChangevehicle"><text class="label">更换载具</text></button>
+		</view>
+		<dialog-end-work ref="endWorkDialog" @resflushItem='resflushItem' />
+	</view>
+	<dialog-lotInfo ref="lotInfo"></dialog-lotInfo>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getAssistDayWorkItemList,
+		saveDayWorkItemBatch,
+		updateDayWorkItem
+	} from "@/api/business/dayWorkItem.js"
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		timestampToTime,
+		toHHmmss
+	} from '@/utils/common.js'
+	import {
+		checkBizDayworkCarriers
+	} from '@/api/business/dayWork.js'
+	import {
+		isCurProcessFinish
+	} from '@/api/business/dayWorkItem.js'
+	import {
+		getEquipmentByUidAndDid
+	} from '@/api/resourceGroup/resourceGroupDetail.js'
+
+	const listData = ref([]) // 回显 
+	const curPlan = ref({}) // 接收生产计划单信息 
+	const dayWorkInfo = ref({}) // 接收daywork信息
+	const equipmentList = ref([]) // 设备列表
+	const endWorkDialog = ref(null) // 组件
+	const selectEquipment = ref(null) // 组件   
+	const inviteUser = ref(null) // 组件  
+	const dayWorkItem = ref({}) // 添加传输对象
+	const reqParam = ref([]) // 请求参数
+	const userInfo = ref(null) // 登录员工信息
+	const flag = ref(true) // 控制底部开始加工按钮功能
+	const lotInfo = ref(null) // 详情弹窗
+	const hasEquipment = ref(true) // 判断资源组是否有设备
+
+
+	onLoad(() => {
+		curPlan.value = store.planDetails;
+		dayWorkInfo.value = store.dayworkInfo;
+		init();
+	})
+	// onUnload(() => {
+	// 	uni.$off('dayworkItemUpdate', reflush)
+	// })
+
+	onShow(() => {
+		uni.$on('dayworkItemUpdate', reflush)
+	})
+
+	function init() {
+		console.log(store.dayworkInfo)
+		userInfo.value = store.userInfo;
+		uni.showLoading({
+			title: '加载中'
+		});
+		getAssistDayWorkItemList({
+			dayworkId: dayWorkInfo.value.id,
+			lotId: dayWorkInfo.value.lotId,
+			isWasteRecycling: dayWorkInfo.value.isWasteRecycling,
+			isAmend: dayWorkInfo.value.isAmend,
+			processStepNumber: dayWorkInfo.value.currentProcess.processStepNumber,
+			// processId: store.dayworkInfo.currentProcess.id,
+			type: '非周转中item'
+		}).then(res => {
+			if (res.code == 200) {
+				listData.value = res.rows || [];
+				console.log(listData.value)
+				// 时间戳转工时
+				for (var i = 0; i < listData.value.length; i++) {
+					let timeStamp = listData.value[i].workingHours;
+					listData.value[i].taskTime = toHHmmss(timeStamp);
+					listData.value[i].assistUserId = store.userInfo.userId
+					listData.value[i].assistUserName = store.userInfo.userName
+					listData.value[i].assistNickName = store.userInfo.nickName
+				}
+				flag.value = !listData.value.some(item => item.status == 0);
+				uni.hideLoading();
+			} else {
+				uni.showToast({
+					icon: "error",
+					title: res.message,
+					duration: 1000
+				})
+				uni.hideLoading();
+			}
+		})
+
+		getEquipmentByUidAndDid(store.planDetails.id, store.curDeptDetails.deptId, store.dayworkInfo.lotId).then(
+			equipmentRes => {
+				if (equipmentRes.code == 200) {
+					hasEquipment.value = equipmentRes.rows.length > 0 ? true : false;
+				}
+			})
+	}
+
+	function reflush() {
+		init();
+	}
+
+	function resflushItem() {
+		reflush();
+	}
+
+	function handleOpenLonInfo() {
+		lotInfo.value.open();
+	}
+
+	function handleShowEndWorkDialog(data) {
+		console.log(data)
+		checkBizDayworkCarriers({
+			id: store.dayworkInfo.id
+		}).then(res => {
+			if (res.code == 200) {
+				// 调用子组件中的方法
+				endWorkDialog.value.open(data, listData)
+			} else {
+				uni.showToast({
+					icon: "none",
+					title: res.msg + ",请绑定",
+					duration: 2000
+				})
+				uni.navigateTo({
+					url: "/pages/changeBox/index"
+				})
+			}
+		})
+	}
+
+	function handleChangevehicle() {
+		if (store.dayworkInfo.status == 4) {
+			uni.showToast({
+				icon: 'none',
+				title: '该工序已完成'
+			})
+		} else {
+			uni.navigateTo({
+				url: "/pages/changeBox/index"
+			})
+		}
+	}
+	//送检跳转
+	function HandleSendInspection() {
+		uni.navigateTo({
+			url: "/pages/firstInspection/scan"
+		})
+	}
+
+	function getEquipment(data) {
+		console.log(data);
+		equipmentList.value = data;
+	}
+
+	function handleStartProcessing(item) {
+		// 查询当前工序是否完成再判断是否进行报工
+		isCurProcessFinish({
+			dayworkId: store.dayworkInfo.id,
+			processId: listData.value[0].processId
+		}).then(res => {
+			if (store.dayworkInfo.status == 4) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前批次已完成'
+				})
+			} else if (res.data) {
+				uni.showToast({
+					icon: 'none',
+					title: '该工序已完成,不能继续报工'
+				})
+			} else if (!hasEquipment.value) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前无可用设备',
+				})
+			} else {
+				selectEquipment.value.open(item);
+			}
+		})
+		// }
+	}
+
+	/**
+	 * 新批次默认item去报工(执行方法)
+	 * @param {Object} item
+	 */
+	function handleStartFirstItem(item) {
+		let reqParam = item;
+		reqParam.status = 1;
+		reqParam.startTime = timestampToTime(new Date());
+		updateDayWorkItem(reqParam).then(res => {
+			if (res.code === 200) {
+				uni.showToast({
+					icon: "success",
+					title: "报工成功",
+					duration: 2000
+				})
+				init();
+			} else {
+				uni.showToast({
+					icon: "none",
+					title: "报工失败,请联系管理员",
+					duration: 2000
+				})
+			}
+		})
+	}
+
+	function handleAddDayWorkItem(data) {
+		console.log(data)
+		if (data.dayworkId) { // data里面任意一对象除了设备相关的字段存在,直接给reqParam赋值
+			reqParam.value = {
+				...data,
+				productionPlanId: curPlan.value.productionPlanId,
+				productionPlanDetailId: curPlan.value.id,
+				technologicalProcessId: dayWorkInfo.value.technologicalProcessId,
+				prodNum: store.dayworkInfo.prevProcess == null ?
+					store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo[
+						'oneLotQuantity'] : store.dayworkInfo['processQualifiedNum'],
+				deptId: store.curDeptDetails.deptId,
+				tenantId: !store.tenantId ? store.userInfo.tenantId : store.tenantId,
+				deptName: store.curDeptDetails.deptName
+			}
+		} else {
+			// equipmentList.value = data;
+			dayWorkItem.value = {
+				dayworkId: dayWorkInfo.value.id,
+				lotId: dayWorkInfo.value.lotId,
+				productionPlanId: curPlan.value.productionPlanId,
+				productionPlanDetailId: curPlan.value.id,
+				technologicalProcessId: dayWorkInfo.value.technologicalProcessId,
+				prodNum: store.dayworkInfo.prevProcess == null ?
+					store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo[
+						'oneLotQuantity'] : store.dayworkInfo['processQualifiedNum'],
+				status: 1,
+				startTime: timestampToTime(new Date()),
+				deptId: store.curDeptDetails.deptId,
+				deptName: store.curDeptDetails.deptName,
+				tenantId: !store.tenantId ? store.userInfo.tenantId : store.tenantId,
+				...data
+			}
+			reqParam.value = dayWorkItem.value;
+		}
+		console.log(reqParam.value)
+		saveDayWorkItemBatch(reqParam.value).then(res => {
+			if (res.code === 200) {
+				uni.showToast({
+					icon: 'success',
+					title: '操作成功',
+					duration: 2000
+				});
+				reqParam.value = [];
+				reflush();
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: '操作失败',
+					duration: 2000
+				});
+			}
+		})
+	}
+</script>
+
+<style lang="scss">
+	.container {
+		// height: calc(100% - 232rpx);
+		background-color: #f5f5f5;
+		position: absolute;
+		left: 0;
+		right: 0;
+		height: 100%;
+	}
+
+
+	.scroll-container {
+		height: 88%;
+		position: relative;
+		top: 16rpx;
+		overflow: auto;
+		// right: 0;
+		// bottom: 144rpx;
+		// left: 0;
+	}
+
+	.selected {
+		border: 1px solid #1684fc;
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		margin: 0 24rpx;
+		margin-bottom: 24rpx;
+		border-radius: 8rpx;
+
+		.title-container {
+			margin: 8rpx 0;
+			width: 100%;
+
+			.title {
+				height: 48rpx;
+				justify-content: space-between;
+				align-items: center;
+				flex: 7;
+
+				.label {
+					// font-size: 32rpx;
+					font-weight: bold;
+				}
+
+				.code {
+					margin-left: 8rpx;
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 152rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+
+		.right-info {
+
+			// justify-content: flex-end;
+			// width:45%;
+			// margin-top: 5rpx;
+			.label {
+				font-size: 28rpx;
+			}
+
+			.time {
+				margin-left: 8rpx;
+				color: #1684fc;
+			}
+
+			.number {
+				margin-left: 8rpx;
+				color: #1684fc;
+			}
+
+		}
+	}
+
+	.top {
+		position: fixed;
+		right: 0;
+		bottom: 100rpx;
+		left: 0;
+		height: 100rpx;
+		padding: 16rpx 24rpx;
+		align-items: center;
+		background-color: #FFFFFF;
+		justify-content: space-between;
+
+		.bottom-btn {
+			flex: 1;
+			font-size: 28rpx;
+			color: #FFFFFF;
+
+			&.left-btn {
+				background-color: rgba(0, 226, 166, 1);
+			}
+
+			&.right-btn {
+				margin-left: 24rpx;
+			}
+		}
+	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		padding: 16rpx 24rpx;
+		align-items: center;
+		background-color: #FFFFFF;
+		justify-content: space-between;
+
+		.bottom-btn {
+			flex: 1;
+			font-size: 28rpx;
+			color: #FFFFFF;
+
+			&.left-btn {
+				background-color: rgba(0, 226, 166, 1);
+			}
+
+			&.right-btn {
+				margin-left: 24rpx;
+			}
+		}
+	}
+
+	.status-btn {
+		width: 100%;
+		justify-content: flex-end;
+
+		.finished-turnover-tag {
+			margin: unset;
+			border-radius: 8rpx;
+			background-color: rgb(255, 85, 85);
+			font-size: 28rpx;
+			color: #FFFFFF;
+		}
+
+		.start-turnover-tag {
+			margin: unset;
+			border-radius: 8rpx;
+			font-size: 28rpx;
+			color: #FFFFFF;
+		}
+	}
+</style>

+ 28 - 1
pages/dashboard/index.vue

@@ -37,6 +37,10 @@
 			@click="handleToProductionPlan">
 			<text class="label">报工</text>
 		</view>
+		<view class="business-btn uni-row" v-if="showOther && !showSizing && !showOutsource && showAssistDaywork"
+			@click="handleToAssistDaywork">
+			<text class="label">集中报工</text>
+		</view>
 		<view class="business-btn uni-row" v-if="showInnerTurnover && !showOutsource" @click="handleInnerTurnover">
 			<text class="label">内部周转</text>
 		</view>
@@ -168,6 +172,7 @@
 	const showFirstArticleInspection = ref(false)
 	const showOutSourceList = ref(false)
 	const showChangeTurnover = ref(false)
+	const showAssistDaywork = ref(false)
 
 	onLoad(() => {
 		console.log(store.userInfo)
@@ -230,6 +235,12 @@
 		} else {
 			showAdjust.value = false
 		}
+		//协助报工
+		if (store.userInfo.roles.some(item => item.roleKey == 'assistDaywork')) {
+			showAssistDaywork.value = true
+		} else {
+			showAssistDaywork.value = false
+		}
 		if (store.userInfo.permissions.some(item => item === 'business:outsource:checkBox') || store.userInfo
 			.permissions.some(item => item === "*:*:*")) {
 			showOutSourceList.value = true;
@@ -312,7 +323,9 @@
 					console.log(store)
 					handleSelectInnerTurnover()
 				}
-				if (res.data.some(v => v.hasQuick === 1)) {
+				if (res.data.some(v => v.hasQuick === 1) && (store.userInfo.permissions.some(item => item ===
+							'business:quickDaywork:list') || store.userInfo
+						.permissions.some(item => item === "*:*:*"))) {
 					showQuick.value = true
 				} else {
 					showQuick.value = false
@@ -587,6 +600,19 @@
 			url: '/pages/outsourcedReturnCheck/index'
 		})
 	}
+	//协助报工
+	function handleToAssistDaywork() {
+		if (curSelectedDeptId.value) {
+			uni.navigateTo({
+				url: '/pages/assistDaywork/index'
+			})
+		} else {
+			uni.showToast({
+				icon: "none",
+				title: "请选择工段"
+			})
+		}
+	}
 	// 
 	function handleChangeTurnover() {
 		if (curSelectedDeptId.value) {
@@ -824,6 +850,7 @@
 		justify-content: center;
 		border: 1rpx solid #e1e1e1;
 		border-radius: 8rpx;
+		z-index: 5;
 
 		.label {
 			font-size: 35rpx;

+ 78 - 78
pages/fastProductionPlan/index.vue

@@ -271,90 +271,90 @@
 	*/
 
 	function handleAdd() {
-		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
-		if (mpaasScanModule) {
-			// 调用插件的 mpaasScan 方法
-			mpaasScanModule.mpaasScan({
-					// 扫码识别类型,参数可多选,qrCode、barCode,
-					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
-					scanType: ["qrCode", "barCode"],
-					// 是否隐藏相册,默认false不隐藏
-					hideAlbum: false,
-				},
-				(ret) => {
-					let vehicleObj = {
-						carrierCode: ret.resp_result
-					};
-					if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
-						uni.showToast({
-							icon: "none",
-							title: "请扫载具码",
-							duration: 1000
-						})
-						return;
-					}
-					getDayworkByCarrierCode({
-						carrierCode: vehicleObj.carrierCode,
-						deptId: store.curDeptDetails.deptId,
-						status: 7
-					}).then(response => {
-						if (response.code == 200) {
-							if (response.data.items.length > 0) {
-								lotReporting.value.open(response.data);
-							} else {
-								uni.showToast({
-									icon: 'none',
-									title: '该批次不在此计划单内, 或不在当前工段',
-									duration: 2000
-								})
-							}
-						} else {
-							uni.showToast({
-								icon: 'none',
-								title: response.msg,
-								duration: 2000
-							})
-						}
-					})
-				}
-			);
-		} else {
-			// 测试时用
-			getDayworkByCarrierCode({
-				carrierCode: '000702',
-				status: 7,
-				deptId: store.curDeptDetails.deptId
-			}).then(response => {
-				console.log(response)
-				if (response.code == 200) {
-					// 
-					// if (response.data.items[0].deptId !== store.curDeptDetails.deptId) {
-					// 	uni.showToast({
-					// 		icon: 'none',
-					// 		title: '该批次不在当前工段',
-					// 		duration: 2000
-					// 	})
-					// 	return
-					// }
-					if (response.data.items.length > 0) {
-						// console.log(response.data)
-						lotReporting.value.open(response.data);
-					} else {
-						uni.showToast({
-							icon: 'none',
-							title: '该批次不在此计划单内, 或不在当前工段',
-							duration: 2000
-						})
-					}
+		// const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		// if (mpaasScanModule) {
+		// 	// 调用插件的 mpaasScan 方法
+		// 	mpaasScanModule.mpaasScan({
+		// 			// 扫码识别类型,参数可多选,qrCode、barCode,
+		// 			// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+		// 			scanType: ["qrCode", "barCode"],
+		// 			// 是否隐藏相册,默认false不隐藏
+		// 			hideAlbum: false,
+		// 		},
+		// 		(ret) => {
+		// 			let vehicleObj = {
+		// 				carrierCode: ret.resp_result
+		// 			};
+		// 			if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+		// 				uni.showToast({
+		// 					icon: "none",
+		// 					title: "请扫载具码",
+		// 					duration: 1000
+		// 				})
+		// 				return;
+		// 			}
+		// 			getDayworkByCarrierCode({
+		// 				carrierCode: vehicleObj.carrierCode,
+		// 				deptId: store.curDeptDetails.deptId,
+		// 				status: 7
+		// 			}).then(response => {
+		// 				if (response.code == 200) {
+		// 					if (response.data.items.length > 0) {
+		// 						lotReporting.value.open(response.data);
+		// 					} else {
+		// 						uni.showToast({
+		// 							icon: 'none',
+		// 							title: '该批次不在此计划单内, 或不在当前工段',
+		// 							duration: 2000
+		// 						})
+		// 					}
+		// 				} else {
+		// 					uni.showToast({
+		// 						icon: 'none',
+		// 						title: response.msg,
+		// 						duration: 2000
+		// 					})
+		// 				}
+		// 			})
+		// 		}
+		// 	);
+		// } else {
+		// 测试时用
+		getDayworkByCarrierCode({
+			carrierCode: '000650',
+			status: 7,
+			deptId: store.curDeptDetails.deptId
+		}).then(response => {
+			console.log(response)
+			if (response.code == 200) {
+				// 
+				// if (response.data.items[0].deptId !== store.curDeptDetails.deptId) {
+				// 	uni.showToast({
+				// 		icon: 'none',
+				// 		title: '该批次不在当前工段',
+				// 		duration: 2000
+				// 	})
+				// 	return
+				// }
+				if (response.data.items.length > 0) {
+					// console.log(response.data)
+					lotReporting.value.open(response.data);
 				} else {
 					uni.showToast({
 						icon: 'none',
-						title: response.msg,
+						title: '该批次不在此计划单内, 或不在当前工段',
 						duration: 2000
 					})
 				}
-			})
-		}
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: response.msg,
+					duration: 2000
+				})
+			}
+		})
+		// }
 		// lotReporting.value.open(data);
 	}