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
30406f1b
Commit
30406f1b
authored
Jun 09, 2023
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
交易中心
parent
16eefd05
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1602 additions
and
68 deletions
+1602
-68
TTradeProjectController.java
...g/web/controller/transaction/TTradeProjectController.java
+97
-0
TTransactionProjectController.java
...controller/transaction/TTransactionProjectController.java
+13
-1
application-dev.yml
...ision-effect-admin/src/main/resources/application-dev.yml
+1
-1
TTradeProject.java
...src/main/java/com/zehong/system/domain/TTradeProject.java
+327
-0
TTradeProjectMapper.java
...in/java/com/zehong/system/mapper/TTradeProjectMapper.java
+61
-0
ITTradeProjectService.java
...java/com/zehong/system/service/ITTradeProjectService.java
+61
-0
TTradeProjectServiceImpl.java
.../zehong/system/service/impl/TTradeProjectServiceImpl.java
+104
-0
TTradeProjectMapper.xml
...rc/main/resources/mapper/business/TTradeProjectMapper.xml
+183
-0
project.js
precision-effect-web/src/api/transaction/project.js
+18
-9
tradeProject.js
precision-effect-web/src/api/transaction/tradeProject.js
+53
-0
uploadfile.png
precision-effect-web/src/assets/uploadfile.png
+0
-0
index.vue
precision-effect-web/src/components/FileUpload/index.vue
+145
-57
index.vue
precision-effect-web/src/views/trade/index.vue
+539
-0
No files found.
precision-effect-admin/src/main/java/com/zehong/web/controller/transaction/TTradeProjectController.java
0 → 100644
View file @
30406f1b
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.page.TableDataInfo
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.system.domain.TTradeProject
;
import
com.zehong.system.service.ITTradeProjectService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 交易项目Controller
*
* @author zehong
* @date 2023-06-08
*/
@RestController
@RequestMapping
(
"/trade/project"
)
public
class
TTradeProjectController
extends
BaseController
{
@Autowired
private
ITTradeProjectService
tTradeProjectService
;
/**
* 查询交易项目列表
*/
@PreAuthorize
(
"@ss.hasPermi('trade:project:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
TTradeProject
tTradeProject
)
{
startPage
();
List
<
TTradeProject
>
list
=
tTradeProjectService
.
selectTTradeProjectList
(
tTradeProject
);
return
getDataTable
(
list
);
}
/**
* 导出交易项目列表
*/
@PreAuthorize
(
"@ss.hasPermi('trade:project:export')"
)
@Log
(
title
=
"交易项目"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
TTradeProject
tTradeProject
)
{
List
<
TTradeProject
>
list
=
tTradeProjectService
.
selectTTradeProjectList
(
tTradeProject
);
ExcelUtil
<
TTradeProject
>
util
=
new
ExcelUtil
<
TTradeProject
>(
TTradeProject
.
class
);
return
util
.
exportExcel
(
list
,
"交易项目数据"
);
}
/**
* 获取交易项目详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('trade:project:query')"
)
@GetMapping
(
value
=
"/{tradeId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"tradeId"
)
Long
tradeId
)
{
return
AjaxResult
.
success
(
tTradeProjectService
.
selectTTradeProjectById
(
tradeId
));
}
/**
* 新增交易项目
*/
@PreAuthorize
(
"@ss.hasPermi('trade:project:add')"
)
@Log
(
title
=
"交易项目"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
TTradeProject
tTradeProject
)
{
return
toAjax
(
tTradeProjectService
.
insertTTradeProject
(
tTradeProject
));
}
/**
* 修改交易项目
*/
@PreAuthorize
(
"@ss.hasPermi('trade:project:edit')"
)
@Log
(
title
=
"交易项目"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
TTradeProject
tTradeProject
)
{
return
toAjax
(
tTradeProjectService
.
updateTTradeProject
(
tTradeProject
));
}
/**
* 删除交易项目
*/
@PreAuthorize
(
"@ss.hasPermi('trade:project:remove')"
)
@Log
(
title
=
"交易项目"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{tradeIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
tradeIds
)
{
return
toAjax
(
tTradeProjectService
.
deleteTTradeProjectByIds
(
tradeIds
));
}
}
precision-effect-admin/src/main/java/com/zehong/web/controller/transaction/TTransactionProjectController.java
View file @
30406f1b
...
...
@@ -21,7 +21,7 @@ import java.util.List;
* @date 2023-06-05
*/
@RestController
@RequestMapping
(
"/
system
/project"
)
@RequestMapping
(
"/
transaction
/project"
)
public
class
TTransactionProjectController
extends
BaseController
{
@Autowired
...
...
@@ -39,6 +39,18 @@ public class TTransactionProjectController extends BaseController
return
getDataTable
(
list
);
}
/**
* 获取所有交易项目
* @param tTransactionProject
* @return
*/
@GetMapping
(
"/getTransactionProjectList"
)
public
AjaxResult
getTransactionProjectList
(
TTransactionProject
tTransactionProject
){
List
<
TTransactionProject
>
list
=
tTransactionProjectService
.
selectTTransactionProjectList
(
tTransactionProject
);
return
AjaxResult
.
success
(
list
);
}
/**
* 导出交易项目列表
*/
...
...
precision-effect-admin/src/main/resources/application-dev.yml
View file @
30406f1b
...
...
@@ -90,7 +90,7 @@ zehong:
# 实例演示开关
demoEnabled
:
true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile
:
/home
/zehong/uploadPath
profile
:
D:
/zehong/uploadPath
# 获取ip地址开关
addressEnabled
:
false
# 验证码类型 math 数组计算 char 字符验证
...
...
precision-effect-system/src/main/java/com/zehong/system/domain/TTradeProject.java
0 → 100644
View file @
30406f1b
package
com
.
zehong
.
system
.
domain
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.zehong.common.annotation.Excel
;
import
com.zehong.common.core.domain.BaseEntity
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 交易项目对象 t_trade_project
*
* @author zehong
* @date 2023-06-08
*/
public
class
TTradeProject
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 交易主键 */
private
Long
tradeId
;
/** 单据编号 */
@Excel
(
name
=
"单据编号"
)
private
String
receiptNum
;
/** 关联交易项目 */
@Excel
(
name
=
"关联交易项目"
)
private
Long
relationTransactionProjectId
;
/** 申请人 */
@Excel
(
name
=
"申请人"
)
private
Long
applyId
;
/** 申请部门 */
@Excel
(
name
=
"申请部门"
)
private
Long
applyDeptId
;
/** 申请部门长 */
@Excel
(
name
=
"申请部门长"
)
private
Long
applyDeptManagerId
;
/** 交易经办人 */
@Excel
(
name
=
"交易经办人"
)
private
Long
tradeTransactor
;
/** 交易部门 */
@Excel
(
name
=
"交易部门"
)
private
Long
tradeDeptId
;
/** 交易单价 */
@Excel
(
name
=
"交易单价"
)
private
BigDecimal
tradePrice
;
/** 交易数量 */
@Excel
(
name
=
"交易数量"
)
private
BigDecimal
tradeCount
;
/** 交易总价 */
@Excel
(
name
=
"交易总价"
)
private
BigDecimal
tradeTotal
;
/** 交易评分 */
@Excel
(
name
=
"交易评分"
)
private
Integer
tradeScore
;
/** 交易部门长 */
@Excel
(
name
=
"交易部门长"
)
private
Long
tradeDeptManagerId
;
/** 结算时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"结算时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
settlementTime
;
/** 交易成交价 */
@Excel
(
name
=
"交易成交价"
)
private
BigDecimal
dealPrice
;
/** 尾款 */
@Excel
(
name
=
"尾款"
)
private
BigDecimal
pendingPayment
;
/** 附件 */
@Excel
(
name
=
"附件"
)
private
String
attachmentUrl
;
/** 交易状态:0.申请中 1.待经办人评价 2.待对方部门长确认 3.待本部门长确认 4.驳回 5.完成 */
@Excel
(
name
=
"交易状态:0.申请中 1.待经办人评价 2.待对方部门长确认 3.待本部门长确认 4.驳回 5.完成"
)
private
String
tradeStatus
;
/** 是否删除:0否,1是 */
@Excel
(
name
=
"是否删除:0否,1是"
)
private
String
isDel
;
private
String
applyName
;
private
String
applyDeptName
;
private
String
tradeDeptName
;
public
void
setTradeId
(
Long
tradeId
)
{
this
.
tradeId
=
tradeId
;
}
public
Long
getTradeId
()
{
return
tradeId
;
}
public
void
setReceiptNum
(
String
receiptNum
)
{
this
.
receiptNum
=
receiptNum
;
}
public
String
getReceiptNum
()
{
return
receiptNum
;
}
public
void
setRelationTransactionProjectId
(
Long
relationTransactionProjectId
)
{
this
.
relationTransactionProjectId
=
relationTransactionProjectId
;
}
public
Long
getRelationTransactionProjectId
()
{
return
relationTransactionProjectId
;
}
public
void
setApplyId
(
Long
applyId
)
{
this
.
applyId
=
applyId
;
}
public
Long
getApplyId
()
{
return
applyId
;
}
public
void
setApplyDeptId
(
Long
applyDeptId
)
{
this
.
applyDeptId
=
applyDeptId
;
}
public
Long
getApplyDeptId
()
{
return
applyDeptId
;
}
public
void
setApplyDeptManagerId
(
Long
applyDeptManagerId
)
{
this
.
applyDeptManagerId
=
applyDeptManagerId
;
}
public
Long
getApplyDeptManagerId
()
{
return
applyDeptManagerId
;
}
public
void
setTradeTransactor
(
Long
tradeTransactor
)
{
this
.
tradeTransactor
=
tradeTransactor
;
}
public
Long
getTradeTransactor
()
{
return
tradeTransactor
;
}
public
void
setTradeDeptId
(
Long
tradeDeptId
)
{
this
.
tradeDeptId
=
tradeDeptId
;
}
public
Long
getTradeDeptId
()
{
return
tradeDeptId
;
}
public
void
setTradePrice
(
BigDecimal
tradePrice
)
{
this
.
tradePrice
=
tradePrice
;
}
public
BigDecimal
getTradePrice
()
{
return
tradePrice
;
}
public
void
setTradeCount
(
BigDecimal
tradeCount
)
{
this
.
tradeCount
=
tradeCount
;
}
public
BigDecimal
getTradeCount
()
{
return
tradeCount
;
}
public
void
setTradeTotal
(
BigDecimal
tradeTotal
)
{
this
.
tradeTotal
=
tradeTotal
;
}
public
BigDecimal
getTradeTotal
()
{
return
tradeTotal
;
}
public
void
setTradeScore
(
Integer
tradeScore
)
{
this
.
tradeScore
=
tradeScore
;
}
public
Integer
getTradeScore
()
{
return
tradeScore
;
}
public
void
setTradeDeptManagerId
(
Long
tradeDeptManagerId
)
{
this
.
tradeDeptManagerId
=
tradeDeptManagerId
;
}
public
Long
getTradeDeptManagerId
()
{
return
tradeDeptManagerId
;
}
public
void
setSettlementTime
(
Date
settlementTime
)
{
this
.
settlementTime
=
settlementTime
;
}
public
Date
getSettlementTime
()
{
return
settlementTime
;
}
public
void
setDealPrice
(
BigDecimal
dealPrice
)
{
this
.
dealPrice
=
dealPrice
;
}
public
BigDecimal
getDealPrice
()
{
return
dealPrice
;
}
public
void
setPendingPayment
(
BigDecimal
pendingPayment
)
{
this
.
pendingPayment
=
pendingPayment
;
}
public
BigDecimal
getPendingPayment
()
{
return
pendingPayment
;
}
public
void
setAttachmentUrl
(
String
attachmentUrl
)
{
this
.
attachmentUrl
=
attachmentUrl
;
}
public
String
getAttachmentUrl
()
{
return
attachmentUrl
;
}
public
void
setTradeStatus
(
String
tradeStatus
)
{
this
.
tradeStatus
=
tradeStatus
;
}
public
String
getTradeStatus
()
{
return
tradeStatus
;
}
public
void
setIsDel
(
String
isDel
)
{
this
.
isDel
=
isDel
;
}
public
String
getIsDel
()
{
return
isDel
;
}
public
String
getApplyName
()
{
return
applyName
;
}
public
void
setApplyName
(
String
applyName
)
{
this
.
applyName
=
applyName
;
}
public
String
getApplyDeptName
()
{
return
applyDeptName
;
}
public
void
setApplyDeptName
(
String
applyDeptName
)
{
this
.
applyDeptName
=
applyDeptName
;
}
public
String
getTradeDeptName
()
{
return
tradeDeptName
;
}
public
void
setTradeDeptName
(
String
tradeDeptName
)
{
this
.
tradeDeptName
=
tradeDeptName
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"tradeId"
,
getTradeId
())
.
append
(
"receiptNum"
,
getReceiptNum
())
.
append
(
"relationTransactionProjectId"
,
getRelationTransactionProjectId
())
.
append
(
"applyId"
,
getApplyId
())
.
append
(
"applyDeptId"
,
getApplyDeptId
())
.
append
(
"applyDeptManagerId"
,
getApplyDeptManagerId
())
.
append
(
"tradeTransactor"
,
getTradeTransactor
())
.
append
(
"tradeDeptId"
,
getTradeDeptId
())
.
append
(
"tradePrice"
,
getTradePrice
())
.
append
(
"tradeCount"
,
getTradeCount
())
.
append
(
"tradeTotal"
,
getTradeTotal
())
.
append
(
"tradeScore"
,
getTradeScore
())
.
append
(
"tradeDeptManagerId"
,
getTradeDeptManagerId
())
.
append
(
"settlementTime"
,
getSettlementTime
())
.
append
(
"dealPrice"
,
getDealPrice
())
.
append
(
"pendingPayment"
,
getPendingPayment
())
.
append
(
"attachmentUrl"
,
getAttachmentUrl
())
.
append
(
"tradeStatus"
,
getTradeStatus
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"isDel"
,
getIsDel
())
.
append
(
"remark"
,
getRemark
())
.
toString
();
}
}
precision-effect-system/src/main/java/com/zehong/system/mapper/TTradeProjectMapper.java
0 → 100644
View file @
30406f1b
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
com.zehong.system.domain.TTradeProject
;
/**
* 交易项目Mapper接口
*
* @author zehong
* @date 2023-06-08
*/
public
interface
TTradeProjectMapper
{
/**
* 查询交易项目
*
* @param tradeId 交易项目ID
* @return 交易项目
*/
public
TTradeProject
selectTTradeProjectById
(
Long
tradeId
);
/**
* 查询交易项目列表
*
* @param tTradeProject 交易项目
* @return 交易项目集合
*/
public
List
<
TTradeProject
>
selectTTradeProjectList
(
TTradeProject
tTradeProject
);
/**
* 新增交易项目
*
* @param tTradeProject 交易项目
* @return 结果
*/
public
int
insertTTradeProject
(
TTradeProject
tTradeProject
);
/**
* 修改交易项目
*
* @param tTradeProject 交易项目
* @return 结果
*/
public
int
updateTTradeProject
(
TTradeProject
tTradeProject
);
/**
* 删除交易项目
*
* @param tradeId 交易项目ID
* @return 结果
*/
public
int
deleteTTradeProjectById
(
Long
tradeId
);
/**
* 批量删除交易项目
*
* @param tradeIds 需要删除的数据ID
* @return 结果
*/
public
int
deleteTTradeProjectByIds
(
Long
[]
tradeIds
);
}
precision-effect-system/src/main/java/com/zehong/system/service/ITTradeProjectService.java
0 → 100644
View file @
30406f1b
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.system.domain.TTradeProject
;
/**
* 交易项目Service接口
*
* @author zehong
* @date 2023-06-08
*/
public
interface
ITTradeProjectService
{
/**
* 查询交易项目
*
* @param tradeId 交易项目ID
* @return 交易项目
*/
public
TTradeProject
selectTTradeProjectById
(
Long
tradeId
);
/**
* 查询交易项目列表
*
* @param tTradeProject 交易项目
* @return 交易项目集合
*/
public
List
<
TTradeProject
>
selectTTradeProjectList
(
TTradeProject
tTradeProject
);
/**
* 新增交易项目
*
* @param tTradeProject 交易项目
* @return 结果
*/
public
int
insertTTradeProject
(
TTradeProject
tTradeProject
);
/**
* 修改交易项目
*
* @param tTradeProject 交易项目
* @return 结果
*/
public
int
updateTTradeProject
(
TTradeProject
tTradeProject
);
/**
* 批量删除交易项目
*
* @param tradeIds 需要删除的交易项目ID
* @return 结果
*/
public
int
deleteTTradeProjectByIds
(
Long
[]
tradeIds
);
/**
* 删除交易项目信息
*
* @param tradeId 交易项目ID
* @return 结果
*/
public
int
deleteTTradeProjectById
(
Long
tradeId
);
}
precision-effect-system/src/main/java/com/zehong/system/service/impl/TTradeProjectServiceImpl.java
0 → 100644
View file @
30406f1b
package
com
.
zehong
.
system
.
service
.
impl
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.SecurityUtils
;
import
com.zehong.system.domain.TTradeProject
;
import
com.zehong.system.mapper.TTradeProjectMapper
;
import
com.zehong.system.service.ITTradeProjectService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 交易项目Service业务层处理
*
* @author zehong
* @date 2023-06-08
*/
@Service
public
class
TTradeProjectServiceImpl
implements
ITTradeProjectService
{
@Autowired
private
TTradeProjectMapper
tTradeProjectMapper
;
/**
* 查询交易项目
*
* @param tradeId 交易项目ID
* @return 交易项目
*/
@Override
public
TTradeProject
selectTTradeProjectById
(
Long
tradeId
)
{
return
tTradeProjectMapper
.
selectTTradeProjectById
(
tradeId
);
}
/**
* 查询交易项目列表
*
* @param tTradeProject 交易项目
* @return 交易项目
*/
@Override
public
List
<
TTradeProject
>
selectTTradeProjectList
(
TTradeProject
tTradeProject
)
{
return
tTradeProjectMapper
.
selectTTradeProjectList
(
tTradeProject
);
}
/**
* 新增交易项目
*
* @param tTradeProject 交易项目
* @return 结果
*/
@Override
public
int
insertTTradeProject
(
TTradeProject
tTradeProject
)
{
tTradeProject
.
setReceiptNum
(
"ZEHONG"
+
DateUtils
.
dateTimeNow
());
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
tTradeProject
.
setApplyId
(
user
.
getUserId
());
tTradeProject
.
setApplyDeptId
(
user
.
getDeptId
());
tTradeProject
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
tTradeProjectMapper
.
insertTTradeProject
(
tTradeProject
);
}
/**
* 修改交易项目
*
* @param tTradeProject 交易项目
* @return 结果
*/
@Override
public
int
updateTTradeProject
(
TTradeProject
tTradeProject
)
{
tTradeProject
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
tTradeProjectMapper
.
updateTTradeProject
(
tTradeProject
);
}
/**
* 批量删除交易项目
*
* @param tradeIds 需要删除的交易项目ID
* @return 结果
*/
@Override
public
int
deleteTTradeProjectByIds
(
Long
[]
tradeIds
)
{
return
tTradeProjectMapper
.
deleteTTradeProjectByIds
(
tradeIds
);
}
/**
* 删除交易项目信息
*
* @param tradeId 交易项目ID
* @return 结果
*/
@Override
public
int
deleteTTradeProjectById
(
Long
tradeId
)
{
return
tTradeProjectMapper
.
deleteTTradeProjectById
(
tradeId
);
}
}
precision-effect-system/src/main/resources/mapper/business/TTradeProjectMapper.xml
0 → 100644
View file @
30406f1b
This diff is collapsed.
Click to expand it.
precision-effect-web/src/api/transaction/project.js
View file @
30406f1b
...
...
@@ -3,16 +3,25 @@ import request from '@/utils/request'
// 查询交易项目列表
export
function
listProject
(
query
)
{
return
request
({
url
:
'/system/project/list'
,
url
:
'/transaction/project/list'
,
method
:
'get'
,
params
:
query
})
}
//获取所有项目
export
function
getTransactionProjectList
(
query
){
return
request
({
url
:
'/transaction/project/getTransactionProjectList'
,
method
:
'get'
,
params
:
query
})
}
// 查询交易项目详细
export
function
getProject
(
transaction
Project
Id
)
{
export
function
getProject
(
transactionId
)
{
return
request
({
url
:
'/
system/project/'
+
transactionProject
Id
,
url
:
'/
transaction/project/'
+
transaction
Id
,
method
:
'get'
})
}
...
...
@@ -20,7 +29,7 @@ export function getProject(transactionProjectId) {
// 新增交易项目
export
function
addProject
(
data
)
{
return
request
({
url
:
'/
system
/project'
,
url
:
'/
transaction
/project'
,
method
:
'post'
,
data
:
data
})
...
...
@@ -29,16 +38,16 @@ export function addProject(data) {
// 修改交易项目
export
function
updateProject
(
data
)
{
return
request
({
url
:
'/
system
/project'
,
url
:
'/
transaction
/project'
,
method
:
'put'
,
data
:
data
})
}
// 删除交易项目
export
function
delProject
(
transaction
Project
Id
)
{
export
function
delProject
(
transactionId
)
{
return
request
({
url
:
'/
system/project/'
+
transactionProject
Id
,
url
:
'/
transaction/project/'
+
transaction
Id
,
method
:
'delete'
})
}
...
...
@@ -46,8 +55,8 @@ export function delProject(transactionProjectId) {
// 导出交易项目
export
function
exportProject
(
query
)
{
return
request
({
url
:
'/
system
/project/export'
,
url
:
'/
transaction
/project/export'
,
method
:
'get'
,
params
:
query
})
}
\ No newline at end of file
}
precision-effect-web/src/api/transaction/tradeProject.js
0 → 100644
View file @
30406f1b
import
request
from
'@/utils/request'
// 查询交易项目列表
export
function
listProject
(
query
)
{
return
request
({
url
:
'/trade/project/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询交易项目详细
export
function
getProject
(
tradeId
)
{
return
request
({
url
:
'/trade/project/'
+
tradeId
,
method
:
'get'
})
}
// 新增交易项目
export
function
addProject
(
data
)
{
return
request
({
url
:
'/trade/project'
,
method
:
'post'
,
data
:
data
})
}
// 修改交易项目
export
function
updateProject
(
data
)
{
return
request
({
url
:
'/trade/project'
,
method
:
'put'
,
data
:
data
})
}
// 删除交易项目
export
function
delProject
(
tradeId
)
{
return
request
({
url
:
'/trade/project/'
+
tradeId
,
method
:
'delete'
})
}
// 导出交易项目
export
function
exportProject
(
query
)
{
return
request
({
url
:
'/trade/project/export'
,
method
:
'get'
,
params
:
query
})
}
precision-effect-web/src/assets/uploadfile.png
0 → 100644
View file @
30406f1b
2.43 KB
precision-effect-web/src/components/FileUpload/index.vue
View file @
30406f1b
...
...
@@ -2,30 +2,58 @@
<div
class=
"upload-file"
>
<el-upload
:action=
"uploadFileUrl"
:disabled=
"disabled"
:before-upload=
"handleBeforeUpload"
:file-list=
"file
List
"
:file-list=
"file
Arr
"
:limit=
"1"
:fileType=
"fileType"
:list-type=
"listType"
:on-error=
"handleUploadError"
:on-exceed=
"handleExceed"
:on-success=
"handleUploadSuccess"
:show-file-list=
"false"
:on-remove=
"handleRemove"
:on-preview=
"handleFileClick"
:on-change=
"fileChange"
:show-file-list=
"true"
:headers=
"headers"
class=
"upload-file-uploader"
:class=
"
{ hide: fileArr.length > 0 || addShow }"
ref="upload"
>
<!-- 上传按钮 -->
<el-button
size=
"mini"
type=
"primary"
>
选取文件
</el-button>
<el-button
:disabled=
"disabled"
plain
type=
"primary"
>
选取文件
</el-button>
<!--
<i
class=
"el-icon-plus"
></i>
-->
<!-- 上传提示 -->
<div
class=
"el-upload__tip"
slot=
"tip"
v-if=
"showTip"
>
请上传
<template
v-if=
"fileSize"
>
大小不超过
<b
style=
"color: #f56c6c"
>
{{
fileSize
}}
MB
</b>
</
template
>
<
template
v-if=
"fileType"
>
格式为
<b
style=
"color: #f56c6c"
>
{{
fileType
.
join
(
"/"
)
}}
</b>
</
template
>
的文件
<template
v-if=
"fileSize"
>
大小不超过
<b
style=
"color: #f56c6c"
>
{{
fileSize
}}
MB
</b>
</
template
>
<
template
v-if=
"fileType"
>
格式为
<b
style=
"color: #f56c6c"
>
{{
fileType
.
join
(
"/"
)
}}
</b>
</
template
>
的文件,且不超过一个
</div>
</el-upload>
<el-image
v-show=
"false"
id=
"img"
ref=
"previewImg"
:src=
"dialogImageUrl"
:preview-src-list=
"bigImageArr"
:z-index=
"9999999"
></el-image>
<!-- <el-dialog
:center="true"
width="50%"
:modal="modal"
:visible.sync="dialogVisible"
>
<img :src="dialogImageUrl" alt="" />
</el-dialog> -->
<!-- 文件列表 -->
<transition-group
class=
"upload-file-list el-upload-list el-upload-list--text"
name=
"el-fade-in-linear"
tag=
"ul"
>
<
!-- <
transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list">
<el-link :href="file.url" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
...
...
@@ -34,32 +62,44 @@
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div>
</li>
</transition-group>
</transition-group>
-->
</div>
</template>
<
script
>
import
{
getToken
}
from
"@/utils/auth"
;
import
{
getToken
}
from
"@/utils/auth"
;
export
default
{
props
:
{
// 值
value
:
[
String
,
Object
,
Array
],
// 大小限制(MB)
fileSize
:
{
type
:
Number
,
default
:
5
,
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType
:
{
type
:
Array
,
default
:
()
=>
[
"doc"
,
"xls"
,
"ppt"
,
"txt"
,
"pdf"
],
export
default
{
props
:
{
// 值
value
:
[
String
,
Object
,
Array
],
listType
:
{
type
:
String
,
defaule
:
"text"
,
},
// 大小限制(MB)
fileSize
:
{
type
:
Number
,
default
:
50
,
},
fileArr
:
{
type
:
Array
,
default
:
[],
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType
:
{
type
:
Array
,
default
:
()
=>
[
"doc"
,
"xls"
,
"ppt"
,
"txt"
,
"pdf"
],
},
// 是否显示提示
isShowTip
:
{
type
:
Boolean
,
default
:
true
}
default
:
true
,
},
disabled
:
{
type
:
Boolean
,
default
:
false
,
},
},
data
()
{
return
{
...
...
@@ -68,6 +108,10 @@ export default {
Authorization
:
"Bearer "
+
getToken
(),
},
fileList
:
[],
modal
:
false
,
dialogVisible
:
false
,
dialogImageUrl
:
""
,
addShow
:
true
,
};
},
computed
:
{
...
...
@@ -84,16 +128,19 @@ export default {
// 然后将数组转为对象数组
return
list
.
map
((
item
)
=>
{
if
(
typeof
item
===
"string"
)
{
item
=
{
name
:
item
,
url
:
item
};
}
item
.
uid
=
item
.
uid
||
new
Date
().
getTime
()
+
temp
++
;
return
item
;
});
item
=
{
name
:
item
,
url
:
item
};
}
item
.
uid
=
item
.
uid
||
new
Date
().
getTime
()
+
temp
++
;
return
item
;
});
}
else
{
this
.
fileList
=
[];
return
[];
}
},
bigImageArr
()
{
return
[
this
.
dialogImageUrl
];
},
},
methods
:
{
// 上传前校检格式和大小
...
...
@@ -106,11 +153,13 @@ export default {
}
const
isTypeOk
=
this
.
fileType
.
some
((
type
)
=>
{
if
(
file
.
type
.
indexOf
(
type
)
>
-
1
)
return
true
;
if
(
fileExtension
&&
fileExtension
.
indexOf
(
type
)
>
-
1
)
return
true
;
return
false
;
});
if
(
fileExtension
&&
fileExtension
.
indexOf
(
type
)
>
-
1
)
return
true
;
return
false
;
});
if
(
!
isTypeOk
)
{
this
.
$message
.
error
(
`文件格式不正确, 请上传
${
this
.
fileType
.
join
(
"/"
)}
格式文件!`
);
this
.
$message
.
error
(
`文件格式不正确, 请上传
${
this
.
fileType
.
join
(
"/"
)}
格式文件!`
);
return
false
;
}
}
...
...
@@ -135,12 +184,42 @@ export default {
// 上传成功回调
handleUploadSuccess
(
res
,
file
)
{
this
.
$message
.
success
(
"上传成功"
);
this
.
$emit
(
"input"
,
res
.
url
);
this
.
$emit
(
"resFun"
,
res
);
},
// 文件列表移除文件
handleRemove
(
file
,
fileList
)
{
console
.
log
(
"列表移除"
,
file
,
fileList
);
this
.
addShow
=
fileList
.
length
>
0
?
true
:
false
;
this
.
$emit
(
"remove"
,
file
);
},
// 删除文件
handleDelete
(
index
)
{
this
.
fileList
.
splice
(
index
,
1
);
this
.
$emit
(
"input"
,
''
);
this
.
$emit
(
"input"
,
""
);
// let that = this,
// param;
// param = file.response ? file.response.fileName.replace(/\\/g, "%")
// : file.response.url.replace(/\\/g, "%").slice(9);
// $.ajax({
// type: "GET",
// url: process.env.VUE_APP_BASE_API + "/common/deleteFile",
// data: {savePath: param},
// dataType: "json",
// success: function(data){
// if (data) that.$message.success("删除成功");
// else return false;
// }
// });
},
handleFileClick
(
file
,
fileList
)
{
this
.
dialogImageUrl
=
file
.
response
?
file
.
response
.
url
:
file
.
url
;
// this.dialogImageUrl =if(this.fileArr) this.fileArr[0].url;
// this.dialogVisible = true;
this
.
$refs
.
previewImg
.
showViewer
=
false
;
console
.
log
(
file
);
// console.log(file.response.url)
},
// 获取文件名称
getFileName
(
name
)
{
...
...
@@ -149,31 +228,40 @@ export default {
}
else
{
return
""
;
}
}
},
// 当改变列表改变时
fileChange
(
file
,
fileList
)
{
this
.
addShow
=
fileList
.
length
>
0
?
true
:
false
;
},
},
created
()
{
this
.
fileList
=
this
.
list
;
console
.
log
(
this
.
fileArr
);
// this.fileList = this.list;
this
.
addShow
=
this
.
fileArr
.
length
>
0
?
true
:
false
;
},
};
};
</
script
>
<
style
scoped
lang=
"scss"
>
.upload-file-uploader
{
margin-bottom
:
5px
;
}
.upload-file-list
.el-upload-list__item
{
border
:
1px
solid
#e4e7ed
;
line-height
:
2
;
margin-bottom
:
10px
;
position
:
relative
;
}
.upload-file-list
.ele-upload-list__item-content
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
color
:
inherit
;
}
.ele-upload-list__item-content-action
.el-link
{
margin-right
:
10px
;
}
</
style
>
\ No newline at end of file
img
{
width
:
100%
;
}
.upload-file-uploader
{
margin-bottom
:
5px
;
}
.upload-file-list
.el-upload-list__item
{
border
:
1px
solid
#e4e7ed
;
line-height
:
2
;
margin-bottom
:
10px
;
position
:
relative
;
}
.upload-file-list
.ele-upload-list__item-content
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
color
:
inherit
;
}
.ele-upload-list__item-content-action
.el-link
{
margin-right
:
10px
;
}
</
style
>
precision-effect-web/src/views/trade/index.vue
0 → 100644
View file @
30406f1b
This diff is collapsed.
Click to expand it.
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