mao il y a 1 an
Parent
commit
12984e4e85

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

@@ -35,7 +35,7 @@
 </template>
 
 
-<script setup>
+<script setup> 
 	import {
 		ref,
 		getCurrentInstance
@@ -50,8 +50,8 @@
 	const baseDialog = ref(null)
 	const workInfo = ref({})
 	const open = (data) => {
-		workInfo.value.dayworkId = data.dayworkId;
-		workInfo.value.id = data.id;
+		workInfo.value = data;
+		console.log(data)
 		baseDialog.value.open()
 	}
 	const emit = defineEmits(['reset'])
@@ -82,6 +82,7 @@
 					duration: 2000
 				});
 				emit('reset');
+				uni.$emit('dayworkItemUpdate');
 				baseDialog.value.close();
 			} else {
 				uni.showToast({

+ 1 - 0
components/dialog-turnoverApplication/dialog-turnoverApplication.vue

@@ -176,6 +176,7 @@
 			})
 		}
 		emit('confirm');
+		uni.$emit('dayworkItemUpdate');
 	}
 
 	function handleChange() {

+ 6 - 6
pages/batchReporting/index.vue

@@ -14,9 +14,9 @@
 						</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 v-else-if="item['status'] == 0" class="tag finished "><text class="label">未开始</text>
 						</view>
-						<view v-else-if="item['status'] == 4" type="default" class="tag finished"><text
+						<view v-else-if="item['status'] == 4" type="default finished" class="tag finished"><text
 								class="label">已完成</text></view>
 					</view>
 				</view>
@@ -91,9 +91,6 @@
 		showDayworkSave,
 		turnoverDelete
 	} from '@/api/business/dayWork.js'
-	// import {
-	// 	getDayWorkItemList
-	// } from '@/api/business/dayWorkItem.js'
 	import {
 		store
 	} from '@/store/index.js'
@@ -132,7 +129,10 @@
 			bottomStatus.value = 1;
 		}
 		init(curSubPlan.value.id);
-		uni.$on('batchReporting-addBatch', () => {
+		uni.$once('batchReporting-addBatch', () => {
+			init(curSubPlan.value.id);
+		})
+		uni.$once('dayworkItemUpdate', () => {
 			init(curSubPlan.value.id);
 		})
 	})

+ 12 - 4
pages/changeBox/index.vue

@@ -46,8 +46,8 @@
 		getDayworkCarrierList(data).then(res => {
 			console.log(res)
 			if(res.code == 200){
-				console.log(res)
 				vehicleList.value = res.rows;
+				console.log(vehicleList.value)
 			}
 		}) 
 	}
@@ -62,12 +62,20 @@
 			onlyFromCamera: true, // 只允许相机扫码
 			success: function(res) {
 				let vehicleObj = JSON.parse(res.result);
+				if(!vehicleObj.carrierId || vehicleObj.carrierId == ""){
+					uni.showToast({
+						icon: "error",
+						title: "载具码错误",
+						duration: 2000
+					})
+					return;
+				}
 				for (let i = 0; i < vehicleList.value.length; i++) {
-					if (Object.entries(vehicleList.value[i]).toString() === Object.entries(vehicleObj)
-						.toString()) {
+					if (vehicleList.value[i].carrierId === vehicleObj.carrierId) {
 						uni.showToast({
 							icon: "error",
-							title: "载具已存在"
+							title: "载具已存在",
+							duration: 2000
 						})
 						return;
 					}

+ 1 - 1
pages/dashboard/index.vue

@@ -87,7 +87,7 @@
 	}
 	
 	function handleSwitchOrQuit() {
-		uni.navigateTo({
+		uni.reLaunch({
 			url: '/pages/index/index'
 		})
 	}

+ 5 - 1
pages/productionPlan/index.vue

@@ -84,7 +84,11 @@
 				tenantId: store.tenantId
 			}
 		}
-		init(initReqParam.value)
+		init(initReqParam.value);
+		// dayworkItem数据更改后刷新数据
+		uni.$once('dayworkItemUpdate', () => {
+			init(initReqParam.value);
+		})
 	})
 
 	/**

+ 3 - 1
pages/reportingForWork/index.vue

@@ -92,7 +92,8 @@
 	const dayWorkItem = ref({}) // 添加传输对象
 	const reqParam = ref([]) // 请求参数
 	const userInfo = ref(null) // 登录员工信息
-	const flag = ref(true)
+	const flag = ref(true)     // 控制底部开始加工按钮功能
+
 
 	onLoad(() => {
 		curSubDetails.value = store.planSubDetails;
@@ -214,6 +215,7 @@
 				});
 				reqParam.value = [];
 				init();
+				uni.$emit('dayworkItemUpdate');
 			} else {
 				uni.showToast({
 					icon: 'error',