Commit 4bb3b2c0 authored by 耿迪迪's avatar 耿迪迪

交易中心

parent 30406f1b
...@@ -7,14 +7,7 @@ import com.zehong.framework.systemsetting.SystemSetting; ...@@ -7,14 +7,7 @@ import com.zehong.framework.systemsetting.SystemSetting;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import com.zehong.common.annotation.Log; import com.zehong.common.annotation.Log;
import com.zehong.common.constant.UserConstants; import com.zehong.common.constant.UserConstants;
...@@ -207,4 +200,14 @@ public class SysUserController extends BaseController ...@@ -207,4 +200,14 @@ public class SysUserController extends BaseController
user.setUpdateBy(SecurityUtils.getUsername()); user.setUpdateBy(SecurityUtils.getUsername());
return toAjax(userService.updateUserStatus(user)); return toAjax(userService.updateUserStatus(user));
} }
/**
* 获取经办人
* @param deptId 部门id
* @return
*/
@GetMapping("/selectTransactorByDeptId")
public AjaxResult selectTransactorByDeptId(@RequestParam(value="deptId") Long deptId){
return AjaxResult.success(userService.selectTransactorByDeptId(deptId));
}
} }
...@@ -39,6 +39,13 @@ public class TTradeProjectController extends BaseController ...@@ -39,6 +39,13 @@ public class TTradeProjectController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/selectTTradeProjectListByRoles")
public TableDataInfo selectTTradeProjectListByRoles(TTradeProject tTradeProject){
startPage();
List<TTradeProject> list = tTradeProjectService.selectTTradeProjectListByRoles(tTradeProject);
return getDataTable(list);
}
/** /**
* 导出交易项目列表 * 导出交易项目列表
*/ */
......
...@@ -7,7 +7,9 @@ import org.apache.commons.lang3.builder.ToStringBuilder; ...@@ -7,7 +7,9 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 交易项目对象 t_trade_project * 交易项目对象 t_trade_project
...@@ -101,6 +103,14 @@ public class TTradeProject extends BaseEntity ...@@ -101,6 +103,14 @@ public class TTradeProject extends BaseEntity
private String tradeDeptName; private String tradeDeptName;
/**查询类型:all全部 myApply我申请的 myApproval我的审批*/
private String queryType;
private String tradeDeptManagerName;
/**操作类型*/
private List<String> operators = new ArrayList<>();
public void setTradeId(Long tradeId) public void setTradeId(Long tradeId)
{ {
this.tradeId = tradeId; this.tradeId = tradeId;
...@@ -297,6 +307,30 @@ public class TTradeProject extends BaseEntity ...@@ -297,6 +307,30 @@ public class TTradeProject extends BaseEntity
this.tradeDeptName = tradeDeptName; this.tradeDeptName = tradeDeptName;
} }
public String getQueryType() {
return queryType;
}
public void setQueryType(String queryType) {
this.queryType = queryType;
}
public List<String> getOperators() {
return operators;
}
public void setOperators(List<String> operators) {
this.operators = operators;
}
public String getTradeDeptManagerName() {
return tradeDeptManagerName;
}
public void setTradeDeptManagerName(String tradeDeptManagerName) {
this.tradeDeptManagerName = tradeDeptManagerName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -108,4 +108,11 @@ public interface SysUserMapper ...@@ -108,4 +108,11 @@ public interface SysUserMapper
* @return 结果 * @return 结果
*/ */
public SysUser checkEmailUnique(String email); public SysUser checkEmailUnique(String email);
/**
* 获取经办人
* @param deptId 部门id
* @return
*/
List<SysUser> selectTransactorByDeptId(Long deptId);
} }
...@@ -164,4 +164,11 @@ public interface ISysUserService ...@@ -164,4 +164,11 @@ public interface ISysUserService
* @return 结果 * @return 结果
*/ */
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
/**
* 获取经办人
* @param deptId 部门id
* @return
*/
List<SysUser> selectTransactorByDeptId(Long deptId);
} }
...@@ -27,6 +27,13 @@ public interface ITTradeProjectService ...@@ -27,6 +27,13 @@ public interface ITTradeProjectService
*/ */
public List<TTradeProject> selectTTradeProjectList(TTradeProject tTradeProject); public List<TTradeProject> selectTTradeProjectList(TTradeProject tTradeProject);
/**
* 根据角色查询数据
* @param tTradeProject 交易实体
* @return
*/
List<TTradeProject> selectTTradeProjectListByRoles(TTradeProject tTradeProject);
/** /**
* 新增交易项目 * 新增交易项目
* *
......
...@@ -460,4 +460,13 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -460,4 +460,13 @@ public class SysUserServiceImpl implements ISysUserService
} }
return successMsg.toString(); return successMsg.toString();
} }
/**
* 获取经办人
* @param deptId 部门id
* @return
*/
public List<SysUser> selectTransactorByDeptId(Long deptId){
return userMapper.selectTransactorByDeptId(deptId);
}
} }
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import com.zehong.common.core.domain.entity.SysRole;
import com.zehong.common.core.domain.entity.SysUser; import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils; import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TTradeProject; import com.zehong.system.domain.TTradeProject;
import com.zehong.system.mapper.TTradeProjectMapper; import com.zehong.system.mapper.TTradeProjectMapper;
import com.zehong.system.service.ITTradeProjectService; import com.zehong.system.service.ITTradeProjectService;
import com.zehong.system.service.impl.tradeRoles.*;
import com.zehong.system.service.impl.tradeRoles.roles.DeptLeader;
import com.zehong.system.service.impl.tradeRoles.roles.DoubleRoles;
import com.zehong.system.service.impl.tradeRoles.roles.OtherRoles;
import com.zehong.system.service.impl.tradeRoles.roles.Transactor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 交易项目Service业务层处理 * 交易项目Service业务层处理
...@@ -47,6 +54,44 @@ public class TTradeProjectServiceImpl implements ITTradeProjectService ...@@ -47,6 +54,44 @@ public class TTradeProjectServiceImpl implements ITTradeProjectService
return tTradeProjectMapper.selectTTradeProjectList(tTradeProject); return tTradeProjectMapper.selectTTradeProjectList(tTradeProject);
} }
/**
* 根据角色查询数据
* @param tTradeProject 交易实体
* @return
*/
@Override
public List<TTradeProject> selectTTradeProjectListByRoles(TTradeProject tTradeProject){
judgeRole(tTradeProject).setQueryParams();
List<TTradeProject> tradeProjectList = tTradeProjectMapper.selectTTradeProjectList(tTradeProject);
for(TTradeProject project :tradeProjectList){
judgeRole(project).setOperators();
}
return tradeProjectList;
}
/**
* 判断角色
* @param tTradeProject
* @return TradeRoles
*/
private TradeRoles judgeRole(TTradeProject tTradeProject) {
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
List<String> roleKeys = roles.stream().map(item -> item.getRoleKey()).collect(Collectors.toList());
//双权限
if(roleKeys.contains("transactor") && roleKeys.contains("deptLeader")){
return new DoubleRoles(tTradeProject);
}
//经办人
if(roleKeys.contains("transactor")){
return new Transactor(tTradeProject);
}
//部长
if(roleKeys.contains("deptLeader")){
return new DeptLeader(tTradeProject);
}
return new OtherRoles(tTradeProject);
}
/** /**
* 新增交易项目 * 新增交易项目
* *
......
package com.zehong.system.service.impl.tradeRoles;
/**
* @author geng
* 交易角色
*/
public interface TradeRoles {
/**
* 设置查询权限
*/
void setQueryParams();
/**
* 设置操作权限
*/
void setOperators();
}
package com.zehong.system.service.impl.tradeRoles;
import com.zehong.system.domain.TTradeProject;
public abstract class TradeRolesAbstract implements TradeRoles{
/**交易实体*/
protected TTradeProject tTradeProject;
/**交易状态枚举类*/
protected enum TradeStatusEnum{
evaluate("0"),confirm("1"),approval("2"),complete("3"),reject("4");
private final String tradeStatus;
TradeStatusEnum(String tradeStatus) {
this.tradeStatus = tradeStatus;
}
public String getTradeStatus() {
return tradeStatus;
}
}
public TradeRolesAbstract(TTradeProject tTradeProject){
this.tTradeProject = tTradeProject;
}
}
package com.zehong.system.service.impl.tradeRoles.roles;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TTradeProject;
import com.zehong.system.service.impl.tradeRoles.TradeRolesAbstract;
/**
* @author geng
* 部门长
*/
public class DeptLeader extends TradeRolesAbstract {
public DeptLeader(TTradeProject tTradeProject) {
super(tTradeProject);
}
@Override
public void setQueryParams() {
SysUser user = SecurityUtils.getLoginUser().getUser();
if("myApply".equals(tTradeProject.getQueryType()) ||"all".equals(tTradeProject.getQueryType())){
this.tTradeProject.setApplyDeptId(user.getDeptId());
}
if("myApproval".equals(tTradeProject.getQueryType()) || "all".equals(tTradeProject.getQueryType())){
this.tTradeProject.setTradeDeptId(user.getDeptId());
}
}
@Override
public void setOperators() {
//判断买方还是卖方
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
//卖方部门
if(deptId.equals(this.tTradeProject.getApplyDeptId()) && TradeStatusEnum.approval.getTradeStatus().equals(this.tTradeProject.getTradeStatus())){
tTradeProject.getOperators().add("approval");
}
//买方部门
if(deptId.equals(this.tTradeProject.getTradeDeptId()) && TradeStatusEnum.confirm.getTradeStatus().equals(this.tTradeProject.getTradeStatus())){
tTradeProject.getOperators().add("confirm");
}
}
}
package com.zehong.system.service.impl.tradeRoles.roles;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TTradeProject;
import com.zehong.system.service.impl.tradeRoles.TradeRolesAbstract;
/**
*
* 部长和经办人双角色
*/
public class DoubleRoles extends TradeRolesAbstract {
public DoubleRoles(TTradeProject tTradeProject) {
super(tTradeProject);
}
/**
* 多权限以最高权限为准
*/
@Override
public void setQueryParams() {
SysUser user = SecurityUtils.getLoginUser().getUser();
if("myApply".equals(tTradeProject.getQueryType()) ||"all".equals(tTradeProject.getQueryType())){
this.tTradeProject.setApplyDeptId(user.getDeptId());
}
if("myApproval".equals(tTradeProject.getQueryType()) || "all".equals(tTradeProject.getQueryType())){
this.tTradeProject.setTradeDeptId(user.getDeptId());
}
}
@Override
public void setOperators() {
//判断买方还是卖方
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
//买方评价
if(deptId.equals(this.tTradeProject.getTradeDeptId()) && (TradeStatusEnum.evaluate.getTradeStatus().equals(this.tTradeProject.getTradeStatus())||TradeStatusEnum.reject.getTradeStatus().equals(this.tTradeProject.getTradeStatus()))){
tTradeProject.getOperators().add("evaluate");
}
//卖方部门
if(deptId.equals(this.tTradeProject.getApplyDeptId()) && TradeStatusEnum.approval.getTradeStatus().equals(this.tTradeProject.getTradeStatus())){
tTradeProject.getOperators().add("approval");
}
//买方部门
if(deptId.equals(this.tTradeProject.getTradeDeptId()) && TradeStatusEnum.confirm.getTradeStatus().equals(this.tTradeProject.getTradeStatus())){
tTradeProject.getOperators().add("confirm");
}
}
}
package com.zehong.system.service.impl.tradeRoles.roles;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TTradeProject;
import com.zehong.system.service.impl.tradeRoles.TradeRolesAbstract;
/**
* 其他角色
*/
public class OtherRoles extends TradeRolesAbstract {
public OtherRoles(TTradeProject tTradeProject) {
super(tTradeProject);
}
@Override
public void setQueryParams() {
SysUser user = SecurityUtils.getLoginUser().getUser();
if("myApply".equals(tTradeProject.getQueryType()) ||"all".equals(tTradeProject.getQueryType())){
this.tTradeProject.setApplyDeptId(user.getDeptId());
this.tTradeProject.setApplyId(user.getUserId());
}
if("myApproval".equals(tTradeProject.getQueryType()) || "all".equals(tTradeProject.getQueryType())){
this.tTradeProject.setTradeDeptId(user.getDeptId());
this.tTradeProject.setTradeTransactor(user.getUserId());
}
}
@Override
public void setOperators() {
}
}
package com.zehong.system.service.impl.tradeRoles.roles;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TTradeProject;
import com.zehong.system.service.impl.tradeRoles.TradeRolesAbstract;
/**
*@author geng
* 经办人
*/
public class Transactor extends TradeRolesAbstract {
public Transactor(TTradeProject tTradeProject) {
super(tTradeProject);
}
@Override
public void setQueryParams() {
SysUser user = SecurityUtils.getLoginUser().getUser();
if("myApply".equals(tTradeProject.getQueryType()) ||"all".equals(tTradeProject.getQueryType())){
this.tTradeProject.setApplyDeptId(user.getDeptId());
this.tTradeProject.setApplyId(user.getUserId());
}
if("myApproval".equals(tTradeProject.getQueryType()) || "all".equals(tTradeProject.getQueryType())){
this.tTradeProject.setTradeDeptId(user.getDeptId());
this.tTradeProject.setTradeTransactor(user.getUserId());
}
}
@Override
public void setOperators() {
//申请中
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
if(deptId.equals(this.tTradeProject.getTradeDeptId()) && (TradeStatusEnum.evaluate.getTradeStatus().equals(this.tTradeProject.getTradeStatus())||TradeStatusEnum.reject.getTradeStatus().equals(this.tTradeProject.getTradeStatus()))){
tTradeProject.getOperators().add("evaluate");
}
}
}
...@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="applyName" column="apply_name"/> <result property="applyName" column="apply_name"/>
<result property="applyDeptName" column="apply_dept_name"/> <result property="applyDeptName" column="apply_dept_name"/>
<result property="tradeDeptName" column="trade_dept_name"/> <result property="tradeDeptName" column="trade_dept_name"/>
<result property="tradeDeptManagerName" column="trade_dept_manager_name"/>
</resultMap> </resultMap>
<sql id="selectTTradeProjectVo"> <sql id="selectTTradeProjectVo">
...@@ -56,9 +57,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -56,9 +57,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time, update_time,
is_del, is_del,
remark, remark,
(SELECT nick_name FROM sys_user WHERE user_id = apply_id) AS apply_name, (SELECT user_name FROM sys_user WHERE user_id = apply_id) AS apply_name,
(SELECT dept_name FROM sys_dept WHERE dept_id = apply_dept_id) AS apply_dept_name, (SELECT dept_name FROM sys_dept WHERE dept_id = apply_dept_id) AS apply_dept_name,
(SELECT dept_name FROM sys_dept WHERE dept_id = trade_dept_id) AS trade_dept_name (SELECT dept_name FROM sys_dept WHERE dept_id = trade_dept_id) AS trade_dept_name,
(SELECT user_name FROM sys_user WHERE user_id = trade_dept_manager_id) AS trade_dept_manager_name
FROM FROM
t_trade_project t_trade_project
</sql> </sql>
...@@ -68,11 +70,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -68,11 +70,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="receiptNum != null and receiptNum != ''"> and receipt_num = #{receiptNum}</if> <if test="receiptNum != null and receiptNum != ''"> and receipt_num = #{receiptNum}</if>
<if test="relationTransactionProjectId != null "> and relation_transaction_project_id = #{relationTransactionProjectId}</if> <if test="relationTransactionProjectId != null "> and relation_transaction_project_id = #{relationTransactionProjectId}</if>
<if test="applyId != null "> and apply_id = #{applyId}</if> <if test="queryType != 'all'">
<if test="applyDeptId != null "> and apply_dept_id = #{applyDeptId}</if> <if test="applyId != null"> and apply_id = #{applyId}</if>
<if test="applyDeptId != null"> and apply_dept_id = #{applyDeptId}</if>
<if test="tradeTransactor != null"> and trade_transactor = #{tradeTransactor}</if>
<if test="tradeDeptId != null"> and trade_dept_id = #{tradeDeptId}</if>
</if>
<if test="queryType == 'all' and applyDeptId != null and tradeTransactor != null">
and (
(apply_dept_id = #{applyDeptId}
<if test="applyId != null"> and apply_id = #{applyId}</if>)
or(trade_dept_id = #{tradeDeptId}
<if test="tradeTransactor != null"> and trade_transactor = #{tradeTransactor}</if>)
)
</if>
<if test="applyDeptManagerId != null "> and apply_dept_manager_id = #{applyDeptManagerId}</if> <if test="applyDeptManagerId != null "> and apply_dept_manager_id = #{applyDeptManagerId}</if>
<if test="tradeTransactor != null "> and trade_transactor = #{tradeTransactor}</if>
<if test="tradeDeptId != null "> and trade_dept_id = #{tradeDeptId}</if>
<if test="tradePrice != null "> and trade_price = #{tradePrice}</if> <if test="tradePrice != null "> and trade_price = #{tradePrice}</if>
<if test="tradeCount != null "> and trade_count = #{tradeCount}</if> <if test="tradeCount != null "> and trade_count = #{tradeCount}</if>
<if test="tradeTotal != null "> and trade_total = #{tradeTotal}</if> <if test="tradeTotal != null "> and trade_total = #{tradeTotal}</if>
......
...@@ -179,4 +179,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -179,4 +179,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<select id="selectTransactorByDeptId" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.dept_id = #{deptId} AND r.role_key = "transactor";
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
"clipboard": "2.0.6", "clipboard": "2.0.6",
"core-js": "^3.19.1", "core-js": "^3.19.1",
"echarts": "4.9.0", "echarts": "4.9.0",
"element-ui": "2.15.0", "element-ui": "2.15.6",
"file-saver": "2.0.4", "file-saver": "2.0.4",
"fuse.js": "6.4.3", "fuse.js": "6.4.3",
"highlight.js": "9.18.5", "highlight.js": "9.18.5",
......
...@@ -125,3 +125,11 @@ export function importTemplate() { ...@@ -125,3 +125,11 @@ export function importTemplate() {
method: 'get' method: 'get'
}) })
} }
export function selectTransactorByDeptId(query){
return request({
url: '/system/user/selectTransactorByDeptId',
method: 'get',
params: query
})
}
...@@ -9,6 +9,15 @@ export function listProject(query) { ...@@ -9,6 +9,15 @@ export function listProject(query) {
}) })
} }
export function selectTTradeProjectListByRoles(query) {
return request({
url: '/trade/project/selectTTradeProjectListByRoles',
method: 'get',
params: query
})
}
// 查询交易项目详细 // 查询交易项目详细
export function getProject(tradeId) { export function getProject(tradeId) {
return request({ return request({
......
...@@ -10,6 +10,7 @@ const user = { ...@@ -10,6 +10,7 @@ const user = {
permissions: [], permissions: [],
systemSetting:{}, systemSetting:{},
deptId: '', deptId: '',
userId: ''
}, },
mutations: { mutations: {
...@@ -19,6 +20,9 @@ const user = { ...@@ -19,6 +20,9 @@ const user = {
SET_NAME: (state, name) => { SET_NAME: (state, name) => {
state.name = name state.name = name
}, },
SET_USER_ID: (state, userId) =>{
state.userId = userId;
},
SET_AVATAR: (state, avatar) => { SET_AVATAR: (state, avatar) => {
state.avatar = avatar state.avatar = avatar
}, },
...@@ -68,6 +72,7 @@ const user = { ...@@ -68,6 +72,7 @@ const user = {
commit('SET_ROLES', ['ROLE_DEFAULT']) commit('SET_ROLES', ['ROLE_DEFAULT'])
} }
commit('SET_NAME', user.userName) commit('SET_NAME', user.userName)
commit('SET_USER_ID',user.userId)
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
// 默认配置 // 默认配置
commit('SET_SYSTEMSETTING', res.systemSetting) commit('SET_SYSTEMSETTING', res.systemSetting)
......
<template>
<div>
<CommonInfo :tradeData="tradeData"/>
<div style="margin: 11px 30px;color: #1890ff;">买方审核</div>
<el-row style="margin-left:97px">
<el-col :span="5">
<el-row>
<el-col :span="6">评价</el-col>
<el-col :span="18">{{tradeData.tradeScore?tradeData.tradeScore:"-"}}</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="8">成交价</el-col>
<el-col :span="16">{{tradeData.dealPrice}}</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="8">审核人</el-col>
<el-col :span="16">{{tradeData.tradeDeptManagerName}}</el-col>
</el-row>
</el-col>
</el-row>
<el-divider></el-divider>
<div style="margin: 11px 30px;color: #1890ff;">部门复核</div>
<el-row style="margin-left:97px">
<el-col :span="10">
<el-row>
<el-col :span="6">
<el-radio v-model="radio" label="1">通过</el-radio>
</el-col>
<el-col :span="6">
<el-radio v-model="radio" label="2">不通过</el-radio>
</el-col>
</el-row>
</el-col>
<el-col :span="10">
<el-row>
<el-col :span="5">审核人</el-col>
<el-col :span="16"><el-input :value="$store.state.user.name" style="width: 90px" disabled/></el-col>
</el-row>
</el-col>
</el-row>
</div>
</template>
<script>
import CommonInfo from "./CommonInfo";
export default {
name: "approval",
props:{
tradeData: {
type: Object
}
},
components:{
CommonInfo
},
watch:{
radio(newVal,oldVal){
if(newVal== "1"){
this.tradeStatus = "3";
}
if(newVal== "2"){
this.tradeStatus = "4";
}
}
},
data(){
return{
radio: "1",
tradeStatus: "3"
}
},
methods:{
checkParam(){
return false;
},
submitSuggestion(){
return {tradeId:this.tradeData.tradeId,tradeStatus:this.tradeStatus};
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="common">
<el-form label-width="100px">
<el-divider></el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="项目名称">{{transactionProjectInfo.transactionProjectName}}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="卖方部门">{{tradeData.applyDeptName}}</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="内容说明">{{transactionProjectInfo.context}}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="买方部门">{{tradeData.tradeDeptName}}</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="相关附件">
<span
style="padding-top: 10px;"
class="dbtn"
@click="checkFile(tradeData.attachmentUrl)"
v-if="tradeData.attachmentUrl != null && tradeData.attachmentUrl!=''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="经办人">{{tradeData.applyName}}</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-form-item label="细项名称">
<div>{{transactionProjectInfo.transactionItemName}}</div>
<el-row>
<el-col :span="5">
<el-row>
<el-col :span="6">数量</el-col>
<el-col :span="18">{{tradeData.tradeCount}}</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="6">单价</el-col>
<el-col :span="18">{{tradeData.tradePrice}}</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="6">总计</el-col>
<el-col :span="18">{{tradeData.tradeTotal}}</el-col>
</el-row>
</el-col>
</el-row>
</el-form-item>
<el-divider></el-divider>
</el-form>
</div>
</template>
<script>
import { getProject } from "@/api/transaction/project";
export default {
name: "common-info",
props:{
tradeData: {
type: Object
}
},
data(){
return{
transactionProjectInfo: {}
}
},
created(){
this.getTransactionProjecInfo();
},
methods:{
getTransactionProjecInfo(){
getProject(this.tradeData.relationTransactionProjectId).then(res =>{
if(res.code == 200){
this.transactionProjectInfo = res.data;
}
})
},
checkFile(url) {
window.open(url,'_blank');
},
}
}
</script>
<style>
.common{
.el-form-item {
margin-bottom: 0px;
}
.el-divider--horizontal {
margin: 5px 0;
}
}
</style>
<style scoped lang="scss">
/* 横线 */
.line{
float:right;
width: 100%;
height: 1px;
margin-top: -0.5em;
background:#d4c4c4;
position: relative;
text-align: center;
}
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
</style>
<template>
<div>
<CommonInfo :tradeData="tradeData"/>
<div style="margin: 11px 30px;color: #1890ff;">部门审核</div>
<el-row style="margin-left:95px">
<el-col :span="8" style="margin-top: 10px">
<el-checkbox v-model="checked">我已知晓</el-checkbox>
</el-col>
<el-col :span="8">
<span style="margin: 0px 5px;">审批人</span>
<el-input :value="$store.state.user.name" style="width: 130px" disabled/>
</el-col>
</el-row>
<el-divider></el-divider>
</div>
</template>
<script>
import CommonInfo from "./CommonInfo";
export default {
name: "confirm",
props:{
tradeData: {
type: Object
}
},
components:{
CommonInfo
},
data(){
return{
checked: false
}
},
methods:{
checkParam(){
if(!this.checked){
this.$message.error("请勾选须知!");
return true;
}
return false;
},
submitSuggestion(){
return {tradeId:this.tradeData.tradeId,tradeStatus:"2",tradeDeptManagerId:this.$store.state.user.userId};
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<CommonInfo :tradeData="tradeData"/>
<div style="margin: 11px 30px;color: #1890ff;">买方审核</div>
<el-row style="margin-left:95px">
<el-col :span="8">
<el-radio v-model="radio" label="1">
<span style="margin: 0px 5px;">议价</span>
<el-input v-model="price" placeholder="请输入价格" style="width: 130px" @blur="priceInput" :disabled="priceDisabled"/>
</el-radio>
</el-col>
<el-col :span="8">
<el-radio v-model="radio" label="2">
<span style="margin: 0px 5px;">评价</span>
<el-input v-model="socre"
placeholder="请输入评分"
style="width: 130px" @blur="socreInput"
oninput="if(!/^[0-9]+$/.test(value)) value=value.replace(/\D/g,'');if(value>100)value=100;if(value<0)value=null"
:disabled="socreDisabled"/>
</el-radio>
</el-col>
<el-col :span="8">
<span style="margin: 0px 5px">成交价</span>
<el-input v-model="dealPrice" disabled style="width: 130px"/>
</el-col>
</el-row>
<el-divider></el-divider>
</div>
</template>
<script>
import CommonInfo from "./CommonInfo";
export default {
name: "evaluate",
props:{
tradeData: {
type: Object
}
},
components:{
CommonInfo
},
data(){
return{
radio:"2",
priceDisabled: true,
socreDisabled: false,
socre: "",
price: "",
dealPrice: ""
}
},
watch:{
radio(newVal,oldVal){
this.price = "";
this.socre = "";
this.dealPrice = "";
if(newVal == '1'){
this.priceDisabled = false;
this.socreDisabled = true;
}
if(newVal == '2'){
this.priceDisabled = true;
this.socreDisabled = false;
}
}
},
methods:{
//议价
priceInput(){
this.dealPrice = this.price;
},
socreInput(){
this.dealPrice = this.tradeData.tradeTotal * this.socre / 100;
},
resetSuggestion(){
this.price = "";
this.socre = "";
this.dealPrice = "";
},
checkParam(){
if(!this.dealPrice){
this.$message.error("请检查评价信息!")
return true;
}
return false;
},
submitSuggestion(){
let param = {tradeId:this.tradeData.tradeId,tradeStatus:"1",dealPrice:this.dealPrice};
if(this.socre){
param.tradeScore = this.socre;
}
return param;
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<el-button type="text" @click="open=true" size="mini">{{getOperatorName()}}</el-button>
<el-dialog :title="getOperatorName()" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
<component :is="currentTabComponent" :tradeData="tradeData" ref="currentCom"></component>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button style="width: 150px;border-color: #1890ff;color: #1890ff;" @click="resetSuggestion">重置意见</el-button>
<el-button type="primary" style="width: 150px" @click="submitSuggestion">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getProject, updateProject } from "@/api/transaction/tradeProject.js";
import evaluate from "./Evaluate";
import confirm from "./Confirm";
import approval from "./Approval";
export default {
name: "operator-button",
components:{
evaluate,
confirm,
approval
},
props:{
operatorName: {
type: String
},
tradeInfo: {
type: Object
}
},
created(){
this.currentTabComponent = this.operatorName;
this.getTradeInfo();
},
data(){
return{
open: false,
currentTabComponent: "",
tradeData: {}
}
},
methods:{
getOperatorName(){
switch(this.operatorName){
case "evaluate":
return "经办人评价";
case "confirm":
return "买方部门长确认";
case "approval":
return "卖方部门长审核";
default:
return "";
}
},
getTradeInfo(){
getProject(this.tradeInfo.tradeId).then(res =>{
if(res.code == 200){
this.tradeData = res.data;
}
})
},
//重置意见
resetSuggestion(){
this.$refs.currentCom.resetSuggestion();
},
//提交
submitSuggestion(){
if(this.$refs.currentCom.checkParam()){
return;
}
let that = this;
updateProject(this.$refs.currentCom.submitSuggestion()).then(res =>{
if(res.code == 200){
this.open = false;
this.$emit("getList");
that.$message.success("提交成功!");
}else{
that.$message.error("提交失败!");
}
})
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<el-table v-loading="loading" :data="projectList">
<el-table-column label="交易项目" align="center" prop="relationTransactionProjectId" :formatter="transactionProjectName" :show-overflow-tooltip="true"/>
<el-table-column label="交易状态" align="center" prop="tradeStatus" :formatter="getTradeStatus" :show-overflow-tooltip="true"/>
<el-table-column label="申请人" align="center" prop="applyName" />
<el-table-column label="卖方" align="center" prop="applyDeptName" :show-overflow-tooltip="true"/>
<el-table-column label="申报总价" align="center" prop="tradeTotal" />
<el-table-column label="买方" align="center" prop="tradeDeptName" :show-overflow-tooltip="true"/>
<el-table-column label="交易评分" align="center" prop="tradeScore" />
<el-table-column label="交易成交价" align="center" prop="dealPrice" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.tradeStatus=='0' || scope.row.tradeStatus=='4'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:project:edit']"
>修改</el-button>
<el-button
v-if="scope.row.tradeStatus=='0' || scope.row.tradeStatus=='4'"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:project:remove']"
>删除</el-button>
<OperatorButton v-for="item in scope.row.operators"
:operatorName="item"
:tradeInfo="scope.row"
@getList="getList"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import OperatorButton from "./OperatorButton";
export default {
name: "table-list",
props:{
projectList:{
type: Array
},
queryParams:{
type: Object
},
total:{
type: Number
},
loading:{
type: Boolean
}
},
components:{
OperatorButton
},
methods:{
getList(){
this.$emit("getList");
},
//获取项目名称
transactionProjectName(row){
let project = this.$parent.$parent.transactionProjects.find(item => item.transactionProjectId == row.relationTransactionProjectId);
if(project){
return project.transactionProjectName;
}
return "-";
},
//获取交易状态
getTradeStatus(row){
return this.selectDictLabel(this.$parent.$parent.transactionProjectStatus, row.tradeStatus);
},
handleUpdate(row){
this.$parent.$parent.handleUpdate(row);
},
handleDelete(row){
this.$parent.$parent.handleDelete(row);
}
}
}
</script>
<style scoped>
</style>
...@@ -96,9 +96,9 @@ ...@@ -96,9 +96,9 @@
<div class="outer-div"> <div class="outer-div">
<header class="header"> <header class="header">
<ul class="tab-tilte"> <ul class="tab-tilte">
<li :class="{ active: tab == 0 }" @click="tab = 0">所有项目</li> <li :class="{ active: tab == 0 }" @click="changeTab(0)">所有项目</li>
<li :class="{ active: tab == 1 }" @click="tab = 1">我申请的</li> <li :class="{ active: tab == 1 }" @click="changeTab(1)">我申请的</li>
<li :class="{ active: tab == 2 }" @click="tab = 2">我审批的</li> <li :class="{ active: tab == 2 }" @click="changeTab(2)">我审批的</li>
</ul> </ul>
<el-button <el-button
@click="handleAdd" @click="handleAdd"
...@@ -111,83 +111,75 @@ ...@@ -111,83 +111,75 @@
<!-- 可以使用自定义组件 --> <!-- 可以使用自定义组件 -->
<!-- <component-one v-show="tab == 0"></component-one> <!-- <component-one v-show="tab == 0"></component-one>
<component-two v-show="tab == 1"></component-two> --> <component-two v-show="tab == 1"></component-two> -->
<div v-show="tab == 0"> <div v-if="tab == 0">
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange"> <TableList :queryParams="queryParams"
<el-table-column type="selection" width="55" align="center" /> :projectList="projectList"
<el-table-column label="交易项目" align="center" prop="relationTransactionProjectId" :formatter="transactionProjectName"/>
<el-table-column label="交易状态" align="center" prop="tradeStatus" :formatter="getTradeStatus" :show-overflow-tooltip="true"/>
<el-table-column label="申请人" align="center" prop="applyName" />
<el-table-column label="卖方" align="center" prop="applyDeptName" :show-overflow-tooltip="true"/>
<el-table-column label="申报总价" align="center" prop="tradeTotal" />
<el-table-column label="买方" align="center" prop="tradeDeptName" :show-overflow-tooltip="true"/>
<el-table-column label="交易评分" align="center" prop="tradeScore" />
<el-table-column label="交易成交价" align="center" prop="dealPrice" />
<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:project:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:project:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :loading="loading"
:limit.sync="queryParams.pageSize" @getList="getList"/>
@pagination="getList" </div>
/> <div v-if="tab == 1">
<TableList :queryParams="queryParams"
:projectList="projectList"
:total="total"
:loading="loading"
@getList="getList"/>
</div>
<div v-if="tab == 2">
<TableList :queryParams="queryParams"
:projectList="projectList"
:total="total"
:loading="loading"
@getList="getList"/>
</div> </div>
<div v-show="tab == 1">内容二</div>
<div v-show="tab == 2">内容三</div>
</div> </div>
</div> </div>
</el-card> </el-card>
<!-- 添加或修改交易项目对话框 --> <!-- 添加或修改交易项目对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row> <el-row>
<el-col :span="12">
<el-form-item label="买方" prop="tradeDeptId">
<treeselect v-model="form.tradeDeptId" :options="deptOptions" :show-count="true" placeholder="请选择部门"/>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="交易项目" prop="relationTransactionProjectId"> <el-form-item label="交易项目" prop="relationTransactionProjectId">
<el-select v-model="form.relationTransactionProjectId" placeholder="请选择交易项目" style="width: 100%" @change="changeTransactionProject"> <el-select v-model="form.relationTransactionProjectId" placeholder="请选择交易项目" style="width: 100%" @change="changeTransactionProject">
<el-option v-for="item in transactionProjects" <el-option v-for="item in transactionOptions"
:key="item.transactionProjectId" :key="item.transactionProjectId"
:label="item.transactionProjectName" :label="item.transactionProjectName"
:value="item.transactionProjectId"/> :value="item.transactionProjectId"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="买方" prop="tradeDeptId"> <el-form-item label="买方经办人" prop="tradeTransactor">
<treeselect v-model="form.tradeDeptId" :options="deptOptions" :show-count="true" placeholder="请选择部门" /> <el-select v-model="form.tradeTransactor" 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-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单价" prop="tradePrice"> <el-form-item label="单价" prop="tradePrice">
<el-input v-model="form.tradePrice" placeholder="请输入单价" :disabled="priceType == '1'" @blur="sumAmount"/> <el-input v-model="form.tradePrice" placeholder="请输入单价" :disabled="priceType == '1'" @blur="sumAmount"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="数量" prop="tradeCount"> <el-form-item label="数量" prop="tradeCount">
<el-input v-model="form.tradeCount" placeholder="请输入交易数量" @blur="sumAmount"/> <el-input v-model="form.tradeCount" placeholder="请输入交易数量" @blur="sumAmount"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="总价" prop="tradeTotal"> <el-form-item label="总价" prop="tradeTotal">
<el-input v-model="form.tradeTotal" placeholder="请输入交易总价" /> <el-input v-model="form.tradeTotal" placeholder="请输入交易总价" />
...@@ -214,18 +206,21 @@ ...@@ -214,18 +206,21 @@
</template> </template>
<script> <script>
import { listProject, getProject, delProject, addProject, updateProject, exportProject } from "@/api/transaction/tradeProject.js"; import { selectTTradeProjectListByRoles, listProject, getProject, delProject, addProject, updateProject, exportProject } from "@/api/transaction/tradeProject.js";
import { getTransactionProjectList } from "@/api/transaction/project.js"; import { getTransactionProjectList } from "@/api/transaction/project.js";
import { treeselect } from "@/api/system/dept"; import { treeselect } from "@/api/system/dept";
import { selectTransactorByDeptId } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import FileUpload from "@/components/FileUpload"; import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png"; import uploadfile from "@/assets/uploadfile.png";
import TableList from "./components/TableList";
export default { export default {
name: "Project", name: "Project",
components: { components: {
Treeselect, Treeselect,
FileUpload FileUpload,
TableList
}, },
data() { data() {
return { return {
...@@ -253,6 +248,7 @@ export default { ...@@ -253,6 +248,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
queryType: "all",
relationTransactionProjectId: null, relationTransactionProjectId: null,
applyDeptId: null, applyDeptId: null,
tradeType: null, tradeType: null,
...@@ -270,6 +266,9 @@ export default { ...@@ -270,6 +266,9 @@ export default {
tradeDeptId:[ tradeDeptId:[
{ required: true, message: "请选择买方部门", trigger: "change" } { required: true, message: "请选择买方部门", trigger: "change" }
], ],
tradeTransactor:[
{ required: true, message: "请选择买方经办人", trigger: "change" }
],
tradePrice:[ tradePrice:[
{ required: true, message: "单价不能为空", trigger: "blur" } { required: true, message: "单价不能为空", trigger: "blur" }
], ],
...@@ -285,23 +284,33 @@ export default { ...@@ -285,23 +284,33 @@ export default {
priceType: "", priceType: "",
fileList: [], fileList: [],
transactionProjectStatus: [], transactionProjectStatus: [],
tab:"0" tab:"0",
transactionOptions: [],
transactorList: []
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getTransactionProjects({deptId:this.$store.state.user.deptId}); this.getTransactionProjects();
this.getTreeselect(); this.getTreeselect();
this.getDicts("t_transaction_project_status").then(response => { this.getDicts("t_transaction_project_status").then(response => {
this.transactionProjectStatus = response.data; this.transactionProjectStatus = response.data;
console.log("haha",this.transactionProjectStatus)
}); });
}, },
watch:{
"form.tradeDeptId":{
handler(newValue, oldValue){
this.changeDept();
this.getTransactor();
},
deep:true
}
},
methods: { methods: {
/** 查询交易项目列表 */ /** 查询交易项目列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listProject(this.queryParams).then(response => { selectTTradeProjectListByRoles(this.queryParams).then(response => {
this.projectList = response.rows; this.projectList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -476,18 +485,34 @@ export default { ...@@ -476,18 +485,34 @@ export default {
this.fileList = []; this.fileList = [];
this.form.attachmentUrl = ""; this.form.attachmentUrl = "";
}, },
//获取项目名称 //切换tab
transactionProjectName(row){ changeTab(tabNum){
let project = this.transactionProjects.find(item => item.transactionProjectId == row.relationTransactionProjectId); this.queryParams.pageNum = 1;
if(project){ this.queryParams.pageSize = 10;
return project.transactionProjectName; this.tab = tabNum;
if(tabNum == 0){
this.queryParams.queryType = "all";
}
if(tabNum == 1){
this.queryParams.queryType = "myApply";
} }
return "-"; if(tabNum == 2){
this.queryParams.queryType = "myApproval";
}
this.getList();
}, },
//获取交易状态 changeDept(){
getTradeStatus(row){ this.transactionOptions = this.transactionProjects.filter(item => item.deptId == this.form.tradeDeptId);
return this.selectDictLabel(this.transactionProjectStatus, row.tradeStatus); this.relationTransactionProjectId = null;
}, },
getTransactor(){
this.form.tradeTransactor = null;
if(this.form.tradeDeptId && this.form.tradeDeptId != null){
selectTransactorByDeptId({deptId:this.form.tradeDeptId}).then(res => {
this.transactorList = res.data;
});
}
}
} }
}; };
</script> </script>
......
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