Commit 2423ec69 authored by 柳 佳乐's avatar 柳 佳乐
Browse files

20221104

parent 344202ed
<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
<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
<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
...@@ -50,14 +50,20 @@ ...@@ -50,14 +50,20 @@
style="margin:1px 5px;" style="margin:1px 5px;"
@click="selectexpend()" @click="selectexpend()"
>查询</el-button> >查询</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-button type="success" icon="el-icon-download" @click="Reimbursement()">添加发票单</el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!-- 表格区域 --> <!-- 表格区域 -->
<div class="drawer" v-show="isgetid==0" style="margin-left:15px"> <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> <el-table-column label="序号" width="50" style>
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
...@@ -67,8 +73,8 @@ ...@@ -67,8 +73,8 @@
}} }}
</template> </template>
</el-table-column> </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="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="time" label="发票时间"></el-table-column>
<el-table-column prop="category" label="发票类型"> <el-table-column prop="category" label="发票类型">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -138,11 +144,11 @@ ...@@ -138,11 +144,11 @@
label-width="80px" label-width="80px"
class="demo-ruleForm" 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-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>
<el-form-item label="发票时间" required prop="time"> <el-form-item label="发票时间" required prop="time">
<el-date-picker <el-date-picker
...@@ -201,7 +207,7 @@ ...@@ -201,7 +207,7 @@
type="primary" type="primary"
style="margin-left:20px;margin-top:40px;" style="margin-left:20px;margin-top:40px;"
>选取文件</el-button> >选取文件</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-upload>
</el-col> </el-col>
</el-row> </el-row>
...@@ -311,7 +317,14 @@ export default { ...@@ -311,7 +317,14 @@ export default {
trigger: "change" 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: { invoiceList: {
......
...@@ -4,34 +4,20 @@ ...@@ -4,34 +4,20 @@
<div class="header"> <div class="header">
<el-form :inline="true" :model="projectQurey"> <el-form :inline="true" :model="projectQurey">
<el-form-item label="项目名称"> <el-form-item label="项目名称">
<el-input <el-input v-model="projectQurey.projectName" placeholder="项目名称"></el-input>
v-model="projectQurey.projectName"
placeholder="项目名称"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="项目编号"> <el-form-item label="项目编号">
<el-input <el-input v-model="projectQurey.projectNumber" placeholder="项目编号"></el-input>
v-model="projectQurey.projectNumber"
placeholder="项目编号"
></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qurey()" <el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
>查询</el-button <el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
>
<el-button
type="primary"
icon="el-icon-refresh-right"
@click="reset()"
>重置</el-button
>
<el-button <el-button
type="success" type="success"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click="addproject()" @click="addproject()"
v-show="false" v-show="false"
>添加项目</el-button >添加项目</el-button>
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -41,6 +27,8 @@ ...@@ -41,6 +27,8 @@
:data="projectList" :data="projectList"
style="width: 100%; text-align: center" style="width: 100%; text-align: center"
border border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
> >
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
...@@ -58,54 +46,76 @@ ...@@ -58,54 +46,76 @@
<el-table-column label="序号" width="50px"> <el-table-column label="序号" width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
(projectQurey.pageNum - 1) * projectQurey.pageSize + scope.$index + 1 (projectQurey.pageNum - 1) * projectQurey.pageSize + scope.$index + 1
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="projectName" label="项目名称" /> <el-table-column prop="projectName" label="项目名称" />
<el-table-column prop="projectNumber" label="项目编号" /> <el-table-column prop="projectNumber" label="项目编号" />
<el-table-column label="项目合同金额" > <el-table-column label="项目合同金额">
<template slot-scope="scope" > <template slot-scope="scope">
<p class="amounttext">{{scope.row.projectAmount}}</p> <p class="amounttext">{{scope.row.projectAmount}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="项目总收入金额" align="center"> <el-table-column label="项目总收入金额" align="center">
<el-table-column label="金额"> <el-table-column label="金额">
<template slot-scope="scope" > <template slot-scope="scope">
<p class="incometext">{{scope.row.projectIncome}}</p> <p class="incometext">{{scope.row.projectIncome}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope" > <template slot-scope="scope">
<el-button size="mini" type="success" @click="showIncome(scope.row)">查看详情</el-button> <el-button size="mini" type="success" @click="showIncome(scope.row)">查看详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="项目总支出金额" align="center"> <el-table-column label="项目总支出金额" align="center">
<el-table-column label="金额"> <el-table-column label="金额">
<template slot-scope="scope" > <template slot-scope="scope">
<p class="expendtext">{{scope.row.projectExpend}}</p> <p class="expendtext">{{scope.row.projectExpend}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope" > <template slot-scope="scope">
<el-button size="mini" type="danger" @click="showExpend(scope.row)">查看详情</el-button> <el-button size="mini" type="danger" @click="showExpend(scope.row)">查看详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="projectExpense" label="项目总报销金额" > <el-table-column prop="projectExpense" label="项目总报销金额">
<template slot-scope="scope" > <template slot-scope="scope">
<p class="expendtext">{{scope.row.projectExpense}}</p> <p class="expendtext">{{scope.row.projectExpense}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="projectStartTime" label="项目开始时间" align="center" :formatter="timestampToTime"/> <el-table-column
<el-table-column prop="projectEndTime" label="项目结束时间" align="center" :formatter="timestampToTime"/> 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"> <el-table-column prop="projectAmount" label="操作" align="center">
<template slot-scope="scope"> <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
<el-button style="margin:5px" size="mini" icon="el-icon-coin" type="primary" @click="member(scope.row)">成员管理</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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -118,120 +128,120 @@ ...@@ -118,120 +128,120 @@
:page-size="projectQurey.pageSize" :page-size="projectQurey.pageSize"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" :total="total"
> ></el-pagination>
</el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { selectBYPression } from "@/api/project";
import { selectBYPression } from '@/api/project'
export default { export default {
data(){ data() {
return{ return {
projectQurey:{ projectQurey: {
projectName:null, projectName: null,
projectNumber:null, projectNumber: null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userId:null, userId: null,
memberPression:0 memberPression: 0
}, },
projectList:[], projectList: [],
total:null, total: null
} };
}, },
created(){ created() {
this.projectQurey.userId = this.$store.getters.urId this.projectQurey.userId = this.$store.getters.urId;
this.getProjectList(); this.getProjectList();
}, },
methods:{ methods: {
//获取项目列表 //获取项目列表
getProjectList(){ getProjectList() {
selectBYPression(this.projectQurey).then((res)=>{ selectBYPression(this.projectQurey)
if(res.success){ .then(res => {
//请求成功,获取到了数据 if (res.success) {
this.projectList = res.data.list //请求成功,获取到了数据
this.total = res.data.total this.projectList = res.data.list;
}else{ this.total = res.data.total;
this.$message.error(res.msg) } else {
} this.$message.error(res.msg);
}).catch((error)=>{ }
this.$message.error("获取数据失败") })
}) .catch(error => {
this.$message.error("获取数据失败");
});
}, },
//查询 //查询
qurey(){ qurey() {
this.projectQurey.pageNum = 1 this.projectQurey.pageNum = 1;
this.getProjectList() this.getProjectList();
}, },
//重置 //重置
reset(){ reset() {
this.projectQurey = { this.projectQurey = {
projectName:null, projectName: null,
projectNumber:null, projectNumber: null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userId:null, userId: null,
memberPression:0 memberPression: 0
} };
this.projectQurey.userId = this.$store.getters.urId this.projectQurey.userId = this.$store.getters.urId;
this.getProjectList() this.getProjectList();
}, },
//添加项目 //添加项目
addproject(){ addproject() {
this.$router.push('/projectAdd') this.$router.push("/projectAdd");
}, },
//分页 //分页
handleCurrentChange(val){ handleCurrentChange(val) {
this.projectQurey.pageNum = val this.projectQurey.pageNum = val;
this.getProjectList() this.getProjectList();
}, },
//修改项目 //修改项目
updataProject(data){ updataProject(data) {
this.$router.push({ this.$router.push({
path: '/projectUpdata', path: "/projectUpdata",
query:{ query: {
id:data.projectId, id: data.projectId
} }
}) });
}, },
//时间处理 //时间处理
timestampToTime(row,column,cellValue) { timestampToTime(row, column, cellValue) {
return cellValue.split(' ')[0] return cellValue.split(" ")[0];
}, },
//查看收入详情列表 //查看收入详情列表
showIncome(data){ showIncome(data) {
this.$router.push({ this.$router.push({
path: '/incomeList', path: "/incomeList",
query:{ query: {
id:data.projectId, id: data.projectId,
backid:1 backid: 1
} }
}) });
}, },
//成员管理 //成员管理
member(data){ member(data) {
this.$store.dispatch("settings/setMemberId",1) this.$store.dispatch("settings/setMemberId", 1);
this.$router.push({ this.$router.push({
path: '/memberList', path: "/memberList",
query:{ query: {
id:data.projectId, id: data.projectId
} }
}) });
}, },
//查看支出详情列表 //查看支出详情列表
showExpend(data){ showExpend(data) {
this.$router.push({ this.$router.push({
path: '/expendList', path: "/expendList",
query:{ query: {
id:data.projectId, id: data.projectId,
backlistid:1 backlistid: 1
} }
}) });
} }
} }
}; };
...@@ -247,18 +257,18 @@ export default { ...@@ -247,18 +257,18 @@ export default {
.footer { .footer {
text-align: right; text-align: right;
} }
.incometext{ .incometext {
color: #13ce66; color: #13ce66;
font-weight: 600; font-weight: 600;
font-size: 15px; font-size: 15px;
} }
.amounttext{ .amounttext {
color: #1890ff; color: #1890ff;
font-weight: 600; font-weight: 600;
font-size: 15px; font-size: 15px;
} }
.expendtext{ .expendtext {
color: rgb(255, 0, 0); color: rgb(255, 0, 0);
font-weight: 600; font-weight: 600;
font-size: 15px; font-size: 15px;
......
...@@ -127,12 +127,13 @@ ...@@ -127,12 +127,13 @@
<script> <script>
import { import {
selectByProjectId, selectByProjectId,
insertList,
queryBypageIncomeAdd,
selectAllBystatus, selectAllBystatus,
updatesubmit updatesubmit
} from "@/api/project"; } from "@/api/project";
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { insert } from "@/api/expend"; import { insert } from "@/api/expend";
import { money } from "@/utils/myValidate";
export default { export default {
data() { data() {
return { return {
...@@ -152,31 +153,25 @@ export default { ...@@ -152,31 +153,25 @@ export default {
}, },
typeList: [], typeList: [],
projectData: {}, 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, companyId: 0,
typeList: [], typeList: [],
projectData: {}, projectData: {},
//表单验证内容 //表单验证内容
rules: { 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: [ expendType: [
{ required: true, message: "请输入支出类别", trigger: "change" } { required: true, message: "请输入支出类别", trigger: "change" }
], ],
expendMoney: [
{ required: true, validator: money, trigger: "blur" }
],
expendObject: [ expendObject: [
{ required: true, message: "请输入支出对象", trigger: "change" } { required: true, message: "请输入支出对象", trigger: "change" }
], ],
......
...@@ -45,7 +45,13 @@ ...@@ -45,7 +45,13 @@
</div> </div>
<div class="conter"> <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"> <el-table-column label="序号" width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
...@@ -85,7 +91,7 @@ ...@@ -85,7 +91,7 @@
<el-tag effect="plain">{{ scope.row.userName }}</el-tag> <el-tag effect="plain">{{ scope.row.userName }}</el-tag>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<el-button <el-button
style="margin: 5px" style="margin: 5px"
...@@ -217,11 +223,15 @@ ...@@ -217,11 +223,15 @@
<el-table-column prop="mone" label="金额" width="180"></el-table-column> <el-table-column prop="mone" label="金额" width="180"></el-table-column>
<el-table-column prop="prop" label="查看PDF文件或图片"> <el-table-column prop="prop" label="查看PDF文件或图片">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.filePath != null"> <div v-if="formatProtocolType(scope.row)">
<a class="a-style" @click="handlePreView(scope.row)">点击查看图片或文件</a> <el-image
style="width: 100px; height: 100px"
:src="getimagin(scope.row)"
:preview-src-list="srcList"
></el-image>
</div> </div>
<div v-else> <div v-else>
<p>无图片或文件</p> <a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -458,8 +468,7 @@ export default { ...@@ -458,8 +468,7 @@ export default {
delProject(row) { delProject(row) {
var a = document.createElement("a"); //创建一个<a></a>标 var a = document.createElement("a"); //创建一个<a></a>标
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a.target = "_blank"
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了 a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
...@@ -485,28 +494,32 @@ export default { ...@@ -485,28 +494,32 @@ export default {
this.drawer = true; this.drawer = true;
this.getinvoiveId.expendId = row.expendId; this.getinvoiveId.expendId = row.expendId;
this.incomeIdgrt = row.expendId; this.incomeIdgrt = row.expendId;
//console.log(process.env.VUE_APP_BASE_API);
this.Selectinsertlsit(); this.Selectinsertlsit();
}, },
//查询发票图片 //查询发票图片
Selectinsertlsit() { Selectinsertlsit() {
console.log(selectAllById(this.getinvoiveId));
selectAllById(this.getinvoiveId) selectAllById(this.getinvoiveId)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
// this.getinvoivelist.forEach(e => { this.srcList = [];
// e.filePath = process.env.VUE_APP_BASE_API + e.filePath; res.data.forEach(e => {
// }); let fileNamepdf = e.filePath;
console.log(this.getinvoivelist); let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
if (fileType != ".pdf") {
this.srcList.push(process.env.VUE_APP_BASE_API + e.filePath);
}
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); //this.back();
} }
}) })
.catch(error => { .catch(error => {
this.$message.error("获取发票图片失败"); this.$message.error("获取发票图片失败");
this.back(); //this.back();
}); });
}, },
back() { back() {
...@@ -536,12 +549,10 @@ export default { ...@@ -536,12 +549,10 @@ export default {
//点击查看发票 //点击查看发票
handlePreView(row) { handlePreView(row) {
const photopath = process.env.VUE_APP_BASE_API + row.filePath; const photopath = process.env.VUE_APP_BASE_API + row.filePath;
console.log(photopath);
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
//查看项目附件..... //查看项目附件.....
selectImage(row) { selectImage(row) {
console.log(row);
this.queryDTO.expendId = row.expendId; this.queryDTO.expendId = row.expendId;
this.proutlist1.Id = row.expendId; this.proutlist1.Id = row.expendId;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
...@@ -589,7 +600,6 @@ export default { ...@@ -589,7 +600,6 @@ export default {
this.dialogFormVisible = false; this.dialogFormVisible = false;
}, },
Buttonback2() { Buttonback2() {
console.log(this.getListincom);
let list = []; let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销 //提交发票与收入关系 status默认为1 表示发票已报销
this.getListincom.forEach(item => { this.getListincom.forEach(item => {
...@@ -599,7 +609,6 @@ export default { ...@@ -599,7 +609,6 @@ export default {
status: 1 status: 1
}); });
}); });
console.log(list);
updatesubmit(list).then(res => { updatesubmit(list).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
...@@ -618,13 +627,11 @@ export default { ...@@ -618,13 +627,11 @@ export default {
}, },
//删除发票 //删除发票
DeleteFrom(row) { DeleteFrom(row) {
console.log(row);
//收集被删除发票的数据 //收集被删除发票的数据
let BillList = { let BillList = {
invoiceId: row.invoiceId, invoiceId: row.invoiceId,
expendId: row.expendId expendId: row.expendId
}; };
console.log(BillList);
deletBystatus(BillList) deletBystatus(BillList)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
...@@ -634,13 +641,30 @@ export default { ...@@ -634,13 +641,30 @@ export default {
type: "success" type: "success"
}); });
this.Selectinsertlsit(); this.Selectinsertlsit();
console.log(res.msg);
} }
}) })
.catch(errror => { .catch(errror => {
this.$message.error(res.msg); 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----------- // 附件-------0-----------
//显示添加附件 //显示添加附件
...@@ -660,7 +684,6 @@ export default { ...@@ -660,7 +684,6 @@ export default {
type: "success" type: "success"
}); });
this.visible = false; this.visible = false;
console.log(res.msg);
} }
}) })
.catch(errror => { .catch(errror => {
...@@ -676,7 +699,6 @@ export default { ...@@ -676,7 +699,6 @@ export default {
determine() { determine() {
//判断是否有附件文件 //判断是否有附件文件
if (this.fileTypepdf) { if (this.fileTypepdf) {
this.$refs.upload1.submit(); this.$refs.upload1.submit();
this.getshow = 1; this.getshow = 1;
this.disabled = false; this.disabled = false;
...@@ -693,12 +715,11 @@ export default { ...@@ -693,12 +715,11 @@ export default {
//刷新附件 //刷新附件
Refresh() { Refresh() {
this.queryDTO.expendId = this.proutlist1.Id; this.queryDTO.expendId = this.proutlist1.Id;
console.log(this.proutlist1.Id);
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.queryDTOList = res.data; this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe=""//初始化数据 this.proutlist1.enclosureDescribe = ""; //初始化数据
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
...@@ -733,7 +754,6 @@ export default { ...@@ -733,7 +754,6 @@ export default {
}, },
//附件文件校验 //附件文件校验
onChangepdf(file) { onChangepdf(file) {
console.log(this.proutlist1);
const fileNamepdf = file.name; const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf(".")); let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType != "") { if (fileType != "") {
......
...@@ -125,7 +125,7 @@ import { ...@@ -125,7 +125,7 @@ import {
} from "@/api/project"; } from "@/api/project";
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { insert } from "@/api/imcome"; import { insert } from "@/api/imcome";
import { money } from "@/utils/myValidate";
export default { export default {
data() { data() {
return { return {
...@@ -163,7 +163,12 @@ export default { ...@@ -163,7 +163,12 @@ export default {
{ required: true, message: "没有输入收入详情", trigger: "change" } { required: true, message: "没有输入收入详情", trigger: "change" }
], ],
incomeMoney: [ 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: [ incomeTime: [
{ required: true, message: "请选择收到时间", trigger: "change" } { required: true, message: "请选择收到时间", trigger: "change" }
......
...@@ -43,7 +43,13 @@ ...@@ -43,7 +43,13 @@
</div> </div>
<div class="conter"> <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"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-form label-position="left" class="demo-table-expand"> <el-form label-position="left" class="demo-table-expand">
...@@ -130,17 +136,23 @@ ...@@ -130,17 +136,23 @@
:data="getinvoivelist" :data="getinvoivelist"
style="width: 94%; margin:10px 3%; text-align: center" style="width: 94%; margin:10px 3%; text-align: center"
border border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
> >
<el-table-column type="index" label="序号" width="40px"></el-table-column> <el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column prop="number" label="号码" width="160px"></el-table-column> <el-table-column prop="number" label="号码" width="160px"></el-table-column>
<el-table-column prop="mone" label="金额" width="180px"></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"> <template slot-scope="scope">
<div v-if="scope.row.filePath != null"> <div v-if="formatProtocolType(scope.row)">
<a class="a-style" @click="handlePreView(scope.row)">点击查看图片或文件</a> <el-image
style="width: 100px; height: 100px"
:src="getimagin(scope.row)"
:preview-src-list="srcList"
></el-image>
</div> </div>
<div v-else> <div v-else>
<p>无图片或文件</p> <a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -374,7 +386,7 @@ export default { ...@@ -374,7 +386,7 @@ export default {
}, },
fileTypepdf: false, //判断合同文件是否存在 fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //合同文件 fileList1: [], //合同文件
disabled: false //隐藏 disabled: false //隐藏,
}; };
}, },
computed: { computed: {
...@@ -528,12 +540,11 @@ export default { ...@@ -528,12 +540,11 @@ export default {
this.$message.error("获取附件文件失败"); this.$message.error("获取附件文件失败");
}); });
}, },
//查看图片的方法 //查看pdf的方法
ReviseImage(row) { ReviseImage(row) {
this.drawer = true; this.drawer = true;
this.getinvoiveId.incomeId = row.incomeId; this.getinvoiveId.incomeId = row.incomeId;
this.incomeIdgrt = row.incomeId; this.incomeIdgrt = row.incomeId;
//console.log(process.env.VUE_APP_BASE_API);
this.Selectinsertlsit(); this.Selectinsertlsit();
}, },
//查询发票图片 //查询发票图片
...@@ -542,7 +553,16 @@ export default { ...@@ -542,7 +553,16 @@ export default {
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; 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 { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
...@@ -600,7 +620,7 @@ export default { ...@@ -600,7 +620,7 @@ export default {
var a = document.createElement("a"); //创建一个<a></a>标 var a = document.createElement("a"); //创建一个<a></a>标
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 //a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a.target = "_blank" a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了 a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
...@@ -629,10 +649,8 @@ export default { ...@@ -629,10 +649,8 @@ export default {
this.selectGet(); this.selectGet();
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.getListincom = []; this.getListincom = [];
console.log();
}, },
Buttonback2() { Buttonback2() {
console.log(this.getListincom);
let list = []; let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销 //提交发票与收入关系 status默认为1 表示发票已报销
this.getListincom.forEach(item => { this.getListincom.forEach(item => {
...@@ -642,7 +660,7 @@ export default { ...@@ -642,7 +660,7 @@ export default {
status: 1 status: 1
}); });
}); });
console.log(list);
updatesubmit(list).then(res => { updatesubmit(list).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
...@@ -662,13 +680,11 @@ export default { ...@@ -662,13 +680,11 @@ export default {
}, },
//删除发票 //删除发票
DeleteFrom(row) { DeleteFrom(row) {
console.log(row);
//收集被删除发票的数据 //收集被删除发票的数据
let BillList = { let BillList = {
invoiceId: row.invoiceId, invoiceId: row.invoiceId,
incomeId: row.incomeId incomeId: row.incomeId
}; };
console.log(BillList);
deletBystatus(BillList) deletBystatus(BillList)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
...@@ -678,7 +694,6 @@ export default { ...@@ -678,7 +694,6 @@ export default {
type: "success" type: "success"
}); });
this.Selectinsertlsit(); this.Selectinsertlsit();
console.log(res.msg);
} }
}) })
.catch(errror => { .catch(errror => {
...@@ -704,7 +719,6 @@ export default { ...@@ -704,7 +719,6 @@ export default {
type: "success" type: "success"
}); });
this.visible = false; this.visible = false;
console.log(res.msg);
} }
}) })
.catch(errror => { .catch(errror => {
...@@ -714,6 +728,7 @@ export default { ...@@ -714,6 +728,7 @@ export default {
//清除附件文件 //清除附件文件
delfile1(file) { delfile1(file) {
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid); this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.proutlist1.enclosureDescribe = ""; //初始化数据
this.fileTypepdf = false; this.fileTypepdf = false;
}, },
//确定提交附件 //确定提交附件
...@@ -725,7 +740,7 @@ export default { ...@@ -725,7 +740,7 @@ export default {
this.$refs.upload1.submit(); this.$refs.upload1.submit();
this.getshow = 1; //隐藏与显示 this.getshow = 1; //隐藏与显示
this.disabled = false; this.disabled = false;
//this.backii(); //this.backii();
this.$message({ this.$message({
showClose: true, showClose: true,
message: "上传附件成功", message: "上传附件成功",
...@@ -738,14 +753,13 @@ export default { ...@@ -738,14 +753,13 @@ export default {
}, },
//刷新附件 //刷新附件
Refresh() { Refresh() {
console.log(this.proutlist1.Id);
this.queryDTO.incomeId = this.proutlist1.Id; this.queryDTO.incomeId = this.proutlist1.Id;
console.log(this.proutlist1.Id);
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.queryDTOList = res.data; this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe=""//初始化数据 this.proutlist1.enclosureDescribe = ""; //初始化数据
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
...@@ -759,18 +773,15 @@ export default { ...@@ -759,18 +773,15 @@ export default {
if (this.queryDTOList.length > 0) { if (this.queryDTOList.length > 0) {
this.getshow = 1; this.getshow = 1;
this.disabled = false; this.disabled = false;
this.backii();
this.delfile1(); this.delfile1();
} else { } else {
this.getshow = 3; this.getshow = 3;
this.disabled = false; this.disabled = false;
this.backii();
this.delfile1(); this.delfile1();
} }
}, },
//附件文件校验 //附件文件校验
onChangepdf(file) { onChangepdf(file) {
console.log(this.proutlist1);
const fileNamepdf = file.name; const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf(".")); let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType != "") { if (fileType != "") {
...@@ -780,7 +791,25 @@ export default { ...@@ -780,7 +791,25 @@ export default {
this.$refs.upload1.clearFiles(); this.$refs.upload1.clearFiles();
this.fileTypepdf = false; 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> </script>
......
...@@ -17,7 +17,13 @@ ...@@ -17,7 +17,13 @@
</div> </div>
<div class="conter"> <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"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-form label-position="left" class="demo-table-expand"> <el-form label-position="left" class="demo-table-expand">
...@@ -75,7 +81,7 @@ ...@@ -75,7 +81,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<p class="expendtext">{{scope.row.projectExpense}}</p> <p class="expendtext">{{scope.row.projectExpense}}</p>
</template> </template>
</el-table-column> --> </el-table-column>-->
<el-table-column <el-table-column
prop="projectStartTime" prop="projectStartTime"
label="项目开始时间" label="项目开始时间"
...@@ -115,7 +121,7 @@ export default { ...@@ -115,7 +121,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userId: null, userId: null,
memberPression:1 memberPression: 1
}, },
projectList: [], projectList: [],
total: null total: null
...@@ -155,7 +161,7 @@ export default { ...@@ -155,7 +161,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userId: null, userId: null,
memberPression:1 memberPression: 1
}; };
this.projectQurey.userId = this.$store.getters.urId; this.projectQurey.userId = this.$store.getters.urId;
this.getProjectList(); this.getProjectList();
...@@ -188,7 +194,7 @@ export default { ...@@ -188,7 +194,7 @@ export default {
path: "/incomeList", path: "/incomeList",
query: { query: {
id: data.projectId, id: data.projectId,
state:0 state: 0
} }
}); });
}, },
...@@ -207,7 +213,7 @@ export default { ...@@ -207,7 +213,7 @@ export default {
path: "/expendList", path: "/expendList",
query: { query: {
id: data.projectId, id: data.projectId,
state:0 state: 0
} }
}); });
} }
......
...@@ -139,6 +139,11 @@ export default { ...@@ -139,6 +139,11 @@ export default {
required: true, required: true,
message: "请输入项目合同金额(起始金额)", message: "请输入项目合同金额(起始金额)",
trigger: "blur" trigger: "blur"
},
{
pattern: /(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^([-]?)(0){1}$)|(^([-]?)[0-9]\.[0-9]([0-9])?$)/,
message: "输入项目合同金额不合法",
trigger: "change"
} }
], ],
timeSlot: [ timeSlot: [
......
...@@ -18,7 +18,13 @@ ...@@ -18,7 +18,13 @@
</div> </div>
<div class="conter"> <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"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-form label-position="left" class="demo-table-expand"> <el-form label-position="left" class="demo-table-expand">
...@@ -52,7 +58,7 @@ ...@@ -52,7 +58,7 @@
<p class="incometext">{{scope.row.projectIncome}}</p> <p class="incometext">{{scope.row.projectIncome}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" > <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="success" @click="showIncome(scope.row)">查看详情</el-button> <el-button size="mini" type="success" @click="showIncome(scope.row)">查看详情</el-button>
</template> </template>
...@@ -89,7 +95,7 @@ ...@@ -89,7 +95,7 @@
align="center" align="center"
:formatter="timestampToTime" :formatter="timestampToTime"
/> />
<el-table-column prop="projectAmount" label="操作" align="center"> <el-table-column prop="projectAmount" label="操作" align="center" width="130px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
style="margin:5px" style="margin:5px"
...@@ -217,7 +223,7 @@ export default { ...@@ -217,7 +223,7 @@ export default {
path: "/memberList", path: "/memberList",
query: { query: {
id: data.projectId, id: data.projectId,
staffId:0 staffId: 0
} }
}); });
}, },
......
...@@ -76,20 +76,21 @@ ...@@ -76,20 +76,21 @@
<el-descriptions-item label="财务驳回缘由" :span="5">{{ <el-descriptions-item label="财务驳回缘由" :span="5">{{
props.row.finaceRefute || "" props.row.finaceRefute || ""
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="查看详情" :span="5"> <el-descriptions-item label="查看详情" :span="5">
<el-button <el-button
@click="getdetails(props.row)" @click="getdetails(props.row)"
type="primary" type="primary"
style="margin: 5px" style="margin: 5px"
size="mini" size="mini"
>查看详情</el-button> >查看详情</el-button
</el-descriptions-item> >
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="序号" width="50px"> <el-table-column label="序号" align="center" width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
(reimbursementQurey.pageNum - 1) * reimbursementQurey.pageSize + (reimbursementQurey.pageNum - 1) * reimbursementQurey.pageSize +
...@@ -98,25 +99,24 @@ ...@@ -98,25 +99,24 @@
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userName" label="报销人" /> <el-table-column prop="userName" label="报销人" align="center" />
<el-table-column prop="projectName" label="项目" /> <el-table-column prop="projectName" label="项目" align="center" />
<!-- <el-table-column prop="typeName" label="报销类别"> <el-table-column
<template slot-scope="scope"> prop="applyTotalAmountSmall"
<el-tag>{{ scope.row.typeName }}</el-tag> label="申报总金额(元)"
</template> align="center"
</el-table-column> --> />
<el-table-column prop="applyTotalAmountSmall" label="申报总金额" /> <el-table-column label="核报总金额(元)" align="center">
<el-table-column label="核报总金额">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.verifyTotalAmountSmall || "还未核实金额" }} {{ props.row.verifyTotalAmountSmall || "还未核实金额" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="组长审批人"> <el-table-column label="组长审批人" align="center">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.headmanName || "暂无" }} {{ props.row.headmanName || "暂无" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="财务审批人"> <el-table-column label="财务审批人" align="center">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.financeName || "暂无" }} {{ props.row.financeName || "暂无" }}
</template> </template>
...@@ -124,9 +124,10 @@ ...@@ -124,9 +124,10 @@
<el-table-column <el-table-column
prop="fillingTime" prop="fillingTime"
label="报销日期" label="报销日期"
align="center"
:formatter="timestampToTime" :formatter="timestampToTime"
/> />
<el-table-column prop="prop" label="发票图片"> <el-table-column prop="prop" label="发票图片" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
...@@ -136,7 +137,17 @@ ...@@ -136,7 +137,17 @@
> >
</template> </template>
</el-table-column> </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"> <template slot-scope="props">
<el-tag <el-tag
:type=" :type="
...@@ -162,7 +173,7 @@ ...@@ -162,7 +173,7 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.reimbursementState == 1"> <div v-if="scope.row.reimbursementState == 1">
<el-button <el-button
...@@ -190,7 +201,12 @@ ...@@ -190,7 +201,12 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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-form :inline="true" label-width="80px">
<el-row> <el-row>
<el-col <el-col
...@@ -201,7 +217,13 @@ ...@@ -201,7 +217,13 @@
<el-input v-model="item.money"></el-input> <el-input v-model="item.money"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="说明"> <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-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -237,27 +259,35 @@ ...@@ -237,27 +259,35 @@
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="报销类别">{{ <el-descriptions-item label="报销类别">{{
reimbursementData.typeName 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-item>
</el-descriptions> </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>
<el-col :xl="12" :lg="12" :md="24" :sm="24" style="margin: 10px 0px"> <el-col :xl="12" :lg="12" :md="24" :sm="24" style="margin: 10px 0px">
<el-form <el-form
...@@ -271,13 +301,33 @@ ...@@ -271,13 +301,33 @@
label="核实报销总金额(大写)" label="核实报销总金额(大写)"
prop="verifyTotalAmountLarge" 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>
<el-form-item <el-form-item
label="核实报销总金额(小写)" label="核实报销总金额(小写)"
prop="verifyTotalAmountSmall" 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-item>
</el-form> </el-form>
<div style="width: 100%; text-align: right; padding: 0px 10%"> <div style="width: 100%; text-align: right; padding: 0px 10%">
...@@ -292,44 +342,172 @@ ...@@ -292,44 +342,172 @@
</el-row> </el-row>
</div> </div>
</el-drawer> </el-drawer>
<el-drawer <el-drawer
title="发票详情" title="发票详情"
:visible.sync="invoiceShow" :visible.sync="invoiceShow"
:direction="direction" :direction="direction"
size="40%" size="30%"
>
<!-- filePath-->
<el-table
:data="getinvoivelist"
style="width: 100%; text-align: center"
border
> >
<!-- filePath--> <el-table-column type="index" label="序号" width="80"></el-table-column>
<el-table <el-table-column prop="prop" label="发票详情">
:data="getinvoivelist" <template slot-scope="scope">
style="width: 100%; text-align: center" <div v-if="formatProtocolType(scope.row)">
border
>
<el-table-column
type="index"
label="序号"
width="40"
></el-table-column>
<el-table-column prop="prop" label="发票详情">
<template slot-scope="scope">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src="scope.row.filePath" :src="scope.row.filePath"
:preview-src-list="[scope.row.filePath]" :preview-src-list="[scope.row.filePath]"
></el-image> ></el-image>
</template> </div>
</el-table-column> <div v-else>
</el-table> <a class="a-style" @click="handlePreView(scope.row)"
</el-drawer> >点击查看文件</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> </div>
</template> </template>
<script> <script>
import { money } from "@/utils/myValidate";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { selectByFinance,financeApproval} from "@/api/reimbursement"; import { selectByFinance, financeApproval } from "@/api/reimbursement";
import { selectAllById } from "@/api/project"; import { selectAllById } from "@/api/project";
import { deletBystatus, selectByIdF, deleteById } from "@/api/project";
export default { export default {
data() { data() {
return { return {
...@@ -356,42 +534,89 @@ export default { ...@@ -356,42 +534,89 @@ export default {
from: { from: {
reimbursementId: null, reimbursementId: null,
financeId: null, financeId: null,
finaceRefute: null, finaceRefute: "",
financeTime: null, financeTime: null,
reimbursementState: null, //0待审批 1小组长通过 2小组长驳回 3财务通过 4财务驳回 reimbursementState: null, //0待审批 1小组长通过 2小组长驳回 3财务通过 4财务驳回
verifyTotalAmountLarge: null, verifyTotalAmountLarge: null,
verifyTotalAmountSmall: null, verifyTotalAmountSmall: null,
}, },
rules: { rules: {},
verifyTotalAmountLarge: [
{
required: true,
message: "请输入申请报销总金额(大写)",
trigger: "blur",
},
],
verifyTotalAmountSmall: [
{ required: true, validator: money, trigger: "blur" },
],
},
invoiceShow: false, invoiceShow: false,
getinvoivelist:[], getinvoivelist: [],
//查询图片给的值 //查询图片给的值
getinvoiveId: { getinvoiveId: {
companyId: null, 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() { created() {
this.reimbursementQurey.userId = this.$store.getters.urId; this.reimbursementQurey.userId = this.$store.getters.urId;
this.reimbursementQurey.companyId = this.$store.getters.companyId; this.reimbursementQurey.companyId = this.$store.getters.companyId;
this.getinvoiveId.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(); this.getReimbursement();
}, },
methods: { 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; this.drawer = true;
let param = { let param = {
reimbursementId: data.reimbursementId, reimbursementId: data.reimbursementId,
...@@ -416,7 +641,7 @@ export default { ...@@ -416,7 +641,7 @@ export default {
}; };
selectByReimbursementId(param) selectByReimbursementId(param)
.then((res) => { .then((res) => {
console.log(res) console.log(res);
if (res.success) { if (res.success) {
//获取数据 //获取数据
this.financeList.list = res.data; this.financeList.list = res.data;
...@@ -456,13 +681,27 @@ export default { ...@@ -456,13 +681,27 @@ export default {
this.getReimbursement(); this.getReimbursement();
}, },
//agreeandrefuse //agreeandrefuse同意和驳回
agreeandrefuse(data) { agreeandrefuse(data) {
this.getgetdetails(data) this.getgetdetails(data);
console.log(this.financeList) console.log(this.financeList);
this.reimbursementData = data; this.reimbursementData = data;
this.dialogVisible = true; 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() { agree() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
...@@ -507,13 +746,20 @@ export default { ...@@ -507,13 +746,20 @@ export default {
this.$prompt("驳回理由", "提示", { this.$prompt("驳回理由", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", closeOnClickModal: false,
inputErrorMessage: "驳回理由必填",
inputValidator: (value) => {
if (value) {
return true;
} else {
return false;
}
},
}) })
.then((value) => { .then((value) => {
//处理数据
this.from.reimbursementId = this.reimbursementData.reimbursementId; this.from.reimbursementId = this.reimbursementData.reimbursementId;
this.from.financeId = this.$store.getters.urId; this.from.financeId = this.$store.getters.urId;
this.from.finaceRefute = value.value; this.from.finaceRefute = value.value || "";
this.from.financeTime = this.time(); this.from.financeTime = this.time();
this.from.reimbursementState = 4; this.from.reimbursementState = 4;
financeApproval(this.from) financeApproval(this.from)
...@@ -533,9 +779,8 @@ export default { ...@@ -533,9 +779,8 @@ export default {
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "取消操作", message: "取消输入",
}); });
this.dialogVisible = false;
}); });
}, },
//时间处理 yyyy-MM-dd hh:mm:ss //时间处理 yyyy-MM-dd hh:mm:ss
...@@ -588,6 +833,253 @@ export default { ...@@ -588,6 +833,253 @@ export default {
this.back(); 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> </script>
...@@ -602,4 +1094,30 @@ export default { ...@@ -602,4 +1094,30 @@ export default {
.footer { .footer {
text-align: right; 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> </style>
\ No newline at end of file
<template> <template>
<div class="container"> <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"> <div class="conter">
<el-table <el-table
:data="reimbursementList" :data="reimbursementList"
...@@ -90,7 +77,7 @@ ...@@ -90,7 +77,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="序号" width="50px"> <el-table-column align="center" label="序号" width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
(reimbursementQurey.pageNum - 1) * reimbursementQurey.pageSize + (reimbursementQurey.pageNum - 1) * reimbursementQurey.pageSize +
...@@ -99,25 +86,24 @@ ...@@ -99,25 +86,24 @@
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userName" label="报销人" /> <el-table-column align="center" prop="userName" label="报销人" />
<el-table-column prop="projectName" label="项目" /> <el-table-column align="center" prop="projectName" label="项目" />
<!-- <el-table-column prop="typeName" label="报销类别"> <el-table-column
<template slot-scope="scope"> align="center"
<el-tag>{{ scope.row.typeName }}</el-tag> prop="applyTotalAmountSmall"
</template> label="申报总金额(元)"
</el-table-column> --> />
<el-table-column prop="applyTotalAmountSmall" label="申报总金额" /> <el-table-column align="center" label="核报总金额(元)">
<el-table-column label="核报总金额">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.verifyTotalAmountSmall || "还未核实金额" }} {{ props.row.verifyTotalAmountSmall || "还未核实金额" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="组长审批人"> <el-table-column label="组长审批人" align="center">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.headmanName || "暂无" }} {{ props.row.headmanName || "暂无" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="财务审批人"> <el-table-column label="财务审批人" align="center">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.financeName || "暂无" }} {{ props.row.financeName || "暂无" }}
</template> </template>
...@@ -125,9 +111,10 @@ ...@@ -125,9 +111,10 @@
<el-table-column <el-table-column
prop="fillingTime" prop="fillingTime"
label="报销日期" label="报销日期"
align="center"
:formatter="timestampToTime" :formatter="timestampToTime"
/> />
<el-table-column prop="prop" label="发票图片"> <el-table-column prop="prop" label="发票图片" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
...@@ -137,7 +124,17 @@ ...@@ -137,7 +124,17 @@
> >
</template> </template>
</el-table-column> </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"> <template slot-scope="props">
<el-tag <el-tag
:type=" :type="
...@@ -163,7 +160,7 @@ ...@@ -163,7 +160,7 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.reimbursementState == 0"> <div v-if="scope.row.reimbursementState == 0">
<el-button <el-button
...@@ -187,7 +184,13 @@ ...@@ -187,7 +184,13 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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-form :inline="true" label-width="80px">
<el-row> <el-row>
<el-col <el-col
...@@ -197,19 +200,28 @@ ...@@ -197,19 +200,28 @@
<el-form-item :label="item.name"> <el-form-item :label="item.name">
<el-input v-model="item.money"></el-input> <el-input v-model="item.money"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="说明"> <!-- <el-form-item label="说明">
<el-input v-model="item.remarks"></el-input> <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-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-drawer> </el-drawer>
<!-- 发票详情 -->
<el-drawer <el-drawer
title="发票详情" title="发票详情"
:visible.sync="invoiceShow" :visible.sync="invoiceShow"
:direction="direction" :direction="direction"
size="40%" size="30%"
> >
<!-- filePath--> <!-- filePath-->
<el-table <el-table
...@@ -220,15 +232,22 @@ ...@@ -220,15 +232,22 @@
<el-table-column <el-table-column
type="index" type="index"
label="序号" label="序号"
width="40" width="80"
></el-table-column> ></el-table-column>
<el-table-column prop="prop" label="发票详情"> <el-table-column prop="prop" label="发票详情">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image <div v-if="formatProtocolType(scope.row)">
style="width: 100px; height: 100px" <el-image
:src="scope.row.filePath" style="width: 100px; height: 100px"
:preview-src-list="[scope.row.filePath]" :src="scope.row.filePath"
></el-image> :preview-src-list="[scope.row.filePath]"
></el-image>
</div>
<div v-else>
<a class="a-style" @click="handlePreView(scope.row)"
>点击查看文件</a
>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -243,13 +262,144 @@ ...@@ -243,13 +262,144 @@
:total="total" :total="total"
></el-pagination> ></el-pagination>
</div> </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> </div>
</template> </template>
<script> <script>
import { selectByHeadman, headamApproval } from "@/api/reimbursement"; import { selectByHeadman, headamApproval } from "@/api/reimbursement";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { selectAllById } from "@/api/project"; import {
selectAllById,
deletBystatus,
selectByIdF,
deleteById,
} from "@/api/project";
export default { export default {
data() { data() {
return { return {
...@@ -269,7 +419,7 @@ export default { ...@@ -269,7 +419,7 @@ export default {
from: { from: {
reimbursementId: null, reimbursementId: null,
headmanId: null, headmanId: null,
headmanRefute: null, headmanRefute: "",
headmanTime: null, headmanTime: null,
reimbursementState: null, //0待审批 1小组长通过 2小组长驳回 3财务通过 4财务驳回 reimbursementState: null, //0待审批 1小组长通过 2小组长驳回 3财务通过 4财务驳回
}, },
...@@ -280,14 +430,71 @@ export default { ...@@ -280,14 +430,71 @@ export default {
companyId: null, 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() { created() {
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.reimbursementQurey.userId = this.$store.getters.urId; 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(); this.getReimbursement();
}, },
methods: { 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) { getdetails(data) {
this.drawer = true; this.drawer = true;
...@@ -334,8 +541,10 @@ export default { ...@@ -334,8 +541,10 @@ export default {
}) })
.then(() => { .then(() => {
//处理数据 //处理数据
// console.log(value.value)
this.from.reimbursementId = data.reimbursementId; this.from.reimbursementId = data.reimbursementId;
this.from.headmanId = this.$store.getters.urId; this.from.headmanId = this.$store.getters.urId;
this.from.headmanRefute = "";
this.from.headmanTime = this.time(); this.from.headmanTime = this.time();
this.from.reimbursementState = 1; this.from.reimbursementState = 1;
headamApproval(this.from) headamApproval(this.from)
...@@ -363,13 +572,22 @@ export default { ...@@ -363,13 +572,22 @@ export default {
this.$prompt("驳回理由", "提示", { this.$prompt("驳回理由", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
closeOnClickModal: false,
inputErrorMessage: "驳回理由必填",
type: "warning", type: "warning",
inputValidator: (value) => {
if (value) {
return true;
} else {
return false;
}
},
}) })
.then((value) => { .then((value) => {
//处理数据 //处理数据
this.from.reimbursementId = data.reimbursementId; this.from.reimbursementId = data.reimbursementId;
this.from.headmanId = this.$store.getters.urId; this.from.headmanId = this.$store.getters.urId;
this.from.headmanRefute = value.value; this.from.headmanRefute = value.value || "";
this.from.headmanTime = this.time(); this.from.headmanTime = this.time();
this.from.reimbursementState = 2; this.from.reimbursementState = 2;
headamApproval(this.from) headamApproval(this.from)
...@@ -420,7 +638,6 @@ export default { ...@@ -420,7 +638,6 @@ export default {
ReviseImage(row) { ReviseImage(row) {
this.invoiceShow = true; this.invoiceShow = true;
this.getinvoiveId.reimbursementId = row.reimbursementId; this.getinvoiveId.reimbursementId = row.reimbursementId;
//console.log(process.env.VUE_APP_BASE_API);
this.Selectinsertlsit(); this.Selectinsertlsit();
}, },
//查询发票图片 //查询发票图片
...@@ -443,6 +660,143 @@ export default { ...@@ -443,6 +660,143 @@ export default {
this.back(); 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> </script>
...@@ -452,9 +806,35 @@ export default { ...@@ -452,9 +806,35 @@ export default {
padding: 10px; padding: 10px;
} }
.conter { .conter {
margin-bottom: 10px; padding-top: 40px;
} }
.footer { .footer {
text-align: right; 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> </style>
\ No newline at end of file
...@@ -46,11 +46,18 @@ ...@@ -46,11 +46,18 @@
<el-form-item label="摘要" prop="summary"> <el-form-item label="摘要" prop="summary">
<el-input v-model="from.summary"></el-input> <el-input v-model="from.summary"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报销总金额-大写" prop="applyTotalAmountLarge"> <el-form-item label="报销总金额-大写(元)">
<el-input v-model="from.applyTotalAmountLarge"></el-input> <el-input v-model="from.applyTotalAmountLarge" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报销总金额-小写" prop="applyTotalAmountSmall"> <el-form-item
<el-input v-model="from.applyTotalAmountSmall"></el-input> 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>
<el-form-item label="支付方式" prop="paymentMethod"> <el-form-item label="支付方式" prop="paymentMethod">
<el-input v-model="from.paymentMethod"></el-input> <el-input v-model="from.paymentMethod"></el-input>
...@@ -58,12 +65,40 @@ ...@@ -58,12 +65,40 @@
<el-form-item label="备注"> <el-form-item label="备注">
<el-input <el-input
type="textarea" type="textarea"
:rows="5" :rows="4"
placeholder="请输入内容" placeholder="请输入内容"
v-model="from.remarks" v-model="from.remarks"
> >
</el-input> </el-input>
</el-form-item> </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 /> <br />
<el-form-item> <el-form-item>
<el-button <el-button
...@@ -79,7 +114,6 @@ ...@@ -79,7 +114,6 @@
@click="resetForm()" @click="resetForm()"
>重置信息</el-button >重置信息</el-button
> >
<el-button type="primary" @click="drawerAdd()">申请报销单</el-button>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -101,9 +135,13 @@ ...@@ -101,9 +135,13 @@
<el-form-item <el-form-item
:label="item.itemNamwe" :label="item.itemNamwe"
:prop="'list.' + index + '.money'" :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>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="item.remarks"></el-input> <el-input v-model="item.remarks"></el-input>
...@@ -116,187 +154,21 @@ ...@@ -116,187 +154,21 @@
<el-empty description="暂无报销项,因此无法报销"></el-empty> <el-empty description="暂无报销项,因此无法报销"></el-empty>
</div> </div>
</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> </div>
</template> </template>
<script> <script>
import { selectAllCompanyId } from "@/api/reimbursementItem"; import { selectAllCompanyId } from "@/api/reimbursementItem";
import { money } from "@/utils/myValidate";
import { selectAll as projectSelectAll } from "@/api/project"; import { selectAll as projectSelectAll } from "@/api/project";
import { insert } from "@/api/reimbursement"; import { insert } from "@/api/reimbursement";
import { Details } from "@/api/reimbursement"; import { Details } from "@/api/reimbursement";
import { import { queryBypageIncomeAdd, selectAllBystatus } from "@/api/project";
insertList, import { updatesubmit } from "@/api/project";
queryBypageIncomeAdd,
selectAllBystatus,
} from "@/api/project";
import { updatesubmit, uploadFile } from "@/api/project";
export default { export default {
data() { data() {
return { return {
//提交信息 //提交信息
from: { from: {
// list1:[],
companyId: null, //公司id companyId: null, //公司id
userName: null, //申报人 userName: null, //申报人
userPhone: null, //联系电话 userPhone: null, //联系电话
...@@ -309,9 +181,9 @@ export default { ...@@ -309,9 +181,9 @@ export default {
paymentMethod: null, //支付方式 paymentMethod: null, //支付方式
reimbursementState: 0, //状态 reimbursementState: 0, //状态
projectId: null, //项目id projectId: null, //项目id
// invoiceId: null, //发票的id
fromList: [], //发票号码 fromList: [], //发票号码
remarks: "", //备注 remarks: "", //备注
enclosureDescribe: "", //附件描述
}, },
projectList: [], //项目列表 projectList: [], //项目列表
getinvoivelist: [], //可以选择的发票号 getinvoivelist: [], //可以选择的发票号
...@@ -333,16 +205,6 @@ export default { ...@@ -333,16 +205,6 @@ export default {
projectId: [ projectId: [
{ required: true, message: "请选择项目", trigger: "change" }, { required: true, message: "请选择项目", trigger: "change" },
], ],
applyTotalAmountLarge: [
{
required: true,
message: "请输入申请报销总金额(大写)",
trigger: "blur",
},
],
applyTotalAmountSmall: [
{ required: true, validator: money, trigger: "blur" },
],
number: [ number: [
{ required: true, message: "请输入发票号码", trigger: "change" }, { required: true, message: "请输入发票号码", trigger: "change" },
], ],
...@@ -367,50 +229,24 @@ export default { ...@@ -367,50 +229,24 @@ export default {
{ required: true, message: "请输入发票金额", trigger: "change" }, { required: true, message: "请输入发票金额", trigger: "change" },
], ],
}, },
//发票列表窗口
drawer: false,
isgetid: 0, isgetid: 0,
//发票列表
invoicegetList: [],
//查询发票参数 //查询发票参数
invoicegetQurey: { invoicegetQurey: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
companyId: null, companyId: null,
}, },
total: 0, action1: null, //附件图片提交地址
//添加发票的参数
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代表出差报销
},
fileTypeJpg: false, //判断是否有发票文件且格式正确 fileTypeJpg: false, //判断是否有发票文件且格式正确
Uploadstatus: false, //判断文件上传的状态
//附件提交附带参数 那个data本来就没有参数
enclosurelist: {
Id: null,
companyId: 0,
enclosureDescribe: "",
status: 2,
userId: 0,
},
}; };
}, },
created() { created() {
...@@ -419,14 +255,17 @@ export default { ...@@ -419,14 +255,17 @@ export default {
this.from.userPhone = this.$store.getters.info.userPhone; this.from.userPhone = this.$store.getters.info.userPhone;
this.from.companyId = this.$store.getters.companyId; this.from.companyId = this.$store.getters.companyId;
this.invoicegetQurey.companyId = this.$store.getters.companyId; this.invoicegetQurey.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.action = process.env.VUE_APP_BASE_API + "/file/uploadFile";
this.time(); this.time();
this.getProject(); this.getProject();
this.getReimbursement(); this.getReimbursement();
this.Selectinsertlsit(); this.Selectinsertlsit();
}, },
methods: { methods: {
//上传附件
enclosure() {
this.drawer1 = true;
},
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate((valid1) => { this.$refs.form.validate((valid1) => {
...@@ -436,18 +275,6 @@ export default { ...@@ -436,18 +275,6 @@ export default {
insert(this.from) insert(this.from)
.then((res) => { .then((res) => {
if (res.success) { 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 = []; let list = [];
this.from.fromList.forEach((item) => { this.from.fromList.forEach((item) => {
...@@ -458,10 +285,31 @@ export default { ...@@ -458,10 +285,31 @@ export default {
}); });
}); });
updatesubmit(list).then((res) => { updatesubmit(list).then((res) => {
if (item.success) { if (res.success) {
this.$messages.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 { } else {
this.$messages.error("发票联邦失败"); this.$message.error(res.msg);
} }
}); });
} else { } else {
...@@ -469,6 +317,7 @@ export default { ...@@ -469,6 +317,7 @@ export default {
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error);
this.$message.error("提交失败"); this.$message.error("提交失败");
}); });
} }
...@@ -478,7 +327,7 @@ export default { ...@@ -478,7 +327,7 @@ export default {
}, },
//重置信息 //重置信息
resetForm() { resetForm() {
this.$refs.form.resetFields(); this.$refs.form.resetFields(); //resetFields重置表单
this.time(); this.time();
this.from.userId = this.$store.getters.info.userId; this.from.userId = this.$store.getters.info.userId;
this.from.userName = this.$store.getters.info.userName; this.from.userName = this.$store.getters.info.userName;
...@@ -531,7 +380,6 @@ export default { ...@@ -531,7 +380,6 @@ export default {
if (res.success) { if (res.success) {
//获取数据 //获取数据
let reimbursementItemList = res.data; let reimbursementItemList = res.data;
// console.log(this.reimbursementItemList.length)
if (reimbursementItemList.length == 0) { if (reimbursementItemList.length == 0) {
this.subbut = true; this.subbut = true;
} else { } else {
...@@ -568,18 +416,11 @@ export default { ...@@ -568,18 +416,11 @@ export default {
callback(new Error("金额格式错误")); callback(new Error("金额格式错误"));
} }
}, },
//申请报销单
drawerAdd() {
this.drawer = true;
this.getincomeSelectlist();
},
//查询发票 //查询发票
getincomeSelectlist(pager = 1) { getincomeSelectlist(pager = 1) {
this.invoicegetQurey.pageNum = pager; this.invoicegetQurey.pageNum = pager;
queryBypageIncomeAdd(this.invoicegetQurey) queryBypageIncomeAdd(this.invoicegetQurey)
.then((res) => { .then((res) => {
// console.log(res)
if (res.success) { if (res.success) {
this.invoicegetList = res.data.list; this.invoicegetList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
...@@ -591,99 +432,13 @@ export default { ...@@ -591,99 +432,13 @@ export default {
this.$message.error("查询发票数据失败"); 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> 相当于id
//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() { cancel() {
this.isgetid = 0; this.isgetid = 0;
this.getincomeSelectlist(); 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) { delfile2(file, fileList) {
this.fileTypeJpg = false; this.fileTypeJpg = false;
}, },
...@@ -695,6 +450,7 @@ export default { ...@@ -695,6 +450,7 @@ export default {
type: 2, type: 2,
userId: this.$store.getters.info.userId, userId: this.$store.getters.info.userId,
}; };
// console.log(this.getinvoivelist)
selectAllBystatus(param) selectAllBystatus(param)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
...@@ -709,6 +465,105 @@ export default { ...@@ -709,6 +465,105 @@ export default {
this.back(); 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> </script>
...@@ -716,6 +571,7 @@ export default { ...@@ -716,6 +571,7 @@ export default {
<style scoped> <style scoped>
.container { .container {
padding: 20px; padding: 20px;
/* min-width : 0 */
} }
</style> </style>
...@@ -726,11 +582,13 @@ export default { ...@@ -726,11 +582,13 @@ export default {
margin: 60px 0px; margin: 60px 0px;
padding: 20px 10px; padding: 20px 10px;
border-radius: 30px; border-radius: 30px;
/* white-space: nowrap; */
} }
.spend { .spend {
width: 800px; width: 800px;
float: left; float: left;
margin: 60px 0px; margin: 60px 0px;
padding: 20px 10px; padding: 20px 10px;
/* white-space: nowrap; */
} }
</style> </style>
\ No newline at end of file
<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
<template> <template>
<div class="container"> <div class="container">
<!-- 申请报销头部模块 -->
<div> <div>
<el-form :inline="true" :model="reimbursementQurey"> <el-form :inline="true" :model="reimbursementQurey">
<el-form-item> <el-form-item>
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<!-- 表格模块 -->
<div class="conter"> <div class="conter">
<el-table <el-table
:data="reimbursementList" :data="reimbursementList"
...@@ -89,7 +90,7 @@ ...@@ -89,7 +90,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="序号" width="50px"> <el-table-column label="序号" width="50px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
(reimbursementQurey.pageNum - 1) * reimbursementQurey.pageSize + (reimbursementQurey.pageNum - 1) * reimbursementQurey.pageSize +
...@@ -98,24 +99,23 @@ ...@@ -98,24 +99,23 @@
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="projectName" label="项目" /> <el-table-column prop="projectName" label="项目" align="center" />
<!-- <el-table-column prop="typeName" label="报销类别"> <el-table-column
<template slot-scope="scope"> prop="applyTotalAmountSmall"
<el-tag>{{ scope.row.typeName }}</el-tag> label="申报总金额(元)"
</template> align="center"
</el-table-column> --> />
<el-table-column prop="applyTotalAmountSmall" label="申报总金额" /> <el-table-column label="核报总金额(元)" align="center">
<el-table-column label="核报总金额">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.verifyTotalAmountSmall || "还未核实金额" }} {{ props.row.verifyTotalAmountSmall || "还未核实金额" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="组长审批人"> <el-table-column label="组长审批人" align="center">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.financeName || "暂无" }} {{ props.row.financeName || "暂无" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="财务审批人"> <el-table-column label="财务审批人" align="center">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.financeName || "暂无" }} {{ props.row.financeName || "暂无" }}
</template> </template>
...@@ -123,26 +123,52 @@ ...@@ -123,26 +123,52 @@
<el-table-column <el-table-column
prop="fillingTime" prop="fillingTime"
label="报销日期" label="报销日期"
align="center"
:formatter="timestampToTime" :formatter="timestampToTime"
></el-table-column> ></el-table-column>
<el-table-column prop="prop" label="发票图片"> <el-table-column prop="prop" label="发票图片" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
style="margin: 5px"
type="primary" type="primary"
size="mini" size="mini"
@click="ReviseImage(scope.row)" @click="ReviseImage(scope.row)"
>点击查看</el-button >点击查看</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> </template>
</el-table-column> </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"> <template slot-scope="props">
<el-tag <el-tag
:type=" :type="
props.row.reimbursementState == 0 props.row.reimbursementState == 0 ||
props.row.reimbursementState == 1
? 'info' ? 'info'
: props.row.reimbursementState == 1 || : props.row.reimbursementState == 3
props.row.reimbursementState == 3
? 'success' ? 'success'
: 'danger' : 'danger'
" "
...@@ -161,7 +187,7 @@ ...@@ -161,7 +187,7 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
style="margin: 5px" style="margin: 5px"
...@@ -171,7 +197,9 @@ ...@@ -171,7 +197,9 @@
@click="updataReimbursement(scope.row)" @click="updataReimbursement(scope.row)"
v-if=" v-if="
scope.row.reimbursementState != 3 && scope.row.reimbursementState != 3 &&
scope.row.reimbursementState != 1 scope.row.reimbursementState != 1 &&
scope.row.reimbursementState != 2 &&
scope.row.reimbursementState != 4
" "
>修改信息</el-button >修改信息</el-button
> >
...@@ -195,47 +223,71 @@ ...@@ -195,47 +223,71 @@
> >
撤回</el-button 撤回</el-button
> >
<el-link <div
type="success"
style="margin: 5px"
size="mini"
v-if="scope.row.reimbursementState == 3" v-if="scope.row.reimbursementState == 3"
>已通过</el-link style="width:100%;text-align: center ; color:#67C23A;"
> >
<el-link 已通过
type="info" </div>
style="margin: 5px" <div
size="mini"
v-if="scope.row.reimbursementState == 1" v-if="scope.row.reimbursementState == 1"
>待审批</el-link style="width:100%;text-align: center ; color:darkgray;"
> >
待审批
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 查看详情 --> <!-- 查看详情 -->
<el-drawer title="查看详情" :visible.sync="drawer" :direction="direction"> <el-drawer
<el-row> title="查看详情"
:visible.sync="drawer"
:direction="direction"
size="35%"
>
<div class="cd">
<el-row justify="center" align="middle">
<el-col <el-col
v-for="(item, index) in reimbursementDetails.list" v-for="(item, index) in reimbursementDetails.list"
:key="index" :key="index"
:span="20" :span="20"
> >
<el-descriptions :title="item.name" border :column="1" style="margin: 10px 0;"> <el-descriptions
<el-descriptions-item label="金额">{{item.money}}</el-descriptions-item> :title="item.name"
<el-descriptions-item label="备注" >{{item.explain}}</el-descriptions-item> border
<el-descriptions-item label="说明" >{{item.remarks}}</el-descriptions-item> :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-descriptions>
</el-col> </el-col>
</el-row> </el-row>
</div>
</el-drawer> </el-drawer>
<!-- 发票详情 -->
<el-drawer <el-drawer
title="发票详情" title="发票详情"
:visible.sync="invoiceShow" :visible.sync="invoiceShow"
:direction="direction" :direction="direction"
size="40%" size="30%"
> >
<!-- filePath-->
<el-table <el-table
:data="getinvoivelist" :data="getinvoivelist"
style="width: 100%; text-align: center" style="width: 100%; text-align: center"
...@@ -244,19 +296,100 @@ ...@@ -244,19 +296,100 @@
<el-table-column <el-table-column
type="index" type="index"
label="序号" label="序号"
width="40" width="80"
></el-table-column> ></el-table-column>
<el-table-column prop="prop" label="发票详情"> <el-table-column prop="prop" label="发票详情">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image <div v-if="formatProtocolType(scope.row)">
style="width: 100px; height: 100px" <el-image
:src="scope.row.filePath" style="width: 100px; height: 100px"
:preview-src-list="[scope.row.filePath]" :src="scope.row.filePath"
></el-image> :preview-src-list="[scope.row.filePath]"
></el-image>
</div>
<div v-else>
<a class="a-style" @click="handlePreView(scope.row)"
>点击查看文件</a
>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-drawer> </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>
<div class="footer"> <div class="footer">
<el-pagination <el-pagination
...@@ -267,16 +400,161 @@ ...@@ -267,16 +400,161 @@
:total="total" :total="total"
></el-pagination> ></el-pagination>
</div> </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> </div>
</template> </template>
<script> <script>
import { queryBypage, resubmit, reimbursementId } from "@/api/reimbursement"; import { queryBypage, resubmit, reimbursementId } from "@/api/reimbursement";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { selectAllById } from "@/api/project"; import {
selectAllById,
deletBystatus,
selectAllBystatus,
updatesubmit,
selectByIdF,
deleteById,
} from "@/api/project";
export default { export default {
data() { data() {
return { return {
isDisabled: null, //判断是否显示附件的删除按钮
//修改发票表格
invoicelist: [],
invoiceQurey: {
companyId: null,
reimbursementId: null,
},
getinvoivelist: [], //可以选择的发票号
dialogVisible: false,
//内容样式
contentStyle: {
"text-align": "center",
},
//label样式
labelStyle: { width: "80px" },
reimbursementQurey: { reimbursementQurey: {
userId: null, userId: null,
pageNum: 1, pageNum: 1,
...@@ -286,45 +564,169 @@ export default { ...@@ -286,45 +564,169 @@ export default {
reimbursementList: [], reimbursementList: [],
//抽屉 //抽屉
drawer: false, drawer: false,
drawer1: false,
invoiceShow: false, invoiceShow: false,
direction: "rtl", direction: "rtl",
reimbursementDetails: { reimbursementDetails: {
list: [], list: [],
}, },
getinvoivelist: [],
//查询图片给的值 //查询图片给的值
getinvoiveId: { getinvoiveId: {
companyId: null, 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() { created() {
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.reimbursementQurey.userId = this.$store.getters.urId; 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(); this.getReimbursement();
}, },
methods: { 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) { getdetails(data) {
this.drawer = true; this.drawer = true;
let param = { let param = {
reimbursementId: data.reimbursementId, reimbursementId: data.reimbursementId,
}; }; //接口是一个以对象的形式传值 所以定义了一个对象去拿这个参数
selectByReimbursementId(param) selectByReimbursementId(param)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
//获取数据 //获取数据
console.log(res); console.log(res);
this.reimbursementDetails.list = res.data; this.reimbursementDetails.list = res.data; //接口返回res里面
this.$message.success(res.msg);
} }
}) })
.catch((error) => { .catch((error) => {
this.$message.error("查询失败"); this.$message.error("查询失败");
}); });
}, },
//申请报销 //申请报销
addreimbursement() { addreimbursement() {
this.$router.push({ path: "/reimbursementAdd" }); this.$router.push({ path: "/reimbursementAdd" });
...@@ -355,6 +757,7 @@ export default { ...@@ -355,6 +757,7 @@ export default {
reimbursementId: data.reimbursementId, //传那一行数据的id reimbursementId: data.reimbursementId, //传那一行数据的id
projectId: data.projectId, //项目id 下拉框根据项目id选择 projectId: data.projectId, //项目id 下拉框根据项目id选择
typeId: data.typeId, //报销类别id typeId: data.typeId, //报销类别id
money: data.money, //备注
applyTotalAmountLarge: data.applyTotalAmountLarge, //大写金额 applyTotalAmountLarge: data.applyTotalAmountLarge, //大写金额
applyTotalAmountSmall: data.applyTotalAmountSmall, //小写金额 applyTotalAmountSmall: data.applyTotalAmountSmall, //小写金额
summary: data.summary, //摘要 summary: data.summary, //摘要
...@@ -400,6 +803,7 @@ export default { ...@@ -400,6 +803,7 @@ export default {
}, },
//撤回 //撤回
withdraw(data) { withdraw(data) {
// console.log(data.reimbursementId)
reimbursementId(data.reimbursementId).then((res) => { reimbursementId(data.reimbursementId).then((res) => {
if (res.success) { if (res.success) {
this.getReimbursement(); this.getReimbursement();
...@@ -408,6 +812,7 @@ export default { ...@@ -408,6 +812,7 @@ export default {
}, },
//查看图片的方法 //查看图片的方法
ReviseImage(row) { ReviseImage(row) {
// console.log(row)
this.invoiceShow = true; this.invoiceShow = true;
this.getinvoiveId.reimbursementId = row.reimbursementId; this.getinvoiveId.reimbursementId = row.reimbursementId;
this.Selectinsertlsit(); this.Selectinsertlsit();
...@@ -421,7 +826,6 @@ export default { ...@@ -421,7 +826,6 @@ export default {
this.getinvoivelist.forEach((e) => { this.getinvoivelist.forEach((e) => {
e.filePath = process.env.VUE_APP_BASE_API + e.filePath; e.filePath = process.env.VUE_APP_BASE_API + e.filePath;
}); });
// console.log(this.getinvoivelist);
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
...@@ -432,6 +836,154 @@ export default { ...@@ -432,6 +836,154 @@ export default {
this.back(); 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> </script>
...@@ -446,4 +998,34 @@ export default { ...@@ -446,4 +998,34 @@ export default {
.footer { .footer {
text-align: right; 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> </style>
\ No newline at end of file
...@@ -29,24 +29,15 @@ ...@@ -29,24 +29,15 @@
<el-input v-model="from.summary"></el-input> <el-input v-model="from.summary"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报销总金额-大写" prop="applyTotalAmountLarge"> <el-form-item label="报销总金额-大写(元)" prop="applyTotalAmountLarge">
<el-input v-model="from.applyTotalAmountLarge" ></el-input> <el-input v-model="from.applyTotalAmountLarge" ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报销总金额-小写" prop="applyTotalAmountSmall"> <el-form-item label="报销总金额-小写(元)" prop="applyTotalAmountSmall">
<el-input v-model="from.applyTotalAmountSmall" ></el-input> <el-input v-model="from.applyTotalAmountSmall" ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="支付方式" prop="paymentMethod"> <el-form-item label="支付方式" prop="paymentMethod">
<el-input v-model="from.paymentMethod" ></el-input> <el-input v-model="from.paymentMethod" ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注">
<el-input
type="textarea"
:rows="2"
placeholder="请输入内容"
v-model="textarea"
>
</el-input>
</el-form-item>
<br /> <br />
<el-form-item> <el-form-item>
<el-button type="success" icon="el-icon-upload2" @click="updateForm()">修改</el-button> <el-button type="success" icon="el-icon-upload2" @click="updateForm()">修改</el-button>
...@@ -56,20 +47,26 @@ ...@@ -56,20 +47,26 @@
</el-form> </el-form>
</div> </div>
<div class="spend"><el-form <div class="spend">
<el-form
:model="reimbursementItemData" :model="reimbursementItemData"
:inline="true" :inline="true"
ref="details" ref="details"
label-width="150px"> label-width="150px">
<el-row :gutter="20"> <el-row
<el-col :xl="12" :lg="12" :md="24" :sm="24" style="margin: 10px 0px"
v-for="(item, index) in reimbursementItemData.list" v-for="(item, index) in reimbursementItemData.list"
:key="index"> :key="index"
<el-form-item :label="item.name" >
:prop="'list.' + index + '.money'" <el-col>
:rules="{ validator: moneyrow, trigger: 'blur' }" <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-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -80,8 +77,7 @@ ...@@ -80,8 +77,7 @@
<script> <script>
import { selectById } from "@/api/company"; import { selectById } from "@/api/company";
import {selectById as reimbursementSelectById,update} from "@/api/reimbursement" import {selectById as reimbursementSelectById,update} from "@/api/reimbursement"
import {money} from "@/utils/myValidate" import {money} from "@/utils/myValidate";
// import {selectAll as typeSelectAll} from "@/api/type";
import { selectAll as projectSelectAll } from "@/api/project"; import { selectAll as projectSelectAll } from "@/api/project";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { update as detailsUpdate } from "@/api/reimbursementDetails"; import { update as detailsUpdate } from "@/api/reimbursementDetails";
...@@ -93,7 +89,7 @@ import { ...@@ -93,7 +89,7 @@ import {
export default { export default {
data() { data() {
return { return {
textarea: "",//备注
reimbursementItemData: { reimbursementItemData: {
list: [], list: [],
}, },
...@@ -131,7 +127,8 @@ export default { ...@@ -131,7 +127,8 @@ export default {
reimbursementState:0,//状态 reimbursementState:0,//状态
projectId:null,//项目id projectId:null,//项目id
typeId:null,//报销类别id typeId:null,//报销类别id
invoiceId:null invoiceId:null,
money: "",//备注
}, },
//发票编号数组 //发票编号数组
getinvoivelist: [], getinvoivelist: [],
...@@ -200,9 +197,12 @@ export default { ...@@ -200,9 +197,12 @@ export default {
}; };
}, },
created() { created() {
//v-model 绑定的数据this.from.userId
//this.$store.getters.info.userId 拿来query传过来的参数
this.from.userId = this.$store.getters.info.userId; this.from.userId = this.$store.getters.info.userId;
this.from.userName = this.$store.getters.info.userName; this.from.userName = this.$store.getters.info.userName;
this.from.userPhone = this.$store.getters.info.userPhone; this.from.userPhone = this.$store.getters.info.userPhone;
this.from.money=this.$store.getters.info.money
this.getFrom() this.getFrom()
// this.getTypeList() // this.getTypeList()
this.getReimbursement() this.getReimbursement()
...@@ -242,20 +242,8 @@ export default { ...@@ -242,20 +242,8 @@ export default {
this.from.applyTotalAmountSmall=this.$route.query.applyTotalAmountSmall, this.from.applyTotalAmountSmall=this.$route.query.applyTotalAmountSmall,
this.from.summary=this.$route.query.summary, this.from.summary=this.$route.query.summary,
this.from.paymentMethod=this.$route.query.paymentMethod this.from.paymentMethod=this.$route.query.paymentMethod
// this.from.money=this.$route.query.money
this.getReimbursement() 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(){ getProject(){
...@@ -367,7 +355,9 @@ export default { ...@@ -367,7 +355,9 @@ export default {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
status: 0, status: 0,
type: 2, type: 2,
userId:this.$store.getters.info.userId,
}; };
console.log(this.$store.getters.companyId)
selectAllBystatus(param) selectAllBystatus(param)
.then((res) => { .then((res) => {
// console.log(res) // console.log(res)
...@@ -383,6 +373,17 @@ export default { ...@@ -383,6 +373,17 @@ export default {
this.back(); 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> </script>
......
<template> <template>
<div> <div class="container">
<el-upload <div>
class="upload-demo" <el-form :inline="true" :model="typeQurey">
action="http://192.168.10.109:11523/uploadFile" <el-form-item label="类别名称">
:on-preview="handlePreview" <el-input
:on-remove="handleRemove" v-model="typeQurey.typeName"
:before-remove="beforeRemove" placeholder="类别名称"
multiple ></el-input>
:limit="3" </el-form-item>
:on-exceed="handleExceed" <el-form-item label="列别">
:file-list="fileList"> <el-select v-model="typeQurey.typeCategory" placeholder="请选择">
<el-button size="small" type="primary">点击上传</el-button> <el-option
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> v-for="item in options"
</el-upload> :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> </div>
</template> </template>
<script> <script>
import { select } from "@/api/type";
export default { export default {
data() { data() {
return { return {
fileList: [] typeQurey: {
}; typeName: null,
}, typeCategory: null,
methods: { companyId: null,
handleRemove(file, fileList) { pageNum: 1,
console.log(file, fileList); pageSize: 10,
},
handlePreview(file) {
console.log(file);
}, },
handleExceed(files, fileList) { options: [
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); {
}, value: "0",
beforeRemove(file, fileList) { label: "收入类别",
return this.$confirm(`确定移除 ${ file.name }?`); },
{
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> </script>
<style>
<style scoped>
.container {
padding: 10px;
}
.conter {
margin-bottom: 10px;
}
.footer {
text-align: right;
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment