商丘12345 前端

XGBL.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link href="../css/layer/need/layer.css" />
  8. <link rel="stylesheet" href="../css/init.css" />
  9. <title>办理工单</title>
  10. <style>
  11. .input {
  12. background-color: #FFF;
  13. background-image: none;
  14. border: 1px solid #ccc;
  15. border-radius: 1px;
  16. color: inherit;
  17. padding: 6px 12px
  18. }
  19. .fjnr {
  20. padding: 0!important;
  21. border: none!important;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <div class="Common">
  27. <table>
  28. <tr>
  29. <th class="Importent">办理人:</th>
  30. <td> <input id="dealman" type="text" style="height: 32px;"></td>
  31. </tr>
  32. <tr>
  33. <th class="Importent">办理内容:</th>
  34. <td><textarea data-adaptheight id="result" name="" rows="" cols=""></textarea></td>
  35. <input type="hidden" id="ID"/>
  36. </tr>
  37. <tr>
  38. <th>是否有处理结果:</th>
  39. <td id="isProResultRadio" style="font-size: 12px">
  40. <label style="margin-right: 10px">
  41. <input type="radio" value="1" name="isDisposeResult" style="vertical-align: -2px;" />是
  42. </label>
  43. <label>
  44. <input type="radio" value="2" name="isDisposeResult" style="vertical-align: -2px;" />否
  45. </label>
  46. </td>
  47. </tr>
  48. <tr class="prosituation-wrapper">
  49. <th>处理方案/进程:</th>
  50. <td>
  51. <textarea data-adaptheight id="prosituation" name="" rows="6" cols="" ></textarea>
  52. </td>
  53. </tr>
  54. <tr class="annotation-wrapper">
  55. <th style="color:#FF0000;">注释:</th>
  56. <td style="color:#FF0000">请提交加盖单位公章的相关说明文件</td>
  57. </tr>
  58. <tr class="dealcontact-wrapper">
  59. <th>联系方式:</th>
  60. <td>
  61. <input type="text" id="dealcontact">
  62. </td>
  63. </tr>
  64. <tr class="connecttime-wrapper">
  65. <th>沟通时间:</th>
  66. <td>
  67. <input type="text" class="laydate-icon" id="connecttime" style="width: 172px; height: 32px; border-color: rgb(158, 158, 158);" >
  68. </td>
  69. </tr>
  70. <tr class="connectmode-wrapper">
  71. <th>沟通方式:</th>
  72. <td>
  73. <input type="text" id="connectmode">
  74. </td>
  75. </tr>
  76. <tr class="replycontent-wrapper">
  77. <th>答复内容:</th>
  78. <td>
  79. <input type="text" id="replycontent">
  80. </td>
  81. </tr>
  82. <tr class="isstaisfied-wrapper">
  83. <th>是否满意:</th>
  84. <td id="isStaisfiedRadio" style="font-size: 12px">
  85. <label style="margin-right: 10px;">
  86. <input type="radio" value="1" name="isstaisfied" style="vertical-align: -2px;" />满意
  87. </label>
  88. <label style="margin-right: 10px;">
  89. <input type="radio" value="2" name="isstaisfied" style="vertical-align: -2px;" />基本满意
  90. </label>
  91. <label style="margin-right: 10px;">
  92. <input type="radio" value="3" name="isstaisfied" style="vertical-align: -2px;" />不满意
  93. </label>
  94. </td>
  95. </tr>
  96. <tr>
  97. <th class="Importent">附件:</th>
  98. <td>
  99. <span class="fjnr"></span>
  100. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  101. <input class="input" type="button" value="上传" id="scwj" />
  102. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  103. <input type="hidden" id="file" />
  104. <span style="color:#FF0000; border: none;">
  105. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  106. </span>
  107. </td>
  108. </tr>
  109. </table>
  110. <div class="btn_box">
  111. <button class="btns BC">保存</button>
  112. <button class="btns Submit">保存并办理</button>
  113. </div>
  114. </div>
  115. <script src="../css/laydate/laydate.js"></script>
  116. <script src="../js/adjustHeight.js" ></script>
  117. <script>
  118. var wid = helper.request.queryString("wid");
  119. var isProtect = helper.request.queryString("isProtect");
  120. var State;
  121. var a=$("#ID").val()
  122. Detail();
  123. $(document).ready(function() {
  124. laydate.skin('blue');
  125. laydate({
  126. elem: '#connecttime',
  127. event: 'focus',
  128. istoday: true,
  129. istime: true,
  130. type: 'datetime',
  131. format: 'YYYY-MM-DD hh:mm:ss',
  132. });
  133. //上传附件
  134. $("#scwj").click(function() {
  135. $("#upFile").trigger("click");
  136. })
  137. $("#upFile").change(function() {
  138. upload();
  139. })
  140. $("#scfj").click(function() {
  141. $(".fjnr").text("");
  142. $("#scfj").hide();
  143. })
  144. $('.BC').click(function() {
  145. if($("#dealman").val()==""){
  146. layer.msg("办理人不能为空");
  147. }else if($("#result").val()==""){
  148. layer.msg("办理内容不能为空");
  149. }else{
  150. State = 0;
  151. JA();
  152. }
  153. })
  154. $('.Submit').click(function() {
  155. if($("#dealman").val()==""){
  156. layer.msg("办理人不能为空");
  157. }else if($("#result").val()==""){
  158. layer.msg("办理内容不能为空");
  159. }else{
  160. State = 1;
  161. JA();
  162. }
  163. })
  164. $(".prosituation-wrapper").hide(); //处理方案/进程
  165. $(".annotation-wrapper").hide(); //注释
  166. $(".dealcontact-wrapper").hide(); //联系方式
  167. $(".connecttime-wrapper").hide(); //沟通时间
  168. $(".connectmode-wrapper").hide(); //沟通方式
  169. $(".replycontent-wrapper").hide(); //答复内容
  170. $(".isstaisfied-wrapper").hide(); //是否满意
  171. /*
  172. * 处理结果
  173. * 是 1
  174. * 否 2
  175. */
  176. $('#isProResultRadio').find('input[type="radio"]').on('change', function() {
  177. $("#prosituation").val(""); //处理方案/进程
  178. $("#dealcontact").val(""); //联系方式
  179. $("#connecttime").val(""); //沟通时间
  180. $("#connectmode").val(""); //沟通方式
  181. $("#replycontent").val(""); //答复内容
  182. $('#isStaisfiedRadio input[name="isstaisfied"]:checked').prop("checked", false); //是否满意
  183. isProResultJudge($(this).val())
  184. });
  185. });
  186. //交办
  187. function JA() {
  188. $.post(huayi.config.callcenter_url + 'WorkOrder/FeedBackWorkOrder', {
  189. workorderid: wid,
  190. dealman: $("#dealman").val(), //办理人
  191. result: $('#result').val(), //办理内容
  192. isproresult: $('#isProResultRadio input[name="isDisposeResult"]:checked').val(), //处理结果
  193. prosituation: $("#prosituation").val(), //处理方案/进程
  194. dealcontact: $("#dealcontact").val(), //联系方式
  195. connecttime: $("#connecttime").val(), //沟通时间
  196. connectmode: $("#connectmode").val(), //沟通方式
  197. replycontent: $("#replycontent").val(), //答复内容
  198. isstaisfied: $('#isStaisfiedRadio input[name="isstaisfied"]:checked').val(), //是否满意
  199. state: State,
  200. feedbackid:a,
  201. files:$("#file").val(),
  202. token: $.cookie("token")
  203. }, function(result) {
  204. result = JSON.parse(result);
  205. if(result.state.toLowerCase() == "success") {
  206. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  207. parent.layer.close(index); //再执行关闭
  208. parent.load();
  209. parent.layer.msg("办理成功");
  210. }
  211. })
  212. }
  213. //草稿详情
  214. function Detail() {
  215. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
  216. workorderid: wid,
  217. type: 2,
  218. token: $.cookie("token")
  219. }, function(result) {
  220. if(result.state.toLowerCase() == "success") {
  221. if(result.data.length>0){
  222. var IsProResultValue = result.data[0].F_IsProResult + "";
  223. isProResultJudge(IsProResultValue);
  224. $("#dealman").val(result.data[0].F_DealUser); //承办人
  225. $("#result").val(result.data[0].F_Result); //办理内容
  226. $('#isProResultRadio input[name="isDisposeResult"][value="' + result.data[0].F_IsProResult +'"]').prop("checked", true);//是否有处理结果
  227. $("#prosituation").val(result.data[0].F_ProSituation); //处理方案/进程
  228. $("#dealcontact").val(result.data[0].F_DealUserContact); //联系方式
  229. $("#connecttime").val(result.data[0].F_ConnectTime); //沟通时间
  230. $("#connectmode").val(result.data[0].F_ConnectMode); //沟通方式
  231. $("#replycontent").val(result.data[0].F_ReplyContent); //答复内容
  232. $('#isStaisfiedRadio input[name="isstaisfied"][value="' + result.data[0].F_IsSatisfied +'"]').prop("checked", true); //是否满意
  233. a=result.data[0].F_Id;
  234. };
  235. }
  236. })
  237. }
  238. //清除
  239. function Clean(){
  240. $("#startTime").val(''),
  241. $('#assignedopinion').val('')
  242. }
  243. //上传文件
  244. function upload() {
  245. var Files = document.getElementById("upFile").files;
  246. if(Files.length > 0) {
  247. var formData = new FormData();
  248. for(var i = 0; i < Files.length; i++) {
  249. formData.append('file' + i, Files[i]);
  250. }
  251. formData.append("token", $.cookie("token"));
  252. var typeName=Files[0].name.split('.')[1];
  253. if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
  254. $.ajax({
  255. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  256. type: "POST",
  257. data: formData,
  258. /**
  259. *必须false才会自动加上正确的Content-Type
  260. */
  261. contentType: false,
  262. /**
  263. * 必须false才会避开jQuery对 formdata 的默认处理
  264. * XMLHttpRequest会对 formdata 进行正确的处理
  265. */
  266. processData: false,
  267. success: function(result) {
  268. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  269. $("#upFile").change(function() {
  270. upload();
  271. });
  272. var r = $.parseJSON(result);
  273. if(r.state.toLowerCase() == "success") {
  274. $(".fjnr").text(r.data[0].F_FileName);
  275. var a = r.data;
  276. var str = '';
  277. var Str;
  278. $(a).each(function(i, n) {
  279. console.log(n.F_FileId);
  280. str += n.F_FileId + ",";
  281. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  282. console.log(Str);
  283. })
  284. $("#file").val(Str);
  285. $("#scfj").show();
  286. }
  287. }
  288. });
  289. }else{
  290. layer.msg("格式不正确");
  291. }
  292. } else {
  293. layer.confirm('请上传文件!', {
  294. btn: ['确定']
  295. });
  296. }
  297. }
  298. // 处理结果判断
  299. function isProResultJudge (isProResultdata) {
  300. if(isProResultdata === '1') {
  301. if (isProtect === "1" ) {
  302. $(".prosituation-wrapper").hide(); //处理方案/进程
  303. $(".annotation-wrapper").hide(); //注释
  304. $(".dealcontact-wrapper").show(); //联系方式
  305. $(".connecttime-wrapper").hide(); //沟通时间
  306. $(".connectmode-wrapper").hide(); //沟通方式
  307. $(".replycontent-wrapper").hide(); //答复内容
  308. $(".isstaisfied-wrapper").hide(); //是否满意
  309. } else if (isProtect === "0") {
  310. $(".prosituation-wrapper").hide(); //处理方案/进程
  311. $(".annotation-wrapper").hide(); //注释
  312. $(".dealcontact-wrapper").hide(); //联系方式
  313. $(".connecttime-wrapper").show(); //沟通时间
  314. $(".connectmode-wrapper").show(); //沟通方式
  315. $(".replycontent-wrapper").show(); //答复内容
  316. $(".isstaisfied-wrapper").show(); //是否满意
  317. }
  318. } else if (isProResultdata === '2') {
  319. $(".prosituation-wrapper").show(); //处理方案/进程
  320. $(".annotation-wrapper").show(); //注释
  321. $(".dealcontact-wrapper").hide(); //联系方式
  322. $(".connecttime-wrapper").hide(); //沟通时间
  323. $(".connectmode-wrapper").hide(); //沟通方式
  324. $(".replycontent-wrapper").hide(); //答复内容
  325. $(".isstaisfied-wrapper").hide(); //是否满意
  326. }
  327. }
  328. </script>
  329. </body>
  330. </html>