建客户档案时根据直播记录匹配营养师
This commit is contained in:
parent
b249035da0
commit
cf766cb817
@ -4,6 +4,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.stdiet.common.utils.DateUtils;
|
import com.stdiet.common.utils.DateUtils;
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -242,4 +243,22 @@ public class SysLiveSchedulController extends BaseController
|
|||||||
List<SysLiveSchedul> list = sysLiveSchedulService.selectSysLiveSchedulList(sysLiveSchedul);
|
List<SysLiveSchedul> list = sysLiveSchedulService.selectSysLiveSchedulList(sysLiveSchedul);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据日期查询直播记录
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/getLiveSchedulByTime")
|
||||||
|
public AjaxResult getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul){
|
||||||
|
SysLiveSchedul live = null;
|
||||||
|
try {
|
||||||
|
if(sysLiveSchedul.getFanChannel() != null && StringUtils.isNotEmpty(sysLiveSchedul.getLiveStartTimeString())){
|
||||||
|
sysLiveSchedul.setLiveStartTimeString(java.net.URLDecoder.decode(sysLiveSchedul.getLiveStartTimeString(), "UTF-8"));
|
||||||
|
sysLiveSchedul.setLiveStartTime(DateUtils.parseDate(sysLiveSchedul.getLiveStartTimeString()));
|
||||||
|
live = sysLiveSchedulService.getLiveSchedulByTime(sysLiveSchedul);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return AjaxResult.success(live);
|
||||||
|
}
|
||||||
}
|
}
|
@ -37,6 +37,8 @@ public class SysLiveSchedul extends BaseEntity
|
|||||||
@Excel(name = "直播开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "直播开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date liveStartTime;
|
private Date liveStartTime;
|
||||||
|
|
||||||
|
private String liveStartTimeString;
|
||||||
|
|
||||||
/** 直播结束时间 */
|
/** 直播结束时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
@Excel(name = "直播结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "直播结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@ -90,4 +90,10 @@ public interface SysLiveSchedulMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public SysLiveSchedul getLastLiveSchedul();
|
public SysLiveSchedul getLastLiveSchedul();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据时间确定最近的直播记录
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public SysLiveSchedul getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul);
|
||||||
}
|
}
|
@ -85,4 +85,10 @@ public interface ISysLiveSchedulService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public AjaxResult copyLastTimeLiveSchedul();
|
public AjaxResult copyLastTimeLiveSchedul();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据时间确定最近的直播记录
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public SysLiveSchedul getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul);
|
||||||
}
|
}
|
@ -178,4 +178,12 @@ public class SysLiveSchedulServiceImpl implements ISysLiveSchedulService
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据时间确定最近的直播记录
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public SysLiveSchedul getLiveSchedulByTime(SysLiveSchedul sysLiveSchedul){
|
||||||
|
return sysLiveSchedulMapper.getLiveSchedulByTime(sysLiveSchedul);
|
||||||
|
}
|
||||||
}
|
}
|
@ -211,5 +211,14 @@
|
|||||||
where del_flag = 0 order by live_schedul_date desc limit 1
|
where del_flag = 0 order by live_schedul_date desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据渠道、进粉时间确实进粉来源哪个直播间,取最近的 -->
|
||||||
|
<select id="getLiveSchedulByTime" parameterType="SysLiveSchedul" resultMap="SysLiveSchedulResultSigle">
|
||||||
|
select
|
||||||
|
<include refid="selectSysLiveSchedulVo"/>
|
||||||
|
from sys_live_schedul where del_flag = 0
|
||||||
|
and fan_channel = #{fanChannel}
|
||||||
|
and #{liveStartTime} >= live_start_time order by live_start_time desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -80,5 +80,14 @@ export function getAllLiveSchedulByDate(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据进粉时间查询最近直播记录
|
||||||
|
export function getLiveSchedulByTime(data) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/liveSchedul/getLiveSchedulByTime',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- 添加或修改导粉管理对话框 -->
|
<!-- 添加或修改导粉管理对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="1100px" :close-on-click-modal="false" append-to-body @closed="cancel">
|
<el-dialog :title="title" :visible.sync="open" width="1000px" :close-on-click-modal="false" append-to-body @closed="cancel">
|
||||||
|
<div style="margin-bottom: 20px;color:red">1、添加导粉记录时会根据进粉渠道、当前时间来自动确定所属直播间,当前时间段没有直播,则取上一次直播,若账号从未直播过,则为空</div>
|
||||||
<div style="height: 500px; overflow: auto">
|
<div style="height: 500px; overflow: auto">
|
||||||
<el-table v-loading="loading" :data="wxAccountList">
|
<el-table v-loading="loading" :data="wxAccountList">
|
||||||
<!--<el-table-column label="微信昵称" align="center" prop="wxNickName" />-->
|
<!--<el-table-column label="微信昵称" align="center" prop="wxNickName" />-->
|
||||||
@ -27,7 +28,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="直播间" align="center" prop="importFanLive" >
|
<!--<el-table-column label="直播间" align="center" prop="importFanLive" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="scope.row.importFanLive"
|
v-model="scope.row.importFanLive"
|
||||||
@ -44,7 +45,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>-->
|
||||||
<el-table-column label="导粉数量" align="center" prop="fanNum" width="200">
|
<el-table-column label="导粉数量" align="center" prop="fanNum" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number v-model="scope.row.fanNum" :min="1" :max="10000" label="导粉数量" style="width:160px"></el-input-number>
|
<el-input-number v-model="scope.row.fanNum" :min="1" :max="10000" label="导粉数量" style="width:160px"></el-input-number>
|
||||||
@ -74,7 +75,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addImportFanRecord,getWxAccountAndSale } from "@/api/custom/importFanRecord";
|
import { addImportFanRecord,getWxAccountAndSale } from "@/api/custom/importFanRecord";
|
||||||
import { getAllLiveSchedulByDate } from "@/api/custom/liveSchedul";
|
import { getAllLiveSchedulByDate,getLiveSchedulByTime } from "@/api/custom/liveSchedul";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
const nowTime = dayjs().format("YYYY-MM-DD HH:mm");
|
const nowTime = dayjs().format("YYYY-MM-DD HH:mm");
|
||||||
export default {
|
export default {
|
||||||
@ -125,7 +126,7 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.getListWxAccount();
|
this.getListWxAccount();
|
||||||
this.getAllLiveSchedulByDate();
|
//this.getAllLiveSchedulByDate();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
},
|
},
|
||||||
reset(){
|
reset(){
|
||||||
@ -268,7 +269,24 @@ export default {
|
|||||||
return (value == undefined || value == null || value == "") ? "" : value;
|
return (value == undefined || value == null || value == "") ? "" : value;
|
||||||
},
|
},
|
||||||
autoSelectLive(row){
|
autoSelectLive(row){
|
||||||
if(row.importFanLive == undefined || row.importFanLive == null || row.importFanLive == ""){
|
if(row.importFanChannel == undefined || row.importFanChannel == null || row.importFanChannel == ""){
|
||||||
|
row.importFanLive = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
getLiveSchedulByTime({'fanChannel':row.importFanChannel,'liveStartTimeString':encodeURIComponent(dayjs().format("YYYY-MM-DD HH:mm"))}).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
let live = response.data;
|
||||||
|
if(live != undefined && live != null){
|
||||||
|
row.importFanLive = live.id;
|
||||||
|
}else{
|
||||||
|
row.importFanLive = null;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
row.importFanLive = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*if(row.importFanLive == undefined || row.importFanLive == null || row.importFanLive == ""){
|
||||||
if(row.importFanChannel == undefined || row.importFanChannel == null || row.importFanChannel == ""){
|
if(row.importFanChannel == undefined || row.importFanChannel == null || row.importFanChannel == ""){
|
||||||
row.importFanLive = null;
|
row.importFanLive = null;
|
||||||
}else{
|
}else{
|
||||||
@ -286,7 +304,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -57,6 +57,8 @@
|
|||||||
<el-select
|
<el-select
|
||||||
v-model="form.accountId"
|
v-model="form.accountId"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
@change="handleOnChanelIdChange"
|
@change="handleOnChanelIdChange"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -96,6 +98,8 @@
|
|||||||
<el-form-item label="调理项目" prop="conditioningProjectId">
|
<el-form-item label="调理项目" prop="conditioningProjectId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.conditioningProjectId"
|
v-model="form.conditioningProjectId"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -109,7 +113,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="售前" prop="preSaleId">
|
<el-form-item label="售前" prop="preSaleId">
|
||||||
<el-select v-model="form.preSaleId" placeholder="请选择">
|
<el-select v-model="form.preSaleId" placeholder="请选择" filterable
|
||||||
|
clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in preSaleIdOptions"
|
v-for="dict in preSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -133,7 +138,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" v-show="afterNutiShow">
|
<el-col :span="8" v-show="afterNutiShow">
|
||||||
<el-form-item label="售后" prop="afterSaleId">
|
<el-form-item label="售后" prop="afterSaleId">
|
||||||
<el-select v-model="form.afterSaleId" placeholder="请选择">
|
<el-select v-model="form.afterSaleId" placeholder="请选择" filterable
|
||||||
|
clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in afterSaleIdOptions"
|
v-for="dict in afterSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -148,6 +154,7 @@
|
|||||||
<el-select
|
<el-select
|
||||||
v-model="form.nutritionistIdList"
|
v-model="form.nutritionistIdList"
|
||||||
multiple
|
multiple
|
||||||
|
filterable
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -173,7 +180,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" v-show="afterNutiShow">
|
<el-col :span="8" v-show="afterNutiShow">
|
||||||
<el-form-item label="助理营养师" prop="nutriAssisId">
|
<el-form-item label="助理营养师" prop="nutriAssisId">
|
||||||
<el-select v-model="form.nutriAssisId" placeholder="请选择">
|
<el-select v-model="form.nutriAssisId" placeholder="请选择" filterable
|
||||||
|
clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in nutriAssisIdOptions"
|
v-for="dict in nutriAssisIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -185,7 +193,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="策划" prop="plannerId">
|
<el-form-item label="策划" prop="plannerId">
|
||||||
<el-select v-model="form.plannerId" placeholder="请选择">
|
<el-select v-model="form.plannerId" placeholder="请选择" filterable
|
||||||
|
clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in plannerIdOptions"
|
v-for="dict in plannerIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -197,7 +206,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||||
<el-select v-model="form.plannerAssisId" placeholder="请选择">
|
<el-select v-model="form.plannerAssisId" placeholder="请选择" filterable
|
||||||
|
clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in plannerAssisIdOptions"
|
v-for="dict in plannerAssisIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -209,7 +219,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="运营" prop="operatorId">
|
<el-form-item label="运营" prop="operatorId">
|
||||||
<el-select v-model="form.operatorId" placeholder="请选择">
|
<el-select v-model="form.operatorId" placeholder="请选择" filterable
|
||||||
|
clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in operatorIdOptions"
|
v-for="dict in operatorIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -221,7 +232,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="运营助理" prop="operatorAssisId">
|
<el-form-item label="运营助理" prop="operatorAssisId">
|
||||||
<el-select v-model="form.operatorAssisId" placeholder="请选择">
|
<el-select v-model="form.operatorAssisId" placeholder="请选择" filterable
|
||||||
|
clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in operatorAssisIdOptions"
|
v-for="dict in operatorAssisIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
|
@ -326,16 +326,42 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改客户档案对话框 -->
|
<!-- 添加或修改客户档案对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="520px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="客户名字" prop="name">
|
<el-form-item label="进粉渠道" prop="channelId" style="width:400px">
|
||||||
|
<el-select v-model="form.channelId" placeholder="请选择" filterable clearable @change="channelAutoSelectNutritionist">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in accountIdOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="parseInt(dict.dictValue)"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="进粉时间" prop="fansTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.fansTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择进粉时间"
|
||||||
|
format="yyyy-MM-dd HH:mm"
|
||||||
|
value-format="yyyy-MM-dd HH:mm"
|
||||||
|
:picker-options="fanPickerOptions"
|
||||||
|
@change="fanTimeAutoSelectNutritionist"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="客户名字" prop="name" style="width:300px">
|
||||||
<el-input v-model.trim="form.name" placeholder="请输入名字" />
|
<el-input v-model.trim="form.name" placeholder="请输入名字" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="手机号" prop="phone">
|
<el-form-item label="手机号" prop="phone" style="width:300px">
|
||||||
<el-input v-model.trim="form.phone" placeholder="请输入手机号" />
|
<el-input v-model.trim="form.phone" placeholder="请输入手机号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -387,31 +413,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="进粉时间" prop="fansTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.fansTime"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择进粉时间"
|
|
||||||
format="yyyy-MM-dd"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
:picker-options="fanPickerOptions"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="进粉渠道" prop="channelId">
|
|
||||||
<el-select v-model="form.channelId" placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in accountIdOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="parseInt(dict.dictValue)"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -446,6 +449,7 @@ import {
|
|||||||
listCustomer,
|
listCustomer,
|
||||||
updateCustomer,
|
updateCustomer,
|
||||||
} from "@/api/custom/customer";
|
} from "@/api/custom/customer";
|
||||||
|
import { getLiveSchedulByTime } from "@/api/custom/liveSchedul";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import OrderDrawer from "@/components/OrderDrawer";
|
import OrderDrawer from "@/components/OrderDrawer";
|
||||||
@ -785,6 +789,52 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(function () {});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
|
channelAutoSelectNutritionist(channelValue){
|
||||||
|
this.form.fansChannel = channelValue == "" ? null : channelValue;
|
||||||
|
if(channelValue == undefined || channelValue == null || channelValue == ""){
|
||||||
|
this.form.mainDietitian = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(this.form.fansTime == undefined || this.form.fansTime == null){
|
||||||
|
this.form.mainDietitian = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.autoSelectNutritionist();
|
||||||
|
},
|
||||||
|
fanTimeAutoSelectNutritionist(fansTime){
|
||||||
|
this.form.fansTime = fansTime;
|
||||||
|
if(fansTime == undefined || fansTime == null){
|
||||||
|
this.form.mainDietitian = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(this.form.fansChannel == undefined || this.form.fansChannel == null || this.form.fansChannel == ""){
|
||||||
|
this.form.mainDietitian = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.autoSelectNutritionist();
|
||||||
|
},
|
||||||
|
autoSelectNutritionist(){
|
||||||
|
getLiveSchedulByTime({'fanChannel':this.form.fansChannel,'liveStartTimeString':encodeURIComponent(this.form.fansTime)}).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
let live = response.data;
|
||||||
|
if(live != undefined && live != null && live.liveNutritionistId != null && this.nutritionistIdOptions != null){
|
||||||
|
let mainDietitian = null;
|
||||||
|
this.nutritionistIdOptions.forEach((item,index) => {
|
||||||
|
if(live.liveNutritionistId == item.dictValue){
|
||||||
|
mainDietitian = live.liveNutritionistId;
|
||||||
|
}
|
||||||
|
if(index == this.nutritionistIdOptions.length - 1){
|
||||||
|
this.form.mainDietitian = mainDietitian;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
this.form.mainDietitian = null;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.form.mainDietitian = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -233,6 +233,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listImportFanRecord, getImportFanRecord, delImportFanRecord, addImportFanRecord, updateImportFanRecord, exportImportFanRecord,removeFanWxAccount,saveWxAccountFanNum } from "@/api/custom/importFanRecord";
|
import { listImportFanRecord, getImportFanRecord, delImportFanRecord, addImportFanRecord, updateImportFanRecord, exportImportFanRecord,removeFanWxAccount,saveWxAccountFanNum } from "@/api/custom/importFanRecord";
|
||||||
import ImportFan from "@/components/ImportFanRecord/ImportFan";
|
import ImportFan from "@/components/ImportFanRecord/ImportFan";
|
||||||
|
import { getLiveSchedulByTime } from "@/api/custom/liveSchedul";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
const nowDate = dayjs().format("YYYY-MM-DD");
|
const nowDate = dayjs().format("YYYY-MM-DD");
|
||||||
const nowTime = dayjs().format("YYYY-MM-DD HH:mm");
|
const nowTime = dayjs().format("YYYY-MM-DD HH:mm");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user