| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354 |
- var token = $.cookie("token");
- var id = helper.request.queryString("ids");
- var phone = helper.request.queryString("phone");
- var CallID = helper.request.queryString("CallID");
- var cusid = 0;
- var seartGroup = '';
- $(document).ready(function() {
- if (phone) {
- $("#formTel").val(phone)
- getUserProfile()
- }
- //省
- getProvinceCounty($("#formProvince"), 0, "请选择省")
- //被投诉单位所属办事处
- getComplainedUnitOffice();
- //投诉案件承办人
- getComplaintUndertaker();
- //咨询问题级别
- getQuestionLevel();
- //根据当前登录人坐席组,判断字段
- currentLogInAgentGroup()
- })
- //点击获取用户档案
- $(".btnArchives").click(function() {
- if (!$("#formTel").val()) {
- layer.confirm('请输入电话!', {
- btn: ['确定']
- });
- return;
- }
- getUserProfile();
- })
- //获取用户档案
- function getUserProfile() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Customer/GetCustomerByTel",
- dataType: 'json',
- async: false,
- data: {
- token: $.cookie("token"),
- tel: $("#formTel").val(),
- },
- success: function (result) {
- if (result.state.toLowerCase() == "success") {
- if (result.data != null) {
- cusid = result.data.F_Id;
- $("#formName").val(result.data.F_Name);
- $("#formSex").val(result.data.F_Sex)
- $("#formProvince option:selected").text(result.data.F_Province)
- $("#formProvince option:selected").val(result.data.F_Province)
- $("#formCity option:selected").text(result.data.F_City)
- $("#formCity option:selected").val(result.data.F_City)
- $("#formCounty option:selected").text(result.data.F_County)
- $("#formCounty option:selected").val(result.data.F_County)
- $("#formAddress").val(result.data.F_Address)
- } else {
- layer.confirm('没有获取到用户档案!', {
- btn: ['确定']
- });
- }
- } else {
- }
- }
- })
- }
- //保存按钮
- $('.customerSubmit').click(function() {
- // if (!cusid) {
- // layer.confirm('请先获取用户档案!', {
- // btn: ['确定']
- // });
- // return;
- // }
- $.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(), //登记类型
- userName: $("#formName").val(), //姓名
- userPhone: $("#formTel").val(), //电话
- userSex: $("#formSex").val(), //性别
- userProvince: $("#formProvince option:selected").text(), //省
- userCity: $("#formCity option:selected").text(), //市
- userArea: $("#formCounty option:selected").text(), //县/区
- userAddress: $("#formAddress").val(), //详细地址
- content: $("#formRegistrationContent").val(), //登记内容/投诉事项
- remark: $("#formRegistrationRemark").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") {
- parent.layer.msg("保存成功!");
- Clean()
- }
- })
- })
- //清空
- function Clean() {
- cusid = ""
- $('#formName').val('');
- $('#formTel').val('');
- $('#formSex').val('');
- $('#formProvince').val('');
- $('#formCity').val('');
- $('#formCounty').val('');
- $('#formAddress').val('');
- $('#formComplainedUnit').val('');
- $('#formRegistrationContent').val('');
- $('#formRegistrationRemark').val('');
- $("#formRegistrationType input[name='type'][value='1']").prop("checked","checked"); //工单类型
- }
- //被投诉单位所属办事处
- 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: "DWBSC",
- },
- 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: "WTJB"
- },
- 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: "WTYJFL"
- },
- 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: "WTEJFL"
- },
- 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");
- })
- }
- }
- }
- });
- }
- /*
- 获取 省 市 县/区
- parameter:
- pid int
- */
- function getProvinceCounty(element, pid, text) {
- element.empty();
- element.append('<option value="">'+ text +'</option>');
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
- "token": $.cookie("token"),
- pid: pid,
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- element.append("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>");
- })
- }
- })
- }
- $("#formProvince").on('change',function(){
- getProvinceCounty($("#formCity"), $("#formProvince").val(), "请选择市");
- });
- $("#formCity").on('change',function(){
- getProvinceCounty($("#formCounty"), $("#formCity").val(), "请选择县/区");
- });
- //获取当前登陆人信息
- function getCurrentLoginInformation(){
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'UserAccount/GetNowUser',
- async: true,
- dataType: 'json',
- data: {
- "token": $.cookie("token")
- },
- success: function(data) {
- seartGroup = data.data.user.F_SeartGroup;
- currentLogInAgentGroup();
- }
- });
- }
- //当前登陆人判断字段
- function currentLogInAgentGroup() {
- var seatGroupCode = $.cookie("seatGroupCode")
- if (seatGroupCode === "LDZCZ") {
- $(".citizenClassificationWrapper").hide();
- $(".putRecordWrapper").hide();
- } else if (seatGroupCode === "LDJCZ") {
- $(".citizenClassificationWrapper").show();
- $(".putRecordWrapper").hide();
- } else if (seatGroupCode === "GSHWZ") {
- $(".citizenClassificationWrapper").hide();
- $(".putRecordWrapper").show();
- } else {
- $(".citizenClassificationWrapper").hide();
- $(".putRecordWrapper").hide();
- }
- }
|