Geen omschrijving

banli.html 31KB

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