mao 1 год назад
Родитель
Сommit
e3ab8074ba
3 измененных файлов с 22 добавлено и 8 удалено
  1. 11 0
      pages/batchReporting/index.vue
  2. 1 0
      pages/reportHistory/index.vue
  3. 10 8
      pages/reportingForWork/index.vue

+ 11 - 0
pages/batchReporting/index.vue

@@ -214,6 +214,17 @@
 		getDayWorkList(reqData).then(res => {
 			if (res.code == 200) {
 				listData.value = res.data;
+				for (let i = 0; i < listData.value.length; i++) {
+					if(listData.value[i].prevProcess){
+						let sum = 0;
+						for (let j = 0; j < listData.value[i].dayworkItemList.length; j++) {
+							if(listData.value[i].dayworkItemList[j].processId == listData.value[i].prevProcess.id && (listData.value[i].dayworkItemList[j].status == 2 || listData.value[i].dayworkItemList[j].status == 3)){
+								sum += listData.value[i].dayworkItemList[j].qualifiedNum;
+							}
+						}
+						listData.value[i].processQualifiedNum = sum;
+					}
+				}
 
 				// 计算总工时
 				// for (let i = 0; i < listData.value.length; i++) {

+ 1 - 0
pages/reportHistory/index.vue

@@ -25,6 +25,7 @@
 		border-bottom: 1rpx solid lightgray;">
 			<uni-section title="选择日期:" type="square" class="uni-row" style="margin-left: 16rpx;">
 				<uni-data-select v-model="selectDate" :localdata="dateList" @change="change" :clear="false"
+				placeholder="无报工记录"
 					style="width: 200rpx;"></uni-data-select>
 			</uni-section>
 			<uni-section title="总数:" type="square" class="uni-row" style="justify-content: center;align-items: center;">

+ 10 - 8
pages/reportingForWork/index.vue

@@ -36,7 +36,7 @@
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">结束时间</text>
-					<text class="label right">{{ item['endTime'] ? item['endTime'] : '-'}}</text>
+					<text class="label right">{{ item['endTime'] ? item['endTime'] : '-' }}</text>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">废品数</text>
@@ -45,7 +45,7 @@
 				<view class="item-info uni-row">
 					<text class="label">投入数</text>
 					<text
-						class="label right">{{store.dayworkInfo['processQualifiedNum'] == 0 ? store.dayworkInfo['oneLotQuantity'] : store.dayworkInfo['processQualifiedNum']}}</text>
+						class="label right">{{store.dayworkInfo['processQualifiedNum'] == 0 ? store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo['oneLotQuantity'] : store.dayworkInfo['processQualifiedNum']}}</text>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">设备</text>
@@ -142,7 +142,7 @@
 	})
 
 	function init() {
-		console.log(store.dayworkInfo.processSequence)
+		console.log(store.dayworkInfo)
 		userInfo.value = store.userInfo;
 		uni.showLoading({
 			title: '加载中'
@@ -172,7 +172,7 @@
 			}
 		})
 
-		getEquipmentByUidAndDid(store.planDetails.id,store.curDeptDetails.deptId).then(equipmentRes => {
+		getEquipmentByUidAndDid(store.planDetails.id, store.curDeptDetails.deptId).then(equipmentRes => {
 			if (equipmentRes.code == 200) {
 				hasEquipment.value = equipmentRes.rows.length > 0 ? true : false;
 			}
@@ -320,8 +320,9 @@
 				productionPlanId: curPlan.value.productionPlanId,
 				productionPlanDetailId: curPlan.value.id,
 				technologicalProcessId: curPlan.value.technologicalProcessId,
-				prodNum: store.dayworkInfo['processQualifiedNum'] == 0 ? store.dayworkInfo['oneLotQuantity'] : store
-					.dayworkInfo['processQualifiedNum'],
+				prodNum: store.dayworkInfo['processQualifiedNum'] == 0 ?
+					store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo[
+						'oneLotQuantity'] : store.dayworkInfo['processQualifiedNum'],
 				deptId: store.curDeptDetails.deptId,
 				deptName: store.curDeptDetails.deptName
 			}
@@ -333,8 +334,9 @@
 				productionPlanId: curPlan.value.productionPlanId,
 				productionPlanDetailId: curPlan.value.id,
 				technologicalProcessId: curPlan.value.technologicalProcessId,
-				prodNum: store.dayworkInfo['processQualifiedNum'] == 0 ? store.dayworkInfo['oneLotQuantity'] : store
-					.dayworkInfo['processQualifiedNum'],
+				prodNum: store.dayworkInfo['processQualifiedNum'] == 0 ?
+					store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo[
+						'oneLotQuantity'] : store.dayworkInfo['processQualifiedNum'],
 				status: 1,
 				startTime: timestampToTime(new Date()),
 				deptId: store.curDeptDetails.deptId,