mao 1 yıl önce
ebeveyn
işleme
a399a86142

+ 12 - 0
api/business/carrier.js

@@ -0,0 +1,12 @@
+import req from '@/utils/request.js'
+
+/**
+ * 获取载具信息ById
+ * @param {Object} data
+ */
+export function getCarrierById(data) {
+	return req.request({
+		url:'/business/carrier/id=' + data,
+		method: 'GET'
+	})
+}

+ 5 - 4
components/dialog-end-work/dialog-end-work.vue

@@ -7,7 +7,8 @@
 			</view>
 			<view class="list-title uni-row">
 				<text class="label">废品量</text>
-				<input class="input" type="number" maxlength="5" v-model="workInfo.rejectNum" @input="handleInputRejectNum" placeholder="请输入废品量" />
+				<input class="input" type="number" maxlength="5" v-model="workInfo.rejectNum" placeholder="请输入废品量" />
+				<!-- <input class="input" type="number" maxlength="5" v-model="workInfo.rejectNum" @input="handleInputRejectNum" placeholder="请输入废品量" /> -->
 			</view>
 			<view class="list-title uni-row">
 				<text class="label">废品原因</text>
@@ -66,9 +67,9 @@
 		workInfo.value.qualifiedNum = workInfo.value.qualifiedNum.replace(/^0+|^-|[^\d]/g, '');
 	}
 	
-	function handleInputRejectNum() {
-		workInfo.value.rejectNum = workInfo.value.rejectNum.replace(/^0+|^-|[^\d]/g, '');
-	}
+	// function handleInputRejectNum() {
+	// 	workInfo.value.rejectNum = workInfo.value.rejectNum.replace(/^0+|^-|[^\d]/g, '');
+	// }
 
 	function handleFinishReporting() {
 		console.log(workInfo.value)

+ 4 - 0
pages/batchReporting/index.vue

@@ -20,6 +20,10 @@
 								class="label">已完成</text></view>
 					</view>
 				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ curSubPlan['productDescription'] }}</text>
+				</view>
 				<view class="item-info uni-row">
 					<text class="label">箱号</text>
 					<text class="label right">{{ item['carrierName'] }}</text>

+ 2 - 2
pages/handlingList/index.vue

@@ -27,11 +27,11 @@
 						<text class="label right">{{ item['lotCode'] }}</text>
 					</view>
 					<view class="item-info uni-row"> <text class="label">箱数</text>
-						<text class="label right ">{{ item['qualifiedNum'] }}</text>
+						<text class="label right ">{{ item['carriers'] }}</text>
 					</view>
 					<view class="item-info uni-row">
 						<text class="label">数量</text>
-						<text class="label right">{{ item['carriers'] }}</text>
+						<text class="label right">{{ item['qualifiedNum'] }}</text>
 					</view>
 					<view class="item-info uni-row">
 						<text class="label">箱号</text>

+ 1 - 1
pages/recerptSfprod/index.vue

@@ -26,7 +26,7 @@
 		</view>
 		<view class='btn uni-row'>
 			<button class='bottom-btn left-btn' type="primary" @click="handleScanCode">扫码添加</button>
-			<button class='bottom-btn right-btn' type="primary" @click="handleConfirmReceipt">确定接收</button>
+			<button class='bottom-btn right-btn' type="primary" @click="handleConfirmReceipt">确定领取</button>
 		</view>
 	</view>
 	<dialog-confirm ref="confirm" @submit="handleDoIt"></dialog-confirm>

+ 23 - 17
pages/reportingForWork/index.vue

@@ -2,20 +2,25 @@
 	<view class="uni-column container">
 		<scroll-view class="scroll-container" scroll-y>
 			<view v-for="(item, index) in listData" :key="index" class="list-item">
-				<view class="title-container uni-row">
+				<view class="title-container">
 					<view class="title uni-row">
 						<text class="label">批次号:</text>
 						<text class="label code"> {{ item['lotCode'] }}</text>
 					</view>
-					<view class="right-info " style="flex: 3;margin-right: -30rpx;">
+					<view class="uni-row">
 						<view class="right-info uni-row"> <text class="label">工时</text>
-							<text class="label time">{{ item['taskTime'] }}h</text>
+							<text class="label time">{{ item['taskTime'] }}</text>
+							<!-- <text class="label time">{{ item['taskTime'] }}h</text> -->
 						</view>
-						<view class="right-info uni-row"> <text class="label">合格数</text>
+						<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">{{ curSubDetails['productDescription'] }}</text>
+				</view>
 				<view class="item-info uni-row">
 					<text class="label">操作者</text>
 					<text class="label right">{{ item['nickName'] }}</text>
@@ -47,15 +52,15 @@
 				</view>
 				<view v-if="item['userId'] == userInfo['userId'] ? item['status'] == 0 : false"
 					class="status-btn uni-row ">
-					<button class="finished-turnover-tag" size="mini"
+					<button class="finished-turnover-tag" size="mini" type="primary"
 						@click.stop="handleStartProcessing(item)">开始报工</button>
 				</view>
 			</view>
 		</scroll-view>
 		<view class="bottom uni-row">
 			<button class="bottom-btn left-btn" @click="HandleChangevehicle"><text class="label">更换载具</text></button>
-			<button class="bottom-btn right-btn" type="primary" @click="handleStartProcessing(null)" :disabled="flag"><text
-					class="label">开始加工</text></button>
+			<button class="bottom-btn right-btn" type="primary" @click="handleStartProcessing(null)"
+				:disabled="flag"><text class="label">开始加工</text></button>
 		</view>
 		<dialog-end-work ref="endWorkDialog" @sendEquipment='getEquipment' @reset="reset" />
 		<dialog-selectEquipment ref='selectEquipment'
@@ -80,7 +85,8 @@
 		store
 	} from '@/store/index.js'
 	import {
-		timestampToTime
+		timestampToTime,
+		toHHmmss
 	} from '@/utils/common.js'
 
 	const listData = ref([]) // 回显 
@@ -92,7 +98,7 @@
 	const dayWorkItem = ref({}) // 添加传输对象
 	const reqParam = ref([]) // 请求参数
 	const userInfo = ref(null) // 登录员工信息
-	const flag = ref(true)     // 控制底部开始加工按钮功能
+	const flag = ref(true) // 控制底部开始加工按钮功能
 
 
 	onLoad(() => {
@@ -116,18 +122,20 @@
 			// 时间戳转工时
 			for (var i = 0; i < listData.value.length; i++) {
 				let timeStamp = Date.parse(listData.value[i].endTime) - Date.parse(listData.value[i].startTime);
-				listData.value[i].taskTime = (timeStamp / 3600000).toFixed(2) === 'NaN' ? 0 : (timeStamp / 3600000)
-					.toFixed(2);
+				console.log(timeStamp)
+				// listData.value[i].taskTime = (timeStamp / 3600000).toFixed(2) === 'NaN' ? 0 : (timeStamp / 3600000)
+				// 	.toFixed(2);
+				listData.value[i].taskTime = toHHmmss(timeStamp);
 			}
 			// 判断是否是新批次默认生成的第一条,下面的开始加工按钮不能点(有一个为0就不能点)
 			let arr = []
 			for (var i = 0; i < listData.value.length; i++) {
 				arr[i] = listData.value[i].status;
 			}
-			
+
 			flag.value = arr.includes('0');
 			// flag.value = listData.value.some(value => {value.status == '0'|| value.status == '3'})
-			console.log(flag.value)	
+			console.log(flag.value)
 		})
 		uni.hideLoading();
 	}
@@ -257,8 +265,6 @@
 		border-radius: 8rpx;
 
 		.title-container {
-			justify-content: space-between;
-			align-items: center;
 			margin-top: 8rpx;
 			width: 100%;
 
@@ -268,7 +274,7 @@
 				flex: 7;
 
 				.label {
-					font-size: 32rpx;
+					// font-size: 32rpx;
 					font-weight: bold;
 				}
 
@@ -348,7 +354,7 @@
 		.finished-turnover-tag {
 			margin: unset;
 			border-radius: 8rpx;
-			background-color: rgb(255, 85, 85);
+			// background-color: rgb(255, 85, 85);
 			font-size: 28rpx;
 			color: #FFFFFF;
 		}

+ 43 - 1
utils/common.js

@@ -53,7 +53,10 @@ export function tansParams(params) {
 	return result
 }
 
-// 时间戳转日期
+/**
+ * 时间戳转日期
+ * @param {Object} timestamp 时间戳
+ */
 export function timestampToTime(timestamp) {
 	var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
 	var Y = date.getFullYear() + '-';
@@ -63,4 +66,43 @@ export function timestampToTime(timestamp) {
 	var m = date.getMinutes() + ':';
 	var s = date.getSeconds();
 	return Y + M + D + h + m + s;
+}
+
+
+
+
+var duration = 3000;
+var timer = null;
+/**
+ * 函数防抖
+ * @param {Object} fn 目标函数
+ * @param {Object} duration 间隔时间
+ */
+export function debounce(fn, duration) {
+	if (timer) {
+		clearTimeout(timer);
+	}
+	timer = setTimeout(function() {
+		fn();
+	}, duration)
+}
+
+/**
+ * 时间戳转 时分秒(判断工时)
+ * @param {Object} data 时间戳
+ * @param {Object} flag 是否返回 HH:mm:ss 格式
+ */
+export function toHHmmss(data, flag = true) {
+	var time;
+	var hours = parseInt((data % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
+	var minutes = parseInt((data % (1000 * 60 * 60)) / (1000 * 60));
+	var seconds = (data % (1000 * 60)) / 1000;
+	if (flag) {
+		time = `${hours}小时${minutes}分钟${seconds}秒`;
+	} else {
+		time = (hours < 10 ? ('0' + hours) : hours) + ':' + (minutes < 10 ? ('0' + minutes) : minutes) + ':' + (
+			seconds <
+			10 ? ('0' + seconds) : seconds);
+	}
+	return time;
 }