index.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  1. <style>
  2. .fr{
  3. float: right;
  4. }
  5. .filter {
  6. font-size: 0;
  7. margin-top:10px;
  8. width: 96%;
  9. margin:10px auto 0 auto;
  10. }
  11. .filter * {
  12. font-size: 14px;
  13. }
  14. .filter label {
  15. font-weight: bold;
  16. }
  17. .filter select {
  18. height: 36px;
  19. font-size: 14px;
  20. margin-left: 10px;
  21. }
  22. .filter select:nth-child(2) {
  23. width: 82px;
  24. }
  25. .filter select:nth-child(3) {
  26. width: 110px;
  27. }
  28. .filter button {
  29. border: none;
  30. background: #2977ff;
  31. width: 111px;
  32. height: 36px;
  33. border-radius: 3px;
  34. font-size: 14px;
  35. color: #fff;
  36. outline: none;
  37. cursor: pointer;
  38. margin-left: 10px;
  39. }
  40. .showClassInfo{
  41. cursor: pointer;
  42. }
  43. .list table {
  44. width: 96%;
  45. margin-top: 20px;
  46. text-align: center;
  47. border-right: 1px solid #ccc;
  48. margin:20px auto 0 auto;
  49. }
  50. .list table th {
  51. background: #f2f2f2;
  52. border: 1px solid #ccc;
  53. border-right: none;
  54. padding: 12px 15px;
  55. }
  56. .list table td {
  57. border: 1px solid #ccc;
  58. border-right: none;
  59. border-top: none;
  60. padding: 12px 15px;
  61. font-weight: bold;
  62. }
  63. .list table tr:nth-child(even) {
  64. background: #f2f2f2;
  65. }
  66. .list .tl {
  67. text-align: left;
  68. }
  69. .list .red {
  70. color: #cc3400;
  71. }
  72. .list .green {
  73. color: #2977ff;
  74. }
  75. .icon {
  76. display: inline-block;
  77. background: center/contain no-repeat;
  78. width: 25px;
  79. height: 25px;
  80. cursor: pointer;
  81. vertical-align: middle;
  82. }
  83. .icon-edit {
  84. background-image: url("/images/edit.png")
  85. }
  86. .icon-eye-close {
  87. background-image: url("/images/eye_close.png")
  88. }
  89. .icon-download {
  90. background-image: url("/images/download_cylet.png")
  91. }
  92. .icon-xunhuan {
  93. background-image: url("/images/xunhuan.png")
  94. }
  95. .icon-add {
  96. background-image: url("/images/add.png");
  97. width: 20px;
  98. height: 20px;
  99. }
  100. .list .subjects {
  101. line-height: 22px;
  102. font-size: 0;
  103. }
  104. .list .icon{
  105. margin: 0 4px;
  106. }
  107. .list .subjects span {
  108. display: inline-block;
  109. font-size: 16px;
  110. word-break: keep-all;
  111. margin: 0 4px;
  112. }
  113. .confirmbox {
  114. background: #fff;
  115. border: 1px solid #cccccc;
  116. border-radius: 3px;
  117. padding: 40px 40px 30px;
  118. text-align: center;
  119. position: fixed;
  120. left: 50%;
  121. top: 50%;
  122. transform: translate(-50%, -50%);
  123. z-index: 99;
  124. }
  125. .confirmbox-mask {
  126. background: rgba(0, 0, 0, .7);
  127. left: 0;
  128. right: 0;
  129. top: 0;
  130. bottom: 0;
  131. z-index: 99;
  132. position: fixed;
  133. }
  134. button {
  135. border: none;
  136. background: #2977ff;
  137. width: 111px;
  138. height: 36px;
  139. border-radius: 3px;
  140. font-size: 14px;
  141. color: #fff;
  142. outline: none;
  143. cursor: pointer;
  144. }
  145. button.save {
  146. display: block;
  147. margin: 40px auto;
  148. }
  149. .confirmbox .confirmbox-btns {
  150. margin-top: 40px;
  151. }
  152. .icon-close{
  153. background-image: url("/images/close.png")
  154. }
  155. .class-modal {
  156. width: 700px;
  157. min-height: 400px;
  158. background: #fff;
  159. border-radius: 5px;
  160. position: absolute;
  161. top: 50%;
  162. left: 50%;
  163. transform: translate(-50%, -50%);
  164. padding: 20px;
  165. }
  166. .class-modal-head {
  167. font-size: 20px;
  168. font-weight: bold;
  169. text-align: center;
  170. }
  171. .class-modal-body {
  172. margin-top: 20px;
  173. max-height: 300px;
  174. overflow: auto;
  175. }
  176. .class-modal-body .classes {
  177. margin-bottom: 10px;
  178. }
  179. .class-modal-body .classes > div {
  180. display: inline-block;
  181. max-width: 640px;
  182. vertical-align: top;
  183. }
  184. .class-modal-body .classes a {
  185. text-decoration: none;
  186. display: inline-block;
  187. margin: 0 5px 5px;
  188. color: #136bfb;
  189. font-size: 14px;
  190. }
  191. .class-modal-body .classes a.active {
  192. color: #fc091b
  193. }
  194. .class-modal .icon-close{
  195. position: absolute;
  196. right: 20px;
  197. top: 20px;
  198. }
  199. .c-red {
  200. color: #CC3300
  201. }
  202. .subject-name {
  203. display: inline-block;
  204. padding: 3px 8px;
  205. background: #ff9900;
  206. border-radius: 3px;
  207. color: #ffffff;
  208. font-size: 12px;
  209. }
  210. /* menu */
  211. .banner-menu{
  212. /*font-size: 0;*/
  213. }
  214. .banner-menu .menu-msg{
  215. display: inline-block;
  216. font-size: 14px;
  217. padding: 4px 22px;
  218. cursor: pointer;
  219. }
  220. .banner-menu .menu-msg.selected{
  221. border-bottom: 3px solid #2977ff;
  222. }
  223. .banner-menu a{
  224. color:#000;
  225. }
  226. .armor_search{
  227. border:1px solid #ccc;
  228. padding:5px;
  229. }
  230. .armor_search select{
  231. height:28px;
  232. width:150px;
  233. }
  234. .armor_search button{
  235. height:28px;
  236. }
  237. .armor_search input{
  238. padding:3px;
  239. }
  240. .armor_search label{
  241. margin:0 10px;
  242. }
  243. /* 弹层样式 */
  244. .need-pop{
  245. position: fixed;
  246. top: 0;
  247. left: 0;
  248. bottom: 0;
  249. right: 0;
  250. background: rgba(0, 0, 0, 0.5);
  251. }
  252. .need-pop-con{
  253. background: #fff;
  254. width: 510px;
  255. position: absolute;
  256. left: 50%;
  257. top: 50%;
  258. transform: translate(-50%,-50%);
  259. }
  260. .need-pop-top{
  261. line-height: 30px;
  262. font-size: 20px;
  263. font-weight: bold;
  264. padding: 6px 12px;
  265. }
  266. .npt-close{
  267. font-size: 30px;
  268. cursor: pointer;
  269. line-height: 28px;
  270. }
  271. .need-pop-list{
  272. margin: 10px 0;
  273. line-height: 30px;
  274. }
  275. .need-pop-menu{
  276. width: 110px;
  277. text-align: right;
  278. margin-right: 4px;
  279. }
  280. .need-pop-menu b{
  281. color: red;
  282. font-weight: bold;
  283. }
  284. .gray-bg{
  285. background: #F0F0F0;
  286. }
  287. .need-pop-detail{
  288. width: 370px;
  289. line-height: 26px;
  290. }
  291. .need-pop-detail input,.need-pop-detail textarea{
  292. border: 1px solid #ccc;
  293. width: 100%;
  294. }
  295. .need-pop-detail input{
  296. height: 26px;
  297. }
  298. .prev-class{
  299. position: relative;
  300. }
  301. .inp-text {
  302. position: relative;
  303. text-indent: 10px;
  304. width: 100%;
  305. height: 100%;
  306. line-height: 30px;
  307. border: 1px solid #D8D8D8;
  308. cursor: pointer;
  309. }
  310. .select-con {
  311. display: none;
  312. border: 1px solid #ccc;
  313. border-top: none;
  314. position: absolute;
  315. background: #fff;
  316. z-index: 10;
  317. width: 100%;
  318. text-indent: 10px;
  319. line-height: 28px;
  320. }
  321. .select-con li {
  322. list-style: none;
  323. }
  324. .select-con li:hover{background: #2977ff;color: #fff;cursor: pointer;}
  325. .inp-text:after {
  326. content: '';
  327. border-left: 5px solid transparent;
  328. border-right: 5px solid transparent;
  329. border-top: 5px solid #676767;
  330. position: absolute;
  331. right: 10px;
  332. bottom: 12px;
  333. }
  334. .list-half{
  335. width: 49%;
  336. }
  337. .list-half .need-pop-detail{
  338. width: 120px;
  339. }
  340. .need-pop-sub{
  341. display: block;
  342. margin: 20px auto 30px;
  343. color: #fff;
  344. background: #2977ff;
  345. padding: 2px 24px;
  346. border: none;
  347. border-radius: 4px;
  348. cursor: pointer;
  349. }
  350. .gray-font{
  351. color: rgb(153, 153, 153);
  352. }
  353. .need-warn-con{
  354. font-size: 12px;
  355. padding-left: 20px;
  356. }
  357. .add-file{
  358. cursor: pointer;
  359. font-size: 14px;
  360. }
  361. .vtm{
  362. vertical-align: middle;
  363. }
  364. /* 开发计划 */
  365. .search-propose-man{
  366. background: #2977ff;
  367. color: #fff;
  368. width: 80px;
  369. height: 24px;
  370. text-align: center;
  371. border-radius: 4px;
  372. border: none;
  373. cursor: pointer;
  374. margin-right: 10px;
  375. }
  376. </style>
  377. <?php
  378. if(isset($query_nav)){
  379. $query_nav='&'.$query_nav;
  380. }else{
  381. $query_nav='';
  382. }
  383. ?>
  384. <script src="/js/jquery.datetimepicker.js"></script>
  385. <link rel="stylesheet" href="/css/jquery.datetimepicker.css" />
  386. <div class="filter">
  387. <div>
  388. <ul class="banner-menu">
  389. <li class="menu-msg <?php if(isset($pageType) && $pageType==1){ echo 'selected';}?>" ><a href="?pagetype=1">新需求</a></li>
  390. <li class="menu-msg <?php if(isset($pageType) && $pageType==2){ echo 'selected';}?>"><a href="?pagetype=2">进行中</a></li>
  391. <li class="menu-msg <?php if(isset($pageType) && $pageType==3){ echo 'selected';}?>"><a href="?pagetype=3">排队中</a></li>
  392. <li class="menu-msg <?php if(isset($pageType) && $pageType==4){ echo 'selected';}?>"><a href="?pagetype=4">不采纳</a></li>
  393. <li class="menu-msg <?php if(isset($pageType) && $pageType==5){ echo 'selected';}?>"><a href="?pagetype=5">已完成</a></li>
  394. <!--<li class="fr "><input type="button" class="search-propose-man" value="开发计划"></li>-->
  395. </ul>
  396. </div>
  397. <div class="armor_search">
  398. <form action="" method="get" id="armor">
  399. <label>优先级:</label>
  400. <select name="priority" id="priority">
  401. <option value="-1" <?php if(isset($param['priority']) && $param['priority']==-1){ echo 'selected';}?> >全部</option>
  402. <option value="0" <?php if(isset($param['priority']) && $param['priority']==0){ echo 'selected';}?> >普通</option>
  403. <option value="1" <?php if(isset($param['priority']) && $param['priority']==1){ echo 'selected';}?> >紧急</option>
  404. <option value="2" <?php if(isset($param['priority']) && $param['priority']==2){ echo 'selected';}?> >非常紧急</option>
  405. </select>
  406. <label>类型:</label>
  407. <select name="type" id="type">
  408. <option value="-1" <?php if(isset($param['type']) && $param['type']==-1){ echo 'selected';}?> >全部</option>
  409. <option value="0" <?php if(isset($param['type']) && $param['type']==0){ echo 'selected';}?> >个人建议</option>
  410. <option value="1" <?php if(isset($param['type']) && $param['type']==1){ echo 'selected';}?> >市场反馈</option>
  411. <option value="2" <?php if(isset($param['type']) && $param['type']==2){ echo 'selected';}?> >公司决策</option>
  412. </select>
  413. <label>状态:</label>
  414. <select name="readStatus" id="readStatus">
  415. <option value="-1" <?php if(isset($param['readStatus']) && $param['readStatus']==-1){ echo 'selected';}?>>全部</option>
  416. <option value="0" <?php if(isset($param['readStatus']) && $param['readStatus']==0){ echo 'selected';}?>>未读</option>
  417. <option value="1" <?php if(isset($param['readStatus']) && $param['readStatus']==1){ echo 'selected';}?>>已读</option>
  418. </select>
  419. <label>提出人:</label>
  420. <input type="text" name="origin" value="<?php if(isset($param['origin'])){echo $param['origin'];}?>">
  421. <button type="button" name="search_btn">搜索</button>
  422. <!--
  423. <button type="button" class="fr add_exam" style="margin-right:10px;">
  424. <i class="icon icon-add"></i>
  425. <span style="display: inline-block;vertical-align: middle">提需求</span>
  426. </button>
  427. -->
  428. </form>
  429. </div>
  430. </div>
  431. <div class="list">
  432. <table cellspacing="0" cellpadding="0" >
  433. <thead>
  434. <tr>
  435. <th >序号</th>
  436. <th >需求标题</th>
  437. <th >提出人</th>
  438. <th >类型</th>
  439. <th width="12%">优先级</th>
  440. <th>提出日期</th>
  441. <th >期待上线时间</th>
  442. <th >点赞数</th>
  443. <th width="12%">状态</th>
  444. </tr>
  445. </thead>
  446. <tbody>
  447. <?php
  448. if(isset($list)){
  449. $i=1;
  450. foreach ($list as $item){
  451. ?>
  452. <tr>
  453. <td><?php echo $i;?></td>
  454. <td><a href="<?php echo $this->createUrl('feedback/reply?id='.$item['id'].'&status=0')?>"><?php echo $item['title'];?></a></td>
  455. <td><?php echo $item['origin'];?></td>
  456. <td>
  457. <?php
  458. if($item['type']===0){
  459. echo '个人建议';
  460. }elseif($item['type']==1){
  461. echo '市场反馈';
  462. }elseif($item['type']==2){
  463. echo '公司决策';
  464. }
  465. ?>
  466. </td>
  467. <td>
  468. <?php
  469. if($item['priority']==0){
  470. echo '普通';
  471. }elseif($item['priority']==1){
  472. echo '紧急';
  473. }elseif($item['priority']==2){
  474. echo '非常紧急';
  475. }
  476. ?>
  477. </td>
  478. <td><?php if($item['createTime']) echo date('Y/m/d',strtotime($item['createTime']));?></td>
  479. <td><?php if($item['releaseTime']) echo date('Y/m/d',strtotime($item['releaseTime']));?></td>
  480. <td><?php echo $item['likesNum'];?></td>
  481. <td><?php if($item['readStatus']==1){ echo '已读';}else{echo '未读';};?></td>
  482. </tr>
  483. <?php
  484. $i++;
  485. }
  486. }
  487. ?>
  488. <tr>
  489. <td colspan="12" class="page">
  490. <?php
  491. if(isset($pageTotal) && $pageTotal>1){
  492. $StartPage=$page-5;
  493. $EndPage=$page+5;
  494. if($StartPage<1){
  495. $StartPage=1;
  496. }
  497. if($EndPage>$pageTotal){
  498. $EndPage=$pageTotal;
  499. }
  500. ?>
  501. <div class="row" style="padding-top:10px;">
  502. <div class="col-xs-7">
  503. &nbsp;
  504. </div>
  505. <div class="col-xs-5" style="font-size: 16px">
  506. <div class="dataTables_paginate paging_simple_numbers" style="vertical-align:sub;">
  507. <ul id="yw0" class="yiiPager">
  508. <?php
  509. if(isset($query_page)){
  510. $query_page='&'.$query_page;
  511. }else{
  512. $query_page='';
  513. }
  514. if($page>1){
  515. echo '<li class="previous"><a href="'.$this->createUrl('feedback/index').'?page='.($page-1).$query_page.'">上一页</a></li>';
  516. }
  517. for($i=$StartPage;$i<=$EndPage;$i++){
  518. $url=$this->createUrl('feedback/index')."?page=".$i.$query_page;
  519. if($page==$i){
  520. echo '<li class="page selected"><a href="#">'.$i.'</a></li>';
  521. }else{
  522. echo '<li class="page"><a href="'.$url.'">'.$i.'</a></li>';
  523. }
  524. }
  525. if($page<$pageTotal){
  526. echo '<li class="next"><a href="'.$this->createUrl('feedback/index').'?page='.($page+1).$query_page.'">下一页</a></li>';
  527. }
  528. }
  529. ?>
  530. </td>
  531. </tr>
  532. </tbody>
  533. </table>
  534. </div>
  535. <!--新需求弹层-->
  536. <div class="need-pop " style="display:none">
  537. <form name="new_armor" id="uploadForm" method="post" enctype="multipart/form-data" action="">
  538. <div class="need-pop-con">
  539. <div class="need-pop-top clearfix">
  540. <div class="npt-title fl">提需求</div>
  541. <div class="npt-close fr">×</div>
  542. </div>
  543. <div class="need-pop-form">
  544. <div class="clearfix need-pop-list">
  545. <div class="fl need-pop-menu"><b>*</b>需求标题:</div>
  546. <div class="fl need-pop-detail">
  547. <input type="text" name="title" class="gray-bg">
  548. </div>
  549. </div>
  550. <div class="clearfix need-pop-list">
  551. <div class="clearfix fl list-half">
  552. <div class="fl need-pop-menu"><b>*</b>类型:</div>
  553. <div class="fl need-pop-detail">
  554. <div class="prev-class">
  555. <select name="types" id="type_add">
  556. <option value="0">个人建议</option>
  557. <option value="1">市场反馈</option>
  558. <option value="2">公司决策</option>
  559. </select>
  560. </div>
  561. </div>
  562. </div>
  563. <div class="clearfix fl list-half">
  564. <div class="fl need-pop-menu"><b>*</b>优先级:</div>
  565. <div class="fl need-pop-detail">
  566. <div class="prev-class">
  567. <select name="priority" id="priority_add">
  568. <option value="0">普通</option>
  569. <option value="1">紧急</option>
  570. <option value="2">非常紧急</option>
  571. </select>
  572. </div>
  573. </div>
  574. </div>
  575. </div>
  576. <div class="clearfix need-pop-list">
  577. <div class="fl need-pop-menu"><b>*</b>问题:</div>
  578. <div class="fl need-pop-detail">
  579. <textarea name="question" id="question" cols="30" rows="5" class="gray-bg" placeholder=""></textarea>
  580. </div>
  581. </div>
  582. <div class="clearfix need-pop-list">
  583. <div class="fl need-pop-menu"><b>*</b>建议:</div>
  584. <div class="fl need-pop-detail">
  585. <textarea name="target" id="target" cols="30" rows="5" class="gray-bg" placeholder=""></textarea>
  586. </div>
  587. </div>
  588. <div class="clearfix need-pop-list">
  589. <div class="fl need-pop-menu"><b>*</b>期待上线时间:</div>
  590. <div class="fl need-pop-detail">
  591. <input type="text" class="gray-bg datetimepicker8" readonly name="releaseTime" placeholder="yyyy/mm/dd">
  592. </div>
  593. </div>
  594. <div class="need-warn-con">
  595. <a class="add-file vtm"><span class="gray-font"><img src="/images/upload.jpg" class="upload-icon" alt=""></span>添加附件</a><span class="gray-font vtm">(如果三言两语表达不了心中的想法,可以整理成文档发给我们,感谢)</span>
  596. <div id="imgPreview"></div>
  597. <input type="file" name="uploadfile" id="fileImg" style="display:none">
  598. <input type="hidden" name="filePath" value="">
  599. </div>
  600. </div>
  601. <input type="button" value="提交" class="need-pop-sub" id="save_armor_btn">
  602. </form>
  603. </div>
  604. </div>
  605. <script>
  606. $('.datetimepicker8').datetimepicker({
  607. onGenerate:function( ct ){
  608. $(this).find('.xdsoft_date').toggleClass('xdsoft_disabled');
  609. $(this).find('.xdsoft_today').removeClass('xdsoft_disabled');
  610. },
  611. format:'Y-m-d',
  612. formatDate:'Y-m-d',
  613. //minDate:'-1970/01/2',
  614. maxDate:'+1970/01/2',
  615. todayBtn : true,
  616. minDate: '-<?php echo date('Y-m-d', strtotime('Yesterday')); ?>',
  617. timepicker:false
  618. });
  619. $('button[name="search_btn"]').click(function() {
  620. $('#armor').submit();
  621. });
  622. $('.npt-close').click(function () {
  623. $('.need-pop').hide();
  624. });
  625. $('.add_exam').click(function(){
  626. showNeedPop();
  627. });
  628. function showNeedPop(){
  629. $('.need-pop').show();
  630. }
  631. // 下拉列表模拟
  632. $('.inp-text').click(function(){
  633. if ($(this).next().is(':hidden')){
  634. $(this).next().show();
  635. } else {
  636. $(this).next().hide();
  637. }
  638. });
  639. // 点下拉列表选项
  640. $('.select-con li').click(function(){
  641. $(this).closest('.select-con').hide();
  642. for (var i = 0; i < $('.hid-class-msg').length; i++) {
  643. if ($(this).attr("id") == $('.hid-class-msg').eq(i).val()){
  644. $(this).closest('.prev-class').find('.inp-text').text('选择要转移班级');
  645. return;
  646. }
  647. }
  648. $(this).closest('.prev-class').find('.inp-text').text($(this).text());
  649. $(this).closest('.prev-class').find('.hid-class-msg').val($(this).attr("id"));
  650. });
  651. // 点击空白处下拉列表消失
  652. $(document).click(function(e){
  653. var targetNode = $(e.target).closest(".inp-text");
  654. if (targetNode.length>0){
  655. return;
  656. }else{
  657. $(".select-con").hide();
  658. }
  659. });
  660. $('#save_armor_btn').click(function(){
  661. var title=$('input[name=title]').val();
  662. var type=$('#type_add').val();
  663. var priority=$('#priority_add').val();
  664. var question=$('#question').val();
  665. var target=$('#target').val();
  666. var releaseTime=$('input[name=releaseTime]').val();
  667. var urlList=$('input[name=filePath]').val();
  668. if(title==''){
  669. layer.msg('需求标题不能为空');
  670. return false;
  671. }
  672. if(type==''){
  673. layer.msg('请选择需求类型');
  674. return false;
  675. }
  676. if(priority==''){
  677. layer.msg('请选择需求紧急程度');
  678. return false;
  679. }
  680. if(question==''){
  681. layer.msg('需求问题内容不能为空');
  682. return false;
  683. }
  684. if(target==''){
  685. layer.msg('需求建议内容不能为空');
  686. return false;
  687. }
  688. if(releaseTime==''){
  689. layer.msg('请填写期待上线时间');
  690. return false;
  691. }
  692. $.ajax({
  693. url:'<?php echo $this->createUrl('feedback/add')?>',
  694. type:'POST',
  695. dataType:'json',
  696. data:{'title':title,'type':type,'priority':priority,'question':question,'target':target,'releaseTime':releaseTime,'urlList':urlList},
  697. success:function(res){
  698. if(res.status==1){
  699. layer.msg('新需求发布成功');
  700. location.reload();
  701. /*
  702. $('.need-pop').hide();
  703. $('input[name=title]').val('');
  704. $('#question').val('');
  705. $('#target').val('');
  706. $('input[name=releaseTime]').val('');
  707. $('input[name=filePath]').val('');
  708. */
  709. }else{
  710. layer.msg(res.msg);
  711. }
  712. }
  713. });
  714. });
  715. // 添加图片
  716. $("#fileImg").on("change", function () {
  717. var formData = new FormData();
  718. formData.append('uploadFile', document.getElementById('fileImg').files[0]);
  719. var basic = "<?php echo $basic;?>";
  720. if(document.getElementById('fileImg').files[0]==undefined){
  721. return false;
  722. }
  723. $.ajax({
  724. url: "<?php echo $uploadUrl;?>",
  725. type: "post",
  726. data: formData,
  727. processData: false,
  728. contentType: false,
  729. beforeSend: function (req) {
  730. req.setRequestHeader("Authorization", basic);
  731. },
  732. success: function (data) {
  733. console.log(data);
  734. if (data.errCode == '00') {
  735. $('input[name=filePath]').val(data.data.url);
  736. $('#imgPreview').html('上传成功');
  737. } else {
  738. layer.msg(data.errMsg);
  739. }
  740. }
  741. });
  742. });
  743. $('.add-file').click(function(){
  744. $('#fileImg').click();
  745. });
  746. $('.search-propose-man').click(function(){
  747. window.location.href='<?php echo $this->createUrl('feedback/plan')?>';
  748. });
  749. </script>