Merge branch 'hotfix/update_compony_bind' of wmtx/platform into master

修改公司绑定默认值
master
万盟天下 4 years ago committed by Gogs
commit 4d8af10472

@ -4,6 +4,16 @@ namespace Admin\Controller;
class CompanyRelationController extends AdminController class CompanyRelationController extends AdminController
{ {
/**
* @var 默认甲方公司类型
*/
const COMPANY_TYPE_DEFAULT_A = '0';
/**
* @var 默认甲方公司类型
*/
const COMPANY_TYPE_DEFAULT_B = '2';
public $admininfo; public $admininfo;
public $DBModel; public $DBModel;
public $DBlogModel; public $DBlogModel;
@ -26,6 +36,7 @@ class CompanyRelationController extends AdminController
"2"=>"月结" "2"=>"月结"
]; ];
public $InvoiceType=[ public $InvoiceType=[
"0"=>"无",
"1"=>"专票", "1"=>"专票",
"2"=>"普票" "2"=>"普票"
]; ];
@ -379,7 +390,9 @@ class CompanyRelationController extends AdminController
$this->ajaxReturn(["msg"=>"添加成功","code"=>1,"url"=>U("lists")]); $this->ajaxReturn(["msg"=>"添加成功","code"=>1,"url"=>U("lists")]);
} else { } else {
$this->assign('companyType',$this->CompanyType); $this->assign('defaultCompanyTypeA', self::COMPANY_TYPE_DEFAULT_A);
$this->assign('defaultCompanyTypeB', self::COMPANY_TYPE_DEFAULT_B);
$this->assign('companyType', $this->CompanyType);
$this->display(); $this->display();
} }
} }

@ -383,9 +383,11 @@ class CompanyStatementController extends ThinkController
$data['receive_company'] = $data['first_party_info']; $data['receive_company'] = $data['first_party_info'];
$data['pay_company'] = $data['second_party_info']; $data['pay_company'] = $data['second_party_info'];
} }
if($data['receive_company']['invoice_type'] == 1){ if($data['receive_company']['invoice_type'] == 0){
$data['receive_company']['invoice_type']="无";
} elseif($data['receive_company']['invoice_type'] == 1){
$data['receive_company']['invoice_type']="专票"; $data['receive_company']['invoice_type']="专票";
}else{ } else{
$data['receive_company']['invoice_type']="普票"; $data['receive_company']['invoice_type']="普票";
} }
if ($data['company_belong'] == 9) {//上游 if ($data['company_belong'] == 9) {//上游

@ -157,9 +157,11 @@ class VerifyBillController extends Controller {
$data['receive_company'] = $data['first_party_info']; $data['receive_company'] = $data['first_party_info'];
$data['pay_company'] = $data['second_party_info']; $data['pay_company'] = $data['second_party_info'];
} }
if($data['receive_company']['invoice_type'] == 1){ if($data['receive_company']['invoice_type'] == 0){
$data['receive_company']['invoice_type']="无";
} elseif ($data['receive_company']['invoice_type'] == 1) {
$data['receive_company']['invoice_type']="专票"; $data['receive_company']['invoice_type']="专票";
}else{ } else {
$data['receive_company']['invoice_type']="普票"; $data['receive_company']['invoice_type']="普票";
} }
if ($data['company_belong'] == 9) {//上游 if ($data['company_belong'] == 9) {//上游

@ -107,7 +107,7 @@
<select name="first_company_type" id="first_company_type" class="select_gallery"> <select name="first_company_type" id="first_company_type" class="select_gallery">
<option value="">请选择甲方公司类型</option> <option value="">请选择甲方公司类型</option>
<volist name="companyType" id="vo"> <volist name="companyType" id="vo">
<option value="{$key}">{$vo}</option> <option value="{$key}" <?php if($defaultCompanyTypeA == $key):?>selected<?php endif;?>>{$vo}</option>
</volist> </volist>
</select> </select>
<span class="notice-text"></span> <span class="notice-text"></span>
@ -142,7 +142,7 @@
<select name="second_company_type" id="second_company_type" class="select_gallery"> <select name="second_company_type" id="second_company_type" class="select_gallery">
<option value="">请选择乙方公司类型</option> <option value="">请选择乙方公司类型</option>
<volist name="companyType" id="vo"> <volist name="companyType" id="vo">
<option value="{$key}">{$vo}</option> <option value="{$key}" <?php if($defaultCompanyTypeB == $key):?>selected<?php endif;?>>{$vo}</option>
</volist> </volist>
</select> </select>
<span class="notice-text"></span> <span class="notice-text"></span>
@ -175,8 +175,8 @@
<td class="l"><i class="mustmark">*</i>结算周期:</td> <td class="l"><i class="mustmark">*</i>结算周期:</td>
<td class="r"> <td class="r">
<select name="settlement_type" id="settlement_type" class="select_gallery"> <select name="settlement_type" id="settlement_type" class="select_gallery">
<option value="0" selected></option> <option value="0"></option>
<option value="1">周结</option> <option value="1" selected>周结</option>
<option value="2">月结</option> <option value="2">月结</option>
</select> </select>
<span class="notice-text"></span> <span class="notice-text"></span>
@ -186,7 +186,8 @@
<td class="l"><i class="mustmark">*</i>开票类型:</td> <td class="l"><i class="mustmark">*</i>开票类型:</td>
<td class="r"> <td class="r">
<select name="invoice_type" id="invoice_type" class="select_gallery"> <select name="invoice_type" id="invoice_type" class="select_gallery">
<option value="1" selected>专票</option> <option value="0" selected></option>
<option value="1">专票</option>
<option value="2">普票</option> <option value="2">普票</option>
</select> </select>
<span class="notice-text"></span> <span class="notice-text"></span>
@ -333,10 +334,15 @@ $(function(){
first_company = data.info; first_company = data.info;
var companystr = '<option value="">'+typename+'</option>'; var companystr = '<option value="">'+typename+'</option>';
for (var i in first_company) { for (var i in first_company) {
companystr += "<option value='" + first_company[i].id + "'>" + first_company[i].company_name + "</option>" var selected = ''
if (first_company[i].company_name == '福建金菠菜网络科技有限公司') {
selected = 'selected'
}
companystr += "<option value='" + first_company[i].id + "' " + selected + ">" + first_company[i].company_name + "</option>"
} }
$("#first_company_id").html(companystr); $("#first_company_id").html(companystr);
$("#first_company_id").select2(); $("#first_company_id").select2();
$("#first_company_id").change();
}) })
}) })
$("#first_company_id").on("change",function(){ $("#first_company_id").on("change",function(){
@ -349,6 +355,7 @@ $(function(){
$("#first_company_name").val(companyinfo.company_name); $("#first_company_name").val(companyinfo.company_name);
$("#first_company_info").html(setCompanyInfo(companyinfo)); $("#first_company_info").html(setCompanyInfo(companyinfo));
}); });
$("#first_company_type").change();
$("#second_company_type").on("change",function(){ $("#second_company_type").on("change",function(){
//置空 //置空
@ -369,6 +376,7 @@ $(function(){
$("#second_company_id").select2(); $("#second_company_id").select2();
}) })
}) })
$("#second_company_type").change();
$("#second_company_id").on("change",function(){ $("#second_company_id").on("change",function(){
var id = $(this).find("option:selected").val(); var id = $(this).find("option:selected").val();
//获取基础信息 //获取基础信息

@ -163,6 +163,7 @@
<td class="l"><i class="mustmark">*</i>开票类型:</td> <td class="l"><i class="mustmark">*</i>开票类型:</td>
<td class="r"> <td class="r">
<select name="invoice_type" id="invoice_type" class="select_gallery"> <select name="invoice_type" id="invoice_type" class="select_gallery">
<option value="0" <if condition="$data['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['invoice_type'] eq 1">selected</if>>专票</option> <option value="1" <if condition="$data['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['invoice_type'] eq 2">selected</if>>普票</option> <option value="2" <if condition="$data['invoice_type'] eq 2">selected</if>>普票</option>
</select> </select>

@ -274,6 +274,7 @@
<td class="r"> <td class="r">
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled> <select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option> <option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option> <option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select> </select>

@ -269,6 +269,7 @@
<td class="r"> <td class="r">
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled> <select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option> <option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option> <option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select> </select>
@ -351,10 +352,18 @@
<td class="r"> <td class="r">
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" data-change="${type}.invoice_type" class="select_gallery"> <select id="invoice_type" name="invoice_type" data-change="${type}.invoice_type" class="select_gallery">
{@if party_info.invoice_type==0}
<option value="0" selected></option>
<option value="1">专票</option>
<option value="2">普票</option>
{@/if}
{@if party_info.invoice_type==1} {@if party_info.invoice_type==1}
<option value="0"></option>
<option value="1" selected>专票</option> <option value="1" selected>专票</option>
<option value="2">普票</option> <option value="2">普票</option>
{@else} {@/if}
{@if party_info.invoice_type==2}
<option value="0"></option>
<option value="1">专票</option> <option value="1">专票</option>
<option value="2" selected>普票</option> <option value="2" selected>普票</option>
{@/if} {@/if}

@ -289,6 +289,7 @@
<td class="r"> <td class="r">
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled> <select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option> <option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option> <option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select> </select>

@ -274,6 +274,7 @@
<td class="r"> <td class="r">
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled> <select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option> <option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option> <option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select> </select>

@ -269,6 +269,7 @@
<td class="r"> <td class="r">
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled> <select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option> <option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option> <option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select> </select>
@ -351,10 +352,18 @@
<td class="r"> <td class="r">
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" data-change="${type}.invoice_type" class="select_gallery"> <select id="invoice_type" name="invoice_type" data-change="${type}.invoice_type" class="select_gallery">
{@if party_info.invoice_type==0}
<option value="0" selected></option>
<option value="1">专票</option>
<option value="2">普票</option>
{@/if}
{@if party_info.invoice_type==1} {@if party_info.invoice_type==1}
<option value="0"></option>
<option value="1" selected>专票</option> <option value="1" selected>专票</option>
<option value="2">普票</option> <option value="2">普票</option>
{@else} {@/if}
{@if party_info.invoice_type==2}
<option value="0"></option>
<option value="1">专票</option> <option value="1">专票</option>
<option value="2" selected>普票</option> <option value="2" selected>普票</option>
{@/if} {@/if}

@ -289,6 +289,7 @@
<td class="r"> <td class="r">
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled> <select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option> <option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option> <option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select> </select>

Loading…
Cancel
Save