| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- var token = $.cookie("token");
- var id = helper.request.queryString("ids");
- var CallID = helper.request.queryString("CallID");
- var cusid;
- var seartGroup = ''
- $(document).ready(function() {
- if(id) {
- getRegisterDetail()
- } else if (CallID) {
- getRegisterDetailByCallId()
- }
- //被投诉单位所属办事处
- getComplainedUnitOffice();
- //投诉案件承办人
- getComplaintUndertaker();
- //咨询问题级别
- getQuestionLevel();
- })
- //保存按钮
- $('.customerSubmit').click(function() {
- $.post(huayi.config.callcenter_url + 'RegRecords/Save', {
- "token": $.cookie("token"),
- id:id,
- token: $.cookie("token"),
- cusid: cusid, //档案id
- direction: 0, // 0来电,1去电
- type: $('#formRegistrationType input[name="type"]:checked').val(), //登记类型
- content: $("#formRegistrationContent").val(), //登记内容/投诉事项
- remark: $("#formRegistrationRemark").val(), //备注
- tel: $("#formTel").val(),
- callid: CallID,
- unit: $("#formComplainedUnit").val(), //被投诉单位
- unitOffice: $("#formComplainedUnitOffice").val(), //单位办事处
- caseParty: $("#formComplaintUndertaker option:selected").text(), //投诉案件承办人
- CasePartyId: $("#formComplaintUndertaker").val(), //投诉案件承办人id
- citizensType: $("#formCitizenClassification").val(), //市民分类
- putRecord: $("#formPutRecord input[name='putRecord']:checked").val(), //是否立案
- zXZType: seartGroup, //坐席组类型
- problemType: $("#formQuestionLevel").val(), //问题类型
- ProblemTypeB: $("#formQuestionType").val(), //二级问题类型B
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- $("#activess").val(result.data);
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.layer.msg("保存成功!");
- parent.$("#registerList").bootstrapTable('refresh');
- }
- })
- })
- //通过id获取登记信息
- function getRegisterDetail() {
- $.get(huayi.config.callcenter_url + 'RegRecords/GetDetails', {
- id: id,
- "token": $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- var con = result.data.model;
- cusid = con.F_CusID;
- CallID = con.F_CallId;
- $("#formRegistrationType input[name='type'][value='" + con.F_Type +"']").prop("checked","checked"); //登记类型
- $("#formRegistrationContent").val(con.F_Content); //登记内容/投诉事项
- $("#formRegistrationRemark").val(con.F_Remark); //备注
- $("#formName").val(con.F_userName);
- $("#formTel").val(con.F_userPhone);
- $("#formSex").val(con.F_userSex);
- $("#formProvince option:selected").text(con.F_userProvince);
- $("#formProvince option:selected").val(con.F_userProvince);
- $("#formCity option:selected").text(con.F_userCity);
- $("#formCity option:selected").val(con.F_userCity);
- $("#formCounty option:selected").text(con.F_userArea);
- $("#formCounty option:selected").val(con.F_userArea);
- $("#formAddress").val(con.F_userAddress);
- $("#formComplainedUnit").val(con.F_Unit);
- $("#formComplainedUnitOffice option:selected").text(con.F_UnitOffice);
- $("#formComplainedUnitOffice option:selected").val(con.F_UnitOffice);
- $("#formComplaintUndertaker option:selected").text(con.F_CaseParty);
- $("#formComplaintUndertaker option:selected").val(con.F_CasePartyId);
- $("#formQuestionLevel option:selected").text(con.F_ProblemType);
- $("#formQuestionLevel option:selected").val(con.F_ProblemType);
- $("#formQuestionType option:selected").text(con.F_ProblemTypeB);
- $("#formQuestionType option:selected").val(con.F_ProblemTypeB);
- console.log('con.F_ProblemTypeB', con.F_ProblemTypeB)
- $("#formCitizenClassification").val(con.F_CitizensType);
- $("#formPutRecord input[name='putRecord'][value='" + con.F_PutRecord +"']").prop("checked","checked"); //登记类型
- }
- })
- }
- //通过callid获取登记信息
- function getRegisterDetailByCallId() {
- $.get(huayi.config.callcenter_url + 'RegRecords/GetCallidDetails', {
- callid: CallID,
- "token": $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- var con = result.data.model;
- cusid = con.F_CusID;
- CallID = con.F_CallId;
- id = con.F_ID;
- $("#formRegistrationType input[name='type'][value='" + con.F_Type +"']").prop("checked","checked"); //登记类型
- $("#formComplainedUnit").val(con.F_Complained); //被投诉单位
- $("#formRegistrationContent").val(con.F_Content); //登记内容/投诉事项
- $("#formRegistrationRemark").val(con.F_Remark); //备注
- var cusmodel = result.data.cusmodel
- $("#formName").val(cusmodel.F_Name);
- $("#formTel").val(cusmodel.F_Phone);
- $("#formSex").val(cusmodel.F_Sex)
- $("#formProvince option:selected").text(cusmodel.F_Province)
- $("#formProvince option:selected").val(cusmodel.F_Province)
- $("#formCity option:selected").text(cusmodel.F_City)
- $("#formCity option:selected").val(cusmodel.F_City)
- $("#formCounty option:selected").text(cusmodel.F_County)
- $("#formCounty option:selected").val(cusmodel.F_County)
- $("#formAddress").val(cusmodel.F_Address)
- }
- })
- }
- //被投诉单位所属办事处
- function getComplainedUnitOffice() {
- $("#formComplainedUnitOffice").empty();
- $("#formComplainedUnitOffice").append("<option value='' selected='selected'>请选择</option>");
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "BTSDWSSBSC",
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formComplainedUnitOffice"));
- })
- }
- });
- }
- //投诉案件承办人
- function getComplaintUndertaker () {
- $("#formComplaintUndertaker").empty();
- $("#formComplaintUndertaker").append("<option value='' selected='selected'>请选择</option>");
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "UserAccount/GetSeatList",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_UserId + '">' + n.F_UserName + '</option>').appendTo($("#formComplaintUndertaker"));
- })
- }
- });
- }
- //咨询问题级别
- function getQuestionLevel() {
- $("#formQuestionLevel").empty();
- $("#formQuestionLevel").append("<option value='' selected='selected'>请选择</option>");
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "ZXWTJB"
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionLevel"));
- })
- }
- });
- }
- // 重要级别原因(Ⅰ级)
- function getQuestionTypeOne() {
- $("#formQuestionType").empty();
- $("#formQuestionType").append("<option value='' selected='selected'>请选择</option>");
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "ZXWTYJFL"
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionType"));
- })
- }
- });
- }
- // 重要级别原因(Ⅱ级)
- function getQuestionTypeTwo() {
- $("#formQuestionType").empty();
- $("#formQuestionType").append("<option value='' selected='selected'>请选择</option>");
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "ZXWTEJFL"
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#formQuestionType"));
- })
- }
- });
- }
- // 重要级别显示原因
- $('#formQuestionLevel').on('change',function(){
- if ($('#formQuestionLevel').val() === '一级分类') {
- $('#formQuestionType').val('');
- getQuestionTypeOne();
- } else if ($('#formQuestionLevel').val() === '二级分类') {
- $('#formQuestionType').val('');
- getQuestionTypeTwo();
- } else {
- $('#formQuestionType').val('');
- }
- })
- //被投诉单位
- function darptSearch() {
- $(".selDpart1").css('display', 'block');
- getFormComplainedUnit();
- }
- $("#sponsor").on('click', 'li', function() {
- $(".selDpart1").css('display', 'none');
- $("#formComplainedUnit").val($(this).html());
- })
- function getFormComplainedUnit() {
- $("#sponsor").empty();
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Docking/SendGetCompanylist",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- name: $("#formComplainedUnit").val(),
- pageno: 1,
- pagesize: 100,
- },
- success: function(data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data.records;
- if (content.length === 0) {
- $(".selDpart1").css('display', 'none');
- } else {
- $(content).each(function (i, n) {
- $("<li index='" + n.name + "'>" + n.name + "</li>").appendTo("#sponsor");
- })
- }
- }
- }
- });
- }
|