guoyujia hace 1 año
padre
commit
e321abf169
Se han modificado 1 ficheros con 42 adiciones y 2 borrados
  1. 42 2
      pages/sorting/options.vue

+ 42 - 2
pages/sorting/options.vue

@@ -14,8 +14,8 @@
 			</view>
 			<!-- 搜索框 -->
 			<view class="search-container uni-row">
-				<input type="text" v-model="keywords" placeholder="请输入编号/关键字" />
-				<view class="btn">搜索</view>
+				<input type="text" v-model="keywords" placeholder="请输入关键字" />
+				<view class="btn" @click="handleSearch()">搜索</view>
 			</view>
 			<!-- 选项 -->
 			<view class="option-item" v-for="(item, index) in optionList" :key="index"
@@ -78,6 +78,29 @@
 			}
 		})
 	})
+	function handleSearch() {
+	let data = {technologicalProcessId: dayworkItem.value.technologicalProcessId,
+		processId: dayworkItem.value.processId,
+		keywords:keywords.value}
+		getInspectionList(data).then(res => {
+			console.log(res)
+			if (res.code === 200) {
+				optionList1.value = res.data.instructions
+				optionList2.value = res.data.standards
+			if(currentTabName.value == 1){
+			optionList.value = optionList1.value
+		}else{
+			optionList.value = optionList2.value
+		}
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: '分选标准和检查指导项获取失败'
+				})
+			}
+		})
+		
+	}
 	// 页面生命周期函数
 	onLoad(() => {
 		// optionList1.value = [
@@ -126,12 +149,29 @@
 
 	// tabbar切换
 	const handleTabBarClick = (val) => {
+		let data = {technologicalProcessId: dayworkItem.value.technologicalProcessId,
+			processId: dayworkItem.value.processId,
+			keywords:keywords.value}
+			getInspectionList(data).then(res => {
+				console.log(res)
+				if (res.code === 200) {
+					optionList1.value = res.data.instructions
+					optionList2.value = res.data.standards
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '分选标准和检查指导项获取失败'
+					})
+				}
+			})
 		switch (val) {
 			case 1:
 				optionList.value = optionList1.value
+				keywords.value =''
 				break
 			case 2:
 				optionList.value = optionList2.value
+				keywords.value = ''
 		}
 		currentTabName.value = val
 	}