Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
precision-effect
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
precision-effect
Commits
30f81adc
Commit
30f81adc
authored
Jun 16, 2023
by
吴卿华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
借支申请
parent
982bc748
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1462 additions
and
21 deletions
+1462
-21
SysUserController.java
...a/com/zehong/web/controller/system/SysUserController.java
+5
-1
TBorrowingApplyForController.java
.../controller/transaction/TBorrowingApplyForController.java
+142
-0
TBorrowingApplyFor.java
...ain/java/com/zehong/system/domain/TBorrowingApplyFor.java
+244
-0
TBorrowingApplyForMapper.java
...va/com/zehong/system/mapper/TBorrowingApplyForMapper.java
+74
-0
ITBorrowingApplyForService.java
...com/zehong/system/service/ITBorrowingApplyForService.java
+74
-0
TBorrowingApplyForServiceImpl.java
...ng/system/service/impl/TBorrowingApplyForServiceImpl.java
+115
-0
SysUserMapper.xml
...system/src/main/resources/mapper/system/SysUserMapper.xml
+20
-20
TBorrowingApplyForMapper.xml
...main/resources/mapper/system/TBorrowingApplyForMapper.xml
+139
-0
for.js
precision-effect-web/src/api/system/for.js
+53
-0
index.vue
precision-effect-web/src/views/for/index.vue
+596
-0
No files found.
precision-effect-admin/src/main/java/com/zehong/web/controller/system/SysUserController.java
View file @
30f81adc
...
@@ -29,7 +29,7 @@ import com.zehong.system.service.ISysUserService;
...
@@ -29,7 +29,7 @@ import com.zehong.system.service.ISysUserService;
/**
/**
* 用户信息
* 用户信息
*
*
* @author zehong
* @author zehong
*/
*/
@RestController
@RestController
...
@@ -210,4 +210,8 @@ public class SysUserController extends BaseController
...
@@ -210,4 +210,8 @@ public class SysUserController extends BaseController
public
AjaxResult
selectTransactorByDeptId
(
@RequestParam
(
value
=
"deptId"
)
Long
deptId
){
public
AjaxResult
selectTransactorByDeptId
(
@RequestParam
(
value
=
"deptId"
)
Long
deptId
){
return
AjaxResult
.
success
(
userService
.
selectTransactorByDeptId
(
deptId
));
return
AjaxResult
.
success
(
userService
.
selectTransactorByDeptId
(
deptId
));
}
}
}
}
precision-effect-admin/src/main/java/com/zehong/web/controller/transaction/TBorrowingApplyForController.java
0 → 100644
View file @
30f81adc
package
com
.
zehong
.
web
.
controller
.
transaction
;
import
java.util.Date
;
import
java.util.List
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.utils.ServletUtils
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.framework.web.service.TokenService
;
import
com.zehong.system.domain.TCashOperate
;
import
com.zehong.system.service.ITCashOperateService
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.system.domain.TBorrowingApplyFor
;
import
com.zehong.system.service.ITBorrowingApplyForService
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.common.core.page.TableDataInfo
;
/**
* 借支申请Controller
*
* @author zehong
* @date 2023-06-15
*/
@RestController
@RequestMapping
(
"/system/for"
)
public
class
TBorrowingApplyForController
extends
BaseController
{
@Autowired
private
ITBorrowingApplyForService
tBorrowingApplyForService
;
@Autowired
private
TokenService
tokenService
;
@Autowired
private
ITCashOperateService
tCashOperateService
;
/**
* 查询借支申请列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:for:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
TBorrowingApplyFor
tBorrowingApplyFor
)
{
startPage
();
List
<
TBorrowingApplyFor
>
list
=
tBorrowingApplyForService
.
selectTBorrowingApplyForList
(
tBorrowingApplyFor
);
return
getDataTable
(
list
);
}
/**
* 导出借支申请列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:for:export')"
)
@Log
(
title
=
"借支申请"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
TBorrowingApplyFor
tBorrowingApplyFor
)
{
List
<
TBorrowingApplyFor
>
list
=
tBorrowingApplyForService
.
selectTBorrowingApplyForList
(
tBorrowingApplyFor
);
ExcelUtil
<
TBorrowingApplyFor
>
util
=
new
ExcelUtil
<
TBorrowingApplyFor
>(
TBorrowingApplyFor
.
class
);
return
util
.
exportExcel
(
list
,
"借支申请数据"
);
}
/**
* 获取借支申请详细信息
*/
@GetMapping
(
value
=
"/{borrowing}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"borrowing"
)
Long
borrowing
)
{
return
AjaxResult
.
success
(
tBorrowingApplyForService
.
selectTBorrowingApplyForById
(
borrowing
));
}
/**
* 新增借支申请
*/
@Log
(
title
=
"借支申请"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
TBorrowingApplyFor
tBorrowingApplyFor
)
{
// 获取当前用户
SysUser
user
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
()).
getUser
();
if
(
StringUtils
.
isNotNull
(
user
))
{
tBorrowingApplyFor
.
setHandledByUserId
(
user
.
getUserId
());
}
return
toAjax
(
tBorrowingApplyForService
.
insertTBorrowingApplyFor
(
tBorrowingApplyFor
));
}
/**
* 修改借支申请
*/
@PreAuthorize
(
"@ss.hasPermi('system:for:approved')"
)
@Log
(
title
=
"借支申请"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
int
edit
(
@RequestBody
TBorrowingApplyFor
tBorrowingApplyFor
)
{
/**查询部门余额是否足够*/
int
isSufficient
=
tBorrowingApplyForService
.
selectTacc
(
tBorrowingApplyFor
);
SysUser
user
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
()).
getUser
();
tBorrowingApplyFor
.
setApprovedUserId
(
user
.
getUserId
());
//0部门余额不足 1余额足够
if
(
isSufficient
!=
0
){
//修改部门余额
tBorrowingApplyForService
.
deletebBalance
(
tBorrowingApplyFor
);
//修改借支申请表状态
tBorrowingApplyForService
.
updateTBorrowingApplyFor
(
tBorrowingApplyFor
);
TCashOperate
tCashOperate
=
new
TCashOperate
();
tCashOperate
.
setOperateDeptId
(
tBorrowingApplyFor
.
getBorrowingDeptId
());
tCashOperate
.
setOperateType
(
"2"
);
tCashOperate
.
setOperateAmount
(
tBorrowingApplyFor
.
getTotalFigures
());
tCashOperate
.
setIsDel
(
"0"
);
tCashOperate
.
setOperateTime
(
new
Date
());
//增加资金操作记录
tCashOperateService
.
insertTCashOperate
(
tCashOperate
);
return
1
;
}
else
{
tBorrowingApplyFor
.
setApprovalStatus
(
3
);
//修改借支申请表状态
tBorrowingApplyForService
.
updateTBorrowingApplyFor
(
tBorrowingApplyFor
);
return
2
;
}
}
/**
* 删除借支申请
*/
@PreAuthorize
(
"@ss.hasPermi('system:for:remove')"
)
@Log
(
title
=
"借支申请"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{borrowings}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
borrowings
)
{
return
toAjax
(
tBorrowingApplyForService
.
deleteTBorrowingApplyForByIds
(
borrowings
));
}
}
precision-effect-system/src/main/java/com/zehong/system/domain/TBorrowingApplyFor.java
0 → 100644
View file @
30f81adc
package
com
.
zehong
.
system
.
domain
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.zehong.common.annotation.Excel
;
import
com.zehong.common.core.domain.BaseEntity
;
/**
* 借支申请对象 t_borrowing_apply_for
*
* @author zehong
* @date 2023-06-15
*/
public
class
TBorrowingApplyFor
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 借支主键id */
private
Long
borrowing
;
/** 费用名称 */
@Excel
(
name
=
"费用名称"
)
private
String
feeName
;
/** 借支部门id */
@Excel
(
name
=
"借支部门id"
)
private
Long
borrowingDeptId
;
/** 经办人id */
@Excel
(
name
=
"经办人id"
)
private
Long
handledByUserId
;
/** 用途说明 */
@Excel
(
name
=
"用途说明"
)
private
String
applicationDescription
;
/** 使用人id */
@Excel
(
name
=
"使用人id"
)
private
Long
userId
;
/** 大写合计 */
@Excel
(
name
=
"大写合计"
)
private
String
totalWords
;
/** 小写合计 */
@Excel
(
name
=
"小写合计"
)
private
BigDecimal
totalFigures
;
/** 审批人id */
@Excel
(
name
=
"审批人id"
)
private
Long
approvedUserId
;
/** 登记日期 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"登记日期"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
registrationDate
;
/** 附件 */
@Excel
(
name
=
"附件"
)
private
String
attachmentUrl
;
/** 是否删除 0未删除 1删除 */
@Excel
(
name
=
"是否删除 0未删除 1删除"
)
private
String
isDel
;
/**审批状态 1未审批 2审批通过 3审批拒绝 */
private
Integer
approvalStatus
;
private
String
handledByUserIdName
;
private
String
userIdName
;
private
String
ApprovedUserIdName
;
public
String
getHandledByUserIdName
()
{
return
handledByUserIdName
;
}
public
void
setHandledByUserIdName
(
String
handledByUserIdName
)
{
this
.
handledByUserIdName
=
handledByUserIdName
;
}
public
String
getUserIdName
()
{
return
userIdName
;
}
public
void
setUserIdName
(
String
userIdName
)
{
this
.
userIdName
=
userIdName
;
}
public
String
getApprovedUserIdName
()
{
return
ApprovedUserIdName
;
}
public
void
setApprovedUserIdName
(
String
approvedUserIdName
)
{
ApprovedUserIdName
=
approvedUserIdName
;
}
public
static
long
getSerialVersionUID
()
{
return
serialVersionUID
;
}
public
Integer
getApprovalStatus
()
{
return
approvalStatus
;
}
public
void
setApprovalStatus
(
Integer
approvalStatus
)
{
this
.
approvalStatus
=
approvalStatus
;
}
public
void
setBorrowing
(
Long
borrowing
)
{
this
.
borrowing
=
borrowing
;
}
public
Long
getBorrowing
()
{
return
borrowing
;
}
public
void
setFeeName
(
String
feeName
)
{
this
.
feeName
=
feeName
;
}
public
String
getFeeName
()
{
return
feeName
;
}
public
void
setBorrowingDeptId
(
Long
borrowingDeptId
)
{
this
.
borrowingDeptId
=
borrowingDeptId
;
}
public
Long
getBorrowingDeptId
()
{
return
borrowingDeptId
;
}
public
void
setHandledByUserId
(
Long
handledByUserId
)
{
this
.
handledByUserId
=
handledByUserId
;
}
public
Long
getHandledByUserId
()
{
return
handledByUserId
;
}
public
void
setApplicationDescription
(
String
applicationDescription
)
{
this
.
applicationDescription
=
applicationDescription
;
}
public
String
getApplicationDescription
()
{
return
applicationDescription
;
}
public
void
setUserId
(
Long
userId
)
{
this
.
userId
=
userId
;
}
public
Long
getUserId
()
{
return
userId
;
}
public
void
setTotalWords
(
String
totalWords
)
{
this
.
totalWords
=
totalWords
;
}
public
String
getTotalWords
()
{
return
totalWords
;
}
public
void
setTotalFigures
(
BigDecimal
totalFigures
)
{
this
.
totalFigures
=
totalFigures
;
}
public
BigDecimal
getTotalFigures
()
{
return
totalFigures
;
}
public
void
setApprovedUserId
(
Long
approvedUserId
)
{
this
.
approvedUserId
=
approvedUserId
;
}
public
Long
getApprovedUserId
()
{
return
approvedUserId
;
}
public
void
setRegistrationDate
(
Date
registrationDate
)
{
this
.
registrationDate
=
registrationDate
;
}
public
Date
getRegistrationDate
()
{
return
registrationDate
;
}
public
void
setAttachmentUrl
(
String
attachmentUrl
)
{
this
.
attachmentUrl
=
attachmentUrl
;
}
public
String
getAttachmentUrl
()
{
return
attachmentUrl
;
}
public
void
setIsDel
(
String
isDel
)
{
this
.
isDel
=
isDel
;
}
public
String
getIsDel
()
{
return
isDel
;
}
@Override
public
String
toString
()
{
return
"TBorrowingApplyFor{"
+
"borrowing="
+
borrowing
+
", feeName='"
+
feeName
+
'\''
+
", borrowingDeptId="
+
borrowingDeptId
+
", handledByUserId="
+
handledByUserId
+
", applicationDescription='"
+
applicationDescription
+
'\''
+
", userId="
+
userId
+
", totalWords='"
+
totalWords
+
'\''
+
", totalFigures="
+
totalFigures
+
", approvedUserId="
+
approvedUserId
+
", registrationDate="
+
registrationDate
+
", attachmentUrl='"
+
attachmentUrl
+
'\''
+
", isDel='"
+
isDel
+
'\''
+
", approvalStatus="
+
approvalStatus
+
", handledByUserIdName='"
+
handledByUserIdName
+
'\''
+
", userIdName='"
+
userIdName
+
'\''
+
", ApprovedUserIdName='"
+
ApprovedUserIdName
+
'\''
+
'}'
;
}
}
precision-effect-system/src/main/java/com/zehong/system/mapper/TBorrowingApplyForMapper.java
0 → 100644
View file @
30f81adc
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
com.zehong.system.domain.TBorrowingApplyFor
;
/**
* 借支申请Mapper接口
*
* @author zehong
* @date 2023-06-15
*/
public
interface
TBorrowingApplyForMapper
{
/**
* 查询借支申请
*
* @param borrowing 借支申请ID
* @return 借支申请
*/
public
TBorrowingApplyFor
selectTBorrowingApplyForById
(
Long
borrowing
);
/**
* 查询借支申请列表
*
* @param tBorrowingApplyFor 借支申请
* @return 借支申请集合
*/
public
List
<
TBorrowingApplyFor
>
selectTBorrowingApplyForList
(
TBorrowingApplyFor
tBorrowingApplyFor
);
/**
* 新增借支申请
*
* @param tBorrowingApplyFor 借支申请
* @return 结果
*/
public
int
insertTBorrowingApplyFor
(
TBorrowingApplyFor
tBorrowingApplyFor
);
/**
* 修改借支申请
*
* @param tBorrowingApplyFor 借支申请
* @return 结果
*/
public
int
updateTBorrowingApplyFor
(
TBorrowingApplyFor
tBorrowingApplyFor
);
/**
* 删除借支申请
*
* @param borrowing 借支申请ID
* @return 结果
*/
public
int
deleteTBorrowingApplyForById
(
Long
borrowing
);
/**
* 批量删除借支申请
*
* @param borrowings 需要删除的数据ID
* @return 结果
*/
public
int
deleteTBorrowingApplyForByIds
(
Long
[]
borrowings
);
/**
* 查询部门余额是否足够
* @param tBorrowingApplyFor
* @return
*/
int
selectTacc
(
TBorrowingApplyFor
tBorrowingApplyFor
);
/**
* 修改部门余额
* @param tBorrowingApplyFor
*/
void
deletebBalance
(
TBorrowingApplyFor
tBorrowingApplyFor
);
}
precision-effect-system/src/main/java/com/zehong/system/service/ITBorrowingApplyForService.java
0 → 100644
View file @
30f81adc
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.system.domain.TBorrowingApplyFor
;
/**
* 借支申请Service接口
*
* @author zehong
* @date 2023-06-15
*/
public
interface
ITBorrowingApplyForService
{
/**
* 查询借支申请
*
* @param borrowing 借支申请ID
* @return 借支申请
*/
public
TBorrowingApplyFor
selectTBorrowingApplyForById
(
Long
borrowing
);
/**
* 查询借支申请列表
*
* @param tBorrowingApplyFor 借支申请
* @return 借支申请集合
*/
public
List
<
TBorrowingApplyFor
>
selectTBorrowingApplyForList
(
TBorrowingApplyFor
tBorrowingApplyFor
);
/**
* 新增借支申请
*
* @param tBorrowingApplyFor 借支申请
* @return 结果
*/
public
int
insertTBorrowingApplyFor
(
TBorrowingApplyFor
tBorrowingApplyFor
);
/**
* 修改借支申请
*
* @param tBorrowingApplyFor 借支申请
* @return 结果
*/
public
int
updateTBorrowingApplyFor
(
TBorrowingApplyFor
tBorrowingApplyFor
);
/**
* 批量删除借支申请
*
* @param borrowings 需要删除的借支申请ID
* @return 结果
*/
public
int
deleteTBorrowingApplyForByIds
(
Long
[]
borrowings
);
/**
* 删除借支申请信息
*
* @param borrowing 借支申请ID
* @return 结果
*/
public
int
deleteTBorrowingApplyForById
(
Long
borrowing
);
/**
* 查询部门余额是否足够
* @param tBorrowingApplyFor
* @return
*/
int
selectTacc
(
TBorrowingApplyFor
tBorrowingApplyFor
);
/**
* 修改部门余额
* @param tBorrowingApplyFor
*/
void
deletebBalance
(
TBorrowingApplyFor
tBorrowingApplyFor
);
}
precision-effect-system/src/main/java/com/zehong/system/service/impl/TBorrowingApplyForServiceImpl.java
0 → 100644
View file @
30f81adc
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TBorrowingApplyForMapper
;
import
com.zehong.system.domain.TBorrowingApplyFor
;
import
com.zehong.system.service.ITBorrowingApplyForService
;
/**
* 借支申请Service业务层处理
*
* @author zehong
* @date 2023-06-15
*/
@Service
public
class
TBorrowingApplyForServiceImpl
implements
ITBorrowingApplyForService
{
@Autowired
private
TBorrowingApplyForMapper
tBorrowingApplyForMapper
;
/**
* 查询借支申请
*
* @param borrowing 借支申请ID
* @return 借支申请
*/
@Override
public
TBorrowingApplyFor
selectTBorrowingApplyForById
(
Long
borrowing
)
{
return
tBorrowingApplyForMapper
.
selectTBorrowingApplyForById
(
borrowing
);
}
/**
* 查询借支申请列表
*
* @param tBorrowingApplyFor 借支申请
* @return 借支申请
*/
@Override
public
List
<
TBorrowingApplyFor
>
selectTBorrowingApplyForList
(
TBorrowingApplyFor
tBorrowingApplyFor
)
{
return
tBorrowingApplyForMapper
.
selectTBorrowingApplyForList
(
tBorrowingApplyFor
);
}
/**
* 新增借支申请
*
* @param tBorrowingApplyFor 借支申请
* @return 结果
*/
@Override
public
int
insertTBorrowingApplyFor
(
TBorrowingApplyFor
tBorrowingApplyFor
)
{
tBorrowingApplyFor
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
tBorrowingApplyForMapper
.
insertTBorrowingApplyFor
(
tBorrowingApplyFor
);
}
/**
* 修改借支申请
*
* @param tBorrowingApplyFor 借支申请
* @return 结果
*/
@Override
public
int
updateTBorrowingApplyFor
(
TBorrowingApplyFor
tBorrowingApplyFor
)
{
tBorrowingApplyFor
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
tBorrowingApplyForMapper
.
updateTBorrowingApplyFor
(
tBorrowingApplyFor
);
}
/**
* 批量删除借支申请
*
* @param borrowings 需要删除的借支申请ID
* @return 结果
*/
@Override
public
int
deleteTBorrowingApplyForByIds
(
Long
[]
borrowings
)
{
return
tBorrowingApplyForMapper
.
deleteTBorrowingApplyForByIds
(
borrowings
);
}
/**
* 删除借支申请信息
*
* @param borrowing 借支申请ID
* @return 结果
*/
@Override
public
int
deleteTBorrowingApplyForById
(
Long
borrowing
)
{
return
tBorrowingApplyForMapper
.
deleteTBorrowingApplyForById
(
borrowing
);
}
/**
* 查询部门余额是否足够
* @param tBorrowingApplyFor
* @return
*/
@Override
public
int
selectTacc
(
TBorrowingApplyFor
tBorrowingApplyFor
)
{
return
tBorrowingApplyForMapper
.
selectTacc
(
tBorrowingApplyFor
);
}
/**
* 修改部门余额
* @param tBorrowingApplyFor
*/
@Override
public
void
deletebBalance
(
TBorrowingApplyFor
tBorrowingApplyFor
)
{
tBorrowingApplyForMapper
.
deletebBalance
(
tBorrowingApplyFor
);
}
}
precision-effect-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
30f81adc
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<association
property=
"dept"
column=
"dept_id"
javaType=
"SysDept"
resultMap=
"deptResult"
/>
<association
property=
"dept"
column=
"dept_id"
javaType=
"SysDept"
resultMap=
"deptResult"
/>
<collection
property=
"roles"
javaType=
"java.util.List"
resultMap=
"RoleResult"
/>
<collection
property=
"roles"
javaType=
"java.util.List"
resultMap=
"RoleResult"
/>
</resultMap>
</resultMap>
<resultMap
id=
"deptResult"
type=
"SysDept"
>
<resultMap
id=
"deptResult"
type=
"SysDept"
>
<id
property=
"deptId"
column=
"dept_id"
/>
<id
property=
"deptId"
column=
"dept_id"
/>
<result
property=
"parentId"
column=
"parent_id"
/>
<result
property=
"parentId"
column=
"parent_id"
/>
...
@@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"leader"
column=
"leader"
/>
<result
property=
"leader"
column=
"leader"
/>
<result
property=
"status"
column=
"dept_status"
/>
<result
property=
"status"
column=
"dept_status"
/>
</resultMap>
</resultMap>
<resultMap
id=
"RoleResult"
type=
"SysRole"
>
<resultMap
id=
"RoleResult"
type=
"SysRole"
>
<id
property=
"roleId"
column=
"role_id"
/>
<id
property=
"roleId"
column=
"role_id"
/>
<result
property=
"roleName"
column=
"role_name"
/>
<result
property=
"roleName"
column=
"role_name"
/>
...
@@ -44,9 +44,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -44,9 +44,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"dataScope"
column=
"data_scope"
/>
<result
property=
"dataScope"
column=
"data_scope"
/>
<result
property=
"status"
column=
"role_status"
/>
<result
property=
"status"
column=
"role_status"
/>
</resultMap>
</resultMap>
<sql
id=
"selectUserVo"
>
<sql
id=
"selectUserVo"
>
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u
from sys_user u
...
@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
left join sys_role r on r.role_id = ur.role_id
</sql>
</sql>
<select
id=
"selectUserList"
parameterType=
"SysUser"
resultMap=
"SysUserResult"
>
<select
id=
"selectUserList"
parameterType=
"SysUser"
resultMap=
"SysUserResult"
>
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_dept d on u.dept_id = d.dept_id
...
@@ -80,29 +80,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -80,29 +80,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
${params.dataScope}
${params.dataScope}
</select>
</select>
<select
id=
"selectUserByUserName"
parameterType=
"String"
resultMap=
"SysUserResult"
>
<select
id=
"selectUserByUserName"
parameterType=
"String"
resultMap=
"SysUserResult"
>
<include
refid=
"selectUserVo"
/>
<include
refid=
"selectUserVo"
/>
where u.user_name = #{userName}
where u.user_name = #{userName}
</select>
</select>
<select
id=
"selectUserById"
parameterType=
"Long"
resultMap=
"SysUserResult"
>
<select
id=
"selectUserById"
parameterType=
"Long"
resultMap=
"SysUserResult"
>
<include
refid=
"selectUserVo"
/>
<include
refid=
"selectUserVo"
/>
where u.user_id = #{userId}
where u.user_id = #{userId}
</select>
</select>
<select
id=
"checkUserNameUnique"
parameterType=
"String"
resultType=
"int"
>
<select
id=
"checkUserNameUnique"
parameterType=
"String"
resultType=
"int"
>
select count(1) from sys_user where user_name = #{userName} limit 1
select count(1) from sys_user where user_name = #{userName} limit 1
</select>
</select>
<select
id=
"checkPhoneUnique"
parameterType=
"String"
resultMap=
"SysUserResult"
>
<select
id=
"checkPhoneUnique"
parameterType=
"String"
resultMap=
"SysUserResult"
>
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
</select>
</select>
<select
id=
"checkEmailUnique"
parameterType=
"String"
resultMap=
"SysUserResult"
>
<select
id=
"checkEmailUnique"
parameterType=
"String"
resultMap=
"SysUserResult"
>
select user_id, email from sys_user where email = #{email} limit 1
select user_id, email from sys_user where email = #{email} limit 1
</select>
</select>
<insert
id=
"insertUser"
parameterType=
"SysUser"
useGeneratedKeys=
"true"
keyProperty=
"userId"
>
<insert
id=
"insertUser"
parameterType=
"SysUser"
useGeneratedKeys=
"true"
keyProperty=
"userId"
>
insert into sys_user(
insert into sys_user(
<if
test=
"userId != null and userId != 0"
>
user_id,
</if>
<if
test=
"userId != null and userId != 0"
>
user_id,
</if>
...
@@ -134,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -134,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate()
sysdate()
)
)
</insert>
</insert>
<update
id=
"updateUser"
parameterType=
"SysUser"
>
<update
id=
"updateUser"
parameterType=
"SysUser"
>
update sys_user
update sys_user
<set>
<set>
...
@@ -155,33 +155,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -155,33 +155,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</set>
</set>
where user_id = #{userId}
where user_id = #{userId}
</update>
</update>
<update
id=
"updateUserStatus"
parameterType=
"SysUser"
>
<update
id=
"updateUserStatus"
parameterType=
"SysUser"
>
update sys_user set status = #{status} where user_id = #{userId}
update sys_user set status = #{status} where user_id = #{userId}
</update>
</update>
<update
id=
"updateUserAvatar"
parameterType=
"SysUser"
>
<update
id=
"updateUserAvatar"
parameterType=
"SysUser"
>
update sys_user set avatar = #{avatar} where user_name = #{userName}
update sys_user set avatar = #{avatar} where user_name = #{userName}
</update>
</update>
<update
id=
"resetUserPwd"
parameterType=
"SysUser"
>
<update
id=
"resetUserPwd"
parameterType=
"SysUser"
>
update sys_user set password = #{password} where user_name = #{userName}
update sys_user set password = #{password} where user_name = #{userName}
</update>
</update>
<delete
id=
"deleteUserById"
parameterType=
"Long"
>
<delete
id=
"deleteUserById"
parameterType=
"Long"
>
update sys_user set del_flag = '2' where user_id = #{userId}
update sys_user set del_flag = '2' where user_id = #{userId}
</delete>
</delete>
<delete
id=
"deleteUserByIds"
parameterType=
"Long"
>
<delete
id=
"deleteUserByIds"
parameterType=
"Long"
>
update sys_user set del_flag = '2' where user_id in
update sys_user set del_flag = '2' where user_id in
<foreach
collection=
"array"
item=
"userId"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"array"
item=
"userId"
open=
"("
separator=
","
close=
")"
>
#{userId}
#{userId}
</foreach>
</foreach>
</delete>
</delete>
<select
id=
"selectTransactorByDeptId"
parameterType=
"Long"
resultMap=
"SysUserResult"
>
<select
id=
"selectTransactorByDeptId"
parameterType=
"Long"
resultMap=
"SysUserResult"
>
<include
refid=
"selectUserVo"
/>
<include
refid=
"selectUserVo"
/>
where u.dept_id = #{deptId} AND r.role_key = "transactor";
where u.dept_id = #{deptId} AND r.role_key = "transactor";
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
precision-effect-system/src/main/resources/mapper/system/TBorrowingApplyForMapper.xml
0 → 100644
View file @
30f81adc
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.zehong.system.mapper.TBorrowingApplyForMapper"
>
<resultMap
type=
"TBorrowingApplyFor"
id=
"TBorrowingApplyForResult"
>
<result
property=
"borrowing"
column=
"borrowing"
/>
<result
property=
"feeName"
column=
"fee_name"
/>
<result
property=
"borrowingDeptId"
column=
"borrowing_dept_id"
/>
<result
property=
"handledByUserId"
column=
"handled_by_user_id"
/>
<result
property=
"applicationDescription"
column=
"application_description"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"totalWords"
column=
"total_words"
/>
<result
property=
"totalFigures"
column=
"total_figures"
/>
<result
property=
"approvedUserId"
column=
"approved_user_id"
/>
<result
property=
"registrationDate"
column=
"registration_date"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"attachmentUrl"
column=
"attachment_url"
/>
<result
property=
"isDel"
column=
"is_del"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"approvalStatus"
column=
"approval_status"
/>
</resultMap>
<sql
id=
"selectTBorrowingApplyForVo"
>
select borrowing, fee_name, borrowing_dept_id, handled_by_user_id, application_description, user_id, total_words, total_figures, approved_user_id, registration_date, remark, attachment_url, is_del, create_time, update_time,approval_status from t_borrowing_apply_for
</sql>
<select
id=
"selectTBorrowingApplyForList"
parameterType=
"TBorrowingApplyFor"
resultMap=
"TBorrowingApplyForResult"
>
SELECT a.*,b.nick_name handledByUserIdName,c.nick_name userIdName,d.nick_name ApprovedUserIdName FROM t_borrowing_apply_for a
left join sys_user b on a.handled_by_user_id=b.user_id
left join sys_user c on a.user_id=c.user_id
left join sys_user d on a.approved_user_id=d.user_id
<where>
<if
test=
"feeName != null and feeName != ''"
>
and a.fee_name like concat('%', #{feeName}, '%')
</if>
<if
test=
"borrowingDeptId != null "
>
and a.borrowing_dept_id = #{borrowingDeptId}
</if>
<if
test=
"handledByUserId != null "
>
and a.handled_by_user_id = #{handledByUserId}
</if>
<if
test=
"applicationDescription != null and applicationDescription != ''"
>
and a.application_description = #{applicationDescription}
</if>
<if
test=
"userId != null "
>
and a.user_id = #{userId}
</if>
<if
test=
"totalWords != null and totalWords != ''"
>
and a.total_words = #{totalWords}
</if>
<if
test=
"totalFigures != null "
>
and a.total_figures = #{totalFigures}
</if>
<if
test=
"approvedUserId != null "
>
and a.approved_user_id = #{approvedUserId}
</if>
<if
test=
"registrationDate != null "
>
and a.registration_date = #{registrationDate}
</if>
<if
test=
"attachmentUrl != null and attachmentUrl != ''"
>
and a.attachment_url = #{attachmentUrl}
</if>
<if
test=
"isDel != null and isDel != ''"
>
and a.is_del = #{isDel}
</if>
</where>
order by a.borrowing desc
</select>
<select
id=
"selectTBorrowingApplyForById"
parameterType=
"Long"
resultMap=
"TBorrowingApplyForResult"
>
<include
refid=
"selectTBorrowingApplyForVo"
/>
where borrowing = #{borrowing}
</select>
<insert
id=
"insertTBorrowingApplyFor"
parameterType=
"TBorrowingApplyFor"
>
insert into t_borrowing_apply_for
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"borrowing != null"
>
borrowing,
</if>
<if
test=
"feeName != null"
>
fee_name,
</if>
<if
test=
"borrowingDeptId != null"
>
borrowing_dept_id,
</if>
<if
test=
"handledByUserId != null"
>
handled_by_user_id,
</if>
<if
test=
"applicationDescription != null"
>
application_description,
</if>
<if
test=
"userId != null"
>
user_id,
</if>
<if
test=
"totalWords != null"
>
total_words,
</if>
<if
test=
"totalFigures != null"
>
total_figures,
</if>
<if
test=
"approvedUserId != null"
>
approved_user_id,
</if>
<if
test=
"registrationDate != null"
>
registration_date,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"attachmentUrl != null"
>
attachment_url,
</if>
<if
test=
"isDel != null"
>
is_del,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"borrowing != null"
>
#{borrowing},
</if>
<if
test=
"feeName != null"
>
#{feeName},
</if>
<if
test=
"borrowingDeptId != null"
>
#{borrowingDeptId},
</if>
<if
test=
"handledByUserId != null"
>
#{handledByUserId},
</if>
<if
test=
"applicationDescription != null"
>
#{applicationDescription},
</if>
<if
test=
"userId != null"
>
#{userId},
</if>
<if
test=
"totalWords != null"
>
#{totalWords},
</if>
<if
test=
"totalFigures != null"
>
#{totalFigures},
</if>
<if
test=
"approvedUserId != null"
>
#{approvedUserId},
</if>
<if
test=
"registrationDate != null"
>
#{registrationDate},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"attachmentUrl != null"
>
#{attachmentUrl},
</if>
<if
test=
"isDel != null"
>
#{isDel},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
</trim>
</insert>
<update
id=
"updateTBorrowingApplyFor"
parameterType=
"TBorrowingApplyFor"
>
update t_borrowing_apply_for
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"feeName != null"
>
fee_name = #{feeName},
</if>
<if
test=
"borrowingDeptId != null"
>
borrowing_dept_id = #{borrowingDeptId},
</if>
<if
test=
"handledByUserId != null"
>
handled_by_user_id = #{handledByUserId},
</if>
<if
test=
"applicationDescription != null"
>
application_description = #{applicationDescription},
</if>
<if
test=
"userId != null"
>
user_id = #{userId},
</if>
<if
test=
"totalWords != null"
>
total_words = #{totalWords},
</if>
<if
test=
"totalFigures != null"
>
total_figures = #{totalFigures},
</if>
<if
test=
"approvedUserId != null"
>
approved_user_id = #{approvedUserId},
</if>
<if
test=
"registrationDate != null"
>
registration_date = #{registrationDate},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"attachmentUrl != null"
>
attachment_url = #{attachmentUrl},
</if>
<if
test=
"isDel != null"
>
is_del = #{isDel},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"approvalStatus != null"
>
approval_status = #{approvalStatus},
</if>
</trim>
where borrowing = #{borrowing}
</update>
<delete
id=
"deleteTBorrowingApplyForById"
parameterType=
"Long"
>
delete from t_borrowing_apply_for where borrowing = #{borrowing}
</delete>
<delete
id=
"deleteTBorrowingApplyForByIds"
parameterType=
"String"
>
delete from t_borrowing_apply_for where borrowing in
<foreach
item=
"borrowing"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{borrowing}
</foreach>
</delete>
<!--查询部门余额是否足够-->
<select
id=
"selectTacc"
resultType=
"java.lang.Integer"
>
select count(account_id) from t_account where dept_id=#{borrowingDeptId} and able_amount >= #{totalFigures}
</select>
<!--修改部门余额-->
<update
id=
"deletebBalance"
>
update t_account set able_amount= able_amount- #{totalFigures} where dept_id=#{borrowingDeptId}
</update>
</mapper>
precision-effect-web/src/api/system/for.js
0 → 100644
View file @
30f81adc
import
request
from
'@/utils/request'
// 查询借支申请列表
export
function
listFor
(
query
)
{
return
request
({
url
:
'/system/for/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询借支申请详细
export
function
getFor
(
borrowing
)
{
return
request
({
url
:
'/system/for/'
+
borrowing
,
method
:
'get'
})
}
// 新增借支申请
export
function
addFor
(
data
)
{
return
request
({
url
:
'/system/for'
,
method
:
'post'
,
data
:
data
})
}
// 修改借支申请
export
function
updateFor
(
data
)
{
return
request
({
url
:
'/system/for'
,
method
:
'put'
,
data
:
data
})
}
// 删除借支申请
export
function
delFor
(
borrowing
)
{
return
request
({
url
:
'/system/for/'
+
borrowing
,
method
:
'delete'
})
}
// 导出借支申请
export
function
exportFor
(
query
)
{
return
request
({
url
:
'/system/for/export'
,
method
:
'get'
,
params
:
query
})
}
\ No newline at end of file
precision-effect-web/src/views/for/index.vue
0 → 100644
View file @
30f81adc
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"费用名称"
prop=
"feeName"
>
<el-input
v-model=
"queryParams.feeName"
placeholder=
"请输入费用名称"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
>
新增
</el-button>
</el-col>
<!--
<el-col
:span=
"1.5"
>
-->
<!--
<el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:for:edit']"-->
<!-- >修改
</el-button>
-->
<!--
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:for:remove']"
>
删除
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"forList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"费用名称"
align=
"center"
prop=
"feeName"
/>
<el-table-column
label=
"使用人"
align=
"center"
prop=
"userIdName"
/>
<el-table-column
label=
"经办人"
align=
"center"
prop=
"handledByUserIdName"
>
<template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.handledByUserIdName == null"
>
-
</span>
<span>
{{
scope
.
row
.
handledByUserIdName
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"审批人"
align=
"center"
prop=
"approvedUserIdName"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.approvedUserIdName == null"
>
-
</span>
<span>
{{
scope
.
row
.
approvedUserIdName
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"用途说明"
align=
"center"
prop=
"applicationDescription"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.applicationDescription == null"
>
-
</span>
<span>
{{
scope
.
row
.
applicationDescription
}}
</span>
</
template
>
</el-table-column>
<!-- <el-table-column label="大写合计" align="center" prop="totalWords" />-->
<el-table-column
label=
"小写合计"
align=
"center"
prop=
"totalFigures"
/>
<el-table-column
label=
"登记日期"
align=
"center"
prop=
"registrationDate"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.registrationDate == null"
>
-
</span>
<span>
{{
parseTime
(
scope
.
row
.
registrationDate
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"备注"
align
=
"center"
prop
=
"remark"
>
<
template
slot
-
scope
=
"scope"
>
<
span
v
-
if
=
"scope.row.remark == null"
>-<
/span
>
<
span
>
{{
scope
.
row
.
remark
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
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"
style
=
"color: #1ab394"
>
未审批
<
/span
>
<
span
v
-
if
=
"scope.row.approvalStatus == 2"
style
=
"color: #2338b3"
>
审批通过
<
/span
>
<
span
v
-
if
=
"scope.row.approvalStatus == 3"
style
=
"color: #960602 "
>
审批拒绝
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-edit"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['system:for:approved']"
>
审批
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-delete"
@
click
=
"handleDelete(scope.row)"
>
删除
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"queryParams.pageNum"
:
limit
.
sync
=
"queryParams.pageSize"
@
pagination
=
"getList"
/>
<!--
添加或修改借支申请对话框
-->
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
width
=
"800px"
destroy
-
on
-
close
>
<
el
-
form
ref
=
"form"
:
model
=
"form"
:
rules
=
"rules"
label
-
width
=
"100px"
>
<
el
-
row
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"费用名称"
prop
=
"feeName"
>
<
el
-
input
v
-
model
=
"form.feeName"
placeholder
=
"请输入费用名称"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"借支部门"
prop
=
"borrowingDeptId"
>
<
treeselect
v
-
model
=
"form.borrowingDeptId"
:
options
=
"formDeptOptions"
:
show
-
count
=
"true"
placeholder
=
"请选择部门"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"使用人"
prop
=
"userId"
>
<
el
-
select
v
-
model
=
"form.userId"
placeholder
=
"请选择使用人"
style
=
"width: 100%"
>
<
el
-
option
v
-
for
=
"item in transactorList"
:
key
=
"item.userId"
:
label
=
"item.nickName"
:
value
=
"item.userId"
/>
<
/el-select
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"登记日期"
prop
=
"registrationDate"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.registrationDate"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"选择登记日期"
style
=
"width: 100%;"
>
<
/el-date-picker
>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<!--
<
el
-
col
:
span
=
"12"
>-->
<!--
<
el
-
form
-
item
label
=
"大写合计"
prop
=
"totalWords"
>-->
<!--
<
el
-
input
v
-
model
=
"form.totalWords"
placeholder
=
"请输入大写合计"
/>-->
<!--
<
/el-form-item>--
>
<!--
<
/el-col>--
>
<
el
-
col
:
span
=
"24"
>
<
el
-
form
-
item
label
=
"小写合计"
prop
=
"totalFigures"
>
<
el
-
input
v
-
model
=
"form.totalFigures"
placeholder
=
"请输入小写合计"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
form
-
item
label
=
"用途说明"
prop
=
"applicationDescription"
>
<
el
-
input
v
-
model
=
"form.applicationDescription"
type
=
"textarea"
placeholder
=
"请输入用途说明"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"备注"
prop
=
"remark"
>
<
el
-
input
v
-
model
=
"form.remark"
type
=
"textarea"
placeholder
=
"请输入备注"
/>
<
/el-form-item
>
<
el
-
form
-
item
v
-
if
=
"form.borrowing !=null"
label
=
"附件"
prop
=
"attachmentUrl"
>
<
div
style
=
"height: 60px;width: 100px;margin-top: 5px"
>
<
img
@
click
=
"godown(form.attachmentUrl)"
v
-
if
=
"ispictrue(form.attachmentUrl)"
style
=
"width: 100%;height: 100%"
/>
<
img
@
click
=
"godown(form.attachmentUrl)"
v
-
if
=
"!ispictrue(form.attachmentUrl)"
style
=
"width: 100%;height: 100%"
/>
<
/div
>
<
/el-form-item
>
<
el
-
form
-
item
v
-
if
=
"form.borrowing ==null"
label
=
"附件"
prop
=
"attachmentUrl"
>
<
FileUpload
listType
=
"picture"
@
resFun
=
"getFileInfo"
@
remove
=
"listRemove"
:
fileArr
=
"fileList"
:
fileSize
=
"500"
:
fileType
=
"[
'png',
'jpg',
'jpeg',
'mp4',
'doc',
'xls',
'ppt',
'txt',
'pdf',
]"
/>
<
el
-
input
v
-
show
=
"false"
disabled
v
-
model
=
"form.attachmentUrl"
><
/el-input
>
<
/el-form-item
>
<
/el-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
style
=
"text-align: center"
>
<!--
<
el
-
button
-->
<!--
style
=
"width: 150px; border-color: #1890ff; color: #1890ff"
-->
<!--
@
click
=
"reset"
-->
<!--
>
内容重置
<
/el-button--
>
<!--
>-->
<
el
-
button
v
-
if
=
"this.form.borrowing ==null"
type
=
"primary"
style
=
"width: 150px"
@
click
=
"submitForm"
>
提交申请
<
/el-butto
n
>
<
el
-
button
v
-
if
=
"this.form.borrowing !=null"
v
-
hasPermi
=
"['system:for:approved']"
type
=
"primary"
style
=
"width: 150px"
@
click
=
"submitForm(2)"
>
审批通过
<
/el-butto
n
>
<
el
-
button
v
-
if
=
"this.form.borrowing !=null"
v
-
hasPermi
=
"['system:for:approved']"
type
=
"primary"
style
=
"width: 150px"
@
click
=
"submitForm(3)"
>
审批拒绝
<
/el-butto
n
>
<!--
<
el
-
button
type
=
"primary"
@
click
=
"submitForm"
>
确
定
<
/el-button>--
>
<
el
-
button
style
=
"width: 150px; border-color: #1890ff; color: #1890ff"
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/el-dialog
>
<
/div
>
<
/template
>
<
script
>
import
{
listFor
,
getFor
,
delFor
,
addFor
,
updateFor
,
exportFor
}
from
"@/api/system/for"
;
import
{
selectTransactorByDeptId
,
listUser
}
from
"@/api/system/user"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
{
treeselect
}
from
"@/api/system/dept"
;
import
FileUpload
from
"@/components/FileUpload"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
export
default
{
name
:
"For"
,
components
:
{
Treeselect
,
FileUpload
,
}
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 导出遮罩层
exportLoading
:
false
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 借支申请表格数据
forList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
feeName
:
null
,
borrowingDeptId
:
null
,
handledByUserId
:
null
,
applicationDescription
:
null
,
userId
:
null
,
totalWords
:
null
,
totalFigures
:
null
,
approvedUserId
:
null
,
registrationDate
:
null
,
attachmentUrl
:
null
,
isDel
:
null
,
}
,
// 表单参数
form
:
{
}
,
// 表单校验
rules
:
{
feeName
:
[
{
required
:
true
,
message
:
"费用名称名称不能为空"
,
trigger
:
"blur"
}
,
],
totalFigures
:
[
{
required
:
true
,
message
:
"小写合计不能为空"
,
trigger
:
"blur"
}
,
],
userId
:
[
{
required
:
true
,
message
:
"使用人不能为空"
,
trigger
:
"blur"
}
,
],
}
,
formDeptOptions
:
[],
transactorList
:
[],
fileList
:
[],
}
;
}
,
listRemove
(
e
)
{
this
.
fileList
=
[];
this
.
form
.
attachmentUrl
=
""
;
}
,
created
()
{
this
.
getTreeselect
();
this
.
getList
();
}
,
watch
:{
"form.borrowingDeptId"
:{
handler
(
newValue
,
oldValue
){
// this.changeDept();
this
.
getTransactor
();
}
,
deep
:
true
,
}
,
}
,
methods
:
{
getFileInfo
(
res
)
{
this
.
form
.
attachmentUrl
=
res
.
url
;
this
.
fileList
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
}
,
];
}
,
/** 查询部门下拉树结构 */
getTreeselect
()
{
treeselect
().
then
((
response
)
=>
{
this
.
deptOptions
=
response
.
data
;
this
.
formDeptOptions
=
response
.
data
;
// 申请服务时买方不能选自己部门
// var items = this.formDeptOptions[0].children;
// var result = [];
// var j=0;
// for(var i=0; i<items.length; i++)
{
// if(items[i].id != this.$store.state.user.deptId)
{
// result[j] = items[i];
// j++;
//
}
//
}
// this.formDeptOptions[0].children = result;
}
);
}
,
getTransactor
()
{
this
.
form
.
tradeTransactor
=
null
;
if
(
this
.
form
.
borrowingDeptId
&&
this
.
form
.
borrowingDeptId
!=
null
)
{
this
.
form
.
deptId
=
this
.
form
.
borrowingDeptId
;
listUser
(
this
.
form
).
then
(
(
res
)
=>
{
this
.
transactorList
=
res
.
rows
;
}
);
}
}
,
/** 查询借支申请列表 */
getList
()
{
this
.
loading
=
true
;
listFor
(
this
.
queryParams
).
then
(
response
=>
{
this
.
forList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
}
);
}
,
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
}
,
// 表单重置
reset
()
{
this
.
form
=
{
borrowing
:
null
,
feeName
:
null
,
borrowingDeptId
:
null
,
handledByUserId
:
null
,
applicationDescription
:
null
,
userId
:
null
,
totalWords
:
null
,
totalFigures
:
null
,
approvedUserId
:
null
,
registrationDate
:
null
,
remark
:
null
,
attachmentUrl
:
null
,
isDel
:
null
,
createTime
:
null
,
updateTime
:
null
}
;
this
.
resetForm
(
"form"
);
this
.
fileList
=
[];
}
,
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
}
,
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
borrowing
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
}
,
/** 新增按钮操作 */
handleAdd
()
{
this
.
transactorList
=
[];
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加借支申请"
;
}
,
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
borrowing
=
row
.
borrowing
||
this
.
ids
getFor
(
borrowing
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改借支申请"
;
}
);
this
.
form
.
attachmentUrl
=
this
.
form
.
attachmentUrl
;
this
.
fileList
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
}
,
];
treeselect
().
then
((
response
)
=>
{
this
.
formDeptOptions
=
response
.
data
;
// 申请服务时买方不能选自己部门
var
items
=
this
.
formDeptOptions
[
0
].
children
;
var
result
=
[];
var
j
=
0
;
for
(
var
i
=
0
;
i
<
items
.
length
;
i
++
){
if
(
items
[
i
].
id
!=
this
.
$store
.
state
.
user
.
deptId
){
result
[
j
]
=
items
[
i
];
j
++
;
}
}
this
.
formDeptOptions
[
0
].
children
=
result
;
}
);
}
,
/** 提交按钮 */
submitForm
(
row
)
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
borrowing
!=
null
)
{
this
.
form
.
approvalStatus
=
row
;
updateFor
(
this
.
form
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
==
2
){
// alert("部门余额不足,审批拒绝")
// this.msgSuccess("部门余额不足,审批拒绝");
this
.
$alert
(
'部门余额不足,审批拒绝'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
}
)
}
else
{
// alert("审批成功")
this
.
msgSuccess
(
"审批成功"
);
}
//
this
.
open
=
false
;
this
.
getList
();
}
);
}
else
{
addFor
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}
);
}
}
}
);
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
borrowings
=
row
.
borrowing
||
this
.
ids
;
this
.
$confirm
(
'是否确认删除此数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(
function
()
{
return
delFor
(
borrowings
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"删除成功"
);
}
).
catch
(()
=>
{
}
);
}
,
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
this
.
$confirm
(
'是否确认导出所有借支申请数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(()
=>
{
this
.
exportLoading
=
true
;
return
exportFor
(
queryParams
);
}
).
then
(
response
=>
{
this
.
download
(
response
.
msg
);
this
.
exportLoading
=
false
;
}
).
catch
(()
=>
{
}
);
}
,
godown
(
src
){
window
.
open
(
src
);
}
,
ispictrue
(
src
){
var
pattern
=
/
(\.
jpg|
\.
jpeg|
\.
png|
\.
gif
)
$/i
;
//console.log()
return
pattern
.
test
(
src
);
}
,
}
}
;
<
/script
>
<
style
scoped
lang
=
"scss"
>
.
outer
-
div
{
//padding: 24px;
margin
:
0
auto
;
}
.
header
{
height
:
47
px
;
width
:
100
%
;
//border-bottom: 1px solid #ebebeb;
//margin-bottom: 24px;
}
ul
li
{
margin
:
0
;
padding
:
0
;
list
-
style
:
none
;
}
.
tab
-
tilte
{
font
-
family
:
PingFangSC
-
Semibold
;
letter
-
spacing
:
0
;
width
:
90
%
;
padding
-
left
:
0
;
}
.
tab
-
tilte
li
{
float
:
left
;
font
-
size
:
16
px
;
color
:
#
999999
;
// line-height: 53px;
text
-
align
:
center
;
margin
-
right
:
30
px
;
cursor
:
pointer
;
}
/* 点击对应的标题添加对应的背景颜色 */
.
tab
-
tilte
.
active
{
color
:
#
3385
ff
;
// border-bottom: 2px solid #3385ff;
}
.
applyService
{
float
:
right
;
width
:
124
px
;
border
-
radius
:
18
px
;
color
:
white
;
background
:
#
1890
ff
;
}
<
/style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment