Ei kuvausta

banli_zilei.html 38KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  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. simpleDetailStrEnd = $("#situation").val()
  281. simpleDetailStr =
  282. simpleDetailStrStart + simpleDetailStrEnd;
  283. $("#result").val(simpleDetailStr);
  284. })
  285. });
  286. //交办
  287. function JA() {
  288. $.post(huayi.config.callcenter_url + 'WorkOrder/DealWorkOrder', {
  289. workorderid: wid,
  290. dealman: $("#dealman").val(), //承办人
  291. AuditUser: $("#auditUser").val(), //审核领导
  292. post: $("#auditUserDuties").val(), //审核领导职务
  293. result: $('#result').val(), //处理情况
  294. situation: $("#situation").val(), //办理结果
  295. isproresult: $('#isProResultRadio input[name="isDisposeResult"]:checked').val(), //处理结果
  296. // IsProResult: $('#isProResultRadio input[name="isDisposeResult"]:checked').val(), // 已办未果
  297. prosituation: $("#prosituation").val(), //处理方案/进程
  298. // Unsuccessful: $("#dealWithRemark").val(), //已办未果备注
  299. dealcontact: $("#dealcontact").val(), //联系方式
  300. duties: $("#duties").val(), //职务
  301. connecttime: $("#connecttime").val(), //沟通时间
  302. connectmode: $("#connectmode").val(), //沟通方式
  303. // replycontent: $("#replycontent").val(), //答复内容
  304. isstaisfied: $('#isStaisfiedRadio input[name="isstaisfied"]:checked').val(), //是否满意
  305. state: State,
  306. feedbackid: a,
  307. files: $("#file").val(),
  308. token: $.cookie("token")
  309. }, function (result) {
  310. result = JSON.parse(result);
  311. if (result.state.toLowerCase() == "success") {
  312. addHistory();
  313. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  314. parent.layer.close(index); //再执行关闭
  315. parent.load();
  316. parent.layer.msg("办理成功");
  317. $('.fileBox').html('');
  318. }
  319. })
  320. }
  321. // 工单详情
  322. function HGXX() {
  323. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetSecondDealInfo', {
  324. workorderid: wid,
  325. token: $.cookie("token")
  326. }, function (result) {
  327. // result = JSON.stringify(result)
  328. // alert(result)
  329. if (result.state.toLowerCase() == "success") {
  330. var temp;
  331. var Agree;
  332. $.each(result.data.fkinfo, function (i, n) {
  333. // var r = JSON.stringify(n.File);
  334. if (n.F_IsAudit == 1) {
  335. Agree = "同意";
  336. } else if (n.F_IsAudit == 2) {
  337. Agree = "拒绝";
  338. } else if (n.F_IsAudit == 0) {
  339. Agree = "";
  340. }
  341. var bval = n.F_Type;
  342. switch (bval + '') {
  343. case '1':
  344. bval = '主办';
  345. break;
  346. case '2':
  347. bval = '协办';
  348. break;
  349. }
  350. //是/否向当事人反馈
  351. var isProResultValue = n.F_IsProResult + "";
  352. switch (isProResultValue) {
  353. case "0":
  354. isProResultValue = "否";
  355. break;
  356. case "1":
  357. isProResultValue = "是";
  358. break;
  359. case "2":
  360. isProResultValue = "已办未果";
  361. break;
  362. }
  363. //是否满意
  364. var isSatisfiedValue = n.F_IsSatisfied + "";
  365. switch (isSatisfiedValue) {
  366. case "0":
  367. isSatisfiedValue = "未评价";
  368. break;
  369. case "1":
  370. isSatisfiedValue = "满意";
  371. break;
  372. case "2":
  373. isSatisfiedValue = "基本满意";
  374. break;
  375. case "3":
  376. isSatisfiedValue = "不满意";
  377. break;
  378. }
  379. //沟通时间
  380. var connectTimeValue = n.F_ConnectTime;
  381. switch (connectTimeValue) {
  382. case null:
  383. connectTimeValue = "";
  384. break;
  385. default:
  386. connectTimeValue = n.F_ConnectTime;
  387. }
  388. // 审批时间
  389. var auditTimeValue
  390. switch (n.F_AuditTime) {
  391. case "":
  392. auditTimeValue = ""
  393. break;
  394. case null:
  395. auditTimeValue = ""
  396. break;
  397. default:
  398. auditTimeValue = n.F_AuditTime
  399. break;
  400. }
  401. //审批内容
  402. var auditReasonValue
  403. switch (n.F_AuditReason) {
  404. case "":
  405. auditReasonValue = ""
  406. break;
  407. case null:
  408. auditReasonValue = ""
  409. break;
  410. default:
  411. auditReasonValue = n.F_AuditReason
  412. break;
  413. }
  414. //职务
  415. var dutiesValue
  416. switch (n.F_Duties) {
  417. case "":
  418. dutiesValue = ""
  419. break;
  420. case null:
  421. dutiesValue = ""
  422. break;
  423. default:
  424. dutiesValue = n.F_Duties
  425. break;
  426. }
  427. //处理情况
  428. var situationValue
  429. switch (n.F_Situation) {
  430. case "":
  431. situationValue = ""
  432. break;
  433. case null:
  434. situationValue = ""
  435. break;
  436. default:
  437. situationValue = n.F_Situation
  438. break;
  439. }
  440. temp = '<tr>' +
  441. '<td class="text-center">' + (i + 1) + '</td>' +
  442. '<td class="text-center">' + n.F_DealUser + '</td>' +
  443. '<td class="text-center">' + n.F_DealUserContact + '</td>' +
  444. '<td class="text-center">' + dutiesValue + '</td>' +
  445. '<td class="text-center">' + situationValue + '</td>' +
  446. '<td class="text-center">' + n.F_CreateTime + '</td>' +
  447. '<td class="text-center">' + n.F_Result + '</td>' +
  448. '<td class="text-center">' + auditTimeValue + '</td>' +
  449. '<td class="text-center">' + auditReasonValue + '</td>' +
  450. '<td class="text-center">' + Agree + '</td>' +
  451. '<td class="text-center" data-formatter="shtype">' + bval + '</td>' +
  452. '<td class="text-center">' + isProResultValue + '</td>' +
  453. '<td class="text-center">' + n.F_ProSituation + '</td>' +
  454. // '<td class="text-center">' + connectTimeValue + '</td>' +
  455. // '<td class="text-center">' + n.F_ConnectMode + '</td>' +
  456. // '<td class="text-center">' + isSatisfiedValue + '</td>' +
  457. '<td class="text-center FJ" style="color:#00a1cb;"></td>' +
  458. '</tr>';
  459. var tmp = '';
  460. if (n.File) {
  461. $.each(n.File, function (d, f) {
  462. tmp += '<a style="margin-right:5px;" href="' + f.F_FileUrl +
  463. '" download="' + f.F_FileUrl + '">' + f.F_FileName
  464. .substring(19) + '</a>';
  465. })
  466. }
  467. $(temp).appendTo($('.HGXX'))
  468. .find('.FJ')
  469. .append(tmp);
  470. });
  471. //
  472. // alert(i);
  473. }
  474. })
  475. }
  476. // <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>
  477. // function Hove(){
  478. // $(document).on("mouseover mouseout",'.tiaozhuan',function(event){
  479. // if(event.type == "mouseover"){
  480. // //鼠标悬浮
  481. // var miao=$(this).attr("href");
  482. // if (miao=="") {
  483. // $(this).removeAttr("href");
  484. // $(this).removeAttr("download");
  485. // $(this).html("");
  486. //
  487. // } else{
  488. // $(this).attr("href");
  489. // $(this).attr("download");
  490. // }
  491. // }else if(event.type == "mouseout"){
  492. // //鼠标离开
  493. // }
  494. // })
  495. //
  496. //
  497. // }
  498. // $(window).load(function(){
  499. // alert("DDD");
  500. // alert($(".tiaozhuan").attr("href"));
  501. // var miao1=$(".tiaozhuan").attr("href");
  502. // if (miao1=="") {
  503. // alert("aaa");
  504. //// $(this).html("");
  505. // } else{
  506. // alert("bbb");
  507. // $(this).html("");
  508. // }
  509. // });
  510. // 派单内容给
  511. function BLNR() {
  512. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetSecondDealInfo', {
  513. workorderid: wid,
  514. token: $.cookie("token")
  515. }, function (result) {
  516. // result = JSON.stringify(result)
  517. if (result.state.toLowerCase() == "success") {
  518. var temp2;
  519. $.each(result.data.pdinfo, function (i, n) {
  520. temp2 = temp2 + '<tr><td class="text-center">' + n.F_CreateTime +
  521. '</td><td class="text-center">' + n.F_LimitTime +
  522. '</td><td class="text-center">' + n.F_AssignedOpinion + '</td></tr>';
  523. });
  524. $('.BLNR').append(temp2);
  525. }
  526. })
  527. }
  528. //草稿详情
  529. function Detail() {
  530. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
  531. workorderid: wid,
  532. type: 2,
  533. token: $.cookie("token")
  534. }, function (result) {
  535. if (result.state.toLowerCase() == "success") {
  536. if (result.data.length > 0) {
  537. var IsProResultValue = result.data[0].F_IsProResult + "";
  538. isProResultJudge(IsProResultValue);
  539. $("#dealman").val(result.data[0].F_DealUser); //承办人
  540. $("#duties").val(result.data[0].F_Duties); //职务
  541. // $("#result").text(result.data[0].F_Result); //处理结果
  542. $("#situation").val(result.data[0].F_Situation); //处理情况
  543. $('#isProResultRadio input[name="isDisposeResult"][value="' + result.data[0]
  544. .F_IsProResult + '"]').prop("checked", true); //是/否向当事人反馈
  545. $("#prosituation").val(result.data[0].F_ProSituation); //处理方案/进程
  546. $("#dealcontact").val(result.data[0].F_DealUserContact); //联系方式
  547. $("#connecttime").val(result.data[0].F_ConnectTime); //沟通时间
  548. $("#connectmode").val(result.data[0].F_ConnectMode); //沟通方式
  549. // $("#replycontent").val(result.data[0].F_ReplyContent); //答复内容
  550. $('#isStaisfiedRadio input[name="isstaisfied"][value="' + result.data[0].F_IsSatisfied +
  551. '"]').prop("checked", true); //是否满意
  552. a = result.data[0].F_Id;
  553. };
  554. }
  555. })
  556. }
  557. //清除
  558. function Clean() {
  559. $("#startTime").val(''),
  560. $('#assignedopinion').val('')
  561. }
  562. //上传文件
  563. function upload() {
  564. var Files = document.getElementById("upFile").files;
  565. if (Files.length > 0) {
  566. var formData = new FormData();
  567. for (var i = 0; i < Files.length; i++) {
  568. formData.append('file' + i, Files[i]);
  569. }
  570. formData.append("token", $.cookie("token"));
  571. var typeName = Files[0].name.split('.')[1];
  572. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'mp3' || typeName ==
  573. 'pdf' || typeName == 'doc' || typeName == 'docx' || typeName == 'xls' || typeName == 'xlsx') {
  574. $.ajax({
  575. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  576. type: "POST",
  577. data: formData,
  578. /**
  579. *必须false才会自动加上正确的Content-Type
  580. */
  581. contentType: false,
  582. /**
  583. * 必须false才会避开jQuery对 formdata 的默认处理
  584. * XMLHttpRequest会对 formdata 进行正确的处理
  585. */
  586. processData: false,
  587. success: function (result) {
  588. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  589. .outerHTML;
  590. $("#upFile").change(function () {
  591. upload();
  592. });
  593. var r = $.parseJSON(result);
  594. if (r.state.toLowerCase() == "success") {
  595. //$(".fjnr").text(r.data[0].F_FileName);
  596. var a = r.data;
  597. $(a).each(function (i, n) {
  598. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  599. '">' + n.F_FileName.substring(19) +
  600. '<i class="fa fa-remove del_file"></i></span>'
  601. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  602. function (event) {
  603. event.stopPropagation();
  604. $(this).parent().remove();
  605. file_num()
  606. })
  607. })
  608. file_num();
  609. }
  610. }
  611. });
  612. } else {
  613. layer.msg("格式不正确");
  614. }
  615. } else {
  616. layer.confirm('请上传文件!', {
  617. btn: ['确定']
  618. });
  619. }
  620. }
  621. //上传文件隐藏域值
  622. function file_num() {
  623. var str = '';
  624. var Str;
  625. $('.fileBox .files').each(function (j, m) {
  626. var aa = $(m).attr("fiel-num")
  627. str += aa + ",";
  628. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  629. })
  630. $("#file").val(Str);
  631. }
  632. // 处理结果判断
  633. function isProResultJudge(isProResultdata) {
  634. // if (isProResultdata === '1') {
  635. // if (isProtect === "1") {
  636. // $(".prosituation-wrapper").hide(); //处理方案/进程
  637. // $(".annotation-wrapper").hide(); //注释
  638. // $(".connecttime-wrapper").hide(); //沟通时间
  639. // $(".connectmode-wrapper").hide(); //沟通方式
  640. // // $(".replycontent-wrapper").hide(); //答复内容
  641. // $(".isstaisfied-wrapper").hide(); //是否满意
  642. // // $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  643. // } else if (isProtect === "0") {
  644. // $(".prosituation-wrapper").hide(); //处理方案/进程
  645. // $(".annotation-wrapper").hide(); //注释
  646. // $(".connecttime-wrapper").show(); //沟通时间
  647. // $(".connectmode-wrapper").show(); //沟通方式
  648. // // $(".replycontent-wrapper").show(); //答复内容
  649. // $(".isstaisfied-wrapper").show(); //是否满意
  650. // // $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  651. // }
  652. // } else if (isProResultdata === '2') {
  653. // $(".prosituation-wrapper").show(); //处理方案/进程
  654. // $(".annotation-wrapper").show(); //注释
  655. // $(".connecttime-wrapper").hide(); //沟通时间
  656. // $(".connectmode-wrapper").hide(); //沟通方式
  657. // // $(".replycontent-wrapper").hide(); //答复内容
  658. // $(".isstaisfied-wrapper").hide(); //是否满意
  659. // // $(".dealWithRemark-wrapper").show(); // 已办未果备注
  660. // }
  661. if (isProResultdata === "1") {
  662. // if (isProtect === "1") {
  663. // $(".prosituation-wrapper").hide(); //处理方案/进程
  664. // $(".annotation-wrapper").hide(); //注释
  665. // $(".connecttime-wrapper").hide(); //沟通时间
  666. // $(".connectmode-wrapper").hide(); //沟通方式
  667. // // $(".replycontent-wrapper").hide(); //答复内容
  668. // $(".isstaisfied-wrapper").show(); //是否满意
  669. // $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  670. // } else if (isProtect === "0") {
  671. $(".prosituation-wrapper").hide(); //处理方案/进程
  672. $(".annotation-wrapper").hide(); //注释
  673. $(".connecttime-wrapper").hide(); //沟通时间
  674. $(".connectmode-wrapper").hide(); //沟通方式
  675. // $(".replycontent-wrapper").show(); //答复内容
  676. $(".isstaisfied-wrapper").show(); //是否满意
  677. $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  678. // }
  679. } else if (isProResultdata === "2") {
  680. $(".prosituation-wrapper").show(); //处理方案/进程
  681. $(".annotation-wrapper").show(); //注释
  682. $(".connecttime-wrapper").hide(); //沟通时间
  683. $(".connectmode-wrapper").hide(); //沟通方式
  684. // $(".replycontent-wrapper").hide(); //答复内容
  685. $(".isstaisfied-wrapper").hide(); //是否满意
  686. $(".dealWithRemark-wrapper").show(); // 已办未果备注
  687. } else if (isProResultdata === "0") {
  688. $(".prosituation-wrapper").hide(); //处理方案/进程
  689. $(".annotation-wrapper").hide(); //注释
  690. $(".connecttime-wrapper").hide(); //沟通时间
  691. $(".connectmode-wrapper").hide(); //沟通方式
  692. // $(".replycontent-wrapper").show(); //答复内容
  693. $(".isstaisfied-wrapper").hide(); //是否满意
  694. $(".dealWithRemark-wrapper").hide(); // 已办未果备注
  695. }
  696. }
  697. //简易版工单详情
  698. function simpleDetail() {
  699. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkorderSimp', {
  700. workorderid: wid,
  701. token: $.cookie("token")
  702. }, function (result) {
  703. if (result.state.toLowerCase() == "success") {
  704. var data = result.data[0];
  705. var date = new Date()
  706. var year = date.getFullYear();
  707. var month = date.getMonth();
  708. var day = date.getDate();
  709. var hour = date.getHours();
  710. var minutes = date.getMinutes();
  711. var seconds = date.getSeconds();
  712. month = month + 1;
  713. if (month >= 1 && month <= 9) {
  714. month = "0" + month
  715. }
  716. if (day >= 1 && day <= 9) {
  717. day = "0" + day
  718. }
  719. var daysTime = year + "年" + month + "月" + day + "日 " + hour + "时" + minutes + "分" +
  720. seconds + "秒"
  721. // simpleDetailStrStart =
  722. // data.deptname +
  723. // "于时间(" +
  724. // daysTime +
  725. // ")回复:"
  726. // data.SourceName +
  727. // "来源工单(编号:" +
  728. // data.F_WorkOrderId +
  729. // ")反映" +
  730. // data.F_ComTitle +
  731. // "问题,";
  732. }
  733. })
  734. }
  735. function getHistoryList() {
  736. $("#dealmanList").empty()
  737. $.ajax({
  738. type: "get",
  739. url: huayi.config.callcenter_url + "History/GetList",
  740. async: true,
  741. dataType: "json",
  742. data: {
  743. name: "contractor",
  744. token: $.cookie("token"),
  745. },
  746. success: function (res) {
  747. if (res.state == "success") {
  748. $.each(res.data, function (index, val) {
  749. if (val.F_Count !== "") {
  750. var data = JSON.parse(val.F_Count)
  751. $("#dealmanList").append("<option value='" + data.name +
  752. "'data-contact='" + data.contact + "'data-job='" + data
  753. .job + "'>")
  754. }
  755. })
  756. $("#dealmanList").append("<option value='清除历史记录'>")
  757. } else {
  758. layer.confirm(res.message, {
  759. icon: 2,
  760. btn: ['确定']
  761. });
  762. }
  763. }
  764. });
  765. }
  766. $("#dealman").change(function () {
  767. var name = $("#dealman").val()
  768. if (name === "清除历史记录") {
  769. $("#dealman").val("")
  770. deleteHistory()
  771. return
  772. }
  773. $("#dealmanList").find("option").each(function () {
  774. if (name == $(this).val()) {
  775. $("#dealcontact").val($(this).attr("data-contact"))
  776. $("#duties").val($(this).attr("data-job"))
  777. }
  778. })
  779. // $("#dealcontact").attr("data-contact")
  780. // $("#duties").attr("data-job")
  781. })
  782. function addHistory() {
  783. var contractorObject = {
  784. name: $("#dealman").val(),
  785. contact: $("#dealcontact").val(),
  786. job: $("#duties").val(),
  787. }
  788. var contractorObjectStr = JSON.stringify(contractorObject);
  789. $.ajax({
  790. type: "post",
  791. url: huayi.config.callcenter_url + "History/Add",
  792. async: true,
  793. dataType: "json",
  794. data: {
  795. name: "contractor",
  796. count: contractorObjectStr,
  797. token: $.cookie("token"),
  798. },
  799. success: function (res) {
  800. var res = $.parseJSON(res)
  801. if (res.state == "success") {
  802. } else {
  803. layer.confirm(res.message, {
  804. icon: 2,
  805. btn: ['确定']
  806. });
  807. }
  808. }
  809. });
  810. }
  811. function deleteHistory() {
  812. $.ajax({
  813. type: "post",
  814. url: huayi.config.callcenter_url + "History/Delete",
  815. async: true,
  816. dataType: "json",
  817. data: {
  818. type: 1,
  819. token: $.cookie("token"),
  820. },
  821. success: function (res) {
  822. if (res.state == "success") {
  823. getHistoryList()
  824. } else {
  825. }
  826. }
  827. });
  828. }
  829. </script>
  830. </body>
  831. </html>