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

20221125

parent a0a55082
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
//获取个人信息 //获取个人信息
getUser(){ getUser(){
getOneself(this.userData).then((res)=>{ getOneself(this.userData).then((res)=>{
if(res.status == "success"){ if(res.success){
this.userData = res.data this.userData = res.data
this.backupsData = Object.assign({}, res.data) this.backupsData = Object.assign({}, res.data)
}else{ }else{
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
this.$refs.userform.validate((valida)=>{ this.$refs.userform.validate((valida)=>{
if(valida){ if(valida){
update(this.userData).then((res)=>{ update(this.userData).then((res)=>{
if(res.status == "success"){ if(res.success){
this.$message.success("修改成功") this.$message.success("修改成功")
this.getUser() this.getUser()
this.userupdata = true this.userupdata = true
...@@ -206,7 +206,7 @@ export default { ...@@ -206,7 +206,7 @@ export default {
newPassword:this.passwordData.newPassword newPassword:this.passwordData.newPassword
} }
passwordReset(param).then((res)=>{ passwordReset(param).then((res)=>{
if(res.status == "success"){ if(res.success){
this.$message.success("修改成功") this.$message.success("修改成功")
this.$store.dispatch('user/logout').then(res=>{ this.$store.dispatch('user/logout').then(res=>{
this.$router.push('/login') this.$router.push('/login')
......
...@@ -32,14 +32,27 @@ ...@@ -32,14 +32,27 @@
> >
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-form label-position="left" class="demo-table-expand"> <el-descriptions
<el-form-item label="合作方:"> class="margin-top"
<span>{{ props.row.projectPartyb }}</span> title="关于项目"
</el-form-item> :column="1"
<el-form-item label="项目详情:"> style="width:60%; margin:20px 20px"
border
>
<el-descriptions-item label="合作方:" :labelStyle="{'width':'120px'}">{{ props.row.projectPartyb }}</el-descriptions-item>
<el-descriptions-item label="项目详情:">
<span>{{ props.row.projectInformation }}</span> <span>{{ props.row.projectInformation }}</span>
</el-form-item> </el-descriptions-item>
</el-form> <el-descriptions-item label="更改项目负责人:">
<el-button
style="margin:5px"
size="mini"
icon="el-icon-coin"
type="primary"
@click="member(props.row)"
>成员管理</el-button>
</el-descriptions-item>
</el-descriptions>
</template> </template>
</el-table-column> </el-table-column>
...@@ -100,22 +113,14 @@ ...@@ -100,22 +113,14 @@
align="center" align="center"
:formatter="timestampToTime" :formatter="timestampToTime"
/> />
<el-table-column prop="projectAmount" label="操作" align="center"> <el-table-column prop="projectAmount" label="操作" align="center" width="125px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
style="margin:5px"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
type="info" type="info"
@click="updataProject(scope.row)" @click="updataProject(scope.row)"
>修改信息</el-button> >修改信息</el-button>
<el-button
style="margin:5px"
size="mini"
icon="el-icon-coin"
type="primary"
@click="member(scope.row)"
>成员管理</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -126,7 +131,7 @@ ...@@ -126,7 +131,7 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="projectQurey.pageNum" :current-page.sync="projectQurey.pageNum"
:page-size="projectQurey.pageSize" :page-size="projectQurey.pageSize"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" :total="total"
></el-pagination> ></el-pagination>
</div> </div>
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
</el-form-item> </el-form-item>
<el-form-item label="发票编号" prop="incomebaoxioa"> <el-form-item label="发票编号" prop="incomebaoxioa">
<el-select <el-select
@change="getchange()"
v-model="invoiceListAdd" v-model="invoiceListAdd"
multiple multiple
filterable filterable
default-first-option default-first-option
placeholder="请选择发票编号" placeholder="请选择发票编号"
> >
...@@ -131,10 +132,11 @@ import { ...@@ -131,10 +132,11 @@ import {
} from "@/api/project"; } from "@/api/project";
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { insert } from "@/api/expend"; import { insert } from "@/api/expend";
import { money } from "@/utils/myValidate"; import { expendAdd as rules } from "../rules";
export default { export default {
data() { data() {
return { return {
rules: rules,
action2: null, action2: null,
fileList1: [], fileList1: [],
expendFrom: { expendFrom: {
...@@ -154,38 +156,12 @@ export default { ...@@ -154,38 +156,12 @@ export default {
companyId: 0, companyId: 0,
typeList: [], typeList: [],
projectData: {}, projectData: {},
//表单验证内容
rules: {
expendMoney: [
{
required: true,
validator: money,
trigger: "change"
}
],
expendTime: [
{ required: true, message: "请选择支出时间", trigger: "change" }
],
expendType: [
{ required: true, message: "请输入支出类别", trigger: "change" }
],
expendObject: [
{ required: true, message: "请输入支出对象", trigger: "change" }
],
expendBody: [
{ required: true, message: "请输入支出用途", trigger: "change" }
],
number: [
{ required: true, message: "请输入发票号码", trigger: "change" }
],
code: [{ required: true, message: "请输入发票代码", trigger: "change" }]
},
//发票状态 //发票状态
status: 0, status: 0,
//发票编号数组 //发票编号数组
getinvoivelist: [], getinvoivelist: [],
//收集发票编号 //收集发票编号
invoiceListAdd: {}, invoiceListAdd: [],
//查询发票编号的数组 //查询发票编号的数组
getinvoiveId: { getinvoiveId: {
userId: null, userId: null,
...@@ -229,7 +205,6 @@ export default { ...@@ -229,7 +205,6 @@ export default {
this.action2 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; this.action2 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.proutlist1.userId = this.$store.getters.urId; this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId; this.proutlist1.companyId = this.$store.getters.companyId;
this.backlistid = this.$route.query.backlistid; this.backlistid = this.$route.query.backlistid;
this.getTypeList(); this.getTypeList();
this.getProject(); this.getProject();
...@@ -401,6 +376,24 @@ export default { ...@@ -401,6 +376,24 @@ export default {
this.proutlist1.enclosureDescribe = null; this.proutlist1.enclosureDescribe = null;
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid); this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.dialogFormVisible = false; this.dialogFormVisible = false;
},
//添加发票金额
getchange() {
let sum = 0;
let list = [];
this.invoiceListAdd.forEach(g => {
this.getinvoivelist.forEach(item => {
if (item.invoiceId == g) {
list.push({
mone: item.mone
});
}
});
});
list.forEach(item => {
sum += item.mone;
});
this.expendFrom.expendMoney = sum;
} }
} }
}; };
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
<div class="header"> <div class="header">
<el-form :inline="true" :model="expendQurey"> <el-form :inline="true" :model="expendQurey">
<el-form-item label="支出对象"> <el-form-item label="支出对象">
<el-input <el-input v-model="expendQurey.expendObject" placeholder="收入对象"></el-input>
v-model="expendQurey.expendObject"
placeholder="收入对象"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="支出类别"> <el-form-item label="支出类别">
<el-select v-model="expendQurey.expendType"> <el-select v-model="expendQurey.expendType">
...@@ -20,10 +17,7 @@ ...@@ -20,10 +17,7 @@
</el-form-item> </el-form-item>
<el-form-item label="支出内容"> <el-form-item label="支出内容">
<el-input <el-input v-model="expendQurey.expendBody" placeholder="收入内容"></el-input>
v-model="expendQurey.expendBody"
placeholder="收入内容"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="支出时间"> <el-form-item label="支出时间">
...@@ -37,22 +31,14 @@ ...@@ -37,22 +31,14 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qurey()" <el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
>查询</el-button <el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
>
<el-button
type="primary"
icon="el-icon-refresh-right"
@click="reset()"
>重置</el-button
>
<el-button <el-button
type="success" type="success"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click="addexpend()" @click="addexpend()"
v-if="state != 0" v-if="state != 0"
>新增支出</el-button >新增支出</el-button>
>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -63,15 +49,39 @@ ...@@ -63,15 +49,39 @@
:data="expendList" :data="expendList"
style="width: 100%; text-align: center" style="width: 100%; text-align: center"
border border
: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"
style="width:40%; margin:20px 20px"
border
>
<el-descriptions-item label="收入附言:">
<span>{{ props.row.expendRemarks }}</span>
</el-descriptions-item>
<el-descriptions-item label="收入详情:">
<span>{{ props.row.expendInformation }}</span>
</el-descriptions-item>
<el-descriptions-item label="发票文件:">
<el-button type="primary" size="mini" @click="ReviseImage(props.row)">点击查看</el-button>
</el-descriptions-item>
<el-descriptions-item label="附件下载">
<el-button type="success" size="mini" @click="selectImage(props.row)">点击查看</el-button>
</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column label="序号" width="50px"> <el-table-column label="序号" width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
(expendQurey.pageNum - 1) * expendQurey.pageSize + (expendQurey.pageNum - 1) * expendQurey.pageSize +
scope.$index + scope.$index +
1 1
}} }}
</template> </template>
</el-table-column> </el-table-column>
...@@ -86,41 +96,13 @@ ...@@ -86,41 +96,13 @@
</el-table-column> </el-table-column>
<el-table-column prop="expendBody" label="支出内容" /> <el-table-column prop="expendBody" label="支出内容" />
<el-table-column prop="expendTime" label="支出时间" /> <el-table-column prop="expendTime" label="支出时间" />
<el-table-column prop="expendInformation" label="支出详情" />
<el-table-column prop="expendRemarks" label="支出备注" />
<el-table-column prop="prop" label="发票文件">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="ReviseImage(scope.row)"
>点击查看</el-button
>
</template>
</el-table-column>
<el-table-column prop="prop" label="附件下载">
<template slot-scope="scope">
<el-button
type="success"
size="mini"
@click="selectImage(scope.row)"
>点击查看</el-button
>
</template>
</el-table-column>
<el-table-column label="操作人员"> <el-table-column label="操作人员">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag effect="plain">{{ scope.row.userName }}</el-tag> <el-tag effect="plain">{{ scope.row.userName }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="projectAmount" label="操作" v-if="state != 0" width="120px">
prop="projectAmount"
label="操作"
v-if="state != 0"
width="120px"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
style="margin: 5px" style="margin: 5px"
...@@ -128,8 +110,7 @@ ...@@ -128,8 +110,7 @@
icon="el-icon-edit" icon="el-icon-edit"
type="info" type="info"
@click="updatain(scope.row)" @click="updatain(scope.row)"
>修改信息</el-button >修改信息</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -146,62 +127,39 @@ ...@@ -146,62 +127,39 @@
</div> </div>
<!-- 附件抽屉 --> <!-- 附件抽屉 -->
<div> <div>
<el-drawer <el-drawer title="附件操作" :visible.sync="drawer2" :direction="direction" size="50%">
title="附件操作"
:visible.sync="drawer2"
:direction="direction"
size="50%"
>
<el-button <el-button
type="primary" type="primary"
style="margin-left: 5%; margin-top: 40px" style=" margin-left:5%;margin-top:40px "
:disabled="disabled" :disabled="disabled"
@click="updatecard" @click="updatecard"
>添加附件</el-button >添加附件</el-button>
>
<el-card <el-card
class="box-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"
> >
<el-row class="row-bg"> <el-row class="row-bg">
<div <div v-for="index in queryDTOList" :key="index.enclosureId" class="lsitall">
v-for="index in queryDTOList"
:key="index.enclosureId"
class="lsitall"
>
<el-col :span="10"> <el-col :span="10">
<div style="margin-top: 6px; margin-left: 40px"> <div style=" margin-top: 6px;margin-left:40px">附件{{index.enclosureId}}</div>
附件{{ index.enclosureId }}
</div>
</el-col> </el-col>
<el-col :span="12" style="margin-left: -50px"> <el-col :span="12" style="margin-left:-50px">
<el-button <el-button
type="primary" type="primary"
icon="el-icon-folder-checked" icon="el-icon-folder-checked"
class="a-style" class="a-style"
size="mini" size="mini"
style="font-size: 13px" style=" font-size: 13px"
@click="delProject(index)" @click="delProject(index)"
>下载</el-button >下载</el-button>
>
<el-popover placement="top" width="160" v-model="index.visible"> <el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p> <p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button <el-button size="mini" type="text" @click="index.visible = false">取消</el-button>
size="mini" <el-button type="primary" size="mini" @click="deleteProject(index)">确定</el-button>
type="text"
@click="index.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="deleteProject(index)"
>确定</el-button
>
</div> </div>
<el-button <el-button
type="danger" type="danger"
...@@ -210,8 +168,7 @@ ...@@ -210,8 +168,7 @@
size="mini " size="mini "
style="font-size: 13px" style="font-size: 13px"
slot="reference" slot="reference"
>删除</el-button >删除</el-button>
>
</el-popover> </el-popover>
</el-col> </el-col>
</div> </div>
...@@ -220,16 +177,16 @@ ...@@ -220,16 +177,16 @@
<!-- 附件上传 --> <!-- 附件上传 -->
<el-card <el-card
class="box-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"
> >
<div style="width: 60%; margin-left: 30px"> <div style="width:60%;margin-left:30px">
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
placeholder="请输入附件详情" placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe" v-model="proutlist1.enclosureDescribe"
style="margin: 20px 0px" style="margin:20px 0px;"
></el-input> ></el-input>
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -243,64 +200,37 @@ ...@@ -243,64 +200,37 @@
:on-success="Refresh" :on-success="Refresh"
:data="proutlist1" :data="proutlist1"
multiple multiple
style="margin: 20px 0px" style="margin:20px 0px;"
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text"> <div class="el-upload__text">
将文件拖到此处,或 将文件拖到此处,或
<em>点击上传附件</em> <em>点击上传附件</em>
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
只能上传文件,且不超过500kb
</div>
</el-upload> </el-upload>
</div> </div>
<div style="margin-left: 75%"> <div style="margin-left:75%;">
<el-button @click="remove()">取 消</el-button> <el-button @click="remove()">取 消</el-button>
<el-button <el-button type="primary" @click="determine()" style="margin-top:20px;">确 定</el-button>
type="primary"
@click="determine()"
style="margin-top: 20px"
>确 定</el-button
>
</div> </div>
</el-card> </el-card>
<div class="box-card" v-show="getshow == 3"></div> <div class="box-card" v-show="getshow==3"></div>
</el-drawer> </el-drawer>
</div> </div>
<div> <div>
<!--抽屉--> <!--抽屉-->
<el-drawer <el-drawer title="发票详情" :visible.sync="drawer" :direction="direction" size="50%">
title="发票详情"
:visible.sync="drawer"
:direction="direction"
size="60%"
>
<!-- filePath-->
<el-button type="primary" style="margin: 10px 3%" @click="selectGet()"
>添加收入发票</el-button
>
<el-table <el-table
:data="getinvoivelist" :data="getinvoivelist"
style="width: 94%; margin: 10px 3%; text-align: center" style="width: 90%; margin:10px 5%; text-align: center"
border border
> >
<el-table-column <el-table-column type="index" label="序号" width="80"></el-table-column>
type="index" <el-table-column prop="code" label="发票代码"></el-table-column>
label="序号" <el-table-column prop="number" label="号码"></el-table-column>
width="40" <el-table-column prop="mone" label="金额"></el-table-column>
></el-table-column>
<el-table-column
prop="number"
label="号码"
width="160px"
></el-table-column>
<el-table-column
prop="mone"
label="金额"
width="180"
></el-table-column>
<el-table-column prop="prop" label="查看PDF文件或图片"> <el-table-column prop="prop" label="查看PDF文件或图片">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)"> <div v-if="formatProtocolType(scope.row)">
...@@ -311,74 +241,13 @@ ...@@ -311,74 +241,13 @@
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
<a class="a-style" @click="handlePreView(scope.row)" <a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
>点击查看文件</a
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="操作">
<template slot-scope="scope">
<el-popover
placement="top"
width="60"
v-model="scope.row.visible"
>
<p>确定要删除该发票吗</p>
<div style="text-align: right; margin: 0">
<el-button
size="mini"
type="text"
@click="scope.row.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="DeleteFrom(scope.row)"
>确定</el-button
>
</div>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
slot="reference"
></el-button>
</el-popover>
</template>
</el-table-column>
</el-table> </el-table>
</el-drawer> </el-drawer>
</div> </div>
<!-- 添加发票对话框 -->
<div>
<el-dialog title="添加发票" :visible.sync="dialogFormVisible" width="40%">
<div class="dialog-footer">
<div class="selectList">
<el-select
v-model="getListincom"
multiple
filterable
default-first-option
style="width: 100%"
placeholder="请选择要添加的发票编号"
>
<el-option
v-for="item in invoiceListAdd"
:key="item.invoiceId"
:label="item.number"
:value="item.invoiceId"
></el-option>
</el-select>
</div>
<div slot="footer">
<el-button @click="Buttonback1()">取 消</el-button>
<el-button type="primary" @click="Buttonback2()">确 定</el-button>
</div>
</div>
</el-dialog>
</div>
</div> </div>
</template> </template>
...@@ -391,7 +260,7 @@ import { ...@@ -391,7 +260,7 @@ import {
selectAllBystatus, selectAllBystatus,
updatesubmit, updatesubmit,
deletBystatus, deletBystatus,
deleteById, deleteById
} from "@/api/project"; } from "@/api/project";
import { getFileUrl } from "@/api/companyFile"; import { getFileUrl } from "@/api/companyFile";
export default { export default {
...@@ -406,7 +275,7 @@ export default { ...@@ -406,7 +275,7 @@ export default {
expendType: null, expendType: null,
expendBody: null, expendBody: null,
expendTimeStart: null, expendTimeStart: null,
expendTimeEnd: null, expendTimeEnd: null
}, },
expendList: [], expendList: [],
options: [], options: [],
...@@ -418,7 +287,7 @@ export default { ...@@ -418,7 +287,7 @@ export default {
//查询图片给的值 //查询图片给的值
getinvoiveId: { getinvoiveId: {
companyId: null, companyId: null,
expendId: 0, expendId: 0
}, },
//图片的数组 //图片的数组
getinvoivelist: [], getinvoivelist: [],
...@@ -429,23 +298,13 @@ export default { ...@@ -429,23 +298,13 @@ export default {
// //查询附件 // //查询附件
queryDTO: { queryDTO: {
companyId: null, companyId: null,
expendId: null, expendId: null
}, },
//附件抽屉 //附件抽屉
drawer2: false, drawer2: false,
//发票对话框
dialogFormVisible: false,
//展示抽屉的数组 //展示抽屉的数组
queryDTOList: [], queryDTOList: [],
//查询的能选择的表单信息
getFormslist: {
userId: null,
companyId: null,
type: 1,
},
incomeIdgrt: null, //收集incomeId数据 incomeIdgrt: null, //收集incomeId数据
invoiceListAdd: [], //查询发票的集合
getListincom: [], //收集选择的数组
getshow: 1, //判断show的显示与隐藏, getshow: 1, //判断show的显示与隐藏,
//合同文件上传携带参数 //合同文件上传携带参数
proutlist1: { proutlist1: {
...@@ -453,24 +312,23 @@ export default { ...@@ -453,24 +312,23 @@ export default {
enclosureDescribe: "", enclosureDescribe: "",
status: 1, //0收入 1支出 status: 1, //0收入 1支出
companyId: null, companyId: null,
userId: null, userId: null
}, },
fileTypepdf: false, //判断合同文件是否存在 fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //合同文件 fileList1: [], //合同文件
disabled: false, //隐藏 disabled: false //隐藏
}; };
}, },
computed: { computed: {
state: function () { state: function() {
return this.$route.query.state; return this.$route.query.state;
}, }
}, },
created() { created() {
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.expendQurey.projectId = this.$route.query.id; this.expendQurey.projectId = this.$route.query.id;
this.backlistid = this.$route.query.backlistid; this.backlistid = this.$route.query.backlistid;
this.queryDTO.companyId = this.$store.getters.companyId; this.queryDTO.companyId = this.$store.getters.companyId;
this.getFormslist.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.proutlist1.userId = this.$store.getters.urId; this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId; this.proutlist1.companyId = this.$store.getters.companyId;
...@@ -481,7 +339,7 @@ export default { ...@@ -481,7 +339,7 @@ export default {
//获取支出情况 //获取支出情况
getexpend() { getexpend() {
selectByProjectId(this.expendQurey) selectByProjectId(this.expendQurey)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.expendList = res.data.list; this.expendList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
...@@ -489,7 +347,7 @@ export default { ...@@ -489,7 +347,7 @@ export default {
this.$message.errror(res.msg); this.$message.errror(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("查询数据失败"); this.$message.error("查询数据失败");
}); });
}, },
...@@ -497,10 +355,10 @@ export default { ...@@ -497,10 +355,10 @@ export default {
getTypeList() { getTypeList() {
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
typeCategory: 1, typeCategory: 1
}; };
selectAll(param) selectAll(param)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.options = res.data; this.options = res.data;
} else { } else {
...@@ -508,7 +366,7 @@ export default { ...@@ -508,7 +366,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取类型失败"); this.$message.error("获取类型失败");
this.back(); this.back();
}); });
...@@ -523,8 +381,8 @@ export default { ...@@ -523,8 +381,8 @@ export default {
path: "/expendAdd", path: "/expendAdd",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backlistid: this.backlistid, backlistid: this.backlistid
}, }
}); });
}, },
//修改支出信息 //修改支出信息
...@@ -534,7 +392,8 @@ export default { ...@@ -534,7 +392,8 @@ export default {
query: { query: {
id: data.expendId, id: data.expendId,
projectId: this.$route.query.id, projectId: this.$route.query.id,
}, backlistid: this.backlistid
}
}); });
}, },
//时间处理 //时间处理
...@@ -567,7 +426,7 @@ export default { ...@@ -567,7 +426,7 @@ export default {
}, },
//下载附件 //下载附件
delProject(row) { delProject(row) {
getFileUrl(row.enclosureFile).then((res) => { getFileUrl(row.enclosureFile).then(res => {
if (res.success) { if (res.success) {
let url = res.data; let url = res.data;
console.log(url); console.log(url);
...@@ -608,14 +467,14 @@ export default { ...@@ -608,14 +467,14 @@ export default {
//查询发票图片 //查询发票图片
Selectinsertlsit() { Selectinsertlsit() {
selectAllById(this.getinvoiveId) selectAllById(this.getinvoiveId)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
res.data.forEach((e) => { res.data.forEach(e => {
let fileNamepdf = e.filePath; let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring( let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".") fileNamepdf.lastIndexOf(".")
); );
getFileUrl(e.filePath).then((res) => { getFileUrl(e.filePath).then(res => {
if (res.success) { if (res.success) {
let url = res.data; let url = res.data;
e.fileUrl = url; e.fileUrl = url;
...@@ -632,7 +491,7 @@ export default { ...@@ -632,7 +491,7 @@ export default {
//this.back(); //this.back();
} }
}) })
.catch((error) => { .catch(error => {
console.log(error); console.log(error);
this.$message.error("获取发票图片失败"); this.$message.error("获取发票图片失败");
//this.back(); //this.back();
...@@ -640,28 +499,25 @@ export default { ...@@ -640,28 +499,25 @@ export default {
}, },
back() { back() {
if (this.backlistid == 0) { if (this.backlistid == 0) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ this.$router.push({
path: "/projectList", path: "/projectList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id
}, }
}); });
} else if (this.backlistid == 1) { } else if (this.backlistid == 1) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ this.$router.push({
path: "/beresponsibleforList", path: "/beresponsibleforList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id
}, }
}); });
} else { } else {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ this.$router.push({
path: "/participateinList", path: "/participateinList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id
}, }
}); });
} }
}, },
...@@ -675,7 +531,7 @@ export default { ...@@ -675,7 +531,7 @@ export default {
this.queryDTO.expendId = row.expendId; this.queryDTO.expendId = row.expendId;
this.proutlist1.Id = row.expendId; this.proutlist1.Id = row.expendId;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.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) {
...@@ -691,81 +547,10 @@ export default { ...@@ -691,81 +547,10 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取附件文件失败"); this.$message.error("获取附件文件失败");
}); });
}, },
//查询未报销发票
selectGet() {
this.dialogFormVisible = true;
this.getFormslist.userId = this.$store.getters.urId;
selectAllBystatus(this.getFormslist)
.then((res) => {
if (res.success) {
this.invoiceListAdd = res.data;
} else {
this.$message.error(res.msg);
this.back();
}
})
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
},
//确定与取消
Buttonback1() {
this.getListincom = [];
this.dialogFormVisible = false;
},
Buttonback2() {
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.getListincom.forEach((item) => {
list.push({
invoiceId: item,
expendId: this.incomeIdgrt,
status: 1,
});
});
updatesubmit(list).then((res) => {
if (res.success) {
this.$message.success(res.msg);
this.dialogFormVisible = false;
this.$message({
showClose: true,
message: "添加发票成功",
type: "success",
});
this.Selectinsertlsit();
this.getListincom = [];
} else {
this.$message.error(res.msg);
}
});
},
//删除发票
DeleteFrom(row) {
//收集被删除发票的数据
let BillList = {
invoiceId: row.invoiceId,
expendId: row.expendId,
};
deletBystatus(BillList)
.then((res) => {
if (res.success) {
this.visible = false;
this.$message({
message: "删除成功",
type: "success",
});
this.Selectinsertlsit();
}
})
.catch((errror) => {
this.$message.error(res.msg);
});
},
//图片格式 //图片格式
formatProtocolType(row) { formatProtocolType(row) {
//这里判断的是是否有文件 //这里判断的是是否有文件
...@@ -795,23 +580,23 @@ export default { ...@@ -795,23 +580,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;
} }
}) })
.catch((errror) => { .catch(errror => {
this.$message.error(res.msg); this.$message.error(res.msg);
}); });
}, },
//清除附件文件 //清除附件文件
delfile1() { delfile1() {
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid); this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.fileTypepdf = false; this.fileTypepdf = false;
}, },
//确定提交附件 //确定提交附件
...@@ -824,7 +609,7 @@ export default { ...@@ -824,7 +609,7 @@ export default {
this.$message({ this.$message({
showClose: true, showClose: true,
message: "上传附件成功", message: "上传附件成功",
type: "success", type: "success"
}); });
this.Refresh(); this.Refresh();
} else { } else {
...@@ -835,7 +620,7 @@ export default { ...@@ -835,7 +620,7 @@ export default {
Refresh() { Refresh() {
this.queryDTO.expendId = this.proutlist1.Id; this.queryDTO.expendId = this.proutlist1.Id;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.queryDTOList = res.data; this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据 this.proutlist1.enclosureDescribe = ""; //初始化数据
...@@ -843,7 +628,7 @@ export default { ...@@ -843,7 +628,7 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取附件文件失败"); this.$message.error("获取附件文件失败");
}); });
}, },
...@@ -854,7 +639,7 @@ export default { ...@@ -854,7 +639,7 @@ export default {
enclosureDescribe: "", enclosureDescribe: "",
status: 0, //0收入 1支出 status: 0, //0收入 1支出
companyId: null, companyId: null,
userId: null, userId: null
}; };
}, },
//附件取消 //附件取消
...@@ -882,8 +667,8 @@ export default { ...@@ -882,8 +667,8 @@ export default {
this.$refs.upload1.clearFiles(); this.$refs.upload1.clearFiles();
this.fileTypepdf = false; this.fileTypepdf = false;
} }
}, }
}, }
}; };
</script> </script>
......
<template> <template>
<div class="container"> <div class="container">
<el-row> <el-row>
<el-col :xl="8" :lg="8" :md="8" :sm="12" :xs="24"> <el-col :xl="8" :lg="8" :md="8" :sm="12" :xs="24" style="margin:20px 30px;">
<el-form <el-form ref="form" :model="expendFrom" label-width="120px" :rules="rules">
ref="form"
:model="expendFrom"
label-width="120px"
:rules="rules"
>
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input v-model="expendFrom.projectName" disabled></el-input> <el-input v-model="expendFrom.projectName" disabled></el-input>
</el-form-item> </el-form-item>
...@@ -19,8 +14,7 @@ ...@@ -19,8 +14,7 @@
:key="item.typeId" :key="item.typeId"
:label="item.typeName" :label="item.typeName"
:value="item.typeId" :value="item.typeId"
> ></el-option>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -34,8 +28,7 @@ ...@@ -34,8 +28,7 @@
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
@change="timestampToTime()" @change="timestampToTime()"
> ></el-date-picker>
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="支出对象" prop="expendObject"> <el-form-item label="支出对象" prop="expendObject">
...@@ -58,30 +51,85 @@ ...@@ -58,30 +51,85 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
type="success" <el-button type="danger" icon="el-icon-delete-solid" @click="deleteExpend()">删除</el-button>
icon="el-icon-upload2"
@click="submitForm()"
>提交</el-button
>
<el-button
type="danger"
icon="el-icon-delete-solid"
@click="deleteExpend()"
>删除</el-button
>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
<el-col :xl="8" :lg="10" :md="12" :sm="12" :xs="24" style="margin:10px 130px;">
<div>
<h3>发票编辑</h3>
<div>
<div class="selectList" style="margin:20px 0px">
<el-select
v-model="getListincom"
multiple
filterable
default-first-option
style="width:220px;"
placeholder="请选择要添加的发票编号"
@change="getchange()"
>
<el-option
v-for="item in invoiceListAdd"
:key="item.invoiceId"
:label="item.number"
:value="item.invoiceId"
></el-option>
</el-select>
<el-button type="primary" @click="Buttonback2()" style="margin:0px 5px">添加发票</el-button>
</div>
</div>
<div>
<el-table
:data="getinvoivelist"
border
style="width: 100%"
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center', background:'#eef1f6',color:'#606266'}"
class="gettable"
>
<el-table-column prop="code" label="发票代码"></el-table-column>
<el-table-column prop="number" label="发票号码"></el-table-column>
<el-table-column prop="mone" label="金额"></el-table-column>
<el-table-column prop="prop" label="操作">
<template slot-scope="scope">
<el-popover placement="top" width="60" v-model="scope.row.visible">
<p>确定要删除该发票吗</p>
<div style="text-align: right; margin:0">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="DeleteFrom(scope.row)">确定</el-button>
</div>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
slot="reference"
class="edit"
>删除</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { update,selectById,del} from "@/api/expend"; import { update, selectById, del } from "@/api/expend";
import { money } from "@/utils/myValidate"; import { money } from "@/utils/myValidate";
import { mapGetters } from "vuex";
import {
selectAllById,
selectAllBystatus,
updatesubmit,
deletBystatus
} from "@/api/project";
export default { export default {
data() { data() {
return { return {
...@@ -95,16 +143,16 @@ export default { ...@@ -95,16 +143,16 @@ export default {
expendType: null, expendType: null,
projectId: null, projectId: null,
userId: null, userId: null,
projectName: null, projectName: null
}, },
typeList: [], typeList: [],
projectData: {}, projectData: {},
rules: { rules: {
projectName: [ projectName: [
{ required: true, message: "请选择项目", trigger: "change" }, { required: true, message: "请选择项目", trigger: "change" }
], ],
expendType: [ expendType: [
{ required: true, message: "请选择支出类型", trigger: "change" }, { required: true, message: "请选择支出类型", trigger: "change" }
], ],
expendMoney: [ expendMoney: [
{ {
...@@ -113,71 +161,81 @@ export default { ...@@ -113,71 +161,81 @@ export default {
} }
], ],
expendTime: [ expendTime: [
{ required: true, message: "请选择支出时间", trigger: "change" }, { required: true, message: "请选择支出时间", trigger: "change" }
], ]
}, },
getListincom: [], //收集选择的数组
invoiceListAdd: [], //查询发票的集合
getinvoivelist: [],
backlistid: null //返回标记
}; };
}, },
computed: { computed: {
...mapGetters(["companyId", "urId"]),
expendId() { expendId() {
return this.$route.query.id; return this.$route.query.id;
}, }
}, },
created() { created() {
this.backlistid = this.$route.query.backlistid;
this.expendFrom.userId = this.$store.getters.urId; this.expendFrom.userId = this.$store.getters.urId;
this.getTypeList(); this.getTypeList();
this.getexpend(); this.getexpend();
this.selectGet();
this.Selectinsertlsit();
}, },
methods: { methods: {
//获取支出类型 //获取支出类型
getTypeList() { getTypeList() {
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
typeCategory: 1, typeCategory: 1
}; };
selectAll(param) selectAll(param)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.typeList = res.data; this.typeList = res.data;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back() this.back();
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取类型失败"); this.$message.error("获取类型失败");
this.back() this.back();
}); });
}, },
//获取支出信息 //获取支出信息
getexpend(){ getexpend() {
selectById({expendId:this.expendId}).then((res)=>{ selectById({ expendId: this.expendId })
if(res.success){ .then(res => {
this.expendFrom = res.data; if (res.success) {
this.expendFrom.userId = this.$store.getters.urId this.expendFrom = res.data;
}else{ this.expendFrom.userId = this.$store.getters.urId;
this.$message.error(res.msg); } else {
this.back() this.$message.error(res.msg);
} this.back();
}).catch((error)=>{ }
this.$message.error("获取信息失败") })
this.back() .catch(error => {
}) this.$message.error("获取信息失败");
this.back();
});
}, },
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
update(this.expendFrom) update(this.expendFrom)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.back() this.back();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("新建失败"); this.$message.error("新建失败");
}); });
} }
...@@ -190,7 +248,8 @@ export default { ...@@ -190,7 +248,8 @@ export default {
path: "/expendList", path: "/expendList",
query: { query: {
id: this.$route.query.projectId, id: this.$route.query.projectId,
}, backlistid: this.$route.query.backlistid
}
}); });
}, },
//时间处理 yyyy-MM-dd hh:mm:ss //时间处理 yyyy-MM-dd hh:mm:ss
...@@ -213,34 +272,152 @@ export default { ...@@ -213,34 +272,152 @@ export default {
this.expendFrom.expendTime = Y + M + D + h + m + s; this.expendFrom.expendTime = Y + M + D + h + m + s;
}, },
//删除 //删除
deleteExpend(){ deleteExpend() {
this.$confirm("确定要删除此收入记录吗", "提示", { this.$confirm("确定要删除此收入记录吗", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning"
}) })
.then(() => { .then(() => {
del(this.expendFrom) del(this.expendFrom)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.back(); this.back();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("删除失败"); this.$message.error("删除失败");
}); });
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "已取消删除", message: "已取消删除"
});
});
},
//添加发票
Buttonback2() {
if (this.getListincom.length > 0) {
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.getListincom.forEach(item => {
list.push({
invoiceId: item,
expendId: this.expendId,
status: 1
}); });
});
updatesubmit(list).then(res => {
if (res.success) {
this.$message.success(res.msg);
this.dialogFormVisible = false;
this.$message({
showClose: true,
message: "添加发票成功",
type: "success"
});
this.Selectinsertlsit();
this.getListincom = [];
} else {
this.$message.error(res.msg);
}
});
} else {
this.$message({
showClose: true,
message: "没有添加发票",
type: "warning"
});
}
},
//查询未报销发票
selectGet() {
const params = {
userId: this.urId,
companyId: this.companyId,
type: 1
};
selectAllBystatus(params)
.then(res => {
if (res.success) {
this.invoiceListAdd = res.data;
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error("获取发票编号失败");
});
},
//查询发票图片
Selectinsertlsit() {
const params = {
companyId: this.companyId,
expendId: this.expendId
};
selectAllById(params)
.then(res => {
if (res.success) {
this.getinvoivelist = res.data;
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
console.log(error);
this.$message.error("获取发票图片失败");
});
},
//删除发票
DeleteFrom(row) {
let get = this.expendFrom.expendMoney;
get -= row.mone;
console.log(get);
this.expendFrom.expendMoney = get;
//收集被删除发票的数据
let BillList = {
invoiceId: row.invoiceId,
expendId: row.expendId
};
deletBystatus(BillList)
.then(res => {
if (res.success) {
this.visible = false;
this.$message({
message: "删除成功",
type: "success"
});
this.Selectinsertlsit();
this.selectGet();
}
})
.catch(errror => {
this.$message.error(res.msg);
});
},
//添加发票金额
getchange() {
let sum = 0;
let list = [];
this.getListincom.forEach(g => {
this.invoiceListAdd.forEach(item => {
if (item.invoiceId == g) {
list.push({
mone: item.mone
});
}
});
});
list.forEach(item => {
sum += item.mone;
}); });
this.expendFrom.expendMoney = sum;
} }
}, }
}; };
</script> </script>
...@@ -248,4 +425,7 @@ export default { ...@@ -248,4 +425,7 @@ export default {
.container { .container {
padding: 10px; padding: 10px;
} }
.edit {
font-size: 11px;
}
</style> </style>
\ No newline at end of file
...@@ -2,12 +2,7 @@ ...@@ -2,12 +2,7 @@
<div class="container"> <div class="container">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24"> <el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
<el-form <el-form ref="form" :model="incomeFrom" label-width="120px" :rules="rules">
ref="form"
:model="incomeFrom"
label-width="120px"
:rules="rules"
>
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input v-model="incomeFrom.projectName" disabled></el-input> <el-input v-model="incomeFrom.projectName" disabled></el-input>
</el-form-item> </el-form-item>
...@@ -29,6 +24,7 @@ ...@@ -29,6 +24,7 @@
filterable filterable
default-first-option default-first-option
placeholder="请选择发票编号" placeholder="请选择发票编号"
@change="getchange()"
> >
<el-option <el-option
v-for="item in getinvoivelist" v-for="item in getinvoivelist"
...@@ -70,9 +66,7 @@ ...@@ -70,9 +66,7 @@
</el-col> </el-col>
<!-- 附件上传 --> <!-- 附件上传 -->
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract"> <el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract">
<el-button type="primary" @click="dialogFormVisible = true" <el-button type="primary" @click="dialogFormVisible = true">上传附件</el-button>
>上传附件</el-button
>
<el-dialog title="附件" :visible.sync="dialogFormVisible" width="55%"> <el-dialog title="附件" :visible.sync="dialogFormVisible" width="55%">
<div style="width: 60%; margin-left: 30px"> <div style="width: 60%; margin-left: 30px">
<el-input <el-input
...@@ -100,9 +94,7 @@ ...@@ -100,9 +94,7 @@
将文件拖到此处,或 将文件拖到此处,或
<em>点击上传附件</em> <em>点击上传附件</em>
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
只能上传文件,且不超过500kb
</div>
</el-upload> </el-upload>
</div> </div>
<div style="margin-left: 75%"> <div style="margin-left: 75%">
...@@ -111,19 +103,14 @@ ...@@ -111,19 +103,14 @@
type="primary" type="primary"
@click="dialogFormVisible = false" @click="dialogFormVisible = false"
style="margin-top: 20px" style="margin-top: 20px"
>确 定</el-button >确 定</el-button>
>
</div> </div>
</el-dialog> </el-dialog>
</el-col> </el-col>
<!-- 按钮 --> <!-- 按钮 -->
<el-col :span="24" style="margin-left: 120px"> <el-col :span="24" style="margin-left: 120px">
<el-button type="success" icon="el-icon-upload2" @click="submitForm()" <el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
>提交</el-button <el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()"
>重置信息</el-button
>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-col> </el-col>
</el-row> </el-row>
...@@ -134,14 +121,15 @@ ...@@ -134,14 +121,15 @@
import { import {
selectByProjectId, selectByProjectId,
selectAllBystatus, selectAllBystatus,
updatesubmit, updatesubmit
} from "@/api/project"; } from "@/api/project";
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { insert } from "@/api/imcome"; import { insert } from "@/api/imcome";
import { money } from "@/utils/myValidate"; import { incomeAdd as rules} from "../rules";
export default { export default {
data() { data() {
return { return {
rules:rules,
//表单 //表单
incomeFrom: { incomeFrom: {
incomeBody: null, incomeBody: null,
...@@ -154,31 +142,7 @@ export default { ...@@ -154,31 +142,7 @@ export default {
projectId: null, projectId: null,
userId: null, userId: null,
projectName: null, projectName: null,
incomebaoxioa: null, //报销的字段 incomebaoxioa: null //报销的字段
},
rules: {
projectName: [
{ required: true, message: "请选择项目", trigger: "change" },
],
incomeType: [
{ required: true, message: "请选择收入类型", trigger: "change" },
],
incomeObject: [
{ required: true, message: "没有输入对方户名", trigger: "change" },
],
incomeBody: [
{ required: true, message: "没有输入对收入内容", trigger: "change" },
],
incomeMoney: [
{
required: true,
validator: money,
trigger: "change",
},
],
incomeTime: [
{ required: true, message: "请选择收到时间", trigger: "change" },
],
}, },
invoiceListAdd: [], //选择的发票号 invoiceListAdd: [], //选择的发票号
getinvoivelist: [], //查询的能选择的表单信息 getinvoivelist: [], //查询的能选择的表单信息
...@@ -191,22 +155,22 @@ export default { ...@@ -191,22 +155,22 @@ export default {
enclosureDescribe: "", enclosureDescribe: "",
status: 0, //0收入 1支出 status: 0, //0收入 1支出
companyId: null, companyId: null,
userId: null, userId: null
}, },
//查询发票编号的参数 //查询发票编号的参数
getinvoiveId: { getinvoiveId: {
userId: null, userId: null,
companyId: null, companyId: null,
type: 0, type: 0
}, },
//附件 //附件
dialogFormVisible: false, dialogFormVisible: false
}; };
}, },
computed: { computed: {
projectId() { projectId() {
return this.$route.query.id; return this.$route.query.id;
}, }
}, },
created() { created() {
//用户id //用户id
...@@ -246,10 +210,10 @@ export default { ...@@ -246,10 +210,10 @@ export default {
}, },
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
insert(this.incomeFrom) insert(this.incomeFrom)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
//判断是否有附件文件 //判断是否有附件文件
if (this.fileTypepdf) { if (this.fileTypepdf) {
...@@ -260,14 +224,14 @@ export default { ...@@ -260,14 +224,14 @@ export default {
if (this.invoiceListAdd.length > 0) { if (this.invoiceListAdd.length > 0) {
let list = []; let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销 //提交发票与收入关系 status默认为1 表示发票已报销
this.invoiceListAdd.forEach((item) => { this.invoiceListAdd.forEach(item => {
list.push({ list.push({
invoiceId: item, invoiceId: item,
incomeId: res.data, incomeId: res.data,
status: 1, status: 1
}); });
}); });
updatesubmit(list).then((res) => { updatesubmit(list).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.back(); this.back();
...@@ -282,7 +246,7 @@ export default { ...@@ -282,7 +246,7 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("提交失败"); this.$message.error("提交失败");
}); });
} }
...@@ -301,8 +265,8 @@ export default { ...@@ -301,8 +265,8 @@ export default {
path: "/incomeList", path: "/incomeList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backid: this.$route.query.backid, backid: this.$route.query.backid
}, }
}); });
}, },
//合同文件校验 //合同文件校验
...@@ -322,10 +286,10 @@ export default { ...@@ -322,10 +286,10 @@ export default {
getTypeList() { getTypeList() {
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
typeCategory: 0, typeCategory: 0
}; };
selectAll(param) selectAll(param)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.typeList = res.data; this.typeList = res.data;
} else { } else {
...@@ -333,7 +297,7 @@ export default { ...@@ -333,7 +297,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取类型失败"); this.$message.error("获取类型失败");
this.back(); this.back();
}); });
...@@ -341,10 +305,10 @@ export default { ...@@ -341,10 +305,10 @@ export default {
//获取项目 //获取项目
getProject() { getProject() {
let param = { let param = {
projectId: this.projectId, projectId: this.projectId
}; };
selectByProjectId(param) selectByProjectId(param)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.projectData = res.data; this.projectData = res.data;
this.incomeFrom.projectName = res.data.projectName; this.incomeFrom.projectName = res.data.projectName;
...@@ -354,7 +318,7 @@ export default { ...@@ -354,7 +318,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取项目失败"); this.$message.error("获取项目失败");
this.back(); this.back();
}); });
...@@ -362,7 +326,7 @@ export default { ...@@ -362,7 +326,7 @@ export default {
//查询发票编号 //查询发票编号
Selectinsertlsit() { Selectinsertlsit() {
selectAllBystatus(this.getinvoiveId) selectAllBystatus(this.getinvoiveId)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
} else { } else {
...@@ -370,7 +334,7 @@ export default { ...@@ -370,7 +334,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取发票编号失败"); this.$message.error("获取发票编号失败");
this.back(); this.back();
}); });
...@@ -378,7 +342,7 @@ export default { ...@@ -378,7 +342,7 @@ export default {
//清楚合同文件 //清楚合同文件
delfile1() { delfile1() {
this.fileTypepdf = false; this.fileTypepdf = false;
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid); this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
}, },
//取消 //取消
remove() { remove() {
...@@ -386,7 +350,25 @@ export default { ...@@ -386,7 +350,25 @@ export default {
this.delfile1(); this.delfile1();
this.dialogFormVisible = false; this.dialogFormVisible = false;
}, },
}, //添加发票金额
getchange() {
let sum = 0;
let list = [];
this.invoiceListAdd.forEach(g => {
this.getinvoivelist.forEach(item => {
if (item.invoiceId == g) {
list.push({
mone: item.mone
});
}
});
});
list.forEach(item => {
sum += item.mone;
});
this.incomeFrom.incomeMoney = sum;
}
}
}; };
</script> </script>
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
<div class="header"> <div class="header">
<el-form :inline="true" :model="incomeQurey"> <el-form :inline="true" :model="incomeQurey">
<el-form-item label="收入对象"> <el-form-item label="收入对象">
<el-input <el-input v-model="incomeQurey.incomeObject" placeholder="收入对象"></el-input>
v-model="incomeQurey.incomeObject"
placeholder="收入对象"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收入类别"> <el-form-item label="收入类别">
<el-select v-model="incomeQurey.incomeType"> <el-select v-model="incomeQurey.incomeType">
...@@ -19,10 +16,7 @@ ...@@ -19,10 +16,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="收入内容"> <el-form-item label="收入内容">
<el-input <el-input v-model="incomeQurey.incomeBody" placeholder="收入内容"></el-input>
v-model="incomeQurey.incomeBody"
placeholder="收入内容"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收入时间"> <el-form-item label="收入时间">
<el-date-picker <el-date-picker
...@@ -35,22 +29,14 @@ ...@@ -35,22 +29,14 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qurey()" <el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
>查询</el-button <el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
>
<el-button
type="primary"
icon="el-icon-refresh-right"
@click="reset()"
>重置</el-button
>
<el-button <el-button
type="success" type="success"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click="addincome()" @click="addincome()"
v-if="state != 0" v-if="state != 0"
>新增收入</el-button >新增收入</el-button>
>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -61,28 +47,39 @@ ...@@ -61,28 +47,39 @@
:data="incomeList" :data="incomeList"
style="width: 100%; text-align: center" style="width: 100%; text-align: center"
border border
: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"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-form label-position="left" class="demo-table-expand"> <el-descriptions
<el-form-item label="收入详情:"> class="margin-top"
<span>{{ props.row.incomeInformation }}</span> title="关于项目"
</el-form-item> :column="1"
<el-form-item label="收入备注:"> style="width:40%; margin:20px 20px"
border
>
<el-descriptions-item label="收入附言:">
<span>{{ props.row.incomeRemarks }}</span> <span>{{ props.row.incomeRemarks }}</span>
</el-form-item> </el-descriptions-item>
</el-form> <el-descriptions-item label="收入详情:">
<span>{{ props.row.incomeInformation }}</span>
</el-descriptions-item>
<el-descriptions-item label="发票文件:">
<el-button type="primary" size="mini" @click="ReviseImage(props.row)">点击查看</el-button>
</el-descriptions-item>
<el-descriptions-item label="附件下载">
<el-button type="success" size="mini" @click="selectImage(props.row)">点击查看</el-button>
</el-descriptions-item>
</el-descriptions>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="序号" width="50px"> <el-table-column label="序号" width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
(incomeQurey.pageNum - 1) * incomeQurey.pageSize + (incomeQurey.pageNum - 1) * incomeQurey.pageSize +
scope.$index + scope.$index +
1 1
}} }}
</template> </template>
</el-table-column> </el-table-column>
...@@ -99,27 +96,6 @@ ...@@ -99,27 +96,6 @@
<el-table-column prop="incomeBody" label="收入内容" /> <el-table-column prop="incomeBody" label="收入内容" />
<el-table-column prop="incomeTime" label="收入时间" /> <el-table-column prop="incomeTime" label="收入时间" />
<el-table-column prop="prop" label="发票文件">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="ReviseImage(scope.row)"
>点击查看</el-button
>
</template>
</el-table-column>
<el-table-column prop="prop" label="附件下载">
<template slot-scope="scope">
<el-button
type="success"
size="mini"
@click="selectImage(scope.row)"
>点击查看</el-button
>
</template>
</el-table-column>
<el-table-column label="操作人员"> <el-table-column label="操作人员">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag effect="plain">{{ scope.row.userName }}</el-tag> <el-tag effect="plain">{{ scope.row.userName }}</el-tag>
...@@ -134,8 +110,7 @@ ...@@ -134,8 +110,7 @@
icon="el-icon-edit" icon="el-icon-edit"
type="info" type="info"
@click="updatain(scope.row)" @click="updatain(scope.row)"
>修改信息</el-button >修改信息</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -154,39 +129,20 @@ ...@@ -154,39 +129,20 @@
<!--发票抽屉--> <!--发票抽屉-->
<div> <div>
<el-drawer <el-drawer title="发票详情" :visible.sync="drawer" :direction="direction" size="50%">
title="发票详情"
:visible.sync="drawer"
:direction="direction"
size="60%"
>
<!-- filePath--> <!-- filePath-->
<el-button type="primary" style="margin: 10px 3%" @click="selectGet()"
>添加收入发票</el-button
>
<el-table <el-table
:data="getinvoivelist" :data="getinvoivelist"
style="width: 94%; margin: 10px 3%; text-align: center" style="width: 90%; margin:10px 5%; text-align: center"
border border
: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 <el-table-column type="index" label="序号" width="80px"></el-table-column>
type="index" <el-table-column prop="code" label="发票代码"></el-table-column>
label="序号" <el-table-column prop="number" label="发票号码" ></el-table-column>
width="80px" <el-table-column prop="mone" label="发票金额"></el-table-column>
></el-table-column> <el-table-column prop="prop" label="查看PDF文件或图片">
<el-table-column
prop="number"
label="号码"
width="160px"
></el-table-column>
<el-table-column
prop="mone"
label="金额"
width="180px"
></el-table-column>
<el-table-column prop="prop" label="查看PDF文件或图片" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formatProtocolType(scope.row)"> <div v-if="formatProtocolType(scope.row)">
<el-image <el-image
...@@ -196,133 +152,48 @@ ...@@ -196,133 +152,48 @@
></el-image> ></el-image>
</div> </div>
<div v-else> <div v-else>
<a class="a-style" @click="handlePreView(scope.row)" <a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
>点击查看文件</a
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="操作">
<template slot-scope="scope">
<el-popover
placement="top"
width="60"
v-model="scope.row.visible"
>
<p>确定要删除该发票吗</p>
<div style="text-align: right; margin: 0">
<el-button
size="mini"
type="text"
@click="scope.row.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="DeleteFrom(scope.row)"
>确定</el-button
>
</div>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
slot="reference"
></el-button>
</el-popover>
</template>
</el-table-column>
</el-table> </el-table>
</el-drawer> </el-drawer>
</div> </div>
<!-- 添加发票对话框 -->
<div>
<el-dialog title="添加发票" :visible.sync="dialogFormVisible" width="40%">
<div class="dialog-footer">
<div class="selectList">
<el-select
v-model="getListincom"
multiple
filterable
default-first-option
style="width: 100%"
placeholder="请选择要添加的发票编号"
>
<el-option
v-for="item in invoiceListAdd"
:key="item.invoiceId"
:label="item.number"
:value="item.invoiceId"
></el-option>
</el-select>
</div>
<div slot="footer">
<el-button @click="Buttonback1()">取 消</el-button>
<el-button type="primary" @click="Buttonback2()">确 定</el-button>
</div>
</div>
</el-dialog>
</div>
<!-- 附件抽屉 --> <!-- 附件抽屉 -->
<div> <div>
<el-drawer <el-drawer title="附件操作" :visible.sync="drawer2" :direction="direction" size="50%">
title="附件操作"
:visible.sync="drawer2"
:direction="direction"
size="50%"
>
<el-button <el-button
type="primary" type="primary"
style="margin-left: 5%; margin-top: 40px" style=" margin-left:5%;margin-top:40px "
:disabled="disabled" :disabled="disabled"
@click="updatecard" @click="updatecard"
>添加附件</el-button >添加附件</el-button>
>
<el-card <el-card
class="box-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"
> >
<el-row class="row-bg"> <el-row class="row-bg">
<div <div v-for="index in queryDTOList" :key="index.enclosureId" class="lsitall">
v-for="index in queryDTOList"
:key="index.enclosureId"
class="lsitall"
>
<el-col :span="10"> <el-col :span="10">
<div style="margin-top: 6px; margin-left: 40px"> <div style=" margin-top: 6px;margin-left:40px">附件{{index.enclosureId}}</div>
附件{{ index.enclosureId }}
</div>
</el-col> </el-col>
<el-col :span="12" style="margin-left: -50px"> <el-col :span="12" style="margin-left:-50px">
<el-button <el-button
type="primary" type="primary"
icon="el-icon-folder-checked" icon="el-icon-folder-checked"
class="a-style" class="a-style"
size="mini" size="mini"
style="font-size: 13px" style=" font-size: 13px"
@click="delProject(index)" @click="delProject(index)"
>下载</el-button >下载</el-button>
>
<el-popover placement="top" width="160" v-model="index.visible"> <el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p> <p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button <el-button size="mini" type="text" @click="index.visible= false">取消</el-button>
size="mini" <el-button type="primary" size="mini" @click="deleteProject(index)">确定</el-button>
type="text"
@click="index.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="deleteProject(index)"
>确定</el-button
>
</div> </div>
<el-button <el-button
type="danger" type="danger"
...@@ -331,8 +202,7 @@ ...@@ -331,8 +202,7 @@
size="mini " size="mini "
style="font-size: 13px" style="font-size: 13px"
slot="reference" slot="reference"
>删除</el-button >删除</el-button>
>
</el-popover> </el-popover>
</el-col> </el-col>
</div> </div>
...@@ -341,16 +211,16 @@ ...@@ -341,16 +211,16 @@
<!-- 附件上传 --> <!-- 附件上传 -->
<el-card <el-card
class="box-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"
> >
<div style="width: 60%; margin-left: 30px"> <div style="width:60%;margin-left:30px">
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
placeholder="请输入附件详情" placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe" v-model="proutlist1.enclosureDescribe"
style="margin: 20px 0px" style="margin:20px 0px;"
></el-input> ></el-input>
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -364,30 +234,23 @@ ...@@ -364,30 +234,23 @@
:on-success="Refresh" :on-success="Refresh"
:data="proutlist1" :data="proutlist1"
multiple multiple
style="margin: 20px 0px" style="margin:20px 0px;"
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text"> <div class="el-upload__text">
将文件拖到此处,或 将文件拖到此处,或
<em>点击上传附件</em> <em>点击上传附件</em>
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
只能上传文件,且不超过500kb
</div>
</el-upload> </el-upload>
</div> </div>
<div style="margin-left: 75%"> <div style="margin-left:75%;">
<el-button @click="remove()">取 消</el-button> <el-button @click="remove()">取 消</el-button>
<el-button <el-button type="primary" @click="determine()" style="margin-top:20px;">确 定</el-button>
type="primary"
@click="determine()"
style="margin-top: 20px"
>确 定</el-button
>
</div> </div>
</el-card> </el-card>
<div class="box-card" v-show="getshow == 3"></div> <div class="box-card" v-show="getshow==3"></div>
</el-drawer> </el-drawer>
</div> </div>
</div> </div>
...@@ -396,14 +259,7 @@ ...@@ -396,14 +259,7 @@
<script> <script>
import { selectByProjectId } from "@/api/imcome"; import { selectByProjectId } from "@/api/imcome";
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { import { selectAllById, selectByIdF, deleteById } from "@/api/project";
selectAllById,
selectByIdF,
selectAllBystatus,
updatesubmit,
deletBystatus,
deleteById,
} from "@/api/project";
import { componentMap } from "../../../router"; import { componentMap } from "../../../router";
import { getFileUrl } from "@/api/companyFile"; import { getFileUrl } from "@/api/companyFile";
...@@ -417,13 +273,12 @@ const InitialData = { ...@@ -417,13 +273,12 @@ const InitialData = {
incomeType: null, incomeType: null,
projectId: null, projectId: null,
userId: null, userId: null,
projectName: null, projectName: null
}; };
export default { export default {
data() { data() {
return { return {
visible: false,
incomeQurey: { incomeQurey: {
projectId: null, projectId: null,
pageNum: 1, pageNum: 1,
...@@ -432,7 +287,7 @@ export default { ...@@ -432,7 +287,7 @@ export default {
incomeType: null, incomeType: null,
incomeBody: null, incomeBody: null,
incomeTimeStart: null, incomeTimeStart: null,
incomeTimeEnd: null, incomeTimeEnd: null
}, },
incomeList: [], incomeList: [],
options: [], options: [],
...@@ -446,30 +301,21 @@ export default { ...@@ -446,30 +301,21 @@ export default {
//查询图片给的值 //查询图片给的值
getinvoiveId: { getinvoiveId: {
companyId: null, companyId: null,
incomeId: 0, incomeId: 0
}, },
//图片的数组 //图片的数组
getinvoivelist: [], getinvoivelist: [],
//图片数组
srcList: [], srcList: [],
backid: null, backid: null,
//查询附件 //查询附件
queryDTO: { queryDTO: {
companyId: null, companyId: null,
incomeId: null, incomeId: null
}, },
queryDTOList: [], //收集附件的数据 queryDTOList: [], //收集附件的数据
//附件抽屉 //附件抽屉
drawer2: false, drawer2: false,
//发票对话框 //发票对话框
dialogFormVisible: false,
invoiceListAdd: [], //查询发票的集合
getFormslist: {
userId: null,
companyId: null,
type: 0,
}, //查询的能选择的表单信息
getListincom: [], //收集选择的数组
incomeIdgrt: null, //收集incomeId数据 incomeIdgrt: null, //收集incomeId数据
getshow: 1, //判断show的显示与隐藏, getshow: 1, //判断show的显示与隐藏,
//合同文件上传携带参数 //合同文件上传携带参数
...@@ -478,24 +324,23 @@ export default { ...@@ -478,24 +324,23 @@ export default {
enclosureDescribe: "", enclosureDescribe: "",
status: 0, //0收入 1支出 status: 0, //0收入 1支出
companyId: null, companyId: null,
userId: null, userId: null
}, },
fileTypepdf: false, //判断合同文件是否存在 fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //合同文件 fileList1: [], //合同文件
disabled: false, //隐藏, disabled: false //隐藏,
}; };
}, },
computed: { computed: {
state: function () { state: function() {
return this.$route.query.state; return this.$route.query.state;
}, }
}, },
created() { created() {
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.incomeQurey.projectId = this.$route.query.id; this.incomeQurey.projectId = this.$route.query.id;
this.backid = this.$route.query.backid; this.backid = this.$route.query.backid;
this.queryDTO.companyId = this.$store.getters.companyId; this.queryDTO.companyId = this.$store.getters.companyId;
this.getFormslist.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.getIncome(); this.getIncome();
this.getTypeList(); this.getTypeList();
...@@ -505,24 +350,24 @@ export default { ...@@ -505,24 +350,24 @@ export default {
getTypeList() { getTypeList() {
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
typeCategory: 0, typeCategory: 0
}; };
selectAll(param) selectAll(param)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.options = res.data; this.options = res.data;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取类型失败"); this.$message.error("获取类型失败");
}); });
}, },
//获取收入情况 //获取收入情况
getIncome() { getIncome() {
selectByProjectId(this.incomeQurey) selectByProjectId(this.incomeQurey)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.incomeList = res.data.list; this.incomeList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
...@@ -530,7 +375,7 @@ export default { ...@@ -530,7 +375,7 @@ export default {
this.$message.errror(res.msg); this.$message.errror(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("查询数据失败"); this.$message.error("查询数据失败");
}); });
}, },
...@@ -607,8 +452,8 @@ export default { ...@@ -607,8 +452,8 @@ export default {
path: "/incomeAdd", path: "/incomeAdd",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backid: this.backid, backid: this.backid
}, }
}); });
}, },
//查看项目附件..... //查看项目附件.....
...@@ -616,7 +461,7 @@ export default { ...@@ -616,7 +461,7 @@ export default {
this.queryDTO.incomeId = row.incomeId; this.queryDTO.incomeId = row.incomeId;
this.proutlist1.Id = row.incomeId; this.proutlist1.Id = row.incomeId;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.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) {
...@@ -632,7 +477,7 @@ export default { ...@@ -632,7 +477,7 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取附件文件失败"); this.$message.error("获取附件文件失败");
}); });
}, },
...@@ -640,21 +485,22 @@ export default { ...@@ -640,21 +485,22 @@ export default {
ReviseImage(row) { ReviseImage(row) {
this.drawer = true; this.drawer = true;
this.getinvoiveId.incomeId = row.incomeId; this.getinvoiveId.incomeId = row.incomeId;
console.log(this.getinvoiveId.incomeId);
this.incomeIdgrt = row.incomeId; this.incomeIdgrt = row.incomeId;
this.Selectinsertlsit(); this.Selectinsertlsit();
}, },
//查询发票图片 //查询发票图片
Selectinsertlsit() { Selectinsertlsit() {
selectAllById(this.getinvoiveId) selectAllById(this.getinvoiveId)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
res.data.forEach((e) => { res.data.forEach(e => {
let fileNamepdf = e.filePath; let fileNamepdf = e.filePath;
console.log(fileNamepdf); console.log(fileNamepdf);
let fileType = fileNamepdf.substring( let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".") fileNamepdf.lastIndexOf(".")
); );
getFileUrl(e.filePath).then((res) => { getFileUrl(e.filePath).then(res => {
if (res.success) { if (res.success) {
let url = res.data; let url = res.data;
e.fileUrl = url; e.fileUrl = url;
...@@ -671,7 +517,7 @@ export default { ...@@ -671,7 +517,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch((error) => { .catch(error => {
console.log(error); console.log(error);
this.$message.error("获取发票图片失败"); this.$message.error("获取发票图片失败");
this.back(); this.back();
...@@ -684,34 +530,32 @@ export default { ...@@ -684,34 +530,32 @@ export default {
query: { query: {
id: data.incomeId, id: data.incomeId,
projectId: this.$route.query.id, projectId: this.$route.query.id,
}, backid: this.backid
}
}); });
}, },
//返回开始 //返回开始
back() { back() {
if (this.backid == 0) { if (this.backid == 0) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ this.$router.push({
path: "/projectList", path: "/projectList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id
}, }
}); });
} else if (this.backid == 1) { } else if (this.backid == 1) {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ this.$router.push({
path: "/beresponsibleforList", path: "/beresponsibleforList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id
}, }
}); });
} else { } else {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ this.$router.push({
path: "/participateinList", path: "/participateinList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id
}, }
}); });
} }
}, },
...@@ -724,7 +568,7 @@ export default { ...@@ -724,7 +568,7 @@ export default {
//下载附件 //下载附件
delProject(row) { delProject(row) {
getFileUrl(row.enclosureFile) getFileUrl(row.enclosureFile)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
let url = res.data; let url = res.data;
console.log(url); console.log(url);
...@@ -739,84 +583,10 @@ export default { ...@@ -739,84 +583,10 @@ export default {
this.$message.error("下载失败"); this.$message.error("下载失败");
} }
}) })
.catch((e) => { .catch(e => {
this.$message.error(e.msg); this.$message.error(e.msg);
}); });
}, },
//查询未报销发票
selectGet() {
this.dialogFormVisible = true;
this.getFormslist.userId = this.$store.getters.urId;
selectAllBystatus(this.getFormslist)
.then((res) => {
if (res.success) {
this.invoiceListAdd = res.data;
} else {
this.$message.error(res.msg);
this.back();
}
})
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
},
//确定与取消
Buttonback1() {
this.selectGet();
this.dialogFormVisible = false;
this.getListincom = [];
},
Buttonback2() {
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.getListincom.forEach((item) => {
list.push({
invoiceId: item,
incomeId: this.incomeIdgrt,
status: 1,
});
});
updatesubmit(list).then((res) => {
if (res.success) {
this.$message.success(res.msg);
this.dialogFormVisible = false;
this.$message({
showClose: true,
message: "添加发票成功",
type: "success",
});
this.Selectinsertlsit();
this.getListincom = [];
} else {
this.$message.error(res.msg);
}
});
},
//删除发票
DeleteFrom(row) {
//收集被删除发票的数据
let BillList = {
invoiceId: row.invoiceId,
incomeId: row.incomeId,
};
deletBystatus(BillList)
.then((res) => {
if (res.success) {
this.visible = false;
this.$message({
message: "删除成功",
type: "success",
});
this.Selectinsertlsit();
}
})
.catch((errror) => {
this.$message.error(res.msg);
});
},
// 附件-------0----------- // 附件-------0-----------
//显示添加附件 //显示添加附件
...@@ -828,23 +598,23 @@ export default { ...@@ -828,23 +598,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;
} }
}) })
.catch((errror) => { .catch(errror => {
this.$message.error(res.msg); this.$message.error(res.msg);
}); });
}, },
//清除附件文件 //清除附件文件
delfile1(file) { delfile1(file) {
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid); this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.proutlist1.enclosureDescribe = ""; //初始化数据 this.proutlist1.enclosureDescribe = ""; //初始化数据
this.fileTypepdf = false; this.fileTypepdf = false;
}, },
...@@ -860,7 +630,7 @@ export default { ...@@ -860,7 +630,7 @@ export default {
this.$message({ this.$message({
showClose: true, showClose: true,
message: "上传附件成功", message: "上传附件成功",
type: "success", type: "success"
}); });
this.Refresh(); this.Refresh();
} else { } else {
...@@ -872,7 +642,7 @@ export default { ...@@ -872,7 +642,7 @@ export default {
this.queryDTO.incomeId = this.proutlist1.Id; this.queryDTO.incomeId = this.proutlist1.Id;
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.queryDTOList = res.data; this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据 this.proutlist1.enclosureDescribe = ""; //初始化数据
...@@ -880,7 +650,7 @@ export default { ...@@ -880,7 +650,7 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取附件文件失败"); this.$message.error("获取附件文件失败");
}); });
}, },
...@@ -922,8 +692,8 @@ export default { ...@@ -922,8 +692,8 @@ export default {
return false; return false;
} }
} }
}, }
}, }
}; };
</script> </script>
......
<template> <template>
<div class="container"> <div class="container">
<el-row> <el-row>
<el-col :xl="8" :lg="8" :md="8" :sm="12" :xs="24"> <el-col :xl="8" :lg="8" :md="8" :sm="12" :xs="24" style="margin:20px 30px;">
<el-form <el-form ref="form" :model="incomeFrom" label-width="120px" :rules="rules">
ref="form"
:model="incomeFrom"
label-width="120px"
:rules="rules"
>
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input v-model="incomeFrom.projectName" disabled></el-input> <el-input v-model="incomeFrom.projectName" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收入类别" prop="incomeType"> <el-form-item label="收入类别" prop="incomeType">
<el-select v-model="incomeFrom.incomeType" placeholder="请选择"> <el-select v-model="incomeFrom.incomeType" placeholder="请选择">
<el-option <el-option
...@@ -19,8 +13,7 @@ ...@@ -19,8 +13,7 @@
:key="item.typeId" :key="item.typeId"
:label="item.typeName" :label="item.typeName"
:value="item.typeId" :value="item.typeId"
> ></el-option>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -34,8 +27,7 @@ ...@@ -34,8 +27,7 @@
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
@change="timestampToTime()" @change="timestampToTime()"
> ></el-date-picker>
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="收入对象" prop="incomeObject"> <el-form-item label="收入对象" prop="incomeObject">
...@@ -58,22 +50,71 @@ ...@@ -58,22 +50,71 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
type="success" <el-button type="danger" icon="el-icon-delete-solid" @click="deleteIncome()">删除</el-button>
icon="el-icon-upload2"
@click="submitForm()"
>提交</el-button
>
<el-button
type="danger"
icon="el-icon-delete-solid"
@click="deleteIncome()"
>删除</el-button
>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
<el-col :xl="8" :lg="10" :md="12" :sm="12" :xs="24" style="margin:10px 130px;">
<div>
<h3>发票编辑</h3>
<div>
<div class="selectList" style="margin:20px 0px">
<el-select
v-model="getListincom"
multiple
filterable
default-first-option
style="width:220px;"
placeholder="请选择要添加的发票编号"
@change="getchange()"
>
<el-option
v-for="item in invoiceListAdd"
:key="item.invoiceId"
:label="item.number"
:value="item.invoiceId"
></el-option>
</el-select>
<el-button type="primary" @click="Buttonback2()" style="margin:0px 5px">添加发票</el-button>
</div>
</div>
<div>
<el-table
:data="getinvoivelist"
border
style="width: 100%"
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center', background:'#eef1f6',color:'#606266'}"
class="gettable"
>
<el-table-column prop="code" label="发票代码"></el-table-column>
<el-table-column prop="number" label="发票号码"></el-table-column>
<el-table-column prop="mone" label="发票金额"></el-table-column>
<el-table-column prop="prop" label="操作">
<template slot-scope="scope">
<el-popover placement="top" width="60" v-model="scope.row.visible">
<p>确定要删除该发票吗</p>
<div style="text-align: right; margin:0">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="DeleteFrom(scope.row)">确定</el-button>
</div>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
slot="reference"
class="edit"
>删除</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
...@@ -82,6 +123,13 @@ ...@@ -82,6 +123,13 @@
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { update, selectById, del } from "@/api/imcome"; import { update, selectById, del } from "@/api/imcome";
import { money } from "@/utils/myValidate"; import { money } from "@/utils/myValidate";
import {
selectAllBystatus,
updatesubmit,
selectAllById,
deletBystatus
} from "@/api/project";
import { mapGetters } from "vuex";
export default { export default {
data() { data() {
return { return {
...@@ -95,16 +143,16 @@ export default { ...@@ -95,16 +143,16 @@ export default {
incomeType: null, incomeType: null,
projectId: null, projectId: null,
userId: null, userId: null,
projectName: null, projectName: null
}, },
typeList: [], typeList: [],
projectData: {}, projectData: {},
rules: { rules: {
projectName: [ projectName: [
{ required: true, message: "请选择项目", trigger: "change" }, { required: true, message: "请选择项目", trigger: "change" }
], ],
incomeType: [ incomeType: [
{ required: true, message: "请选择收入类型", trigger: "change" }, { required: true, message: "请选择收入类型", trigger: "change" }
], ],
incomeMoney: [ incomeMoney: [
{ {
...@@ -113,30 +161,38 @@ export default { ...@@ -113,30 +161,38 @@ export default {
} }
], ],
incomeTime: [ incomeTime: [
{ required: true, message: "请选择收入时间", trigger: "change" }, { required: true, message: "请选择收入时间", trigger: "change" }
], ]
}, },
getListincom: [], //收集选择的数组
invoiceListAdd: [], //查询发票的集合
//图片的数组
getinvoivelist: [],
visible: false
}; };
}, },
computed: { computed: {
...mapGetters(["companyId", "urId"]),
incomeId() { incomeId() {
return this.$route.query.id; return this.$route.query.id;
}, }
}, },
created() { created() {
this.incomeFrom.userId = this.$store.getters.urId; this.incomeFrom.userId = this.$store.getters.urId;
this.getTypeList(); this.getTypeList();
this.getIncome(); this.getIncome();
this.selectGet();
this.Selectinsertlsit();
}, },
methods: { methods: {
//获取收入类型 //获取收入类型
getTypeList() { getTypeList() {
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
typeCategory: 0, typeCategory: 0
}; };
selectAll(param) selectAll(param)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.typeList = res.data; this.typeList = res.data;
} else { } else {
...@@ -144,7 +200,7 @@ export default { ...@@ -144,7 +200,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取类型失败"); this.$message.error("获取类型失败");
this.back(); this.back();
}); });
...@@ -152,7 +208,7 @@ export default { ...@@ -152,7 +208,7 @@ export default {
//获取收入信息 //获取收入信息
getIncome() { getIncome() {
selectById({ incomeId: this.incomeId }) selectById({ incomeId: this.incomeId })
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.incomeFrom = res.data; this.incomeFrom = res.data;
this.incomeFrom.userId = this.$store.getters.urId; this.incomeFrom.userId = this.$store.getters.urId;
...@@ -161,17 +217,17 @@ export default { ...@@ -161,17 +217,17 @@ export default {
this.back(); this.back();
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("获取信息失败"); this.$message.error("获取信息失败");
this.back(); this.back();
}); });
}, },
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
update(this.incomeFrom) update(this.incomeFrom)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.back(); this.back();
...@@ -179,7 +235,7 @@ export default { ...@@ -179,7 +235,7 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("新建失败"); this.$message.error("新建失败");
}); });
} }
...@@ -192,7 +248,8 @@ export default { ...@@ -192,7 +248,8 @@ export default {
path: "/incomeList", path: "/incomeList",
query: { query: {
id: this.$route.query.projectId, id: this.$route.query.projectId,
}, backid: this.$route.query.backid
}
}); });
}, },
//时间处理 yyyy-MM-dd hh:mm:ss //时间处理 yyyy-MM-dd hh:mm:ss
...@@ -219,11 +276,11 @@ export default { ...@@ -219,11 +276,11 @@ export default {
this.$confirm("确定要删除此收入记录吗", "提示", { this.$confirm("确定要删除此收入记录吗", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning"
}) })
.then(() => { .then(() => {
del(this.incomeFrom) del(this.incomeFrom)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.back(); this.back();
...@@ -231,18 +288,133 @@ export default { ...@@ -231,18 +288,133 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch(error => {
this.$message.error("删除失败"); this.$message.error("删除失败");
}); });
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "已取消删除", message: "已取消删除"
}); });
}); });
}, },
}, //查询未报销发票
selectGet() {
const params = {
companyId: this.companyId,
userId: this.urId,
type: 0
};
selectAllBystatus(params)
.then(res => {
if (res.success) {
this.invoiceListAdd = res.data;
} else {
this.$message.error(res.msg);
this.back();
}
})
.catch(error => {
this.$message.error("获取发票编号失败");
this.back();
});
},
//确定提交发票
Buttonback2() {
if (this.getListincom.length > 0) {
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.getListincom.forEach(item => {
list.push({
invoiceId: item,
incomeId: this.incomeId,
status: 1
});
});
updatesubmit(list).then(res => {
if (res.success) {
this.$message.success(res.msg);
this.Selectinsertlsit();
this.getListincom = [];
} else {
this.$message.error(res.msg);
}
});
} else {
this.$message({
showClose: true,
message: "没有添加发票",
type: "warning"
});
}
},
//查询发票图片
Selectinsertlsit() {
const params = {
companyId: this.companyId,
incomeId: this.incomeId
};
selectAllById(params)
.then(res => {
if (res.success) {
this.getinvoivelist = res.data;
} else {
this.$message.error(res.msg);
this.back();
}
})
.catch(error => {
this.$message.error("获取发票图片失败");
this.back();
});
},
//删除发票
DeleteFrom(row) {
let get = this.incomeFrom.incomeMoney;
get -= row.mone;
console.log(get);
this.incomeFrom.incomeMoney = get;
//收集被删除发票的数据
let BillList = {
invoiceId: row.invoiceId,
incomeId: row.incomeId
};
deletBystatus(BillList)
.then(res => {
if (res.success) {
this.visible = false;
this.$message({
message: "删除发票状态成功",
type: "success"
});
this.selectGet();
this.Selectinsertlsit();
}
})
.catch(errror => {
this.$message.error(res.msg);
});
},
//添加发票金额
getchange() {
let sum = 0;
let list = [];
this.getListincom.forEach(g => {
this.invoiceListAdd.forEach(item => {
if (item.invoiceId == g) {
list.push({
mone: item.mone
});
}
});
});
list.forEach(item => {
sum += item.mone;
});
this.incomeFrom.incomeMoney = sum;
}
}
}; };
</script> </script>
...@@ -250,4 +422,7 @@ export default { ...@@ -250,4 +422,7 @@ export default {
.container { .container {
padding: 10px; padding: 10px;
} }
.edit {
font-size: 11px;
}
</style> </style>
\ No newline at end of file
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
//查询员工,得到初始员工值 //查询员工,得到初始员工值
secletAllStaff({ companyId: this.$store.getters.companyId }) secletAllStaff({ companyId: this.$store.getters.companyId })
.then(res => { .then(res => {
if (res.status == "success") { if (res.success) {
this.staffList = res.data; this.staffList = res.data;
//数据整理,排除项目负责人 //数据整理,排除项目负责人
selectAllByProjectId({ projectId: this.projectId }) selectAllByProjectId({ projectId: this.projectId })
......
...@@ -26,14 +26,19 @@ ...@@ -26,14 +26,19 @@
> >
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-form label-position="left" class="demo-table-expand"> <el-descriptions
<el-form-item label="合作方:"> class="margin-top"
<span>{{ props.row.projectPartyb }}</span> title="关于项目"
</el-form-item> :column="1"
<el-form-item label="项目详情:"> :size="medium"
style="width:40%; margin:20px 20px"
border
>
<el-descriptions-item label="合作方:">{{ props.row.projectPartyb }}</el-descriptions-item>
<el-descriptions-item label="项目详情:">
<span>{{ props.row.projectInformation }}</span> <span>{{ props.row.projectInformation }}</span>
</el-form-item> </el-descriptions-item>
</el-form> </el-descriptions>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
getRoleList() { getRoleList() {
selectAllByCompanyId({ companyId: this.$store.getters.companyId }) selectAllByCompanyId({ companyId: this.$store.getters.companyId })
.then(res => { .then(res => {
if (res.status == "success") { if (res.success) {
this.rolesList = res.data; this.rolesList = res.data;
} else { } else {
this.$message.error(res.data); this.$message.error(res.data);
......
...@@ -27,14 +27,30 @@ ...@@ -27,14 +27,30 @@
> >
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-form label-position="left" class="demo-table-expand"> <el-descriptions
<el-form-item label="合作方:"> class="margin-top"
<span>{{ props.row.projectPartyb }}</span> title="关于项目"
</el-form-item> :column="1"
<el-form-item label="项目详情:"> style="width:60%; margin:20px 20px"
border
>
<el-descriptions-item
label="合作方:"
:labelStyle="{'width':'120px'}"
>{{ props.row.projectPartyb }}</el-descriptions-item>
<el-descriptions-item label="项目详情:">
<span>{{ props.row.projectInformation }}</span> <span>{{ props.row.projectInformation }}</span>
</el-form-item> </el-descriptions-item>
</el-form> <el-descriptions-item label="更改项目负责人:">
<el-button
style="margin:5px"
size="mini"
icon="el-icon-coin"
type="primary"
@click="member(props.row)"
>负责人管理</el-button>
</el-descriptions-item>
</el-descriptions>
</template> </template>
</el-table-column> </el-table-column>
...@@ -104,13 +120,6 @@ ...@@ -104,13 +120,6 @@
type="info" type="info"
@click="updataProject(scope.row)" @click="updataProject(scope.row)"
>修改信息</el-button> >修改信息</el-button>
<el-button
style="margin:5px"
size="mini"
icon="el-icon-coin"
type="primary"
@click="member(scope.row)"
>负责人管理</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -268,4 +277,8 @@ export default { ...@@ -268,4 +277,8 @@ export default {
font-weight: 600; font-weight: 600;
font-size: 15px; font-size: 15px;
} }
.my-label {
width: 100px;
background: #fde2e2;
}
</style> </style>
\ No newline at end of file
import { money } from "@/utils/myValidate";
//表单验证内容
export const expendAdd = {
expendMoney: [
{
required: true,
validator: money,
trigger: "change"
}
],
expendTime: [
{ required: true, message: "请选择支出时间", trigger: "change" }
],
expendType: [
{ required: true, message: "请输入支出类别", trigger: "change" }
],
expendObject: [
{ required: true, message: "请输入支出对象", trigger: "change" }
],
expendBody: [
{ required: true, message: "请输入支出用途", trigger: "change" }
],
number: [
{ required: true, message: "请输入发票号码", trigger: "change" }
],
code: [{ required: true, message: "请输入发票代码", trigger: "change" }]
}
export const incomeAdd = {
projectName: [
{ required: true, message: "请选择项目", trigger: "change" }
],
incomeType: [
{ required: true, message: "请选择收入类型", trigger: "change" }
],
incomeObject: [
{ required: true, message: "没有输入对方户名", trigger: "change" }
],
incomeBody: [
{ required: true, message: "没有输入对收入内容", trigger: "change" }
],
incomeMoney: [
{
required: true,
validator: money,
trigger: "change"
}
],
incomeTime: [
{ required: true, message: "请选择收到时间", trigger: "change" }
]
}
\ No newline at end of file
...@@ -522,7 +522,7 @@ ...@@ -522,7 +522,7 @@
</div> </div>
</el-card> </el-card>
<div class="box-card" v-show="getshow == 3"></div> <div class="box-card" v-show="getshow == 3"> <el-empty description="没有附件哦!"></el-empty></div>
</el-drawer> </el-drawer>
</div> </div>
</div> </div>
...@@ -698,6 +698,12 @@ export default { ...@@ -698,6 +698,12 @@ export default {
//获取数据 //获取数据
this.reimbursementDetails.list = res.data; this.reimbursementDetails.list = res.data;
this.$message.success(res.msg); this.$message.success(res.msg);
}else{
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -717,6 +723,12 @@ export default { ...@@ -717,6 +723,12 @@ export default {
//获取数据 //获取数据
this.financeList.list = res.data; this.financeList.list = res.data;
// this.$message.success(res.msg); // this.$message.success(res.msg);
}else{
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -742,6 +754,11 @@ export default { ...@@ -742,6 +754,11 @@ export default {
this.total = res.data.total; this.total = res.data.total;
} 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) => { .catch((error) => {
...@@ -800,6 +817,11 @@ export default { ...@@ -800,6 +817,11 @@ export default {
this.getReimbursement(); this.getReimbursement();
} 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) => { .catch((error) => {
...@@ -846,6 +868,11 @@ export default { ...@@ -846,6 +868,11 @@ export default {
this.getReimbursement(); this.getReimbursement();
} 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) => { .catch((error) => {
...@@ -917,6 +944,11 @@ export default { ...@@ -917,6 +944,11 @@ export default {
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -1043,6 +1075,11 @@ export default { ...@@ -1043,6 +1075,11 @@ export default {
} }
} 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) => { .catch((error) => {
...@@ -1079,6 +1116,12 @@ export default { ...@@ -1079,6 +1116,12 @@ export default {
}); });
this.visible = false; this.visible = false;
console.log(res.msg); console.log(res.msg);
}else{
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((errror) => { .catch((errror) => {
...@@ -1108,6 +1151,11 @@ export default { ...@@ -1108,6 +1151,11 @@ export default {
this.Refresh(); this.Refresh();
} else { } else {
this.$message.error("请添加附件,在进行提交"); this.$message.error("请添加附件,在进行提交");
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}, },
//刷新附件 //刷新附件
...@@ -1122,6 +1170,11 @@ export default { ...@@ -1122,6 +1170,11 @@ export default {
this.proutlist1.enclosureDescribe = ""; //初始化数据 this.proutlist1.enclosureDescribe = ""; //初始化数据
} 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) => { .catch((error) => {
...@@ -1158,6 +1211,12 @@ export default { ...@@ -1158,6 +1211,12 @@ export default {
deletBystatus(data).then((res) => { deletBystatus(data).then((res) => {
if (res.success) { if (res.success) {
this.getinvoive(data); this.getinvoive(data);
}else{
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}); });
}, },
......
...@@ -426,7 +426,7 @@ ...@@ -426,7 +426,7 @@
</div> </div>
</el-card> </el-card>
<div class="box-card" v-show="getshow == 3"></div> <div class="box-card" v-show="getshow == 3"> <el-empty description="没有附件哦!"></el-empty></div>
</el-drawer> </el-drawer>
</div> </div>
</div> </div>
...@@ -587,6 +587,12 @@ export default { ...@@ -587,6 +587,12 @@ export default {
//获取数据 //获取数据
this.reimbursementDetails.list = res.data; this.reimbursementDetails.list = res.data;
this.$message.success(res.msg); this.$message.success(res.msg);
}else{
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -602,6 +608,11 @@ export default { ...@@ -602,6 +608,11 @@ export default {
this.total = res.data.total; this.total = res.data.total;
} 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) => { .catch((error) => {
...@@ -634,6 +645,11 @@ export default { ...@@ -634,6 +645,11 @@ export default {
this.getReimbursement(); this.getReimbursement();
} 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) => { .catch((error) => {
...@@ -677,6 +693,11 @@ export default { ...@@ -677,6 +693,11 @@ export default {
this.getReimbursement(); this.getReimbursement();
} 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) => { .catch((error) => {
...@@ -747,6 +768,11 @@ export default { ...@@ -747,6 +768,11 @@ export default {
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -774,6 +800,11 @@ export default { ...@@ -774,6 +800,11 @@ export default {
} }
} 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) => { .catch((error) => {
...@@ -811,6 +842,12 @@ export default { ...@@ -811,6 +842,12 @@ export default {
}); });
this.visible = false; this.visible = false;
console.log(res.msg); console.log(res.msg);
}else{
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((errror) => { .catch((errror) => {
...@@ -840,6 +877,11 @@ export default { ...@@ -840,6 +877,11 @@ export default {
this.Refresh(); this.Refresh();
} else { } else {
this.$message.error("请添加附件,在进行提交"); this.$message.error("请添加附件,在进行提交");
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}, },
//刷新附件 //刷新附件
...@@ -854,6 +896,11 @@ export default { ...@@ -854,6 +896,11 @@ export default {
this.proutlist1.enclosureDescribe = ""; //初始化数据 this.proutlist1.enclosureDescribe = ""; //初始化数据
} 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) => { .catch((error) => {
...@@ -890,6 +937,12 @@ export default { ...@@ -890,6 +937,12 @@ export default {
deletBystatus(data).then((res) => { deletBystatus(data).then((res) => {
if (res.success) { if (res.success) {
this.getinvoive(data); this.getinvoive(data);
}else{
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}); });
}, },
......
...@@ -27,13 +27,14 @@ ...@@ -27,13 +27,14 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发票号码" prop="fromList"> <el-form-item label="发票号码" prop="invoiceIdList">
<el-select <el-select
v-model="from.fromList" v-model="from.invoiceIdList"
multiple multiple
filterable filterable
default-first-option default-first-option
placeholder="请选择" placeholder="请选择"
@change="getmoney()"
> >
<el-option <el-option
v-for="item in getinvoivelist" v-for="item in getinvoivelist"
...@@ -87,6 +88,7 @@ ...@@ -87,6 +88,7 @@
class="upload-demo" class="upload-demo"
drag drag
ref="enclosureUpload" ref="enclosureUpload"
:headers="fileUploadHeader"
:action="action1" :action="action1"
:auto-upload="false" :auto-upload="false"
:data="enclosurelist" :data="enclosurelist"
...@@ -127,41 +129,40 @@ ...@@ -127,41 +129,40 @@
</div> </div>
<div v-show="!subbut"> <div v-show="!subbut">
<el-form <el-form
:model="reimbursementItemData" :model="from"
:inline="true" :inline="true"
label-width="150px" label-width="150px"
ref="details" ref="details"
>
<el-row
v-for="(item, index) in reimbursementItemData.list"
:key="index"
> >
<el-col> <el-row
<el-form-item v-for="(item, index) in from.reimbursementDetailsList"
:label="item.itemNamwe" :key="index"
:prop="'list.' + index + '.money'" >
:rules="{ <el-col>
validator: moneyrow, <el-form-item
trigger: 'blur', :label="item.itemName"
required: true, :prop="'reimbursementDetailsList.' + index + '.money'"
}" :rules="{
> validator: moneyrow,
<el-input v-model="item.money" trigger: 'blur',
><i required: true,
slot="suffix" }"
style="font-style: normal; margin-right: 10px"
></i
></el-input
> >
</el-form-item> <el-input v-model="item.money"
<el-form-item label="备注"> ><i
<el-input v-model="item.remarks"></el-input> slot="suffix"
</el-form-item> style="font-style: normal; margin-right: 10px"
</el-col> ></i
</el-row> ></el-input
</el-form> >
</el-form-item>
<el-form-item label="备注">
<el-input v-model="item.remarks"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -171,9 +172,7 @@ ...@@ -171,9 +172,7 @@
import { selectAllCompanyId } from "@/api/reimbursementItem"; import { selectAllCompanyId } from "@/api/reimbursementItem";
import { selectAll as projectSelectAll } from "@/api/project"; import { selectAll as projectSelectAll } from "@/api/project";
import { insert } from "@/api/reimbursement"; import { insert } from "@/api/reimbursement";
import { Details } from "@/api/reimbursement";
import { queryBypageIncomeAdd, selectAllBystatus } from "@/api/project"; import { queryBypageIncomeAdd, selectAllBystatus } from "@/api/project";
import { updatesubmit } from "@/api/project";
import { money } from "@/utils/myValidate"; import { money } from "@/utils/myValidate";
export default { export default {
data() { data() {
...@@ -193,9 +192,11 @@ export default { ...@@ -193,9 +192,11 @@ export default {
paymentMethod: null, //支付方式 paymentMethod: null, //支付方式
reimbursementState: 0, //状态 reimbursementState: 0, //状态
projectId: null, //项目id projectId: null, //项目id
fromList: [], //发票号码 fromList: [],
remarks: "", //备注 remarks: "", //备注
enclosureDescribe: "", //附件描述 enclosureDescribe: "", //附件描述
invoiceIdList: [], //发票号码
reimbursementDetailsList: [],//报销项
}, },
projectList: [], //项目列表 projectList: [], //项目列表
getinvoivelist: [], //可以选择的发票号 getinvoivelist: [], //可以选择的发票号
...@@ -205,19 +206,21 @@ export default { ...@@ -205,19 +206,21 @@ export default {
list: [], list: [],
}, },
reimbursementItemList: [], reimbursementItemList: [],
fileUploadHeader: {
"X-Token": null,
},
//表单验证内容 //表单验证内容
rules: { rules: {
typeId: [ typeId: [
{ required: true, message: "请选择报销类别", trigger: "change" }, { required: true, message: "请选择报销类别", trigger: "change" },
], ],
fromList: [ invoiceIdList: [
{ required: true, message: "请选择发票号码", trigger: "change" }, { required: true, message: "请选择发票号码", trigger: "change" },
], ],
projectId: [ projectId: [
{ required: true, message: "请选择项目", trigger: "change" }, { required: true, message: "请选择项目", trigger: "change" },
], ],
number: [ invoiceIdList: [
{ required: true, message: "请输入发票号码", trigger: "change" }, { required: true, message: "请输入发票号码", trigger: "change" },
], ],
code: [ code: [
...@@ -268,68 +271,42 @@ export default { ...@@ -268,68 +271,42 @@ export default {
this.from.companyId = this.$store.getters.companyId; this.from.companyId = this.$store.getters.companyId;
this.invoicegetQurey.companyId = this.$store.getters.companyId; this.invoicegetQurey.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.fileUploadHeader["X-Token"] = this.$store.getters.token;
this.time(); this.time();
this.getProject(); this.getProject();
this.getReimbursement(); this.getReimbursement();
this.Selectinsertlsit(); this.Selectinsertlsit();
}, },
methods: { methods: {
//上传附件
enclosure() {
this.drawer1 = true;
},
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate((valid1) => { this.$refs.form.validate((valid1) => {
if (valid1) { if (valid1) {
this.$refs.details.validate((valid) => { this.$refs.details.validate((valid) => {
if (valid) { if (valid) {
let sumMoney = 0;
this.from.reimbursementDetailsList.forEach((m) => {
sumMoney += Number(m.money);
});
if (sumMoney != this.from.applyTotalAmountSmall) {
this.$message.error("报销项总金额要等于报销总金额");
return;
}
insert(this.from) insert(this.from)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
//上传发票号
let list = [];
this.from.fromList.forEach((item) => {
list.push({
invoiceId: item,
reimbursementId: res.data,
status: 1,
});
});
updatesubmit(list).then((res) => {
if (res.success) {
this.$message.success(res.msg);
} else {
this.$message.error("发票绑定失败");
}
});
console.log(res);
// 上传附件 // 上传附件
this.enclosurelist.Id = res.data; this.enclosurelist.Id = res.data;
this.enclosurelist.companyId = this.from.companyId; this.enclosurelist.companyId = this.from.companyId;
this.enclosurelist.enclosureDescribe = this.enclosurelist.enclosureDescribe =this.from.enclosureDescribe;
this.from.enclosureDescribe;
this.enclosurelist.userId = this.from.userId; this.enclosurelist.userId = this.from.userId;
this.$refs.enclosureUpload.submit(); this.$refs.enclosureUpload.submit();
// this.$message.success("上传附件成功"); this.back();
//上传右边的报销项了 ,上传报销项之前,需要处理数据reimbursementId代表着本次提交报销表的id
this.reimbursementItemData.list.forEach((item) => {
item.reimbursementId = res.data; //reimbursementId 放到原本data里面
});
Details(this.reimbursementItemData.list).then((res) => {
if (res.success) {
// this.$message.success(res.msg);
this.back();
} else {
this.$message.error(res.msg);
}
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error);
this.$message.error("提交失败"); this.$message.error("提交失败");
}); });
} }
...@@ -376,6 +353,11 @@ export default { ...@@ -376,6 +353,11 @@ export default {
this.projectList = res.data; this.projectList = res.data;
} 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) => { .catch((error) => {
...@@ -400,13 +382,13 @@ export default { ...@@ -400,13 +382,13 @@ export default {
reimbursementItemList.forEach((e) => { reimbursementItemList.forEach((e) => {
//设置参数 //设置参数
let pram = { let pram = {
itemNamwe: e.name, itemName: e.name,
itemId: e.id, itemId: e.id,
money: 0, money: 0,
reimbursementId: null, reimbursementId: null,
remarks: null, remarks: "",
}; };
this.reimbursementItemData.list.push(pram); this.from.reimbursementDetailsList.push(pram);
}); });
} }
} else { } else {
...@@ -463,7 +445,7 @@ export default { ...@@ -463,7 +445,7 @@ export default {
type: 2, type: 2,
userId: this.$store.getters.info.userId, userId: this.$store.getters.info.userId,
}; };
// console.log(this.getinvoivelist) let list = [];
selectAllBystatus(param) selectAllBystatus(param)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
...@@ -478,6 +460,22 @@ export default { ...@@ -478,6 +460,22 @@ export default {
this.back(); this.back();
}); });
}, },
//添加发票金额
getmoney() {
console.log(this.from.invoiceIdList)
this.from.applyTotalAmountSmall = 0;
this.from.invoiceIdList.forEach((id) => {
this.getinvoivelist.forEach((e) => {
if (e.invoiceId == id) {
this.from.applyTotalAmountSmall += e.mone;
}
});
});
if (this.from.fromList.length == 0) {
this.from.applyTotalAmountLarge = null;
}
this.convertCurrency(this.from.applyTotalAmountSmall);
},
//金额小写转大写 //金额小写转大写
convertCurrency(money) { convertCurrency(money) {
//汉字的数字 //汉字的数字
...@@ -580,14 +578,6 @@ export default { ...@@ -580,14 +578,6 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
.container {
padding: 20px;
/* min-width : 0 */
}
</style>
<style scoped> <style scoped>
.box { .box {
width: 100%; width: 100%;
...@@ -595,13 +585,14 @@ export default { ...@@ -595,13 +585,14 @@ export default {
margin: 60px 0px; margin: 60px 0px;
padding: 20px 10px; padding: 20px 10px;
border-radius: 30px; border-radius: 30px;
/* white-space: nowrap; */
} }
.spend { .spend {
width: 800px; width: 800px;
float: left; float: left;
margin: 60px 0px; margin: 60px 0px;
padding: 20px 10px; padding: 20px 10px;
/* white-space: nowrap; */ }
.container {
padding: 20px;
} }
</style> </style>
\ No newline at end of file
<template>
<div class="container">
<!-- 申请报销头部模块 -->
<div>
<el-form :inline="true" :model="reimbursementQurey">
<el-form-item label="项目名称">
<el-input
v-model="reimbursementQurey.projectName"
placeholder="项目名称"
></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select
v-model="reimbursementQurey.reimbursementState"
placeholder="请选择"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="query()"
>查询</el-button
>
<el-button
type="primary"
icon="el-icon-refresh-right"
@click="reset()"
>重置</el-button
>
</el-form-item>
<el-form-item>
<el-button
type="success"
icon="el-icon-circle-plus-outline"
@click="addreimbursement()"
>申请报销</el-button
>
</el-form-item>
</el-form>
</div>
<!-- 表格模块 -->
<div class="conter">
<el-table
:data="reimbursementList"
style="width: 100%; text-align: center"
border
>
<el-table-column type="expand">
<template slot-scope="props">
<div style="padding: 10px">
<el-descriptions title="报销详情" :column="5" border>
<el-descriptions-item label="支付方式" :span="5">{{
props.row.paymentMethod
}}</el-descriptions-item>
<el-descriptions-item label="组长审批状态" :span="2">
<el-tag
:type="
props.row.reimbursementState == 0
? 'info'
: props.row.reimbursementState == 2
? 'danger'
: 'success'
"
>
{{
props.row.reimbursementState == 0
? "待审批"
: props.row.reimbursementState == 2
? "驳回"
: "通过"
}}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="组长审批时间" :span="3">{{
props.row.headmanTime
}}</el-descriptions-item>
<el-descriptions-item label="组长驳回缘由" :span="5">{{
props.row.headmanRefute || ""
}}</el-descriptions-item>
<el-descriptions-item label="财务审批状态" :span="2">
<el-tag
:type="
props.row.reimbursementState == 4
? 'danger'
: props.row.reimbursementState == 3
? 'success'
: 'info'
"
>
{{
props.row.reimbursementState == 4
? "驳回"
: props.row.reimbursementState == 3
? "通过"
: "待审批"
}}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="财务审批时间" :span="3">{{
props.row.financeTime
}}</el-descriptions-item>
<el-descriptions-item label="财务驳回缘由" :span="5">{{
props.row.finaceRefute || ""
}}</el-descriptions-item>
<el-descriptions-item label="查看详情" :span="5">
<el-button
@click="getdetails(props.row)"
type="primary"
style="margin: 5px"
size="mini"
>查看详情
</el-button>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
</el-table-column>
<el-table-column label="序号" width="50px" align="center">
<template slot-scope="scope">
{{
(reimbursementQurey.pageNum - 1) * reimbursementQurey.pageSize +
scope.$index +
1
}}
</template>
</el-table-column>
<el-table-column prop="projectName" label="项目" align="center" />
<el-table-column
prop="applyTotalAmountSmall"
label="申报总金额(元)"
align="center"
/>
<el-table-column label="核报总金额(元)" align="center">
<template slot-scope="props">
{{ props.row.verifyTotalAmountSmall || "还未核实金额" }}
</template>
</el-table-column>
<el-table-column label="组长审批人" align="center">
<template slot-scope="props">
{{ props.row.financeName || "暂无" }}
</template>
</el-table-column>
<el-table-column label="财务审批人" align="center">
<template slot-scope="props">
{{ props.row.financeName || "暂无" }}
</template>
</el-table-column>
<el-table-column
prop="fillingTime"
label="报销日期"
align="center"
:formatter="timestampToTime"
></el-table-column>
<el-table-column prop="prop" label="发票图片" align="center">
<template slot-scope="scope">
<el-button
style="margin: 5px"
type="primary"
size="mini"
@click="ReviseImage(scope.row)"
>点击查看</el-button
>
<el-button
style="margin: 5px"
size="mini"
icon="el-icon-edit"
type="info"
@click="getinvoive(scope.row)"
v-if="
scope.row.reimbursementState != 3 &&
scope.row.reimbursementState != 1 &&
scope.row.reimbursementState != 2 &&
scope.row.reimbursementState != 4
"
>修改发票</el-button
>
</template>
</el-table-column>
<el-table-column prop="prop" label="附件下载" align="center">
<template slot-scope="scope">
<el-button
type="success"
size="mini"
@click="selectImage(scope.row)"
>点击下载</el-button
>
</template>
</el-table-column>
<el-table-column prop="reimbursementState" label="状态" align="center">
<template slot-scope="props">
<el-tag
:type="
props.row.reimbursementState == 0 ||
props.row.reimbursementState == 1
? 'info'
: props.row.reimbursementState == 3
? 'success'
: 'danger'
"
>
{{
props.row.reimbursementState == 0
? "待小组长通过"
: props.row.reimbursementState == 1
? "待财务长通过"
: props.row.reimbursementState == 2
? "小组长驳回"
: props.row.reimbursementState == 3
? "财务长通过"
: "财务长驳回"
}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center">
<template slot-scope="scope">
<el-button
style="margin: 5px"
size="mini"
type="info"
@click="withdraw(scope.row)"
v-if="scope.row.reimbursementState == 0"
>
撤回</el-button
>
<el-button
style="margin: 5px"
size="mini"
icon="el-icon-edit"
type="info"
@click="updataReimbursement(scope.row)"
v-if="
scope.row.reimbursementState != 3 &&
scope.row.reimbursementState != 1 &&
scope.row.reimbursementState != 2 &&
scope.row.reimbursementState != 4
"
>修改信息</el-button
>
<el-button
style="margin: 5px"
size="mini"
type="danger"
@click="Resubmit(scope.row)"
v-if="
scope.row.reimbursementState == 2 ||
scope.row.reimbursementState == 4
"
>重新提交</el-button
>
<div
v-if="scope.row.reimbursementState == 3"
style="width:100%;text-align: center ; color:#67C23A;"
>
已通过
</div>
<div
v-if="scope.row.reimbursementState == 1"
style="width:100%;text-align: center ; color:darkgray;"
>
待审批
</div>
</template>
</el-table-column>
</el-table>
<!-- 查看详情 -->
<el-drawer
title="查看详情"
:visible.sync="drawer"
:direction="direction"
size="35%"
>
<div class="cd">
<el-row justify="center" align="middle">
<el-col
v-for="(item, index) in reimbursementDetails.list"
:key="index"
:span="20"
>
<el-descriptions
:title="item.name"
border
:column="1"
style="margin: 10px 0"
>
<el-descriptions-item
label="金额"
:contentStyle="contentStyle"
:labelStyle="labelStyle"
>{{ item.money }}元
</el-descriptions-item>
<el-descriptions-item
label="备注"
:contentStyle="contentStyle"
:labelStyle="labelStyle"
>{{ item.explain }}</el-descriptions-item
>
<el-descriptions-item
label="说明"
:contentStyle="contentStyle"
:labelStyle="labelStyle"
>{{ item.remarks }}</el-descriptions-item
>
</el-descriptions>
</el-col>
</el-row>
</div>
</el-drawer>
<!-- 发票详情 -->
<el-drawer
title="发票详情"
:visible.sync="invoiceShow"
:direction="direction"
size="30%"
>
<el-table
:data="getinvoivelist"
style="width: 100%; text-align: center"
border
>
<el-table-column
type="index"
label="序号"
width="80"
></el-table-column>
<el-table-column prop="prop" label="发票详情">
<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>
</el-drawer>
<!-- 修改发票信息 -->
<el-drawer title="修改发票" :visible.sync="drawer1">
<div>
<el-form :inline="true" :model="invoiceQurey">
<el-form-item>
<el-button
type="success"
icon="el-icon-circle-plus-outline"
style="margin: 0 15px"
@click="addinvoice()"
>
添加发票号码</el-button
>
</el-form-item>
</el-form>
</div>
<div>
<el-table
:data="invoicelist"
style="width: 100%; text-align: center"
border
>
<el-table-column
type="index"
label="序号"
width="40"
></el-table-column>
<el-table-column prop="number" label="发票号码" width="180" />
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
style="margin: 5px"
size="mini"
type="info"
@click="delinvoice(scope.row)"
:disabled="isDisabledDel"
>
删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</el-drawer>
<!-- 添加发票对话框 -->
<el-dialog title="添加发票" :visible.sync="dialogVisible" width="50%">
<el-form
ref="form"
:model="invoiceQurey"
:inline="true"
label-width="150px"
>
<el-form-item prop="fromList">
<el-select
style="width: 500px"
v-model="invoiceQurey.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>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submit()">确 定</el-button>
</span>
</el-dialog>
</div>
<div class="footer">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="reimbursementQurey.pageNum"
:page-size="reimbursementQurey.pageSize"
layout="total, prev, pager, next"
:total="total"
></el-pagination>
</div>
<!-- 附件的下载与添加 -->
<div>
<el-drawer
title="附件操作"
:visible.sync="drawer2"
:direction="direction"
size="50%"
>
<el-button
type="primary"
style="margin-left: 5%; margin: 30px 50px"
@click="updatecard"
:disabled="isDisabled"
>
添加附件</el-button
>
<el-card
class="box-card"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 1"
>
<el-row class="row-bg">
<div
v-for="index in queryDTOList"
:key="index.enclosureId"
class="lsitall"
>
<el-col :span="10">
<div style="margin-top: 6px; margin-left: 40px">
附件{{ index.enclosureId }}
</div>
</el-col>
<el-col :span="12" style="margin-left: -50px">
<el-button
type="primary"
icon="el-icon-folder-checked"
class="a-style"
size="mini"
style="font-size: 13px"
@click="delProject(index)"
>下载</el-button
>
<el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0">
<el-button
size="mini"
type="text"
@click="index.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="deleteProject(index)"
>确定</el-button
>
</div>
<el-button
type="danger"
icon="el-icon-delete"
class="a-style"
size="mini "
style="font-size: 13px"
slot="reference"
:disabled="isDisabled"
>删除</el-button
>
</el-popover>
</el-col>
</div>
</el-row>
</el-card>
<!-- 附件上传 -->
<el-card
class="box-card"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 0"
>
<div style="width: 60%; margin-left: 30px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe"
style="margin: 20px 0px"
></el-input>
<el-upload
class="upload-demo"
ref="upload1"
drag
:headers="fileUploadHeader"
:action="action1"
:file-list="fileList1"
:on-remove="delfile1"
:auto-upload="false"
:on-change="onChangepdf"
:on-success="Refresh"
:data="proutlist1"
multiple
style="margin: 20px 0px"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传附件</em>
</div>
<div class="el-upload__tip" slot="tip">
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button>
<el-button
type="primary"
@click="determine()"
style="margin-top: 20px"
>确 定</el-button
>
</div>
</el-card>
<div class="box-card" v-show="getshow == 3"></div>
</el-drawer>
</div>
</div>
</template>
<script>
import { getFileUrl } from "@/api/companyFile";
import { queryBypage, resubmit, reimbursementId } from "@/api/reimbursement";
import { selectByReimbursementId } from "@/api/reimbursementDetails";
import {
selectAllById,
deletBystatus,
selectAllBystatus,
updatesubmit,
selectByIdF,
deleteById,
} from "@/api/project";
export default {
data() {
return {
isDisabled: false, //判断是否显示附件的删除按钮
isDisabledDel: false, //判断是否禁用删除发票图片按钮
//修改发票表格
invoicelist: [],
invoiceQurey: {
companyId: null,
reimbursementId: null,
},
options: [
{
value: "0",
label: "待小组长通过",
},
{
value: "1",
label: "待财务长通过",
},
{
value: "2",
label: "小组长驳回",
},
{
value: "3",
label: "财务长通过",
},
{
value: "4",
label: "财务长驳回",
},
],
getinvoivelist: [], //可以选择的发票号
dialogVisible: false,
//内容样式
contentStyle: {
"text-align": "center",
},
//label样式
labelStyle: { width: "80px" },
reimbursementQurey: {
userId: null,
pageNum: 1,
pageSize: 10,
},
total: 0,
reimbursementList: [],
//抽屉
drawer: false,
drawer1: false,
invoiceShow: false,
direction: "rtl",
reimbursementDetails: {
list: [],
},
//查询图片给的值
getinvoiveId: {
companyId: null,
reimbursementId: 0,
},
//附件///-------
drawer: false,
direction: "rtl",
fileList1: [], //合同文件
disabled: false, //隐藏
getshow: 1, //判断show的显示与隐藏,
//查询附件
queryDTO: {
companyId: null,
reimbursementId: null,
},
queryDTOList: [], //收集附件的数据
//附件抽屉
drawer2: false,
//发票对话框
dialogFormVisible: false,
invoiceListAdd: [], //查询发票的集合
getFormslist: {
userId: null,
companyId: null,
type: 0,
}, //查询的能选择的表单信息
getListincom: [], //收集选择的数组
incomeIdgrt: null, //收集incomeId数据
getshow: 1, //判断show的显示与隐藏,
//合同文件上传携带参数
proutlist1: {
Id: null,
enclosureDescribe: "",
status: 2, //0收入 1支出
companyId: null,
userId: null,
},
fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //附件文件
disabled: false, //隐藏
srcList: [],
fileUploadHeader: {
"X-Token": null,
},
};
},
created() {
this.getinvoiveId.companyId = this.$store.getters.companyId;
this.reimbursementQurey.userId = this.$store.getters.urId;
this.invoiceQurey.companyId = this.$store.getters.companyId;
this.queryDTO.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; //保存附件与下载的接口
this.fileUploadHeader["X-Token"] = this.$store.getters.token;
this.getReimbursement();
},
methods: {
//重置
reset() {
this.reimbursementQurey = {
pageNum: 1,
pageSize: 10,
userId: null,
};
this.reimbursementQurey.userId = this.$store.getters.urId;
this.getReimbursement();
},
//搜索
query() {
this.reimbursementQurey.pageNum = 1;
this.getReimbursement();
},
//图片格式
formatProtocolType(row) {
//这里判断的是是否有文件
if (row.filePath == null) {
return flase;
} else {
let fileNamepdf = row.filePath;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType != ".pdf") {
return true;
} else {
return false;
}
}
},
//添加
submit() {
this.dialogVisible = false;
let list = [];
this.invoiceQurey.fromList.forEach((item) => {
list.push({
invoiceId: item,
reimbursementId: this.invoiceQurey.reimbursementId,
status: 1,
});
});
updatesubmit(list).then((res) => {
if (res.success) {
this.getinvoive({
reimbursementId: this.invoiceQurey.reimbursementId,
});
this.$refs.form.resetFields();
this.$message.success(res.msg);
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error("发票上传失败!");
}
});
},
//查询发票编号
Selectinvoielsit() {
let param = {
companyId: this.$store.getters.companyId,
status: 0,
type: 2,
userId: this.$store.getters.info.userId,
};
selectAllBystatus(param)
.then(async (res) => {
if (res.success) {
this.getinvoivelist = res.data;
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
this.back();
}
})
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
},
//添加发票号码
addinvoice() {
this.dialogVisible = true;
this.Selectinvoielsit();
},
//获取发票号列表详情
getinvoive(data) {
this.drawer1 = true;
this.invoiceQurey.reimbursementId = data.reimbursementId;
selectAllById(this.invoiceQurey).then((res) => {
console.log(res);
if (res.success) {
this.invoicelist = res.data;
console.log(res.data.length);
if (res.data.length <= 1) {
this.isDisabledDel = true;
} else {
this.isDisabledDel = false;
}
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
}
});
},
//删除关系
delinvoice(data) {
this.$confirm("是否同意删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
deletBystatus(data).then((res) => {
if (res.success) {
this.getinvoive(data);
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
});
},
//查看详情
getdetails(data) {
this.drawer = true;
let param = {
reimbursementId: data.reimbursementId,
}; //接口是一个以对象的形式传值 所以定义了一个对象去拿这个参数
selectByReimbursementId(param)
.then((res) => {
if (res.success) {
//获取数据
console.log(res);
this.reimbursementDetails.list = res.data; //接口返回res里面
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
})
.catch((error) => {
this.$message.error("查询失败");
});
},
//申请报销
addreimbursement() {
this.$router.push({ path: "/reimbursementAdd" });
},
//获取申请报销列表
getReimbursement() {
queryBypage(this.reimbursementQurey)
.then((res) => {
if (res.success) {
this.reimbursementList = res.data.list;
this.total = res.data.total;
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("回去数据失败");
});
},
//修改信息
updataReimbursement(data) {
//data是列表中所有的数据
console.log(data);
this.$router.push({
path: "/reimbursementUpdata",
//query 找到我们需要的字段
query: {
reimbursementId: data.reimbursementId, //传那一行数据的id
projectId: data.projectId, //项目id 下拉框根据项目id选择
typeId: data.typeId, //报销类别id
money: data.money, //备注
applyTotalAmountLarge: data.applyTotalAmountLarge, //大写金额
applyTotalAmountSmall: data.applyTotalAmountSmall, //小写金额
summary: data.summary, //摘要
paymentMethod: data.paymentMethod, //支付方式
},
});
},
//换页
handleCurrentChange(val) {
this.reimbursementQurey.pageNum = val;
this.getReimbursement();
},
//时间处理
timestampToTime(row, column, cellValue) {
return cellValue.split(" ")[0];
},
//重新提交
Resubmit(data) {
//重新提交就要让之前的数据回复。
//两个审批人的id、状态、审批时间、驳回缘由、核实金额
//删除记录在重新填,或者删除字段记录
data.reimbursementState = 0; //状态
data.verifyTotalAmountLarge = null; //核实金额
data.verifyTotalAmountSmall = null; //核实金额
data.headmanRefute = null; //驳回缘由
data.finaceRefute = null; //驳回缘由
data.financeTime = null; //审批时间
data.headmanTime = null; //审批时间
data.financeId = null; //审批人的id
data.headmanId = null; //审批人的id
resubmit(data)
.then((res) => {
if (res.success) {
this.$message.success("重新提交成功,等待审批");
this.getReimbursement();
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("重新提交失败");
});
},
//撤回
withdraw(data) {
this.$confirm("是否同意撤回?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
reimbursementId(data.reimbursementId).then((res) => {
if (res.success) {
this.getReimbursement();
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
});
},
//查看图片的方法
ReviseImage(row) {
// console.log(row)
this.invoiceShow = true;
this.getinvoiveId.reimbursementId = row.reimbursementId;
this.Selectinsertlsit();
},
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId)
.then((res) => {
if (res.success) {
this.getinvoivelist = res.data;
this.getinvoivelist.forEach((e) => {
let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
console.log(url);
if (fileType != ".pdf") {
this.srcList.push(url);
}
}
});
});
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
this.back();
}
})
.catch((e) => {
this.$message.error("获取发票图片失败");
this.back();
});
},
//pdf,展示
handlePreView(row) {
const photopath = row.fileUrl;
window.open(photopath, "_blank");
},
///----附件区域
//查看项目附件.....
selectImage(row) {
console.log(row);
if (
row.reimbursementState == 1 ||
row.reimbursementState == 3 ||
row.reimbursementState == 2 ||
row.reimbursementState == 4
) {
this.isDisabled = true;
} else {
this.isDisabled = false;
}
this.queryDTO.reimbursementId = row.reimbursementId;
this.proutlist1.Id = row.reimbursementId;
selectByIdF(this.queryDTO)
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
if (this.queryDTOList.length > 0) {
this.drawer2 = true;
this.getshow = 1;
this.disabled = false;
} else {
this.drawer2 = true;
this.disabled = false;
this.getshow = 3;
}
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
//下载附件
async delProject(row) {
console.log(row);
var a = document.createElement("a"); //创建一个<a></a>标
a.href = (await getFileUrl(row.enclosureFile)).data;
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签
},
//显示添加附件
updatecard() {
this.getshow = 0;
this.disabled = true;
this.delfile1();
},
//删除附件
deleteProject(row) {
// this.submissionFlag = true;
if (
row.reimbursementState == 1 ||
row.reimbursementState == 3 ||
row.reimbursementState == 2 ||
row.reimbursementState == 4
) {
this.isDisabled = true;
} else {
this.isDisabled = false;
}
deleteById(row)
.then((res) => {
if (res.success) {
this.selectImage(row);
this.$message({
message: "删除成功",
type: "success",
});
this.visible = false;
console.log(res.msg);
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
})
.catch((errror) => {
this.$message.error(res.msg);
});
},
//清除附件文件
delfile1(file) {
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
this.fileTypepdf = false;
},
//确定提交附件
determine() {
//判断是否有附件文件
if (this.fileTypepdf) {
this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId;
this.$refs.upload1.submit();
this.getshow = 1; //隐藏与显示
this.disabled = false;
this.$message({
showClose: true,
message: "上传附件成功",
type: "success",
});
this.Refresh();
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error("请添加附件,在进行提交");
}
},
//刷新附件
Refresh() {
console.log(this.proutlist1.Id);
this.queryDTO.reimbursementId = this.proutlist1.Id;
console.log(this.proutlist1.Id);
selectByIdF(this.queryDTO)
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
//附件取消
remove() {
if (this.queryDTOList.length > 0) {
this.getshow = 1;
this.disabled = false;
this.delfile1();
} else {
this.getshow = 3;
this.disabled = false;
this.delfile1();
}
},
//附件文件校验
onChangepdf(file) {
console.log(this.proutlist1);
const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType != "") {
this.fileTypepdf = true;
} else {
this.$message.warning("附件只能只能上传文件");
this.$refs.upload1.clearFiles();
this.fileTypepdf = false;
}
},
},
};
</script>
<style scoped>
.container {
padding: 10px;
}
.conter {
margin-bottom: 10px;
}
.footer {
text-align: right;
}
.lsitall .el-col {
margin: 20px 10px;
}
.lsitall .el-button {
margin-left: 16px;
}
.row-bg {
margin-left: 15%;
}
.dialog-footer {
width: 90%;
margin: 20px 5%;
}
.lsitall .el-col {
margin: 20px 10px;
}
.lsitall .el-button {
margin-left: 16px;
}
.row-bg {
margin-left: 15%;
}
.dialog-footer {
width: 90%;
margin: 20px 5%;
}
.cd {
width: 90%;
margin: 30px 5%;
}
</style>
\ No newline at end of file
...@@ -114,8 +114,8 @@ ...@@ -114,8 +114,8 @@
type="primary" type="primary"
style="margin: 5px" style="margin: 5px"
size="mini" size="mini"
>查看详情</el-button >查看详情
> </el-button>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
...@@ -166,20 +166,6 @@ ...@@ -166,20 +166,6 @@
@click="ReviseImage(scope.row)" @click="ReviseImage(scope.row)"
>点击查看</el-button >点击查看</el-button
> >
<el-button
style="margin: 5px"
size="mini"
icon="el-icon-edit"
type="info"
@click="getinvoive(scope.row)"
v-if="
scope.row.reimbursementState != 3 &&
scope.row.reimbursementState != 1 &&
scope.row.reimbursementState != 2 &&
scope.row.reimbursementState != 4
"
>修改发票</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="附件下载" align="center"> <el-table-column prop="prop" label="附件下载" align="center">
...@@ -187,7 +173,7 @@ ...@@ -187,7 +173,7 @@
<el-button <el-button
type="success" type="success"
size="mini" size="mini"
@click="selectImage(scope.row)" @click="getenclosure(scope.row)"
>点击下载</el-button >点击下载</el-button
> >
</template> </template>
...@@ -271,12 +257,51 @@ ...@@ -271,12 +257,51 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div>
<!-- 列表中的发票详情,发票信息修改,附件 -->
<div>
<!-- 发票详情 -->
<el-drawer
title="发票详情"
:visible.sync="invoiceShow"
:direction="direction"
size="30%"
>
<el-table
:data="getinvoivelist"
style="width: 100%; text-align: center"
border
>
<el-table-column
type="index"
label="序号"
width="80"
></el-table-column>
<el-table-column prop="prop" label="发票详情">
<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>
</el-drawer>
<!-- 查看详情 --> <!-- 查看详情 -->
<el-drawer <el-drawer
title="查看详情" title="查看详情"
:visible.sync="drawer" :visible.sync="drawer"
:direction="direction" :direction="direction"
size="35%" size="45%"
> >
<div class="cd"> <div class="cd">
<el-row justify="center" align="middle"> <el-row justify="center" align="middle">
...@@ -295,8 +320,8 @@ ...@@ -295,8 +320,8 @@
label="金额" label="金额"
:contentStyle="contentStyle" :contentStyle="contentStyle"
:labelStyle="labelStyle" :labelStyle="labelStyle"
>{{ item.money }}元</el-descriptions-item >{{ item.money }}元
> </el-descriptions-item>
<el-descriptions-item <el-descriptions-item
label="备注" label="备注"
:contentStyle="contentStyle" :contentStyle="contentStyle"
...@@ -314,127 +339,7 @@ ...@@ -314,127 +339,7 @@
</el-row> </el-row>
</div> </div>
</el-drawer> </el-drawer>
<!-- 发票详情 --> <!-- 附件查看 -->
<el-drawer
title="发票详情"
:visible.sync="invoiceShow"
:direction="direction"
size="30%"
>
<el-table
:data="getinvoivelist"
style="width: 100%; text-align: center"
border
>
<el-table-column
type="index"
label="序号"
width="80"
></el-table-column>
<el-table-column prop="prop" label="发票详情">
<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>
</el-drawer>
<!-- 修改发票信息 -->
<el-drawer title="修改发票" :visible.sync="drawer1">
<div>
<el-form :inline="true" :model="invoiceQurey">
<el-form-item>
<el-button
type="success"
icon="el-icon-circle-plus-outline"
style="margin: 0 15px"
@click="addinvoice()"
>添加发票号码</el-button
>
</el-form-item>
</el-form>
</div>
<div>
<el-table
:data="invoicelist"
style="width: 100%; text-align: center"
border
>
<el-table-column
type="index"
label="序号"
width="40"
></el-table-column>
<el-table-column prop="number" label="发票号码" width="180" />
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
style="margin: 5px"
size="mini"
type="info"
@click="delinvoice(scope.row)"
:disabled="isDisabledDel"
>
删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</el-drawer>
<!-- 添加发票对话框 -->
<el-dialog title="添加发票" :visible.sync="dialogVisible" width="50%">
<el-form
ref="form"
:model="invoiceQurey"
:inline="true"
label-width="150px"
>
<el-form-item prop="fromList">
<el-select
style="width: 500px"
v-model="invoiceQurey.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>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submit()">确 定</el-button>
</span>
</el-dialog>
</div>
<div class="footer">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="reimbursementQurey.pageNum"
:page-size="reimbursementQurey.pageSize"
layout="total, prev, pager, next"
:total="total"
></el-pagination>
</div>
<!-- 附件的下载与添加 -->
<div>
<el-drawer <el-drawer
title="附件操作" title="附件操作"
:visible.sync="drawer2" :visible.sync="drawer2"
...@@ -444,9 +349,10 @@ ...@@ -444,9 +349,10 @@
<el-button <el-button
type="primary" type="primary"
style="margin-left: 5%; margin: 30px 50px" style="margin-left: 5%; margin: 30px 50px"
@click="updatecard" @click="addenclosure"
:disabled="isDisabled" :disabled="isDisabled"
>添加附件</el-button >
添加附件</el-button
> >
<el-card <el-card
class="box-card" class="box-card"
...@@ -471,7 +377,7 @@ ...@@ -471,7 +377,7 @@
class="a-style" class="a-style"
size="mini" size="mini"
style="font-size: 13px" style="font-size: 13px"
@click="delProject(index)" @click="loadenclosure(index)"
>下载</el-button >下载</el-button
> >
<el-popover placement="top" width="160" v-model="index.visible"> <el-popover placement="top" width="160" v-model="index.visible">
...@@ -486,7 +392,7 @@ ...@@ -486,7 +392,7 @@
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@click="deleteProject(index)" @click="delenclosure(index)"
>确定</el-button >确定</el-button
> >
</div> </div>
...@@ -516,20 +422,21 @@ ...@@ -516,20 +422,21 @@
type="textarea" type="textarea"
:rows="2" :rows="2"
placeholder="请输入附件详情" placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe" v-model="enclosurelist.enclosureDescribe"
style="margin: 20px 0px" style="margin: 20px 0px"
></el-input> ></el-input>
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="upload1" ref="upload1"
drag drag
:headers="fileUploadHeader"
:action="action1" :action="action1"
:file-list="fileList1" :file-list="fileList1"
:on-remove="delfile1" :on-remove="delfile1"
:auto-upload="false" :auto-upload="false"
:on-change="onChangepdf" :on-change="onChangepdf"
:on-success="Refresh" :on-success="Refresh"
:data="proutlist1" :data="enclosurelist"
multiple multiple
style="margin: 20px 0px" style="margin: 20px 0px"
> >
...@@ -544,7 +451,7 @@ ...@@ -544,7 +451,7 @@
</el-upload> </el-upload>
</div> </div>
<div style="margin-left: 75%"> <div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button> <el-button @click="cancel()">取 消</el-button>
<el-button <el-button
type="primary" type="primary"
@click="determine()" @click="determine()"
...@@ -553,35 +460,42 @@ ...@@ -553,35 +460,42 @@
> >
</div> </div>
</el-card> </el-card>
<div class="box-card" v-show="getshow == 3"></div> <div class="box-card" v-show="getshow == 3">
<el-empty description="没有附件哦!"></el-empty>
</div>
</el-drawer> </el-drawer>
</div> </div>
<div class="footer">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="reimbursementQurey.pageNum"
:page-size="reimbursementQurey.pageSize"
layout="total, prev, pager, next"
:total="total"
></el-pagination>
</div>
</div> </div>
</template> </template>
<script> <script>
import { getFileUrl } from "@/api/companyFile"; import { queryBypage, reimbursementId, resubmit } from "@/api/reimbursement";
import { queryBypage, resubmit, reimbursementId } from "@/api/reimbursement";
import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { import {
selectAllById, selectAllById,
deletBystatus,
selectAllBystatus,
updatesubmit,
selectByIdF, selectByIdF,
deleteById, deleteById,
} from "@/api/project"; } from "@/api/project";
import { getFileUrl } from "@/api/companyFile";
import { selectByReimbursementId } from "@/api/reimbursementDetails";
export default { export default {
data() { data() {
return { return {
isDisabled: false, //判断是否显示附件的删除按钮 //获取列表全部数据所需要的值
isDisabledDel: false, //判断是否禁用删除发票图片按钮 reimbursementQurey: {
//修改发票表格 userId: null,
invoicelist: [], pageNum: 1,
invoiceQurey: { pageSize: 10,
companyId: null,
reimbursementId: null,
}, },
//手动下拉框赋值(搜索)
options: [ options: [
{ {
value: "0", value: "0",
...@@ -604,83 +518,64 @@ export default { ...@@ -604,83 +518,64 @@ export default {
label: "财务长驳回", label: "财务长驳回",
}, },
], ],
getinvoivelist: [], //可以选择的发票号 reimbursementList: [], //存放列表的数据
dialogVisible: false,
//内容样式
contentStyle: {
"text-align": "center",
},
//label样式
labelStyle: { width: "80px" },
reimbursementQurey: {
userId: null,
pageNum: 1,
pageSize: 10,
},
total: 0, total: 0,
reimbursementList: [], invoiceShow: false, //发票详情的抽屉
//抽屉
drawer: false,
drawer1: false,
invoiceShow: false,
direction: "rtl",
reimbursementDetails: {
list: [],
},
//查询图片给的值 //查询图片给的值
getinvoiveId: { getinvoiveId: {
companyId: null, companyId: null,
reimbursementId: 0, reimbursementId: 0,
}, },
direction: "rtl", //发票详情抽屉打开的方向
//附件///------- getinvoivelist: [], //可以选择的发票号
drawer: false, srcList: [],
direction: "rtl", drawer: false, //判断是否打开查看详情窗口
fileList1: [], //合同文件 reimbursementDetails: {
disabled: false, //隐藏 list: [],
getshow: 1, //判断show的显示与隐藏, }, //获取报销项列表
//label样式
labelStyle: { width: "80px" },
//内容样式
contentStyle: {
"text-align": "center",
},
drawer2: false, //判断是否打开下载附件
//查询附件 //查询附件
queryDTO: { queryDTO: {
companyId: null, companyId: null,
reimbursementId: null, reimbursementId: null,
}, },
queryDTOList: [], //收集附件的数据 queryDTOList: [], //收集附件的数据
//附件抽屉
drawer2: false,
//发票对话框
dialogFormVisible: false,
invoiceListAdd: [], //查询发票的集合
getFormslist: {
userId: null,
companyId: null,
type: 0,
}, //查询的能选择的表单信息
getListincom: [], //收集选择的数组
incomeIdgrt: null, //收集incomeId数据
getshow: 1, //判断show的显示与隐藏, getshow: 1, //判断show的显示与隐藏,
//合同文件上传携带参数 isDisabled: false, //判断是否显示附件的删除按钮
proutlist1: { //附件上传携带参数
enclosurelist: {
Id: null, Id: null,
enclosureDescribe: "", enclosureDescribe: "",
status: 2, //0收入 1支出 status: 2, //0收入 1支出
companyId: null, companyId: null,
userId: null, userId: null,
}, },
fileTypepdf: false, //判断合同文件是否存在 fileList1: [], //合同文件
fileList1: [], //附件文件 fileTypepdf: false, //判断附件是否存在
disabled: false, //隐藏 fileUploadHeader: {
srcList: [], "X-Token": null,
},
}; };
}, },
created() { created() {
this.getinvoiveId.companyId = this.$store.getters.companyId;
this.reimbursementQurey.userId = this.$store.getters.urId; this.reimbursementQurey.userId = this.$store.getters.urId;
this.invoiceQurey.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.queryDTO.companyId = this.$store.getters.companyId; this.queryDTO.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; //保存附件与下载的接口 this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; //保存附件与下载的接口
this.fileUploadHeader["X-Token"] = this.$store.getters.token;
this.getReimbursement(); this.getReimbursement();
}, },
methods: { methods: {
//申请报销
addreimbursement() {
this.$router.push({ path: "/reimbursementAdd" });
},
//重置 //重置
reset() { reset() {
this.reimbursementQurey = { this.reimbursementQurey = {
...@@ -693,131 +588,10 @@ export default { ...@@ -693,131 +588,10 @@ export default {
}, },
//搜索 //搜索
query() { query() {
this.reimbursementQurey.pageNum = 1; this.reimbursementQurey.pageNum = 1;
this.getReimbursement(); this.getReimbursement();
}, },
//图片格式
formatProtocolType(row) {
//这里判断的是是否有文件
if (row.filePath == null) {
return flase;
} else {
let fileNamepdf = row.filePath;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType != ".pdf") {
return true;
} else {
return false;
}
}
},
//添加
submit() {
this.dialogVisible = false;
let list = [];
this.invoiceQurey.fromList.forEach((item) => {
list.push({
invoiceId: item,
reimbursementId: this.invoiceQurey.reimbursementId,
status: 1,
});
});
updatesubmit(list).then((res) => {
if (res.success) {
this.getinvoive({
reimbursementId: this.invoiceQurey.reimbursementId,
});
this.this.$refs.form.resetFields();
this.$message.success(res.msg);
} else {
this.$message.error("发票上传失败!");
}
});
},
//查询发票编号
Selectinvoielsit() {
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.getinvoivelist = res.data;
} else {
this.$message.error(res.msg);
this.back();
}
})
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
},
//添加发票号码
addinvoice() {
this.dialogVisible = true;
this.Selectinvoielsit();
},
//获取发票号列表详情
getinvoive(data) {
this.drawer1 = true;
this.invoiceQurey.reimbursementId = data.reimbursementId;
selectAllById(this.invoiceQurey).then((res) => {
console.log(res);
if (res.success) {
this.invoicelist = res.data;
console.log(res.data.length);
if (res.data.length <= 1) {
this.isDisabledDel = true;
} else {
this.isDisabledDel = false;
}
} else {
this.$message.error(res.msg);
}
});
},
//删除关系
delinvoice(data) {
this.$confirm("是否同意删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
deletBystatus(data).then((res) => {
if (res.success) {
this.getinvoive(data);
}
});
});
},
//查看详情
getdetails(data) {
this.drawer = true;
let param = {
reimbursementId: data.reimbursementId,
}; //接口是一个以对象的形式传值 所以定义了一个对象去拿这个参数
selectByReimbursementId(param)
.then((res) => {
if (res.success) {
//获取数据
console.log(res);
this.reimbursementDetails.list = res.data; //接口返回res里面
}
})
.catch((error) => {
this.$message.error("查询失败");
});
},
//申请报销
addreimbursement() {
this.$router.push({ path: "/reimbursementAdd" });
},
//获取申请报销列表 //获取申请报销列表
getReimbursement() { getReimbursement() {
queryBypage(this.reimbursementQurey) queryBypage(this.reimbursementQurey)
...@@ -826,6 +600,11 @@ export default { ...@@ -826,6 +600,11 @@ export default {
this.reimbursementList = res.data.list; this.reimbursementList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
} else { } else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
...@@ -833,33 +612,90 @@ export default { ...@@ -833,33 +612,90 @@ export default {
this.$message.error("回去数据失败"); this.$message.error("回去数据失败");
}); });
}, },
//修改信息 //时间处理
updataReimbursement(data) { timestampToTime(row, column, cellValue) {
//data是列表中所有的数据 return cellValue.split(" ")[0];
console.log(data);
this.$router.push({
path: "/reimbursementUpdata",
//query 找到我们需要的字段
query: {
reimbursementId: data.reimbursementId, //传那一行数据的id
projectId: data.projectId, //项目id 下拉框根据项目id选择
typeId: data.typeId, //报销类别id
money: data.money, //备注
applyTotalAmountLarge: data.applyTotalAmountLarge, //大写金额
applyTotalAmountSmall: data.applyTotalAmountSmall, //小写金额
summary: data.summary, //摘要
paymentMethod: data.paymentMethod, //支付方式
},
});
}, },
//换页 //换页
handleCurrentChange(val) { handleCurrentChange(val) {
this.reimbursementQurey.pageNum = val; this.reimbursementQurey.pageNum = val;
this.getReimbursement(); this.getReimbursement();
}, },
//时间处理 //点击查看发票图片
timestampToTime(row, column, cellValue) { ReviseImage(row) {
return cellValue.split(" ")[0]; this.invoiceShow = true;
this.getinvoiveId.reimbursementId = row.reimbursementId;
this.Selectinsertlsit();
},
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId).then((res) => {
if (res.success) {
this.getinvoivelist = res.data;
this.getinvoivelist.forEach((e) => {
let Newfilepath = e.filePath;
let filepdf = Newfilepath.substring(Newfilepath.lastIndexOf("."));
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
if (filepdf != ".pdf") {
this.srcList.push(url);
}
}
});
});
}
});
},
//图片样式
formatProtocolType(row) {
//这里判断的是是否有文件
if (row.filePath == null) {
return flase;
} else {
let Newfilepath = row.filePath;
let filepdf = Newfilepath.substring(Newfilepath.lastIndexOf("."));
if (filepdf != ".pdf") {
return true;
} else {
return false;
}
}
},
//pdf样式,展示
handlePreView(row) {
const photopath = row.fileUrl;
window.open(photopath, "_blank");
},
//返回添加发票列表
returnlist() {
this.getinvoive(data);
},
//撤回
withdraw(data) {
this.$confirm("是否同意撤回?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
reimbursementId(data.reimbursementId).then((res) => {
if (res.success) {
this.getReimbursement();
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
})
.catch((error) => {
this.$message("取消撤回申请");
// this.back();
});
}, },
//重新提交 //重新提交
Resubmit(data) { Resubmit(data) {
...@@ -881,6 +717,11 @@ export default { ...@@ -881,6 +717,11 @@ export default {
this.$message.success("重新提交成功,等待审批"); this.$message.success("重新提交成功,等待审批");
this.getReimbursement(); this.getReimbursement();
} else { } else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
...@@ -888,73 +729,37 @@ export default { ...@@ -888,73 +729,37 @@ export default {
this.$message.error("重新提交失败"); this.$message.error("重新提交失败");
}); });
}, },
//撤回 //查看报销项详情
withdraw(data) { getdetails(data) {
this.$confirm("是否同意撤回?", "提示", { this.drawer = true;
confirmButtonText: "确定", let param = {
cancelButtonText: "取消", reimbursementId: data.reimbursementId,
type: "warning", }; //接口是一个以对象的形式传值 所以定义了一个对象去拿这个参数
}).then(() => { selectByReimbursementId(param)
reimbursementId(data.reimbursementId).then((res) => {
if (res.success) {
this.getReimbursement();
}
});
});
},
//查看图片的方法
ReviseImage(row) {
// console.log(row)
this.invoiceShow = true;
this.getinvoiveId.reimbursementId = row.reimbursementId;
this.Selectinsertlsit();
},
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.reimbursementDetails.list = res.data;
this.getinvoivelist.forEach((e) => {
// console.log("------------")
// console.log(e.filePath)
// console.log("------------")
let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
console.log(url);
if (fileType != ".pdf") {
this.srcList.push(url);
}
}
});
});
} else { } else {
this.$message.error(res.msg); if (res.code == 4) {
this.back(); //执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((e) => { .catch((error) => {
this.$message.error("获取发票图片失败"); this.$message.error("查询失败");
this.back();
}); });
}, },
//pdf,展示 //附件添加
handlePreView(row) { addenclosure() {
const photopath = row.fileUrl; this.getshow = 0;
window.open(photopath, "_blank"); this.disabled = true;
this.delfile1();
}, },
//附件的显示
///----附件区域 getenclosure(row) {
this.drawer2 = true;
//查看项目附件.....
selectImage(row) {
console.log(row);
if ( if (
row.reimbursementState == 1 || row.reimbursementState == 1 ||
row.reimbursementState == 3 || row.reimbursementState == 3 ||
...@@ -965,22 +770,25 @@ export default { ...@@ -965,22 +770,25 @@ export default {
} else { } else {
this.isDisabled = false; this.isDisabled = false;
} }
this.queryDTO.reimbursementId = row.reimbursementId; (this.queryDTO.reimbursementId = row.reimbursementId),
this.proutlist1.Id = row.reimbursementId; (this.enclosurelist.Id = row.reimbursementId);
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.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.getshow = 1; this.getshow = 1;
this.disabled = false; this.disabled = false;
} else { } else {
this.drawer2 = true;
this.disabled = false; this.disabled = false;
this.getshow = 3; this.getshow = 3;
} }
} else { } else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
...@@ -988,27 +796,34 @@ export default { ...@@ -988,27 +796,34 @@ export default {
this.$message.error("获取附件文件失败"); this.$message.error("获取附件文件失败");
}); });
}, },
//下载附件 //清除附件文件
async delProject(row) { delfile1(file) {
console.log(row); this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
var a = document.createElement("a"); //创建一个<a></a>标 this.fileTypepdf = false;
a.href = (await getFileUrl(row.enclosureFile)).data;
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签
}, },
//显示添加附件 //附件的刷新
updatecard() { Refresh() {
this.getshow = 0; this.queryDTO.reimbursementId = this.enclosurelist.Id;
this.disabled = true; selectByIdF(this.queryDTO)
this.delfile1(); .then((res) => {
if (res.success) {
this.queryDTOList = res.data;
this.enclosurelist.enclosureDescribe = ""; //初始化数据
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取附件文件失败");
});
}, },
//删除附件 //删除附件
deleteProject(row) { delenclosure(row) {
// this.submissionFlag = true;
if ( if (
row.reimbursementState == 1 || row.reimbursementState == 1 ||
row.reimbursementState == 3 || row.reimbursementState == 3 ||
...@@ -1022,30 +837,43 @@ export default { ...@@ -1022,30 +837,43 @@ export default {
deleteById(row) deleteById(row)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.selectImage(row); this.getenclosure(row);
this.$message({ this.$message({
message: "删除成功", message: "删除成功",
type: "success", type: "success",
}); });
this.visible = false; this.visible = false;
console.log(res.msg); // console.log(res.msg);
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((errror) => { .catch((error) => {
this.$message.error(res.msg); this.$message.success("删除成功");
}); });
}, },
//清除附件文件 //取消附件的添加啊
delfile1(file) { cancel() {
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid); if (this.queryDTOList.length > 0) {
this.fileTypepdf = false; this.getshow = 1;
this.disabled = false;
this.delfile1();
} else {
this.getshow = 3;
this.disabled = false;
this.delfile1();
}
}, },
//确定提交附件 //确定添加附件
determine() { determine() {
//判断是否有附件文件 //判断是否有附件文件
if (this.fileTypepdf) { if (this.fileTypepdf) {
this.proutlist1.userId = this.$store.getters.urId; this.enclosurelist.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId; this.enclosurelist.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;
...@@ -1059,39 +887,8 @@ export default { ...@@ -1059,39 +887,8 @@ export default {
this.$message.error("请添加附件,在进行提交"); this.$message.error("请添加附件,在进行提交");
} }
}, },
//刷新附件 //附件文件的校验
Refresh() {
console.log(this.proutlist1.Id);
this.queryDTO.reimbursementId = this.proutlist1.Id;
console.log(this.proutlist1.Id);
selectByIdF(this.queryDTO)
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
//附件取消
remove() {
if (this.queryDTOList.length > 0) {
this.getshow = 1;
this.disabled = false;
this.delfile1();
} else {
this.getshow = 3;
this.disabled = false;
this.delfile1();
}
},
//附件文件校验
onChangepdf(file) { onChangepdf(file) {
console.log(this.proutlist1);
const fileNamepdf = file.name; const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf(".")); let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType != "") { if (fileType != "") {
...@@ -1102,6 +899,37 @@ export default { ...@@ -1102,6 +899,37 @@ export default {
this.fileTypepdf = false; this.fileTypepdf = false;
} }
}, },
//附件的下载
async loadenclosure(row) {
//下载附件
var a = document.createElement("a"); //创建一个<a></a>标
a.href = (await getFileUrl(row.enclosureFile)).data;
a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签
},
//修改信息
updataReimbursement(data) {
//data是列表中所有的数据
console.log(data);
this.$router.push({
path: "/reimbursementUpdata",
//query 找到我们需要的字段
query: {
reimbursementId: data.reimbursementId, //传那一行数据的id
projectId: data.projectId, //项目id 下拉框根据项目id选择
typeId: data.typeId, //报销类别id
money: data.money, //备注
applyTotalAmountLarge: data.applyTotalAmountLarge, //大写金额
applyTotalAmountSmall: data.applyTotalAmountSmall, //小写金额
summary: data.summary, //摘要
paymentMethod: data.paymentMethod, //支付方式
},
});
},
}, },
}; };
</script> </script>
...@@ -1110,38 +938,49 @@ export default { ...@@ -1110,38 +938,49 @@ export default {
.container { .container {
padding: 10px; padding: 10px;
} }
.conter { .conter {
margin-bottom: 10px; margin-bottom: 10px;
} }
.footer { .footer {
text-align: right; text-align: right;
} }
.lsitall .el-col { .lsitall .el-col {
margin: 20px 10px; margin: 20px 10px;
} }
.lsitall .el-button { .lsitall .el-button {
margin-left: 16px; margin-left: 16px;
} }
.row-bg { .row-bg {
margin-left: 15%; margin-left: 15%;
} }
.dialog-footer { .dialog-footer {
width: 90%; width: 90%;
margin: 20px 5%; margin: 20px 5%;
} }
.lsitall .el-col { .lsitall .el-col {
margin: 20px 10px; margin: 20px 10px;
} }
.lsitall .el-button { .lsitall .el-button {
margin-left: 16px; margin-left: 16px;
} }
.row-bg { .row-bg {
margin-left: 15%; margin-left: 15%;
} }
.dialog-footer { .dialog-footer {
width: 90%; width: 90%;
margin: 20px 5%; margin: 20px 5%;
} }
.cd { .cd {
width: 90%; width: 90%;
margin: 30px 5%; margin: 30px 5%;
......
<template> <template>
<div class="container"> <div class="container">
<div class="box"> <div class="box">
<el-form <el-row :gutter="24">
ref="form" <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
:model="from" <el-form
:inline="true" ref="form"
label-width="150px" :model="from"
:rules="rules" :inline="true"
> label-width="150px"
<el-form-item label="实际报销人" prop="userName"> :rules="rules"
<el-input v-model="from.userName" disabled></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="userPhone">
<el-input v-model="from.userPhone" disabled></el-input>
</el-form-item>
<el-form-item label="项目名称" prop="projectId">
<el-select v-model="from.projectId" placeholder="请选择">
<el-option
v-for="item in projectList"
:key="item.projectId"
:label="item.projectName"
:value="item.projectId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="摘要" prop="summary">
<el-input v-model="from.summary"></el-input>
</el-form-item>
<el-form-item label="报销总金额-大写(元)" prop="applyTotalAmountLarge" >
<el-input v-model="from.applyTotalAmountLarge" disabled ></el-input>
</el-form-item>
<el-form-item label="报销总金额-小写(元)" prop="applyTotalAmountSmall">
<el-input v-model="from.applyTotalAmountSmall"
@change="convertCurrency(from.applyTotalAmountSmall)"
></el-input>
</el-form-item>
<el-form-item label="支付方式" prop="paymentMethod">
<el-input v-model="from.paymentMethod" ></el-input>
</el-form-item>
<br />
<el-form-item>
<el-button type="success" icon="el-icon-upload2" @click="updateForm()">修改</el-button>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form>
</div>
<div class="spend">
<el-form
:model="reimbursementItemData"
:inline="true"
ref="details"
label-width="150px">
<el-row
v-for="(item, index) in reimbursementItemData.list"
:key="index"
> >
<el-col> <el-form-item label="实际报销人" prop="userName">
<el-form-item <el-input v-model="from.userName" disabled></el-input>
:label="item.name" </el-form-item>
:prop="'list.' + index + '.money'" <el-form-item label="联系电话" prop="userPhone">
:rules="{ validator: moneyrow, trigger: 'blur' ,required: true,}" <el-input v-model="from.userPhone" disabled></el-input>
</el-form-item>
<el-form-item label="项目名称" prop="projectId">
<el-select v-model="from.projectId" placeholder="请选择">
<el-option
v-for="item in projectList"
:key="item.projectId"
:label="item.projectName"
:value="item.projectId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="摘要" prop="summary">
<el-input v-model="from.summary"></el-input>
</el-form-item>
<el-form-item
label="报销总金额-大写(元)"
prop="applyTotalAmountLarge"
>
<el-input
v-model="from.applyTotalAmountLarge"
disabled
></el-input>
</el-form-item>
<el-form-item
label="报销总金额-小写(元)"
prop="applyTotalAmountSmall"
>
<el-input
v-model="from.applyTotalAmountSmall"
@change="convertCurrency(from.applyTotalAmountSmall)"
></el-input>
</el-form-item>
<el-form-item prop="invoiceIdList" label="发票号码">
<el-select
v-model="from.invoiceIdList"
multiple
required
filterable
default-first-option
placeholder="请选择发票号码"
@change="getmoney()"
>
<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-item label="支付方式" prop="paymentMethod">
<el-input v-model="from.paymentMethod"></el-input>
</el-form-item>
<br />
<el-form-item>
<el-button
type="success"
icon="el-icon-upload2"
@click="updateForm()"
>修改</el-button
>
<el-button
type="info"
icon="el-icon-refresh-left"
@click="resetForm()"
>重置信息</el-button
>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form>
</el-col>
<!-- 报销项 -->
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
<div>
<el-form
:model="from"
:inline="true"
ref="details"
label-width="150px"
>
<el-row
v-for="(item, index) in from.reimbursementDetailsList"
:key="index"
> >
<el-input v-model="item.money"><i slot="suffix" style="font-style:normal;margin-right: 10px;"></i></el-input> <el-col>
</el-form-item> <el-form-item
<el-form-item label="备注"> :label="item.name"
<el-input v-model="item.remarks"></el-input> :prop="'reimbursementDetailsList.' + index + '.money'"
</el-form-item> :rules="{
</el-col> validator: moneyrow,
</el-row> trigger: 'blur',
</el-form></div> required: true,
}"
>
<el-input v-model="item.money"
><i
slot="suffix"
style="font-style: normal; margin-right: 10px"
></i
></el-input
>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="item.remarks"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-col>
</el-row>
</div>
</div> </div>
</template> </template>
<script> <script>
import { selectById } from "@/api/company"; import { selectById } from "@/api/company";
import {selectById as reimbursementSelectById,update} from "@/api/reimbursement" import {
import {money} from "@/utils/myValidate"; selectById as reimbursementSelectById,
import { selectAll as projectSelectAll } from "@/api/project"; update,
} from "@/api/reimbursement";
import { money } from "@/utils/myValidate";
import { selectAll as projectSelectAll, selectAllById } from "@/api/project";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
import { update as detailsUpdate } from "@/api/reimbursementDetails";
import { import {
insertList,
queryBypageIncomeAdd,
selectAllBystatus, selectAllBystatus,
} from "@/api/project"; } from "@/api/project";
export default { export default {
data() { data() {
return { return {
reimbursementItemData: { reimbursementItemData: {
list: [], list: [],
}, },
reimbursementItemList:[], reimbursementItemList: [],
company:{}, company: {},
timeNow:null, timeNow: null,
projectList:[], projectList: [],
typeList:[], typeList: [],
from:{ from: {
userName:null,//申报人 userName: null, //申报人
userPhone:null,//联系电话 userPhone: null, //联系电话
userId:null,//申报人Id userId: null, //申报人Id
officeExpenses:0,//办公费 summary: null, //摘要
printingFee:0,//版面复印打印费 enclosureNumber: 0, //附件数量
consultingFee:0,//咨询费 fillingTime: null, //填报日期
serviceCharge:0,//手续费 applyTotalAmountLarge: null, //申请报销总金额(大写)
postage:0,//邮电费 applyTotalAmountSmall: null, //申请报销总金额(小写)
trafficExpense:0,//交通费 paymentMethod: null, //支付方式
maintenanceCost:0,//维修(护)费 reimbursementState: 0, //状态
rentalFee:0,//租赁费 projectId: null, //项目id
conferenceExpenses:0,//会议费 typeId: null, //报销类别id
trainingFee:0,//培训费 invoiceId: null,
entertainmentExpenses:0,//招待费 money: "", //备注
specialMaterialCost:0,//专用材料费 fromList: [], //发票号码
serviceFee:0,//劳务费 invoiceIdList: [], //发票号码
travelExpenses:0,//差旅费 reimbursementDetailsList: [], //报销项
other:0,//其他
entrustedBusinessFee:0,//委托业务费
summary:null,//摘要
enclosureNumber:0,//附件数量
fillingTime:null,//填报日期
applyTotalAmountLarge:null,//申请报销总金额(大写)
applyTotalAmountSmall:null,//申请报销总金额(小写)
paymentMethod:null,//支付方式
reimbursementState:0,//状态
projectId:null,//项目id
typeId:null,//报销类别id
invoiceId:null,
money: "",//备注
}, },
//发票编号数组 //发票编号数组
getinvoivelist: [], getinvoivelist: [],
rules:{ invoiceQurey: {
typeId:[ companyId: null,
{ required: true, message: '请选择报销类别', trigger: 'change'} reimbursementId: null,
},
rules: {
typeId: [
{ required: true, message: "请选择报销类别", trigger: "change" },
], ],
projectId:[ projectId: [
{ required: true, message: '请选择项目', trigger: 'change' } { required: true, message: "请选择项目", trigger: "change" },
], ],
applyTotalAmountLarge:[ applyTotalAmountLarge: [
{ required: true, message: "请输入申请报销总金额(大写)", trigger: "blur" }, {
required: true,
message: "请输入申请报销总金额(大写)",
trigger: "blur",
},
], ],
applyTotalAmountSmall: [ applyTotalAmountSmall: [
{ validator: money, trigger: "blur", required: true }, { validator: money, trigger: "blur", required: true },
], ],
entrustedBusinessFee:[ invoiceIdList:[
{ validator:money, trigger: "blur" }, {required: true, message: "请选择发票号码", trigger: "change" }
], ]
other:[ },
{ validator:money, trigger: "blur" }, getlist:[],
],
travelExpenses:[
{ validator:money, trigger: "blur" },
],
serviceFee:[
{ validator:money, trigger: "blur" },
],
specialMaterialCost:[
{ validator:money, trigger: "blur" },
],
entertainmentExpenses:[
{ validator:money, trigger: "blur" },
],
trainingFee:[
{ validator:money, trigger: "blur" },
],
conferenceExpenses:[
{ validator:money, trigger: "blur" },
],
rentalFee:[
{ validator:money, trigger: "blur" },
],
maintenanceCost:[
{ validator:money, trigger: "blur" },
],
trafficExpense:[
{ validator:money, trigger: "blur" },
],
postage:[
{ validator:money, trigger: "blur" },
],
serviceCharge:[
{ validator:money, trigger: "blur" },
],
consultingFee:[
{ validator:money, trigger: "blur" },
],
printingFee:[
{ validator:money, trigger: "blur" },
],
officeExpenses:[
{ validator:money, trigger: "blur" },
],
}
}; };
}, },
created() { created() {
...@@ -204,12 +210,13 @@ export default { ...@@ -204,12 +210,13 @@ export default {
this.from.userId = this.$store.getters.info.userId; this.from.userId = this.$store.getters.info.userId;
this.from.userName = this.$store.getters.info.userName; this.from.userName = this.$store.getters.info.userName;
this.from.userPhone = this.$store.getters.info.userPhone; this.from.userPhone = this.$store.getters.info.userPhone;
this.from.money=this.$store.getters.info.money this.from.money = this.$store.getters.info.money;
this.getFrom() this.from.fromList = this.$store.getters.info.fromList;
// this.getTypeList() this.getFrom();
this.getReimbursement() this.getReimbursement();
this.getProject() this.getProject();
this.Selectinsertlsit() this.Selectinsertlsit();
}, },
computed: { computed: {
reimbursementId() { reimbursementId() {
...@@ -220,12 +227,12 @@ export default { ...@@ -220,12 +227,12 @@ export default {
// //
//获取报销类型显示(相当于详情) //获取报销类型显示(相当于详情)
getReimbursement() { getReimbursement() {
selectByReimbursementId({reimbursementId:this.$route.query.reimbursementId}) selectByReimbursementId({
reimbursementId: this.$route.query.reimbursementId,
})
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
//获取数据(把data里的数据放在数组里面) this.from.reimbursementDetailsList = res.data;
this.reimbursementItemData.list=res.data
//[{name:'办公费用',money:18},{name:'办公费用',money:18}]
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
...@@ -235,125 +242,150 @@ export default { ...@@ -235,125 +242,150 @@ export default {
}); });
}, },
//获取报销信息 //获取报销信息
getFrom(){ getFrom() {
//接收query传给我们的值 //接收query传给我们的值
this.from.reimbursementId=this.$route.query.reimbursementId, (this.from.reimbursementId = this.$route.query.reimbursementId),
this.from.projectId=this.$route.query.projectId, (this.from.projectId = this.$route.query.projectId),
this.from.typeId=this.$route.query.typeId, (this.from.typeId = this.$route.query.typeId),
this.from.applyTotalAmountLarge=this.$route.query.applyTotalAmountLarge, (this.from.applyTotalAmountLarge =
this.from.applyTotalAmountSmall=this.$route.query.applyTotalAmountSmall, this.$route.query.applyTotalAmountLarge),
this.from.summary=this.$route.query.summary, (this.from.applyTotalAmountSmall =
this.from.paymentMethod=this.$route.query.paymentMethod this.$route.query.applyTotalAmountSmall),
// this.from.money=this.$route.query.money (this.from.summary = this.$route.query.summary),
this.getReimbursement() (this.from.paymentMethod = this.$route.query.paymentMethod);
this.getReimbursement();
}, },
//获取个人的项目 //获取个人的项目
getProject(){ getProject() {
projectSelectAll({userId:this.from.userId}).then((res)=>{ projectSelectAll({ userId: this.from.userId })
.then((res) => {
if(res.success){ if (res.success) {
// console.log(res.data) this.projectList = res.data;
this.projectList = res.data } else {
}else{ this.$message.error(res.msg);
this.$message.error(res.msg) if (res.code == 4) {
} //执行退出功能
}).catch((error)=>{ this.$store.dispatch("user/logout");
this.$message.error("获取个人项目失败,无法申请报销") this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}) }
}
})
.catch((error) => {
this.$message.error("获取个人项目失败,无法申请报销");
});
}, },
//获取公司名称 //获取公司名称
getCompany() { getCompany() {
selectById({ companyId: this.$store.getters.companyId }) selectById({ companyId: this.$store.getters.companyId })
.then((res) => { .then((res) => {
if (res.status == "success") { if (res.status == "success") {
// console.log(res.data)
this.company = res.data; this.company = res.data;
} else { } else {
this.$message.error(res.data); this.$message.error(res.data);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
this.$message.error("获取公司名称失败"); this.$message.error("获取公司名称失败");
}); });
}, },
//打印 //获取发票金额
billPrintClick() { getmoney() {
const style = "@page {margin:0 10mm};"; this.from.applyTotalAmountSmall = 0;
printJS({ this.from.invoiceIdList.forEach((id)=>{
printable: "printBill", this.getinvoivelist.forEach((e) => {
type: "html", if (e.invoiceId == id) {
headerStyle: "font-size:22px;text-align: center;", this.from.applyTotalAmountSmall += e.mone;
header: this.company.companyName + "日常报销单", }
ignoreElements:['caption','button'], });
targetStyles: ["*"], })
style, if (this.from.invoiceIdList.length == 0) {
}); this.from.applyTotalAmountLarge = null;
}
this.convertCurrency(this.from.applyTotalAmountSmall);
}, },
//修改 //修改
updateForm(){ updateForm() {
//金额的校验 //金额的校验
this.$refs.form.validate((valid)=>{ this.$refs.form.validate((valid) => {
if(valid){//第一次校验左边 if (valid) {
this.$refs.details.validate(valid2=>{ //第一次校验左边
if(valid2){ this.$refs.details.validate((valid2) => {
update(this.from).then((res)=>{ if (valid2) {
if(res.success){ let sumMoney = 0;
this.from.reimbursementDetailsList.forEach((m) => {
detailsUpdate(this.reimbursementItemData.list).then(res=>{ sumMoney += Number(m.money);
if(res.success){//如果第一个方法成功了,就执行第二个方法(第一个方法修改报销信息,第二个方法修改报销详情信息) });
this.$message.success("修改成功,等待审批") if (sumMoney != this.from.applyTotalAmountSmall) {
this.back() this.$message.error("报销项总金额要等于报销总金额");
} return;
}) }
}else{ update(this.from)
this.$message.error(res.msg) .then((res) => {
if (res.success) {
this.$message.success("修改成功,等待审批");
this.back();
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("申请失败");
});
} else {
this.$message.error("金额错误");
} }
}).catch((error)=>{ });
this.$message.error("申请失败")
})
}
else{
this.$message.error("金额错误");
}
})
} }
}) });
}, },
//获取现在时间 //获取现在时间
time(data){ time(data) {
let date = new Date(data); let date = new Date(data);
var Y = date.getFullYear() var Y = date.getFullYear();
var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) var M =
var D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) date.getMonth() + 1 < 10
var h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) ? "0" + (date.getMonth() + 1)
var m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) : date.getMonth() + 1;
var s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds()) var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
this.timeNow = Y+ ''+M+ ''+D +'' var h = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var m =
date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var s =
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.timeNow = Y + "" + M + "" + D + "";
}, },
//返回 //返回
back(){ back() {
this.$store.dispatch('tagsView/delView', this.$route) this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({path: '/reimbursementList'}) this.$router.push({ path: "/reimbursementList" });
}, },
//重置信息 //重置信息
resetForm(){ resetForm() {
this.getFrom() this.getFrom();
this.from.invoiceIdList=this.getlist;
}, },
//查询发票编号 //查询未报销的发票编号
Selectinsertlsit() { Selectinsertlsit() {
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
status: 0, status: 0,
type: 2, type: 2,
userId:this.$store.getters.info.userId, userId: this.$store.getters.info.userId,
}; };
console.log(this.$store.getters.companyId) let list = [];
selectAllBystatus(param) selectAllBystatus(param)
.then((res) => { .then((res) => {
// console.log(res)
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
this.getinvoive({
companyId: this.$store.getters.companyId,
reimbursementId: this.from.reimbursementId,
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
...@@ -364,8 +396,20 @@ export default { ...@@ -364,8 +396,20 @@ export default {
this.back(); this.back();
}); });
}, },
//定义金额校验 //获取已报销的发票
moneyrow(rule, value, callback) { getinvoive(data) {
selectAllById(data).then((res) => {
if (res.success) {
res.data.forEach((e) => {
this.getinvoivelist.push(e)
this.getlist.push(e.invoiceId)
this.from.invoiceIdList.push(e.invoiceId);
});
}
});
},
//定义金额校验
moneyrow(rule, value, callback) {
let RegExp = let RegExp =
/(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^([-]?)(0){1}$)|(^([-]?)[0-9]\.[0-9]([0-9])?$)/; /(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^([-]?)(0){1}$)|(^([-]?)[0-9]\.[0-9]([0-9])?$)/;
// /^(([1-9][0-9]{0,14})|([0]{1})|(([0]\\.\\d{1,2}|[1-9][0-9]{0,14}\\.\\d{1,2})))$/; // /^(([1-9][0-9]{0,14})|([0]{1})|(([0]\\.\\d{1,2}|[1-9][0-9]{0,14}\\.\\d{1,2})))$/;
...@@ -375,6 +419,7 @@ export default { ...@@ -375,6 +419,7 @@ export default {
callback(new Error("金额格式错误")); callback(new Error("金额格式错误"));
} }
}, },
//金额转大小写
convertCurrency(money) { convertCurrency(money) {
//汉字的数字 //汉字的数字
var cnNums = new Array( var cnNums = new Array(
...@@ -476,14 +521,10 @@ export default { ...@@ -476,14 +521,10 @@ export default {
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.container { .container {
padding: 20px; padding: 20px;
} }
</style>
<style scoped>
.clearfloat:after { .clearfloat:after {
/*伪元素是行内元素 正常浏览器清除浮动方法*/ /*伪元素是行内元素 正常浏览器清除浮动方法*/
content: ""; content: "";
...@@ -498,14 +539,6 @@ export default { ...@@ -498,14 +539,6 @@ export default {
.show-border { .show-border {
border: 1px solid black; border: 1px solid black;
} }
.printTable {
float: left;
width: 794px;
height: 1123px;
padding: 20px 80px;
box-sizing: border-box;
font-size: 14px;
}
.table { .table {
margin-bottom: 20px; margin-bottom: 20px;
} }
...@@ -550,34 +583,26 @@ export default { ...@@ -550,34 +583,26 @@ export default {
font-weight: 900; font-weight: 900;
} }
.items { .items {
text-align: center; text-align: center;
} }
.td-input{ .td-input {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
height: 100%; height: 100%;
outline: none; outline: none;
border: none; border: none;
} }
.input{ .input {
outline: none; outline: none;
border: none; border: none;
} }
.box{ .box {
width: 800px; width: 100%;
float: left; float: left;
margin: 60px 0px; margin: 60px 0px;
padding: 20px 10px; padding: 20px 10px;
/* box-sizing: border-box;
border:1px #000 solid; */
border-radius: 30px; border-radius: 30px;
} }
.spend {
width: 800px;
float: left;
margin: 60px 0px;
padding: 20px 10px;
}
</style> </style>
\ No newline at end of file
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
methods: { methods: {
getRoles() { getRoles() {
selectAllByCompanyId({ companyId: this.$store.getters.companyId }).then((res) => { selectAllByCompanyId({ companyId: this.$store.getters.companyId }).then((res) => {
if (res.status == "success") { if (res.success) {
this.rolesList = res.data this.rolesList = res.data
} else { } else {
this.$message.error(res.data) this.$message.error(res.data)
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
if (valida) { if (valida) {
//提交 //提交
insertStaff(this.staffData).then((res) => { insertStaff(this.staffData).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("/staffList") this.$router.push("/staffList")
......
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