Açıklama Yok

Supervision_.html 15KB

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