Keine Beschreibung

Supervision_.html 14KB

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