Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psa-web
Project
Project
Details
Activity
Releases
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
高滢
psa-web
Commits
5c65b3ab
Commit
5c65b3ab
authored
Mar 24, 2025
by
祁正
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日常报销修改
parent
6a5620cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
53 deletions
+80
-53
cost.js
src/api/costManage/cost.js
+1
-1
add.vue
src/views/costManage/dailyReimburse/add.vue
+45
-20
index.vue
src/views/costManage/dailyReimburse/index.vue
+34
-32
No files found.
src/api/costManage/cost.js
View file @
5c65b3ab
...
...
@@ -11,7 +11,7 @@ import request from '@/utils/request'
// 日常报销列表
export
const
listCostManage
=
(
query
)
=>
{
return
request
({
url
:
'/dailyReimbursement/dailyReimbursement/
list
'
,
url
:
'/dailyReimbursement/dailyReimbursement/
getProjectListByUserId
'
,
method
:
'get'
,
params
:
query
})
...
...
src/views/costManage/dailyReimburse/add.vue
View file @
5c65b3ab
...
...
@@ -13,8 +13,9 @@
>
<el-row
:gutter=
"15"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"项目名称"
prop=
"projectId"
>
<el-form-item
label=
"项目名称"
>
<el-select
disabled
v-model=
"ruleForm.projectId"
placeholder=
"请选择"
clearable
...
...
@@ -80,7 +81,7 @@
/>
</el-select>
</el-form-item>
<el-form-item
label=
"报销月份"
prop=
"reimbursement"
>
<el-form-item
label=
"报销月份"
>
<el-date-picker
disabled
format=
"YYYY-M"
...
...
@@ -188,28 +189,20 @@
</
template
>
<
script
setup
name=
"add"
>
import
{
addDailyReimburse
,
projectList
,
projectDetailById
}
from
"../../../api/costManage/cost.js"
;
import
{
listUser
}
from
"../../../api/system/user.js"
;
import
{
addDailyReimburse
,
projectDetailById
,
projectList
}
from
"../../../api/costManage/cost.js"
;
import
{
listUser
}
from
"../../../api/system/user.js"
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
const
{
proxy
}
=
getCurrentInstance
();
const
{
cost_daily_type
,
project_status
,
project_type
}
=
proxy
.
useDict
(
'cost_daily_type'
,
'project_status'
,
'project_type'
);
const
router
=
useRouter
();
const
route
=
useRoute
();
const
formRef
=
ref
(
null
);
const
formSize
=
ref
(
'default'
)
const
ruleForm
=
ref
({
projectId
:
''
,
reimbursement
:
''
,
timeOfExpense
:
''
,
childList
:[{
money
:
''
,
reimbursementType
:
''
,
remark
:
''
,
timeOfExpense
:
''
,
}],
})
const
rules
=
ref
({
projectId
:
{
...
...
@@ -224,10 +217,26 @@ const rules = ref({
trigger
:
'blur'
,
},
})
let
projectId
=
parseInt
(
route
.
query
.
projectId
)
console
.
log
(
projectId
)
const
projectOption
=
ref
([]);
const
headOptions
=
ref
([]);
const
managerOptions
=
ref
([]);
const
ruleForm
=
ref
({
projectId
:
projectId
,
reimbursement
:
''
,
timeOfExpense
:
''
,
childList
:[{
money
:
''
,
reimbursementType
:
''
,
remark
:
''
,
timeOfExpense
:
''
,
}],
})
//获取所有项目
const
getProjectList
=
()
=>
{
projectList
().
then
(
res
=>
{
...
...
@@ -257,6 +266,18 @@ const getProjectList = () => {
})
}
const
getDefaultDate
=
()
=>
{
// todo 有问题待改
// let str = ruleForm.value.reimbursement + "-1"
// const parts = str.split('-');
// const year = parseInt(parts[0]);
// const month = parseInt(parts[1]) - 1;
// console.log("y",year)
// console.log("month",str)
//
// return ref(new Date(str))
}
//根据项目id自动填充项目详情
const
getProjectDetail
=
()
=>
{
projectDetailById
(
ruleForm
.
value
.
projectId
).
then
(
res
=>
{
...
...
@@ -350,11 +371,14 @@ function deleteRow() {
const
pickerOptions
=
ref
({
disabledDate
:
(
time
)
=>
{
const
defaultDate
=
ruleForm
.
value
.
reimbursement
;
const
selectedMonth
=
new
Date
(
defaultDate
).
getMonth
();
// console.log("获得的月份",selectedMonth)// 月份从0开始
const
selectedYear
=
new
Date
(
defaultDate
).
getFullYear
();
if
(
!
defaultDate
)
return
false
;
const
[
year
,
month
]
=
defaultDate
.
split
(
'-'
);
const
selectedYear
=
parseInt
(
year
);
const
selectedMonth
=
parseInt
(
month
)
-
1
;
// 月份从0开始
const
checkYear
=
time
.
getFullYear
();
const
checkMonth
=
time
.
getMonth
();
return
time
.
getMonth
()
!==
selectedMonth
||
time
.
getFullYear
()
!==
selectedYear
;
return
checkYear
!==
selectedYear
||
checkMonth
!==
selectedMonth
;
},
});
...
...
@@ -380,6 +404,7 @@ const getLastMonth = ()=> {
onMounted
(()
=>
{
// getDetail()
getProjectList
()
getProjectDetail
()
let
time
=
getLastMonth
()
console
.
log
(
time
)
ruleForm
.
value
.
reimbursement
=
getLastMonth
()
...
...
src/views/costManage/dailyReimburse/index.vue
View file @
5c65b3ab
...
...
@@ -120,15 +120,10 @@
</div>
</el-affix>
<div
class=
"contentTable"
>
<div
style=
"padding-left: 8px ;margin-bottom: 20px"
>
<div
style=
"padding-left: 8px ;margin-bottom: 20px
;display: flex;width: 100%;align-items: center;justify-content: space-between
"
>
<span
class=
"bold-text"
style=
"border-bottom: 3px solid #0062FF;"
>
日常报销列表
</span>
<span
style=
"padding-left: 77%"
>
<el-button
class=
"el-button-primary-pain"
plain
icon=
"Plus"
@
click=
"handleAdd"
>
发起报销
</el-button>
<span>
<el-tooltip
content=
"草稿箱"
placement=
"top"
>
<el-button
type=
"text"
...
...
@@ -146,6 +141,12 @@
<span>
项目名称:
{{
item
.
projectName
}}
(
{{
item
.
startDate
}}
-
{{
item
.
endDate
}}
)
</span>
<span>
项目经理:
{{
item
.
projectUserName
}}
</span>
<span>
事业部负责人:
{{
item
.
departmentUserName
}}
</span>
<el-button
class=
"el-button-primary-pain"
plain
icon=
"Plus"
@
click=
"handleAdd(item)"
>
发起报销
</el-button>
</div>
</
template
>
<span>
费用明细
</span>
...
...
@@ -220,9 +221,9 @@
<!--
</el-steps>
-->
</div>
<div
class=
"footer-right"
>
<span>
已通过金额:
{{
item
.
passNumber
}}
</span>
<span>
未通过金额:
{{
item
.
notPassNumber
}}
</span>
<span>
累计金额:
{{
item
.
totalMoney
}}
</span>
<span>
已通过金额:
{{
item
.
passNumber
||
0
}}
</span>
<span>
未通过金额:
{{
item
.
notPassNumber
||
0
}}
</span>
<span>
累计金额:
{{
item
.
totalMoney
||
0
}}
</span>
</div>
</div>
</
template
>
...
...
@@ -281,25 +282,29 @@ const data = reactive({
const
{
queryParams
,
form
}
=
toRefs
(
data
);
/** 查询角色列表 */
function
getList
()
{
// console.log("坤坤",costManageList.value)
loading
.
value
=
true
;
//获取日常报销列表
listCostManage
(
queryParams
.
value
).
then
((
res
)
=>
{
costManageList
.
value
=
res
.
rows
console
.
log
(
"123"
,
res
.
rows
)
for
(
let
key
in
res
.
rows
){
// console.log(data)
res
.
rows
[
key
].
tableItemList
.
sort
((
a
,
b
)
=>
{
if
(
a
.
status
===
1
&&
b
.
status
!==
1
){
return
-
1
;
}
if
(
b
.
status
===
1
&&
a
.
status
!==
1
){
return
1
;
}
return
new
Date
(
b
.
registrationTime
)
-
new
Date
(
a
.
registrationTime
)
})
costManageList
.
value
=
res
.
data
for
(
let
item
of
costManageList
.
value
){
if
(
!
item
.
tableItemList
){
item
.
tableItemList
=
[]
}
}
total
.
value
=
res
.
total
console
.
log
(
"123"
,
res
.
data
)
// for(let key in res.data){
// // console.log(data)
// res.rows[key].tableItemList.sort((a, b) => {
// if(a.status === 1 && b.status !== 1){
// return -1;
// }
// if(b.status === 1 && a.status !== 1){
// return 1;
// }
// return new Date(b.registrationTime) - new Date(a.registrationTime)
// })
// }
loading
.
value
=
false
})
...
...
@@ -412,8 +417,8 @@ function handleDelete(row) {
/** 日常报销新增页*/
function
handleAdd
()
{
router
.
push
(
'/costManage/dailyReimburse/add
'
)
function
handleAdd
(
row
)
{
router
.
push
(
'/costManage/dailyReimburse/add
?projectId='
+
row
.
projectId
)
}
/** 日常报销详情页 */
...
...
@@ -495,20 +500,17 @@ onMounted(() => {
<
style
scoped
>
.card-header
{
display
:
flex
;
justify-content
:
space-
around
;
justify-content
:
space-
between
;
align-items
:
center
;
margin-bottom
:
7px
;
}
.bold-text
{
width
:
72px
;
height
:
15px
;
font-family
:
PingFangSC-Medium
;
font-weight
:
900
;
font-size
:
18px
;
color
:
#0D162A
;
letter-spacing
:
0
;
line-height
:
15px
;
}
.box-card
{
...
...
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