ezhizao_zx 1 jaar geleden
bovenliggende
commit
adccf8382e
2 gewijzigde bestanden met toevoegingen van 16 en 17 verwijderingen
  1. 6 5
      pages/changeBox/index.vue
  2. 10 12
      pages/fastProductionPlan/index.vue

+ 6 - 5
pages/changeBox/index.vue

@@ -88,7 +88,7 @@
 		const eventChannel = instance.getOpenerEventChannel();
 
 		eventChannel.on('acceptDataFromOpenerPage', function(data) {
-			console.log('acceptDataFromOpenerPage', data)
+			// console.log('acceptDataFromOpenerPage', data)
 			if (data && data.data) {
 				dayWorkInfo = data.data.daywork
 				init({
@@ -124,9 +124,9 @@
 	// })
 
 	function init(data) {
-		console.log(data)
+		// console.log(data)
 		getDayworkCarrierList(data).then(res => {
-			console.log(res)
+			// console.log(res)
 			if (res.code == 200) {
 				bindList.value = [...res.rows];
 				newBindList.value = res.rows;
@@ -163,7 +163,7 @@
 	// }
 	function handleDelVehicleNo(item, index) {
 		if (bindList.value.some(carrier => carrier.carrierCode == item.carrierCode)) {
-			console.log(bindList.value)
+			// console.log(bindList.value)
 			newBindList.value.splice(index, 1);
 			let discardVehicleInfo = {
 				carrierCode: item.carrierCode,
@@ -220,7 +220,7 @@
 					newCarrierId: vehicleObj.carrierId
 				}
 				checkCarrierNew(checkData).then(response => {
-					console.log(response)
+					// console.log(response)
 					// uni.showToast({
 					// 	icon: 'none',
 					// 	title: response.msg
@@ -292,6 +292,7 @@
 					icon: 'success',
 					title: '添加成功',
 				});
+				uni.$emit('refreshQuickReport')
 				uni.navigateBack({
 					delta: 1
 				});

+ 10 - 12
pages/fastProductionPlan/index.vue

@@ -7,7 +7,6 @@
 						<button :class="[ checkAll ? 'active' : 'select' ]" @click="handleAll"
 							style="margin-left: 0px;display: flex; align-items: center; justify-content: center;">全选</button>
 					</view>
-
 					<button @click="handleSearch" style="margin-right: 20rpx ;">搜索</button>
 					<uni-data-select v-model="workshopId" :localdata="workshopList" @change="handleChangeWorkshop"
 						:clear="false" class="label right"
@@ -52,12 +51,9 @@
 				</view>
 			</view>
 		</view>
-
-
 		<view v-if="allData.length==0" style="color: #999;">
 			<image style="width: 420rpx; height: 420rpx; padding-top: 30% ; margin: auto;"
 				src="../../static/images/fastProductionPlan.png" />
-
 		</view>
 		<view v-if="allData.length==0" class='bottom-btn-container'>
 			<text style="margin: auto; padding-bottom: 10%;">扫箱码开始快速报工</text>
@@ -116,7 +112,7 @@
 	})
 	//初始化
 	function init() {
-		console.log(store.curDeptDetails)
+		// console.log(store.curDeptDetails)
 		uni.showLoading({
 			title: '加载中'
 		});
@@ -124,7 +120,7 @@
 		getQuickDayworkList({
 			deptId: store.curDeptDetails.deptId,
 		}).then(res => {
-			console.log(res)
+			// console.log(res)
 			if (res.code == 200) {
 				allData.value = res.rows
 				if (allData.value.length == 0) {
@@ -138,7 +134,7 @@
 					text: v.name,
 					depts: v.depts
 				}))
-				if (workshopId.value == null && workshopList.value.length > 0) {
+				if ((workshopId.value == null || !workshopList.value.some(e => e.value === workshopId.value)) && workshopList.value.length > 0) {
 					workshopId.value = workshopList.value[0].value
 					handleChangeWorkshop(workshopId.value)
 				} else {
@@ -158,7 +154,7 @@
 	}
 	
 	function refreshSearch(input) {
-		console.log(input)
+		// console.log(input)
 		keyword.value = input
 		handleChangeWorkshop(workshopId.value)
 	}
@@ -263,8 +259,8 @@
 
 	function handleChangeWorkshop(arg) {
 		const workshop = workshopList.value.find(v => v.value === arg)
-		console.log(allData.value)
-		console.log(workshop)
+		// console.log(allData.value)
+		// console.log(workshop)
 		// console.log()
 		listData.value = allData.value.filter(v => workshop.depts.some(e => e.deptId === v.quickInfo.deptId) && (v.lotCode.includes(keyword.value) || v.productDescription.includes(keyword.value)))
 	}
@@ -290,6 +286,9 @@
 	}
 
 	function handleChangeCarrier(item) {
+		uni.$once('refreshQuickReport', () => {
+			init()
+		})
 		store.dayworkInfo = null
 		uni.navigateTo({
 			url: "/pages/changeBox/index",
@@ -311,7 +310,7 @@
 			return
 		}
 		finishQuick(selection.value).then(res => {
-			console.log(res)
+			// console.log(res)
 			if (res.code === 200) {
 				init()
 			}
@@ -323,7 +322,6 @@
 
 <style lang="scss">
 	$nav-height: 60rpx;
-
 	.bottom-btn-container {
 		position: fixed;
 		top: 80%;