wangxin пре 1 година
родитељ
комит
957184ed47

+ 11 - 3
api/business/dayWorkItem.js

@@ -96,7 +96,7 @@ export function listItem(data) {
 
 export function getIsFirstOrder(dayWorkId) {
 	return req.request({
-		url: '/business/dayworkItem/getIsFirstOrder/'+dayWorkId,
+		url: '/business/dayworkItem/getIsFirstOrder/' + dayWorkId,
 		method: 'GET',
 	})
 }
@@ -105,7 +105,7 @@ export function getIsFirstOrder(dayWorkId) {
 
 
 
-export function getDayWorkItemHistory(startTime,endTime) {
+export function getDayWorkItemHistory(startTime, endTime) {
 	return req.request({
 		url: '/business/dayworkItem/getDayWorkItemHistory?startTime=' + startTime + '&endTime=' + endTime,
 		method: 'GET',
@@ -116,6 +116,14 @@ export function turnover(data) {
 	return req.request({
 		url: '/business/dayworkItem/turnover',
 		method: 'POST',
-		data:data
+		data: data
+	})
+}
+
+export function turnoverOutsource(data) {
+	return req.request({
+		url: '/business/dayworkItem/turnoverOutsource',
+		method: 'POST',
+		data: data
 	})
 }

+ 119 - 68
components/dialog-turnoverApplication/dialog-turnoverApplication.vue

@@ -1,37 +1,42 @@
 <template>
 	<dialog-base ref="baseDialog" title="周转申请">
 		<view class="list-container">
-			<view ><text  style="margin: 0 0 0 5rpx;">请选择周转类型</text></view>
+			<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>
+					@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"
+			<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"
+				<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 >
-				<text style="margin: 0 0 0 5rpx;">请选择您摆放位置</text>
+			<view v-if="curDayworkItem.turnoverType != '3'">
+				<text style=" margin: 0 0 0 5rpx;">请选择您摆放位置</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>
+						@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>
+						@click="selectTurnoverDoorOutside(item)"><text class="label"
+							style="font-size: 30rpx;">{{item.code}}</text></view>
 				</view>
 			</view>
 		</view>
@@ -58,7 +63,8 @@
 	import {
 		getDayWorkItemList,
 		saveDayWorkItem,
-		turnover
+		turnover,
+		turnoverOutsource
 	} from '@/api/business/dayWorkItem.js'
 	import {
 		getDeptList
@@ -125,16 +131,18 @@
 	function init() {
 		getDictInfoByType('daywork_turnover_type').then(res => {
 			turnoverType.value = res.data;
-			getTurnoverByWorkshop({ deptId: store.curDeptDetails.deptId }).then(res => {
+			getTurnoverByWorkshop({
+				deptId: store.curDeptDetails.deptId
+			}).then(res => {
 				turnoverArea.value = res.data;
 			})
 		})
 		getDayWorkItemList({
 			dayworkId: dayworkInfo.value.id,
 			userId: store.userInfo.userId,
-			lotId:dayworkInfo.value.lotId,
-			isWasteRecycling:dayworkInfo.value.isWasteRecycling,
-			processStepNumber:dayworkInfo.value.currentProcess.processStepNumber
+			lotId: dayworkInfo.value.lotId,
+			isWasteRecycling: dayworkInfo.value.isWasteRecycling,
+			processStepNumber: dayworkInfo.value.currentProcess.processStepNumber
 		}).then(res => {
 			curDayworkItem.value = {
 				...res.rows[0],
@@ -145,9 +153,9 @@
 		getDeptList({
 			tenantId: store.tenantId,
 			productionPlanDetailId: store.planDetails.id,
-			lotId:dayworkInfo.value.lotId,
-			isWasteRecycling:dayworkInfo.value.isWasteRecycling,
-			isAmend:dayworkInfo.value.isAmend
+			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;
@@ -166,8 +174,8 @@
 					})
 				}
 			}
-			 console.log(insideDepts.value)
-			 console.log(outsideDepts.value)
+			console.log(insideDepts.value)
+			console.log(outsideDepts.value)
 		})
 	}
 
@@ -204,68 +212,112 @@
 		}
 	}
 
-	function handleConfirm() {
-		//console.log(dayworkInfo.value)
+	function handleConfirmOutsource() {
 		curDayworkItem.value.id = null;
-		curDayworkItem.value.status = curDayworkItem.value.turnoverType == '1' ? '7' : '4';
 		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;
 		}
-		// 过滤出周转位置的数组,并转换成字符串
-		const newArray = selection.value.map((item) => {
-			if (item.code) {
-				return item.code;
-			} else if (item.dictLabel) {
-				return item.dictLabel;
+		curDayworkItem.value.turnoverArea = "外协周转";
+
+		/**** 此处暂时为硬编码,170000为外协部门编码,根据编码查询信息 ***/
+		curDayworkItem.value.deptCode = 170000;
+
+		close();
+		turnoverOutsource(curDayworkItem.value).then(res => {
+			if (res.code === 200) {
+				uni.showToast({
+					icon: 'success',
+					title: '操作成功'
+				});
+				emit('reflushDaywork');
 			} else {
-				return null;
+				uni.showToast({
+					icon: 'none',
+					title: '操作失败'
+				});
 			}
 		})
-		if (curDayworkItem.value.turnoverType == '1') {
-			curDayworkItem.value.place = newArray.join('、');
-			curDayworkItem.value.turnoverArea = "车间内周转看place字段";
+	}
+
+	function handleConfirm() {
+		if (curDayworkItem.value.turnoverType == '3') {
+			handleConfirmOutsource();
 		} else {
-			curDayworkItem.value.turnoverArea = newArray.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(dayworkInfo.value)
+			curDayworkItem.value.id = null;
+			curDayworkItem.value.status = curDayworkItem.value.turnoverType == '1' ? '7' : '4';
+			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;
 			}
-		}
-		// console.log(curDayworkItem.value);
-		// console.log(dayworkInfo.value)
-		if (!handleValidate(curDayworkItem.value)) {
-			uni.showToast({
-				icon: "none",
-				title: '请选择完整信息'
-			});
-		} else {
-			close();
-			turnover(curDayworkItem.value).then(res => {
-				if (res.code === 200) {
-					uni.showToast({
-						icon: 'success',
-						title: '操作成功'
-					});
-					emit('reflushDaywork');
+
+
+
+			// 过滤出周转位置的数组,并转换成字符串
+			const newArray = selection.value.map((item) => {
+				if (item.code) {
+					return item.code;
+				} else if (item.dictLabel) {
+					return item.dictLabel;
 				} else {
-					uni.showToast({
-						icon: 'none',
-						title: '操作失败'
-					});
+					return null;
 				}
 			})
+			if (curDayworkItem.value.turnoverType == '1') {
+				curDayworkItem.value.place = newArray.join('、');
+				curDayworkItem.value.turnoverArea = "车间内周转看place字段";
+			} else {
+				curDayworkItem.value.turnoverArea = newArray.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 {
+				close();
+				turnover(curDayworkItem.value).then(res => {
+					if (res.code === 200) {
+						uni.showToast({
+							icon: 'success',
+							title: '操作成功'
+						});
+						emit('reflushDaywork');
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: '操作失败'
+						});
+					}
+				})
+			}
+			// emit('confirm');
 		}
-		// emit('confirm');
+
+
 	}
 
 	function handleChangeInside() {
@@ -281,11 +333,10 @@
 			}
 		})
 	}
-	
-	function handleChangeOutside(){
+
+	function handleChangeOutside() {
 		//console.log(curDayworkItem.value.deptId)
 	}
-	
 </script>
 
 <style lang="scss">

+ 10 - 8
pages/batchReporting/index.vue

@@ -187,7 +187,7 @@
 
 	onLoad(() => {
 		curPlan.value = store.planDetails;
-				normalStatus.value = true;
+		normalStatus.value = true;
 		console.log(curPlan.value)
 		//废品回用的领料部门如果是当前工段,也要可以开始新批次
 		//查找当前计划单下的批次废品回用是当前工段
@@ -269,14 +269,14 @@
 		getDayWorkList(reqData).then(res => {
 			if (res.code == 200) {
 				tempList.value = res.data
-				if(normalStatus.value) {
-				listData.value = res.data.filter(item => {
-					return item.isWasteRecycling == 0 && item.isAmend == 0;
-				});
-				}else {
+				if (normalStatus.value) {
+					listData.value = res.data.filter(item => {
+						return item.isWasteRecycling == 0 && item.isAmend == 0;
+					});
+				} else {
 					listData.value = res.data.filter(item => {
 						return item.isWasteRecycling == 1 || item.isAmend == 1;
-				})
+					})
 				}
 				for (let i = 0; i < listData.value.length; i++) {
 					if (listData.value[i].prevProcess) {
@@ -310,7 +310,8 @@
 
 	function handleClickProcessList(item) {
 		let curProcessAfterList = [];
-		// console.log(item)
+		console.log("工序列表", item)
+
 		let nextIndex = 0;
 		for (let i = 0; i < item.processSequence.length; i++) {
 			if (item.nextProcess.id == item.processSequence[i].id) {
@@ -342,6 +343,7 @@
 			listData.value = tempList.value.filter(item => {
 				return item.isWasteRecycling == 1 || item.isAmend == 1;
 			});
+			console.log("批次信息", listData.value)
 			normalStatus.value = false
 		} else {
 			listData.value = tempList.value.filter(item => {

+ 1 - 1
pages/sortBatchReporting/index.vue

@@ -313,7 +313,6 @@
 	}
 
 	function switchChange(event) {
-		console.log(event.detail.value)
 		//异常批
 		if (event.detail.value) {
 			listData.value = tempList.value.filter(item => {
@@ -326,6 +325,7 @@
 			});
 			normalStatus.value = 0
 		}
+
 	}
 
 	function handleScanCode() {