Nenhuma Descrição

banli.html 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  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>
  31. <input id="dealman" list="dealmanList" type="text" style="height: 32px" autocomplete="off" />
  32. <datalist id="dealmanList">
  33. </datalist>
  34. </td>
  35. <th class="Importent">职务:</th>
  36. <td>
  37. <input type="text" id="duties" />
  38. </td>
  39. <th class="Importent">联系方式:</th>
  40. <td>
  41. <input type="text" id="dealcontact" />
  42. </td>
  43. </tr>
  44. <tr>
  45. <th class="Importent">审核领导:</th>
  46. <td>
  47. <input type="text" id="auditUser" />
  48. </td>
  49. <th class="Importent">职务:</th>
  50. <td>
  51. <input type="text" id="auditUserDuties" />
  52. </td>
  53. <th class="Importent">联系方式:</th>
  54. <td>
  55. <input type="text" id="auditContact" />
  56. </td>
  57. </tr>
  58. <tr>
  59. <th class="Importent">办理结果:</th>
  60. <td colspan="5">
  61. <textarea data-adaptheight id="situation" maxlength="2000" onkeyup="OnFocusFun(this)" name="" rows="6" cols=""></textarea>
  62. <textarea data-adaptheight id="result" hidden="hidden" name="" rows="6" cols=""></textarea>
  63. </td>
  64. </tr>
  65. <tr>
  66. <th>工单内容:</th>
  67. <td colspan="5">
  68. <span id="workremark" name="" rows="6" cols="" readonly="readonly"></span>
  69. </td>
  70. </tr>
  71. <tr class="Importent">
  72. <th>
  73. 调查情况:
  74. </th>
  75. <td>
  76. <select class="select_" id="issurvey">
  77. <option value="1">属实</option>
  78. <option value="2">部分属实</option>
  79. <option value="3">不属实</option>
  80. </select>
  81. </td>
  82. </tr>
  83. <tr>
  84. <th>
  85. 调查情况说明:
  86. </th>
  87. <td colspan="5">
  88. <textarea data-adaptheight id="survey" name="" rows="3" cols=""></textarea>
  89. </td>
  90. </tr>
  91. <tr>
  92. <th>
  93. 办理依据:
  94. </th>
  95. <td colspan="5">
  96. <textarea data-adaptheight id="accordingto" name="" rows="3" cols=""></textarea>
  97. </td>
  98. </tr>
  99. <!--<tr>
  100. <th class="Importent">是/否向当事人反馈:</th>
  101. <td id="isProResultRadio" style="font-size: 12px">
  102. <label style="margin-right: 10px">
  103. <input type="radio" value="1" name="isDisposeResult" style="vertical-align: -2px" />是
  104. </label>
  105. <label>
  106. <input type="radio" value="0" name="isDisposeResult" style="vertical-align: -2px" />否
  107. </label>
  108. </td>
  109. </tr>-->
  110. <tr class="dealWithRemark-wrapper">
  111. <th>已办未果备注:</th>
  112. <td colspan="5">
  113. <textarea data-adaptheight id="dealWithRemark" name="" rows="6" cols=""></textarea>
  114. </td>
  115. </tr>
  116. <tr class="prosituation-wrapper">
  117. <th>处理方案/进程:</th>
  118. <td colspan="5">
  119. <textarea data-adaptheight id="prosituation" name="" rows="6" cols=""></textarea>
  120. </td>
  121. </tr>
  122. <tr class="annotation-wrapper">
  123. <th style="color: #ff0000">注释:</th>
  124. <td style="color: #ff0000" colspan="5">
  125. 请提交加盖单位公章的相关说明文件,不添加文件说明将被扣考核分
  126. </td>
  127. </tr>
  128. <tr class="connecttime-wrapper">
  129. <th>沟通时间:</th>
  130. <td>
  131. <input type="text" class="laydate-icon" id="connecttime" style="
  132. width: 172px;
  133. height: 32px;
  134. border-color: rgb(158, 158, 158);
  135. " />
  136. </td>
  137. </tr>
  138. <tr class="connectmode-wrapper">
  139. <th>沟通方式:</th>
  140. <td>
  141. <input type="text" id="connectmode" />
  142. </td>
  143. </tr>
  144. <tr class="Importent">
  145. <th>回访情况:</th>
  146. <td id="isStaisfiedRadio" style="font-size: 12px" colspan="5">
  147. <label style="margin-right: 10px">
  148. <input type="radio" value="0" name="isstaisfied" style="vertical-align: -2px" />未回访
  149. </label>
  150. <label style="margin-right: 10px">
  151. <input type="radio" value="1" name="isstaisfied" style="vertical-align: -2px" />满意
  152. </label>
  153. <label style="margin-right: 10px">
  154. <input type="radio" value="2" name="isstaisfied" style="vertical-align: -2px" />基本满意
  155. </label>
  156. <label style="margin-right: 10px">
  157. <input type="radio" value="3" name="isstaisfied" style="vertical-align: -2px" />不满意
  158. </label>
  159. </td>
  160. </tr>
  161. <tr class="files-wrappper">
  162. <th class="Importent">附件:</th>
  163. <td colspan="5">
  164. <div class="fileBox"></div>
  165. <!--<span class="fjnr"></span>-->
  166. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  167. style="display: none" />
  168. <input class="input" type="button" value="上传" id="scwj" />
  169. <!--<input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />-->
  170. <input type="hidden" id="file" />
  171. <span style="color: #ff0000; border: none">
  172. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  173. </span>
  174. </td>
  175. </tr>
  176. <tr style="display: none;">
  177. <td>
  178. <button class="btns handleBtn">查看办理结果</button>
  179. </td>
  180. <td colspan="5">
  181. <textarea data-adaptheight id="result" name="" rows="4" cols=""></textarea>
  182. </td>
  183. <input type="hidden" id="ID" />
  184. </tr>
  185. </table>
  186. <div class="btn_box">
  187. <!-- <button class="btns BC">保存</button> -->
  188. <button class="btns Submit">提交</button>
  189. </div>
  190. </div>
  191. <script src="../css/laydate/laydate.js"></script>
  192. <script src="../js/adjustHeight.js"></script>
  193. <script src="../Script/Common/huayi.common.js"></script>
  194. <script>
  195. var wid = helper.request.queryString("wid");
  196. var isProtect = helper.request.queryString("isProtect");
  197. var isSPT = helper.request.queryString("isSPT");
  198. var State;
  199. var a = $("#ID").val();
  200. var simpleDetailStrStart = "";
  201. var simpleDetailStrEnd = "";
  202. var simpleDetailStr = "";
  203. var isproresult
  204. Detail();
  205. $(document).ready(function () {
  206. laydate.skin("blue");
  207. laydate({
  208. elem: "#connecttime",
  209. event: "focus",
  210. istoday: true,
  211. istime: true,
  212. type: "datetime",
  213. format: "YYYY-MM-DD hh:mm:ss",
  214. });
  215. simpleDetail();
  216. getHistoryList();
  217. orderdetail();
  218. //上传附件
  219. $("#scwj").click(function () {
  220. $("#upFile").trigger("click");
  221. });
  222. $("#upFile").change(function () {
  223. upload('upFile','.fileBox',['png','jpg','mp3','mp4','pdf','doc','docx','xls','xlsx'],"#file");
  224. });
  225. $("#scfj").click(function () {
  226. $(".fjnr").text("");
  227. $("#scfj").hide();
  228. });
  229. // $(".BC").click(function () {
  230. // if ($('#isProResultRadio input[name="isDisposeResult"]:checked').val() == "1") {
  231. // if ($("#dealman").val() == "") {
  232. // layer.msg("办理人不能为空");
  233. // } else if ($("#situation").val() == "") {
  234. // layer.msg("处理情况不能为空");
  235. // } else if ($("#dealcontact").val() == "") {
  236. // layer.msg("联系方式不能为空");
  237. // } else if ($("#duties").val() == "") {
  238. // layer.msg("职务不能为空");
  239. // } else if ($("#result").val() == "") {
  240. // layer.msg("请生成办理结果");
  241. // } else {
  242. // State = 0;
  243. // JA();
  244. // }
  245. // } else if ($('#isProResultRadio input[name="isDisposeResult"]:checked').val() == "2") {
  246. // State = 0;
  247. // JA();
  248. // } else if ($('#isProResultRadio input[name="isDisposeResult"]:checked').val() == "0") {
  249. // State = 0;
  250. // JA();
  251. // } else {
  252. // layer.msg("请选择是/否向当事人反馈");
  253. // }
  254. // });
  255. $(".Submit").click(function () {
  256. if(decodeURI(isSPT) === '省12345平台' && $("#situation").val().length > 1000){
  257. layer.msg("办理结果不能超过1000字");
  258. return;
  259. }
  260. if (!$('#isStaisfiedRadio input[name="isstaisfied"]:checked').val()) {
  261. layer.msg("回访情况不能为空");
  262. } else {
  263. // if($('#isStaisfiedRadio input[name="isstaisfied"]:checked').val() === '0'){
  264. // State = 1;
  265. // isproresult = 1
  266. // } else{
  267. // State = 1;
  268. // isproresult = 1
  269. // }
  270. if ($("#dealman").val() == "") {
  271. layer.msg("办理人不能为空");
  272. } else if ($("#situation").val() == "") {
  273. layer.msg("处理情况不能为空");
  274. } else if ($("#dealcontact").val() == "") {
  275. layer.msg("联系方式不能为空");
  276. } else if ($("#duties").val() == "") {
  277. layer.msg("职务不能为空");
  278. } else if (!$('#isStaisfiedRadio input[name="isstaisfied"]:checked').val()) {
  279. layer.msg("回访情况不能为空");
  280. } else {
  281. State = 1;
  282. isproresult = 1
  283. $("#result").val($("#situation").val().replace(simpleDetailStrStart, ''))
  284. JA();
  285. }
  286. }
  287. // if ($('#isProResultRadio input[name="isDisposeResult"]:checked').val() == "1") {
  288. // if ($("#dealman").val() == "") {
  289. // layer.msg("办理人不能为空");
  290. // } else if ($("#situation").val() == "") {
  291. // layer.msg("处理情况不能为空");
  292. // } else if ($("#dealcontact").val() == "") {
  293. // layer.msg("联系方式不能为空");
  294. // } else if ($("#duties").val() == "") {
  295. // layer.msg("职务不能为空");
  296. // } else if (!$('#isStaisfiedRadio input[name="isstaisfied"]:checked').val()) {
  297. // layer.msg("回访情况不能为空");
  298. // } else {
  299. // State = 1;
  300. // debugger
  301. // //$("#situation").val(stripscript($("#situation").val()));
  302. // $("#result").val($("#situation").val().replace(simpleDetailStrStart, ''))
  303. // JA();
  304. // }
  305. // } else if ($('#isProResultRadio input[name="isDisposeResult"]:checked').val() == "2") {
  306. // State = 1;
  307. // JA();
  308. // } else if ($('#isProResultRadio input[name="isDisposeResult"]:checked').val() == "0") {
  309. // State = 1;
  310. // JA();
  311. // } else {
  312. // layer.msg("请选择是/否向当事人反馈");
  313. // }
  314. });
  315. $(".prosituation-wrapper").hide(); //处理方案/进程
  316. $(".annotation-wrapper").hide(); //注释
  317. $(".connecttime-wrapper").hide(); //沟通时间
  318. $(".connectmode-wrapper").hide(); //沟通方式
  319. // $(".isstaisfied-wrapper").hide(); //是否满意
  320. $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  321. /*
  322. * 处理结果
  323. * 默认 0
  324. * 是 1
  325. * 否 2
  326. */
  327. $("#isProResultRadio").find('input[type="radio"]').on("change", function () {
  328. $("#prosituation").val(""); //处理方案/进程
  329. $("#connecttime").val(""); //沟通时间
  330. $("#connectmode").val(""); //沟通方式
  331. $("#result").val(""); //办理结果
  332. $('#isStaisfiedRadio input[name="isstaisfied"]:checked').prop("checked", false); //是否满意
  333. isProResultJudge($(this).val());
  334. });
  335. $(".handleBtn").click(function () {
  336. // if ($('#isProResultRadio input[name="isDisposeResult"]:checked').val() === "1") {
  337. // var isStaisfiedRadioData;
  338. // if (
  339. // $(
  340. // '#isStaisfiedRadio input[name="isstaisfied"]:checked'
  341. // ).val() === "1"
  342. // ) {
  343. // isStaisfiedRadioData = "满意";
  344. // } else if (
  345. // $(
  346. // '#isStaisfiedRadio input[name="isstaisfied"]:checked'
  347. // ).val() === "2"
  348. // ) {
  349. // isStaisfiedRadioData = "基本满意";
  350. // } else if (
  351. // $(
  352. // '#isStaisfiedRadio input[name="isstaisfied"]:checked'
  353. // ).val() === "3"
  354. // ) {
  355. // isStaisfiedRadioData = "不满意";
  356. // } else {
  357. // isStaisfiedRadioData = "未评价";
  358. // }
  359. // simpleDetailStrEnd =
  360. // $("#situation").val() +
  361. // " [办理结果:" +
  362. // "已办理,承办人:" +
  363. // $("#dealman").val() +
  364. // ",职务:" +
  365. // $("#duties").val() +
  366. // ",联系电话:" +
  367. // $("#dealcontact").val() +
  368. // "," +
  369. // $("#dealman").val() +
  370. // "向当事人进行了反馈,当事人对结果表示" +
  371. // isStaisfiedRadioData +
  372. // "。]";
  373. // simpleDetailStr =
  374. // simpleDetailStrStart + simpleDetailStrEnd;
  375. // $("#result").val(simpleDetailStr);
  376. // } else if ($('#isProResultRadio input[name="isDisposeResult"]:checked').val() === "0") {
  377. // simpleDetailStrEnd =
  378. // $("#situation").val() +
  379. // " [办理结果:" +
  380. // "已办理,承办人:" +
  381. // $("#dealman").val() +
  382. // ",职务:" +
  383. // $("#duties").val() +
  384. // ",联系电话:" +
  385. // $("#dealcontact").val() +
  386. // "," +
  387. // $("#dealman").val() +
  388. // "没有向当事人进行反馈" +
  389. // "。]";
  390. // simpleDetailStr =
  391. // simpleDetailStrStart + simpleDetailStrEnd;
  392. // $("#result").val(simpleDetailStr);
  393. // }
  394. simpleDetailStrEnd = $("#situation").val()
  395. simpleDetailStr =
  396. simpleDetailStrStart + simpleDetailStrEnd;
  397. $("#result").val(simpleDetailStr);
  398. });
  399. });
  400. //得到焦点时触发事件
  401. function OnFocusFun(element) {
  402. (element.value.indexOf(simpleDetailStrStart) === 0) || (element.value = simpleDetailStrStart);
  403. }
  404. //交办
  405. function JA() {
  406. $.post(
  407. huayi.config.callcenter_url + "WorkOrder/FeedBackWorkOrder", {
  408. workorderid: wid,
  409. issurvey:$("#issurvey").val(),
  410. survey:$("#survey").val(),
  411. accordingto: $("#accordingto").val(),
  412. dealman: $("#dealman").val(), //承办人
  413. dealcontact: $("#dealcontact").val(), //联系方式
  414. duties: $("#duties").val(), //职务
  415. AuditUser: $("#auditUser").val(), //审核领导
  416. post: $("#auditUserDuties").val(), //审核领导职务
  417. auditContact: $("#auditContact").val(), //审核领导联系方式
  418. situation: $("#situation").val().replace(simpleDetailStrStart, ''), //处理情况
  419. // result: $("#result").val(), //办理结果
  420. result: $("#situation").val(), //办理结果
  421. isproresult: isproresult, //处理结果
  422. // IsProResult: $(
  423. // '#isProResultRadio input[name="isDisposeResult"]:checked'
  424. // ).val(), // 已办未果
  425. IsProResultState: "", // 已办未果状态
  426. prosituation: $("#prosituation").val(), //处理方案/进程
  427. Unsuccessful: $("#dealWithRemark").val(), //已办未果备注
  428. connecttime: $("#connecttime").val(), //沟通时间
  429. connectmode: $("#connectmode").val(), //沟通方式
  430. // replycontent: $("#replycontent").val(), //答复内容
  431. isstaisfied: $('#isStaisfiedRadio input[name="isstaisfied"]:checked').val(), //是否满意
  432. state: State,
  433. feedbackid: a,
  434. files: $("#file").val(),
  435. token: $.cookie("token"),
  436. },
  437. function (result) {
  438. result = JSON.parse(result);
  439. if (result.state.toLowerCase() == "success") {
  440. addHistory();
  441. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  442. parent.layer.close(index); //再执行关闭
  443. parent.$("#orderlist").bootstrapTable("refresh");
  444. parent.layer.msg("办理成功");
  445. $(".fileBox").html("");
  446. }
  447. }
  448. );
  449. }
  450. //工单详情
  451. function orderdetail(){
  452. $.getJSON(
  453. huayi.config.callcenter_url + "WorkOrder/GetWorkOrderNew", {
  454. workorderid: wid,
  455. type: 0,
  456. token: $.cookie("token"),
  457. },
  458. function (result) {
  459. if (result.state.toLowerCase() == "success") {
  460. var Data = result.data.data;
  461. $('#workremark').text(Data[0].F_Content);
  462. }
  463. }
  464. );
  465. }
  466. //草稿详情
  467. function Detail() {
  468. $.getJSON(
  469. huayi.config.callcenter_url + "WorkOrder/GetDraftInfo", {
  470. workorderid: wid,
  471. type: 2,
  472. token: $.cookie("token"),
  473. },
  474. function (result) {
  475. if (result.state.toLowerCase() == "success") {
  476. if (result.data.length > 0) {
  477. var IsProResultValue =
  478. result.data[0].F_IsProResult + "";
  479. isProResultJudge(IsProResultValue);
  480. $("#dealman").val(result.data[0].F_DealUser); //承办人
  481. // $("#result").text(result.data[0].F_Result); //办理结果
  482. $("#situation").val(result.data[0].F_Situation); //处理情况
  483. $("#duties").val(result.data[0].F_Duties); //职务
  484. isproresult = result.data[0].F_IsProResult
  485. // $('#isProResultRadio input[name="isDisposeResult"][value="' + result.data[0].F_IsProResult + '"]').prop("checked", true); //是/否向当事人反馈
  486. $("#prosituation").val(result.data[0].F_ProSituation); //处理方案/进程
  487. $("#dealcontact").val(result.data[0].F_DealUserContact); //联系方式
  488. $("#connecttime").val(result.data[0].F_ConnectTime); //沟通时间
  489. $("#connectmode").val(result.data[0].F_ConnectMode); //沟通方式
  490. $('#isStaisfiedRadio input[name="isstaisfied"][value="' +result.data[0].F_IsSatisfied +'"]').prop("checked", true); //是否满意
  491. a = result.data[0].F_Id;
  492. }
  493. }
  494. }
  495. );
  496. }
  497. //清除
  498. function Clean() {
  499. $("#startTime").val(""), $("#assignedopinion").val("");
  500. }
  501. //上传文件
  502. // function upload() {
  503. // var Files = document.getElementById("upFile").files;
  504. // if (Files.length > 0) {
  505. // var formData = new FormData();
  506. // for (var i = 0; i < Files.length; i++) {
  507. // formData.append("file" + i, Files[i]);
  508. // }
  509. // formData.append("token", $.cookie("token"));
  510. // var typeName = Files[0].name.split(".")[1];
  511. // if (
  512. // typeName == "png" ||
  513. // typeName == "jpg" ||
  514. // typeName == "mp4" ||
  515. // typeName == "mp3" ||
  516. // typeName == "pdf" ||
  517. // typeName == "doc" ||
  518. // typeName == "docx" ||
  519. // typeName == "xls" ||
  520. // typeName == "xlsx"
  521. // ) {
  522. // $.ajax({
  523. // url: huayi.config.callcenter_url +
  524. // "/WorkOrder/UploadFile",
  525. // type: "POST",
  526. // data: formData,
  527. // /**
  528. // *必须false才会自动加上正确的Content-Type
  529. // */
  530. // contentType: false,
  531. // /**
  532. // * 必须false才会避开jQuery对 formdata 的默认处理
  533. // * XMLHttpRequest会对 formdata 进行正确的处理
  534. // */
  535. // processData: false,
  536. // success: function (result) {
  537. // document.getElementById(
  538. // "upFile"
  539. // ).outerHTML = document.getElementById(
  540. // "upFile"
  541. // ).outerHTML;
  542. // $("#upFile").change(function () {
  543. // upload();
  544. // });
  545. // var r = $.parseJSON(result);
  546. // if (r.state.toLowerCase() == "success") {
  547. // $(".fjnr").text(r.data[0].F_FileName);
  548. // var a = r.data;
  549. // $(a).each(function (i, n) {
  550. // var strs =
  551. // '<span class="files" fiel-num="' +
  552. // n.F_FileId +
  553. // '">' +
  554. // n.F_FileName.substring(19) +
  555. // '<i class="fa fa-remove del_file"></i></span>';
  556. // $(strs)
  557. // .appendTo($(".fileBox"))
  558. // .find(".del_file")
  559. // .click(function (event) {
  560. // event.stopPropagation();
  561. // $(this).parent().remove();
  562. // file_num();
  563. // });
  564. // });
  565. // file_num();
  566. // }
  567. // },
  568. // });
  569. // } else {
  570. // layer.msg("格式不正确");
  571. // }
  572. // } else {
  573. // layer.confirm("请上传文件!", {
  574. // btn: ["确定"],
  575. // });
  576. // }
  577. // }
  578. // //上传文件隐藏域值
  579. // function file_num() {
  580. // var str = "";
  581. // var Str;
  582. // $(".fileBox .files").each(function (j, m) {
  583. // var aa = $(m).attr("fiel-num");
  584. // console.log(aa);
  585. // str += aa + ",";
  586. // Str =
  587. // str.substring(str.length - 1) == "," ?
  588. // str.substring(0, str.length - 1) :
  589. // str;
  590. // });
  591. // $("#file").val(Str);
  592. // }
  593. // 处理结果判断
  594. function isProResultJudge(isProResultdata) {
  595. if (isProResultdata === "1") {
  596. // if (isProtect === "1") {
  597. // $(".prosituation-wrapper").hide(); //处理方案/进程
  598. // $(".annotation-wrapper").hide(); //注释
  599. // $(".connecttime-wrapper").hide(); //沟通时间
  600. // $(".connectmode-wrapper").hide(); //沟通方式
  601. // // $(".replycontent-wrapper").hide(); //答复内容
  602. // $(".isstaisfied-wrapper").show(); //是否满意
  603. // $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  604. // } else if (isProtect === "0") {
  605. $(".prosituation-wrapper").hide(); //处理方案/进程
  606. $(".annotation-wrapper").hide(); //注释
  607. $(".connecttime-wrapper").hide(); //沟通时间
  608. $(".connectmode-wrapper").hide(); //沟通方式
  609. // $(".replycontent-wrapper").show(); //答复内容
  610. $(".isstaisfied-wrapper").show(); //是否满意
  611. $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  612. // }
  613. } else if (isProResultdata === "2") {
  614. $(".prosituation-wrapper").show(); //处理方案/进程
  615. $(".annotation-wrapper").show(); //注释
  616. $(".connecttime-wrapper").hide(); //沟通时间
  617. $(".connectmode-wrapper").hide(); //沟通方式
  618. // $(".replycontent-wrapper").hide(); //答复内容
  619. $(".isstaisfied-wrapper").hide(); //是否满意
  620. $(".dealWithRemark-wrapper").show(); // 已办未果备注
  621. } else if (isProResultdata === "0") {
  622. $(".prosituation-wrapper").hide(); //处理方案/进程
  623. $(".annotation-wrapper").hide(); //注释
  624. $(".connecttime-wrapper").hide(); //沟通时间
  625. $(".connectmode-wrapper").hide(); //沟通方式
  626. // $(".replycontent-wrapper").show(); //答复内容
  627. $(".isstaisfied-wrapper").hide(); //是否满意
  628. $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  629. }
  630. }
  631. //简易版工单详情
  632. function simpleDetail() {
  633. $.getJSON(
  634. huayi.config.callcenter_url + "WorkOrder/GetWorkorderSimp", {
  635. workorderid: wid,
  636. token: $.cookie("token"),
  637. },
  638. function (result) {
  639. if (result.state.toLowerCase() == "success") {
  640. var data = result.data[0];
  641. // var date = (new Date(data.F_CreateTime)).getTime();
  642. var date = new Date()
  643. var year = date.getFullYear();
  644. var month = date.getMonth();
  645. var day = date.getDate();
  646. var hour = date.getHours();
  647. var minutes = date.getMinutes();
  648. var seconds = date.getSeconds();
  649. month = month + 1;
  650. if (month >= 1 && month <= 9) {
  651. month = "0" + month
  652. }
  653. if (day >= 1 && day <= 9) {
  654. day = "0" + day
  655. }
  656. var daysTime = year + "年" + month + "月" + day + "日 " + hour + "时" + minutes + "分" +
  657. seconds + "秒"
  658. simpleDetailStrStart =
  659. data.deptname +
  660. "(" +
  661. daysTime +
  662. ")回复:"
  663. // data.SourceName +
  664. // "来源工单(编号:" +
  665. // data.F_WorkOrderId +
  666. // ")反映" +
  667. // data.F_ComTitle +
  668. // "问题,";
  669. $("#situation").val(simpleDetailStrStart);
  670. }
  671. }
  672. );
  673. }
  674. function getHistoryList() {
  675. $("#dealmanList").empty()
  676. $.ajax({
  677. type: "get",
  678. url: huayi.config.callcenter_url + "History/GetList",
  679. async: true,
  680. dataType: "json",
  681. data: {
  682. name: "contractor",
  683. token: $.cookie("token"),
  684. },
  685. success: function (res) {
  686. if (res.state == "success") {
  687. $.each(res.data, function (index, val) {
  688. console.log("val", val)
  689. if (val.F_Count !== "") {
  690. var data = JSON.parse(val.F_Count)
  691. console.log("data", data)
  692. $("#dealmanList").append("<option value='" + data.name +
  693. "'data-contact='" + data.contact + "'data-job='" + data
  694. .job + "'>")
  695. }
  696. })
  697. $("#dealmanList").append("<option value='清除历史记录'>")
  698. } else {
  699. layer.confirm(res.message, {
  700. icon: 2,
  701. btn: ['确定']
  702. });
  703. }
  704. }
  705. });
  706. }
  707. $("#dealman").change(function () {
  708. var name = $("#dealman").val()
  709. if (name === "清除历史记录") {
  710. $("#dealman").val("")
  711. deleteHistory()
  712. return
  713. }
  714. $("#dealmanList").find("option").each(function () {
  715. if (name == $(this).val()) {
  716. $("#dealcontact").val($(this).attr("data-contact"))
  717. $("#duties").val($(this).attr("data-job"))
  718. }
  719. })
  720. // $("#dealcontact").attr("data-contact")
  721. // $("#duties").attr("data-job")
  722. })
  723. function addHistory() {
  724. var contractorObject = {
  725. name: $("#dealman").val(),
  726. contact: $("#dealcontact").val(),
  727. job: $("#duties").val(),
  728. }
  729. var contractorObjectStr = JSON.stringify(contractorObject);
  730. $.ajax({
  731. type: "post",
  732. url: huayi.config.callcenter_url + "History/Add",
  733. async: true,
  734. dataType: "json",
  735. data: {
  736. name: "contractor",
  737. count: contractorObjectStr,
  738. token: $.cookie("token"),
  739. },
  740. success: function (res) {
  741. debugger
  742. //var res = $.parseJSON(res)
  743. if (res.state == "success") {
  744. } else {
  745. layer.confirm(res.message, {
  746. icon: 2,
  747. btn: ['确定']
  748. });
  749. }
  750. }
  751. });
  752. }
  753. function deleteHistory() {
  754. $.ajax({
  755. type: "post",
  756. url: huayi.config.callcenter_url + "History/Delete",
  757. async: true,
  758. dataType: "json",
  759. data: {
  760. type: 1,
  761. token: $.cookie("token"),
  762. },
  763. success: function (res) {
  764. if (res.state == "success") {
  765. getHistoryList()
  766. } else {
  767. }
  768. }
  769. });
  770. }
  771. </script>
  772. </body>
  773. </html>