wangxin преди 1 година
родител
ревизия
7cb086d18d
променени са 7 файла, в които са добавени 119 реда и са изтрити 69 реда
  1. 6 4
      pages.json
  2. 2 37
      pages/batchReporting/index.vue
  3. 1 0
      pages/dashboard/index.vue
  4. 13 1
      pages/processInspection/form.vue
  5. 22 12
      pages/productionPlan/index.vue
  6. 50 3
      pages/sortBatchReporting/index.vue
  7. 25 12
      pages/sortProductionPlan/index.vue

+ 6 - 4
pages.json

@@ -24,8 +24,8 @@
 		{
 			"path": "pages/productionPlan/index",
 			"style": {
-				"navigationBarTitleText": "生产计划单"
-				// "enablePullDownRefresh": true
+				"navigationBarTitleText": "生产计划单",
+				"enablePullDownRefresh": true
 			}
 		},
 		{
@@ -87,13 +87,15 @@
 		{
 			"path": "pages/sortProductionPlan/index",
 			"style": {
-				"navigationBarTitleText": "分选报工"
+				"navigationBarTitleText": "分选报工",
+				"enablePullDownRefresh": true
 			}
 		},
 		{
 			"path": "pages/sortBatchReporting/index",
 			"style": {
-				"navigationBarTitleText": "分选报工"
+				"navigationBarTitleText": "分选报工",
+				"enablePullDownRefresh": true
 			}
 		},
 		{

+ 2 - 37
pages/batchReporting/index.vue

@@ -219,43 +219,8 @@
 
 	// 页面下拉刷新操作
 	onPullDownRefresh(() => {
-		let reqData = {
-			productionPlanDetailId: store.planDetails.id,
-			deptId: store.curDeptDetails.deptId,
-			keywords: keywords.value
-		};
-		// console.log(normalStatus.value)
-
-		getDayWorkList(reqData).then(res => {
-			if (res.code == 200) {
-				tempList.value = res.data
-				if (normalStatus.value) {
-					listData.value = res.data.filter(item => {
-						return item.isWasteRecycling == 0 && item.isAmend == 0;
-					});
-				} else {
-					listData.value = res.data.filter(item => {
-						return item.isWasteRecycling == 1 || item.isAmend == 1;
-					})
-				}
-				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;
-					}
-				}
-				uni.stopPullDownRefresh();
-			}
-		})
+		uni.stopPullDownRefresh();
+		reflush();
 	})
 
 

+ 1 - 0
pages/dashboard/index.vue

@@ -94,6 +94,7 @@
 			nickName: ""
 		};
 		store.tenantId = userInfo.value.tenantId;
+		console.log("-----------", store.userInfo.roles)
 		if (store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length > 1) {
 			showTurn.value = true;
 			showOther.value = true;

+ 13 - 1
pages/processInspection/form.vue

@@ -253,7 +253,7 @@
 	//结束报工按钮
 	function endWork() {
 		let unf = unfitInfos.value;
-		for (var i = 0; i < unfitInfos.length; i++) {
+		for (var i = 0; i < unfitInfos.value.length; i++) {
 			if (!unf.checkStandard && !unf.checkResult && !unf.rejectNum) {
 				uni.showToast({
 					icon: 'none',
@@ -262,7 +262,19 @@
 				})
 				return;
 			}
+		}
 
+		let sumReject = 0
+		unfitInfos.value.forEach(v => {
+			sumReject += Number(v.rejectNum)
+		})
+		if (processInspecion.value.rejectNum != sumReject) {
+			uni.showToast({
+				icon: 'none',
+				title: "废品量与废品信息不一致",
+				duration: 2000
+			})
+			return;
 		}
 
 		save();

+ 22 - 12
pages/productionPlan/index.vue

@@ -6,12 +6,13 @@
 				<input class="nav-bar-input" type="text" v-model="keywords" placeholder="输入搜索关键词" />
 			</view>
 			<view class="search" @click="handleSearch">搜索</view>
-		</view> 
+		</view>
 		<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
 			<text>暂无生产计划</text>
 		</view>
 		<view v-else style="height: calc(100% - 100rpx); overflow: auto;">
-			<view  v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)" class="list-item">
+			<view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)"
+				class="list-item">
 				<view class="title-container uni-row">
 					<view class="title uni-row">
 						<text class="label">生产计划单号</text>
@@ -46,7 +47,9 @@
 </template>
 
 <script setup>
-	import { getPlanDetailsList } from '@/api/business/planDetails.js'
+	import {
+		getPlanDetailsList
+	} from '@/api/business/planDetails.js'
 	import {
 		ref
 	} from 'vue'
@@ -75,7 +78,7 @@
 		// dayworkItem数据更改后刷新数据
 		// uni.$on('dayworkItemUpdate', reflush);
 	})
-	
+
 	onShow(() => {
 		reflush();
 	})
@@ -88,11 +91,18 @@
 	/**	
 	 * 监听下拉刷新
 	 */
-	// onPullDownRefresh(() => {
-	// 	setTimeout(function() {
-	// 		uni.stopPullDownRefresh();
-	// 	}, 3000);
-	// })
+	onPullDownRefresh(() => {
+		getPlanDetailsList({
+			deptId: Number(store.curDeptDetails.deptId),
+			keywords: keywords.value
+		}).then(res => {
+			if (res.code == 200) {
+				listData.value = res.data;
+				uni.stopPullDownRefresh();
+			}
+			uni.stopPullDownRefresh();
+		})
+	})
 
 	function reflush() {
 		init();
@@ -104,9 +114,9 @@
 		});
 		getPlanDetailsList({
 			deptId: Number(store.curDeptDetails.deptId),
-			keywords:keywords.value
+			keywords: keywords.value
 		}).then(res => {
-			if(res.code == 200){
+			if (res.code == 200) {
 				listData.value = res.data;
 				uni.hideLoading();
 			}
@@ -149,7 +159,7 @@
 			border-radius: 15rpx;
 			padding: 0 15rpx;
 			flex-wrap: nowrap;
-			margin:0 10rpx 20rpx;
+			margin: 0 10rpx 20rpx;
 			line-height: $nav-height;
 
 			.input-uni-icon {

+ 50 - 3
pages/sortBatchReporting/index.vue

@@ -137,7 +137,8 @@
 		onLoad,
 		onReady,
 		onUnload,
-		onShow
+		onShow,
+		onPullDownRefresh
 	} from '@dcloudio/uni-app'
 	import {
 		getDayWorkList,
@@ -199,6 +200,52 @@
 		console.log(wasteRecyclingList.value.length)
 	})
 
+
+	/**	
+	 * 监听下拉刷新
+	 */
+	onPullDownRefresh(() => {
+		uni.stopPullDownRefresh();
+		reflush();
+		// normalStatus.value = true;
+		// let reqData = {
+		// 	productionPlanDetailId: store.planDetails.id,
+		// 	deptId: store.curDeptDetails.deptId,
+		// 	keywords: keywords.value
+		// };
+		// getDayWorkList(reqData).then(res => {
+		// 	if (res.code == 200) {
+		// 		tempList.value = res.data
+		// 		if (normalStatus.value) {
+		// 			listData.value = res.data.filter(item => {
+		// 				return item.isWasteRecycling == 0 && item.isAmend == 0;
+		// 			});
+		// 		} else {
+		// 			listData.value = res.data.filter(item => {
+		// 				return item.isWasteRecycling == 1 || item.isAmend == 1;
+		// 			})
+		// 		}
+		// 		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;
+		// 			}
+		// 		}
+		// 	}
+		// 	uni.stopPullDownRefresh();
+		// })
+
+	})
+
 	onShow(() => {
 		reflush();
 	})
@@ -471,10 +518,10 @@
 			});
 			normalStatus.value = true
 		}
-		
+
 		console.log(listData.value)
 	}
-	
+
 	function handleCancelTurnover(data) {
 		turnoverDelete(data).then(res => {
 			if (res.code == 200) {

+ 25 - 12
pages/sortProductionPlan/index.vue

@@ -6,12 +6,13 @@
 				<input class="nav-bar-input" type="text" v-model="keywords" placeholder="输入搜索关键词" />
 			</view>
 			<view class="search" @click="handleSearch">搜索</view>
-		</view> 
+		</view>
 		<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
 			<text>暂无生产计划</text>
 		</view>
 		<view v-else style="height: calc(100% - 100rpx); overflow: auto;">
-			<view  v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)" class="list-item">
+			<view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)"
+				class="list-item">
 				<view class="title-container uni-row">
 					<view class="title uni-row">
 						<text class="label">生产计划单号</text>
@@ -46,7 +47,9 @@
 </template>
 
 <script setup>
-	import { getPlanDetailsList } from '@/api/business/planDetails.js'
+	import {
+		getPlanDetailsList
+	} from '@/api/business/planDetails.js'
 	import {
 		ref
 	} from 'vue'
@@ -75,7 +78,7 @@
 		// dayworkItem数据更改后刷新数据
 		// uni.$on('dayworkItemUpdate', reflush);
 	})
-	
+
 	onShow(() => {
 		reflush();
 	})
@@ -88,11 +91,21 @@
 	/**	
 	 * 监听下拉刷新
 	 */
-	// onPullDownRefresh(() => {
-	// 	setTimeout(function() {
-	// 		uni.stopPullDownRefresh();
-	// 	}, 3000);
-	// })
+	onPullDownRefresh(() => {
+		uni.stopPullDownRefresh();
+		reflush();
+		// getPlanDetailsList({
+		// 	deptId: Number(store.curDeptDetails.deptId),
+		// 	keywords: keywords.value
+		// }).then(res => {
+		// 	if (res.code == 200) {
+		// 		listData.value = res.data;
+		// 		uni.stopPullDownRefresh();
+		// 	}
+		// 	uni.stopPullDownRefresh();
+		// })
+
+	})
 
 	function reflush() {
 		init();
@@ -104,9 +117,9 @@
 		});
 		getPlanDetailsList({
 			deptId: Number(store.curDeptDetails.deptId),
-			keywords:keywords.value
+			keywords: keywords.value
 		}).then(res => {
-			if(res.code == 200){
+			if (res.code == 200) {
 				listData.value = res.data;
 				uni.hideLoading();
 			}
@@ -149,7 +162,7 @@
 			border-radius: 15rpx;
 			padding: 0 15rpx;
 			flex-wrap: nowrap;
-			margin:0 10rpx 20rpx;
+			margin: 0 10rpx 20rpx;
 			line-height: $nav-height;
 
 			.input-uni-icon {