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

fix bugs

parent b04e0fd0
...@@ -155,8 +155,27 @@ export default { ...@@ -155,8 +155,27 @@ export default {
//处理路由数据 //处理路由数据
generateRoutes(routes, basePath = '/') { generateRoutes(routes, basePath = '/') {
const res = [] const res = []
console.log(routes)
if(this.$store.getters.roles[0] != 1){
//不是超管
for (let route of routes) {
if(route.id != 1 && route.id != 113){
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)
}
}
}else{
//是超管
for (let route of routes) { for (let route of routes) {
if(route.id != 1){
const data = { const data = {
path: path.resolve(basePath, route.path), path: path.resolve(basePath, route.path),
title: route.meta && (route.menuExplain ? `${route.meta.title}${route.menuExplain})`: route.meta.title), title: route.meta && (route.menuExplain ? `${route.meta.title}${route.menuExplain})`: route.meta.title),
...@@ -166,8 +185,11 @@ export default { ...@@ -166,8 +185,11 @@ export default {
data.children = this.generateRoutes(route.children, data.path) data.children = this.generateRoutes(route.children, data.path)
} }
res.push(data) 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,6 +75,24 @@ ...@@ -74,6 +75,24 @@
</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%">
...@@ -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
}, },
...@@ -318,10 +344,18 @@ export default { ...@@ -318,10 +344,18 @@ export default {
newList: [], newList: [],
//保存图片 //保存图片
proutlist: { proutlist: {
Id: 1, Id: null,
status: 1
},
//保存合同
proutlist1: {
Id: null,
status: 1 status: 1
}, },
fileList:[] 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);
this.$store.dispatch("tagsView/delView", this.$route); console.log(this.fileTypepdf);
this.$router.push({ if (this.fileTypepdf) {
path: "/expendList", //进行合同的上传
query: { //上传合同
id: this.$route.query.id this.proutlist1.Id = res.data;
} console.log(this.proutlist1.Id);
});
} else { this.$refs.upload1.submit();
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,24 +446,18 @@ export default { ...@@ -415,24 +446,18 @@ 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({
path: "/expendList",
query: {
id: this.$route.query.id
}
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
})
.catch(error => {
this.$message.error("新建失败");
}); });
} else {
this.back();
}
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
...@@ -441,7 +466,6 @@ export default { ...@@ -441,7 +466,6 @@ export default {
this.$message.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,6 +587,11 @@ export default { ...@@ -540,6 +587,11 @@ export default {
getlistForm() { getlistForm() {
this.$refs.addTO.validate(valid => { this.$refs.addTO.validate(valid => {
if (valid) { if (valid) {
if (
this.fileType === ".jpg" ||
this.fileType === ".pdf" ||
this.fileType === ".png"
) {
insertList(this.addTO) insertList(this.addTO)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
...@@ -548,7 +600,10 @@ export default { ...@@ -548,7 +600,10 @@ export default {
this.$refs.upload.submit(); this.$refs.upload.submit();
this.$message.success(res.msg); this.$message.success(res.msg);
this.isgetid = 0; this.isgetid = 0;
this.delectdd() this.addTO.time = "";
this.$refs.addTO.resetFields();
this.getincomeSelectlist();
this.Selectinsertlsit();
this.getincomeSelectlist(); this.getincomeSelectlist();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
...@@ -557,12 +612,15 @@ export default { ...@@ -557,12 +612,15 @@ export default {
.catch(error => { .catch(error => {
this.$message.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,22 +307,22 @@ export default { ...@@ -309,22 +307,22 @@ 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: {
...@@ -332,6 +330,12 @@ export default { ...@@ -332,6 +330,12 @@ export default {
} }
}); });
} }
},
//点击查看发票
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-form>
</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="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="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
<el-button type="primary" @click="drawerAdd()">添加发票单</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>
</el-col> </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,32 +250,7 @@ export default { ...@@ -235,32 +250,7 @@ export default {
], ],
incomeTime: [ incomeTime: [
{ required: true, message: "请选择收入时间", trigger: "change" } { required: true, message: "请选择收入时间", trigger: "change" }
]
},
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: [ number: [
{ required: true, message: "请输入发票号码", trigger: "change" } { required: true, message: "请输入发票号码", trigger: "change" }
], ],
...@@ -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已报销
time: null,
type: 0,//0 普票 1专票
userId: null //提交人
},
//发票类型
options: [
{
value: 0,
category: "普票"
},
{ {
asc: null, value: 1,
column: null category: "专票"
} }
], ],
pageNum: 1, //判断发票文件是否存在
pageSize: 10, fileTypeJpg:false,
searchCount: null, fileList2: [], //发票文件
status: null, proutlist2: {
time: null, Id: null,
type: null status: 0 //0收入 1支出
}, },
//发票状态 //查询发票编号的参数
status: 0,
//发票的数组
invoicegetList: [],
//发票编号数组
getinvoivelist: [],
//收集发票编号
invoiceListAdd: {},
//查询发票编号的数组
getinvoiveId: { getinvoiveId: {
userId: null,
companyId: null, companyId: null,
type: 0 type: 0
}, },
pageNum: 10,
total: 10,
currentPage: 1,
//收集数据
newList: []
}; };
}, },
computed: { computed: {
...@@ -330,134 +350,107 @@ export default { ...@@ -330,134 +350,107 @@ 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: {
//获取收入类型 //时间处理
getTypeList() { timestampToTime1() {
let param = { var date = this.addTO.time;
companyId: this.$store.getters.companyId, var Y = date.getFullYear() + "-";
typeCategory: 0 var M =
}; (date.getMonth() + 1 < 10
selectAll(param) ? "0" + (date.getMonth() + 1)
.then(res => { : date.getMonth() + 1) + "-";
if (res.success) { var D =
this.typeList = res.data; (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
} else { var h =
this.$message.error(res.msg); (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
this.back(); var m =
} (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) +
}) ":";
.catch(error => { var s =
this.$message.error("获取类型失败"); date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.back(); this.addTO.time = Y + M + D + h + m + s;
});
},
//获取项目
getProject() {
let param = {
projectId: this.projectId
};
selectByProjectId(param)
.then(res => {
if (res.success) {
this.projectData = res.data;
this.incomeFrom.projectName = res.data.projectName;
this.incomeFrom.projectId = res.data.projectId;
} else {
this.$message.error(res.msg);
this.back();
}
})
.catch(error => {
this.$message.error("获取项目失败");
this.back();
});
}, },
//查询发票编号 timestampToTime() {
Selectinsertlsit() { var date = this.incomeFrom.incomeTime;
selectAllBystatus(this.getinvoiveId) var Y = date.getFullYear() + "-";
.then(res => { var M =
if (res.success) { (date.getMonth() + 1 < 10
this.getinvoivelist = res.data; ? "0" + (date.getMonth() + 1)
} else { : date.getMonth() + 1) + "-";
this.$message.error(res.msg); var D =
this.back(); (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
} var h =
}) (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
.catch(error => { var m =
this.$message.error("获取发票编号失败"); (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) +
this.back(); ":";
}); var s =
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.incomeFrom.incomeTime = Y + M + D + h + m + s;
}, },
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
if (this.invoiceListAdd.length < 0) {
insert(this.incomeFrom) insert(this.incomeFrom)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); //判断是否有合同文件
this.$store.dispatch("tagsView/delView", this.$route); if (this.fileTypepdf) {
this.$router.push({ this.proutlist1.Id = res.data;
path: "/incomeList", this.$refs.upload1.submit();
query: {
id: this.$route.query.id
}
});
} else {
this.$message.error(res.msg);
} }
}) //判断是否有选择发票
.catch(error => { if(this.invoiceListAdd.length > 0){
this.$message.error("新建失败");
});
} else {
insert(this.incomeFrom)
.then(res => {
if (res.success) {
let list = []; let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.invoiceListAdd.forEach(item => { this.invoiceListAdd.forEach(item => {
list.push({ list.push({
invoiceId: item, invoiceId: item,
incomeId: res.data, incomeId: res.data,
status: 1 status:1
}); });
}); });
updatesubmit(list) updatesubmit(list).then(res => {
.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({
path: "/incomeList",
query: {
id: this.$route.query.id
}
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
})
.catch(error => {
this.$message.error("新建失败");
}); });
}else{
this.back()
}
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch(error => { .catch(error => {
this.$message.error("新建失败"); this.$message.error("提交失败");
}); });
} }
}
}); });
}, },
//重置 //重置
...@@ -473,60 +466,82 @@ export default { ...@@ -473,60 +466,82 @@ export default {
path: "/incomeList", path: "/incomeList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backid:this.$route.query.backid backid: this.$route.query.backid
} }
}); });
}, },
//时间处理 yyyy-MM-dd hh:mm:ss //合同文件校验
timestampToTime1() { onChangepdf(file) {
var date = this.addTO.time; console.log("2")
var Y = date.getFullYear() + "-"; const fileNamepdf = file.name;
var M = let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
(date.getMonth() + 1 < 10 if (fileType == ".pdf") {
? "0" + (date.getMonth() + 1) this.fileTypepdf = true;
: date.getMonth() + 1) + "-"; } else {
var D = this.$message.warning("合同文件只能是pdf格式文件");
(date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "; this.$refs.upload1.clearFiles();
var h = this.fileTypepdf = false;
(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; getTypeList() {
var Y = date.getFullYear() + "-"; let param = {
var M = companyId: this.$store.getters.companyId,
(date.getMonth() + 1 < 10 typeCategory: 0
? "0" + (date.getMonth() + 1) };
: date.getMonth() + 1) + "-"; selectAll(param)
var D = .then(res => {
(date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "; if (res.success) {
var h = this.typeList = res.data;
(date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":"; } else {
var m = this.$message.error(res.msg);
(date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + this.back();
":"; }
var s = })
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); .catch(error => {
this.incomeFrom.incomeTime = Y + M + D + h + m + s; this.$message.error("获取类型失败");
this.back();
});
}, },
//发票页面的按钮事件 //获取项目
getProject() {
let param = {
projectId: this.projectId
};
selectByProjectId(param)
.then(res => {
if (res.success) {
this.projectData = res.data;
this.incomeFrom.projectName = res.data.projectName;
this.incomeFrom.projectId = res.data.projectId;
} else {
this.$message.error(res.msg);
this.back();
}
})
.catch(error => {
this.$message.error("获取项目失败");
this.back();
});
},
//添加发票
drawerAdd() { drawerAdd() {
this.drawer = true; this.drawer = true;
this.getincomeSelectlist(); this.getincomeSelectlist();
}, },
//发票的分页查询 //添加发票单
Reimbursement() {
this.isgetid = 1;
this.$refs.addTO.resetFields();
},
//查询发票信息
getincomeSelectlist(pager = 1) { getincomeSelectlist(pager = 1) {
this.invoiceList.pageNum = pager; this.invoicegetList.qurey.pageNum = pager;
queryBypageIncomeAdd(this.invoiceList) queryBypageIncomeAdd(this.invoicegetList.qurey)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.invoicegetList = res.data; this.invoicegetList.list = res.data.list;
this.total = res.data.total; this.invoicegetList.total = res.data.total;
} else { } else {
this.$message.errror(res.msg); this.$message.errror(res.msg);
} }
...@@ -535,61 +550,88 @@ export default { ...@@ -535,61 +550,88 @@ export default {
this.$message.error("查询发票数据失败"); this.$message.error("查询发票数据失败");
}); });
}, },
//分页 //校验发票文件格式
handleSizeChange(val) { onChange(file) {
this.invoicegetList.pageSize = pageSize; console.log("1")
}, const fileNamepdf = file.name;
handleCurrentChange: function(currentPage) { let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
this.total = this.invoicegetList.length; if (fileType == ".pdf" || fileType == ".png" || fileType == ".jpg") {
this.currentPage = currentPage; this.fileTypeJpg = true
}, }else{
//取消隐藏tatle this.fileTypeJpg = false
cancel() { this.$message.warning("发票文件只能是pdf,png,jpg格式文件");
console.log(this.isgetid); this.$refs.upload2.clearFiles();
this.isgetid = 0; }
this.getincomeSelectlist();
},
//显示报销单添加页面
Reimbursement() {
this.isgetid = 1;
this.$refs.addTO.resetFields();
}, },
//发票提交页面的提交 //添加发票提交
getlistForm() { getlistForm(){
if(this.fileTypeJpg){
this.$refs.addTO.validate(valid => { this.$refs.addTO.validate(valid => {
if (valid) { if (valid) {
this.addTO.userId = this.$store.getters.urId
this.addTO.companyId = this.$store.getters.companyId
insertList(this.addTO) insertList(this.addTO)
.then(res => { .then(res=>{
if (res.success) { if(res.success){
this.proutlist.Id = res.data; //发票记录添加成功
//提交图片 //提交发票文件
this.$refs.upload.submit(); this.proutlist2.Id = res.data;
this.$refs.upload2.submit();
this.$message.success(res.msg); this.$message.success(res.msg);
this.isgetid = 0; this.isgetid = 0;
this.addTO.time = ""; this.addTO = {
this.$refs.addTO.resetFields(); category: 0, //0收入 1支出 2报销
code: null,
companyId: null,
mone: null,
number: null,
status: 0,//状态 0未报销 1已报销
time: null,
type: 0,//0 普票 1专票
userId: null
}
this.$refs.upload2.clearFiles();
this.getincomeSelectlist(); this.getincomeSelectlist();
this.Selectinsertlsit();
}else{
this.$message.errror(res.msg)
}
})
.catch(errpr=>{
this.$message.errror("发票添加失败")
})
}
})
}else{
this.$message.warning("没有发票文件,无法提交")
}
},
//查询发票编号
Selectinsertlsit() {
selectAllBystatus(this.getinvoiveId)
.then(res => {
if (res.success) {
this.getinvoivelist = res.data;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back();
} }
}) })
.catch(error => { .catch(error => {
this.$message.error("新建失败"); this.$message.error("获取发票编号失败");
}); this.back();
}
}); });
}, },
//数据清除 //清楚合同文件
delectdd() { delfile1(file, fileList){
this.$refs.addTO.resetFields(); this.fileTypepdf = false
},
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,22 +371,22 @@ export default { ...@@ -346,22 +371,22 @@ 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: {
...@@ -369,6 +394,12 @@ export default { ...@@ -369,6 +394,12 @@ export default {
} }
}); });
} }
},
//点击查看发票
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">
...@@ -32,6 +34,7 @@ ...@@ -32,6 +34,7 @@
</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,12 +84,41 @@ ...@@ -81,12 +84,41 @@
</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"
>
<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-form-item>
<el-form-item label="备注">
<el-input v-model="item.remarks"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div v-show="subbut">
<el-empty description="暂无报销项,因此无法报销"></el-empty>
</div>
</div>
<!-- 报销单 -->
<el-drawer title="发票单列表" :visible.sync="drawer" size="100%">
<!-- 表格区域 --> <!-- 表格区域 -->
<div class="drawer" v-show="isgetid == 0" style="margin-left: 5%"> <div class="drawer" v-show="isgetid == 0" style="margin-left: 5%">
<el-button <el-button
...@@ -95,12 +127,17 @@ ...@@ -95,12 +127,17 @@
style="margin: 20px 0px" style="margin: 20px 0px"
>添加报销单</el-button >添加报销单</el-button
> >
<el-table :data="invoicegetList.list" border style="width: 90%"> <el-table :data="invoicegetList" border style="width: 90%">
<el-table-column <el-table-column label="序号" width="50px">
prop="invoiceId" <template slot-scope="scope">
label="序号" {{
width="80" (invoicegetQurey.pageNum - 1) * invoicegetQurey.pageSize +
></el-table-column> scope.$index +
1
}}
</template>
</el-table-column>
<el-table-column <el-table-column
prop="number" prop="number"
label="发票号码" label="发票号码"
...@@ -110,10 +147,9 @@ ...@@ -110,10 +147,9 @@
<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">
<el-tag <el-tag :type="scope.row.category == '0' ? 'info' : 'primary'">{{
:type="scope.row.category == '0' ? 'info' : 'primary'" scope.row.category == "0" ? "普票" : "专票"
>{{ scope.row.category == "0" ? "普票" : "专票" }}</el-tag }}</el-tag>
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="type" label="发票类别"> <el-table-column prop="type" label="发票类别">
...@@ -149,9 +185,11 @@ ...@@ -149,9 +185,11 @@
<!-- total:总的条目数 --> <!-- total:总的条目数 -->
<el-pagination <el-pagination
style="margin: 0px auto" style="margin: 0px auto"
:current-page.sync="invoicegetQurey.pageNum"
:page-size="invoicegetQurey.pageSize"
@current-change="getincomeSelectlist" @current-change="getincomeSelectlist"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="invoicegetList.total" :total="total"
></el-pagination> ></el-pagination>
</div> </div>
<!-- 添加区域 --> <!-- 添加区域 -->
...@@ -203,12 +241,6 @@ ...@@ -203,12 +241,6 @@
@click="getlistForm()" @click="getlistForm()"
>立即创建</el-button >立即创建</el-button
> >
<el-button
type="info"
icon="el-icon-refresh"
@click="delectdd"
>重置信息</el-button
>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
...@@ -223,9 +255,11 @@ ...@@ -223,9 +255,11 @@
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"
:on-change="onChange"
:on-remove="delfile2"
style="margin-left: 90px" style="margin-left: 90px"
> >
<el-button <el-button
...@@ -244,33 +278,6 @@ ...@@ -244,33 +278,6 @@
</div> </div>
</el-drawer> </el-drawer>
</div> </div>
<div class="spend">
<el-form
:model="reimbursementItemData"
:inline="true"
label-width="150px"
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-form-item>
<el-form-item label="说明">
<el-input v-model="item.remarks"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</template> </template>
<script> <script>
...@@ -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,94 +368,146 @@ export default { ...@@ -383,94 +368,146 @@ 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, //抽屉的显示与隐藏 //报销单区域
//发票状态 options: [
status: 0, {
//发票的数组 value: 0,
invoicegetList: [], category: "普票",
//发票编号数组
getinvoivelist: [],
//收集发票编号
invoiceListAdd: {},
//查询发票编号的数组
getinvoiveId: {
companyId: null,
type: 1,
}, },
pageNum: 10, {
total: 1, value: 1,
//收集数据 category: "专票",
newList: [], },
//保存图片 ],
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() { submitForm() {
this.$forceUpdate(); this.$refs.form.validate((valid1) => {
}, if (valid1) {
this.$refs.details.validate((valid) => {
//获取公司报销类别 if (valid) {
getTypeList() { insert(this.from)
let param = {
companyId: this.$store.getters.companyId,
//typeCategory: 2,
};
typeSelectAll(param)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.typeList = res.data; //上传右边的报销项了 ,上传报销项之前,需要处理数据reimbursementId代表着本次提交报销表的id
this.reimbursementItemData.list.forEach((item) => {
item.reimbursementId = res.data;
});
Details(this.reimbursementItemData.list).then((res) => {
if (res.success) {
this.$message.success("申请成功,等待审批");
this.back();
} else {
this.$message.error(res.msg);
}
});
//上传发票号
let list = [];
this.from.fromList.forEach((item) => {
list.push({
invoiceId: item,
reimbursementId: res.data,
status: 1,
});
});
updatesubmit(list).then((res) => {
if (item.success) {
this.$messages.success("发票联邦成功");
} else {
this.$messages.error("发票联邦失败");
}
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back();
} }
}) })
.catch((error) => { .catch((error) => {
this.$message.error("获取类型失败"); this.$message.error("提交失败");
this.back(); });
}
});
}
}); });
}, },
//重置信息
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() {
let date = new Date();
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.from.fillingTime =
Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s;
},
//获取个人的项目 //获取个人的项目
getProject() { getProject() {
projectSelectAll({ userId: this.from.userId }) projectSelectAll({ userId: this.from.userId })
...@@ -494,10 +531,14 @@ export default { ...@@ -494,10 +531,14 @@ export default {
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
//获取数据 //获取数据
this.reimbursementItemList = res.data; let reimbursementItemList = res.data;
// console.log(this.reimbursementItemList.length)
if (reimbursementItemList.length == 0) {
this.subbut = true;
} else {
this.subbut = false;
//处理数据 //处理数据
this.reimbursementItemList.forEach((e) => { reimbursementItemList.forEach((e) => {
//设置参数 //设置参数
let pram = { let pram = {
itemNamwe: e.name, itemNamwe: e.name,
...@@ -508,115 +549,15 @@ export default { ...@@ -508,115 +549,15 @@ export default {
}; };
this.reimbursementItemData.list.push(pram); 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() {
this.$refs.form.validate((valid) => {
if (valid) {
//如果左侧校验成功,则开始校验右侧
this.$refs.details.validate((valid2) => {
if (valid2) {
insert(this.from)
.then((res) => {
if (res.success) {
this.reimbursementItemData.list.forEach((item) => {
item.reimbursementId = res.data;
});
let list = [];
this.from.fromList.forEach((item) => {
list.push({
invoiceId: item,
reimbursementId: res.data,
status: 1,
});
});
updatesubmit(list)
.then((item) => {
if (item.success) {
Details(this.reimbursementItemData.list).then(
(res) => {
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("请选择报销项");
}
});
}
}); });
}, },
//获取现在时间
time() {
let date = new Date();
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.from.fillingTime =
Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s;
this.timeNow = Y + "" + M + "" + D + "";
},
//新增消费
consumption() {
this.spend.push({});
},
//返回
back() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ path: "/reimbursementList" });
},
//重置信息
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;
},
//定义金额校验 //定义金额校验
moneyrow(rule, value, callback) { moneyrow(rule, value, callback) {
let RegExp = let RegExp =
...@@ -628,38 +569,20 @@ export default { ...@@ -628,38 +569,20 @@ export default {
callback(new Error("金额格式错误")); callback(new Error("金额格式错误"));
} }
}, },
//发票单区域
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;
},
//发票页面的按钮事件
drawerAdd() { drawerAdd() {
this.drawer = true; this.drawer = true;
this.getincomeSelectlist(); this.getincomeSelectlist();
}, },
//发票的分页查询 //查询发票
getincomeSelectlist(pager = 1) { getincomeSelectlist(pager = 1) {
this.invoiceList.pageNum = pager; this.invoicegetQurey.pageNum = pager;
queryBypageIncomeAdd(this.invoiceList) queryBypageIncomeAdd(this.invoicegetQurey)
.then((res) => { .then((res) => {
// console.log(res) // console.log(res)
if (res.success) { if (res.success) {
this.invoicegetList = res.data; this.invoicegetList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
} else { } else {
this.$message.errror(res.msg); this.$message.errror(res.msg);
...@@ -669,51 +592,101 @@ export default { ...@@ -669,51 +592,101 @@ export default {
this.$message.error("查询发票数据失败"); this.$message.error("查询发票数据失败");
}); });
}, },
//分页 //添加报销单
handleSizeChange(val) {
this.invoicegetList.pageSize = pageSize;
},
handleCurrentChange(currentPage) {
this.invoicegetList.pageNum = currentPage;
},
//取消隐藏tatle
cancel() {
// console.log(this.isgetid);
this.isgetid = 0;
this.getincomeSelectlist();
},
//显示报销单添加页面
Reimbursement() { Reimbursement() {
this.isgetid = 1; 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() { getlistForm() {
if (this.fileTypeJpg) {
this.$refs.addTO.validate((valid) => { this.$refs.addTO.validate((valid) => {
if (valid) { if (valid) {
this.addTO.companyId = this.$store.getters.companyId;
this.addTO.userId = this.$store.getters.info.userId;
insertList(this.addTO) insertList(this.addTO)
.then((res) => { .then((res) => {
console.log(res);
console.log(this.isgetid);
if (res.success) { if (res.success) {
//上传图片
//res.data 是上传那图片参数之一
//上传前提参数要对 status id
this.proutlist.Id = res.data; this.proutlist.Id = res.data;
//提交图片 //el-uploda组件的提交方法
//vue ref //代表着给标签设立一个标识 <div id=""></div> 相当于id
//this.$refs document.getElementById()
//手动上传
this.$refs.upload.submit(); this.$refs.upload.submit();
this.$message.success(res.msg); this.$message.success(res.msg);
//切换到表格区域
this.isgetid = 0; this.isgetid = 0;
this.addTO.time = ""; //初始化表单
this.$refs.addTO.resetFields(); this.addTO = {
userId: null,
category: null,
code: null,
companyId: null,
mone: null,
number: null,
status: 0,
time: null,
type: 2,
};
this.getincomeSelectlist(); this.getincomeSelectlist();
this.Selectinsertlsit();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error);
this.$message.error("新建失败"); this.$message.error("新建失败");
}); });
} }
}); });
} else {
this.$message.warning("需要发票的图片或文件");
}
},
//取消
cancel() {
this.isgetid = 0;
this.getincomeSelectlist();
}, },
//数据清除 //校验发票图片是否合格
delectdd() { onChange(file) {
this.$refs.addTO.resetFields(); const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType == ".pdf" || fileType == ".png" || fileType == ".jpg") {
this.fileTypeJpg = true;
} else {
this.fileTypeJpg = false;
this.$message.warning("发票文件只能是pdf,png,jpg格式文件");
this.$refs.upload.clearFiles();
}
},
//清除发片文件
delfile2(file, fileList) {
this.fileTypeJpg = false;
}, },
//查询发票编号 //查询发票编号
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();
......
...@@ -24,16 +24,6 @@ ...@@ -24,16 +24,6 @@
> >
</el-option> </el-option>
</el-select> </el-select>
</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>
<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>
...@@ -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