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

addRegistrationList.js 11KB

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