No Description

banli_zilei.html 38KB

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