1
This commit is contained in:
parent
fdc3c03216
commit
8103fa9252
@ -7,12 +7,14 @@ import com.ruoyi.base.domain.BaseInquiry;
|
||||
import com.ruoyi.base.domain.BasePic;
|
||||
import com.ruoyi.base.domain.BaseSiteInfo;
|
||||
import com.ruoyi.base.service.IBaseInquiryService;
|
||||
import com.ruoyi.base.service.IBaseNationalService;
|
||||
import com.ruoyi.base.service.IBasePicService;
|
||||
import com.ruoyi.base.service.IBaseSiteInfoService;
|
||||
import com.ruoyi.busi.domain.BusiCategory;
|
||||
import com.ruoyi.busi.domain.BusiInquiryItem;
|
||||
import com.ruoyi.busi.domain.BusiProdNew;
|
||||
import com.ruoyi.busi.service.IBusiCategoryService;
|
||||
import com.ruoyi.busi.service.IBusiInquiryItemService;
|
||||
import com.ruoyi.busi.service.IBusiProdNewService;
|
||||
import com.ruoyi.busi.utils.CommonUtils;
|
||||
import com.ruoyi.busi.vo.BusiCategoryVO;
|
||||
@ -63,7 +65,9 @@ public class WebController extends BaseController {
|
||||
@Autowired
|
||||
private IBusiProdNewService prodNewService;
|
||||
@Autowired
|
||||
private CommonUtils commonUtils;
|
||||
private IBaseNationalService nationalService;
|
||||
@Autowired
|
||||
private IBusiInquiryItemService inquiryItemService;
|
||||
|
||||
/**
|
||||
* 导航栏接口--所有分类
|
||||
@ -331,9 +335,28 @@ public class WebController extends BaseController {
|
||||
@ApiImplicitParam(name = "tenantId", value = "公司名称", required = true, paramType = "body")
|
||||
})
|
||||
@PostMapping("/inquirySave")
|
||||
public R<BaseInquiry> inquirySave(@ApiIgnore @RequestBody BusiInquiryItem inquiryItem, HttpServletRequest request){
|
||||
String ip = CommonUtils.getIpAddr(request);
|
||||
System.out.println(CommonUtils.getAddr(ip));
|
||||
public R<String> inquirySave(@ApiIgnore @RequestBody BusiInquiryItem inquiryItem, HttpServletRequest request){
|
||||
String ip = "";
|
||||
String nationalStr = "";
|
||||
try {
|
||||
ip = CommonUtils.getIpAddr(request);
|
||||
nationalStr = CommonUtils.getAddr(ip);
|
||||
}catch (Exception e){
|
||||
logger.error("识别所属国家失败");
|
||||
}
|
||||
ip = StringUtils.isNotEmpty(ip)?ip:"未知";
|
||||
nationalStr = StringUtils.isNotEmpty(nationalStr)?nationalStr:"未知";
|
||||
String national = nationalStr.split("\\|")[0];
|
||||
System.out.println(ip+"-----"+nationalStr);
|
||||
String oceania = "未知";
|
||||
Map<String,String> nationalMap = nationalService.getNationalMap();
|
||||
if(nationalMap.containsKey(national)){
|
||||
oceania = nationalMap.get(national);
|
||||
}
|
||||
inquiryItem.setIp(ip);
|
||||
inquiryItem.setNational(national);
|
||||
inquiryItem.setOceania(oceania);
|
||||
inquiryItemService.save(inquiryItem);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
package com.ruoyi.base.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import com.ruoyi.common.core.domain.DlBaseEntity;
|
||||
|
||||
/**
|
||||
* 国家列对象 dl_base_national
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@TableName("dl_base_national")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseNational
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private Integer id;
|
||||
|
||||
/** 国家 */
|
||||
@Excel(name = "国家")
|
||||
private String national;
|
||||
|
||||
/** 洲 */
|
||||
@Excel(name = "洲")
|
||||
private String oceania;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.domain.BaseNational;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 国家列Mapper接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseNationalMapper extends BaseMapper<BaseNational>
|
||||
{
|
||||
IPage<BaseNational> queryListPage(@Param("entity") BaseNational entity, Page<BaseNational> page);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.ruoyi.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.base.domain.BaseNational;
|
||||
|
||||
/**
|
||||
* 国家列Service接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface IBaseNationalService extends IService<BaseNational>
|
||||
{
|
||||
IPage<BaseNational> queryListPage(BaseNational pageReqVO, Page<BaseNational> page);
|
||||
|
||||
/**
|
||||
* 返回所有国家列表map
|
||||
* @author vinjor-M
|
||||
* @date 11:36 2025/7/11
|
||||
* @return java.util.Map<java.lang.String,java.lang.String>
|
||||
**/
|
||||
Map<String,String> getNationalMap();
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ruoyi.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.base.mapper.BaseNationalMapper;
|
||||
import com.ruoyi.base.domain.BaseNational;
|
||||
import com.ruoyi.base.service.IBaseNationalService;
|
||||
|
||||
/**
|
||||
* 国家列Service业务层处理
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@Service
|
||||
public class BaseNationalServiceImpl extends ServiceImpl<BaseNationalMapper,BaseNational> implements IBaseNationalService
|
||||
{
|
||||
@Autowired
|
||||
private BaseNationalMapper baseNationalMapper;
|
||||
|
||||
@Override
|
||||
public IPage<BaseNational> queryListPage(BaseNational pageReqVO, Page<BaseNational> page) {
|
||||
return baseNationalMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回所有国家列表map
|
||||
*
|
||||
* @return java.util.Map<java.lang.String, java.lang.String>
|
||||
* @author vinjor-M
|
||||
* @date 11:36 2025/7/11
|
||||
**/
|
||||
@Override
|
||||
@Cacheable("national_map")
|
||||
public Map<String, String> getNationalMap() {
|
||||
return this.list().stream().collect(Collectors.toMap(BaseNational::getNational,BaseNational::getOceania));
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.vo.InquiryItemVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -44,9 +45,9 @@ public class BusiInquiryItemController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:inquiryItem:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BusiInquiryItem busiInquiryItem,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
public AjaxResult list(InquiryItemVO busiInquiryItem,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
Page<BusiInquiryItem> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BusiInquiryItem> list = busiInquiryItemService.queryListPage(busiInquiryItem,page);
|
||||
|
@ -41,6 +41,8 @@ public class StatisticsController extends BaseController
|
||||
Map<String, Map<String,Object>> rtnMap = new HashMap<>();
|
||||
//文章、产品数量
|
||||
rtnMap.put("prodNews",prodNewService.getIndexData(tenantId));
|
||||
//询盘流量
|
||||
rtnMap.put("ipInquiry",busiThirdItemService.inquiryMap(tenantId));
|
||||
return success(rtnMap);
|
||||
}
|
||||
|
||||
|
@ -19,4 +19,15 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
public interface BusiChatMainMapper extends BaseMapper<BusiChatMain>
|
||||
{
|
||||
IPage<ChatMainVO> queryListPage(@Param("entity") ChatMainVO entity, Page<BusiChatMain> page);
|
||||
|
||||
/**
|
||||
* 查询IP数量
|
||||
* @author vinjor-M
|
||||
* @date 16:29 2025/7/11
|
||||
* @param tenantId TODO
|
||||
* @param startDate TODO
|
||||
* @param endDate TODO
|
||||
* @return java.lang.Integer
|
||||
**/
|
||||
Integer selectIpCount(@Param("tenantId")String tenantId,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.domain.BusiInquiryItem;
|
||||
import com.ruoyi.busi.vo.InquiryItemVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -17,5 +18,16 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface BusiInquiryItemMapper extends BaseMapper<BusiInquiryItem>
|
||||
{
|
||||
IPage<BusiInquiryItem> queryListPage(@Param("entity") BusiInquiryItem entity, Page<BusiInquiryItem> page);
|
||||
IPage<BusiInquiryItem> queryListPage(@Param("entity") InquiryItemVO entity, Page<BusiInquiryItem> page);
|
||||
|
||||
/**
|
||||
* 查询IP数量
|
||||
* @author vinjor-M
|
||||
* @date 16:29 2025/7/11
|
||||
* @param tenantId TODO
|
||||
* @param startDate TODO
|
||||
* @param endDate TODO
|
||||
* @return java.lang.Integer
|
||||
**/
|
||||
Integer selectIpCount(@Param("tenantId")String tenantId,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
}
|
||||
|
@ -19,4 +19,14 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
public interface BusiThirdItemMapper extends BaseMapper<BusiThirdItem>
|
||||
{
|
||||
IPage<ThirdVO> queryListPage(@Param("entity") ThirdVO entity, Page<BusiThirdItem> page);
|
||||
/**
|
||||
* 查询IP数量
|
||||
* @author vinjor-M
|
||||
* @date 16:29 2025/7/11
|
||||
* @param tenantId TODO
|
||||
* @param startDate TODO
|
||||
* @param endDate TODO
|
||||
* @return java.lang.Integer
|
||||
**/
|
||||
Integer selectIpCount(@Param("tenantId")String tenantId,@Param("thirdSoft")String thirdSoft,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.busi.domain.BusiInquiryItem;
|
||||
import com.ruoyi.busi.vo.InquiryItemVO;
|
||||
|
||||
/**
|
||||
* 在线询盘记录Service接口
|
||||
@ -14,5 +15,5 @@ import com.ruoyi.busi.domain.BusiInquiryItem;
|
||||
*/
|
||||
public interface IBusiInquiryItemService extends IService<BusiInquiryItem>
|
||||
{
|
||||
IPage<BusiInquiryItem> queryListPage(BusiInquiryItem pageReqVO, Page<BusiInquiryItem> page);
|
||||
IPage<BusiInquiryItem> queryListPage(InquiryItemVO pageReqVO, Page<BusiInquiryItem> page);
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.busi.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -16,4 +18,13 @@ import com.ruoyi.busi.vo.ThirdVO;
|
||||
public interface IBusiThirdItemService extends IService<BusiThirdItem>
|
||||
{
|
||||
IPage<ThirdVO> queryListPage(ThirdVO pageReqVO, Page<BusiThirdItem> page);
|
||||
|
||||
/**
|
||||
* 首页询盘总流量
|
||||
* @author vinjor-M
|
||||
* @date 16:25 2025/7/11
|
||||
* @param tenantId TODO
|
||||
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
Map<String,Object> inquiryMap(String tenantId);
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.busi.vo.InquiryItemVO;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -24,7 +26,7 @@ public class BusiInquiryItemServiceImpl extends ServiceImpl<BusiInquiryItemMappe
|
||||
private BusiInquiryItemMapper busiInquiryItemMapper;
|
||||
|
||||
@Override
|
||||
public IPage<BusiInquiryItem> queryListPage(BusiInquiryItem pageReqVO, Page<BusiInquiryItem> page) {
|
||||
public IPage<BusiInquiryItem> queryListPage(InquiryItemVO pageReqVO, Page<BusiInquiryItem> page) {
|
||||
return busiInquiryItemMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,19 @@
|
||||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.busi.mapper.BusiChatMainMapper;
|
||||
import com.ruoyi.busi.mapper.BusiInquiryItemMapper;
|
||||
import com.ruoyi.busi.vo.ThirdVO;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.constant.StrConstants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -25,15 +32,92 @@ public class BusiThirdItemServiceImpl extends ServiceImpl<BusiThirdItemMapper,Bu
|
||||
{
|
||||
@Autowired
|
||||
private BusiThirdItemMapper busiThirdItemMapper;
|
||||
@Autowired
|
||||
private BusiInquiryItemMapper inquiryItemMapper;
|
||||
@Autowired
|
||||
private BusiChatMainMapper chatMainMapper;
|
||||
|
||||
@Override
|
||||
public IPage<ThirdVO> queryListPage(ThirdVO pageReqVO, Page<BusiThirdItem> page) {
|
||||
if(StringUtils.isNotEmpty(pageReqVO.getStartDate())){
|
||||
pageReqVO.setStartDate(pageReqVO.getStartDate()+" 00:00:00");
|
||||
pageReqVO.setStartDate(pageReqVO.getStartDate()+ StrConstants.START_DATE);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(pageReqVO.getEndDate())){
|
||||
pageReqVO.setEndDate(pageReqVO.getEndDate()+" 23:59:59");
|
||||
pageReqVO.setEndDate(pageReqVO.getEndDate()+StrConstants.END_DATE);
|
||||
}
|
||||
return busiThirdItemMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页询盘总流量
|
||||
*
|
||||
* @param tenantId TODO
|
||||
* @return java.util.Map<java.lang.String, java.lang.Object>
|
||||
* @author vinjor-M
|
||||
* @date 16:25 2025/7/11
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Object> inquiryMap(String tenantId) {
|
||||
Map<String, Object> rtnMap = new HashMap<>();
|
||||
/*1.所有日期*/
|
||||
//当前日期
|
||||
String nowDay = DateUtil.formatDate(new Date());
|
||||
String todayStart = nowDay+StrConstants.START_DATE;
|
||||
String todayEnd = nowDay+StrConstants.END_DATE;
|
||||
//昨日日期
|
||||
String yesterday = DateUtil.formatDate(DateUtil.offsetDay(new Date(),-1));
|
||||
String yesterdayStart = yesterday+StrConstants.START_DATE;
|
||||
String yesterdayEnd = yesterday+StrConstants.END_DATE;
|
||||
//近30日开始日期
|
||||
String monthStart = DateUtil.formatDate(DateUtil.offsetDay(new Date(),-30))+StrConstants.START_DATE;
|
||||
String monthEnd = nowDay+StrConstants.END_DATE;
|
||||
|
||||
/*2.1 三方IP数据*/
|
||||
//三方的IP总数
|
||||
Integer thirdNum = busiThirdItemMapper.selectIpCount(tenantId,null,null,null);
|
||||
//今日三方IP总数
|
||||
Integer thirdNumToday = busiThirdItemMapper.selectIpCount(tenantId,null,todayStart,todayEnd);
|
||||
//昨日三方IP总数
|
||||
Integer thirdNumYesterday = busiThirdItemMapper.selectIpCount(tenantId,null,yesterdayStart,yesterdayEnd);
|
||||
//近30日三方IP总数
|
||||
Integer thirdNumMonth = busiThirdItemMapper.selectIpCount(tenantId,null,monthStart,monthEnd);
|
||||
/*2.2 在线询盘IP数据*/
|
||||
//在线询盘的IP总数
|
||||
Integer formNum = inquiryItemMapper.selectIpCount(tenantId,null,null);
|
||||
//今日在线询盘的IP总数
|
||||
Integer formNumToday = inquiryItemMapper.selectIpCount(tenantId,todayStart,todayEnd);
|
||||
//昨日在线询盘IP总数
|
||||
Integer formNumYesterday = inquiryItemMapper.selectIpCount(tenantId,yesterdayStart,yesterdayEnd);
|
||||
//近30日在线询盘IP总数
|
||||
Integer formNumMonth = inquiryItemMapper.selectIpCount(tenantId,monthStart,monthEnd);
|
||||
/*2.3 在线聊天IP数据*/
|
||||
//在线询盘的IP总数
|
||||
Integer chatNum = chatMainMapper.selectIpCount(tenantId,null,null);
|
||||
//今日在线询盘的IP总数
|
||||
Integer chatNumToday = chatMainMapper.selectIpCount(tenantId,todayStart,todayEnd);
|
||||
//昨日在线询盘IP总数
|
||||
Integer chatNumYesterday = chatMainMapper.selectIpCount(tenantId,yesterdayStart,yesterdayEnd);
|
||||
//近30日在线询盘IP总数
|
||||
Integer chatNumMonth = chatMainMapper.selectIpCount(tenantId,monthStart,monthEnd);
|
||||
//组装IP数量
|
||||
rtnMap.put("ipNum",thirdNum+formNum+chatNum);
|
||||
rtnMap.put("ipNumToday",thirdNumToday+formNumToday+chatNumToday);
|
||||
rtnMap.put("ipNumYesterday",thirdNumYesterday+formNumYesterday+chatNumYesterday);
|
||||
rtnMap.put("ipNumMonth",thirdNumMonth+formNumMonth+chatNumMonth);
|
||||
|
||||
/*3.1 Teams 记录数*/
|
||||
Integer teamsNum = busiThirdItemMapper.selectIpCount(tenantId,"Teams",null,null);
|
||||
/*3.2 WhatsApp 记录数*/
|
||||
Integer whatsAppNum = busiThirdItemMapper.selectIpCount(tenantId,"WhatsApp",null,null);
|
||||
/*3.2 Email 记录数*/
|
||||
Integer emailNum = busiThirdItemMapper.selectIpCount(tenantId,"Email",null,null);
|
||||
//组装询盘数量
|
||||
rtnMap.put("formNum",formNum);
|
||||
rtnMap.put("chatNum",chatNum);
|
||||
rtnMap.put("teamsNum",teamsNum);
|
||||
rtnMap.put("whatsAppNum",whatsAppNum);
|
||||
rtnMap.put("emailNum",emailNum);
|
||||
rtnMap.put("inquiryNum",formNum+chatNum+teamsNum+whatsAppNum+emailNum);
|
||||
return rtnMap;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.busi.vo;
|
||||
|
||||
import com.ruoyi.busi.domain.BusiInquiryItem;
|
||||
import com.ruoyi.busi.domain.BusiThirdItem;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class InquiryItemVO extends BusiInquiryItem {
|
||||
/** 时间范围-开始 */
|
||||
private String startDate;
|
||||
/** 时间范围-结束 */
|
||||
private String endDate;
|
||||
}
|
@ -6,6 +6,12 @@ package com.ruoyi.constant;
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class StrConstants {
|
||||
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
public static final String START_DATE =" 00:00:00";
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
public static final String END_DATE =" 23:59:59";
|
||||
}
|
||||
|
@ -60,4 +60,19 @@
|
||||
</where>
|
||||
order BY dbcm.create_time DESC,dbcm.update_time DESC
|
||||
</select>
|
||||
<select id="selectIpCount" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT( id )
|
||||
FROM
|
||||
dl_busi_chat_main
|
||||
WHERE
|
||||
del_flag = 0
|
||||
AND tenant_id = #{tenantId}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and (create_time >= #{startDate} OR update_time >= #{startDate})
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and (create_time <= #{endDate} OR update_time >= #{endDate})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select id, company_name, name, tel, title, content, email, ip, national, oceania, page_url, tenant_id, creator, create_time, updater, update_time, del_flag from dl_busi_inquiry_item
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BusiInquiryItem" resultMap="BusiInquiryItemResult">
|
||||
<select id="queryListPage" parameterType="com.ruoyi.busi.vo.InquiryItemVO" resultMap="BusiInquiryItemResult">
|
||||
<include refid="selectBusiInquiryItemVo"/>
|
||||
<where>
|
||||
<if test="entity.companyName != null and entity.companyName != ''"> and company_name like concat('%', #{entity.companyName}, '%')</if>
|
||||
@ -42,6 +42,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="entity.oceania != null and entity.oceania != ''"> and oceania = #{entity.oceania}</if>
|
||||
<if test="entity.pageUrl != null and entity.pageUrl != ''"> and page_url = #{entity.pageUrl}</if>
|
||||
<if test="entity.tenantId != null and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
|
||||
<if test="entity.startDate != null and entity.startDate != ''">and create_time >= #{entity.startDate}</if>
|
||||
<if test="entity.endDate != null and entity.endDate != ''">and create_time <= #{entity.endDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectIpCount" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT( id )
|
||||
FROM
|
||||
dl_busi_inquiry_item
|
||||
WHERE
|
||||
del_flag = 0
|
||||
AND tenant_id = #{tenantId}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and create_time <= #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -31,7 +31,7 @@
|
||||
from dl_busi_third_item
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BusiThirdItem" resultMap="BusiThirdItemResult">
|
||||
<select id="queryListPage" parameterType="com.ruoyi.busi.vo.ThirdVO" resultMap="BusiThirdItemResult">
|
||||
select dbti.*,dbpn.title AS prod_name
|
||||
from dl_busi_third_item dbti
|
||||
left join dl_busi_prod_new dbpn on dbti.prod_id = dbpn.id
|
||||
@ -50,4 +50,22 @@
|
||||
</where>
|
||||
order by dbti.create_time DESC
|
||||
</select>
|
||||
<select id="selectIpCount" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT( id )
|
||||
FROM
|
||||
dl_busi_third_item
|
||||
WHERE
|
||||
del_flag = 0
|
||||
AND tenant_id = #{tenantId}
|
||||
<if test="thirdSoft != null and thirdSoft != ''">
|
||||
and third_soft = #{thirdSoft}
|
||||
</if>
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and create_time <= #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -42,3 +42,12 @@ export function delInquiryItem(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询在线询盘记录详细
|
||||
export function getInquirySet(query) {
|
||||
return request({
|
||||
url: '/web/inquirySet',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -1,382 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="公司名称" prop="companyName">
|
||||
<el-input
|
||||
v-model="queryParams.companyName"
|
||||
placeholder="请输入公司名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="tel">
|
||||
<el-input
|
||||
v-model="queryParams.tel"
|
||||
placeholder="请输入电话"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子邮件" prop="email">
|
||||
<el-input
|
||||
v-model="queryParams.email"
|
||||
placeholder="请输入电子邮件"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源IP" prop="ip">
|
||||
<el-input
|
||||
v-model="queryParams.ip"
|
||||
placeholder="请输入来源IP"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源国家" prop="national">
|
||||
<el-input
|
||||
v-model="queryParams.national"
|
||||
placeholder="请输入来源国家"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="洲" prop="oceania">
|
||||
<el-input
|
||||
v-model="queryParams.oceania"
|
||||
placeholder="请输入洲"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页面路径" prop="pageUrl">
|
||||
<el-input
|
||||
v-model="queryParams.pageUrl"
|
||||
placeholder="请输入页面路径"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="站点唯一编码" prop="tenantId">
|
||||
<el-input
|
||||
v-model="queryParams.tenantId"
|
||||
placeholder="请输入站点唯一编码"
|
||||
clearable
|
||||
@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"
|
||||
v-hasPermi="['busi:inquiryItem:add']"
|
||||
>新增</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="['busi:inquiryItem: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="['busi:inquiryItem:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['busi:inquiryItem:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="inquiryItemList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="公司名称" align="center" prop="companyName" />
|
||||
<el-table-column label="姓名" align="center" prop="name" />
|
||||
<el-table-column label="电话" align="center" prop="tel" />
|
||||
<el-table-column label="标题" align="center" prop="title" />
|
||||
<el-table-column label="内容" align="center" prop="content" />
|
||||
<el-table-column label="电子邮件" align="center" prop="email" />
|
||||
<el-table-column label="来源IP" align="center" prop="ip" />
|
||||
<el-table-column label="来源国家" align="center" prop="national" />
|
||||
<el-table-column label="洲" align="center" prop="oceania" />
|
||||
<el-table-column label="页面路径" align="center" prop="pageUrl" />
|
||||
<el-table-column label="站点唯一编码" align="center" prop="tenantId" />
|
||||
<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="['busi:inquiryItem:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['busi:inquiryItem:remove']"
|
||||
>删除</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="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="公司名称" prop="companyName">
|
||||
<el-input v-model="form.companyName" placeholder="请输入公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="tel">
|
||||
<el-input v-model="form.tel" placeholder="请输入电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input v-model="form.content" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电子邮件" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入电子邮件" />
|
||||
</el-form-item>
|
||||
<el-form-item label="来源IP" prop="ip">
|
||||
<el-input v-model="form.ip" placeholder="请输入来源IP" />
|
||||
</el-form-item>
|
||||
<el-form-item label="来源国家" prop="national">
|
||||
<el-input v-model="form.national" placeholder="请输入来源国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洲" prop="oceania">
|
||||
<el-input v-model="form.oceania" placeholder="请输入洲" />
|
||||
</el-form-item>
|
||||
<el-form-item label="页面路径" prop="pageUrl">
|
||||
<el-input v-model="form.pageUrl" placeholder="请输入页面路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="站点唯一编码" prop="tenantId">
|
||||
<el-input v-model="form.tenantId" placeholder="请输入站点唯一编码" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInquiryItem, getInquiryItem, delInquiryItem, addInquiryItem, updateInquiryItem } from "@/api/busi/inquiryItem";
|
||||
|
||||
export default {
|
||||
name: "InquiryItem",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 在线询盘记录表格数据
|
||||
inquiryItemList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
companyName: null,
|
||||
name: null,
|
||||
tel: null,
|
||||
title: null,
|
||||
content: null,
|
||||
email: null,
|
||||
ip: null,
|
||||
national: null,
|
||||
oceania: null,
|
||||
pageUrl: null,
|
||||
tenantId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询在线询盘记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listInquiryItem(this.queryParams).then(response => {
|
||||
this.inquiryItemList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
companyName: null,
|
||||
name: null,
|
||||
tel: null,
|
||||
title: null,
|
||||
content: null,
|
||||
email: null,
|
||||
ip: null,
|
||||
national: null,
|
||||
oceania: null,
|
||||
pageUrl: null,
|
||||
tenantId: null,
|
||||
creator: null,
|
||||
createTime: null,
|
||||
updater: null,
|
||||
updateTime: null,
|
||||
delFlag: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加在线询盘记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInquiryItem(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改在线询盘记录";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInquiryItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInquiryItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除在线询盘记录编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delInquiryItem(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('busi/inquiryItem/export', {
|
||||
...this.queryParams
|
||||
}, `inquiryItem_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
293
dl_vue/src/views/statistics/inquiryItem/index.vue
Normal file
293
dl_vue/src/views/statistics/inquiryItem/index.vue
Normal file
@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源国家" prop="national">
|
||||
<el-input
|
||||
v-model="queryParams.national"
|
||||
placeholder="请输入来源国家"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="洲" prop="oceania">
|
||||
<el-input
|
||||
v-model="queryParams.oceania"
|
||||
placeholder="请输入洲"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间范围" prop="dataRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.dataRange"
|
||||
type="daterange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:picker-options="pickerOptions"
|
||||
>
|
||||
</el-date-picker>
|
||||
</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="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['busi:inquiryItem:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="inquiryItemList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column v-if="columnSet.company" label="公司名称" align="center" prop="companyName" />
|
||||
<el-table-column v-if="columnSet.name" label="姓名" align="center" prop="name" />
|
||||
<el-table-column v-if="columnSet.tel" label="电话" align="center" prop="tel" />
|
||||
<el-table-column v-if="columnSet.title" label="标题" align="center" prop="title" />
|
||||
<el-table-column v-if="columnSet.email" label="电子邮件" align="center" prop="email" />
|
||||
<el-table-column label="内容" align="center" prop="content" />
|
||||
<el-table-column label="IP" align="center" prop="ip" />
|
||||
<el-table-column label="来源国家" align="center" prop="national" />
|
||||
<el-table-column label="洲" align="center" prop="oceania" />
|
||||
<el-table-column label="提交时间" align="center" prop="createTime"/>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInquiryItem, getInquiryItem, delInquiryItem, addInquiryItem, updateInquiryItem,getInquirySet } from "@/api/busi/inquiryItem";
|
||||
|
||||
export default {
|
||||
name: "InquiryItem",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 在线询盘记录表格数据
|
||||
inquiryItemList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dataRange: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
companyName: null,
|
||||
name: null,
|
||||
tel: null,
|
||||
title: null,
|
||||
content: null,
|
||||
email: null,
|
||||
ip: null,
|
||||
national: null,
|
||||
oceania: null,
|
||||
pageUrl: null,
|
||||
tenantId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
},
|
||||
columnSet:{
|
||||
company:false,
|
||||
email:false,
|
||||
name:false,
|
||||
tel:false,
|
||||
title:false,
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询在线询盘记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
//先查动态表头
|
||||
getInquirySet({}).then(rep=>{
|
||||
this.columnSet = rep.data
|
||||
listInquiryItem(this.queryParams).then(response => {
|
||||
this.inquiryItemList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
})
|
||||
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
companyName: null,
|
||||
name: null,
|
||||
tel: null,
|
||||
title: null,
|
||||
content: null,
|
||||
email: null,
|
||||
ip: null,
|
||||
national: null,
|
||||
oceania: null,
|
||||
pageUrl: null,
|
||||
tenantId: null,
|
||||
creator: null,
|
||||
createTime: null,
|
||||
updater: null,
|
||||
updateTime: null,
|
||||
delFlag: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
if (this.queryParams.dataRange && this.queryParams.dataRange.length > 1) {
|
||||
this.queryParams.startDate = this.formatDate(this.queryParams.dataRange[0])
|
||||
this.queryParams.endDate = this.formatDate(this.queryParams.dataRange[1])
|
||||
}else{
|
||||
this.queryParams.startDate = null
|
||||
this.queryParams.endDate = null
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加在线询盘记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInquiryItem(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改在线询盘记录";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInquiryItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInquiryItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除在线询盘记录编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delInquiryItem(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('busi/inquiryItem/export', {
|
||||
...this.queryParams
|
||||
}, `inquiryItem_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -194,63 +194,6 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改三方程序跳转记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="产品id" prop="prodId">
|
||||
<el-input v-model="form.prodId" placeholder="请输入产品id"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="三方程序类型" prop="thirdSoft">
|
||||
<el-select v-model="form.thirdSoft" placeholder="请选择三方程序类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.third_soft"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源国家" prop="national">
|
||||
<el-input v-model="form.national" placeholder="请输入来源国家"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属email/电话/teams账户" prop="thirdAccount">
|
||||
<el-input v-model="form.thirdAccount" placeholder="请输入所属email/电话/teams账户"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="浏览记录" prop="viewType">
|
||||
<el-select v-model="form.viewType" placeholder="请选择浏览记录">
|
||||
<el-option
|
||||
v-for="dict in dict.type.view_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="页面路径" prop="pageUrl">
|
||||
<el-input v-model="form.pageUrl" placeholder="请输入页面路径"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="equipment">
|
||||
<el-select v-model="form.equipment" placeholder="请选择设备类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.equipment_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源IP" prop="ip">
|
||||
<el-input v-model="form.ip" placeholder="请输入来源IP"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="站点唯一编码" prop="tenantId">
|
||||
<el-input v-model="form.tenantId" placeholder="请输入站点唯一编码"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -372,15 +315,15 @@ export default {
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
console.log(this.queryParams.dataRange,"12")
|
||||
console.log(this.queryParams.dataRange, '12')
|
||||
if (this.queryParams.dataRange && this.queryParams.dataRange.length > 1) {
|
||||
this.queryParams.startDate = this.formatDate(this.queryParams.dataRange[0])
|
||||
this.queryParams.endDate = this.formatDate(this.queryParams.dataRange[1])
|
||||
}else{
|
||||
this.getList()
|
||||
} else {
|
||||
this.queryParams.startDate = null
|
||||
this.queryParams.endDate = null
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 格式化时间戳
|
||||
|
Loading…
Reference in New Issue
Block a user