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

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

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

@ -288,7 +288,7 @@ class UserController extends AdminController
$User = new UserApi;
$uid = $User->register($username, $password, $email, $second_pwd);
if (0 < $uid) { //注册成功
$user = array('uid' => $uid,'realname'=>$real_name, 'nickname' => $username, 'status' => 1,"birthday"=>date('Y-m-d',time()));
$user = array('uid' => $uid,'real_name'=>$real_name, 'nickname' => $username, 'status' => 1,"birthday"=>date('Y-m-d',time()));
$data['uid'] = $uid;
$data['group_id'] = I('auth');
M('auth_group_access')->data($data)->add();

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

@ -163,6 +163,7 @@
<td class="l"><i class="mustmark">*</i>开票类型:</td>
<td class="r">
<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="2" <if condition="$data['invoice_type'] eq 2">selected</if>>普票</option>
</select>

Loading…
Cancel
Save