Commit 979e03ac authored by 柳 佳乐's avatar 柳 佳乐
Browse files

20221125

parent a0a55082
...@@ -130,11 +130,11 @@ ...@@ -130,11 +130,11 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="申报总金额" label="申报总金额(元)"
prop="applyTotalAmountSmall" prop="applyTotalAmountSmall"
> >
</el-table-column> </el-table-column>
<el-table-column label="核报总金额" align="center"> <el-table-column label="核报总金额(元)" align="center">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.verifyTotalAmountSmall || "还未核实金额" }} {{ props.row.verifyTotalAmountSmall || "还未核实金额" }}
</template> </template>
...@@ -320,10 +320,10 @@ ...@@ -320,10 +320,10 @@
<span>{{ paramlist.vehicle }}</span> <span>{{ paramlist.vehicle }}</span>
</el-form-item> </el-form-item>
<el-form-item label="伙食补贴"> <el-form-item label="伙食补贴(元)">
<span>{{ paramlist.foodAllowance }}</span> <span>{{ paramlist.foodAllowance }}</span>
</el-form-item> </el-form-item>
<el-form-item label="公杂补贴"> <el-form-item label="公杂补贴(元)">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span> <span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-form-item> </el-form-item>
<el-form-item label="随从人员"> <el-form-item label="随从人员">
...@@ -340,19 +340,19 @@ ...@@ -340,19 +340,19 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="grid-content bg-purple-light"> <div class="grid-content bg-purple-light">
<el-form-item label="火车/汽车/轮船费"> <el-form-item label="火车/汽车/轮船费(元)">
<span>{{ paramlist.tripCost }}</span> <span>{{ paramlist.tripCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="机票费"> <el-form-item label="机票费(元)">
<span>{{ paramlist.planeTicket }}</span> <span>{{ paramlist.planeTicket }}</span>
</el-form-item> </el-form-item>
<el-form-item label="汽油费"> <el-form-item label="汽油费(元)">
<span>{{ paramlist.trafficCost }}</span> <span>{{ paramlist.trafficCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="住宿费"> <el-form-item label="住宿费(元)">
<span>{{ paramlist.lodgingCost }}</span> <span>{{ paramlist.lodgingCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="其他费用"> <el-form-item label="其他费用(元)">
<span>{{ paramlist.otherCost }}</span> <span>{{ paramlist.otherCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
...@@ -584,9 +584,11 @@ ...@@ -584,9 +584,11 @@
<script> <script>
import { money } from "@/utils/myValidate"; import { money } from "@/utils/myValidate";
import { getFileUrl } from "@/api/companyFile"; import { getFileUrl } from "@/api/companyFile";
import { queryBypagefinance } from "@/api/spendreimbursement"; import {
import { selectAll } from "@/api/spendreimbursement"; queryBypagefinance,
import { finApproval } from "@/api/spendreimbursement"; selectAll,
finApproval,
} from "@/api/spendreimbursement";
import { selectAllById, selectByIdF, deleteById } from "@/api/project"; import { selectAllById, selectByIdF, deleteById } from "@/api/project";
export default { export default {
created() { created() {
...@@ -692,31 +694,33 @@ export default { ...@@ -692,31 +694,33 @@ export default {
// 展示数据的方法 // 展示数据的方法
getpagelist(pager = 1) { getpagelist(pager = 1) {
this.queryitem.pageNum = pager; this.queryitem.pageNum = pager;
queryBypagefinance(this.queryitem) queryBypagefinance(this.queryitem).then(async (res) => {
.then((res) => { if (res.success) {
if (res.success) { this.total = res.data.total;
this.total = res.data.total; this.tableData = res.data.list;
this.tableData = res.data.list; res.data.list.forEach((item) => {
res.data.list.forEach((item) => { selectAll({ tripId: item.tripId })
selectAll({ tripId: item.tripId }) .then((resu) => {
.then((resu) => { if (resu.success) {
if (resu.success) { item.entouragelist = resu.data;
item.entouragelist = resu.data; } else {
} else { this.$message.error(resu.msg);
this.$message.error(resu.msg); }
} })
}) .catch((error) => {
.catch((error) => { this.$message.error("失败");
this.$message.error("失败"); });
}); });
}); } else {
} else { //业务逻辑
this.$message.error(res.msg); this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("查询失败");
});
}, },
agreeandrefuse(data) { agreeandrefuse(data) {
this.financelistData = data; this.financelistData = data;
...@@ -754,35 +758,29 @@ export default { ...@@ -754,35 +758,29 @@ export default {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) }).then(() => {
.then(() => { this.agreeOrapproval.financeId = this.$store.getters.urId;
this.agreeOrapproval.financeId = this.$store.getters.urId; this.agreeOrapproval.tripStatus = 3;
this.agreeOrapproval.tripStatus = 3; this.agreeOrapproval.tripId = this.financelistData.tripId;
this.agreeOrapproval.tripId = this.financelistData.tripId; this.agreeOrapproval.financeTime = this.time();
this.agreeOrapproval.financeTime = this.time(); finApproval(this.agreeOrapproval).then(async (res) => {
finApproval(this.agreeOrapproval) if (res.success) {
.then((res) => { this.$message({
if (res.success) { type: "success",
this.$message({ message: "同意成功!",
type: "success",
message: "同意成功!",
});
this.getpagelist();
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("操作失败");
}); });
this.dialogVisible = false; this.getpagelist();
}) } else {
.catch(() => { this.$message.error(res.msg);
this.$message({ if (res.code == 4) {
type: "info", //执行退出功能
message: "已取消操作", await this.$store.dispatch("user/logout");
}); this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
}); });
this.dialogVisible = false;
});
} }
}); });
}, },
...@@ -802,33 +800,27 @@ export default { ...@@ -802,33 +800,27 @@ export default {
return false; return false;
} }
}, },
}) }).then((value) => {
.then((value) => { this.agreeOrapproval.financeId = this.$store.getters.urId;
this.agreeOrapproval.financeId = this.$store.getters.urId; this.agreeOrapproval.finaceRefute = value.value;
this.agreeOrapproval.finaceRefute = value.value; this.agreeOrapproval.tripStatus = 4;
this.agreeOrapproval.tripStatus = 4; this.agreeOrapproval.tripId = this.financelistData.tripId;
this.agreeOrapproval.tripId = this.financelistData.tripId; this.agreeOrapproval.financeTime = this.time();
this.agreeOrapproval.financeTime = this.time(); finApproval(this.agreeOrapproval).then(async (res) => {
finApproval(this.agreeOrapproval) if (res.success) {
.then((res) => { this.$message.success("操作成功");
if (res.success) { this.getpagelist();
this.$message.success("操作成功"); } else {
this.getpagelist(); this.$message.error(res.msg);
} else { if (res.code == 4) {
this.$message.error(res.msg); //执行退出功能
} await this.$store.dispatch("user/logout");
}) this.$router.push(`/login?redirect=${this.$route.fullPath}`);
.catch((error) => { }
this.$message.error("操作失败"); }
});
this.dialogVisible = false;
})
.catch(() => {
this.$message({
type: "info",
message: "取消操作",
});
}); });
this.dialogVisible = false;
});
} }
}); });
}, },
...@@ -864,12 +856,11 @@ export default { ...@@ -864,12 +856,11 @@ export default {
//查询发票图片 //查询发票图片
Selectinsertlsit() { Selectinsertlsit() {
selectAllById(this.getinvoiveId) selectAllById(this.getinvoiveId)
.then((res) => { .then(async (res) => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
this.getinvoivelist.forEach((e) => { this.getinvoivelist.forEach((e) => {
let fileNamepdf = e.filePath; let fileNamepdf = e.filePath;
console.log(e.filePath);
let fileType = fileNamepdf.substring( let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".") fileNamepdf.lastIndexOf(".")
); );
...@@ -885,7 +876,12 @@ export default { ...@@ -885,7 +876,12 @@ export default {
}); });
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); //业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -1000,26 +996,28 @@ export default { ...@@ -1000,26 +996,28 @@ export default {
selectImage(row) { selectImage(row) {
this.queryDTO.tripId = row.tripId; this.queryDTO.tripId = row.tripId;
this.proutlist1.Id = row.tripId; this.proutlist1.Id = row.tripId;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO).then(async (res) => {
.then((res) => { if (res.success) {
if (res.success) { this.queryDTOList = res.data;
this.queryDTOList = res.data; if (this.queryDTOList.length > 0) {
if (this.queryDTOList.length > 0) { this.drawer2 = true;
this.drawer2 = true; this.getshow = 1;
this.getshow = 1; this.disabled = false;
this.disabled = false;
} else {
this.drawer2 = true;
this.disabled = false;
this.getshow = 3;
}
} else { } else {
this.$message.error(res.msg); this.drawer2 = true;
this.disabled = false;
this.getshow = 3;
} }
}) } else {
.catch((error) => { this.$message.error(res.msg);
this.$message.error("获取附件文件失败"); //业务逻辑
}); if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
}, },
//下载附件 //下载附件
async delProject(row) { async delProject(row) {
...@@ -1035,18 +1033,20 @@ export default { ...@@ -1035,18 +1033,20 @@ export default {
//刷新附件 //刷新附件
Refresh() { Refresh() {
this.queryDTO.tripId = this.proutlist1.Id; this.queryDTO.tripId = this.proutlist1.Id;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO).then(async (res) => {
.then((res) => { if (res.success) {
if (res.success) { this.queryDTOList = res.data;
this.queryDTOList = res.data; this.proutlist1.enclosureDescribe = ""; //初始化数据
this.proutlist1.enclosureDescribe = ""; //初始化数据 } else {
} else { //业务逻辑
this.$message.error(res.msg); this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("获取附件文件失败");
});
}, },
//判断图片与pdf显示与隐藏 //判断图片与pdf显示与隐藏
......
...@@ -129,12 +129,12 @@ ...@@ -129,12 +129,12 @@
<el-table-column label="报销项目" prop="projectName" align="center"> <el-table-column label="报销项目" prop="projectName" align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="申报总金额" label="申报总金额(元)"
align="center" align="center"
prop="applyTotalAmountSmall" prop="applyTotalAmountSmall"
> >
</el-table-column> </el-table-column>
<el-table-column align="center" label="核报总金额"> <el-table-column align="center" label="核报总金额(元)">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.verifyTotalAmountSmall || "还未核实金额" }} {{ props.row.verifyTotalAmountSmall || "还未核实金额" }}
</template> </template>
...@@ -282,10 +282,10 @@ ...@@ -282,10 +282,10 @@
<span>{{ paramlist.vehicle }}</span> <span>{{ paramlist.vehicle }}</span>
</el-form-item> </el-form-item>
<el-form-item label="伙食补贴"> <el-form-item label="伙食补贴(元)">
<span>{{ paramlist.foodAllowance }}</span> <span>{{ paramlist.foodAllowance }}</span>
</el-form-item> </el-form-item>
<el-form-item label="公杂补贴"> <el-form-item label="公杂补贴(元)">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span> <span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-form-item> </el-form-item>
<el-form-item label="随从人员"> <el-form-item label="随从人员">
...@@ -302,19 +302,19 @@ ...@@ -302,19 +302,19 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="grid-content bg-purple-light"> <div class="grid-content bg-purple-light">
<el-form-item label="火车/汽车/轮船费"> <el-form-item label="火车/汽车/轮船费(元)">
<span>{{ paramlist.tripCost }}</span> <span>{{ paramlist.tripCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="机票费"> <el-form-item label="机票费(元)">
<span>{{ paramlist.planeTicket }}</span> <span>{{ paramlist.planeTicket }}</span>
</el-form-item> </el-form-item>
<el-form-item label="汽油费"> <el-form-item label="汽油费(元)">
<span>{{ paramlist.trafficCost }}</span> <span>{{ paramlist.trafficCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="住宿费"> <el-form-item label="住宿费(元)">
<span>{{ paramlist.lodgingCost }}</span> <span>{{ paramlist.lodgingCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="其他费用"> <el-form-item label="其他费用(元)">
<span>{{ paramlist.otherCost }}</span> <span>{{ paramlist.otherCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
...@@ -363,10 +363,10 @@ ...@@ -363,10 +363,10 @@
<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: 80px; height: 80px" style="width: 80px; height: 80px"
:src="scope.row.fileUrl" :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="Agrt(scope.row)">点击查看文件</a> <a class="a-style" @click="Agrt(scope.row)">点击查看文件</a>
...@@ -469,10 +469,8 @@ ...@@ -469,10 +469,8 @@
</template> </template>
<script> <script>
import { queryByheadman } from "@/api/spendreimbursement"; import { queryByheadman, selectAll, Approval } from "@/api/spendreimbursement";
import { getFileUrl } from "@/api/companyFile"; import { getFileUrl } from "@/api/companyFile";
import { selectAll } from "@/api/spendreimbursement";
import { Approval } from "@/api/spendreimbursement";
import { selectAllById, selectByIdF } from "@/api/project"; import { selectAllById, selectByIdF } from "@/api/project";
export default { export default {
created() { created() {
...@@ -515,7 +513,7 @@ export default { ...@@ -515,7 +513,7 @@ export default {
companyId: null, companyId: null,
tripId: 0, tripId: 0,
}, },
srcList:[], srcList: [],
//附件///------- //附件///-------
//drawer1: false, //drawer1: false,
...@@ -559,31 +557,27 @@ export default { ...@@ -559,31 +557,27 @@ export default {
// 展示数据的方法 // 展示数据的方法
getpagelist(pager = 1) { getpagelist(pager = 1) {
this.queryitem.pageNum = pager; this.queryitem.pageNum = pager;
queryByheadman(this.queryitem) queryByheadman(this.queryitem).then((res) => {
.then((res) => { if (res.success) {
if (res.success) { this.total = res.data.total;
this.total = res.data.total; this.tableData = res.data.list;
this.tableData = res.data.list; res.data.list.forEach((item) => {
res.data.list.forEach((item) => { selectAll({ tripId: item.tripId }).then(async (resu) => {
selectAll({ tripId: item.tripId }) if (resu.success) {
.then((resu) => { item.entouragelist = resu.data;
if (resu.success) { } else {
item.entouragelist = resu.data; this.$message.error(res.msg);
} else { //业务逻辑
this.$message.error(resu.msg); if (res.code == 4) {
} //执行退出功能
}) await this.$store.dispatch("user/logout");
.catch((error) => { this.$router.push(`/login?redirect=${this.$route.fullPath}`);
this.$message.error("失败"); }
}); }
}); });
} else { });
this.$message.error(res.msg); }
} });
})
.catch((error) => {
this.$message.error("查询失败");
});
}, },
// 搜索 // 搜索
onSubmit() { onSubmit() {
...@@ -609,36 +603,30 @@ export default { ...@@ -609,36 +603,30 @@ export default {
this.$confirm("是否同意此报销单?, 是否继续?", "提示", { this.$confirm("是否同意此报销单?, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) }).then(() => {
.then(() => { this.agreeOrapproval.headmanId = data.userId;
this.agreeOrapproval.headmanId = data.userId; this.agreeOrapproval.tripStatus = 1;
this.agreeOrapproval.tripStatus = 1; this.agreeOrapproval.tripId = data.tripId;
this.agreeOrapproval.tripId = data.tripId; this.agreeOrapproval.headmanTime = this.time();
this.agreeOrapproval.headmanTime = this.time(); Approval(this.agreeOrapproval).then(async (res) => {
Approval(this.agreeOrapproval) if (res.success) {
.then((res) => { this.$message({
if (res.success) { type: "success",
this.$message({ message: "同意成功!",
type: "success",
message: "同意成功!",
});
this.getpagelist();
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("操作失败");
}); });
}) this.getpagelist();
.catch(() => { } else {
this.$message({ this.$message.error(res.msg);
type: "info", //业务逻辑
message: "已取消操作", if (res.code == 4) {
}); //执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
}); });
});
}, },
// 驳回 // 驳回
refuse(data) { refuse(data) {
...@@ -654,32 +642,26 @@ export default { ...@@ -654,32 +642,26 @@ export default {
return false; return false;
} }
}, },
}) }).then((value) => {
.then((value) => { this.agreeOrapproval.headmanId = data.userId;
this.agreeOrapproval.headmanId = data.userId; this.agreeOrapproval.headmanRefute = value.value;
this.agreeOrapproval.headmanRefute = value.value; this.agreeOrapproval.tripStatus = 2;
this.agreeOrapproval.tripStatus = 2; this.agreeOrapproval.tripId = data.tripId;
this.agreeOrapproval.tripId = data.tripId; this.agreeOrapproval.headmanTime = this.time();
this.agreeOrapproval.headmanTime = this.time(); Approval(this.agreeOrapproval).then(async (res) => {
Approval(this.agreeOrapproval) if (res.success) {
.then((res) => { this.$message.success("操作成功");
if (res.success) { this.getpagelist();
this.$message.success("操作成功"); } else {
this.getpagelist(); this.$message.error(res.msg);
} else { if (res.code == 4) {
this.$message.error(res.msg); //执行退出功能
} await this.$store.dispatch("user/logout");
}) this.$router.push(`/login?redirect=${this.$route.fullPath}`);
.catch((error) => { }
this.$message.error("操作失败"); }
});
})
.catch(() => {
this.$message({
type: "info",
message: "取消操作",
});
}); });
});
}, },
// 查看详情 // 查看详情
getdetails(data) { getdetails(data) {
...@@ -694,34 +676,32 @@ export default { ...@@ -694,34 +676,32 @@ export default {
}, },
//查询发票图片 //查询发票图片
Selectinsertlsit() { Selectinsertlsit() {
selectAllById(this.getinvoiveId) selectAllById(this.getinvoiveId).then(async (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) => { let fileNamepdf = e.filePath;
let fileNamepdf = e.filePath; let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
let fileType = fileNamepdf.substring( getFileUrl(e.filePath).then((res) => {
fileNamepdf.lastIndexOf(".") if (res.success) {
); let url = res.data;
getFileUrl(e.filePath).then((res) => { e.fileUrl = url;
if (res.success) { if (fileType != ".pdf") {
let url = res.data; this.srcList.push(url);
e.fileUrl = url;
if (fileType != ".pdf") {
this.srcList.push(url);
}
} }
}); }
}); });
} else { });
this.$message.error(res.msg); } else {
this.back(); this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("获取发票图片失败");
this.back();
});
}, },
//时间处理 yyyy-MM-dd hh:mm:ss //时间处理 yyyy-MM-dd hh:mm:ss
time() { time() {
...@@ -753,26 +733,28 @@ export default { ...@@ -753,26 +733,28 @@ export default {
selectImage(row) { selectImage(row) {
this.queryDTO.tripId = row.tripId; this.queryDTO.tripId = row.tripId;
this.proutlist1.Id = row.tripId; this.proutlist1.Id = row.tripId;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO).then(async (res) => {
.then((res) => { if (res.success) {
if (res.success) { this.queryDTOList = res.data;
this.queryDTOList = res.data; if (this.queryDTOList.length > 0) {
if (this.queryDTOList.length > 0) { this.drawer2 = true;
this.drawer2 = true; this.getshow = 1;
this.getshow = 1; this.disabled = false;
this.disabled = false;
} else {
this.drawer2 = true;
this.disabled = false;
this.getshow = 3;
}
} else { } else {
this.$message.error(res.msg); this.drawer2 = true;
this.disabled = false;
this.getshow = 3;
} }
}) } else {
.catch((error) => { //业务逻辑
this.$message.error("获取附件文件失败"); this.$message.error(res.msg);
}); if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
}, },
//下载附件 //下载附件
async delProject(row) { async delProject(row) {
...@@ -788,18 +770,20 @@ export default { ...@@ -788,18 +770,20 @@ export default {
//刷新附件 //刷新附件
Refresh() { Refresh() {
this.queryDTO.tripId = this.proutlist1.Id; this.queryDTO.tripId = this.proutlist1.Id;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO).then(async (res) => {
.then((res) => { if (res.success) {
if (res.success) { this.queryDTOList = res.data;
this.queryDTOList = res.data; this.proutlist1.enclosureDescribe = ""; //初始化数据
this.proutlist1.enclosureDescribe = ""; //初始化数据 } else {
} else { this.$message.error(res.msg);
this.$message.error(res.msg); //业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("获取附件文件失败");
});
}, },
//判断图片与pdf显示与隐藏 //判断图片与pdf显示与隐藏
fromgetlist(row) { fromgetlist(row) {
......
...@@ -3,306 +3,317 @@ ...@@ -3,306 +3,317 @@
ref="ruleform" ref="ruleform"
:model="spendreimbursementform" :model="spendreimbursementform"
:label-position="labelPosition" :label-position="labelPosition"
label-width="120px"
:rules="rules" :rules="rules"
> >
<el-main> <el-main>
<el-row :gutter="20"> <!-- 第一个样式 -->
<!-- 第一列表单 --> <el-descriptions
<el-col :span="6"> class="contract-description-form"
<div class="grid-content bg-purple"> title="发票信息"
<!-- projectId --> :column="3"
<el-form-item label="报销项目" prop="projectId"> border
<el-select >
placeholder="请选择" <el-descriptions-item labelClassName="required" label="报销项目">
v-model="spendreimbursementform.projectId" <!-- projectId -->
> <el-form-item prop="projectId">
<el-option <el-select
:label="item.projectName" placeholder="请选择"
v-for="item in collectProject" :style="{ width: '100%' }"
:key="item.projectId" v-model.trim="spendreimbursementform.projectId"
:value="item.projectId" >
> <el-option
</el-option> :label="item.projectName"
</el-select> v-for="item in collectProject"
</el-form-item> :key="item.projectId"
<!-- summary --> :value="item.projectId"
<el-form-item label="摘要" prop="summary">
<el-input v-model="spendreimbursementform.summary"></el-input>
</el-form-item>
<!-- enclosureNumber -->
<el-form-item label="附件数量" prop="enclosureNumber">
<el-input
v-model.number="spendreimbursementform.enclosureNumber"
></el-input>
</el-form-item>
<!-- tripReason -->
<el-form-item label="出差缘由" prop="tripReason">
<el-input v-model="spendreimbursementform.tripReason"></el-input>
</el-form-item>
<!-- fromPlace -->
<el-form-item label="出发地点" prop="fromPlace">
<el-input v-model="spendreimbursementform.fromPlace"></el-input>
</el-form-item>
<!-- purposePlace -->
<el-form-item label="目的地点" prop="purposePlace">
<el-input
v-model="spendreimbursementform.purposePlace"
></el-input>
</el-form-item>
<!-- transitPlace -->
<el-form-item label="经过地点" prop="transitPlace">
<el-input
v-model="spendreimbursementform.transitPlace"
></el-input>
</el-form-item>
<!-- vehicle -->
<el-form-item label="交通工具" prop="vehicle">
<el-input v-model="spendreimbursementform.vehicle"></el-input>
</el-form-item>
<!-- applyTime -->
<el-form-item label="申请时间" prop="applyTime" required>
<el-date-picker
v-model="spendreimbursementform.applyTime"
type="date"
style="width: 90%"
@change="formtime3"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</div>
</el-col>
<!-- 第二列表单 -->
<el-col :span="6">
<div class="grid-content bg-purple">
<!-- receiveSubsidy -->
<el-form-item label="是否领取补贴">
<el-switch
v-model="values"
active-color="#13ce66"
inactive-color="#ff4949"
@change="changeswitch(values)"
> >
</el-switch> </el-option>
</el-form-item> </el-select>
</el-form-item>
<!-- foodAllowance --> </el-descriptions-item>
<el-form-item label="伙食补贴" prop="foodAllowance"> <!-- summary -->
<el-input <el-descriptions-item labelClassName="required" label="摘要">
v-model="spendreimbursementform.foodAllowance" <el-form-item prop="summary">
:disabled=" <el-input v-model.trim="spendreimbursementform.summary"></el-input>
spendreimbursementform.receiveSubsidy == 1 ? false : true </el-form-item>
" </el-descriptions-item>
></el-input> <!-- enclosureNumber -->
</el-form-item> <el-descriptions-item labelClassName="required" label="附件数量">
<!-- publicMiscellaneousSubsidy --> <el-form-item prop="enclosureNumber">
<el-form-item label="公杂补贴" prop="publicMiscellaneousSubsidy"> <el-input
<el-input v-model.number="spendreimbursementform.enclosureNumber"
v-model="spendreimbursementform.publicMiscellaneousSubsidy" ></el-input>
:disabled=" </el-form-item>
spendreimbursementform.receiveSubsidy == 1 ? false : true </el-descriptions-item>
" <!-- tripReason -->
></el-input> <el-descriptions-item labelClassName="required" label="出差理由">
</el-form-item> <el-form-item prop="tripReason">
<!-- tripCost --> <el-input
<el-form-item label="火车/汽车/轮船费" prop="tripCost"> v-model.trim="spendreimbursementform.tripReason"
<el-input v-model="spendreimbursementform.tripCost"></el-input> ></el-input>
</el-form-item> </el-form-item>
<!-- planeTicket --> </el-descriptions-item>
<el-form-item label="飞机票" prop="planeTicket"> <!-- fromPlace -->
<el-input v-model="spendreimbursementform.planeTicket"></el-input> <el-descriptions-item labelClassName="required" label="出发地点">
</el-form-item> <el-form-item prop="fromPlace">
<!-- trafficCost --> <el-input
<el-form-item label="过路过桥汽油费" prop="trafficCost"> v-model.trim="spendreimbursementform.fromPlace"
<el-input v-model="spendreimbursementform.trafficCost"></el-input> ></el-input>
</el-form-item> </el-form-item>
<!-- lodgingCost --> </el-descriptions-item>
<el-form-item label="住宿费" prop="lodgingCost"> <el-descriptions-item labelClassName="required" label="目的地点">
<el-input v-model="spendreimbursementform.lodgingCost"></el-input> <!-- purposePlace -->
</el-form-item> <el-form-item prop="purposePlace">
<!-- insuranceCost --> <el-input
<el-form-item label="保险费" prop="insuranceCost"> v-model.trim="spendreimbursementform.purposePlace"
<el-input ></el-input>
v-model="spendreimbursementform.insuranceCost" </el-form-item>
></el-input> </el-descriptions-item>
</el-form-item> <el-descriptions-item labelClassName="required" label="经过地点">
<!-- otherCost --> <!-- transitPlace -->
<el-form-item label="其他费用" prop="otherCost"> <el-form-item prop="transitPlace">
<el-input v-model="spendreimbursementform.otherCost"></el-input> <el-input
</el-form-item> v-model.trim="spendreimbursementform.transitPlace"
</div> ></el-input>
</el-col> </el-form-item>
<!-- 第三列表单 --> </el-descriptions-item>
<el-col :span="6"> <el-descriptions-item labelClassName="required" label="交通工具">
<div class="grid-content bg-purple"> <!-- vehicle -->
<!-- applyTotalAmountLarge --> <el-form-item prop="vehicle">
<el-form-item <el-input
label="申报总金额(大写)" v-model.trim="spendreimbursementform.vehicle"
prop="applyTotalAmountLarge" ></el-input>
label-width="120" </el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="申请时间">
<!-- applyTime -->
<el-form-item prop="applyTime">
<el-date-picker
v-model.trim="spendreimbursementform.applyTime"
type="date"
style="width: 90%"
@change="formtime3"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<!-- receiveSubsidy -->
<el-descriptions-item labelClassName="required" label="是否领取补贴">
<el-form-item prop="receiveSubsidy">
<el-switch
v-model.trim="values"
active-color="#13ce66"
inactive-color="#ff4949"
@change="changeswitch(values)"
> >
<el-input </el-switch>
disabled </el-form-item>
v-model="spendreimbursementform.applyTotalAmountLarge" </el-descriptions-item>
></el-input> <el-descriptions-item labelClassName="required" label="伙食补贴(元)">
</el-form-item> <!-- foodAllowance -->
<!-- applyTotalAmountSmall --> <el-form-item prop="foodAllowance">
<el-form-item <el-input
label="申报总金额(小写)" v-model.trim="spendreimbursementform.foodAllowance"
prop="applyTotalAmountSmall" :disabled="
label-width="120" spendreimbursementform.receiveSubsidy == 1 ? false : true
"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="公杂补贴(元)">
<!-- publicMiscellaneousSubsidy -->
<el-form-item prop="publicMiscellaneousSubsidy">
<el-input
v-model.trim="spendreimbursementform.publicMiscellaneousSubsidy"
:disabled="
spendreimbursementform.receiveSubsidy == 1 ? false : true
"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
labelClassName="required"
label="火车/汽车/轮船费(元)"
>
<!-- tripCost -->
<el-form-item prop="tripCost">
<el-input
v-model.trim="spendreimbursementform.tripCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="飞机票(元)">
<!-- planeTicket -->
<el-form-item prop="planeTicket">
<el-input
v-model.trim="spendreimbursementform.planeTicket"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
labelClassName="required"
label="过路过桥汽油费(元)"
>
<!-- trafficCost -->
<el-form-item prop="trafficCost">
<el-input
v-model.trim="spendreimbursementform.trafficCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="住宿费(元)">
<!-- lodgingCost -->
<el-form-item prop="lodgingCost">
<el-input
v-model.trim="spendreimbursementform.lodgingCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="保险费(元)">
<!-- insuranceCost -->
<el-form-item prop="insuranceCost">
<el-input
v-model.trim="spendreimbursementform.insuranceCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="其他费用(元)">
<!-- otherCost -->
<el-form-item prop="otherCost">
<el-input
v-model.trim="spendreimbursementform.otherCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
:span="1"
labelClassName="required"
label="申报总金额(小写)(元)"
>
<!-- applyTotalAmountSmall -->
<el-form-item prop="applyTotalAmountSmall">
<el-input
v-model.trim="spendreimbursementform.applyTotalAmountSmall"
@change="
convertCurrency(spendreimbursementform.applyTotalAmountSmall)
"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
:span="2"
labelClassName="required"
label="申报总金额(大写)"
>
<!-- applyTotalAmountLarge -->
<el-form-item prop="applyTotalAmountLarge">
<el-input
disabled
v-model.trim="spendreimbursementform.applyTotalAmountLarge"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
:span="2"
labelClassName="required"
label="出差时间"
>
<!-- startTime -->
<el-form-item prop="startTime">
<el-date-picker
v-model.trim="timeSlot"
@change="formtime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
> >
<el-input </el-date-picker>
v-model="spendreimbursementform.applyTotalAmountSmall" </el-form-item>
@change=" </el-descriptions-item>
convertCurrency(spendreimbursementform.applyTotalAmountSmall) <el-descriptions-item labelClassName="required" label="发票号码">
" <!-- invoiceIdList -->
></el-input> <el-form-item prop="invoiceIdList">
</el-form-item> <el-select
<el-form-item v-model.trim="spendreimbursementform.invoiceIdList"
label="出差时间" multiple
prop="startTime" filterable
required default-first-option
:rules="[ placeholder="请选择"
{ @change="Selectmoney()"
required: true,
message: '请选择日期',
trigger: 'change',
},
]"
> >
<el-date-picker <el-option
v-model="timeSlot" v-for="item in getinvoivelist"
@change="formtime" :key="item.invoiceId"
type="daterange" :label="item.number"
range-separator="至" :value="item.invoiceId"
start-placeholder="开始日期" ></el-option>
end-placeholder="结束日期" </el-select>
> </el-form-item>
</el-date-picker> </el-descriptions-item>
</el-form-item>
<!-- nobillExplain -->
<el-form-item label="无票据说明" prop="nobillExplain">
<el-input
type="textarea"
:rows="5"
v-model="spendreimbursementform.nobillExplain"
></el-input>
</el-form-item>
<el-form-item label="发票号码" prop="fromList"> <el-descriptions-item :span="3" label="随行人员(*名字需要用逗号隔开*)">
<el-select <el-input
v-model="spendreimbursementform.fromList" type="textarea"
multiple :rows="2"
filterable v-model.trim="peopleListName"
default-first-option ></el-input>
placeholder="请选择" </el-descriptions-item>
>
<el-option
v-for="item in getinvoivelist"
:key="item.invoiceId"
:label="item.number"
:value="item.invoiceId"
></el-option>
</el-select>
</el-form-item>
<!-- remarks --> <el-descriptions-item :span="3" label="备注">
<el-form-item label="备注" prop="remarks"> <!-- remarks -->
<el-input <el-form-item prop="remarks">
type="textarea" <el-input
:rows="5" type="textarea"
v-model="spendreimbursementform.remarks" :rows="2"
></el-input> v-model.trim="spendreimbursementform.remarks"
</el-form-item> ></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :span="3" label="无票据说明">
<!-- nobillExplain -->
<el-form-item prop="nobillExplain">
<el-input
type="textarea"
:rows="2"
v-model.trim="spendreimbursementform.nobillExplain"
></el-input>
</el-form-item>
</el-descriptions-item>
<!-- 附件上传 --> <el-descriptions-item :span="3" label="附件上传">
<el-form-item label="附件上传"> <!-- 附件上传 -->
<el-upload <el-form-item>
class="upload-demo" <el-upload
drag class="upload-demo"
:action="action1" drag
ref="enclosureUpload" :action="action1"
:data="enclosurelist" ref="enclosureUpload"
:auto-upload="false" :data="enclosurelist"
multiple :headers="fileUploadHeader"
> :auto-upload="false"
<i class="el-icon-upload"></i> multiple
<div class="el-upload__text"> >
将文件拖到此处,或<em>点击上传</em> <i class="el-icon-upload"></i>
</div> <div class="el-upload__text">
</el-upload> 将文件拖到此处,或<em>点击上传</em>
</el-form-item>
</div>
</el-col>
<!-- 第四列表单 -->
<el-col :span="6">
<div class="grid-content bg-purple">
<!-- 其他 -->
<el-form-item>
<el-button
type="primary"
icon="el-icon-circle-plus"
@click="addBtn1"
>随行人员</el-button
>
</el-form-item>
<!-- 对话框1 -->
<el-dialog title="选择随行人员" :visible.sync="dialogFormVisible">
<!-- -->
<el-form :model="peopleList">
<el-row
v-for="(item, index) in peopleList.insertBatch"
:key="index"
>
<el-form-item
:label="'姓名' + (index + 1)"
:prop="'insertBatch.' + index + '.personnelName'"
:rules="{
required: true,
message: '姓名不能为空',
trigger: 'blur',
}"
>
<el-col :span="12"
><div class="grid-content bg-purple-light">
<el-input
v-model.trim="item.personnelName"
></el-input></div
></el-col>
<el-col :span="3"
><div class="grid-content bg-purple">
<el-button
style="margin-left: 5px"
@click.prevent="removeDomain(item)"
:disabled="
peopleList.insertBatch.length == 1 ? true : false
"
>删除</el-button
>
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple-light">
<el-button @click="addDomain">新增人员</el-button>
</div></el-col
>
</el-form-item>
</el-row>
</el-form>
<!-- -->
<!-- 操作 -->
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogFormVisible = false"
>确 定</el-button
>
</div> </div>
</el-dialog> </el-upload>
</div> </el-form-item>
</el-col> </el-descriptions-item>
</el-row> </el-descriptions>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" @click="submitForm()">提交</el-button> <el-button type="primary" @click="submitForm()">提交</el-button>
...@@ -311,24 +322,19 @@ ...@@ -311,24 +322,19 @@
</el-footer> </el-footer>
</el-form> </el-form>
</template> </template>
<script> <script>
import { insert } from "@/api/spendreimbursement.js"; import {
import { selectTypeitem } from "@/api/spendreimbursement.js"; insert,
// selectProjectitem selectTypeitem,
import { selectProjectitem } from "@/api/spendreimbursement.js"; selectProjectitem,
//selectProjectpeople selectProjectpeople,
import { selectProjectpeople } from "@/api/spendreimbursement.js"; } from "@/api/spendreimbursement.js";
// insertId
import { insertId } from "@/api/spendreimbursement.js";
import { Addinvoice } from "@/api/spendreimbursement.js";
import { selectAllBystatus } from "@/api/project"; import { selectAllBystatus } from "@/api/project";
import { money } from "@/utils/myValidate"; import { money } from "@/utils/myValidate";
export default { export default {
created() { created() {
this.Typeitem.companyId = this.$store.getters.companyId; this.fileUploadHeader["X-Token"] = this.$store.getters.token;
this.Projectitem.companyId = this.$store.getters.companyId;
this.Projectpeople.companyId = this.$store.getters.companyId;
this.spendreimbursementform.companyId = this.$store.getters.companyId; this.spendreimbursementform.companyId = this.$store.getters.companyId;
this.spendreimbursementform.userId = this.$store.getters.urId; this.spendreimbursementform.userId = this.$store.getters.urId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
...@@ -339,6 +345,10 @@ export default { ...@@ -339,6 +345,10 @@ export default {
}, },
data() { data() {
return { return {
fileUploadHeader: {
"X-Token": null,
},
peopleListName: "",
// 文字对齐方式 // 文字对齐方式
labelPosition: "left", labelPosition: "left",
// 图片提交地址 // 图片提交地址
...@@ -356,10 +366,10 @@ export default { ...@@ -356,10 +366,10 @@ export default {
values: false, values: false,
timeSlot: null, timeSlot: null,
userId: [], userId: [],
form: [],
// 收集的是页面表单的数据 // 收集的是页面表单的数据
spendreimbursementform: { spendreimbursementform: {
fromList: [], invoiceIdList: [], //发票信息
tripRersonnel: [], //随行人员
companyId: null, companyId: null,
summary: "", summary: "",
enclosureNumber: "", enclosureNumber: "",
...@@ -391,28 +401,7 @@ export default { ...@@ -391,28 +401,7 @@ export default {
days: null, days: null,
userId: null, userId: null,
tripStatus: 0, tripStatus: 0,
enclosureDescribe: "描述", //附件描述 enclosureDescribe: "", //附件描述
},
peopleList: {
insertBatch: [
{
personnelName: null,
tripId: null,
},
],
},
// 报销类型
Typeitem: {
companyId: null,
typeCategory: 0,
},
// 项目类型
Projectitem: {
companyId: null,
},
// 随从成员
Projectpeople: {
companyId: null,
}, },
peopletripid: null, peopletripid: null,
// 收集报销类型进行展示 // 收集报销类型进行展示
...@@ -428,9 +417,7 @@ export default { ...@@ -428,9 +417,7 @@ export default {
// 验证规则 // 验证规则
rules: { rules: {
fromList: [ invoiceIdList: [{ required: true, message: "此项不能为空!" }],
{ required: true, message: "此项不能为空!", trigger: "change" },
],
summary: [{ required: true, message: "此项不能为空!" }], summary: [{ required: true, message: "此项不能为空!" }],
enclosureNumber: [ enclosureNumber: [
{ required: true, message: "此项不能为空!" }, { required: true, message: "此项不能为空!" },
...@@ -480,6 +467,24 @@ export default { ...@@ -480,6 +467,24 @@ export default {
}; };
}, },
methods: { methods: {
// 根据发票号码查询金额
Selectmoney() {
let sum = 0;
let list = [];
this.spendreimbursementform.invoiceIdList.forEach((item) => {
this.getinvoivelist.forEach((e) => {
if (item == e.invoiceId) {
list.push({ money: e.mone });
}
});
});
list.forEach((val) => {
sum += val.money;
});
this.spendreimbursementform.applyTotalAmountSmall = sum;
this.convertCurrency(sum);
return sum;
},
//查询发票编号 //查询发票编号
Selectinsertlsit() { Selectinsertlsit() {
let param = { let param = {
...@@ -489,12 +494,16 @@ export default { ...@@ -489,12 +494,16 @@ export default {
userId: this.$store.getters.info.userId, userId: this.$store.getters.info.userId,
}; };
selectAllBystatus(param) selectAllBystatus(param)
.then((res) => { .then(async (res) => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -506,44 +515,27 @@ export default { ...@@ -506,44 +515,27 @@ export default {
submitForm() { submitForm() {
this.$refs.ruleform.validate((valid) => { this.$refs.ruleform.validate((valid) => {
if (valid) { if (valid) {
insert(this.spendreimbursementform) // 除发票以外所有的金额
.then((res) => { let sum1 = this.addnum(this.spendreimbursementform);
// console.log(sum1);
// 申报总金额
let sum2 = this.spendreimbursementform.applyTotalAmountSmall;
if (sum1 == sum2) {
// 判断随行人员 是否为空
if (this.peopleListName == "") {
// 如果为空 就用默认的人员
this.spendreimbursementform.tripRersonnel[0] =
this.$store.getters.name;
} else {
this.spendreimbursementform.tripRersonnel = [];
let k = this.peopleListName.split("");
let m = this.$store.getters.name;
k.forEach((e) => {
this.spendreimbursementform.tripRersonnel.push(m, e);
});
}
insert(this.spendreimbursementform).then((res) => {
if (res.success) { if (res.success) {
let tid = res.data;
let addpeopleList = [];
let obj1 = {};
obj1.personnelName = this.$store.getters.name;
obj1.tripId = tid;
addpeopleList[0] = obj1;
this.peopleList.insertBatch.forEach((e) => {
if (e.personnelName != null && e.personnelName != "") {
let obj = {};
obj.personnelName = e.personnelName;
obj.tripId = res.data;
addpeopleList.push(obj);
}
});
// 第二个方法 添加随从人员
insertId(addpeopleList)
.then((result) => {
if (result.success) {
} else {
this.$message.error(result.msg);
}
})
.catch((error) => {
this.$message.error("失败");
});
this.spendreimbursementform.fromList.forEach((e) => {
let obj = {};
obj.companyId = this.$store.getters.companyId;
obj.status = 1;
obj.tripId = res.data;
obj.invoiceId = e;
this.form.push(obj);
});
// 上传附件 // 上传附件
this.enclosurelist.Id = res.data; this.enclosurelist.Id = res.data;
this.enclosurelist.companyId = this.enclosurelist.companyId =
...@@ -552,85 +544,78 @@ export default { ...@@ -552,85 +544,78 @@ export default {
this.spendreimbursementform.enclosureDescribe; this.spendreimbursementform.enclosureDescribe;
this.enclosurelist.userId = this.spendreimbursementform.userId; this.enclosurelist.userId = this.spendreimbursementform.userId;
this.$refs.enclosureUpload.submit(); this.$refs.enclosureUpload.submit();
this.$message.success("添加成功!");
// 第三个方法 添加发票 this.back();
Addinvoice(this.form)
.then((resu) => {
if (resu.success) {
this.$message.success("添加成功!");
this.back();
} else {
this.$message.error(resu.msg);
}
})
.catch((error) => {
this.$message.error("失败");
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
})
.catch((error) => {
this.$message.error("添加失败");
}); });
} else {
this.$message.warning("发票金额不同,无法提交");
}
} }
}); });
}, },
addDomain() {
this.peopleList.insertBatch.push({
personnelName: "",
tripId: null,
});
},
//
removeDomain(item) {
var index = this.peopleList.insertBatch.indexOf(item);
if (index !== -1) {
this.peopleList.insertBatch.splice(index, 1);
}
},
// 报销类型 // 报销类型
reimebursementtypeItem() { reimebursementtypeItem() {
selectTypeitem(this.Typeitem) const params = {
.then((res) => { companyId: this.$store.getters.companyId,
if (res.success) { };
this.collectType = res.data; selectTypeitem(params).then((res) => {
} else { if (res.success) {
this.$message.error(res.msg); this.collectType = res.data;
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("查询失败");
});
}, },
// 项目类型 // 项目类型
reimebursementprojectItem() { reimebursementprojectItem() {
selectProjectitem(this.Projectitem) const params = {
.then((res) => { companyId: this.$store.getters.companyId,
if (res.success) { };
this.collectProject = res.data; selectProjectitem(params).then((res) => {
} else { if (res.success) {
this.$message.error(res.msg); this.collectProject = res.data;
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("查询失败");
});
}, },
// 查询随从人员 // 查询随从人员
reimebursementprojectpeopleItem() { reimebursementprojectpeopleItem() {
selectProjectpeople(this.Projectpeople) const params = {
.then((res) => { companyId: this.$store.getters.companyId,
if (res.code == 20000) { };
// console.log(res.data); selectProjectpeople(params).then(async (res) => {
this.collectProjectpeople = res.data; if (res.success) {
} else { this.collectProjectpeople = res.data;
this.$message.error("失败"); } else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("查询失败");
});
}, },
// 弹窗按钮 // 弹窗按钮
addBtn1() { addBtn1() {
...@@ -639,7 +624,6 @@ export default { ...@@ -639,7 +624,6 @@ export default {
}, },
// 开关选项 // 开关选项
changeswitch(values) { changeswitch(values) {
// console.log(values);
if (values == true) { if (values == true) {
this.spendreimbursementform.receiveSubsidy = 1; this.spendreimbursementform.receiveSubsidy = 1;
} else { } else {
...@@ -708,6 +692,16 @@ export default { ...@@ -708,6 +692,16 @@ export default {
resetForm() { resetForm() {
this.$refs.ruleform.resetFields(); this.$refs.ruleform.resetFields();
}, },
// 删除附件
handleRemove(file) {
const index = this.fileList.findIndex((item) => item.uid === file.uid);
if (index >= 0) {
const deleteFile = this.fileList.splice(index, 1);
if (deleteFile.length) {
this.deleteFiles.push(deleteFile[0]);
}
}
},
// 大小写 // 大小写
convertCurrency(money) { convertCurrency(money) {
//汉字的数字 //汉字的数字
...@@ -815,9 +809,56 @@ export default { ...@@ -815,9 +809,56 @@ export default {
} }
this.spendreimbursementform.applyTotalAmountLarge = chineseStr; this.spendreimbursementform.applyTotalAmountLarge = chineseStr;
}, },
// 浮点数加法
addnum(data) {
const obj = { ...data };
let a1 = parseFloat(obj.foodAllowance);
let a2 = parseFloat(obj.publicMiscellaneousSubsidy);
let a3 = parseFloat(obj.tripCost);
let a4 = parseFloat(obj.planeTicket);
let a5 = parseFloat(obj.trafficCost);
let a6 = parseFloat(obj.lodgingCost);
let a7 = parseFloat(obj.insuranceCost);
let a8 = parseFloat(obj.otherCost);
let sum = parseFloat(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8).toFixed(2);
// console.log(sum);
// 转换大小写
this.convertCurrency(sum);
return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
},
}, },
}; };
</script> </script>
<style rel="stylesheet/scss" scoped lang="scss">
.file-list {
display: flex;
justify-content: flex-start;
align-items: center;
width: 250px;
padding: 0 5px;
}
.avator {
width: 10%;
font-size: 32px;
color: #d75b5b;
}
.file-content {
width: 80%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-left: 10px;
}
.file-operate {
width: 15%;
font-size: 16px;
display: flex;
justify-content: space-around;
align-items: center;
<style> span {
cursor: pointer;
}
}
</style> </style>
\ No newline at end of file
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<el-form-item label="项目名称:"> <el-form-item label="项目名称:">
<el-input <el-input
placeholder="请输入" placeholder="请输入"
v-model="queryitem.projectName" v-model.trim="queryitem.projectName"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="审批状态:"> <el-form-item label="审批状态:">
<el-select placeholder="请选择" v-model="queryitem.tripStatus"> <el-select placeholder="请选择" v-model.trim="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>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<el-button <el-button
type="success" type="success"
icon="el-icon-circle-plus" icon="el-icon-circle-plus"
@click="insertreimebursementItem" @click="insertOrupdatereimebursementItem()"
>申请出差报销</el-button >申请出差报销</el-button
> >
</el-form-item> </el-form-item>
...@@ -133,11 +133,11 @@ ...@@ -133,11 +133,11 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="申报总金额" label="申报总金额(元)"
prop="applyTotalAmountSmall" prop="applyTotalAmountSmall"
> >
</el-table-column> </el-table-column>
<el-table-column align="center" label="核报总金额"> <el-table-column align="center" label="核报总金额(元)">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.verifyTotalAmountSmall || "还未核实金额" }} {{ props.row.verifyTotalAmountSmall || "还未核实金额" }}
</template> </template>
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
align="center" align="center"
> >
</el-table-column> </el-table-column>
<el-table-column align="center" label="发票图片" width="120"> <el-table-column align="center" label="发票文件" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
style="margin: 5px" style="margin: 5px"
...@@ -168,14 +168,6 @@ ...@@ -168,14 +168,6 @@
@click="ReviseImage(scope.row)" @click="ReviseImage(scope.row)"
>点击查看</el-button >点击查看</el-button
> >
<el-button
style="margin: 5px"
size="mini"
type="success"
@click="updateinvoice()"
v-if="scope.row.tripStatus == 0"
>修改发票</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="下载附件" width="120"> <el-table-column align="center" label="下载附件" width="120">
...@@ -217,21 +209,12 @@ ...@@ -217,21 +209,12 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="180"> <el-table-column align="center" label="操作" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
style="margin: 5px"
size="mini"
icon="el-icon-user-solid"
type="info"
@click="updatebtn(scope.row)"
v-if="scope.row.tripStatus == 0"
>修改随行人员</el-button
>
<el-button <el-button
style="margin: 5px" style="margin: 5px"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
type="info" type="info"
@click="updatereimbursementList(scope.row)" @click="insertOrupdatereimebursementItem(scope.row)"
v-if="scope.row.tripStatus == 0" v-if="scope.row.tripStatus == 0"
>修改信息</el-button >修改信息</el-button
> >
...@@ -297,7 +280,7 @@ ...@@ -297,7 +280,7 @@
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
<a class="a-style" @click="Agrt(scope.row)">点击查看文件</a> <a @click="Agrt(scope.row)">点击查看文件</a>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -358,10 +341,10 @@ ...@@ -358,10 +341,10 @@
<span>{{ paramlist.vehicle }}</span> <span>{{ paramlist.vehicle }}</span>
</el-form-item> </el-form-item>
<el-form-item label="伙食补贴"> <el-form-item label="伙食补贴(元)">
<span>{{ paramlist.foodAllowance }}</span> <span>{{ paramlist.foodAllowance }}</span>
</el-form-item> </el-form-item>
<el-form-item label="公杂补贴"> <el-form-item label="公杂补贴(元)">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span> <span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-form-item> </el-form-item>
<el-form-item label="随从人员"> <el-form-item label="随从人员">
...@@ -378,19 +361,19 @@ ...@@ -378,19 +361,19 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="grid-content bg-purple-light"> <div class="grid-content bg-purple-light">
<el-form-item label="火车/汽车/轮船费"> <el-form-item label="火车/汽车/轮船费(元)">
<span>{{ paramlist.tripCost }}</span> <span>{{ paramlist.tripCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="机票费"> <el-form-item label="机票费(元)">
<span>{{ paramlist.planeTicket }}</span> <span>{{ paramlist.planeTicket }}</span>
</el-form-item> </el-form-item>
<el-form-item label="汽油费"> <el-form-item label="汽油费(元)">
<span>{{ paramlist.trafficCost }}</span> <span>{{ paramlist.trafficCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="住宿费"> <el-form-item label="住宿费(元)">
<span>{{ paramlist.lodgingCost }}</span> <span>{{ paramlist.lodgingCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="其他费用"> <el-form-item label="其他费用(元)">
<span>{{ paramlist.otherCost }}</span> <span>{{ paramlist.otherCost }}</span>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
...@@ -410,118 +393,6 @@ ...@@ -410,118 +393,6 @@
</el-row> </el-row>
</el-form> </el-form>
</el-drawer> </el-drawer>
<!-- 修改发票号码 -->
<div>
<el-drawer
title="修改发票号码"
:visible.sync="table"
direction="rtl"
size="40%"
>
<el-button
style="margin: 20px"
type="success"
icon="el-icon-circle-plus"
@click="Selectinvoicelsit()"
>添加发票号码</el-button
>
<el-table border style="width: 100%" :data="invoicelist">
<el-table-column label="序号" width="50" type="index">
</el-table-column>
<el-table-column label="发票号码">
<template slot-scope="props">
{{ props.row.number }}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="props">
<el-button
type="danger"
size="mini"
icon="el-icon-delete"
:disabled="invoicestatus == true ? true : false"
@click="deleteinvoice(props.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-drawer>
<!-- 添加发票号码 -->
<el-dialog title="发票号码" :visible.sync="insertvioiceFrom">
<el-form :model="invoicelistform">
<el-form-item label="发票号码(可多选):">
<el-select
v-model="invoicelistform.fromList"
multiple
filterable
default-first-option
placeholder="请选择"
>
<el-option
v-for="item in getinvoivelist"
:key="item.invoiceId"
:label="item.number"
:value="item.invoiceId"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="insertvioiceFrom = false">取 消</el-button>
<el-button type="primary" @click="insertInvoice()">确 定</el-button>
</div>
</el-dialog>
</div>
<!-- 修改随从人员 -->
<el-dialog title="修改随从人员" :visible.sync="dialogFormVisible">
<el-form :model="peopleList" ref="peopleForm">
<el-row
v-for="(item, index) in peopleList.collectName"
:key="item.index"
>
<el-form-item
:label="'姓名' + (index + 1)"
:prop="'collectName.' + index + '.personnelName'"
:rules="{
required: true,
message: '姓名不能为空',
trigger: 'blur',
}"
>
<el-col :span="8"
><div class="grid-content bg-purple-light">
<el-input
v-model.trim="item.personnelName"
:disabled="item.disable"
></el-input></div
></el-col>
<el-col :span="3"
><div class="grid-content bg-purple">
<el-button
style="margin-left: 5px"
@click.prevent="removeDomain(item)"
:disabled="item.disable"
>删除</el-button
>
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple-light">
<el-button @click="addDomain">新增人员</el-button>
</div></el-col
>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="updatereimbursementPeople"
>确 定</el-button
>
</div>
</el-dialog>
</div> </div>
<!-- 分页区域 --> <!-- 分页区域 -->
<div class="block"> <div class="block">
...@@ -550,7 +421,6 @@ ...@@ -550,7 +421,6 @@
> >
<el-card <el-card
class="box-card"
style="width: 90%; margin-left: 5%; margin-top: 20px" style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 1" v-show="getshow == 1"
> >
...@@ -569,7 +439,6 @@ ...@@ -569,7 +439,6 @@
<el-button <el-button
type="primary" type="primary"
icon="el-icon-folder-checked" icon="el-icon-folder-checked"
class="a-style"
size="mini" size="mini"
style="font-size: 13px" style="font-size: 13px"
@click="delProject(index)" @click="delProject(index)"
...@@ -595,7 +464,6 @@ ...@@ -595,7 +464,6 @@
<el-button <el-button
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
class="a-style"
size="mini " size="mini "
style="font-size: 13px" style="font-size: 13px"
slot="reference" slot="reference"
...@@ -608,7 +476,6 @@ ...@@ -608,7 +476,6 @@
</el-card> </el-card>
<!-- 附件上传 --> <!-- 附件上传 -->
<el-card <el-card
class="box-card"
style="width: 90%; margin-left: 5%; margin-top: 20px" style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 0" v-show="getshow == 0"
> >
...@@ -629,6 +496,7 @@ ...@@ -629,6 +496,7 @@
:on-remove="delfile1" :on-remove="delfile1"
:auto-upload="false" :auto-upload="false"
:on-change="onChangepdf" :on-change="onChangepdf"
:headers="fileUploadHeader"
:on-success="Refresh" :on-success="Refresh"
:data="proutlist1" :data="proutlist1"
multiple multiple
...@@ -655,37 +523,29 @@ ...@@ -655,37 +523,29 @@
</div> </div>
</el-card> </el-card>
<div class="box-card" v-show="getshow == 3"></div> <div v-show="getshow == 3"></div>
</el-drawer> </el-drawer>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { queryBypage } from "@/api/spendreimbursement";
import { getFileUrl } from "@/api/companyFile";
import { selectAll } from "@/api/spendreimbursement";
import { selectAllById, selectByIdF, deleteById } from "@/api/project";
import { import {
queryBypage,
selectAll,
reimbursementListid, reimbursementListid,
resubmit, resubmit,
Addinvoice, selectProjectpeople,
} from "@/api/spendreimbursement"; } from "@/api/spendreimbursement";
// insertId import { getFileUrl } from "@/api/companyFile";
import { insertId } from "@/api/spendreimbursement.js"; import { selectAllById, selectByIdF, deleteById } from "@/api/project";
import { deletBystatus, selectAllBystatus } from "@/api/project";
//selectProjectpeople
import { selectProjectpeople } from "@/api/spendreimbursement.js";
export default { export default {
created() { created() {
this.Projectpeople.companyId = this.$store.getters.companyId; this.fileUploadHeader["X-Token"] = this.$store.getters.token;
this.getinvoiveId.companyId = this.$store.getters.companyId; this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId;
this.parm.companyId = this.$store.getters.companyId; this.parm.companyId = this.$store.getters.companyId;
// 获取 userId this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.queryitem.userId = this.$store.getters.urId;
this.queryDTO.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; //保存附件与下载的接口
this.reimebursementprojectpeopleItem(); this.reimebursementprojectpeopleItem();
this.getpagelist(); this.getpagelist();
}, },
...@@ -698,7 +558,6 @@ export default { ...@@ -698,7 +558,6 @@ export default {
tripStatus: null, tripStatus: null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userId: null,
}, },
//抽屉 //抽屉
drawer: false, drawer: false,
...@@ -709,10 +568,6 @@ export default { ...@@ -709,10 +568,6 @@ export default {
tableData: [], tableData: [],
// 收集随从人员进行展示 // 收集随从人员进行展示
collectProjectpeople: [], collectProjectpeople: [],
// 随从成员
Projectpeople: {
companyId: null,
},
getinvoivelist: [], getinvoivelist: [],
// 发票状态 // 发票状态
invoicestatus: false, invoicestatus: false,
...@@ -726,9 +581,11 @@ export default { ...@@ -726,9 +581,11 @@ export default {
temporaryData: {}, temporaryData: {},
//查询图片给的值 //查询图片给的值
getinvoiveId: { getinvoiveId: {
companyId: null,
tripId: 0, tripId: 0,
}, },
fileUploadHeader: {
"X-Token": null,
},
//附件///------- //附件///-------
//drawer1: false, //drawer1: false,
...@@ -736,11 +593,6 @@ export default { ...@@ -736,11 +593,6 @@ export default {
fileList1: [], //合同文件 fileList1: [], //合同文件
disabled2: false, //隐藏 disabled2: false, //隐藏
getshow: 1, //判断show的显示与隐藏, getshow: 1, //判断show的显示与隐藏,
//查询附件
queryDTO: {
companyId: null,
tripId: null,
},
queryDTOList: [], //收集附件的数据 queryDTOList: [], //收集附件的数据
//附件抽屉 //附件抽屉
drawer2: false, drawer2: false,
...@@ -760,19 +612,15 @@ export default { ...@@ -760,19 +612,15 @@ export default {
Id: null, Id: null,
enclosureDescribe: "", enclosureDescribe: "",
status: 3, //0收入 1支出 status: 3, //0收入 1支出
companyId: null,
userId: null, userId: null,
companyId: null,
}, },
fileTypepdf: false, //判断合同文件是否存在 fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //附件文件 fileList1: [], //附件文件
disabled: false, //隐藏 disabled: false, //隐藏
table: false, table: false,
insertvioiceFrom: false,
invoicelist: [], invoicelist: [],
invoicelistform: {
fromList: [], //发票号码
},
formtripid: null, formtripid: null,
srcList: [], srcList: [],
parm: { parm: {
...@@ -796,26 +644,25 @@ export default { ...@@ -796,26 +644,25 @@ export default {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) }).then(() => {
.then(() => { if (index !== -1) {
if (index !== -1) { this.peopleList.collectName.splice(index, 1);
this.peopleList.collectName.splice(index, 1);
this.$message({
type: "success",
message: "删除成功!",
});
}
})
.catch(() => {
this.$message({ this.$message({
type: "info", type: "success",
message: "已取消删除", message: "删除成功!",
}); });
}); } else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
}, },
// 搜索 // 搜索
onSubmit() { onSubmit() {
this.queryitem.pageNum = 1;
this.getpagelist(); this.getpagelist();
}, },
// 重置 // 重置
...@@ -825,233 +672,78 @@ export default { ...@@ -825,233 +672,78 @@ export default {
tripStatus: null, tripStatus: null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userId: null, userId: this.$store.getters.companyId,
}; };
// 获取 userId
this.queryitem.userId = this.$store.getters.urId;
this.getpagelist(); this.getpagelist();
}, },
// 修改随从人员 // 查询de所有员工
updatereimbursementPeople() { reimebursementprojectpeopleItem() {
this.$refs.peopleForm.validate((valid) => { const params = {
if (valid) {
let param = [];
this.peopleList.collectName.forEach((e) => {
let obj = {
personnelName: e.personnelName,
tripId: this.temporaryData.tripId,
};
param.push(obj);
});
// 第二个方法
insertId(param)
.then((result) => {
if (result.success) {
this.$message.success("修改成功!");
// 刷新页面
this.getpagelist();
// 关闭窗口
this.dialogFormVisible = false;
} else {
this.$message.error(result.msg);
}
})
.catch((error) => {
this.$message.error("修改失败");
});
} else {
console.log("error submit!!");
return false;
}
});
},
//查询出要添加的发票编号
Selectinvoicelsit() {
this.invoicelistform.fromList = [];
this.insertvioiceFrom = true;
let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
status: 0,
type: 2,
userId: this.$store.getters.info.userId,
}; };
selectAllBystatus(param) selectProjectpeople(params).then((res) => {
.then((res) => { if (res.success) {
if (res.success) { this.collectProjectpeople = res.data;
this.getinvoivelist = res.data; } else {
} else { this.$message.error("失败");
this.$message.error(res.msg); if (res.code == 4) {
this.back(); //执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
},
/**
* 第一次 选择两条 this.form.length = 2
* 第二次 不选择 this.form.length = 2
* 第三次 选择两条 this.form.length = 4
*
*/
// 添加发票号码
insertInvoice() {
// 第三个方法 添加发票
let param = []
this.invoicelistform.fromList.forEach((e) => {
let obj = {};
obj.companyId = this.$store.getters.companyId;
obj.status = 1;
obj.tripId = this.formtripid;
obj.invoiceId = e;
param.push(obj);
}); });
if (param.length == 0) {
this.insertvioiceFrom = false;
} else {
Addinvoice(param)
.then((resu) => {
if (resu.success) {
this.$message.success("添加成功!");
this.insertvioiceFrom = false;
this.table = false
} else {
this.$message.error(resu.msg);
}
})
.catch((error) => {
this.$message.error("失败");
});
}
},
// 修改发票号码
updateinvoice() {
this.table = true;
this.Selectlsitinvoice();
},
// 删除发票关系
deleteinvoice(data) {
let invoices = {
invoiceId: data.invoiceId,
tripId: data.tripId,
};
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deletBystatus(invoices)
.then((result) => {
if (result.success) {
this.$message({
type: "success",
message: "删除成功!",
});
this.table = false
// 关闭窗口
} else {
this.$message.error(result.msg);
}
})
.catch((error) => {
this.$message.error("删除失败");
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
}, },
// 查询de所有员工 //跳转添加修改的窗口
reimebursementprojectpeopleItem() { insertOrupdatereimebursementItem(data) {
selectProjectpeople(this.Projectpeople) if (data == "" || data == undefined) {
.then((res) => { this.$router.push("/spendreimbursementAdd");
if (res.code == 20000) { } else {
this.collectProjectpeople = res.data; this.$router.push({
} else { path: "/spendreimbursementListUpdate",
this.$message.error("失败"); query: {
} tripid: data.tripId,
}) },
.catch((error) => {
this.$message.error("查询失败");
}); });
}, }
//添加的方法
insertreimebursementItem() {
this.$router.push("/spendreimbursementAdd");
}, },
// 展示数据的方法 // 展示数据的方法
getpagelist(pager = 1) { getpagelist(pager = 1) {
this.queryitem.pageNum = pager; this.queryitem.pageNum = pager;
const params = {
...this.queryitem,
userId: this.$store.getters.urId,
};
//分页查询出差报销记录 //分页查询出差报销记录
queryBypage(this.queryitem) queryBypage(params).then((res) => {
.then((res) => { this.tableData = res.data.list;
if (res.success) { if (res.success) {
this.total = res.data.total; this.total = res.data.total;
//获取随性人员 //获取随性人员
res.data.list.forEach((e) => { res.data.list.forEach((e) => {
this.parm.tripId = e.tripId; this.parm.tripId = e.tripId;
this.formtripid = e.tripId; this.formtripid = e.tripId;
selectAll({ tripId: e.tripId }) selectAll({ tripId: e.tripId }).then((resu) => {
.then((resu) => { if (resu.success) {
if (resu.success) { e.entouragelist = resu.data;
e.entouragelist = resu.data; } else {
} else { this.$message.error(res.msg);
this.$message.error(resu.msg); if (res.code == 4) {
} //执行退出功能
}) this.$store.dispatch("user/logout");
.catch((error) => { this.$router.push(`/login?redirect=${this.$route.fullPath}`);
this.$message.error("失败"); }
}); }
}); });
this.tableData = res.data.list; });
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("查询失败");
});
},
// 跳转修改页面
updatereimbursementList(data) {
this.$router.push({
path: "/spendreimbursementListUpdate",
//query 找到我们需要的字段
query: {
tripid: data.tripId,
},
});
},
// 修改随行人员窗口
updatebtn(data) {
//去获取随行人员
this.temporaryData = data;
this.peopleList.collectName = [];
let a = 0;
data.entouragelist.forEach((e) => {
let obj = {};
obj.personnelName = e.personnelName;
obj.tripId = e.tripId;
if (e.personnelName == this.$store.getters.name) {
if (a == 0) {
obj.disable = true;
a++;
} else {
obj.disable = false;
}
} else { } else {
obj.disable = false; if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
this.peopleList.collectName.push(obj);
}); });
this.dialogFormVisible = true;
}, },
// 查看详情 // 查看详情
getdetails(data) { getdetails(data) {
...@@ -1060,39 +752,40 @@ export default { ...@@ -1060,39 +752,40 @@ export default {
}, },
//查询发票编号 //查询发票编号
Selectlsitinvoice() { Selectlsitinvoice() {
selectAllById(this.parm) selectAllById(this.parm).then((res) => {
.then((res) => { if (res.success) {
if (res.success) { this.invoicelist = res.data;
this.invoicelist = res.data; if (this.invoicelist.length == 1) {
if (this.invoicelist.length == 1) { this.invoicestatus = true;
this.invoicestatus = true;
} else {
this.invoicestatus = false;
}
} else { } else {
this.$message.error(res.msg); this.invoicestatus = false;
this.back();
} }
}) } else {
.catch((error) => { this.$message.error(res.msg);
this.$message.error("获取发票编号失败");
this.back(); this.back();
}); if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
}, },
// 从新提交 // 从新提交
Resubmit(data) { Resubmit(data) {
resubmit(data) resubmit(data).then((res) => {
.then((res) => { if (res.success) {
if (res.success) { this.$message.success("重新提交成功,等待审批");
this.$message.success("重新提交成功,等待审批"); this.getpagelist();
this.getpagelist(); } else {
} else { this.$message.error(res.msg);
this.$message.error(res.msg); if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("重新提交失败");
});
}, },
// 撤回申请 // 撤回申请
withdraw(data) { withdraw(data) {
...@@ -1100,24 +793,24 @@ export default { ...@@ -1100,24 +793,24 @@ export default {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) }).then(() => {
.then(() => { reimbursementListid(data.tripId).then((res) => {
reimbursementListid(data.tripId).then((res) => { if (res.success) {
if (res.success) { this.$message({
this.$message({ type: "success",
type: "success", message: "撤回成功!",
message: "撤回成功!", });
}); this.getpagelist();
this.getpagelist(); } else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}); }
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
}); });
});
}, },
//查看图片的方法 //查看图片的方法
ReviseImage(row) { ReviseImage(row) {
...@@ -1127,34 +820,34 @@ export default { ...@@ -1127,34 +820,34 @@ export default {
}, },
//查询发票图片 //查询发票图片
Selectinsertlsit() { Selectinsertlsit() {
selectAllById(this.getinvoiveId) const params = {
.then((res) => { ...this.getinvoiveId,
if (res.success) { companyId: this.$store.getters.companyId,
this.getinvoivelist = res.data; };
this.getinvoivelist.forEach((e) => { selectAllById(params).then((res) => {
let fileNamepdf = e.filePath; if (res.success) {
let fileType = fileNamepdf.substring( this.getinvoivelist = res.data;
fileNamepdf.lastIndexOf(".") this.getinvoivelist.forEach((e) => {
); let fileNamepdf = e.filePath;
getFileUrl(e.filePath).then((res) => { let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (res.success) { getFileUrl(e.filePath).then((res) => {
let url = res.data; if (res.success) {
e.fileUrl = url; e.fileUrl = res.data;
if (fileType != ".pdf") { if (fileType != ".pdf") {
this.srcList.push(url); this.srcList.push(res.data);
}
} }
}); }
}); });
} else { });
this.$message.error(res.msg); } else {
this.back(); this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("获取发票图片失败");
this.back();
});
}, },
//时间处理 //时间处理
timestampToTime(row, column, cellValue) { timestampToTime(row, column, cellValue) {
...@@ -1162,36 +855,39 @@ export default { ...@@ -1162,36 +855,39 @@ export default {
}, },
///----附件区域 ///----附件区域
//查看项目附件..... //查看项目附件.....
selectImage(row) { selectImage(row) {
this.queryDTO.tripId = row.tripId; const params = {
companyId: this.$store.getters.companyId,
tripId: row.tripId,
};
this.proutlist1.Id = row.tripId; this.proutlist1.Id = row.tripId;
if (row.tripStatus == 2 || row.tripStatus == 0) { if (row.tripStatus == 2 || row.tripStatus == 0) {
this.disabled2 = false; this.disabled2 = false;
} else { } else {
this.disabled2 = true; this.disabled2 = true;
} }
selectByIdF(this.queryDTO) selectByIdF(params).then((res) => {
.then((res) => { if (res.success) {
if (res.success) { this.queryDTOList = res.data;
this.queryDTOList = res.data; if (this.queryDTOList.length > 0) {
if (this.queryDTOList.length > 0) { this.drawer2 = true;
this.drawer2 = true; this.getshow = 1;
this.getshow = 1; this.disabled = false;
this.disabled = false;
} else {
this.drawer2 = true;
this.disabled = false;
this.getshow = 3;
}
} else { } else {
this.$message.error(res.msg); this.drawer2 = true;
this.disabled = false;
this.getshow = 3;
} }
}) } else {
.catch((error) => { this.$message.error(res.msg);
this.$message.error("获取附件文件失败"); if (res.code == 4) {
}); //执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
}, },
//下载附件 //下载附件
async delProject(row) { async delProject(row) {
...@@ -1212,21 +908,23 @@ export default { ...@@ -1212,21 +908,23 @@ export default {
}, },
//删除附件 //删除附件
deleteProject(row) { deleteProject(row) {
deleteById(row) deleteById(row).then((res) => {
.then((res) => { if (res.success) {
if (res.success) { this.selectImage(row);
this.selectImage(row); this.$message({
this.$message({ message: "删除成功",
message: "删除成功", type: "success",
type: "success", });
}); this.visible = false;
this.visible = false; } else {
console.log(res.msg);
}
})
.catch((errror) => {
this.$message.error(res.msg); this.$message.error(res.msg);
}); if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
}, },
//清除附件文件 //清除附件文件
delfile1(file) { delfile1(file) {
...@@ -1238,8 +936,6 @@ export default { ...@@ -1238,8 +936,6 @@ export default {
determine() { determine() {
//判断是否有附件文件 //判断是否有附件文件
if (this.fileTypepdf) { if (this.fileTypepdf) {
this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId;
this.$refs.upload1.submit(); this.$refs.upload1.submit();
this.getshow = 1; //隐藏与显示 this.getshow = 1; //隐藏与显示
this.disabled = false; this.disabled = false;
...@@ -1255,40 +951,39 @@ export default { ...@@ -1255,40 +951,39 @@ export default {
}, },
//刷新附件 //刷新附件
Refresh() { Refresh() {
this.queryDTO.tripId = this.proutlist1.Id; const params = {
selectByIdF(this.queryDTO) tripId: this.proutlist1.Id,
.then((res) => { companyId: this.$store.getters.companyId,
if (res.success) { };
this.queryDTOList = res.data; selectByIdF(params).then((res) => {
this.proutlist1.enclosureDescribe = ""; //初始化数据 if (res.success) {
} else { this.queryDTOList = res.data;
this.$message.error(res.msg); this.proutlist1.enclosureDescribe = ""; //初始化数据
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("获取附件文件失败");
});
}, },
//附件取消 //附件取消
remove() { remove() {
if (this.queryDTOList.length > 0) { if (this.queryDTOList.length > 0) {
this.getshow = 1; this.getshow = 1;
this.disabled = false; this.disabled = false;
this.backii();
this.delfile1(); this.delfile1();
} else { } else {
this.getshow = 3; this.getshow = 3;
this.disabled = false; this.disabled = false;
this.backii();
this.delfile1(); this.delfile1();
} }
}, },
//附件文件校验 //附件文件校验
onChangepdf(file) { onChangepdf(file) {
console.log(this.proutlist1); if (file.name.substring(file.name.lastIndexOf(".")) != "") {
const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType != "") {
this.fileTypepdf = true; this.fileTypepdf = true;
} else { } else {
this.$message.warning("附件只能只能上传文件"); this.$message.warning("附件只能只能上传文件");
...@@ -1301,9 +996,7 @@ export default { ...@@ -1301,9 +996,7 @@ export default {
if (row.filePath == null) { if (row.filePath == null) {
return false; return false;
} else { } else {
let fileNamepdf = row.filePath; if (row.filePath.substring(row.filePath.lastIndexOf(".")) != ".pdf") {
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType != ".pdf") {
return true; return true;
} else { } else {
return false; return false;
...@@ -1312,15 +1005,13 @@ export default { ...@@ -1312,15 +1005,13 @@ export default {
}, },
//跳转修改 //跳转修改
Agrt(row) { Agrt(row) {
const photopath = row.fileUrl; window.open(row.fileUrl, "_blank");
console.log(photopath);
window.open(photopath, "_blank");
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.total_content { .total_content {
padding: 0px 15px; padding: 0px 15px;
} }
......
...@@ -3,204 +3,293 @@ ...@@ -3,204 +3,293 @@
ref="ruleform" ref="ruleform"
:model="spendreimbursementform" :model="spendreimbursementform"
:label-position="labelPosition" :label-position="labelPosition"
label-width="120px"
:rules="rules" :rules="rules"
:data="spendreimbursementform" :data="spendreimbursementform"
> >
<el-main> <el-main>
<el-row :gutter="20"> <!-- 第一个样式 -->
<!-- 第一列表单 --> <el-descriptions
<el-col :span="6"> class="contract-description-form"
<div class="grid-content bg-purple"> title="发票信息"
<!-- projectId --> :column="3"
<el-form-item label="报销项目" prop="projectId"> border
<el-select >
placeholder="请选择" <el-descriptions-item labelClassName="required" label="报销项目">
v-model="spendreimbursementform.projectId" <!-- projectId -->
> <el-form-item prop="projectId">
<el-option <el-select
:label="item.projectName" placeholder="请选择"
v-for="item in collectProject" :style="{ width: '100%' }"
:key="item.projectId" v-model.trim="spendreimbursementform.projectId"
:value="item.projectId" >
> <el-option
</el-option> :label="item.projectName"
</el-select> v-for="item in collectProject"
</el-form-item> :key="item.projectId"
<!-- summary --> :value="item.projectId"
<el-form-item label="摘要" prop="summary">
<el-input v-model="spendreimbursementform.summary"></el-input>
</el-form-item>
<!-- enclosureNumber -->
<el-form-item label="附件数量" prop="enclosureNumber">
<el-input
v-model.number="spendreimbursementform.enclosureNumber"
value=""
></el-input>
</el-form-item>
<!-- tripReason -->
<el-form-item label="出差缘由" prop="tripReason">
<el-input v-model="spendreimbursementform.tripReason"></el-input>
</el-form-item>
<!-- fromPlace -->
<el-form-item label="出发地点" prop="fromPlace">
<el-input v-model="spendreimbursementform.fromPlace"></el-input>
</el-form-item>
<!-- purposePlace -->
<el-form-item label="目的地点" prop="purposePlace">
<el-input
v-model="spendreimbursementform.purposePlace"
></el-input>
</el-form-item>
<!-- transitPlace -->
<el-form-item label="经过地点" prop="transitPlace">
<el-input
v-model="spendreimbursementform.transitPlace"
></el-input>
</el-form-item>
<!-- vehicle -->
<el-form-item label="交通工具" prop="vehicle">
<el-input v-model="spendreimbursementform.vehicle"></el-input>
</el-form-item>
<!-- applyTime -->
<el-form-item label="申请时间" prop="applyTime" required>
<el-date-picker
v-model="spendreimbursementform.applyTime"
type="date"
style="width: 90%"
@change="formtime3"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</div>
</el-col>
<!-- 第二列表单 -->
<el-col :span="6">
<div class="grid-content bg-purple">
<!-- receiveSubsidy -->
<el-form-item label="是否领取补贴">
<el-switch
v-model="values"
active-color="#13ce66"
inactive-color="#ff4949"
@change="changeswitch(values)"
> >
</el-switch> </el-option>
</el-form-item> </el-select>
</el-form-item>
<!-- foodAllowance --> </el-descriptions-item>
<el-form-item label="伙食补贴" prop="foodAllowance"> <!-- summary -->
<el-input <el-descriptions-item labelClassName="required" label="摘要">
v-model="spendreimbursementform.foodAllowance" <el-form-item prop="summary">
:disabled=" <el-input v-model.trim="spendreimbursementform.summary"></el-input>
spendreimbursementform.receiveSubsidy == 1 ? false : true </el-form-item>
" </el-descriptions-item>
></el-input> <!-- enclosureNumber -->
</el-form-item> <el-descriptions-item labelClassName="required" label="附件数量">
<!-- publicMiscellaneousSubsidy --> <el-form-item prop="enclosureNumber">
<el-form-item label="公杂补贴" prop="publicMiscellaneousSubsidy"> <el-input
<el-input v-model.number="spendreimbursementform.enclosureNumber"
v-model="spendreimbursementform.publicMiscellaneousSubsidy" ></el-input>
:disabled=" </el-form-item>
spendreimbursementform.receiveSubsidy == 1 ? false : true </el-descriptions-item>
" <!-- tripReason -->
></el-input> <el-descriptions-item labelClassName="required" label="出差理由">
</el-form-item> <el-form-item prop="tripReason">
<!-- tripCost --> <el-input
<el-form-item label="火车/汽车/轮船费" prop="tripCost"> v-model.trim="spendreimbursementform.tripReason"
<el-input v-model="spendreimbursementform.tripCost"></el-input> ></el-input>
</el-form-item> </el-form-item>
<!-- planeTicket --> </el-descriptions-item>
<el-form-item label="飞机票" prop="planeTicket"> <!-- fromPlace -->
<el-input v-model="spendreimbursementform.planeTicket"></el-input> <el-descriptions-item labelClassName="required" label="出发地点">
</el-form-item> <el-form-item prop="fromPlace">
<!-- trafficCost --> <el-input
<el-form-item label="过路过桥汽油费" prop="trafficCost"> v-model.trim="spendreimbursementform.fromPlace"
<el-input v-model="spendreimbursementform.trafficCost"></el-input> ></el-input>
</el-form-item> </el-form-item>
<!-- lodgingCost --> </el-descriptions-item>
<el-form-item label="住宿费" prop="lodgingCost"> <el-descriptions-item labelClassName="required" label="目的地点">
<el-input v-model="spendreimbursementform.lodgingCost"></el-input> <!-- purposePlace -->
</el-form-item> <el-form-item prop="purposePlace">
<!-- insuranceCost --> <el-input
<el-form-item label="保险费" prop="insuranceCost"> v-model.trim="spendreimbursementform.purposePlace"
<el-input ></el-input>
v-model="spendreimbursementform.insuranceCost" </el-form-item>
></el-input> </el-descriptions-item>
</el-form-item> <el-descriptions-item labelClassName="required" label="经过地点">
<!-- otherCost --> <!-- transitPlace -->
<el-form-item label="其他费用" prop="otherCost"> <el-form-item prop="transitPlace">
<el-input v-model="spendreimbursementform.otherCost"></el-input> <el-input
</el-form-item> v-model.trim="spendreimbursementform.transitPlace"
</div> ></el-input>
</el-col> </el-form-item>
<!-- 第三列表单 --> </el-descriptions-item>
<el-col :span="6"> <el-descriptions-item labelClassName="required" label="交通工具">
<div class="grid-content bg-purple"> <!-- vehicle -->
<!-- applyTotalAmountLarge --> <el-form-item prop="vehicle">
<el-form-item <el-input v-model.trim="spendreimbursementform.vehicle"></el-input>
label="申报总金额(大写)" </el-form-item>
prop="applyTotalAmountLarge" </el-descriptions-item>
label-width="140" <el-descriptions-item labelClassName="required" label="申请时间">
<!-- applyTime -->
<el-form-item prop="applyTime">
<el-date-picker
v-model.trim="spendreimbursementform.applyTime"
type="date"
style="width: 90%"
@change="formtime3"
placeholder="选择日期"
> >
<el-input </el-date-picker>
disabled </el-form-item>
v-model="spendreimbursementform.applyTotalAmountLarge" </el-descriptions-item>
></el-input> <!-- receiveSubsidy -->
</el-form-item> <el-descriptions-item labelClassName="required" label="是否领取补贴">
<!-- applyTotalAmountSmall --> <el-form-item prop="receiveSubsidy">
<el-form-item <el-switch
label="申报总金额(小写)" v-model="values"
prop="applyTotalAmountSmall" active-color="#13ce66"
label-width="140" inactive-color="#ff4949"
@change="changeswitch(values)"
>
</el-switch>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="伙食补贴(元)">
<!-- foodAllowance -->
<el-form-item prop="foodAllowance">
<el-input
v-model.trim="spendreimbursementform.foodAllowance"
:disabled="
spendreimbursementform.receiveSubsidy == 1 ? false : true
"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="公杂补贴(元)">
<!-- publicMiscellaneousSubsidy -->
<el-form-item prop="publicMiscellaneousSubsidy">
<el-input
v-model.trim="spendreimbursementform.publicMiscellaneousSubsidy"
:disabled="
spendreimbursementform.receiveSubsidy == 1 ? false : true
"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
labelClassName="required"
label="火车/汽车/轮船费(元)"
>
<!-- tripCost -->
<el-form-item prop="tripCost">
<el-input
v-model.trim="spendreimbursementform.tripCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="飞机票(元)">
<!-- planeTicket -->
<el-form-item prop="planeTicket">
<el-input
v-model.trim="spendreimbursementform.planeTicket"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
labelClassName="required"
label="过路过桥汽油费(元)"
>
<!-- trafficCost -->
<el-form-item prop="trafficCost">
<el-input
v-model.trim="spendreimbursementform.trafficCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="住宿费(元)">
<!-- lodgingCost -->
<el-form-item prop="lodgingCost">
<el-input
v-model.trim="spendreimbursementform.lodgingCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="保险费(元)">
<!-- insuranceCost -->
<el-form-item prop="insuranceCost">
<el-input
v-model.trim="spendreimbursementform.insuranceCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="其他费用(元)">
<!-- otherCost -->
<el-form-item prop="otherCost">
<el-input
v-model.trim="spendreimbursementform.otherCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
:span="1"
labelClassName="required"
label="申报总金额(小写)(元)"
>
<!-- applyTotalAmountSmall -->
<el-form-item prop="applyTotalAmountSmall">
<el-input
v-model.trim="spendreimbursementform.applyTotalAmountSmall"
@change="
convertCurrency(spendreimbursementform.applyTotalAmountSmall)
"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
:span="2"
labelClassName="required"
label="申报总金额(大写)"
>
<!-- applyTotalAmountLarge -->
<el-form-item prop="applyTotalAmountLarge">
<el-input
disabled
v-model.trim="spendreimbursementform.applyTotalAmountLarge"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
:span="2"
labelClassName="required"
label="出差时间"
>
<!-- startTime -->
<el-form-item prop="startTime">
<el-date-picker
v-model.trim="timeSlot"
@change="formtime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
> >
<el-input </el-date-picker>
v-model="spendreimbursementform.applyTotalAmountSmall" </el-form-item>
@change=" </el-descriptions-item>
convertCurrency(spendreimbursementform.applyTotalAmountSmall) <el-descriptions-item labelClassName="required" label="发票号码">
" <!-- invoiceIdList -->
></el-input> <el-form-item prop="invoiceIdList">
</el-form-item> <el-select
<el-form-item v-model="spendreimbursementform.invoiceIdList"
label="出差时间" multiple
prop="startTime" filterable
required required
:rules="[ default-first-option
{ placeholder="请选择"
required: true, @change="Selectmoney()"
message: '请选择日期',
trigger: 'blur',
},
]"
> >
<el-date-picker <el-option
v-model="timeSlot" v-for="item in selectgetinvoivelist"
@change="formtime" :key="item.invoiceId"
type="daterange" :label="item.number"
range-separator="至" :value="item.invoiceId"
start-placeholder="开始日期" ></el-option>
end-placeholder="结束日期" </el-select>
> </el-form-item>
</el-date-picker> </el-descriptions-item>
</el-form-item>
<!-- nobillExplain --> <el-descriptions-item :span="3" label="随行人员(*名字需要用逗号隔开*)">
<el-form-item label="无票据说明" prop="nobillExplain"> <el-input type="textarea" :rows="2" v-model="peopleListName">
<el-input </el-input>
v-model="spendreimbursementform.nobillExplain" </el-descriptions-item>
></el-input>
</el-form-item> <el-descriptions-item :span="3" label="备注">
<!-- remarks --> <!-- remarks -->
<el-form-item label="备注" prop="remarks"> <el-form-item prop="remarks">
<el-input <el-input
type="textarea" type="textarea"
:rows="5" :rows="2"
v-model="spendreimbursementform.remarks" v-model.trim="spendreimbursementform.remarks"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</div> </el-descriptions-item>
</el-col> <el-descriptions-item :span="3" label="无票据说明">
</el-row> <!-- nobillExplain -->
<el-form-item prop="nobillExplain">
<el-input
type="textarea"
:rows="2"
v-model.trim="spendreimbursementform.nobillExplain"
></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" @click="submitForm()">提交</el-button> <el-button type="primary" @click="submitForm()">提交</el-button>
...@@ -210,32 +299,36 @@ ...@@ -210,32 +299,36 @@
</el-form> </el-form>
</template> </template>
<script> <script>
import { selectTypeitem } from "@/api/spendreimbursement.js"; import {
// selectProjectitem selectTypeitem,
import { selectProjectitem } from "@/api/spendreimbursement.js"; selectProjectitem,
import { update } from "@/api/spendreimbursement.js"; update,
import { selectByTripId } from "@/api/spendreimbursement.js"; selectByTripId,
selectAll,
} from "@/api/spendreimbursement.js";
import { money } from "@/utils/myValidate"; import { money } from "@/utils/myValidate";
import { selectAllBystatus, selectAllById } from "@/api/project";
export default { export default {
created() { created() {
this.triplistfrom(); this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.Typeitem.companyId = this.$store.getters.companyId;
this.Projectitem.companyId = this.$store.getters.companyId;
this.Projectpeople.companyId = this.$store.getters.companyId;
this.spendreimbursementform.companyId = this.$store.getters.companyId; this.spendreimbursementform.companyId = this.$store.getters.companyId;
this.spendreimbursementform.userId = this.$store.getters.urId; this.spendreimbursementform.userId = this.$store.getters.urId;
this.triplistfrom();
this.reimebursementtypeItem(); this.reimebursementtypeItem();
this.reimebursementprojectItem(); this.reimebursementprojectItem();
this.Selectinsertlsit();
}, },
data() { data() {
return { return {
dialogFormVisible: false, dialogFormVisible: false,
// 文字对齐方式 // 文字对齐方式
labelPosition: "left", labelPosition: "left",
// 收集到的随行人员
peopleListName: "",
values: false, values: false,
timeSlot: [], timeSlot: [],
userId: [], // fromList: [],
// 收集的是页面表单的数据 // 收集的是页面表单的数据
spendreimbursementform: { spendreimbursementform: {
companyId: null, companyId: null,
...@@ -269,31 +362,24 @@ export default { ...@@ -269,31 +362,24 @@ export default {
days: null, days: null,
userId: null, userId: null,
tripStatus: 0, tripStatus: 0,
enclosureDescribe: "",
invoiceIdList: [], //发票信息
tripRersonnel: [], //随行人员
}, },
peopleId: [],
insertBatch: [ insertBatch: [
{ {
personnelId: null, personnelId: null,
tripId: null, tripId: null,
}, },
], ],
// 报销类型
Typeitem: {
companyId: null,
typeCategory: 0,
},
// 项目类型
Projectitem: {
companyId: null,
},
// 随从成员
Projectpeople: {
companyId: null,
},
// 收集报销类型进行展示 // 收集报销类型进行展示
collectType: [], collectType: [],
// 收集项目名称进行展示时间 // 收集项目名称进行展示时间
collectProject: [], collectProject: [],
// 本条数据的发票号码
getinvoivelist: [],
// 所有的发票号码
selectgetinvoivelist: [],
// 验证规则 // 验证规则
rules: { rules: {
summary: [{ required: true, message: "此项不能为空!" }], summary: [{ required: true, message: "此项不能为空!" }],
...@@ -301,6 +387,7 @@ export default { ...@@ -301,6 +387,7 @@ export default {
{ required: true, message: "此项不能为空!" }, { required: true, message: "此项不能为空!" },
{ type: "number", message: "格式不正确!" }, { type: "number", message: "格式不正确!" },
], ],
invoiceIdList: [{ required: true, message: "此项不能为空!" }],
tripReason: [{ required: true, message: "此项不能为空!" }], tripReason: [{ required: true, message: "此项不能为空!" }],
typeId: [ typeId: [
{ {
...@@ -340,7 +427,6 @@ export default { ...@@ -340,7 +427,6 @@ export default {
], ],
startTime: [{ required: true, message: "此项不能为空!" }], startTime: [{ required: true, message: "此项不能为空!" }],
endTime: [{ required: true, message: "此项不能为空!" }], endTime: [{ required: true, message: "此项不能为空!" }],
}, },
}; };
}, },
...@@ -354,78 +440,205 @@ export default { ...@@ -354,78 +440,205 @@ export default {
triplistfrom() { triplistfrom() {
selectByTripId({ selectByTripId({
tripId: this.$route.query.tripid, tripId: this.$route.query.tripid,
}) }).then((res) => {
.then((res) => { if (res.success) {
if (res.success) { // console.log(res.data);
//获取数据(把data里的数据放在数组里面) //获取数据(把data里的数据放在数组里面)
this.spendreimbursementform = res.data; //this.spendreimbursementform = res.data;
if (res.data.receiveSubsidy == 1) { this.spendreimbursementform = {
this.values = true; ...res.data,
invoiceIdList: [], //发票信息
tripRersonnel: [], //随行人员
};
// 把获取到的随行人员 存到新对象
selectAll({ tripId: res.data.tripId }).then((resu) => {
if (resu.success) {
let array = [];
resu.data.forEach((e) => {
let c = e.personnelName;
array.push(c);
});
let d = array.join("");
this.peopleListName = d;
} else { } else {
this.values = false; this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
this.timeSlot = []; });
this.timeSlot.push(res.data.startTime); if (res.data.receiveSubsidy == 1) {
this.timeSlot.push(res.data.endTime); this.values = true;
} else { } else {
this.$message.error(res.msg); this.values = false;
} }
}) this.timeSlot.push(res.data.startTime);
.catch((error) => { this.timeSlot.push(res.data.endTime);
this.$message.error("获取失败"); } else {
}); this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
//查询本条数据发票编号
Selectlsitinvoice() {
let param = {
tripId: this.$route.query.tripid,
companyId: this.$store.getters.companyId,
};
selectAllById(param).then((res) => {
if (res.success) {
//this.spendreimbursementform.invoiceIdList = [];
res.data.forEach((e) => {
this.selectgetinvoivelist.push(e);
this.spendreimbursementform.invoiceIdList.push(e.invoiceId);
});
console.log(this.spendreimbursementform.invoiceIdList);
console.log(this.selectgetinvoivelist);
} else {
this.$message.error(res.msg);
this.back();
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
//查询所有未报销的发票编号
Selectinsertlsit() {
let param = {
companyId: this.$store.getters.companyId,
status: 0,
type: 2,
userId: this.$store.getters.info.userId,
};
selectAllBystatus(param).then((res) => {
if (res.success) {
this.selectgetinvoivelist = res.data;
this.Selectlsitinvoice();
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
}, },
// 修改数据的方法 // 修改数据的方法
submitForm() { submitForm() {
this.$refs.ruleform.validate((valid) => { this.$refs.ruleform.validate((valid) => {
if (valid) { if (valid) {
update(this.spendreimbursementform) // 除发票以外所有的金额
.then((res) => { let sum1 = this.addnum(this.spendreimbursementform);
// console.log(sum1);
// 申报总金额
let sum2 = this.spendreimbursementform.applyTotalAmountSmall;
// console.log(sum2);
// 判断金额是否相等
if (sum1 == sum2) {
// 判断随行人员 是否为空
if (this.peopleListName == "") {
// 如果为空 就用默认的人员
this.spendreimbursementform.tripRersonnel[0] =
this.$store.getters.name;
} else {
this.spendreimbursementform.tripRersonnel = [];
let k = this.peopleListName.split("");
this.spendreimbursementform.tripRersonnel = k;
// let m = this.$store.getters.name;
// k.forEach((e) => {
// this.spendreimbursementform.tripRersonnel.push(m, e);
// });
}
update(this.spendreimbursementform).then((res) => {
if (res.success) { if (res.success) {
// let addpeopleList = [];
// let a = this.colleagepeopleList.split(",");
// a.forEach((e) => {
// if (e != null && e != "") {
// addpeopleList.push({
// personnelName: e,
// tripId: res.data,
// });
// }
// });
// // 第二个方法 添加随从人员
// insertId(addpeopleList).then((result) => {
// if (result.success) {
// } else {
// this.$message.error(result.msg);
// }
// });
this.$message.success("修改成功!"); this.$message.success("修改成功!");
this.$router.push("/spendreimbursementList"); this.$router.push("/spendreimbursementList");
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
})
.catch((error) => {
this.$message.error("修改失败");
}); });
} else { } else {
console.log("error submit!!"); this.$message.warning("发票金额不同,无法提交");
return false; }
} }
}); });
}, },
// 报销类型 // 报销类型
reimebursementtypeItem() { reimebursementtypeItem() {
selectTypeitem(this.Typeitem) const params = {
.then((res) => { companyId: this.$store.getters.companyId,
if (res.success) { };
this.collectType = res.data; selectTypeitem(params).then((res) => {
} else { if (res.success) {
this.$message.error(res.msg); this.collectType = res.data;
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("查询失败");
});
}, },
// 项目类型 // 项目类型
reimebursementprojectItem() { reimebursementprojectItem() {
selectProjectitem(this.Projectitem) const params = {
.then((res) => { companyId: this.$store.getters.companyId,
if (res.success) { };
this.collectProject = res.data; selectProjectitem(params).then((res) => {
} else { if (res.success) {
this.$message.error(res.msg); this.collectProject = res.data;
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
}) }
.catch((error) => { });
this.$message.error("查询失败");
});
}, },
// 开关选项 // 开关选项
changeswitch(values) { changeswitch(values) {
// console.log(values);
if (values == true) { if (values == true) {
this.spendreimbursementform.receiveSubsidy = 1; this.spendreimbursementform.receiveSubsidy = 1;
} else { } else {
...@@ -491,6 +704,24 @@ export default { ...@@ -491,6 +704,24 @@ export default {
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return Y + M + D + h + m + s; return Y + M + D + h + m + s;
}, },
// 根据发票号码查询金额
Selectmoney() {
let sum = 0;
let list = [];
this.spendreimbursementform.invoiceIdList.forEach((item) => {
this.selectgetinvoivelist.forEach((e) => {
if (item == e.invoiceId) {
list.push({ money: e.mone });
}
});
});
list.forEach((val) => {
sum += val.money;
});
this.spendreimbursementform.applyTotalAmountSmall = sum;
this.convertCurrency(sum);
return sum;
},
//重置 //重置
resetForm() { resetForm() {
this.$refs.ruleform.resetFields(); this.$refs.ruleform.resetFields();
...@@ -594,6 +825,23 @@ export default { ...@@ -594,6 +825,23 @@ export default {
} }
this.spendreimbursementform.applyTotalAmountLarge = chineseStr; this.spendreimbursementform.applyTotalAmountLarge = chineseStr;
}, },
// 浮点数加法
addnum(data) {
const obj = { ...data };
let a1 = parseFloat(obj.foodAllowance);
let a2 = parseFloat(obj.publicMiscellaneousSubsidy);
let a3 = parseFloat(obj.tripCost);
let a4 = parseFloat(obj.planeTicket);
let a5 = parseFloat(obj.trafficCost);
let a6 = parseFloat(obj.lodgingCost);
let a7 = parseFloat(obj.insuranceCost);
let a8 = parseFloat(obj.otherCost);
let sum = parseFloat(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8).toFixed(2);
// console.log(sum);
// 转换大小写
this.convertCurrency(sum);
return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
},
}, },
}; };
</script> </script>
......
...@@ -173,10 +173,8 @@ export default { ...@@ -173,10 +173,8 @@ export default {
//返回 //返回
back() { back() {
if (this.attrId == 0) { if (this.attrId == 0) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/assetslist"); this.$router.push("/assetslist");
} else { } else {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/administrationlsit"); this.$router.push("/administrationlsit");
} }
}, },
......
...@@ -35,6 +35,42 @@ ...@@ -35,6 +35,42 @@
:cell-style="{'text-align':'center'}" :cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}" :header-cell-style="{'text-align':'center'}"
> >
<el-table-column type="expand">
<template slot-scope="props">
<el-descriptions
class="margin-top"
title="关于资产"
:column="1"
:size="medium"
style="width:40%; margin:20px 20px"
border
>
<el-descriptions-item label="资产名称:" :labelStyle="{'width':'120px'}">
<span>{{ props.row.fixedName }}</span>
</el-descriptions-item>
<el-descriptions-item label="资产详情:">
<span>{{ props.row.registerRemarks }}</span>
</el-descriptions-item>
<el-descriptions-item label="资产使用情况:">
<el-button
type="primary"
@click="selectFrom(props.row)"
size="mini"
icon="el-icon-search"
>查询使用</el-button>
</el-descriptions-item>
<el-descriptions-item label="资产丢失登记:">
<el-button
type="danger"
:disabled="props.row.fixedState=='2'?true:false"
size="mini"
icon="el-icon-edit"
@click="open(props.row)"
>丢失登记</el-button>
</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column label="序号" width="50px" align="center"> <el-table-column label="序号" width="50px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
...@@ -59,33 +95,25 @@ ...@@ -59,33 +95,25 @@
>{{scope.row.fixedState == '0' ? '未使用' : scope.row.fixedState == '1' ? '已使用':'已丢失'}}</el-tag> >{{scope.row.fixedState == '0' ? '未使用' : scope.row.fixedState == '1' ? '已使用':'已丢失'}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="资产使用情况" width="130px"> <!-- <el-table-column label="资产使用情况" width="130px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" @click="selectFrom(scope.row)" size="mini">查询资产使用</el-button> <el-button
type="primary"
@click="selectFrom(scope.row)"
size="mini"
icon="el-icon-search"
>查询使用</el-button>
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column prop="prop" label="操作" width="220px" align="center"> <el-table-column prop="prop" label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-row :gutter="20"> <el-button
<el-col :span="4"> type="primary"
<el-button size="mini"
type="danger" icon="el-icon-edit"
:disabled="scope.row.fixedState=='2'?true:false" @click="goUpdate(scope.row)"
size="mini" :disabled="scope.row.fixedState=='2'?true:false"
@click="open(scope.row)" >修改资产信息</el-button>
>丢失登记</el-button>
</el-col>
<el-col :span="8" style="margin-left:5px">
<el-button
type="primary"
size="mini"
style="margin-left:40px"
icon="el-icon-edit"
@click="goUpdate(scope.row)"
:disabled="scope.row.fixedState=='2'?true:false"
>修改资产信息</el-button>
</el-col>
</el-row>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -387,7 +387,6 @@ export default { ...@@ -387,7 +387,6 @@ export default {
}, },
//返回 //返回
back() { back() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/administrationlsit"); this.$router.push("/administrationlsit");
}, },
//重置 //重置
......
...@@ -266,7 +266,6 @@ export default { ...@@ -266,7 +266,6 @@ export default {
}, },
// 返回 // 返回
back() { back() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/assetslist"); this.$router.push("/assetslist");
}, },
//重置 //重置
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
>{{scope.row.fixedState == '0' ? '未使用' : scope.row.fixedState == '1' ? '已使用':'已丢失'}}</el-tag> >{{scope.row.fixedState == '0' ? '未使用' : scope.row.fixedState == '1' ? '已使用':'已丢失'}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="操作"> <el-table-column prop="prop" label="操作" width="140px;">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="goUpdate(scope.row)" @click="goUpdate(scope.row)"
>修改资产信息</el-button> >修改资产信息</el-button>
<!-- <el-button type="danger" size="mini" @click="Updateget(scope.row)">修改管理者</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -83,7 +82,7 @@ ...@@ -83,7 +82,7 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="queryDTO.pageNum" :current-page.sync="queryDTO.pageNum"
:page-size="queryDTO.pageSize" :page-size="queryDTO.pageSize"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" :total="total"
></el-pagination></div> ></el-pagination></div>
</div> </div>
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="queryDTO.pageNum" :current-page.sync="queryDTO.pageNum"
:page-size="queryDTO.pageSize" :page-size="queryDTO.pageSize"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" :total="total"
></el-pagination> ></el-pagination>
</div> </div>
......
...@@ -166,7 +166,7 @@ export default { ...@@ -166,7 +166,7 @@ export default {
this.company.companyCreateTime = this.timestampToTime() this.company.companyCreateTime = this.timestampToTime()
//提交 //提交
register(this.company).then((res)=>{ register(this.company).then((res)=>{
if(res.status == "success"){ if(res.success){
this.$message.success("添加成功") this.$message.success("添加成功")
this.$store.dispatch('tagsView/delView', this.$route) this.$store.dispatch('tagsView/delView', this.$route)
this.$router.push("/companyList") this.$router.push("/companyList")
......
...@@ -265,7 +265,7 @@ export default { ...@@ -265,7 +265,7 @@ export default {
if (valid) { if (valid) {
staffpassword(this.passwordData) staffpassword(this.passwordData)
.then(res => { .then(res => {
if (res.status == "success") { if (res.success) {
this.$message({ this.$message({
showClose: true, showClose: true,
message: "修改密码成功", message: "修改密码成功",
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<el-upload <el-upload
class="upload-demo" class="upload-demo"
drag drag
:headers="fileUploadHeader"
ref="Upload" ref="Upload"
:action="action" :action="action"
:auto-upload="false" :auto-upload="false"
...@@ -78,6 +79,9 @@ export default { ...@@ -78,6 +79,9 @@ export default {
fileRemarks: "", //文件备注 fileRemarks: "", //文件备注
userId: null, userId: null,
}, },
fileUploadHeader: {
"X-Token": null,
},
// 表单验证 // 表单验证
rules: { rules: {
companyFileName: [ companyFileName: [
...@@ -90,6 +94,7 @@ export default { ...@@ -90,6 +94,7 @@ export default {
this.companylist.companyId = this.$store.getters.companyId; this.companylist.companyId = this.$store.getters.companyId;
this.companylist.userId = this.$store.getters.info.userId; this.companylist.userId = this.$store.getters.info.userId;
this.action = process.env.VUE_APP_BASE_API + "/file/companyFile"; this.action = process.env.VUE_APP_BASE_API + "/file/companyFile";
this.fileUploadHeader["X-Token"] = this.$store.getters.token;
}, },
methods: { methods: {
submitForm() { submitForm() {
......
...@@ -76,14 +76,11 @@ ...@@ -76,14 +76,11 @@
> >
</el-pagination> </el-pagination>
</div> </div>
<!-- <div >
</div> -->
</div> </div>
</template> </template>
<script> <script>
import { queryBypage,getFileUrl } from "@/api/companyFile"; import { queryBypage, getFileUrl } from "@/api/companyFile";
export default { export default {
data() { data() {
return { return {
...@@ -116,11 +113,10 @@ export default { ...@@ -116,11 +113,10 @@ export default {
}, },
//下载 //下载
async 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=(await getFileUrl(row.companyFile)).data a.href = (await getFileUrl(row.companyFile)).data;
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点. // //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标签追加到文档对象中
...@@ -134,11 +130,23 @@ export default { ...@@ -134,11 +130,23 @@ export default {
}, },
//分页查询(查询全公司的) //分页查询(查询全公司的)
getCompanyFileList() { getCompanyFileList() {
// if (this.companyFileQurey.conmpanyFileName != null) {
// this.companyFileQurey.conmpanyFileName =
// this.companyFileQurey.conmpanyFileName
// .replace("%", "\\%")
// .replace("_", "\\_");
// }
queryBypage(this.companyFileQurey) queryBypage(this.companyFileQurey)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.companyFIleList = res.data.list; this.companyFIleList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
// if (this.companyFileQurey.conmpanyFileName != null) {
// this.companyFileQurey.conmpanyFileName =
// this.companyFileQurey.conmpanyFileName
// .replace("\\%", "%")
// .replace("\\_", "_");
// }
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
...@@ -157,22 +165,22 @@ export default { ...@@ -157,22 +165,22 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-col { .el-col {
border-radius: 4px; border-radius: 4px;
} }
.bg-purple-dark { .bg-purple-dark {
background: #99a9bf; background: #99a9bf;
} }
.bg-purple { .bg-purple {
background: #d3dce6; background: #d3dce6;
} }
.bg-purple-light { .bg-purple-light {
background: #e5e9f2; background: #e5e9f2;
} }
.grid-content { .grid-content {
border-radius: 4px; border-radius: 4px;
min-height: 36px; min-height: 36px;
} }
.container { .container {
padding: 10px; padding: 10px;
} }
......
...@@ -57,6 +57,44 @@ ...@@ -57,6 +57,44 @@
:cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
:header-cell-style="{ 'text-align': 'center' }" :header-cell-style="{ 'text-align': 'center' }"
> >
<el-table-column type="expand">
<template slot-scope="props">
<el-descriptions
class="margin-top"
title="关于发票"
:column="1"
:size="medium"
style="width:60%; margin:20px 20px"
border
>
<el-descriptions-item label="发票代码:" :labelStyle="{'width':'120px'}">
<span>{{ props.row.code }}</span>
</el-descriptions-item>
<el-descriptions-item label="发票号码:">
<span>{{ props.row.number }}</span>
</el-descriptions-item>
<el-descriptions-item label="发票状态:">
<el-tag :type="props.row.status == '0' ? 'info' : 'warning'">
{{
props.row.status == 0 ? "未报销" : "已报销"
}}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="发票文件:">
<div v-if="formatProtocolType(props.row)">
<el-image
style="width: 100px; height: 60px"
:src="props.row.fileUrl"
:preview-src-list="srcList"
></el-image>
</div>
<div v-else>
<a class="a-style" @click="handlePreView(props.row)">点击查看文件</a>
</div>
</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column label="序号" width="50" style> <el-table-column label="序号" width="50" style>
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
...@@ -67,9 +105,9 @@ ...@@ -67,9 +105,9 @@
</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 prop="number" label="发票号码" width="width"></el-table-column> <el-table-column prop="number" label="发票号码"></el-table-column>
<el-table-column prop="time" label="发票时间" :formatter="getFroms"></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="发票类型" width="90px">
<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'">
{{ {{
...@@ -78,7 +116,7 @@ ...@@ -78,7 +116,7 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="type" label="发票类别"> <el-table-column prop="type" label="发票类别" width="90px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag <el-tag
:type=" :type="
...@@ -99,21 +137,7 @@ ...@@ -99,21 +137,7 @@
</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="发票金额" width="width"></el-table-column>
<el-table-column prop="prop" label="发票文件" width="120px">
<template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)">
<el-image
style="width: 80px; height: 80px"
:src="scope.row.fileUrl"
:preview-src-list="srcList"
></el-image>
</div>
<div v-else>
<a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
</div>
</template>
</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'">
...@@ -123,7 +147,7 @@ ...@@ -123,7 +147,7 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="操作"> <el-table-column prop="prop" label="操作" width="90px">
<template slot-scope="scope"> <template slot-scope="scope">
<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>
...@@ -148,8 +172,8 @@ ...@@ -148,8 +172,8 @@
<div class="foot_yi"> <div class="foot_yi">
<el-pagination <el-pagination
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="total, prev, pager, next"
:total="total" :total="total"
layout="total, prev, pager, next"
:current-page.sync="invoiceQruey.pageNum" :current-page.sync="invoiceQruey.pageNum"
:page-size="invoiceQruey.pageSize" :page-size="invoiceQruey.pageSize"
></el-pagination> ></el-pagination>
......
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
//获取公司名称 //获取公司名称
getCompany(){ getCompany(){
selectById({companyId:this.$store.getters.companyId}).then((res)=>{ selectById({companyId:this.$store.getters.companyId}).then((res)=>{
if(res.status == "success"){ if(res.success){
this.company = res.data this.company = res.data
}else{ }else{
this.$message.error(res.data) this.$message.error(res.data)
......
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
//获取公司名称 //获取公司名称
getCompany(){ getCompany(){
selectById({companyId:this.$store.getters.companyId}).then((res)=>{ selectById({companyId:this.$store.getters.companyId}).then((res)=>{
if(res.status == "success"){ if(res.success){
this.company = res.data this.company = res.data
}else{ }else{
this.$message.error(res.data) this.$message.error(res.data)
......
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
submitMenu.meta.breadcrumb = this.convertToNumber(submitMenu.meta.breadcrumb) submitMenu.meta.breadcrumb = this.convertToNumber(submitMenu.meta.breadcrumb)
editMenu(submitMenu).then((res) => { editMenu(submitMenu).then((res) => {
if (res.status == "success") { if (res.success) {
this.getMenuData() this.getMenuData()
this.$message({ this.$message({
type: 'success', type: 'success',
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
submitMenu.meta.breadcrumb = this.convertToNumber(submitMenu.meta.breadcrumb) submitMenu.meta.breadcrumb = this.convertToNumber(submitMenu.meta.breadcrumb)
addMenu(submitMenu).then((res) => { addMenu(submitMenu).then((res) => {
if (res.status == "success") { if (res.success) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '添加成功!' message: '添加成功!'
......
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
//获取角色 //获取角色
getRoles() { getRoles() {
getRoles(this.roleQuery).then((res) => { getRoles(this.roleQuery).then((res) => {
if (res.status == "success") { if (res.success) {
this.rolesList = res.data.list this.rolesList = res.data.list
this.total = res.data.total this.total = res.data.total
} else { } else {
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
//获取路由 //获取路由
getRoutes() { getRoutes() {
getRoutes().then((res) => { getRoutes().then((res) => {
if (res.status == "success") { if (res.success) {
this.serviceRoutes = res.data this.serviceRoutes = res.data
this.routes = this.generateRoutes(res.data) this.routes = this.generateRoutes(res.data)
} }
...@@ -255,7 +255,7 @@ export default { ...@@ -255,7 +255,7 @@ export default {
} }
if (isEdit) { // 修改角色 if (isEdit) { // 修改角色
updateRole(this.role).then((res) => { updateRole(this.role).then((res) => {
if (res.status == "success") { if (res.success) {
this.$message.success("修改成功") this.$message.success("修改成功")
this.getRoles() this.getRoles()
} else { } else {
...@@ -268,7 +268,7 @@ export default { ...@@ -268,7 +268,7 @@ export default {
} else { } else {
//新增角色 //新增角色
addRole(this.role).then((res) => { addRole(this.role).then((res) => {
if (res.status == "success") { if (res.success) {
this.$message.success("添加成功") this.$message.success("添加成功")
this.getRoles() this.getRoles()
} else { } else {
......
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