|
@@ -20,10 +20,18 @@
|
|
|
<el-menu-item index="1-1"><p @click="ssl(0)"> 一般费用填报</p></el-menu-item>
|
|
|
<el-menu-item index="1-2"><p @click="ssl(1)">差旅费用填报</p></el-menu-item>
|
|
|
<el-menu-item index="1-3"><p @click="ssl(2)">外包费用填报</p></el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- <el-menu-item index="2" @select="bills" @click="bills">
|
|
|
+ </el-submenu>
|
|
|
+ <el-submenu index="2" v-if="user.role != 0">
|
|
|
+ <template slot="title">
|
|
|
<i class="iconfont firerock-iconbaoxiaodan"></i>
|
|
|
- <span slot="title">报销单据列表</span>
|
|
|
+ <span>{{user.role == 0?"我的报销单据":"报销单据列表"}}</span>
|
|
|
+ </template>
|
|
|
+ <el-menu-item index="2-1" ><p @click="bills(false)" >单据列表</p></el-menu-item>
|
|
|
+ <el-menu-item index="2-2" ><p @click="bills(true)">单据审核</p></el-menu-item>
|
|
|
+ </el-submenu>
|
|
|
+ <el-menu-item index="3" @select="bills" @click="bills(false)" v-if="user.role == 0">
|
|
|
+ <i class="iconfont firerock-iconbaoxiaodan"></i>
|
|
|
+ <span slot="title">{{user.role == 0?"我的报销单据":"报销单据列表"}}</span>
|
|
|
</el-menu-item>
|
|
|
</el-menu>
|
|
|
<!-- <el-menu
|
|
@@ -59,8 +67,9 @@
|
|
|
<el-form :model="addForm" label-width="80px">
|
|
|
<!-- <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> -->
|
|
|
<!-- 报销人 -->
|
|
|
- <el-form-item label="报销人">
|
|
|
- <el-select v-model="addForm.ownerId" placeholder="请选择报销人" style="width: 150px">
|
|
|
+ <el-form-item label="报销人" >
|
|
|
+ <!--普通员工只能自己填报自己的 -->
|
|
|
+ <el-select v-model="addForm.ownerId" placeholder="请选择报销人" style="width: 150px" :disabled="user.role == 0" filterable="true">
|
|
|
<span v-for="(item, index) in users" :key="index">
|
|
|
<el-option :label="item.name" :value="item.id"></el-option>
|
|
|
</span>
|
|
@@ -219,12 +228,25 @@
|
|
|
<span style="font-size:12px;">{{scope.row.remark}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button icon="el-icon-view" circle size="mini" @click.stop.native="downloadByA(scope.row)"></el-button>
|
|
|
- <el-button icon="el-icon-edit" circle size="mini" style="margin-left:10px;" @click.stop.native="showEditName(scope.row)"></el-button>
|
|
|
- <el-button icon="el-icon-delete" circle size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.row)"></el-button>
|
|
|
-
|
|
|
+ <el-table-column prop="status" label="状态" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.status == 1" class="waiting">{{statusTxt[scope.row.status]}}</span>
|
|
|
+ <span v-if="scope.row.status == 2" class="rejected">{{statusTxt[scope.row.status]}}</span>
|
|
|
+ <span v-if="scope.row.status == 0 || scope.row.status == 3" >{{statusTxt[scope.row.status]}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" :width="isAuditList?220:160">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ <div v-if="!isAuditList">
|
|
|
+ <el-button icon="el-icon-view" circle size="mini" @click.stop.native="downloadByA(scope.row)" ></el-button>
|
|
|
+ <el-button icon="el-icon-edit" circle size="mini" style="margin-left:10px;" @click.stop.native="showEditName(scope.row)" v-show="(scope.row.status == 1 || scope.row.status == 2) || user.role > 0 "></el-button>
|
|
|
+ <el-button icon="el-icon-delete" circle size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.row)" v-show="(scope.row.status == 1 || scope.row.status == 2) || user.role > 0 "></el-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="isAuditList">
|
|
|
+ <el-button size="mini" @click.stop.native="downloadByA(scope.row)" >查看</el-button>
|
|
|
+ <el-button size="mini" style="margin-left:5px;" @click.stop.native="approve(scope.row)" >通过</el-button>
|
|
|
+ <el-button size="mini" style="margin-left:5px;" @click.stop.native="deny(scope.row)" >驳回</el-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -249,9 +271,9 @@
|
|
|
<!-- 内容主体 -->
|
|
|
<div class="informant"><!-- 报销人 -->
|
|
|
<el-form :model="ParticularsList" label-width="80px">
|
|
|
- <el-form-item label="报销人">
|
|
|
- <el-input v-show="flg" v-model="ParticularsList.ownerName" disabled ></el-input>
|
|
|
- <el-select v-show="!flg" v-model="ParticularsList.ownerId" placeholder="请选择报销人" style="width: 150px" :disabled="flg">
|
|
|
+ <el-form-item label="报销人" style="width: 270px">
|
|
|
+ <!-- <el-input v-show="flg" v-model="ParticularsList.ownerName" disabled ></el-input> -->
|
|
|
+ <el-select v-model="ParticularsList.ownerId" placeholder="请选择报销人" style="width: 150px" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId">
|
|
|
<span v-for="(item, index) in users" :key="index">
|
|
|
<el-option :label="item.name" :value="item.id"></el-option>
|
|
|
</span>
|
|
@@ -373,6 +395,9 @@ export default {
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isAuditList: false,
|
|
|
+ statusTxt:["审核通过","待审核", "已驳回", "已撤销"],
|
|
|
+ user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
allExpList:[],
|
|
|
expenseTypeList:[],
|
|
|
tian:{a: null,b: null,c: null,d: null,e: null,f: null,g: null,h: null,},
|
|
@@ -457,6 +482,48 @@ export default {
|
|
|
inpu.value = parseFloat(inpu.value);
|
|
|
}
|
|
|
},
|
|
|
+ approve(item) {
|
|
|
+ //审核通过
|
|
|
+ this.http.post('/expense-sheet/approve', {id:item.id
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deny(item) {
|
|
|
+ //审核驳回
|
|
|
+ this.http.post('/expense-sheet/deny', {id:item.id
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
getExpList() {
|
|
|
this.http.post('/expense-type/getList', {
|
|
|
},
|
|
@@ -493,12 +560,18 @@ export default {
|
|
|
this.getParticulars(val.id)
|
|
|
this.expenseTypeList = this.allExpList.filter(a=>a.mainType == val.type);
|
|
|
},
|
|
|
- staffs() { // 控制员工费用报表
|
|
|
- this.displayTable = false;
|
|
|
+ staffs(key, keyPath) { // 控制员工费用报表
|
|
|
+ if (keyPath[0] == '1') {
|
|
|
+ this.displayTable = false;
|
|
|
+ } else {
|
|
|
+ this.displayTable = true;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
},
|
|
|
- bills() { // 控制
|
|
|
- this.displayTable = true
|
|
|
- this.getList()
|
|
|
+ bills(audit) { // 控制
|
|
|
+ this.isAuditList = audit;
|
|
|
+ this.getList();
|
|
|
+ this.displayTable = true;
|
|
|
},
|
|
|
present(){
|
|
|
this.dialog = false
|
|
@@ -518,7 +591,7 @@ export default {
|
|
|
this.http.post('/expense-sheet/add', this.ParticularsList,
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
- this.bills()
|
|
|
+ this.bills(this.isAuditList);
|
|
|
this.$message({
|
|
|
message: '编辑成功',
|
|
|
type: "success"
|
|
@@ -548,6 +621,10 @@ export default {
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
this.users = res.data.records;
|
|
|
+ if (this.user.role == 0) {
|
|
|
+ this.addForm.ownerId = this.user.id;
|
|
|
+ this.addForm.status = 1;
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -596,13 +673,19 @@ export default {
|
|
|
},
|
|
|
//获取单据列表
|
|
|
getList() {
|
|
|
- this.http.post('/expense-sheet/list', {pageIndex: this.page,
|
|
|
+ var param = {pageIndex: this.page,
|
|
|
pageSize: this.size,
|
|
|
code: this.code,
|
|
|
createDate: this.date,
|
|
|
ownerId:this.ownerId,
|
|
|
type:this.type,
|
|
|
- },
|
|
|
+ };
|
|
|
+ if (this.isAuditList) {
|
|
|
+ param.status = 1;
|
|
|
+ }
|
|
|
+ this.list = [];
|
|
|
+ this.total = 0;
|
|
|
+ this.http.post('/expense-sheet/list', param,
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
this.list = res.data.records;
|
|
@@ -772,6 +855,10 @@ export default {
|
|
|
this.addForm.type = index
|
|
|
this.ins = index;
|
|
|
this.expenseTypeList = this.allExpList.filter(a=>a.mainType == this.ins);
|
|
|
+ if (this.user.role == 0) {
|
|
|
+ this.addForm.ownerId = this.user.id;
|
|
|
+ }
|
|
|
+
|
|
|
this.getNextCode();
|
|
|
},
|
|
|
|
|
@@ -974,5 +1061,10 @@ export default {
|
|
|
margin-left: 50%;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+.waiting {
|
|
|
+ color:orange;
|
|
|
+}
|
|
|
+.rejected {
|
|
|
+ color:red;
|
|
|
+}
|
|
|
</style>
|