阜外心血管项目前端

redeploy.js 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. mui.init({})
  2. var UserCode = helper.cookies.get("usercode");
  3. var id = helper.request.queryString("id");
  4. var itype = helper.request.queryString("itype");
  5. var openid = helper.cookies.get("openid");
  6. //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
  7. //alert(id);
  8. $(function() {
  9. // 接收人员
  10. $('#order_recive').on('tap', function() {
  11. //alert("ddd");
  12. getReceiveUser();
  13. $("#order_recive option").remove();
  14. });
  15. //返回列表
  16. $('.return').on('tap', function() {
  17. window.location.href = "orderDetail.html?id=" + id + '&type=' + itype;
  18. });
  19. //提交按钮
  20. $('#submit').on('tap', function() {
  21. if($('#recive_type').attr('data-index')== '') {
  22. mui.alert('请选择部门!') //请输入工单类型
  23. } else if($('#ower_recive').attr('data-index')== '') {
  24. mui.alert('请选择接收人!') //请输入工单类型
  25. } else if($('#order_reception').val() == '') {
  26. mui.alert('请输入转派理由!') //填写详细描述
  27. } else {
  28. $.ajax({
  29. type: "post",
  30. dataType: 'json',
  31. url: huayi.config.callcenter_url + '/WxLogin/AssignWorkOrder',
  32. async: true,
  33. data: {
  34. orderid: id, //否 strubg 工单编号
  35. clbm: $('#recive_type').attr('data-index'), //是 int 部门Id
  36. clid: $("#ower_recive").attr('data-index'), //否 int 接收人用户id
  37. cont: $("#order_reception").val(), //否 int 处理内容
  38. openid: openid, //微信openid,
  39. // openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
  40. },
  41. success: function(data) {
  42. if(data.state == "success") {
  43. debugger
  44. mui.toast('成功');
  45. window.location.href="orderList.html?Itype=2";
  46. } else {
  47. mui.toast(data.message);
  48. }
  49. }
  50. });
  51. }
  52. })
  53. // 接收部门
  54. function getDepts() {}
  55. var recive = [];
  56. $.ajax({
  57. type: "get",
  58. url: huayi.config.callcenter_url + 'Department/GetDeptList',
  59. async: false,
  60. data: {},
  61. dataType: 'json',
  62. success: function(data) {
  63. console.log(data)
  64. recive = data.data;
  65. //alert(JSON.stringify(data));
  66. }
  67. });
  68. //接收人员
  69. function getReceiveUser() {
  70. renyuan = []
  71. $.ajax({
  72. url: huayi.config.callcenter_url + 'UserAccount/GetDeptUserList',
  73. type: 'get',
  74. data: {
  75. deptid: $('#recive_type').attr('data-index'),
  76. },
  77. dataType: "json",
  78. async: true,
  79. success: function(res) {
  80. if(res.state.toLowerCase() === "success") {
  81. res = res.data;
  82. if(res && res.length > -1) {
  83. res.forEach(function(v, i) {
  84. var obj = {};
  85. obj.value = v.F_UserId;
  86. obj.text = v.F_UserCode;
  87. renyuan.push(obj);
  88. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  89. });
  90. cityPicker5.setData(renyuan);
  91. }
  92. }
  93. },
  94. });
  95. }
  96. (function($, doc) {
  97. $.init();
  98. $.ready(function() {
  99. //接收部门
  100. var RCiPickers = new $.PopPicker({
  101. layer: 3
  102. });
  103. RCiPickers.setData(recive);
  104. var RCs = doc.getElementById('showUserPicker1');
  105. var RCResults = doc.getElementById('recive_type');
  106. var RCResults2 = doc.getElementById('recive_type1');
  107. var RCResults3 = doc.getElementById('recive_type2');
  108. RCs.addEventListener('tap', function(event) {
  109. RCiPickers.show(function(items) {
  110. console.log(items)
  111. if(items[2].text == undefined) {
  112. RCResults.value = items[1].text;
  113. RCResults.setAttribute("data-index", items[1].id);
  114. } else
  115. if(items[1].text == undefined) {
  116. RCResults.value = items[0].text;
  117. RCResults.setAttribute("data-index", items[0].id);
  118. } else {
  119. RCResults.value = items[2].text
  120. RCResults.setAttribute("data-index", items[2].id);
  121. }
  122. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  123. //RCResults.setAttribute("data-index", items[0].id);
  124. //RCResults2.setAttribute("data-index", items[1].id);
  125. //RCResults3.setAttribute("data-index", items[2].id);
  126. //返回 false 可以阻止选择框的关闭
  127. //return false;
  128. });
  129. }, false);
  130. // 接收人员
  131. cityPicker5 = new $.PopPicker();
  132. var showCityPickerButton5 = doc.getElementById('showCityPicker5');
  133. var cityResult5 = doc.getElementById('ower_recive');
  134. showCityPickerButton5.addEventListener('tap', function(event) {
  135. getReceiveUser();
  136. cityPicker5.show(function(items) {
  137. if (items[0].text!=undefined) {
  138. cityResult5.value = items[0].text;
  139. cityResult5.setAttribute("data-index", items[0].value);
  140. }
  141. //返回 false 可以阻止选择框的关闭
  142. //return false;
  143. });
  144. }, false);
  145. })
  146. })(mui, document);
  147. })