201 lines
8.6 KiB
HTML

{extend name="common/base"/}
{block name="style"}
<style>
.layui-table-min th{font-size:13px; text-align:center; background-color:#f8f8f8;}
.layui-table-min td{font-size:13px; padding:6px;text-align:center;}
</style>
<link rel="stylesheet" href="{__JS__}/module/dtree/dtree.css">
<link rel="stylesheet" href="{__JS__}/module/dtree/font/dtreefont.css">
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form body-content">
<h3 class="h3-title">申请开票</h3>
{if condition="($id == 0)"}
<table class="layui-table">
<tr>
<td class="layui-td-gray">开票金额<span style="color: red">*</span></td>
<td>
<input type="text" class="layui-input" name="amount" lay-verify="required|number" placeholder="请输入开票金额" lay-reqText="请输入开票金额" value="">
</td>
<td class="layui-td-gray">开票类型<span style="color: red">*</span></td>
<td>
<select name="invoice_type" lay-verify="required" lay-reqText="请选择开票类型">
<option value="">请选择开票类型</option>
<option value="1">增值税专用发票</option>
<option value="2">增值税普通发票</option>
</select>
</td>
<td class="layui-td-gray">开票主体<span style="color: red">*</span></td>
<td>
<select name="invoice_subject" lay-verify="required" lay-reqText="请选择开票主体">
<option value="">请选择开票主体</option>
{volist name=":get_invoice_subject()" id="vo"}
<option value="{$vo.id}">{$vo.title}</option>
{/volist}
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">抬头类型<span style="color: red">*</span></td>
<td>
<input type="radio" name="type" lay-filter="type" value="1" title="企业" checked>
<input type="radio" name="type" lay-filter="type" value="2" title="个人">
</td>
<td class="layui-td-gray">开票抬头<span style="color: red">*</span></td>
<td><input type="text" name="invoice_title" class="layui-input" value="" lay-verify="required" lay-reqText="请输入开票抬头"></td>
<td class="layui-td-gray">电话号码<span style="color: red">*</span></td>
<td><input type="text" name="invoice_phone" class="layui-input" value="" lay-verify="required" lay-reqText="请输入电话号码"></td>
</tr>
<tr class="invoice-type">
<td class="layui-td-gray2">纳税人识别号<span style="color: red">*</span></td>
<td><input type="text" name="invoice_tax" class="layui-input" value=""></td>
<td class="layui-td-gray">开户行<span style="color: red">*</span></td>
<td><input type="text" name="invoice_bank" class="layui-input" value=""></td>
<td class="layui-td-gray">银行账号<span style="color: red">*</span></td>
<td><input type="text" name="invoice_account" class="layui-input" value=""></td>
</tr>
<tr class="invoice-type">
<td class="layui-td-gray2">银行营业网点<span style="color: red">*</span></td>
<td><input type="text" name="invoice_banking" class="layui-input" value=""></td>
<td class="layui-td-gray">地址<span style="color: red">*</span></td>
<td colspan="3"><input type="text" name="invoice_address" class="layui-input" value=""></td>
</tr>
<tr>
<td class="layui-td-gray">备注信息</td>
<td colspan="5"><textarea name="remark" placeholder="请输入备注信息" class="layui-textarea"></textarea></td>
</tr>
<tr>
<td class="layui-td-gray">发票审核人<span style="color: red">*</span></td>
<td colspan="5">
<div style="width:300px;">
<select name="check_admin_id" lay-verify="required" lay-reqText="请选择发票审核人">
<option value="">请选择发票审核人</option>
{volist name=":get_check_user(3)" id="vo"}
<option value="{$vo.uid}">{$vo.user}</option>
{/volist}
</select>
</div>
</td>
</tr>
</table>
{else/}
<table class="layui-table">
<tr>
<td class="layui-td-gray">开票金额<span style="color: red">*</span></td>
<td>
<input type="text" class="layui-input" name="amount" lay-verify="required|number" placeholder="请输入开票金额" lay-reqText="请输入开票金额" value="{$detail.amount}">
</td>
<td class="layui-td-gray">开票类型<span style="color: red">*</span></td>
<td>
<select name="invoice_type" lay-verify="required" lay-reqText="请选择开票类型">
<option value="">请选择开票类型</option>
<option value="1" {eq name="$detail.invoice_type" value="1"}selected{/eq}>增值税专用发票</option>
<option value="2" {eq name="$detail.invoice_type" value="2"}selected{/eq}>增值税普通发票</option>
</select>
</td>
<td class="layui-td-gray">开票主体<span style="color: red">*</span></td>
<td>
<select name="invoice_subject" lay-verify="required" lay-reqText="请选择开票主体">
<option value="">请选择开票主体</option>
{volist name=":get_invoice_subject()" id="vo"}
<option value="{$vo.id}" {eq name="$vo.id" value="$detail.invoice_subject"}selected{/eq}>{$vo.title}</option>
{/volist}
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">抬头类型<span style="color: red">*</span></td>
<td>
<input type="radio" name="type" lay-filter="type" value="1" title="企业" {eq name="$detail.type" value="1"}checked{/eq}>
<input type="radio" name="type" lay-filter="type" value="2" title="个人" {eq name="$detail.type" value="2"}checked{/eq}>
</td>
<td class="layui-td-gray">开票抬头<span style="color: red">*</span></td>
<td><input type="text" name="invoice_title" class="layui-input" value="{$detail.invoice_title}"></td>
<td class="layui-td-gray">电话号码<span style="color: red">*</span></td>
<td><input type="text" name="invoice_phone" class="layui-input" value="{$detail.invoice_phone}"></td>
</tr>
<tr class="invoice-type" {eq name="$detail.type" value="2"}style="display:none"{/eq}>
<td class="layui-td-gray2">纳税人识别号<span style="color: red">*</span></td>
<td><input type="text" name="invoice_tax" class="layui-input" value="{$detail.invoice_tax}"></td>
<td class="layui-td-gray">开户行<span style="color: red">*</span></td>
<td><input type="text" name="invoice_bank" class="layui-input" value="{$detail.invoice_bank}"></td>
<td class="layui-td-gray">银行账号<span style="color: red">*</span></td>
<td><input type="text" name="invoice_account" class="layui-input" value="{$detail.invoice_account}"></td>
</tr>
<tr class="invoice-type" {eq name="$detail.type" value="2"}style="display:none"{/eq}>
<td class="layui-td-gray2">银行营业网点<span style="color: red">*</span></td>
<td><input type="text" name="invoice_banking" class="layui-input" value="{$detail.invoice_banking}"></td>
<td class="layui-td-gray">地址<span style="color: red">*</span></td>
<td colspan="3"><input type="text" name="invoice_address" class="layui-input" value="{$detail.invoice_address}"></td>
</tr>
<tr>
<td class="layui-td-gray">备注信息</td>
<td colspan="5"><textarea name="remark" placeholder="请输入备注信息" class="layui-textarea">{$detail.remark}</textarea></td>
</tr>
<tr>
<td class="layui-td-gray">发票审核人<span style="color: red">*</span></td>
<td colspan="5">
<div style="width:300px;">
<select name="check_admin_id" lay-verify="required" lay-reqText="请选择发票审核人">
<option value="">请选择发票审核人</option>
{volist name=":get_check_user(3)" id="vo"}
<option value="{$vo.uid}" {eq name="$vo.uid" value="$detail.check_admin_id"}selected{/eq}>{$vo.user}</option>
{/volist}
</select>
</div>
</td>
</tr>
</table>
{/if}
<div class="layui-form-item" style="padding-top:10px;">
<input name="id" id="id" type="hidden" value="{$id}">
<button class="layui-btn" lay-submit="" lay-filter="webform">保存并提交审核</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
function init(layui){
var form = layui.form
,layer = layui.layer
,laydate = layui.laydate;
//选择收件人类型
form.on('radio(type)', function (data) {
if(data.value==2){
$('.invoice-type').hide();
}
else{
$('.invoice-type').show();
}
});
//监听提交
form.on('submit(webform)', function(data){
$.ajax({
url: "/home/invoice/add",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==0){
window.setTimeout(function(){
parent.location.reload();
},1200)
}
}
})
return false;
});
}
</script>
{include file="common/layui" base='base' extend="[]" callback="init" /}
{/block}
<!-- /脚本 -->