mao 1 سال پیش
والد
کامیت
377c496c05

+ 1 - 1
api/dept/dept.js

@@ -6,7 +6,7 @@ import req from '@/utils/request.js'
  */
 export function getDeptList(data) {
 	return req.request({
-		url:'/system/dept/list',
+		url:'/system/dept/listByPlanDetailsId',
 		method: 'GET',
 		data: data
 	})

+ 31 - 23
components/dialog-selectProduction/dialog-selectProduction.vue

@@ -91,31 +91,38 @@
 				console.log(processList.value)
 			}
 			/* 处理结果格式 */
-			// 用于存放处理后的结果
-			const result = {};
-			// 遍历原始数组的每个对象
-			response.data.forEach(item => {
-			  const { lotCode, place,carrierCode } = item;  
-			  // 如果lotCode不存在于结果中,则以该lotCode为键,创建一个新对象
-			  if (!result[lotCode]) {  
-			    result[lotCode] = {
-			      lotCode: lotCode,
-			      place: place,
-				  carrierCode: carrierCode
-			    };
-			  // 如果lotCode已存在于结果中,则将place进行字符串拼接
-			  } else {
-				  if (result[lotCode].place !== place){
-					  result[lotCode].place += `, ${place}`;
-				  }
-				result[lotCode].carrierCode += `, ${carrierCode}`;
-			  }
-			});
-			carrierList.value = Object.values(result);
+			carrierList.value = changeResultStructure(response.data)
 			console.log(carrierList.value)
+			console.log(store.userInfo)
 			baseDialog.value.open();
 		})
 	}
+	/**
+	 * 处理响应结果
+	 */
+	function changeResultStructure(data){
+		// 用于存放处理后的结果
+		const result = {};
+		// 遍历原始数组的每个对象
+		data.forEach(item => {
+		  const { lotCode, place,carrierCode } = item;  
+		  // 如果lotCode不存在于结果中,则以该lotCode为键,创建一个新对象
+		  if (!result[lotCode]) {  
+		    result[lotCode] = {
+		      lotCode: lotCode,
+		      place: place,
+			  carrierCode: carrierCode
+		    };
+		  // 如果lotCode已存在于结果中,则将place进行字符串拼接
+		  } else {
+			  if (result[lotCode].place !== place){
+				  result[lotCode].place += `, ${place}`;
+			  }
+			result[lotCode].carrierCode += `, ${carrierCode}`;
+		  }
+		});
+		return Object.values(result);
+	}
 
 	function close() {
 		baseDialog.value.close()
@@ -150,7 +157,8 @@
 
 					console.log(processList.value)
 				}
-				carrierList.value = response.data;
+				/* 处理结果格式 */
+				carrierList.value = changeResultStructure(response.data);
 				baseDialog.value.open();
 			})
 		} else {
@@ -168,7 +176,7 @@
 				processId: curProcessId.value
 			}).then(res => {
 				if (res.code == 200) {
-					carrierList.value = res.data;
+					carrierList.value = changeResultStructure(res.data);
 				}
 				console.log(res)
 			})

+ 41 - 16
components/dialog-turnoverApplication/dialog-turnoverApplication.vue

@@ -7,9 +7,14 @@
 					:class="{ 'middle-btn': true, 'active': item.dictValue == curDayworkItem.turnoverType }"
 					@click="selectTurnoverType(item)"><text class="label">{{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;">
-					<uni-data-select v-model="curDayworkItem.deptId" :localdata="deptList" @change="handleChange"
+			<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>
@@ -74,6 +79,8 @@
 	})
 	const dayworkInfo = ref(null)
 	const deptList = ref([]) // 工段列表
+	const insideDepts = ref([]) // 车间内工段
+	const outsideDepts = ref([]) // 车间外工段
 	const turnAreaList = ref([]) // 周转区列表
 	// const emit = defineEmits('confirm') // 自定义调用父组件方法
 
@@ -107,6 +114,8 @@
 			turnoverType: 1
 		}
 		deptList.value = []
+		insideDepts.value = []
+		outsideDepts.value = []
 		turnAreaList.value = []
 	}
 
@@ -129,17 +138,28 @@
 			console.log(curDayworkItem.value)
 		})
 		getDeptList({
-			isWorkSection: 1,
-			tenantId: store.tenantId
+			tenantId: store.tenantId,
+			productionPlanDetailId: store.planDetails.id
 		}).then(res => {
+			console.log(store.curDeptDetails)
 			console.log(res.data)
 			for (let i = 0; i < res.data.length; i++) {
-				deptList.value[i] = {
-					text: res.data[i].deptName,
-					value: res.data[i].deptId,
-					data: res.data[i]
+				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)
 		})
 	}
 
@@ -156,10 +176,10 @@
 			selection.value.splice(index, 1);
 		} else {
 			selection.value.push(item);
-		} 
+		}
 	}
-	
-	function selectTurnoverDoorOutside(item){
+
+	function selectTurnoverDoorOutside(item) {
 		selection.value[0] = item;
 	}
 
@@ -181,7 +201,7 @@
 		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.technologicalProcessId = dayworkInfo.value.technologicalProcessId;
 		curDayworkItem.value.dayworkId = dayworkInfo.value.id;
 		curDayworkItem.value.productionPlanDetailId = dayworkInfo.value.productionPlanDetailId;
 		if (!store.tenantId) {
@@ -199,10 +219,10 @@
 				return null;
 			}
 		})
-		if(curDayworkItem.value.turnoverType == '1'){
+		if (curDayworkItem.value.turnoverType == '1') {
 			curDayworkItem.value.place = newArray.join('、');
 			curDayworkItem.value.turnoverArea = "车间内周转看place字段";
-		}else{
+		} else {
 			curDayworkItem.value.turnoverArea = newArray.join('、');
 		}
 		// curDayworkItem.value.dayworkId = store.dayworkInfo.id;
@@ -239,7 +259,7 @@
 		// emit('confirm');
 	}
 
-	function handleChange() {
+	function handleChangeInside() {
 		turnAreaList.value = [];
 		selection.value = []
 		getTurnoverListByDeptId({
@@ -252,6 +272,11 @@
 			}
 		})
 	}
+	
+	function handleChangeOutside(){
+		
+	}
+	
 </script>
 
 <style lang="scss">

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "德迈仕数字生产管理平台",
     "appid" : "__UNI__B065984",
     "description" : "",
-    "versionName" : "1.0.18",
-    "versionCode" : 117,
+    "versionName" : "1.0.19",
+    "versionCode" : 118,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 42 - 1
pages/batchReporting/index.vue

@@ -13,6 +13,7 @@
 			<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
 				<text>暂无批次</text>
 			</view>
+			<!-- 批次列表 -->
 			<view v-else 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;">
@@ -65,7 +66,10 @@
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">下道工序</text>
-					<text class="label right">{{ item.nextDeptProcess ? item['nextDeptProcess'] : '-' }}</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>
@@ -88,6 +92,22 @@
 				</view>
 			</view>
 		</view>
+		<!-- 抽屉 -->
+		<view>
+			<uni-drawer ref="showRight" mode="right" :mask-click="true">
+				<view class="scroll-view">
+					<scroll-view class="scroll-view-box" scroll-y="true">
+						<view style="width: 100%;text-align: center;;font-size: 48rpx;margin: 48rpx 0 24rpx 0;">工艺列表</view>
+						<view style="font-size: 24rpx;width: 100%;text-align: center;color: red;margin-bottom: 48rpx;">仅显示当前工艺后面工艺</view>
+						<view class="info-content" v-for="(item,index) in curProcessAfte" :key="index"
+						style="width: 100%;margin: 8rpx 0 8rpx 30%;"
+						>
+							<text>{{ index + 1 }}.{{item.processAlias}}</text>
+						</view>
+					</scroll-view>
+				</view>
+			</uni-drawer>
+		</view>
 		<!-- 		<view v-if="bottomStatus" class="bottom uni-row">
 			<button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
 		</view>
@@ -144,6 +164,8 @@
 	const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态	
 	const keywords = ref(null)
 	const notPreProcess = ref(true)
+	const curProcessAfte = ref([])
+	const showRight = ref(null) // 抽屉
 
 	onLoad(() => {
 		curPlan.value = store.planDetails;
@@ -238,6 +260,25 @@
 		})
 	}
 
+	function handleClickProcessList(item) {
+		let curProcessAfterList = [];
+		let nextIndex = 0;
+		for (let i = 0; i < item.processSequence.length; i++) {
+			if (item.nextProcess.id == item.processSequence[i].id) {
+				nextIndex = i;
+			}
+		}
+		for (let i = 0; i < item.processSequence.length; i++) {
+			if (i >= nextIndex) {
+				curProcessAfterList.push(item.processSequence[i]);
+			}
+		}
+		console.log(curProcessAfterList)
+		curProcessAfte.value = curProcessAfterList;
+		showRight.value.open();
+	}
+	
+
 	function handleSearchCode() {
 		selectProduction.value.open();
 	}

+ 15 - 3
pages/dashboard/index.vue

@@ -23,9 +23,9 @@
 					@change="handleDeptChange"></uni-data-select>
 			</uni-section>
 		</view>
-		<view class="business-btn uni-row" @click="handleRecerptSfprod"><text class="label">半成品接收</text></view>
-		<view class="business-btn uni-row" @click="handleToProductionPlan"><text class="label">报工</text></view>
-		<view class="business-btn uni-row" @click="handleToHandlingList"><text class="label">周转</text></view>
+		<view class="business-btn uni-row" v-if="showOther" @click="handleRecerptSfprod"><text class="label">半成品接收</text></view>
+		<view class="business-btn uni-row" v-if="showOther" @click="handleToProductionPlan"><text class="label">报工</text></view>
+		<view class="business-btn uni-row" v-if="showTurn" @click="handleToHandlingList"><text class="label">周转</text></view>
 		<view class="bottom-btn-container">
 			<view class="start-batch-btn uni-row" @click="handleToEquiPmentList"><text class="label">绑定设备</text></view>
 			<view class="start-batch-btn uni-row" @click="handleSwitchOrQuit"><text class="label">切换 / 退出账号</text>
@@ -65,12 +65,24 @@
 	const userDeptList = ref([]) // 用户所在所有工段列表	
 	const userDeptsByTenantId = ref([])
 	const confirm = ref(null) // 确认组件
+	const showTurn = ref(false)
+	const showOther = ref(false)
 
 	onLoad(() => {
 		userInfo.value = store.userInfo || {
 			nickName: ""
 		};getUserDepts
 		store.tenantId = userInfo.value.tenantId;
+		if(store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length > 1){
+			showTurn.value = true;
+			showOther.value = true;
+		}else if(store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length == 1){
+			showTurn.value = true;
+			showOther.value = false;
+		}else{
+			showTurn.value = false;
+			showOther.value = true;
+		}
 		init();
 	})
 

+ 5 - 2
pages/reportingForWork/index.vue

@@ -122,17 +122,20 @@
 	const flag = ref(true) // 控制底部开始加工按钮功能
 	const lotInfo = ref(null) // 详情弹窗
 
-
+	
 	onLoad(() => {
 		curPlan.value = store.planDetails;
 		dayWorkInfo.value = store.dayworkInfo;
 		console.log(dayWorkInfo.value)
 		init();
-		uni.$on('dayworkItemUpdate', reflush)
 	})
 	// onUnload(() => {
 	// 	uni.$off('dayworkItemUpdate', reflush)
 	// })
+	
+	onShow(() => {
+		uni.$on('dayworkItemUpdate', reflush)
+	})
 
 	function init() {
 		console.log(store.dayworkInfo.processSequence)