Commit fdfb3666 authored by 柳 佳乐's avatar 柳 佳乐
Browse files

20221117

parent 2b231389
...@@ -24,3 +24,11 @@ export function queryBypageByuserId(data) { ...@@ -24,3 +24,11 @@ export function queryBypageByuserId(data) {
data data
}) })
} }
//获取在线预览url
export function getFileUrl(fileName) {
return request({
url: `/file/getFileUrl?fileName=${fileName}`,
method: 'post'
})
}
...@@ -104,16 +104,26 @@ export function checkPhone(rule, value, callback) { ...@@ -104,16 +104,26 @@ export function checkPhone(rule, value, callback) {
}; };
//路径校验 //路径校验
export function pathValid(rule, value, callback) { export function pathValid(rule, value, callback) {
const RegExp = /^\/.*/ const RegExp = /^\/[\S].*/
if (!value) { if (!value) {
return callback(new Error('路劲不能为空')) return callback(new Error('路劲不能为空'))
} else if (!RegExp.test(value)) { } else if (!RegExp.test(value)) {
callback(new Error("路径必须已‘/’开头")) callback(new Error("路径必须已‘/’开头,且不能由空格"))
} else { } else {
callback(); callback();
} }
} }
//路径校验
export function pathRedirect(rule, value, callback) {
const RegExp = /^\/[\S].*/
if (value) {
if(!RegExp.test(value)){
callback(new Error("路径必须已‘/’开头,且不能由空格"))
}
}
callback();
}
//定义金额校验 //定义金额校验
export function money(rule, value, callback) { export function money(rule, value, callback) {
let RegExp = /(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^([-]?)(0){1}$)|(^([-]?)[0-9]\.[0-9]([0-9])?$)/; let RegExp = /(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^([-]?)(0){1}$)|(^([-]?)[0-9]\.[0-9]([0-9])?$)/;
......
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="审批状态:"> <el-form-item label="审批状态:">
<el-select <el-select placeholder="请选择" v-model="queryitem.tripStatus">
placeholder="请选择"
v-model="queryitem.tripStatus"
>
<el-option label="待审批" value="0"></el-option> <el-option label="待审批" value="0"></el-option>
<el-option label="小组长通过" value="1"></el-option> <el-option label="小组长通过" value="1"></el-option>
<el-option label="小组长驳回" value="2"></el-option> <el-option label="小组长驳回" value="2"></el-option>
...@@ -209,7 +206,10 @@ ...@@ -209,7 +206,10 @@
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.tripStatus == 1"> <div v-if="scope.row.tripStatus == 1">
<el-button type="primary" size="mini" @click="agreeandrefuse(scope.row)" <el-button
type="primary"
size="mini"
@click="agreeandrefuse(scope.row)"
>同意或驳回</el-button >同意或驳回</el-button
> >
</div> </div>
...@@ -253,9 +253,9 @@ ...@@ -253,9 +253,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="fromgetlist(scope.row)"> <div v-if="fromgetlist(scope.row)">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 80px; height: 80px"
:src="scope.row.filePath" :src="scope.row.fileUrl"
:preview-src-list="[scope.row.filePath]" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
...@@ -583,6 +583,7 @@ ...@@ -583,6 +583,7 @@
<script> <script>
import { money } from "@/utils/myValidate"; import { money } from "@/utils/myValidate";
import { getFileUrl } from "@/api/companyFile";
import { queryBypagefinance } from "@/api/spendreimbursement"; import { queryBypagefinance } from "@/api/spendreimbursement";
import { selectAll } from "@/api/spendreimbursement"; import { selectAll } from "@/api/spendreimbursement";
import { finApproval } from "@/api/spendreimbursement"; import { finApproval } from "@/api/spendreimbursement";
...@@ -632,6 +633,7 @@ export default { ...@@ -632,6 +633,7 @@ export default {
paramlist: {}, paramlist: {},
financelistData: {}, financelistData: {},
getinvoivelist: [], getinvoivelist: [],
srcList: [],
rules: { rules: {
verifyTotalAmountLarge: [ verifyTotalAmountLarge: [
{ {
...@@ -866,7 +868,20 @@ export default { ...@@ -866,7 +868,20 @@ export default {
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; let fileNamepdf = e.filePath;
console.log(e.filePath);
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
if (fileType != ".pdf") {
this.srcList.push(url);
}
}
});
}); });
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
...@@ -1007,9 +1022,9 @@ export default { ...@@ -1007,9 +1022,9 @@ export default {
}); });
}, },
//下载附件 //下载附件
delProject(row) { async delProject(row) {
var a = document.createElement("a"); //创建一个<a></a>标 var a = document.createElement("a"); //创建一个<a></a>标
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href = (await getFileUrl(row.enclosureFile)).data; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 //a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
...@@ -1041,7 +1056,7 @@ export default { ...@@ -1041,7 +1056,7 @@ export default {
} else { } else {
let fileNamepdf = row.filePath; let fileNamepdf = row.filePath;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf(".")); let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType == ".pdf") { if (fileType != ".pdf") {
return true; return true;
} else { } else {
return false; return false;
...@@ -1050,7 +1065,7 @@ export default { ...@@ -1050,7 +1065,7 @@ export default {
}, },
//跳转修改 //跳转修改
Agrt(row) { Agrt(row) {
const photopath = row.filePath; const photopath = row.fileUrl;
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
}, },
......
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="审批状态:"> <el-form-item label="审批状态:">
<el-select <el-select placeholder="请选择" v-model="queryitem.tripStatus">
placeholder="请选择"
v-model="queryitem.tripStatus"
>
<el-option label="待审批" value="0"></el-option> <el-option label="待审批" value="0"></el-option>
<el-option label="小组长通过" value="1"></el-option> <el-option label="小组长通过" value="1"></el-option>
<el-option label="小组长驳回" value="2"></el-option> <el-option label="小组长驳回" value="2"></el-option>
...@@ -366,9 +363,9 @@ ...@@ -366,9 +363,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="fromgetlist(scope.row)"> <div v-if="fromgetlist(scope.row)">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 80px; height: 80px"
:src="scope.row.filePath" :src="scope.row.fileUrl"
:preview-src-list="[scope.row.filePath]" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
...@@ -473,6 +470,7 @@ ...@@ -473,6 +470,7 @@
<script> <script>
import { queryByheadman } from "@/api/spendreimbursement"; import { queryByheadman } from "@/api/spendreimbursement";
import { getFileUrl } from "@/api/companyFile";
import { selectAll } from "@/api/spendreimbursement"; import { selectAll } from "@/api/spendreimbursement";
import { Approval } from "@/api/spendreimbursement"; import { Approval } from "@/api/spendreimbursement";
import { selectAllById, selectByIdF } from "@/api/project"; import { selectAllById, selectByIdF } from "@/api/project";
...@@ -517,6 +515,7 @@ export default { ...@@ -517,6 +515,7 @@ export default {
companyId: null, companyId: null,
tripId: 0, tripId: 0,
}, },
srcList:[],
//附件///------- //附件///-------
//drawer1: false, //drawer1: false,
...@@ -700,7 +699,19 @@ export default { ...@@ -700,7 +699,19 @@ export default {
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; let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
if (fileType != ".pdf") {
this.srcList.push(url);
}
}
});
}); });
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
...@@ -764,9 +775,9 @@ export default { ...@@ -764,9 +775,9 @@ export default {
}); });
}, },
//下载附件 //下载附件
delProject(row) { async delProject(row) {
var a = document.createElement("a"); //创建一个<a></a>标 var a = document.createElement("a"); //创建一个<a></a>标
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href = (await getFileUrl(row.enclosureFile)).data; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 //a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
...@@ -797,7 +808,7 @@ export default { ...@@ -797,7 +808,7 @@ export default {
} else { } else {
let fileNamepdf = row.filePath; let fileNamepdf = row.filePath;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf(".")); let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType == ".pdf") { if (fileType != ".pdf") {
return true; return true;
} else { } else {
return false; return false;
...@@ -806,7 +817,7 @@ export default { ...@@ -806,7 +817,7 @@ export default {
}, },
//跳转修改 //跳转修改
Agrt(row) { Agrt(row) {
const photopath = row.filePath; const photopath = row.fileUrl;
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
}, },
......
...@@ -504,7 +504,6 @@ export default { ...@@ -504,7 +504,6 @@ export default {
}, },
// 添加数据的方法 // 添加数据的方法
submitForm() { submitForm() {
this.$refs.ruleform.validate((valid) => { this.$refs.ruleform.validate((valid) => {
if (valid) { if (valid) {
insert(this.spendreimbursementform) insert(this.spendreimbursementform)
...@@ -517,7 +516,7 @@ export default { ...@@ -517,7 +516,7 @@ export default {
obj1.tripId = tid; obj1.tripId = tid;
addpeopleList[0] = obj1; addpeopleList[0] = obj1;
this.peopleList.insertBatch.forEach((e) => { this.peopleList.insertBatch.forEach((e) => {
if(e.personnelName != null && e.personnelName != ''){ if (e.personnelName != null && e.personnelName != "") {
let obj = {}; let obj = {};
obj.personnelName = e.personnelName; obj.personnelName = e.personnelName;
obj.tripId = res.data; obj.tripId = res.data;
...@@ -551,8 +550,7 @@ export default { ...@@ -551,8 +550,7 @@ export default {
this.spendreimbursementform.companyId; this.spendreimbursementform.companyId;
this.enclosurelist.enclosureDescribe = this.enclosurelist.enclosureDescribe =
this.spendreimbursementform.enclosureDescribe; this.spendreimbursementform.enclosureDescribe;
this.enclosurelist.userId = this.enclosurelist.userId = this.spendreimbursementform.userId;
this.spendreimbursementform.userId;
this.$refs.enclosureUpload.submit(); this.$refs.enclosureUpload.submit();
// 第三个方法 添加发票 // 第三个方法 添加发票
...@@ -578,7 +576,6 @@ export default { ...@@ -578,7 +576,6 @@ export default {
} }
}); });
}, },
//
addDomain() { addDomain() {
this.peopleList.insertBatch.push({ this.peopleList.insertBatch.push({
personnelName: "", personnelName: "",
......
...@@ -291,9 +291,9 @@ ...@@ -291,9 +291,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="fromgetlist(scope.row)"> <div v-if="fromgetlist(scope.row)">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 80px; height: 80px"
:src="scope.row.filePath" :src="scope.row.fileUrl"
:preview-src-list="[scope.row.filePath]" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
...@@ -663,6 +663,7 @@ ...@@ -663,6 +663,7 @@
<script> <script>
import { queryBypage } from "@/api/spendreimbursement"; import { queryBypage } from "@/api/spendreimbursement";
import { getFileUrl } from "@/api/companyFile";
import { selectAll } from "@/api/spendreimbursement"; import { selectAll } from "@/api/spendreimbursement";
import { selectAllById, selectByIdF, deleteById } from "@/api/project"; import { selectAllById, selectByIdF, deleteById } from "@/api/project";
import { import {
...@@ -774,7 +775,7 @@ export default { ...@@ -774,7 +775,7 @@ export default {
}, },
formtripid: null, formtripid: null,
form: [], form: [],
srcList: [],
parm: { parm: {
tripId: null, tripId: null,
companyId: null, companyId: null,
...@@ -1122,9 +1123,20 @@ export default { ...@@ -1122,9 +1123,20 @@ export default {
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; let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
if (fileType != ".pdf") {
this.srcList.push(url);
}
}
});
}); });
// console.log(this.getinvoivelist);
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
...@@ -1173,9 +1185,9 @@ export default { ...@@ -1173,9 +1185,9 @@ export default {
}); });
}, },
//下载附件 //下载附件
delProject(row) { async delProject(row) {
var a = document.createElement("a"); //创建一个<a></a>标 var a = document.createElement("a"); //创建一个<a></a>标
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href = (await getFileUrl(row.enclosureFile)).data; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 //a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
...@@ -1235,7 +1247,6 @@ export default { ...@@ -1235,7 +1247,6 @@ export default {
//刷新附件 //刷新附件
Refresh() { Refresh() {
this.queryDTO.tripId = this.proutlist1.Id; this.queryDTO.tripId = this.proutlist1.Id;
console.log(this.proutlist1.Id);
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
...@@ -1292,7 +1303,7 @@ export default { ...@@ -1292,7 +1303,7 @@ export default {
}, },
//跳转修改 //跳转修改
Agrt(row) { Agrt(row) {
const photopath = row.filePath; const photopath = row.fileUrl;
console.log(photopath); console.log(photopath);
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
></el-pagination> ></el-pagination>
</div> </div>
<!-- 抽屉 --> <!-- 抽屉 -->
<el-drawer title="使用登记" :visible.sync="drawer" :direction="direction" size="40%"> <el-drawer title="使用登记" :visible.sync="drawer" :direction="direction" size="40%" :before-close="handleClose">
<div v-show="showid==0" style="width:80%;margin-left:10%;margin-top:60px;"> <div v-show="showid==0" style="width:80%;margin-left:10%;margin-top:60px;">
<el-form <el-form
:model="user" :model="user"
...@@ -218,10 +218,11 @@ export default { ...@@ -218,10 +218,11 @@ export default {
loading: false, loading: false,
direction: "rtl", direction: "rtl",
currentTime: new Date(), // 获取当前时间 currentTime: new Date(), // 获取当前时间
getid: 1,
///抽屉 ///抽屉
showid: 1, showid: 1,
rules: { rules: {
userId: [{ required: true, message: "请输入姓名", trigger: "change" }] userId: [{ required: true, message: "请输入姓名", trigger: "blur" }]
} }
}; };
}, },
...@@ -246,13 +247,12 @@ export default { ...@@ -246,13 +247,12 @@ export default {
} }
}) })
.catch(e => { .catch(e => {
this.$$message.error(e.msg); this.$message.error(e.msg);
}); });
}, },
//借用 //借用
Uselist1(showid= 0) { Uselist1(showid = 0) {
this.showid =showid; this.showid = showid;
console.log(this.showid);
this.options = []; this.options = [];
this.addDTO = { this.addDTO = {
fixedId: null, //资产ID fixedId: null, //资产ID
...@@ -268,7 +268,6 @@ export default { ...@@ -268,7 +268,6 @@ export default {
}, },
//归还 //归还
Uselist(row) { Uselist(row) {
console.log(row.id);
this.drawer = true; this.drawer = true;
this.showid = 1; this.showid = 1;
this.addDTOs = { this.addDTOs = {
...@@ -344,6 +343,7 @@ export default { ...@@ -344,6 +343,7 @@ export default {
message: "恭喜您借用申请成功", message: "恭喜您借用申请成功",
type: "success" type: "success"
}); });
this.drawer = false; this.drawer = false;
this.getList(); this.getList();
} else { } else {
...@@ -372,6 +372,7 @@ export default { ...@@ -372,6 +372,7 @@ export default {
type: "success" type: "success"
}); });
this.$refs.ruleForm1.resetFields(); this.$refs.ruleForm1.resetFields();
this.drawer = false; this.drawer = false;
this.getList(); this.getList();
} else { } else {
...@@ -403,6 +404,11 @@ export default { ...@@ -403,6 +404,11 @@ export default {
//搜索 //搜索
selectgetlist() { selectgetlist() {
this.getList(); this.getList();
},
//关闭
handleClose(done){
this.$refs.ruleForm1.resetFields();
done();
} }
} }
}; };
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</template> </template>
<script> <script>
import { queryBypage } from "@/api/companyFile"; import { queryBypage,getFileUrl } from "@/api/companyFile";
export default { export default {
data() { data() {
return { return {
...@@ -115,10 +115,12 @@ export default { ...@@ -115,10 +115,12 @@ export default {
this.getCompanyFileList(); this.getCompanyFileList();
}, },
//下载 //下载
download(row) { async download(row) {
console.log(row); console.log(row);
var a = document.createElement("a"); //创建一个<a></a>标签 var a = document.createElement("a"); //创建一个<a></a>标签
a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href=(await getFileUrl(row.companyFile)).data
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</template> </template>
<script> <script>
import { queryBypageByuserId } from "@/api/companyFile"; import { queryBypageByuserId ,getFileUrl } from "@/api/companyFile";
export default { export default {
data() { data() {
return { return {
...@@ -127,10 +127,12 @@ export default { ...@@ -127,10 +127,12 @@ export default {
this.getselFileList(); this.getselFileList();
}, },
//下载 //下载
download(row) { async download(row) {
console.log(row); console.log(row);
var a = document.createElement("a"); //创建一个<a></a>标签 var a = document.createElement("a"); //创建一个<a></a>标签
a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href=(await getFileUrl(row.companyFile)).data
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
......
...@@ -399,6 +399,7 @@ export default { ...@@ -399,6 +399,7 @@ export default {
let url = process.env.VUE_APP_BASE_API + filePath; let url = process.env.VUE_APP_BASE_API + filePath;
downloadPDFFile(url, name) downloadPDFFile(url, name)
}, },
handleRemove(file) { handleRemove(file) {
deleteContract(file).then(res => { deleteContract(file).then(res => {
if (res.success) { if (res.success) {
......
...@@ -6,16 +6,10 @@ ...@@ -6,16 +6,10 @@
<el-col :span="30"> <el-col :span="30">
<el-form :inline="true" :model="invoiceQruey"> <el-form :inline="true" :model="invoiceQruey">
<el-form-item label="发票号码" style="margin-left"> <el-form-item label="发票号码" style="margin-left">
<el-input <el-input v-model="invoiceQruey.number" placeholder="发票号码"></el-input>
v-model="invoiceQruey.number"
placeholder="发票号码"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="发票代码"> <el-form-item label="发票代码">
<el-input <el-input v-model="invoiceQruey.code" placeholder="发票代码"></el-input>
v-model="invoiceQruey.code"
placeholder="发票代码"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="发票类型"> <el-form-item label="发票类型">
<el-select v-model="invoiceQruey.category" placeholder="请选择"> <el-select v-model="invoiceQruey.category" placeholder="请选择">
...@@ -55,24 +49,15 @@ ...@@ -55,24 +49,15 @@
icon="el-icon-search" icon="el-icon-search"
style="margin: 1px 5px" style="margin: 1px 5px"
@click="selectexpend()" @click="selectexpend()"
>查询</el-button >查询</el-button>
> <el-button type="info" icon="el-icon-refresh-right" @click="upddlist()">重置</el-button>
<el-button
type="info"
icon="el-icon-refresh-right"
@click="upddlist()"
>重置</el-button
>
<el-button <el-button
type="success" type="success"
icon="el-icon-download" icon="el-icon-download"
v-if="isgetid" v-if="isgetid"
@click="Reimbursement()" @click="Reimbursement()"
>添加发票单</el-button >添加发票单</el-button>
> <el-button type="warning" v-if="!isgetid" @click="Reimbursement()">返回</el-button>
<el-button type="warning" v-if="!isgetid" @click="Reimbursement()"
>返回</el-button
>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -95,21 +80,15 @@ ...@@ -95,21 +80,15 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="code" label="发票代码"></el-table-column> <el-table-column prop="code" label="发票代码"></el-table-column>
<el-table-column <el-table-column prop="number" label="发票号码" width="width"></el-table-column>
prop="number" <el-table-column prop="time" label="发票时间" :formatter="getFroms"></el-table-column>
label="发票号码"
width="width"
></el-table-column>
<el-table-column
prop="time"
label="发票时间"
:formatter="getFroms"
></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 :type="scope.row.category == '0' ? 'info' : 'primary'">{{ <el-tag :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="发票类别">
...@@ -122,14 +101,15 @@ ...@@ -122,14 +101,15 @@
? 'danger' ? 'danger'
: 'warning' : 'warning'
" "
>{{ >
{{
scope.row.type == "0" scope.row.type == "0"
? "收入" ? "收入"
: scope.row.type == "1" : scope.row.type == "1"
? "支出" ? "支出"
: "报销" : "报销"
}}</el-tag }}
> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="mone" label="发票金额"></el-table-column> <el-table-column prop="mone" label="发票金额"></el-table-column>
...@@ -138,22 +118,22 @@ ...@@ -138,22 +118,22 @@
<div v-if="formatProtocolType(scope.row)"> <div v-if="formatProtocolType(scope.row)">
<el-image <el-image
style="width: 80px; height: 80px" style="width: 80px; height: 80px"
:src="getimagin(scope.row)" :src="scope.row.fileUrl"
:preview-src-list="srcList" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
<a class="a-style" @click="handlePreView(scope.row)" <a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
>点击查看文件</a
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="发票状态" width="90px"> <el-table-column prop="status" label="发票状态" width="90px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.status == '0' ? 'info' : 'warning'">{{ <el-tag :type="scope.row.status == '0' ? 'info' : 'warning'">
{{
scope.row.status == 0 ? "未报销" : "已报销" scope.row.status == 0 ? "未报销" : "已报销"
}}</el-tag> }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="操作"> <el-table-column prop="prop" label="操作">
...@@ -161,15 +141,8 @@ ...@@ -161,15 +141,8 @@
<el-popover placement="top" width="160" v-model="scope.row.visible"> <el-popover placement="top" width="160" v-model="scope.row.visible">
<p>确定要删除当前发票吗</p> <p>确定要删除当前发票吗</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button <el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
size="mini" <el-button type="primary" size="mini" @click="YesGet(scope.row)">确定</el-button>
type="text"
@click="scope.row.visible = false"
>取消</el-button
>
<el-button type="primary" size="mini" @click="YesGet(scope.row)"
>确定</el-button
>
</div> </div>
<el-button <el-button
type="danger" type="danger"
...@@ -205,7 +178,6 @@ ...@@ -205,7 +178,6 @@
style="width: 100%; margin: 30px 0px" style="width: 100%; margin: 30px 0px"
:model="addTO" :model="addTO"
:rules="rules" :rules="rules"
ref="addTO" ref="addTO"
label-width="80px" label-width="80px"
class="demo-ruleForm" class="demo-ruleForm"
...@@ -258,15 +230,8 @@ ...@@ -258,15 +230,8 @@
<el-input v-model="addTO.mone"></el-input> <el-input v-model="addTO.mone"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="success" icon="el-icon-folder-checked" @click="getlistForm()">立即创建</el-button>
type="success" <el-button type="info" icon="el-icon-refresh" @click="delectdd">重置信息</el-button>
icon="el-icon-folder-checked"
@click="getlistForm()"
>立即创建</el-button
>
<el-button type="info" icon="el-icon-refresh" @click="delectdd"
>重置信息</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
...@@ -282,6 +247,7 @@ ...@@ -282,6 +247,7 @@
:on-remove="delfile" :on-remove="delfile"
:on-success="fileSuccess" :on-success="fileSuccess"
:limit="1" :limit="1"
:on-error="loading==true"
style="margin-left: 90px" style="margin-left: 90px"
> >
<el-button <el-button
...@@ -289,11 +255,8 @@ ...@@ -289,11 +255,8 @@
size="small" size="small"
type="primary" type="primary"
style="margin-left: 20px; margin-top: 40px" style="margin-left: 20px; margin-top: 40px"
>选取文件</el-button >选取文件</el-button>
> <div slot="tip" class="el-upload__tip">只能上传jpg/png/pdf文件,且不超过500kb</div>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png/pdf文件,且不超过500kb
</div>
</el-upload> </el-upload>
</el-col> </el-col>
</el-row> </el-row>
...@@ -303,6 +266,7 @@ ...@@ -303,6 +266,7 @@
<script> <script>
import { insertList, queryBypageIncomeAdd, deleteexpen } from "@/api/project"; import { insertList, queryBypageIncomeAdd, deleteexpen } from "@/api/project";
import { getFileUrl } from "@/api/companyFile";
import { money, Invoice_code, Invoice_No } from "@/utils/myValidate"; import { money, Invoice_code, Invoice_No } from "@/utils/myValidate";
export default { export default {
data() { data() {
...@@ -317,41 +281,41 @@ export default { ...@@ -317,41 +281,41 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
companyId: null, companyId: null,
userId: null, userId: null
}, },
categoryOptions: [ categoryOptions: [
{ {
value: 0, value: 0,
category: "普票", category: "普票"
}, },
{ {
value: 1, value: 1,
category: "专票", category: "专票"
}, }
], ],
typeOptions: [ typeOptions: [
{ {
value: 0, value: 0,
type: "收入", type: "收入"
}, },
{ {
value: 1, value: 1,
type: "支出", type: "支出"
}, },
{ {
value: 2, value: 2,
type: "报销", type: "报销"
}, }
], ],
statusOptions: [ statusOptions: [
{ {
value: 0, value: 0,
status: "未报销", status: "未报销"
}, },
{ {
value: 1, value: 1,
status: "已报销", status: "已报销"
}, }
], ],
total: 0, total: 0,
invoicegetList: [], invoicegetList: [],
...@@ -366,52 +330,54 @@ export default { ...@@ -366,52 +330,54 @@ export default {
number: null, number: null,
status: 0, status: 0,
time: null, time: null,
type: null, type: null
}, },
rules: { rules: {
time: [ time: [
{ required: true, message: "请输入发票时间", trigger: "change" }, { required: true, message: "请输入发票时间", trigger: "change" }
], ],
number: [ number: [
{ {
required: true, required: true,
validator: Invoice_No, validator: Invoice_No,
trigger: "change", trigger: "change"
}, }
], ],
code: [{ required: true, validator: Invoice_code, trigger: "change" }], code: [{ required: true, validator: Invoice_code, trigger: "change" }],
category: [ category: [
{ {
required: true, required: true,
message: "请至少选择一个发票类型", message: "请至少选择一个发票类型",
trigger: "change", trigger: "change"
}, }
], ],
type: [ type: [
{ {
required: true, required: true,
message: "请至少选择一个发票类别", message: "请至少选择一个发票类别",
trigger: "change", trigger: "change"
}, }
], ],
mone: [ mone: [
{ {
required: true, required: true,
validator: money, validator: money,
trigger: "change", trigger: "change"
}, }
], ]
}, },
fileList: [], fileList: [],
action:null, action: null,
proutlist: { proutlist: {
Id: 1, Id: 1,
status: 0, status: 0,
companyId: null
}, },
loading:false loading: false
}; };
}, },
created() { created() {
this.proutlist.companyId = this.$store.getters.companyId;
this.invoiceQruey.companyId = this.$store.getters.companyId; this.invoiceQruey.companyId = this.$store.getters.companyId;
this.invoiceQruey.userId = this.$store.getters.urId; this.invoiceQruey.userId = this.$store.getters.urId;
this.action = process.env.VUE_APP_BASE_API + "/file/uploadFile"; this.action = process.env.VUE_APP_BASE_API + "/file/uploadFile";
...@@ -437,30 +403,38 @@ export default { ...@@ -437,30 +403,38 @@ export default {
Reimbursement() { Reimbursement() {
this.isgetid = !this.isgetid; this.isgetid = !this.isgetid;
this.$refs.addTO.resetFields(); this.$refs.addTO.resetFields();
this.fileList = this.fileList.filter((item) => item.uid !== file.uid); this.fileList = this.fileList.filter(item => item.uid !== file.uid);
}, },
//发票的分页查询 //发票的分页查询
getincomeSelectlist() { getincomeSelectlist() {
queryBypageIncomeAdd(this.invoiceQruey) queryBypageIncomeAdd(this.invoiceQruey)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.invoicegetList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
this.srcList = []; res.data.list.forEach(e => {
res.data.list.forEach((e) => {
let fileNamepdf = e.filePath; let fileNamepdf = e.filePath;
console.log(fileNamepdf);
let fileType = fileNamepdf.substring( let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".") fileNamepdf.lastIndexOf(".")
); );
getFileUrl(e.filePath).then(res => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
if (fileType != ".pdf") { if (fileType != ".pdf") {
this.srcList.push(process.env.VUE_APP_BASE_API + e.filePath); this.srcList.push(url);
}
} }
}); });
});
this.invoicegetList = res.data.list;
} 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("查询发票数据失败");
}); });
}, },
...@@ -484,11 +458,8 @@ export default { ...@@ -484,11 +458,8 @@ export default {
} }
} }
}, },
getimagin(row) {
return process.env.VUE_APP_BASE_API + row.filePath;
},
//时间处理 //时间处理
getFroms: function (value) { getFroms: function(value) {
var dt = new Date(value.time); var dt = new Date(value.time);
let year = dt.getFullYear(); let year = dt.getFullYear();
let month = dt.getMonth() + 1; let month = dt.getMonth() + 1;
...@@ -497,8 +468,7 @@ export default { ...@@ -497,8 +468,7 @@ export default {
}, },
//点击查看发票 //点击查看发票
handlePreView(row) { handlePreView(row) {
const photopath = process.env.VUE_APP_BASE_API + row.filePath; const photopath = row.fileUrl;
console.log(photopath);
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
//时间处理 yyyy-MM-dd hh:mm:ss //时间处理 yyyy-MM-dd hh:mm:ss
...@@ -522,15 +492,14 @@ export default { ...@@ -522,15 +492,14 @@ export default {
}, },
//发票提交页面的提交 //发票提交页面的提交
getlistForm() { getlistForm() {
if (this.fileTypeJpg == true) { if (this.fileTypeJpg == true) {
this.$refs.addTO.validate((valid) => { this.$refs.addTO.validate(valid => {
if (valid) { if (valid) {
this.loading = true this.loading = true;
this.addTO.userId = this.$store.getters.urId; this.addTO.userId = this.$store.getters.urId;
this.addTO.companyId = this.$store.getters.companyId; this.addTO.companyId = this.$store.getters.companyId;
insertList(this.addTO) insertList(this.addTO)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
//发票记录添加成功 //发票记录添加成功
//提交发票文件 //提交发票文件
...@@ -538,12 +507,12 @@ export default { ...@@ -538,12 +507,12 @@ export default {
this.$refs.upload.submit(); this.$refs.upload.submit();
this.$message.success(res.msg); this.$message.success(res.msg);
} else { } else {
this.loading = false this.loading = false;
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((e) => { .catch(e => {
this.loading = false this.loading = false;
this.$message.error("发票添加失败,检测是否重复"); this.$message.error("发票添加失败,检测是否重复");
}); });
} }
...@@ -559,7 +528,6 @@ export default { ...@@ -559,7 +528,6 @@ export default {
//校验发票文件格式 //校验发票文件格式
onChange(file) { onChange(file) {
const fileNamepdf = file.name; const fileNamepdf = file.name;
console.log(file.name);
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf(".")); let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType == ".pdf" || fileType == ".png" || fileType == ".jpg") { if (fileType == ".pdf" || fileType == ".png" || fileType == ".jpg") {
this.fileTypeJpg = true; this.fileTypeJpg = true;
...@@ -574,12 +542,12 @@ export default { ...@@ -574,12 +542,12 @@ export default {
this.fileTypeJpg = false; this.fileTypeJpg = false;
}, },
//文件上传成功 //文件上传成功
fileSuccess(res){ fileSuccess(res) {
this.loading = false this.loading = false;
this.isgetid = true; this.isgetid = true;
this.getincomeSelectlist(); this.getincomeSelectlist();
} }
}, }
}; };
</script> </script>
<style scoped> <style scoped>
......
...@@ -26,25 +26,25 @@ ...@@ -26,25 +26,25 @@
<el-input v-model="permission.path" placeholder="路由path" /> <el-input v-model="permission.path" placeholder="路由path" />
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="permission.name" placeholder="路由名称" /> <el-input v-model.trim="permission.name" placeholder="路由名称" />
</el-form-item> </el-form-item>
<el-form-item label="路由备注"> <el-form-item label="路由备注">
<el-input v-model="permission.menuExplain" placeholder="路由备注" /> <el-input v-model.trim="permission.menuExplain" placeholder="路由备注" />
</el-form-item> </el-form-item>
<el-form-item label="组件名称" prop="component"> <el-form-item label="组件名称" prop="component">
<el-input v-model="permission.component" placeholder="组件名称" /> <el-input v-model.trim="permission.component" placeholder="组件名称" />
</el-form-item> </el-form-item>
<el-form-item label="重定向路径"> <el-form-item label="重定向路径" prop="redirect">
<el-input v-model="permission.redirect" placeholder="重定向路径" /> <el-input v-model="permission.redirect" placeholder="重定向路径" />
</el-form-item> </el-form-item>
<el-form-item label="主题" prop="meta.title"> <el-form-item label="主题" prop="meta.title">
<el-input v-model="permission.meta.title" placeholder="路由主题" /> <el-input v-model.trim="permission.meta.title" placeholder="路由主题" />
</el-form-item> </el-form-item>
<el-form-item label="图标"> <el-form-item label="图标">
<el-input v-model="permission.meta.icon" placeholder="路由图标" /> <el-input v-model.trim="permission.meta.icon" placeholder="路由图标" />
</el-form-item> </el-form-item>
<el-form-item label="高亮菜单"> <el-form-item label="高亮菜单">
<el-input v-model="permission.meta.activeMenu" placeholder="高亮菜单" /> <el-input v-model.trim="permission.meta.activeMenu" placeholder="高亮菜单" />
</el-form-item> </el-form-item>
<el-checkbox v-model="permission.hidden" label="隐藏"></el-checkbox> <el-checkbox v-model="permission.hidden" label="隐藏"></el-checkbox>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<script> <script>
import { getMenuTree, addMenu, editMenu, deleteMenu } from '@/api/menu' import { getMenuTree, addMenu, editMenu, deleteMenu } from '@/api/menu'
import { deepClone } from '@/utils' import { deepClone } from '@/utils'
import { pathValid } from '@/utils/myValidate' import { pathValid,pathRedirect} from '@/utils/myValidate'
let id = 1000; let id = 1000;
const defaultPermisson = { const defaultPermisson = {
...@@ -102,6 +102,9 @@ export default { ...@@ -102,6 +102,9 @@ export default {
path: [{ path: [{
required: true, validator: pathValid, trigger: "blur" required: true, validator: pathValid, trigger: "blur"
}], }],
redirect: [{
validator: pathRedirect, trigger: "blur"
}],
name: [{ required: true, message: "请输入名称", trigger: "blur" }], name: [{ required: true, message: "请输入名称", trigger: "blur" }],
component: [{ required: true, message: "请输入组件名称", trigger: "blur" }], component: [{ required: true, message: "请输入组件名称", trigger: "blur" }],
'meta.title': [{ required: true, message: "请输入主题", trigger: "blur" }] 'meta.title': [{ required: true, message: "请输入主题", trigger: "blur" }]
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<el-dialog :visible.sync="dialogVisible" :title="dialogType"> <el-dialog :visible.sync="dialogVisible" :title="dialogType">
<el-form ref="form" :model="role" label-width="80px" label-position="left" :rules="rules"> <el-form ref="form" :model="role" label-width="80px" label-position="left" :rules="rules">
<el-form-item label="角色名称" prop="rlName"> <el-form-item label="角色名称" prop="rlName">
<el-input v-model="role.rlName" placeholder="角色名称" /> <el-input v-model.trim="role.rlName" placeholder="角色名称" />
</el-form-item> </el-form-item>
<el-form-item label="角色描述" prop="rlDesc"> <el-form-item label="角色描述" prop="rlDesc">
<el-input v-model="role.rlDesc" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" placeholder="角色描述" /> <el-input v-model="role.rlDesc" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" placeholder="角色描述" />
......
...@@ -145,6 +145,7 @@ export default { ...@@ -145,6 +145,7 @@ export default {
}, },
addPettyFile(pettyId) { addPettyFile(pettyId) {
this.fileParams.Id = pettyId this.fileParams.Id = pettyId
this.fileParams.companyId = this.companyId
this.uploadChange && this.$refs.uploadPettyFile.submit() this.uploadChange && this.$refs.uploadPettyFile.submit()
}, },
handleDownload(file) { handleDownload(file) {
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<el-popover placement="top" width="160" v-model="index.visible"> <el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p> <p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</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> <el-button type="primary" size="mini" @click="deleteProject(index)">确定</el-button>
</div> </div>
<el-button <el-button
...@@ -225,8 +225,8 @@ ...@@ -225,8 +225,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)"> <div v-if="formatProtocolType(scope.row)">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 80px; height: 80px"
:src="getimagin(scope.row)" :src="scope.row.fileUrl"
:preview-src-list="srcList" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
...@@ -292,6 +292,7 @@ import { ...@@ -292,6 +292,7 @@ import {
deletBystatus, deletBystatus,
deleteById deleteById
} from "@/api/project"; } from "@/api/project";
import { getFileUrl } from "@/api/companyFile";
export default { export default {
data() { data() {
return { return {
...@@ -465,13 +466,21 @@ export default { ...@@ -465,13 +466,21 @@ export default {
}, },
//下载附件 //下载附件
delProject(row) { delProject(row) {
getFileUrl( row.enclosureFile).then(res => {
if (res.success) {
let url = res.data;
console.log(url);
var a = document.createElement("a"); //创建一个<a></a>标 var a = document.createElement("a"); //创建一个<a></a>标
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href = url; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了 a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签 a.remove(); // 一次性的,用完就删除a标签
} else {
this.$message.error("下载失败");
}
});
}, },
//查询 //查询
qurey() { qurey() {
...@@ -500,23 +509,30 @@ export default { ...@@ -500,23 +509,30 @@ export default {
selectAllById(this.getinvoiveId) selectAllById(this.getinvoiveId)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data;
this.srcList = [];
res.data.forEach(e => { res.data.forEach(e => {
let fileNamepdf = e.filePath; let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring( let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".") fileNamepdf.lastIndexOf(".")
); );
getFileUrl( e.filePath).then(res => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
if (fileType != ".pdf") { if (fileType != ".pdf") {
this.srcList.push(process.env.VUE_APP_BASE_API + e.filePath); this.srcList.push(url);
}
} }
}); });
});
this.getinvoivelist = res.data;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
//this.back(); //this.back();
} }
}) })
.catch(error => { .catch(error => {
console.log(error);
this.$message.error("获取发票图片失败"); this.$message.error("获取发票图片失败");
//this.back(); //this.back();
}); });
...@@ -547,7 +563,7 @@ export default { ...@@ -547,7 +563,7 @@ export default {
}, },
//点击查看发票 //点击查看发票
handlePreView(row) { handlePreView(row) {
const photopath = process.env.VUE_APP_BASE_API + row.filePath; const photopath = row.fileUrl;
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
//查看项目附件..... //查看项目附件.....
......
...@@ -146,8 +146,8 @@ ...@@ -146,8 +146,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)"> <div v-if="formatProtocolType(scope.row)">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 80px; height: 80px"
:src="getimagin(scope.row)" :src="scope.row.fileUrl"
:preview-src-list="srcList" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
...@@ -180,7 +180,6 @@ ...@@ -180,7 +180,6 @@
v-model="getListincom" v-model="getListincom"
multiple multiple
filterable filterable
default-first-option default-first-option
style="width:100%;" style="width:100%;"
placeholder="请选择要添加的发票编号" placeholder="请选择要添加的发票编号"
...@@ -310,6 +309,7 @@ import { ...@@ -310,6 +309,7 @@ import {
deleteById deleteById
} from "@/api/project"; } from "@/api/project";
import { componentMap } from "../../../router"; import { componentMap } from "../../../router";
import { getFileUrl } from "@/api/companyFile";
const InitialData = { const InitialData = {
incomeBody: null, incomeBody: null,
...@@ -552,23 +552,31 @@ export default { ...@@ -552,23 +552,31 @@ export default {
selectAllById(this.getinvoiveId) selectAllById(this.getinvoiveId)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data;
this.srcList = [];
res.data.forEach(e => { res.data.forEach(e => {
let fileNamepdf = e.filePath; let fileNamepdf = e.filePath;
console.log(fileNamepdf);
let fileType = fileNamepdf.substring( let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".") fileNamepdf.lastIndexOf(".")
); );
if (fileType == ".jpg") { getFileUrl( e.filePath ).then(res => {
this.srcList.push(process.env.VUE_APP_BASE_API + e.filePath); if (res.success) {
let url = res.data;
e.fileUrl = url;
if (fileType != ".pdf") {
this.srcList.push(url);
}
} }
}); });
});
this.getinvoivelist = res.data;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
} }
}) })
.catch(error => { .catch(error => {
console.log(error);
this.$message.error("获取发票图片失败"); this.$message.error("获取发票图片失败");
this.back(); this.back();
}); });
...@@ -610,21 +618,29 @@ export default { ...@@ -610,21 +618,29 @@ export default {
}, },
//点击查看发票 //点击查看发票
handlePreView(row) { handlePreView(row) {
const photopath = process.env.VUE_APP_BASE_API + row.filePath; const photopath = row.fileUrl;
console.log(photopath);
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
//下载附件 //下载附件
delProject(row) { delProject(row) {
getFileUrl(row.enclosureFile).then(res => {
if (res.success) {
let url = res.data;
console.log(url);
var a = document.createElement("a"); //创建一个<a></a>标 var a = document.createElement("a"); //创建一个<a></a>标
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href = url; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了 a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签 a.remove(); // 一次性的,用完就删除a标签
}else{
this.$message.error('下载失败');
}
}).catch(e=>{
this.$message.error(e.msg)
})
}, },
//查询未报销发票 //查询未报销发票
selectGet() { selectGet() {
...@@ -805,10 +821,7 @@ export default { ...@@ -805,10 +821,7 @@ export default {
return false; return false;
} }
} }
}, }
getimagin(row) {
return process.env.VUE_APP_BASE_API + row.filePath;
},
} }
}; };
</script> </script>
......
...@@ -385,9 +385,9 @@ ...@@ -385,9 +385,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)"> <div v-if="formatProtocolType(scope.row)">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 80px; height: 80px"
:src="scope.row.filePath" :src="scope.row.fileUrl"
:preview-src-list="[scope.row.filePath]" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
...@@ -529,6 +529,7 @@ ...@@ -529,6 +529,7 @@
</template> </template>
<script> <script>
import { getFileUrl } from "@/api/companyFile";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { selectByFinance, financeApproval } from "@/api/reimbursement"; import { selectByFinance, financeApproval } from "@/api/reimbursement";
import { selectAllById } from "@/api/project"; import { selectAllById } from "@/api/project";
...@@ -635,6 +636,7 @@ export default { ...@@ -635,6 +636,7 @@ export default {
fileTypepdf: false, //判断合同文件是否存在 fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //附件文件 fileList1: [], //附件文件
disabled: false, //隐藏 disabled: false, //隐藏
srcList: [],
}; };
}, },
created() { created() {
...@@ -681,7 +683,7 @@ export default { ...@@ -681,7 +683,7 @@ export default {
//查看pdf格式 //查看pdf格式
handlePreView(row) { handlePreView(row) {
console.log(row); console.log(row);
const photopath = row.filePath; const photopath = row.fileUrl;
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
//查看详情 //查看详情
...@@ -895,7 +897,21 @@ export default { ...@@ -895,7 +897,21 @@ export default {
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; let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
console.log(url);
if (fileType != ".pdf") {
this.srcList.push(url);
}
}
});
// e.filePath = process.env.VUE_APP_BASE_API + e.filePath;
}); });
console.log(this.getinvoivelist); console.log(this.getinvoivelist);
} else { } else {
...@@ -1034,10 +1050,11 @@ export default { ...@@ -1034,10 +1050,11 @@ export default {
}); });
}, },
//下载附件 //下载附件
delProject(row) { async delProject(row) {
console.log(row);
var a = document.createElement("a"); //创建一个<a></a>标签 var a = document.createElement("a"); //创建一个<a></a>标签
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href=(await getFileUrl(row.enclosureFile)).data
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 // //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
......
...@@ -279,9 +279,9 @@ ...@@ -279,9 +279,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)"> <div v-if="formatProtocolType(scope.row)">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 80px; height: 80px"
:src="scope.row.filePath" :src="scope.row.fileUrl"
:preview-src-list="[scope.row.filePath]" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
...@@ -433,6 +433,7 @@ ...@@ -433,6 +433,7 @@
</template> </template>
<script> <script>
import { getFileUrl } from "@/api/companyFile";
import { selectByHeadman, headamApproval } from "@/api/reimbursement"; import { selectByHeadman, headamApproval } from "@/api/reimbursement";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { import {
...@@ -528,6 +529,7 @@ export default { ...@@ -528,6 +529,7 @@ export default {
fileTypepdf: false, //判断合同文件是否存在 fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //附件文件 fileList1: [], //附件文件
disabled: false, //隐藏 disabled: false, //隐藏
srcList: [],
}; };
}, },
created() { created() {
...@@ -570,7 +572,7 @@ export default { ...@@ -570,7 +572,7 @@ export default {
}, },
//获取pdf格式 //获取pdf格式
handlePreView(row){ handlePreView(row){
const photopath =row.filePath; const photopath = row.fileUrl;
window.open(photopath,"_blank") window.open(photopath,"_blank")
}, },
//查看详情 //查看详情
...@@ -725,7 +727,21 @@ export default { ...@@ -725,7 +727,21 @@ export default {
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; let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
console.log(url);
if (fileType != ".pdf") {
this.srcList.push(url);
}
}
});
// e.filePath = process.env.VUE_APP_BASE_API + e.filePath;
}); });
console.log(this.getinvoivelist); console.log(this.getinvoivelist);
} else { } else {
...@@ -765,10 +781,12 @@ export default { ...@@ -765,10 +781,12 @@ export default {
}); });
}, },
//下载附件 //下载附件
delProject(row) { //下载附件
async delProject(row) {
console.log(row);
var a = document.createElement("a"); //创建一个<a></a>标签 var a = document.createElement("a"); //创建一个<a></a>标签
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href=(await getFileUrl(row.enclosureFile)).data
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 // //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
......
...@@ -344,9 +344,9 @@ ...@@ -344,9 +344,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)"> <div v-if="formatProtocolType(scope.row)">
<el-image <el-image
style="width: 100px; height: 100px" style="width: 80px; height: 80px"
:src="scope.row.filePath" :src="scope.row.fileUrl"
:preview-src-list="[scope.row.filePath]" :preview-src-list="srcList"
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
...@@ -569,6 +569,7 @@ ...@@ -569,6 +569,7 @@
</template> </template>
<script> <script>
import { getFileUrl } from "@/api/companyFile";
import { queryBypage, resubmit, reimbursementId } from "@/api/reimbursement"; import { queryBypage, resubmit, reimbursementId } from "@/api/reimbursement";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { import {
...@@ -677,6 +678,7 @@ export default { ...@@ -677,6 +678,7 @@ export default {
fileTypepdf: false, //判断合同文件是否存在 fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //附件文件 fileList1: [], //附件文件
disabled: false, //隐藏 disabled: false, //隐藏
srcList: [],
}; };
}, },
created() { created() {
...@@ -917,21 +919,37 @@ export default { ...@@ -917,21 +919,37 @@ export default {
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; // console.log("------------")
// console.log(e.filePath)
// console.log("------------")
let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
console.log(url);
if (fileType != ".pdf") {
this.srcList.push(url);
}
}
});
}); });
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
} }
}) })
.catch((error) => { .catch((e) => {
this.$message.error("获取发票图片失败"); this.$message.error("获取发票图片失败");
this.back(); this.back();
}); });
}, },
//pdf,展示 //pdf,展示
handlePreView(row) { handlePreView(row) {
const photopath = row.filePath; const photopath = row.fileUrl;
window.open(photopath, "_blank"); window.open(photopath, "_blank");
}, },
...@@ -974,11 +992,11 @@ export default { ...@@ -974,11 +992,11 @@ export default {
}); });
}, },
//下载附件 //下载附件
delProject(row) { async delProject(row) {
console.log(row); console.log(row);
var a = document.createElement("a"); //创建一个<a></a>标 var a = document.createElement("a"); //创建一个<a></a>标
a.href = process.env.VUE_APP_BASE_API + row.enclosureFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. a.href = (await getFileUrl(row.enclosureFile)).data;
//a.download = row.enclosureFile; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可 // //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.target = "_blank"; a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签 a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中 document.body.appendChild(a); // 将a标签追加到文档对象中
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userName" label="姓名" /> <el-table-column prop="userName" label="姓名" />
<el-table-column prop="userSex" label="性别" > <el-table-column prop="userSex" label="性别" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.userSex == '0' ? '' : ''}} {{scope.row.userSex == '0' ? '' : ''}}
</template> </template>
......
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