Commit 06681c94 authored by 柳 佳乐's avatar 柳 佳乐
Browse files

20221117

parent 5e4b6059
finance @ 6e137f66
Subproject commit 6e137f66e7646a55ebb0681483b9c502249d0d84
......@@ -31,7 +31,6 @@ export const previewPDF = async (filename) => {
const a = document.createElement("a"); //创建一个<a></a>标签
// a.href = url; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.href=(await getFileUrl(filename)).data
debugger
a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中
......
......@@ -15,9 +15,7 @@ export function isExternal(path) {
* @returns {Boolean}
*/
export function validUsername(str) {
// const valid_map = ['admin', 'editor']
// return valid_map.indexOf(str.trim()) >= 0
return str.trim().length>0
return str.length>0
}
/**
......
......@@ -387,6 +387,7 @@ export default {
},
//返回
back() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/administrationlsit");
},
//重置
......
......@@ -266,6 +266,7 @@ export default {
},
// 返回
back() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/assetslist");
},
//重置
......
......@@ -113,7 +113,7 @@
>
<el-col :span="20">
<el-form-item label="确认密码" prop="staffPassword">
<el-input type="password" v-model="passwordData.staffPassword"></el-input>
<el-input type="password" v-model="passwordData.staffPassword" show-password></el-input>
</el-form-item>
</el-col>
<el-col :span="20">
......
......@@ -36,7 +36,7 @@
</el-descriptions-item>
<el-descriptions-item label="合同编号" labelClassName="required" :disabled="isEdit">
<el-form-item prop="contractNumber">
<el-input placeholder="请输入合同编号" v-model="formData.contractNumber"></el-input>
<el-input placeholder="请输入合同编号" v-model="formData.contractNumber" :disabled="isEdit"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="合同类型" labelClassName="required">
......
<template>
<div>
<div v-loading="loading" element-loading-text="图片上传中。。。">
<!-- 头部 -->
<div class="QueryInvoice" style="margin: 10px 15px">
<el-row :gutter="30">
......@@ -172,7 +172,7 @@
</div>
<!-- 添加区域 -->
<div class="getadd" v-show="!isgetid" style="margin-left: 5%">
<el-row v-loading="loading" element-loading-text="图片上传中。。。">
<el-row >
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
<el-form
style="width: 100%; margin: 30px 0px"
......@@ -247,7 +247,7 @@
:on-remove="delfile"
:on-success="fileSuccess"
:limit="1"
:on-error="loading==true"
:on-error="geterror"
style="margin-left: 90px"
>
<el-button
......@@ -413,7 +413,6 @@ export default {
this.total = res.data.total;
res.data.list.forEach(e => {
let fileNamepdf = e.filePath;
console.log(fileNamepdf);
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
......@@ -459,7 +458,7 @@ export default {
}
},
//时间处理
getFroms: function(value) {
getFroms(value) {
var dt = new Date(value.time);
let year = dt.getFullYear();
let month = dt.getMonth() + 1;
......@@ -546,6 +545,31 @@ export default {
this.loading = false;
this.isgetid = true;
this.getincomeSelectlist();
},
//发票的删除操作
YesGet(row) {
deleteexpen(row)
.then(res => {
if (res.success) {
this.visible = false;
this.$message({
message: "发票删除成功",
type: "success"
});
this.getincomeSelectlist();
} else {
this.$message.error(res.msg);
}
})
.catch(e => {
console.log(e.msg);
this.$message.error(e.msg);
});
},
geterror() {
this.loading = true;
}
}
};
......
......@@ -71,11 +71,10 @@
</template>
<script>
import { validUsername } from "@/utils/validate";
export default {
data() {
const validateUsername = (rule, value, callback) => {
if (!validUsername(value)) {
if (!(value)) {
callback(new Error("请输入账号"));
} else {
callback();
......@@ -88,7 +87,7 @@ export default {
},
loginRules: {
username: [
{ required: true, trigger: "blur", validator: validateUsername },
{ required: true, trigger: "blur", message: "请输入账号" },
],
password: [{ required: true, trigger: "blur", message: "请输入密码" }],
},
......
......@@ -112,8 +112,9 @@ export default {
},
methods: {
back(){
this.$router.back();
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.back();
},
addPettyMoneyRecord() {
......@@ -129,7 +130,7 @@ export default {
if (this.isEdit) {
updatePettyMoneyRecord(params).then(res => {
if (res.success) {
// this.addPettyFile(params.pettyId)
//this.addPettyFile(params.pettyId)
this.$message.success("修改成功")
setTimeout(() => {
this.$router.push('/pettyMoneyRecord')
......@@ -141,6 +142,7 @@ export default {
} else {
insertPettyMoneyRecord(params).then(res => {
if (res.success) {
this.addPettyFile(res.data)
this.$message.success("申请成功")
setTimeout(() => {
......@@ -164,7 +166,8 @@ export default {
},
addPettyFile(pettyId) {
this.fileParams.Id = pettyId
this.uploadChange && this.$refs.uploadPettyFile.submit()
this.fileParams.companyId = this.companyId
this.$refs.uploadPettyFile.submit()
},
handleDownload() {
let { pettyEnclosure: filePath } = this.formData
......
......@@ -248,6 +248,7 @@ export default {
revokePetty(params).then(res => {
if (res.success) {
this.$message.success("撤销成功")
this.getPettyMoneyList()
} else {
this.$message.error("撤销失败")
}
......
......@@ -3,7 +3,10 @@
<div class="header">
<el-form :inline="true" :model="expendQurey">
<el-form-item label="支出对象">
<el-input v-model="expendQurey.expendObject" placeholder="收入对象"></el-input>
<el-input
v-model="expendQurey.expendObject"
placeholder="收入对象"
></el-input>
</el-form-item>
<el-form-item label="支出类别">
<el-select v-model="expendQurey.expendType">
......@@ -17,7 +20,10 @@
</el-form-item>
<el-form-item label="支出内容">
<el-input v-model="expendQurey.expendBody" placeholder="收入内容"></el-input>
<el-input
v-model="expendQurey.expendBody"
placeholder="收入内容"
></el-input>
</el-form-item>
<el-form-item label="支出时间">
......@@ -31,14 +37,22 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="qurey()"
>查询</el-button
>
<el-button
type="primary"
icon="el-icon-refresh-right"
@click="reset()"
>重置</el-button
>
<el-button
type="success"
icon="el-icon-circle-plus-outline"
@click="addexpend()"
v-if="state != 0"
>新增支出</el-button>
>新增支出</el-button
>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form>
......@@ -49,8 +63,8 @@
:data="expendList"
style="width: 100%; text-align: center"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="序号" width="50px">
<template slot-scope="scope">
......@@ -78,12 +92,22 @@
<el-table-column prop="expendRemarks" label="支出备注" />
<el-table-column prop="prop" label="发票文件">
<template slot-scope="scope">
<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>
</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>
<el-button
type="success"
size="mini"
@click="selectImage(scope.row)"
>点击查看</el-button
>
</template>
</el-table-column>
<el-table-column label="操作人员">
......@@ -91,7 +115,12 @@
<el-tag effect="plain">{{ scope.row.userName }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="projectAmount" label="操作" v-if="state != 0" width="120px">
<el-table-column
prop="projectAmount"
label="操作"
v-if="state != 0"
width="120px"
>
<template slot-scope="scope">
<el-button
style="margin: 5px"
......@@ -99,7 +128,8 @@
icon="el-icon-edit"
type="info"
@click="updatain(scope.row)"
>修改信息</el-button>
>修改信息</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -116,39 +146,62 @@
</div>
<!-- 附件抽屉 -->
<div>
<el-drawer title="附件操作" :visible.sync="drawer2" :direction="direction" size="50%">
<el-drawer
title="附件操作"
:visible.sync="drawer2"
:direction="direction"
size="50%"
>
<el-button
type="primary"
style=" margin-left:5%;margin-top:40px "
style="margin-left: 5%; margin-top: 40px"
:disabled="disabled"
@click="updatecard"
>添加附件</el-button>
>添加附件</el-button
>
<el-card
class="box-card"
style="width:90%; margin-left:5%; margin-top:20px"
v-show="getshow==1"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 1"
>
<el-row class="row-bg">
<div v-for="index in queryDTOList" :key="index.enclosureId" class="lsitall">
<div
v-for="index in queryDTOList"
:key="index.enclosureId"
class="lsitall"
>
<el-col :span="10">
<div style=" margin-top: 6px;margin-left:40px">附件{{index.enclosureId}}</div>
<div style="margin-top: 6px; margin-left: 40px">
附件{{ index.enclosureId }}
</div>
</el-col>
<el-col :span="12" style="margin-left:-50px">
<el-col :span="12" style="margin-left: -50px">
<el-button
type="primary"
icon="el-icon-folder-checked"
class="a-style"
size="mini"
style=" font-size: 13px"
style="font-size: 13px"
@click="delProject(index)"
>下载</el-button>
>下载</el-button
>
<el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="index.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteProject(index)">确定</el-button>
<el-button
size="mini"
type="text"
@click="index.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="deleteProject(index)"
>确定</el-button
>
</div>
<el-button
type="danger"
......@@ -157,7 +210,8 @@
size="mini "
style="font-size: 13px"
slot="reference"
>删除</el-button>
>删除</el-button
>
</el-popover>
</el-col>
</div>
......@@ -166,16 +220,16 @@
<!-- 附件上传 -->
<el-card
class="box-card"
style="width:90%; margin-left:5%; margin-top:20px"
v-show="getshow==0"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 0"
>
<div style="width:60%;margin-left:30px">
<div style="width: 60%; margin-left: 30px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe"
style="margin:20px 0px;"
style="margin: 20px 0px"
></el-input>
<el-upload
class="upload-demo"
......@@ -189,38 +243,64 @@
:on-success="Refresh"
:data="proutlist1"
multiple
style="margin:20px 0px;"
style="margin: 20px 0px"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传附件</em>
</div>
<div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
<div class="el-upload__tip" slot="tip">
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div style="margin-left:75%;">
<div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button>
<el-button type="primary" @click="determine()" style="margin-top:20px;">确 定</el-button>
<el-button
type="primary"
@click="determine()"
style="margin-top: 20px"
>确 定</el-button
>
</div>
</el-card>
<div class="box-card" v-show="getshow==3"></div>
<div class="box-card" v-show="getshow == 3"></div>
</el-drawer>
</div>
<div>
<!--抽屉-->
<el-drawer title="发票详情" :visible.sync="drawer" :direction="direction" size="60%">
<el-drawer
title="发票详情"
:visible.sync="drawer"
:direction="direction"
size="60%"
>
<!-- filePath-->
<el-button type="primary" style="margin:10px 3%" @click="selectGet()">添加收入发票</el-button>
<el-button type="primary" style="margin: 10px 3%" @click="selectGet()"
>添加收入发票</el-button
>
<el-table
:data="getinvoivelist"
style="width: 94%; margin:10px 3%; text-align: center"
style="width: 94%; margin: 10px 3%; text-align: center"
border
>
<el-table-column type="index" label="序号" width="40"></el-table-column>
<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
type="index"
label="序号"
width="40"
></el-table-column>
<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">
<div v-if="formatProtocolType(scope.row)">
......@@ -231,19 +311,40 @@
></el-image>
</div>
<div v-else>
<a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
<a class="a-style" @click="handlePreView(scope.row)"
>点击查看文件</a
>
</div>
</template>
</el-table-column>
<el-table-column prop="prop" label="操作">
<template slot-scope="scope">
<el-popover placement="top" width="60" v-model="scope.row.visible">
<el-popover
placement="top"
width="60"
v-model="scope.row.visible"
>
<p>确定要删除该发票吗</p>
<div style="text-align: right; margin:0">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="DeleteFrom(scope.row)">确定</el-button>
<div style="text-align: right; margin: 0">
<el-button
size="mini"
type="text"
@click="scope.row.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="DeleteFrom(scope.row)"
>确定</el-button
>
</div>
<el-button type="danger" icon="el-icon-delete" size="mini" slot="reference"></el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
slot="reference"
></el-button>
</el-popover>
</template>
</el-table-column>
......@@ -260,7 +361,7 @@
multiple
filterable
default-first-option
style="width:100%;"
style="width: 100%"
placeholder="请选择要添加的发票编号"
>
<el-option
......@@ -290,7 +391,7 @@ import {
selectAllBystatus,
updatesubmit,
deletBystatus,
deleteById
deleteById,
} from "@/api/project";
import { getFileUrl } from "@/api/companyFile";
export default {
......@@ -305,7 +406,7 @@ export default {
expendType: null,
expendBody: null,
expendTimeStart: null,
expendTimeEnd: null
expendTimeEnd: null,
},
expendList: [],
options: [],
......@@ -317,7 +418,7 @@ export default {
//查询图片给的值
getinvoiveId: {
companyId: null,
expendId: 0
expendId: 0,
},
//图片的数组
getinvoivelist: [],
......@@ -328,7 +429,7 @@ export default {
// //查询附件
queryDTO: {
companyId: null,
expendId: null
expendId: null,
},
//附件抽屉
drawer2: false,
......@@ -340,7 +441,7 @@ export default {
getFormslist: {
userId: null,
companyId: null,
type: 1
type: 1,
},
incomeIdgrt: null, //收集incomeId数据
invoiceListAdd: [], //查询发票的集合
......@@ -352,17 +453,17 @@ export default {
enclosureDescribe: "",
status: 1, //0收入 1支出
companyId: null,
userId: null
userId: null,
},
fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //合同文件
disabled: false //隐藏
disabled: false, //隐藏
};
},
computed: {
state: function() {
state: function () {
return this.$route.query.state;
}
},
},
created() {
this.getinvoiveId.companyId = this.$store.getters.companyId;
......@@ -380,7 +481,7 @@ export default {
//获取支出情况
getexpend() {
selectByProjectId(this.expendQurey)
.then(res => {
.then((res) => {
if (res.success) {
this.expendList = res.data.list;
this.total = res.data.total;
......@@ -388,7 +489,7 @@ export default {
this.$message.errror(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("查询数据失败");
});
},
......@@ -396,10 +497,10 @@ export default {
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
typeCategory: 1
typeCategory: 1,
};
selectAll(param)
.then(res => {
.then((res) => {
if (res.success) {
this.options = res.data;
} else {
......@@ -407,7 +508,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取类型失败");
this.back();
});
......@@ -422,8 +523,8 @@ export default {
path: "/expendAdd",
query: {
id: this.$route.query.id,
backlistid: this.backlistid
}
backlistid: this.backlistid,
},
});
},
//修改支出信息
......@@ -432,8 +533,8 @@ export default {
path: "/expendUpdata",
query: {
id: data.expendId,
projectId: this.$route.query.id
}
projectId: this.$route.query.id,
},
});
},
//时间处理
......@@ -466,7 +567,7 @@ export default {
},
//下载附件
delProject(row) {
getFileUrl( row.enclosureFile).then(res => {
getFileUrl(row.enclosureFile).then((res) => {
if (res.success) {
let url = res.data;
console.log(url);
......@@ -507,14 +608,14 @@ export default {
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId)
.then(res => {
.then((res) => {
if (res.success) {
res.data.forEach(e => {
res.data.forEach((e) => {
let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl( e.filePath).then(res => {
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
......@@ -531,7 +632,7 @@ export default {
//this.back();
}
})
.catch(error => {
.catch((error) => {
console.log(error);
this.$message.error("获取发票图片失败");
//this.back();
......@@ -539,25 +640,28 @@ export default {
},
back() {
if (this.backlistid == 0) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/projectList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
} else if (this.backlistid == 1) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/beresponsibleforList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
} else {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/participateinList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
}
},
......@@ -571,7 +675,7 @@ export default {
this.queryDTO.expendId = row.expendId;
this.proutlist1.Id = row.expendId;
selectByIdF(this.queryDTO)
.then(res => {
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
if (this.queryDTOList.length > 0) {
......@@ -587,7 +691,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
......@@ -596,7 +700,7 @@ export default {
this.dialogFormVisible = true;
this.getFormslist.userId = this.$store.getters.urId;
selectAllBystatus(this.getFormslist)
.then(res => {
.then((res) => {
if (res.success) {
this.invoiceListAdd = res.data;
} else {
......@@ -604,7 +708,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
......@@ -617,21 +721,21 @@ export default {
Buttonback2() {
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.getListincom.forEach(item => {
this.getListincom.forEach((item) => {
list.push({
invoiceId: item,
expendId: this.incomeIdgrt,
status: 1
status: 1,
});
});
updatesubmit(list).then(res => {
updatesubmit(list).then((res) => {
if (res.success) {
this.$message.success(res.msg);
this.dialogFormVisible = false;
this.$message({
showClose: true,
message: "添加发票成功",
type: "success"
type: "success",
});
this.Selectinsertlsit();
this.getListincom = [];
......@@ -645,20 +749,20 @@ export default {
//收集被删除发票的数据
let BillList = {
invoiceId: row.invoiceId,
expendId: row.expendId
expendId: row.expendId,
};
deletBystatus(BillList)
.then(res => {
.then((res) => {
if (res.success) {
this.visible = false;
this.$message({
message: "删除成功",
type: "success"
type: "success",
});
this.Selectinsertlsit();
}
})
.catch(errror => {
.catch((errror) => {
this.$message.error(res.msg);
});
},
......@@ -691,23 +795,23 @@ export default {
//删除附件
deleteProject(row) {
deleteById(row)
.then(res => {
.then((res) => {
if (res.success) {
this.selectImage(row);
this.$message({
message: "删除成功",
type: "success"
type: "success",
});
this.visible = false;
}
})
.catch(errror => {
.catch((errror) => {
this.$message.error(res.msg);
});
},
//清除附件文件
delfile1() {
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
this.fileTypepdf = false;
},
//确定提交附件
......@@ -720,7 +824,7 @@ export default {
this.$message({
showClose: true,
message: "上传附件成功",
type: "success"
type: "success",
});
this.Refresh();
} else {
......@@ -731,7 +835,7 @@ export default {
Refresh() {
this.queryDTO.expendId = this.proutlist1.Id;
selectByIdF(this.queryDTO)
.then(res => {
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
......@@ -739,7 +843,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
......@@ -750,7 +854,7 @@ export default {
enclosureDescribe: "",
status: 0, //0收入 1支出
companyId: null,
userId: null
userId: null,
};
},
//附件取消
......@@ -778,8 +882,8 @@ export default {
this.$refs.upload1.clearFiles();
this.fileTypepdf = false;
}
}
}
},
},
};
</script>
......
......@@ -3,7 +3,10 @@
<div class="header">
<el-form :inline="true" :model="incomeQurey">
<el-form-item label="收入对象">
<el-input v-model="incomeQurey.incomeObject" placeholder="收入对象"></el-input>
<el-input
v-model="incomeQurey.incomeObject"
placeholder="收入对象"
></el-input>
</el-form-item>
<el-form-item label="收入类别">
<el-select v-model="incomeQurey.incomeType">
......@@ -16,7 +19,10 @@
</el-select>
</el-form-item>
<el-form-item label="收入内容">
<el-input v-model="incomeQurey.incomeBody" placeholder="收入内容"></el-input>
<el-input
v-model="incomeQurey.incomeBody"
placeholder="收入内容"
></el-input>
</el-form-item>
<el-form-item label="收入时间">
<el-date-picker
......@@ -29,14 +35,22 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="qurey()"
>查询</el-button
>
<el-button
type="primary"
icon="el-icon-refresh-right"
@click="reset()"
>重置</el-button
>
<el-button
type="success"
icon="el-icon-circle-plus-outline"
@click="addincome()"
v-if="state != 0"
>新增收入</el-button>
>新增收入</el-button
>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form>
......@@ -47,8 +61,8 @@
:data="incomeList"
style="width: 100%; text-align: center"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{ 'text-align': 'center' }"
>
<el-table-column type="expand">
<template slot-scope="props">
......@@ -87,12 +101,22 @@
<el-table-column prop="incomeTime" label="收入时间" />
<el-table-column prop="prop" label="发票文件">
<template slot-scope="scope">
<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>
</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>
<el-button
type="success"
size="mini"
@click="selectImage(scope.row)"
>点击查看</el-button
>
</template>
</el-table-column>
......@@ -110,7 +134,8 @@
icon="el-icon-edit"
type="info"
@click="updatain(scope.row)"
>修改信息</el-button>
>修改信息</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -129,19 +154,38 @@
<!--发票抽屉-->
<div>
<el-drawer title="发票详情" :visible.sync="drawer" :direction="direction" size="60%">
<el-drawer
title="发票详情"
:visible.sync="drawer"
:direction="direction"
size="60%"
>
<!-- filePath-->
<el-button type="primary" style="margin:10px 3%" @click="selectGet()">添加收入发票</el-button>
<el-button type="primary" style="margin: 10px 3%" @click="selectGet()"
>添加收入发票</el-button
>
<el-table
:data="getinvoivelist"
style="width: 94%; margin:10px 3%; text-align: center"
style="width: 94%; margin: 10px 3%; text-align: center"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{ 'text-align': 'center' }"
>
<el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column prop="number" label="号码" width="160px"></el-table-column>
<el-table-column prop="mone" label="金额" width="180px"></el-table-column>
<el-table-column
type="index"
label="序号"
width="80px"
></el-table-column>
<el-table-column
prop="number"
label="号码"
width="160px"
></el-table-column>
<el-table-column
prop="mone"
label="金额"
width="180px"
></el-table-column>
<el-table-column prop="prop" label="查看PDF文件或图片" width="180px">
<template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)">
......@@ -152,19 +196,40 @@
></el-image>
</div>
<div v-else>
<a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
<a class="a-style" @click="handlePreView(scope.row)"
>点击查看文件</a
>
</div>
</template>
</el-table-column>
<el-table-column prop="prop" label="操作">
<template slot-scope="scope">
<el-popover placement="top" width="60" v-model="scope.row.visible">
<el-popover
placement="top"
width="60"
v-model="scope.row.visible"
>
<p>确定要删除该发票吗</p>
<div style="text-align: right; margin:0">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="DeleteFrom(scope.row)">确定</el-button>
<div style="text-align: right; margin: 0">
<el-button
size="mini"
type="text"
@click="scope.row.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="DeleteFrom(scope.row)"
>确定</el-button
>
</div>
<el-button type="danger" icon="el-icon-delete" size="mini" slot="reference"></el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
slot="reference"
></el-button>
</el-popover>
</template>
</el-table-column>
......@@ -181,7 +246,7 @@
multiple
filterable
default-first-option
style="width:100%;"
style="width: 100%"
placeholder="请选择要添加的发票编号"
>
<el-option
......@@ -202,39 +267,62 @@
<!-- 附件抽屉 -->
<div>
<el-drawer title="附件操作" :visible.sync="drawer2" :direction="direction" size="50%">
<el-drawer
title="附件操作"
:visible.sync="drawer2"
:direction="direction"
size="50%"
>
<el-button
type="primary"
style=" margin-left:5%;margin-top:40px "
style="margin-left: 5%; margin-top: 40px"
:disabled="disabled"
@click="updatecard"
>添加附件</el-button>
>添加附件</el-button
>
<el-card
class="box-card"
style="width:90%; margin-left:5%; margin-top:20px"
v-show="getshow==1"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 1"
>
<el-row class="row-bg">
<div v-for="index in queryDTOList" :key="index.enclosureId" class="lsitall">
<div
v-for="index in queryDTOList"
:key="index.enclosureId"
class="lsitall"
>
<el-col :span="10">
<div style=" margin-top: 6px;margin-left:40px">附件{{index.enclosureId}}</div>
<div style="margin-top: 6px; margin-left: 40px">
附件{{ index.enclosureId }}
</div>
</el-col>
<el-col :span="12" style="margin-left:-50px">
<el-col :span="12" style="margin-left: -50px">
<el-button
type="primary"
icon="el-icon-folder-checked"
class="a-style"
size="mini"
style=" font-size: 13px"
style="font-size: 13px"
@click="delProject(index)"
>下载</el-button>
>下载</el-button
>
<el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="index.visible= false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteProject(index)">确定</el-button>
<el-button
size="mini"
type="text"
@click="index.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="deleteProject(index)"
>确定</el-button
>
</div>
<el-button
type="danger"
......@@ -243,7 +331,8 @@
size="mini "
style="font-size: 13px"
slot="reference"
>删除</el-button>
>删除</el-button
>
</el-popover>
</el-col>
</div>
......@@ -252,16 +341,16 @@
<!-- 附件上传 -->
<el-card
class="box-card"
style="width:90%; margin-left:5%; margin-top:20px"
v-show="getshow==0"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 0"
>
<div style="width:60%;margin-left:30px">
<div style="width: 60%; margin-left: 30px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe"
style="margin:20px 0px;"
style="margin: 20px 0px"
></el-input>
<el-upload
class="upload-demo"
......@@ -275,23 +364,30 @@
:on-success="Refresh"
:data="proutlist1"
multiple
style="margin:20px 0px;"
style="margin: 20px 0px"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传附件</em>
</div>
<div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
<div class="el-upload__tip" slot="tip">
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div style="margin-left:75%;">
<div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button>
<el-button type="primary" @click="determine()" style="margin-top:20px;">确 定</el-button>
<el-button
type="primary"
@click="determine()"
style="margin-top: 20px"
>确 定</el-button
>
</div>
</el-card>
<div class="box-card" v-show="getshow==3"></div>
<div class="box-card" v-show="getshow == 3"></div>
</el-drawer>
</div>
</div>
......@@ -306,7 +402,7 @@ import {
selectAllBystatus,
updatesubmit,
deletBystatus,
deleteById
deleteById,
} from "@/api/project";
import { componentMap } from "../../../router";
import { getFileUrl } from "@/api/companyFile";
......@@ -321,7 +417,7 @@ const InitialData = {
incomeType: null,
projectId: null,
userId: null,
projectName: null
projectName: null,
};
export default {
......@@ -336,7 +432,7 @@ export default {
incomeType: null,
incomeBody: null,
incomeTimeStart: null,
incomeTimeEnd: null
incomeTimeEnd: null,
},
incomeList: [],
options: [],
......@@ -350,7 +446,7 @@ export default {
//查询图片给的值
getinvoiveId: {
companyId: null,
incomeId: 0
incomeId: 0,
},
//图片的数组
getinvoivelist: [],
......@@ -360,7 +456,7 @@ export default {
//查询附件
queryDTO: {
companyId: null,
incomeId: null
incomeId: null,
},
queryDTOList: [], //收集附件的数据
//附件抽屉
......@@ -371,7 +467,7 @@ export default {
getFormslist: {
userId: null,
companyId: null,
type: 0
type: 0,
}, //查询的能选择的表单信息
getListincom: [], //收集选择的数组
incomeIdgrt: null, //收集incomeId数据
......@@ -382,17 +478,17 @@ export default {
enclosureDescribe: "",
status: 0, //0收入 1支出
companyId: null,
userId: null
userId: null,
},
fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //合同文件
disabled: false //隐藏,
disabled: false, //隐藏,
};
},
computed: {
state: function() {
state: function () {
return this.$route.query.state;
}
},
},
created() {
this.getinvoiveId.companyId = this.$store.getters.companyId;
......@@ -409,24 +505,24 @@ export default {
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
typeCategory: 0
typeCategory: 0,
};
selectAll(param)
.then(res => {
.then((res) => {
if (res.success) {
this.options = res.data;
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取类型失败");
});
},
//获取收入情况
getIncome() {
selectByProjectId(this.incomeQurey)
.then(res => {
.then((res) => {
if (res.success) {
this.incomeList = res.data.list;
this.total = res.data.total;
......@@ -434,7 +530,7 @@ export default {
this.$message.errror(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("查询数据失败");
});
},
......@@ -511,8 +607,8 @@ export default {
path: "/incomeAdd",
query: {
id: this.$route.query.id,
backid: this.backid
}
backid: this.backid,
},
});
},
//查看项目附件.....
......@@ -520,7 +616,7 @@ export default {
this.queryDTO.incomeId = row.incomeId;
this.proutlist1.Id = row.incomeId;
selectByIdF(this.queryDTO)
.then(res => {
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
if (this.queryDTOList.length > 0) {
......@@ -536,7 +632,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
......@@ -550,15 +646,15 @@ export default {
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId)
.then(res => {
.then((res) => {
if (res.success) {
res.data.forEach(e => {
res.data.forEach((e) => {
let fileNamepdf = e.filePath;
console.log(fileNamepdf);
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl( e.filePath ).then(res => {
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
......@@ -575,7 +671,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
console.log(error);
this.$message.error("获取发票图片失败");
this.back();
......@@ -587,32 +683,35 @@ export default {
path: "/incomeUpdata",
query: {
id: data.incomeId,
projectId: this.$route.query.id
}
projectId: this.$route.query.id,
},
});
},
//返回开始
back() {
if (this.backid == 0) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/projectList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
} else if (this.backid == 1) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/beresponsibleforList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
} else {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/participateinList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
}
},
......@@ -624,7 +723,8 @@ export default {
//下载附件
delProject(row) {
getFileUrl(row.enclosureFile).then(res => {
getFileUrl(row.enclosureFile)
.then((res) => {
if (res.success) {
let url = res.data;
console.log(url);
......@@ -635,19 +735,20 @@ export default {
document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签
}else{
this.$message.error('下载失败');
} else {
this.$message.error("下载失败");
}
}).catch(e=>{
this.$message.error(e.msg)
})
.catch((e) => {
this.$message.error(e.msg);
});
},
//查询未报销发票
selectGet() {
this.dialogFormVisible = true;
this.getFormslist.userId = this.$store.getters.urId;
selectAllBystatus(this.getFormslist)
.then(res => {
.then((res) => {
if (res.success) {
this.invoiceListAdd = res.data;
} else {
......@@ -655,7 +756,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
......@@ -669,15 +770,15 @@ export default {
Buttonback2() {
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.getListincom.forEach(item => {
this.getListincom.forEach((item) => {
list.push({
invoiceId: item,
incomeId: this.incomeIdgrt,
status: 1
status: 1,
});
});
updatesubmit(list).then(res => {
updatesubmit(list).then((res) => {
if (res.success) {
this.$message.success(res.msg);
this.dialogFormVisible = false;
......@@ -685,7 +786,7 @@ export default {
this.$message({
showClose: true,
message: "添加发票成功",
type: "success"
type: "success",
});
this.Selectinsertlsit();
this.getListincom = [];
......@@ -699,20 +800,20 @@ export default {
//收集被删除发票的数据
let BillList = {
invoiceId: row.invoiceId,
incomeId: row.incomeId
incomeId: row.incomeId,
};
deletBystatus(BillList)
.then(res => {
.then((res) => {
if (res.success) {
this.visible = false;
this.$message({
message: "删除成功",
type: "success"
type: "success",
});
this.Selectinsertlsit();
}
})
.catch(errror => {
.catch((errror) => {
this.$message.error(res.msg);
});
},
......@@ -727,23 +828,23 @@ export default {
//删除附件
deleteProject(row) {
deleteById(row)
.then(res => {
.then((res) => {
if (res.success) {
this.selectImage(row);
this.$message({
message: "删除成功",
type: "success"
type: "success",
});
this.visible = false;
}
})
.catch(errror => {
.catch((errror) => {
this.$message.error(res.msg);
});
},
//清除附件文件
delfile1(file) {
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
this.proutlist1.enclosureDescribe = ""; //初始化数据
this.fileTypepdf = false;
},
......@@ -759,7 +860,7 @@ export default {
this.$message({
showClose: true,
message: "上传附件成功",
type: "success"
type: "success",
});
this.Refresh();
} else {
......@@ -771,7 +872,7 @@ export default {
this.queryDTO.incomeId = this.proutlist1.Id;
selectByIdF(this.queryDTO)
.then(res => {
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
......@@ -779,7 +880,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
......@@ -821,8 +922,8 @@ export default {
return false;
}
}
}
}
},
},
};
</script>
......
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