Commit 098c6731 authored by 柳 佳乐's avatar 柳 佳乐
Browse files

fix bugs

parent b04e0fd0
...@@ -155,19 +155,41 @@ export default { ...@@ -155,19 +155,41 @@ export default {
//处理路由数据 //处理路由数据
generateRoutes(routes, basePath = '/') { generateRoutes(routes, basePath = '/') {
const res = [] const res = []
for (let route of routes) { console.log(routes)
if(route.id != 1){ if(this.$store.getters.roles[0] != 1){
const data = { //不是超管
path: path.resolve(basePath, route.path),
title: route.meta && (route.menuExplain ? `${route.meta.title}${route.menuExplain})`: route.meta.title), for (let route of routes) {
id: route.id if(route.id != 1 && route.id != 113){
} const data = {
if (route.children.length>0) { path: path.resolve(basePath, route.path),
data.children = this.generateRoutes(route.children, data.path) title: route.meta && (route.menuExplain ? `${route.meta.title}${route.menuExplain})`: route.meta.title),
} id: route.id
res.push(data) }
if (route.children.length>0) {
data.children = this.generateRoutes(route.children, data.path)
}
res.push(data)
}
}
}else{
//是超管
for (let route of routes) {
const data = {
path: path.resolve(basePath, route.path),
title: route.meta && (route.menuExplain ? `${route.meta.title}${route.menuExplain})`: route.meta.title),
id: route.id
}
if (route.children.length>0) {
data.children = this.generateRoutes(route.children, data.path)
}
res.push(data)
}
} }
}
return res return res
}, },
//新增角色 //新增角色
......
<template> <template>
<!-- 添加支出区域 -->
<div class="container"> <div class="container">
<el-row> <el-row>
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24"> <el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
...@@ -74,9 +75,27 @@ ...@@ -74,9 +75,27 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
<!-- 合同上传 -->
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract">
<el-upload
class="upload-demo"
ref="upload1"
:action="action2"
:file-list="fileList"
:auto-upload="false"
:on-change="onChangepdf"
:on-remove="delfile1"
:limit="1"
:data="proutlist1"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/pdf文件,且不超过500kb</div>
</el-upload>
</el-col>
</el-row> </el-row>
<!-- 报销单 --> <!-- 报销单 -->
<el-drawer title="发票单列表" :visible.sync="drawer" size="100%"> <el-drawer title="发票单列表" :visible.sync="drawer" size="100%">
<!-- 表格区域 --> <!-- 表格区域 -->
<div class="drawer" v-show="isgetid==0" style="margin-left:5%"> <div class="drawer" v-show="isgetid==0" style="margin-left:5%">
<el-button type="primary" @click="Reimbursement()" style="margin:20px 0px">添加报销单</el-button> <el-button type="primary" @click="Reimbursement()" style="margin:20px 0px">添加报销单</el-button>
...@@ -109,7 +128,7 @@ ...@@ -109,7 +128,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页--> <!-- 分页-->
<el-pagination <el-pagination
style="margin:0px auto" style="margin:0px auto"
@current-change="getincomeSelectlist" @current-change="getincomeSelectlist"
layout="total, prev, pager, next" layout="total, prev, pager, next"
...@@ -167,10 +186,13 @@ ...@@ -167,10 +186,13 @@
class="upload-demo" class="upload-demo"
ref="upload" ref="upload"
:file-list="fileList" :file-list="fileList"
action="http://192.168.10.109:7080/file/uploadFile" :action="action"
:auto-upload="false" :auto-upload="false"
:data="proutlist" :data="proutlist"
style="margin-left:90px;" style="margin-left:90px;"
:on-change="onChange"
:on-remove="delfile2"
:limit="1"
> >
<el-button <el-button
slot="trigger" slot="trigger"
...@@ -200,6 +222,8 @@ import { insert } from "@/api/expend"; ...@@ -200,6 +222,8 @@ import { insert } from "@/api/expend";
export default { export default {
data() { data() {
return { return {
action2: null,
action: null,
expendFrom: { expendFrom: {
expendBody: null, expendBody: null,
expendInformation: null, expendInformation: null,
...@@ -252,7 +276,8 @@ export default { ...@@ -252,7 +276,8 @@ export default {
number: null, number: null,
status: 0, status: 0,
time: null, time: null,
type: 1 type: 1,
userId: null
}, },
//表单验证内容 //表单验证内容
rules: { rules: {
...@@ -309,6 +334,7 @@ export default { ...@@ -309,6 +334,7 @@ export default {
invoiceListAdd: {}, invoiceListAdd: {},
//查询发票编号的数组 //查询发票编号的数组
getinvoiveId: { getinvoiveId: {
userId: null,
companyId: null, companyId: null,
type: 1 type: 1
}, },
...@@ -317,11 +343,19 @@ export default { ...@@ -317,11 +343,19 @@ export default {
//收集数据 //收集数据
newList: [], newList: [],
//保存图片 //保存图片
proutlist: { proutlist: {
Id: 1, Id: null,
status: 1 status: 1
}, },
fileList:[] //保存合同
proutlist1: {
Id: null,
status: 1
},
fileList: [],
fileType: null,
fileTypepdf: false,
backlistid: null
}; };
}, },
computed: { computed: {
...@@ -332,8 +366,14 @@ export default { ...@@ -332,8 +366,14 @@ export default {
created() { created() {
this.expendFrom.userId = this.$store.getters.urId; this.expendFrom.userId = this.$store.getters.urId;
this.addTO.companyId = this.$store.getters.companyId; this.addTO.companyId = this.$store.getters.companyId;
this.addTO.userId = this.$store.getters.urId;
this.invoiceList.companyId = this.$store.getters.companyId; this.invoiceList.companyId = this.$store.getters.companyId;
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.getinvoiveId.userId = this.$store.getters.urId;
this.action = process.env.VUE_APP_BASE_API + "/file/uploadFile";
this.action2 =
process.env.VUE_APP_BASE_API + "/file/updataContractDocuments";
this.backlistid = this.$route.query.backlistid;
this.getTypeList(); this.getTypeList();
this.getProject(); this.getProject();
this.Selectinsertlsit(); this.Selectinsertlsit();
...@@ -384,29 +424,20 @@ export default { ...@@ -384,29 +424,20 @@ export default {
submitForm() { submitForm() {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
if (this.invoiceListAdd.length < 0) { insert(this.expendFrom)
insert(this.expendFrom) .then(res => {
.then(res => { if (res.success) {
if (res.success) { this.$message.success(res.msg);
this.$message.success(res.msg); console.log(this.fileTypepdf);
this.$store.dispatch("tagsView/delView", this.$route); if (this.fileTypepdf) {
this.$router.push({ //进行合同的上传
path: "/expendList", //上传合同
query: { this.proutlist1.Id = res.data;
id: this.$route.query.id console.log(this.proutlist1.Id);
}
}); this.$refs.upload1.submit();
} else {
this.$message.error(res.msg);
} }
}) if (this.invoiceListAdd.length > 0) {
.catch(error => {
this.$message.error("新建失败");
});
} else {
insert(this.expendFrom)
.then(res => {
if (res.success) {
let list = []; let list = [];
this.invoiceListAdd.forEach(item => { this.invoiceListAdd.forEach(item => {
list.push({ list.push({
...@@ -415,32 +446,25 @@ export default { ...@@ -415,32 +446,25 @@ export default {
status: 1 status: 1
}); });
}); });
updatesubmit(list) //上传发票记录
.then(res => { updatesubmit(list).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.$store.dispatch("tagsView/delView", this.$route); this.back();
this.$router.push({ } else {
path: "/expendList", this.$message.error(res.msg);
query: { }
id: this.$route.query.id });
}
});
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error("新建失败");
});
} else { } else {
this.$message.error(res.msg); this.back();
} }
}) } else {
.catch(error => { this.$message.error(res.msg);
this.$message.error("新建失败"); }
}); })
} .catch(error => {
this.$message.error("新建失败");
});
} }
}); });
}, },
...@@ -457,7 +481,7 @@ export default { ...@@ -457,7 +481,7 @@ export default {
path: "/expendList", path: "/expendList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backlistid:this.$route.query.backlistid backlistid: this.$route.query.backlistid
} }
}); });
}, },
...@@ -498,6 +522,29 @@ export default { ...@@ -498,6 +522,29 @@ export default {
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.addTO.time = Y + M + D + h + m + s; this.addTO.time = Y + M + D + h + m + s;
}, },
//合同图片
onChangepdf(file) {
const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType == ".pdf") {
this.fileTypepdf = true;
} else {
this.$message.warning("合同文件只能是pdf格式文件");
this.$resf.upload1.clearFiles();
this.fileTypepdf = false;
}
console.log(this.fileTypepdf);
},
//清楚合同文件
delfile1() {
this.fileTypepdf = false;
},
//清除发片文件
delfile2() {
this.fileTypeJpg = false;
},
//////发票区域//////
//发票页面的按钮事件 //发票页面的按钮事件
drawerAdd() { drawerAdd() {
this.drawer = true; this.drawer = true;
...@@ -505,7 +552,7 @@ export default { ...@@ -505,7 +552,7 @@ export default {
}, },
//发票的分页查询 //发票的分页查询
getincomeSelectlist(pager = 1) { getincomeSelectlist(pager = 1) {
this.invoiceList.pageNum = pager this.invoiceList.pageNum = pager;
queryBypageIncomeAdd(this.invoiceList) queryBypageIncomeAdd(this.invoiceList)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
...@@ -540,29 +587,40 @@ export default { ...@@ -540,29 +587,40 @@ export default {
getlistForm() { getlistForm() {
this.$refs.addTO.validate(valid => { this.$refs.addTO.validate(valid => {
if (valid) { if (valid) {
insertList(this.addTO) if (
.then(res => { this.fileType === ".jpg" ||
if (res.success) { this.fileType === ".pdf" ||
this.proutlist.Id = res.data; this.fileType === ".png"
//提交图片 ) {
this.$refs.upload.submit(); insertList(this.addTO)
this.$message.success(res.msg); .then(res => {
this.isgetid = 0; if (res.success) {
this.delectdd() this.proutlist.Id = res.data;
this.getincomeSelectlist(); //提交图片
} else { this.$refs.upload.submit();
this.$message.error(res.msg); this.$message.success(res.msg);
} this.isgetid = 0;
}) this.addTO.time = "";
.catch(error => { this.$refs.addTO.resetFields();
this.$message.error("新建失败"); this.getincomeSelectlist();
}); this.Selectinsertlsit();
this.getincomeSelectlist();
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error("新建失败");
});
} else {
this.$message.error("请输入jpg格式的图片或者pdf在或者png的文件");
}
} }
}); });
}, },
//数据清除 //数据清除
delectdd() { delectdd() {
this.addTO ={ this.addTO = {
category: 0, category: 0,
code: null, code: null,
companyId: null, companyId: null,
...@@ -571,7 +629,7 @@ export default { ...@@ -571,7 +629,7 @@ export default {
status: 0, status: 0,
time: null, time: null,
type: 1 type: 1
} };
}, },
//查询发票编号 //查询发票编号
Selectinsertlsit() { Selectinsertlsit() {
...@@ -588,6 +646,12 @@ export default { ...@@ -588,6 +646,12 @@ export default {
this.$message.error("获取发票编号失败"); this.$message.error("获取发票编号失败");
this.back(); this.back();
}); });
},
//给fileType赋值
onChange(file) {
const fileName = file.name;
this.fileType = fileName.substring(fileName.lastIndexOf("."));
console.log(this.fileType);
} }
} }
}; };
...@@ -597,4 +661,7 @@ export default { ...@@ -597,4 +661,7 @@ export default {
.container { .container {
padding: 10px; padding: 10px;
} }
.contract {
margin: 20px 50px;
}
</style> </style>
\ No newline at end of file
...@@ -105,22 +105,20 @@ ...@@ -105,22 +105,20 @@
</div> </div>
<div> <div>
<!--抽屉--> <!--抽屉-->
<el-drawer <el-drawer title="发票详情" :visible.sync="drawer" :direction="direction" size="40%">
title="发票详情"
:visible.sync="drawer"
:direction="direction"
size="40%"
>
<!-- filePath--> <!-- filePath-->
<el-table :data="getinvoivelist" style="width: 100%; text-align: center" border> <el-table :data="getinvoivelist" style="width: 100%; text-align: center" border>
<el-table-column type="index" label="序号" width="40"></el-table-column> <el-table-column type="index" label="序号" width="40"></el-table-column>
<el-table-column prop="prop" label="发票详情"> <el-table-column prop="number" label="号码" width="160px"></el-table-column>
<el-table-column prop="mone" label="金额" width="180"></el-table-column>
<el-table-column prop="prop" label="查看PDF文件或图片">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image <div v-if="scope.row.filePath != null">
style="width: 100px; height: 100px" <a class="a-style" @click="handlePreView(scope.row)">点击查看图片或文件</a>
:src="scope.row.filePath" </div>
:preview-src-list="[scope.row.filePath]" <div v-else>
></el-image> <p>无图片或文件</p>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -163,7 +161,7 @@ export default { ...@@ -163,7 +161,7 @@ export default {
//图片数组 //图片数组
srcList: [], srcList: [],
//返回的标记 //返回的标记
backlistid:null backlistid: null
}; };
}, },
computed: { computed: {
...@@ -174,7 +172,7 @@ export default { ...@@ -174,7 +172,7 @@ export default {
created() { created() {
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.expendQurey.projectId = this.$route.query.id; this.expendQurey.projectId = this.$route.query.id;
this.backlistid=this.$route.query.backlistid this.backlistid = this.$route.query.backlistid;
this.getexpend(); this.getexpend();
this.getTypeList(); this.getTypeList();
}, },
...@@ -224,7 +222,7 @@ export default { ...@@ -224,7 +222,7 @@ export default {
path: "/expendAdd", path: "/expendAdd",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backlistid:this.backlistid backlistid: this.backlistid
} }
}); });
}, },
...@@ -295,9 +293,9 @@ export default { ...@@ -295,9 +293,9 @@ export default {
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
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); console.log(this.getinvoivelist);
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
...@@ -309,29 +307,35 @@ export default { ...@@ -309,29 +307,35 @@ export default {
this.back(); this.back();
}); });
}, },
back(){ back() {
if(this.backlistid==0){ if (this.backlistid == 0) {
this.$router.push({ this.$router.push({
path: "/projectList", path: "/projectList",
query: { query: {
id: this.$route.query.id id: this.$route.query.id
} }
}); });
}else if (this.backlistid==1) { } else if (this.backlistid == 1) {
this.$router.push({ this.$router.push({
path: "/beresponsibleforList", path: "/beresponsibleforList",
query: { query: {
id: this.$route.query.id id: this.$route.query.id
} }
}); });
}else{ } else {
this.$router.push({ this.$router.push({
path: "/participateinList", path: "/participateinList",
query: { query: {
id: this.$route.query.id id: this.$route.query.id
} }
}); });
} }
},
//点击查看发票
handlePreView(row) {
const photopath = process.env.VUE_APP_BASE_API + row.filePath;
console.log(photopath);
window.open(photopath, "_blank");
} }
} }
}; };
......
<template> <template>
<div class="container"> <div class="container">
<el-row> <el-row :gutter="20">
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24"> <el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
<el-form ref="form" :model="incomeFrom" label-width="120px" :rules="rules"> <el-form ref="form" :model="incomeFrom" label-width="120px" :rules="rules">
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
<el-form-item label="收入金额" prop="incomeMoney"> <el-form-item label="收入金额" prop="incomeMoney">
<el-input v-model="incomeFrom.incomeMoney"></el-input> <el-input v-model="incomeFrom.incomeMoney"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收到时间" prop="incomeTime"> <el-form-item label="收到时间" prop="incomeTime">
<el-date-picker <el-date-picker
v-model="incomeFrom.incomeTime" v-model="incomeFrom.incomeTime"
...@@ -46,19 +45,15 @@ ...@@ -46,19 +45,15 @@
@change="timestampToTime()" @change="timestampToTime()"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="对方户名" prop="incomeObject">
<el-form-item label="收入对象" prop="incomeObject">
<el-input v-model="incomeFrom.incomeObject"></el-input> <el-input v-model="incomeFrom.incomeObject"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收入内容" prop="incomeBody"> <el-form-item label="收入内容" prop="incomeBody">
<el-input v-model="incomeFrom.incomeBody"></el-input> <el-input v-model="incomeFrom.incomeBody"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收入备注" prop="incomeRemarks"> <el-form-item label="收入备注" prop="incomeRemarks">
<el-input v-model="incomeFrom.incomeRemarks"></el-input> <el-input v-model="incomeFrom.incomeRemarks"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收入详情" prop="incomeInformation"> <el-form-item label="收入详情" prop="incomeInformation">
<el-input <el-input
type="textarea" type="textarea"
...@@ -66,22 +61,46 @@ ...@@ -66,22 +61,46 @@
v-model="incomeFrom.incomeInformation" v-model="incomeFrom.incomeInformation"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item></el-form-item>
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
<el-button type="primary" @click="drawerAdd()">添加发票单</el-button>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form> </el-form>
</el-col> </el-col>
<!-- 合同上传 -->
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract">
<el-upload
class="upload-demo"
ref="upload1"
:action="action1"
:on-change="onChangepdf"
:file-list="fileList1"
:on-remove="delfile1"
:auto-upload="false"
:limit="1"
:data="proutlist1"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/pdf文件,且不超过500kb</div>
</el-upload>
</el-col>
<el-col :span="24">
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
<el-button type="primary" @click="drawerAdd()">添加发票单</el-button>
<el-button @click="back()">返回</el-button>
</el-col>
</el-row> </el-row>
<!-- 抽屉 -->
<el-drawer title="发票单列表" :visible.sync="drawer" size="100%"> <el-drawer title="发票单列表" :visible.sync="drawer" size="100%">
<!-- 表格区域 --> <!-- 表格区域 -->
<div class="drawer" v-show="isgetid==0" style="margin-left:5%"> <div class="drawer" v-show="isgetid==0" style="margin-left:5%">
<el-button type="primary" @click="Reimbursement()" style="margin:20px 0px">添加发票单</el-button> <el-button type="primary" @click="Reimbursement()" style="margin:20px 0px">添加发票单</el-button>
<el-table :data="invoicegetList.list" border style="width:90%"> <el-table :data="invoicegetList.list" border style="width:90%">
<el-table-column prop="invoiceId" label="序号" width="80"></el-table-column> <el-table-column label="序号" width="80px">
<template slot-scope="scope">
{{
(invoicegetList.qurey.pageNum - 1) * invoicegetList.qurey.pageSize + scope.$index + 1
}}
</template>
</el-table-column>
<el-table-column prop="number" label="发票号码" width="width"></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="time" label="发票时间"></el-table-column> <el-table-column prop="time" label="发票时间"></el-table-column>
...@@ -108,15 +127,17 @@ ...@@ -108,15 +127,17 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页部分有问题 --> <!-- 分页 -->
<el-pagination <el-pagination
style="margin:0px auto" style="margin:0px auto"
:current-page.sync="invoicegetList.qurey.pageNum"
:page-size="invoicegetList.qurey.pageSize"
@current-change="getincomeSelectlist" @current-change="getincomeSelectlist"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="invoicegetList.total" :total="invoicegetList.total"
></el-pagination> ></el-pagination>
</div> </div>
<!-- 添加区域 --> <!-- 添加发票 -->
<div class="getadd" v-show="isgetid==1" style="margin-left:5%"> <div class="getadd" v-show="isgetid==1" style="margin-left:5%">
<el-row> <el-row>
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24"> <el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
...@@ -157,7 +178,6 @@ ...@@ -157,7 +178,6 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="success" icon="el-icon-folder-checked" @click="getlistForm()">立即创建</el-button> <el-button type="success" icon="el-icon-folder-checked" @click="getlistForm()">立即创建</el-button>
<el-button type="info" icon="el-icon-refresh" @click="delectdd">重置信息</el-button>
<el-button type="primary" icon="el-icon-refresh-left" @click="cancel()">取消</el-button> <el-button type="primary" icon="el-icon-refresh-left" @click="cancel()">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -165,11 +185,14 @@ ...@@ -165,11 +185,14 @@
<el-col :xs="4" :sm="6" :md="8" :lg="10" :xl="11"> <el-col :xs="4" :sm="6" :md="8" :lg="10" :xl="11">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="upload" ref="upload2"
:file-list="fileList" :file-list="fileList2"
action="http://192.168.10.109:7080/file/uploadFile" :action="action2"
:auto-upload="false" :auto-upload="false"
:data="proutlist" :data="proutlist2"
:on-change="onChange"
:on-remove="delfile2"
:limit="1"
style="margin-left:90px;" style="margin-left:90px;"
> >
<el-button <el-button
...@@ -197,17 +220,11 @@ import { ...@@ -197,17 +220,11 @@ 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";
export default { export default {
data() { data() {
return { return {
fileList: [], //表单
proutlist: {
Id: 1,
status: 0
},
companyId: 0,
isgetid: 0,
drawer: false, //抽屉的显示与隐藏
incomeFrom: { incomeFrom: {
incomeBody: null, incomeBody: null,
incomeInformation: null, incomeInformation: null,
...@@ -221,8 +238,6 @@ export default { ...@@ -221,8 +238,6 @@ export default {
projectName: null, projectName: null,
incomebaoxioa: null //报销的字段 incomebaoxioa: null //报销的字段
}, },
typeList: [],
projectData: {},
rules: { rules: {
projectName: [ projectName: [
{ required: true, message: "请选择项目", trigger: "change" } { required: true, message: "请选择项目", trigger: "change" }
...@@ -235,33 +250,8 @@ export default { ...@@ -235,33 +250,8 @@ export default {
], ],
incomeTime: [ incomeTime: [
{ required: true, message: "请选择收入时间", trigger: "change" } { required: true, message: "请选择收入时间", trigger: "change" }
] ],
}, number: [
options: [
{
value: 0,
category: "普票"
},
{
value: 1,
category: "专票"
}
],
//添加发票的数组
addTO: {
category: 0,
code: null,
companyId: null,
mone: null,
number: null,
status: 0,
time: null,
type: 0
},
//抽屉的临时数据
//表单验证内容
rules: {
number: [
{ required: true, message: "请输入发票号码", trigger: "change" } { required: true, message: "请输入发票号码", trigger: "change" }
], ],
code: [ code: [
...@@ -283,45 +273,75 @@ export default { ...@@ -283,45 +273,75 @@ export default {
], ],
mone: [{ required: true, message: "请输入发票金额", trigger: "change" }] mone: [{ required: true, message: "请输入发票金额", trigger: "change" }]
}, },
//查询发票数据 options: [
invoiceList: { {
category: null, value: 0,
category: "普票"
},
{
value: 1,
category: "专票"
}
],
invoiceListAdd: [], //选择的发票号
getinvoivelist: [], //查询的能选择的表单信息
typeList: [], //收入类型列表
fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //合同文件
//合同文件上传携带参数
proutlist1: {
Id: null,
status: 0 //0收入 1支出
},
drawer: false, //发票视图
isgetid: 0, //发票视图切换
//发票参数
invoicegetList: {
list: [], //发票列表
//查询发票条件
qurey: {
pageNum: 1,
pageSize: 5,
companyId: null
},
total: 0
},
//添加发票的参数
addTO: {
category: 0, //0收入 1支出 2报销
code: null, code: null,
companyId: null, companyId: null,
invoiceId: null,
mone: null, mone: null,
number: null, number: null,
orders: [ status: 0,//状态 0未报销 1已报销
{
asc: null,
column: null
}
],
pageNum: 1,
pageSize: 10,
searchCount: null,
status: null,
time: null, time: null,
type: null type: 0,//0 普票 1专票
userId: null //提交人
}, },
//发票状态 //发票类型
status: 0, options: [
//发票的数组 {
invoicegetList: [], value: 0,
//发票编号数组 category: "普票"
getinvoivelist: [], },
//收集发票编号 {
invoiceListAdd: {}, value: 1,
//查询发票编号的数组 category: "专票"
}
],
//判断发票文件是否存在
fileTypeJpg:false,
fileList2: [], //发票文件
proutlist2: {
Id: null,
status: 0 //0收入 1支出
},
//查询发票编号的参数
getinvoiveId: { getinvoiveId: {
userId: null,
companyId: null, companyId: null,
type: 0 type: 0
}, },
pageNum: 10,
total: 10,
currentPage: 1,
//收集数据
newList: []
}; };
}, },
computed: { computed: {
...@@ -330,15 +350,139 @@ export default { ...@@ -330,15 +350,139 @@ export default {
} }
}, },
created() { created() {
//用户id
this.incomeFrom.userId = this.$store.getters.urId; this.incomeFrom.userId = this.$store.getters.urId;
this.addTO.companyId = this.$store.getters.companyId;
this.invoiceList.companyId = this.$store.getters.companyId; this.invoicegetList.qurey.companyId = this.$store.getters.companyId;
//发票上传地址
this.action2 = process.env.VUE_APP_BASE_API + "/file/uploadFile";
//合同上传地址
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataContractDocuments";
this.getinvoiveId.userId = this.$store.getters.urId;
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
//获取收入类别
this.getTypeList(); this.getTypeList();
//获取项目信息
this.getProject(); this.getProject();
this.Selectinsertlsit(); this.Selectinsertlsit();
}, },
methods: { methods: {
//时间处理
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;
},
timestampToTime() {
var date = this.incomeFrom.incomeTime;
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.incomeFrom.incomeTime = Y + M + D + h + m + s;
},
//提交
submitForm() {
this.$refs.form.validate(valid => {
if (valid) {
insert(this.incomeFrom)
.then(res => {
if (res.success) {
//判断是否有合同文件
if (this.fileTypepdf) {
this.proutlist1.Id = res.data;
this.$refs.upload1.submit();
}
//判断是否有选择发票
if(this.invoiceListAdd.length > 0){
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.invoiceListAdd.forEach(item => {
list.push({
invoiceId: item,
incomeId: res.data,
status:1
});
});
updatesubmit(list).then(res => {
if (res.success) {
this.$message.success(res.msg);
this.back()
} else {
this.$message.error(res.msg);
}
});
}else{
this.back()
}
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error("提交失败");
});
}
});
},
//重置
resetForm() {
this.$refs.form.resetFields();
this.incomeFrom.projectName = this.projectData.projectName;
this.incomeFrom.projectId = this.projectData.projectId;
},
//返回
back() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/incomeList",
query: {
id: this.$route.query.id,
backid: this.$route.query.backid
}
});
},
//合同文件校验
onChangepdf(file) {
console.log("2")
const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType == ".pdf") {
this.fileTypepdf = true;
} else {
this.$message.warning("合同文件只能是pdf格式文件");
this.$refs.upload1.clearFiles();
this.fileTypepdf = false;
}
},
//获取收入类型 //获取收入类型
getTypeList() { getTypeList() {
let param = { let param = {
...@@ -380,216 +524,114 @@ export default { ...@@ -380,216 +524,114 @@ export default {
this.back(); this.back();
}); });
}, },
//查询发票编号 //添加发票
Selectinsertlsit() { drawerAdd() {
selectAllBystatus(this.getinvoiveId) this.drawer = true;
this.getincomeSelectlist();
},
//添加发票单
Reimbursement() {
this.isgetid = 1;
this.$refs.addTO.resetFields();
},
//查询发票信息
getincomeSelectlist(pager = 1) {
this.invoicegetList.qurey.pageNum = pager;
queryBypageIncomeAdd(this.invoicegetList.qurey)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.invoicegetList.list = res.data.list;
this.invoicegetList.total = res.data.total;
} else { } else {
this.$message.error(res.msg); this.$message.errror(res.msg);
this.back();
} }
}) })
.catch(error => { .catch(error => {
this.$message.error("获取发票编号失败"); this.$message.error("查询发票数据失败");
this.back();
}); });
}, },
//提交 //校验发票文件格式
submitForm() { onChange(file) {
this.$refs.form.validate(valid => { console.log("1")
if (valid) { const fileNamepdf = file.name;
if (this.invoiceListAdd.length < 0) { let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
insert(this.incomeFrom) if (fileType == ".pdf" || fileType == ".png" || fileType == ".jpg") {
.then(res => { this.fileTypeJpg = true
if (res.success) { }else{
this.fileTypeJpg = false
this.$message.warning("发票文件只能是pdf,png,jpg格式文件");
this.$refs.upload2.clearFiles();
}
},
//添加发票提交
getlistForm(){
if(this.fileTypeJpg){
this.$refs.addTO.validate(valid => {
if (valid) {
this.addTO.userId = this.$store.getters.urId
this.addTO.companyId = this.$store.getters.companyId
insertList(this.addTO)
.then(res=>{
if(res.success){
//发票记录添加成功
//提交发票文件
this.proutlist2.Id = res.data;
this.$refs.upload2.submit();
this.$message.success(res.msg); this.$message.success(res.msg);
this.$store.dispatch("tagsView/delView", this.$route); this.isgetid = 0;
this.$router.push({ this.addTO = {
path: "/incomeList", category: 0, //0收入 1支出 2报销
query: { code: null,
id: this.$route.query.id companyId: null,
} mone: null,
}); number: null,
} else { status: 0,//状态 0未报销 1已报销
this.$message.error(res.msg); time: null,
type: 0,//0 普票 1专票
userId: null
}
this.$refs.upload2.clearFiles();
this.getincomeSelectlist();
this.Selectinsertlsit();
}else{
this.$message.errror(res.msg)
} }
}) })
.catch(error => { .catch(errpr=>{
this.$message.error("新建失败"); this.$message.errror("发票添加失败")
});
} else {
insert(this.incomeFrom)
.then(res => {
if (res.success) {
let list = [];
this.invoiceListAdd.forEach(item => {
list.push({
invoiceId: item,
incomeId: res.data,
status: 1
});
});
updatesubmit(list)
.then(res => {
if (res.success) {
this.$message.success(res.msg);
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/incomeList",
query: {
id: this.$route.query.id
}
});
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error("新建失败");
});
} else {
this.$message.error(res.msg);
}
}) })
.catch(error => {
this.$message.error("新建失败");
});
} }
} })
}); }else{
}, this.$message.warning("没有发票文件,无法提交")
//重置 }
resetForm() {
this.$refs.form.resetFields();
this.incomeFrom.projectName = this.projectData.projectName;
this.incomeFrom.projectId = this.projectData.projectId;
}, },
//返回 //查询发票编号
back() { Selectinsertlsit() {
this.$store.dispatch("tagsView/delView", this.$route); selectAllBystatus(this.getinvoiveId)
this.$router.push({
path: "/incomeList",
query: {
id: this.$route.query.id,
backid:this.$route.query.backid
}
});
},
//时间处理 yyyy-MM-dd hh:mm:ss
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;
},
timestampToTime() {
var date = this.incomeFrom.incomeTime;
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.incomeFrom.incomeTime = Y + M + D + h + m + s;
},
//发票页面的按钮事件
drawerAdd() {
this.drawer = true;
this.getincomeSelectlist();
},
//发票的分页查询
getincomeSelectlist(pager = 1) {
this.invoiceList.pageNum = pager;
queryBypageIncomeAdd(this.invoiceList)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.invoicegetList = res.data; this.getinvoivelist = res.data;
this.total = res.data.total;
} else { } else {
this.$message.errror(res.msg); this.$message.error(res.msg);
this.back();
} }
}) })
.catch(error => { .catch(error => {
this.$message.error("查询发票数据失败"); this.$message.error("获取发票编号失败");
this.back();
}); });
}, },
//分页 //清楚合同文件
handleSizeChange(val) { delfile1(file, fileList){
this.invoicegetList.pageSize = pageSize; this.fileTypepdf = false
},
handleCurrentChange: function(currentPage) {
this.total = this.invoicegetList.length;
this.currentPage = currentPage;
},
//取消隐藏tatle
cancel() {
console.log(this.isgetid);
this.isgetid = 0;
this.getincomeSelectlist();
},
//显示报销单添加页面
Reimbursement() {
this.isgetid = 1;
this.$refs.addTO.resetFields();
},
//发票提交页面的提交
getlistForm() {
this.$refs.addTO.validate(valid => {
if (valid) {
insertList(this.addTO)
.then(res => {
if (res.success) {
this.proutlist.Id = res.data;
//提交图片
this.$refs.upload.submit();
this.$message.success(res.msg);
this.isgetid = 0;
this.addTO.time = "";
this.$refs.addTO.resetFields();
this.getincomeSelectlist();
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error("新建失败");
});
}
});
},
//数据清除
delectdd() {
this.$refs.addTO.resetFields();
},
handleRemove(file, fileList) {
console.log(file, fileList);
}, },
handlePreview(file) { //清除发片文件
console.log(file); delfile2(file, fileList){
this.fileTypeJpg = false
} }
//图片上传
} }
}; };
</script> </script>
......
...@@ -31,7 +31,12 @@ ...@@ -31,7 +31,12 @@
<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-search" @click="qurey()">查询</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button> <el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
<el-button type="success" icon="el-icon-circle-plus-outline" @click="addincome()" v-if="state != 0">新增收入</el-button> <el-button
type="success"
icon="el-icon-circle-plus-outline"
@click="addincome()"
v-if="state != 0"
>新增收入</el-button>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -79,6 +84,11 @@ ...@@ -79,6 +84,11 @@
<el-button type="primary" size="mini" @click="ReviseImage(scope.row)">点击查看</el-button> <el-button type="primary" size="mini" @click="ReviseImage(scope.row)">点击查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="项目合同">
<template slot-scope="scope">
<el-button type="success" size="mini" @click="selectImage(scope.row)">点击查看</el-button>
</template>
</el-table-column>
<el-table-column label="操作人员"> <el-table-column label="操作人员">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -111,18 +121,20 @@ ...@@ -111,18 +121,20 @@
</div> </div>
<div> <div>
<!--抽屉--> <!--抽屉-->
<el-drawer <el-drawer title="发票详情" :visible.sync="drawer" :direction="direction" size="40%">
title="发票详情"
:visible.sync="drawer"
:direction="direction"
size="40%"
>
<!-- filePath--> <!-- filePath-->
<el-table :data="getinvoivelist" style="width: 100%; text-align: center" border> <el-table :data="getinvoivelist" style="width: 100%; text-align: center" border>
<el-table-column type="index" label="序号" width="40"></el-table-column> <el-table-column type="index" label="序号" width="40"></el-table-column>
<el-table-column prop="prop" label="发票详情"> <el-table-column prop="number" label="号码" width="160px"></el-table-column>
<el-table-column prop="mone" label="金额" width="180"></el-table-column>
<el-table-column prop="prop" label="查看PDF文件或图片">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image style="width: 100px; height: 100px" :src="scope.row.filePath" :preview-src-list="[scope.row.filePath]" ></el-image> <div v-if="scope.row.filePath != null">
<a class="a-style" @click="handlePreView(scope.row)">点击查看图片或文件</a>
</div>
<div v-else>
<p>无图片或文件</p>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -135,6 +147,7 @@ ...@@ -135,6 +147,7 @@
import { selectByProjectId } from "@/api/imcome"; import { selectByProjectId } from "@/api/imcome";
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { selectAllById } from "@/api/project"; import { selectAllById } from "@/api/project";
import { Col } from "element-ui";
const InitialData = { const InitialData = {
incomeBody: null, incomeBody: null,
...@@ -152,7 +165,6 @@ const InitialData = { ...@@ -152,7 +165,6 @@ const InitialData = {
export default { export default {
data() { data() {
return { return {
incomeQurey: { incomeQurey: {
projectId: null, projectId: null,
pageNum: 1, pageNum: 1,
...@@ -180,20 +192,19 @@ export default { ...@@ -180,20 +192,19 @@ export default {
//图片的数组 //图片的数组
getinvoivelist: [], getinvoivelist: [],
//图片数组 //图片数组
srcList:[], srcList: [],
backid:null, backid: null
}; };
}, },
computed:{ computed: {
state:function(){ state: function() {
return this.$route.query.state return this.$route.query.state;
} }
}, },
created() { created() {
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.incomeQurey.projectId = this.$route.query.id; this.incomeQurey.projectId = this.$route.query.id;
this.backid=this.$route.query.backid this.backid = this.$route.query.backid;
this.getIncome(); this.getIncome();
this.getTypeList(); this.getTypeList();
}, },
...@@ -304,10 +315,24 @@ export default { ...@@ -304,10 +315,24 @@ export default {
path: "/incomeAdd", path: "/incomeAdd",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backid:this.backid backid: this.backid
} }
}); });
}, },
//查看项目合同
selectImage(row) {
if (row.contractDocuments != null) {
const photopath = process.env.VUE_APP_BASE_API + row.contractDocuments;
window.open(photopath, "_blank");
console.log(photopath);
} else {
this.$message({
showClose: true,
message: "该项目没有添加合同",
type: "warning"
});
}
},
//查看图片的方法 //查看图片的方法
ReviseImage(row) { ReviseImage(row) {
this.drawer = true; this.drawer = true;
...@@ -321,9 +346,9 @@ export default { ...@@ -321,9 +346,9 @@ export default {
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
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); console.log(this.getinvoivelist);
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
...@@ -346,29 +371,35 @@ export default { ...@@ -346,29 +371,35 @@ export default {
}); });
}, },
//返回开始 //返回开始
back(){ back() {
if(this.backid==0){ if (this.backid == 0) {
this.$router.push({ this.$router.push({
path: "/projectList", path: "/projectList",
query: { query: {
id: this.$route.query.id id: this.$route.query.id
} }
}); });
}else if (this.backid==1) { } else if (this.backid == 1) {
this.$router.push({ this.$router.push({
path: "/beresponsibleforList", path: "/beresponsibleforList",
query: { query: {
id: this.$route.query.id id: this.$route.query.id
} }
}); });
}else{ } else {
this.$router.push({ this.$router.push({
path: "/participateinList", path: "/participateinList",
query: { query: {
id: this.$route.query.id id: this.$route.query.id
} }
}); });
} }
},
//点击查看发票
handlePreView(row) {
const photopath = process.env.VUE_APP_BASE_API + row.filePath;
console.log(photopath);
window.open(photopath, "_blank");
} }
} }
}; };
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="header"> <div class="header">
<el-form :inline="true" :model="memberQurey"> <el-form :inline="true" :model="memberQurey">
<el-form-item> <el-form-item>
<el-button type="success" icon="el-icon-circle-plus-outline" @click="updataMember()">更新成员</el-button> <el-button type="success" icon="el-icon-circle-plus-outline" @click="updataMember()">更新{{staffName}}</el-button>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -54,15 +54,27 @@ export default { ...@@ -54,15 +54,27 @@ export default {
pageSize: 10 pageSize: 10
}, },
memberList: [], memberList: [],
total: 0 total: 0,
staffId:null,
staffName:null
}; };
}, },
created() { created() {
this.memberId = this.$store.getters.memberId; this.memberId = this.$store.getters.memberId;
this.memberQurey.projectId = this.$route.query.id; this.memberQurey.projectId = this.$route.query.id;
this.staffId=this.$route.query.staffId;
this.getMember(); this.getMember();
this.staff();
}, },
methods: { methods: {
//判断staffId分析是负责人还是管理员
staff(){
if(this.staffId==0){
this.staffName='负责人'
}else{
this.staffName='成员'
}
},
//获取员工信息 //获取员工信息
getMember() { getMember() {
console.log(selectByProjectId(this.memberQurey)); console.log(selectByProjectId(this.memberQurey));
...@@ -102,7 +114,8 @@ export default { ...@@ -102,7 +114,8 @@ export default {
this.$router.push({ this.$router.push({
path: "/memberUpdata", path: "/memberUpdata",
query: { query: {
id: this.$route.query.id id: this.$route.query.id,
staffId:this.$route.query.staffId
} }
}); });
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form ref="form" :model="memberFrom" label-width="120px" :rules="rules"> <el-form ref="form" :model="memberFrom" label-width="120px" :rules="rules">
<el-form-item label="普通成员" prop="ordinary"> <el-form-item :label="staffName" prop="ordinary">
<el-checkbox-group v-model="memberFrom.ordinary"> <el-checkbox-group v-model="memberFrom.ordinary">
<el-checkbox v-for="city in datalist" :label="city.userId" :key="city.userId"> <el-checkbox v-for="city in datalist" :label="city.userId" :key="city.userId">
{{ {{
...@@ -59,6 +59,9 @@ export default { ...@@ -59,6 +59,9 @@ export default {
//过滤后的新数组 //过滤后的新数组
queryList: [], queryList: [],
memberId: null, memberId: null,
//判断是否是管理员
staffId: null,
staffName: null
}; };
}, },
computed: { computed: {
...@@ -69,16 +72,24 @@ export default { ...@@ -69,16 +72,24 @@ export default {
created() { created() {
this.memberQurey.projectId = this.$route.query.id; this.memberQurey.projectId = this.$route.query.id;
this.memberId = this.$store.getters.memberId; this.memberId = this.$store.getters.memberId;
this.staffId = this.$route.query.staffId;
//查询员工 //查询员工
//this.getStaffList(); //this.getStaffList();
//查询项目的成员信息 //查询项目的成员信息
this.getPeojectMember(); this.getPeojectMember();
this.getselectlist(); this.getselectlist();
this.staff();
}, },
methods: { methods: {
//判断staffId分析是负责人还是管理员
staff(){
console.log(this.staffId);
if(this.staffId==0){
this.staffName='负责人管理'
}else{
this.staffName='成员管理'
}
},
getselectlist() { getselectlist() {
//查询员工,得到初始员工值 //查询员工,得到初始员工值
secletAllStaff({ companyId: this.$store.getters.companyId }) secletAllStaff({ companyId: this.$store.getters.companyId })
...@@ -97,7 +108,7 @@ export default { ...@@ -97,7 +108,7 @@ export default {
list = queryList.filter(a => { list = queryList.filter(a => {
return a.memberPression == 0; return a.memberPression == 0;
}); });
const datalistyou = list;; const datalistyou = list;
//将项目负责人与查询员工分离整理 //将项目负责人与查询员工分离整理
let datalist1 = this.staffList.filter( let datalist1 = this.staffList.filter(
a => !datalistyou.some(b => a.userId === b.userId) a => !datalistyou.some(b => a.userId === b.userId)
...@@ -211,7 +222,8 @@ export default { ...@@ -211,7 +222,8 @@ export default {
path: "/memberList", path: "/memberList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
memberId:this.memberId memberId: this.memberId,
staffId:this.$route.query.staffId
} }
}); });
}, },
...@@ -227,7 +239,7 @@ export default { ...@@ -227,7 +239,7 @@ export default {
memberPression: 1 memberPression: 1
}); });
}); });
}else{ } else {
this.memberFrom.ordinary.forEach(e => { this.memberFrom.ordinary.forEach(e => {
member.push({ member.push({
projectId: this.projectId, projectId: this.projectId,
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</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>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,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="项目开始时间"
......
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
</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>
<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">
...@@ -31,6 +33,7 @@ ...@@ -31,6 +33,7 @@
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="序号" width="50px"> <el-table-column label="序号" width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -52,7 +55,7 @@ ...@@ -52,7 +55,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" width="200"> <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>
...@@ -205,18 +208,19 @@ export default { ...@@ -205,18 +208,19 @@ export default {
path: "/incomeList", path: "/incomeList",
query: { query: {
id: data.projectId, id: data.projectId,
backid:0, backid: 0,
state:0 state: 0
} }
}); });
}, },
//成员管理 //负责人管理
member(data) { member(data) {
this.$store.dispatch("settings/setMemberId", 0); this.$store.dispatch("settings/setMemberId", 0);
this.$router.push({ this.$router.push({
path: "/memberList", path: "/memberList",
query: { query: {
id: data.projectId id: data.projectId,
staffId:0
} }
}); });
}, },
...@@ -226,8 +230,8 @@ export default { ...@@ -226,8 +230,8 @@ export default {
path: "/expendList", path: "/expendList",
query: { query: {
id: data.projectId, id: data.projectId,
backlistid:0, backlistid: 0,
state:0 state: 0
} }
}); });
} }
......
...@@ -100,11 +100,11 @@ ...@@ -100,11 +100,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="userName" label="报销人" /> <el-table-column prop="userName" label="报销人" />
<el-table-column prop="projectName" label="项目" /> <el-table-column prop="projectName" label="项目" />
<el-table-column prop="typeName" label="报销类别"> <!-- <el-table-column prop="typeName" label="报销类别">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag>{{ scope.row.typeName }}</el-tag> <el-tag>{{ scope.row.typeName }}</el-tag>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="applyTotalAmountSmall" label="申报总金额" /> <el-table-column prop="applyTotalAmountSmall" label="申报总金额" />
<el-table-column label="核报总金额"> <el-table-column label="核报总金额">
<template slot-scope="props"> <template slot-scope="props">
......
...@@ -101,11 +101,11 @@ ...@@ -101,11 +101,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="userName" label="报销人" /> <el-table-column prop="userName" label="报销人" />
<el-table-column prop="projectName" label="项目" /> <el-table-column prop="projectName" label="项目" />
<el-table-column prop="typeName" label="报销类别"> <!-- <el-table-column prop="typeName" label="报销类别">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag>{{ scope.row.typeName }}</el-tag> <el-tag>{{ scope.row.typeName }}</el-tag>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="applyTotalAmountSmall" label="申报总金额" /> <el-table-column prop="applyTotalAmountSmall" label="申报总金额" />
<el-table-column label="核报总金额"> <el-table-column label="核报总金额">
<template slot-scope="props"> <template slot-scope="props">
......
<template> <template>
<div class="container"> <div class="container">
<!-- 左边 -->
<div class="box"> <div class="box">
<el-form <el-form
ref="form" ref="form"
...@@ -25,17 +26,6 @@ ...@@ -25,17 +26,6 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="报销类别" prop="typeId">
<el-select v-model="from.typeId" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发票号码" prop="fromList"> <el-form-item label="发票号码" prop="fromList">
<el-select <el-select
v-model="from.fromList" v-model="from.fromList"
...@@ -65,9 +55,22 @@ ...@@ -65,9 +55,22 @@
<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="5"
placeholder="请输入内容"
v-model="from.remarks"
>
</el-input>
</el-form-item>
<br /> <br />
<el-form-item> <el-form-item>
<el-button type="success" icon="el-icon-upload2" @click="submitForm()" <el-button
type="success"
icon="el-icon-upload2"
@click="submitForm()"
:disabled="subbut"
>提交</el-button >提交</el-button
> >
<el-button <el-button
...@@ -81,195 +84,199 @@ ...@@ -81,195 +84,199 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<!-- 右边 -->
<div> <div>
<el-drawer <div class="spend" v-show="!subbut">
title="发票单列表" <el-form
:visible.sync="drawer" :model="reimbursementItemData"
size="100%" :inline="true"
> label-width="150px"
<!-- 表格区域 --> ref="details"
<div class="drawer" v-show="isgetid == 0" style="margin-left: 5%"> >
<el-button <el-row
type="primary" v-for="(item, index) in reimbursementItemData.list"
@click="Reimbursement()" :key="index"
style="margin: 20px 0px"
>添加报销单</el-button
> >
<el-table :data="invoicegetList.list" border style="width: 90%"> <el-col>
<el-table-column <el-form-item
prop="invoiceId" :label="item.itemNamwe"
label="序号" :prop="'list.' + index + '.money'"
width="80" :rules="{ validator: moneyrow, trigger: 'blur' }"
></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-change="getincomeSelectlist"
layout="total, prev, pager, next"
:total="invoicegetList.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="item.money"></el-input>
<el-input </el-form-item>
v-model="addTO.number" <el-form-item label="备注">
oninput="value=value.replace(/^\.+|[^\d.]/g,'')" <el-input v-model="item.remarks"></el-input>
></el-input> </el-form-item>
</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="info"
icon="el-icon-refresh"
@click="delectdd"
>重置信息</el-button
>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="cancel()"
>取消</el-button
>
</el-form-item>
</el-form>
</el-col> </el-col>
<el-col :xs="4" :sm="6" :md="8" :lg="10" :xl="11"> </el-row>
<el-upload </el-form>
class="upload-demo" </div>
ref="upload" <div v-show="subbut">
:file-list="fileList" <el-empty description="暂无报销项,因此无法报销"></el-empty>
action="http://192.168.10.109:7080/file/uploadFile" </div>
:auto-upload="false" </div>
:data="proutlist"
style="margin-left: 90px" <!-- 报销单 -->
<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 <el-button
slot="trigger"
size="small"
type="primary" type="primary"
style="margin-left: 20px; margin-top: 40px" icon="el-icon-refresh-left"
>选取文件</el-button @click="cancel()"
>取消</el-button
> >
<div slot="tip" class="el-upload__tip"> </el-form-item>
只能上传jpg/png文件,且不超过500kb </el-form>
</div> </el-col>
</el-upload> <el-col :xs="4" :sm="6" :md="8" :lg="10" :xl="11">
</el-col> <el-upload
</el-row> class="upload-demo"
</div> ref="upload"
</el-drawer> :file-list="fileList"
</div> :action="action"
<div class="spend"> :auto-upload="false"
<el-form :data="proutlist"
:model="reimbursementItemData" :on-change="onChange"
:inline="true" :on-remove="delfile2"
label-width="150px" style="margin-left: 90px"
ref="details"
>
<el-row
v-for="(item, index) in reimbursementItemData.list"
:key="index"
>
<el-col>
<el-form-item
:label="item.itemNamwe"
:prop="'list.' + index + '.money'"
:rules="{ validator: moneyrow, trigger: 'blur' }"
> >
<el-input v-model="item.money"></el-input> <el-button
</el-form-item> slot="trigger"
<el-form-item label="说明"> size="small"
<el-input v-model="item.remarks"></el-input> type="primary"
</el-form-item> 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-col>
</el-row> </el-row>
</el-form> </div>
</div> </el-drawer>
</div> </div>
</template> </template>
...@@ -278,7 +285,6 @@ import { selectById } from "@/api/company"; ...@@ -278,7 +285,6 @@ import { selectById } from "@/api/company";
import { selectAllCompanyId } from "@/api/reimbursementItem"; import { selectAllCompanyId } from "@/api/reimbursementItem";
import { money } from "@/utils/myValidate"; import { money } from "@/utils/myValidate";
import { selectAll as projectSelectAll } from "@/api/project"; import { selectAll as projectSelectAll } from "@/api/project";
import { selectAll as typeSelectAll } from "@/api/type";
import { insert } from "@/api/reimbursement"; import { insert } from "@/api/reimbursement";
import { Details } from "@/api/reimbursement"; import { Details } from "@/api/reimbursement";
import { import {
...@@ -286,15 +292,11 @@ import { ...@@ -286,15 +292,11 @@ import {
queryBypageIncomeAdd, queryBypageIncomeAdd,
selectAllBystatus, selectAllBystatus,
} from "@/api/project"; } from "@/api/project";
import { updatesubmit } from "@/api/project"; import { updatesubmit, uploadFile } from "@/api/project";
export default { export default {
data() { data() {
return { return {
company: {}, //提交信息
timeNow: null,
projectList: [],
typeList: [], //类型列表
invoiceList: [], //发票号码
from: { from: {
companyId: null, //公司id companyId: null, //公司id
userName: null, //申报人 userName: null, //申报人
...@@ -308,42 +310,25 @@ export default { ...@@ -308,42 +310,25 @@ export default {
paymentMethod: null, //支付方式 paymentMethod: null, //支付方式
reimbursementState: 0, //状态 reimbursementState: 0, //状态
projectId: null, //项目id projectId: null, //项目id
typeId: null, //报销类别id // invoiceId: null, //发票的id
invoiceId: null, //发票的id fromList: [], //发票号码
fromList: [],//发票号码 remarks: "", //备注
}, },
projectList: [], //项目列表
getinvoivelist: [], //可以选择的发票号
subbut: false, //是否有报销项
//右边表单数据
reimbursementItemData: { reimbursementItemData: {
list: [], list: [],
}, },
reimbursementItemList: [], reimbursementItemList: [],
//报销单区域
options: [
{
value: 0,
category: "普票",
},
{
value: 1,
category: "专票",
},
],
addTO: {
category: null,
code: null,
companyId: null,
mone: null,
number: null,
status: 0,
time: null,
type: 2,
},
isgetid: 0,
//表单验证内容 //表单验证内容
rules: { rules: {
typeId: [ typeId: [
{ required: true, message: "请选择报销类别", trigger: "change" }, { required: true, message: "请选择报销类别", trigger: "change" },
], ],
invoiceId:[ fromList: [
{ required: true, message: "请选择发票号码", trigger: "change" }, { required: true, message: "请选择发票号码", trigger: "change" },
], ],
projectId: [ projectId: [
...@@ -383,166 +368,88 @@ export default { ...@@ -383,166 +368,88 @@ export default {
{ required: true, message: "请输入发票金额", trigger: "change" }, { required: true, message: "请输入发票金额", trigger: "change" },
], ],
}, },
//查询发票数据
invoiceList: { //发票列表窗口
drawer: false,
isgetid: 0,
//发票列表
invoicegetList: [],
//查询发票参数
invoicegetQurey: {
pageNum: 1,
pageSize: 10,
companyId: null,
},
total: 0,
//添加发票的参数
addTO: {
userId: null,
category: null, category: null,
code: null, code: null,
companyId: null, companyId: null,
invoiceId: null,
mone: null, mone: null,
number: null, number: null,
orders: [ status: 0, //发票是否已报销 0未报销 1已报销
{
asc: null,
column: null,
},
],
pageNum: 1,
pageSize: 10,
searchCount: null,
status: null,
time: null, time: null,
type: null, type: 2, // 0收入 1支出 2报销
},
drawer: false, //抽屉的显示与隐藏
//发票状态
status: 0,
//发票的数组
invoicegetList: [],
//发票编号数组
getinvoivelist: [],
//收集发票编号
invoiceListAdd: {},
//查询发票编号的数组
getinvoiveId: {
companyId: null,
type: 1,
}, },
pageNum: 10, //报销单区域
total: 1, options: [
//收集数据 {
newList: [], value: 0,
//保存图片 category: "普票",
},
{
value: 1,
category: "专票",
},
],
fileList: [], //发票图片存放位置
action: null, //发票图片提交地址
//图片提交携带的额外参数
proutlist: { proutlist: {
Id: 1, Id: null, //res.data
status: 1, status: 2, // 0代表收入 1代表收入 2代表日常报销 3代表出差报销
}, },
fileList: [], fileTypeJpg: false, //判断是否有发票文件且格式正确
}; };
}, },
created() { created() {
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;
//获取公司id
this.invoiceList.companyId = this.$store.getters.companyId;
this.from.companyId = this.$store.getters.companyId; this.from.companyId = this.$store.getters.companyId;
this.addTO.companyId = this.$store.getters.companyId; this.invoicegetQurey.companyId = this.$store.getters.companyId;
this.action = process.env.VUE_APP_BASE_API + "/file/uploadFile";
this.time(); this.time();
this.getTypeList();
this.getReimbursement();
this.getProject(); this.getProject();
this.Selectinsertlsit(); //获取发票号码 this.getReimbursement();
this.Selectinsertlsit();
}, },
methods: { methods: {
//解决输入框无法输入
change() {
this.$forceUpdate();
},
//获取公司报销类别
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
//typeCategory: 2,
};
typeSelectAll(param)
.then((res) => {
if (res.success) {
this.typeList = res.data;
} else {
this.$message.error(res.msg);
this.back();
}
})
.catch((error) => {
this.$message.error("获取类型失败");
this.back();
});
},
//获取个人的项目
getProject() {
projectSelectAll({ userId: this.from.userId })
.then((res) => {
if (res.success) {
this.projectList = res.data;
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取个人项目失败,无法申请报销");
});
},
//获取报销项
getReimbursement() {
let param = {
companyId: this.$store.getters.companyId,
};
selectAllCompanyId(param)
.then((res) => {
if (res.success) {
//获取数据
this.reimbursementItemList = res.data;
//处理数据
this.reimbursementItemList.forEach((e) => {
//设置参数
let pram = {
itemNamwe: e.name,
itemId: e.id,
money: 0,
reimbursementId: null,
remarks: null,
};
this.reimbursementItemData.list.push(pram);
});
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取报销项失败");
});
},
//获取公司名称
getCompany() {
selectById({ companyId: this.$store.getters.companyId })
.then((res) => {
if (res.status == "success") {
this.company = res.data;
} else {
this.$message.error(res.data);
}
})
.catch((error) => {
this.$message.error("获取公司名称失败");
});
},
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid1) => {
if (valid) { if (valid1) {
//如果左侧校验成功,则开始校验右侧 this.$refs.details.validate((valid) => {
this.$refs.details.validate((valid2) => { if (valid) {
if (valid2) {
insert(this.from) insert(this.from)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
//上传右边的报销项了 ,上传报销项之前,需要处理数据reimbursementId代表着本次提交报销表的id
this.reimbursementItemData.list.forEach((item) => { this.reimbursementItemData.list.forEach((item) => {
item.reimbursementId = res.data; 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) => {
list.push({ list.push({
...@@ -551,36 +458,39 @@ export default { ...@@ -551,36 +458,39 @@ export default {
status: 1, status: 1,
}); });
}); });
updatesubmit(list) updatesubmit(list).then((res) => {
.then((item) => { if (item.success) {
if (item.success) { this.$messages.success("发票联邦成功");
Details(this.reimbursementItemData.list).then( } else {
(res) => { this.$messages.error("发票联邦失败");
if (res.success) { }
this.$message.success("申请成功,等待审批"); });
this.back();
}
}
);
}
})
.catch((error) => {
console.log("报销失败");
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch((error) => {
this.$message.error("申请失败"); this.$message.error("提交失败");
}); });
} else {
this.$message.error("请选择报销项");
} }
}); });
} }
}); });
}, },
//重置信息
resetForm() {
this.$refs.form.resetFields();
this.time();
this.from.userId = this.$store.getters.info.userId;
this.from.userName = this.$store.getters.info.userName;
this.from.userPhone = this.$store.getters.info.userPhone;
this.from.companyId = this.$store.getters.companyId;
},
//返回
back() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ path: "/reimbursementList" });
},
//获取现在时间 //获取现在时间
time() { time() {
let date = new Date(); let date = new Date();
...@@ -597,25 +507,56 @@ export default { ...@@ -597,25 +507,56 @@ export default {
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.from.fillingTime = this.from.fillingTime =
Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s; Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s;
this.timeNow = Y + "" + M + "" + D + "";
},
//新增消费
consumption() {
this.spend.push({});
}, },
//返回 //获取个人的项目
back() { getProject() {
this.$store.dispatch("tagsView/delView", this.$route); projectSelectAll({ userId: this.from.userId })
this.$router.push({ path: "/reimbursementList" }); .then((res) => {
if (res.success) {
this.projectList = res.data;
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取个人项目失败,无法申请报销");
});
}, },
//重置信息 //获取报销项
resetForm() { getReimbursement() {
this.$refs.form.resetFields(); let param = {
this.time(); companyId: this.$store.getters.companyId,
this.from.userId = this.$store.getters.info.userId; };
this.from.userName = this.$store.getters.info.userName; selectAllCompanyId(param)
this.from.userPhone = this.$store.getters.info.userPhone; .then((res) => {
this.from.companyId = this.$store.getters.companyId; if (res.success) {
//获取数据
let reimbursementItemList = res.data;
// console.log(this.reimbursementItemList.length)
if (reimbursementItemList.length == 0) {
this.subbut = true;
} else {
this.subbut = false;
//处理数据
reimbursementItemList.forEach((e) => {
//设置参数
let pram = {
itemNamwe: e.name,
itemId: e.id,
money: 0,
reimbursementId: null,
remarks: null,
};
this.reimbursementItemData.list.push(pram);
});
}
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取报销项失败");
});
}, },
//定义金额校验 //定义金额校验
moneyrow(rule, value, callback) { moneyrow(rule, value, callback) {
...@@ -628,6 +569,33 @@ export default { ...@@ -628,6 +569,33 @@ export default {
callback(new Error("金额格式错误")); callback(new Error("金额格式错误"));
} }
}, },
//申请报销单
drawerAdd() {
this.drawer = true;
this.getincomeSelectlist();
},
//查询发票
getincomeSelectlist(pager = 1) {
this.invoicegetQurey.pageNum = pager;
queryBypageIncomeAdd(this.invoicegetQurey)
.then((res) => {
// console.log(res)
if (res.success) {
this.invoicegetList = res.data.list;
this.total = res.data.total;
} else {
this.$message.errror(res.msg);
}
})
.catch((error) => {
this.$message.error("查询发票数据失败");
});
},
//添加报销单
Reimbursement() {
this.isgetid = 1;
},
//发票单区域 //发票单区域
timestampToTime1() { timestampToTime1() {
var date = this.addTO.time; var date = this.addTO.time;
...@@ -647,73 +615,78 @@ export default { ...@@ -647,73 +615,78 @@ export default {
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.addTO.time = Y + M + D + h + m + s; this.addTO.time = Y + M + D + h + m + s;
}, },
//发票页面的按钮事件 //发票提交
drawerAdd() { getlistForm() {
this.drawer = true; if (this.fileTypeJpg) {
this.getincomeSelectlist(); this.$refs.addTO.validate((valid) => {
}, if (valid) {
//发票的分页查询 this.addTO.companyId = this.$store.getters.companyId;
getincomeSelectlist(pager = 1) { this.addTO.userId = this.$store.getters.info.userId;
this.invoiceList.pageNum = pager; insertList(this.addTO)
queryBypageIncomeAdd(this.invoiceList) .then((res) => {
.then((res) => { console.log(res);
// console.log(res) console.log(this.isgetid);
if (res.success) { if (res.success) {
this.invoicegetList = res.data; //上传图片
this.total = res.data.total; //res.data 是上传那图片参数之一
} else { //上传前提参数要对 status id
this.$message.errror(res.msg); 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("新建失败");
});
} }
})
.catch((error) => {
this.$message.error("查询发票数据失败");
}); });
} else {
this.$message.warning("需要发票的图片或文件");
}
}, },
//分页 //取消
handleSizeChange(val) {
this.invoicegetList.pageSize = pageSize;
},
handleCurrentChange(currentPage) {
this.invoicegetList.pageNum = currentPage;
},
//取消隐藏tatle
cancel() { cancel() {
// console.log(this.isgetid);
this.isgetid = 0; this.isgetid = 0;
this.getincomeSelectlist(); this.getincomeSelectlist();
}, },
//显示报销单添加页面 //校验发票图片是否合格
Reimbursement() { onChange(file) {
this.isgetid = 1; const fileNamepdf = file.name;
}, let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
//发票提交页面的提交 if (fileType == ".pdf" || fileType == ".png" || fileType == ".jpg") {
getlistForm() { this.fileTypeJpg = true;
this.$refs.addTO.validate((valid) => { } else {
if (valid) { this.fileTypeJpg = false;
insertList(this.addTO) this.$message.warning("发票文件只能是pdf,png,jpg格式文件");
.then((res) => { this.$refs.upload.clearFiles();
if (res.success) { }
this.proutlist.Id = res.data;
//提交图片
this.$refs.upload.submit();
this.$message.success(res.msg);
this.isgetid = 0;
this.addTO.time = "";
this.$refs.addTO.resetFields();
this.getincomeSelectlist();
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("新建失败");
});
}
});
}, },
//数据清除 //清除发片文件
delectdd() { delfile2(file, fileList) {
this.$refs.addTO.resetFields(); this.fileTypeJpg = false;
}, },
//查询发票编号 //查询发票编号
Selectinsertlsit() { Selectinsertlsit() {
...@@ -721,10 +694,10 @@ export default { ...@@ -721,10 +694,10 @@ 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,
}; };
selectAllBystatus(param) selectAllBystatus(param)
.then((res) => { .then((res) => {
// console.log(res)
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
} else { } else {
...@@ -748,7 +721,6 @@ export default { ...@@ -748,7 +721,6 @@ export default {
</style> </style>
<style scoped> <style scoped>
.box { .box {
width: 800px; width: 800px;
float: left; float: left;
......
...@@ -99,11 +99,11 @@ ...@@ -99,11 +99,11 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="projectName" label="项目" /> <el-table-column prop="projectName" label="项目" />
<el-table-column prop="typeName" label="报销类别"> <!-- <el-table-column prop="typeName" label="报销类别">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag>{{ scope.row.typeName }}</el-tag> <el-tag>{{ scope.row.typeName }}</el-tag>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="applyTotalAmountSmall" label="申报总金额" /> <el-table-column prop="applyTotalAmountSmall" label="申报总金额" />
<el-table-column label="核报总金额"> <el-table-column label="核报总金额">
<template slot-scope="props"> <template slot-scope="props">
...@@ -212,23 +212,21 @@ ...@@ -212,23 +212,21 @@
</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">
<el-form :inline="true" label-width="80px">
<el-row> <el-row>
<el-col <el-col
v-for="(item, index) in reimbursementDetails.list" v-for="(item, index) in reimbursementDetails.list"
:key="index" :key="index"
:span="20"
> >
<el-form-item :label="item.name"> <el-descriptions :title="item.name" border :column="1" style="margin: 10px 0;">
<el-input v-model="item.money" disabled="disabled"></el-input> <el-descriptions-item label="金额">{{item.money}}</el-descriptions-item>
</el-form-item> <el-descriptions-item label="备注" >{{item.explain}}</el-descriptions-item>
<el-form-item label="说明"> <el-descriptions-item label="说明" >{{item.remarks}}</el-descriptions-item>
<el-input v-model="item.remarks" disabled="disabled"></el-input> </el-descriptions>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</el-drawer> </el-drawer>
<el-drawer <el-drawer
...@@ -333,13 +331,10 @@ export default { ...@@ -333,13 +331,10 @@ export default {
}, },
//获取申请报销列表 //获取申请报销列表
getReimbursement() { getReimbursement() {
// console.log(this.reimbursementQurey);
queryBypage(this.reimbursementQurey) queryBypage(this.reimbursementQurey)
.then((res) => { .then((res) => {
// console.log(res)
if (res.success) { if (res.success) {
this.reimbursementList = res.data.list; this.reimbursementList = res.data.list;
// console.log(this.reimbursementList);
this.total = res.data.total; this.total = res.data.total;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
...@@ -415,7 +410,6 @@ export default { ...@@ -415,7 +410,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();
}, },
//查询发票图片 //查询发票图片
...@@ -427,7 +421,7 @@ export default { ...@@ -427,7 +421,7 @@ 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); // console.log(this.getinvoivelist);
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
......
...@@ -25,16 +25,6 @@ ...@@ -25,16 +25,6 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="报销类别" prop="typeId">
<el-select v-model="from.typeId" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId">
</el-option>
</el-select>
</el-form-item>
<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>
...@@ -48,6 +38,16 @@ ...@@ -48,6 +38,16 @@
<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 />
<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>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button> <el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
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 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,6 +93,7 @@ import { ...@@ -93,6 +93,7 @@ import {
export default { export default {
data() { data() {
return { return {
textarea: "",//备注
reimbursementItemData: { reimbursementItemData: {
list: [], list: [],
}, },
...@@ -203,7 +204,7 @@ export default { ...@@ -203,7 +204,7 @@ export default {
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.getFrom() this.getFrom()
this.getTypeList() // this.getTypeList()
this.getReimbursement() this.getReimbursement()
this.getProject() this.getProject()
this.Selectinsertlsit() this.Selectinsertlsit()
...@@ -231,26 +232,6 @@ export default { ...@@ -231,26 +232,6 @@ export default {
this.$message.error("获取报销项失败"); this.$message.error("获取报销项失败");
}); });
}, },
//获取公司报销类别
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
// typeCategory: 2,
};
typeSelectAll(param)
.then((res) => {
if (res.success) {
this.typeList = res.data;
} else {
this.$message.error(res.msg);
this.back()
}
})
.catch((error) => {
this.$message.error("获取类型失败");
this.back()
});
},
//获取报销信息 //获取报销信息
getFrom(){ getFrom(){
//接收query传给我们的值 //接收query传给我们的值
......
...@@ -80,9 +80,6 @@ ...@@ -80,9 +80,6 @@
}, { }, {
value: '1', value: '1',
label: '支出类别' label: '支出类别'
},{
value: "2",
label: "报销类别",
}] }]
}; };
}, },
......
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
<el-table-column label="类别种类" > <el-table-column label="类别种类" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag <el-tag
:type="scope.row.typeCategory == '0' ? 'success' : scope.row.typeCategory == '1' ? 'danger':'warning' " :type="scope.row.typeCategory == '0' ? 'success' : 'danger' "
> >
{{scope.row.typeCategory == '0' ? '收入类别' : scope.row.typeCategory == '1' ? '支出类别':'报销类别'}} {{scope.row.typeCategory == '0' ? '收入类别' : '支出类别'}}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
...@@ -105,10 +105,6 @@ export default { ...@@ -105,10 +105,6 @@ export default {
value: "1", value: "1",
label: "支出类别", label: "支出类别",
}, },
{
value: "2",
label: "报销类别",
}
], ],
total:0, total:0,
typeList:[] typeList:[]
......
...@@ -54,10 +54,6 @@ export default { ...@@ -54,10 +54,6 @@ export default {
value: "1", value: "1",
label: "支出类别", label: "支出类别",
}, },
{
value: "2",
label: "报销类别",
}
], ],
rules: { rules: {
typeName: [ typeName: [
......
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