Geen omschrijving

addAdviceOrder.html 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <link rel="stylesheet" href="../layui/css/layui.mobile.css" />
  9. <link href="../css/mui.min.css" rel="stylesheet" />
  10. <link href="../css/mui.picker.css" rel="stylesheet" />
  11. <link href="../css/mui.poppicker.css" rel="stylesheet" />
  12. <link href="../css/feedback-page.css" rel="stylesheet" />
  13. <link rel="stylesheet" href="../css/iconfont.css" />
  14. <link rel="stylesheet" href="../css/inits.css" />
  15. <title>添加工单</title>
  16. <style>
  17. .mui-input-row {
  18. border-bottom: 1px solid #c9c9c9;
  19. }
  20. .mui-card {
  21. margin: 0;
  22. }
  23. .mui-card-content {
  24. padding: 0 20px;
  25. }
  26. .mui-input-row {
  27. height: 75px;
  28. }
  29. #phone,
  30. #code {
  31. height: 50%;
  32. }
  33. .mui-input-row label~input, .mui-input-row label~select, .mui-input-row label~textarea{
  34. width: 90% !important;
  35. }
  36. label,
  37. input,
  38. textarea {
  39. float: none !important;
  40. }
  41. .mui-input-row input,
  42. textarea {
  43. /*padding: 0 15px !important;*/
  44. }
  45. .mui-input-row label,
  46. .reaction {
  47. display: block;
  48. font-weight: 600;
  49. padding: 13px 15px 8px;
  50. }
  51. .mui-radio {
  52. display: inline-block;
  53. }
  54. .line,
  55. .codeTX {
  56. display: inline-block;
  57. border-left: 1px solid #1ba3c9;
  58. padding-left: 10px;
  59. height: 25px;
  60. position: absolute;
  61. right: 10px;
  62. color: #1ba3c9;
  63. font-size: 16px;
  64. font-weight: 600;
  65. }
  66. .btns {
  67. width: 90%;
  68. margin: 20px auto;
  69. text-align: center;
  70. }
  71. .btn {
  72. /* width: 90%; */
  73. background-color: #1ba3c9;
  74. outline: none;
  75. border: none;
  76. padding: 5px 45px;
  77. /* display: block; */
  78. border-radius: 10px;
  79. font-size: 16px;
  80. color: #fff;
  81. }
  82. .titleW {
  83. padding: 5px 0px;
  84. margin-bottom: 5px;
  85. }
  86. .mui-icon-info-filled {
  87. color: rgb(253, 193, 30);
  88. }
  89. .warning {
  90. font-size: 15px;
  91. margin-bottom: 5px;
  92. font-weight: 600;
  93. }
  94. .mui-radio input[type=radio]:before {
  95. font-size: 20px;
  96. vertical-align: middle;
  97. }
  98. .mui-checkbox input[type=checkbox],
  99. .mui-radio input[type=radio] {
  100. top: 0 !important;
  101. }
  102. .mui-checkbox.mui-left label,
  103. .mui-radio.mui-left label {
  104. padding: 0 0 0 45px;
  105. vertical-align: middle;
  106. }
  107. .content {
  108. height: 125px;
  109. border-bottom: none;
  110. }
  111. .mui-input-row label~textarea {
  112. float: none;
  113. width: 100% !important;
  114. height: 70%;
  115. background-color: rgb(246, 246, 246);
  116. }
  117. .ztext {
  118. padding: 10px 64px 10px 15px !important;
  119. }
  120. .feedback {
  121. height: auto;
  122. border: none;
  123. }
  124. .space {
  125. background-color: rgb(246, 246, 246);
  126. }
  127. .btnLeft {
  128. background-color: rgb(254, 150, 3);
  129. margin-right: 40px;
  130. }
  131. .btnRight {
  132. background-color: #1ba3c9;
  133. }
  134. .result {
  135. position: absolute;
  136. right: -4px;
  137. top: 30px;
  138. display: inline-block;
  139. width: 85px;
  140. padding: 5px 0;
  141. color: #fff;
  142. text-align: center;
  143. border-radius: 20px 0 0 20px;
  144. background-color: rgb(17, 211, 169);
  145. }
  146. i {
  147. color: #FF0000;
  148. }
  149. .feedback .image-item {
  150. border: none;
  151. margin-left: 5px;
  152. float: left;
  153. }
  154. .feedback label {
  155. width: 125%;
  156. }
  157. .feedback span {
  158. font-weight: 100;
  159. }
  160. .filesHandle {
  161. background-color: antiquewhite;
  162. display: inline-block;
  163. padding: 2px 10px;
  164. margin-right: 5px;
  165. margin-bottom: 5px;
  166. }
  167. .del_file {
  168. margin-left: 5px;
  169. font-weight: 600;
  170. }
  171. .limit{
  172. position: absolute;
  173. right: 4px;
  174. color: #222;
  175. z-index: 10;
  176. top: 52px;
  177. color: rgb(176,176,176);
  178. }
  179. </style>
  180. </head>
  181. <body>
  182. <!-- <header class="mui-bar mui-bar-nav">
  183. <h1 class="mui-title">添加工单</h1>
  184. </header> -->
  185. <div class="mui-content">
  186. <div class="mui-card">
  187. <div class="mui-card-content">
  188. <div class="titleW">
  189. <span class="mui-icon mui-icon-info-filled"></span>
  190. <span class="warning">请填写真实信息,带 “ <i>*</i> ” 为必填项</span>
  191. <span class="result" onclick="seeResult()">查看结果</span>
  192. </div>
  193. <!--<div style="margin: 10px 0;">
  194. <label class="label reaction" style="display: inline-block;"><i>*</i>反映类型</label>
  195. <input type="radio" name="phoneType" value="12" checked="checked"/>
  196. <label style="margin-top: 5px;">建议</label>
  197. </div>-->
  198. <div class="mui-input-row phone">
  199. <label>姓名</label>
  200. <input type="text" placeholder="请输入姓名" id="cusname">
  201. </div>
  202. <div class="mui-input-row phone">
  203. <label><i>*</i> 手机号</label>
  204. <input type="text" placeholder="请输入手机号" id="cusphone">
  205. <span class="line" onclick="getCode()">获取验证码</span>
  206. <span class="codeTX">60s</span>
  207. </div>
  208. <div class="mui-input-row">
  209. <label><i>*</i> 验证码</label>
  210. <input type="text" class="mui-input-clear" placeholder="请输入验证码" id="code">
  211. </div>
  212. <div class="mui-input-row phone">
  213. <label><i>*</i> 反映标题</label>
  214. <input type="text" placeholder="请简要概述您的问题" id="title" maxlength="30" oninput="getTitleNum()">
  215. <div class="limit">
  216. <span id="titlenum">0</span><span>/30</span>
  217. </div>
  218. </div>
  219. <div class="mui-input-row content">
  220. <label><i>*</i> 反映内容</label>
  221. <textarea class="ztext" name="" id="cont" placeholder="请您一事一诉,请勿重复提交;
  222. 请说明您的主要诉求。" maxlength="500" oninput="getConNum()"></textarea>
  223. <div class="limit" style="top: 100px;">
  224. <span id="contnum">0</span><span>/500</span>
  225. </div>
  226. </div>
  227. <li class="mui-input-row" id="showCityPicker3">
  228. <label><i>*</i> 事发区域</label>
  229. <input type="text" id='cityResult3' data-index="" class="ui-alert type_con" placeholder="请选择区域"
  230. readonly="readonly" />
  231. <a href="javascript:void(0)"><span
  232. class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
  233. </li>
  234. <li class="mui-input-row" id="showCityPicker2">
  235. <label>乡镇</label>
  236. <input type="text" id='cityResult2' data-index="" class="ui-alert type_con" placeholder="请选择乡镇"
  237. readonly="readonly" />
  238. <a href="javascript:void(0)"><span
  239. class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
  240. </li>
  241. <li class="mui-input-row" id="showCityPicker1">
  242. <label>村</label>
  243. <input type="text" id='cityResult1' data-index="" class="ui-alert type_con" placeholder="请选择村"
  244. readonly="readonly" />
  245. <a href="javascript:void(0)"><span
  246. class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
  247. </li>
  248. <div class="mui-input-row content">
  249. <label>详细地址</label>
  250. <textarea class="ztext" name="" id="cusaddress" placeholder="请输入详细地址..."></textarea>
  251. </div>
  252. <div class="mui-input-row feedback">
  253. <label>添加附件 <span
  254. style="color: rgb(176,176,176);">(文件格式为jpg,png,mp4,avi,wmv,mp3,pdf,doc,docx,xls,xlsx)</span></label>
  255. <!-- <label>添加附件</label> -->
  256. <!-- <div id='image-list' class="row image-list"></div> -->
  257. <input class="input" type="file" name="upFile" id="upFileHandle" multiple="multiple"
  258. style="display: none;">
  259. <div class="showFile">
  260. <div id='scwjHandle' class="row image-item"></div>
  261. <div class="fileBoxHandle" style="margin-left: 5px;float: left;width: 78%;">
  262. </div>
  263. </div>
  264. <input type="hidden" id="fileHandle" />
  265. </div>
  266. <div style="margin: 10px 0;border-bottom: 1px solid #c9c9c9;padding-bottom: 20px;">
  267. <div style="font-weight: 600; padding: 13px 15px 8px;"><i>*</i>是否匿名?</div>
  268. <div class="mui-radio mui-left radio_box">
  269. <input type="radio" name="select" value="1" checked="checked"/>
  270. <label>个人信息保密</label>
  271. </div>
  272. <div class="mui-radio mui-left radio_box">
  273. <input type="radio" name="select" value="0" />
  274. <label>个人信息公开</label>
  275. </div>
  276. </div>
  277. <div class="btns">
  278. <button type="button" class="btn btnLeft" onclick="Reset()">重置</button>
  279. <button type="button" class="btn btnRight" onclick="Submit()">提交</button>
  280. </div>
  281. </div>
  282. </div>
  283. </div>
  284. <script src="../js/mui.min.js"></script>
  285. <script src="../js/mui.picker.js"></script>
  286. <script src="../js/mui.poppicker.js"></script>
  287. <script src="../js/jquery.min.js"></script>
  288. <script src="../Script/Common/huayi.config.js"></script>
  289. <script src="../Script/Common/huayi.http.js"></script>
  290. <script src="../layui/layui.js"></script>
  291. <script>
  292. $('.codeTX').css('display', 'none')
  293. var areaList = [],
  294. townList = [];
  295. var area = 0,town = 0,village = 0;
  296. getArea() //获取事发区域
  297. //附件
  298. $("#scwjHandle").click(function() {
  299. $("#upFileHandle").trigger("click");
  300. })
  301. $("#upFileHandle").change(function() {
  302. uploadHandle();
  303. })
  304. function getTitleNum() {
  305. if($('#title').val().length<= 30){
  306. $('#titlenum').text($('#title').val().length)
  307. }
  308. }
  309. function getConNum() {
  310. if($('#cont').val().length<= 500){
  311. $('#contnum').text($('#cont').val().length)
  312. }
  313. }
  314. function getCode() {
  315. if (!$('#cusphone').val()) {
  316. mui.alert('请输入联系电话!');
  317. return;
  318. } else {
  319. if(!(/^1[0-9]\d{9}$/.test($('#cusphone').val()))){
  320. mui.alert("请输入正确的手机号");
  321. return false;
  322. }
  323. }
  324. $.ajax({
  325. type: "get",
  326. url: huayi.config.callcenter_url + 'WxLogin/SendCode',
  327. async: true,
  328. dataType: 'json',
  329. data: {
  330. mobile: $('#cusphone').val()
  331. },
  332. success: function(res) {
  333. if (res.state == 'success') {
  334. let num = 60
  335. $('.line').css('display', 'none')
  336. $('.codeTX').css('display', 'inline-block')
  337. var fq = setInterval(function() {
  338. num -= 1
  339. $('.codeTX').text(num+'s')
  340. console.log(num)
  341. if (num == 0) {
  342. clearInterval(fq)
  343. $('.codeTX').css('display', 'none')
  344. $('.line').css('display', 'inline-block')
  345. }
  346. }, 1000)
  347. }
  348. }
  349. })
  350. }
  351. function getArea() {
  352. $.ajax({
  353. type: "post",
  354. url: huayi.config.callcenter_url + 'Area/GetAreaListById',
  355. dataType: 'json',
  356. async: false,
  357. data: {},
  358. success: function(res) {
  359. res.data.forEach(function(v, n) {
  360. if(v.F_AreaName != '市区'){
  361. var obj = {};
  362. obj.value = v.F_AreaId;
  363. obj.text = v.F_AreaName;
  364. areaList.push(obj)
  365. }
  366. })
  367. }
  368. });
  369. }
  370. function getAreaChildren(id) {
  371. $.ajax({
  372. type: "post",
  373. url: huayi.config.callcenter_url + 'Area/GetAreaChildren',
  374. dataType: 'json',
  375. async: false,
  376. data: {
  377. parentid: id
  378. },
  379. success: function(res) {
  380. townList = []
  381. res.data.forEach(function(v, n) {
  382. var objC = {};
  383. objC.value = v.F_AreaId;
  384. objC.text = v.F_AreaName;
  385. townList.push(objC)
  386. })
  387. }
  388. });
  389. }
  390. function Reset() {
  391. window.location.reload();
  392. }
  393. function Submit() {
  394. // if (!$('input[name="phoneType"]:checked').val()) {
  395. // mui.alert('请输入反映类型!');
  396. // return;
  397. // }
  398. if (!$('#cusphone').val()) {
  399. mui.alert('请输入联系电话!');
  400. return;
  401. } else {
  402. if(!(/^[1]([2-9])[0-9]{9}$/.test($('#cusphone').val()))){
  403. mui.alert("请输入正确的手机号");
  404. return false;
  405. }
  406. }
  407. if (!$('#code').val()) {
  408. mui.alert('请输入手机验证码!');
  409. return;
  410. }
  411. if (!$('#title').val()) {
  412. mui.alert('请输入反映标题!');
  413. return;
  414. }
  415. if (!$('#cont').val()) {
  416. mui.alert('请输入反映内容!');
  417. return;
  418. }
  419. if ($('#cityResult3').val() == '') {
  420. mui.alert('请选择事发区域!');
  421. return;
  422. }
  423. if (!$('input[name="select"]:checked').val()) {
  424. mui.alert('请选择姓名公开!');
  425. return;
  426. }
  427. $.ajax({
  428. type: "post",
  429. url: huayi.config.callcenter_url + 'APP/AddWorkOrder',
  430. async: true,
  431. dataType: 'json',
  432. contentType: 'application/x-www-form-urlencoded',
  433. data: {
  434. source: '5',
  435. type: 12, // 反应类别
  436. cusname: $('#cusname').val(), //姓名
  437. sourceaddress: $('#cusaddress').val(), //详情
  438. cusphone: $('#cusphone').val(), //电话
  439. code: $('#code').val(), //验证码
  440. title: $('#title').val(), //标题
  441. content: $('#cont').val(), //n内容
  442. sourcearea: area, //事发区域
  443. township: town, //乡镇
  444. village: village, //村
  445. sourceaddress: $('#cusaddress').val(),
  446. files: $("#fileHandle").val(), //附件
  447. isprotect: $('input[name="select"]:checked').val() //保密
  448. },
  449. success: function(data) {
  450. if (data.state == "success") {
  451. mui.alert('提交成功!')
  452. window.location.reload();
  453. }
  454. }
  455. });
  456. }
  457. //查看结果
  458. function seeResult(){
  459. window.location.replace("../html/login.html");
  460. }
  461. //上传文件
  462. function uploadHandle() {
  463. var Files = document.getElementById("upFileHandle").files;
  464. console.log(Files);
  465. if (Files.length > 0) {
  466. var formData = new FormData();
  467. for (var i = 0; i < Files.length; i++) {
  468. formData.append('file' + i, Files[i]);
  469. }
  470. var typeName = Files[0].name.split('.')[Files[0].name.split('.').length - 1].toLowerCase();
  471. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
  472. 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
  473. typeName == 'xls' || typeName == 'xlsx') {
  474. $.ajax({
  475. url: huayi.config.callcenter_url + "Web/UploadFile",
  476. type: "POST",
  477. data: formData,
  478. /**
  479. *必须false才会自动加上正确的Content-Type
  480. */
  481. contentType: false,
  482. /**
  483. * 必须false才会避开jQuery对 formdata 的默认处理
  484. * XMLHttpRequest会对 formdata 进行正确的处理
  485. */
  486. processData: false,
  487. success: function(result) {
  488. document.getElementById("upFileHandle").outerHTML = document.getElementById(
  489. "upFileHandle").outerHTML;
  490. $("#upFileHandle").change(function() {
  491. uploadHandle();
  492. });
  493. var r = $.parseJSON(result);
  494. if (r.state.toLowerCase() == "success") {
  495. var a = r.data;
  496. $(a).each(function(i, n) {
  497. // var strs = '<div class="imgC"><img src='+huayi.config.callcenter_url+n.F_FileUrl+' fiel-num="' + n.F_FileId +'" /><span class="del_file">X</span></div>'
  498. var strs = '<span class="filesHandle" fiel-num="' + n.F_FileId +
  499. '">' + n.F_FileName.substring(19) +
  500. '<span class="del_file">X</i></span>'
  501. $(strs).appendTo($('.fileBoxHandle')).find('.del_file').click(
  502. function(event) {
  503. event.stopPropagation();
  504. $(this).parent().remove();
  505. file_numHandle()
  506. })
  507. })
  508. file_numHandle();
  509. }
  510. }
  511. });
  512. } else {
  513. layer.msg("格式不正确");
  514. }
  515. } else {
  516. layer.confirm('请上传文件!', {
  517. btn: ['确定']
  518. });
  519. }
  520. }
  521. function file_numHandle() {
  522. var str = '';
  523. var Str;
  524. $('.fileBoxHandle .filesHandle').each(function(j, m) {
  525. var aa = $(m).attr("fiel-num")
  526. console.log(aa);
  527. str += aa + ",";
  528. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  529. })
  530. console.log(Str)
  531. $("#fileHandle").val(Str);
  532. }
  533. (function($, doc) {
  534. $.init();
  535. $.ready(function() {
  536. var cityPicker3 = new $.PopPicker({
  537. layer: 1
  538. });
  539. var townPicker = new $.PopPicker({
  540. layer: 1
  541. });
  542. var valPicker = new $.PopPicker({
  543. layer: 1
  544. });
  545. cityPicker3.setData(areaList);
  546. var showCityPickerButton = doc.getElementById('showCityPicker3');
  547. var cityResult3 = doc.getElementById('cityResult3');
  548. var townPickerPickerButton = doc.getElementById('showCityPicker2');
  549. var townResult = doc.getElementById('cityResult2');
  550. var valPickerPickerButton = doc.getElementById('showCityPicker1');
  551. var valResult = doc.getElementById('cityResult1');
  552. showCityPickerButton.addEventListener('tap', function(event) {
  553. cityPicker3.show(function(items) {
  554. cityResult3.value = (items[0].text ? items[0].text : "");
  555. area = items[0].value
  556. cityResult3.setAttribute("data-index", items[0].value);
  557. getAreaChildren(items[0].value)
  558. townPicker.setData(townList);
  559. townResult.value=''
  560. valResult.value=''
  561. townPickerPickerButton.addEventListener('tap', function(event) {
  562. townPicker.show(function(items) {
  563. townResult.value = (items[0].text ? items[0].text : "");
  564. town = items[0].value
  565. townResult.setAttribute("data-index", items[0].value);
  566. getAreaChildren(items[0].value)
  567. valPicker.setData(townList);
  568. valResult.value=''
  569. valPickerPickerButton.addEventListener('tap', function(event) {
  570. valPicker.show(function(items) {
  571. valResult.value = (items[0].text ? items[0].text : "");
  572. village = items[0].value
  573. valResult.setAttribute("data-index", items[0].value);
  574. });
  575. }, false);
  576. });
  577. }, false);
  578. });
  579. }, false);
  580. //街道
  581. })
  582. })(mui, document);
  583. </script>
  584. </body>
  585. </html>