| | |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | Long deptId = getDeptId(); |
| | | boolean signUserId = false; |
| | | boolean signDeptId = false; |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().equals("dept_id")){ |
| | | signDeptId = true; |
| | | } |
| | | } |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else if (entry.getKey().equals("dept_id")){ |
| | | if (!val.equals("19")){ |
| | | wrapper.eq(entry.getKey(), val); |
| | | } |
| | | } else if (entry.getKey().equals("user_id") && !signDeptId){ |
| | | signUserId = true; |
| | | wrapper.eq(entry.getKey(), val); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | if (!signUserId && !signDeptId){ |
| | | wrapper.eq("user_id", getUserId()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/priQuote/add/auth") |
| | |
| | | var cstmrByMore; |
| | | var orderByMore; |
| | | var planByMore; |
| | | var priQuoteByMore; |
| | |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | cascader: 'cascader/cascader', |
| | | }).use(['table','laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function(){ |
| | | }).use(['table','laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown','layer','upload', 'cascader'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | admin = layui.admin; |
| | | var tree = layui.tree; |
| | | var element = layui.element; |
| | | var upload = layui.upload; |
| | | var xmSelect = layui.xmSelect; |
| | | var cascader = layui.cascader; |
| | | var dropdown = layui.dropdown; |
| | | |
| | | $('#organization').html(localStorage.getItem('nickname') + ' <i class="layui-icon"></i>'); |
| | | |
| | | // 部门人员 筛选 |
| | | dropdown.render({ |
| | | elem: '#organization' |
| | | ,content: ['<div id="organizationTree" style="height: calc(100vh - 525px);border: none"></div>'].join('') |
| | | ,style: 'width: 370px; height: 350px; padding: 0 15px; box-shadow: 1px 1px 30px rgb(0 0 0 / 12%);' |
| | | ,ready: function(){ |
| | | loadTree(); |
| | | } |
| | | }); |
| | | |
| | | // 树形图 |
| | | var organizationTree; |
| | | window.loadTree = function(condition){ |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/dept/user/tree/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | 'condition': condition |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | organizationTree = tree.render({ |
| | | elem: '#organizationTree', |
| | | id: 'organizationTree', |
| | | onlyIconControl: true, |
| | | data: res.data, |
| | | click: function (obj) { |
| | | treeCond = { |
| | | key: obj.data.key, |
| | | val: obj.data.id |
| | | } |
| | | $('#organization').html(obj.data.title + ' <i class="layui-icon"></i>'); |
| | | $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click'); |
| | | $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click'); |
| | | clearFormVal($('#search-box')); |
| | | tableIns.reload({ |
| | | where: {[obj.data.key]: obj.data.id}, |
| | | page: {curr: 1} |
| | | }); |
| | | } |
| | | }); |
| | | treeData = res.data; |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'templateName', align: 'center',title: '模板名'} |
| | | ,{field: 'templateName', align: 'center',title: '模板名', width: 220, style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} |
| | | ,{field: 'orderNum', align: 'center',title: '报价预算单号'} |
| | | ,{field: 'inOrderNum', align: 'center',title: '报价编号'} |
| | | ,{field: 'itemId$', align: 'center',title: '项目名'} |
| | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(priQuote)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | console.log(checkStatus) |
| | | switch(obj.event) { |
| | | case 'more': |
| | | top.priQuoteByMore = obj.data.id; |
| | | console.log(top.priQuoteByMore) |
| | | |
| | | admin.popupRight({ |
| | | type: 1, |
| | | window: "top", |
| | | area: "1250px", |
| | | url: "priQuote_more.html", |
| | | end: function () { |
| | | // $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | }) |
| | | break; |
| | | case 'addBlank': |
| | | showEditModel(); |
| | | break; |
| | |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/tree.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/layui/lay/modules/formDesigner/coolForm.css" /> |
| | | <style> |
| | | .nav-box { |
| | | position: absolute; |
| | | top: 1px; |
| | | left: 5px; |
| | | } |
| | | .nav-box-item { |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | .layui-dropdown.layui-border-box.layui-panel.layui-anim.layui-anim-downbit,.layui-dropdown.layui-border-box.layui-panel.layui-anim.layui-anim-downbit * { |
| | | box-sizing:inherit; |
| | | } |
| | | |
| | | .layui-menu li { |
| | | width: inherit; |
| | | } |
| | | .layui-tree-icon { |
| | | height: 16px; |
| | | line-height: 15px; |
| | | width: 15px; |
| | | text-align: center; |
| | | border: 1px solid #c0c4cc; |
| | | } |
| | | |
| | | .site-dropdown-demo, |
| | | .site-dropdown-demo .layui-menu{background: #32363F;border-color: #484e58;} |
| | | .site-dropdown-demo .layui-menu li{color: #a1a8b8;} |
| | | .site-dropdown-demo .layui-menu li:hover{background-color: #32363F;} |
| | | .layui-menu-body-title>.layui-icon { |
| | | position: relative; |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | .layui-form-radio { |
| | | display: block; |
| | | } |
| | | .layui-unselect.layui-form-radio { |
| | | display: inline-block; |
| | | } |
| | | .layui-form-radio:hover *, .layui-form-radioed, .layui-form-radioed>i { |
| | | color: #2d8cf0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div id="search-box" class="layui-form toolbar" style="display: flex;justify-content: flex-end;position: relative"> |
| | | <div class="nav-box"> |
| | | <div class="nav-box-item"> |
| | | <i class="layui-icon" style="color: #1890ff;font-weight: bold"></i> |
| | | </div> |
| | | <div class="nav-box-item"> |
| | | <button id="organization" style="border: none;padding-right: 35px;" class="layui-btn layui-btn-primary icon-btn"> |
| | | 未知 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/layui/lay/modules/cascader/citys-data.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/priQuote/priQuote.js" charset="utf-8"></script> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
New file |
| | |
| | | <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> |
| | | <style> |
| | | #formAdvForm { |
| | | background-color: #f3f3f3; |
| | | } |
| | | #formAdvForm .layui-form-item { |
| | | margin-top: 20px; |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | #formAdvForm .layui-form-item .layui-inline { |
| | | margin-bottom: 25px; |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .form-group-bottom { |
| | | position: fixed; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | padding: 10px 20px; |
| | | background-color: #fff; |
| | | box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05); |
| | | } |
| | | |
| | | .card-body-item { |
| | | display: inline-block; |
| | | border-right: 1px solid #e0e0e0; |
| | | width: 250px; |
| | | padding: 0 30px 0 10px; |
| | | } |
| | | .header-desc { |
| | | overflow:hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | -o-text-overflow:ellipsis; |
| | | } |
| | | |
| | | </style> |
| | | <!-- 正文开始 --> |
| | | <form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%"> |
| | | <div class="layui-fluid" style="padding-bottom: 75px;height: 100%; overflow: scroll;box-sizing: border-box"> |
| | | <!-- 标题 --> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header" style="padding-top: 5px; padding-bottom: 5px"> |
| | | <div> |
| | | <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold"></i> |
| | | <span id="form-name" style="margin: 0 6px;font-size: 18px;font-weight: bold;letter-spacing: 1px"></span> |
| | | <span style="opacity: .5;font-size: small;margin-left: 5px">售前规划申请单</span> |
| | | </div> |
| | | </div> |
| | | <div class="layui-card-body" style="padding: 30px 20px"> |
| | | |
| | | <div class="layui-tab layui-steps"> |
| | | <ul class="layui-tab-title" id="stepBox"> |
| | | </ul> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="layui-row"> |
| | | <!-- 数据 --> |
| | | <div class="layui-col-md9"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header"> |
| | | 基本信息 |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 动态 --> |
| | | <div class="layui-col-md3" style="width: 24%;margin-left: 1%"> |
| | | <!-- 时间线 --> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header"> |
| | | <span>售前规划清单</span> |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <ul class="layui-timeline" id="timelineBox"> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group-bottom text-right"> |
| | | <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 刷新 </button> |
| | | </div> |
| | | |
| | | </form> |
| | | |
| | | <script type="text/html" id="followerTabOperate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <!-- 跟进人 --> |
| | | <script type="text/html" id="followerEditDialog"> |
| | | <form id="followerEditForm" lay-filter="followerEditForm" class="layui-form model-form"> |
| | | <input name="experimentId" type="hidden"/> |
| | | <div class="layui-form-item" style="float: left;clear: none;margin-right: 20px"> |
| | | <label class="layui-form-label">选择成员</label> |
| | | <div class="layui-input-block"> |
| | | <div id="followersBox" name="followersBox"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item text-right" style="float: left;clear: none"> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn" lay-filter="followerSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | <script type="text/template" id="stepTpl"> |
| | | {{#each list}} |
| | | <li id="step-{{step}}" style="pointer-events: none"> |
| | | <i class="layui-icon layui-icon-ok">{{step}}</i> |
| | | <span class="layui-steps-title">{{title}}</span> |
| | | {{# if username}} |
| | | <span class="layui-steps-content">{{username}}</span> |
| | | {{ else }} |
| | | <span class="layui-steps-content"> </span> |
| | | {{/if}} |
| | | </li> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <script type="text/template" id="timelineTpl"> |
| | | {{#each list}} |
| | | <li class="layui-timeline-item"> |
| | | <i class="layui-icon layui-timeline-axis"></i> |
| | | <div class="layui-timeline-content layui-text"> |
| | | <h4 class="layui-timeline-title" style="display: inline;margin-right: 10px;">{{title}}</h4> |
| | | <span>{{time}}</span> |
| | | <p> |
| | | {{msg}} |
| | | </p> |
| | | </div> |
| | | </li> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <script> |
| | | var priQuoteId = top.priQuoteByMore; |
| | | $('.layui-layer-close').hide(); |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | notice: 'notice/notice', |
| | | steps: 'steps/steps', |
| | | }).use(['form', 'table', 'laydate', 'notice', 'xmSelect', 'steps'], function () { |
| | | var $ = layui.jquery; |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var laydate = layui.laydate; |
| | | var notice = layui.notice; |
| | | var xmSelect = layui.xmSelect; |
| | | var steps = layui.steps; |
| | | |
| | | form.render('select'); |
| | | |
| | | init(); |
| | | function init(){ |
| | | notice.msg('正在载入数据......', {icon: 4, position: "topRight"}); |
| | | $.ajax({ |
| | | url: baseUrl + "/priQuote/" + priQuoteId + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | notice.destroy(); |
| | | if (res.code === 200) { |
| | | let priQuote = res.data; |
| | | top.priQuoteByMore = null; |
| | | $("#form-name").html(priQuote.name); |
| | | // 进度步骤图 |
| | | let template0 = Handlebars.compile($('#stepTpl').html()); |
| | | $('#stepBox').html(template0({list: JSON.parse(priQuote.settleMsg)})); |
| | | $('#step-' + Number(priQuote.step)).addClass("layui-this"); |
| | | |
| | | let template1 = Handlebars.compile($('#timelineTpl').html()); |
| | | $('#timelineBox').html(template1({list: JSON.parse(priQuote.settleMsg)})); |
| | | // 补充html |
| | | $('#customizeBox').html(priQuote.formHtml); |
| | | // 设备明细 |
| | | form.val('formAdvForm', priQuote); |
| | | top.convertDisabled($('#formAdvForm :input'), true); |
| | | // 跟进人 |
| | | initFollowers(priQuote.id); |
| | | layDateRender(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /* 渲染laydate */ |
| | | function layDateRender() { |
| | | laydate.render({ |
| | | elem: '#endTime', |
| | | type: 'datetime' |
| | | }); |
| | | } |
| | | layDateRender(); |
| | | |
| | | /* 监听表单提交 */ |
| | | form.on('submit(refresh)', function (data) { |
| | | init(); |
| | | return false; |
| | | }); |
| | | |
| | | }) |
| | | </script> |