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
9424cada
Commit
9424cada
authored
Mar 28, 2025
by
祁正
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改日常
parent
4918914b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
8 deletions
+37
-8
edit.vue
src/views/costManage/dailyReimburse/edit.vue
+37
-8
No files found.
src/views/costManage/dailyReimburse/edit.vue
View file @
9424cada
...
...
@@ -75,8 +75,8 @@
}]"
>
<el-select
v-model=
"item.reimbursementType"
placeholder=
"请输入项目名称"
class=
"form-data-select"
clearable
>
<el-option
label=
"餐饮费"
value=
"shanghai"
/>
<el-option
label=
"通行费"
value=
"beijing"
/>
<el-option
:label=
"t.dictLabel"
:value=
"t.dictValue"
v-for=
"t in reimburseTypeOptions"
/>
</el-select>
</el-form-item>
<el-form-item
...
...
@@ -129,9 +129,17 @@
import
{
detailCostManage
,
updateDailyReimbursement
}
from
"@/api/costManage/cost.js"
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
const
{
proxy
}
=
getCurrentInstance
()
import
{
getDicts
}
from
"@/api/system/dict/data"
;
const
router
=
useRouter
();
//项目类型字典类表
const
projectTypeOptions
=
reactive
([])
//项目类型字典类表
const
reimburseTypeOptions
=
reactive
([])
const
formRef
=
ref
();
const
ruleForm
=
ref
({
projectId
:
''
,
...
...
@@ -165,6 +173,12 @@ function getDetail() {
detailCostManage
(
id
).
then
(
res
=>
{
ruleForm
.
value
=
res
.
data
console
.
log
(
"我是数据"
,
ruleForm
.
value
)
//报销类型需要转换
ruleForm
.
value
.
childList
.
forEach
(
item
=>
{
item
.
reimbursementType
=
String
(
item
.
reimbursementType
)
})
//项目类型转换
ruleForm
.
value
.
projectType
=
projectTypeOptions
.
find
(
item
=>
item
.
dictValue
===
String
(
ruleForm
.
value
.
projectType
)).
dictLabel
})
// console.log("坤坤",Id.value)
// console.log("test",ruleForm.value.childList)
...
...
@@ -190,7 +204,7 @@ const customValidator2 = (rule, value, callback)=>{
// 自定义规则验证-金额
const
customValidator3
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
ruleForm
.
value
.
childList
[
rule
.
index
].
money
||
ruleForm
.
value
.
childList
[
rule
.
index
].
money
.
trim
()
===
''
)
{
if
(
!
ruleForm
.
value
.
childList
[
rule
.
index
].
money
)
{
callback
(
new
Error
(
'请输入报销金额'
));
// 如果为空,返回错误
}
else
{
callback
();
// 验证通过
...
...
@@ -255,11 +269,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
;
},
});
...
...
@@ -287,6 +304,18 @@ onMounted(() => {
let
time
=
getLastMonth
()
console
.
log
(
time
)
ruleForm
.
value
.
reimbursement
=
getLastMonth
()
//项目类型字典
getDicts
(
"project_type"
).
then
(
response
=>
{
Object
.
assign
(
projectTypeOptions
,
response
.
data
);
console
.
log
(
"项目类型字典"
,
projectTypeOptions
)
});
//报销类型字典
getDicts
(
"cost_daily_type"
).
then
(
response
=>
{
Object
.
assign
(
reimburseTypeOptions
,
response
.
data
);
console
.
log
(
"报销类型字典"
,
reimburseTypeOptions
)
});
})
</
script
>
...
...
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