Forráskód Böngészése

分选-更换载具,显示原材料厂家

wangxin 1 éve
szülő
commit
82de92c3ac
3 módosított fájl, 69 hozzáadás és 6 törlés
  1. 14 1
      pages/changeBox/index.vue
  2. 4 0
      pages/sortBatchReporting/index.vue
  3. 51 5
      pages/sorting/form.vue

+ 14 - 1
pages/changeBox/index.vue

@@ -87,6 +87,16 @@
 		const instance = getCurrentInstance().proxy
 		const eventChannel = instance.getOpenerEventChannel();
 
+		eventChannel.on('sortingFromOpenerPage', function(data) {
+			dayWorkInfo = data.data.daywork
+			let reqParam = {
+				dayworkId: data.data.dayworkId,
+				isChanged: 0
+			}
+			init(reqParam);
+			console.log("dayWorkInfo = data.data.daywork", dayWorkInfo);
+		})
+
 		eventChannel.on('acceptDataFromOpenerPage', function(data) {
 			// console.log('acceptDataFromOpenerPage', data)
 			if (data && data.data) {
@@ -124,7 +134,7 @@
 	// })
 
 	function init(data) {
-		// console.log(data)
+		console.log("data", data)
 		getDayworkCarrierList(data).then(res => {
 			// console.log(res)
 			if (res.code == 200) {
@@ -188,6 +198,7 @@
 	function handleScanCode() {
 		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+
 		// 调用插件的 mpaasScan 方法
 		mpaasScanModule.mpaasScan({
 				// 扫码识别类型,参数可多选,qrCode、barCode,
@@ -219,6 +230,7 @@
 					dayworkCarriers: newBindList.value,
 					newCarrierId: vehicleObj.carrierId
 				}
+				console.log("dayWorkInfo", dayWorkInfo);
 				checkCarrierNew(checkData).then(response => {
 					// console.log(response)
 					// uni.showToast({
@@ -285,6 +297,7 @@
 				}
 			})
 		}
+		console.log("dayWorkInfo", dayWorkInfo);
 		dayWorkInfo.dayworkCarriers = newBindList.value;
 		saveDayWork(dayWorkInfo).then(res => {
 			if (res.code === 200) {

+ 4 - 0
pages/sortBatchReporting/index.vue

@@ -47,6 +47,10 @@
 					<text
 						class="label right">{{ item['furnaceNoInfo'] ? item['furnaceNoInfo'].firstTechnicalRequirement + ";" + item['furnaceNoInfo'].secondTechnicalRequirement : '-' }}</text>
 				</view>
+				<view class="item-info uni-row">
+					<text class="label">原材料厂家</text>
+					<text class="label right">{{ item['furnaceNoInfo'] ? item['furnaceNoInfo'].factory : '-' }}</text>
+				</view>
 				<view class="item-info uni-row">
 					<text class="label">箱号</text>
 					<text class="label right">{{ item['carrierName'] ? item['carrierName'] : '-' }}</text>

+ 51 - 5
pages/sorting/form.vue

@@ -8,6 +8,9 @@
 			<view class="product-info">
 				产品描述: {{ dayworkItem.productDescription }}
 			</view>
+			<view class="product-info">
+				原材料厂家: {{ dayworkInfo.furnaceNoInfo.factory }}
+			</view>
 			<view class="product-info">
 				投产数量: {{ dayworkItem.prodNum }}
 			</view>
@@ -75,10 +78,14 @@
 				<span v-else>{{ dayworkItem.remark }}</span>
 			</view>
 
-			<view class="btns-container uni-row" v-if="Number(dayworkItem.status) < 3">
-				<view v-if="checkFinishable()" class="finished-btn" @click.stop="handleFinishDaywork">结束报工</view>
-				<view v-if="!checkFinishable()" class="pause-btn" @click.stop="handleUpdateDaywork">暂停</view>
-				<view class="question-btn uni-column" @click.stop="handleAddConsultation">
+			<view class="btns-container uni-row">
+				<view class="bottom-btn left-btn " @click="handleChangeCarrier">更换载具</view>
+				<view v-if="checkFinishable()&&Number(dayworkItem.status) < 3" class="finished-btn"
+					@click.stop="handleFinishDaywork">结束报工</view>
+				<view v-if="!checkFinishable()&&Number(dayworkItem.status) < 3" class="pause-btn"
+					@click.stop="handleUpdateDaywork">暂停</view>
+				<view v-if="Number(dayworkItem.status) < 3" class="question-btn uni-column"
+					@click.stop="handleAddConsultation">
 					<uni-icons type="headphones" size="24" />
 					<text>咨询</text>
 				</view>
@@ -128,7 +135,6 @@
 		const eventChannel = instance.getOpenerEventChannel();
 
 		eventChannel.on('acceptDataFromOpenerPage', function(data) {
-			// console.log('acceptDataFromOpenerPage', data)
 			if (data && data.data) {
 				dayworkInfo.value = data.data
 				init({
@@ -145,6 +151,7 @@
 
 	/***************************** 定义了一些方法 *****************************/
 	const init = (data) => {
+		console.log("dayworkInfo", dayworkInfo.value);
 		// 获取当前报工信息
 		getSortingDayworkItem(data).then(res => {
 			console.log(res)
@@ -245,6 +252,23 @@
 		})
 	}
 
+	/* 更换载具*/
+	function handleChangeCarrier(item) {
+		// uni.$once('refreshQuickReport', () => {
+		// 	init()
+		// })
+		store.dayworkInfo = null
+		uni.navigateTo({
+			url: "/pages/changeBox/index",
+			success: function(res) {
+				// 通过eventChannel向被打开页面传送数据
+				res.eventChannel.emit('sortingFromOpenerPage', {
+					data: dayworkItem.value
+				})
+			}
+		})
+	}
+
 	// 添加不合格信息
 	const handleAddConsultation = () => {
 		isEventTriggered.value = false; // 更新标志位状态
@@ -543,6 +567,7 @@
 		}
 	}
 
+
 	.daywork-container {
 		margin-top: 24rpx;
 		padding: 24rpx;
@@ -582,6 +607,27 @@
 		.btns-container {
 			margin-top: 24rpx;
 
+			.bottom-btn {
+				display: flex;
+				flex: 1;
+				height: 80rpx;
+				background-color: #5555ff;
+				color: #ffffff;
+				text-align: center;
+				justify-content: center;
+				align-items: center;
+				border-radius: 8rpx;
+				margin-right: 10rpx;
+
+				&.left-btn {
+					background-color: rgba(85, 85, 255, 1.0);
+				}
+
+				&.right-btn {
+					margin-left: 24rpx;
+				}
+			}
+
 			.finished-btn {
 				display: flex;
 				flex: 1;