1
0

module_setting.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. {extend name="public/layout" /} {block name="title"}自定义设置{/block} {block name="body"}
  2. <style type="text/css">
  3. html,
  4. body {
  5. display: block;
  6. min-width: 1100px;
  7. background-color: #fff;
  8. }
  9. .layui-fluid {
  10. display: block;
  11. box-shadow: 0 0 4px 0 #B6CADE;
  12. border-radius: 5px;
  13. margin: 15px;
  14. background-color: #ffffff;
  15. }
  16. .layui-icon {
  17. font-size: 20px !important;
  18. line-height: 38px;
  19. }
  20. .layui-form-switch {
  21. margin-top: 0px;
  22. }
  23. .ml5 {
  24. margin-left: 5px;
  25. }
  26. .mr5 {
  27. margin-right: 5px;
  28. }
  29. .flex {
  30. display: flex !important;
  31. }
  32. .active {
  33. color: #249EFB;
  34. font-weight: 600;
  35. }
  36. .leftViewBox {
  37. width: 120px;
  38. display: inline-block;
  39. background-color: #fff;
  40. border-right: 1px solid #f5f5f5;
  41. }
  42. .leftViewBox > div {
  43. width: 100%;
  44. height: 40px;
  45. background-color: #fff;
  46. line-height: 40px;
  47. border-bottom: 1px solid #f5f5f5;
  48. display: flex;
  49. align-items: center;
  50. box-sizing: border-box;
  51. padding-left: 5px;
  52. cursor: pointer;
  53. }
  54. .rightViewBox {
  55. width: calc(100% - 100px);
  56. display: inline-block;
  57. }
  58. .rightViewBox > div {
  59. width: 100%;
  60. height: 100%;
  61. }
  62. iframe {
  63. width: 100%;
  64. height: 100%;
  65. }
  66. .height100vh_200 {
  67. height: calc(100vh + 200px);
  68. }
  69. .height100vh-200 {
  70. height: calc(100vh - 0px);
  71. }
  72. .height100vh_200{height: calc(100vh - 2px) !important;}
  73. .disabledClass span{color:#999;}
  74. /* .disabledClass .layui-form-onswitch{background:#999 !important;} */
  75. .layui-form-switch{min-width:30px !important;height: 18px !important;line-height: 18px !important;}
  76. .layui-form-switch i{width: 12px !important;height: 12px !important;}
  77. .layui-form-onswitch i{margin-left: -18px !important;}
  78. </style>
  79. <body>
  80. <div class="layui-card flex">
  81. <div class="leftViewBox layui-form height100vh_200">
  82. <div data-index="0" class="active">报备设置</div>
  83. <div data-index="1">客户跟踪</div>
  84. <div data-index="2" class="disabledClass">
  85. <span class="mr5">信息完善</span>
  86. <input type="checkbox" lay-filter="switchEl1" name="switch" {if $perfect}checked{/if} lay-skin="switch">
  87. </div>
  88. <div data-index="3">
  89. <span class="mr5">客户转化</span>
  90. <input type="checkbox" lay-filter="switchEl2" name="switch" {if $change}checked{/if} lay-skin="switch">
  91. </div>
  92. <div data-index="4">
  93. <span class="mr5">客户预约</span>
  94. <input type="checkbox" lay-filter="switchEl3" name="switch" {if $subscribe}checked{/if} lay-skin="switch">
  95. </div>
  96. <div data-index="5">团队客户</div>
  97. <div data-index="6">操作设置</div>
  98. {auth:check name="customerSetting/report"}
  99. <div data-index="7">PC端报备设置</div>
  100. {/auth:check}
  101. </div>
  102. <div class="rightViewBox height100vh_200">
  103. <div>
  104. <iframe src="/dashboard/customer_setting/module_report.html" frameborder="0"></iframe>
  105. </div>
  106. <div class="layui-hide">
  107. <iframe src="/dashboard/customer_setting/moduleVisit.html" frameborder="0"></iframe>
  108. </div>
  109. <div class="layui-hide"></div>
  110. <div class="layui-hide">
  111. <iframe src="/dashboard/customer_setting/moduleChange.html" frameborder="0"></iframe>
  112. </div>
  113. <div class="layui-hide">
  114. <iframe src="/dashboard/customer_setting/moduleSubscribe.html" frameborder="0"></iframe>
  115. </div>
  116. <div class="layui-hide">
  117. <iframe src="/dashboard/customer_setting/team_statistics_data.html" frameborder="0"></iframe>
  118. </div>
  119. <div class="layui-hide">
  120. <iframe src="/dashboard/customer_setting/moduleHandel.html" frameborder="0"></iframe>
  121. </div>
  122. {auth:check name="customerSetting/report"}
  123. <div class="layui-hide">
  124. <iframe src="/dashboard/customer_setting/report.html" frameborder="0"></iframe>
  125. </div>
  126. {/auth:check}
  127. </div>
  128. </div>
  129. </body>
  130. {/block} {block name="js"}
  131. <script>
  132. layui.config({
  133. base: '__LAYUI__/' //静态资源所在路径
  134. ,
  135. urlbase: '/sys'
  136. }).extend({
  137. index: 'lib/index' //主入口模块
  138. }).use(['index', 'table', 'layedit', 'element', 'upload'], function () {
  139. var $ = layui.$,
  140. table = layui.table,
  141. element = layui.element,
  142. upload = layui.upload,
  143. form = layui.form;
  144. form.render();
  145. let activenum = localStorage.getItem('CUR_ACTIVE_NUM');
  146. if (activenum) {
  147. $('.leftViewBox').children().eq(parseInt(activenum)).addClass('active').siblings().removeClass('active');
  148. $('.rightViewBox div').eq(parseInt(activenum)).removeClass('layui-hide').siblings().addClass('layui-hide');
  149. }
  150. //切换模块设置
  151. $('.leftViewBox div').click(function() {
  152. let index = parseInt($(this).prop('dataset').index);
  153. localStorage.setItem('CUR_ACTIVE_NUM',$(this).prop('dataset').index);
  154. if (index == 5) {
  155. $('.leftViewBox').removeClass('height100vh_200')
  156. $('.rightViewBox').removeClass('height100vh_200')
  157. $('.leftViewBox').addClass('height100vh-200')
  158. $('.rightViewBox').addClass('height100vh-200')
  159. } else {
  160. $('.leftViewBox').removeClass('height100vh-200')
  161. $('.rightViewBox').removeClass('height100vh-200')
  162. $('.leftViewBox').addClass('height100vh_200')
  163. $('.rightViewBox').addClass('height100vh_200')
  164. }
  165. if (index == 2) {
  166. return false;
  167. } else {
  168. $(this).addClass('active').siblings().removeClass("active");
  169. }
  170. $('.rightViewBox div').eq(index).removeClass('layui-hide').siblings().addClass('layui-hide');
  171. })
  172. window.reloadFunc = function () {
  173. location.reload();
  174. }
  175. form.on('switch(switchEl1)', function (data) {
  176. let formData = new FormData();
  177. formData.append('perfect',(data.elem.checked ? 1 : '0'))
  178. $.ajax({
  179. url: '{:url("customerSetting/moduleSetting")}',
  180. type: 'post',
  181. data: formData,
  182. dataType: 'json',
  183. processData: false,
  184. contentType: false,
  185. success: function (res) {
  186. if (res.code === 0) {
  187. layer.msg(res.msg, { anim: 0 });
  188. } else {
  189. layer.msg(res.msg, { anim: 6 });
  190. setTimeout(() => {
  191. location.reload();
  192. },1000)
  193. }
  194. }
  195. });
  196. data.stopPropagation();
  197. return false;
  198. });
  199. form.on('switch(switchEl2)', function (data) {
  200. let formData = new FormData();
  201. formData.append('change',(data.elem.checked ? 1 : '0'))
  202. $.ajax({
  203. url: '{:url("customerSetting/moduleSetting")}',
  204. type: 'post',
  205. data: formData,
  206. dataType: 'json',
  207. processData: false,
  208. contentType: false,
  209. success: function (res) {
  210. if (res.code === 0) {
  211. layer.msg(res.msg, { anim: 0 });
  212. } else {
  213. layer.msg(res.msg, { anim: 6 });
  214. setTimeout(() => {
  215. location.reload();
  216. },1000)
  217. }
  218. }
  219. });
  220. data.stopPropagation();
  221. return false;
  222. });
  223. form.on('switch(switchEl3)', function (data) {
  224. let formData = new FormData();
  225. formData.append('subscribe',(data.elem.checked ? 1 : '0'))
  226. $.ajax({
  227. url: '{:url("customerSetting/moduleSetting")}',
  228. type: 'post',
  229. data: formData,
  230. dataType: 'json',
  231. processData: false,
  232. contentType: false,
  233. success: function (res) {
  234. if (res.code === 0) {
  235. layer.msg(res.msg, { anim: 0 });
  236. } else {
  237. layer.msg(res.msg, { anim: 6 });
  238. setTimeout(() => {
  239. location.reload();
  240. },1000)
  241. }
  242. }
  243. });
  244. data.stopPropagation();
  245. return false;
  246. });
  247. });
  248. </script>
  249. {/block}