Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
c79ef474
Commit
c79ef474
authored
Mar 26, 2024
by
tianhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
7759ba70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
119 additions
and
51 deletions
+119
-51
index.vue
dsk-operate-ui/src/components/CustomTable/index.vue
+36
-30
index.vue
...projectCostLedger/detail/components/CostSummary/index.vue
+83
-21
No files found.
dsk-operate-ui/src/components/CustomTable/index.vue
View file @
c79ef474
...
...
@@ -2,17 +2,12 @@
<div
class=
"custom-table-list-com-ins"
:class=
"
{'is-empty-table' : !tableDataTotal,'no-pagination' : !hasQueryParams,'auto-max-height' : maxHeight,'has-y-Scroll' : maxHeight
&&
hasYScroll}"
:style="maxBodyFixedStyle">
<div
class=
"table-item"
>
<el-table
v-if=
"tableDataTotal>0"
class=
"custom-table"
v-loading=
"
tableLoading"
:data=
"tableData"
element-loading-text=
"Loading
"
<div
class=
"
custom-
table-item"
>
<el-table
v-if=
"tableDataTotal>0"
class=
"custom-table"
v-loading=
"
comTableLoading"
:data=
"tableData"
element-loading-text=
"加载中
"
ref=
"customTableRef"
border
fit
highlight-current-row
:default-sort=
"defaultSort?defaultSort:
{}" @sort-change="sortChange"
@selection-change="selectionChange" :cell-class-name="cellClassName" :cell-style="cellStyle" :row-class-name="rowClassName"
:row-style="rowStyle" :height="height" :maxHeight="comMaxHeight" v-sticky-header="stickyHeader">
<el-table-column
type=
"selection"
:width=
"needSelection.width ? needSelection.width : '38px'"
v-if=
"needSelection.flag"
:fixed=
"needSelection.fixed"
:align=
"needSelection.align"
:show-overflow-tooltip=
"needSelection.showOverflowTooltip"
>
</el-table-column>
<el-table-column
type=
"index"
v-if=
"isIndex"
label=
"序号"
:width=
"flexWidth(tableData)"
align=
"left"
:fixed=
"indexFixed"
:resizable=
"false"
>
<template
slot-scope=
"scope"
>
{{
pagingHandler
(
hasQueryParams
,
queryParams
,
scope
)
}}
</
template
>
</el-table-column>
:row-style="rowStyle" :row-key="rowKey" :lazy="lazy" :load="loadFn" :tree-props="treeOptions" :height="height" :maxHeight="comMaxHeight"
v-sticky-header="stickyHeader">
<!-- 列二次封装 -->
<template
v-for=
"(item,index) of formColum"
>
...
...
@@ -57,20 +52,6 @@ export default {
maxHeight
:
{
type
:
[
Boolean
,
Number
]
},
isIndex
:
{
type
:
Boolean
,
default
:
false
},
needSelection
:
{
type
:
Object
,
default
:
()
=>
({
flag
:
false
,
width
:
"39px"
,
fixed
:
false
,
align
:
"left"
,
showOverflowTooltip
:
false
})
},
cellClassName
:
{
type
:
Function
,
default
:
()
=>
{
}
...
...
@@ -87,6 +68,25 @@ export default {
type
:
Function
,
default
:
()
=>
{
}
},
rowKey
:
{
type
:
[
String
,
Number
],
default
:
"id"
},
// 是否树形结构懒加载
lazy
:
{
type
:
Boolean
,
default
:
false
},
// 懒加载函数
loadFn
:
{
type
:
Function
,
default
:
()
=>
{
}
},
// 懒加载配置字段映射
treeOptions
:
{
type
:
Object
,
default
:
()
=>
({})
},
// 吸顶偏移量
stickyHeader
:
{
type
:
Object
,
...
...
@@ -147,7 +147,8 @@ export default {
headerLastBlockHeight
:
0
,
hasYScroll
:
false
,
observer
:
null
,
resizeTimer
:
null
resizeTimer
:
null
,
comTableLoading
:
this
.
tableLoading
};
},
watch
:
{
...
...
@@ -166,6 +167,11 @@ export default {
},
immediate
:
true
,
deep
:
true
},
tableLoading
:
{
handler
(
newValue
)
{
this
.
comTableLoading
=
newValue
;
}
}
},
computed
:
{
...
...
@@ -303,7 +309,7 @@ export default {
.custom-table-list-com-ins
{
/* 空数据样式 */
&
.is-empty-table
{
.table-item
{
.
custom-
table-item
{
max-height
:
unset
;
height
:
100%
;
}
...
...
@@ -312,7 +318,7 @@ export default {
/* maxHeight自适应样式 */
&
.auto-max-height
{
height
:
100%
;
::v-deep
.table-item
{
::v-deep
.
custom-
table-item
{
// 原滚动条为6px 现在多10px
.el-table
{
/* 右侧fixed列 */
...
...
@@ -350,7 +356,7 @@ export default {
// 是否存在Y轴滚动条
&
.has-y-Scroll
{
::v-deep
.table-item
{
::v-deep
.
custom-
table-item
{
.el-table
{
/* 右侧fixed列 */
.el-table__fixed-right
{
...
...
@@ -366,12 +372,12 @@ export default {
/* 不需要分页 或没有分页参数 */
&
.no-pagination
{
::v-deep
.table-item
{
::v-deep
.
custom-
table-item
{
max-height
:
100%
;
}
}
::v-deep
.table-item
{
::v-deep
.
custom-
table-item
{
width
:
100%
;
max-height
:
calc
(
100%
-
40px
);
...
...
@@ -437,7 +443,7 @@ export default {
padding-right
:
12px
;
padding-left
:
12px
;
line-height
:
21px
;
font-size
:
1
2
px
;
font-size
:
1
4
px
;
font-weight
:
400
;
}
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/components/CostSummary/index.vue
View file @
c79ef474
...
...
@@ -21,7 +21,7 @@
<div
class=
"right-table-list-container"
>
<div
class=
"project-table-list-header"
>
<div
class=
"project-table-list-haeder-left"
>
<el-select
v-model=
"
record
Date"
placeholder=
"请选择年月"
class=
"project-month-select-options"
clearable
@
change=
"monthChange"
>
<el-select
v-model=
"
expense
Date"
placeholder=
"请选择年月"
class=
"project-month-select-options"
clearable
@
change=
"monthChange"
>
<el-option
v-for=
"item in monthList"
:key=
"item.expenseDate"
:label=
"item.label"
:value=
"item.expenseDate"
>
</el-option>
</el-select>
...
...
@@ -35,8 +35,8 @@
<dsk-skeleton
v-if=
"tableLoading"
></dsk-skeleton>
<!-- 非实体工程材料列表 -->
<el-form
:model=
"dataForm"
ref=
"feedSummaryForm"
:show-message=
"false"
v-else-if=
"!tableLoading"
class=
"feed-summary-form"
>
<custom-table
:tableData=
"dataForm.tableDataList"
:formColum=
"formColum"
:max-height=
"true"
:
tableDataTotal=
"total"
:paging=
"fals
e"
:cell-class-name=
"cellClassName"
>
<custom-table
:tableData=
"dataForm.tableDataList"
:formColum=
"formColum"
:max-height=
"true"
:
row-key=
"rowKey"
:lazy=
"tru
e"
:
load-fn=
"tableLazyLoad"
:tree-options=
"treeOptions"
:tableDataTotal=
"total"
:paging=
"false"
:
cell-class-name=
"cellClassName"
>
</custom-table>
</el-form>
</div>
...
...
@@ -53,6 +53,13 @@ import { v4 } from 'uuid';
import
dayjs
from
"dayjs"
;
import
{
cloneDeep
}
from
"lodash-es"
;
import
{
add
}
from
"@/utils/decimal"
;
// 可编辑字段
const
editPropNames
=
[
"taxInclusiveExpense"
,
"taxExclusiveExpense"
,
];
export
default
{
name
:
"costSummary"
,
props
:
{
...
...
@@ -81,9 +88,9 @@ export default {
this
.
comProjectId
=
newValue
;
}
},
record
Date
:
{
expense
Date
:
{
handler
(
newValue
,
oldValue
)
{
this
.
old
Record
Date
=
newValue
;
this
.
old
Expense
Date
=
newValue
;
}
}
},
...
...
@@ -118,10 +125,16 @@ export default {
total
:
0
,
// 列表表头
formColum
:
[
// { label: '序号', prop: "staticSerialNumber", type: "index", lock: true, width: "53", fixed: false
, uid: v4() },
// { label: '操作', prop: "action-field-bar", width: "99", uid: v4(), fixed: "right"
},
{
label
:
'序号'
,
prop
:
"number"
,
width
:
"53"
,
uid
:
v4
()
},
{
label
:
'名称'
,
prop
:
"cbName"
,
width
:
"303"
,
uid
:
v4
()
},
],
monthList
:
[],
rowKey
:
"id"
,
// 列表懒加载配置
treeOptions
:
{
children
:
"children"
,
hasChildren
:
"hasChildren"
},
// 源数据月份
originMonthList
:
[],
dataForm
:
{
...
...
@@ -129,9 +142,9 @@ export default {
tableDataList
:
[],
},
// 当前查询的数据月份
record
Date
:
""
,
expense
Date
:
""
,
// 历史查询月份
old
Record
Date
:
""
,
old
Expense
Date
:
""
,
// 当前选中子菜单的父类名称
currentParentName
:
""
,
// 当前选中的成本科目
...
...
@@ -241,9 +254,9 @@ export default {
// 判断当月是否存在于server返回month集合中 有传入的重置时间 采用重置时间
const
_now
=
this
.
getNowMonth
();
if
(
resetDate
&&
this
.
includeNowMonth
(
resetDate
))
{
params
[
"
record
Date"
]
=
resetDate
;
params
[
"
expense
Date"
]
=
resetDate
;
}
else
if
(
this
.
includeNowMonth
(
_now
))
{
params
[
"
record
Date"
]
=
_now
;
params
[
"
expense
Date"
]
=
_now
;
}
return
params
;
},
...
...
@@ -270,8 +283,7 @@ export default {
const
data
=
monthList
.
data
;
this
.
originMonthList
=
cloneDeep
(
data
);
const
_now
=
this
.
getNowMonth
();
this
.
recordDate
=
_now
;
// this.oldRecordDate = _now;
this
.
expenseDate
=
_now
;
// 默认以当前月数据为准 若不包含当前月 需要手动push数据
if
(
!
data
.
includes
(
_now
))
{
data
.
push
({
...
...
@@ -301,16 +313,16 @@ export default {
const
params
=
this
.
createRequestConditions
();
// 清空了年月 默认选中当前月
if
(
!
month
)
{
this
.
record
Date
=
_now
;
this
.
expense
Date
=
_now
;
// 如果命中的旧月份 等于当前月 且 不处于编辑状态 说明清空的是默认查询月 不调用接口
if
(
this
.
old
Record
Date
==
_now
&&
!
this
.
addActualCostEditStatus
)
return
;
if
(
this
.
old
Expense
Date
==
_now
&&
!
this
.
addActualCostEditStatus
)
return
;
}
else
{
// 正常选择
params
[
"
record
Date"
]
=
month
;
params
[
"
expense
Date"
]
=
month
;
}
this
.
resetEditStatus
();
// 获取列表数据
this
.
get
Feed
SummaryList
(
params
);
this
.
get
Cost
SummaryList
(
params
);
},
monthsSort
(
monthList
)
{
const
sortResult
=
monthList
.
sort
((
before
,
after
)
=>
{
...
...
@@ -325,7 +337,18 @@ export default {
this
.
tableLoading
=
true
;
const
list
=
await
getCostSummaryListApi
(
params
);
if
(
list
.
code
==
200
&&
list
.
data
instanceof
Array
)
{
const
_temp
=
list
.
data
;
let
_temp
=
list
.
data
;
// 如果有长度循环处理字段
if
(
_temp
.
length
)
{
_temp
=
_temp
.
map
(
item
=>
{
if
(
!
item
.
hasChildren
)
{
item
.
hasChildren
=
false
;
}
else
{
item
.
hasChildren
=
true
;
};
return
item
;
});
}
this
.
$set
(
this
.
dataForm
,
"tableDataList"
,
cloneDeep
(
_temp
));
this
.
originTableDataList
=
cloneDeep
(
_temp
);
this
.
total
=
_temp
.
length
;
...
...
@@ -336,6 +359,45 @@ export default {
this
.
tableLoading
=
false
;
}
},
async
getCostSummaryListLazy
(
params
=
{})
{
try
{
const
list
=
await
getCostSummaryListApi
(
params
);
if
(
list
.
code
==
200
&&
list
.
data
instanceof
Array
)
{
let
_temp
=
list
.
data
;
// 如果有长度循环处理字段
if
(
_temp
.
length
)
{
_temp
=
_temp
.
map
(
item
=>
{
if
(
!
item
.
hasChildren
)
{
item
.
hasChildren
=
false
;
}
else
{
item
.
hasChildren
=
true
;
};
return
item
;
});
}
return
_temp
;
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
// 列表懒加载
async
tableLazyLoad
(
row
,
treeNode
,
resolve
)
{
try
{
const
{
id
}
=
row
;
const
{
cbType
,
expenseDate
}
=
this
.
createRequestConditions
();
const
params
=
{
id
,
cbType
};
expenseDate
?
params
[
"expenseDate"
]
=
expenseDate
:
null
;
const
_lazyResult
=
await
this
.
getCostSummaryListLazy
(
params
);
resolve
([]);
}
catch
(
error
)
{
}
},
// 编辑状态下 进行了其它操作
resetEditStatus
()
{
// 当前需要编辑或者新增的成本年份
...
...
@@ -351,7 +413,7 @@ export default {
const
index
=
this
.
monthList
.
findIndex
(
item
=>
item
.
value
==
_selectActualCostTime
);
if
(
index
!=
-
1
)
{
this
.
monthList
.
splice
(
index
,
1
);
this
.
record
Date
=
this
.
getNowMonth
();
this
.
expense
Date
=
this
.
getNowMonth
();
}
}
},
...
...
@@ -360,8 +422,8 @@ export default {
this
.
currentNodeValue
=
currentId
;
const
parentName
=
currentTemp
.
parent
?
this
.
getCurrentType
(
currentTemp
.
parent
)
:
currentId
;
if
(
parentName
)
this
.
currentParentName
=
parentName
;
const
params
=
this
.
createRequestConditions
(
this
.
record
Date
);
this
.
get
Feed
SummaryList
(
params
);
const
params
=
this
.
createRequestConditions
(
this
.
expense
Date
);
this
.
get
Cost
SummaryList
(
params
);
},
},
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment