Sin descripción

banli_zilei.html 41KB

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