!182 进粉统计加上时间范围筛选

Merge pull request !182 from 德仔/xzj
This commit is contained in:
德仔 2021-03-29 19:44:47 +08:00 committed by Gitee
commit 3119fa90e2
3 changed files with 34 additions and 10 deletions

View File

@ -63,4 +63,12 @@ public class SysWxFanStatistics extends BaseEntity
//排序参数null或者0按照id倒序 1按照组别IDid顺序正序 //排序参数null或者0按照id倒序 1按照组别IDid顺序正序
private Integer sortFlag; private Integer sortFlag;
//进粉开始时间
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fanStartTime;
//进粉结束时间
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fanEndTime;
} }

View File

@ -42,7 +42,9 @@
<select id="selectSysWxFanStatisticsList" parameterType="SysWxFanStatistics" resultMap="SysWxFanStatisticsResult"> <select id="selectSysWxFanStatisticsList" parameterType="SysWxFanStatistics" resultMap="SysWxFanStatisticsResult">
<include refid="selectSysWxFanStatisticsVoExtended"/> where swfs.del_flag = 0 <include refid="selectSysWxFanStatisticsVoExtended"/> where swfs.del_flag = 0
<if test="fanTime != null ">and swfs.fan_time = #{fanTime}</if> <if test="fanStartTime != null and fanEndTime != null">
and swfs.fan_time >= #{fanStartTime} and #{fanEndTime} >= swfs.fan_time
</if>
<if test="userId != null">and su.user_id = #{userId}</if> <if test="userId != null">and su.user_id = #{userId}</if>
<if test="accountId != null">and swd.account_id = #{accountId}</if> <if test="accountId != null">and swd.account_id = #{accountId}</if>
<if test="sortFlag == null or sortFlag == 0"> <if test="sortFlag == null or sortFlag == 0">
@ -60,7 +62,9 @@
left join sys_wx_distribution swd on swd.wechat_account = swfs.wx_id and swd.del_flag = 0 left join sys_wx_distribution swd on swd.wechat_account = swfs.wx_id and swd.del_flag = 0
left join sys_user su on su.user_id = swd.user_id and su.del_flag = 0 left join sys_user su on su.user_id = swd.user_id and su.del_flag = 0
where swfs.del_flag = 0 where swfs.del_flag = 0
<if test="fanTime != null ">and swfs.fan_time = #{fanTime}</if> <if test="fanStartTime != null and fanEndTime != null">
and swfs.fan_time >= #{fanStartTime} and #{fanEndTime} >= swfs.fan_time
</if>
<if test="userId != null">and su.user_id = #{userId}</if> <if test="userId != null">and su.user_id = #{userId}</if>
<if test="accountId != null">and swd.account_id = #{accountId}</if> <if test="accountId != null">and swd.account_id = #{accountId}</if>
</select> </select>

View File

@ -8,13 +8,16 @@
label-width="68px" label-width="68px"
> >
<el-form-item label="进粉日期" prop="fanTime"> <el-form-item label="进粉日期" prop="fanTime">
<el-date-picker <el-date-picker
clearable v-model="fanTimeScope"
style="width: 200px" type="daterange"
v-model="queryParams.fanTime" range-separator="至"
type="date" start-placeholder="进粉开始日期"
end-placeholder="进粉结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期" :picker-options="fanTimePickerOptions"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -188,6 +191,7 @@
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期" placeholder="选择日期"
:picker-options="fanTimePickerOptions"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -318,7 +322,6 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
fanTime: nowDate,
userId: null, userId: null,
accountId: null, accountId: null,
}, },
@ -343,6 +346,12 @@ export default {
{ required: true, trigger: "blur", message: "请输入进粉数量" }, { required: true, trigger: "blur", message: "请输入进粉数量" },
], ],
}, },
fanTimeScope: [nowDate, nowDate],
fanTimePickerOptions: {
disabledDate(time) {
return time.getTime() > dayjs()
},
}
}; };
}, },
created() { created() {
@ -361,6 +370,8 @@ export default {
/** 查询进粉统计列表 */ /** 查询进粉统计列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.fanStartTime = this.fanTimeScope && this.fanTimeScope.length > 0 ? this.fanTimeScope[0] : null;
this.queryParams.fanEndTime = this.fanTimeScope && this.fanTimeScope.length > 0 ? this.fanTimeScope[1] : null;
listFanStatistics(this.queryParams).then((response) => { listFanStatistics(this.queryParams).then((response) => {
this.fanStatisticsList = response.rows; this.fanStatisticsList = response.rows;
this.totalFanNum = 0; this.totalFanNum = 0;
@ -394,6 +405,7 @@ export default {
}; };
this.wxList = []; this.wxList = [];
this.showWxFlag = false; this.showWxFlag = false;
this.fanTimeScope = [nowDate,nowDate];
this.resetForm("form"); this.resetForm("form");
}, },
editFormReset() { editFormReset() {