Commit d5d72788 authored by 耿迪迪's avatar 耿迪迪
parents 7ab6a724 36304e55
...@@ -47,17 +47,22 @@ public class TBorrowingApplyForController extends BaseController ...@@ -47,17 +47,22 @@ public class TBorrowingApplyForController extends BaseController
/** /**
* 查询借支申请列表 * 查询借支申请列表
*/ */
@PreAuthorize("@ss.hasPermi('system:for:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TBorrowingApplyFor tBorrowingApplyFor) public TableDataInfo list(TBorrowingApplyFor tBorrowingApplyFor)
{ {
SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser(); SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
int permission=0;
for (int i=0;i<user.getRoles().size();i++){
if ("calculator".equals(user.getRoles().get(i).getRoleKey())){
permission=1;
}
}
if (!"核算部".equals(user.getDept().getDeptName())){ if (!"核算部".equals(user.getDept().getDeptName())){
tBorrowingApplyFor.setBorrowingDeptId(user.getDeptId()); tBorrowingApplyFor.setBorrowingDeptId(user.getDeptId());
} }
startPage(); startPage();
List<TBorrowingApplyFor> list = tBorrowingApplyForService.selectTBorrowingApplyForList(tBorrowingApplyFor); List<TBorrowingApplyFor> list = tBorrowingApplyForService.selectTBorrowingApplyForList(tBorrowingApplyFor);
return getDataTable(list); return getDataTableT(list,permission);
} }
/** /**
...@@ -105,7 +110,6 @@ public class TBorrowingApplyForController extends BaseController ...@@ -105,7 +110,6 @@ public class TBorrowingApplyForController extends BaseController
/** /**
* 修改借支申请 * 修改借支申请
*/ */
@PreAuthorize("@ss.hasPermi('system:for:approved')")
@Log(title = "借支申请", businessType = BusinessType.UPDATE) @Log(title = "借支申请", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public int edit(@RequestBody TBorrowingApplyFor tBorrowingApplyFor) public int edit(@RequestBody TBorrowingApplyFor tBorrowingApplyFor)
...@@ -150,7 +154,6 @@ public class TBorrowingApplyForController extends BaseController ...@@ -150,7 +154,6 @@ public class TBorrowingApplyForController extends BaseController
/** /**
* 删除借支申请 * 删除借支申请
*/ */
@PreAuthorize("@ss.hasPermi('system:for:remove')")
@Log(title = "借支申请", businessType = BusinessType.DELETE) @Log(title = "借支申请", businessType = BusinessType.DELETE)
@DeleteMapping("/{borrowings}") @DeleteMapping("/{borrowings}")
public AjaxResult remove(@PathVariable Long[] borrowings) public AjaxResult remove(@PathVariable Long[] borrowings)
......
...@@ -20,7 +20,7 @@ import com.zehong.common.utils.sql.SqlUtil; ...@@ -20,7 +20,7 @@ import com.zehong.common.utils.sql.SqlUtil;
/** /**
* web层通用数据处理 * web层通用数据处理
* *
* @author zehong * @author zehong
*/ */
public class BaseController public class BaseController
...@@ -86,9 +86,20 @@ public class BaseController ...@@ -86,9 +86,20 @@ public class BaseController
return rspData; return rspData;
} }
protected TableDataInfo getDataTableT(List<?> list,int key)
{
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(list);
rspData.setPermissionSymbol(key);
rspData.setTotal(new PageInfo(list).getTotal());
return rspData;
}
/** /**
* 响应返回结果 * 响应返回结果
* *
* @param rows 影响行数 * @param rows 影响行数
* @return 操作结果 * @return 操作结果
*/ */
...@@ -99,7 +110,7 @@ public class BaseController ...@@ -99,7 +110,7 @@ public class BaseController
/** /**
* 响应返回结果 * 响应返回结果
* *
* @param result 结果 * @param result 结果
* @return 操作结果 * @return 操作结果
*/ */
......
...@@ -5,7 +5,7 @@ import java.util.List; ...@@ -5,7 +5,7 @@ import java.util.List;
/** /**
* 表格分页数据对象 * 表格分页数据对象
* *
* @author zehong * @author zehong
*/ */
public class TableDataInfo implements Serializable public class TableDataInfo implements Serializable
...@@ -24,6 +24,9 @@ public class TableDataInfo implements Serializable ...@@ -24,6 +24,9 @@ public class TableDataInfo implements Serializable
/** 消息内容 */ /** 消息内容 */
private String msg; private String msg;
/**权限符*/
private int permissionSymbol;
/** /**
* 表格数据对象 * 表格数据对象
*/ */
...@@ -33,7 +36,7 @@ public class TableDataInfo implements Serializable ...@@ -33,7 +36,7 @@ public class TableDataInfo implements Serializable
/** /**
* 分页 * 分页
* *
* @param list 列表数据 * @param list 列表数据
* @param total 总记录数 * @param total 总记录数
*/ */
...@@ -43,6 +46,18 @@ public class TableDataInfo implements Serializable ...@@ -43,6 +46,18 @@ public class TableDataInfo implements Serializable
this.total = total; this.total = total;
} }
public static long getSerialVersionUID() {
return serialVersionUID;
}
public int getPermissionSymbol() {
return permissionSymbol;
}
public void setPermissionSymbol(int permissionSymbol) {
this.permissionSymbol = permissionSymbol;
}
public long getTotal() public long getTotal()
{ {
return total; return total;
......
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
<el-table-column label="状态" align="center" prop="eventLevel"> <el-table-column label="状态" align="center" prop="eventLevel">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.approvalStatus == null">-</span> <span v-if="scope.row.approvalStatus == null">-</span>
<span v-if="scope.row.approvalStatus == 1">待核算部核算</span> <span v-if="scope.row.approvalStatus == 1">待核算部审批</span>
<span v-if="scope.row.approvalStatus == 2">通过</span> <span v-if="scope.row.approvalStatus == 2">完成</span>
<span v-if="scope.row.approvalStatus == 3">驳回</span> <span v-if="scope.row.approvalStatus == 3">驳回</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -108,9 +108,8 @@ ...@@ -108,9 +108,8 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
v-if="scope.row.approvalStatus == 1" v-if="scope.row.approvalStatus == 1&&roleKey==1"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:for:approved']"
>审批</el-button> >审批</el-button>
<el-button <el-button
size="mini" size="mini"
...@@ -413,11 +412,11 @@ ...@@ -413,11 +412,11 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer" style="text-align: center" > <div slot="footer" class="dialog-footer" style="text-align: center" >
<el-button v-if="this.form.borrowing !=null" v-hasPermi="['system:for:approved']" type="primary" style="width: 150px" @click="submitForm(2)" <el-button v-if="this.form.borrowing !=null" type="primary" style="width: 150px" @click="submitForm(2)"
>通过</el-button >通过</el-button
> >
<el-button v-if="this.form.borrowing !=null" v-hasPermi="['system:for:approved']" type="primary" style="width: 150px" @click="submitForm(3)" <el-button v-if="this.form.borrowing !=null" type="primary" style="width: 150px" @click="submitForm(3)"
>驳回</el-button >驳回</el-button
> >
<el-button style="width: 150px; border-color: #1890ff; color: #1890ff" @click="cancel">取 消</el-button> <el-button style="width: 150px; border-color: #1890ff; color: #1890ff" @click="cancel">取 消</el-button>
...@@ -510,6 +509,8 @@ export default { ...@@ -510,6 +509,8 @@ export default {
}, },
data() { data() {
return { return {
//权限判断
roleKey:"",
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 导出遮罩层 // 导出遮罩层
...@@ -630,6 +631,9 @@ export default { ...@@ -630,6 +631,9 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listFor(this.queryParams).then(response => { listFor(this.queryParams).then(response => {
console.log(response.permissionSymbol)
this.roleKey=response.permissionSymbol;
this.forList = response.rows; this.forList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
......
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