瀏覽代碼

检验记录返回逻辑修改

zhangxike 2 月之前
父節點
當前提交
2facb8981f
共有 2 個文件被更改,包括 21 次插入4 次删除
  1. 0 2
      pages/work/download/DownloadDetail.uvue
  2. 21 2
      pages/work/report/InspectionList.uvue

+ 0 - 2
pages/work/download/DownloadDetail.uvue

@@ -157,8 +157,6 @@
 	})
 
 	const goBack = () => {
-
-		5
 		uni.navigateBack()
 	}
 

+ 21 - 2
pages/work/report/InspectionList.uvue

@@ -73,11 +73,10 @@
 				<view class="info-row">
 					<text class="label">结论</text>
 					<view class="value">
-						<radio-group class="radio-group-horizontal" @change="resultChange" v-if="item.nature == '定性'">
+						<radio-group class="radio-group-horizontal" @change="resultChange" disabled = "item.nature != '定性'" >
 							<radio class="radio-group-horizontal-rg" value="合格" :checked="item.result == '合格'">合格</radio>
 							<radio class="radio-group-horizontal-rg" value="不合格" :checked="item.result == '不合格'">不合格</radio>
 						</radio-group>	
-						<input v-model="item.result" class="surround uni-input" v-if="item.nature != '定性'"></input>
 					</view>
 				</view>
 				<view class="info-row">
@@ -124,6 +123,22 @@
 	// 下拉框选项数组 - 定性分析选项
 	const array = ref(['合格', '不合格']);
 	
+	//自定义返回行为,覆盖系统默认返回按钮
+	const backPressOptions = reactive({
+		from: 'backbutton'
+	} as OnBackPressOptions)
+	
+	onBackPress((options : OnBackPressOptions) : boolean | null => {
+		uni.navigateTo({
+			url: `/pages/work/download/DownloadDetail?id=${pdid}`,
+			// 修改动画方向为从左到右退回
+			animationType: 'slide-in-left', // 使用从左到右滑出的动画效果
+			animationDuration: 300 // 动画持续时间,单位ms
+		})
+		// 返回true表示拦截默认返回行为
+		return true
+	})
+	
 	const getParsedValue = computed(() => {
 		return (value : string | number) => {
 			if (typeof value === 'number') {
@@ -281,6 +296,10 @@
 		// 加载初始数据(转换 senum 为数值,避免字符串类型问题)
 		refreshRecords(getParsedValue.value(senum))
 	});
+	
+	defineExpose({
+		backPressOptions
+	})
 </script>
 
 <style scoped>