feat(purchase): 添加采购单号搜索功能并优化参数处理
- 在搜索框中统一使用“搜索采购单号”作为占位文本 - 在 `purchase.ts` API 中添加 `businessKey` 参数,用于传递采购单号 - 更新 `purchaseListParams` 类型定义,将 `keyword` 改为 `purchaseNo` - 优化 `onTabChange` 方法,移除冗余代码并调用 `handleClear` 清空搜索关键词master
parent
18047796ac
commit
2fac4ff782
|
|
@ -26,6 +26,7 @@ export const getCompletedPurchaseList = (params: PurchaseListParams): Promise<Ax
|
||||||
// 添加参数到FormData
|
// 添加参数到FormData
|
||||||
formData.append('page', params.page.toString())
|
formData.append('page', params.page.toString())
|
||||||
formData.append('pageSize', params.pageSize.toString())
|
formData.append('pageSize', params.pageSize.toString())
|
||||||
|
if (params.purchaseNo) formData.append('businessKey', params.purchaseNo.toString())
|
||||||
if (params.processKeyList) formData.append('processKeyList', params.processKeyList)
|
if (params.processKeyList) formData.append('processKeyList', params.processKeyList)
|
||||||
|
|
||||||
return http.post('/flow/completed/list', formData)
|
return http.post('/flow/completed/list', formData)
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ export const usePurchaseStore = defineStore('purchase', {
|
||||||
const params: PurchaseListParams = {
|
const params: PurchaseListParams = {
|
||||||
page: this.currentPage,
|
page: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
keyword: this.keyword || undefined
|
purchaseNo: this.keyword || undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await getPurchaseList(params)
|
const response = await getPurchaseList(params)
|
||||||
|
|
@ -145,7 +145,7 @@ export const usePurchaseStore = defineStore('purchase', {
|
||||||
const params: PurchaseListParams = {
|
const params: PurchaseListParams = {
|
||||||
page: this.completedCurrentPage,
|
page: this.completedCurrentPage,
|
||||||
pageSize: this.completedPageSize,
|
pageSize: this.completedPageSize,
|
||||||
keyword: this.completedKeyword || undefined,
|
purchaseNo: this.completedKeyword || undefined,
|
||||||
processKeyList:['purchase_order_online']
|
processKeyList:['purchase_order_online']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ export interface Purchase {
|
||||||
export interface PurchaseListParams {
|
export interface PurchaseListParams {
|
||||||
page: number
|
page: number
|
||||||
pageSize: number
|
pageSize: number
|
||||||
keyword?: string
|
purchaseNo?: string
|
||||||
processKeyList?: string[]
|
processKeyList?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="search-container">
|
<div class="search-container">
|
||||||
<van-search
|
<van-search
|
||||||
v-model="searchKeyword"
|
v-model="searchKeyword"
|
||||||
:placeholder="currentTab === 'pending' ? '搜索采购单号' : '搜索采购合同名称'"
|
:placeholder="currentTab === 'pending' ? '搜索采购单号' : '搜索采购单号'"
|
||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
@clear="handleClear"
|
@clear="handleClear"
|
||||||
class="custom-search"
|
class="custom-search"
|
||||||
|
|
@ -163,10 +163,11 @@ const onRefresh = async () => {
|
||||||
const onTabChange = (name: string) => {
|
const onTabChange = (name: string) => {
|
||||||
currentTab.value = name
|
currentTab.value = name
|
||||||
searchKeyword.value = ''
|
searchKeyword.value = ''
|
||||||
|
handleClear()
|
||||||
if (name === 'completed' && completedList.value.length === 0) {
|
//
|
||||||
onCompletedLoad()
|
// if (name === 'completed' && completedList.value.length === 0) {
|
||||||
}
|
// onCompletedLoad()
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 已审批列表加载
|
// 已审批列表加载
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue