优化内部公司改进

master
chenzhi 4 years ago
parent 4b1935676b
commit 648fb3ebbf

@ -315,7 +315,16 @@ class StatementMangementController extends ThinkController
$selectCompanyId = true; $selectCompanyId = true;
if(!empty($params['detail_company_type']) && $params['detail_company_type']== 3 && (I('detail_company_id', -1) >= 0)){ if(!empty($params['detail_company_type']) && $params['detail_company_type']== 3 && (I('detail_company_id', -1) >= 0)){
$detail_company_name = self::INSIDE_COMPANY[$params['detail_company_id']]; $detail_company_name = self::INSIDE_COMPANY[$params['detail_company_id']];
$map .= " and rd.company_name like '%{$detail_company_name}%' ";
if($detail_company_name == "其他"){
foreach (self::INSIDE_COMPANY as $inside_company_name) {
if($inside_company_name != "其他"){
$map .= " and rd.company_name NOT LIKE '%{$inside_company_name}%' ";
}
}
}else{
$map .= " and rd.company_name like '%{$detail_company_name}%' ";
}
$selectCompanyId = false; $selectCompanyId = false;
} }
@ -499,11 +508,17 @@ class StatementMangementController extends ThinkController
//$item['id'] = null; //$item['id'] = null;
} }
if (!empty($item['company_id'])) if (!empty($item['company_id']) && $item['company_type'] !=3 )
{ {
$item['company_name'] = ''; $item['company_name'] = '';
} }
if ( $item['company_type'] ==3 )
{
$item['company_id'] = 0;
}
$item['confirm_time'] = $data['settlement_time']; $item['confirm_time'] = $data['settlement_time'];
//$item['settlement_flag'] = sprintf('%s-%s-%s', $item['company_type'], $item['company_name'], $item['']) //$item['settlement_flag'] = sprintf('%s-%s-%s', $item['company_type'], $item['company_name'], $item[''])
// 归类奖罚数组 // 归类奖罚数组

@ -584,7 +584,7 @@
if (companyId == 0) { if (companyId == 0) {
$("#form-company-name").attr("readonly",false) $("#form-company-name").attr("readonly",false)
$("#form-company-name").val(''); $("#form-company-name").val('');
} else if (companyType == 1) { // 上游公司没有下级会长 } else if (companyType == 1 || companyType == 3) { // 上游公司没有下级会长
var promoteData = "<option value='0' selected>其他</option>"; var promoteData = "<option value='0' selected>其他</option>";
$("#form-promote-account").empty(); $("#form-promote-account").empty();
$('#form-promote-account').html(promoteData); $('#form-promote-account').html(promoteData);
@ -617,19 +617,23 @@
{ {
var companyType = $('#form-company-type').val(); var companyType = $('#form-company-type').val();
// 如果公司类型为内部的时候,公司部门仅其他 // 如果公司类型为内部的时候,公司部门仅其他
if (companyType == 3) { // if (companyType == 3) {
var companyData = "<option value='0' selected>其他</option>"; // var companyData = "<option value='0' selected>其他</option>";
$("#form-company-id").empty(); // $("#form-company-id").empty();
$('#form-company-id').html(companyData); // $('#form-company-id').html(companyData);
$("#form-company-id").select2(); // $("#form-company-id").select2();
$("#form-company-name").attr("readonly",false) // $("#form-company-name").attr("readonly",false)
} else { // } else {
$.ajax({ $.ajax({
url:"{:U('StatementMangement/getCompanys')}", url:"{:U('StatementMangement/getCompanys')}",
dataType:'JSON', dataType:'JSON',
data: {'type':companyType}, data: {'type':companyType},
success:function(response){ success:function(response){
var companyData = "<option value='0'>其他</option>"; if(companyType == 3){
var companyData = "";
}else{
var companyData = "<option value='0'>其他</option>";
}
$.each(response.info, function(index, item){ $.each(response.info, function(index, item){
companyData += "<option value='"+item.id+"' >"+item.name+"</option>"; companyData += "<option value='"+item.id+"' >"+item.name+"</option>";
}); });
@ -641,7 +645,7 @@
promoteChange(); promoteChange();
} }
}); });
} // }
} }
companyTypeChange(); companyTypeChange();

Loading…
Cancel
Save