Bez popisu

Supervision_.html 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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 rel="stylesheet" href="../css/bootstrap-select.css" />
  8. <link rel="stylesheet" href="../css/addappeal.css" />
  9. <link rel="stylesheet" href="../css/layer/need/layer.css" />
  10. <link rel="stylesheet" href="../css/init.css" />
  11. <title>监察</title>
  12. <style>
  13. .input {
  14. background-color: #FFF;
  15. background-image: none;
  16. border: 1px solid #ccc;
  17. border-radius: 1px;
  18. color: inherit;
  19. padding: 6px 12px
  20. }
  21. .fjnr {
  22. padding: 0 !important;
  23. border: none !important;
  24. }
  25. #message {
  26. display: none;
  27. }
  28. .Common {
  29. height: 90%;
  30. }
  31. .whetherSupervise {
  32. display: none;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <div class="Common">
  38. <table>
  39. <tr>
  40. <th class="Importent title">督查意见:</th>
  41. <td><textarea data-adaptheight id='overseeopinion' textarea name="" rows="4" cols=""></textarea></td>
  42. </tr>
  43. <tr>
  44. <th>附件上传:</th>
  45. <td colspan="7">
  46. <!--<span class="fjnr"></span>-->
  47. <div class="fileBox">
  48. <!--<span class="files">文件1<i class="fa fa-remove"></i></span>-->
  49. </div>
  50. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  51. style="display: none;">
  52. <input class="input" type="button" value="上传" id="scwj" />
  53. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  54. <input type="hidden" id="file" />
  55. <span style="color:#FF0000; border: none;">
  56. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  57. </span>
  58. </td>
  59. </tr>
  60. <!-- <tr class="whetherSupervise">
  61. <th>是否发送短信:</th>
  62. <td>
  63. <div id="message" style="text-align: left;">
  64. <input type="radio" name="message" id="" value="0" />否
  65. <input type="radio" name="message" id="" value="1" />是
  66. </div>
  67. </td>
  68. </tr> -->
  69. <tr class="whetherSupervise">
  70. <th>交办单位:</th>
  71. <td colspan="1">
  72. <select id="jbSelect" name="select" class="selectpicker show-tick form-control" multiple
  73. data-live-search="true">
  74. </select>
  75. </td>
  76. </tr>
  77. <tr class="whetherSupervise limittimeWrapper">
  78. <th>办理时限:</th>
  79. <td colspan="">
  80. <select class="startTime" id="startTime" style="width: 200px; height: 30px; line-height: 30px;">
  81. <!--<option value="0">选择</option>-->
  82. <option value="1">一天</option>
  83. <option value="3">三天</option>
  84. <option value="5">五天</option>
  85. <option value="7">七天</option>
  86. </select>
  87. </td>
  88. </tr>
  89. <tr class="whetherSupervise limittimesWrapper">
  90. <th>紧急时限:</th>
  91. <td colspan="">
  92. <input type="text" id="limittimes">
  93. </td>
  94. </tr>
  95. </table>
  96. <div class="btn_box">
  97. <button class="btns DB">保存</button>
  98. <button class="btns JC">保存</button>
  99. </div>
  100. </div>
  101. <script src="../js/adjustHeight.js"></script>
  102. <script src="../js/bootstrap-select.js"></script>
  103. <script src="../css/laydate/laydate.js"></script>
  104. <script>
  105. var wid = helper.request.queryString("wid");
  106. var type = helper.request.queryString("type");
  107. var state = helper.request.queryString("state");
  108. var depId = helper.request.queryString("depId");
  109. var pageName = helper.request.queryString("pageName");
  110. var level;
  111. $(document).ready(function () {
  112. laydate.skin("blue");
  113. laydate({
  114. elem: "#limittimes",
  115. event: "focus",
  116. istime: true,
  117. format: 'YYYY-MM-DD hh:mm:ss'
  118. });
  119. jbSelect($("#jbSelect"));
  120. if (type == 1) {
  121. if (state == 1) {
  122. $(".title").text("督办意见");
  123. $(".JC").hide();
  124. // $('#message').show();
  125. if (pageName === "superviseUpcoming") {
  126. $('.whetherSupervise').show();
  127. } else if (pageName === "haveAduit") {
  128. $('.whetherSupervise').hide();
  129. }
  130. } else {
  131. $(".title").text("不督办意见");
  132. $(".JC").hide();
  133. // $('#message').hide()
  134. $('.whetherSupervise').hide();
  135. }
  136. } else {
  137. $(".title").text("监察意见")
  138. $(".DB").hide();
  139. }
  140. if (wid) {
  141. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrder', {
  142. workorderid: wid,
  143. "token": $.cookie("token")
  144. }, function (result) {
  145. if (result.state.toLowerCase() == "success") {
  146. var content = result.data;
  147. if (content.data[0].F_DeptIdIsSms == 1) {
  148. // $('#message input[value="1"]').attr('checked', true)
  149. } else {
  150. // $('#message input[value="0"]').attr('checked', true)
  151. }
  152. level = content.data[0].F_Level + ""
  153. if (level === "1") {
  154. $(".limittimesWrapper").hide()
  155. $(".limittimeWrapper").show()
  156. } else {
  157. $(".limittimesWrapper").show()
  158. $(".limittimeWrapper").hide()
  159. }
  160. }
  161. })
  162. }
  163. $(".DB").click(function () {
  164. if ($("#overseeopinion").val() == '') {
  165. layer.msg("意见不能为空");
  166. } else {
  167. type = 1;
  168. JA();
  169. // if ($('#message input[type="radio"]:checked').val() == 1) {
  170. // sendMessage();
  171. // }
  172. }
  173. })
  174. $(".JC").click(function () {
  175. if ($("#overseeopinion").val() == '') {
  176. layer.msg("意见不能为空");
  177. } else {
  178. type = 2;
  179. JA();
  180. }
  181. })
  182. //上传附件
  183. $("#scwj").click(function () {
  184. $("#upFile").trigger("click");
  185. })
  186. $("#upFile").change(function () {
  187. upload();
  188. })
  189. // $("#scfj").click(function() {
  190. // $(".fjnr").text("");
  191. // $("#scfj").hide();
  192. // })
  193. })
  194. //发送短信
  195. function sendMessage() {
  196. $.post(huayi.config.callcenter_url + 'WorkOrder/SendSms', {
  197. workordercode: wid,
  198. deptid: depId, //承办单位
  199. type: 1,
  200. token: $.cookie("token")
  201. }, function (result) {
  202. result = JSON.parse(result);
  203. if (result.state.toLowerCase() == 'success') {
  204. layer.msg('发送短信成功')
  205. }
  206. })
  207. }
  208. //督察
  209. function JA() {
  210. $.post(huayi.config.callcenter_url + 'WorkOrder/RemindWorkOrder', {
  211. workorderid: wid,
  212. overseeopinion: $("#overseeopinion").val(),
  213. type: type,
  214. state: state,
  215. files: $("#file").val(),
  216. "token": $.cookie("token")
  217. }, function (result) {
  218. result = JSON.parse(result);
  219. if (result.state.toLowerCase() == "success") {
  220. parent.$('#orderlist').bootstrapTable('refresh');
  221. parent.layer.msg("操作成功");
  222. $('.fileBox').html('');
  223. console.log("state", state, typeof (state))
  224. if (state === "1") {
  225. if (pageName === "superviseUpcoming") {
  226. jb()
  227. } else if (pageName === "haveAduit") {
  228. hf()
  229. }
  230. } else {
  231. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  232. parent.layer.close(index); //再执行关闭
  233. }
  234. }
  235. })
  236. }
  237. //上传文件
  238. function upload() {
  239. var Files = document.getElementById("upFile").files;
  240. if (Files.length > 0) {
  241. var formData = new FormData();
  242. for (var i = 0; i < Files.length; i++) {
  243. formData.append('file' + i, Files[i]);
  244. }
  245. formData.append("token", $.cookie("token"));
  246. var typeName = Files[0].name.split('.')[1];
  247. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'mp3' || typeName ==
  248. 'pdf' || typeName == 'doc' || typeName == 'docx' || typeName == 'xls' || typeName == 'xlsx') {
  249. $.ajax({
  250. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  251. type: "POST",
  252. data: formData,
  253. /**
  254. *必须false才会自动加上正确的Content-Type
  255. */
  256. contentType: false,
  257. /**
  258. * 必须false才会避开jQuery对 formdata 的默认处理
  259. * XMLHttpRequest会对 formdata 进行正确的处理
  260. */
  261. processData: false,
  262. success: function (result) {
  263. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  264. .outerHTML;
  265. $("#upFile").change(function () {
  266. upload();
  267. });
  268. var r = $.parseJSON(result);
  269. if (r.state.toLowerCase() == "success") {
  270. $(".fjnr").text(r.data[0].F_FileName);
  271. var a = r.data;
  272. // var str = '';
  273. // var Str;
  274. $(a).each(function (i, n) {
  275. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  276. '">' + n.F_FileName.substring(19) +
  277. '<i class="fa fa-remove del_file"></i></span>'
  278. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  279. function (event) {
  280. event.stopPropagation();
  281. $(this).parent().remove();
  282. file_num();
  283. })
  284. })
  285. file_num();
  286. }
  287. }
  288. });
  289. } else {
  290. layer.msg("格式不正确");
  291. }
  292. } else {
  293. layer.confirm('请上传文件!', {
  294. btn: ['确定']
  295. });
  296. }
  297. }
  298. //上传文件隐藏域值
  299. function file_num() {
  300. var str = '';
  301. var Str;
  302. $('.fileBox .files').each(function (j, m) {
  303. var aa = $(m).attr("fiel-num")
  304. console.log(aa);
  305. str += aa + ",";
  306. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  307. })
  308. $("#file").val(Str);
  309. }
  310. //交办
  311. function jb() {
  312. var jbSelect = $("#jbSelect").val();
  313. var startTime = $("#startTime").val();
  314. var limittimes = $("#limittimes").val();
  315. layer.open({
  316. type: 2,
  317. content: "../CommonHtml/jiaoban.html?wid=" + wid + "&jbSelect=" + jbSelect + "&startTime=" +
  318. startTime + "&limittimes=" + limittimes + "&level=" + level, //iframe的url,no代表不显示滚动条
  319. title: '工单交办',
  320. area: ['95%', '95%'], //宽高
  321. });
  322. }
  323. //诉求回访
  324. function hf() {
  325. layer.open({
  326. type: 2,
  327. content: "../CommonHtml/Back.html?wid=" + wid, //iframe的url,no代表不显示滚动条
  328. title: '工单回访',
  329. area: ['95%', '95%'], //宽高
  330. });
  331. }
  332. function jbSelect(obj) {
  333. obj.empty();
  334. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  335. "token": $.cookie("token"),
  336. "iscbdw": 1,
  337. }, function (data) {
  338. if (data.state.toLowerCase() == "success") {
  339. var content = data.data;
  340. $("<option value=''>请选择</option>").appendTo(obj);
  341. $(content).each(function (i, n) {
  342. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  343. obj);
  344. })
  345. obj.selectpicker({
  346. noneSelectedText: '请选择' //默认显示内容
  347. });
  348. obj.selectpicker('refresh');
  349. }
  350. })
  351. }
  352. // 关闭弹出页
  353. function closePage() {
  354. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  355. parent.layer.close(index); //再执行关闭
  356. parent.$("#orderlist").bootstrapTable("refresh");
  357. parent.layer.msg("操作成功");
  358. }
  359. </script>
  360. </body>
  361. </html>