商丘12345 前端

lawsuits.html 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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 type="text/css">
  11. .isStandard,
  12. .bulletUnit{
  13. display: none;
  14. }
  15. .bulletUnit ul{
  16. list-style: none;
  17. margin: 0;
  18. padding: 0;
  19. }
  20. .bulletUnit ul li{
  21. float: left;
  22. margin-right: 20px;
  23. text-align: center;
  24. padding: 6px 0;
  25. }
  26. .bulletUnit li input{
  27. display: none;
  28. }
  29. .bulletUnit li label{
  30. margin: 0;
  31. font-weight: normal;
  32. display: block;
  33. width: 100%;
  34. border: 1px solid #ccc;
  35. padding: 2px 10px;
  36. cursor: pointer;
  37. }
  38. .bulletUnit li label:hover{
  39. /*border-color: #fe6604;*/
  40. }
  41. .bulletUnit .checkedDept{
  42. border-color: #fe6604;
  43. }
  44. select:disabled{
  45. background-color: #eee;
  46. }
  47. .reasons{
  48. display: none;
  49. height: 160px;
  50. }
  51. #reasons{
  52. height: 160px;
  53. }
  54. </style>
  55. </head>
  56. <body>
  57. <div class="Common">
  58. <table>
  59. <tr>
  60. <th class="Importent">回访结果:</th>
  61. <td>
  62. <input checked="true" type="radio" value="1" name="huifang" />满意
  63. <input type="radio" value="0" name="huifang"/>不满意
  64. </td>
  65. </tr>
  66. <tr>
  67. <th class="Importent">是否通报:</th>
  68. <td>
  69. <select class="select_" id='isBulletin'>
  70. <option value="0">否</option>
  71. <option value="1">是</option>
  72. </select>
  73. </td>
  74. </tr>
  75. <tr id="bulletinUnit" class="bulletUnit">
  76. <th class="Importent">通报单位:</th>
  77. <td>
  78. <ul>
  79. </ul>
  80. </td>
  81. </tr>
  82. <tr class="bulletUnit">
  83. <th class="Importent">通报原因:</th>
  84. <td>
  85. <select name="" class="form-control orderType">
  86. <option value="0">请选择通报原因</option>
  87. </select>
  88. </td>
  89. <!--<td><textarea name="" rows="4" cols="" id="bulletinReason"></textarea></td>-->
  90. </tr>
  91. <tr class="reasons">
  92. <th class="Importent">其他原因:</th>
  93. <td colspan="2"><textarea data-adaptheight id="reasons" name="" rows="6" cols=""></textarea></td>
  94. </tr>
  95. <tr>
  96. <th class="Importent">是否规范:</th>
  97. <td>
  98. <select class="select_" id='isStandard'>
  99. <option value="0">是</option>
  100. <option value="1">否</option>
  101. </select>
  102. </td>
  103. </tr>
  104. <tr class="isStandard">
  105. <th class="Importent">不规范原因:</th>
  106. <td>
  107. <select name="" class="form-control standard">
  108. <option value="0">请选择不规范原因</option>
  109. </select>
  110. </td>
  111. </tr>
  112. <tr>
  113. <th class="Importent">备注:</th>
  114. <td colspan="2"><textarea data-adaptheight id="finalopinion" name="" rows="6" cols=""></textarea></td>
  115. </tr>
  116. </table>
  117. <div class="btn_box">
  118. <button class="btns">保存</button>
  119. </div>
  120. </div>
  121. <input type="hidden" name="depID" id="depID" value="" />
  122. <script src="../js/adjustHeight.js"></script>
  123. <script>
  124. var wid = helper.request.queryString("wid");
  125. var bulletinUnits = '';//通报单位
  126. $(document).ready(function() {
  127. //通报原因
  128. getOrderType();
  129. //获取单位
  130. getUnit();
  131. //不规范原因
  132. getIsStandard();
  133. //是否通报
  134. $('#isBulletin').change(function(){
  135. if($('#isBulletin').val() == '0'){
  136. //默认不通报,通报单位通报原因不显示
  137. $('.bulletUnit').hide();
  138. }else if($('#isBulletin').val()== '1'){
  139. //选择是 ,显示通报单位通报原因;
  140. $('.bulletUnit').show();
  141. }
  142. });
  143. //是否规范
  144. $('#isStandard').change(function(){
  145. if($('#isStandard').val() == '0'){
  146. //默认规范
  147. $('.isStandard').hide();
  148. }else if($('#isStandard').val()== '1'){
  149. $('.isStandard').show();
  150. }
  151. });
  152. $(".btns").click(function(){
  153. if($('#isBulletin').val() == 0){
  154. JA(bulletinUnits);
  155. }else if($('#isBulletin').val() == 1){
  156. // if($("input[name='checkbox']:checkbox:checked").length <= 0){
  157. // layer.msg("您没有选择通报单位。");
  158. // }else
  159. if(!$(".orderType").val() || $('.orderType').val()==0){
  160. layer.msg("通报原因没有填写。");
  161. return
  162. }else if ($(".orderType").val()==76&& !$('#reasons').val()){
  163. layer.msg('其他通报原因没有填写');
  164. return
  165. }else {
  166. $("input[name='checkbox']:checkbox:checked").each(function(){
  167. bulletinUnits += $(this).val() + ',';
  168. });
  169. bulletinUnits = bulletinUnits.substring(0,bulletinUnits.length-1);
  170. JA(bulletinUnits);
  171. }
  172. }
  173. });
  174. })
  175. function JA(bUnits) {
  176. var standardID=$('.standard').val()
  177. if($('#isStandard').val()==1 && standardID==0){
  178. layer.msg('请选择不规范原因');
  179. return
  180. }else if($('#isStandard').val()==0) {
  181. standardID=''
  182. }
  183. $.post(huayi.config.callcenter_url + 'WorkOrder/FinishWorkOrder', {
  184. workorderid: wid,
  185. issatisfie:$('input[name="huifang"]:checked ').val(),
  186. finalopinion: $("#finalopinion").val(),
  187. isnotice: $('#isBulletin').val(),//0不通告1通告
  188. deptids: $('#depID').val(),//通报单位
  189. // noticereson: $('#bulletinReason').val(),//通报原因
  190. noticeid:$('.orderType').val(),//通报id
  191. noticeinfo:$('.orderType').find("option:selected").text(),
  192. noticereson:$('#reasons').val(),//其他通报原因
  193. isstandard:$('#isStandard').val(),//是否规范0是1否
  194. standardids:standardID,//不规范id
  195. "token": $.cookie("token")
  196. }, function(result) {
  197. result = JSON.parse(result);
  198. if(result.state.toLowerCase() == "success") {
  199. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  200. parent.layer.close(index); //再执行关闭
  201. parent.$('#orderlist').bootstrapTable('refresh');
  202. parent.layer.msg("结案成功");
  203. }
  204. })
  205. }
  206. //获取单位
  207. function getUnit() {
  208. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetAllAssignDept', {
  209. workorderid: wid,
  210. token: $.cookie("token")
  211. }, function(result) {
  212. if(result.state.toLowerCase() == "success") {
  213. $('#depID').val(result.data[0].F_DeptId)
  214. if(result.data.length > 0) {
  215. $('#isBulletin').removeAttr("disabled");
  216. for(var i = 0; i < result.data.length; i++){
  217. $('#bulletinUnit ul').append('<li><input type="checkbox" name="checkbox" id="unit'+i+'" value=""/>'+
  218. '<label for="unit'+i+'">'+ result.data[i].F_DeptName +'</label></li>');
  219. }
  220. if(('#bulletinUnit input').length>0){
  221. $('#bulletinUnit input').each(function(index){
  222. if($(this).is('[type=checkbox]')){
  223. var cinput = $(this);
  224. var label = $('label[for='+cinput.attr('id')+']');
  225. cinput.bind('updateState', function(){
  226. if(cinput.is(':checked')){
  227. label.addClass('checkedDept');
  228. cinput.val(result.data[index].F_DeptId);
  229. }else{
  230. label.removeClass('checkedDept');
  231. cinput.val('');
  232. }
  233. })
  234. .trigger('updateState')
  235. .click(function(){
  236. $('input[name='+ $(this).attr('name') +']').trigger('updateState');
  237. });
  238. }
  239. });
  240. }
  241. }else{
  242. $('#isBulletin').attr("disabled","disabled");
  243. }
  244. }
  245. })
  246. }
  247. function getOrderType() {
  248. $.get(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByParentId', {
  249. "token": $.cookie("token"),
  250. pid: 62
  251. }, function(result) {
  252. result = $.parseJSON(result);
  253. var Count = result.data;
  254. $(Count).each(function(i, n) {
  255. $('<option value="' + n.F_ValueId + '">' + n.F_Value + '</option>').appendTo($(".orderType"));
  256. })
  257. });
  258. }
  259. //不规范原因
  260. function getIsStandard() {
  261. $.get(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByParentId', {
  262. "token": $.cookie("token"),
  263. pid: 78
  264. }, function(result) {
  265. result = $.parseJSON(result);
  266. var Count = result.data;
  267. $(Count).each(function(i, n) {
  268. $('<option value="' + n.F_ValueId + '">' + n.F_Value + '</option>').appendTo($(".standard"));
  269. })
  270. });
  271. }
  272. $('.orderType').change(()=>{
  273. if($('.orderType').val()==76){
  274. $('.reasons').show()
  275. }else{
  276. $('.reasons').hide()
  277. }
  278. })
  279. </script>
  280. </body>
  281. </html>