Нет описания

banli.html 32KB

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