交班记录新增sort字段

This commit is contained in:
gyq
2024-08-03 16:55:20 +08:00
parent b495926968
commit 671159277c

View File

@@ -73,7 +73,8 @@ export default {
query: {
createdAt: [],
proName: '',
cateId: ''
cateId: '',
sort: 'id,desc'
},
tableData: {
data: [],
@@ -129,9 +130,9 @@ export default {
try {
let urlData = null
if (this.query.createdAt.length == 0) { // 为什么这么写 因为后端让我有时候传key值有时候不传 为啥不按照框架走后端处理起来太麻烦 前端处理 -- 魏文政 2024.7.30 15:50
urlData = `/api/tbHandover?page=${this.tableData.page + 1}&size=${this.tableData.size}&shopId=${localStorage.getItem("shopId")}`
urlData = `/api/tbHandover?page=${this.tableData.page + 1}&size=${this.tableData.size}&shopId=${localStorage.getItem("shopId")}&sort=${this.query.sort}`
} else {
urlData = `/api/tbHandover?page=${this.tableData.page + 1}&size=${this.tableData.size}&shopId=${localStorage.getItem("shopId")}&tradeDay=${this.query.createdAt[0] ? this.query.createdAt[0] : ''}&tradeDay=${this.query.createdAt[1] ? this.query.createdAt[1] : ''}`
urlData = `/api/tbHandover?page=${this.tableData.page + 1}&size=${this.tableData.size}&shopId=${localStorage.getItem("shopId")}&tradeDay=${this.query.createdAt[0] ? this.query.createdAt[0] : ''}&tradeDay=${this.query.createdAt[1] ? this.query.createdAt[1] : ''}&sort=${this.query.sort}`
}
const res = await tbHandoverGet(urlData);
this.tableData.loading = false;