|
{layout name="layout" /}
<nav class="breadcrumb">
<span><a href="/">首页</a></span>
<span>></span>
<span><a href="javascript:void(0);">购货单位管理</a></span>
</nav>
<div class="content">
<div class="row" style="margin: 0 0;">
<div class="col-md-2 col-xs-3 btn-top-box text-center">
<a href="/company/save/0" class="btn btn-success radius">新增</a>
</div>
<div class="col-md-6 btn-top-box">
<form action="/company/index" method="get">
<div class="col-md-4">
<input type="text" class="form-control" name="key" id="key" value="{$key|default=''}"
placeholder="请输入公司名称">
</div>
<div class="col-md-3" style="text-align:left;">
<div class="btn-group ">
<button type="submit" class="btn btn-success">搜索</button>
</div>
<div class="btn-group ">
<a href="/company" class="btn btn-danger ml-10">清除</a>
</div>
</div>
</form>
</div>
</div>
<div class="col-md-10" style="margin-top: 20px;">
<table class=" table table-hover table-bordered">
<thead>
<tr class="text-center bg-info">
<td class="text-left" colspan="4">购货单位: {$list->total()}</td>
<td colspan="2">
<span>每页行数:</span>
<select name="limit" id="limit" onchange="changLimit()">
{for start="10" end="101" step="10"}
<option value="{$i}" {eq name="limit" value="$i"}selected{/eq}>{$i}</option>
{/for}
</select>
</td>
</tr>
<tr>
<th width="25">
<input type="checkbox" value="" name="">
</th>
<th class="text-center">id</th>
<th class="text-center">公司名称</th>
<th class="text-center">余额初期值</th>
<!-- <th class="text-center">当前余额</th> -->
<th class="text-center">操作</th>
</tr>
</thead>
<tbody>
{foreach $list as $value}
<tr>
<td>
<input type="checkbox" value="{$value.id}" name="checkbox[]">
</td>
<td class="text-center">{$value.id}</td>
<td class="text-center">{$value['name']}</td>
<td class="text-center">{:number_format(bcdiv($value['initial_balance'],100,2),2)}</td>
<!-- <td class="text-center">{//:number_format(bcdiv($value['current_balance'],100,2),2)}</td> -->
<td class="text-center">
<a href="/company/save/{$value['id']}">修改</a>
<a href="javascript:void(0);" class="ml-10" onClick="del('{$value.id}', this)">删除</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div class="pagelist">
{$page|raw}
</div>
</div>
<script>
function del(id, obj) {
$.post('/company/delete', {
'id': id
}, function (res) {
if (res.code == 2) {
$(obj).parents("tr").remove();
alert('删除成功!');
} else {
alert('删除失败, 请稍后重试.');
return false;
}
}, 'json');
}
</script>
|