mao 1 anno fa
parent
commit
57691e0b12

+ 51 - 30
components/dialog-selectEquipment/dialog-selectEquipment.vue

@@ -1,9 +1,22 @@
 <template>
-	<dialog-base ref="baseDialog" title="选择设备">
-		<view class="equipment-container uni-row ">
+	<dialog-base ref="baseDialog" title="选择">
+		<!-- 		<view class="equipment-container uni-row ">
 			<view v-for="(item, index) in equiments" :class="{'item':true,'selected': isSelected(item)}" :key="index"
 				@click="handleSelection(item)"><text class="label">{{item['equipmentDetailCode']}}</text></view>
+		</view> -->
+		<view>
+			<uni-section title="工序" type="line">
+				<uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
+					@change="handleProcessChange"></uni-data-select>
+			</uni-section>
 		</view>
+		<view>
+			<uni-section title="设备" type="line">
+				<uni-data-select v-model="selectedEquiment" :localdata="equipmentList" :clear="false"
+					@change="handleEquipmentChange"></uni-data-select>
+			</uni-section>
+		</view>
+
 		<view class="add-btn-container uni-row">
 			<button type="primary" class="btn" @click="handleStart">开始</button>
 		</view>
@@ -24,7 +37,8 @@
 		getUserInfo
 	} from '@/api/login/index.js'
 	import {
-		saveDayWorkItem,getDayWorkItemList
+		saveDayWorkItem,
+		getDayWorkItemList
 	} from '@/api/business/dayWorkItem.js'
 	import {
 		store
@@ -34,12 +48,16 @@
 	} from '@/utils/common.js'
 
 	const baseDialog = ref(null)
-	const selection = ref([])
-	const equiments = ref([])    // 接收设备列表信息
+	const equiments = ref([]) // 接收设备列表信息
+	const equipmentList = ref([])
 	const emit = defineEmits(['handleAddDayWorkItem'])
 	const userId = ref(null)
 	const firstItem = ref(null);
 	const sendReqParam = ref([])
+	const processList = ref([])
+	const selectedProcess = ref(null)
+	const selectedEquiment = ref(null)
+
 
 	onLoad(() => {
 		userId.value = store.userInfo.userId || "";
@@ -51,7 +69,7 @@
 			processId: store.dayworkInfo.currentProcess.id,
 		}
 		getUserequipmentList(reqParam).then(res => {
-			if(res.code == 200){
+			if (res.code == 200) {
 				equiments.value = res.rows
 				getDayWorkItemList({
 					userId: store.userInfo.userId,
@@ -61,13 +79,14 @@
 					// 过滤人员可选择的设备列表(选择之后不予展示)
 					for (let i = 0; i < response.rows.length; i++) {
 						for (let j = 0; j < equiments.value.length; j++) {
-							if(response.rows[i].equipmentDetailId == equiments.value[j].equipmentDetailId){
-								equiments.value.splice(j,1);
+							if (response.rows[i].equipmentDetailId == equiments.value[j]
+								.equipmentDetailId) {
+								equiments.value.splice(j, 1);
 							}
 						}
 					}
 					console.log(equiments.value)
-					baseDialog.value.open()	
+					baseDialog.value.open()
 				})
 			}
 		})
@@ -86,8 +105,12 @@
 		open
 	})
 
-	function isSelected(item) {
-		return selection.value.includes(item);
+	function handleProcessChange() {
+
+	}
+
+	function handleEquipmentChange() {
+
 	}
 
 	function handleSelection(item) {
@@ -101,34 +124,32 @@
 	}
 
 	function handleStart() {
-		if(selection.value.length == 0){
+		if (!selectedProcess.value || !selectedEquiment.value) {
 			uni.showToast({
-				icon: "error",
-				title: "未选择设备"
+				icon: "none",
+				title: "未选择工序或设备"
 			})
-			close();
+
 			return;
 		}
 		close();
 		if (firstItem.value) {
-			for (var i = 0; i < selection.value.length; i++) {
-				sendReqParam.value.push(firstItem.value);
-				sendReqParam.value[i].equipmentDetailId = selection.value[i].equipmentDetailId;
-				sendReqParam.value[i].equipmentDetailCode = selection.value[i].equipmentDetailCode;
-				sendReqParam.value[i].startTime = timestampToTime(new Date());
-				sendReqParam.value[i].status = 1;
-				if (i > 0) {
-					sendReqParam.value[i].id = null;
-				}
-			}
+			sendReqParam.value.push(firstItem.value);
+			sendReqParam.value[i].id = null;
+			sendReqParam.value[i].processId = selectedProcess.value;
+			sendReqParam.value[i].equipmentDetailId = selectedEquiment.value.equipmentDetailId;
+			sendReqParam.value[i].equipmentDetailCode = selectedEquiment.value.equipmentDetailCode;
+			sendReqParam.value[i].startTime = timestampToTime(new Date());
+			sendReqParam.value[i].status = 1;
+
 			emit('handleAddDayWorkItem', sendReqParam.value);
-			selection.value = [];
-			equiments.value = [];
-		}else{
+			selectedProcess.value = null;
+			selectedEquiment.value = null;
+		} else {
 			console.log(selection.value);
 			emit('handleAddDayWorkItem', selection.value);
-			equiments.value = [];
-			selection.value = [];
+			selectedProcess.value = null;
+			selectedEquiment.value = null;
 		}
 	}
 </script>

+ 64 - 3
pages/batchReporting/index.vue

@@ -1,6 +1,15 @@
 <template>
 	<view class="uni-column" style="height: 100%; background-color: #f5f5f5;">
-		<scroll-view class="scroll-container" scroll-y>
+		<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="scroll-container" >
 			<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;">
@@ -54,6 +63,10 @@
 					<text class="label">设备</text>
 					<text class="label right">{{ curSubPlan['equipmentName'] }}</text>
 				</view>
+				<view v-if="notPreProcess" class="item-info uni-row">
+					<text class="label">所在区域</text>
+					<text class="label right">{{ curSubPlan['area'] }}</text>
+				</view>
 				<view class="status-btn uni-row">
 					<view v-if="item['status'] == 2" class=" uni-row">
 						<button class="turnover-tag" size="mini"
@@ -65,7 +78,7 @@
 					</view>
 				</view>
 			</view>
-		</scroll-view>
+		</view>
 		<view v-if="bottomStatus == 0" class="bottom uni-row">
 			<button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
 		</view>
@@ -117,6 +130,8 @@
 	const bottomStatus = ref(0) // 底部按钮显示
 	const reqParam = ref(null);
 	const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态	
+	const keywords = ref(null) 
+	const notPreProcess = ref(true)
 
 	onLoad(() => {
 		curSubPlan.value = store.planSubDetails || {
@@ -207,6 +222,10 @@
 		})
 	}
 
+	function handleSearch(){
+		
+	}
+
 	function handleToreportingForWork(item) {
 		store.dayworkInfo = item
 		uni.navigateTo({
@@ -300,10 +319,52 @@
 </script>
 
 <style lang="scss">
+	$nav-height: 60rpx;
+	
+	.box-bg {
+		width: 100%;
+		background-color: #F5F5F5;
+		padding: 5rpx 16rpx;
+		justify-content: space-around;
+		align-items: center;
+		margin-top: 20rpx;
+		
+		.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;
+		}
+	}
 	.scroll-container {
 		width: 92%;
 		margin: 24rpx auto 0 auto;
-		height: 90%;
+		height: calc(90% - 100rpx);
+		overflow: auto;
 	}
 
 	.list-item {

+ 6 - 6
pages/changeBox/index.vue

@@ -10,7 +10,7 @@
 					<text @click="handleDelVehicleNo(item,index)">×</text>
 				</view>
 			</view>
-			<view class="disuseList">
+			<view v-if="discardVehicleList.length > 0" class="disuseList">
 				<view class="uni-row" style="align-items: center;justify-content: space-evenly;">
 					<view>箱号</view>
 					<view>是否废弃</view>
@@ -19,7 +19,7 @@
 				<view class="vehicleNo uni-row" v-for="(item,index) in discardVehicleList"
 					style="align-items: center;justify-content: space-around;">
 					<view class="uni-row discardVehicleNo"><text>{{item.carrierCode}}</text>
-						<text @click="handleDelDiscardVehicleList(item)">×</text>
+						<text @click="handleDelDiscardVehicleList(item,index)">×</text>
 					</view>
 					<view class="uni-row">
 						<switch color="#ff0000" style="transform:scale(0.7)" @change="handleSwitchChange(item)" />
@@ -126,8 +126,8 @@
 		}
 	}
 
-	function handleDelDiscardVehicleList(item) {
-		discardVehicleList.value.splice(item, 1)
+	function handleDelDiscardVehicleList(item,index) {
+		discardVehicleList.value.splice(index, 1)
 		newBindList.value.push(item)
 	}
 
@@ -270,11 +270,11 @@
 
 		.disuseList {
 			border-top: 2rpx solid #e1e1e1;
-			height: calc(100% - 480rpx);
+			height: calc(100% - 480rpx - 20rpx);
 			overflow: auto;
 			width: 90%;
 			margin: 0 auto;
-			padding-top: 10rpx;
+			padding-top: 20rpx;
 		}
 	}