Bez popisu

banli_zilei.html 41KB

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