高新区管委会,以5.0标准版为基准,从双汇项目拷贝

edit.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. var token = $.cookie("token");
  2. var id = helper.request.queryString("ids");
  3. var CallID = helper.request.queryString("CallID");
  4. var cusid;
  5. var seartGroup = ''
  6. $(document).ready(function() {
  7. if(id) {
  8. getRegisterDetail()
  9. } else if (CallID) {
  10. getRegisterDetailByCallId()
  11. }
  12. //被投诉单位所属办事处
  13. getComplainedUnitOffice();
  14. //投诉案件承办人
  15. getComplaintUndertaker();
  16. //咨询问题级别
  17. getQuestionLevel();
  18. })
  19. //保存按钮
  20. $('.customerSubmit').click(function() {
  21. $.post(huayi.config.callcenter_url + 'RegRecords/Save', {
  22. "token": $.cookie("token"),
  23. id:id,
  24. token: $.cookie("token"),
  25. cusid: cusid, //档案id
  26. direction: 0, // 0来电,1去电
  27. type: $('#formRegistrationType input[name="type"]:checked').val(), //登记类型
  28. content: $("#formRegistrationContent").val(), //登记内容/投诉事项
  29. remark: $("#formRegistrationRemark").val(), //备注
  30. tel: $("#formTel").val(),
  31. callid: CallID,
  32. unit: $("#formComplainedUnit").val(), //被投诉单位
  33. unitOffice: $("#formComplainedUnitOffice").val(), //单位办事处
  34. caseParty: $("#formComplaintUndertaker option:selected").text(), //投诉案件承办人
  35. CasePartyId: $("#formComplaintUndertaker").val(), //投诉案件承办人id
  36. citizensType: $("#formCitizenClassification").val(), //市民分类
  37. putRecord: $("#formPutRecord input[name='putRecord']:checked").val(), //是否立案
  38. zXZType: seartGroup, //坐席组类型
  39. problemType: $("#formQuestionLevel").val(), //问题类型
  40. ProblemTypeB: $("#formQuestionType").val(), //二级问题类型B
  41. }, function(result) {
  42. result = $.parseJSON(result);
  43. if(result.state.toLowerCase() == "success") {
  44. $("#activess").val(result.data);
  45. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  46. parent.layer.close(index); //再执行关闭
  47. parent.layer.msg("保存成功!");
  48. parent.$("#registerList").bootstrapTable('refresh');
  49. }
  50. })
  51. })
  52. //通过id获取登记信息
  53. function getRegisterDetail() {
  54. $.get(huayi.config.callcenter_url + 'RegRecords/GetDetails', {
  55. id: id,
  56. "token": $.cookie("token")
  57. }, function(result) {
  58. result = $.parseJSON(result);
  59. if(result.state.toLowerCase() == "success") {
  60. var con = result.data.model;
  61. cusid = con.F_CusID;
  62. CallID = con.F_CallId;
  63. $("#formRegistrationType input[name='type'][value='" + con.F_Type +"']").prop("checked","checked"); //登记类型
  64. $("#formRegistrationContent").val(con.F_Content); //登记内容/投诉事项
  65. $("#formRegistrationRemark").val(con.F_Remark); //备注
  66. $("#formName").val(con.F_userName);
  67. $("#formTel").val(con.F_userPhone);
  68. $("#formSex").val(con.F_userSex);
  69. $("#formProvince option:selected").text(con.F_userProvince);
  70. $("#formProvince option:selected").val(con.F_userProvince);
  71. $("#formCity option:selected").text(con.F_userCity);
  72. $("#formCity option:selected").val(con.F_userCity);
  73. $("#formCounty option:selected").text(con.F_userArea);
  74. $("#formCounty option:selected").val(con.F_userArea);
  75. $("#formAddress").val(con.F_userAddress);
  76. $("#formComplainedUnit").val(con.F_Unit);
  77. $("#formComplainedUnitOffice option:selected").text(con.F_UnitOffice);
  78. $("#formComplainedUnitOffice option:selected").val(con.F_UnitOffice);
  79. $("#formComplaintUndertaker option:selected").text(con.F_CaseParty);
  80. $("#formComplaintUndertaker option:selected").val(con.F_CasePartyId);
  81. $("#formQuestionLevel option:selected").text(con.F_ProblemType);
  82. $("#formQuestionLevel option:selected").val(con.F_ProblemType);
  83. $("#formQuestionType option:selected").text(con.F_ProblemTypeB);
  84. $("#formQuestionType option:selected").val(con.F_ProblemTypeB);
  85. console.log('con.F_ProblemTypeB', con.F_ProblemTypeB)
  86. $("#formCitizenClassification").val(con.F_CitizensType);
  87. $("#formPutRecord input[name='putRecord'][value='" + con.F_PutRecord +"']").prop("checked","checked"); //登记类型
  88. }
  89. })
  90. }
  91. //通过callid获取登记信息
  92. function getRegisterDetailByCallId() {
  93. $.get(huayi.config.callcenter_url + 'RegRecords/GetCallidDetails', {
  94. callid: CallID,
  95. "token": $.cookie("token")
  96. }, function(result) {
  97. result = $.parseJSON(result);
  98. if(result.state.toLowerCase() == "success") {
  99. var con = result.data.model;
  100. cusid = con.F_CusID;
  101. CallID = con.F_CallId;
  102. id = con.F_ID;
  103. $("#formRegistrationType input[name='type'][value='" + con.F_Type +"']").prop("checked","checked"); //登记类型
  104. $("#formComplainedUnit").val(con.F_Complained); //被投诉单位
  105. $("#formRegistrationContent").val(con.F_Content); //登记内容/投诉事项
  106. $("#formRegistrationRemark").val(con.F_Remark); //备注
  107. var cusmodel = result.data.cusmodel
  108. $("#formName").val(cusmodel.F_Name);
  109. $("#formTel").val(cusmodel.F_Phone);
  110. $("#formSex").val(cusmodel.F_Sex)
  111. $("#formProvince option:selected").text(cusmodel.F_Province)
  112. $("#formProvince option:selected").val(cusmodel.F_Province)
  113. $("#formCity option:selected").text(cusmodel.F_City)
  114. $("#formCity option:selected").val(cusmodel.F_City)
  115. $("#formCounty option:selected").text(cusmodel.F_County)
  116. $("#formCounty option:selected").val(cusmodel.F_County)
  117. $("#formAddress").val(cusmodel.F_Address)
  118. }
  119. })
  120. }
  121. //被投诉单位所属办事处
  122. function getComplainedUnitOffice() {
  123. $("#formComplainedUnitOffice").empty();
  124. $("#formComplainedUnitOffice").append("<option value='' selected='selected'>请选择</option>");
  125. $.ajax({
  126. type: "get",
  127. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  128. dataType: 'json',
  129. async: true,
  130. data: {
  131. token: $.cookie("token"),
  132. flag: "BTSDWSSBSC",
  133. },
  134. success: function(data) {
  135. var Count = data.data;
  136. $(Count).each(function(i, n) {
  137. $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formComplainedUnitOffice"));
  138. })
  139. }
  140. });
  141. }
  142. //投诉案件承办人
  143. function getComplaintUndertaker () {
  144. $("#formComplaintUndertaker").empty();
  145. $("#formComplaintUndertaker").append("<option value='' selected='selected'>请选择</option>");
  146. $.ajax({
  147. type: "get",
  148. url: huayi.config.callcenter_url + "UserAccount/GetSeatList",
  149. dataType: 'json',
  150. async: true,
  151. data: {
  152. token: $.cookie("token"),
  153. },
  154. success: function(data) {
  155. var Count = data.data;
  156. $(Count).each(function(i, n) {
  157. $('<option value="' + n.F_UserId + '">' + n.F_UserName + '</option>').appendTo($("#formComplaintUndertaker"));
  158. })
  159. }
  160. });
  161. }
  162. //咨询问题级别
  163. function getQuestionLevel() {
  164. $("#formQuestionLevel").empty();
  165. $("#formQuestionLevel").append("<option value='' selected='selected'>请选择</option>");
  166. $.ajax({
  167. type: "get",
  168. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  169. dataType: 'json',
  170. async: true,
  171. data: {
  172. token: $.cookie("token"),
  173. flag: "ZXWTJB"
  174. },
  175. success: function(data) {
  176. var Count = data.data;
  177. $(Count).each(function(i, n) {
  178. $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionLevel"));
  179. })
  180. }
  181. });
  182. }
  183. // 重要级别原因(Ⅰ级)
  184. function getQuestionTypeOne() {
  185. $("#formQuestionType").empty();
  186. $("#formQuestionType").append("<option value='' selected='selected'>请选择</option>");
  187. $.ajax({
  188. type: "get",
  189. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  190. dataType: 'json',
  191. async: true,
  192. data: {
  193. token: $.cookie("token"),
  194. flag: "ZXWTYJFL"
  195. },
  196. success: function(data) {
  197. var Count = data.data;
  198. $(Count).each(function(i, n) {
  199. $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionType"));
  200. })
  201. }
  202. });
  203. }
  204. // 重要级别原因(Ⅱ级)
  205. function getQuestionTypeTwo() {
  206. $("#formQuestionType").empty();
  207. $("#formQuestionType").append("<option value='' selected='selected'>请选择</option>");
  208. $.ajax({
  209. type: "get",
  210. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  211. dataType: 'json',
  212. async: true,
  213. data: {
  214. token: $.cookie("token"),
  215. flag: "ZXWTEJFL"
  216. },
  217. success: function(data) {
  218. var Count = data.data;
  219. $(Count).each(function(i, n) {
  220. $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionType"));
  221. })
  222. }
  223. });
  224. }
  225. // 重要级别显示原因
  226. $('#formQuestionLevel').on('change',function(){
  227. if ($('#formQuestionLevel').val() === '一级分类') {
  228. $('#formQuestionType').val('');
  229. getQuestionTypeOne();
  230. } else if ($('#formQuestionLevel').val() === '二级分类') {
  231. $('#formQuestionType').val('');
  232. getQuestionTypeTwo();
  233. } else {
  234. $('#formQuestionType').val('');
  235. }
  236. })
  237. //被投诉单位
  238. function darptSearch() {
  239. $(".selDpart1").css('display', 'block');
  240. getFormComplainedUnit();
  241. }
  242. $("#sponsor").on('click', 'li', function() {
  243. $(".selDpart1").css('display', 'none');
  244. $("#formComplainedUnit").val($(this).html());
  245. })
  246. function getFormComplainedUnit() {
  247. $("#sponsor").empty();
  248. $.ajax({
  249. type: "get",
  250. url: huayi.config.callcenter_url + "Docking/SendGetCompanylist",
  251. dataType: 'json',
  252. async: true,
  253. data: {
  254. token: $.cookie("token"),
  255. name: $("#formComplainedUnit").val(),
  256. pageno: 1,
  257. pagesize: 100,
  258. },
  259. success: function(data) {
  260. if (data.state.toLowerCase() == "success") {
  261. var content = data.data.records;
  262. if (content.length === 0) {
  263. $(".selDpart1").css('display', 'none');
  264. } else {
  265. $(content).each(function (i, n) {
  266. $("<li index='" + n.name + "'>" + n.name + "</li>").appendTo("#sponsor");
  267. })
  268. }
  269. }
  270. }
  271. });
  272. }