Нет описания

WorkOrderMark.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. var id = helper.request.queryString("id");
  2. $(document).ready(function () {
  3. //保存
  4. $('.customerSubmit').click(function() {
  5. saveCustomer();
  6. });
  7. //重要级别
  8. getDealTimely();
  9. //重要级别原因
  10. getReason();
  11. })
  12. // 重要级别
  13. function getDealTimely() {
  14. $.ajax({
  15. type: "get",
  16. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  17. dataType: 'json',
  18. async: true,
  19. data: {
  20. token: $.cookie("token"),
  21. flag: "GDDJ"
  22. },
  23. success: function(data) {
  24. var Count = data.data;
  25. $(Count).each(function(i, n) {
  26. $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#dealTimely"));
  27. })
  28. }
  29. });
  30. }
  31. // 重要级别原因
  32. function getReason() {
  33. $.ajax({
  34. type: "get",
  35. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  36. dataType: 'json',
  37. async: true,
  38. data: {
  39. token: $.cookie("token"),
  40. flag: "YJYY"
  41. },
  42. success: function(data) {
  43. var Count = data.data;
  44. $(Count).each(function(i, n) {
  45. $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#reason"));
  46. })
  47. }
  48. });
  49. }
  50. // 重要级别为一级时显示原因
  51. $('#dealTimely').on('change',function(){
  52. console.log('1111',$('#dealTimely').val());
  53. if ($('#dealTimely').val() !== '506'){
  54. $('#reason').val('');
  55. $('#reason').attr("disabled", "disabled");
  56. } else {
  57. $('#reason').removeAttr("disabled");
  58. }
  59. })
  60. //保存
  61. function saveCustomer() {
  62. $.ajax({
  63. type: "post",
  64. url: huayi.config.callcenter_url + "WorkOrder/Sing",
  65. dataType: 'json',
  66. async: true,
  67. beforeSend: function() { //触发ajax请求开始时执行
  68. $('.customerSubmit').attr("disabled", true);
  69. $('.customerSubmit').text('确定中...');
  70. },
  71. data: {
  72. token: $.cookie("token"),
  73. id: id,
  74. dealTimely: $('#dealTimely').val(), //重要级别内容
  75. reason: $('#reason').val(), //重要级别原因
  76. },
  77. success: function(data) {
  78. if (data.state.toLowerCase() == 'success') {
  79. $('.customerSubmit').attr("disabled", false);
  80. $('.customerSubmit').text('确定');
  81. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  82. parent.layer.close(index); //再执行关闭
  83. parent.layer.msg("保存成功!");
  84. // parent.$('#workorderlist').bootstrapTable('refresh');
  85. // parent.$('#workorderlist_').bootstrapTable('refresh');
  86. // parent.$('#orderlist').bootstrapTable('refresh');
  87. parent.initTable();
  88. } else {
  89. $('.customerSubmit').attr("disabled", false);
  90. $('.customerSubmit').text('确定');
  91. }
  92. }
  93. });
  94. }