fix(xumu): 修复耳标号查询功能
- 更新 API 请求参数,添加 pageSize 和 pageNum - 修改数据处理逻辑,使用 records[0] 而不是直接使用 data - 优化代码格式,删除多余的空格和换行
This commit is contained in:
		| @@ -14,9 +14,9 @@ export default { | ||||
|   methods: { | ||||
|     getText(biochipEarNumber) { | ||||
|       this.info = {} | ||||
|       return this.instance.post("/api/breed/earTag/page", null, { params: { biochipEarNumber } }).then(res => { | ||||
|         if (res?.data) { | ||||
|           this.info = res.data | ||||
|       return this.instance.post("/api/breed/earTag/page", null, {params: {biochipEarNumber, pageSize: 10, pageNum: 1}}).then(res => { | ||||
|         if (res?.data?.records) { | ||||
|           this.info = res.data.records[0] | ||||
|           this.$emit('enter', this.info) | ||||
|         } | ||||
|       }) | ||||
| @@ -27,7 +27,7 @@ export default { | ||||
|  | ||||
| <template> | ||||
|   <section class="AiEartagRemote"> | ||||
|     <ai-input v-model="value" placeholder="请输入耳标号按回车查询,或扫描耳标号" @keyup.enter.native="getText(value)" /> | ||||
|     <ai-input v-model="value" placeholder="请输入耳标号按回车查询,或扫描耳标号" @keyup.enter.native="getText(value)"/> | ||||
|   </section> | ||||
|  | ||||
| </template> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user