| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- /**
- * 客户信息详情
- * */
- var taxCusFinId;// 财税信息自增id
- var taxCustomerId;// 客户id
- $(document).ready(function() {
- var edit_id = helper.request.queryString("edit_id");
- if (edit_id) {
- getCustomer(edit_id); //获取客户信息
- //获取财税情况
- // getTaxDetail(edit_id).then(function(data){
- // if($.cookie("userRoleId") == '17' || $.cookie("userRoleId") == '57' ){
- // $('.hide_btn').show();
- // $('#btn_editTax').show();
- // }
- // taxCusFinId = data.F_CusFinId;// 财税信息自增id
- // taxCustomerId = data.F_CustomerId;// 客户id
- // });
- }
- });
- //获取客户详情
- function getCustomer(ids) {
- $.getJSON(huayi.config.callcenter_url + "CustomerNew/GetCustomer", {
- cusid: ids, //客户id
- token: $.cookie("token")
- }, function(data) {
- if (data.state.toLowerCase() == "success") {
- var cusBase = data.data && data.data.CustomerBase;
- $('#customer_bedept').text(data.data && data.data.BeDeptName); // int 客户归属部门
- if (cusBase) {
- $('#customer_key').text(cusBase.F_KeyWords); //string 关键词
- $('#customer_code').text(cusBase.F_CustomerCode); //string 客户姓名
- if(cusBase.F_LegalTel){
- $('#customer_lehalTel').html('<a href="jvascript:;" onclick="calloutopt('+ cusBase.F_LegalTel +')">'+ helper.filter.cutTel(cusBase.F_LegalTel) +'<img src="../img/Phones.png" alt="phone" /></a>'); //string 客户电话
- }
- $('#customer_cusType').text(cusBase.F_CusTypeName); //string 客户类型
- $('#customer_comaddress').text(cusBase.F_CompanyAddress); //string 客户地址
- $('#customer_Remark1').text(cusBase.F_Remark1); // string 备注(输入框即可)
- $('#customer_legalName').text(cusBase.F_LegalName); //string 法人姓名
- $('#customer_subtrade').text(cusBase.F_SubTrade); // int 所属行业
- $('#customer_taxCategory').text(cusBase.F_TaxCategory); // int 税务类别
- $('#customer_invoiceRange').text(cusBase.F_InvoiceRange); //string 开票范围
- $('#customer_taxPointDes').text(cusBase.F_TaxPointDes); //string 税点描述
- $('#customer_layer').text(cusBase.F_Layer); // int 客户信誉等级
- $('#customer_berelatedAcc').text(cusBase.F_BeRelatedAcc); //string 客户归属涉税会计
- $('#customer_beauditAcc').text(cusBase.F_BeAuditAcc); //string 客户归属审核会计
- $('#customer_bemakeAcc').text(cusBase.F_BeMakeAcc); //string 客户归属做账会计
-
- $('#customer_RegisteredAddress').text(cusBase.F_RegisteredAddress); // string 注册地址
- $('#customer_LegalIDCards').text(cusBase.F_LegalIDCards); // string 法人身份证
- $('#customer_Qualification').text(cusBase.F_Qualification); // string 企业资质荣誉
- $('#customer_FinancialManager').text(cusBase.F_FinancialManager); // string 客户公司财务负责人
- $('#customer_BusinessOwner').text(cusBase.F_BusinessOwner); // string 客户归属业务负责人
- $('#customer_Remark2').text(cusBase.F_Remark2); // string 备注2(输入框即可)
- $('#customer_Remark3').text(cusBase.F_Remark3); // string 备注3(输入框即可)
- $('#customer_service').text(cusBase.F_CusService); // string 客服
- $('#customer_handoverDate').text(cusBase.F_HandoverDate); // string 交接日期
- $('#customer_feeExpires').text(cusBase.F_FeeExpires && cusBase.F_FeeExpires.split(' ')[0]); // datetime 代理费到期日期
-
- $('#customer_isbankSlips').text(cusBase.F_ISBankSlips ? '是' : '否'); // string 是否需要去银行拿回单(一般纳税人)
- $('#customer_address').text(cusBase.F_Address); // string 联系地址
- $('#customer_address1').text(cusBase.F_Address); // string 联系地址1
- $('#customer_address2').text(cusBase.F_Address1); // string 联系地址2
- $('#customer_address3').text(cusBase.F_Address2); // string 联系地址3
- $('#customer_address4').text(cusBase.F_Address3); // string 联系地址4
-
- }
- var cusLists = data.data && data.data.ContactList;
- if (cusLists && cusLists.length > 0) {
- $('#cusLists').empty();
- $('#conectLits').show();
- for (var i = 0; i < cusLists.length; i++) {
- var tplstr = '';
- tplstr = '<div class="clearfix cusListItem">'+
- '<a href="javascript:;" class="aBtn hide_btn" onclick="btn_edit(\''+ cusLists[i].F_CustomerId +'\',\''+ cusLists[i].F_ManId +'\')" title="修改">修改</a>'+
- '<a href="javascript:;" class="aBtn aBtn1 hide_btn" onclick="btn_delete(\''+ cusLists[i].F_ManId +'\')" title="删除">删除</a>'+
- '<li class="col-md-3 col-sm-4">' +
- '<label>姓名:</label>' +
- '<span>'+ cusLists[i].F_Name +'</span>' +
- '</li>'+
- '<li class="col-md-3 col-sm-4">' +
- '<label>电话:</label>' +
- '<a href="jvascript:;" onclick="calloutopt('+ cusLists[i].F_Telephone +')">'+ helper.filter.cutTel(cusLists[i].F_Telephone) +'<img src="../img/Phones.png" alt="phone" /></a>'+
- '</li>'+
- '<li class="col-md-3 col-sm-4">' +
- '<label>邮箱:</label>' +
- '<span>'+ cusLists[i].F_Email +'</span>' +
- '</li>'+
- '<li class="col-md-3 col-sm-4">' +
- '<label>职务:</label>' +
- '<span>'+ cusLists[i].F_Duties +'</span>' +
- '</li>'+
- '<li class="col-md-3 col-sm-4">' +
- '<label>QQ:</label>' +
- '<span>'+ cusLists[i].F_QQ +'</span>' +
- '</li>'+
- '<li class="col-md-3 col-sm-4">' +
- '<label>MSN:</label>' +
- '<span>'+ cusLists[i].F_MSN +'</span>' +
- '</li>'+
- '<li class="col-md-12 col-sm-12">' +
- '<label>备注:</label>' +
- '<span>'+ cusLists[i].F_Remark +'</span>' +
- '</li>'+
- '<li class="col-md-12 col-sm-12">'+
- '<label for="customer_F_IsMain">是否主要联系人:</label>'+
- '<span>'+ (cusLists[i].F_IsMain === true ? '是' : '否') +'</span>'+
- '</li>'+
- '</div>';
- $('#cusLists').append(tplstr);
-
- if($.cookie("userRoleId") == '17' || $.cookie("userRoleId") == '57' ){
- $('.hide_btn').show();
- }
-
- }
- }
- }
- });
- }
- //获取财税情况
- function getTaxDetail(ids){
- var dtd = $.Deferred();
- $.getJSON(huayi.config.callcenter_url + "CustomerNew/GetFinc",{
- cusid: ids, // 客户id
- token: $.cookie("token")
- },function(data){
- if(data.state.toLowerCase() === 'success'){
- data = data.data;
- $('#tax_code').text(data.F_CustomerCode); // string 客户编号
- $('#tax_MonthState').text(data.F_MonthState); // string 本月财税情况:已结清/未结清
- $('#tax_AnnualIncome').text(data.F_AnnualIncome); // string 本年收入(元)
- $('#tax_AnnualProfit').text(data.F_AnnualProfit); // string 本年利润
- $('#tax_AnnualCost').text(data.F_AnnualCost); // string 本年费用
- $('#tax_AnnualPersonCount').text(data.F_AnnualPersonCount); // string 本年人数
- $('#tax_AnnualWages').text(data.F_AnnualWages); // string 本年工资
- $('#tax_QuarterlyCost').text(data.F_QuarterlyCost); // string 本季费用
- $('#tax_QuarterlyPersonCount').text(data.F_QuarterlyPersonCount); // string 本季人数
- $('#tax_QuarterlyWages').text(data.F_QuarterlyWages); // string 本季工资
- $('#tax_QuarterlyIncome').text(data.F_QuarterlyIncome); // string 本季收入
- $('#tax_QPVAT').text(data.F_QPVAT); // string 本季应交税额-增值税
- $('#tax_QPSurtax').text(data.F_QPSurtax); // string 本季应交税额-附加税
- $('#tax_QPTaxes').text(data.F_QPTaxes); // string 本季应交税额-企业所得税
- $('#tax_QPConTax').text(data.F_QPConTax); // string 本季应交税额-文化事业建设税
- $('#tax_QPPerinTax').text(data.F_QPPerinTax); // string 本季应交税额-个税
- $('#tax_QPStampTax').text(data.F_QPStampTax); // string 本季应交税额-其他税额
- dtd.resolve(data);
- }
- });
- return dtd.promise();
- }
- /**
- * 修改财税情况
- * editId 客户id
- * mid 自增id
- * */
- function btn_editTax() {
- layer.open({
- type: 2,
- title: '修改财税情况',
- maxmin: true, //开启最大化最小化按钮
- area: ['60%', '70%'],
- content: '../commonTpl/addOrEditTax.html?edit_id=' + taxCustomerId + '&mid=' + taxCusFinId
- });
- }
- /**
- * 修改联系人信息
- * editId 客户id
- * */
- function btn_edit(editId, mid) {
- layer.open({
- type: 2,
- title: '修改联系人信息',
- maxmin: true, //开启最大化最小化按钮
- area: ['60%', '70%'],
- content: '../commonTpl/addOrEditContacts.html?edit_id=' + editId + '&mid=' + mid
- });
- }
- //删除
- function btn_delete(cid) {
- layer.confirm('确定删除当前联系人信息吗?', {
- icon: 7,
- btn: ['是', '否'] //按钮
- }, function(index) {
- /*执行删除*/
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "CustomerNew/DelContact",
- dataType: 'json',
- async: true,
- data: {
- ids: cid,//客户Id,可多选[1,2,3]
- token: $.cookie("token")
- },
- success: function(data) {
- layer.msg("删除成功!");
- var edit_id = helper.request.queryString("edit_id");
- if (edit_id) {
- getCustomer(edit_id); //获取客户信息
- }
- layer.close(index);
- }
- });
- });
- }
- //外呼
- function calloutopt(telphone) {
- event.stopPropagation();
- if(telphone) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
- async: true,
- dataType: 'json',
- data: {
- phone: telphone,
- token: $.cookie("token")
- },
- success: function(result) {
- if(result.state.toLowerCase() === "success") {
- top.obj.Type = "MakeCall";
- top.obj.DestinationNumber = result.data.phone;
- top.obj.Header = result.data.fix;
- top.obj.TaskType = "0"; //0:拨号外呼;1:问卷外呼;
- top.obj.TaskPhoneID = ''; // 原来是 回访的电话工单ID
- top.Send();
- }
- }
- });
- }
- }
|