郑州颐和随访系统UI

addOrEditWorkOrder.js 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /**
  2. * 修改工单
  3. * */
  4. $(function() {
  5. //获取 id
  6. var oid = helper.request.queryString("oid");
  7. autosize($('textarea'));
  8. //获取工单来源 获取业务办理 获取工单类型
  9. $.when(helper.getDropList.getlistDropByDic($('#order_source'), 'GDLY'),
  10. helper.getDropList.getlistDropByDic($('#order_handle'), 'YWLX'),
  11. helper.getDropList.getOrderRadios($('#order_typ'), 'GDLX', 'inlineRadioOptions'))
  12. .then(function(){
  13. $('#order_source').selectpicker('val', '468');
  14. $('#order_typ').find('input[type="radio"]').on('change', function() {
  15. $('#order_type').find('input[type="radio"]').on('change', function() {
  16. if($(this).val() === "107") { // 业务办理
  17. $('#order_handles').show();
  18. }else{
  19. $('#order_handles').hide();
  20. }
  21. });
  22. });
  23. if(oid) {
  24. getWorkOrder(oid); //获取工单信息
  25. }
  26. });
  27. $('#order_type').find('input[type="radio"]').on('change', function() {
  28. if($(this).val() === "1") { //业务办理 dispatch
  29. $('#order_pointment').hide();
  30. $('#Tousik').hide();
  31. $('#Tojon').hide();
  32. $("#insurance").hide();
  33. $("#dispatch").hide();
  34. $("#zhujkeshi").hide();
  35. $("#yukshi").hide();
  36. $("#yusjian").hide();
  37. $("#yubzhu").hide();
  38. $("#tration").hide();
  39. }else if($(this).val() === "2"){
  40. $('#order_pointment').show();
  41. $('#Tousik').hide();
  42. $('#Tojon').hide();
  43. $("#insurance").hide();
  44. $("#dispatch").hide();
  45. $("#zhujkeshi").hide();
  46. $("#yukshi").hide();
  47. $("#yusjian").hide();
  48. $("#yubzhu").hide();
  49. $("#tration").hide();
  50. }else if($(this).val() === "3"){
  51. $('#order_pointment').hide();
  52. $('#Tousik').show();
  53. $('#Tojon').show();
  54. $("#dispatch").hide();
  55. $("#insurance").hide();
  56. $("#zhujkeshi").show(); //tration insurance yubzhu
  57. $("#yukshi").hide();
  58. $("#yusjian").hide();
  59. $("#yubzhu").show();
  60. $("#tration").hide();
  61. }else if($(this).val() === "4"){
  62. $('#order_pointment').hide();
  63. $('#Tousik').hide();
  64. $('#Tojon').show();
  65. $("#insurance").hide();
  66. $("#dispatch").hide();
  67. $("#zhujkeshi").hide();
  68. $("#yukshi").hide();
  69. $("#yusjian").hide();
  70. $("#yubzhu").show();
  71. $("#tration").hide();
  72. }
  73. });
  74. //预约类别 显示内容
  75. $("#order_category").change(function(){
  76. if($("#order_category").find("option:selected").val()=="预约挂号"){
  77. $("#tration").show();
  78. $("#insurance").hide();
  79. $("#bunk").hide();
  80. $("#dispatch").hide();
  81. $("#yukshi").show();
  82. $("#yusjian").show();
  83. $("#yubzhu").show();
  84. $("#zhujkeshi").hide();
  85. }else if($("#order_category").find("option:selected").text()=="预约检查"){
  86. $("#tration").hide();
  87. $("#insurance").show();
  88. $("#bunk").hide();
  89. $("#dispatch").hide();
  90. $("#zhujkeshi").show();
  91. $("#yukshi").hide();
  92. $("#yusjian").hide();
  93. $("#yubzhu").show();
  94. }else if($("#order_category").find("option:selected").text()=="预约床位"){
  95. $("#tration").hide(); //bunk dispatch zhujkeshi
  96. $("#insurance").hide();
  97. $("#bunk").show();
  98. $("#dispatch").hide();
  99. $("#yukshi").show();
  100. $("#yusjian").hide();
  101. $("#yubzhu").show();
  102. $("#zhujkeshi").show();
  103. }else if($("#order_category").find("option:selected").text()=="预约车辆"){
  104. $("#tration").hide();
  105. $("#insurance").hide();
  106. $("#bunk").hide();
  107. $("#dispatch").show();
  108. $("#yukshi").show();
  109. $("#yusjian").hide();
  110. $("#yubzhu").show();
  111. $("#zhujkeshi").hide();
  112. }
  113. })
  114. //工单有效性
  115. $('#order_iseffective').find('input[type="radio"]').on('change', function() {
  116. //是否有效工单项(0有效,1无效)
  117. if($(this).val() === "1") { //无效
  118. $('.order_note').show();
  119. } else {
  120. $('.order_note').hide();
  121. }
  122. });
  123. //新增工单创建
  124. $('#save_order').on('click', orderSave);
  125. });
  126. //新建工单 保存
  127. function orderSave() {
  128. var wURL = '';
  129. var oid = '';
  130. oid = helper.request.queryString("oid");
  131. var isDetail = helper.request.queryString("isDetail");
  132. if(oid) {
  133. wURL = 'WorkOrderNew/Update';
  134. } else {
  135. wURL = 'CallInScreen/AddWorkOrder';
  136. }
  137. var order_handle = $('#order_handles').is(':visible') ? $('#order_handle').val() : 0;
  138. $.post(huayi.config.callcenter_url + wURL, {
  139. ID: oid, //int 工单id;
  140. TypeClass:$('#order_type').find('input[type="radio"]:checked').val(), //反馈类型
  141. CustomerName:$('#order_name').val(), //客户姓名
  142. CustomerTel:$('#order_tel').val(), //客户电话
  143. Gender:$('#order_sexte').find('input[type="radio"]:checked').val(), //性别
  144. Location:$('#order_company').val(), //客户地址
  145. IsOver:$('#order_isover').find('input[type="radio"]:checked').val(), //是否处理
  146. DealContents:$('#order_conduct').val(), //处理内容
  147. Problem:$('#order_reception').val(), //问题描述
  148. Reservation:$('#order_category').val(), //预约类型
  149. IDnumber:$('#order_number').val(), //身份证
  150. Expert:$('#order_expert').val(), //预约专家
  151. IsMedical:$('#order_advice').find('input[type="radio"]:checked').val(), //是否来院就医
  152. Project:$('#order_utilities').val(), //预约项目
  153. AboutcarMan:$('#order_About').val(), //约车人
  154. CarTel:$('#order_lephone').val(), //约车电话
  155. TreatmentAddress:$('#order_ocation').val(), //接诊地址
  156. IsCar:$('#order_chuch').find('input[type="radio"]:checked').val(), //是否出车
  157. Condition:$('#order_Huebig').val(), //患者病情
  158. Department:$('#order_office').val(), //预约科室 1111111111111111111111111111111111111
  159. TranDepartment:$('#order_strtil').val(), //转接科室 222222222222222222222222222
  160. Remarks:$('#order_strative').val(),//备注
  161. AppointmentTime:$('#order_time').val(),//预约时间
  162. DriveoutTime:$('#order_chucetime').val(),//出车时间
  163. ComplaintDepartment:$('#order_Betou').val(), //被投诉科室
  164. ComplaintTarget:$('#order_Betxia').val(), //被投诉对象
  165. IsRelevant:$('#order_xibum').find('input[type="radio"]:checked').val(), //是否转相关部门
  166. // isover: $('#order_isover').find('input[type="radio"]:checked').val(), //int 是否立即处理(默认为0,立即处理为1,立即处理的工单无法指派接收人和接受部门)
  167. token: $.cookie("token")
  168. }, function(result) {
  169. result = $.parseJSON(result);
  170. if(result.state.toLowerCase() == "success") {
  171. if(isDetail === "true") {
  172. parent.parent.layer.closeAll();
  173. parent.parent.$('#orderlist').bootstrapTable('refresh');
  174. parent.parent.layer.msg("修改成功");
  175. } else {
  176. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  177. parent.layer.close(index); //再执行关闭
  178. parent.$('#workorderlist').bootstrapTable('refresh');
  179. parent.$('.Closed').trigger('click');
  180. parent.layer.msg("保存成功");
  181. }
  182. top.workcount();
  183. }
  184. })
  185. }
  186. //获取 工单信息
  187. function getWorkOrder(oid) {
  188. $.getJSON(huayi.config.callcenter_url + 'WorkOrderNew/GetDetails', {
  189. "id": oid,
  190. "token": $.cookie("token")
  191. }, function(result) {
  192. if(result.state.toLowerCase() == "success") {
  193. if(result.rows && result.rows.length > 0) {
  194. var data = result.rows[0];
  195. $('#order_type').find('input[type="radio"]:checked').val(data.TypeClass); //反馈类型
  196. $('#order_name').val(data.CustomerName); //客户姓名
  197. $('#order_tel').val(data.CustomerTel); //客户电话
  198. $('#order_company').val(data.Location); //客户地址
  199. $('#order_isover').find('input[type="radio"]:checked').val(data.IsOver); //是否处理
  200. $('#order_conduct').val(data.DealContents); //处理内容
  201. $('#order_reception').val(data.Problem); //问题描述
  202. $('#order_category').val(data.Reservation); //预约类型
  203. $('#order_number').val(data.IDnumber); //身份证
  204. $('#order_expert').val(data.Expert); //预约专家
  205. $('#order_utilities').val(data.Project); //预约项目
  206. $('#order_About').val(data.AboutcarMan); //约车人
  207. $('#order_lephone').val(data.CarTel); //约车电话
  208. $('#order_ocation').val(data.TreatmentAddress); //接诊地址
  209. $('#order_Huebig').val(data.Condition); //患者病情
  210. $('#order_office').val(data.Department); //预约科室 1111111111111111111111111111111111111
  211. $('#order_strtil').val(data.TranDepartment); //转接科室 222222222222222222222222222
  212. $('#order_strative').val(data.Remarks);//备注
  213. $('#order_time').val(data.AppointmentTime);//预约时间
  214. $('#order_chucetime').val(data.DriveoutTime);//出车时间
  215. $('#order_Betou').val(data.ComplaintDepartment); //被投诉科室
  216. $('#order_Betxia').val(data.ComplaintTarget); //被投诉对象
  217. //性别
  218. if (data.Gender === "男") {
  219. $("#order_sexte input[name='tions'][value='1']").prop("checked","checked");
  220. } else if (data.Gender === "女") {
  221. $("#order_sexte input[name='tions'][value='2']").prop("checked","checked");
  222. }
  223. //是否来医院就医
  224. if (data.IsMedical === "是") {
  225. $("#order_advice input[name='advice'][value='1']").prop("checked","checked");
  226. } else if (data.IsMedical === "否") {
  227. $("#order_advice input[name='advice'][value='0']").prop("checked","checked");
  228. }
  229. //是否出车
  230. if (data.IsCar === "是") {
  231. $("#order_chuch input[name='chuch'][value='1']").prop("checked","checked");
  232. } else if (data.IsCar === "否") {
  233. $("#order_chuch input[name='chuch'][value='0']").prop("checked","checked");
  234. }
  235. //是否转相关部门
  236. if (data.IsRelevant === "是") {
  237. $("#order_xibum input[name='xibum'][value='1']").prop("checked","checked");
  238. } else if (data.IsRelevant === "否") {
  239. $("#order_xibum input[name='xibum'][value='0']").prop("checked","checked");
  240. }
  241. if(data.TypeClass === "就医咨询") { //业务办理 dispatch
  242. $("#order_type input[type=radio][value='1']").prop("checked", true);
  243. $('#order_pointment').hide();
  244. $('#Tousik').hide();
  245. $('#Tojon').hide();
  246. $("#insurance").hide();
  247. $("#dispatch").hide();
  248. $("#zhujkeshi").hide();
  249. $("#yukshi").hide();
  250. $("#yusjian").hide();
  251. $("#yubzhu").hide();
  252. $("#tration").hide();
  253. }else if(data.TypeClass === "预约诊疗"){
  254. $("#order_type input[type=radio][value='2']").prop("checked", true);
  255. $('#order_pointment').show();
  256. $('#Tousik').hide();
  257. $('#Tojon').hide();
  258. $("#insurance").hide();
  259. $("#dispatch").hide();
  260. $("#zhujkeshi").hide();
  261. $("#yukshi").hide();
  262. $("#yusjian").hide();
  263. $("#yubzhu").hide();
  264. $("#tration").hide();
  265. }else if(data.TypeClass === "投诉"){
  266. $("#order_type input[type=radio][value='3']").prop("checked", true);
  267. $('#order_pointment').hide();
  268. $('#Tousik').show();
  269. $('#Tojon').show();
  270. $("#dispatch").hide();
  271. $("#insurance").hide();
  272. $("#zhujkeshi").show(); //tration insurance yubzhu
  273. $("#yukshi").hide();
  274. $("#yusjian").hide();
  275. $("#yubzhu").show();
  276. $("#tration").hide();
  277. }else if(data.TypeClass === "建议"){
  278. $("#order_type input[type=radio][value='4']").prop("checked", true);
  279. $('#order_pointment').hide();
  280. $('#Tousik').hide();
  281. $('#Tojon').show();
  282. $("#insurance").hide();
  283. $("#dispatch").hide();
  284. $("#zhujkeshi").hide();
  285. $("#yukshi").hide();
  286. $("#yusjian").hide();
  287. $("#yubzhu").show();
  288. $("#tration").hide();
  289. }
  290. if(data.Reservation=="预约挂号"){
  291. $("#tration").show();
  292. $("#insurance").hide();
  293. $("#bunk").hide();
  294. $("#dispatch").hide();
  295. $("#yukshi").show();
  296. $("#yusjian").show();
  297. $("#yubzhu").show();
  298. $("#zhujkeshi").hide();
  299. }else if(data.Reservation=="预约检查"){
  300. $("#tration").hide();
  301. $("#insurance").show();
  302. $("#bunk").hide();
  303. $("#dispatch").hide();
  304. $("#zhujkeshi").show();
  305. $("#yukshi").hide();
  306. $("#yusjian").hide();
  307. $("#yubzhu").show();
  308. }else if(data.Reservation=="预约床位"){
  309. $("#tration").hide(); //bunk dispatch zhujkeshi
  310. $("#insurance").hide();
  311. $("#bunk").show();
  312. $("#dispatch").hide();
  313. $("#yukshi").show();
  314. $("#yusjian").hide();
  315. $("#yubzhu").show();
  316. $("#zhujkeshi").show();
  317. }else if(data.Reservation=="预约车辆"){
  318. $("#tration").hide();
  319. $("#insurance").hide();
  320. $("#bunk").hide();
  321. $("#dispatch").show();
  322. $("#yukshi").show();
  323. $("#yusjian").hide();
  324. $("#yubzhu").show();
  325. $("#zhujkeshi").hide();
  326. }
  327. if(data.Province) {
  328. $('#order_note').val(decodeURIComponent(data.Province)); //否 string 无效原因
  329. }
  330. if(data.F_IsOver != null){
  331. $('#order_isover').find('input[type="radio"][value="'+ data.F_IsOver +'"]').prop('checked', true); //int 是否立即处理(默认为0,立即处理为1,立即处理的工单无法指派接收人和接受部门)
  332. }
  333. }
  334. }
  335. });
  336. }