Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
柳 佳乐
finance
Commits
979e03ac
Commit
979e03ac
authored
Nov 25, 2022
by
柳 佳乐
Browse files
20221125
parent
a0a55082
Changes
42
Show whitespace changes
Inline
Side-by-side
src/views/personal/personal.vue
View file @
979e03ac
...
...
@@ -161,7 +161,7 @@ export default {
//获取个人信息
getUser
(){
getOneself
(
this
.
userData
).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
){
if
(
res
.
success
){
this
.
userData
=
res
.
data
this
.
backupsData
=
Object
.
assign
({},
res
.
data
)
}
else
{
...
...
@@ -176,7 +176,7 @@ export default {
this
.
$refs
.
userform
.
validate
((
valida
)
=>
{
if
(
valida
){
update
(
this
.
userData
).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
){
if
(
res
.
success
){
this
.
$message
.
success
(
"
修改成功
"
)
this
.
getUser
()
this
.
userupdata
=
true
...
...
@@ -206,7 +206,7 @@ export default {
newPassword
:
this
.
passwordData
.
newPassword
}
passwordReset
(
param
).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
){
if
(
res
.
success
){
this
.
$message
.
success
(
"
修改成功
"
)
this
.
$store
.
dispatch
(
'
user/logout
'
).
then
(
res
=>
{
this
.
$router
.
push
(
'
/login
'
)
...
...
src/views/project/beresponsiblefor/beresponsibleforList.vue
View file @
979e03ac
...
...
@@ -32,14 +32,27 @@
>
<el-table-column
type=
"expand"
>
<template
slot-scope=
"props"
>
<el-form
label-position=
"left"
class=
"demo-table-expand"
>
<el-form-item
label=
"合作方:"
>
<span>
{{
props
.
row
.
projectPartyb
}}
</span>
</el-form-item>
<el-form-item
label=
"项目详情:"
>
<el-descriptions
class=
"margin-top"
title=
"关于项目"
:column=
"1"
style=
"width:60%; margin:20px 20px"
border
>
<el-descriptions-item
label=
"合作方:"
:labelStyle=
"
{'width':'120px'}">
{{
props
.
row
.
projectPartyb
}}
</el-descriptions-item>
<el-descriptions-item
label=
"项目详情:"
>
<span>
{{
props
.
row
.
projectInformation
}}
</span>
</el-form-item>
</el-form>
</el-descriptions-item>
<el-descriptions-item
label=
"更改项目负责人:"
>
<el-button
style=
"margin:5px"
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
@
click=
"member(props.row)"
>
成员管理
</el-button>
</el-descriptions-item>
</el-descriptions>
</
template
>
</el-table-column>
...
...
@@ -100,22 +113,14 @@
align=
"center"
:formatter=
"timestampToTime"
/>
<el-table-column
prop=
"projectAmount"
label=
"操作"
align=
"center"
>
<el-table-column
prop=
"projectAmount"
label=
"操作"
align=
"center"
width=
"125px"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin:5px"
size=
"mini"
icon=
"el-icon-edit"
type=
"info"
@
click=
"updataProject(scope.row)"
>
修改信息
</el-button>
<el-button
style=
"margin:5px"
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
@
click=
"member(scope.row)"
>
成员管理
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
src/views/project/expend/expendAdd.vue
View file @
979e03ac
...
...
@@ -20,6 +20,7 @@
</el-form-item>
<el-form-item
label=
"发票编号"
prop=
"incomebaoxioa"
>
<el-select
@
change=
"getchange()"
v-model=
"invoiceListAdd"
multiple
filterable
...
...
@@ -131,10 +132,11 @@ import {
}
from
"
@/api/project
"
;
import
{
selectAll
}
from
"
@/api/type
"
;
import
{
insert
}
from
"
@/api/expend
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
import
{
expendAdd
as
rules
}
from
"
../rules
"
;
export
default
{
data
()
{
return
{
rules
:
rules
,
action2
:
null
,
fileList1
:
[],
expendFrom
:
{
...
...
@@ -154,38 +156,12 @@ export default {
companyId
:
0
,
typeList
:
[],
projectData
:
{},
//表单验证内容
rules
:
{
expendMoney
:
[
{
required
:
true
,
validator
:
money
,
trigger
:
"
change
"
}
],
expendTime
:
[
{
required
:
true
,
message
:
"
请选择支出时间
"
,
trigger
:
"
change
"
}
],
expendType
:
[
{
required
:
true
,
message
:
"
请输入支出类别
"
,
trigger
:
"
change
"
}
],
expendObject
:
[
{
required
:
true
,
message
:
"
请输入支出对象
"
,
trigger
:
"
change
"
}
],
expendBody
:
[
{
required
:
true
,
message
:
"
请输入支出用途
"
,
trigger
:
"
change
"
}
],
number
:
[
{
required
:
true
,
message
:
"
请输入发票号码
"
,
trigger
:
"
change
"
}
],
code
:
[{
required
:
true
,
message
:
"
请输入发票代码
"
,
trigger
:
"
change
"
}]
},
//发票状态
status
:
0
,
//发票编号数组
getinvoivelist
:
[],
//收集发票编号
invoiceListAdd
:
{}
,
invoiceListAdd
:
[]
,
//查询发票编号的数组
getinvoiveId
:
{
userId
:
null
,
...
...
@@ -229,7 +205,6 @@ export default {
this
.
action2
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
this
.
proutlist1
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
proutlist1
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
backlistid
=
this
.
$route
.
query
.
backlistid
;
this
.
getTypeList
();
this
.
getProject
();
...
...
@@ -401,6 +376,24 @@ export default {
this
.
proutlist1
.
enclosureDescribe
=
null
;
this
.
fileList1
=
this
.
fileList1
.
filter
(
item
=>
item
.
uid
!==
file
.
uid
);
this
.
dialogFormVisible
=
false
;
},
//添加发票金额
getchange
()
{
let
sum
=
0
;
let
list
=
[];
this
.
invoiceListAdd
.
forEach
(
g
=>
{
this
.
getinvoivelist
.
forEach
(
item
=>
{
if
(
item
.
invoiceId
==
g
)
{
list
.
push
({
mone
:
item
.
mone
});
}
});
});
list
.
forEach
(
item
=>
{
sum
+=
item
.
mone
;
});
this
.
expendFrom
.
expendMoney
=
sum
;
}
}
};
...
...
src/views/project/expend/expendList.vue
View file @
979e03ac
...
...
@@ -3,10 +3,7 @@
<div
class=
"header"
>
<el-form
:inline=
"true"
:model=
"expendQurey"
>
<el-form-item
label=
"支出对象"
>
<el-input
v-model=
"expendQurey.expendObject"
placeholder=
"收入对象"
></el-input>
<el-input
v-model=
"expendQurey.expendObject"
placeholder=
"收入对象"
></el-input>
</el-form-item>
<el-form-item
label=
"支出类别"
>
<el-select
v-model=
"expendQurey.expendType"
>
...
...
@@ -20,10 +17,7 @@
</el-form-item>
<el-form-item
label=
"支出内容"
>
<el-input
v-model=
"expendQurey.expendBody"
placeholder=
"收入内容"
></el-input>
<el-input
v-model=
"expendQurey.expendBody"
placeholder=
"收入内容"
></el-input>
</el-form-item>
<el-form-item
label=
"支出时间"
>
...
...
@@ -37,22 +31,14 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"qurey()"
>
查询
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"reset()"
>
重置
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"qurey()"
>
查询
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"reset()"
>
重置
</el-button>
<el-button
type=
"success"
icon=
"el-icon-circle-plus-outline"
@
click=
"addexpend()"
v-if=
"state != 0"
>
新增支出
</el-button
>
>
新增支出
</el-button>
<el-button
@
click=
"back()"
>
返回
</el-button>
</el-form-item>
</el-form>
...
...
@@ -63,9 +49,33 @@
:data=
"expendList"
style=
"width: 100%; text-align: center"
border
:cell-style=
"
{
'text-align':
'center'
}"
:header-cell-style="{
'text-align':
'center'
}"
:cell-style=
"
{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
>
<el-table-column
type=
"expand"
>
<template
slot-scope=
"props"
>
<el-descriptions
class=
"margin-top"
title=
"关于项目"
:column=
"1"
style=
"width:40%; margin:20px 20px"
border
>
<el-descriptions-item
label=
"收入附言:"
>
<span>
{{
props
.
row
.
expendRemarks
}}
</span>
</el-descriptions-item>
<el-descriptions-item
label=
"收入详情:"
>
<span>
{{
props
.
row
.
expendInformation
}}
</span>
</el-descriptions-item>
<el-descriptions-item
label=
"发票文件:"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"ReviseImage(props.row)"
>
点击查看
</el-button>
</el-descriptions-item>
<el-descriptions-item
label=
"附件下载"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"selectImage(props.row)"
>
点击查看
</el-button>
</el-descriptions-item>
</el-descriptions>
</
template
>
</el-table-column>
<el-table-column
label=
"序号"
width=
"50px"
>
<
template
slot-scope=
"scope"
>
{{
...
...
@@ -86,41 +96,13 @@
</el-table-column>
<el-table-column
prop=
"expendBody"
label=
"支出内容"
/>
<el-table-column
prop=
"expendTime"
label=
"支出时间"
/>
<el-table-column
prop=
"expendInformation"
label=
"支出详情"
/>
<el-table-column
prop=
"expendRemarks"
label=
"支出备注"
/>
<el-table-column
prop=
"prop"
label=
"发票文件"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"ReviseImage(scope.row)"
>
点击查看
</el-button
>
</
template
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"附件下载"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"selectImage(scope.row)"
>
点击查看
</el-button
>
</
template
>
</el-table-column>
<el-table-column
label=
"操作人员"
>
<
template
slot-scope=
"scope"
>
<el-tag
effect=
"plain"
>
{{
scope
.
row
.
userName
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
prop=
"projectAmount"
label=
"操作"
v-if=
"state != 0"
width=
"120px"
>
<el-table-column
prop=
"projectAmount"
label=
"操作"
v-if=
"state != 0"
width=
"120px"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin: 5px"
...
...
@@ -128,8 +110,7 @@
icon=
"el-icon-edit"
type=
"info"
@
click=
"updatain(scope.row)"
>
修改信息
</el-button
>
>
修改信息
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -146,62 +127,39 @@
</div>
<!-- 附件抽屉 -->
<div>
<el-drawer
title=
"附件操作"
:visible.sync=
"drawer2"
:direction=
"direction"
size=
"50%"
>
<el-drawer
title=
"附件操作"
:visible.sync=
"drawer2"
:direction=
"direction"
size=
"50%"
>
<el-button
type=
"primary"
style=
"margin-left:
5%;
margin-top:
40px"
style=
"
margin-left:5%;margin-top:40px
"
:disabled=
"disabled"
@
click=
"updatecard"
>
添加附件
</el-button
>
>
添加附件
</el-button>
<el-card
class=
"box-card"
style=
"width:
90%; margin-left:
5%; margin-top:
20px"
v-show=
"getshow
==
1"
style=
"width:90%; margin-left:5%; margin-top:20px"
v-show=
"getshow==1"
>
<el-row
class=
"row-bg"
>
<div
v-for=
"index in queryDTOList"
:key=
"index.enclosureId"
class=
"lsitall"
>
<div
v-for=
"index in queryDTOList"
:key=
"index.enclosureId"
class=
"lsitall"
>
<el-col
:span=
"10"
>
<div
style=
"margin-top: 6px; margin-left: 40px"
>
附件{{ index.enclosureId }}
</div>
<div
style=
" margin-top: 6px;margin-left:40px"
>
附件{{index.enclosureId}}
</div>
</el-col>
<el-col
:span=
"12"
style=
"margin-left:
-50px"
>
<el-col
:span=
"12"
style=
"margin-left:-50px"
>
<el-button
type=
"primary"
icon=
"el-icon-folder-checked"
class=
"a-style"
size=
"mini"
style=
"font-size: 13px"
style=
"
font-size: 13px"
@
click=
"delProject(index)"
>
下载
</el-button
>
>
下载
</el-button>
<el-popover
placement=
"top"
width=
"160"
v-model=
"index.visible"
>
<p>
确定要删除此条附件吗
</p>
<div
style=
"text-align: right; margin: 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"index.visible = false"
>
取消
</el-button
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteProject(index)"
>
确定
</el-button
>
<el-button
size=
"mini"
type=
"text"
@
click=
"index.visible = false"
>
取消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteProject(index)"
>
确定
</el-button>
</div>
<el-button
type=
"danger"
...
...
@@ -210,8 +168,7 @@
size=
"mini "
style=
"font-size: 13px"
slot=
"reference"
>
删除
</el-button
>
>
删除
</el-button>
</el-popover>
</el-col>
</div>
...
...
@@ -220,16 +177,16 @@
<!-- 附件上传 -->
<el-card
class=
"box-card"
style=
"width:
90%; margin-left:
5%; margin-top:
20px"
v-show=
"getshow
==
0"
style=
"width:90%; margin-left:5%; margin-top:20px"
v-show=
"getshow==0"
>
<div
style=
"width:
60%;
margin-left:
30px"
>
<div
style=
"width:60%;margin-left:30px"
>
<el-input
type=
"textarea"
:rows=
"2"
placeholder=
"请输入附件详情"
v-model=
"proutlist1.enclosureDescribe"
style=
"margin:
20px 0px"
style=
"margin:20px 0px
;
"
></el-input>
<el-upload
class=
"upload-demo"
...
...
@@ -243,64 +200,37 @@
:on-success=
"Refresh"
:data=
"proutlist1"
multiple
style=
"margin:
20px 0px"
style=
"margin:20px 0px
;
"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传附件
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传文件,且不超过500kb
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div
style=
"margin-left:
75%"
>
<div
style=
"margin-left:75%
;
"
>
<el-button
@
click=
"remove()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"determine()"
style=
"margin-top: 20px"
>
确 定
</el-button
>
<el-button
type=
"primary"
@
click=
"determine()"
style=
"margin-top:20px;"
>
确 定
</el-button>
</div>
</el-card>
<div
class=
"box-card"
v-show=
"getshow
==
3"
></div>
<div
class=
"box-card"
v-show=
"getshow==3"
></div>
</el-drawer>
</div>
<div>
<!--抽屉-->
<el-drawer
title=
"发票详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"60%"
>
<!-- filePath-->
<el-button
type=
"primary"
style=
"margin: 10px 3%"
@
click=
"selectGet()"
>
添加收入发票
</el-button
>
<el-drawer
title=
"发票详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"50%"
>
<el-table
:data=
"getinvoivelist"
style=
"width: 9
4
%; margin:
10px
3
%; text-align: center"
style=
"width: 9
0
%; margin:10px
5
%; text-align: center"
border
>
<el-table-column
type=
"index"
label=
"序号"
width=
"40"
></el-table-column>
<el-table-column
prop=
"number"
label=
"号码"
width=
"160px"
></el-table-column>
<el-table-column
prop=
"mone"
label=
"金额"
width=
"180"
></el-table-column>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
></el-table-column>
<el-table-column
prop=
"code"
label=
"发票代码"
></el-table-column>
<el-table-column
prop=
"number"
label=
"号码"
></el-table-column>
<el-table-column
prop=
"mone"
label=
"金额"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"查看PDF文件或图片"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"formatProtocolType(scope.row)"
>
...
...
@@ -311,74 +241,13 @@
></el-image>
</div>
<div
v-else
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看文件
</a
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看文件
</a>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"top"
width=
"60"
v-model=
"scope.row.visible"
>
<p>
确定要删除该发票吗
</p>
<div
style=
"text-align: right; margin: 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"scope.row.visible = false"
>
取消
</el-button
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"DeleteFrom(scope.row)"
>
确定
</el-button
>
</div>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
slot=
"reference"
></el-button>
</el-popover>
</
template
>
</el-table-column>
</el-table>
</el-drawer>
</div>
<!-- 添加发票对话框 -->
<div>
<el-dialog
title=
"添加发票"
:visible.sync=
"dialogFormVisible"
width=
"40%"
>
<div
class=
"dialog-footer"
>
<div
class=
"selectList"
>
<el-select
v-model=
"getListincom"
multiple
filterable
default-first-option
style=
"width: 100%"
placeholder=
"请选择要添加的发票编号"
>
<el-option
v-for=
"item in invoiceListAdd"
:key=
"item.invoiceId"
:label=
"item.number"
:value=
"item.invoiceId"
></el-option>
</el-select>
</div>
<div
slot=
"footer"
>
<el-button
@
click=
"Buttonback1()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"Buttonback2()"
>
确 定
</el-button>
</div>
</div>
</el-dialog>
</div>
</div>
</template>
...
...
@@ -391,7 +260,7 @@ import {
selectAllBystatus
,
updatesubmit
,
deletBystatus
,
deleteById
,
deleteById
}
from
"
@/api/project
"
;
import
{
getFileUrl
}
from
"
@/api/companyFile
"
;
export
default
{
...
...
@@ -406,7 +275,7 @@ export default {
expendType
:
null
,
expendBody
:
null
,
expendTimeStart
:
null
,
expendTimeEnd
:
null
,
expendTimeEnd
:
null
},
expendList
:
[],
options
:
[],
...
...
@@ -418,7 +287,7 @@ export default {
//查询图片给的值
getinvoiveId
:
{
companyId
:
null
,
expendId
:
0
,
expendId
:
0
},
//图片的数组
getinvoivelist
:
[],
...
...
@@ -429,23 +298,13 @@ export default {
// //查询附件
queryDTO
:
{
companyId
:
null
,
expendId
:
null
,
expendId
:
null
},
//附件抽屉
drawer2
:
false
,
//发票对话框
dialogFormVisible
:
false
,
//展示抽屉的数组
queryDTOList
:
[],
//查询的能选择的表单信息
getFormslist
:
{
userId
:
null
,
companyId
:
null
,
type
:
1
,
},
incomeIdgrt
:
null
,
//收集incomeId数据
invoiceListAdd
:
[],
//查询发票的集合
getListincom
:
[],
//收集选择的数组
getshow
:
1
,
//判断show的显示与隐藏,
//合同文件上传携带参数
proutlist1
:
{
...
...
@@ -453,24 +312,23 @@ export default {
enclosureDescribe
:
""
,
status
:
1
,
//0收入 1支出
companyId
:
null
,
userId
:
null
,
userId
:
null
},
fileTypepdf
:
false
,
//判断合同文件是否存在
fileList1
:
[],
//合同文件
disabled
:
false
,
//隐藏
disabled
:
false
//隐藏
};
},
computed
:
{
state
:
function
()
{
state
:
function
()
{
return
this
.
$route
.
query
.
state
;
}
,
}
},
created
()
{
this
.
getinvoiveId
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
expendQurey
.
projectId
=
this
.
$route
.
query
.
id
;
this
.
backlistid
=
this
.
$route
.
query
.
backlistid
;
this
.
queryDTO
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
getFormslist
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
action1
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
this
.
proutlist1
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
proutlist1
.
companyId
=
this
.
$store
.
getters
.
companyId
;
...
...
@@ -481,7 +339,7 @@ export default {
//获取支出情况
getexpend
()
{
selectByProjectId
(
this
.
expendQurey
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
expendList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
...
...
@@ -489,7 +347,7 @@ export default {
this
.
$message
.
errror
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
查询数据失败
"
);
});
},
...
...
@@ -497,10 +355,10 @@ export default {
getTypeList
()
{
let
param
=
{
companyId
:
this
.
$store
.
getters
.
companyId
,
typeCategory
:
1
,
typeCategory
:
1
};
selectAll
(
param
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
options
=
res
.
data
;
}
else
{
...
...
@@ -508,7 +366,7 @@ export default {
this
.
back
();
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取类型失败
"
);
this
.
back
();
});
...
...
@@ -523,8 +381,8 @@ export default {
path
:
"
/expendAdd
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
backlistid
:
this
.
backlistid
,
}
,
backlistid
:
this
.
backlistid
}
});
},
//修改支出信息
...
...
@@ -534,7 +392,8 @@ export default {
query
:
{
id
:
data
.
expendId
,
projectId
:
this
.
$route
.
query
.
id
,
},
backlistid
:
this
.
backlistid
}
});
},
//时间处理
...
...
@@ -567,7 +426,7 @@ export default {
},
//下载附件
delProject
(
row
)
{
getFileUrl
(
row
.
enclosureFile
).
then
(
(
res
)
=>
{
getFileUrl
(
row
.
enclosureFile
).
then
(
res
=>
{
if
(
res
.
success
)
{
let
url
=
res
.
data
;
console
.
log
(
url
);
...
...
@@ -608,14 +467,14 @@ export default {
//查询发票图片
Selectinsertlsit
()
{
selectAllById
(
this
.
getinvoiveId
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
res
.
data
.
forEach
(
(
e
)
=>
{
res
.
data
.
forEach
(
e
=>
{
let
fileNamepdf
=
e
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
)
);
getFileUrl
(
e
.
filePath
).
then
(
(
res
)
=>
{
getFileUrl
(
e
.
filePath
).
then
(
res
=>
{
if
(
res
.
success
)
{
let
url
=
res
.
data
;
e
.
fileUrl
=
url
;
...
...
@@ -632,7 +491,7 @@ export default {
//this.back();
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
console
.
log
(
error
);
this
.
$message
.
error
(
"
获取发票图片失败
"
);
//this.back();
...
...
@@ -640,28 +499,25 @@ export default {
},
back
()
{
if
(
this
.
backlistid
==
0
)
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
"
/projectList
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
}
,
id
:
this
.
$route
.
query
.
id
}
});
}
else
if
(
this
.
backlistid
==
1
)
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
"
/beresponsibleforList
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
}
,
id
:
this
.
$route
.
query
.
id
}
});
}
else
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
"
/participateinList
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
}
,
id
:
this
.
$route
.
query
.
id
}
});
}
},
...
...
@@ -675,7 +531,7 @@ export default {
this
.
queryDTO
.
expendId
=
row
.
expendId
;
this
.
proutlist1
.
Id
=
row
.
expendId
;
selectByIdF
(
this
.
queryDTO
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
if
(
this
.
queryDTOList
.
length
>
0
)
{
...
...
@@ -691,81 +547,10 @@ export default {
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//查询未报销发票
selectGet
()
{
this
.
dialogFormVisible
=
true
;
this
.
getFormslist
.
userId
=
this
.
$store
.
getters
.
urId
;
selectAllBystatus
(
this
.
getFormslist
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
invoiceListAdd
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取发票编号失败
"
);
this
.
back
();
});
},
//确定与取消
Buttonback1
()
{
this
.
getListincom
=
[];
this
.
dialogFormVisible
=
false
;
},
Buttonback2
()
{
let
list
=
[];
//提交发票与收入关系 status默认为1 表示发票已报销
this
.
getListincom
.
forEach
((
item
)
=>
{
list
.
push
({
invoiceId
:
item
,
expendId
:
this
.
incomeIdgrt
,
status
:
1
,
});
});
updatesubmit
(
list
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
this
.
dialogFormVisible
=
false
;
this
.
$message
({
showClose
:
true
,
message
:
"
添加发票成功
"
,
type
:
"
success
"
,
});
this
.
Selectinsertlsit
();
this
.
getListincom
=
[];
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
},
//删除发票
DeleteFrom
(
row
)
{
//收集被删除发票的数据
let
BillList
=
{
invoiceId
:
row
.
invoiceId
,
expendId
:
row
.
expendId
,
};
deletBystatus
(
BillList
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
visible
=
false
;
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
});
this
.
Selectinsertlsit
();
}
})
.
catch
((
errror
)
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//图片格式
formatProtocolType
(
row
)
{
//这里判断的是是否有文件
...
...
@@ -795,23 +580,23 @@ export default {
//删除附件
deleteProject
(
row
)
{
deleteById
(
row
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
selectImage
(
row
);
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
type
:
"
success
"
});
this
.
visible
=
false
;
}
})
.
catch
(
(
errror
)
=>
{
.
catch
(
errror
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//清除附件文件
delfile1
()
{
this
.
fileList1
=
this
.
fileList1
.
filter
(
(
item
)
=>
item
.
uid
!==
file
.
uid
);
this
.
fileList1
=
this
.
fileList1
.
filter
(
item
=>
item
.
uid
!==
file
.
uid
);
this
.
fileTypepdf
=
false
;
},
//确定提交附件
...
...
@@ -824,7 +609,7 @@ export default {
this
.
$message
({
showClose
:
true
,
message
:
"
上传附件成功
"
,
type
:
"
success
"
,
type
:
"
success
"
});
this
.
Refresh
();
}
else
{
...
...
@@ -835,7 +620,7 @@ export default {
Refresh
()
{
this
.
queryDTO
.
expendId
=
this
.
proutlist1
.
Id
;
selectByIdF
(
this
.
queryDTO
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
...
...
@@ -843,7 +628,7 @@ export default {
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
...
...
@@ -854,7 +639,7 @@ export default {
enclosureDescribe
:
""
,
status
:
0
,
//0收入 1支出
companyId
:
null
,
userId
:
null
,
userId
:
null
};
},
//附件取消
...
...
@@ -882,8 +667,8 @@ export default {
this
.
$refs
.
upload1
.
clearFiles
();
this
.
fileTypepdf
=
false
;
}
}
,
}
,
}
}
};
</
script
>
...
...
src/views/project/expend/expendUpdata.vue
View file @
979e03ac
<
template
>
<div
class=
"container"
>
<el-row>
<el-col
:xl=
"8"
:lg=
"8"
:md=
"8"
:sm=
"12"
:xs=
"24"
>
<el-form
ref=
"form"
:model=
"expendFrom"
label-width=
"120px"
:rules=
"rules"
>
<el-col
:xl=
"8"
:lg=
"8"
:md=
"8"
:sm=
"12"
:xs=
"24"
style=
"margin:20px 30px;"
>
<el-form
ref=
"form"
:model=
"expendFrom"
label-width=
"120px"
:rules=
"rules"
>
<el-form-item
label=
"项目名称"
prop=
"projectName"
>
<el-input
v-model=
"expendFrom.projectName"
disabled
></el-input>
</el-form-item>
...
...
@@ -19,8 +14,7 @@
:key=
"item.typeId"
:label=
"item.typeName"
:value=
"item.typeId"
>
</el-option>
></el-option>
</el-select>
</el-form-item>
...
...
@@ -34,8 +28,7 @@
type=
"datetime"
placeholder=
"选择日期时间"
@
change=
"timestampToTime()"
>
</el-date-picker>
></el-date-picker>
</el-form-item>
<el-form-item
label=
"支出对象"
prop=
"expendObject"
>
...
...
@@ -58,30 +51,85 @@
>
</el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"submitForm()"
>
提交
</el-button
>
<el-button
type=
"danger"
icon=
"el-icon-delete-solid"
@
click=
"deleteExpend()"
>
删除
</el-button
>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"submitForm()"
>
提交
</el-button>
<el-button
type=
"danger"
icon=
"el-icon-delete-solid"
@
click=
"deleteExpend()"
>
删除
</el-button>
<el-button
@
click=
"back()"
>
返回
</el-button>
</el-form-item>
</el-form>
</el-col>
<el-col
:xl=
"8"
:lg=
"10"
:md=
"12"
:sm=
"12"
:xs=
"24"
style=
"margin:10px 130px;"
>
<div>
<h3>
发票编辑
</h3>
<div>
<div
class=
"selectList"
style=
"margin:20px 0px"
>
<el-select
v-model=
"getListincom"
multiple
filterable
default-first-option
style=
"width:220px;"
placeholder=
"请选择要添加的发票编号"
@
change=
"getchange()"
>
<el-option
v-for=
"item in invoiceListAdd"
:key=
"item.invoiceId"
:label=
"item.number"
:value=
"item.invoiceId"
></el-option>
</el-select>
<el-button
type=
"primary"
@
click=
"Buttonback2()"
style=
"margin:0px 5px"
>
添加发票
</el-button>
</div>
</div>
<div>
<el-table
:data=
"getinvoivelist"
border
style=
"width: 100%"
:cell-style=
"
{'text-align':'center'}"
:header-cell-style="{'text-align':'center', background:'#eef1f6',color:'#606266'}"
class="gettable"
>
<el-table-column
prop=
"code"
label=
"发票代码"
></el-table-column>
<el-table-column
prop=
"number"
label=
"发票号码"
></el-table-column>
<el-table-column
prop=
"mone"
label=
"金额"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-popover
placement=
"top"
width=
"60"
v-model=
"scope.row.visible"
>
<p>
确定要删除该发票吗
</p>
<div
style=
"text-align: right; margin:0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"scope.row.visible = false"
>
取消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"DeleteFrom(scope.row)"
>
确定
</el-button>
</div>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
slot=
"reference"
class=
"edit"
>
删除
</el-button>
</el-popover>
</
template
>
</el-table-column>
</el-table>
</div>
</div>
</el-col>
</el-row>
</div>
</template>
<
script
>
import
{
selectAll
}
from
"
@/api/type
"
;
import
{
update
,
selectById
,
del
}
from
"
@/api/expend
"
;
import
{
update
,
selectById
,
del
}
from
"
@/api/expend
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
import
{
mapGetters
}
from
"
vuex
"
;
import
{
selectAllById
,
selectAllBystatus
,
updatesubmit
,
deletBystatus
}
from
"
@/api/project
"
;
export
default
{
data
()
{
return
{
...
...
@@ -95,16 +143,16 @@ export default {
expendType
:
null
,
projectId
:
null
,
userId
:
null
,
projectName
:
null
,
projectName
:
null
},
typeList
:
[],
projectData
:
{},
rules
:
{
projectName
:
[
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
}
,
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
}
],
expendType
:
[
{
required
:
true
,
message
:
"
请选择支出类型
"
,
trigger
:
"
change
"
}
,
{
required
:
true
,
message
:
"
请选择支出类型
"
,
trigger
:
"
change
"
}
],
expendMoney
:
[
{
...
...
@@ -113,71 +161,81 @@ export default {
}
],
expendTime
:
[
{
required
:
true
,
message
:
"
请选择支出时间
"
,
trigger
:
"
change
"
}
,
]
,
{
required
:
true
,
message
:
"
请选择支出时间
"
,
trigger
:
"
change
"
}
]
},
getListincom
:
[],
//收集选择的数组
invoiceListAdd
:
[],
//查询发票的集合
getinvoivelist
:
[],
backlistid
:
null
//返回标记
};
},
computed
:
{
...
mapGetters
([
"
companyId
"
,
"
urId
"
]),
expendId
()
{
return
this
.
$route
.
query
.
id
;
}
,
}
},
created
()
{
this
.
backlistid
=
this
.
$route
.
query
.
backlistid
;
this
.
expendFrom
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
getTypeList
();
this
.
getexpend
();
this
.
selectGet
();
this
.
Selectinsertlsit
();
},
methods
:
{
//获取支出类型
getTypeList
()
{
let
param
=
{
companyId
:
this
.
$store
.
getters
.
companyId
,
typeCategory
:
1
,
typeCategory
:
1
};
selectAll
(
param
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
typeList
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
()
this
.
back
()
;
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取类型失败
"
);
this
.
back
()
this
.
back
()
;
});
},
//获取支出信息
getexpend
(){
selectById
({
expendId
:
this
.
expendId
}).
then
((
res
)
=>
{
if
(
res
.
success
){
getexpend
()
{
selectById
({
expendId
:
this
.
expendId
})
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
expendFrom
=
res
.
data
;
this
.
expendFrom
.
userId
=
this
.
$store
.
getters
.
urId
}
else
{
this
.
expendFrom
.
userId
=
this
.
$store
.
getters
.
urId
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
()
this
.
back
()
;
}
}).
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取信息失败
"
)
this
.
back
()
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取信息失败
"
);
this
.
back
();
});
},
//提交
submitForm
()
{
this
.
$refs
.
form
.
validate
(
(
valid
)
=>
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
update
(
this
.
expendFrom
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
this
.
back
()
this
.
back
()
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
新建失败
"
);
});
}
...
...
@@ -190,7 +248,8 @@ export default {
path
:
"
/expendList
"
,
query
:
{
id
:
this
.
$route
.
query
.
projectId
,
},
backlistid
:
this
.
$route
.
query
.
backlistid
}
});
},
//时间处理 yyyy-MM-dd hh:mm:ss
...
...
@@ -213,15 +272,15 @@ export default {
this
.
expendFrom
.
expendTime
=
Y
+
M
+
D
+
h
+
m
+
s
;
},
//删除
deleteExpend
(){
deleteExpend
()
{
this
.
$confirm
(
"
确定要删除此收入记录吗
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
type
:
"
warning
"
})
.
then
(()
=>
{
del
(
this
.
expendFrom
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
删除成功
"
);
this
.
back
();
...
...
@@ -229,18 +288,136 @@ export default {
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
删除失败
"
);
});
})
.
catch
(()
=>
{
this
.
$message
({
type
:
"
info
"
,
message
:
"
已取消删除
"
,
message
:
"
已取消删除
"
});
});
},
//添加发票
Buttonback2
()
{
if
(
this
.
getListincom
.
length
>
0
)
{
let
list
=
[];
//提交发票与收入关系 status默认为1 表示发票已报销
this
.
getListincom
.
forEach
(
item
=>
{
list
.
push
({
invoiceId
:
item
,
expendId
:
this
.
expendId
,
status
:
1
});
});
updatesubmit
(
list
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
this
.
dialogFormVisible
=
false
;
this
.
$message
({
showClose
:
true
,
message
:
"
添加发票成功
"
,
type
:
"
success
"
});
this
.
Selectinsertlsit
();
this
.
getListincom
=
[];
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
}
else
{
this
.
$message
({
showClose
:
true
,
message
:
"
没有添加发票
"
,
type
:
"
warning
"
});
}
},
//查询未报销发票
selectGet
()
{
const
params
=
{
userId
:
this
.
urId
,
companyId
:
this
.
companyId
,
type
:
1
};
selectAllBystatus
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
invoiceListAdd
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取发票编号失败
"
);
});
},
//查询发票图片
Selectinsertlsit
()
{
const
params
=
{
companyId
:
this
.
companyId
,
expendId
:
this
.
expendId
};
selectAllById
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
error
=>
{
console
.
log
(
error
);
this
.
$message
.
error
(
"
获取发票图片失败
"
);
});
},
//删除发票
DeleteFrom
(
row
)
{
let
get
=
this
.
expendFrom
.
expendMoney
;
get
-=
row
.
mone
;
console
.
log
(
get
);
this
.
expendFrom
.
expendMoney
=
get
;
//收集被删除发票的数据
let
BillList
=
{
invoiceId
:
row
.
invoiceId
,
expendId
:
row
.
expendId
};
deletBystatus
(
BillList
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
visible
=
false
;
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
});
this
.
Selectinsertlsit
();
this
.
selectGet
();
}
})
.
catch
(
errror
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//添加发票金额
getchange
()
{
let
sum
=
0
;
let
list
=
[];
this
.
getListincom
.
forEach
(
g
=>
{
this
.
invoiceListAdd
.
forEach
(
item
=>
{
if
(
item
.
invoiceId
==
g
)
{
list
.
push
({
mone
:
item
.
mone
});
}
});
});
list
.
forEach
(
item
=>
{
sum
+=
item
.
mone
;
});
this
.
expendFrom
.
expendMoney
=
sum
;
}
}
};
</
script
>
...
...
@@ -248,4 +425,7 @@ export default {
.container
{
padding
:
10px
;
}
.edit
{
font-size
:
11px
;
}
</
style
>
\ No newline at end of file
src/views/project/income/incomeAdd.vue
View file @
979e03ac
...
...
@@ -2,12 +2,7 @@
<div
class=
"container"
>
<el-row
:gutter=
"20"
>
<el-col
:xl=
"8"
:lg=
"10"
:md=
"8"
:sm=
"12"
:xs=
"24"
>
<el-form
ref=
"form"
:model=
"incomeFrom"
label-width=
"120px"
:rules=
"rules"
>
<el-form
ref=
"form"
:model=
"incomeFrom"
label-width=
"120px"
:rules=
"rules"
>
<el-form-item
label=
"项目名称"
prop=
"projectName"
>
<el-input
v-model=
"incomeFrom.projectName"
disabled
></el-input>
</el-form-item>
...
...
@@ -29,6 +24,7 @@
filterable
default-first-option
placeholder=
"请选择发票编号"
@
change=
"getchange()"
>
<el-option
v-for=
"item in getinvoivelist"
...
...
@@ -70,9 +66,7 @@
</el-col>
<!-- 附件上传 -->
<el-col
:xl=
"8"
:lg=
"10"
:md=
"8"
:sm=
"12"
:xs=
"24"
class=
"contract"
>
<el-button
type=
"primary"
@
click=
"dialogFormVisible = true"
>
上传附件
</el-button
>
<el-button
type=
"primary"
@
click=
"dialogFormVisible = true"
>
上传附件
</el-button>
<el-dialog
title=
"附件"
:visible.sync=
"dialogFormVisible"
width=
"55%"
>
<div
style=
"width: 60%; margin-left: 30px"
>
<el-input
...
...
@@ -100,9 +94,7 @@
将文件拖到此处,或
<em>
点击上传附件
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传文件,且不超过500kb
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div
style=
"margin-left: 75%"
>
...
...
@@ -111,19 +103,14 @@
type=
"primary"
@
click=
"dialogFormVisible = false"
style=
"margin-top: 20px"
>
确 定
</el-button
>
>
确 定
</el-button>
</div>
</el-dialog>
</el-col>
<!-- 按钮 -->
<el-col
:span=
"24"
style=
"margin-left: 120px"
>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"submitForm()"
>
提交
</el-button
>
<el-button
type=
"info"
icon=
"el-icon-refresh-left"
@
click=
"resetForm()"
>
重置信息
</el-button
>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"submitForm()"
>
提交
</el-button>
<el-button
type=
"info"
icon=
"el-icon-refresh-left"
@
click=
"resetForm()"
>
重置信息
</el-button>
<el-button
@
click=
"back()"
>
返回
</el-button>
</el-col>
</el-row>
...
...
@@ -134,14 +121,15 @@
import
{
selectByProjectId
,
selectAllBystatus
,
updatesubmit
,
updatesubmit
}
from
"
@/api/project
"
;
import
{
selectAll
}
from
"
@/api/type
"
;
import
{
insert
}
from
"
@/api/imcome
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
import
{
incomeAdd
as
rules
}
from
"
../rules
"
;
export
default
{
data
()
{
return
{
rules
:
rules
,
//表单
incomeFrom
:
{
incomeBody
:
null
,
...
...
@@ -154,31 +142,7 @@ export default {
projectId
:
null
,
userId
:
null
,
projectName
:
null
,
incomebaoxioa
:
null
,
//报销的字段
},
rules
:
{
projectName
:
[
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
},
],
incomeType
:
[
{
required
:
true
,
message
:
"
请选择收入类型
"
,
trigger
:
"
change
"
},
],
incomeObject
:
[
{
required
:
true
,
message
:
"
没有输入对方户名
"
,
trigger
:
"
change
"
},
],
incomeBody
:
[
{
required
:
true
,
message
:
"
没有输入对收入内容
"
,
trigger
:
"
change
"
},
],
incomeMoney
:
[
{
required
:
true
,
validator
:
money
,
trigger
:
"
change
"
,
},
],
incomeTime
:
[
{
required
:
true
,
message
:
"
请选择收到时间
"
,
trigger
:
"
change
"
},
],
incomebaoxioa
:
null
//报销的字段
},
invoiceListAdd
:
[],
//选择的发票号
getinvoivelist
:
[],
//查询的能选择的表单信息
...
...
@@ -191,22 +155,22 @@ export default {
enclosureDescribe
:
""
,
status
:
0
,
//0收入 1支出
companyId
:
null
,
userId
:
null
,
userId
:
null
},
//查询发票编号的参数
getinvoiveId
:
{
userId
:
null
,
companyId
:
null
,
type
:
0
,
type
:
0
},
//附件
dialogFormVisible
:
false
,
dialogFormVisible
:
false
};
},
computed
:
{
projectId
()
{
return
this
.
$route
.
query
.
id
;
}
,
}
},
created
()
{
//用户id
...
...
@@ -246,10 +210,10 @@ export default {
},
//提交
submitForm
()
{
this
.
$refs
.
form
.
validate
(
(
valid
)
=>
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
insert
(
this
.
incomeFrom
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
//判断是否有附件文件
if
(
this
.
fileTypepdf
)
{
...
...
@@ -260,14 +224,14 @@ export default {
if
(
this
.
invoiceListAdd
.
length
>
0
)
{
let
list
=
[];
//提交发票与收入关系 status默认为1 表示发票已报销
this
.
invoiceListAdd
.
forEach
(
(
item
)
=>
{
this
.
invoiceListAdd
.
forEach
(
item
=>
{
list
.
push
({
invoiceId
:
item
,
incomeId
:
res
.
data
,
status
:
1
,
status
:
1
});
});
updatesubmit
(
list
).
then
(
(
res
)
=>
{
updatesubmit
(
list
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
this
.
back
();
...
...
@@ -282,7 +246,7 @@ export default {
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
提交失败
"
);
});
}
...
...
@@ -301,8 +265,8 @@ export default {
path
:
"
/incomeList
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
backid
:
this
.
$route
.
query
.
backid
,
}
,
backid
:
this
.
$route
.
query
.
backid
}
});
},
//合同文件校验
...
...
@@ -322,10 +286,10 @@ export default {
getTypeList
()
{
let
param
=
{
companyId
:
this
.
$store
.
getters
.
companyId
,
typeCategory
:
0
,
typeCategory
:
0
};
selectAll
(
param
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
typeList
=
res
.
data
;
}
else
{
...
...
@@ -333,7 +297,7 @@ export default {
this
.
back
();
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取类型失败
"
);
this
.
back
();
});
...
...
@@ -341,10 +305,10 @@ export default {
//获取项目
getProject
()
{
let
param
=
{
projectId
:
this
.
projectId
,
projectId
:
this
.
projectId
};
selectByProjectId
(
param
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
projectData
=
res
.
data
;
this
.
incomeFrom
.
projectName
=
res
.
data
.
projectName
;
...
...
@@ -354,7 +318,7 @@ export default {
this
.
back
();
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取项目失败
"
);
this
.
back
();
});
...
...
@@ -362,7 +326,7 @@ export default {
//查询发票编号
Selectinsertlsit
()
{
selectAllBystatus
(
this
.
getinvoiveId
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
}
else
{
...
...
@@ -370,7 +334,7 @@ export default {
this
.
back
();
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取发票编号失败
"
);
this
.
back
();
});
...
...
@@ -378,7 +342,7 @@ export default {
//清楚合同文件
delfile1
()
{
this
.
fileTypepdf
=
false
;
this
.
fileList1
=
this
.
fileList1
.
filter
(
(
item
)
=>
item
.
uid
!==
file
.
uid
);
this
.
fileList1
=
this
.
fileList1
.
filter
(
item
=>
item
.
uid
!==
file
.
uid
);
},
//取消
remove
()
{
...
...
@@ -386,7 +350,25 @@ export default {
this
.
delfile1
();
this
.
dialogFormVisible
=
false
;
},
},
//添加发票金额
getchange
()
{
let
sum
=
0
;
let
list
=
[];
this
.
invoiceListAdd
.
forEach
(
g
=>
{
this
.
getinvoivelist
.
forEach
(
item
=>
{
if
(
item
.
invoiceId
==
g
)
{
list
.
push
({
mone
:
item
.
mone
});
}
});
});
list
.
forEach
(
item
=>
{
sum
+=
item
.
mone
;
});
this
.
incomeFrom
.
incomeMoney
=
sum
;
}
}
};
</
script
>
...
...
src/views/project/income/incomeList.vue
View file @
979e03ac
...
...
@@ -3,10 +3,7 @@
<div
class=
"header"
>
<el-form
:inline=
"true"
:model=
"incomeQurey"
>
<el-form-item
label=
"收入对象"
>
<el-input
v-model=
"incomeQurey.incomeObject"
placeholder=
"收入对象"
></el-input>
<el-input
v-model=
"incomeQurey.incomeObject"
placeholder=
"收入对象"
></el-input>
</el-form-item>
<el-form-item
label=
"收入类别"
>
<el-select
v-model=
"incomeQurey.incomeType"
>
...
...
@@ -19,10 +16,7 @@
</el-select>
</el-form-item>
<el-form-item
label=
"收入内容"
>
<el-input
v-model=
"incomeQurey.incomeBody"
placeholder=
"收入内容"
></el-input>
<el-input
v-model=
"incomeQurey.incomeBody"
placeholder=
"收入内容"
></el-input>
</el-form-item>
<el-form-item
label=
"收入时间"
>
<el-date-picker
...
...
@@ -35,22 +29,14 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"qurey()"
>
查询
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"reset()"
>
重置
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"qurey()"
>
查询
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"reset()"
>
重置
</el-button>
<el-button
type=
"success"
icon=
"el-icon-circle-plus-outline"
@
click=
"addincome()"
v-if=
"state != 0"
>
新增收入
</el-button
>
>
新增收入
</el-button>
<el-button
@
click=
"back()"
>
返回
</el-button>
</el-form-item>
</el-form>
...
...
@@ -61,22 +47,33 @@
:data=
"incomeList"
style=
"width: 100%; text-align: center"
border
:cell-style=
"
{
'text-align':
'center'
}"
:header-cell-style="{
'text-align':
'center'
}"
:cell-style=
"
{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
>
<el-table-column
type=
"expand"
>
<template
slot-scope=
"props"
>
<el-form
label-position=
"left"
class=
"demo-table-expand"
>
<el-form-item
label=
"收入详情:"
>
<span>
{{
props
.
row
.
incomeInformation
}}
</span>
</el-form-item>
<el-form-item
label=
"收入备注:"
>
<el-descriptions
class=
"margin-top"
title=
"关于项目"
:column=
"1"
style=
"width:40%; margin:20px 20px"
border
>
<el-descriptions-item
label=
"收入附言:"
>
<span>
{{
props
.
row
.
incomeRemarks
}}
</span>
</el-form-item>
</el-form>
</el-descriptions-item>
<el-descriptions-item
label=
"收入详情:"
>
<span>
{{
props
.
row
.
incomeInformation
}}
</span>
</el-descriptions-item>
<el-descriptions-item
label=
"发票文件:"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"ReviseImage(props.row)"
>
点击查看
</el-button>
</el-descriptions-item>
<el-descriptions-item
label=
"附件下载"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"selectImage(props.row)"
>
点击查看
</el-button>
</el-descriptions-item>
</el-descriptions>
</
template
>
</el-table-column>
<el-table-column
label=
"序号"
width=
"50px"
>
<
template
slot-scope=
"scope"
>
{{
...
...
@@ -99,27 +96,6 @@
<el-table-column
prop=
"incomeBody"
label=
"收入内容"
/>
<el-table-column
prop=
"incomeTime"
label=
"收入时间"
/>
<el-table-column
prop=
"prop"
label=
"发票文件"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"ReviseImage(scope.row)"
>
点击查看
</el-button
>
</
template
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"附件下载"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"selectImage(scope.row)"
>
点击查看
</el-button
>
</
template
>
</el-table-column>
<el-table-column
label=
"操作人员"
>
<
template
slot-scope=
"scope"
>
<el-tag
effect=
"plain"
>
{{
scope
.
row
.
userName
}}
</el-tag>
...
...
@@ -134,8 +110,7 @@
icon=
"el-icon-edit"
type=
"info"
@
click=
"updatain(scope.row)"
>
修改信息
</el-button
>
>
修改信息
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -154,39 +129,20 @@
<!--发票抽屉-->
<div>
<el-drawer
title=
"发票详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"60%"
>
<el-drawer
title=
"发票详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"50%"
>
<!-- filePath-->
<el-button
type=
"primary"
style=
"margin: 10px 3%"
@
click=
"selectGet()"
>
添加收入发票
</el-button
>
<el-table
:data=
"getinvoivelist"
style=
"width: 9
4
%; margin:
10px
3
%; text-align: center"
style=
"width: 9
0
%; margin:10px
5
%; text-align: center"
border
:cell-style=
"{
'text-align':
'center'
}"
:header-cell-style=
"{
'text-align':
'center'
}"
:cell-style=
"{'text-align':'center'}"
:header-cell-style=
"{'text-align':'center'}"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"80px"
></el-table-column>
<el-table-column
prop=
"number"
label=
"号码"
width=
"160px"
></el-table-column>
<el-table-column
prop=
"mone"
label=
"金额"
width=
"180px"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"查看PDF文件或图片"
width=
"180px"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"80px"
></el-table-column>
<el-table-column
prop=
"code"
label=
"发票代码"
></el-table-column>
<el-table-column
prop=
"number"
label=
"发票号码"
></el-table-column>
<el-table-column
prop=
"mone"
label=
"发票金额"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"查看PDF文件或图片"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"formatProtocolType(scope.row)"
>
<el-image
...
...
@@ -196,133 +152,48 @@
></el-image>
</div>
<div
v-else
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看文件
</a
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看文件
</a>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"top"
width=
"60"
v-model=
"scope.row.visible"
>
<p>
确定要删除该发票吗
</p>
<div
style=
"text-align: right; margin: 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"scope.row.visible = false"
>
取消
</el-button
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"DeleteFrom(scope.row)"
>
确定
</el-button
>
</div>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
slot=
"reference"
></el-button>
</el-popover>
</
template
>
</el-table-column>
</el-table>
</el-drawer>
</div>
<!-- 添加发票对话框 -->
<div>
<el-dialog
title=
"添加发票"
:visible.sync=
"dialogFormVisible"
width=
"40%"
>
<div
class=
"dialog-footer"
>
<div
class=
"selectList"
>
<el-select
v-model=
"getListincom"
multiple
filterable
default-first-option
style=
"width: 100%"
placeholder=
"请选择要添加的发票编号"
>
<el-option
v-for=
"item in invoiceListAdd"
:key=
"item.invoiceId"
:label=
"item.number"
:value=
"item.invoiceId"
></el-option>
</el-select>
</div>
<div
slot=
"footer"
>
<el-button
@
click=
"Buttonback1()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"Buttonback2()"
>
确 定
</el-button>
</div>
</div>
</el-dialog>
</div>
<!-- 附件抽屉 -->
<div>
<el-drawer
title=
"附件操作"
:visible.sync=
"drawer2"
:direction=
"direction"
size=
"50%"
>
<el-drawer
title=
"附件操作"
:visible.sync=
"drawer2"
:direction=
"direction"
size=
"50%"
>
<el-button
type=
"primary"
style=
"margin-left:
5%;
margin-top:
40px"
style=
"
margin-left:5%;margin-top:40px
"
:disabled=
"disabled"
@
click=
"updatecard"
>
添加附件
</el-button
>
>
添加附件
</el-button>
<el-card
class=
"box-card"
style=
"width:
90%; margin-left:
5%; margin-top:
20px"
v-show=
"getshow
==
1"
style=
"width:90%; margin-left:5%; margin-top:20px"
v-show=
"getshow==1"
>
<el-row
class=
"row-bg"
>
<div
v-for=
"index in queryDTOList"
:key=
"index.enclosureId"
class=
"lsitall"
>
<div
v-for=
"index in queryDTOList"
:key=
"index.enclosureId"
class=
"lsitall"
>
<el-col
:span=
"10"
>
<div
style=
"margin-top: 6px; margin-left: 40px"
>
附件{{ index.enclosureId }}
</div>
<div
style=
" margin-top: 6px;margin-left:40px"
>
附件{{index.enclosureId}}
</div>
</el-col>
<el-col
:span=
"12"
style=
"margin-left:
-50px"
>
<el-col
:span=
"12"
style=
"margin-left:-50px"
>
<el-button
type=
"primary"
icon=
"el-icon-folder-checked"
class=
"a-style"
size=
"mini"
style=
"font-size: 13px"
style=
"
font-size: 13px"
@
click=
"delProject(index)"
>
下载
</el-button
>
>
下载
</el-button>
<el-popover
placement=
"top"
width=
"160"
v-model=
"index.visible"
>
<p>
确定要删除此条附件吗
</p>
<div
style=
"text-align: right; margin: 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"index.visible = false"
>
取消
</el-button
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteProject(index)"
>
确定
</el-button
>
<el-button
size=
"mini"
type=
"text"
@
click=
"index.visible= false"
>
取消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteProject(index)"
>
确定
</el-button>
</div>
<el-button
type=
"danger"
...
...
@@ -331,8 +202,7 @@
size=
"mini "
style=
"font-size: 13px"
slot=
"reference"
>
删除
</el-button
>
>
删除
</el-button>
</el-popover>
</el-col>
</div>
...
...
@@ -341,16 +211,16 @@
<!-- 附件上传 -->
<el-card
class=
"box-card"
style=
"width:
90%; margin-left:
5%; margin-top:
20px"
v-show=
"getshow
==
0"
style=
"width:90%; margin-left:5%; margin-top:20px"
v-show=
"getshow==0"
>
<div
style=
"width:
60%;
margin-left:
30px"
>
<div
style=
"width:60%;margin-left:30px"
>
<el-input
type=
"textarea"
:rows=
"2"
placeholder=
"请输入附件详情"
v-model=
"proutlist1.enclosureDescribe"
style=
"margin:
20px 0px"
style=
"margin:20px 0px
;
"
></el-input>
<el-upload
class=
"upload-demo"
...
...
@@ -364,30 +234,23 @@
:on-success=
"Refresh"
:data=
"proutlist1"
multiple
style=
"margin:
20px 0px"
style=
"margin:20px 0px
;
"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传附件
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传文件,且不超过500kb
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div
style=
"margin-left:
75%"
>
<div
style=
"margin-left:75%
;
"
>
<el-button
@
click=
"remove()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"determine()"
style=
"margin-top: 20px"
>
确 定
</el-button
>
<el-button
type=
"primary"
@
click=
"determine()"
style=
"margin-top:20px;"
>
确 定
</el-button>
</div>
</el-card>
<div
class=
"box-card"
v-show=
"getshow
==
3"
></div>
<div
class=
"box-card"
v-show=
"getshow==3"
></div>
</el-drawer>
</div>
</div>
...
...
@@ -396,14 +259,7 @@
<
script
>
import
{
selectByProjectId
}
from
"
@/api/imcome
"
;
import
{
selectAll
}
from
"
@/api/type
"
;
import
{
selectAllById
,
selectByIdF
,
selectAllBystatus
,
updatesubmit
,
deletBystatus
,
deleteById
,
}
from
"
@/api/project
"
;
import
{
selectAllById
,
selectByIdF
,
deleteById
}
from
"
@/api/project
"
;
import
{
componentMap
}
from
"
../../../router
"
;
import
{
getFileUrl
}
from
"
@/api/companyFile
"
;
...
...
@@ -417,13 +273,12 @@ const InitialData = {
incomeType
:
null
,
projectId
:
null
,
userId
:
null
,
projectName
:
null
,
projectName
:
null
};
export
default
{
data
()
{
return
{
visible
:
false
,
incomeQurey
:
{
projectId
:
null
,
pageNum
:
1
,
...
...
@@ -432,7 +287,7 @@ export default {
incomeType
:
null
,
incomeBody
:
null
,
incomeTimeStart
:
null
,
incomeTimeEnd
:
null
,
incomeTimeEnd
:
null
},
incomeList
:
[],
options
:
[],
...
...
@@ -446,30 +301,21 @@ export default {
//查询图片给的值
getinvoiveId
:
{
companyId
:
null
,
incomeId
:
0
,
incomeId
:
0
},
//图片的数组
getinvoivelist
:
[],
//图片数组
srcList
:
[],
backid
:
null
,
//查询附件
queryDTO
:
{
companyId
:
null
,
incomeId
:
null
,
incomeId
:
null
},
queryDTOList
:
[],
//收集附件的数据
//附件抽屉
drawer2
:
false
,
//发票对话框
dialogFormVisible
:
false
,
invoiceListAdd
:
[],
//查询发票的集合
getFormslist
:
{
userId
:
null
,
companyId
:
null
,
type
:
0
,
},
//查询的能选择的表单信息
getListincom
:
[],
//收集选择的数组
incomeIdgrt
:
null
,
//收集incomeId数据
getshow
:
1
,
//判断show的显示与隐藏,
//合同文件上传携带参数
...
...
@@ -478,24 +324,23 @@ export default {
enclosureDescribe
:
""
,
status
:
0
,
//0收入 1支出
companyId
:
null
,
userId
:
null
,
userId
:
null
},
fileTypepdf
:
false
,
//判断合同文件是否存在
fileList1
:
[],
//合同文件
disabled
:
false
,
//隐藏,
disabled
:
false
//隐藏,
};
},
computed
:
{
state
:
function
()
{
state
:
function
()
{
return
this
.
$route
.
query
.
state
;
}
,
}
},
created
()
{
this
.
getinvoiveId
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
incomeQurey
.
projectId
=
this
.
$route
.
query
.
id
;
this
.
backid
=
this
.
$route
.
query
.
backid
;
this
.
queryDTO
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
getFormslist
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
action1
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
this
.
getIncome
();
this
.
getTypeList
();
...
...
@@ -505,24 +350,24 @@ export default {
getTypeList
()
{
let
param
=
{
companyId
:
this
.
$store
.
getters
.
companyId
,
typeCategory
:
0
,
typeCategory
:
0
};
selectAll
(
param
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
options
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取类型失败
"
);
});
},
//获取收入情况
getIncome
()
{
selectByProjectId
(
this
.
incomeQurey
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
incomeList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
...
...
@@ -530,7 +375,7 @@ export default {
this
.
$message
.
errror
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
查询数据失败
"
);
});
},
...
...
@@ -607,8 +452,8 @@ export default {
path
:
"
/incomeAdd
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
backid
:
this
.
backid
,
}
,
backid
:
this
.
backid
}
});
},
//查看项目附件.....
...
...
@@ -616,7 +461,7 @@ export default {
this
.
queryDTO
.
incomeId
=
row
.
incomeId
;
this
.
proutlist1
.
Id
=
row
.
incomeId
;
selectByIdF
(
this
.
queryDTO
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
if
(
this
.
queryDTOList
.
length
>
0
)
{
...
...
@@ -632,7 +477,7 @@ export default {
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
...
...
@@ -640,21 +485,22 @@ export default {
ReviseImage
(
row
)
{
this
.
drawer
=
true
;
this
.
getinvoiveId
.
incomeId
=
row
.
incomeId
;
console
.
log
(
this
.
getinvoiveId
.
incomeId
);
this
.
incomeIdgrt
=
row
.
incomeId
;
this
.
Selectinsertlsit
();
},
//查询发票图片
Selectinsertlsit
()
{
selectAllById
(
this
.
getinvoiveId
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
res
.
data
.
forEach
(
(
e
)
=>
{
res
.
data
.
forEach
(
e
=>
{
let
fileNamepdf
=
e
.
filePath
;
console
.
log
(
fileNamepdf
);
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
)
);
getFileUrl
(
e
.
filePath
).
then
(
(
res
)
=>
{
getFileUrl
(
e
.
filePath
).
then
(
res
=>
{
if
(
res
.
success
)
{
let
url
=
res
.
data
;
e
.
fileUrl
=
url
;
...
...
@@ -671,7 +517,7 @@ export default {
this
.
back
();
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
console
.
log
(
error
);
this
.
$message
.
error
(
"
获取发票图片失败
"
);
this
.
back
();
...
...
@@ -684,34 +530,32 @@ export default {
query
:
{
id
:
data
.
incomeId
,
projectId
:
this
.
$route
.
query
.
id
,
},
backid
:
this
.
backid
}
});
},
//返回开始
back
()
{
if
(
this
.
backid
==
0
)
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
"
/projectList
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
}
,
id
:
this
.
$route
.
query
.
id
}
});
}
else
if
(
this
.
backid
==
1
)
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
"
/beresponsibleforList
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
}
,
id
:
this
.
$route
.
query
.
id
}
});
}
else
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
"
/participateinList
"
,
query
:
{
id
:
this
.
$route
.
query
.
id
,
}
,
id
:
this
.
$route
.
query
.
id
}
});
}
},
...
...
@@ -724,7 +568,7 @@ export default {
//下载附件
delProject
(
row
)
{
getFileUrl
(
row
.
enclosureFile
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
let
url
=
res
.
data
;
console
.
log
(
url
);
...
...
@@ -739,84 +583,10 @@ export default {
this
.
$message
.
error
(
"
下载失败
"
);
}
})
.
catch
(
(
e
)
=>
{
.
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
msg
);
});
},
//查询未报销发票
selectGet
()
{
this
.
dialogFormVisible
=
true
;
this
.
getFormslist
.
userId
=
this
.
$store
.
getters
.
urId
;
selectAllBystatus
(
this
.
getFormslist
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
invoiceListAdd
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取发票编号失败
"
);
this
.
back
();
});
},
//确定与取消
Buttonback1
()
{
this
.
selectGet
();
this
.
dialogFormVisible
=
false
;
this
.
getListincom
=
[];
},
Buttonback2
()
{
let
list
=
[];
//提交发票与收入关系 status默认为1 表示发票已报销
this
.
getListincom
.
forEach
((
item
)
=>
{
list
.
push
({
invoiceId
:
item
,
incomeId
:
this
.
incomeIdgrt
,
status
:
1
,
});
});
updatesubmit
(
list
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
this
.
dialogFormVisible
=
false
;
this
.
$message
({
showClose
:
true
,
message
:
"
添加发票成功
"
,
type
:
"
success
"
,
});
this
.
Selectinsertlsit
();
this
.
getListincom
=
[];
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
},
//删除发票
DeleteFrom
(
row
)
{
//收集被删除发票的数据
let
BillList
=
{
invoiceId
:
row
.
invoiceId
,
incomeId
:
row
.
incomeId
,
};
deletBystatus
(
BillList
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
visible
=
false
;
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
});
this
.
Selectinsertlsit
();
}
})
.
catch
((
errror
)
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
// 附件-------0-----------
//显示添加附件
...
...
@@ -828,23 +598,23 @@ export default {
//删除附件
deleteProject
(
row
)
{
deleteById
(
row
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
selectImage
(
row
);
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
type
:
"
success
"
});
this
.
visible
=
false
;
}
})
.
catch
(
(
errror
)
=>
{
.
catch
(
errror
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//清除附件文件
delfile1
(
file
)
{
this
.
fileList1
=
this
.
fileList1
.
filter
(
(
item
)
=>
item
.
uid
!==
file
.
uid
);
this
.
fileList1
=
this
.
fileList1
.
filter
(
item
=>
item
.
uid
!==
file
.
uid
);
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
this
.
fileTypepdf
=
false
;
},
...
...
@@ -860,7 +630,7 @@ export default {
this
.
$message
({
showClose
:
true
,
message
:
"
上传附件成功
"
,
type
:
"
success
"
,
type
:
"
success
"
});
this
.
Refresh
();
}
else
{
...
...
@@ -872,7 +642,7 @@ export default {
this
.
queryDTO
.
incomeId
=
this
.
proutlist1
.
Id
;
selectByIdF
(
this
.
queryDTO
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
...
...
@@ -880,7 +650,7 @@ export default {
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
...
...
@@ -922,8 +692,8 @@ export default {
return
false
;
}
}
}
,
}
,
}
}
};
</
script
>
...
...
src/views/project/income/incomeUpdata.vue
View file @
979e03ac
<
template
>
<div
class=
"container"
>
<el-row>
<el-col
:xl=
"8"
:lg=
"8"
:md=
"8"
:sm=
"12"
:xs=
"24"
>
<el-form
ref=
"form"
:model=
"incomeFrom"
label-width=
"120px"
:rules=
"rules"
>
<el-col
:xl=
"8"
:lg=
"8"
:md=
"8"
:sm=
"12"
:xs=
"24"
style=
"margin:20px 30px;"
>
<el-form
ref=
"form"
:model=
"incomeFrom"
label-width=
"120px"
:rules=
"rules"
>
<el-form-item
label=
"项目名称"
prop=
"projectName"
>
<el-input
v-model=
"incomeFrom.projectName"
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"收入类别"
prop=
"incomeType"
>
<el-select
v-model=
"incomeFrom.incomeType"
placeholder=
"请选择"
>
<el-option
...
...
@@ -19,8 +13,7 @@
:key=
"item.typeId"
:label=
"item.typeName"
:value=
"item.typeId"
>
</el-option>
></el-option>
</el-select>
</el-form-item>
...
...
@@ -34,8 +27,7 @@
type=
"datetime"
placeholder=
"选择日期时间"
@
change=
"timestampToTime()"
>
</el-date-picker>
></el-date-picker>
</el-form-item>
<el-form-item
label=
"收入对象"
prop=
"incomeObject"
>
...
...
@@ -58,22 +50,71 @@
>
</el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"submitForm()"
>
提交
</el-button
>
<el-button
type=
"danger"
icon=
"el-icon-delete-solid"
@
click=
"deleteIncome()"
>
删除
</el-button
>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"submitForm()"
>
提交
</el-button>
<el-button
type=
"danger"
icon=
"el-icon-delete-solid"
@
click=
"deleteIncome()"
>
删除
</el-button>
<el-button
@
click=
"back()"
>
返回
</el-button>
</el-form-item>
</el-form>
</el-col>
<el-col
:xl=
"8"
:lg=
"10"
:md=
"12"
:sm=
"12"
:xs=
"24"
style=
"margin:10px 130px;"
>
<div>
<h3>
发票编辑
</h3>
<div>
<div
class=
"selectList"
style=
"margin:20px 0px"
>
<el-select
v-model=
"getListincom"
multiple
filterable
default-first-option
style=
"width:220px;"
placeholder=
"请选择要添加的发票编号"
@
change=
"getchange()"
>
<el-option
v-for=
"item in invoiceListAdd"
:key=
"item.invoiceId"
:label=
"item.number"
:value=
"item.invoiceId"
></el-option>
</el-select>
<el-button
type=
"primary"
@
click=
"Buttonback2()"
style=
"margin:0px 5px"
>
添加发票
</el-button>
</div>
</div>
<div>
<el-table
:data=
"getinvoivelist"
border
style=
"width: 100%"
:cell-style=
"
{'text-align':'center'}"
:header-cell-style="{'text-align':'center', background:'#eef1f6',color:'#606266'}"
class="gettable"
>
<el-table-column
prop=
"code"
label=
"发票代码"
></el-table-column>
<el-table-column
prop=
"number"
label=
"发票号码"
></el-table-column>
<el-table-column
prop=
"mone"
label=
"发票金额"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-popover
placement=
"top"
width=
"60"
v-model=
"scope.row.visible"
>
<p>
确定要删除该发票吗
</p>
<div
style=
"text-align: right; margin:0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"scope.row.visible = false"
>
取消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"DeleteFrom(scope.row)"
>
确定
</el-button>
</div>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
slot=
"reference"
class=
"edit"
>
删除
</el-button>
</el-popover>
</
template
>
</el-table-column>
</el-table>
</div>
</div>
</el-col>
</el-row>
</div>
</template>
...
...
@@ -82,6 +123,13 @@
import
{
selectAll
}
from
"
@/api/type
"
;
import
{
update
,
selectById
,
del
}
from
"
@/api/imcome
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
import
{
selectAllBystatus
,
updatesubmit
,
selectAllById
,
deletBystatus
}
from
"
@/api/project
"
;
import
{
mapGetters
}
from
"
vuex
"
;
export
default
{
data
()
{
return
{
...
...
@@ -95,16 +143,16 @@ export default {
incomeType
:
null
,
projectId
:
null
,
userId
:
null
,
projectName
:
null
,
projectName
:
null
},
typeList
:
[],
projectData
:
{},
rules
:
{
projectName
:
[
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
}
,
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
}
],
incomeType
:
[
{
required
:
true
,
message
:
"
请选择收入类型
"
,
trigger
:
"
change
"
}
,
{
required
:
true
,
message
:
"
请选择收入类型
"
,
trigger
:
"
change
"
}
],
incomeMoney
:
[
{
...
...
@@ -113,30 +161,38 @@ export default {
}
],
incomeTime
:
[
{
required
:
true
,
message
:
"
请选择收入时间
"
,
trigger
:
"
change
"
}
,
]
,
{
required
:
true
,
message
:
"
请选择收入时间
"
,
trigger
:
"
change
"
}
]
},
getListincom
:
[],
//收集选择的数组
invoiceListAdd
:
[],
//查询发票的集合
//图片的数组
getinvoivelist
:
[],
visible
:
false
};
},
computed
:
{
...
mapGetters
([
"
companyId
"
,
"
urId
"
]),
incomeId
()
{
return
this
.
$route
.
query
.
id
;
}
,
}
},
created
()
{
this
.
incomeFrom
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
getTypeList
();
this
.
getIncome
();
this
.
selectGet
();
this
.
Selectinsertlsit
();
},
methods
:
{
//获取收入类型
getTypeList
()
{
let
param
=
{
companyId
:
this
.
$store
.
getters
.
companyId
,
typeCategory
:
0
,
typeCategory
:
0
};
selectAll
(
param
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
typeList
=
res
.
data
;
}
else
{
...
...
@@ -144,7 +200,7 @@ export default {
this
.
back
();
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取类型失败
"
);
this
.
back
();
});
...
...
@@ -152,7 +208,7 @@ export default {
//获取收入信息
getIncome
()
{
selectById
({
incomeId
:
this
.
incomeId
})
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
incomeFrom
=
res
.
data
;
this
.
incomeFrom
.
userId
=
this
.
$store
.
getters
.
urId
;
...
...
@@ -161,17 +217,17 @@ export default {
this
.
back
();
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取信息失败
"
);
this
.
back
();
});
},
//提交
submitForm
()
{
this
.
$refs
.
form
.
validate
(
(
valid
)
=>
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
update
(
this
.
incomeFrom
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
this
.
back
();
...
...
@@ -179,7 +235,7 @@ export default {
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
新建失败
"
);
});
}
...
...
@@ -192,7 +248,8 @@ export default {
path
:
"
/incomeList
"
,
query
:
{
id
:
this
.
$route
.
query
.
projectId
,
},
backid
:
this
.
$route
.
query
.
backid
}
});
},
//时间处理 yyyy-MM-dd hh:mm:ss
...
...
@@ -219,11 +276,11 @@ export default {
this
.
$confirm
(
"
确定要删除此收入记录吗
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
type
:
"
warning
"
})
.
then
(()
=>
{
del
(
this
.
incomeFrom
)
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
删除成功
"
);
this
.
back
();
...
...
@@ -231,18 +288,133 @@ export default {
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
(
error
)
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
删除失败
"
);
});
})
.
catch
(()
=>
{
this
.
$message
({
type
:
"
info
"
,
message
:
"
已取消删除
"
,
message
:
"
已取消删除
"
});
});
},
//查询未报销发票
selectGet
()
{
const
params
=
{
companyId
:
this
.
companyId
,
userId
:
this
.
urId
,
type
:
0
};
selectAllBystatus
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
invoiceListAdd
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
}
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取发票编号失败
"
);
this
.
back
();
});
},
//确定提交发票
Buttonback2
()
{
if
(
this
.
getListincom
.
length
>
0
)
{
let
list
=
[];
//提交发票与收入关系 status默认为1 表示发票已报销
this
.
getListincom
.
forEach
(
item
=>
{
list
.
push
({
invoiceId
:
item
,
incomeId
:
this
.
incomeId
,
status
:
1
});
});
updatesubmit
(
list
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
this
.
Selectinsertlsit
();
this
.
getListincom
=
[];
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
}
else
{
this
.
$message
({
showClose
:
true
,
message
:
"
没有添加发票
"
,
type
:
"
warning
"
});
}
},
//查询发票图片
Selectinsertlsit
()
{
const
params
=
{
companyId
:
this
.
companyId
,
incomeId
:
this
.
incomeId
};
selectAllById
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
}
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取发票图片失败
"
);
this
.
back
();
});
},
//删除发票
DeleteFrom
(
row
)
{
let
get
=
this
.
incomeFrom
.
incomeMoney
;
get
-=
row
.
mone
;
console
.
log
(
get
);
this
.
incomeFrom
.
incomeMoney
=
get
;
//收集被删除发票的数据
let
BillList
=
{
invoiceId
:
row
.
invoiceId
,
incomeId
:
row
.
incomeId
};
deletBystatus
(
BillList
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
visible
=
false
;
this
.
$message
({
message
:
"
删除发票状态成功
"
,
type
:
"
success
"
});
this
.
selectGet
();
this
.
Selectinsertlsit
();
}
})
.
catch
(
errror
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//添加发票金额
getchange
()
{
let
sum
=
0
;
let
list
=
[];
this
.
getListincom
.
forEach
(
g
=>
{
this
.
invoiceListAdd
.
forEach
(
item
=>
{
if
(
item
.
invoiceId
==
g
)
{
list
.
push
({
mone
:
item
.
mone
});
}
});
});
list
.
forEach
(
item
=>
{
sum
+=
item
.
mone
;
});
this
.
incomeFrom
.
incomeMoney
=
sum
;
}
}
};
</
script
>
...
...
@@ -250,4 +422,7 @@ export default {
.container
{
padding
:
10px
;
}
.edit
{
font-size
:
11px
;
}
</
style
>
\ No newline at end of file
src/views/project/member/memberUpdata.vue
View file @
979e03ac
...
...
@@ -94,7 +94,7 @@ export default {
//查询员工,得到初始员工值
secletAllStaff
({
companyId
:
this
.
$store
.
getters
.
companyId
})
.
then
(
res
=>
{
if
(
res
.
status
==
"
success
"
)
{
if
(
res
.
success
)
{
this
.
staffList
=
res
.
data
;
//数据整理,排除项目负责人
selectAllByProjectId
({
projectId
:
this
.
projectId
})
...
...
src/views/project/participatein/participateinList.vue
View file @
979e03ac
...
...
@@ -26,14 +26,19 @@
>
<el-table-column
type=
"expand"
>
<template
slot-scope=
"props"
>
<el-form
label-position=
"left"
class=
"demo-table-expand"
>
<el-form-item
label=
"合作方:"
>
<span>
{{
props
.
row
.
projectPartyb
}}
</span>
</el-form-item>
<el-form-item
label=
"项目详情:"
>
<el-descriptions
class=
"margin-top"
title=
"关于项目"
:column=
"1"
:size=
"medium"
style=
"width:40%; margin:20px 20px"
border
>
<el-descriptions-item
label=
"合作方:"
>
{{
props
.
row
.
projectPartyb
}}
</el-descriptions-item>
<el-descriptions-item
label=
"项目详情:"
>
<span>
{{
props
.
row
.
projectInformation
}}
</span>
</el-
form
-item>
</el-
form
>
</el-
descriptions
-item>
</el-
descriptions
>
</
template
>
</el-table-column>
...
...
src/views/project/projectAdd.vue
View file @
979e03ac
...
...
@@ -176,7 +176,7 @@ export default {
getRoleList
()
{
selectAllByCompanyId
({
companyId
:
this
.
$store
.
getters
.
companyId
})
.
then
(
res
=>
{
if
(
res
.
status
==
"
success
"
)
{
if
(
res
.
success
)
{
this
.
rolesList
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
data
);
...
...
src/views/project/projectList.vue
View file @
979e03ac
...
...
@@ -27,14 +27,30 @@
>
<el-table-column
type=
"expand"
>
<template
slot-scope=
"props"
>
<el-form
label-position=
"left"
class=
"demo-table-expand"
>
<el-form-item
label=
"合作方:"
>
<span>
{{
props
.
row
.
projectPartyb
}}
</span>
</el-form-item>
<el-form-item
label=
"项目详情:"
>
<el-descriptions
class=
"margin-top"
title=
"关于项目"
:column=
"1"
style=
"width:60%; margin:20px 20px"
border
>
<el-descriptions-item
label=
"合作方:"
:labelStyle=
"
{'width':'120px'}"
>
{{
props
.
row
.
projectPartyb
}}
</el-descriptions-item>
<el-descriptions-item
label=
"项目详情:"
>
<span>
{{
props
.
row
.
projectInformation
}}
</span>
</el-form-item>
</el-form>
</el-descriptions-item>
<el-descriptions-item
label=
"更改项目负责人:"
>
<el-button
style=
"margin:5px"
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
@
click=
"member(props.row)"
>
负责人管理
</el-button>
</el-descriptions-item>
</el-descriptions>
</
template
>
</el-table-column>
...
...
@@ -104,13 +120,6 @@
type=
"info"
@
click=
"updataProject(scope.row)"
>
修改信息
</el-button>
<el-button
style=
"margin:5px"
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
@
click=
"member(scope.row)"
>
负责人管理
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -268,4 +277,8 @@ export default {
font-weight
:
600
;
font-size
:
15px
;
}
.my-label
{
width
:
100px
;
background
:
#fde2e2
;
}
</
style
>
\ No newline at end of file
src/views/project/rules.js
0 → 100644
View file @
979e03ac
import
{
money
}
from
"
@/utils/myValidate
"
;
//表单验证内容
export
const
expendAdd
=
{
expendMoney
:
[
{
required
:
true
,
validator
:
money
,
trigger
:
"
change
"
}
],
expendTime
:
[
{
required
:
true
,
message
:
"
请选择支出时间
"
,
trigger
:
"
change
"
}
],
expendType
:
[
{
required
:
true
,
message
:
"
请输入支出类别
"
,
trigger
:
"
change
"
}
],
expendObject
:
[
{
required
:
true
,
message
:
"
请输入支出对象
"
,
trigger
:
"
change
"
}
],
expendBody
:
[
{
required
:
true
,
message
:
"
请输入支出用途
"
,
trigger
:
"
change
"
}
],
number
:
[
{
required
:
true
,
message
:
"
请输入发票号码
"
,
trigger
:
"
change
"
}
],
code
:
[{
required
:
true
,
message
:
"
请输入发票代码
"
,
trigger
:
"
change
"
}]
}
export
const
incomeAdd
=
{
projectName
:
[
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
}
],
incomeType
:
[
{
required
:
true
,
message
:
"
请选择收入类型
"
,
trigger
:
"
change
"
}
],
incomeObject
:
[
{
required
:
true
,
message
:
"
没有输入对方户名
"
,
trigger
:
"
change
"
}
],
incomeBody
:
[
{
required
:
true
,
message
:
"
没有输入对收入内容
"
,
trigger
:
"
change
"
}
],
incomeMoney
:
[
{
required
:
true
,
validator
:
money
,
trigger
:
"
change
"
}
],
incomeTime
:
[
{
required
:
true
,
message
:
"
请选择收到时间
"
,
trigger
:
"
change
"
}
]
}
\ No newline at end of file
src/views/reimbursement/finance/financeList.vue
View file @
979e03ac
...
...
@@ -522,7 +522,7 @@
</div>
</el-card>
<div
class=
"box-card"
v-show=
"getshow == 3"
></div>
<div
class=
"box-card"
v-show=
"getshow == 3"
>
<el-empty
description=
"没有附件哦!"
></el-empty>
</div>
</el-drawer>
</div>
</div>
...
...
@@ -698,6 +698,12 @@ export default {
//获取数据
this
.
reimbursementDetails
.
list
=
res
.
data
;
this
.
$message
.
success
(
res
.
msg
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -717,6 +723,12 @@ export default {
//获取数据
this
.
financeList
.
list
=
res
.
data
;
// this.$message.success(res.msg);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -742,6 +754,11 @@ export default {
this
.
total
=
res
.
data
.
total
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -800,6 +817,11 @@ export default {
this
.
getReimbursement
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -846,6 +868,11 @@ export default {
this
.
getReimbursement
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -917,6 +944,11 @@ export default {
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -1043,6 +1075,11 @@ export default {
}
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -1079,6 +1116,12 @@ export default {
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
errror
)
=>
{
...
...
@@ -1108,6 +1151,11 @@ export default {
this
.
Refresh
();
}
else
{
this
.
$message
.
error
(
"
请添加附件,在进行提交
"
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
},
//刷新附件
...
...
@@ -1122,6 +1170,11 @@ export default {
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -1158,6 +1211,12 @@ export default {
deletBystatus
(
data
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoive
(
data
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
});
},
...
...
src/views/reimbursement/headman/headmanList.vue
View file @
979e03ac
...
...
@@ -426,7 +426,7 @@
</div>
</el-card>
<div
class=
"box-card"
v-show=
"getshow == 3"
></div>
<div
class=
"box-card"
v-show=
"getshow == 3"
>
<el-empty
description=
"没有附件哦!"
></el-empty>
</div>
</el-drawer>
</div>
</div>
...
...
@@ -587,6 +587,12 @@ export default {
//获取数据
this
.
reimbursementDetails
.
list
=
res
.
data
;
this
.
$message
.
success
(
res
.
msg
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -602,6 +608,11 @@ export default {
this
.
total
=
res
.
data
.
total
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -634,6 +645,11 @@ export default {
this
.
getReimbursement
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -677,6 +693,11 @@ export default {
this
.
getReimbursement
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -747,6 +768,11 @@ export default {
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -774,6 +800,11 @@ export default {
}
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -811,6 +842,12 @@ export default {
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
errror
)
=>
{
...
...
@@ -840,6 +877,11 @@ export default {
this
.
Refresh
();
}
else
{
this
.
$message
.
error
(
"
请添加附件,在进行提交
"
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
},
//刷新附件
...
...
@@ -854,6 +896,11 @@ export default {
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -890,6 +937,12 @@ export default {
deletBystatus
(
data
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoive
(
data
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
});
},
...
...
src/views/reimbursement/reimbursementAdd.vue
View file @
979e03ac
...
...
@@ -27,13 +27,14 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"发票号码"
prop=
"
from
List"
>
<el-form-item
label=
"发票号码"
prop=
"
invoiceId
List"
>
<el-select
v-model=
"from.
from
List"
v-model=
"from.
invoiceId
List"
multiple
filterable
default-first-option
placeholder=
"请选择"
@
change=
"getmoney()"
>
<el-option
v-for=
"item in getinvoivelist"
...
...
@@ -87,6 +88,7 @@
class=
"upload-demo"
drag
ref=
"enclosureUpload"
:headers=
"fileUploadHeader"
:action=
"action1"
:auto-upload=
"false"
:data=
"enclosurelist"
...
...
@@ -127,19 +129,19 @@
</div>
<div
v-show=
"!subbut"
>
<el-form
:model=
"
reimbursementItemData
"
:model=
"
from
"
:inline=
"true"
label-width=
"150px"
ref=
"details"
>
<el-row
v-for=
"(item, index) in reimbursement
ItemData.l
ist"
v-for=
"(item, index) in
from.
reimbursement
DetailsL
ist"
:key=
"index"
>
<el-col>
<el-form-item
:label=
"item.itemNam
w
e"
:prop=
"'
l
ist.' + index + '.money'"
:label=
"item.itemName"
:prop=
"'
reimbursementDetailsL
ist.' + index + '.money'"
:rules=
"
{
validator: moneyrow,
trigger: 'blur',
...
...
@@ -161,7 +163,6 @@
</el-row>
</el-form>
</div>
</el-col>
</el-row>
</div>
...
...
@@ -171,9 +172,7 @@
import
{
selectAllCompanyId
}
from
"
@/api/reimbursementItem
"
;
import
{
selectAll
as
projectSelectAll
}
from
"
@/api/project
"
;
import
{
insert
}
from
"
@/api/reimbursement
"
;
import
{
Details
}
from
"
@/api/reimbursement
"
;
import
{
queryBypageIncomeAdd
,
selectAllBystatus
}
from
"
@/api/project
"
;
import
{
updatesubmit
}
from
"
@/api/project
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
export
default
{
data
()
{
...
...
@@ -193,9 +192,11 @@ export default {
paymentMethod
:
null
,
//支付方式
reimbursementState
:
0
,
//状态
projectId
:
null
,
//项目id
fromList
:
[],
//发票号码
fromList
:
[],
remarks
:
""
,
//备注
enclosureDescribe
:
""
,
//附件描述
invoiceIdList
:
[],
//发票号码
reimbursementDetailsList
:
[],
//报销项
},
projectList
:
[],
//项目列表
getinvoivelist
:
[],
//可以选择的发票号
...
...
@@ -205,19 +206,21 @@ export default {
list
:
[],
},
reimbursementItemList
:
[],
fileUploadHeader
:
{
"
X-Token
"
:
null
,
},
//表单验证内容
rules
:
{
typeId
:
[
{
required
:
true
,
message
:
"
请选择报销类别
"
,
trigger
:
"
change
"
},
],
from
List
:
[
invoiceId
List
:
[
{
required
:
true
,
message
:
"
请选择发票号码
"
,
trigger
:
"
change
"
},
],
projectId
:
[
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
},
],
number
:
[
invoiceIdList
:
[
{
required
:
true
,
message
:
"
请输入发票号码
"
,
trigger
:
"
change
"
},
],
code
:
[
...
...
@@ -268,68 +271,42 @@ export default {
this
.
from
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
invoicegetQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
action1
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
this
.
fileUploadHeader
[
"
X-Token
"
]
=
this
.
$store
.
getters
.
token
;
this
.
time
();
this
.
getProject
();
this
.
getReimbursement
();
this
.
Selectinsertlsit
();
},
methods
:
{
//上传附件
enclosure
()
{
this
.
drawer1
=
true
;
},
//提交
submitForm
()
{
this
.
$refs
.
form
.
validate
((
valid1
)
=>
{
if
(
valid1
)
{
this
.
$refs
.
details
.
validate
((
valid
)
=>
{
if
(
valid
)
{
let
sumMoney
=
0
;
this
.
from
.
reimbursementDetailsList
.
forEach
((
m
)
=>
{
sumMoney
+=
Number
(
m
.
money
);
});
if
(
sumMoney
!=
this
.
from
.
applyTotalAmountSmall
)
{
this
.
$message
.
error
(
"
报销项总金额要等于报销总金额
"
);
return
;
}
insert
(
this
.
from
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
//上传发票号
let
list
=
[];
this
.
from
.
fromList
.
forEach
((
item
)
=>
{
list
.
push
({
invoiceId
:
item
,
reimbursementId
:
res
.
data
,
status
:
1
,
});
});
updatesubmit
(
list
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
}
else
{
this
.
$message
.
error
(
"
发票绑定失败
"
);
}
});
console
.
log
(
res
);
// 上传附件
this
.
enclosurelist
.
Id
=
res
.
data
;
this
.
enclosurelist
.
companyId
=
this
.
from
.
companyId
;
this
.
enclosurelist
.
enclosureDescribe
=
this
.
from
.
enclosureDescribe
;
this
.
enclosurelist
.
enclosureDescribe
=
this
.
from
.
enclosureDescribe
;
this
.
enclosurelist
.
userId
=
this
.
from
.
userId
;
this
.
$refs
.
enclosureUpload
.
submit
();
// this.$message.success("上传附件成功");
//上传右边的报销项了 ,上传报销项之前,需要处理数据reimbursementId代表着本次提交报销表的id
this
.
reimbursementItemData
.
list
.
forEach
((
item
)
=>
{
item
.
reimbursementId
=
res
.
data
;
//reimbursementId 放到原本data里面
});
Details
(
this
.
reimbursementItemData
.
list
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
// this.$message.success(res.msg);
this
.
back
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
console
.
log
(
error
);
this
.
$message
.
error
(
"
提交失败
"
);
});
}
...
...
@@ -376,6 +353,11 @@ export default {
this
.
projectList
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
...
...
@@ -400,13 +382,13 @@ export default {
reimbursementItemList
.
forEach
((
e
)
=>
{
//设置参数
let
pram
=
{
itemNam
w
e
:
e
.
name
,
itemName
:
e
.
name
,
itemId
:
e
.
id
,
money
:
0
,
reimbursementId
:
null
,
remarks
:
null
,
remarks
:
""
,
};
this
.
reimbursement
ItemData
.
l
ist
.
push
(
pram
);
this
.
from
.
reimbursement
DetailsL
ist
.
push
(
pram
);
});
}
}
else
{
...
...
@@ -463,7 +445,7 @@ export default {
type
:
2
,
userId
:
this
.
$store
.
getters
.
info
.
userId
,
};
// console.log(this.getinvoivelist)
let
list
=
[];
selectAllBystatus
(
param
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
...
...
@@ -478,6 +460,22 @@ export default {
this
.
back
();
});
},
//添加发票金额
getmoney
()
{
console
.
log
(
this
.
from
.
invoiceIdList
)
this
.
from
.
applyTotalAmountSmall
=
0
;
this
.
from
.
invoiceIdList
.
forEach
((
id
)
=>
{
this
.
getinvoivelist
.
forEach
((
e
)
=>
{
if
(
e
.
invoiceId
==
id
)
{
this
.
from
.
applyTotalAmountSmall
+=
e
.
mone
;
}
});
});
if
(
this
.
from
.
fromList
.
length
==
0
)
{
this
.
from
.
applyTotalAmountLarge
=
null
;
}
this
.
convertCurrency
(
this
.
from
.
applyTotalAmountSmall
);
},
//金额小写转大写
convertCurrency
(
money
)
{
//汉字的数字
...
...
@@ -580,14 +578,6 @@ export default {
},
};
</
script
>
<
style
scoped
>
.container
{
padding
:
20px
;
/* min-width : 0 */
}
</
style
>
<
style
scoped
>
.box
{
width
:
100%
;
...
...
@@ -595,13 +585,14 @@ export default {
margin
:
60px
0px
;
padding
:
20px
10px
;
border-radius
:
30px
;
/* white-space: nowrap; */
}
.spend
{
width
:
800px
;
float
:
left
;
margin
:
60px
0px
;
padding
:
20px
10px
;
/* white-space: nowrap; */
}
.container
{
padding
:
20px
;
}
</
style
>
\ No newline at end of file
src/views/reimbursement/reimbursementList copy.vue
0 → 100644
View file @
979e03ac
<
template
>
<div
class=
"container"
>
<!-- 申请报销头部模块 -->
<div>
<el-form
:inline=
"true"
:model=
"reimbursementQurey"
>
<el-form-item
label=
"项目名称"
>
<el-input
v-model=
"reimbursementQurey.projectName"
placeholder=
"项目名称"
></el-input>
</el-form-item>
<el-form-item
label=
"状态"
>
<el-select
v-model=
"reimbursementQurey.reimbursementState"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"query()"
>
查询
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"reset()"
>
重置
</el-button
>
</el-form-item>
<el-form-item>
<el-button
type=
"success"
icon=
"el-icon-circle-plus-outline"
@
click=
"addreimbursement()"
>
申请报销
</el-button
>
</el-form-item>
</el-form>
</div>
<!-- 表格模块 -->
<div
class=
"conter"
>
<el-table
:data=
"reimbursementList"
style=
"width: 100%; text-align: center"
border
>
<el-table-column
type=
"expand"
>
<template
slot-scope=
"props"
>
<div
style=
"padding: 10px"
>
<el-descriptions
title=
"报销详情"
:column=
"5"
border
>
<el-descriptions-item
label=
"支付方式"
:span=
"5"
>
{{
props
.
row
.
paymentMethod
}}
</el-descriptions-item>
<el-descriptions-item
label=
"组长审批状态"
:span=
"2"
>
<el-tag
:type=
"
props.row.reimbursementState == 0
? 'info'
: props.row.reimbursementState == 2
? 'danger'
: 'success'
"
>
{{
props
.
row
.
reimbursementState
==
0
?
"
待审批
"
:
props
.
row
.
reimbursementState
==
2
?
"
驳回
"
:
"
通过
"
}}
</el-tag>
</el-descriptions-item>
<el-descriptions-item
label=
"组长审批时间"
:span=
"3"
>
{{
props
.
row
.
headmanTime
}}
</el-descriptions-item>
<el-descriptions-item
label=
"组长驳回缘由"
:span=
"5"
>
{{
props
.
row
.
headmanRefute
||
"
无
"
}}
</el-descriptions-item>
<el-descriptions-item
label=
"财务审批状态"
:span=
"2"
>
<el-tag
:type=
"
props.row.reimbursementState == 4
? 'danger'
: props.row.reimbursementState == 3
? 'success'
: 'info'
"
>
{{
props
.
row
.
reimbursementState
==
4
?
"
驳回
"
:
props
.
row
.
reimbursementState
==
3
?
"
通过
"
:
"
待审批
"
}}
</el-tag>
</el-descriptions-item>
<el-descriptions-item
label=
"财务审批时间"
:span=
"3"
>
{{
props
.
row
.
financeTime
}}
</el-descriptions-item>
<el-descriptions-item
label=
"财务驳回缘由"
:span=
"5"
>
{{
props
.
row
.
finaceRefute
||
"
无
"
}}
</el-descriptions-item>
<el-descriptions-item
label=
"查看详情"
:span=
"5"
>
<el-button
@
click=
"getdetails(props.row)"
type=
"primary"
style=
"margin: 5px"
size=
"mini"
>
查看详情
</el-button>
</el-descriptions-item>
</el-descriptions>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"序号"
width=
"50px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
(
reimbursementQurey
.
pageNum
-
1
)
*
reimbursementQurey
.
pageSize
+
scope
.
$index
+
1
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"projectName"
label=
"项目"
align=
"center"
/>
<el-table-column
prop=
"applyTotalAmountSmall"
label=
"申报总金额(元)"
align=
"center"
/>
<el-table-column
label=
"核报总金额(元)"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
verifyTotalAmountSmall
||
"
还未核实金额
"
}}
</
template
>
</el-table-column>
<el-table-column
label=
"组长审批人"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
financeName
||
"
暂无
"
}}
</
template
>
</el-table-column>
<el-table-column
label=
"财务审批人"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
financeName
||
"
暂无
"
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"fillingTime"
label=
"报销日期"
align=
"center"
:formatter=
"timestampToTime"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"发票图片"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin: 5px"
type=
"primary"
size=
"mini"
@
click=
"ReviseImage(scope.row)"
>
点击查看
</el-button
>
<el-button
style=
"margin: 5px"
size=
"mini"
icon=
"el-icon-edit"
type=
"info"
@
click=
"getinvoive(scope.row)"
v-if=
"
scope.row.reimbursementState != 3 &&
scope.row.reimbursementState != 1 &&
scope.row.reimbursementState != 2 &&
scope.row.reimbursementState != 4
"
>
修改发票
</el-button
>
</
template
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"附件下载"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"selectImage(scope.row)"
>
点击下载
</el-button
>
</
template
>
</el-table-column>
<el-table-column
prop=
"reimbursementState"
label=
"状态"
align=
"center"
>
<
template
slot-scope=
"props"
>
<el-tag
:type=
"
props.row.reimbursementState == 0 ||
props.row.reimbursementState == 1
? 'info'
: props.row.reimbursementState == 3
? 'success'
: 'danger'
"
>
{{
props
.
row
.
reimbursementState
==
0
?
"
待小组长通过
"
:
props
.
row
.
reimbursementState
==
1
?
"
待财务长通过
"
:
props
.
row
.
reimbursementState
==
2
?
"
小组长驳回
"
:
props
.
row
.
reimbursementState
==
3
?
"
财务长通过
"
:
"
财务长驳回
"
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin: 5px"
size=
"mini"
type=
"info"
@
click=
"withdraw(scope.row)"
v-if=
"scope.row.reimbursementState == 0"
>
撤回
</el-button
>
<el-button
style=
"margin: 5px"
size=
"mini"
icon=
"el-icon-edit"
type=
"info"
@
click=
"updataReimbursement(scope.row)"
v-if=
"
scope.row.reimbursementState != 3 &&
scope.row.reimbursementState != 1 &&
scope.row.reimbursementState != 2 &&
scope.row.reimbursementState != 4
"
>
修改信息
</el-button
>
<el-button
style=
"margin: 5px"
size=
"mini"
type=
"danger"
@
click=
"Resubmit(scope.row)"
v-if=
"
scope.row.reimbursementState == 2 ||
scope.row.reimbursementState == 4
"
>
重新提交
</el-button
>
<div
v-if=
"scope.row.reimbursementState == 3"
style=
"width:100%;text-align: center ; color:#67C23A;"
>
已通过
</div>
<div
v-if=
"scope.row.reimbursementState == 1"
style=
"width:100%;text-align: center ; color:darkgray;"
>
待审批
</div>
</
template
>
</el-table-column>
</el-table>
<!-- 查看详情 -->
<el-drawer
title=
"查看详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"35%"
>
<div
class=
"cd"
>
<el-row
justify=
"center"
align=
"middle"
>
<el-col
v-for=
"(item, index) in reimbursementDetails.list"
:key=
"index"
:span=
"20"
>
<el-descriptions
:title=
"item.name"
border
:column=
"1"
style=
"margin: 10px 0"
>
<el-descriptions-item
label=
"金额"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.money }}元
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.explain }}
</el-descriptions-item
>
<el-descriptions-item
label=
"说明"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.remarks }}
</el-descriptions-item
>
</el-descriptions>
</el-col>
</el-row>
</div>
</el-drawer>
<!-- 发票详情 -->
<el-drawer
title=
"发票详情"
:visible.sync=
"invoiceShow"
:direction=
"direction"
size=
"30%"
>
<el-table
:data=
"getinvoivelist"
style=
"width: 100%; text-align: center"
border
>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"发票详情"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"formatProtocolType(scope.row)"
>
<el-image
style=
"width: 80px; height: 80px"
:src=
"scope.row.fileUrl"
:preview-src-list=
"srcList"
>
</el-image>
</div>
<div
v-else
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看文件
</a
>
</div>
</
template
>
</el-table-column>
</el-table>
</el-drawer>
<!-- 修改发票信息 -->
<el-drawer
title=
"修改发票"
:visible.sync=
"drawer1"
>
<div>
<el-form
:inline=
"true"
:model=
"invoiceQurey"
>
<el-form-item>
<el-button
type=
"success"
icon=
"el-icon-circle-plus-outline"
style=
"margin: 0 15px"
@
click=
"addinvoice()"
>
添加发票号码
</el-button
>
</el-form-item>
</el-form>
</div>
<div>
<el-table
:data=
"invoicelist"
style=
"width: 100%; text-align: center"
border
>
<el-table-column
type=
"index"
label=
"序号"
width=
"40"
></el-table-column>
<el-table-column
prop=
"number"
label=
"发票号码"
width=
"180"
/>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin: 5px"
size=
"mini"
type=
"info"
@
click=
"delinvoice(scope.row)"
:disabled=
"isDisabledDel"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
</div>
</el-drawer>
<!-- 添加发票对话框 -->
<el-dialog
title=
"添加发票"
:visible.sync=
"dialogVisible"
width=
"50%"
>
<el-form
ref=
"form"
:model=
"invoiceQurey"
:inline=
"true"
label-width=
"150px"
>
<el-form-item
prop=
"fromList"
>
<el-select
style=
"width: 500px"
v-model=
"invoiceQurey.fromList"
multiple
filterable
default-first-option
placeholder=
"请选择发票号码"
>
<el-option
v-for=
"item in getinvoivelist"
:key=
"item.invoiceId"
:label=
"item.number"
:value=
"item.invoiceId"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit()"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
<div
class=
"footer"
>
<el-pagination
@
current-change=
"handleCurrentChange"
:current-page.sync=
"reimbursementQurey.pageNum"
:page-size=
"reimbursementQurey.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
></el-pagination>
</div>
<!-- 附件的下载与添加 -->
<div>
<el-drawer
title=
"附件操作"
:visible.sync=
"drawer2"
:direction=
"direction"
size=
"50%"
>
<el-button
type=
"primary"
style=
"margin-left: 5%; margin: 30px 50px"
@
click=
"updatecard"
:disabled=
"isDisabled"
>
添加附件
</el-button
>
<el-card
class=
"box-card"
style=
"width: 90%; margin-left: 5%; margin-top: 20px"
v-show=
"getshow == 1"
>
<el-row
class=
"row-bg"
>
<div
v-for=
"index in queryDTOList"
:key=
"index.enclosureId"
class=
"lsitall"
>
<el-col
:span=
"10"
>
<div
style=
"margin-top: 6px; margin-left: 40px"
>
附件{{ index.enclosureId }}
</div>
</el-col>
<el-col
:span=
"12"
style=
"margin-left: -50px"
>
<el-button
type=
"primary"
icon=
"el-icon-folder-checked"
class=
"a-style"
size=
"mini"
style=
"font-size: 13px"
@
click=
"delProject(index)"
>
下载
</el-button
>
<el-popover
placement=
"top"
width=
"160"
v-model=
"index.visible"
>
<p>
确定要删除此条附件吗
</p>
<div
style=
"text-align: right; margin: 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"index.visible = false"
>
取消
</el-button
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteProject(index)"
>
确定
</el-button
>
</div>
<el-button
type=
"danger"
icon=
"el-icon-delete"
class=
"a-style"
size=
"mini "
style=
"font-size: 13px"
slot=
"reference"
:disabled=
"isDisabled"
>
删除
</el-button
>
</el-popover>
</el-col>
</div>
</el-row>
</el-card>
<!-- 附件上传 -->
<el-card
class=
"box-card"
style=
"width: 90%; margin-left: 5%; margin-top: 20px"
v-show=
"getshow == 0"
>
<div
style=
"width: 60%; margin-left: 30px"
>
<el-input
type=
"textarea"
:rows=
"2"
placeholder=
"请输入附件详情"
v-model=
"proutlist1.enclosureDescribe"
style=
"margin: 20px 0px"
></el-input>
<el-upload
class=
"upload-demo"
ref=
"upload1"
drag
:headers=
"fileUploadHeader"
:action=
"action1"
:file-list=
"fileList1"
:on-remove=
"delfile1"
:auto-upload=
"false"
:on-change=
"onChangepdf"
:on-success=
"Refresh"
:data=
"proutlist1"
multiple
style=
"margin: 20px 0px"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传附件
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div
style=
"margin-left: 75%"
>
<el-button
@
click=
"remove()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"determine()"
style=
"margin-top: 20px"
>
确 定
</el-button
>
</div>
</el-card>
<div
class=
"box-card"
v-show=
"getshow == 3"
></div>
</el-drawer>
</div>
</div>
</template>
<
script
>
import
{
getFileUrl
}
from
"
@/api/companyFile
"
;
import
{
queryBypage
,
resubmit
,
reimbursementId
}
from
"
@/api/reimbursement
"
;
import
{
selectByReimbursementId
}
from
"
@/api/reimbursementDetails
"
;
import
{
selectAllById
,
deletBystatus
,
selectAllBystatus
,
updatesubmit
,
selectByIdF
,
deleteById
,
}
from
"
@/api/project
"
;
export
default
{
data
()
{
return
{
isDisabled
:
false
,
//判断是否显示附件的删除按钮
isDisabledDel
:
false
,
//判断是否禁用删除发票图片按钮
//修改发票表格
invoicelist
:
[],
invoiceQurey
:
{
companyId
:
null
,
reimbursementId
:
null
,
},
options
:
[
{
value
:
"
0
"
,
label
:
"
待小组长通过
"
,
},
{
value
:
"
1
"
,
label
:
"
待财务长通过
"
,
},
{
value
:
"
2
"
,
label
:
"
小组长驳回
"
,
},
{
value
:
"
3
"
,
label
:
"
财务长通过
"
,
},
{
value
:
"
4
"
,
label
:
"
财务长驳回
"
,
},
],
getinvoivelist
:
[],
//可以选择的发票号
dialogVisible
:
false
,
//内容样式
contentStyle
:
{
"
text-align
"
:
"
center
"
,
},
//label样式
labelStyle
:
{
width
:
"
80px
"
},
reimbursementQurey
:
{
userId
:
null
,
pageNum
:
1
,
pageSize
:
10
,
},
total
:
0
,
reimbursementList
:
[],
//抽屉
drawer
:
false
,
drawer1
:
false
,
invoiceShow
:
false
,
direction
:
"
rtl
"
,
reimbursementDetails
:
{
list
:
[],
},
//查询图片给的值
getinvoiveId
:
{
companyId
:
null
,
reimbursementId
:
0
,
},
//附件///-------
drawer
:
false
,
direction
:
"
rtl
"
,
fileList1
:
[],
//合同文件
disabled
:
false
,
//隐藏
getshow
:
1
,
//判断show的显示与隐藏,
//查询附件
queryDTO
:
{
companyId
:
null
,
reimbursementId
:
null
,
},
queryDTOList
:
[],
//收集附件的数据
//附件抽屉
drawer2
:
false
,
//发票对话框
dialogFormVisible
:
false
,
invoiceListAdd
:
[],
//查询发票的集合
getFormslist
:
{
userId
:
null
,
companyId
:
null
,
type
:
0
,
},
//查询的能选择的表单信息
getListincom
:
[],
//收集选择的数组
incomeIdgrt
:
null
,
//收集incomeId数据
getshow
:
1
,
//判断show的显示与隐藏,
//合同文件上传携带参数
proutlist1
:
{
Id
:
null
,
enclosureDescribe
:
""
,
status
:
2
,
//0收入 1支出
companyId
:
null
,
userId
:
null
,
},
fileTypepdf
:
false
,
//判断合同文件是否存在
fileList1
:
[],
//附件文件
disabled
:
false
,
//隐藏
srcList
:
[],
fileUploadHeader
:
{
"
X-Token
"
:
null
,
},
};
},
created
()
{
this
.
getinvoiveId
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
reimbursementQurey
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
invoiceQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
queryDTO
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
action1
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
//保存附件与下载的接口
this
.
fileUploadHeader
[
"
X-Token
"
]
=
this
.
$store
.
getters
.
token
;
this
.
getReimbursement
();
},
methods
:
{
//重置
reset
()
{
this
.
reimbursementQurey
=
{
pageNum
:
1
,
pageSize
:
10
,
userId
:
null
,
};
this
.
reimbursementQurey
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
getReimbursement
();
},
//搜索
query
()
{
this
.
reimbursementQurey
.
pageNum
=
1
;
this
.
getReimbursement
();
},
//图片格式
formatProtocolType
(
row
)
{
//这里判断的是是否有文件
if
(
row
.
filePath
==
null
)
{
return
flase
;
}
else
{
let
fileNamepdf
=
row
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
));
if
(
fileType
!=
"
.pdf
"
)
{
return
true
;
}
else
{
return
false
;
}
}
},
//添加
submit
()
{
this
.
dialogVisible
=
false
;
let
list
=
[];
this
.
invoiceQurey
.
fromList
.
forEach
((
item
)
=>
{
list
.
push
({
invoiceId
:
item
,
reimbursementId
:
this
.
invoiceQurey
.
reimbursementId
,
status
:
1
,
});
});
updatesubmit
(
list
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoive
({
reimbursementId
:
this
.
invoiceQurey
.
reimbursementId
,
});
this
.
$refs
.
form
.
resetFields
();
this
.
$message
.
success
(
res
.
msg
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
"
发票上传失败!
"
);
}
});
},
//查询发票编号
Selectinvoielsit
()
{
let
param
=
{
companyId
:
this
.
$store
.
getters
.
companyId
,
status
:
0
,
type
:
2
,
userId
:
this
.
$store
.
getters
.
info
.
userId
,
};
selectAllBystatus
(
param
)
.
then
(
async
(
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取发票编号失败
"
);
this
.
back
();
});
},
//添加发票号码
addinvoice
()
{
this
.
dialogVisible
=
true
;
this
.
Selectinvoielsit
();
},
//获取发票号列表详情
getinvoive
(
data
)
{
this
.
drawer1
=
true
;
this
.
invoiceQurey
.
reimbursementId
=
data
.
reimbursementId
;
selectAllById
(
this
.
invoiceQurey
).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
success
)
{
this
.
invoicelist
=
res
.
data
;
console
.
log
(
res
.
data
.
length
);
if
(
res
.
data
.
length
<=
1
)
{
this
.
isDisabledDel
=
true
;
}
else
{
this
.
isDisabledDel
=
false
;
}
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
}
});
},
//删除关系
delinvoice
(
data
)
{
this
.
$confirm
(
"
是否同意删除?
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
}).
then
(()
=>
{
deletBystatus
(
data
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoive
(
data
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
});
});
},
//查看详情
getdetails
(
data
)
{
this
.
drawer
=
true
;
let
param
=
{
reimbursementId
:
data
.
reimbursementId
,
};
//接口是一个以对象的形式传值 所以定义了一个对象去拿这个参数
selectByReimbursementId
(
param
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
//获取数据
console
.
log
(
res
);
this
.
reimbursementDetails
.
list
=
res
.
data
;
//接口返回res里面
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
查询失败
"
);
});
},
//申请报销
addreimbursement
()
{
this
.
$router
.
push
({
path
:
"
/reimbursementAdd
"
});
},
//获取申请报销列表
getReimbursement
()
{
queryBypage
(
this
.
reimbursementQurey
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
reimbursementList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
回去数据失败
"
);
});
},
//修改信息
updataReimbursement
(
data
)
{
//data是列表中所有的数据
console
.
log
(
data
);
this
.
$router
.
push
({
path
:
"
/reimbursementUpdata
"
,
//query 找到我们需要的字段
query
:
{
reimbursementId
:
data
.
reimbursementId
,
//传那一行数据的id
projectId
:
data
.
projectId
,
//项目id 下拉框根据项目id选择
typeId
:
data
.
typeId
,
//报销类别id
money
:
data
.
money
,
//备注
applyTotalAmountLarge
:
data
.
applyTotalAmountLarge
,
//大写金额
applyTotalAmountSmall
:
data
.
applyTotalAmountSmall
,
//小写金额
summary
:
data
.
summary
,
//摘要
paymentMethod
:
data
.
paymentMethod
,
//支付方式
},
});
},
//换页
handleCurrentChange
(
val
)
{
this
.
reimbursementQurey
.
pageNum
=
val
;
this
.
getReimbursement
();
},
//时间处理
timestampToTime
(
row
,
column
,
cellValue
)
{
return
cellValue
.
split
(
"
"
)[
0
];
},
//重新提交
Resubmit
(
data
)
{
//重新提交就要让之前的数据回复。
//两个审批人的id、状态、审批时间、驳回缘由、核实金额
//删除记录在重新填,或者删除字段记录
data
.
reimbursementState
=
0
;
//状态
data
.
verifyTotalAmountLarge
=
null
;
//核实金额
data
.
verifyTotalAmountSmall
=
null
;
//核实金额
data
.
headmanRefute
=
null
;
//驳回缘由
data
.
finaceRefute
=
null
;
//驳回缘由
data
.
financeTime
=
null
;
//审批时间
data
.
headmanTime
=
null
;
//审批时间
data
.
financeId
=
null
;
//审批人的id
data
.
headmanId
=
null
;
//审批人的id
resubmit
(
data
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
重新提交成功,等待审批
"
);
this
.
getReimbursement
();
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
重新提交失败
"
);
});
},
//撤回
withdraw
(
data
)
{
this
.
$confirm
(
"
是否同意撤回?
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
}).
then
(()
=>
{
reimbursementId
(
data
.
reimbursementId
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getReimbursement
();
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
});
});
},
//查看图片的方法
ReviseImage
(
row
)
{
// console.log(row)
this
.
invoiceShow
=
true
;
this
.
getinvoiveId
.
reimbursementId
=
row
.
reimbursementId
;
this
.
Selectinsertlsit
();
},
//查询发票图片
Selectinsertlsit
()
{
selectAllById
(
this
.
getinvoiveId
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
this
.
getinvoivelist
.
forEach
((
e
)
=>
{
let
fileNamepdf
=
e
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
)
);
getFileUrl
(
e
.
filePath
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
let
url
=
res
.
data
;
e
.
fileUrl
=
url
;
console
.
log
(
url
);
if
(
fileType
!=
"
.pdf
"
)
{
this
.
srcList
.
push
(
url
);
}
}
});
});
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
}
})
.
catch
((
e
)
=>
{
this
.
$message
.
error
(
"
获取发票图片失败
"
);
this
.
back
();
});
},
//pdf,展示
handlePreView
(
row
)
{
const
photopath
=
row
.
fileUrl
;
window
.
open
(
photopath
,
"
_blank
"
);
},
///----附件区域
//查看项目附件.....
selectImage
(
row
)
{
console
.
log
(
row
);
if
(
row
.
reimbursementState
==
1
||
row
.
reimbursementState
==
3
||
row
.
reimbursementState
==
2
||
row
.
reimbursementState
==
4
)
{
this
.
isDisabled
=
true
;
}
else
{
this
.
isDisabled
=
false
;
}
this
.
queryDTO
.
reimbursementId
=
row
.
reimbursementId
;
this
.
proutlist1
.
Id
=
row
.
reimbursementId
;
selectByIdF
(
this
.
queryDTO
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
if
(
this
.
queryDTOList
.
length
>
0
)
{
this
.
drawer2
=
true
;
this
.
getshow
=
1
;
this
.
disabled
=
false
;
}
else
{
this
.
drawer2
=
true
;
this
.
disabled
=
false
;
this
.
getshow
=
3
;
}
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//下载附件
async
delProject
(
row
)
{
console
.
log
(
row
);
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
(
await
getFileUrl
(
row
.
enclosureFile
)).
data
;
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a
.
target
=
"
_blank
"
;
a
.
style
.
display
=
"
none
"
;
// 障眼法藏起来a标签
document
.
body
.
appendChild
(
a
);
// 将a标签追加到文档对象中
a
.
click
();
// 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a
.
remove
();
// 一次性的,用完就删除a标签
},
//显示添加附件
updatecard
()
{
this
.
getshow
=
0
;
this
.
disabled
=
true
;
this
.
delfile1
();
},
//删除附件
deleteProject
(
row
)
{
// this.submissionFlag = true;
if
(
row
.
reimbursementState
==
1
||
row
.
reimbursementState
==
3
||
row
.
reimbursementState
==
2
||
row
.
reimbursementState
==
4
)
{
this
.
isDisabled
=
true
;
}
else
{
this
.
isDisabled
=
false
;
}
deleteById
(
row
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
selectImage
(
row
);
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
errror
)
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//清除附件文件
delfile1
(
file
)
{
this
.
fileList1
=
this
.
fileList1
.
filter
((
item
)
=>
item
.
uid
!==
file
.
uid
);
this
.
fileTypepdf
=
false
;
},
//确定提交附件
determine
()
{
//判断是否有附件文件
if
(
this
.
fileTypepdf
)
{
this
.
proutlist1
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
proutlist1
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
$refs
.
upload1
.
submit
();
this
.
getshow
=
1
;
//隐藏与显示
this
.
disabled
=
false
;
this
.
$message
({
showClose
:
true
,
message
:
"
上传附件成功
"
,
type
:
"
success
"
,
});
this
.
Refresh
();
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
"
请添加附件,在进行提交
"
);
}
},
//刷新附件
Refresh
()
{
console
.
log
(
this
.
proutlist1
.
Id
);
this
.
queryDTO
.
reimbursementId
=
this
.
proutlist1
.
Id
;
console
.
log
(
this
.
proutlist1
.
Id
);
selectByIdF
(
this
.
queryDTO
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//附件取消
remove
()
{
if
(
this
.
queryDTOList
.
length
>
0
)
{
this
.
getshow
=
1
;
this
.
disabled
=
false
;
this
.
delfile1
();
}
else
{
this
.
getshow
=
3
;
this
.
disabled
=
false
;
this
.
delfile1
();
}
},
//附件文件校验
onChangepdf
(
file
)
{
console
.
log
(
this
.
proutlist1
);
const
fileNamepdf
=
file
.
name
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
));
if
(
fileType
!=
""
)
{
this
.
fileTypepdf
=
true
;
}
else
{
this
.
$message
.
warning
(
"
附件只能只能上传文件
"
);
this
.
$refs
.
upload1
.
clearFiles
();
this
.
fileTypepdf
=
false
;
}
},
},
};
</
script
>
<
style
scoped
>
.container
{
padding
:
10px
;
}
.conter
{
margin-bottom
:
10px
;
}
.footer
{
text-align
:
right
;
}
.lsitall
.el-col
{
margin
:
20px
10px
;
}
.lsitall
.el-button
{
margin-left
:
16px
;
}
.row-bg
{
margin-left
:
15%
;
}
.dialog-footer
{
width
:
90%
;
margin
:
20px
5%
;
}
.lsitall
.el-col
{
margin
:
20px
10px
;
}
.lsitall
.el-button
{
margin-left
:
16px
;
}
.row-bg
{
margin-left
:
15%
;
}
.dialog-footer
{
width
:
90%
;
margin
:
20px
5%
;
}
.cd
{
width
:
90%
;
margin
:
30px
5%
;
}
</
style
>
\ No newline at end of file
src/views/reimbursement/reimbursementList.vue
View file @
979e03ac
...
...
@@ -114,8 +114,8 @@
type=
"primary"
style=
"margin: 5px"
size=
"mini"
>
查看详情
</el-button
>
>
查看详情
</el-button
>
</el-descriptions-item>
</el-descriptions>
</div>
...
...
@@ -166,20 +166,6 @@
@
click=
"ReviseImage(scope.row)"
>
点击查看
</el-button
>
<el-button
style=
"margin: 5px"
size=
"mini"
icon=
"el-icon-edit"
type=
"info"
@
click=
"getinvoive(scope.row)"
v-if=
"
scope.row.reimbursementState != 3 &&
scope.row.reimbursementState != 1 &&
scope.row.reimbursementState != 2 &&
scope.row.reimbursementState != 4
"
>
修改发票
</el-button
>
</
template
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"附件下载"
align=
"center"
>
...
...
@@ -187,7 +173,7 @@
<el-button
type=
"success"
size=
"mini"
@
click=
"
selectImag
e(scope.row)"
@
click=
"
getenclosur
e(scope.row)"
>
点击下载
</el-button
>
</
template
>
...
...
@@ -271,49 +257,9 @@
</
template
>
</el-table-column>
</el-table>
<!-- 查看详情 -->
<el-drawer
title=
"查看详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"35%"
>
<div
class=
"cd"
>
<el-row
justify=
"center"
align=
"middle"
>
<el-col
v-for=
"(item, index) in reimbursementDetails.list"
:key=
"index"
:span=
"20"
>
<el-descriptions
:title=
"item.name"
border
:column=
"1"
style=
"margin: 10px 0"
>
<el-descriptions-item
label=
"金额"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.money }}元
</el-descriptions-item
>
<el-descriptions-item
label=
"备注"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.explain }}
</el-descriptions-item
>
<el-descriptions-item
label=
"说明"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.remarks }}
</el-descriptions-item
>
</el-descriptions>
</el-col>
</el-row>
</div>
</el-drawer>
<!-- 列表中的发票详情,发票信息修改,附件 -->
<div>
<!-- 发票详情 -->
<el-drawer
title=
"发票详情"
...
...
@@ -338,7 +284,8 @@
style=
"width: 80px; height: 80px"
:src=
"scope.row.fileUrl"
:preview-src-list=
"srcList"
></el-image>
>
</el-image>
</div>
<div
v-else
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
...
...
@@ -349,92 +296,50 @@
</el-table-column>
</el-table>
</el-drawer>
<!-- 修改发票信息 -->
<el-drawer
title=
"修改发票"
:visible.sync=
"drawer1"
>
<div>
<el-form
:inline=
"true"
:model=
"invoiceQurey"
>
<el-form-item>
<el-button
type=
"success"
icon=
"el-icon-circle-plus-outline"
style=
"margin: 0 15px"
@
click=
"addinvoice()"
>
添加发票号码
</el-button
<!-- 查看详情 -->
<el-drawer
title=
"查看详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"45%"
>
</el-form-item>
</el-form>
</div>
<div>
<el-table
:data=
"invoicelist"
style=
"width: 100%; text-align: center"
<div
class=
"cd"
>
<el-row
justify=
"center"
align=
"middle"
>
<el-col
v-for=
"(item, index) in reimbursementDetails.list"
:key=
"index"
:span=
"20"
>
<el-descriptions
:title=
"item.name"
border
:column=
"1"
style=
"margin: 10px 0"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"40"
></el-table-column>
<el-table-column
prop=
"number"
label=
"发票号码"
width=
"180"
/>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin: 5px"
size=
"mini"
type=
"info"
@
click=
"delinvoice(scope.row)"
:disabled=
"isDisabledDel"
<el-descriptions-item
label=
"金额"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.money }}元
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.explain }}
</el-descriptions-item
>
删除
</el-button
<el-descriptions-item
label=
"说明"
:contentStyle=
"contentStyle"
:labelStyle=
"labelStyle"
>
{{ item.remarks }}
</el-descriptions-item
>
</
template
>
</el-
table-column
>
</el-
table
>
</
el-descriptions
>
</el-
col
>
</el-
row
>
</div>
</el-drawer>
<!-- 添加发票对话框 -->
<el-dialog
title=
"添加发票"
:visible.sync=
"dialogVisible"
width=
"50%"
>
<el-form
ref=
"form"
:model=
"invoiceQurey"
:inline=
"true"
label-width=
"150px"
>
<el-form-item
prop=
"fromList"
>
<el-select
style=
"width: 500px"
v-model=
"invoiceQurey.fromList"
multiple
filterable
default-first-option
placeholder=
"请选择发票号码"
>
<el-option
v-for=
"item in getinvoivelist"
:key=
"item.invoiceId"
:label=
"item.number"
:value=
"item.invoiceId"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit()"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
<div
class=
"footer"
>
<el-pagination
@
current-change=
"handleCurrentChange"
:current-page.sync=
"reimbursementQurey.pageNum"
:page-size=
"reimbursementQurey.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
></el-pagination>
</div>
<!-- 附件的下载与添加 -->
<div>
<!-- 附件查看 -->
<el-drawer
title=
"附件操作"
:visible.sync=
"drawer2"
...
...
@@ -444,9 +349,10 @@
<el-button
type=
"primary"
style=
"margin-left: 5%; margin: 30px 50px"
@
click=
"
updatecard
"
@
click=
"
addenclosure
"
:disabled=
"isDisabled"
>
添加附件
</el-button
>
添加附件
</el-button
>
<el-card
class=
"box-card"
...
...
@@ -471,7 +377,7 @@
class=
"a-style"
size=
"mini"
style=
"font-size: 13px"
@
click=
"
delProject
(index)"
@
click=
"
loadenclosure
(index)"
>
下载
</el-button
>
<el-popover
placement=
"top"
width=
"160"
v-model=
"index.visible"
>
...
...
@@ -486,7 +392,7 @@
<el-button
type=
"primary"
size=
"mini"
@
click=
"dele
teProject
(index)"
@
click=
"dele
nclosure
(index)"
>
确定
</el-button
>
</div>
...
...
@@ -516,20 +422,21 @@
type=
"textarea"
:rows=
"2"
placeholder=
"请输入附件详情"
v-model=
"
prout
list
1
.enclosureDescribe"
v-model=
"
enclosure
list.enclosureDescribe"
style=
"margin: 20px 0px"
></el-input>
<el-upload
class=
"upload-demo"
ref=
"upload1"
drag
:headers=
"fileUploadHeader"
:action=
"action1"
:file-list=
"fileList1"
:on-remove=
"delfile1"
:auto-upload=
"false"
:on-change=
"onChangepdf"
:on-success=
"Refresh"
:data=
"
prout
list
1
"
:data=
"
enclosure
list"
multiple
style=
"margin: 20px 0px"
>
...
...
@@ -544,7 +451,7 @@
</el-upload>
</div>
<div
style=
"margin-left: 75%"
>
<el-button
@
click=
"
remove
()"
>
取 消
</el-button>
<el-button
@
click=
"
cancel
()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"determine()"
...
...
@@ -553,35 +460,42 @@
>
</div>
</el-card>
<div
class=
"box-card"
v-show=
"getshow == 3"
></div>
<div
class=
"box-card"
v-show=
"getshow == 3"
>
<el-empty
description=
"没有附件哦!"
></el-empty>
</div>
</el-drawer>
</div>
<div
class=
"footer"
>
<el-pagination
@
current-change=
"handleCurrentChange"
:current-page.sync=
"reimbursementQurey.pageNum"
:page-size=
"reimbursementQurey.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
></el-pagination>
</div>
</div>
</template>
<
script
>
import
{
getFileUrl
}
from
"
@/api/companyFile
"
;
import
{
queryBypage
,
resubmit
,
reimbursementId
}
from
"
@/api/reimbursement
"
;
import
{
selectByReimbursementId
}
from
"
@/api/reimbursementDetails
"
;
import
{
queryBypage
,
reimbursementId
,
resubmit
}
from
"
@/api/reimbursement
"
;
import
{
selectAllById
,
deletBystatus
,
selectAllBystatus
,
updatesubmit
,
selectByIdF
,
deleteById
,
}
from
"
@/api/project
"
;
import
{
getFileUrl
}
from
"
@/api/companyFile
"
;
import
{
selectByReimbursementId
}
from
"
@/api/reimbursementDetails
"
;
export
default
{
data
()
{
return
{
isDisabled
:
false
,
//判断是否显示附件的删除按钮
isDisabledDel
:
false
,
//判断是否禁用删除发票图片按钮
//修改发票表格
invoicelist
:
[],
invoiceQurey
:
{
companyId
:
null
,
reimbursementId
:
null
,
//获取列表全部数据所需要的值
reimbursementQurey
:
{
userId
:
null
,
pageNum
:
1
,
pageSize
:
10
,
},
//手动下拉框赋值(搜索)
options
:
[
{
value
:
"
0
"
,
...
...
@@ -604,83 +518,64 @@ export default {
label
:
"
财务长驳回
"
,
},
],
getinvoivelist
:
[],
//可以选择的发票号
dialogVisible
:
false
,
//内容样式
contentStyle
:
{
"
text-align
"
:
"
center
"
,
},
//label样式
labelStyle
:
{
width
:
"
80px
"
},
reimbursementQurey
:
{
userId
:
null
,
pageNum
:
1
,
pageSize
:
10
,
},
reimbursementList
:
[],
//存放列表的数据
total
:
0
,
reimbursementList
:
[],
//抽屉
drawer
:
false
,
drawer1
:
false
,
invoiceShow
:
false
,
direction
:
"
rtl
"
,
reimbursementDetails
:
{
list
:
[],
},
invoiceShow
:
false
,
//发票详情的抽屉
//查询图片给的值
getinvoiveId
:
{
companyId
:
null
,
reimbursementId
:
0
,
},
//附件///-------
drawer
:
false
,
direction
:
"
rtl
"
,
fileList1
:
[],
//合同文件
disabled
:
false
,
//隐藏
getshow
:
1
,
//判断show的显示与隐藏,
direction
:
"
rtl
"
,
//发票详情抽屉打开的方向
getinvoivelist
:
[],
//可以选择的发票号
srcList
:
[],
drawer
:
false
,
//判断是否打开查看详情窗口
reimbursementDetails
:
{
list
:
[],
},
//获取报销项列表
//label样式
labelStyle
:
{
width
:
"
80px
"
},
//内容样式
contentStyle
:
{
"
text-align
"
:
"
center
"
,
},
drawer2
:
false
,
//判断是否打开下载附件
//查询附件
queryDTO
:
{
companyId
:
null
,
reimbursementId
:
null
,
},
queryDTOList
:
[],
//收集附件的数据
//附件抽屉
drawer2
:
false
,
//发票对话框
dialogFormVisible
:
false
,
invoiceListAdd
:
[],
//查询发票的集合
getFormslist
:
{
userId
:
null
,
companyId
:
null
,
type
:
0
,
},
//查询的能选择的表单信息
getListincom
:
[],
//收集选择的数组
incomeIdgrt
:
null
,
//收集incomeId数据
getshow
:
1
,
//判断show的显示与隐藏,
//合同文件上传携带参数
proutlist1
:
{
isDisabled
:
false
,
//判断是否显示附件的删除按钮
//附件上传携带参数
enclosurelist
:
{
Id
:
null
,
enclosureDescribe
:
""
,
status
:
2
,
//0收入 1支出
companyId
:
null
,
userId
:
null
,
},
fileTypepdf
:
false
,
//判断合同文件是否存在
fileList1
:
[],
//附件文件
disabled
:
false
,
//隐藏
srcList
:
[],
fileList1
:
[],
//合同文件
fileTypepdf
:
false
,
//判断附件是否存在
fileUploadHeader
:
{
"
X-Token
"
:
null
,
},
};
},
created
()
{
this
.
getinvoiveId
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
reimbursementQurey
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
invoi
ceQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
get
invoi
veId
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
queryDTO
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
action1
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
//保存附件与下载的接口
this
.
fileUploadHeader
[
"
X-Token
"
]
=
this
.
$store
.
getters
.
token
;
this
.
getReimbursement
();
},
methods
:
{
//申请报销
addreimbursement
()
{
this
.
$router
.
push
({
path
:
"
/reimbursementAdd
"
});
},
//重置
reset
()
{
this
.
reimbursementQurey
=
{
...
...
@@ -693,174 +588,115 @@ export default {
},
//搜索
query
()
{
this
.
reimbursementQurey
.
pageNum
=
1
;
this
.
getReimbursement
();
},
//图片格式
formatProtocolType
(
row
)
{
//这里判断的是是否有文件
if
(
row
.
filePath
==
null
)
{
return
flase
;
}
else
{
let
fileNamepdf
=
row
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
));
if
(
fileType
!=
"
.pdf
"
)
{
return
true
;
}
else
{
return
false
;
}
}
},
//添加
submit
()
{
this
.
dialogVisible
=
false
;
let
list
=
[];
this
.
invoiceQurey
.
fromList
.
forEach
((
item
)
=>
{
list
.
push
({
invoiceId
:
item
,
reimbursementId
:
this
.
invoiceQurey
.
reimbursementId
,
status
:
1
,
});
});
updatesubmit
(
list
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoive
({
reimbursementId
:
this
.
invoiceQurey
.
reimbursementId
,
});
this
.
this
.
$refs
.
form
.
resetFields
();
this
.
$message
.
success
(
res
.
msg
);
}
else
{
this
.
$message
.
error
(
"
发票上传失败!
"
);
}
});
},
//查询发票编号
Selectinvoielsit
()
{
let
param
=
{
companyId
:
this
.
$store
.
getters
.
companyId
,
status
:
0
,
type
:
2
,
userId
:
this
.
$store
.
getters
.
info
.
userId
,
};
selectAllBystatus
(
param
)
//获取申请报销列表
getReimbursement
()
{
queryBypage
(
this
.
reimbursementQurey
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
this
.
reimbursementList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取发票编号失败
"
);
this
.
back
();
this
.
$message
.
error
(
"
回去数据失败
"
);
});
},
//添加发票号码
addinvoice
()
{
this
.
dialogVisible
=
true
;
this
.
Selectinvoielsit
();
//时间处理
timestampToTime
(
row
,
column
,
cellValue
)
{
return
cellValue
.
split
(
"
"
)[
0
];
},
//换页
handleCurrentChange
(
val
)
{
this
.
reimbursementQurey
.
pageNum
=
val
;
this
.
getReimbursement
();
},
//获取发票号列表详情
getinvoive
(
data
)
{
this
.
drawer1
=
true
;
this
.
invoiceQurey
.
reimbursementId
=
data
.
reimbursementId
;
selectAllById
(
this
.
invoiceQurey
).
then
((
res
)
=>
{
console
.
log
(
res
);
//点击查看发票图片
ReviseImage
(
row
)
{
this
.
invoiceShow
=
true
;
this
.
getinvoiveId
.
reimbursementId
=
row
.
reimbursementId
;
this
.
Selectinsertlsit
();
},
//查询发票图片
Selectinsertlsit
()
{
selectAllById
(
this
.
getinvoiveId
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
invoicelist
=
res
.
data
;
console
.
log
(
res
.
data
.
length
);
if
(
res
.
data
.
length
<=
1
)
{
this
.
isDisabledDel
=
true
;
}
else
{
this
.
isDisabledDel
=
false
;
this
.
getinvoivelist
=
res
.
data
;
this
.
getinvoivelist
.
forEach
((
e
)
=>
{
let
Newfilepath
=
e
.
filePath
;
let
filepdf
=
Newfilepath
.
substring
(
Newfilepath
.
lastIndexOf
(
"
.
"
));
getFileUrl
(
e
.
filePath
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
let
url
=
res
.
data
;
e
.
fileUrl
=
url
;
if
(
filepdf
!=
"
.pdf
"
)
{
this
.
srcList
.
push
(
url
);
}
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
},
//删除关系
delinvoice
(
data
)
{
this
.
$confirm
(
"
是否同意删除?
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
}).
then
(()
=>
{
deletBystatus
(
data
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoive
(
data
);
}
});
}
});
},
//查看详情
getdetails
(
data
)
{
this
.
drawer
=
true
;
let
param
=
{
reimbursementId
:
data
.
reimbursementId
,
};
//接口是一个以对象的形式传值 所以定义了一个对象去拿这个参数
selectByReimbursementId
(
param
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
//获取数据
console
.
log
(
res
)
;
this
.
reimbursementDetails
.
list
=
res
.
data
;
//接口返回res里面
//图片样式
formatProtocolType
(
row
)
{
//这里判断的是是否有文件
if
(
row
.
filePath
==
null
)
{
return
flase
;
}
else
{
let
Newfilepath
=
row
.
filePath
;
let
filepdf
=
Newfilepath
.
substring
(
Newfilepath
.
lastIndexOf
(
"
.
"
));
if
(
filepdf
!=
"
.pdf
"
)
{
return
true
;
}
else
{
return
false
;
}
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
查询失败
"
);
});
},
//申请报销
addreimbursement
()
{
this
.
$router
.
push
({
path
:
"
/reimbursementAdd
"
});
//pdf样式,展示
handlePreView
(
row
)
{
const
photopath
=
row
.
fileUrl
;
window
.
open
(
photopath
,
"
_blank
"
);
},
//获取申请报销列表
getReimbursement
()
{
queryBypage
(
this
.
reimbursementQurey
)
.
then
((
res
)
=>
{
//返回添加发票列表
returnlist
()
{
this
.
getinvoive
(
data
);
},
//撤回
withdraw
(
data
)
{
this
.
$confirm
(
"
是否同意撤回?
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
})
.
then
(()
=>
{
reimbursementId
(
data
.
reimbursementId
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
reimbursementList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
this
.
getReimbursement
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
});
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
回去数据失败
"
);
});
},
//修改信息
updataReimbursement
(
data
)
{
//data是列表中所有的数据
console
.
log
(
data
);
this
.
$router
.
push
({
path
:
"
/reimbursementUpdata
"
,
//query 找到我们需要的字段
query
:
{
reimbursementId
:
data
.
reimbursementId
,
//传那一行数据的id
projectId
:
data
.
projectId
,
//项目id 下拉框根据项目id选择
typeId
:
data
.
typeId
,
//报销类别id
money
:
data
.
money
,
//备注
applyTotalAmountLarge
:
data
.
applyTotalAmountLarge
,
//大写金额
applyTotalAmountSmall
:
data
.
applyTotalAmountSmall
,
//小写金额
summary
:
data
.
summary
,
//摘要
paymentMethod
:
data
.
paymentMethod
,
//支付方式
},
this
.
$message
(
"
取消撤回申请
"
);
// this.back();
});
},
//换页
handleCurrentChange
(
val
)
{
this
.
reimbursementQurey
.
pageNum
=
val
;
this
.
getReimbursement
();
},
//时间处理
timestampToTime
(
row
,
column
,
cellValue
)
{
return
cellValue
.
split
(
"
"
)[
0
];
},
//重新提交
Resubmit
(
data
)
{
//重新提交就要让之前的数据回复。
...
...
@@ -881,6 +717,11 @@ export default {
this
.
$message
.
success
(
"
重新提交成功,等待审批
"
);
this
.
getReimbursement
();
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
}
})
...
...
@@ -888,73 +729,37 @@ export default {
this
.
$message
.
error
(
"
重新提交失败
"
);
});
},
//撤回
withdraw
(
data
)
{
this
.
$confirm
(
"
是否同意撤回?
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
}).
then
(()
=>
{
reimbursementId
(
data
.
reimbursementId
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getReimbursement
();
}
});
});
},
//查看图片的方法
ReviseImage
(
row
)
{
// console.log(row)
this
.
invoiceShow
=
true
;
this
.
getinvoiveId
.
reimbursementId
=
row
.
reimbursementId
;
this
.
Selectinsertlsit
();
},
//查询发票图片
Selectinsertlsit
()
{
selectAllById
(
this
.
getinvoiveId
)
//查看报销项详情
getdetails
(
data
)
{
this
.
drawer
=
true
;
let
param
=
{
reimbursementId
:
data
.
reimbursementId
,
};
//接口是一个以对象的形式传值 所以定义了一个对象去拿这个参数
selectByReimbursementId
(
param
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
this
.
getinvoivelist
.
forEach
((
e
)
=>
{
// console.log("------------")
// console.log(e.filePath)
// console.log("------------")
let
fileNamepdf
=
e
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
)
);
getFileUrl
(
e
.
filePath
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
let
url
=
res
.
data
;
e
.
fileUrl
=
url
;
console
.
log
(
url
);
if
(
fileType
!=
"
.pdf
"
)
{
this
.
srcList
.
push
(
url
);
}
}
});
});
this
.
reimbursementDetails
.
list
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
e
)
=>
{
this
.
$message
.
error
(
"
获取发票图片失败
"
);
this
.
back
();
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
查询失败
"
);
});
},
//pdf,展示
handlePreView
(
row
)
{
const
photopath
=
row
.
fileUrl
;
window
.
open
(
photopath
,
"
_blank
"
);
//附件添加
addenclosure
()
{
this
.
getshow
=
0
;
this
.
disabled
=
true
;
this
.
delfile1
();
},
///----附件区域
//查看项目附件.....
selectImage
(
row
)
{
console
.
log
(
row
);
//附件的显示
getenclosure
(
row
)
{
this
.
drawer2
=
true
;
if
(
row
.
reimbursementState
==
1
||
row
.
reimbursementState
==
3
||
...
...
@@ -965,22 +770,25 @@ export default {
}
else
{
this
.
isDisabled
=
false
;
}
this
.
queryDTO
.
reimbursementId
=
row
.
reimbursementId
;
this
.
prout
list
1
.
Id
=
row
.
reimbursementId
;
(
this
.
queryDTO
.
reimbursementId
=
row
.
reimbursementId
),
(
this
.
enclosure
list
.
Id
=
row
.
reimbursementId
)
;
selectByIdF
(
this
.
queryDTO
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
if
(
this
.
queryDTOList
.
length
>
0
)
{
this
.
drawer2
=
true
;
this
.
getshow
=
1
;
this
.
disabled
=
false
;
}
else
{
this
.
drawer2
=
true
;
this
.
disabled
=
false
;
this
.
getshow
=
3
;
}
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
}
})
...
...
@@ -988,27 +796,34 @@ export default {
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//下载附件
async
delProject
(
row
)
{
console
.
log
(
row
);
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
(
await
getFileUrl
(
row
.
enclosureFile
)).
data
;
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a
.
target
=
"
_blank
"
;
a
.
style
.
display
=
"
none
"
;
// 障眼法藏起来a标签
document
.
body
.
appendChild
(
a
);
// 将a标签追加到文档对象中
a
.
click
();
// 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a
.
remove
();
// 一次性的,用完就删除a标签
//清除附件文件
delfile1
(
file
)
{
this
.
fileList1
=
this
.
fileList1
.
filter
((
item
)
=>
item
.
uid
!==
file
.
uid
);
this
.
fileTypepdf
=
false
;
},
//显示添加附件
updatecard
()
{
this
.
getshow
=
0
;
this
.
disabled
=
true
;
this
.
delfile1
();
//附件的刷新
Refresh
()
{
this
.
queryDTO
.
reimbursementId
=
this
.
enclosurelist
.
Id
;
selectByIdF
(
this
.
queryDTO
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
this
.
enclosurelist
.
enclosureDescribe
=
""
;
//初始化数据
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//删除附件
deleteProject
(
row
)
{
// this.submissionFlag = true;
delenclosure
(
row
)
{
if
(
row
.
reimbursementState
==
1
||
row
.
reimbursementState
==
3
||
...
...
@@ -1022,30 +837,43 @@ export default {
deleteById
(
row
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
selectImag
e
(
row
);
this
.
getenclosur
e
(
row
);
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
// console.log(res.msg);
}
else
{
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
err
r
or
)
=>
{
this
.
$message
.
error
(
res
.
msg
);
.
catch
((
error
)
=>
{
this
.
$message
.
success
(
"
删除成功
"
);
});
},
//清除附件文件
delfile1
(
file
)
{
this
.
fileList1
=
this
.
fileList1
.
filter
((
item
)
=>
item
.
uid
!==
file
.
uid
);
this
.
fileTypepdf
=
false
;
//取消附件的添加啊
cancel
()
{
if
(
this
.
queryDTOList
.
length
>
0
)
{
this
.
getshow
=
1
;
this
.
disabled
=
false
;
this
.
delfile1
();
}
else
{
this
.
getshow
=
3
;
this
.
disabled
=
false
;
this
.
delfile1
();
}
},
//确定
提交
附件
//确定
添加
附件
determine
()
{
//判断是否有附件文件
if
(
this
.
fileTypepdf
)
{
this
.
prout
list
1
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
prout
list
1
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
enclosure
list
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
enclosure
list
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
$refs
.
upload1
.
submit
();
this
.
getshow
=
1
;
//隐藏与显示
this
.
disabled
=
false
;
...
...
@@ -1059,39 +887,8 @@ export default {
this
.
$message
.
error
(
"
请添加附件,在进行提交
"
);
}
},
//刷新附件
Refresh
()
{
console
.
log
(
this
.
proutlist1
.
Id
);
this
.
queryDTO
.
reimbursementId
=
this
.
proutlist1
.
Id
;
console
.
log
(
this
.
proutlist1
.
Id
);
selectByIdF
(
this
.
queryDTO
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//附件取消
remove
()
{
if
(
this
.
queryDTOList
.
length
>
0
)
{
this
.
getshow
=
1
;
this
.
disabled
=
false
;
this
.
delfile1
();
}
else
{
this
.
getshow
=
3
;
this
.
disabled
=
false
;
this
.
delfile1
();
}
},
//附件文件校验
//附件文件的校验
onChangepdf
(
file
)
{
console
.
log
(
this
.
proutlist1
);
const
fileNamepdf
=
file
.
name
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
));
if
(
fileType
!=
""
)
{
...
...
@@ -1102,6 +899,37 @@ export default {
this
.
fileTypepdf
=
false
;
}
},
//附件的下载
async
loadenclosure
(
row
)
{
//下载附件
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
(
await
getFileUrl
(
row
.
enclosureFile
)).
data
;
a
.
target
=
"
_blank
"
;
a
.
style
.
display
=
"
none
"
;
// 障眼法藏起来a标签
document
.
body
.
appendChild
(
a
);
// 将a标签追加到文档对象中
a
.
click
();
// 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a
.
remove
();
// 一次性的,用完就删除a标签
},
//修改信息
updataReimbursement
(
data
)
{
//data是列表中所有的数据
console
.
log
(
data
);
this
.
$router
.
push
({
path
:
"
/reimbursementUpdata
"
,
//query 找到我们需要的字段
query
:
{
reimbursementId
:
data
.
reimbursementId
,
//传那一行数据的id
projectId
:
data
.
projectId
,
//项目id 下拉框根据项目id选择
typeId
:
data
.
typeId
,
//报销类别id
money
:
data
.
money
,
//备注
applyTotalAmountLarge
:
data
.
applyTotalAmountLarge
,
//大写金额
applyTotalAmountSmall
:
data
.
applyTotalAmountSmall
,
//小写金额
summary
:
data
.
summary
,
//摘要
paymentMethod
:
data
.
paymentMethod
,
//支付方式
},
});
},
},
};
</
script
>
...
...
@@ -1110,38 +938,49 @@ export default {
.container
{
padding
:
10px
;
}
.conter
{
margin-bottom
:
10px
;
}
.footer
{
text-align
:
right
;
}
.lsitall
.el-col
{
margin
:
20px
10px
;
}
.lsitall
.el-button
{
margin-left
:
16px
;
}
.row-bg
{
margin-left
:
15%
;
}
.dialog-footer
{
width
:
90%
;
margin
:
20px
5%
;
}
.lsitall
.el-col
{
margin
:
20px
10px
;
}
.lsitall
.el-button
{
margin-left
:
16px
;
}
.row-bg
{
margin-left
:
15%
;
}
.dialog-footer
{
width
:
90%
;
margin
:
20px
5%
;
}
.cd
{
width
:
90%
;
margin
:
30px
5%
;
...
...
src/views/reimbursement/reimbursementUpdata.vue
View file @
979e03ac
<
template
>
<div
class=
"container"
>
<div
class=
"box"
>
<el-row
:gutter=
"24"
>
<el-col
:xl=
"12"
:lg=
"12"
:md=
"12"
:sm=
"24"
:xs=
"24"
>
<el-form
ref=
"form"
:model=
"from"
...
...
@@ -29,173 +31,177 @@
<el-input
v-model=
"from.summary"
></el-input>
</el-form-item>
<el-form-item
label=
"报销总金额-大写(元)"
prop=
"applyTotalAmountLarge"
>
<el-input
v-model=
"from.applyTotalAmountLarge"
disabled
></el-input>
<el-form-item
label=
"报销总金额-大写(元)"
prop=
"applyTotalAmountLarge"
>
<el-input
v-model=
"from.applyTotalAmountLarge"
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"报销总金额-小写(元)"
prop=
"applyTotalAmountSmall"
>
<el-input
v-model=
"from.applyTotalAmountSmall"
<el-form-item
label=
"报销总金额-小写(元)"
prop=
"applyTotalAmountSmall"
>
<el-input
v-model=
"from.applyTotalAmountSmall"
@
change=
"convertCurrency(from.applyTotalAmountSmall)"
></el-input>
</el-form-item>
<el-form-item
prop=
"invoiceIdList"
label=
"发票号码"
>
<el-select
v-model=
"from.invoiceIdList"
multiple
required
filterable
default-first-option
placeholder=
"请选择发票号码"
@
change=
"getmoney()"
>
<el-option
v-for=
"item in getinvoivelist"
:key=
"item.invoiceId"
:label=
"item.number"
:value=
"item.invoiceId"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"支付方式"
prop=
"paymentMethod"
>
<el-input
v-model=
"from.paymentMethod"
></el-input>
<el-input
v-model=
"from.paymentMethod"
></el-input>
</el-form-item>
<br
/>
<el-form-item>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"updateForm()"
>
修改
</el-button>
<el-button
type=
"info"
icon=
"el-icon-refresh-left"
@
click=
"resetForm()"
>
重置信息
</el-button>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"updateForm()"
>
修改
</el-button
>
<el-button
type=
"info"
icon=
"el-icon-refresh-left"
@
click=
"resetForm()"
>
重置信息
</el-button
>
<el-button
@
click=
"back()"
>
返回
</el-button>
</el-form-item>
</el-form>
</div>
<div
class=
"spend"
>
</el-col>
<!-- 报销项 -->
<el-col
:xl=
"12"
:lg=
"12"
:md=
"12"
:sm=
"24"
:xs=
"24"
>
<div>
<el-form
:model=
"
reimbursementItemData
"
:model=
"
from
"
:inline=
"true"
ref=
"details"
label-width=
"150px"
>
label-width=
"150px"
>
<el-row
v-for=
"(item, index) in reimbursement
ItemData.l
ist"
v-for=
"(item, index) in
from.
reimbursement
DetailsL
ist"
:key=
"index"
>
<el-col>
<el-form-item
:label=
"item.name"
:prop=
"'list.' + index + '.money'"
:rules=
"
{ validator: moneyrow, trigger: 'blur' ,required: true,}"
:prop=
"'reimbursementDetailsList.' + index + '.money'"
:rules=
"
{
validator: moneyrow,
trigger: 'blur',
required: true,
}"
>
<el-input
v-model=
"item.money"
><i
slot=
"suffix"
style=
"font-style: normal; margin-right: 10px"
>
元
</i
></el-input
>
<el-input
v-model=
"item.money"
><i
slot=
"suffix"
style=
"font-style:normal;margin-right: 10px;"
>
元
</i></el-input>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-input
v-model=
"item.remarks"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form></div>
</el-form>
</div>
</el-col>
</el-row>
</div>
</div>
</
template
>
<
script
>
import
{
selectById
}
from
"
@/api/company
"
;
import
{
selectById
as
reimbursementSelectById
,
update
}
from
"
@/api/reimbursement
"
import
{
money
}
from
"
@/utils/myValidate
"
;
import
{
selectAll
as
projectSelectAll
}
from
"
@/api/project
"
;
import
{
selectById
as
reimbursementSelectById
,
update
,
}
from
"
@/api/reimbursement
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
import
{
selectAll
as
projectSelectAll
,
selectAllById
}
from
"
@/api/project
"
;
import
{
selectByReimbursementId
}
from
"
@/api/reimbursementDetails
"
;
import
{
update
as
detailsUpdate
}
from
"
@/api/reimbursementDetails
"
;
import
{
insertList
,
queryBypageIncomeAdd
,
selectAllBystatus
,
}
from
"
@/api/project
"
;
export
default
{
data
()
{
return
{
reimbursementItemData
:
{
list
:
[],
},
reimbursementItemList
:[],
company
:{},
timeNow
:
null
,
projectList
:[],
typeList
:[],
from
:{
userName
:
null
,
//申报人
userPhone
:
null
,
//联系电话
userId
:
null
,
//申报人Id
officeExpenses
:
0
,
//办公费
printingFee
:
0
,
//版面复印打印费
consultingFee
:
0
,
//咨询费
serviceCharge
:
0
,
//手续费
postage
:
0
,
//邮电费
trafficExpense
:
0
,
//交通费
maintenanceCost
:
0
,
//维修(护)费
rentalFee
:
0
,
//租赁费
conferenceExpenses
:
0
,
//会议费
trainingFee
:
0
,
//培训费
entertainmentExpenses
:
0
,
//招待费
specialMaterialCost
:
0
,
//专用材料费
serviceFee
:
0
,
//劳务费
travelExpenses
:
0
,
//差旅费
other
:
0
,
//其他
entrustedBusinessFee
:
0
,
//委托业务费
summary
:
null
,
//摘要
enclosureNumber
:
0
,
//附件数量
fillingTime
:
null
,
//填报日期
applyTotalAmountLarge
:
null
,
//申请报销总金额(大写)
applyTotalAmountSmall
:
null
,
//申请报销总金额(小写)
paymentMethod
:
null
,
//支付方式
reimbursementState
:
0
,
//状态
projectId
:
null
,
//项目id
typeId
:
null
,
//报销类别id
invoiceId
:
null
,
money
:
""
,
//备注
reimbursementItemList
:
[],
company
:
{},
timeNow
:
null
,
projectList
:
[],
typeList
:
[],
from
:
{
userName
:
null
,
//申报人
userPhone
:
null
,
//联系电话
userId
:
null
,
//申报人Id
summary
:
null
,
//摘要
enclosureNumber
:
0
,
//附件数量
fillingTime
:
null
,
//填报日期
applyTotalAmountLarge
:
null
,
//申请报销总金额(大写)
applyTotalAmountSmall
:
null
,
//申请报销总金额(小写)
paymentMethod
:
null
,
//支付方式
reimbursementState
:
0
,
//状态
projectId
:
null
,
//项目id
typeId
:
null
,
//报销类别id
invoiceId
:
null
,
money
:
""
,
//备注
fromList
:
[],
//发票号码
invoiceIdList
:
[],
//发票号码
reimbursementDetailsList
:
[],
//报销项
},
//发票编号数组
getinvoivelist
:
[],
rules
:{
typeId
:[
{
required
:
true
,
message
:
'
请选择报销类别
'
,
trigger
:
'
change
'
}
invoiceQurey
:
{
companyId
:
null
,
reimbursementId
:
null
,
},
rules
:
{
typeId
:
[
{
required
:
true
,
message
:
"
请选择报销类别
"
,
trigger
:
"
change
"
},
],
projectId
:[
{
required
:
true
,
message
:
'
请选择项目
'
,
trigger
:
'
change
'
}
projectId
:
[
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
}
,
],
applyTotalAmountLarge
:[
{
required
:
true
,
message
:
"
请输入申请报销总金额(大写)
"
,
trigger
:
"
blur
"
},
applyTotalAmountLarge
:
[
{
required
:
true
,
message
:
"
请输入申请报销总金额(大写)
"
,
trigger
:
"
blur
"
,
},
],
applyTotalAmountSmall
:
[
{
validator
:
money
,
trigger
:
"
blur
"
,
required
:
true
},
],
entrustedBusinessFee
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
other
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
travelExpenses
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
serviceFee
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
specialMaterialCost
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
entertainmentExpenses
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
trainingFee
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
conferenceExpenses
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
rentalFee
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
maintenanceCost
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
trafficExpense
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
postage
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
serviceCharge
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
consultingFee
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
printingFee
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
officeExpenses
:[
{
validator
:
money
,
trigger
:
"
blur
"
},
],
}
invoiceIdList
:[
{
required
:
true
,
message
:
"
请选择发票号码
"
,
trigger
:
"
change
"
}
]
},
getlist
:[],
};
},
created
()
{
...
...
@@ -204,12 +210,13 @@ export default {
this
.
from
.
userId
=
this
.
$store
.
getters
.
info
.
userId
;
this
.
from
.
userName
=
this
.
$store
.
getters
.
info
.
userName
;
this
.
from
.
userPhone
=
this
.
$store
.
getters
.
info
.
userPhone
;
this
.
from
.
money
=
this
.
$store
.
getters
.
info
.
money
this
.
getFrom
()
// this.getTypeList()
this
.
getReimbursement
()
this
.
getProject
()
this
.
Selectinsertlsit
()
this
.
from
.
money
=
this
.
$store
.
getters
.
info
.
money
;
this
.
from
.
fromList
=
this
.
$store
.
getters
.
info
.
fromList
;
this
.
getFrom
();
this
.
getReimbursement
();
this
.
getProject
();
this
.
Selectinsertlsit
();
},
computed
:
{
reimbursementId
()
{
...
...
@@ -220,12 +227,12 @@ export default {
//
//获取报销类型显示(相当于详情)
getReimbursement
()
{
selectByReimbursementId
({
reimbursementId
:
this
.
$route
.
query
.
reimbursementId
})
selectByReimbursementId
({
reimbursementId
:
this
.
$route
.
query
.
reimbursementId
,
})
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
//获取数据(把data里的数据放在数组里面)
this
.
reimbursementItemData
.
list
=
res
.
data
//[{name:'办公费用',money:18},{name:'办公费用',money:18}]
this
.
from
.
reimbursementDetailsList
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
...
...
@@ -235,125 +242,150 @@ export default {
});
},
//获取报销信息
getFrom
(){
getFrom
()
{
//接收query传给我们的值
this
.
from
.
reimbursementId
=
this
.
$route
.
query
.
reimbursementId
,
this
.
from
.
projectId
=
this
.
$route
.
query
.
projectId
,
this
.
from
.
typeId
=
this
.
$route
.
query
.
typeId
,
this
.
from
.
applyTotalAmountLarge
=
this
.
$route
.
query
.
applyTotalAmountLarge
,
this
.
from
.
applyTotalAmountSmall
=
this
.
$route
.
query
.
applyTotalAmountSmall
,
this
.
from
.
summary
=
this
.
$route
.
query
.
summary
,
this
.
from
.
paymentMethod
=
this
.
$route
.
query
.
paymentMethod
// this.from.money=this.$route.query.money
this
.
getReimbursement
()
(
this
.
from
.
reimbursementId
=
this
.
$route
.
query
.
reimbursementId
),
(
this
.
from
.
projectId
=
this
.
$route
.
query
.
projectId
),
(
this
.
from
.
typeId
=
this
.
$route
.
query
.
typeId
),
(
this
.
from
.
applyTotalAmountLarge
=
this
.
$route
.
query
.
applyTotalAmountLarge
),
(
this
.
from
.
applyTotalAmountSmall
=
this
.
$route
.
query
.
applyTotalAmountSmall
),
(
this
.
from
.
summary
=
this
.
$route
.
query
.
summary
),
(
this
.
from
.
paymentMethod
=
this
.
$route
.
query
.
paymentMethod
);
this
.
getReimbursement
();
},
//获取个人的项目
getProject
(){
projectSelectAll
({
userId
:
this
.
from
.
userId
}).
then
((
res
)
=>
{
if
(
res
.
success
){
// console.log(res.data)
this
.
projectList
=
res
.
data
}
else
{
this
.
$message
.
error
(
res
.
msg
)
getProject
()
{
projectSelectAll
({
userId
:
this
.
from
.
userId
})
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
projectList
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
}).
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取个人项目失败,无法申请报销
"
)
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取个人项目失败,无法申请报销
"
);
});
},
//获取公司名称
getCompany
()
{
selectById
({
companyId
:
this
.
$store
.
getters
.
companyId
})
.
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
)
{
// console.log(res.data)
this
.
company
=
res
.
data
;
}
else
{
this
.
$message
.
error
(
res
.
data
);
if
(
res
.
code
==
4
)
{
//执行退出功能
this
.
$store
.
dispatch
(
"
user/logout
"
);
this
.
$router
.
push
(
`/login?redirect=
${
this
.
$route
.
fullPath
}
`
);
}
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取公司名称失败
"
);
});
},
//打印
billPrintClick
()
{
const
style
=
"
@page {margin:0 10mm};
"
;
printJS
({
printable
:
"
printBill
"
,
type
:
"
html
"
,
headerStyle
:
"
font-size:22px;text-align: center;
"
,
header
:
this
.
company
.
companyName
+
"
日常报销单
"
,
ignoreElements
:[
'
caption
'
,
'
button
'
],
targetStyles
:
[
"
*
"
],
style
,
//获取发票金额
getmoney
()
{
this
.
from
.
applyTotalAmountSmall
=
0
;
this
.
from
.
invoiceIdList
.
forEach
((
id
)
=>
{
this
.
getinvoivelist
.
forEach
((
e
)
=>
{
if
(
e
.
invoiceId
==
id
)
{
this
.
from
.
applyTotalAmountSmall
+=
e
.
mone
;
}
});
})
if
(
this
.
from
.
invoiceIdList
.
length
==
0
)
{
this
.
from
.
applyTotalAmountLarge
=
null
;
}
this
.
convertCurrency
(
this
.
from
.
applyTotalAmountSmall
);
},
//修改
updateForm
(){
updateForm
()
{
//金额的校验
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
){
//第一次校验左边
this
.
$refs
.
details
.
validate
(
valid2
=>
{
if
(
valid2
){
update
(
this
.
from
).
then
((
res
)
=>
{
if
(
res
.
success
){
detailsUpdate
(
this
.
reimbursementItemData
.
list
).
then
(
res
=>
{
if
(
res
.
success
){
//如果第一个方法成功了,就执行第二个方法(第一个方法修改报销信息,第二个方法修改报销详情信息)
this
.
$message
.
success
(
"
修改成功,等待审批
"
)
this
.
back
()
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
//第一次校验左边
this
.
$refs
.
details
.
validate
((
valid2
)
=>
{
if
(
valid2
)
{
let
sumMoney
=
0
;
this
.
from
.
reimbursementDetailsList
.
forEach
((
m
)
=>
{
sumMoney
+=
Number
(
m
.
money
);
});
if
(
sumMoney
!=
this
.
from
.
applyTotalAmountSmall
)
{
this
.
$message
.
error
(
"
报销项总金额要等于报销总金额
"
);
return
;
}
})
}
else
{
this
.
$message
.
error
(
res
.
msg
)
update
(
this
.
from
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
修改成功,等待审批
"
);
this
.
back
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
}).
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
申请失败
"
)
})
}
else
{
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
申请失败
"
);
});
}
else
{
this
.
$message
.
error
(
"
金额错误
"
);
}
})
});
}
})
})
;
},
//获取现在时间
time
(
data
){
time
(
data
)
{
let
date
=
new
Date
(
data
);
var
Y
=
date
.
getFullYear
()
var
M
=
(
date
.
getMonth
()
+
1
<
10
?
'
0
'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
var
D
=
(
date
.
getDate
()
<
10
?
'
0
'
+
date
.
getDate
()
:
date
.
getDate
())
var
h
=
(
date
.
getHours
()
<
10
?
'
0
'
+
date
.
getHours
()
:
date
.
getHours
())
var
m
=
(
date
.
getMinutes
()
<
10
?
'
0
'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
var
s
=
(
date
.
getSeconds
()
<
10
?
'
0
'
+
date
.
getSeconds
()
:
date
.
getSeconds
())
this
.
timeNow
=
Y
+
'
年
'
+
M
+
'
月
'
+
D
+
'
日
'
var
Y
=
date
.
getFullYear
();
var
M
=
date
.
getMonth
()
+
1
<
10
?
"
0
"
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
;
var
D
=
date
.
getDate
()
<
10
?
"
0
"
+
date
.
getDate
()
:
date
.
getDate
();
var
h
=
date
.
getHours
()
<
10
?
"
0
"
+
date
.
getHours
()
:
date
.
getHours
();
var
m
=
date
.
getMinutes
()
<
10
?
"
0
"
+
date
.
getMinutes
()
:
date
.
getMinutes
();
var
s
=
date
.
getSeconds
()
<
10
?
"
0
"
+
date
.
getSeconds
()
:
date
.
getSeconds
();
this
.
timeNow
=
Y
+
"
年
"
+
M
+
"
月
"
+
D
+
"
日
"
;
},
//返回
back
(){
this
.
$store
.
dispatch
(
'
tagsView/delView
'
,
this
.
$route
)
this
.
$router
.
push
({
path
:
'
/reimbursementList
'
})
back
()
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
)
;
this
.
$router
.
push
({
path
:
"
/reimbursementList
"
})
;
},
//重置信息
resetForm
(){
this
.
getFrom
()
resetForm
()
{
this
.
getFrom
();
this
.
from
.
invoiceIdList
=
this
.
getlist
;
},
//查询发票编号
//查询
未报销的
发票编号
Selectinsertlsit
()
{
let
param
=
{
companyId
:
this
.
$store
.
getters
.
companyId
,
status
:
0
,
type
:
2
,
userId
:
this
.
$store
.
getters
.
info
.
userId
,
userId
:
this
.
$store
.
getters
.
info
.
userId
,
};
console
.
log
(
this
.
$store
.
getters
.
companyId
)
let
list
=
[];
selectAllBystatus
(
param
)
.
then
((
res
)
=>
{
// console.log(res)
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
this
.
getinvoive
({
companyId
:
this
.
$store
.
getters
.
companyId
,
reimbursementId
:
this
.
from
.
reimbursementId
,
});
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
...
...
@@ -364,6 +396,18 @@ export default {
this
.
back
();
});
},
//获取已报销的发票
getinvoive
(
data
)
{
selectAllById
(
data
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
res
.
data
.
forEach
((
e
)
=>
{
this
.
getinvoivelist
.
push
(
e
)
this
.
getlist
.
push
(
e
.
invoiceId
)
this
.
from
.
invoiceIdList
.
push
(
e
.
invoiceId
);
});
}
});
},
//定义金额校验
moneyrow
(
rule
,
value
,
callback
)
{
let
RegExp
=
...
...
@@ -375,6 +419,7 @@ export default {
callback
(
new
Error
(
"
金额格式错误
"
));
}
},
//金额转大小写
convertCurrency
(
money
)
{
//汉字的数字
var
cnNums
=
new
Array
(
...
...
@@ -476,14 +521,10 @@ export default {
},
};
</
script
>
<
style
scoped
>
.container
{
padding
:
20px
;
}
</
style
>
<
style
scoped
>
.clearfloat
:after
{
/*伪元素是行内元素 正常浏览器清除浮动方法*/
content
:
""
;
...
...
@@ -498,14 +539,6 @@ export default {
.show-border
{
border
:
1px
solid
black
;
}
.printTable
{
float
:
left
;
width
:
794px
;
height
:
1123px
;
padding
:
20px
80px
;
box-sizing
:
border-box
;
font-size
:
14px
;
}
.table
{
margin-bottom
:
20px
;
}
...
...
@@ -553,31 +586,23 @@ export default {
text-align
:
center
;
}
.td-input
{
.td-input
{
display
:
inline-block
;
width
:
100%
;
height
:
100%
;
outline
:
none
;
border
:
none
;
}
.input
{
.input
{
outline
:
none
;
border
:
none
;
}
.box
{
width
:
8
00
px
;
.box
{
width
:
1
00
%
;
float
:
left
;
margin
:
60px
0px
;
padding
:
20px
10px
;
/* box-sizing: border-box;
border:1px #000 solid; */
border-radius
:
30px
;
}
.spend
{
width
:
800px
;
float
:
left
;
margin
:
60px
0px
;
padding
:
20px
10px
;
}
</
style
>
\ No newline at end of file
src/views/staff/addStaff.vue
View file @
979e03ac
...
...
@@ -115,7 +115,7 @@ export default {
methods
:
{
getRoles
()
{
selectAllByCompanyId
({
companyId
:
this
.
$store
.
getters
.
companyId
}).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
)
{
if
(
res
.
success
)
{
this
.
rolesList
=
res
.
data
}
else
{
this
.
$message
.
error
(
res
.
data
)
...
...
@@ -135,7 +135,7 @@ export default {
if
(
valida
)
{
//提交
insertStaff
(
this
.
staffData
).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
)
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
添加成功
"
)
this
.
$store
.
dispatch
(
'
tagsView/delView
'
,
this
.
$route
)
this
.
$router
.
push
(
"
/staffList
"
)
...
...
Prev
1
2
3
Next
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