mao 1 年之前
父節點
當前提交
5dd206aebc
共有 5 個文件被更改,包括 99 次插入104 次删除
  1. 1 2
      api/base/path.js
  2. 36 51
      pages/addNewBatch/index.vue
  3. 47 37
      pages/batchReporting/index.vue
  4. 13 13
      pages/handlingList/index.vue
  5. 2 1
      pages/productionPlan/index.vue

+ 1 - 2
api/base/path.js

@@ -1,4 +1,3 @@
-// const baseURL = 'http:// 192.168.31.15:8099'
-const baseURL = 'http://192.168.31.147:8099'
+const baseURL = 'http://192.168.31.216:8099'
 
 export default baseURL

+ 36 - 51
pages/addNewBatch/index.vue

@@ -14,7 +14,7 @@
 			</view>
 			<view class='middle'>
 				<view class='segment'></view>
-				<uni-icons type="link" size="30" class="link"></uni-icons>
+				<uni-icons type="link" size="30" style="margin: 10rpx;  transform: rotate(135deg);"></uni-icons>
 				<view class='segment'></view>
 			</view>
 			<view>
@@ -26,7 +26,9 @@
 					</view>
 				</view>
 				<view>
-					<button class="btn"  @click='scanCodeHandle()'>扫码</button>
+					<button style='background-color: rgba(0, 226, 166,1);
+						   color: white;margin: 20rpx auto;
+						   width: 80%;' @click='scanCodeHandle()'>扫码</button>
 				</view>
 			</view>
 			<view class='middle'>
@@ -38,22 +40,22 @@
 				<text class='title' style="margin-bottom: 50rpx;">基础信息</text>
 				<view class="uni-row info">
 					<label for="HeatNo">炉号</label>
-					<!-- <input id="HeatNo" class="uni-input" v-model="basicInfo.heatNo" placeholder="请填写" /> -->
-					<text id="HeatNo" class="uni-input">{{basicInfo.heatNo}}</text>
+					<input id="HeatNo" class="uni-input" v-model="basicInfo.heatNo" placeholder="请填写" />
+					<!-- <text id="HeatNo" class="uni-input">{{basicInfo.heatNo}}</text> -->
 				</view>
-				<view class='segment basicInfo' ></view>
+				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 				<view class="uni-row info">
 					<label for="manufacturer">厂家</label>
-					<!-- <input id="manufacturer" class="uni-input" v-model="basicInfo.manufacturer" placeholder="请填写" /> -->
-					<text id="manufacturer" class="uni-input">{{basicInfo.manufacturer}}</text>
+					<input id="manufacturer" class="uni-input" v-model="basicInfo.manufacturer" placeholder="请填写" />
+					<!-- <text id="manufacturer" class="uni-input">{{basicInfo.manufacturer}}</text> -->
 				</view>
-				<view class='segment basicInfo' ></view>
+				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 				<view class="uni-row info">
-					<label for="incomingInfo">来料信息</label>
-					<!-- <input id="incomingInfo" class="uni-input" v-model="basicInfo.incomingInfo" placeholder="请填写" /> -->
-					<text id="incomingInfo" class="uni-input">{{basicInfo.incomingInfo}}</text>
+					<label for="incomingInfo">来料信息:</label>
+					<input id="incomingInfo" class="uni-input" v-model="basicInfo.incomingInfo" placeholder="请填写" />
+					<!-- <text id="incomingInfo" class="uni-input">{{basicInfo.incomingInfo}}</text> -->
 				</view>
-				<view class='segment basicInfo' ></view>
+				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 			</view>
 		</view>
 		<view class='bottom uni-row'>
@@ -76,21 +78,16 @@
 		saveDayWork
 	} from '@/api/business/dayWork.js'
 
-	onReady(() => {
-		init();
-	})
-
 	const batchNoCheck = ref(false)
 	const batchNoList = ref([])
 	const vehicleList = ref([{
-			carrierId: '1731475038666575873',
-			carrierCode: '0001'
-		},
-		{
-			carrierId: '1731467623237767169',
-			carrierCode: '0002'
-		}
-	])
+		carrierId: '1731475038666575873',
+		carrierCode: '0001'
+	},
+	{
+		carrierId: '1731467623237767169',
+		carrierCode: '0002'
+	}])
 	const basicInfo = ref({
 		heatNo: 'cs222',
 		manufacturer: 'DMS',
@@ -98,8 +95,15 @@
 	})
 	const selected = ref(null)
 	const boxNo = ref(null)
-	const productPlanId = ref('0')
+	const productPlanId = ref('0') 
 	const dayWork = ref({})
+	const curSubPlan = ref({})
+	
+	onLoad((options) => {
+		curSubPlan.value = JSON.parse(options.currentSubPlan);
+		console.log(curSubPlan.value)
+		init();
+	})
 
 	function init() {
 		let obj = {}
@@ -110,9 +114,6 @@
 			}
 			console.log(batchNoList.value)
 		})
-		// getSubPlanDetailsList().then(res => {
-		// 	console.log(res)
-		// })
 	}
 
 	function handleCheckBatchNo(item) {
@@ -138,16 +139,16 @@
 	function addHandle() {
 		dayWork.value.dayworkCarriers = vehicleList.value;
 		saveDayWork(dayWork.value).then(res => {
-			if (res.code === 200) {
+			if(res.code === 200){
 				uni.showToast({
 					icon: 'success',
 					title: '添加成功',
 					duration: 2000
 				});
 				uni.navigateTo({
-					url: '/pages/batchReporting/index'
+					url:'/pages/batchReporting/index'
 				})
-			} else {
+			}else{
 				uni.showToast({
 					icon: 'error',
 					title: '添加失败',
@@ -155,7 +156,7 @@
 				});
 			}
 		})
-	}
+	} 
 </script>
 
 <style lang="scss">
@@ -196,17 +197,6 @@
 			font-size: 36rpx;
 			font-weight: bold;
 		}
-
-		.btn {
-			background-color: rgba(0, 226, 166, 1);
-			color: white;
-			margin: 20rpx auto;
-			width: 80%;
-		}
-		.basicInfo {
-			width: 90%;
-			margin: 20rpx auto;
-		}
 	}
 
 	.batchNo {
@@ -260,12 +250,7 @@
 		display: flex;
 		flex-direction: row;
 		align-items: center;
-		justify-content: center;
-
-		.link {
-			margin: 10rpx;
-			transform: rotate(135deg);
-		}
+		justify-content: center
 	}
 
 	.segment {
@@ -279,13 +264,13 @@
 		justify-content: space-around;
 
 		label {
-			flex: 3;
+			flex: 1;
 			text-combine-upright: all;
 			margin: 0 30rpx;
 
 		}
 
-		text {
+		input {
 			flex: 3;
 			width: 80%;
 		}

+ 47 - 37
pages/batchReporting/index.vue

@@ -1,23 +1,25 @@
 <template>
-	<view class="uni-column container" >
+	<view class="uni-column" style="height: 100%; background-color: #f5f5f5;">
 		<scroll-view class="scroll-container" scroll-y>
 			<view v-for="(item, index) in listData" :key="index" class="list-item" @click="handleToreportingForWork">
-				<view class="title-container uni-row">
+				<view class="title-container uni-row" style="justify-content: flex-start;">
 					<view class="title uni-row">
-						<text class="label">批次号</text>
+						<text class="label">批次号:</text>
 						<text class="label code">{{ item['productionPlanNo'] }}</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'] == 2" class="tag turnover "><text class="label">周转中</text></view>
-						<view v-else-if="item['status'] == 0" 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 turnover "><text class="label">未开始</text>
+						</view>
 						<view v-else type="default" 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['caseNumber'] }}</text>
-				</view> 
+				</view>
 				<view class="item-info uni-row">
 					<text class="label">总工时</text>
 					<text class="label right">{{ item['totalWorkingHours']}}h</text>
@@ -41,7 +43,7 @@
 				<view class="status-btn uni-row">
 					<view v-if="item['status'] == 1" class=" uni-row">
 						<!-- <button class="turnover-tag" size="mini" @click="handleShowTurnoverApplication(null)">周转申请</button> -->
-						<button class="reporting-tag" size="mini" @click="handleToreportingForWork" >去报工</button> 
+						<button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button>
 					</view>
 					<view v-else-if="item['status'] == 2" class=" uni-row">
 						<button class="turnover-tag" size="mini">取消周转</button>
@@ -50,68 +52,77 @@
 			</view>
 		</scroll-view>
 		<view class="bottom uni-row">
-			<button class="start-batch-btn" @click="handleShowLotDialog(listData)">开始新批次</button>
+			<button class="start-batch-btn" type="primary" @click="handleShowLotDialog(listData)">开始新批次</button>
 		</view>
-		<dialog-lot ref="lotDialog"/>
+		<dialog-lot ref="lotDialog" />
 		<dialog-turnoverApplication ref="turnoverApplicationDialog" />
 	</view>
-	
+
 </template>
 
 <script setup>
-	import { reactive, ref } from 'vue'
-	import { onLoad, onReady } from '@dcloudio/uni-app'
-	import { getDayWorkList } from '@/api/business/dayWork.js'
-	
+	import {
+		reactive,
+		ref
+	} from 'vue'
+	import {
+		onLoad,
+		onReady
+	} from '@dcloudio/uni-app'
+	import {
+		getDayWorkList
+	} from '@/api/business/dayWork.js'
+
 	const turnoverApplicationDialog = ref(null)
 	const lotDialog = ref(null)
 	const listData = ref([])
 	const bizDayworkObj = ref({})
-		
+	const curSubPlan = ref({})
+
 	onLoad((options) => {
-		init(options.id);
-	}) 
+		curSubPlan.value = JSON.parse(options.currentSubPlan);
+		console.log(curSubPlan.value)
+		init(curSubPlan.value.id);
+	})
 	const handleShowTurnoverApplication = (data) => {
 		let _data = data ?? {}
 		// 调用子组件中的方法
 		turnoverApplicationDialog.value.open(_data)
 	}
 	const handleShowLotDialog = (data) => {
-		// if(data){
+		// if (data) {
 		// 	lotDialog.value.open(data)
-		// }else{
+		// } else {
 			uni.navigateTo({
-				url:"/pages/addNewBatch/index"
+				url: "/pages/addNewBatch/index?currentSubPlan=" + JSON.stringify(curSubPlan.value)
 			})
 		// }
 		// let _data = data ?? {} 
 		// 调用子组件中的方法
 	}
-	function init(id){
+
+	function init(id) {
 		uni.showLoading({
 			title: '加载中'
 		});
 		let reqData = {};
 		reqData.productionPlanDetailSubDetailId = id;
-		console.log(reqData)
+		// console.log(reqData)
 		getDayWorkList(reqData).then(res => {
 			listData.value = res.rows;
 			uni.hideLoading();
-		}) 
+		})
 	}
-	function handleToreportingForWork(){
+
+	function handleToreportingForWork() {
+		console.log(curSubPlan.value)
 		uni.navigateTo({
-			url:"/pages/reportingForWork/index"
+			url: "/pages/reportingForWork/index?currentSubPlan=" + JSON.stringify(curSubPlan.value)
 		})
 	}
-
-</script> 
+</script>
 
 <style lang="scss">
-	.container {
-		height: 100%; 
-		background-color: #f5f5f5;
-	}
 	.scroll-container {
 		width: 92%;
 		margin: 24rpx auto 0 auto;
@@ -125,8 +136,9 @@
 		padding-bottom: 24rpx;
 		margin-bottom: 24rpx;
 		border-radius: 10rpx;
+
 		.title-container {
-			justify-content: flex-start;
+
 			margin-top: 8rpx;
 			margin-bottom: 16rpx;
 
@@ -225,7 +237,7 @@
 		right: 0;
 		bottom: 0;
 		left: 0;
-		height: 80rpx;
+		height: 100rpx;
 		border-top: 1px solid #999999;
 		padding: 16rpx 32rpx;
 		align-items: center;
@@ -233,10 +245,8 @@
 
 		.start-batch-btn {
 			flex: 1;
-			background-color: #1684fc;
-			height: 100%;
-			justify-content: center;
-			align-items: center;
+			height: 80rpx;
+			padding-top: 10 rpx;
 			border-radius: 8rpx;
 			color: #FFFFFF;
 			font-size: 28rpx;

+ 13 - 13
pages/handlingList/index.vue

@@ -141,19 +141,6 @@
 	const turnoverClass = ref({
 		selecter: false
 	})
-	const isSelected = (item) => {
-		return selection.value.includes(item);
-	}
-
-	const handleSelection = (item, index) => {
-		const buttonIndex = selection.value.findIndex(selectedItem => selectedItem === item);
-		if (buttonIndex > -1) {
-			selection.value.splice(buttonIndex, 1); // 取消选中
-		} else {
-			selection.value.push(item); // 选中
-		}
-		console.log(selection.value, "selection");
-	}
 	const selection = ref([])
 	const pendingShow = ref(true)
 	const turnoverShow = ref(false)
@@ -230,6 +217,19 @@
 		turnoverSecondTitle.value = listData.value[0]['process'].toString() + ' → ' + listData.value[0]['car']
 			.toString();
 	}
+	const isSelected = (item) => {
+		return selection.value.includes(item);
+	}
+	
+	const handleSelection = (item, index) => {
+		const buttonIndex = selection.value.findIndex(selectedItem => selectedItem === item);
+		if (buttonIndex > -1) {
+			selection.value.splice(buttonIndex, 1); // 取消选中
+		} else {
+			selection.value.push(item); // 选中
+		}
+		console.log(selection.value, "selection");
+	}
 	const selectPending = () => {
 		pendingClass.value['selecter'] = true;
 		turnoverClass.value['selecter'] = false;

+ 2 - 1
pages/productionPlan/index.vue

@@ -106,7 +106,8 @@
 
 	function handleToBatchReporting(item) {
 		uni.navigateTo({
-			url: '/pages/batchReporting/index?id=' + item.id
+			// url: '/pages/batchReporting/index?id=' + item.id
+			url: '/pages/batchReporting/index?currentSubPlan=' + JSON.stringify(item)
 		})
 	}
 </script>