Brak opisu

Supervision_.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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">
  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. </table>
  90. <div class="btn_box">
  91. <button class="btns DB">保存</button>
  92. <button class="btns JC">保存</button>
  93. </div>
  94. </div>
  95. <script src="../js/adjustHeight.js"></script>
  96. <script src="../js/bootstrap-select.js"></script>
  97. <script>
  98. var wid = helper.request.queryString("wid");
  99. var type = helper.request.queryString("type");
  100. var state = helper.request.queryString("state");
  101. var depId = helper.request.queryString("depId");
  102. var pageName = helper.request.queryString("pageName");
  103. $(document).ready(function () {
  104. jbSelect($("#jbSelect"));
  105. if (wid) {
  106. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrder', {
  107. workorderid: wid,
  108. "token": $.cookie("token")
  109. }, function (result) {
  110. if (result.state.toLowerCase() == "success") {
  111. var content = result.data;
  112. if (content.data[0].F_DeptIdIsSms == 1) {
  113. $('#message input[value="1"]').attr('checked', true)
  114. } else {
  115. $('#message input[value="0"]').attr('checked', true)
  116. }
  117. }
  118. })
  119. }
  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. $(".DB").click(function () {
  141. if ($("#overseeopinion").val() == '') {
  142. layer.msg("意见不能为空");
  143. } else {
  144. type = 1;
  145. JA();
  146. if ($('#message input[type="radio"]:checked').val() == 1) {
  147. sendMessage();
  148. }
  149. }
  150. })
  151. $(".JC").click(function () {
  152. if ($("#overseeopinion").val() == '') {
  153. layer.msg("意见不能为空");
  154. } else {
  155. type = 2;
  156. JA();
  157. }
  158. })
  159. //上传附件
  160. $("#scwj").click(function () {
  161. $("#upFile").trigger("click");
  162. })
  163. $("#upFile").change(function () {
  164. upload();
  165. })
  166. // $("#scfj").click(function() {
  167. // $(".fjnr").text("");
  168. // $("#scfj").hide();
  169. // })
  170. })
  171. //发送短信
  172. function sendMessage() {
  173. $.post(huayi.config.callcenter_url + 'WorkOrder/SendSms', {
  174. workordercode: wid,
  175. deptid: depId, //承办单位
  176. type: 1,
  177. token: $.cookie("token")
  178. }, function (result) {
  179. result = JSON.parse(result);
  180. if (result.state.toLowerCase() == 'success') {
  181. layer.msg('发送短信成功')
  182. }
  183. })
  184. }
  185. //督察
  186. function JA() {
  187. $.post(huayi.config.callcenter_url + 'WorkOrder/RemindWorkOrder', {
  188. workorderid: wid,
  189. overseeopinion: $("#overseeopinion").val(),
  190. type: type,
  191. state: state,
  192. files: $("#file").val(),
  193. "token": $.cookie("token")
  194. }, function (result) {
  195. result = JSON.parse(result);
  196. if (result.state.toLowerCase() == "success") {
  197. parent.$('#orderlist').bootstrapTable('refresh');
  198. parent.layer.msg("操作成功");
  199. $('.fileBox').html('');
  200. console.log("state", state, typeof (state))
  201. if (state === "1") {
  202. if (pageName === "superviseUpcoming") {
  203. jb()
  204. } else if (pageName === "haveAduit") {
  205. hf()
  206. }
  207. } else {
  208. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  209. parent.layer.close(index); //再执行关闭
  210. }
  211. }
  212. })
  213. }
  214. //上传文件
  215. function upload() {
  216. var Files = document.getElementById("upFile").files;
  217. if (Files.length > 0) {
  218. var formData = new FormData();
  219. for (var i = 0; i < Files.length; i++) {
  220. formData.append('file' + i, Files[i]);
  221. }
  222. formData.append("token", $.cookie("token"));
  223. var typeName = Files[0].name.split('.')[1];
  224. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'mp3' || typeName ==
  225. 'pdf' || typeName == 'doc' || typeName == 'docx' || typeName == 'xls' || typeName == 'xlsx') {
  226. $.ajax({
  227. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  228. type: "POST",
  229. data: formData,
  230. /**
  231. *必须false才会自动加上正确的Content-Type
  232. */
  233. contentType: false,
  234. /**
  235. * 必须false才会避开jQuery对 formdata 的默认处理
  236. * XMLHttpRequest会对 formdata 进行正确的处理
  237. */
  238. processData: false,
  239. success: function (result) {
  240. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  241. .outerHTML;
  242. $("#upFile").change(function () {
  243. upload();
  244. });
  245. var r = $.parseJSON(result);
  246. if (r.state.toLowerCase() == "success") {
  247. $(".fjnr").text(r.data[0].F_FileName);
  248. var a = r.data;
  249. // var str = '';
  250. // var Str;
  251. $(a).each(function (i, n) {
  252. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  253. '">' + n.F_FileName.substring(19) +
  254. '<i class="fa fa-remove del_file"></i></span>'
  255. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  256. function (event) {
  257. event.stopPropagation();
  258. $(this).parent().remove();
  259. file_num();
  260. })
  261. })
  262. file_num();
  263. }
  264. }
  265. });
  266. } else {
  267. layer.msg("格式不正确");
  268. }
  269. } else {
  270. layer.confirm('请上传文件!', {
  271. btn: ['确定']
  272. });
  273. }
  274. }
  275. //上传文件隐藏域值
  276. function file_num() {
  277. var str = '';
  278. var Str;
  279. $('.fileBox .files').each(function (j, m) {
  280. var aa = $(m).attr("fiel-num")
  281. console.log(aa);
  282. str += aa + ",";
  283. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  284. })
  285. $("#file").val(Str);
  286. }
  287. //交办
  288. function jb() {
  289. var jbSelect = $("#jbSelect").val();
  290. var startTime = $("#startTime").val()
  291. layer.open({
  292. type: 2,
  293. content: "../CommonHtml/jiaoban.html?wid=" + wid + "&jbSelect=" + jbSelect + "&startTime=" +
  294. startTime, //iframe的url,no代表不显示滚动条
  295. title: '工单交办',
  296. area: ['95%', '95%'], //宽高
  297. });
  298. }
  299. //诉求回访
  300. function hf() {
  301. layer.open({
  302. type: 2,
  303. content: "../CommonHtml/Back.html?wid=" + wid, //iframe的url,no代表不显示滚动条
  304. title: '工单回访',
  305. area: ['95%', '95%'], //宽高
  306. });
  307. }
  308. function jbSelect(obj) {
  309. obj.empty();
  310. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  311. "token": $.cookie("token"),
  312. "iscbdw": 1,
  313. }, function (data) {
  314. if (data.state.toLowerCase() == "success") {
  315. var content = data.data;
  316. $("<option value=''>请选择</option>").appendTo(obj);
  317. $(content).each(function (i, n) {
  318. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  319. obj);
  320. })
  321. obj.selectpicker({
  322. noneSelectedText: '请选择' //默认显示内容
  323. });
  324. obj.selectpicker('refresh');
  325. }
  326. })
  327. }
  328. // 关闭弹出页
  329. function closePage() {
  330. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  331. parent.layer.close(index); //再执行关闭
  332. parent.$("#orderlist").bootstrapTable("refresh");
  333. parent.layer.msg("操作成功");
  334. }
  335. </script>
  336. </body>
  337. </html>