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
2423ec69
Commit
2423ec69
authored
Nov 14, 2022
by
柳 佳乐
Browse files
20221104
parent
344202ed
Changes
39
Hide whitespace changes
Inline
Side-by-side
src/views/companyFile/companyFileList copy.vue
0 → 100644
View file @
2423ec69
<
template
>
<!-- 公司文件列表(查询公司全部的文件信息) -->
<div
class=
"container"
>
<!-- 头部 -->
<div
class=
"header"
>
<el-form
:inline=
"true"
:model=
"companyFileQurey"
>
<el-form-item
label=
"文件名称"
>
<el-input
v-model=
"companyFileQurey.conmpanyFileName"
placeholder=
"文件名称"
></el-input>
</el-form-item>
<!--
<el-form-item
label=
"提交人姓名"
>
<el-input
v-model=
"companyFileQurey.userName"
placeholder=
"提交人姓名"
></el-input>
</el-form-item>
-->
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"querycompanyFile()"
>
查询
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"reset()"
>
重置
</el-button
>
</el-form-item>
</el-form>
</div>
<!-- 中间 -->
<div
class=
"center"
>
<el-table
:data=
"companyFIleList"
style=
"width: 100%"
text-align:
center
border
>
<el-table-column
label=
"序号"
width=
"100px"
align=
"center"
>
<template
slot-scope=
"scope"
>
{{
(
companyFileQurey
.
pageNum
-
1
)
*
companyFileQurey
.
pageSize
+
scope
.
$index
+
1
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"conmpanyFileName"
label=
"文件名称"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"fileRemarks"
label=
"文件备注"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"userName"
label=
"提交人"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"submitTime"
label=
"上传时间"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"操作"
width=
"130px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"download(scope.row)"
>
点击下载
</el-button
>
</
template
>
</el-table-column>
</el-table>
</div>
<!-- 尾部 -->
<div
class=
"footer"
>
<el-pagination
@
current-change=
"handleCurrentChange"
:current-page.sync=
"companyFileQurey.pageNum"
:page-size=
"companyFileQurey.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
>
</el-pagination>
</div>
</div>
</template>
<
script
>
import
{
queryBypage
}
from
"
@/api/companyFile
"
;
export
default
{
data
()
{
return
{
companyFileQurey
:
{
conmpanyFileName
:
null
,
pageNum
:
1
,
pageSize
:
10
,
companyId
:
null
,
},
companyFIleList
:
[],
//公司合同文件表格区域
total
:
0
,
};
},
created
()
{
this
.
companyFileQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
getCompanyFileList
();
},
methods
:
{
//重置
reset
(){
this
.
companyFileQurey
=
{
pageNum
:
1
,
pageSize
:
10
,
companyId
:
null
,
userId
:
null
,
}
this
.
companyFileQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
getCompanyFileList
();
},
//下载
download
(
row
)
{
console
.
log
(
row
);
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
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标签
},
//查询
querycompanyFile
()
{
this
.
companyFileQurey
.
pageNum
=
1
;
this
.
getCompanyFileList
();
},
//分页查询(查询全公司的)
getCompanyFileList
()
{
queryBypage
(
this
.
companyFileQurey
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
companyFIleList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取数据失败
"
);
});
},
//换页
handleCurrentChange
(
val
)
{
this
.
companyFileQurey
.
pageNum
=
val
;
this
.
getCompanyFileList
();
},
},
};
</
script
>
<
style
scoped
>
.container
{
padding
:
10px
;
}
.header
{
padding
:
10px
;
}
.center
{
margin-bottom
:
10px
;
}
.footer
{
text-align
:
right
;
}
</
style
>
\ No newline at end of file
src/views/companyFile/companyFileList.vue
0 → 100644
View file @
2423ec69
<
template
>
<!-- 公司文件列表(查询公司全部的文件信息) -->
<div
class=
"container"
>
<!-- 头部 -->
<div
class=
"header"
>
<el-form
:inline=
"true"
:model=
"companyFileQurey"
>
<el-form-item
label=
"文件名称"
>
<el-input
v-model=
"companyFileQurey.conmpanyFileName"
placeholder=
"文件名称"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"querycompanyFile()"
>
查询
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"reset()"
>
重置
</el-button
>
</el-form-item>
</el-form>
</div>
<!-- 中间 -->
<div
class=
"center"
>
<el-table
:data=
"companyFIleList"
style=
"width: 100%"
text-align:
center
border
>
<el-table-column
label=
"序号"
width=
"100px"
align=
"center"
>
<template
slot-scope=
"scope"
>
{{
(
companyFileQurey
.
pageNum
-
1
)
*
companyFileQurey
.
pageSize
+
scope
.
$index
+
1
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"conmpanyFileName"
label=
"文件名称"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"fileRemarks"
label=
"文件备注"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"userName"
label=
"提交人"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"submitTime"
label=
"上传时间"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"操作"
width=
"130px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"download(scope.row)"
>
点击下载
</el-button
>
</
template
>
</el-table-column>
</el-table>
</div>
<!-- 尾部 -->
<div
class=
"footer"
>
<el-pagination
@
current-change=
"handleCurrentChange"
:current-page.sync=
"companyFileQurey.pageNum"
:page-size=
"companyFileQurey.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
>
</el-pagination>
</div>
<!-- <div >
</div> -->
</div>
</template>
<
script
>
import
{
queryBypage
}
from
"
@/api/companyFile
"
;
export
default
{
data
()
{
return
{
companyFileQurey
:
{
conmpanyFileName
:
null
,
pageNum
:
1
,
pageSize
:
10
,
companyId
:
null
,
},
companyFIleList
:
[],
//公司合同文件表格区域
total
:
0
,
};
},
created
()
{
this
.
companyFileQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
getCompanyFileList
();
},
methods
:
{
//重置
reset
()
{
this
.
companyFileQurey
=
{
pageNum
:
1
,
pageSize
:
10
,
companyId
:
null
,
userId
:
null
,
};
this
.
companyFileQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
getCompanyFileList
();
},
//下载
download
(
row
)
{
console
.
log
(
row
);
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
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标签
},
//查询
querycompanyFile
()
{
this
.
companyFileQurey
.
pageNum
=
1
;
this
.
getCompanyFileList
();
},
//分页查询(查询全公司的)
getCompanyFileList
()
{
queryBypage
(
this
.
companyFileQurey
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
companyFIleList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取数据失败
"
);
});
},
//换页val 当前页的页数
handleCurrentChange
(
val
)
{
this
.
companyFileQurey
.
pageNum
=
val
;
this
.
getCompanyFileList
();
},
},
};
</
script
>
<
style
scoped
>
.el-col
{
border-radius
:
4px
;
}
.bg-purple-dark
{
background
:
#99a9bf
;
}
.bg-purple
{
background
:
#d3dce6
;
}
.bg-purple-light
{
background
:
#e5e9f2
;
}
.grid-content
{
border-radius
:
4px
;
min-height
:
36px
;
}
.container
{
padding
:
10px
;
}
.header
{
padding
:
10px
;
}
.center
{
margin-bottom
:
10px
;
}
.footer
{
text-align
:
right
;
}
</
style
>
\ No newline at end of file
src/views/companyFile/selfFileList.vue
0 → 100644
View file @
2423ec69
<
template
>
<div
class=
"container"
>
<!-- 头部 -->
<div
class=
"header"
>
<el-form
:inline=
"true"
>
<el-form-item
label=
"文件名称"
>
<el-input
v-model=
"selFileQurey.conmpanyFileName"
placeholder=
"文件名称"
></el-input>
</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"
@
click=
"addcompanyFile()"
>
添加
</el-button
>
</el-form-item>
</el-form>
</div>
<!-- 中间区域 -->
<div>
<div
class=
"center"
>
<el-table
:data=
"selFileList"
style=
"width: 100%"
border
>
<el-table-column
label=
"序号"
width=
"100px"
align=
"center"
>
<template
slot-scope=
"scope"
>
{{
(
selFileQurey
.
pageNum
-
1
)
*
selFileQurey
.
pageSize
+
scope
.
$index
+
1
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"conmpanyFileName"
label=
"文件名称"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"fileRemarks"
label=
"文件备注"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"submitTime"
label=
"上传时间"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"prop"
label=
"操作"
width=
"130px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"success"
size=
"mini"
@
click=
"download(scope.row)"
>
点击下载
</el-button
>
</
template
>
</el-table-column>
</el-table>
</div>
<!-- 尾部 -->
<div
class=
"footer"
>
<el-pagination
@
current-change=
"handleCurrentChange"
:current-page.sync=
"selFileQurey.pageNum"
:page-size=
"selFileQurey.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
>
</el-pagination>
</div>
</div>
</div>
</template>
<
script
>
import
{
queryBypageByuserId
}
from
"
@/api/companyFile
"
;
export
default
{
data
()
{
return
{
selFileQurey
:
{
pageNum
:
1
,
pageSize
:
10
,
companyId
:
null
,
userId
:
null
,
},
selFileList
:
[],
total
:
0
,
};
},
created
()
{
this
.
selFileQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
selFileQurey
.
userId
=
this
.
$store
.
getters
.
info
.
userId
;
this
.
getselFileList
();
},
methods
:
{
//分页查询(查询自己的)
getselFileList
()
{
queryBypageByuserId
(
this
.
selFileQurey
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
selFileList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取数据失败
"
);
});
},
//查询
query
()
{
this
.
selFileQurey
.
pageNum
=
1
this
.
getselFileList
();
},
//重置
reset
(){
this
.
selFileQurey
=
{
pageNum
:
1
,
pageSize
:
10
,
companyId
:
null
,
userId
:
null
,
}
this
.
selFileQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
selFileQurey
.
userId
=
this
.
$store
.
getters
.
info
.
userId
;
this
.
getselFileList
();
},
//下载
download
(
row
)
{
console
.
log
(
row
);
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
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标签
},
//换页
handleCurrentChange
(
val
)
{
this
.
selFileQurey
.
pageNum
=
val
;
this
.
getselFileList
();
},
//添加公司文件
addcompanyFile
()
{
this
.
$router
.
push
(
"
/companyFileAdd
"
);
},
},
};
</
script
>
<
style
scoped
>
.container
{
padding
:
10px
;
}
.footer
{
text-align
:
right
;
}
</
style
>
\ No newline at end of file
src/views/expense/expenseList.vue
View file @
2423ec69
...
...
@@ -50,14 +50,20 @@
style=
"margin:1px 5px;"
@
click=
"selectexpend()"
>
查询
</el-button>
<el-button
type=
"info"
icon=
"el-icon-refresh"
@
click=
"upddlist()"
>
重置
</el-button>
<el-button
type=
"info"
icon=
"el-icon-refresh"
@
click=
"upddlist()"
>
刷新
</el-button>
<el-button
type=
"success"
icon=
"el-icon-download"
@
click=
"Reimbursement()"
>
添加发票单
</el-button>
</el-col>
</el-row>
</div>
<!-- 表格区域 -->
<div
class=
"drawer"
v-show=
"isgetid==0"
style=
"margin-left:15px"
>
<el-table
:data=
"invoicegetList.list"
border
style=
"width:99%"
>
<el-table
:data=
"invoicegetList.list"
border
style=
"width:99%"
:cell-style=
"
{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
>
<el-table-column
label=
"序号"
width=
"50"
style
>
<template
slot-scope=
"scope"
>
{{
...
...
@@ -67,8 +73,8 @@
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"number"
label=
"发票号码"
width=
"width"
></el-table-column>
<el-table-column
prop=
"code"
label=
"发票代码"
></el-table-column>
<el-table-column
prop=
"number"
label=
"发票号码"
width=
"width"
></el-table-column>
<el-table-column
prop=
"time"
label=
"发票时间"
></el-table-column>
<el-table-column
prop=
"category"
label=
"发票类型"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -138,11 +144,11 @@
label-width=
"80px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"发票号码"
prop=
"number"
>
<el-input
v-model=
"addTO.number"
oninput=
"value=value.replace(/^\.+|[^\d.]/g,'')"
></el-input>
</el-form-item>
<el-form-item
label=
"发票代码"
prop=
"code"
>
<el-input
v-model=
"addTO.code"
></el-input>
<el-input
v-model=
"addTO.code"
maxlength=
"12"
onkeyup=
"this.value=this.value.replace(/\D|^0/g,'')"
></el-input>
</el-form-item>
<el-form-item
label=
"发票号码"
prop=
"number"
>
<el-input
v-model=
"addTO.number"
maxlength=
"8"
onkeyup=
"this.value=this.value.replace(/\D|^0/g,'')"
></el-input>
</el-form-item>
<el-form-item
label=
"发票时间"
required
prop=
"time"
>
<el-date-picker
...
...
@@ -201,7 +207,7 @@
type=
"primary"
style=
"margin-left:20px;margin-top:40px;"
>
选取文件
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传jpg/png/pdf文件
</div>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传jpg/png/pdf文件
,且不超过500kb
</div>
</el-upload>
</el-col>
</el-row>
...
...
@@ -311,7 +317,14 @@ export default {
trigger
:
"
change
"
}
],
mone
:
[{
required
:
true
,
message
:
"
请输入发票金额
"
,
trigger
:
"
change
"
}]
mone
:
[
{
required
:
true
,
message
:
"
请输入发票金额
"
,
trigger
:
"
change
"
},
{
pattern
:
/
(
^
([
-
]?)[
1-9
]([
0-9
]
+
)?(\.[
0-9
]{1,6})?
$
)
|
(
^
([
-
]?)(
0
){1}
$
)
|
(
^
([
-
]?)[
0-9
]\.[
0-9
]([
0-9
])?
$
)
/
,
message
:
"
输入发票金额不合法
"
,
trigger
:
"
change
"
}
]
},
//查询发票数据
invoiceList
:
{
...
...
src/views/project/beresponsiblefor/beresponsibleforList.vue
View file @
2423ec69
...
...
@@ -4,34 +4,20 @@
<div
class=
"header"
>
<el-form
:inline=
"true"
:model=
"projectQurey"
>
<el-form-item
label=
"项目名称"
>
<el-input
v-model=
"projectQurey.projectName"
placeholder=
"项目名称"
></el-input>
<el-input
v-model=
"projectQurey.projectName"
placeholder=
"项目名称"
></el-input>
</el-form-item>
<el-form-item
label=
"项目编号"
>
<el-input
v-model=
"projectQurey.projectNumber"
placeholder=
"项目编号"
></el-input>
<el-input
v-model=
"projectQurey.projectNumber"
placeholder=
"项目编号"
></el-input>
</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=
"addproject()"
v-show=
"false"
>
添加项目
</el-button
>
>
添加项目
</el-button>
</el-form-item>
</el-form>
</div>
...
...
@@ -41,6 +27,8 @@
:data=
"projectList"
style=
"width: 100%; text-align: center"
border
:cell-style=
"
{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
>
<el-table-column
type=
"expand"
>
<template
slot-scope=
"props"
>
...
...
@@ -58,54 +46,76 @@
<el-table-column
label=
"序号"
width=
"50px"
>
<
template
slot-scope=
"scope"
>
{{
(
projectQurey
.
pageNum
-
1
)
*
projectQurey
.
pageSize
+
scope
.
$index
+
1
(
projectQurey
.
pageNum
-
1
)
*
projectQurey
.
pageSize
+
scope
.
$index
+
1
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"projectName"
label=
"项目名称"
/>
<el-table-column
prop=
"projectNumber"
label=
"项目编号"
/>
<el-table-column
label=
"项目合同金额"
>
<
template
slot-scope=
"scope"
>
<p
class=
"amounttext"
>
{{
scope
.
row
.
projectAmount
}}
</p>
</
template
>
<el-table-column
label=
"项目合同金额"
>
<
template
slot-scope=
"scope"
>
<p
class=
"amounttext"
>
{{
scope
.
row
.
projectAmount
}}
</p>
</
template
>
</el-table-column>
<el-table-column
label=
"项目总收入金额"
align=
"center"
>
<el-table-column
label=
"金额"
>
<
template
slot-scope=
"scope"
>
<el-table-column
label=
"项目总收入金额"
align=
"center"
>
<el-table-column
label=
"金额"
>
<
template
slot-scope=
"scope"
>
<p
class=
"incometext"
>
{{
scope
.
row
.
projectIncome
}}
</p>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"success"
@
click=
"showIncome(scope.row)"
>
查看详情
</el-button>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"success"
@
click=
"showIncome(scope.row)"
>
查看详情
</el-button>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"项目总支出金额"
align=
"center"
>
<el-table-column
label=
"金额"
>
<
template
slot-scope=
"scope"
>
<el-table-column
label=
"金额"
>
<
template
slot-scope=
"scope"
>
<p
class=
"expendtext"
>
{{
scope
.
row
.
projectExpend
}}
</p>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"danger"
@
click=
"showExpend(scope.row)"
>
查看详情
</el-button>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"danger"
@
click=
"showExpend(scope.row)"
>
查看详情
</el-button>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"projectExpense"
label=
"项目总报销金额"
>
<
template
slot-scope=
"scope"
>
<el-table-column
prop=
"projectExpense"
label=
"项目总报销金额"
>
<
template
slot-scope=
"scope"
>
<p
class=
"expendtext"
>
{{
scope
.
row
.
projectExpense
}}
</p>
</
template
>
</el-table-column>
<el-table-column
prop=
"projectStartTime"
label=
"项目开始时间"
align=
"center"
:formatter=
"timestampToTime"
/>
<el-table-column
prop=
"projectEndTime"
label=
"项目结束时间"
align=
"center"
:formatter=
"timestampToTime"
/>
<el-table-column
prop=
"projectStartTime"
label=
"项目开始时间"
align=
"center"
:formatter=
"timestampToTime"
/>
<el-table-column
prop=
"projectEndTime"
label=
"项目结束时间"
align=
"center"
:formatter=
"timestampToTime"
/>
<el-table-column
prop=
"projectAmount"
label=
"操作"
align=
"center"
>
<
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>
<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>
...
...
@@ -118,120 +128,120 @@
:page-size=
"projectQurey.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
>
</el-pagination>
></el-pagination>
</div>
</div>
</template>
<
script
>
import
{
selectBYPression
}
from
'
@/api/project
'
import
{
selectBYPression
}
from
"
@/api/project
"
;
export
default
{
data
(){
return
{
projectQurey
:{
projectName
:
null
,
projectNumber
:
null
,
data
()
{
return
{
projectQurey
:
{
projectName
:
null
,
projectNumber
:
null
,
pageNum
:
1
,
pageSize
:
10
,
userId
:
null
,
memberPression
:
0
userId
:
null
,
memberPression
:
0
},
projectList
:[],
total
:
null
,
}
projectList
:
[],
total
:
null
}
;
},
created
(){
this
.
projectQurey
.
userId
=
this
.
$store
.
getters
.
urId
created
()
{
this
.
projectQurey
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
getProjectList
();
},
methods
:{
methods
:
{
//获取项目列表
getProjectList
(){
selectBYPression
(
this
.
projectQurey
).
then
((
res
)
=>
{
if
(
res
.
success
){
//请求成功,获取到了数据
this
.
projectList
=
res
.
data
.
list
this
.
total
=
res
.
data
.
total
}
else
{
this
.
$message
.
error
(
res
.
msg
)
}
}).
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取数据失败
"
)
})
getProjectList
()
{
selectBYPression
(
this
.
projectQurey
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
//请求成功,获取到了数据
this
.
projectList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取数据失败
"
);
});
},
//查询
qurey
(){
this
.
projectQurey
.
pageNum
=
1
this
.
getProjectList
()
qurey
()
{
this
.
projectQurey
.
pageNum
=
1
;
this
.
getProjectList
()
;
},
//重置
reset
(){
reset
()
{
this
.
projectQurey
=
{
projectName
:
null
,
projectNumber
:
null
,
projectName
:
null
,
projectNumber
:
null
,
pageNum
:
1
,
pageSize
:
10
,
userId
:
null
,
memberPression
:
0
}
this
.
projectQurey
.
userId
=
this
.
$store
.
getters
.
urId
this
.
getProjectList
()
userId
:
null
,
memberPression
:
0
}
;
this
.
projectQurey
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
getProjectList
()
;
},
//添加项目
addproject
(){
this
.
$router
.
push
(
'
/projectAdd
'
)
addproject
()
{
this
.
$router
.
push
(
"
/projectAdd
"
);
},
//分页
handleCurrentChange
(
val
){
this
.
projectQurey
.
pageNum
=
val
this
.
getProjectList
()
handleCurrentChange
(
val
)
{
this
.
projectQurey
.
pageNum
=
val
;
this
.
getProjectList
()
;
},
//修改项目
updataProject
(
data
){
updataProject
(
data
)
{
this
.
$router
.
push
({
path
:
'
/projectUpdata
'
,
query
:{
id
:
data
.
projectId
,
path
:
"
/projectUpdata
"
,
query
:
{
id
:
data
.
projectId
}
})
})
;
},
//时间处理
timestampToTime
(
row
,
column
,
cellValue
)
{
return
cellValue
.
split
(
'
'
)[
0
]
timestampToTime
(
row
,
column
,
cellValue
)
{
return
cellValue
.
split
(
"
"
)[
0
]
;
},
//查看收入详情列表
showIncome
(
data
){
showIncome
(
data
)
{
this
.
$router
.
push
({
path
:
'
/incomeList
'
,
query
:{
id
:
data
.
projectId
,
backid
:
1
path
:
"
/incomeList
"
,
query
:
{
id
:
data
.
projectId
,
backid
:
1
}
})
})
;
},
//成员管理
member
(
data
){
this
.
$store
.
dispatch
(
"
settings/setMemberId
"
,
1
)
member
(
data
)
{
this
.
$store
.
dispatch
(
"
settings/setMemberId
"
,
1
)
;
this
.
$router
.
push
({
path
:
'
/memberList
'
,
query
:{
id
:
data
.
projectId
,
path
:
"
/memberList
"
,
query
:
{
id
:
data
.
projectId
}
})
})
;
},
//查看支出详情列表
showExpend
(
data
){
showExpend
(
data
)
{
this
.
$router
.
push
({
path
:
'
/expendList
'
,
query
:{
id
:
data
.
projectId
,
backlistid
:
1
path
:
"
/expendList
"
,
query
:
{
id
:
data
.
projectId
,
backlistid
:
1
}
})
})
;
}
}
};
...
...
@@ -247,18 +257,18 @@ export default {
.footer
{
text-align
:
right
;
}
.incometext
{
.incometext
{
color
:
#13ce66
;
font-weight
:
600
;
font-size
:
15px
;
}
.amounttext
{
.amounttext
{
color
:
#1890ff
;
font-weight
:
600
;
font-size
:
15px
;
}
.expendtext
{
.expendtext
{
color
:
rgb
(
255
,
0
,
0
);
font-weight
:
600
;
font-size
:
15px
;
...
...
src/views/project/expend/expendAdd.vue
View file @
2423ec69
...
...
@@ -127,12 +127,13 @@
<
script
>
import
{
selectByProjectId
,
insertList
,
queryBypageIncomeAdd
,
selectAllBystatus
,
updatesubmit
}
from
"
@/api/project
"
;
import
{
selectAll
}
from
"
@/api/type
"
;
import
{
insert
}
from
"
@/api/expend
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
export
default
{
data
()
{
return
{
...
...
@@ -152,31 +153,25 @@ export default {
},
typeList
:
[],
projectData
:
{},
rules
:
{
projectName
:
[
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
}
],
expendType
:
[
{
required
:
true
,
message
:
"
请选择支出类型
"
,
trigger
:
"
change
"
}
],
expendMoney
:
[
{
required
:
true
,
message
:
"
请输入支出金额
"
,
trigger
:
"
blur
"
}
],
expendTime
:
[
{
required
:
true
,
message
:
"
请选择支出时间
"
,
trigger
:
"
change
"
}
]
},
companyId
:
0
,
typeList
:
[],
projectData
:
{},
//表单验证内容
rules
:
{
expendMoney
:
[
{
required
:
true
,
message
:
"
请输入支出金额
"
,
trigger
:
"
blur
"
},
{
pattern
:
/
(
^
([
-
]?)[
1-9
]([
0-9
]
+
)?(\.[
0-9
]{1,6})?
$
)
|
(
^
([
-
]?)(
0
){1}
$
)
|
(
^
([
-
]?)[
0-9
]\.[
0-9
]([
0-9
])?
$
)
/
,
message
:
"
输入支出金额不合法
"
,
trigger
:
"
change
"
}
],
expendTime
:
[
{
required
:
true
,
message
:
"
请选择支出时间
"
,
trigger
:
"
change
"
}
],
expendType
:
[
{
required
:
true
,
message
:
"
请输入支出类别
"
,
trigger
:
"
change
"
}
],
expendMoney
:
[
{
required
:
true
,
validator
:
money
,
trigger
:
"
blur
"
}
],
expendObject
:
[
{
required
:
true
,
message
:
"
请输入支出对象
"
,
trigger
:
"
change
"
}
],
...
...
src/views/project/expend/expendList.vue
View file @
2423ec69
...
...
@@ -45,7 +45,13 @@
</div>
<div
class=
"conter"
>
<el-table
:data=
"expendList"
style=
"width: 100%; text-align: center"
border
>
<el-table
:data=
"expendList"
style=
"width: 100%; text-align: center"
border
:cell-style=
"
{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
>
<el-table-column
label=
"序号"
width=
"50px"
>
<template
slot-scope=
"scope"
>
{{
...
...
@@ -85,7 +91,7 @@
<el-tag
effect=
"plain"
>
{{
scope
.
row
.
userName
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
prop=
"projectAmount"
label=
"操作"
v-if=
"state != 0"
>
<el-table-column
prop=
"projectAmount"
label=
"操作"
v-if=
"state != 0"
width=
"120px"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin: 5px"
...
...
@@ -217,11 +223,15 @@
<el-table-column
prop=
"mone"
label=
"金额"
width=
"180"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"查看PDF文件或图片"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.filePath != null"
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看图片或文件
</a>
<div
v-if=
"formatProtocolType(scope.row)"
>
<el-image
style=
"width: 100px; height: 100px"
:src=
"getimagin(scope.row)"
:preview-src-list=
"srcList"
></el-image>
</div>
<div
v-else
>
<
p>
无图片或
文件
</
p
>
<
a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看
文件
</
a
>
</div>
</
template
>
</el-table-column>
...
...
@@ -458,8 +468,7 @@ export default {
delProject
(
row
)
{
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
process
.
env
.
VUE_APP_BASE_API
+
row
.
enclosureFile
;
// 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a
.
target
=
"
_blank
"
a
.
download
=
row
.
enclosureFile
;
//设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a
.
style
.
display
=
"
none
"
;
// 障眼法藏起来a标签
document
.
body
.
appendChild
(
a
);
// 将a标签追加到文档对象中
a
.
click
();
// 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
...
...
@@ -485,28 +494,32 @@ export default {
this
.
drawer
=
true
;
this
.
getinvoiveId
.
expendId
=
row
.
expendId
;
this
.
incomeIdgrt
=
row
.
expendId
;
//console.log(process.env.VUE_APP_BASE_API);
this
.
Selectinsertlsit
();
},
//查询发票图片
Selectinsertlsit
()
{
console
.
log
(
selectAllById
(
this
.
getinvoiveId
));
selectAllById
(
this
.
getinvoiveId
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
// this.getinvoivelist.forEach(e => {
// e.filePath = process.env.VUE_APP_BASE_API + e.filePath;
// });
console
.
log
(
this
.
getinvoivelist
);
this
.
srcList
=
[];
res
.
data
.
forEach
(
e
=>
{
let
fileNamepdf
=
e
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
)
);
if
(
fileType
!=
"
.pdf
"
)
{
this
.
srcList
.
push
(
process
.
env
.
VUE_APP_BASE_API
+
e
.
filePath
);
}
});
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
//
this.back();
}
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取发票图片失败
"
);
this
.
back
();
//
this.back();
});
},
back
()
{
...
...
@@ -536,12 +549,10 @@ export default {
//点击查看发票
handlePreView
(
row
)
{
const
photopath
=
process
.
env
.
VUE_APP_BASE_API
+
row
.
filePath
;
console
.
log
(
photopath
);
window
.
open
(
photopath
,
"
_blank
"
);
},
//查看项目附件.....
selectImage
(
row
)
{
console
.
log
(
row
);
this
.
queryDTO
.
expendId
=
row
.
expendId
;
this
.
proutlist1
.
Id
=
row
.
expendId
;
selectByIdF
(
this
.
queryDTO
)
...
...
@@ -589,7 +600,6 @@ export default {
this
.
dialogFormVisible
=
false
;
},
Buttonback2
()
{
console
.
log
(
this
.
getListincom
);
let
list
=
[];
//提交发票与收入关系 status默认为1 表示发票已报销
this
.
getListincom
.
forEach
(
item
=>
{
...
...
@@ -599,7 +609,6 @@ export default {
status
:
1
});
});
console
.
log
(
list
);
updatesubmit
(
list
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
...
...
@@ -618,13 +627,11 @@ export default {
},
//删除发票
DeleteFrom
(
row
)
{
console
.
log
(
row
);
//收集被删除发票的数据
let
BillList
=
{
invoiceId
:
row
.
invoiceId
,
expendId
:
row
.
expendId
};
console
.
log
(
BillList
);
deletBystatus
(
BillList
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
...
...
@@ -634,13 +641,30 @@ export default {
type
:
"
success
"
});
this
.
Selectinsertlsit
();
console
.
log
(
res
.
msg
);
}
})
.
catch
(
errror
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//图片格式
formatProtocolType
(
row
)
{
//这里判断的是是否有文件
if
(
row
.
filePath
==
null
)
{
return
false
;
}
else
{
let
fileNamepdf
=
row
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
));
if
(
fileType
!=
"
.pdf
"
)
{
return
true
;
}
else
{
return
false
;
}
}
},
getimagin
(
row
)
{
return
process
.
env
.
VUE_APP_BASE_API
+
row
.
filePath
;
},
// 附件-------0-----------
//显示添加附件
...
...
@@ -660,7 +684,6 @@ export default {
type
:
"
success
"
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
})
.
catch
(
errror
=>
{
...
...
@@ -676,7 +699,6 @@ export default {
determine
()
{
//判断是否有附件文件
if
(
this
.
fileTypepdf
)
{
this
.
$refs
.
upload1
.
submit
();
this
.
getshow
=
1
;
this
.
disabled
=
false
;
...
...
@@ -693,12 +715,11 @@ export default {
//刷新附件
Refresh
()
{
this
.
queryDTO
.
expendId
=
this
.
proutlist1
.
Id
;
console
.
log
(
this
.
proutlist1
.
Id
);
selectByIdF
(
this
.
queryDTO
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
this
.
proutlist1
.
enclosureDescribe
=
""
//初始化数据
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
...
...
@@ -733,7 +754,6 @@ export default {
},
//附件文件校验
onChangepdf
(
file
)
{
console
.
log
(
this
.
proutlist1
);
const
fileNamepdf
=
file
.
name
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
));
if
(
fileType
!=
""
)
{
...
...
src/views/project/income/incomeAdd.vue
View file @
2423ec69
...
...
@@ -125,7 +125,7 @@ import {
}
from
"
@/api/project
"
;
import
{
selectAll
}
from
"
@/api/type
"
;
import
{
insert
}
from
"
@/api/imcome
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
export
default
{
data
()
{
return
{
...
...
@@ -163,7 +163,12 @@ export default {
{
required
:
true
,
message
:
"
没有输入收入详情
"
,
trigger
:
"
change
"
}
],
incomeMoney
:
[
{
required
:
true
,
validator
:
money
,
trigger
:
"
blur
"
}
{
required
:
true
,
message
:
"
请输入收入金额
"
,
trigger
:
"
blur
"
},
{
pattern
:
/
(
^
([
-
]?)[
1-9
]([
0-9
]
+
)?(\.[
0-9
]{1,6})?
$
)
|
(
^
([
-
]?)(
0
){1}
$
)
|
(
^
([
-
]?)[
0-9
]\.[
0-9
]([
0-9
])?
$
)
/
,
message
:
"
输入收入金额不合法
"
,
trigger
:
"
change
"
}
],
incomeTime
:
[
{
required
:
true
,
message
:
"
请选择收到时间
"
,
trigger
:
"
change
"
}
...
...
src/views/project/income/incomeList.vue
View file @
2423ec69
...
...
@@ -43,7 +43,13 @@
</div>
<div
class=
"conter"
>
<el-table
:data=
"incomeList"
style=
"width: 100%; text-align: center"
border
>
<el-table
:data=
"incomeList"
style=
"width: 100%; text-align: center"
border
: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"
>
...
...
@@ -130,17 +136,23 @@
:data=
"getinvoivelist"
style=
"width: 94%; margin:10px 3%; text-align: center"
border
:cell-style=
"{'text-align':'center'}"
:header-cell-style=
"{'text-align':'center'}"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"
4
0px"
></el-table-column>
<el-table-column
type=
"index"
label=
"序号"
width=
"
8
0px"
></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文件或图片"
>
<el-table-column
prop=
"prop"
label=
"查看PDF文件或图片"
width=
"180px"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.filePath != null"
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看图片或文件
</a>
<div
v-if=
"formatProtocolType(scope.row)"
>
<el-image
style=
"width: 100px; height: 100px"
:src=
"getimagin(scope.row)"
:preview-src-list=
"srcList"
></el-image>
</div>
<div
v-else
>
<
p>
无图片或
文件
</
p
>
<
a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看
文件
</
a
>
</div>
</
template
>
</el-table-column>
...
...
@@ -374,7 +386,7 @@ export default {
},
fileTypepdf
:
false
,
//判断合同文件是否存在
fileList1
:
[],
//合同文件
disabled
:
false
//隐藏
disabled
:
false
//隐藏
,
};
},
computed
:
{
...
...
@@ -528,12 +540,11 @@ export default {
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//查看
图片
的方法
//查看
pdf
的方法
ReviseImage
(
row
)
{
this
.
drawer
=
true
;
this
.
getinvoiveId
.
incomeId
=
row
.
incomeId
;
this
.
incomeIdgrt
=
row
.
incomeId
;
//console.log(process.env.VUE_APP_BASE_API);
this
.
Selectinsertlsit
();
},
//查询发票图片
...
...
@@ -542,7 +553,16 @@ export default {
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
console
.
log
(
this
.
getinvoivelist
);
this
.
srcList
=
[];
res
.
data
.
forEach
(
e
=>
{
let
fileNamepdf
=
e
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
)
);
if
(
fileType
==
"
.jpg
"
)
{
this
.
srcList
.
push
(
process
.
env
.
VUE_APP_BASE_API
+
e
.
filePath
);
}
});
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
...
...
@@ -600,7 +620,7 @@ export default {
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
process
.
env
.
VUE_APP_BASE_API
+
row
.
enclosureFile
;
// 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a
.
target
=
"
_blank
"
a
.
target
=
"
_blank
"
;
a
.
style
.
display
=
"
none
"
;
// 障眼法藏起来a标签
document
.
body
.
appendChild
(
a
);
// 将a标签追加到文档对象中
a
.
click
();
// 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
...
...
@@ -629,10 +649,8 @@ export default {
this
.
selectGet
();
this
.
dialogFormVisible
=
false
;
this
.
getListincom
=
[];
console
.
log
();
},
Buttonback2
()
{
console
.
log
(
this
.
getListincom
);
let
list
=
[];
//提交发票与收入关系 status默认为1 表示发票已报销
this
.
getListincom
.
forEach
(
item
=>
{
...
...
@@ -642,7 +660,7 @@ export default {
status
:
1
});
});
console
.
log
(
list
);
updatesubmit
(
list
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
msg
);
...
...
@@ -662,13 +680,11 @@ export default {
},
//删除发票
DeleteFrom
(
row
)
{
console
.
log
(
row
);
//收集被删除发票的数据
let
BillList
=
{
invoiceId
:
row
.
invoiceId
,
incomeId
:
row
.
incomeId
};
console
.
log
(
BillList
);
deletBystatus
(
BillList
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
...
...
@@ -678,7 +694,6 @@ export default {
type
:
"
success
"
});
this
.
Selectinsertlsit
();
console
.
log
(
res
.
msg
);
}
})
.
catch
(
errror
=>
{
...
...
@@ -704,7 +719,6 @@ export default {
type
:
"
success
"
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
})
.
catch
(
errror
=>
{
...
...
@@ -714,6 +728,7 @@ export default {
//清除附件文件
delfile1
(
file
)
{
this
.
fileList1
=
this
.
fileList1
.
filter
(
item
=>
item
.
uid
!==
file
.
uid
);
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
this
.
fileTypepdf
=
false
;
},
//确定提交附件
...
...
@@ -725,7 +740,7 @@ export default {
this
.
$refs
.
upload1
.
submit
();
this
.
getshow
=
1
;
//隐藏与显示
this
.
disabled
=
false
;
//this.backii();
//this.backii();
this
.
$message
({
showClose
:
true
,
message
:
"
上传附件成功
"
,
...
...
@@ -738,14 +753,13 @@ export default {
},
//刷新附件
Refresh
()
{
console
.
log
(
this
.
proutlist1
.
Id
);
this
.
queryDTO
.
incomeId
=
this
.
proutlist1
.
Id
;
console
.
log
(
this
.
proutlist1
.
Id
);
selectByIdF
(
this
.
queryDTO
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
queryDTOList
=
res
.
data
;
this
.
proutlist1
.
enclosureDescribe
=
""
//初始化数据
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
...
...
@@ -759,18 +773,15 @@ export default {
if
(
this
.
queryDTOList
.
length
>
0
)
{
this
.
getshow
=
1
;
this
.
disabled
=
false
;
this
.
backii
();
this
.
delfile1
();
}
else
{
this
.
getshow
=
3
;
this
.
disabled
=
false
;
this
.
backii
();
this
.
delfile1
();
}
},
//附件文件校验
onChangepdf
(
file
)
{
console
.
log
(
this
.
proutlist1
);
const
fileNamepdf
=
file
.
name
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
));
if
(
fileType
!=
""
)
{
...
...
@@ -780,7 +791,25 @@ export default {
this
.
$refs
.
upload1
.
clearFiles
();
this
.
fileTypepdf
=
false
;
}
}
},
//图片格式
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
;
}
}
},
getimagin
(
row
)
{
return
process
.
env
.
VUE_APP_BASE_API
+
row
.
filePath
;
},
}
};
</
script
>
...
...
src/views/project/participatein/participateinList.vue
View file @
2423ec69
...
...
@@ -17,7 +17,13 @@
</div>
<div
class=
"conter"
>
<el-table
:data=
"projectList"
style=
"width: 100%; text-align: center"
border
>
<el-table
:data=
"projectList"
style=
"width: 100%; text-align: center"
border
: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"
>
...
...
@@ -75,7 +81,7 @@
<template slot-scope="scope">
<p class="expendtext">{{scope.row.projectExpense}}</p>
</template>
</el-table-column>
-->
</el-table-column>-->
<el-table-column
prop=
"projectStartTime"
label=
"项目开始时间"
...
...
@@ -115,7 +121,7 @@ export default {
pageNum
:
1
,
pageSize
:
10
,
userId
:
null
,
memberPression
:
1
memberPression
:
1
},
projectList
:
[],
total
:
null
...
...
@@ -155,7 +161,7 @@ export default {
pageNum
:
1
,
pageSize
:
10
,
userId
:
null
,
memberPression
:
1
memberPression
:
1
};
this
.
projectQurey
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
getProjectList
();
...
...
@@ -188,7 +194,7 @@ export default {
path
:
"
/incomeList
"
,
query
:
{
id
:
data
.
projectId
,
state
:
0
state
:
0
}
});
},
...
...
@@ -207,7 +213,7 @@ export default {
path
:
"
/expendList
"
,
query
:
{
id
:
data
.
projectId
,
state
:
0
state
:
0
}
});
}
...
...
src/views/project/projectAdd.vue
View file @
2423ec69
...
...
@@ -139,6 +139,11 @@ export default {
required
:
true
,
message
:
"
请输入项目合同金额(起始金额)
"
,
trigger
:
"
blur
"
},
{
pattern
:
/
(
^
([
-
]?)[
1-9
]([
0-9
]
+
)?(\.[
0-9
]{1,6})?
$
)
|
(
^
([
-
]?)(
0
){1}
$
)
|
(
^
([
-
]?)[
0-9
]\.[
0-9
]([
0-9
])?
$
)
/
,
message
:
"
输入项目合同金额不合法
"
,
trigger
:
"
change
"
}
],
timeSlot
:
[
...
...
src/views/project/projectList.vue
View file @
2423ec69
...
...
@@ -18,7 +18,13 @@
</div>
<div
class=
"conter"
>
<el-table
:data=
"projectList"
style=
"width: 100%; text-align: center"
border
>
<el-table
:data=
"projectList"
style=
"width: 100%; text-align: center"
border
: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"
>
...
...
@@ -52,7 +58,7 @@
<p
class=
"incometext"
>
{{
scope
.
row
.
projectIncome
}}
</p>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"success"
@
click=
"showIncome(scope.row)"
>
查看详情
</el-button>
</
template
>
...
...
@@ -89,7 +95,7 @@
align=
"center"
:formatter=
"timestampToTime"
/>
<el-table-column
prop=
"projectAmount"
label=
"操作"
align=
"center"
>
<el-table-column
prop=
"projectAmount"
label=
"操作"
align=
"center"
width=
"130px"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin:5px"
...
...
@@ -217,7 +223,7 @@ export default {
path
:
"
/memberList
"
,
query
:
{
id
:
data
.
projectId
,
staffId
:
0
staffId
:
0
}
});
},
...
...
src/views/reimbursement/finance/financeList.vue
View file @
2423ec69
...
...
@@ -76,20 +76,21 @@
<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-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"
>
<el-table-column
label=
"序号"
align=
"center"
width=
"50px"
>
<
template
slot-scope=
"scope"
>
{{
(
reimbursementQurey
.
pageNum
-
1
)
*
reimbursementQurey
.
pageSize
+
...
...
@@ -98,25 +99,24 @@
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"userName"
label=
"报销人"
/>
<el-table-column
prop=
"projectName"
label=
"项目"
/>
<!-- <el-table-column prop="typeName" label="报销类别">
<template slot-scope="scope">
<el-tag>{{ scope.row.typeName }}</el-tag>
</template>
</el-table-column> -->
<el-table-column
prop=
"applyTotalAmountSmall"
label=
"申报总金额"
/>
<el-table-column
label=
"核报总金额"
>
<el-table-column
prop=
"userName"
label=
"报销人"
align=
"center"
/>
<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=
"组长审批人"
>
<el-table-column
label=
"组长审批人"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
headmanName
||
"
暂无
"
}}
</
template
>
</el-table-column>
<el-table-column
label=
"财务审批人"
>
<el-table-column
label=
"财务审批人"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
financeName
||
"
暂无
"
}}
</
template
>
...
...
@@ -124,9 +124,10 @@
<el-table-column
prop=
"fillingTime"
label=
"报销日期"
align=
"center"
:formatter=
"timestampToTime"
/>
<el-table-column
prop=
"prop"
label=
"发票图片"
>
<el-table-column
prop=
"prop"
label=
"发票图片"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
...
...
@@ -136,7 +137,17 @@
>
</
template
>
</el-table-column>
<el-table-column
prop=
"reimbursementState"
label=
"状态"
>
<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=
"
...
...
@@ -162,7 +173,7 @@
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
fixed=
"right"
>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.reimbursementState == 1"
>
<el-button
...
...
@@ -190,7 +201,12 @@
</
template
>
</el-table-column>
</el-table>
<el-drawer
title=
"查看详情"
:visible.sync=
"drawer"
:direction=
"direction"
>
<el-drawer
title=
"查看详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"35%"
>
<el-form
:inline=
"true"
label-width=
"80px"
>
<el-row>
<el-col
...
...
@@ -201,7 +217,13 @@
<el-input
v-model=
"item.money"
></el-input>
</el-form-item>
<el-form-item
label=
"说明"
>
<el-input
v-model=
"item.remarks"
></el-input>
<el-input
type=
"textarea"
:rows=
"4"
placeholder=
"请输入内容"
v-model=
"item.remarks"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -237,27 +259,35 @@
}}
</el-descriptions-item>
<el-descriptions-item
label=
"报销类别"
>
{{
reimbursementData.typeName
}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions
:column=
"3"
border
>
<el-descriptions-item
:label=
"item.name"
v-for=
"( item ,index ) in financeList.list"
:key=
"index"
>
{{item.money}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions
border
>
<el-descriptions-item
:span=
"2"
label=
"申请报销总金额(大写)"
>
{{
reimbursementData.applyTotalAmountLarge
}}
</el-descriptions-item>
<el-descriptions-item
label=
"申请报销总金额(小写)"
>
{{
reimbursementData.applyTotalAmountSmall
}}
</el-descriptions-item>
<el-descriptions-item
:span=
"2"
label=
"核实报销总金额(大写)"
>
{{
from.verifyTotalAmountLarge
}}
</el-descriptions-item>
<el-descriptions-item
label=
"核实报销总金额(小写)"
>
{{
from.verifyTotalAmountSmall
}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions
:column=
"3"
border
>
<el-descriptions-item
:label=
"item.name"
v-for=
"(item, index) in financeList.list"
:key=
"index"
>
{{ item.money }}元
</el-descriptions-item>
</el-descriptions>
<el-descriptions
border
>
<el-descriptions-item
:span=
"2"
label=
"申请报销总金额(大写)"
>
{{
reimbursementData.applyTotalAmountLarge
}}元
</el-descriptions-item
>
<el-descriptions-item
label=
"申请报销总金额(小写)"
>
{{
reimbursementData.applyTotalAmountSmall
}}元
</el-descriptions-item
>
<el-descriptions-item
:span=
"2"
label=
"核实报销总金额(大写)"
>
{{ from.verifyTotalAmountLarge }}元
</el-descriptions-item
>
<el-descriptions-item
label=
"核实报销总金额(小写)"
>
{{ from.verifyTotalAmountSmall }}元
</el-descriptions-item
>
</el-descriptions>
</el-col>
<el-col
:xl=
"12"
:lg=
"12"
:md=
"24"
:sm=
"24"
style=
"margin: 10px 0px"
>
<el-form
...
...
@@ -271,13 +301,33 @@
label=
"核实报销总金额(大写)"
prop=
"verifyTotalAmountLarge"
>
<el-input
v-model=
"from.verifyTotalAmountLarge"
></el-input>
<el-input
v-model=
"from.verifyTotalAmountLarge"
disabled
><i
slot=
"suffix"
style=
"font-style: normal; margin-right: 10px"
>
元
</i
></el-input
>
</el-form-item>
<el-form-item
label=
"核实报销总金额(小写)"
prop=
"verifyTotalAmountSmall"
:rules=
"{
validator: moneyrow,
trigger: 'blur',
required: true,
}"
>
<el-input
v-model=
"from.verifyTotalAmountSmall"
></el-input>
<el-input
v-model=
"from.verifyTotalAmountSmall"
@
change=
"convertCurrency(from.verifyTotalAmountSmall)"
>
<i
slot=
"suffix"
style=
"font-style: normal; margin-right: 10px"
>
元
</i
></el-input
>
</el-form-item>
</el-form>
<div
style=
"width: 100%; text-align: right; padding: 0px 10%"
>
...
...
@@ -292,44 +342,172 @@
</el-row>
</div>
</el-drawer>
<el-drawer
title=
"发票详情"
:visible.sync=
"invoiceShow"
:direction=
"direction"
size=
"40%"
title=
"发票详情"
:visible.sync=
"invoiceShow"
:direction=
"direction"
size=
"30%"
>
<!-- filePath-->
<el-table
:data=
"getinvoivelist"
style=
"width: 100%; text-align: center"
border
>
<!-- filePath-->
<el-table
:data=
"getinvoivelist"
style=
"width: 100%; text-align: center"
border
>
<el-table-column
type=
"index"
label=
"序号"
width=
"40"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"发票详情"
>
<
template
slot-scope=
"scope"
>
<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: 100px; height: 100px"
:src=
"scope.row.filePath"
:preview-src-list=
"[scope.row.filePath]"
></el-image>
</
template
>
</el-table-column>
</el-table>
</el-drawer>
</div>
<div
v-else
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看文件
</a
>
</div>
</
template
>
</el-table-column>
</el-table>
</el-drawer>
<!-- 附件的下载与添加 -->
<div>
<el-drawer
title=
"附件操作"
:visible.sync=
"drawer2"
:direction=
"direction"
size=
"50%"
>
<el-button
type=
"primary"
style=
"margin-left: 5%; margin: 30px 50px"
disabled
@
click=
"updatecard"
>
添加附件
</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
>
删除
</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
: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
{
money
}
from
"
@/utils/myValidate
"
;
import
{
selectByReimbursementId
}
from
"
@/api/reimbursementDetails
"
;
import
{
selectByFinance
,
financeApproval
}
from
"
@/api/reimbursement
"
;
import
{
selectByFinance
,
financeApproval
}
from
"
@/api/reimbursement
"
;
import
{
selectAllById
}
from
"
@/api/project
"
;
import
{
deletBystatus
,
selectByIdF
,
deleteById
}
from
"
@/api/project
"
;
export
default
{
data
()
{
return
{
...
...
@@ -356,42 +534,89 @@ export default {
from
:
{
reimbursementId
:
null
,
financeId
:
null
,
finaceRefute
:
null
,
finaceRefute
:
""
,
financeTime
:
null
,
reimbursementState
:
null
,
//0待审批 1小组长通过 2小组长驳回 3财务通过 4财务驳回
verifyTotalAmountLarge
:
null
,
verifyTotalAmountSmall
:
null
,
},
rules
:
{
verifyTotalAmountLarge
:
[
{
required
:
true
,
message
:
"
请输入申请报销总金额(大写)
"
,
trigger
:
"
blur
"
,
},
],
verifyTotalAmountSmall
:
[
{
required
:
true
,
validator
:
money
,
trigger
:
"
blur
"
},
],
},
rules
:
{},
invoiceShow
:
false
,
getinvoivelist
:[],
getinvoivelist
:
[],
//查询图片给的值
getinvoiveId
:
{
companyId
:
null
,
reimbursementId
:
0
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
,
//隐藏
};
},
created
()
{
this
.
reimbursementQurey
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
reimbursementQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
getinvoiveId
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
queryDTO
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
action1
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
//保存附件与下载的接口
this
.
getReimbursement
();
},
methods
:
{
//查看详情
getdetails
(
data
)
{
//图片格式
formatProtocolType
(
row
)
{
if
(
row
.
filePath
==
null
)
{
return
false
;
}
else
{
let
fileNamepdf
=
row
.
filePath
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
))
if
(
fileType
!=
"
.pdf
"
)
{
return
true
;
}
else
{
return
false
;
}
}
},
//查看pdf格式
handlePreView
(
row
)
{
console
.
log
(
row
);
const
photopath
=
row
.
filePath
;
window
.
open
(
photopath
,
"
_blank
"
);
},
//查看详情
getdetails
(
data
)
{
this
.
drawer
=
true
;
let
param
=
{
reimbursementId
:
data
.
reimbursementId
,
...
...
@@ -416,7 +641,7 @@ export default {
};
selectByReimbursementId
(
param
)
.
then
((
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
;
if
(
res
.
success
)
{
//获取数据
this
.
financeList
.
list
=
res
.
data
;
...
...
@@ -456,13 +681,27 @@ export default {
this
.
getReimbursement
();
},
//agreeandrefuse
//agreeandrefuse
同意和驳回
agreeandrefuse
(
data
)
{
this
.
getgetdetails
(
data
)
console
.
log
(
this
.
financeList
)
this
.
getgetdetails
(
data
)
;
console
.
log
(
this
.
financeList
)
;
this
.
reimbursementData
=
data
;
this
.
dialogVisible
=
true
;
this
.
lsitboot
();
},
//清空
lsitboot
()
{
this
.
from
=
{
reimbursementId
:
null
,
financeId
:
null
,
finaceRefute
:
""
,
financeTime
:
null
,
reimbursementState
:
null
,
//0待审批 1小组长通过 2小组长驳回 3财务通过 4财务驳回
verifyTotalAmountLarge
:
null
,
verifyTotalAmountSmall
:
null
,
};
},
//同意
agree
()
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
...
...
@@ -507,13 +746,20 @@ export default {
this
.
$prompt
(
"
驳回理由
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
closeOnClickModal
:
false
,
inputErrorMessage
:
"
驳回理由必填
"
,
inputValidator
:
(
value
)
=>
{
if
(
value
)
{
return
true
;
}
else
{
return
false
;
}
},
})
.
then
((
value
)
=>
{
//处理数据
this
.
from
.
reimbursementId
=
this
.
reimbursementData
.
reimbursementId
;
this
.
from
.
financeId
=
this
.
$store
.
getters
.
urId
;
this
.
from
.
finaceRefute
=
value
.
value
;
this
.
from
.
finaceRefute
=
value
.
value
||
""
;
this
.
from
.
financeTime
=
this
.
time
();
this
.
from
.
reimbursementState
=
4
;
financeApproval
(
this
.
from
)
...
...
@@ -533,9 +779,8 @@ export default {
.
catch
(()
=>
{
this
.
$message
({
type
:
"
info
"
,
message
:
"
取消
操作
"
,
message
:
"
取消
输入
"
,
});
this
.
dialogVisible
=
false
;
});
},
//时间处理 yyyy-MM-dd hh:mm:ss
...
...
@@ -588,6 +833,253 @@ export default {
this
.
back
();
});
},
//金额小写转大写
convertCurrency
(
money
)
{
//汉字的数字
var
cnNums
=
new
Array
(
"
零
"
,
"
壹
"
,
"
贰
"
,
"
叁
"
,
"
肆
"
,
"
伍
"
,
"
陆
"
,
"
柒
"
,
"
捌
"
,
"
玖
"
);
//基本单位
var
cnIntRadice
=
new
Array
(
""
,
"
拾
"
,
"
佰
"
,
"
仟
"
);
//对应整数部分扩展单位
var
cnIntUnits
=
new
Array
(
""
,
"
万
"
,
"
亿
"
,
"
兆
"
);
//对应小数部分单位
var
cnDecUnits
=
new
Array
(
"
角
"
,
"
分
"
,
"
毫
"
,
"
厘
"
);
//整数金额时后面跟的字符
var
cnInteger
=
"
整
"
;
//整型完以后的单位
var
cnIntLast
=
"
元
"
;
//最大处理的数字
var
maxNum
=
999999999999999.9999
;
//金额整数部分
var
integerNum
;
//金额小数部分
var
decimalNum
;
//输出的中文金额字符串
var
chineseStr
=
""
;
//分离金额后用的数组,预定义
var
parts
;
if
(
money
==
""
)
{
return
""
;
}
money
=
parseFloat
(
money
);
if
(
money
>=
maxNum
)
{
//超出最大处理数字
return
""
;
}
if
(
money
==
0
)
{
chineseStr
=
cnNums
[
0
]
+
cnIntLast
+
cnInteger
;
return
chineseStr
;
}
//转换为字符串
money
=
money
.
toString
();
if
(
money
.
indexOf
(
"
.
"
)
==
-
1
)
{
integerNum
=
money
;
decimalNum
=
""
;
}
else
{
parts
=
money
.
split
(
"
.
"
);
integerNum
=
parts
[
0
];
decimalNum
=
parts
[
1
].
substr
(
0
,
4
);
}
//获取整型部分转换
if
(
parseInt
(
integerNum
,
10
)
>
0
)
{
var
zeroCount
=
0
;
var
IntLen
=
integerNum
.
length
;
for
(
var
i
=
0
;
i
<
IntLen
;
i
++
)
{
var
n
=
integerNum
.
substr
(
i
,
1
);
var
p
=
IntLen
-
i
-
1
;
var
q
=
p
/
4
;
var
m
=
p
%
4
;
if
(
n
==
"
0
"
)
{
zeroCount
++
;
}
else
{
if
(
zeroCount
>
0
)
{
chineseStr
+=
cnNums
[
0
];
}
//归零
zeroCount
=
0
;
chineseStr
+=
cnNums
[
parseInt
(
n
)]
+
cnIntRadice
[
m
];
}
if
(
m
==
0
&&
zeroCount
<
4
)
{
chineseStr
+=
cnIntUnits
[
q
];
}
}
chineseStr
+=
cnIntLast
;
}
//小数部分
if
(
decimalNum
!=
""
)
{
var
decLen
=
decimalNum
.
length
;
for
(
var
i
=
0
;
i
<
decLen
;
i
++
)
{
var
n
=
decimalNum
.
substr
(
i
,
1
);
if
(
n
!=
"
0
"
)
{
chineseStr
+=
cnNums
[
Number
(
n
)]
+
cnDecUnits
[
i
];
}
}
}
if
(
chineseStr
==
""
)
{
chineseStr
+=
cnNums
[
0
]
+
cnIntLast
+
cnInteger
;
}
else
if
(
decimalNum
==
""
)
{
chineseStr
+=
cnInteger
;
}
this
.
from
.
verifyTotalAmountLarge
=
chineseStr
;
},
//定义金额校验
moneyrow
(
rule
,
value
,
callback
)
{
let
RegExp
=
/
(
^
([
-
]?)[
1-9
]([
0-9
]
+
)?(\.[
0-9
]{1,2})?
$
)
|
(
^
([
-
]?)(
0
){1}
$
)
|
(
^
([
-
]?)[
0-9
]\.[
0-9
]([
0-9
])?
$
)
/
;
// /^(([1-9][0-9]{0,14})|([0]{1})|(([0]\\.\\d{1,2}|[1-9][0-9]{0,14}\\.\\d{1,2})))$/;
if
(
RegExp
.
test
(
value
))
{
callback
();
}
else
{
callback
(
new
Error
(
"
金额格式错误
"
));
}
},
//查看项目附件.....
selectImage
(
row
)
{
console
.
log
(
row
);
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
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//下载附件
delProject
(
row
)
{
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
process
.
env
.
VUE_APP_BASE_API
+
row
.
enclosureFile
;
// 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
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
)
{
deleteById
(
row
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
selectImage
(
row
);
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
})
.
catch
((
errror
)
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//清除附件文件
delfile1
(
file
)
{
this
.
fileList1
=
this
.
fileList1
.
filter
((
item
)
=>
item
.
uid
!==
file
.
uid
);
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
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
{
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
!=
""
)
{
this
.
fileTypepdf
=
true
;
}
else
{
this
.
$message
.
warning
(
"
附件只能只能上传文件
"
);
this
.
$refs
.
upload1
.
clearFiles
();
this
.
fileTypepdf
=
false
;
}
},
//删除关系
delinvoice
(
data
)
{
deletBystatus
(
data
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoive
(
data
);
}
});
},
},
};
</
script
>
...
...
@@ -602,4 +1094,30 @@ export default {
.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%
;
}
</
style
>
\ No newline at end of file
src/views/reimbursement/headman/headmanList.vue
View file @
2423ec69
<
template
>
<div
class=
"container"
>
<div>
<el-form
:inline=
"true"
:model=
"reimbursementQurey"
>
<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"
...
...
@@ -90,7 +77,7 @@
</
template
>
</el-table-column>
<el-table-column
label=
"序号"
width=
"50px"
>
<el-table-column
align=
"center"
label=
"序号"
width=
"50px"
>
<
template
slot-scope=
"scope"
>
{{
(
reimbursementQurey
.
pageNum
-
1
)
*
reimbursementQurey
.
pageSize
+
...
...
@@ -99,25 +86,24 @@
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"userName"
label=
"报销人"
/>
<el-table-column
prop=
"projectName"
label=
"项目"
/>
<!-- <el-table-column prop="typeName" label="报销类别">
<template slot-scope="scope">
<el-tag>{{ scope.row.typeName }}</el-tag>
</template>
</el-table-column> -->
<el-table-column
prop=
"applyTotalAmountSmall"
label=
"申报总金额"
/>
<el-table-column
label=
"核报总金额"
>
<el-table-column
align=
"center"
prop=
"userName"
label=
"报销人"
/>
<el-table-column
align=
"center"
prop=
"projectName"
label=
"项目"
/>
<el-table-column
align=
"center"
prop=
"applyTotalAmountSmall"
label=
"申报总金额(元)"
/>
<el-table-column
align=
"center"
label=
"核报总金额(元)"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
verifyTotalAmountSmall
||
"
还未核实金额
"
}}
</
template
>
</el-table-column>
<el-table-column
label=
"组长审批人"
>
<el-table-column
label=
"组长审批人"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
headmanName
||
"
暂无
"
}}
</
template
>
</el-table-column>
<el-table-column
label=
"财务审批人"
>
<el-table-column
label=
"财务审批人"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
financeName
||
"
暂无
"
}}
</
template
>
...
...
@@ -125,9 +111,10 @@
<el-table-column
prop=
"fillingTime"
label=
"报销日期"
align=
"center"
:formatter=
"timestampToTime"
/>
<el-table-column
prop=
"prop"
label=
"发票图片"
>
<el-table-column
prop=
"prop"
label=
"发票图片"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
...
...
@@ -137,7 +124,17 @@
>
</
template
>
</el-table-column>
<el-table-column
prop=
"reimbursementState"
label=
"状态"
>
<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=
"
...
...
@@ -163,7 +160,7 @@
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
fixed=
"right"
>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.reimbursementState == 0"
>
<el-button
...
...
@@ -187,7 +184,13 @@
</
template
>
</el-table-column>
</el-table>
<el-drawer
title=
"查看详情"
:visible.sync=
"drawer"
:direction=
"direction"
>
<!-- 查看详情 -->
<el-drawer
title=
"查看详情"
:visible.sync=
"drawer"
:direction=
"direction"
size=
"35%"
>
<el-form
:inline=
"true"
label-width=
"80px"
>
<el-row>
<el-col
...
...
@@ -197,19 +200,28 @@
<el-form-item
:label=
"item.name"
>
<el-input
v-model=
"item.money"
></el-input>
</el-form-item>
<el-form-item
label=
"说明"
>
<!--
<el-form-item label="说明">
<el-input v-model="item.remarks"></el-input>
</el-form-item> -->
<el-form-item
label=
"说明"
>
<el-input
type=
"textarea"
:rows=
"4"
placeholder=
"请输入内容"
v-model=
"item.remarks"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-drawer>
<!-- 发票详情 -->
<el-drawer
title=
"发票详情"
:visible.sync=
"invoiceShow"
:direction=
"direction"
size=
"
4
0%"
size=
"
3
0%"
>
<!-- filePath-->
<el-table
...
...
@@ -220,15 +232,22 @@
<el-table-column
type=
"index"
label=
"序号"
width=
"
4
0"
width=
"
8
0"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"发票详情"
>
<
template
slot-scope=
"scope"
>
<el-image
style=
"width: 100px; height: 100px"
:src=
"scope.row.filePath"
:preview-src-list=
"[scope.row.filePath]"
></el-image>
<div
v-if=
"formatProtocolType(scope.row)"
>
<el-image
style=
"width: 100px; height: 100px"
:src=
"scope.row.filePath"
:preview-src-list=
"[scope.row.filePath]"
></el-image>
</div>
<div
v-else
>
<a
class=
"a-style"
@
click=
"handlePreView(scope.row)"
>
点击查看文件
</a
>
</div>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -243,13 +262,144 @@
: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"
disabled
@
click=
"updatecard"
>
添加附件
</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
>
删除
</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
: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
{
selectByHeadman
,
headamApproval
}
from
"
@/api/reimbursement
"
;
import
{
selectByReimbursementId
}
from
"
@/api/reimbursementDetails
"
;
import
{
selectAllById
}
from
"
@/api/project
"
;
import
{
selectAllById
,
deletBystatus
,
selectByIdF
,
deleteById
,
}
from
"
@/api/project
"
;
export
default
{
data
()
{
return
{
...
...
@@ -269,7 +419,7 @@ export default {
from
:
{
reimbursementId
:
null
,
headmanId
:
null
,
headmanRefute
:
null
,
headmanRefute
:
""
,
headmanTime
:
null
,
reimbursementState
:
null
,
//0待审批 1小组长通过 2小组长驳回 3财务通过 4财务驳回
},
...
...
@@ -280,14 +430,71 @@ export default {
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
,
//隐藏
};
},
created
()
{
this
.
getinvoiveId
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
reimbursementQurey
.
userId
=
this
.
$store
.
getters
.
urId
;
this
.
queryDTO
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
action1
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
//保存附件与下载的接口
this
.
getReimbursement
();
},
methods
:
{
//图片格式
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
;
}
}
},
//获取pdf格式
handlePreView
(
row
){
const
photopath
=
row
.
filePath
;
window
.
open
(
photopath
,
"
_blank
"
)
},
//查看详情
getdetails
(
data
)
{
this
.
drawer
=
true
;
...
...
@@ -334,8 +541,10 @@ export default {
})
.
then
(()
=>
{
//处理数据
// console.log(value.value)
this
.
from
.
reimbursementId
=
data
.
reimbursementId
;
this
.
from
.
headmanId
=
this
.
$store
.
getters
.
urId
;
this
.
from
.
headmanRefute
=
""
;
this
.
from
.
headmanTime
=
this
.
time
();
this
.
from
.
reimbursementState
=
1
;
headamApproval
(
this
.
from
)
...
...
@@ -363,13 +572,22 @@ export default {
this
.
$prompt
(
"
驳回理由
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
closeOnClickModal
:
false
,
inputErrorMessage
:
"
驳回理由必填
"
,
type
:
"
warning
"
,
inputValidator
:
(
value
)
=>
{
if
(
value
)
{
return
true
;
}
else
{
return
false
;
}
},
})
.
then
((
value
)
=>
{
//处理数据
this
.
from
.
reimbursementId
=
data
.
reimbursementId
;
this
.
from
.
headmanId
=
this
.
$store
.
getters
.
urId
;
this
.
from
.
headmanRefute
=
value
.
value
;
this
.
from
.
headmanRefute
=
value
.
value
||
""
;
this
.
from
.
headmanTime
=
this
.
time
();
this
.
from
.
reimbursementState
=
2
;
headamApproval
(
this
.
from
)
...
...
@@ -420,7 +638,6 @@ export default {
ReviseImage
(
row
)
{
this
.
invoiceShow
=
true
;
this
.
getinvoiveId
.
reimbursementId
=
row
.
reimbursementId
;
//console.log(process.env.VUE_APP_BASE_API);
this
.
Selectinsertlsit
();
},
//查询发票图片
...
...
@@ -443,6 +660,143 @@ export default {
this
.
back
();
});
},
//查看项目附件.....
selectImage
(
row
)
{
console
.
log
(
row
);
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
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//下载附件
delProject
(
row
)
{
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
process
.
env
.
VUE_APP_BASE_API
+
row
.
enclosureFile
;
// 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
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
)
{
deleteById
(
row
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
selectImage
(
row
);
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
})
.
catch
((
errror
)
=>
{
this
.
$message
.
error
(
res
.
msg
);
});
},
//清除附件文件
delfile1
(
file
)
{
this
.
fileList1
=
this
.
fileList1
.
filter
((
item
)
=>
item
.
uid
!==
file
.
uid
);
this
.
proutlist1
.
enclosureDescribe
=
""
;
//初始化数据
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
{
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
!=
""
)
{
this
.
fileTypepdf
=
true
;
}
else
{
this
.
$message
.
warning
(
"
附件只能只能上传文件
"
);
this
.
$refs
.
upload1
.
clearFiles
();
this
.
fileTypepdf
=
false
;
}
},
//删除关系
delinvoice
(
data
)
{
deletBystatus
(
data
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoive
(
data
);
}
});
},
},
};
</
script
>
...
...
@@ -452,9 +806,35 @@ export default {
padding
:
10px
;
}
.conter
{
margin-bot
to
m
:
1
0px
;
padding-
to
p
:
4
0px
;
}
.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%
;
}
</
style
>
\ No newline at end of file
src/views/reimbursement/reimbursementAdd.vue
View file @
2423ec69
...
...
@@ -46,11 +46,18 @@
<el-form-item
label=
"摘要"
prop=
"summary"
>
<el-input
v-model=
"from.summary"
></el-input>
</el-form-item>
<el-form-item
label=
"报销总金额-大写
"
prop=
"applyTotalAmountLarge
"
>
<el-input
v-model=
"from.applyTotalAmountLarge"
></el-input>
<el-form-item
label=
"报销总金额-大写
(元)
"
>
<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-input>
<el-form-item
label=
"报销总金额-小写(元)"
prop=
"applyTotalAmountSmall"
:rules=
"
{ validator: moneyrow, trigger: 'blur', required: true }"
>
<el-input
v-model=
"from.applyTotalAmountSmall"
@
change=
"convertCurrency(from.applyTotalAmountSmall)"
></el-input>
</el-form-item>
<el-form-item
label=
"支付方式"
prop=
"paymentMethod"
>
<el-input
v-model=
"from.paymentMethod"
></el-input>
...
...
@@ -58,12 +65,40 @@
<el-form-item
label=
"备注"
>
<el-input
type=
"textarea"
:rows=
"
5
"
:rows=
"
4
"
placeholder=
"请输入内容"
v-model=
"from.remarks"
>
</el-input>
</el-form-item>
<el-form-item
label=
"附件描述"
>
<el-input
type=
"textarea"
:rows=
"4"
placeholder=
"请输入内容"
v-model=
"from.enclosureDescribe"
>
</el-input>
</el-form-item>
<el-form-item
label=
"附件上传"
>
<el-upload
class=
"upload-demo"
drag
ref=
"enclosureUpload"
:action=
"action1"
:auto-upload=
"false"
:data=
"enclosurelist"
multiple
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传jpg/png文件,且不超过500kb
</div>
</el-upload>
</el-form-item>
<br
/>
<el-form-item>
<el-button
...
...
@@ -79,7 +114,6 @@
@
click=
"resetForm()"
>
重置信息
</el-button
>
<el-button
type=
"primary"
@
click=
"drawerAdd()"
>
申请报销单
</el-button>
<el-button
@
click=
"back()"
>
返回
</el-button>
</el-form-item>
</el-form>
...
...
@@ -101,9 +135,13 @@
<el-form-item
:label=
"item.itemNamwe"
:prop=
"'list.' + index + '.money'"
:rules=
"
{ validator: moneyrow, trigger: 'blur' }"
:rules=
"
{
validator: moneyrow,
trigger: 'blur',
required: true,
}"
>
<el-input
v-model=
"item.money"
></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>
...
...
@@ -116,187 +154,21 @@
<el-empty
description=
"暂无报销项,因此无法报销"
></el-empty>
</div>
</div>
<!-- 报销单 -->
<el-drawer
title=
"发票单列表"
:visible.sync=
"drawer"
size=
"100%"
>
<!-- 表格区域 -->
<div
class=
"drawer"
v-show=
"isgetid == 0"
style=
"margin-left: 5%"
>
<el-button
type=
"primary"
@
click=
"Reimbursement()"
style=
"margin: 20px 0px"
>
添加报销单
</el-button
>
<el-table
:data=
"invoicegetList"
border
style=
"width: 90%"
>
<el-table-column
label=
"序号"
width=
"50px"
>
<template
slot-scope=
"scope"
>
{{
(
invoicegetQurey
.
pageNum
-
1
)
*
invoicegetQurey
.
pageSize
+
scope
.
$index
+
1
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"number"
label=
"发票号码"
width=
"width"
></el-table-column>
<el-table-column
prop=
"code"
label=
"发票代码"
></el-table-column>
<el-table-column
prop=
"time"
label=
"发票时间"
></el-table-column>
<el-table-column
prop=
"category"
label=
"发票类型"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.category == '0' ? 'info' : 'primary'"
>
{{
scope
.
row
.
category
==
"
0
"
?
"
普票
"
:
"
专票
"
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
label=
"发票类别"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"
scope.row.type == '0'
? 'success'
: scope.row.type == '1'
? 'danger'
: 'warning'
"
>
{{
scope
.
row
.
type
==
"
0
"
?
"
收入
"
:
scope
.
row
.
type
==
"
1
"
?
"
支出
"
:
"
报销
"
}}
</el-tag
>
</
template
>
</el-table-column>
<el-table-column
prop=
"mone"
label=
"发票金额"
></el-table-column>
<el-table-column
prop=
"status"
label=
"发票状态"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.status == '0' ? 'info' : 'warning'"
>
{{
scope
.
row
.
status
==
0
?
"
未报销
"
:
"
已报销
"
}}
</el-tag>
</
template
>
</el-table-column>
</el-table>
<!-- 分页-->
<!-- total:总的条目数 -->
<el-pagination
style=
"margin: 0px auto"
:current-page.sync=
"invoicegetQurey.pageNum"
:page-size=
"invoicegetQurey.pageSize"
@
current-change=
"getincomeSelectlist"
layout=
"total, prev, pager, next"
:total=
"total"
></el-pagination>
</div>
<!-- 添加区域 -->
<div
class=
"getadd"
v-show=
"isgetid == 1"
style=
"margin-left: 5%"
>
<el-row>
<el-col
:xl=
"8"
:lg=
"10"
:md=
"8"
:sm=
"12"
:xs=
"24"
>
<el-form
style=
"width: 100%; margin: 30px 0px"
:model=
"addTO"
:rules=
"rules"
ref=
"addTO"
label-width=
"80px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"发票号码"
prop=
"number"
>
<el-input
v-model=
"addTO.number"
oninput=
"value=value.replace(/^\.+|[^\d.]/g,'')"
></el-input>
</el-form-item>
<el-form-item
label=
"发票代码"
prop=
"code"
>
<el-input
v-model=
"addTO.code"
></el-input>
</el-form-item>
<el-form-item
label=
"发票时间"
required
>
<el-date-picker
v-model=
"addTO.time"
type=
"datetime"
placeholder=
"选择日期时间"
@
change=
"timestampToTime1()"
></el-date-picker>
</el-form-item>
<el-form-item
label=
"发票类型"
prop=
"category"
>
<el-select
v-model=
"addTO.category"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.category"
:value=
"item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"发票金额"
prop=
"mone"
>
<el-input
v-model=
"addTO.mone"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"success"
icon=
"el-icon-folder-checked"
@
click=
"getlistForm()"
>
立即创建
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-refresh-left"
@
click=
"cancel()"
>
取消
</el-button
>
</el-form-item>
</el-form>
</el-col>
<el-col
:xs=
"4"
:sm=
"6"
:md=
"8"
:lg=
"10"
:xl=
"11"
>
<el-upload
class=
"upload-demo"
ref=
"upload"
:file-list=
"fileList"
:action=
"action"
:auto-upload=
"false"
:data=
"proutlist"
:on-change=
"onChange"
:on-remove=
"delfile2"
style=
"margin-left: 90px"
>
<el-button
slot=
"trigger"
size=
"small"
type=
"primary"
style=
"margin-left: 20px; margin-top: 40px"
>
选取文件
</el-button
>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传jpg/png文件,且不超过500kb
</div>
</el-upload>
</el-col>
</el-row>
</div>
</el-drawer>
</div>
</
template
>
<
script
>
import
{
selectAllCompanyId
}
from
"
@/api/reimbursementItem
"
;
import
{
money
}
from
"
@/utils/myValidate
"
;
import
{
selectAll
as
projectSelectAll
}
from
"
@/api/project
"
;
import
{
insert
}
from
"
@/api/reimbursement
"
;
import
{
Details
}
from
"
@/api/reimbursement
"
;
import
{
insertList
,
queryBypageIncomeAdd
,
selectAllBystatus
,
}
from
"
@/api/project
"
;
import
{
updatesubmit
,
uploadFile
}
from
"
@/api/project
"
;
import
{
queryBypageIncomeAdd
,
selectAllBystatus
}
from
"
@/api/project
"
;
import
{
updatesubmit
}
from
"
@/api/project
"
;
export
default
{
data
()
{
return
{
//提交信息
from
:
{
// list1:[],
companyId
:
null
,
//公司id
userName
:
null
,
//申报人
userPhone
:
null
,
//联系电话
...
...
@@ -309,9 +181,9 @@ export default {
paymentMethod
:
null
,
//支付方式
reimbursementState
:
0
,
//状态
projectId
:
null
,
//项目id
// invoiceId: null, //发票的id
fromList
:
[],
//发票号码
remarks
:
""
,
//备注
enclosureDescribe
:
""
,
//附件描述
},
projectList
:
[],
//项目列表
getinvoivelist
:
[],
//可以选择的发票号
...
...
@@ -333,16 +205,6 @@ export default {
projectId
:
[
{
required
:
true
,
message
:
"
请选择项目
"
,
trigger
:
"
change
"
},
],
applyTotalAmountLarge
:
[
{
required
:
true
,
message
:
"
请输入申请报销总金额(大写)
"
,
trigger
:
"
blur
"
,
},
],
applyTotalAmountSmall
:
[
{
required
:
true
,
validator
:
money
,
trigger
:
"
blur
"
},
],
number
:
[
{
required
:
true
,
message
:
"
请输入发票号码
"
,
trigger
:
"
change
"
},
],
...
...
@@ -367,50 +229,24 @@ export default {
{
required
:
true
,
message
:
"
请输入发票金额
"
,
trigger
:
"
change
"
},
],
},
//发票列表窗口
drawer
:
false
,
isgetid
:
0
,
//发票列表
invoicegetList
:
[],
//查询发票参数
invoicegetQurey
:
{
pageNum
:
1
,
pageSize
:
10
,
companyId
:
null
,
},
total
:
0
,
//添加发票的参数
addTO
:
{
userId
:
null
,
category
:
null
,
code
:
null
,
companyId
:
null
,
mone
:
null
,
number
:
null
,
status
:
0
,
//发票是否已报销 0未报销 1已报销
time
:
null
,
type
:
2
,
// 0收入 1支出 2报销
},
//报销单区域
options
:
[
{
value
:
0
,
category
:
"
普票
"
,
},
{
value
:
1
,
category
:
"
专票
"
,
},
],
fileList
:
[],
//发票图片存放位置
action
:
null
,
//发票图片提交地址
//图片提交携带的额外参数
proutlist
:
{
Id
:
null
,
//res.data
status
:
2
,
// 0代表收入 1代表收入 2代表日常报销 3代表出差报销
},
action1
:
null
,
//附件图片提交地址
fileTypeJpg
:
false
,
//判断是否有发票文件且格式正确
Uploadstatus
:
false
,
//判断文件上传的状态
//附件提交附带参数 那个data本来就没有参数
enclosurelist
:
{
Id
:
null
,
companyId
:
0
,
enclosureDescribe
:
""
,
status
:
2
,
userId
:
0
,
},
};
},
created
()
{
...
...
@@ -419,14 +255,17 @@ export default {
this
.
from
.
userPhone
=
this
.
$store
.
getters
.
info
.
userPhone
;
this
.
from
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
invoicegetQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
action
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/uploadFile
"
;
this
.
action1
=
process
.
env
.
VUE_APP_BASE_API
+
"
/file/updataEnclosures
"
;
this
.
time
();
this
.
getProject
();
this
.
getReimbursement
();
this
.
Selectinsertlsit
();
},
methods
:
{
//上传附件
enclosure
()
{
this
.
drawer1
=
true
;
},
//提交
submitForm
()
{
this
.
$refs
.
form
.
validate
((
valid1
)
=>
{
...
...
@@ -436,18 +275,6 @@ export default {
insert
(
this
.
from
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
//上传右边的报销项了 ,上传报销项之前,需要处理数据reimbursementId代表着本次提交报销表的id
this
.
reimbursementItemData
.
list
.
forEach
((
item
)
=>
{
item
.
reimbursementId
=
res
.
data
;
});
Details
(
this
.
reimbursementItemData
.
list
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
申请成功,等待审批
"
);
this
.
back
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
//上传发票号
let
list
=
[];
this
.
from
.
fromList
.
forEach
((
item
)
=>
{
...
...
@@ -458,10 +285,31 @@ export default {
});
});
updatesubmit
(
list
).
then
((
res
)
=>
{
if
(
item
.
success
)
{
this
.
$messages
.
success
(
"
发票联邦成功
"
);
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
.
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
s
.
error
(
"
发票联邦失败
"
);
this
.
$message
.
error
(
res
.
msg
);
}
});
}
else
{
...
...
@@ -469,6 +317,7 @@ export default {
}
})
.
catch
((
error
)
=>
{
console
.
log
(
error
);
this
.
$message
.
error
(
"
提交失败
"
);
});
}
...
...
@@ -478,7 +327,7 @@ export default {
},
//重置信息
resetForm
()
{
this
.
$refs
.
form
.
resetFields
();
this
.
$refs
.
form
.
resetFields
();
//resetFields重置表单
this
.
time
();
this
.
from
.
userId
=
this
.
$store
.
getters
.
info
.
userId
;
this
.
from
.
userName
=
this
.
$store
.
getters
.
info
.
userName
;
...
...
@@ -531,7 +380,6 @@ export default {
if
(
res
.
success
)
{
//获取数据
let
reimbursementItemList
=
res
.
data
;
// console.log(this.reimbursementItemList.length)
if
(
reimbursementItemList
.
length
==
0
)
{
this
.
subbut
=
true
;
}
else
{
...
...
@@ -568,18 +416,11 @@ export default {
callback
(
new
Error
(
"
金额格式错误
"
));
}
},
//申请报销单
drawerAdd
()
{
this
.
drawer
=
true
;
this
.
getincomeSelectlist
();
},
//查询发票
getincomeSelectlist
(
pager
=
1
)
{
this
.
invoicegetQurey
.
pageNum
=
pager
;
queryBypageIncomeAdd
(
this
.
invoicegetQurey
)
.
then
((
res
)
=>
{
// console.log(res)
if
(
res
.
success
)
{
this
.
invoicegetList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
...
...
@@ -591,99 +432,13 @@ export default {
this
.
$message
.
error
(
"
查询发票数据失败
"
);
});
},
//添加报销单
Reimbursement
()
{
this
.
isgetid
=
1
;
},
//发票单区域
timestampToTime1
()
{
var
date
=
this
.
addTO
.
time
;
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
.
addTO
.
time
=
Y
+
M
+
D
+
h
+
m
+
s
;
},
//发票提交
getlistForm
()
{
if
(
this
.
fileTypeJpg
)
{
this
.
$refs
.
addTO
.
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
addTO
.
companyId
=
this
.
$store
.
getters
.
companyId
;
this
.
addTO
.
userId
=
this
.
$store
.
getters
.
info
.
userId
;
insertList
(
this
.
addTO
)
.
then
((
res
)
=>
{
console
.
log
(
res
);
console
.
log
(
this
.
isgetid
);
if
(
res
.
success
)
{
//上传图片
//res.data 是上传那图片参数之一
//上传前提参数要对 status id
this
.
proutlist
.
Id
=
res
.
data
;
//el-uploda组件的提交方法
//vue ref //代表着给标签设立一个标识
<
div
id
=
""
><
/div> 相当于i
d
//this.$refs document.getElementById()
//手动上传
this
.
$refs
.
upload
.
submit
();
this
.
$message
.
success
(
res
.
msg
);
//切换到表格区域
this
.
isgetid
=
0
;
//初始化表单
this
.
addTO
=
{
userId
:
null
,
category
:
null
,
code
:
null
,
companyId
:
null
,
mone
:
null
,
number
:
null
,
status
:
0
,
time
:
null
,
type
:
2
,
};
this
.
getincomeSelectlist
();
this
.
Selectinsertlsit
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
console
.
log
(
error
);
this
.
$message
.
error
(
"
新建失败
"
);
});
}
});
}
else
{
this
.
$message
.
warning
(
"
需要发票的图片或文件
"
);
}
},
//取消
cancel
()
{
this
.
isgetid
=
0
;
this
.
getincomeSelectlist
();
},
//校验发票图片是否合格
onChange
(
file
)
{
const
fileNamepdf
=
file
.
name
;
let
fileType
=
fileNamepdf
.
substring
(
fileNamepdf
.
lastIndexOf
(
"
.
"
));
if
(
fileType
==
"
.pdf
"
||
fileType
==
"
.png
"
||
fileType
==
"
.jpg
"
)
{
this
.
fileTypeJpg
=
true
;
}
else
{
this
.
fileTypeJpg
=
false
;
this
.
$message
.
warning
(
"
发票文件只能是pdf,png,jpg格式文件
"
);
this
.
$refs
.
upload
.
clearFiles
();
}
},
//清除发片文件
//清除图片片文件
delfile2
(
file
,
fileList
)
{
this
.
fileTypeJpg
=
false
;
},
...
...
@@ -695,6 +450,7 @@ export default {
type
:
2
,
userId
:
this
.
$store
.
getters
.
info
.
userId
,
};
// console.log(this.getinvoivelist)
selectAllBystatus
(
param
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
...
...
@@ -709,6 +465,105 @@ export default {
this
.
back
();
});
},
//金额小写转大写
convertCurrency
(
money
)
{
//汉字的数字
var
cnNums
=
new
Array
(
"
零
"
,
"
壹
"
,
"
贰
"
,
"
叁
"
,
"
肆
"
,
"
伍
"
,
"
陆
"
,
"
柒
"
,
"
捌
"
,
"
玖
"
);
//基本单位
var
cnIntRadice
=
new
Array
(
""
,
"
拾
"
,
"
佰
"
,
"
仟
"
);
//对应整数部分扩展单位
var
cnIntUnits
=
new
Array
(
""
,
"
万
"
,
"
亿
"
,
"
兆
"
);
//对应小数部分单位
var
cnDecUnits
=
new
Array
(
"
角
"
,
"
分
"
,
"
毫
"
,
"
厘
"
);
//整数金额时后面跟的字符
var
cnInteger
=
"
整
"
;
//整型完以后的单位
var
cnIntLast
=
"
元
"
;
//最大处理的数字
var
maxNum
=
999999999999999.9999
;
//金额整数部分
var
integerNum
;
//金额小数部分
var
decimalNum
;
//输出的中文金额字符串
var
chineseStr
=
""
;
//分离金额后用的数组,预定义
var
parts
;
if
(
money
==
""
)
{
return
""
;
}
money
=
parseFloat
(
money
);
if
(
money
>=
maxNum
)
{
//超出最大处理数字
return
""
;
}
if
(
money
==
0
)
{
chineseStr
=
cnNums
[
0
]
+
cnIntLast
+
cnInteger
;
return
chineseStr
;
}
//转换为字符串
money
=
money
.
toString
();
if
(
money
.
indexOf
(
"
.
"
)
==
-
1
)
{
integerNum
=
money
;
decimalNum
=
""
;
}
else
{
parts
=
money
.
split
(
"
.
"
);
integerNum
=
parts
[
0
];
decimalNum
=
parts
[
1
].
substr
(
0
,
4
);
}
//获取整型部分转换
if
(
parseInt
(
integerNum
,
10
)
>
0
)
{
var
zeroCount
=
0
;
var
IntLen
=
integerNum
.
length
;
for
(
var
i
=
0
;
i
<
IntLen
;
i
++
)
{
var
n
=
integerNum
.
substr
(
i
,
1
);
var
p
=
IntLen
-
i
-
1
;
var
q
=
p
/
4
;
var
m
=
p
%
4
;
if
(
n
==
"
0
"
)
{
zeroCount
++
;
}
else
{
if
(
zeroCount
>
0
)
{
chineseStr
+=
cnNums
[
0
];
}
//归零
zeroCount
=
0
;
chineseStr
+=
cnNums
[
parseInt
(
n
)]
+
cnIntRadice
[
m
];
}
if
(
m
==
0
&&
zeroCount
<
4
)
{
chineseStr
+=
cnIntUnits
[
q
];
}
}
chineseStr
+=
cnIntLast
;
}
//小数部分
if
(
decimalNum
!=
""
)
{
var
decLen
=
decimalNum
.
length
;
for
(
var
i
=
0
;
i
<
decLen
;
i
++
)
{
var
n
=
decimalNum
.
substr
(
i
,
1
);
if
(
n
!=
"
0
"
)
{
chineseStr
+=
cnNums
[
Number
(
n
)]
+
cnDecUnits
[
i
];
}
}
}
if
(
chineseStr
==
""
)
{
chineseStr
+=
cnNums
[
0
]
+
cnIntLast
+
cnInteger
;
}
else
if
(
decimalNum
==
""
)
{
chineseStr
+=
cnInteger
;
}
this
.
from
.
applyTotalAmountLarge
=
chineseStr
;
},
},
};
</
script
>
...
...
@@ -716,6 +571,7 @@ export default {
<
style
scoped
>
.container
{
padding
:
20px
;
/* min-width : 0 */
}
</
style
>
...
...
@@ -726,11 +582,13 @@ 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; */
}
</
style
>
\ No newline at end of file
src/views/reimbursement/reimbursementList copy.vue
0 → 100644
View file @
2423ec69
<
template
>
<div
class=
"container"
>
<div>
<el-form
:inline=
"true"
:model=
"reimbursementQurey"
>
<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"
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
>
<el-button
style=
"margin: 5px"
size=
"mini"
type=
"info"
@
click=
"withdraw(scope.row)"
v-if=
"scope.row.reimbursementState == 0"
>
撤回
</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%"
>
<!-- filePath-->
<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"
>
<el-image
style=
"width: 100px; height: 100px"
:src=
"scope.row.filePath"
:preview-src-list=
"[scope.row.filePath]"
></el-image>
</
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)"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
</div>
</el-drawer>
<!-- 添加发票对话框 -->
<el-dialog
title=
"添加发票"
:visible.sync=
"dialogVisible"
width=
"30%"
>
<
template
>
<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
allow-create
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>
</
template
>
<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
: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
{
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
:
null
,
//判断是否显示附件的删除按钮
//修改发票表格
invoicelist
:
[],
invoiceQurey
:
{
companyId
:
null
,
reimbursementId
:
null
,
},
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
,
//隐藏
};
},
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
.
getReimbursement
();
},
methods
:
{
//添加
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
.
$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
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
}
else
{
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
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
},
//删除关系
delinvoice
(
data
){
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里面
}
})
.
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
{
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
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
重新提交失败
"
);
});
},
//撤回
withdraw
(
data
)
{
// console.log(data.reimbursementId)
reimbursementId
(
data
.
reimbursementId
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getReimbursement
();
}
});
},
//查看图片的方法
ReviseImage
(
row
)
{
this
.
invoiceShow
=
true
;
this
.
getinvoiveId
.
reimbursementId
=
row
.
reimbursementId
;
this
.
Selectinsertlsit
();
},
//查询发票图片
Selectinsertlsit
()
{
console
.
log
(
this
.
getinvoivelist
)
selectAllById
(
this
.
getinvoiveId
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
this
.
getinvoivelist
.
forEach
((
e
)
=>
{
e
.
filePath
=
process
.
env
.
VUE_APP_BASE_API
+
e
.
filePath
;
});
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取发票图片失败
"
);
this
.
back
();
});
},
///----附件区域
//查看项目附件.....
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
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//下载附件
delProject
(
row
)
{
console
.
log
(
row
)
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
process
.
env
.
VUE_APP_BASE_API
+
row
.
enclosureFile
;
// 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
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
;
deleteById
(
row
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
selectImage
(
row
);
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
})
.
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
{
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
!=
""
)
{
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 @
2423ec69
<
template
>
<div
class=
"container"
>
<!-- 申请报销头部模块 -->
<div>
<el-form
:inline=
"true"
:model=
"reimbursementQurey"
>
<el-form-item>
...
...
@@ -12,7 +13,7 @@
</el-form-item>
</el-form>
</div>
<!-- 表格模块 -->
<div
class=
"conter"
>
<el-table
:data=
"reimbursementList"
...
...
@@ -89,7 +90,7 @@
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"序号"
width=
"50px"
>
<el-table-column
label=
"序号"
width=
"50px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
(
reimbursementQurey
.
pageNum
-
1
)
*
reimbursementQurey
.
pageSize
+
...
...
@@ -98,24 +99,23 @@
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"projectName"
label=
"项目"
/>
<!-- <el-table-column prop="typeName" label="报销类别">
<template slot-scope="scope">
<el-tag>{{ scope.row.typeName }}</el-tag>
</template>
</el-table-column> -->
<el-table-column
prop=
"applyTotalAmountSmall"
label=
"申报总金额"
/>
<el-table-column
label=
"核报总金额"
>
<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=
"组长审批人"
>
<el-table-column
label=
"组长审批人"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
financeName
||
"
暂无
"
}}
</
template
>
</el-table-column>
<el-table-column
label=
"财务审批人"
>
<el-table-column
label=
"财务审批人"
align=
"center"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
financeName
||
"
暂无
"
}}
</
template
>
...
...
@@ -123,26 +123,52 @@
<el-table-column
prop=
"fillingTime"
label=
"报销日期"
align=
"center"
:formatter=
"timestampToTime"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"发票图片"
>
<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=
"reimbursementState"
label=
"状态"
>
<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 == 0 ||
props.row.reimbursementState == 1
? 'info'
: props.row.reimbursementState == 1 ||
props.row.reimbursementState == 3
: props.row.reimbursementState == 3
? 'success'
: 'danger'
"
...
...
@@ -161,7 +187,7 @@
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
fixed=
"right"
>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin: 5px"
...
...
@@ -171,7 +197,9 @@
@
click=
"updataReimbursement(scope.row)"
v-if=
"
scope.row.reimbursementState != 3 &&
scope.row.reimbursementState != 1
scope.row.reimbursementState != 1 &&
scope.row.reimbursementState != 2 &&
scope.row.reimbursementState != 4
"
>
修改信息
</el-button
>
...
...
@@ -195,47 +223,71 @@
>
撤回
</el-button
>
<el-link
type=
"success"
style=
"margin: 5px"
size=
"mini"
<div
v-if=
"scope.row.reimbursementState == 3"
>
已通过
</el-link
style=
"width:100%;text-align: center ; color:#67C23A;"
>
<el-link
type=
"info"
style=
"margin: 5px"
size=
"mini"
已通过
</div>
<div
v-if=
"scope.row.reimbursementState == 1"
>
待审批
</el-link
style=
"width:100%;text-align: center ; color:darkgray;"
>
待审批
</div>
</
template
>
</el-table-column>
</el-table>
<!-- 查看详情 -->
<el-drawer
title=
"查看详情"
:visible.sync=
"drawer"
:direction=
"direction"
>
<el-row>
<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=
"金额"
>
{{item.money}}
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
>
{{item.explain}}
</el-descriptions-item>
<el-descriptions-item
label=
"说明"
>
{{item.remarks}}
</el-descriptions-item>
<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=
"
4
0%"
size=
"
3
0%"
>
<!-- filePath-->
<el-table
:data=
"getinvoivelist"
style=
"width: 100%; text-align: center"
...
...
@@ -244,19 +296,100 @@
<el-table-column
type=
"index"
label=
"序号"
width=
"
4
0"
width=
"
8
0"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"发票详情"
>
<
template
slot-scope=
"scope"
>
<el-image
style=
"width: 100px; height: 100px"
:src=
"scope.row.filePath"
:preview-src-list=
"[scope.row.filePath]"
></el-image>
<div
v-if=
"formatProtocolType(scope.row)"
>
<el-image
style=
"width: 100px; height: 100px"
:src=
"scope.row.filePath"
:preview-src-list=
"[scope.row.filePath]"
></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)"
>
删除
</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
allow-create
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
...
...
@@ -267,16 +400,161 @@
: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
: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
{
queryBypage
,
resubmit
,
reimbursementId
}
from
"
@/api/reimbursement
"
;
import
{
selectByReimbursementId
}
from
"
@/api/reimbursementDetails
"
;
import
{
selectAllById
}
from
"
@/api/project
"
;
import
{
selectAllById
,
deletBystatus
,
selectAllBystatus
,
updatesubmit
,
selectByIdF
,
deleteById
,
}
from
"
@/api/project
"
;
export
default
{
data
()
{
return
{
isDisabled
:
null
,
//判断是否显示附件的删除按钮
//修改发票表格
invoicelist
:
[],
invoiceQurey
:
{
companyId
:
null
,
reimbursementId
:
null
,
},
getinvoivelist
:
[],
//可以选择的发票号
dialogVisible
:
false
,
//内容样式
contentStyle
:
{
"
text-align
"
:
"
center
"
,
},
//label样式
labelStyle
:
{
width
:
"
80px
"
},
reimbursementQurey
:
{
userId
:
null
,
pageNum
:
1
,
...
...
@@ -286,45 +564,169 @@ export default {
reimbursementList
:
[],
//抽屉
drawer
:
false
,
drawer1
:
false
,
invoiceShow
:
false
,
direction
:
"
rtl
"
,
reimbursementDetails
:
{
list
:
[],
},
getinvoivelist
:
[],
//查询图片给的值
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
,
//隐藏
};
},
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
.
getReimbursement
();
},
methods
:
{
//图片格式
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
.
$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
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getinvoivelist
=
res
.
data
;
}
else
{
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
;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
});
},
//删除关系
delinvoice
(
data
)
{
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
;
this
.
$message
.
success
(
res
.
msg
);
this
.
reimbursementDetails
.
list
=
res
.
data
;
//接口返回res里面
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
查询失败
"
);
});
},
//申请报销
addreimbursement
()
{
this
.
$router
.
push
({
path
:
"
/reimbursementAdd
"
});
...
...
@@ -355,6 +757,7 @@ export default {
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
,
//摘要
...
...
@@ -400,6 +803,7 @@ export default {
},
//撤回
withdraw
(
data
)
{
// console.log(data.reimbursementId)
reimbursementId
(
data
.
reimbursementId
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
getReimbursement
();
...
...
@@ -408,6 +812,7 @@ export default {
},
//查看图片的方法
ReviseImage
(
row
)
{
// console.log(row)
this
.
invoiceShow
=
true
;
this
.
getinvoiveId
.
reimbursementId
=
row
.
reimbursementId
;
this
.
Selectinsertlsit
();
...
...
@@ -421,7 +826,6 @@ export default {
this
.
getinvoivelist
.
forEach
((
e
)
=>
{
e
.
filePath
=
process
.
env
.
VUE_APP_BASE_API
+
e
.
filePath
;
});
// console.log(this.getinvoivelist);
}
else
{
this
.
$message
.
error
(
res
.
msg
);
this
.
back
();
...
...
@@ -432,6 +836,154 @@ export default {
this
.
back
();
});
},
//pdf,展示
handlePreView
(
row
)
{
const
photopath
=
row
.
filePath
;
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
{
this
.
$message
.
error
(
res
.
msg
);
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
获取附件文件失败
"
);
});
},
//下载附件
delProject
(
row
)
{
console
.
log
(
row
);
var
a
=
document
.
createElement
(
"
a
"
);
//创建一个
<
a
><
/a>标
签
a
.
href
=
process
.
env
.
VUE_APP_BASE_API
+
row
.
enclosureFile
;
// 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
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
;
deleteById
(
row
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
selectImage
(
row
);
this
.
$message
({
message
:
"
删除成功
"
,
type
:
"
success
"
,
});
this
.
visible
=
false
;
console
.
log
(
res
.
msg
);
}
})
.
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
{
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
!=
""
)
{
this
.
fileTypepdf
=
true
;
}
else
{
this
.
$message
.
warning
(
"
附件只能只能上传文件
"
);
this
.
$refs
.
upload1
.
clearFiles
();
this
.
fileTypepdf
=
false
;
}
},
},
};
</
script
>
...
...
@@ -446,4 +998,34 @@ export default {
.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/reimbursementUpdata.vue
View file @
2423ec69
...
...
@@ -29,24 +29,15 @@
<el-input
v-model=
"from.summary"
></el-input>
</el-form-item>
<el-form-item
label=
"报销总金额-大写"
prop=
"applyTotalAmountLarge"
>
<el-form-item
label=
"报销总金额-大写
(元)
"
prop=
"applyTotalAmountLarge"
>
<el-input
v-model=
"from.applyTotalAmountLarge"
></el-input>
</el-form-item>
<el-form-item
label=
"报销总金额-小写"
prop=
"applyTotalAmountSmall"
>
<el-form-item
label=
"报销总金额-小写
(元)
"
prop=
"applyTotalAmountSmall"
>
<el-input
v-model=
"from.applyTotalAmountSmall"
></el-input>
</el-form-item>
<el-form-item
label=
"支付方式"
prop=
"paymentMethod"
>
<el-input
v-model=
"from.paymentMethod"
></el-input>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-input
type=
"textarea"
:rows=
"2"
placeholder=
"请输入内容"
v-model=
"textarea"
>
</el-input>
</el-form-item>
<br
/>
<el-form-item>
<el-button
type=
"success"
icon=
"el-icon-upload2"
@
click=
"updateForm()"
>
修改
</el-button>
...
...
@@ -56,20 +47,26 @@
</el-form>
</div>
<div
class=
"spend"
><el-form
<div
class=
"spend"
>
<el-form
:model=
"reimbursementItemData"
:inline=
"true"
ref=
"details"
label-width=
"150px"
>
<el-row
:gutter=
"20"
>
<el-col
:xl=
"12"
:lg=
"12"
:md=
"24"
:sm=
"24"
style=
"margin: 10px 0px"
<el-row
v-for=
"(item, index) in reimbursementItemData.list"
:key=
"index"
>
<el-form-item
:label=
"item.name"
:prop=
"'list.' + index + '.money'"
:rules=
"
{ validator: moneyrow, trigger: 'blur' }"
:key=
"index"
>
<el-col>
<el-form-item
:label=
"item.name"
:prop=
"'list.' + index + '.money'"
:rules=
"
{ validator: moneyrow, trigger: 'blur' ,required: true,}"
>
<el-input
v-model=
"item.money"
></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>
...
...
@@ -80,8 +77,7 @@
<
script
>
import
{
selectById
}
from
"
@/api/company
"
;
import
{
selectById
as
reimbursementSelectById
,
update
}
from
"
@/api/reimbursement
"
import
{
money
}
from
"
@/utils/myValidate
"
// import {selectAll as typeSelectAll} from "@/api/type";
import
{
money
}
from
"
@/utils/myValidate
"
;
import
{
selectAll
as
projectSelectAll
}
from
"
@/api/project
"
;
import
{
selectByReimbursementId
}
from
"
@/api/reimbursementDetails
"
;
import
{
update
as
detailsUpdate
}
from
"
@/api/reimbursementDetails
"
;
...
...
@@ -93,7 +89,7 @@ import {
export
default
{
data
()
{
return
{
textarea
:
""
,
//备注
reimbursementItemData
:
{
list
:
[],
},
...
...
@@ -131,7 +127,8 @@ export default {
reimbursementState
:
0
,
//状态
projectId
:
null
,
//项目id
typeId
:
null
,
//报销类别id
invoiceId
:
null
invoiceId
:
null
,
money
:
""
,
//备注
},
//发票编号数组
getinvoivelist
:
[],
...
...
@@ -200,9 +197,12 @@ export default {
};
},
created
()
{
//v-model 绑定的数据this.from.userId
//this.$store.getters.info.userId 拿来query传过来的参数
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
()
...
...
@@ -242,20 +242,8 @@ export default {
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
()
// reimbursementSelectById({reimbursementId:this.reimbursementId}).then((res)=>{
// if(res.success){
// this.from = res.data
// this.from.userPhone = this.$store.getters.info.userPhone
// this.getProject()
// //处理时间
// this.time(this.from.fillingTime)
// }else{
// this.$message.error(res.msg)
// }
// }).catch((error)=>{
// this.$message.error("获取数据失败")
// })
},
//获取个人的项目
getProject
(){
...
...
@@ -367,7 +355,9 @@ export default {
companyId
:
this
.
$store
.
getters
.
companyId
,
status
:
0
,
type
:
2
,
userId
:
this
.
$store
.
getters
.
info
.
userId
,
};
console
.
log
(
this
.
$store
.
getters
.
companyId
)
selectAllBystatus
(
param
)
.
then
((
res
)
=>
{
// console.log(res)
...
...
@@ -383,6 +373,17 @@ export default {
this
.
back
();
});
},
//定义金额校验
moneyrow
(
rule
,
value
,
callback
)
{
let
RegExp
=
/
(
^
([
-
]?)[
1-9
]([
0-9
]
+
)?(\.[
0-9
]{1,2})?
$
)
|
(
^
([
-
]?)(
0
){1}
$
)
|
(
^
([
-
]?)[
0-9
]\.[
0-9
]([
0-9
])?
$
)
/
;
// /^(([1-9][0-9]{0,14})|([0]{1})|(([0]\\.\\d{1,2}|[1-9][0-9]{0,14}\\.\\d{1,2})))$/;
if
(
RegExp
.
test
(
value
))
{
callback
();
}
else
{
callback
(
new
Error
(
"
金额格式错误
"
));
}
},
},
};
</
script
>
...
...
src/views/type/typeList.vue
View file @
2423ec69
<
template
>
<div>
<el-upload
class=
"upload-demo"
action=
"http://192.168.10.109:11523/uploadFile"
:on-preview=
"handlePreview"
:on-remove=
"handleRemove"
:before-remove=
"beforeRemove"
multiple
:limit=
"3"
:on-exceed=
"handleExceed"
:file-list=
"fileList"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传jpg/png文件,且不超过500kb
</div>
</el-upload>
<div
class=
"container"
>
<div>
<el-form
:inline=
"true"
:model=
"typeQurey"
>
<el-form-item
label=
"类别名称"
>
<el-input
v-model=
"typeQurey.typeName"
placeholder=
"类别名称"
></el-input>
</el-form-item>
<el-form-item
label=
"列别"
>
<el-select
v-model=
"typeQurey.typeCategory"
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=
"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=
"addtype()"
>
添加类型
</el-button
>
</el-form-item>
</el-form>
</div>
<div
class=
"conter"
>
<el-table
:data=
"typeList"
style=
"width: 100%; text-align: center"
border
>
<el-table-column
label=
"序号"
width=
"50px"
>
<template
slot-scope=
"scope"
>
{{
(
typeQurey
.
pageNum
-
1
)
*
typeQurey
.
pageSize
+
scope
.
$index
+
1
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"typeName"
label=
"类别名称"
/>
<el-table-column
label=
"类别种类"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.typeCategory == '0' ? 'success' : scope.row.typeCategory == '1' ? 'danger':'warning' "
>
{{
scope
.
row
.
typeCategory
==
'
0
'
?
'
收入类别
'
:
scope
.
row
.
typeCategory
==
'
1
'
?
'
支出类别
'
:
'
报销类别
'
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
style=
"margin:5px"
size=
"mini"
icon=
"el-icon-edit"
type=
"info"
@
click=
"updataType(scope.row)"
>
修改信息
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<div
class=
"footer"
>
<el-pagination
@
current-change=
"handleCurrentChange"
:current-page.sync=
"typeQurey.pageNum"
:page-size=
"typeQurey.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
>
</el-pagination>
</div>
</div>
</template>
<
script
>
import
{
select
}
from
"
@/api/type
"
;
export
default
{
data
()
{
return
{
fileList
:
[]
};
},
methods
:
{
handleRemove
(
file
,
fileList
)
{
console
.
log
(
file
,
fileList
);
},
handlePreview
(
file
)
{
console
.
log
(
file
);
return
{
typeQurey
:
{
typeName
:
null
,
typeCategory
:
null
,
companyId
:
null
,
pageNum
:
1
,
pageSize
:
10
,
},
handleExceed
(
files
,
fileList
)
{
this
.
$message
.
warning
(
`当前限制选择 3 个文件,本次选择了
${
files
.
length
}
个文件,共选择了
${
files
.
length
+
fileList
.
length
}
个文件`
);
},
beforeRemove
(
file
,
fileList
)
{
return
this
.
$confirm
(
`确定移除
${
file
.
name
}
?`
);
options
:
[
{
value
:
"
0
"
,
label
:
"
收入类别
"
,
},
{
value
:
"
1
"
,
label
:
"
支出类别
"
,
},
{
value
:
"
2
"
,
label
:
"
报销类别
"
,
}
],
total
:
0
,
typeList
:[]
};
},
created
()
{
this
.
typeQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
this
.
getTypeList
()
},
methods
:
{
//获取种类
getTypeList
(){
select
(
this
.
typeQurey
).
then
((
res
)
=>
{
if
(
res
.
success
){
this
.
typeList
=
res
.
data
.
list
this
.
total
=
res
.
data
.
total
}
else
{
this
.
$message
.
error
(
res
.
msg
)
}
}).
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
查询失败
"
)
})
},
//重置
reset
()
{
this
.
typeQurey
=
{
typeName
:
null
,
typeCategory
:
null
,
companyId
:
null
,
pageNum
:
1
,
pageSize
:
10
,
}
this
.
typeQurey
.
companyId
=
this
.
$store
.
getters
.
companyId
this
.
getTypeList
()
},
//添加类型
addtype
()
{
this
.
$router
.
push
(
'
/typeAdd
'
)
},
//修改类型
updataType
(
data
){
this
.
$router
.
push
({
path
:
'
/typeUpdata
'
,
query
:{
id
:
data
.
typeId
,
}
})
},
//搜索
qurey
(){
this
.
typeQurey
.
pageNum
=
1
this
.
getTypeList
()
},
//换页
handleCurrentChange
(
val
){
this
.
typeQurey
.
pageNum
=
val
this
.
getTypeList
()
}
}
},
};
</
script
>
<
style
>
<
style
scoped
>
.container
{
padding
:
10px
;
}
.conter
{
margin-bottom
:
10px
;
}
.footer
{
text-align
:
right
;
}
</
style
>
\ No newline at end of file
Prev
1
2
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