聚合公司绑定流程优化

master
zhengyongxing 4 years ago
parent 7d3c8ebd61
commit 2b4ed15a30

@ -400,6 +400,7 @@ class AggregateRelationController extends AdminController
(second_company_type ='{$params['second_company_type']}' and second_company_id = '{$params['second_company_id']}')
";
}
$params['first_company_info'] = $this->getCompanyInfo($params['first_company_type'],$params['first_company_id']);
$params['first_company_info']['type'] = 'first_party_info';
$params['first_company_info'] = json_encode($params['first_company_info']);
@ -408,6 +409,25 @@ class AggregateRelationController extends AdminController
$params['second_company_info']['type'] = 'second_party_info';
$params['second_company_info'] = json_encode($params['second_company_info']);
if(!$params['settlement_type']) {
$params['settlement_type'] = 0;
}
if(!$params['invoice_type']) {
$params['invoice_type'] = 0;
}
if ($params['first_company_type'] == 3) {
$company_info = json_decode($params['first_company_info'],true);
$company_info['invoice_item'] = $params['invoice_content'];
$params['first_company_info'] = json_encode($company_info);
}else if ($params['second_company_type'] == 3) {
$company_info = json_decode($params['second_company_info'],true);
$company_info['invoice_item'] = $params['invoice_content'];
$params['second_company_info'] = json_encode($company_info);
}
$r_res = $this->DBModel->where($where)->find();
if(!empty($r_res)){
$this->error('当前合作方已有绑定关系');

@ -198,7 +198,7 @@
<td class="l">开票内容:</td>
<td class="r table_radio">
<input type="text" id="invoice_content" class="input" value="信息服务费" disabled >
<input type="text" name="invoice_content" class="input invoice_content" value="信息服务费" style="display: none" >
<input type="hidden" name="invoice_content" id="invoice_content_other" class="input invoice_content" value="信息服务费" >
</td>
</tr>
@ -277,7 +277,11 @@ $(function(){
layer.msg("合作甲乙双方必须有个是己方公司", {icon: 2});
return false;
}
$("select[disabled]").each(function() {
if (parseInt($(this).val()) != -1) {
$(this).attr("disabled", false);
}
});
var target = $('form').get(0).action;
var query = $('form').serialize();
@ -386,26 +390,29 @@ $(function(){
});
function setAggregateInfo(invoice_content,settlement_type,invoice_type) {
if (invoice_content) {
$('.invoice_content').val(invoice_content);
$('#invoice_content').val(invoice_content);
}
$('#settlement_type').find("option").each(function() {
$(this).removeAttr("selected");
});
if (!settlement_type) {
$('#settlement_type').removeAttr("disabled");
} else {
// if (!settlement_type) {
// $('#settlement_type').removeAttr("disabled");
// } else {
$('#settlement_type').prop("disabled",true);
}
// }
$('#invoice_type').find("option").each(function() {
$(this).removeAttr("selected");
});
if (!invoice_type) {
$('#invoice_type').removeAttr("disabled");
} else {
// if (!invoice_type) {
// $('#invoice_type').removeAttr("disabled");
// } else {
$('#invoice_type').prop("disabled",true);
}
// }
$("#settlement_type").find("option[value="+settlement_type+"]").prop("selected",true);
$("#invoice_type").find("option[value="+invoice_type+"]").prop("selected",true);
$("#settlement_type").change();

Loading…
Cancel
Save