Commit 46978617 authored by yanzhengyang's avatar yanzhengyang

日常报销、出差申请、差旅报销列表修改

parent e01635ae
...@@ -202,8 +202,8 @@ ...@@ -202,8 +202,8 @@
</el-table> </el-table>
<div style="padding-right: 35%"> <div style="padding-right: 35%">
<pagination <pagination
v-show="item.tableItemList.length > 0" v-show="total > 0"
:total="item.tableItemList.length" :total="total"
v-model:page="queryParams.pageNum" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getList" @pagination="getList"
...@@ -286,17 +286,17 @@ function getList() { ...@@ -286,17 +286,17 @@ function getList() {
loading.value = true; loading.value = true;
//获取日常报销列表 //获取日常报销列表
listCostManage(queryParams.value).then((res) => { listCostManage(queryParams.value).then((res) => {
costManageList.value = res.data costManageList.value = res.rows
for(let item of costManageList.value){ for(let item of costManageList.value){
if(!item.tableItemList){ if(!item.tableItemList){
item.tableItemList = [] item.tableItemList = []
} }
} }
console.log("123",res.data) console.log("123",res.rows)
for(let key in res.data){ for(let key in res.rows){
// console.log(data) // console.log(data)
res.data[key].tableItemList.sort((a, b) => { res.rows[key].tableItemList.sort((a, b) => {
if(a.status === 1 && b.status !== 1){ if(a.status === 1 && b.status !== 1){
return -1; return -1;
} }
...@@ -306,6 +306,7 @@ function getList() { ...@@ -306,6 +306,7 @@ function getList() {
return new Date(b.registrationTime) - new Date(a.registrationTime) return new Date(b.registrationTime) - new Date(a.registrationTime)
}) })
} }
total.value = res.total
loading.value = false loading.value = false
}) })
......
...@@ -123,7 +123,8 @@ ...@@ -123,7 +123,8 @@
</div> </div>
<!-- 表格数据 --> <!-- 表格数据 -->
<el-table v-loading="loading" :data="tripApplicationList" border style="width: 100%"> <el-table v-loading="loading" :data="tripApplicationList" border style="width: 100%"
:row-class-name="tableRowClassName">
<el-table-column type="selection" width="40" align="right"/> <el-table-column type="selection" width="40" align="right"/>
<el-table-column label="项目编号" align="center" prop="projectNumber" min-width="150"/> <el-table-column label="项目编号" align="center" prop="projectNumber" min-width="150"/>
<el-table-column label="项目名称" align="center" prop="projectName" min-width="120" show-overflow-tooltip/> <el-table-column label="项目名称" align="center" prop="projectName" min-width="120" show-overflow-tooltip/>
...@@ -233,9 +234,19 @@ function getList() { ...@@ -233,9 +234,19 @@ function getList() {
loading.value = true; loading.value = true;
listTripApplication(queryParams.value).then(res => { listTripApplication(queryParams.value).then(res => {
tripApplicationList.value = res.rows; tripApplicationList.value = res.rows;
console.log("出差数据",tripApplicationList.value)
for(let key in res.rows){
res.rows.sort((a, b) => {
if(a.status === 1 && b.status !== 1){
return -1;
}
if(b.status === 1 && a.status !== 1){
return 1;
}
})
}
total.value = res.total; total.value = res.total;
loading.value = false; loading.value = false;
console.log("出差数据",tripApplicationList.value)
}); });
} }
...@@ -325,6 +336,17 @@ function handleReimbursement(row){ ...@@ -325,6 +336,17 @@ function handleReimbursement(row){
router.push({path:'/costManage/tripReimburse/add',query: { id: row.id }}); router.push({path:'/costManage/tripReimburse/add',query: { id: row.id }});
} }
// 表格不同状态设置高亮
const tableRowClassName = ({row}) => {
if(row.status === 3){
return 'success-row';
}
if(row.status === 1){
return 'error-row';
}
return '';
}
onMounted(() => { onMounted(() => {
getList(); getList();
getProjectList(); getProjectList();
...@@ -338,4 +360,12 @@ onMounted(() => { ...@@ -338,4 +360,12 @@ onMounted(() => {
color: #0D162A; color: #0D162A;
border-bottom: 4px solid #0062FF; border-bottom: 4px solid #0062FF;
} }
:deep .el-table .error-row{
--el-table-tr-bg-color: var(--el-color-warning-light-9);
}
:deep .el-table .success-row{
--el-table-tr-bg-color: var(--el-color-success-light-9);
}
</style> </style>
...@@ -107,7 +107,8 @@ ...@@ -107,7 +107,8 @@
</div> </div>
<!-- 表格数据 --> <!-- 表格数据 -->
<el-table v-loading="loading" :data="tripReimburseList" border style="width: 100%"> <el-table v-loading="loading" :data="tripReimburseList" border style="width: 100%"
:row-class-name="tableRowClassName">
<el-table-column type="selection" width="40" align="right"/> <el-table-column type="selection" width="40" align="right"/>
<el-table-column label="项目编号" align="center" prop="projectNumber" min-width="150"/> <el-table-column label="项目编号" align="center" prop="projectNumber" min-width="150"/>
<el-table-column label="项目名称" align="center" prop="projectName" min-width="120" show-overflow-tooltip/> <el-table-column label="项目名称" align="center" prop="projectName" min-width="120" show-overflow-tooltip/>
...@@ -205,9 +206,19 @@ function getList() { ...@@ -205,9 +206,19 @@ function getList() {
loading.value = true; loading.value = true;
listTripReimburse(queryParams.value).then(res => { listTripReimburse(queryParams.value).then(res => {
tripReimburseList.value = res.rows; tripReimburseList.value = res.rows;
console.log("差旅数据",tripReimburseList.value)
for(let key in res.rows){
res.rows.sort((a, b) => {
if(a.status === 1 && b.status !== 1){
return -1;
}
if(b.status === 1 && a.status !== 1){
return 1;
}
})
}
total.value = res.total; total.value = res.total;
loading.value = false; loading.value = false;
console.log("差旅数据",tripReimburseList.value)
}); });
} }
...@@ -286,6 +297,17 @@ function handleUpdate(row) { ...@@ -286,6 +297,17 @@ function handleUpdate(row) {
router.push({path: '/costManage/tripReimburse/edit', query: {id: row.id}}); router.push({path: '/costManage/tripReimburse/edit', query: {id: row.id}});
} }
// 表格不同状态设置高亮
const tableRowClassName = ({row}) => {
if(row.status === 3){
return 'success-row';
}
if(row.status === 1){
return 'error-row';
}
return '';
}
onMounted(() => { onMounted(() => {
getList(); getList();
getProjectList(); getProjectList();
...@@ -299,4 +321,12 @@ onMounted(() => { ...@@ -299,4 +321,12 @@ onMounted(() => {
color: #0D162A; color: #0D162A;
border-bottom: 4px solid #0062FF; border-bottom: 4px solid #0062FF;
} }
:deep .el-table .error-row{
--el-table-tr-bg-color: var(--el-color-warning-light-9);
}
:deep .el-table .success-row{
--el-table-tr-bg-color: var(--el-color-success-light-9);
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment