优化内部公司改进

master
chenzhi 4 years ago
parent 4b1935676b
commit 648fb3ebbf

@ -315,7 +315,16 @@ class StatementMangementController extends ThinkController
$selectCompanyId = true;
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']];
$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;
}
@ -499,11 +508,17 @@ class StatementMangementController extends ThinkController
//$item['id'] = null;
}
if (!empty($item['company_id']))
if (!empty($item['company_id']) && $item['company_type'] !=3 )
{
$item['company_name'] = '';
}
if ( $item['company_type'] ==3 )
{
$item['company_id'] = 0;
}
$item['confirm_time'] = $data['settlement_time'];
//$item['settlement_flag'] = sprintf('%s-%s-%s', $item['company_type'], $item['company_name'], $item[''])
// 归类奖罚数组

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

Loading…
Cancel
Save