Commit d81da5d5 authored by 吴卿华's avatar 吴卿华

借支申请修改

parent 79516b86
......@@ -47,17 +47,22 @@ public class TBorrowingApplyForController extends BaseController
/**
* 查询借支申请列表
*/
@PreAuthorize("@ss.hasPermi('system:for:list')")
@GetMapping("/list")
public TableDataInfo list(TBorrowingApplyFor tBorrowingApplyFor)
{
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())){
tBorrowingApplyFor.setBorrowingDeptId(user.getDeptId());
}
startPage();
List<TBorrowingApplyFor> list = tBorrowingApplyForService.selectTBorrowingApplyForList(tBorrowingApplyFor);
return getDataTable(list);
return getDataTableT(list,permission);
}
/**
......@@ -105,7 +110,6 @@ public class TBorrowingApplyForController extends BaseController
/**
* 修改借支申请
*/
@PreAuthorize("@ss.hasPermi('system:for:approved')")
@Log(title = "借支申请", businessType = BusinessType.UPDATE)
@PutMapping
public int edit(@RequestBody TBorrowingApplyFor tBorrowingApplyFor)
......@@ -150,7 +154,6 @@ public class TBorrowingApplyForController extends BaseController
/**
* 删除借支申请
*/
@PreAuthorize("@ss.hasPermi('system:for:remove')")
@Log(title = "借支申请", businessType = BusinessType.DELETE)
@DeleteMapping("/{borrowings}")
public AjaxResult remove(@PathVariable Long[] borrowings)
......
......@@ -20,7 +20,7 @@ import com.zehong.common.utils.sql.SqlUtil;
/**
* web层通用数据处理
*
*
* @author zehong
*/
public class BaseController
......@@ -86,9 +86,20 @@ public class BaseController
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 影响行数
* @return 操作结果
*/
......@@ -99,7 +110,7 @@ public class BaseController
/**
* 响应返回结果
*
*
* @param result 结果
* @return 操作结果
*/
......
......@@ -5,7 +5,7 @@ import java.util.List;
/**
* 表格分页数据对象
*
*
* @author zehong
*/
public class TableDataInfo implements Serializable
......@@ -24,6 +24,9 @@ public class TableDataInfo implements Serializable
/** 消息内容 */
private String msg;
/**权限符*/
private int permissionSymbol;
/**
* 表格数据对象
*/
......@@ -33,7 +36,7 @@ public class TableDataInfo implements Serializable
/**
* 分页
*
*
* @param list 列表数据
* @param total 总记录数
*/
......@@ -43,6 +46,18 @@ public class TableDataInfo implements Serializable
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()
{
return total;
......
......@@ -91,8 +91,8 @@
<el-table-column label="状态" align="center" prop="eventLevel">
<template slot-scope="scope">
<span v-if="scope.row.approvalStatus == null">-</span>
<span v-if="scope.row.approvalStatus == 1">待核算部核算</span>
<span v-if="scope.row.approvalStatus == 2">通过</span>
<span v-if="scope.row.approvalStatus == 1">待核算部审批</span>
<span v-if="scope.row.approvalStatus == 2">完成</span>
<span v-if="scope.row.approvalStatus == 3">驳回</span>
</template>
</el-table-column>
......@@ -108,9 +108,8 @@
size="mini"
type="text"
icon="el-icon-edit"
v-if="scope.row.approvalStatus == 1"
v-if="scope.row.approvalStatus == 1&&roleKey==1"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:for:approved']"
>审批</el-button>
<el-button
size="mini"
......@@ -413,11 +412,11 @@
</el-form>
<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 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 style="width: 150px; border-color: #1890ff; color: #1890ff" @click="cancel">取 消</el-button>
......@@ -510,6 +509,8 @@ export default {
},
data() {
return {
//权限判断
roleKey:"",
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -630,6 +631,9 @@ export default {
getList() {
this.loading = true;
listFor(this.queryParams).then(response => {
console.log(response.permissionSymbol)
this.roleKey=response.permissionSymbol;
this.forList = response.rows;
this.total = response.total;
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