3 files added
6 files modified
| | |
| | | |
| | | |
| | | /** |
| | | * 美疗师id |
| | | * 美疗师id 把这个字段视为正式的业绩归属人 |
| | | */ |
| | | private Long beaultId; |
| | | |
| | |
| | | package com.matrix.system.hive.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.app.vo.OrderDetailAchieveItemVo; |
| | | import com.matrix.system.app.vo.RankingVo; |
| | | import com.matrix.system.app.vo.UserAchieveVo; |
| | | import com.matrix.system.hive.bean.AchieveNew; |
| | | import com.matrix.system.hive.dto.AchieveNewStatisticsDto; |
| | | import com.matrix.system.hive.vo.AchieveNewStatisticsVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | |
| | | */ |
| | | |
| | | |
| | | public interface AchieveNewDao{ |
| | | public interface AchieveNewDao extends BaseMapper<AchieveNew> { |
| | | |
| | | public int insert(@Param("item") AchieveNew achieveNew); |
| | | |
| | |
| | | |
| | | int updateAchieveNumOfPeople(@Param("list") List<AchieveNew> list, @Param("num") Double num); |
| | | |
| | | IPage<AchieveNewStatisticsVo> achieveNewStatistics(Page<AchieveNewStatisticsVo> page, @Param("record")AchieveNewStatisticsDto queryDto); |
| | | } |
New file |
| | |
| | | package com.matrix.system.hive.dto; |
| | | |
| | | import com.google.common.base.CaseFormat; |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AchieveNewStatisticsDto extends BasePageQueryDto { |
| | | |
| | | //规则名称 |
| | | String achieveRuleId; |
| | | |
| | | |
| | | //业绩归属人id |
| | | String staffName; |
| | | |
| | | |
| | | //门店名称 |
| | | Long shopId; |
| | | |
| | | //公司id |
| | | Long companyId; |
| | | |
| | | //订单类型 |
| | | String orderType; |
| | | |
| | | @Override |
| | | public void setSort(String sort) { |
| | | if(StringUtils.isNotBlank(sort)){ |
| | | if ("ruleName".equals(sort)) { |
| | | super.setSort("u.name"); |
| | | } else { |
| | | super.setSort(CaseFormat.LOWER_CAMEL.to |
| | | (CaseFormat.LOWER_UNDERSCORE, sort)); |
| | | } |
| | | }else{ |
| | | super.setSort(sort); |
| | | } |
| | | } |
| | | } |
| | |
| | | for (AchieveNew achieveNew : orderItem.getAchieveList()) { |
| | | if (achieveNew !=null && achieveNew.getGoodsCash()!=null) { |
| | | buildAchieve(pageOrder, orderItem, achieveNew); |
| | | // 新增美疗师业绩 |
| | | achieveNewList.add(achieveNew); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | achieveNew.setVipId(pageOrder.getVipId()); |
| | | achieveNew.setSaleId(pageOrder.getStaffId()); |
| | | if(achieveNew.getSaleId()==null){ |
| | | achieveNew.setSaleId(pageOrder.getStaffId()); |
| | | } |
| | | |
| | | |
| | | if (pageOrder.getPayTime() != null) { |
| | | achieveNew.setDatatime(pageOrder.getPayTime()); |
| | |
| | | if (!Dictionary.ORDER_STATU_DFK.equals(pageOrder.getStatu())) { |
| | | throw new GlobleException("该订单已经收过款,请刷新页面再试!"); |
| | | } |
| | | |
| | | //交易业绩设置是否合理 |
| | | |
| | | checkAchieveIsOk(pageOrder); |
| | | |
| | | |
| | | // 更新收款时间 |
| | | pageOrder.setPayTime(new Date()); |
| | | pageOrder.setStatu(Dictionary.ORDER_STATU_YFK); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 交易业绩设置是否合理 |
| | | * @param pageOrder |
| | | */ |
| | | private void checkAchieveIsOk(SysOrder pageOrder) { |
| | | double huakouSum = pageOrder.getItems().stream() |
| | | .mapToDouble( |
| | | item -> |
| | | item.getAchieveList().stream() |
| | | .filter(achieveNew -> "划扣".equals(achieveNew.getPayMethod())) |
| | | .mapToDouble(achieve -> achieve.getGoodsCash()).sum() |
| | | ).sum(); |
| | | |
| | | double czkPay= pageOrder.getFlows().stream() |
| | | .filter(sysOrderFlow -> "储值卡".equals(sysOrderFlow.getPayMethod())) |
| | | .mapToDouble(sysOrderFlow ->sysOrderFlow.getAmount().doubleValue()).sum(); |
| | | |
| | | if(czkPay!=huakouSum){ |
| | | throw new GlobleException("划扣业绩不等于储值卡扣款金额,请修改业绩设置!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置会员消费积分 |
| | | * @param pageOrder |
| | | */ |
| | |
| | | package com.matrix.system.hive.statistics; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.AchieveNew; |
| | | import com.matrix.system.hive.dao.AchieveNewDao; |
| | | import com.matrix.system.hive.dto.AchieveNewStatisticsDto; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.service.AchieveNewService; |
| | | import com.matrix.system.hive.service.SysOrderItemService; |
| | | import com.matrix.system.hive.service.SysOrderService; |
| | | import com.matrix.system.hive.vo.AchieveNewStatisticsVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | @Autowired |
| | | private AchieveNewDao achieveNewDao; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 员工业绩统计 |
| | | */ |
| | | @PostMapping(value = "/achieveNewStatistics") |
| | | public @ResponseBody |
| | | AjaxResult achieveNewStatistics(@RequestBody AchieveNewStatisticsDto queryDto){ |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ |
| | | queryDto.setShopId(sysUsers.getShopId()); |
| | | } |
| | | queryDto.setCompanyId(sysUsers.getCompanyId()); |
| | | |
| | | Page<AchieveNewStatisticsVo> page = new Page(queryDto.getPageNum(), queryDto.getPageSize()); |
| | | IPage<AchieveNewStatisticsVo> rows = achieveNewDao.achieveNewStatistics(page,queryDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 门店每日单据明细表 |
| | | */ |
| | |
| | | return result; |
| | | } |
| | | |
| | | @RequestMapping(value = "/exportAchieveNewStatisticsExcel") |
| | | public void exportAchieveNewStatisticsExcel(ModelMap model, HttpServletRequest request, HttpServletResponse response, AchieveNewStatisticsDto queryDto) throws IOException { |
| | | //这里是从数据库里查数据并组装成我们想要的数据结构的过程 |
| | | List<ExcelSheetPO> res = new ArrayList<>(); |
| | | ExcelSheetPO orderSheet = new ExcelSheetPO(); |
| | | String title = "员工业绩统计"; |
| | | orderSheet.setSheetName(title); |
| | | orderSheet.setTitle(title); |
| | | String[] header = {"规则名称", "门店名称", "业绩归属人", "业绩创建人", "订单金额", "现金", "划扣", "本金消耗", "赠送消耗" |
| | | , "服务提成", "人头", "项目个数", "服务时间", "订单类型"}; |
| | | orderSheet.setHeaders(header); |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ |
| | | queryDto.setShopId(sysUsers.getShopId()); |
| | | } |
| | | queryDto.setCompanyId(sysUsers.getCompanyId()); |
| | | Page<AchieveNewStatisticsVo> page = new Page(1, Long.MAX_VALUE); |
| | | IPage<AchieveNewStatisticsVo> rows = achieveNewDao.achieveNewStatistics(page,queryDto); |
| | | List<AchieveNewStatisticsVo> dataList = rows.getRecords(); |
| | | List<List<Object>> list = new ArrayList<>(); |
| | | if (dataList.size() > 0) { |
| | | for (AchieveNewStatisticsVo item : dataList) { |
| | | List<Object> temp = new ArrayList<>(); |
| | | temp.add(item.getRuleName()); |
| | | temp.add(item.getShopName()); |
| | | temp.add(item.getGuwen()); |
| | | temp.add(item.getCreateBy()); |
| | | temp.add(item.getZkTotal()); |
| | | temp.add(item.getGoodsCash()); |
| | | temp.add(item.getCardCash()); |
| | | temp.add(item.getHisConsume()); |
| | | temp.add(item.getFreeConsume()); |
| | | temp.add(item.getProjPercentage()); |
| | | temp.add(item.getNumberOfPeople()); |
| | | temp.add(item.getProjNum()); |
| | | temp.add(item.getProjTime()); |
| | | temp.add(item.getOrderType()); |
| | | list.add(temp); |
| | | } |
| | | } |
| | | orderSheet.setDataList(list); |
| | | res.add(orderSheet); |
| | | response = ResponseHeadUtil.setExcelHead(response); |
| | | response.setHeader("Content-Disposition", |
| | | "attachment;filename=" + java.net.URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8")); |
| | | OutputStream os = response.getOutputStream(); |
| | | com.matrix.core.tools.excl.ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); |
| | | } |
| | | |
| | | @RequestMapping(value = "/exportDailyInfoNew") |
| | | public void exportDailyInfoNew(ModelMap model, HttpServletRequest request, HttpServletResponse response, AchieveNew achieveNew) throws IOException { |
| | | //这里是从数据库里查数据并组装成我们想要的数据结构的过程 |
New file |
| | |
| | | package com.matrix.system.hive.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class AchieveNewStatisticsVo { |
| | | //规则名称 |
| | | String ruleName; |
| | | //业绩归属人 |
| | | String guwen; |
| | | //业绩归属人id |
| | | Long gwid; |
| | | //订单创建人 |
| | | String createBy; |
| | | //创建人id |
| | | Long createId; |
| | | //订单金额 |
| | | BigDecimal zkTotal; |
| | | //消耗金额 |
| | | BigDecimal hisConsume; |
| | | //赠送消耗 |
| | | BigDecimal freeConsume; |
| | | //项目提成 |
| | | BigDecimal projPercentage; |
| | | // 人头数 |
| | | Double numberOfPeople; |
| | | //项目数 |
| | | Double projNum; |
| | | //项目时长 |
| | | Integer projTime; |
| | | //现金支付 |
| | | BigDecimal goodsCash; |
| | | //卡项支付 |
| | | BigDecimal cardCash; |
| | | //门店名称 |
| | | String shopName; |
| | | //订单类型 |
| | | String orderType; |
| | | |
| | | } |
| | |
| | | and date_format(datatime, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d') |
| | | </select> |
| | | |
| | | <select id="achieveNewStatistics" resultType="com.matrix.system.hive.vo.AchieveNewStatisticsVo"> |
| | | |
| | | select |
| | | u.name ruleName, |
| | | f.su_name guwen, |
| | | f.su_id gwid, |
| | | g.su_name createBy, |
| | | g.su_id createId, |
| | | cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total, |
| | | cast(SUM(a.his_consume) AS decimal(15,2)) his_consume, |
| | | cast(SUM(a.free_consume) AS decimal(15,2)) free_consume, |
| | | cast(SUM(a.proj_percentage) AS decimal(15,2)) proj_percentage, |
| | | cast(SUM(a.number_of_people) AS decimal(15,2)) number_of_people, |
| | | cast(SUM(a.proj_num) AS decimal(15,2)) proj_num, |
| | | cast(SUM(case when a.pay_method = '划扣' then goods_cash end )AS decimal(15,2)) card_cash, |
| | | cast(SUM(a.proj_time) AS decimal(15,2)) proj_time, |
| | | cast(SUM(case when a.pay_method = '现金' then goods_cash end )AS decimal(15,2)) goods_cash, |
| | | h.shop_short_name shop_name, |
| | | a.order_type |
| | | from |
| | | achieve_new a |
| | | left join sys_order b on a.order_id=b.id |
| | | left join sys_vip_info c on a.vip_id=c.id |
| | | left join sys_vip_level d on c.LEVEL_ID=d.id |
| | | left join shopping_goods e on a.shopping_goods_id=e.id |
| | | LEFT JOIN sys_users f on a.beault_id=f.su_id |
| | | LEFT JOIN sys_users g on a.sale_id = g.su_id |
| | | LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID |
| | | LEFT JOIN shopping_goods_category i ON e.cate_id = i.id |
| | | left join sys_proj_services l on a.service_order_id=l.id |
| | | left join sys_order_item j on a.order_item_id=j.ID |
| | | left join achieve_rule u on u.id=e.achieve_rule_id |
| | | <where> |
| | | and a.company_id = #{record.companyId} |
| | | <if test="record.shopId != null"> |
| | | and a.shop_id = #{record.shopId} |
| | | </if> |
| | | <if test="record.achieveRuleId != null"> |
| | | and u.id = #{record.achieveRuleId} |
| | | </if> |
| | | |
| | | <if test="record.staffName != null and record.staffName!=''"> |
| | | <!-- 创建人和归属人都有业绩 --> |
| | | and (f.su_name like concat('%',#{record.staffName},'%') or g.su_name like concat('%',#{record.staffName},'%') ) |
| | | </if> |
| | | |
| | | <if test="record.orderType != null and record.orderType != '' "> |
| | | and a.order_type= #{record.orderType} |
| | | </if> |
| | | <if test="record.beginTime != null "> |
| | | and a.datatime >= #{record.beginTime} |
| | | </if> |
| | | <if test="record.endTime != null "> |
| | | <![CDATA[and a.datatime <= #{record.endTime}]]> |
| | | </if> |
| | | |
| | | </where> |
| | | GROUP BY g.su_id , f.su_id, a.order_type, h.id,a.achieveType |
| | | <if test="record.sort !=null and record.sort!=''"> order by ${record.sort} ${record.order}</if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <update id="updateAchieveNumOfPeople"> |
| | | <foreach collection="list" item="item" index="index" |
New file |
| | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp"/> |
| | | <LINK rel="Bookmark" href="../images/favicon.ico"> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> |
| | | <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | <title></title> |
| | | <style> |
| | | .panel-body{ |
| | | overflow: hidden; |
| | | } |
| | | .buttonPanel{ |
| | | background: #ffffff; |
| | | padding: 10px 10px ; |
| | | margin: 0px 0px 10px 0px; |
| | | } |
| | | .rowPanel{ |
| | | background: #ffffff; |
| | | padding: 0px 10px ; |
| | | padding-top: 10px; |
| | | margin: 0px 0px 10px 0px; |
| | | } |
| | | .paginationStyle{ |
| | | background: #ffffff; |
| | | padding: 10px 10px; |
| | | margin: 0px 0px 10px 0px; |
| | | text-align: right; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div class="panel-body" id="app"> |
| | | |
| | | <el-row class="buttonPanel"> |
| | | <el-button @click="exportExcel" type="primary" >导出</el-button> |
| | | </el-row> |
| | | |
| | | <el-row class="rowPanel" > |
| | | <el-form ref="form" :model="form" inline > |
| | | |
| | | <el-form-item label="业绩规则" > |
| | | <el-select v-model="form.achieveRuleId" filterable placeholder="请选择业绩规则"> |
| | | <el-option |
| | | v-for="item in achieveRulsList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="员工姓名" > |
| | | <el-input v-model="form.staffName"></el-input> |
| | | </el-form-item> |
| | | |
| | | |
| | | <el-form-item label="统计门店" > |
| | | <el-select v-model="form.shopId" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in shopList" |
| | | :key="item.shopShortName" |
| | | :label="item.shopShortName" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | |
| | | <el-form-item label="订单类型" > |
| | | <el-select v-model="form.orderType" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in orderTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="统计时间" prop="datetimeArr"> |
| | | <el-date-picker |
| | | v-model="form.datetimeArr" |
| | | type="daterange" |
| | | range-separator="至" format="yyyy-MM-dd HH:mm" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | |
| | | <el-button type="primary" @click="search" >搜索</el-button> |
| | | <el-button @click="resetForm('form')">重置</el-button> |
| | | </el-form> |
| | | </el-row> |
| | | |
| | | <el-row class="table-style" > |
| | | |
| | | <el-table id="proj" :data="table.rows" :height="height" stripe @sort-change="sortChange"> |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="ruleName" |
| | | label="规则名称" |
| | | width="180"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="shopName" |
| | | label="门店名称" |
| | | show-overflow-tooltip |
| | | width="240"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="guwen" |
| | | label="业绩归属人" |
| | | show-overflow-tooltip |
| | | width="180"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="createBy" |
| | | label="业绩创建人" |
| | | show-overflow-tooltip |
| | | width="180"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="zkTotal" |
| | | label="订单金额"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="goodsCash" |
| | | label="现金"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="cardCash" |
| | | label="划扣"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="hisConsume" |
| | | label="本金消耗"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="freeConsume" |
| | | label="赠送消耗"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="projPercentage" |
| | | label="服务提成"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="numberOfPeople" |
| | | label="人头"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="projNum" |
| | | label="项目个数"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="projTime" |
| | | label="服务时间"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | sortable="custom" |
| | | prop="orderType" |
| | | label="订单类型"> |
| | | </el-table-column> |
| | | |
| | | </el-table> |
| | | </el-row> |
| | | <el-row class="paginationStyle" > |
| | | <el-pagination background |
| | | @size-change="changePageSize" |
| | | @current-change="changeCurrentPage" |
| | | :current-page="table.currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="table.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="table.total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> |
| | | <script type="text/javascript" th:inline="javascript"> |
| | | |
| | | var vue = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | table:{ |
| | | rows:[], |
| | | total:0, |
| | | pageSize:10, |
| | | currentPage:1, |
| | | }, |
| | | form:{ |
| | | achieveRuleId:null, |
| | | staffName:null, |
| | | shopId:null, |
| | | orderType:'', |
| | | order:'', |
| | | sort:'', |
| | | beginTime:'', |
| | | endTime:'', |
| | | }, |
| | | height:'calc(100vh - 240px)', |
| | | |
| | | //提成规则 |
| | | achieveRulsList:[], |
| | | //业绩用户列表 |
| | | userList: [], |
| | | shopList:[{id:0,shopShortName:'全部'}], |
| | | |
| | | orderTypeList:[ |
| | | {value:'',label:'全部'}, |
| | | {value:'订单',label:'订单'}, |
| | | {value:'服务单',label:'服务单'}, |
| | | |
| | | ], |
| | | }, |
| | | created: function () { |
| | | let _this=this; |
| | | //获取业绩用户列表 |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | url: basePath + '/admin/shopAll', |
| | | callback: function (data) { |
| | | _this.userList = data.rows; |
| | | } |
| | | }); |
| | | AjaxProxy.requst({ |
| | | app:_this, |
| | | url:basePath+"/admin/shopInfo/findAll", |
| | | callback:function (data) { |
| | | data.rows.forEach(shop=>{ |
| | | _this.shopList.push(shop); |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | this.getAchieveRule(); |
| | | this.loadData(); |
| | | window.addEventListener("keydown", this.keydown); |
| | | }, |
| | | methods: { |
| | | changePageSize(val) { |
| | | this.table.pageSize = val; |
| | | this.loadData(); |
| | | }, |
| | | changeCurrentPage(val) { |
| | | this.table.currentPage = val; |
| | | this.loadData(); |
| | | }, |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | this.form={ |
| | | achieveRuleId:null, |
| | | staffName:null, |
| | | shopId:null, |
| | | orderType:'', |
| | | order:'', |
| | | sort:'', |
| | | beginTime:'', |
| | | endTime:'', |
| | | }; |
| | | }, |
| | | sortChange:function (column){ |
| | | if(column.order){ |
| | | if(column.order.indexOf("desc")){ |
| | | this.form.order="desc"; |
| | | }else{ |
| | | this.form.order="asc"; |
| | | } |
| | | this.form.sort=column.prop; |
| | | this.loadData(); |
| | | } |
| | | }, |
| | | loadData:function(){ |
| | | let _this = this; |
| | | let data=_this.getRequestParam(); |
| | | data.pageSize=_this.table.pageSize; |
| | | data.pageNum=_this.table.currentPage; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:data, |
| | | url: basePath + '/admin/achieve/achieveNewStatistics', |
| | | callback: function (data) { |
| | | _this.table.rows = data.rows; |
| | | _this.table.total=data.total; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 获取规则 |
| | | */ |
| | | getAchieveRule(){ |
| | | let _this = this; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data: {pageNum:1,pageSize:1000}, |
| | | url: basePath + "/admin/achieveRule/selectList", |
| | | callback: function (data) { |
| | | _this.achieveRulsList=data.rows; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | getRequestParam(){ |
| | | let _this = this; |
| | | return { |
| | | achieveRuleId:_this.form.achieveRuleId, |
| | | staffName:_this.form.staffName, |
| | | shopId:_this.form.shopId, |
| | | orderType:_this.form.orderType, |
| | | beginTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'', |
| | | endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'', |
| | | order:_this.form.order, |
| | | sort:_this.form.sort, |
| | | } |
| | | }, |
| | | search:function(){ |
| | | this.table.currentPage=1; |
| | | this.loadData(); |
| | | }, |
| | | keydown(evt){ |
| | | if(evt.keyCode==13) { |
| | | this.search(); |
| | | } |
| | | }, |
| | | |
| | | //导出 |
| | | exportExcel(){ |
| | | window.location.href=basePath+"/admin/achieve/exportAchieveNewStatisticsExcel?"+MTools.jsonToUrlParam(this.getRequestParam()); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | </script> |
| | | </body> |
| | | </html> |