From 4d16eccb156ad17b395332edafd41cae208d7a28 Mon Sep 17 00:00:00 2001 From: zhaoxiaohao <279049017@qq.com> Date: Mon, 28 Dec 2020 14:12:41 +0800 Subject: [PATCH] 添加合同时,添加签订日期; 数据需求,将查询条件修改为创建日期 --- kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/dataNeed.html | 37 ++++- kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html | 351 +++++++++++++++++++++++++++---------------------- kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/DataNeedMapper.xml | 6 3 files changed, 228 insertions(+), 166 deletions(-) diff --git a/kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/DataNeedMapper.xml b/kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/DataNeedMapper.xml index 59a3051..91a5abd 100644 --- a/kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/DataNeedMapper.xml +++ b/kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/DataNeedMapper.xml @@ -74,6 +74,12 @@ <if test="p.createTime != null and p.createTime !=''"> and create_time = #{p.createTime} </if> + <if test="p.createTimeBegin != null and p.createTimeBegin !=''"> + and create_time >= #{p.createTimeBegin} + </if> + <if test="p.createTimeEnd != null and p.createTimeEnd !=''"> + and create_time <= #{p.createTimeEnd} + </if> <if test="p.updateTime != null and p.updateTime !=''"> and update_time = #{p.updateTime} </if> diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/dataNeed.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/dataNeed.html index daaa6c0..67ec24c 100644 --- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/dataNeed.html +++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/dataNeed.html @@ -126,10 +126,30 @@ var laydate = layui.laydate; //执行一个laydate实例 laydate.render({ - elem: '#test1' //指定元素 + elem: '#test1', //指定元素 + done: function (value, date, endDate) { + var startDate = new Date(value).getTime(); + var endTime = new Date($('#test2').val()).getTime(); + if (endTime < startDate) { + layer.msg('结束时间不能小于开始时间'); + $('#test1').val($('#test2').val()); + } else { + $('#custom_beginTime').val($("#test1").val()) + } + } }); laydate.render({ - elem: '#test2' //指定元素 + elem: '#test2', //指定元素 + done: function (value, date, endDate) { + var startDate = new Date($('#test1').val()).getTime(); + var endTime = new Date(value).getTime(); + if (endTime < startDate) { + layer.msg('结束时间不能小于开始时间'); + $('#test2').val($('#test1').val()); + } else { + $('#custom_endTime').val($("#test2").val()) + } + } }); // 渲染表格 @@ -148,7 +168,8 @@ { field: 'needType',align:'center', width: 100, title: '数据类型', templet: function (d) { if (d.needType == 1) { return '筛查' } else { return '就诊' } } },// 0就诊数据 1筛查 { field: 'needTags',align:'center', width: 100, align: 'center', toolbar: '#app-table-bar', title: '需求标签' }, { field: 'enabled',align:'center', width: 200, toolbar: '#app-table-bar1', title: '处理状态', }, - { field: 'downTime',align:'center', width: 250, title: '下载时间', templet: "<div>{{layui.util.toDateString(d.downTime, 'yyyy-MM-dd HH:mm')}}</div>" } + { field: 'downTime',align:'center', width: 250, title: '下载时间', templet: "<div>{{layui.util.toDateString(d.downTime, 'yyyy-MM-dd HH:mm')}}</div>" }, + { field: 'creatTime',align:'center', width: 250, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.creatTime, 'yyyy-MM-dd')}}</div>" } ]],done:function(res){ permissionsInput(res,config); } @@ -212,17 +233,17 @@ // 搜索按钮点击事件 $('#app-btn-search').click(function () { var key = $('#app-edit-search').val(); - var needBegintime = $('#test1').val(); - var needEndtime = $('#test2').val(); - if (needBegintime != null && needEndtime != null) { - var flag = compareDate(needBegintime, needEndtime); + var createTimeBegin = $('#test1').val(); + var createTimeEnd = $('#test2').val(); + if (createTimeBegin != null && createTimeEnd != null) { + var flag = compareDate(createTimeBegin, createTimeEnd); if (!flag) { layer.msg('结束时间不得小于开始时间'); return; } } - table.reload('app-table', { where: { doctorName: key, needBegintime: needBegintime, needEndtime: needEndtime },page: {curr: 1 } }); + table.reload('app-table', { where: { doctorName: key, createTimeBegin: createTimeBegin, createTimeEnd: createTimeEnd },page: {curr: 1 } }); }); //比较日期大小 function compareDate(logintime, logouttime) { diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html index 129af3e..c0d16cd 100644 --- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html +++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html @@ -80,12 +80,12 @@ <div class="layui-row"> <div class="layui-col-sm6"> <label class="layui-form-label">当前软件服务周期:</label> - <div class="layui-input-block" > + <div class="layui-input-block"> <input autocomplete="off" name="contractBeginTime_not" disabled id="contractBeginTime_not" type="text" placeholder="请输开始时间" class="layui-input" maxlength="50" readonly style="border: none; display: inline-block;width: 30%;" /> - <span id="contractBeginTime_not_heng"> 至 </span> + <span id="contractBeginTime_not_heng"> 至 </span> <input autocomplete="off" name="contractEndTime_not" disabled id="contractEndTime_not" type="text" placeholder="请输入结束时间" class="layui-input" maxlength="50" readonly @@ -137,6 +137,17 @@ </div> </div> </div> + <div class="layui-form-item" style="margin: 10px 0px 0px 0px;"> + <div class="layui-row"> + <div class="layui-col-sm6"> + <label class="layui-form-label">签订日期</label> + <div class="layui-input-block"> + <input autocomplete="off" name="contractTime" id="contractTime" type="text" + class="layui-input" maxlength="50" lay-verify="required" style="display: inline-block;width: 40%;" required /> + </div> + </div> + </div> + </div> </div> </div> </div> @@ -169,13 +180,14 @@ <label class="layui-form-label">读片充值量:</label> <div class="layui-input-inline"> <input autocomplete="off" id="custom_ailightCount" - onkeyup="this.value=this.value.replace(/[^\d]/g,'') " type="text" + onkeyup="this.value=this.value.replace(/[^\d]/g,'') " type="text" class="layui-input" maxlength="50" /> </div> </div> <div class="layui-col-sm6"> <div class="layui-input-inline"> - <input type="checkbox" id="custom_isShare" name="gongxiang" value="1" lay-skin="primary" title="是否共享" /> + <input type="checkbox" id="custom_isShare" name="gongxiang" value="1" + lay-skin="primary" title="是否共享" /> </div> </div> </div> @@ -184,8 +196,8 @@ <div class="layui-row"> <div class="layui-col-sm12"> <div class="layui-input-inline" style="width: 160px;text-align: right;"> - <input type="checkbox" id="termType" lay-skin="primary" name="termType" value="true" checked - title="期限限制" /> + <input type="checkbox" id="termType" lay-skin="primary" name="termType" value="true" + checked title="期限限制" /> </div> <div class="layui-col-sm4" style="margin-right: 30px;"> <input autocomplete="off" id="custom_beginTime" type="text" placeholder="请输开始时间" @@ -262,7 +274,7 @@ //充值进行中 var isRun = false; //执行一个laydate实例 - var contractBeginTime= laydate.render({ + var contractBeginTime = laydate.render({ elem: '#contractBeginTime', //指定元素 done: function (value, date, endDate) { var startDate = new Date(value).getTime(); @@ -270,11 +282,11 @@ if (endTime <= startDate) { layer.msg('结束时间不能小于或等于开始时间'); var end = new Date($('#contractEndTime').val()) - end.setDate(end.getDate()-1) + end.setDate(end.getDate() - 1) $('#contractBeginTime').val(util.toDateString(end, "yyyy-MM-dd")); } else { - var flag=termTypeTime(); - if(!false){ + var flag = termTypeTime(); + if (!flag) { return false; } $('#custom_beginTime').val($("#contractBeginTime").val()) @@ -298,15 +310,33 @@ if (endTime <= startDate) { layer.msg('结束时间不能小于或等于开始时间'); var begin = new Date($('#contractBeginTime').val()) - begin.setDate(begin.getDate()+1) + begin.setDate(begin.getDate() + 1) $('#contractEndTime').val(util.toDateString(begin, "yyyy-MM-dd")); // $('#contractEndTime').val($('#contractBeginTime').val()); } else { - var flag=termTypeTime(); - if(!false){ + var flag = termTypeTime(); + if (!flag) { return false; } $('#custom_endTime').val($("#contractEndTime").val()) + //将自定义的开始时间都限制 + custom_beginTimes.config.min = { + year: layui.util.toDateString(begin, "yyyy"), + month: layui.util.toDateString(begin, "MM") - 1,//关键 + date: layui.util.toDateString(begin, "dd"), + hours: layui.util.toDateString(begin, "HH"), + minutes: layui.util.toDateString(begin, "mm"), + seconds: layui.util.toDateString(begin, "ss") + } + custom_beginTimes.config.max = { + year: date.year, + month: date.month - 1,//关键 + date: date.date, + hours: date.hours, + minutes: date.minutes, + seconds: date.seconds + } + //将自定义的结束时间都限制 custom_endTimes.config.max = { year: date.year, month: date.month - 1,//关键 @@ -328,43 +358,48 @@ } } }); - function termTypeTime(){ + function termTypeTime() { var listData = admin.getTempData("t_tempProduct"); - var max= ""; - var min= ''; - if(listData!=null&&listData.length>0){ - - listData.forEach((element,index) => { - if(index==0){ - max=element.endTime; - min=element.beginTime; - }else{ + var max = ""; + var min = ''; + if (listData != null && listData.length > 0) { + + listData.forEach((element, index) => { + if (index == 0) { + max = element.endTime; + min = element.beginTime; + } else { if (dateUtil.compareDate(min, element.beginTime)) { - min=element.beginTime; + min = element.beginTime; } - if (dateUtil.compareDate( element.endTime,max)) { - max=element.endTime; + if (dateUtil.compareDate(element.endTime, max)) { + max = element.endTime; } } - + }); + } else { + return true; } - if(dateUtil.compareDate( $('#contractBeginTime').val(),min)){ + if (dateUtil.compareDate($('#contractBeginTime').val(), min)) { layer.msg("合同的时间必须小于待充值的开始时间") $('#contractBeginTime').val(contractBeginTime_cheng); return false; - }else{ - contractBeginTime_cheng=$('#contractBeginTime').val() + } else { + contractBeginTime_cheng = $('#contractBeginTime').val() } - if(dateUtil.compareDate(max, $('#contractEndTime').val())){ + if (dateUtil.compareDate(max, $('#contractEndTime').val())) { layer.msg("合同的时间必须小于待充值的开始时间") $('#contractEndTime').val(contractEndTime_cheng); return false; - }else{ - contractEndTime_cheng=$('#contractEndTime').val() + } else { + contractEndTime_cheng = $('#contractEndTime').val() } } + laydate.render({ + elem: '#contractTime' //指定元素 + }); laydate.render({ elem: '#contractBeginTime_not' //指定元素 }); @@ -500,13 +535,13 @@ admin.req('api-opration/productorderdetail/getContractBeginEndTimeAndNum', { departmentId: departmentId }, function (data) { if (data.code == 0) { - if(data.data.beginTime==undefined){ + if (data.data.beginTime == undefined) { $("#contractBeginTime_not").hide(); $("#contractEndTime_not").hide(); $("#contractBeginTime_not_heng").hide(); $("#contractNum_not").hide(); form.render(); - }else{ + } else { $("#contractBeginTime_not").val(layui.util.toDateString(data.data.beginTime, "yyyy-MM-dd")); $("#contractEndTime_not").val(layui.util.toDateString(data.data.endTime, "yyyy-MM-dd")); $("#contractBeginTime").val(layui.util.toDateString(data.data.beginTime, "yyyy-MM-dd")); @@ -563,7 +598,7 @@ minutes: layui.util.toDateString(data.data.endTime, "mm"), seconds: layui.util.toDateString(data.data.endTime, "ss") } - $("#contractNum_not").val(data.data.count); + $("#contractNum_not").val(data.data.count); } } @@ -715,7 +750,7 @@ var listNum = 0; if (!strUtil.isEmpty(listData)) { listData.forEach(item => { - if(item.proType==1){ + if (item.proType == 1) { listNum += item.ailightCount; } }) @@ -727,7 +762,7 @@ } else { contractNum = $("#contractNum").val(); //将自定义的读片量赋值 - $("#custom_ailightCount").val($("#contractNum").val()-listNum); + $("#custom_ailightCount").val($("#contractNum").val() - listNum); } }) //自定义的确定 @@ -840,14 +875,14 @@ //将所选的时间不得大于 合同的时间 var contractBeginTime = $("#contractBeginTime").val(); var contractEndTime = $("#contractEndTime").val(); - if (!strUtil.isEmpty(data.beginTime)){ - if (dateUtil.compareDate( contractBeginTime,data.beginTime)) { + if (!strUtil.isEmpty(data.beginTime)) { + if (dateUtil.compareDate(contractBeginTime, data.beginTime)) { layer.msg("开始时间必须大于合同的开始时间!"); return false; } } - if (!strUtil.isEmpty(data.endTime)){ - if (dateUtil.compareDate(data.endTime,contractEndTime)) { + if (!strUtil.isEmpty(data.endTime)) { + if (dateUtil.compareDate(data.endTime, contractEndTime)) { layer.msg("结束时间必须小于合同的结束时间!"); return false; } @@ -871,17 +906,17 @@ } }); //将自定义的数量重新赋值 - function zidingyiNum(){ + function zidingyiNum() { var listData = admin.getTempData("t_tempProduct"); var listNum = 0; if (!strUtil.isEmpty(listData)) { listData.forEach(item => { - if(item.proType==1){ + if (item.proType == 1) { listNum += item.ailightCount; } }) } - $("#custom_ailightCount").val($("#contractNum").val()-listNum); + $("#custom_ailightCount").val($("#contractNum").val() - listNum); } function isthenNum(num) { if (num <= 0) { @@ -891,7 +926,7 @@ var listNum = 0; if (!strUtil.isEmpty(listData)) { listData.forEach(item => { - if(item.proType==1){ + if (item.proType == 1) { listNum += item.ailightCount; } }) @@ -984,120 +1019,120 @@ layer.load(2); var listData = admin.getTempData("t_tempProduct"); // if (listData != null) { - var count= 0; - if(listData!=null){ - listData.forEach(element => { - if(element.proType==1){ - count+=element.ailightCount; - } - }); - } - if(count!=data.field.contractNum){ - layer.closeAll('loading'); - layer.msg("合同读片充值量与套餐充值量不一致") - return false; - } - if (data.field != null) { - var len=listData!=null&&listData.length>0 ? listData.length : 0 - layer.confirm("确定要将待充值列表中的" + len + "个产品充值给当前医院的科室吗?", { - btn: ["确定", "返回"] - }, function () { - isRun = true; - data.field.contractBeginTime = data.field.contractBeginTime + - " 00:00:00"; - data.field.contractEndTime = data.field.contractEndTime + - " 23:59:59"; - // data.field.contractTime = data.field.contractTime + " 00:00:00"; - delete data.field.contractNum_not - delete data.field.contractBeginTime_not - delete data.field.contractEndTime_not - admin.req('api-opration/contract', JSON.stringify(data.field), - function (data) { - layer.closeAll('loading'); - if (data.code === 0) { - var orderData = data.data; - //处理订单明细数据 - var listDetailData = new Array(); - $.each(listData, function (index, item) { - var detailData = { - orderId: orderData.id + '', - proId: item.termType == null ? item.id + '' : "0", - proType: item.proType, - proName: item.proName, - isShare: item.isShare, - ailightCount: item.ailightCount != null ? item.ailightCount : 0, - recordCount: item.recordCount != null ? item.recordCount : 0, - termType: item.termType, - proBegintime: item.beginTime != "" ? item.beginTime + - ' 00:00:00' : "", - proEndtime: item.endTime != "" ? item.endTime + - ' 00:00:00' : "", - orderAilightCount: item.ailightCount, - orderRecordCount: item.recordCount != null ? item.recordCount : 0, - }; - listDetailData.push(detailData); - }) + var count = 0; + if (listData != null) { + listData.forEach(element => { + if (element.proType == 1) { + count += element.ailightCount; + } + }); + } + if (count != data.field.contractNum) { + layer.closeAll('loading'); + layer.msg("合同读片充值量与套餐充值量不一致") + return false; + } + if (data.field != null) { + var len = listData != null && listData.length > 0 ? listData.length : 0 + layer.confirm("确定要将待充值列表中的" + len + "个产品充值给当前医院的科室吗?", { + btn: ["确定", "返回"] + }, function () { + isRun = true; + data.field.contractBeginTime = data.field.contractBeginTime + + " 00:00:00"; + data.field.contractEndTime = data.field.contractEndTime + + " 23:59:59"; + // data.field.contractTime = data.field.contractTime + " 00:00:00"; + delete data.field.contractNum_not + delete data.field.contractBeginTime_not + delete data.field.contractEndTime_not + admin.req('api-opration/contract', JSON.stringify(data.field), + function (data) { + layer.closeAll('loading'); + if (data.code === 0) { + var orderData = data.data; + //处理订单明细数据 + var listDetailData = new Array(); + $.each(listData, function (index, item) { + var detailData = { + orderId: orderData.id + '', + proId: item.termType == null ? item.id + '' : "0", + proType: item.proType, + proName: item.proName, + isShare: item.isShare, + ailightCount: item.ailightCount != null ? item.ailightCount : 0, + recordCount: item.recordCount != null ? item.recordCount : 0, + termType: item.termType, + proBegintime: item.beginTime != "" ? item.beginTime + + ' 00:00:00' : "", + proEndtime: item.endTime != "" ? item.endTime + + ' 00:00:00' : "", + orderAilightCount: item.ailightCount, + orderRecordCount: item.recordCount != null ? item.recordCount : 0, + }; + listDetailData.push(detailData); + }) - if (listDetailData.length <=0) { - var detailData = { - orderId: orderData.id + '', - proId: "0", - proType: 1, - proName: "软件服务周期", - isShare: 0, - ailightCount: 0, - recordCount: 0, - proBegintime: $("#contractBeginTime").val()+' 00:00:00' , - proEndtime: $("#contractEndTime").val()+' 00:00:00' , - orderAilightCount: 0, - orderRecordCount: 0, - }; - listDetailData.push(detailData) - } - //提交订单数据 - admin.req( - 'api-opration/productorderdetail/saveall', - JSON.stringify(listDetailData), - function (data) { - isRun = false; - layer.closeAll('loading'); - if (data.code === 0) { - //现将临时数据清理 - admin.putTempData( - "t_tempProduct", - ""); - layer.msg(data.msg, { - icon: 1, - time: 2000 - }, function () { - admin - .finishPopupCenter(); - }); - } else { - layer.msg(data.msg, { - icon: 2, - time: 1000 - }); - } - }, 'POST'); - // layer.closeAll(); - // layer.msg("充值数据成功!"); - // isRun = false; - } else { - layer.msg(data.msg, { - icon: 2, - time: 1000 - }); - isRun = false; + if (listDetailData.length <= 0) { + var detailData = { + orderId: orderData.id + '', + proId: "0", + proType: 1, + proName: "软件服务周期", + isShare: 0, + ailightCount: 0, + recordCount: 0, + proBegintime: $("#contractBeginTime").val() + ' 00:00:00', + proEndtime: $("#contractEndTime").val() + ' 00:00:00', + orderAilightCount: 0, + orderRecordCount: 0, + }; + listDetailData.push(detailData) } - }, 'POST'); - }) - } else { - layer.msg("数据异常!", { - icon: 2, - time: 1000 - }); - } + //提交订单数据 + admin.req( + 'api-opration/productorderdetail/saveall', + JSON.stringify(listDetailData), + function (data) { + isRun = false; + layer.closeAll('loading'); + if (data.code === 0) { + //现将临时数据清理 + admin.putTempData( + "t_tempProduct", + ""); + layer.msg(data.msg, { + icon: 1, + time: 2000 + }, function () { + admin + .finishPopupCenter(); + }); + } else { + layer.msg(data.msg, { + icon: 2, + time: 1000 + }); + } + }, 'POST'); + // layer.closeAll(); + // layer.msg("充值数据成功!"); + // isRun = false; + } else { + layer.msg(data.msg, { + icon: 2, + time: 1000 + }); + isRun = false; + } + }, 'POST'); + }) + } else { + layer.msg("数据异常!", { + icon: 2, + time: 1000 + }); + } // } else { // layer.msg("请先将要充值的产品加入待充值!", { // icon: 2, -- Gitblit v1.8.0