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
7f5a4903
Commit
7f5a4903
authored
Jul 04, 2023
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目维护中心部门选择
parent
25facd47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
TTransactionProjectController.java
...controller/transaction/TTransactionProjectController.java
+7
-3
index.vue
precision-effect-web/src/views/transaction/index.vue
+17
-6
No files found.
precision-effect-admin/src/main/java/com/zehong/web/controller/transaction/TTransactionProjectController.java
View file @
7f5a4903
...
...
@@ -3,6 +3,7 @@ package com.zehong.web.controller.transaction;
import
com.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.core.domain.entity.SysRole
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.core.domain.model.LoginUser
;
import
com.zehong.common.core.page.TableDataInfo
;
...
...
@@ -15,10 +16,12 @@ import com.zehong.system.domain.TTransactionProject;
import
com.zehong.system.service.ITTransactionProjectService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 交易项目Controller
...
...
@@ -45,7 +48,8 @@ public class TTransactionProjectController extends BaseController
startPage
();
// 获取当前用户
SysUser
user
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
()).
getUser
();
if
(
StringUtils
.
isNotNull
(
user
)
&&
!
user
.
isAdmin
())
{
List
<
SysRole
>
roles
=
user
.
getRoles
().
stream
().
filter
(
item
->
"calculator"
.
equals
(
item
.
getRoleKey
())).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isNotNull
(
user
)
&&
!
user
.
isAdmin
()
&&
CollectionUtils
.
isEmpty
(
roles
))
{
tTransactionProject
.
setDeptId
(
user
.
getDeptId
());
}
List
<
TTransactionProject
>
list
=
tTransactionProjectService
.
selectTTransactionProjectList
(
tTransactionProject
);
...
...
@@ -119,10 +123,10 @@ public class TTransactionProjectController extends BaseController
public
AjaxResult
add
(
@RequestBody
TTransactionProject
tTransactionProject
)
{
// 获取当前用户
SysUser
user
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
()).
getUser
();
/*
SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
if (StringUtils.isNotNull(user) && !user.isAdmin()) {
tTransactionProject.setDeptId(user.getDeptId());
}
}
*/
return
toAjax
(
tTransactionProjectService
.
insertTTransactionProject
(
tTransactionProject
));
}
...
...
precision-effect-web/src/views/transaction/index.vue
View file @
7f5a4903
...
...
@@ -146,11 +146,11 @@
<el-input
v-model=
"form.transactionProjectName"
placeholder=
"请输入交易项目名称"
/>
</el-form-item>
</el-col>
<
!--<
el-col :span="12">
<el-form-item label="
交易细项名称" prop="transactionItemName
">
<
el-input v-model="form.transactionItemName" placeholder="请输入交易细项名称"
/>
<el-col
:span=
"12"
>
<el-form-item
label=
"
归属部门"
prop=
"deptId
"
>
<
treeselect
v-model=
"form.deptId"
:options=
"deptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
/>
</el-form-item>
</el-col>
-->
</el-col>
</el-row>
<el-form-item
label=
"职责项明细说明"
prop=
"dutyDetailDescribe"
>
...
...
@@ -206,6 +206,11 @@
{{detailInfo.transactionProjectName}}
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"归属部门"
>
{{detailInfo.deptName}}
</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
...
...
@@ -373,6 +378,9 @@ export default {
transactionProjectName
:
[
{
required
:
true
,
message
:
"交易项目名称不能为空"
,
trigger
:
"blur"
}
],
deptId
:
[
{
required
:
true
,
message
:
"请选择归属部门"
,
trigger
:
"change"
}
],
dutyDetailDescribe
:
[
{
required
:
true
,
message
:
"职责项明细说明不能为空"
,
trigger
:
"blur"
}
],
...
...
@@ -413,7 +421,7 @@ export default {
};
},
created
()
{
if
(
this
.
$store
.
state
.
user
.
userId
!=
1
){
if
(
this
.
$store
.
state
.
user
.
userId
!=
1
&&
this
.
$store
.
state
.
user
.
roles
.
findIndex
(
item
=>
"calculator"
==
item
)
==
-
1
){
this
.
queryParams
.
deptId
=
this
.
$store
.
state
.
user
.
deptId
;
this
.
disabled
=
true
;
}
...
...
@@ -477,6 +485,7 @@ export default {
this
.
reset
();
this
.
form
.
priceType
=
"1"
;
this
.
changePriceType
(
this
.
form
.
priceType
);
this
.
getTreeselect
();
this
.
open
=
true
;
this
.
title
=
"添加交易项目"
;
},
...
...
@@ -510,6 +519,7 @@ export default {
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
this
.
getTreeselect
();
const
transactionProjectId
=
row
.
transactionProjectId
||
this
.
ids
getProject
(
transactionProjectId
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
...
...
@@ -521,6 +531,7 @@ export default {
/** 详情 */
handleDetail
(
row
){
this
.
detailInfo
=
{};
this
.
getTreeselect
();
getProject
(
row
.
transactionProjectId
).
then
(
response
=>
{
this
.
detailInfo
=
response
.
data
;
this
.
detailOpen
=
true
;
...
...
@@ -528,7 +539,7 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
this
.
form
.
deptId
=
this
.
$store
.
state
.
user
.
deptId
;
//
this.form.deptId = this.$store.state.user.deptId;
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
transactionProjectId
!=
null
)
{
...
...
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