| | |
| | | import lombok.NoArgsConstructor; |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | |
| | | */ |
| | | @NotEmpty(message = "合同名称不能为空") |
| | | private String contractTitle; |
| | | |
| | | @NotNull(message = "合同名数量不能为空") |
| | | @Min(1) |
| | | private Integer contractNum; |
| | | /** |
| | | * 合同开始时间 |
| | | */ |
| | |
| | | @NotEmpty(message = "产品/明细名称不能为空") |
| | | private String proName; |
| | | /** |
| | | * 产品类型 0试用 1正式 |
| | | * 产品类型 0试用 1正式 3 自定义 |
| | | */ |
| | | @NotNull(message = "产品类型不能为空") |
| | | private Integer proType; |
| | | /** |
| | | * 产品使用期限限制 1有限制,0 无限制 |
| | | */ |
| | | private Integer termType; |
| | | /** |
| | | * 是否共享 0否 1是 |
| | | */ |
| | | @NotEmpty(message = "是否共享不能为空") |
| | |
| | | oAuth2Authentication.setAuthenticated(true); |
| | | ResponseUtil.responseSucceed(objectMapper, response, oAuth2AccessToken); |
| | | } catch (BadCredentialsException | InternalAuthenticationServiceException e) { |
| | | e.printStackTrace();//添加日志的打印功能 |
| | | e.printStackTrace(); |
| | | exceptionHandler(response, badCredenbtialsMsg); |
| | | } catch (Exception e) { |
| | | exceptionHandler(response, e); |
| | |
| | | <div class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline" style="margin-bottom: -25px;">  |
| | | <input id="hospital-search-value" class="layui-input search-input" type="text" placeholder="按医院名" autocomplete="off" width="400px" /></div>  |
| | | <button id="contract-btn-search" class="layui-btn icon-btn permissions" permissions="contract-list" style="margin-bottom: -25px;"><i class="layui-icon"></i>搜索</button> |
| | | <input id="hospital-search-value" class="layui-input search-input" type="text" placeholder="按医院名" |
| | | autocomplete="off" width="400px" /></div>  |
| | | <button id="contract-btn-search" class="layui-btn icon-btn permissions" permissions="contract-list" |
| | | style="margin-bottom: -25px;"><i class="layui-icon"></i>搜索</button> |
| | | </div> |
| | | <table class="layui-table" id="contract-table" lay-filter="contract-table"></table> |
| | | </div> |
| | | <table class="layui-table" id="contract-table" lay-filter="contract-table"></table> |
| | | </div></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <input id="hospitalId" type="hidden" /> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="contract-table-bar"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="contract-del" lay-event="del">删除</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="productorderdetail-save" lay-event="detail">查看套餐</a> |
| | | <!-- <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="contract-del" lay-event="del">删除</a> --> |
| | | <a class="layui-btn layui-btn-xs permissions" permissions="contract-edit" lay-event="edit"">修改</a> |
| | | <a class=" layui-btn layui-btn-primary layui-btn-xs permissions" permissions="productorderdetail-save" |
| | | lay-event="detail">查看套餐</a> |
| | | </script> |
| | | <!-- 表格状态列 --> |
| | | <script type="text/html" id="contract-tpl-state"> |
| | |
| | | { field: 'departmentName', width: 200, title: '科室名称' }, |
| | | { field: 'contractNo', width: 150, title: '合同编号' }, |
| | | { field: 'contractTitle', width: 200, title: '合同名' }, |
| | | { field: 'contractBeginTime', width: 120, title: '合同生效时间',templet:function(d) |
| | | { |
| | | return new Date(d.contractBeginTime).dateFormat("yyyy/MM/dd"); |
| | | } |
| | | field: 'contractBeginTime', width: 120, title: '合同生效时间', templet: function (d) { |
| | | return new Date(d.contractBeginTime).dateFormat("yyyy/MM/dd"); |
| | | } |
| | | }, |
| | | { field: 'contractEndTime', width: 120, title: '合同到期时间',templet:function(d){ |
| | | return new Date(d.contractEndTime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | { field: 'contractTime', width: 120, title: '合同签订时间',templet:function(d){ |
| | | return new Date(d.contractTime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | { |
| | | field: 'contractEndTime', width: 120, title: '合同到期时间', templet: function (d) { |
| | | return new Date(d.contractEndTime).dateFormat("yyyy/MM/dd"); |
| | | } |
| | | }, |
| | | { |
| | | field: 'contractTime', width: 120, title: '合同签订时间', templet: function (d) { |
| | | return new Date(d.contractTime).dateFormat("yyyy/MM/dd"); |
| | | } |
| | | }, |
| | | // { field: 'enabled', width: 120, templet: '#contract-tpl-state', sort: true, title: '状态' }, |
| | | { field: 'createTime', width: 160, title: '创建时间' , templet: function (d) { |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm"); |
| | | }}, |
| | | { align: 'center', width: 150, toolbar: '#contract-table-bar', title: '操作', |
| | | fixed: 'right'} |
| | | { |
| | | field: 'createTime', width: 160, title: '创建时间', templet: function (d) { |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm"); |
| | | } |
| | | }, |
| | | { |
| | | align: 'center', width: 150, toolbar: '#contract-table-bar', title: '操作', |
| | | fixed: 'right' |
| | | } |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | done: function (res) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | } |
| | |
| | | }, 'DELETE'); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | else if (obj.event === 'edit') { |
| | | //修改 |
| | | updateModel(obj.data); |
| | | } else if (obj.event === 'detail') { |
| | | //充值记录列表 |
| | | showModel(obj.data.id); |
| | | } |
| | | }); |
| | |
| | | // 搜索按钮点击事件 |
| | | $('#contract-btn-search').click(function () { |
| | | var hospitalName = $('#hospital-search-value').val(); |
| | | if(strUtil.isEmpty(hospitalName)) |
| | | { |
| | | if (strUtil.isEmpty(hospitalName)) { |
| | | $("#hospitalId").val(""); |
| | | } |
| | | table.reload('contract-table', { |
| | | where: { hospitalId: $("#hospitalId").val()}, |
| | | table.reload('contract-table', { |
| | | where: { hospitalId: $("#hospitalId").val() }, |
| | | page: { |
| | | curr: 1 |
| | | } }); |
| | | curr: 1 |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | var showModel=function(orderId){ |
| | | layer.open({ |
| | | type:1, |
| | | title:'查看产品', |
| | | area: '1200px', |
| | | offset: '100px', |
| | | content: $('#contract-model').html(), |
| | | success:function(){ |
| | | table.render({ |
| | | elem: '#contract-table-detail', |
| | | url: config.base_server + 'api-opration/productorderrecord', |
| | | method: 'GET', |
| | | where:{'orderId':orderId}, |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | limit:10, |
| | | limits:[5,10], |
| | | cols: [[ |
| | | { field: 'proName', width: 300, title: '产品名称' }, |
| | | { field: 'ailightCount', width: 150, title: '读片量' }, |
| | | { field: 'recordCount', width: 100, title: '报告量' }, |
| | | { field: 'isShare', width: 150, title: '是否共享',templet:function(d) |
| | | { |
| | | if(d.isShare) |
| | | return '共享' |
| | | else |
| | | return '私有' |
| | | } |
| | | }, |
| | | { field: 'proBegintime', width: 150, title: '开始时间',templet:function(d){ |
| | | return new Date(d.proBegintime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | { field: 'proEndtime', width: 180, title: '结束时间',templet:function(d){ |
| | | return new Date(d.proEndtime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | { field: 'createTime', width: 160, sort: true, title: '创建时间' } |
| | | ]] |
| | | var showModel = function (orderId) { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '查看产品', |
| | | area: '1200px', |
| | | offset: '100px', |
| | | content: $('#contract-model').html(), |
| | | success: function () { |
| | | table.render({ |
| | | elem: '#contract-table-detail', |
| | | url: config.base_server + 'api-opration/productorderrecord', |
| | | method: 'GET', |
| | | where: { 'orderId': orderId }, |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | limit: 10, |
| | | limits: [5, 10], |
| | | cols: [[ |
| | | { field: 'proName', width: 300, title: '产品名称' }, |
| | | { field: 'ailightCount', width: 150, title: '读片量' }, |
| | | { field: 'recordCount', width: 100, title: '报告量' }, |
| | | { |
| | | field: 'isShare', width: 150, title: '是否共享', templet: function (d) { |
| | | if (d.isShare) |
| | | return '共享' |
| | | else |
| | | return '私有' |
| | | } |
| | | }, |
| | | { |
| | | field: 'proBegintime', width: 150, title: '开始时间', templet: function (d) { |
| | | return new Date(d.proBegintime).dateFormat("yyyy/MM/dd"); |
| | | } |
| | | }, |
| | | { |
| | | field: 'proEndtime', width: 180, title: '结束时间', templet: function (d) { |
| | | return new Date(d.proEndtime).dateFormat("yyyy/MM/dd"); |
| | | } |
| | | }, |
| | | { field: 'createTime', width: 160, sort: true, title: '创建时间' } |
| | | ]] |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | var updateModel = function (data) { |
| | | //修改充值记录 |
| | | admin.putTempData("t_hospital", data); |
| | | admin.popupCenter({ |
| | | title: '修改合同', |
| | | path: 'pages/opration/rechargeupdate.html', |
| | | area: '1200px', |
| | | offset: '0px', |
| | | finish: function () { |
| | | $('#hospita-btn-search').click(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | } |
| | | }); |
| | | } else if(layEvent=="health"){ |
| | | //充值 |
| | | //运动处方服务 |
| | | admin.putTempData("t_hospital", data); |
| | | admin.popupCenter({ |
| | | title: '运动处方服务', |
| | |
| | | </div> |
| | | <div class="layui-form-item" style="padding: 0; margin-bottom: 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm4"> |
| | | <div class="layui-col-sm6"> |
| | | <label class="layui-form-label" style="padding: 10px 30px 0 0px;">合同名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="contractTitle" id="contractTitle" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required autocomplete="off" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <div class="layui-col-sm6"> |
| | | <label class="layui-form-label">合同编号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="contractNo" id="contractNo" type="text" class="layui-input" |
| | | maxlength="50" style="width: 185px;" autocomplete="off" lay-verify="required" |
| | | required /> |
| | | maxlength="50" autocomplete="off" lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="margin: 10px 0px 0px 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label" style="padding: 10px 30px 0 0px;">开始日期</label> |
| | | <input autocomplete="off" name="contractBeginTime" id="contractBeginTime" type="text" |
| | | class="layui-input" style="width: 182px;" maxlength="50" lay-verify="required" |
| | | required /> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">截止日期</label> |
| | | <div class="layui-input-block"> |
| | | <input autocomplete="off" name="contractEndTime" id="contractEndTime" type="text" |
| | | class="layui-input" maxlength="50" lay-verify="required" required /> |
| | | <div class="layui-col-sm6"> |
| | | <label class="layui-form-label">当前软件服务周期:</label> |
| | | <div class="layui-col-sm4" style="margin-right: 30px;"> |
| | | <input autocomplete="off" name="contractBeginTime_not" disabled id="contractBeginTime_not" |
| | | type="text" placeholder="请输开始时间" class="layui-input" maxlength="50"/> |
| | | </div> |
| | | <div class="layui-col-sm4 "> |
| | | <input autocomplete="off" name="contractEndTime_not" disabled id="contractEndTime_not" type="text" |
| | | placeholder="请输入结束时间" class="layui-input" maxlength="50" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <div class="layui-col-sm6"> |
| | | <label class="layui-form-label">当前读片总量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input autocomplete="off" name="contractNum_not" id="contractNum_not" disabled type="text" class="layui-input" maxlength="50" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <!-- <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" required /> |
| | | </div> |
| | | </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> |
| | | <!-- <input autocomplete="off" name="contractBeginTime" id="contractBeginTime" type="text" |
| | | class="layui-input" maxlength="50" lay-verify="required" |
| | | required /> --> |
| | | <!-- <input autocomplete="off" name="contractEndTime" id="contractEndTime" type="text" |
| | | class="layui-input" maxlength="50" lay-verify="required" required /> --> |
| | | |
| | | <div class="layui-col-sm4" style="margin-right: 30px;"> |
| | | <input autocomplete="off" name="contractBeginTime" id="contractBeginTime" |
| | | type="text" placeholder="请输开始时间" class="layui-input" maxlength="50" |
| | | lay-verify="required" required /> |
| | | </div> |
| | | <div class="layui-col-sm4 "> |
| | | <input autocomplete="off" name="contractEndTime" id="contractEndTime" type="text" |
| | | placeholder="请输入结束时间" class="layui-input" maxlength="50" lay-verify="required" |
| | | required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm6"> |
| | | <label class="layui-form-label">合同读片充值量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input autocomplete="off" name="contractNum" id="contractNum" onkeyup="this.value=this.value.replace(/[^\d]/g,'') " type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="layui-tab" style="margin: 0px;"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">产品信息</li> |
| | | <li class="layui-this">套餐列表</li> |
| | | <li>自定义充值</li> |
| | | </ul> |
| | | <div class="layui-tab-content" style="margin: -10px 0px -10px 0px;"> |
| | | <div class="layui-tab-item layui-show" style="padding-top: 0px;"> |
| | | <table class="layui-table" id="product-table" lay-filter="product-table" style="margin: 0px;"> |
| | | </table> |
| | | </div> |
| | | <div class="layui-tab-item"> |
| | | <div class="layui-form-item" style="margin: 10px 0px 0px 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm12"> |
| | | <label class="layui-form-label">充值名称:</label> |
| | | <div class="layui-input-inline"> |
| | | <input autocomplete="off" id="custom_proName" type="text" class="layui-input" maxlength="50" |
| | | value="1000" lay-verify="required" required /> |
| | | </div> |
| | | </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-inline"> |
| | | <input autocomplete="off" id="custom_ailightCount" onkeyup="this.value=this.value.replace(/[^\d]/g,'') " type="text" class="layui-input" maxlength="50" |
| | | value="1000" lay-verify="required" required />张 |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm6"> |
| | | <div class="layui-input-inline"> |
| | | <input type="radio" id="custom_isShare" name="gongxiang" value="1" title="是否共享" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="margin: 10px 0px 0px 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm6"> |
| | | <div class="layui-input-inline"> |
| | | <input type="radio" id="termType" name="termType" value="true" title="期限限制" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm6"> |
| | | <div class="layui-col-sm4" style="margin-right: 30px;"> |
| | | <input autocomplete="off" id="custom_beginTime" |
| | | type="text" placeholder="请输开始时间" class="layui-input" maxlength="50"/> |
| | | </div> |
| | | <div class="layui-col-sm4 "> |
| | | <input autocomplete="off" type="text" |
| | | placeholder="请输入结束时间" id="custom_endTime" class="layui-input" maxlength="50" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-input-block" style="width: 50;"> |
| | | <input class="layui-btn" type="button" id="custom_submit" value="确定" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <input type="checkbox" lay-filter="product-tpl-isShare" value="{{d.id}}" lay-skin="switch" lay-text="共享|不共享" /> |
| | | </script> |
| | | <script> |
| | | layui.use(['form', 'table', 'util', 'config', 'laydate', 'admin'], function () { |
| | | layui.use(['form', 'table', 'util', 'config', 'laydate', 'jquery','admin'], function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var config = layui.config; |
| | | var layer = layui.layer; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | // element=layui.element; |
| | | var $ = layui.jquery; |
| | | var laydate = layui.laydate; |
| | | |
| | | var contractNum=0; |
| | | |
| | | //充值进行中 |
| | | var isRun = false; |
| | | //执行一个laydate实例 |
| | | laydate.render({ |
| | | elem: '#contractBeginTime' //指定元素 |
| | | elem: '#contractBeginTime', //指定元素 |
| | | done: function (value, date, endDate) { |
| | | var startDate = new Date(value).getTime(); |
| | | var endTime = new Date($('#contractEndTime').val()).getTime(); |
| | | if (endTime < startDate) { |
| | | layer.msg('结束时间不能小于开始时间'); |
| | | $('#contractBeginTime').val($('#contractEndTime').val()); |
| | | } |
| | | } |
| | | }); |
| | | laydate.render({ |
| | | elem: '#contractEndTime' //指定元素 |
| | | elem: '#contractEndTime', //指定元素 |
| | | done: function (value, date, endDate) { |
| | | var startDate = new Date($('#contractBeginTime').val()).getTime(); |
| | | var endTime = new Date(value).getTime(); |
| | | if (endTime < startDate) { |
| | | layer.msg('结束时间不能小于开始时间'); |
| | | $('#contractEndTime').val($('#contractBeginTime').val()); |
| | | } |
| | | } |
| | | }); |
| | | laydate.render({ |
| | | elem: '#contractTime', //指定元素 |
| | | value: new Date().dateFormat("yyyy-MM-dd") |
| | | elem: '#contractBeginTime_not' //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: '#contractEndTime_not' //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: '#custom_beginTime', //指定元素 |
| | | done: function (value, date, endDate) { |
| | | var startDate = new Date(value).getTime(); |
| | | var endTime = new Date($('#custom_endTime').val()).getTime(); |
| | | if (endTime < startDate) { |
| | | layer.msg('结束时间不能小于开始时间'); |
| | | $('#custom_beginTime').val($('#custom_endTime').val()); |
| | | } |
| | | } |
| | | }); |
| | | laydate.render({ |
| | | elem: '#custom_endTime', //指定元素 |
| | | done: function (value, date, endDate) { |
| | | var startDate = new Date($('#custom_beginTime').val()).getTime(); |
| | | var endTime = new Date(value).getTime(); |
| | | if (endTime < startDate) { |
| | | layer.msg('结束时间不能小于开始时间'); |
| | | $('#custom_endTime').val($('#custom_beginTime').val()); |
| | | } |
| | | } |
| | | }); |
| | | //现将临时数据清理 |
| | | admin.putTempData("t_tempProduct", ""); |
| | |
| | | cellMinWidth: 100, |
| | | cols: [ |
| | | [{ |
| | | field: 'proName', |
| | | width: 330, |
| | | title: '产品名称', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | field: 'proName', |
| | | width: 330, |
| | | title: '产品名称', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'proType', |
| | | align: 'center', |
| | | width: 80, |
| | | templet: function (d) { |
| | | if (d.proType === 0) |
| | | return "试用" |
| | | else |
| | | return "正式" |
| | | }, |
| | | { |
| | | field: 'proType', |
| | | align: 'center', |
| | | width: 80, |
| | | templet: function (d) { |
| | | if (d.proType === 0) |
| | | return "试用" |
| | | else |
| | | return "正式" |
| | | }, |
| | | title: '类型' |
| | | }, |
| | | { |
| | | field: 'proTime', |
| | | width: 100, |
| | | title: '时长', |
| | | align: 'center', |
| | | templet: function (d) { |
| | | switch (d.proTimeUnit) { |
| | | case 0: |
| | | return d.proTime + "天"; |
| | | break; |
| | | case 1: |
| | | return d.proTime + "月"; |
| | | break; |
| | | case 2: |
| | | return d.proTime + "年"; |
| | | break; |
| | | } |
| | | title: '类型' |
| | | }, |
| | | { |
| | | field: 'proTime', |
| | | width: 100, |
| | | title: '时长', |
| | | align: 'center', |
| | | templet: function (d) { |
| | | switch (d.proTimeUnit) { |
| | | case 0: |
| | | return d.proTime + "天"; |
| | | break; |
| | | case 1: |
| | | return d.proTime + "月"; |
| | | break; |
| | | case 2: |
| | | return d.proTime + "年"; |
| | | break; |
| | | } |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '读片量' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告量' |
| | | }, |
| | | { |
| | | field: 'beginTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '开始日期' |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '结束日期' |
| | | }, |
| | | { |
| | | field: 'isShare', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | templet: function (d) { |
| | | if (d.isShare == 0) |
| | | return "不共享" |
| | | else |
| | | return "共享" |
| | | }, |
| | | title: '共享' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | toolbar: '#product-tpl-bar-temp', |
| | | title: '操作' |
| | | return ""; |
| | | } |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '读片量' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告量' |
| | | }, |
| | | { |
| | | field: 'beginTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '开始日期' |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '结束日期' |
| | | }, |
| | | { |
| | | field: 'isShare', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | templet: function (d) { |
| | | if (d.isShare == 0) |
| | | return "不共享" |
| | | else |
| | | return "共享" |
| | | }, |
| | | title: '共享' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | toolbar: '#product-tpl-bar-temp', |
| | | title: '操作' |
| | | } |
| | | ] |
| | | ] |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | //回显医院基本数据 |
| | | let hospitalData = admin.getTempData('t_hospital'); |
| | | if (hospitalData != null) { |
| | |
| | | if (0 === data.code) { |
| | | queryData = data.data; |
| | | if (queryData === true) { |
| | | admin.finishPopupCenter(); |
| | | admin.finishPopupCenter(); |
| | | layer.msg("当前科室开通了单次支付功能,不能进行充值业务!", { |
| | | icon: 3, |
| | | time: 5000 |
| | |
| | | }, |
| | | cols: [ |
| | | [{ |
| | | field: 'proName', |
| | | sort: true, |
| | | width: 330, |
| | | title: '产品名称', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | field: 'proName', |
| | | sort: true, |
| | | width: 330, |
| | | title: '产品名称', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'proType', |
| | | sort: true, |
| | | align: 'center', |
| | | width: 80, |
| | | templet: function (d) { |
| | | if (d.proType === 0) |
| | | return "试用" |
| | | else |
| | | return "正式" |
| | | }, |
| | | { |
| | | field: 'proType', |
| | | sort: true, |
| | | align: 'center', |
| | | width: 80, |
| | | templet: function (d) { |
| | | if (d.proType === 0) |
| | | return "试用" |
| | | else |
| | | return "正式" |
| | | }, |
| | | title: '类型' |
| | | }, |
| | | { |
| | | field: 'proTime', |
| | | width: 100, |
| | | title: '时长', |
| | | align: 'center', |
| | | templet: function (d) { |
| | | switch (d.proTimeUnit) { |
| | | case 0: |
| | | return d.proTime + "天"; |
| | | break; |
| | | case 1: |
| | | return d.proTime + "月"; |
| | | break; |
| | | case 2: |
| | | return d.proTime + "年"; |
| | | break; |
| | | } |
| | | title: '类型' |
| | | }, |
| | | { |
| | | field: 'proTime', |
| | | width: 100, |
| | | title: '时长', |
| | | align: 'center', |
| | | templet: function (d) { |
| | | switch (d.proTimeUnit) { |
| | | case 0: |
| | | return d.proTime + "天"; |
| | | break; |
| | | case 1: |
| | | return d.proTime + "月"; |
| | | break; |
| | | case 2: |
| | | return d.proTime + "年"; |
| | | break; |
| | | } |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '读片量' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告量' |
| | | }, |
| | | { |
| | | field: 'beginTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '开始日期', |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '结束日期', |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'isShare', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | templet: '#product-tpl-isShare', |
| | | title: '共享' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | toolbar: '#product-tpl-bar', |
| | | title: '操作' |
| | | } |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '读片量' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告量' |
| | | }, |
| | | { |
| | | field: 'beginTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '开始日期', |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | | align: 'center', |
| | | width: 120, |
| | | title: '结束日期', |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'isShare', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | templet: '#product-tpl-isShare', |
| | | title: '共享' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 100, |
| | | toolbar: '#product-tpl-bar', |
| | | title: '操作' |
| | | } |
| | | ] |
| | | ], |
| | | done: function (res) { |
| | |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | else { |
| | | admin.finishPopupCenter(); |
| | | layer.msg("验证医院科室数据异常!", { |
| | | icon: 2, |
| | | time: 3000 |
| | | }); |
| | | icon: 2, |
| | | time: 3000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | //报告数量事件 |
| | | $("#contractNum").blur(function(){ |
| | | if($("#contractNum").val()<=0){ |
| | | layer.msg("输入的读片量大于0"); |
| | | $("#contractNum").val("") |
| | | return false; |
| | | } |
| | | var listData = admin.getTempData("t_tempProduct"); |
| | | var listNum=0; |
| | | if (!strUtil.isEmpty(listData)) { |
| | | listData.forEach(item =>{ |
| | | listNum+=item.ailightCount; |
| | | }) |
| | | } |
| | | if($("#contractNum").val()<listNum){ |
| | | layer.msg("请先删除待充值套餐"); |
| | | $("#contractNum").val(contractNum) |
| | | return false; |
| | | }else{ |
| | | contractNum=$("#contractNum").val(); |
| | | } |
| | | }) |
| | | //自定义的确定 |
| | | $("#custom_submit").click(function(){ |
| | | var custom_proName=$("#custom_proName").val() |
| | | var custom_ailightCount=$("#custom_ailightCount").val() |
| | | var custom_isShare=$("#custom_isShare").prop("checked") ? 1:0; |
| | | var termType=$("#termType").prop("checked")? 1:0; |
| | | var custom_beginTime=""; |
| | | var custom_endTime=""; |
| | | if(termType==1){ |
| | | custom_beginTime=$("#custom_beginTime").val(); |
| | | custom_endTime=$("#custom_endTime").val(); |
| | | }else{ |
| | | custom_beginTime=$("#contractBeginTime").val(); |
| | | custom_endTime=$("#contractEndTime").val(); |
| | | } |
| | | var listData = admin.getTempData("t_tempProduct"); |
| | | //添加一个id,删除用 |
| | | var max=0; |
| | | if (strUtil.isEmpty(listData)) { |
| | | listData = new Array(); |
| | | } |
| | | listData.forEach(element => { |
| | | if(max<element.id){ |
| | | max=element.id |
| | | } |
| | | }); |
| | | //判断待加入产品的总数是否大于合同的总数 |
| | | var msg=isthenNum(parseInt(custom_ailightCount)); |
| | | if(msg!=null){ |
| | | layer.msg(msg); |
| | | return false; |
| | | } |
| | | |
| | | var data={ |
| | | id: max+1, |
| | | ailightCount: parseInt(custom_ailightCount), |
| | | beginTime: custom_beginTime, |
| | | endTime: custom_endTime, |
| | | isShare: custom_isShare, |
| | | proName: custom_proName, |
| | | proTime: "", |
| | | proType: 1, |
| | | termType: termType |
| | | } |
| | | tempDataList(data); |
| | | waitRecharge(); |
| | | }) |
| | | } |
| | | |
| | | //待充值列表功能操作 |
| | | table.on('tool(product-table-temp)', function (obj) { |
| | | if (obj.event === "del") { |
| | |
| | | "td[data-field='endTime'] div").text(); |
| | | data.isShare = obj.tr.find("td[data-field='isShare'] em").text(); |
| | | data.isShare = (data.isShare.indexOf("不") == 0) ? 0 : 1; |
| | | //判断待加入产品的总数是否大于合同的总数 |
| | | var msg=isthenNum(data.ailightCount); |
| | | if(msg!=null){ |
| | | layer.msg(msg); |
| | | return false; |
| | | } |
| | | if (!strUtil.isEmpty(data.beginTime) && !strUtil.isEmpty(data.endTime)) { |
| | | if (dateUtil.compareDate(data.endTime, data.beginTime)) { |
| | | data.id=data.id+''; |
| | | data.id = data.id + ''; |
| | | tempDataList(data); |
| | | waitRecharge(); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | }); |
| | | function isthenNum(num){ |
| | | if(num<=0){ |
| | | return "请输入读片量大于0"; |
| | | } |
| | | var listData = admin.getTempData("t_tempProduct"); |
| | | var listNum=0; |
| | | if (!strUtil.isEmpty(listData)) { |
| | | listData.forEach(item =>{ |
| | | listNum+=item.ailightCount; |
| | | }) |
| | | } |
| | | listNum+=num; |
| | | if($("#contractNum").val()==undefined||$("#contractNum").val()==""){ |
| | | return "请输入读片量!"; |
| | | }else{ |
| | | if($("#contractNum").val()<listNum){ |
| | | return "当前产品总数不得大于合同总量"; |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | //监听单元格编辑 判断日期格式 |
| | | table.on('edit(product-table)', function (obj) { |
| | | var value = obj.value //得到修改后的值 |
| | |
| | | data = obj.data //得到所在行所有键值 |
| | | , |
| | | field = obj.field; //得到字段 |
| | | if (dateUtil.isDate(value)) {} else { |
| | | if (dateUtil.isDate(value)) { } else { |
| | | layer.msg("输入的日期格式无效!"); |
| | | } |
| | | }); |
| | |
| | | if (strUtil.isEmpty(listData)) { |
| | | listData = new Array(); |
| | | } |
| | | $.each(listData, function (index, value) { |
| | | if (value.id === data.id) { |
| | | //移除 |
| | | listData.splice(index, 1); |
| | | return false; |
| | | } |
| | | }) |
| | | // $.each(listData, function (index, value) { |
| | | // if (value.id === data.id) { |
| | | // //移除 |
| | | // listData.splice(index, 1); |
| | | // return false; |
| | | // } |
| | | // }) |
| | | listData.push(data); |
| | | admin.putTempData("t_tempProduct", listData); |
| | | } else { |
| | |
| | | " 00:00:00"; |
| | | data.field.contractEndTime = data.field.contractEndTime + |
| | | " 23:59:59"; |
| | | data.field.contractTime = data.field.contractTime + " 00:00:00"; |
| | | // 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'); |
| | |
| | | var listDetailData = new Array(); |
| | | $.each(listData, function (index, item) { |
| | | var detailData = { |
| | | orderId: orderData.id+'', |
| | | proId: item.id+'', |
| | | orderId: orderData.id + '', |
| | | proId: item.termType==null? item.id + '': "0", |
| | | proType: item.proType, |
| | | proName: item.proName, |
| | | isShare: item.isShare, |
| | | ailightCount: item.ailightCount, |
| | | recordCount: item.recordCount, |
| | | proBegintime: item.beginTime + |
| | | ' 00:00:00', |
| | | proEndtime: item.endTime + |
| | | ' 23:59:59' |
| | | 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 + |
| | | ' 23:59:59':"" |
| | | }; |
| | | listDetailData.push(detailData); |
| | | }) |