1
0

index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. {extend name="public/layout" /} {block name="title"}日常任务{/block}
  2. {block name="body"}
  3. <style>
  4. .layui-fluid {
  5. display: block;
  6. box-shadow: 0 0 4px 0 #B6CADE;
  7. border-radius: 5px;
  8. /* margin: 15px; */
  9. background-color: #ffffff;
  10. min-height: calc(100vh - 80px);
  11. }
  12. .cardheader {
  13. padding-left: 10px;
  14. }
  15. .layui-table thead tr,
  16. .layui-table-header {
  17. background-color: #D8E6F1 !important;
  18. }
  19. .layui-btn-primary {
  20. color: #249EFB;
  21. border: 1px solid #249EFB;
  22. }
  23. .layui-btn-primary:hover {
  24. background-color: #E3F7FF;
  25. color: #249EFB;
  26. }
  27. .layui-card .layui-tab-brief .layui-tab-title li.layui-this {
  28. color: #249EFB;
  29. }
  30. .layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after {
  31. border: none;
  32. }
  33. .layui-card .layui-tab-brief .layui-tab-title .layui-this:after {
  34. width: 50px;
  35. height: 4px;
  36. background-color: #249EFB;
  37. top: 37px;
  38. left: 50%;
  39. transform: translateX(-50%);
  40. }
  41. .layui-card .layui-tab-brief .layui-tab-title li{
  42. margin: 0px 5px;
  43. padding: 0px 15px;
  44. }
  45. .layui-btn-xs,.layui-btn-xs:hover {
  46. border: 1px solid #249EFB;
  47. background-color: #fff;
  48. color: #249EFB;
  49. padding: 0px 10px;
  50. }
  51. .layui-btn-danger,.layui-btn-danger:hover{
  52. color: #FF5722;
  53. background-color: #fff;
  54. border: 1px solid #FF5722;
  55. padding: 0px 10px;
  56. }
  57. .layui-card .layui-tab-brief .layui-tab-title li{margin-left:0 !important;margin-right: 15px;}
  58. /* .layui-card .layui-tab-brief .layui-tab-title{margin-left:15px;} */
  59. .flex-row {
  60. display: flex;
  61. justify-content: space-around;
  62. align-items: center;
  63. background-color: #fff;
  64. /*margin: 15px;*/
  65. height: 111px;
  66. box-shadow: 0 0 4px 0 #b6cade;
  67. border-radius: 5px;
  68. }
  69. .flex-item {
  70. display: flex;
  71. flex-direction: column;
  72. justify-content: center;
  73. align-items: center;
  74. }
  75. .font-weight {
  76. font-weight: 600;
  77. }
  78. .font24 {
  79. font-size: 24px;
  80. }
  81. .mt10 {
  82. margin-top: 10px;
  83. }
  84. .flex-box {
  85. flex: none;
  86. display: flex;
  87. justify-content: space-around;
  88. align-items: center;
  89. background-color: #fff;
  90. margin: 17px;
  91. box-shadow: 0 0 4px 0 #b6cade;
  92. border-radius: 5px;
  93. padding: 16px;
  94. width: 45%;
  95. margin-left: 0;
  96. margin-top: 0;
  97. }
  98. .flex-box-title{
  99. font-size: 17px;
  100. font-weight: 600;
  101. }
  102. .flex-column {
  103. flex: 1;
  104. display: flex;
  105. flex-direction: column;
  106. overflow: hidden;
  107. }
  108. .box-title {
  109. border-left: 4px solid #249EFB;
  110. display: inline-block;
  111. height: 20px;
  112. line-height: 20px;
  113. padding-left: 5px;
  114. font-size: 16px;
  115. font-weight: 700;
  116. }
  117. .box-little {
  118. margin-top: 4px;
  119. color: #999999;
  120. white-space: nowrap;
  121. overflow: hidden;
  122. text-overflow: ellipsis;
  123. }
  124. .box-content {
  125. width: 100%;
  126. color: #aaa;
  127. white-space: nowrap;
  128. overflow: hidden;
  129. text-overflow: ellipsis;
  130. font-size: 12px;
  131. }
  132. .box-img {
  133. display: flex;
  134. height: 45px;
  135. margin-top: 4px;
  136. }
  137. .box-img img {
  138. width:40px;
  139. height: 40px;
  140. margin-right: 10px;
  141. }
  142. .box-tips {
  143. font-size: 12px;
  144. }
  145. .box-operate {
  146. width: 150px;
  147. height: 100%;
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. }
  152. .box-del {
  153. width: 200px;
  154. height: 100px;
  155. border-left: 1px solid #cccccc;
  156. display: flex;
  157. justify-content: center;
  158. align-items: center;
  159. color: red;
  160. padding-left: 10px;
  161. }
  162. .color249EFB {
  163. color: #249EFB;
  164. }
  165. .ml10 {
  166. margin-left: 10px;
  167. }
  168. #page_container {
  169. padding: 0px 35px;
  170. }
  171. html{background: none;}
  172. .noneimgs {
  173. margin:50px auto 0;
  174. width:20%;
  175. }
  176. .layui-card{box-shadow:none !important;}
  177. .layui-card-body{padding:0 !important;}
  178. </style>
  179. <body>
  180. <div class="layui-fluid" style="box-shadow: none;">
  181. <div class="flex-row">
  182. <div class="flex-item">
  183. <span class="font-weight font24 mt10">{$data.count}</span>
  184. <span class="">任务总量</span>
  185. </div>
  186. <div class="flex-item">
  187. <span class="font-weight font24 mt10">{$data.ing_count}</span>
  188. <span class="">任务进行中</span>
  189. </div>
  190. <div class="flex-item">
  191. <span class="font-weight font24 mt10">{$data.pass_count}</span>
  192. <span class="">已完成</span>
  193. </div>
  194. <div class="flex-item">
  195. <span class="font-weight font24 mt10">{$data.no_count}</span>
  196. <span class="">逾期任务</span>
  197. </div>
  198. <div class="flex-item">
  199. <span class="font-weight font24 mt10">{$data.grawth}</span>
  200. <span class="">任务完成率</span>
  201. </div>
  202. </div>
  203. <div class="layui-card" style="margin-top:30px;">
  204. <div class="layui-card-body">
  205. <div class="layui-row">
  206. <div class="layui-col-md12 layui-col-xs12 layui-col-sm12">
  207. <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-hash">
  208. <ul class="layui-tab-title">
  209. <li class="layui-this" lay-id="1">全部</li>
  210. <li lay-id="2">装修案例</li>
  211. <li lay-id="3">口碑见证</li>
  212. <li lay-id="4">图文素材</li>
  213. <li lay-id="5">视频素材</li>
  214. <li lay-id="6">朋友圈</li>
  215. </ul>
  216. <div class="layui-tab-content">
  217. <div class="layui-tab-item" id="con" style="display:flex !important;flex-wrap:wrap !important;">
  218. </div>
  219. </div>
  220. <div id="page_container"></div>
  221. <input type="hidden" name="count" value="0">
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. {/block}
  229. {block name="js"}
  230. <script>
  231. layui.config({
  232. base: '__LAYUI__/',
  233. urlbase: '/sys'
  234. }).extend({
  235. index: 'lib/index' //主入口模块
  236. }).use(['index', 'table','laypage','element'], function () {
  237. var $ = layui.$,
  238. table = layui.table,
  239. laypage = layui.laypage,
  240. element = layui.element,
  241. form = layui.form;
  242. var page = 1;//当前页
  243. //选项卡切换
  244. element.on('tab(component-tabs-hash)', function(data){
  245. var index = data.index;
  246. page = 1;
  247. if (index==0) {
  248. active.list(page);
  249. } else if (index == 1) {
  250. active.list(page,'material_case');
  251. } else if (index==2) {
  252. active.list(page,'evidencelist');
  253. } else if (index==3) {
  254. active.list(page,'article');
  255. } else if (index==4) {
  256. active.list(page,'video');
  257. } else if (index==5) {
  258. active.list(page,'wxshowlist');
  259. }
  260. });
  261. // table.render({
  262. // elem: '#operater',
  263. // url: '{:url("dailyTasks/list")}',
  264. // page: true,
  265. // height: 'full-180',
  266. // cols: [
  267. // [{
  268. // type: 'numbers',
  269. // field: 'id',
  270. // fixed: 'left',
  271. // title: '序号',
  272. // }, {
  273. // field: 'title',
  274. // title: '标题',
  275. // }, {
  276. // field: 'con',
  277. // title: '描述',
  278. // }, {
  279. // field: 'end_date',
  280. // title: '最迟结束时间',
  281. // }, {
  282. // title: '操作',
  283. // width: 240,
  284. // align: 'center',
  285. // fixed: 'right',
  286. // toolbar: '#op'
  287. // }]
  288. // ],
  289. // text: '对不起,加载出现异常!'
  290. // });
  291. var active = {
  292. list:function(page,type=''){
  293. $.ajax({
  294. url: '{:url("dailyTasks/list")}?page='+page+'&type='+type,
  295. type: 'get',
  296. success: function(res) {
  297. if (res.code==0) {
  298. var data = res.data;
  299. if(data.length != 0){
  300. var html = '';
  301. data.forEach(function(elem, index) {
  302. html += "<div class='flex-box'>";
  303. html += "<div class='flex-column'>";
  304. html += "<div class='box-title'>"+elem.type_name+"</div>";
  305. html += "<span class='box-little'>"+elem.title+"</span>";
  306. html += "<div class='box-content'>"+elem.con+"</div>";
  307. html += "<div class='box-img'>";
  308. for(var i=0;i<elem.img.length;i++){
  309. html += "<img src="+elem.img[i]+" />";
  310. }
  311. html += "</div>";
  312. html += "<div class='box-tips'>";
  313. html += "<span>最晚完成时间:"+elem.end_date+"</span>";
  314. html += "<span class='ml10'>状态:"+elem.state+"</span>";
  315. html += "<span class='ml10'>执行人员:"+elem.all_count+"人</span>";
  316. html += "<span class='ml10'>执行情况:<a class='color249EFB' data-type="+elem.type+" data-id="+elem.id+">"+elem.count+"/"+elem.all_count+"</a></span>";
  317. html += "</div>";
  318. html += "</div>";
  319. html += "<div class='box-operate'>";
  320. if (elem.state=='已结束') {
  321. html += "<div class='box-del' >已过期无法删除</div>";
  322. } else{
  323. html += "<div class='box-del del_task' data-id="+elem.id+">删除</div>";
  324. }
  325. html += "</div>";
  326. html += "</div>";
  327. });
  328. $('#con').empty();
  329. $('#con').html(html);
  330. active.page(res.count);
  331. }else{
  332. $('#con').html('<img class="noneimgs" src="__STATIC__/img/nonedata.png"/>');
  333. }
  334. }
  335. },
  336. error:function(res){
  337. // layer.close(index);
  338. }
  339. });
  340. },
  341. page:function(count){
  342. laypage.render({
  343. elem:'page_container',
  344. count:count,
  345. limit:6,
  346. curr:page,
  347. jump:function(obj,first){
  348. // console.log(obj)
  349. //获取到当前的页数
  350. if(!first) {
  351. if ( page != obj.curr ) {
  352. page = obj.curr;
  353. active.list(page);
  354. }
  355. }
  356. }
  357. })
  358. }
  359. };
  360. active.list(page);
  361. //删除任务
  362. $("#con").on('click','.del_task',function () {
  363. var id = $(this).data("id");
  364. $.ajax({
  365. url: '{:url("dailyTasks/del_task")}?eid='+id,
  366. data: {
  367. // select_id:id,type:type,res:res
  368. },
  369. type: 'get',
  370. success: function(res) {
  371. if (res.code === 0) {
  372. layer.msg(res.msg, { anim: 0 });
  373. active.list(page);
  374. } else {
  375. layer.msg(res.msg, { anim: 6 });
  376. }
  377. },
  378. error:function(res){
  379. active.list(page);
  380. }
  381. });
  382. });
  383. //完成情况
  384. $("#con").on('click','.color249EFB',function () {
  385. var id = $(this).data("id");
  386. var type = $(this).data("type");
  387. layer.open({
  388. type: 2,
  389. title: ['新建案例', 'color:#333333;background-color:#D8E6F1;'],
  390. content: "{:url('dailyTasks/person')}?id="+id+'&type='+type,
  391. resize: false,
  392. area: ['80%', '80%'],
  393. });
  394. });
  395. });
  396. </script>
  397. {/block}