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

addRegistrationList.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. var token = $.cookie("token");
  2. var id = helper.request.queryString("ids");
  3. var phone = helper.request.queryString("phone");
  4. var CallID = helper.request.queryString("CallID");
  5. var cusid = 0;
  6. var seartGroup = '';
  7. $(document).ready(function() {
  8. if (phone) {
  9. $("#formTel").val(phone)
  10. getUserProfile()
  11. }
  12. //省
  13. getProvinceCounty($("#formProvince"), 0, "请选择省")
  14. //被投诉单位所属办事处
  15. getComplainedUnitOffice();
  16. //投诉案件承办人
  17. getComplaintUndertaker();
  18. //咨询问题级别
  19. getQuestionLevel();
  20. //根据当前登录人坐席组,判断字段
  21. currentLogInAgentGroup()
  22. })
  23. //点击获取用户档案
  24. $(".btnArchives").click(function() {
  25. if (!$("#formTel").val()) {
  26. layer.confirm('请输入电话!', {
  27. btn: ['确定']
  28. });
  29. return;
  30. }
  31. getUserProfile();
  32. })
  33. //获取用户档案
  34. function getUserProfile() {
  35. $.ajax({
  36. type: "get",
  37. url: huayi.config.callcenter_url + "Customer/GetCustomerByTel",
  38. dataType: 'json',
  39. async: false,
  40. data: {
  41. token: $.cookie("token"),
  42. tel: $("#formTel").val(),
  43. },
  44. success: function (result) {
  45. if (result.state.toLowerCase() == "success") {
  46. if (result.data != null) {
  47. cusid = result.data.F_Id;
  48. $("#formName").val(result.data.F_Name);
  49. $("#formSex").val(result.data.F_Sex)
  50. $("#formProvince option:selected").text(result.data.F_Province)
  51. $("#formProvince option:selected").val(result.data.F_Province)
  52. $("#formCity option:selected").text(result.data.F_City)
  53. $("#formCity option:selected").val(result.data.F_City)
  54. $("#formCounty option:selected").text(result.data.F_County)
  55. $("#formCounty option:selected").val(result.data.F_County)
  56. $("#formAddress").val(result.data.F_Address)
  57. } else {
  58. layer.confirm('没有获取到用户档案!', {
  59. btn: ['确定']
  60. });
  61. }
  62. } else {
  63. }
  64. }
  65. })
  66. }
  67. //保存按钮
  68. $('.customerSubmit').click(function() {
  69. // if (!cusid) {
  70. // layer.confirm('请先获取用户档案!', {
  71. // btn: ['确定']
  72. // });
  73. // return;
  74. // }
  75. $.post(huayi.config.callcenter_url + 'RegRecords/Save', {
  76. "token": $.cookie("token"),
  77. id:id,
  78. token: $.cookie("token"),
  79. cusid: cusid, //档案id
  80. direction: 0, // 0来电,1去电
  81. type: $('#formRegistrationType input[name="type"]:checked').val(), //登记类型
  82. userName: $("#formName").val(), //姓名
  83. userPhone: $("#formTel").val(), //电话
  84. userSex: $("#formSex").val(), //性别
  85. userProvince: $("#formProvince option:selected").text(), //省
  86. userCity: $("#formCity option:selected").text(), //市
  87. userArea: $("#formCounty option:selected").text(), //县/区
  88. userAddress: $("#formAddress").val(), //详细地址
  89. content: $("#formRegistrationContent").val(), //登记内容/投诉事项
  90. remark: $("#formRegistrationRemark").val(), //备注
  91. callid: CallID,
  92. unit: $("#formComplainedUnit").val(), //被投诉单位
  93. unitOffice: $("#formComplainedUnitOffice").val(), //单位办事处
  94. caseParty: $("#formComplaintUndertaker option:selected").text(), //投诉案件承办人
  95. CasePartyId: $("#formComplaintUndertaker").val(), //投诉案件承办人id
  96. citizensType: $("#formCitizenClassification").val(), //市民分类
  97. putRecord: $("#formPutRecord input[name='putRecord']:checked").val(), //是否立案
  98. zXZType: seartGroup, //坐席组类型
  99. problemType: $("#formQuestionLevel").val(), //问题类型
  100. ProblemTypeB: $("#formQuestionType").val(), //二级问题类型B
  101. }, function(result) {
  102. result = $.parseJSON(result);
  103. if(result.state.toLowerCase() == "success") {
  104. parent.layer.msg("保存成功!");
  105. Clean()
  106. }
  107. })
  108. })
  109. //清空
  110. function Clean() {
  111. cusid = ""
  112. $('#formName').val('');
  113. $('#formTel').val('');
  114. $('#formSex').val('');
  115. $('#formProvince').val('');
  116. $('#formCity').val('');
  117. $('#formCounty').val('');
  118. $('#formAddress').val('');
  119. $('#formComplainedUnit').val('');
  120. $('#formRegistrationContent').val('');
  121. $('#formRegistrationRemark').val('');
  122. $("#formRegistrationType input[name='type'][value='1']").prop("checked","checked"); //工单类型
  123. }
  124. //被投诉单位所属办事处
  125. function getComplainedUnitOffice() {
  126. $("#formComplainedUnitOffice").empty();
  127. $("#formComplainedUnitOffice").append("<option value='' selected='selected'>请选择</option>");
  128. $.ajax({
  129. type: "get",
  130. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  131. dataType: 'json',
  132. async: true,
  133. data: {
  134. token: $.cookie("token"),
  135. flag: "DWBSC",
  136. },
  137. success: function(data) {
  138. var Count = data.data;
  139. $(Count).each(function(i, n) {
  140. $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formComplainedUnitOffice"));
  141. })
  142. }
  143. });
  144. }
  145. //投诉案件承办人
  146. function getComplaintUndertaker () {
  147. $("#formComplaintUndertaker").empty();
  148. $("#formComplaintUndertaker").append("<option value='' selected='selected'>请选择</option>");
  149. $.ajax({
  150. type: "get",
  151. url: huayi.config.callcenter_url + "UserAccount/GetSeatList",
  152. dataType: 'json',
  153. async: true,
  154. data: {
  155. token: $.cookie("token"),
  156. },
  157. success: function(data) {
  158. var Count = data.data;
  159. $(Count).each(function(i, n) {
  160. $('<option value="' + n.F_UserId + '">' + n.F_UserName + '</option>').appendTo($("#formComplaintUndertaker"));
  161. })
  162. }
  163. });
  164. }
  165. //咨询问题级别
  166. function getQuestionLevel() {
  167. $("#formQuestionLevel").empty();
  168. $("#formQuestionLevel").append("<option value='' selected='selected'>请选择</option>");
  169. $.ajax({
  170. type: "get",
  171. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  172. dataType: 'json',
  173. async: true,
  174. data: {
  175. token: $.cookie("token"),
  176. flag: "WTJB"
  177. },
  178. success: function(data) {
  179. var Count = data.data;
  180. $(Count).each(function(i, n) {
  181. $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionLevel"));
  182. })
  183. }
  184. });
  185. }
  186. // 重要级别原因(Ⅰ级)
  187. function getQuestionTypeOne() {
  188. $("#formQuestionType").empty();
  189. $("#formQuestionType").append("<option value='' selected='selected'>请选择</option>");
  190. $.ajax({
  191. type: "get",
  192. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  193. dataType: 'json',
  194. async: true,
  195. data: {
  196. token: $.cookie("token"),
  197. flag: "WTYJFL"
  198. },
  199. success: function(data) {
  200. var Count = data.data;
  201. $(Count).each(function(i, n) {
  202. $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionType"));
  203. })
  204. }
  205. });
  206. }
  207. // 重要级别原因(Ⅱ级)
  208. function getQuestionTypeTwo() {
  209. $("#formQuestionType").empty();
  210. $("#formQuestionType").append("<option value='' selected='selected'>请选择</option>");
  211. $.ajax({
  212. type: "get",
  213. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  214. dataType: 'json',
  215. async: true,
  216. data: {
  217. token: $.cookie("token"),
  218. flag: "WTEJFL"
  219. },
  220. success: function(data) {
  221. var Count = data.data;
  222. $(Count).each(function(i, n) {
  223. $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionType"));
  224. })
  225. }
  226. });
  227. }
  228. // 重要级别显示原因
  229. $('#formQuestionLevel').on('change',function(){
  230. if ($('#formQuestionLevel').val() === '一级分类') {
  231. $('#formQuestionType').val('');
  232. getQuestionTypeOne();
  233. } else if ($('#formQuestionLevel').val() === '二级分类') {
  234. $('#formQuestionType').val('');
  235. getQuestionTypeTwo();
  236. } else {
  237. $('#formQuestionType').val('');
  238. }
  239. })
  240. //被投诉单位
  241. function darptSearch() {
  242. $(".selDpart1").css('display', 'block');
  243. getFormComplainedUnit();
  244. }
  245. $("#sponsor").on('click', 'li', function() {
  246. $(".selDpart1").css('display', 'none');
  247. $("#formComplainedUnit").val($(this).html());
  248. })
  249. function getFormComplainedUnit() {
  250. $("#sponsor").empty();
  251. $.ajax({
  252. type: "get",
  253. url: huayi.config.callcenter_url + "Docking/SendGetCompanylist",
  254. dataType: 'json',
  255. async: true,
  256. data: {
  257. token: $.cookie("token"),
  258. name: $("#formComplainedUnit").val(),
  259. pageno: 1,
  260. pagesize: 100,
  261. },
  262. success: function(data) {
  263. if (data.state.toLowerCase() == "success") {
  264. var content = data.data.records;
  265. if (content.length === 0) {
  266. $(".selDpart1").css('display', 'none');
  267. } else {
  268. $(content).each(function (i, n) {
  269. $("<li index='" + n.name + "'>" + n.name + "</li>").appendTo("#sponsor");
  270. })
  271. }
  272. }
  273. }
  274. });
  275. }
  276. /*
  277. 获取 省 市 县/区
  278. parameter:
  279. pid int
  280. */
  281. function getProvinceCounty(element, pid, text) {
  282. element.empty();
  283. element.append('<option value="">'+ text +'</option>');
  284. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
  285. "token": $.cookie("token"),
  286. pid: pid,
  287. }, function (data) {
  288. if (data.state.toLowerCase() == "success") {
  289. var content = data.data;
  290. $(content).each(function (i, n) {
  291. element.append("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>");
  292. })
  293. }
  294. })
  295. }
  296. $("#formProvince").on('change',function(){
  297. getProvinceCounty($("#formCity"), $("#formProvince").val(), "请选择市");
  298. });
  299. $("#formCity").on('change',function(){
  300. getProvinceCounty($("#formCounty"), $("#formCity").val(), "请选择县/区");
  301. });
  302. //获取当前登陆人信息
  303. function getCurrentLoginInformation(){
  304. $.ajax({
  305. type: "get",
  306. url: huayi.config.callcenter_url + 'UserAccount/GetNowUser',
  307. async: true,
  308. dataType: 'json',
  309. data: {
  310. "token": $.cookie("token")
  311. },
  312. success: function(data) {
  313. seartGroup = data.data.user.F_SeartGroup;
  314. currentLogInAgentGroup();
  315. }
  316. });
  317. }
  318. //当前登陆人判断字段
  319. function currentLogInAgentGroup() {
  320. var seatGroupCode = $.cookie("seatGroupCode")
  321. if (seatGroupCode === "LDZCZ") {
  322. $(".citizenClassificationWrapper").hide();
  323. $(".putRecordWrapper").hide();
  324. } else if (seatGroupCode === "LDJCZ") {
  325. $(".citizenClassificationWrapper").show();
  326. $(".putRecordWrapper").hide();
  327. } else if (seatGroupCode === "GSHWZ") {
  328. $(".citizenClassificationWrapper").hide();
  329. $(".putRecordWrapper").show();
  330. } else {
  331. $(".citizenClassificationWrapper").hide();
  332. $(".putRecordWrapper").hide();
  333. }
  334. }