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");
} }
} }
}; };
......
This diff is collapsed.
...@@ -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">
......
...@@ -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