阜外心血管项目前端

orderDetail.js 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. mui.init({})
  2. var id = helper.request.queryString("id");
  3. var state = helper.request.queryString("type");
  4. var openid = helper.cookies.get("openid");
  5. //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
  6. var roleCode = helper.cookies.get("RoleCode");
  7. var backType=0,turn=1;
  8. if (!openid) {
  9. var openid = helper.request.queryString("openid");
  10. }
  11. function formatterDealDetail(val, row) {
  12. return str;
  13. }
  14. if (roleCode=="JDYPTZX"||roleCode=="JDYBZZX") {
  15. $(".sendBackBtn").remove();
  16. } else if(roleCode=="JG"){
  17. $(".sendBackBtn").show();
  18. $(".unusualBtn").show();
  19. }else if(roleCode=="BLRY"){
  20. $(".unusualBtn").show();
  21. $(".allotBtn").hide();
  22. backType=1;
  23. }
  24. $(function () {
  25. Ajax();
  26. if (state=="0") {
  27. $(".dispose1").show();
  28. } else if (state=="1") {
  29. $(".dispose2").show();
  30. } else if(state=="2"){
  31. $(".dispose3").show();
  32. } else if(state=="3"){
  33. $(".dispose4").show();
  34. }
  35. //返回列表
  36. $('.return').on('tap', function() {
  37. if (state==0) {
  38. window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
  39. }else if (state==1) {
  40. window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
  41. }else if (state==2) {
  42. window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
  43. } else if (state==3){
  44. window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
  45. }else if (state==4){
  46. window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
  47. }
  48. //window.location.href = "client_index.html?Itype=" + itype;
  49. });
  50. })
  51. //接单
  52. $(".redeploy").click(function(){
  53. var btnArray = ['否', '是'];
  54. mui.confirm('确定接单?', '提示', btnArray, function(f) {
  55. if(f.index == 1) {
  56. $.ajax({
  57. type: "post",
  58. dataType: 'json',
  59. url: huayi.config.callcenter_url + '/WxLogin/SureWorkOrder',
  60. async: true,
  61. data: {
  62. orderid: id, //否 strubg 工单编号
  63. openid: openid, //微信openid 测试用
  64. },
  65. success: function(data) {
  66. if(data.state == "success") {
  67. debugger
  68. mui.toast('接单成功');
  69. window.location.href = "orderList.html?Itype=1";
  70. } else {
  71. mui.toast(data.message);
  72. }
  73. }
  74. });
  75. } else {
  76. mui.toast("取消");
  77. }
  78. })
  79. })
  80. //退回
  81. $(".backBtn").click(function(){
  82. $(".pop_up_bj").fadeIn();
  83. $(".pop_up_div3").fadeIn();
  84. backType=0;
  85. itype=1;
  86. })
  87. $(".unusualBtn").click(function(){
  88. $(".pop_up_bj").fadeIn();
  89. $(".pop_up_div3").fadeIn();
  90. backType=1;
  91. itype=2;
  92. })
  93. $(".pop_up_bj" ).click(function(){
  94. $(".pop_up_bj").hide();
  95. $(".pop_up_div3").hide();
  96. })
  97. $(".pop_up_div3 .btn .fl" ).click(function(){
  98. $(".pop_up_bj").hide();
  99. $(".pop_up_div3").hide();
  100. mui.alert("取消");
  101. })
  102. $(".pop_up_div3 .btn .fr").click(function(){
  103. if($(".textcont_back").val()=="") {
  104. mui.alert("请输入退回内容");
  105. }else{
  106. $(".pop_up_bj").hide();
  107. $(".pop_up_div3").hide();
  108. $.ajax({
  109. type: "post",
  110. dataType: 'json',
  111. url: huayi.config.callcenter_url + '/WxLogin/BackWorkOrder',
  112. async: true,
  113. data: {
  114. openid: openid, //微信openid 测试用
  115. orderid: id, //否 strubg 工单编号
  116. cont:$(".textcont_back").val(),
  117. type:backType,
  118. },
  119. success: function(data) {
  120. if(data.state == "success") {
  121. debugger
  122. mui.toast('退回成功');
  123. window.location.href = "orderList.html?Itype="+itype;
  124. } else {
  125. mui.toast(data.message);
  126. }
  127. }
  128. });
  129. }
  130. })
  131. //处理
  132. $(".deal").click(function(){
  133. $(".pop_up_bj").fadeIn();
  134. $(".pop_up_div4").fadeIn();
  135. })
  136. $(".pop_up_bj" ).click(function(){
  137. $(".pop_up_bj").hide();
  138. $(".pop_up_div4").hide();
  139. })
  140. $(".pop_up_div4 .btn .fl" ).click(function(){
  141. $(".pop_up_bj").hide();
  142. $(".pop_up_div4").hide();
  143. mui.alert("取消");
  144. })
  145. $(".pop_up_div4 .btn .fr" ).click(function(){
  146. $(".pop_up_bj").hide();
  147. $(".pop_up_div4").hide();
  148. if($(".textcont_deal").val()=="") {
  149. mui.alert("请输入处理内容");
  150. }else{
  151. $(".pop_up_bj").hide();
  152. $(".pop_up_div4").hide();
  153. $.ajax({
  154. type: "post",
  155. dataType: 'json',
  156. url: huayi.config.callcenter_url + '/WxLogin/DealWorkOrder',
  157. async: true,
  158. data: {
  159. orderid: id, //否 strubg 工单编号
  160. isover:$('.order_state').find('input[type="radio"]:checked').val(), //处理状态
  161. cont: $(".textcont_deal").val(), //否 int 处理内容
  162. openid: openid, //微信openid,
  163. },
  164. success: function(data) {
  165. if(data.state == "success") {
  166. debugger
  167. mui.toast('处理成功');
  168. window.location.href = "orderList.html?Itype=2";
  169. } else {
  170. mui.toast(data.message);
  171. }
  172. }
  173. });
  174. }
  175. })
  176. $(".allot").click(function(){
  177. window.location.href = "redeploy.html?id=" + id + '&itype=' + state;
  178. })
  179. function Ajax() {
  180. $.ajax({
  181. url: huayi.config.callcenter_url + '/WxLogin/GetWoInfo',
  182. data: {
  183. workorderid: id, //工单编号
  184. openid: openid, //微信openid,
  185. },
  186. async: true,
  187. dataType: 'json',
  188. type: 'get', //HTTP请求类型
  189. success: function(data) {
  190. if(data.state.toLowerCase() == "success") {
  191. var result = data.data.data[0]
  192. var stateText
  193. if (result.State==0) {
  194. stateText="待指派"
  195. }else if(result.State==1){
  196. stateText="待接单"
  197. }else if(result.State==2){
  198. stateText="待处理"
  199. $(".allotBtn").hide();
  200. }else if(result.State==3){
  201. stateText="退回待处理"
  202. }else if(result.State==4){
  203. stateText="异常退回待处理"
  204. }else if(result.State==5){
  205. stateText="处理中"
  206. }else if(result.State==10){
  207. stateText="已完结"
  208. }
  209. console.log(result.State);
  210. $("#workOrderID").text(result.WorkOrderID); //工单编号
  211. $("#gdlxName").text(result.GDLXName); //工单类型
  212. $("#gdlyName").text(result.GDLYName); //工单来源
  213. $("#state").text(stateText); //工单状态
  214. $("#customer").text(result.Customer); //客户姓名
  215. if (state==3) {
  216. var str="";
  217. var val1 = result.CustomerTel.substring(0, 3);
  218. var val2 = result.CustomerTel.substr(-4);
  219. str = val1 + '****' + val2;
  220. $("#customerTel").text(str); //客户电话
  221. }else{
  222. $("#customerTel").text(result.CustomerTel); //客户电话
  223. }
  224. $("#state").text(stateText); //工单状态
  225. $("#ywlxName").text(result.YWLXName); //业务类型
  226. $("#detail").text(result.Detail); //工单内容
  227. //$("#Work_areaname").attr('data-index',result.IsAdminSend);
  228. var record=data.data.item;
  229. if(data.data.item &&record.length > 0) {
  230. $(record).each(function(i, row) {
  231. $('<h5 class="mui-badge-success mui-badge-inverted">' + record[i].F_CreateTime+
  232. '</h5><h5><span style="line-height: 20px;">跟踪信息:'+
  233. '</span><span class="Font" style="line-height: 20px;">' + record[i].F_OptContent +
  234. '</span></h5>').appendTo("#GDgz")
  235. })
  236. }
  237. }
  238. },
  239. error: function(xhr, type, errorThrown) {
  240. //异常处理;
  241. }
  242. })
  243. }