!356 提成明细加上服务时间范围查询、优化订单营养师助理售后绑定关系逻辑
Merge pull request !356 from 德仔/xzj
This commit is contained in:
commit
c481af6c60
@ -267,8 +267,15 @@ public class SysCommisionController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('commisionDay:detail:list')")
|
||||
@GetMapping("/detailDay")
|
||||
public TableDataInfo getDetailDay(SysCommision sysCommision) {
|
||||
startPage();
|
||||
return getDataTable(sysCommissionDayService.calculateCommissionByDay(sysCommision));
|
||||
int count = sysCommissionDayService.getAfterSaleAndNutriCount(sysCommision);
|
||||
List<SysCommissionDayDetail> list = null;
|
||||
if(count > 0){
|
||||
startPage();
|
||||
list = sysCommissionDayService.calculateCommissionByDay(sysCommision);
|
||||
}else{
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
return new TableDataInfo(list, count);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,5 +69,7 @@ public interface SysCommisionMapper
|
||||
*/
|
||||
List<SysCommision> getAfterSaleAndNutri(SysCommision sysCommision);
|
||||
|
||||
int getAfterSaleAndNutriCount(SysCommision sysCommision);
|
||||
|
||||
List<Long> getAfterSaleId(SysCommision sysCommision);
|
||||
}
|
||||
|
@ -46,4 +46,11 @@ public interface ISysCommissionDayService {
|
||||
*/
|
||||
Map<String, List<SysCommision>> getRateMapByStartTime(List<SysCommision> tmpComList);
|
||||
|
||||
/**
|
||||
* 查询营养师、售后数量
|
||||
* @param sysCommision
|
||||
* @return
|
||||
*/
|
||||
int getAfterSaleAndNutriCount(SysCommision sysCommision);
|
||||
|
||||
}
|
||||
|
@ -969,4 +969,9 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAfterSaleAndNutriCount(SysCommision sysCommision){
|
||||
return sysCommisionMapper.getAfterSaleAndNutriCount(sysCommision);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -260,6 +260,16 @@
|
||||
<if test="userId != null and userId != ''">and su.user_id = #{userId}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询售后和营养师数量 -->
|
||||
<select id="getAfterSaleAndNutriCount" parameterType="SysCommision" resultType="int">
|
||||
SELECT count(su.user_id) FROM sys_user su
|
||||
LEFT JOIN sys_user_post sup ON sup.user_id = su.user_id
|
||||
LEFT JOIN sys_post sp ON sp.post_id = sup.post_id
|
||||
WHERE su.del_flag = 0 AND su.status = 0 AND sp.remark = 'sale_post' AND (sp.post_code = 'after_sale' OR sp.post_code = 'nutri')
|
||||
<if test="postId != null and postId != ''">and sp.post_id = #{postId}</if>
|
||||
<if test="userId != null and userId != ''">and su.user_id = #{userId}</if>
|
||||
</select>
|
||||
|
||||
<select id="getAfterSaleId" parameterType="SysCommision" resultType="Long">
|
||||
SELECT su.user_id FROM sys_user su
|
||||
LEFT JOIN sys_user_post sup ON sup.user_id = su.user_id
|
||||
|
@ -807,6 +807,10 @@ export default {
|
||||
};
|
||||
this.screenNutriAssisIdOptions = this.nutriAssisIdOptions;
|
||||
this.screenAfterSaleIdOptions = this.afterSaleIdOptions;
|
||||
|
||||
//处理原先设定的营养师、助理、售后绑定关系发生变化(比如原先订单的售后或助理发生变化)之后,需要自动更换
|
||||
this.handleOnDietIdChange(this.form.nutritionistIdList);
|
||||
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleOnClosed() {
|
||||
@ -851,15 +855,21 @@ export default {
|
||||
},
|
||||
//监听营养师下拉列表
|
||||
handleOnDietIdChange(val) {
|
||||
let assistantAfterArray = orderUtils.getAfterSaleAndAssistantByDietId(this.dietitianAfterAssistantOptions, (val && val.length != null) ? val[val.length-1] : 0);
|
||||
this.form = {
|
||||
let assistantAfterArray = orderUtils.getAfterSaleAndAssistantByDietId(this.dietitianAfterAssistantOptions, (val && val != null) ? val[val.length-1] : 0);
|
||||
/*this.form = {
|
||||
...this.form,
|
||||
nutriAssisId: assistantAfterArray ? orderUtils.getRandomValueByArray(assistantAfterArray[0]) : 0,
|
||||
afterSaleId: assistantAfterArray ? orderUtils.getRandomValueByArray(assistantAfterArray[1]) : 0,
|
||||
};
|
||||
};*/
|
||||
if(this.form.nutriAssisId == null || assistantAfterArray[0].indexOf(this.form.nutriAssisId) == -1){
|
||||
this.form.nutriAssisId = assistantAfterArray ? orderUtils.getRandomValueByArray(assistantAfterArray[0]) : 0;
|
||||
}
|
||||
if(this.form.afterSaleId == null || assistantAfterArray[1].indexOf(this.form.afterSaleId) == -1){
|
||||
this.form.afterSaleId = assistantAfterArray ? orderUtils.getRandomValueByArray(assistantAfterArray[1]) : 0;
|
||||
}
|
||||
this.screenNutriAssisIdOptions = orderUtils.getAfterSaleOrAssistantByIds(this.nutriAssisIdOptions, assistantAfterArray[0]);
|
||||
this.screenAfterSaleIdOptions = orderUtils.getAfterSaleOrAssistantByIds(this.afterSaleIdOptions, assistantAfterArray[1]);
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听收款账号的变化
|
||||
|
@ -664,7 +664,7 @@ export default {
|
||||
},
|
||||
//监听营养师下拉列表
|
||||
handleOnDietIdChange(val) {
|
||||
console.log(val);
|
||||
//console.log(val);
|
||||
let assistantAfterArray = orderUtils.getAfterSaleAndAssistantByDietId(this.dietitianAfterAssistantOptions, val);
|
||||
console.log(assistantAfterArray);
|
||||
this.form = {
|
||||
|
@ -261,6 +261,7 @@ export default {
|
||||
this.queryParam.userId = this.data.userId;
|
||||
this.queryParam.reviewStatus = this.data.reviewStatus;
|
||||
this.queryParam.endTime = this.data.endTime;
|
||||
this.serverDateScope = this.data.serverDateScope;
|
||||
this.title = `「${this.data.name}`;
|
||||
this.fileName = this.data.name;
|
||||
if (this.data.yearMonth) {
|
||||
|
@ -823,8 +823,8 @@ export function dealHealthy(customerHealthy) {
|
||||
return customerHealthy;
|
||||
}
|
||||
|
||||
export const extendHealthyTitle = {"0":"减脂","5":"降血压","6":"降血糖","3": "备孕营养", "1": "月经不调", "2": "多囊调理", "11":"心脑血管调理","13":"胃肠肿瘤调理","4":"产后调理","7":"高血脂","10":"消化系统管理","14":"增重"};
|
||||
export const projectName = {"0":"减脂","5":"高血压","6":"高血糖","3": "备孕营养", "1":"月经不调", "2":"多囊卵巢综合症", "13":"胃肠肿瘤","4":"产后调理","7":"高血脂","10":"消化系统管理","14":"增重"};
|
||||
export const extendHealthyTitle = {"0":"减脂","1": "月经不调","2": "多囊调理", "3": "备孕营养", "4":"产后调理","5":"降血压","6":"降血糖","7":"高血脂调理","8":"高尿酸调理","9":"营养性贫血调理","10":"消化系统调理","11":"心脑血管调理","12":"99体验","13":"胃肠肿瘤调理","14":"增重"};
|
||||
export const projectName = {"0":"减脂","1":"月经不调","2":"多囊卵巢综合症", "3": "备孕营养", "4":"产后调理", "5":"高血压","6":"高血糖","7":"高血脂","8":"高尿酸","9":"营养性贫血","10":"消化系统管理","11":"心脑血管系统","12":"99体验","13":"胃肠肿瘤","14":"增重"};
|
||||
//需要填写慢病调查问卷的项目
|
||||
export const extendHealthyIndex = [5, 6, 1, 2, 13,4,7];
|
||||
//跳过减脂经历问卷的项目
|
||||
|
@ -39,7 +39,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="截止月份" prop="month">
|
||||
<el-form-item label="截止订单成交月份" prop="month" label-width="140px">
|
||||
<el-date-picker
|
||||
v-model="month"
|
||||
@change="monthRangeChange"
|
||||
@ -48,6 +48,7 @@
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="订单状态" prop="reviewStatus">
|
||||
<el-select
|
||||
v-model="queryParams.reviewStatus"
|
||||
@ -63,7 +64,19 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-form-item label="服务时间" prop="dateScope">
|
||||
<el-date-picker
|
||||
v-model="serverDateScope"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left:25lpx">
|
||||
<el-button
|
||||
type="cyan"
|
||||
icon="el-icon-search"
|
||||
@ -283,6 +296,7 @@ export default {
|
||||
sendCommissionPlanTable: false,
|
||||
sendCommissionPlan: {},
|
||||
fixLength: 2,
|
||||
serverDateScope: null
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@ -332,12 +346,17 @@ export default {
|
||||
/** 查询业务提成比例列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
const dateRange = [
|
||||
dayjs(this.month).startOf("month").format("YYYY-MM-DD"),
|
||||
dayjs(this.month).endOf("month").format("YYYY-MM-DD"),
|
||||
];
|
||||
let dateRange = null;
|
||||
if(this.month && this.month != null){
|
||||
dateRange = [
|
||||
dayjs(this.month).startOf("month").format("YYYY-MM-DD"),
|
||||
dayjs(this.month).endOf("month").format("YYYY-MM-DD"),
|
||||
];
|
||||
}
|
||||
this.queryParams.serverScopeStartTime = this.serverDateScope && this.serverDateScope.length > 0 ? this.serverDateScope[0] : null;
|
||||
this.queryParams.serverScopeEndTime = this.serverDateScope && this.serverDateScope.length > 0 ? this.serverDateScope[1] : null;
|
||||
// console.log(dateRange)
|
||||
detailDayCommision(this.addDateRange(this.queryParams, dateRange)).then(
|
||||
detailDayCommision(dateRange != null ? this.addDateRange(this.queryParams, dateRange) : this.queryParams).then(
|
||||
(response) => {
|
||||
this.commisionList = response.rows;
|
||||
this.total = response.total;
|
||||
@ -416,11 +435,21 @@ export default {
|
||||
},
|
||||
handleDetailClick(row) {
|
||||
// console.log(row);
|
||||
const dateRange = [
|
||||
dayjs(this.month).startOf("month").format("YYYY-MM-DD"),
|
||||
dayjs(this.month).endOf("month").format("YYYY-MM-DD"),
|
||||
];
|
||||
this.$refs["ordercommissDetailRef"].showDrawer(this.addDateRange({'yearMonth': dayjs(this.month).endOf("month").format("YYYY-MM-DD"),'name': row.nickName, 'userId': row.userId, 'reviewStatus': this.queryParams.reviewStatus}, dateRange));
|
||||
let dateRange = null;
|
||||
if(this.month && this.month != null){
|
||||
dateRange = [
|
||||
dayjs(this.month).startOf("month").format("YYYY-MM-DD"),
|
||||
dayjs(this.month).endOf("month").format("YYYY-MM-DD"),
|
||||
];
|
||||
}
|
||||
let param = {
|
||||
'name': row.nickName,
|
||||
'userId': row.userId,
|
||||
'reviewStatus': this.queryParams.reviewStatus,
|
||||
'yearMonth': this.month == null ? null : dayjs(this.month).endOf("month").format("YYYY-MM-DD"),
|
||||
'serverDateScope': this.serverDateScope
|
||||
}
|
||||
this.$refs["ordercommissDetailRef"].showDrawer(dateRange != null ? this.addDateRange(param, dateRange) : param);
|
||||
},
|
||||
getSummaries(param) {
|
||||
//param 是固定的对象,里面包含 columns与 data参数的对象 {columns: Array[4], data: Array[5]},包含了表格的所有的列与数据信息
|
||||
|
Loading…
x
Reference in New Issue
Block a user