Commit 01e9384f authored by 柳 佳乐's avatar 柳 佳乐
Browse files

202211201

parent 979e03ac
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
//重置数据 //重置数据
resetForm(){ resetForm(){
this.$refs.form.resetFields() this.getProject()
}, },
//提交数据 //提交数据
submitForm(){ submitForm(){
......
...@@ -699,11 +699,7 @@ export default { ...@@ -699,11 +699,7 @@ export default {
this.reimbursementDetails.list = res.data; this.reimbursementDetails.list = res.data;
this.$message.success(res.msg); this.$message.success(res.msg);
}else{ }else{
if (res.code == 4) { this.$message.error(res.msg)
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -722,13 +718,8 @@ export default { ...@@ -722,13 +718,8 @@ export default {
if (res.success) { if (res.success) {
//获取数据 //获取数据
this.financeList.list = res.data; this.financeList.list = res.data;
// this.$message.success(res.msg);
}else{ }else{
if (res.code == 4) { this.$message.success(res.msg);
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -754,11 +745,6 @@ export default { ...@@ -754,11 +745,6 @@ 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) => {
...@@ -817,11 +803,6 @@ export default { ...@@ -817,11 +803,6 @@ 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) => {
...@@ -868,11 +849,6 @@ export default { ...@@ -868,11 +849,6 @@ 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) => {
...@@ -944,11 +920,7 @@ export default { ...@@ -944,11 +920,7 @@ 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) => {
...@@ -1075,11 +1047,7 @@ export default { ...@@ -1075,11 +1047,7 @@ 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) => {
...@@ -1115,13 +1083,9 @@ export default { ...@@ -1115,13 +1083,9 @@ export default {
type: "success", type: "success",
}); });
this.visible = false; this.visible = false;
console.log(res.msg);
}else{ }else{
if (res.code == 4) { this.$message.error(res.msg)
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((errror) => { .catch((errror) => {
...@@ -1151,11 +1115,7 @@ export default { ...@@ -1151,11 +1115,7 @@ 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}`);
}
} }
}, },
//刷新附件 //刷新附件
...@@ -1170,11 +1130,7 @@ export default { ...@@ -1170,11 +1130,7 @@ 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) => {
...@@ -1212,11 +1168,7 @@ export default { ...@@ -1212,11 +1168,7 @@ export default {
if (res.success) { if (res.success) {
this.getinvoive(data); this.getinvoive(data);
}else{ }else{
if (res.code == 4) { this.$message.error(res.msg)
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}); });
}, },
......
...@@ -588,11 +588,7 @@ export default { ...@@ -588,11 +588,7 @@ export default {
this.reimbursementDetails.list = res.data; this.reimbursementDetails.list = res.data;
this.$message.success(res.msg); this.$message.success(res.msg);
}else{ }else{
if (res.code == 4) { this.$message.error(res.msg)
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -608,11 +604,6 @@ export default { ...@@ -608,11 +604,6 @@ 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) => {
...@@ -645,11 +636,6 @@ export default { ...@@ -645,11 +636,6 @@ 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) => {
...@@ -693,11 +679,6 @@ export default { ...@@ -693,11 +679,6 @@ 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) => {
...@@ -768,11 +749,6 @@ export default { ...@@ -768,11 +749,6 @@ 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) => {
...@@ -800,11 +776,6 @@ export default { ...@@ -800,11 +776,6 @@ 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) => {
...@@ -841,17 +812,13 @@ export default { ...@@ -841,17 +812,13 @@ export default {
type: "success", type: "success",
}); });
this.visible = false; this.visible = false;
console.log(res.msg);
}else{ }else{
if (res.code == 4) { this.$message.error(res.msg);
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((errror) => { .catch((errror) => {
this.$message.error(res.msg); this.$message.error("删除失败");
}); });
}, },
//清除附件文件 //清除附件文件
...@@ -877,11 +844,7 @@ export default { ...@@ -877,11 +844,7 @@ 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}`);
}
} }
}, },
//刷新附件 //刷新附件
...@@ -896,11 +859,6 @@ export default { ...@@ -896,11 +859,6 @@ 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) => {
...@@ -938,11 +896,7 @@ export default { ...@@ -938,11 +896,7 @@ export default {
if (res.success) { if (res.success) {
this.getinvoive(data); this.getinvoive(data);
}else{ }else{
if (res.code == 4) { this.$message.error(res.msg)
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}); });
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="container" :gutter="20"> <div class="container" :gutter="20">
<div class="box"> <div class="box">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24"> <el-col :xl="12" :lg="10" :md="10" :sm="24" :xs="24">
<el-form <el-form
ref="form" ref="form"
:model="from" :model="from"
...@@ -92,6 +92,8 @@ ...@@ -92,6 +92,8 @@
:action="action1" :action="action1"
:auto-upload="false" :auto-upload="false"
:data="enclosurelist" :data="enclosurelist"
:on-remove="fileError"
:on-success="fileSuccess"
multiple multiple
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
...@@ -123,7 +125,7 @@ ...@@ -123,7 +125,7 @@
</el-form> </el-form>
</el-col> </el-col>
<!-- 右边 --> <!-- 右边 -->
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24"> <el-col :xl="12" :lg="14" :md="14" :sm="24" :xs="24">
<div v-show="subbut"> <div v-show="subbut">
<el-empty description="暂无报销项,因此无法报销"></el-empty> <el-empty description="暂无报销项,因此无法报销"></el-empty>
</div> </div>
...@@ -148,7 +150,7 @@ ...@@ -148,7 +150,7 @@
required: true, required: true,
}" }"
> >
<el-input v-model="item.money" <el-input v-model="item.money" style="width:130px"
><i ><i
slot="suffix" slot="suffix"
style="font-style: normal; margin-right: 10px" style="font-style: normal; margin-right: 10px"
...@@ -156,8 +158,8 @@ ...@@ -156,8 +158,8 @@
></el-input ></el-input
> >
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="说明">
<el-input v-model="item.remarks"></el-input> <el-input v-model="item.remarks" type="textarea" :rows="2" style="width:120%"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -192,7 +194,6 @@ export default { ...@@ -192,7 +194,6 @@ export default {
paymentMethod: null, //支付方式 paymentMethod: null, //支付方式
reimbursementState: 0, //状态 reimbursementState: 0, //状态
projectId: null, //项目id projectId: null, //项目id
fromList: [],
remarks: "", //备注 remarks: "", //备注
enclosureDescribe: "", //附件描述 enclosureDescribe: "", //附件描述
invoiceIdList: [], //发票号码 invoiceIdList: [], //发票号码
...@@ -353,11 +354,6 @@ export default { ...@@ -353,11 +354,6 @@ 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) => {
...@@ -399,6 +395,17 @@ export default { ...@@ -399,6 +395,17 @@ export default {
this.$message.error("获取报销项失败"); this.$message.error("获取报销项失败");
}); });
}, },
//上传失败的回调
fileError(){
this.$message.error("附件上传失败");
},
fileSuccess(res){
if(res.success){
this.$message.success(res.msg)
}else{
this.$message.error(res.msg);
}
},
//定义金额校验 //定义金额校验
moneyrow(rule, value, callback) { moneyrow(rule, value, callback) {
let RegExp = let RegExp =
...@@ -471,7 +478,7 @@ export default { ...@@ -471,7 +478,7 @@ export default {
} }
}); });
}); });
if (this.from.fromList.length == 0) { if (this.from.invoiceIdList.length == 0) {
this.from.applyTotalAmountLarge = null; this.from.applyTotalAmountLarge = null;
} }
this.convertCurrency(this.from.applyTotalAmountSmall); this.convertCurrency(this.from.applyTotalAmountSmall);
...@@ -519,10 +526,6 @@ export default { ...@@ -519,10 +526,6 @@ export default {
//超出最大处理数字 //超出最大处理数字
return ""; return "";
} }
if (money == 0) {
chineseStr = cnNums[0] + cnIntLast + cnInteger;
return chineseStr;
}
//转换为字符串 //转换为字符串
money = money.toString(); money = money.toString();
if (money.indexOf(".") == -1) { if (money.indexOf(".") == -1) {
......
<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
...@@ -479,11 +479,7 @@ ...@@ -479,11 +479,7 @@
<script> <script>
import { queryBypage, reimbursementId, resubmit } from "@/api/reimbursement"; import { queryBypage, reimbursementId, resubmit } from "@/api/reimbursement";
import { import { selectAllById, selectByIdF, deleteById } from "@/api/project";
selectAllById,
selectByIdF,
deleteById,
} from "@/api/project";
import { getFileUrl } from "@/api/companyFile"; import { getFileUrl } from "@/api/companyFile";
import { selectByReimbursementId } from "@/api/reimbursementDetails"; import { selectByReimbursementId } from "@/api/reimbursementDetails";
export default { export default {
...@@ -493,7 +489,7 @@ export default { ...@@ -493,7 +489,7 @@ export default {
reimbursementQurey: { reimbursementQurey: {
userId: null, userId: null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 5,
}, },
//手动下拉框赋值(搜索) //手动下拉框赋值(搜索)
options: [ options: [
...@@ -588,7 +584,6 @@ export default { ...@@ -588,7 +584,6 @@ export default {
}, },
//搜索 //搜索
query() { query() {
this.reimbursementQurey.pageNum = 1; this.reimbursementQurey.pageNum = 1;
this.getReimbursement(); this.getReimbursement();
}, },
...@@ -600,16 +595,11 @@ export default { ...@@ -600,16 +595,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);
} }
}) })
.catch((error) => { .catch((error) => {
this.$message.error("回去数据失败"); this.$message.error("获取数据失败");
}); });
}, },
//时间处理 //时间处理
...@@ -682,13 +672,15 @@ export default { ...@@ -682,13 +672,15 @@ export default {
.then(() => { .then(() => {
reimbursementId(data.reimbursementId).then((res) => { reimbursementId(data.reimbursementId).then((res) => {
if (res.success) { if (res.success) {
if (
this.reimbursementQurey.pageNum != 1 &&
this.reimbursementList.length == 1
) {
this.reimbursementQurey.pageNum--;
}
this.getReimbursement(); this.getReimbursement();
} else { } else {
if (res.code == 4) { this.$message.error(res.msg);
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}); });
}) })
...@@ -717,11 +709,6 @@ export default { ...@@ -717,11 +709,6 @@ 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);
} }
}) })
...@@ -740,11 +727,7 @@ export default { ...@@ -740,11 +727,7 @@ export default {
if (res.success) { if (res.success) {
this.reimbursementDetails.list = res.data; this.reimbursementDetails.list = res.data;
} else { } else {
if (res.code == 4) { this.$message.error(res.msg);
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -755,7 +738,10 @@ export default { ...@@ -755,7 +738,10 @@ export default {
addenclosure() { addenclosure() {
this.getshow = 0; this.getshow = 0;
this.disabled = true; this.disabled = true;
this.delfile1(); // this.$nextTick(()=>{
// this.$refs.upload1.clearFile()
// })
this.clearFile();
}, },
//附件的显示 //附件的显示
getenclosure(row) { getenclosure(row) {
...@@ -784,11 +770,6 @@ export default { ...@@ -784,11 +770,6 @@ export default {
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);
} }
}) })
...@@ -796,31 +777,36 @@ export default { ...@@ -796,31 +777,36 @@ export default {
this.$message.error("获取附件文件失败"); this.$message.error("获取附件文件失败");
}); });
}, },
//清除附件文件 //附件上传失败回调
delfile1(file) { delfile1(file) {
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid); this.$message.error("上传附件失败");
},
//文件清除
clearFile(){
this.fileList1 = []
this.fileTypepdf = false; this.fileTypepdf = false;
this.enclosurelist.enclosureDescribe = "";
}, },
//附件的刷新 //附件的刷新
Refresh() { Refresh(res) {
this.queryDTO.reimbursementId = this.enclosurelist.Id; this.queryDTO.reimbursementId = this.enclosurelist.Id;
selectByIdF(this.queryDTO) if (res.success) {
.then((res) => { selectByIdF(this.queryDTO)
if (res.success) { .then((res) => {
this.queryDTOList = res.data; if (res.success) {
this.enclosurelist.enclosureDescribe = ""; //初始化数据 this.queryDTOList = res.data;
} else { this.enclosurelist.enclosureDescribe = ""; //初始化数据
if (res.code == 4) { } else {
//执行退出功能 this.$message.error(res.msg);
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
} }
this.$message.error(res.msg); })
} .catch((error) => {
}) this.$message.error(error.msg);
.catch((error) => { });
this.$message.error("获取附件文件失败"); } else {
}); this.$message.error(res.msg);
}
}, },
//删除附件 //删除附件
delenclosure(row) { delenclosure(row) {
...@@ -843,13 +829,8 @@ export default { ...@@ -843,13 +829,8 @@ export default {
type: "success", type: "success",
}); });
this.visible = false; this.visible = false;
// console.log(res.msg);
} else { } else {
if (res.code == 4) { this.$message.error(res.msg);
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -861,11 +842,11 @@ export default { ...@@ -861,11 +842,11 @@ export default {
if (this.queryDTOList.length > 0) { if (this.queryDTOList.length > 0) {
this.getshow = 1; this.getshow = 1;
this.disabled = false; this.disabled = false;
this.delfile1(); this.clearFile();
} else { } else {
this.getshow = 3; this.getshow = 3;
this.disabled = false; this.disabled = false;
this.delfile1(); this.clearFile();
} }
}, },
//确定添加附件 //确定添加附件
...@@ -882,7 +863,6 @@ export default { ...@@ -882,7 +863,6 @@ export default {
message: "上传附件成功", message: "上传附件成功",
type: "success", type: "success",
}); });
this.Refresh();
} else { } else {
this.$message.error("请添加附件,在进行提交"); this.$message.error("请添加附件,在进行提交");
} }
...@@ -910,8 +890,8 @@ export default { ...@@ -910,8 +890,8 @@ export default {
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了 a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签 a.remove(); // 一次性的,用完就删除a标签
}, },
//修改信息 //修改信息
updataReimbursement(data) { updataReimbursement(data) {
//data是列表中所有的数据 //data是列表中所有的数据
console.log(data); console.log(data);
this.$router.push({ this.$router.push({
...@@ -926,7 +906,6 @@ export default { ...@@ -926,7 +906,6 @@ export default {
applyTotalAmountSmall: data.applyTotalAmountSmall, //小写金额 applyTotalAmountSmall: data.applyTotalAmountSmall, //小写金额
summary: data.summary, //摘要 summary: data.summary, //摘要
paymentMethod: data.paymentMethod, //支付方式 paymentMethod: data.paymentMethod, //支付方式
}, },
}); });
}, },
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
></el-input ></el-input
> >
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="说明">
<el-input v-model="item.remarks"></el-input> <el-input v-model="item.remarks"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -263,11 +263,6 @@ export default { ...@@ -263,11 +263,6 @@ 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) => {
...@@ -281,12 +276,7 @@ export default { ...@@ -281,12 +276,7 @@ export default {
if (res.status == "success") { if (res.status == "success") {
this.company = res.data; this.company = res.data;
} else { } else {
this.$message.error(res.data); 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) => {
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
if (res.success) { if (res.success) {
this.rolesList = res.data this.rolesList = res.data
} else { } else {
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("查询角色失败") this.$message.error("查询角色失败")
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
this.$store.dispatch('tagsView/delView', this.$route) this.$store.dispatch('tagsView/delView', this.$route)
this.$router.push("/staffList") this.$router.push("/staffList")
} else { } else {
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("添加失败") this.$message.error("添加失败")
......
...@@ -159,7 +159,7 @@ export default { ...@@ -159,7 +159,7 @@ export default {
if (res.success) { if (res.success) {
this.rolesList = res.data; this.rolesList = res.data;
} else { } else {
this.$message.error(res.data); this.$message.error(res.msg);
} }
}) })
.catch(error => { .catch(error => {
...@@ -175,7 +175,7 @@ export default { ...@@ -175,7 +175,7 @@ export default {
this.staffList = res.data.list; this.staffList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
} else { } else {
this.$message.error(res.data); this.$message.error(res.msg);
} }
}) })
.catch(error => { .catch(error => {
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
if (res.success) { if (res.success) {
this.getSatff(); this.getSatff();
} else { } else {
this.$message.error(res.data); this.$message.error(res.msg);
} }
}); });
this.dialogVisible = false; this.dialogVisible = false;
......
...@@ -13,7 +13,11 @@ ...@@ -13,7 +13,11 @@
<el-input v-model="staffData.userName" disabled></el-input> <el-input v-model="staffData.userName" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="员工性别" prop="userSex"> <el-form-item label="员工性别" prop="userSex">
<el-select v-model="staffData.userSex" placeholder="请选择" disabled> <el-select
v-model="staffData.userSex"
placeholder="请选择"
disabled
>
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
...@@ -27,10 +31,13 @@ ...@@ -27,10 +31,13 @@
<el-input v-model="staffData.userAdmin" disabled></el-input> <el-input v-model="staffData.userAdmin" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="员工手机号" prop="userPhone"> <el-form-item label="员工手机号" prop="userPhone">
<el-input v-model="staffData.userPhone" disabled></el-input> <el-input v-model="staffData.userPhone" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="员工身份证" prop="userIdentification"> <el-form-item label="员工身份证" prop="userIdentification">
<el-input v-model="staffData.userIdentification" disabled></el-input> <el-input
v-model="staffData.userIdentification"
disabled
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="员工银行卡号" prop="userBankNumber"> <el-form-item label="员工银行卡号" prop="userBankNumber">
<el-input v-model="staffData.userBankNumber"></el-input> <el-input v-model="staffData.userBankNumber"></el-input>
...@@ -39,8 +46,12 @@ ...@@ -39,8 +46,12 @@
<el-input v-model="staffData.userBankAddress"></el-input> <el-input v-model="staffData.userBankAddress"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="success" icon="el-icon-upload2" @click="update()">提交</el-button> <el-button type="success" icon="el-icon-upload2" @click="update()"
<el-button type="info" icon="el-icon-refresh-left" @click="cancel()">取消</el-button> >提交</el-button
>
<el-button type="info" icon="el-icon-refresh-left" @click="cancel()"
>取消</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
...@@ -48,7 +59,12 @@ ...@@ -48,7 +59,12 @@
<div class="password"> <div class="password">
<p class="title">强制修改密码:</p> <p class="title">强制修改密码:</p>
<el-input v-model="password"></el-input> <el-input v-model="password"></el-input>
<el-button style="margin-top:10px" type="primary" @click="updatePassword()">确认修改</el-button> <el-button
style="margin-top: 10px"
type="primary"
@click="updatePassword()"
>确认修改</el-button
>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -56,133 +72,151 @@ ...@@ -56,133 +72,151 @@
</template> </template>
<script> <script>
import {bankAccountValid} from '@/utils/myValidate' import { bankAccountValid } from "@/utils/myValidate";
import {getOneself,update,staffpassword} from '@/api/user' import { getOneself, update, staffpassword } from "@/api/user";
export default { export default {
data(){ data() {
return{ return {
password:'', password: "",
staffData: { staffData: {
companyId:null, companyId: null,
userName:null, userName: null,
userSex:null, userSex: null,
userAdmin:null, userAdmin: null,
userPassword:null, userPassword: null,
userPhone:null, userPhone: null,
userIdentification:null, userIdentification: null,
userBankNumber:null, userBankNumber: null,
userBankAddress:null, userBankAddress: null,
roles:[], roles: [],
}, },
rolesList:[], rolesList: [],
options: [ options: [
{ {
value: '1', value: "1",
label: "", label: "",
}, },
{ {
value: '0', value: "0",
label: "", label: "",
}, },
], ],
rules: { rules: {
userBankNumber: [ userBankNumber: [
{ required:true, validator:bankAccountValid, trigger:'blur'}, { required: true, validator: bankAccountValid, trigger: "blur" },
], ],
userBankAddress: [ userBankAddress: [
{ required: true, message: "请输入员工开户行", trigger: "blur" }, { required: true, message: "请输入员工开户行", trigger: "blur" },
], ],
roles:[ roles: [
{ type: 'array', required: true, message: '请至少选择一个角色', trigger: 'change' } {
] type: "array",
required: true,
message: "请至少选择一个角色",
trigger: "change",
},
],
}, },
} };
}, },
computed:{ computed: {
userId(){ userId() {
return this.$route.query.id return this.$route.query.id;
} },
}, },
created(){ created() {
this.getStaff();
this.getStaff()
}, },
methods:{ methods: {
getStaff() {
getStaff(){ getOneself({ userId: this.userId })
getOneself({userId:this.userId}).then((res)=>{ .then((res) => {
if(res.success){ if (res.success) {
this.staffData = res.data this.staffData = res.data;
}else{ } else {
this.$message.error(res.data) this.$message.error(res.msg);
} }
}).catch((error)=>{ })
this.$message.error("查询员工信息失败") .catch((error) => {
}) this.$message.error("查询员工信息失败");
});
}, },
cancel(){ cancel() {
this.$store.dispatch('tagsView/delView', this.$route) this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/staffList") this.$router.push("/staffList");
}, },
update(){ update() {
this.$refs.form.validate((valida)=>{ this.$refs.form.validate((valida) => {
if(valida){ if (valida) {
update(this.staffData).then((res)=>{ update(this.staffData)
if(res.success){ .then((res) => {
this.$message.success("修改成功") if (res.success) {
this.$store.dispatch('tagsView/delView', this.$route) this.$message.success("修改成功");
this.$router.push("/staffList") this.$store.dispatch("tagsView/delView", this.$route);
}else{ this.$router.push("/staffList");
this.$message.error(res.data) } else {
} this.$message.error(res.msg);
}).catch((error)=>{ }
this.$message.error("修改失败") })
}) .catch((error) => {
this.$message.error("修改失败");
});
} }
}) });
}, },
updatePassword(){ updatePassword() {
this.$confirm('确认要修改此员工的密码吗?', '提示', { if (this.password != "" && this.password != null) {
confirmButtonText: '确定', this.$confirm("确认要修改此员工的密码吗?", "提示", {
cancelButtonText: '取消', confirmButtonText: "确定",
type: 'warning' cancelButtonText: "取消",
}).then(() => { type: "warning",
let param = { })
staffPassword:this.password, .then(() => {
userId:this.staffData.userId let param = {
} staffPassword: this.password,
staffpassword(param).then((res)=>{ userId: this.staffData.userId,
if(res.success){ };
this.$message.success("修改成功") staffpassword(param)
this.password='' .then((res) => {
}else{ if (res.success) {
this.$message.error(res.data) this.$message.success("修改成功");
} this.password = "";
}).catch(()=>{ } else {
this.$message.error("修改失败") this.$message.error(res.msg);
}
})
.catch(() => {
this.$message.error("修改失败");
});
}) })
}).catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: "info",
message: '已取消修改' message: "已取消修改",
}); });
});
} else {
this.$message({
message: "密码不能为空",
type: "warning",
}); });
} }
} },
} },
};
</script> </script>
<style scoped> <style scoped>
.container{ .container {
padding: 10px; padding: 10px;
} }
.password{ .password {
border: 1px solid black; border: 1px solid black;
padding: 20px; padding: 20px;
border-radius: 10px; border-radius: 10px;
} }
.password>.title{ .password > .title {
margin: 0px 0px 10px 0px; margin: 0px 0px 10px 0px;
font-weight: 600; font-weight: 600;
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
typeList:[ typeList:[
{ {
key:Date.now(), key:Date.now(),
typeCategory:'1', typeCategory:'0',
typeName:'', typeName:'',
companyId:this.$store.getters.companyId, companyId:this.$store.getters.companyId,
} }
...@@ -114,7 +114,6 @@ ...@@ -114,7 +114,6 @@
} }
}) })
.catch(error => { .catch(error => {
console.log(error);
this.$message.error("添加失败"); this.$message.error("添加失败");
}); });
} else { } else {
...@@ -144,7 +143,7 @@ ...@@ -144,7 +143,7 @@
{ {
key:Date.now(), key:Date.now(),
typeName:'', typeName:'',
typeCategory:'1', typeCategory:'0',
companyId:this.$store.getters.companyId, companyId:this.$store.getters.companyId,
} }
); );
......
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