guoyujia пре 8 месеци
родитељ
комит
b174ac3298
2 измењених фајлова са 58 додато и 50 уклоњено
  1. 50 50
      pages/queryLotInfo/index.vue
  2. 8 0
      pages/sortBatchReporting/index.vue

+ 50 - 50
pages/queryLotInfo/index.vue

@@ -191,7 +191,7 @@
 				<view class="item-info uni-row"> <text class="label">检查员:</text>
 					<text class="label right ">{{ item['nickName'] }}</text>
 				</view>
-				<view v-for="(info, index) in item.processInspectionDetails" :key="index">
+				<view v-if="item.processInspectionDetails && item.processInspectionDetails.length>0" v-for="(info, index) in item.processInspectionDetails" :key="index">
 					<view class="item-info uni-row">
 						<text class="label">检测项目:</text>
 						<text class="label right">{{ info['checkStandard']}}</text>
@@ -206,7 +206,7 @@
 					</view>
 				</view>
 				<!-- 拍照上传部分 -->
-						<view class="item-info uni-row">
+						<view v-if="item.processInspectionPictureList && item.processInspectionPictureList.length>0" class="item-info uni-row">
 							<text class="label">拍照上传:</text>
 							<text class=" label right" >
 							<uni-file-picker v-model="item.processInspectionPictureList" :readonly="true"   return-type="array" :image-styles="imageStyles"  file-mediatype="image" class="my-files" ></uni-file-picker>
@@ -400,54 +400,54 @@
 	//扫码
 	function handleScanCode() {
 		//引入原生插件
-		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
-		if (mpaasScanModule) {
-			// 调用插件的 mpaasScan 方法
-			mpaasScanModule.mpaasScan({
-					// 扫码识别类型,参数可多选,qrCode、barCode,
-					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
-					scanType: ["qrCode", "barCode"],
-					// 是否隐藏相册,默认false不隐藏
-					hideAlbum: false,
-				},
-				(ret) => {
-					console.log(ret);
-					let vehicleObj = {
-						carrierCode: ret.resp_result
-					};
-					if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
-						uni.showToast({
-							icon: "none",
-							title: "请扫载具码",
-							duration: 1000
-						})
-						return;
-					}
-					getDayworkCarrierByCarrierCode({
-						carrierCode: vehicleObj.carrierCode,
-					}).then(response => {
-						if (response.code == 200) {
-							if (response.data.length > 0) {
-								if (response.data.length > 1) {
-									selectLotDialog.value.open(response.data);
-								} else {
-									handleDoIt(response.data[0])
-								}
-							} else {
-								uni.showToast({
-									icon: 'none',
-									title: "该箱未绑定批次,请重新扫码",
-									duration: 2000
-								})
-							}
-						}
-					})
-				}
-			);
-		} else {
+		// const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		// if (mpaasScanModule) {
+		// 	// 调用插件的 mpaasScan 方法
+		// 	mpaasScanModule.mpaasScan({
+		// 			// 扫码识别类型,参数可多选,qrCode、barCode,
+		// 			// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+		// 			scanType: ["qrCode", "barCode"],
+		// 			// 是否隐藏相册,默认false不隐藏
+		// 			hideAlbum: false,
+		// 		},
+		// 		(ret) => {
+		// 			console.log(ret);
+		// 			let vehicleObj = {
+		// 				carrierCode: ret.resp_result
+		// 			};
+		// 			if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+		// 				uni.showToast({
+		// 					icon: "none",
+		// 					title: "请扫载具码",
+		// 					duration: 1000
+		// 				})
+		// 				return;
+		// 			}
+		// 			getDayworkCarrierByCarrierCode({
+		// 				carrierCode: vehicleObj.carrierCode,
+		// 			}).then(response => {
+		// 				if (response.code == 200) {
+		// 					if (response.data.length > 0) {
+		// 						if (response.data.length > 1) {
+		// 							selectLotDialog.value.open(response.data);
+		// 						} else {
+		// 							handleDoIt(response.data[0])
+		// 						}
+		// 					} else {
+		// 						uni.showToast({
+		// 							icon: 'none',
+		// 							title: "该箱未绑定批次,请重新扫码",
+		// 							duration: 2000
+		// 						})
+		// 					}
+		// 				}
+		// 			})
+		// 		}
+		// 	);
+		// } else {
 			// 测试时用
 			getDayworkCarrierByCarrierCode({
-				carrierCode: '000581'
+				carrierCode: '000605'
 			}).then(res => {
 				if (res.code == 200) {
 					if (res.data.length > 0) {
@@ -465,7 +465,7 @@
 					}
 				}
 			})
-		}
+		// }
 	}
 
 	function handleDoIt(data) {
@@ -513,7 +513,7 @@
 		}).then(response => {
 			if (response.code == 200) {
 				response.data.forEach(item =>{
-					if(item.processInspectionPictureList.length>0){
+					if(item.processInspectionPictureList && item.processInspectionPictureList.length>0){
 						item.processInspectionPictureList.forEach(i=>{
 							i.url = webHost.value + i.url
 						})

+ 8 - 0
pages/sortBatchReporting/index.vue

@@ -708,6 +708,14 @@
 		showDayworkSave(data).then(res => {
 			console.log(res)
 			init(store.planDetails.id);
+			}else{
+				uni.showToast({
+					icon: "none",
+					title: res.msg,
+					duration: 2000
+				})
+			}
+			
 		})
 	}