创建版本
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<form method="post" id="model_bill" name="model_bill">
|
||||
<table class="table table-form m-b-none">
|
||||
<tr>
|
||||
<td align="right" width="10%">单据名称</th>
|
||||
<td><input type="text" id="name" name="name" value="{{$bill->name}}" class="form-control input-sm"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">单据编码</th>
|
||||
<td><input type="text" id="code" name="code" value="{{$bill->code}}" class="form-control input-sm"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">单据路径</th>
|
||||
<td><input type="text" id="uri" name="uri" value="{{$bill->uri}}" class="form-control input-sm"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">模型主表</td>
|
||||
<td>
|
||||
<select class="form-control input-sm" name="model_id" id="model_id">
|
||||
<option value="0"> - </option>
|
||||
@foreach($models as $_model)
|
||||
<option value="{{$_model->id}}" @if($_model->id == $bill->model_id) selected @endif>{{$_model->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">编号前缀</th>
|
||||
<td><input type="text" id="sn_prefix" name="sn_prefix" value="{{$bill->sn_prefix}}" class="form-control input-sm"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">编号规则</th>
|
||||
<td><input type="text" id="sn_rule" name="sn_rule" value="{{$bill->sn_rule}}" class="form-control input-sm"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">编号长度</th>
|
||||
<td><input type="text" id="sn_length" name="sn_length" value="{{$bill->sn_length}}" class="form-control input-sm"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">审核类型</td>
|
||||
<td>
|
||||
<label class="radio-inline"><input type="radio" @if($bill['audit_type'] == 0) checked @endif value="0" name="audit_type"> 无 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($bill['audit_type'] == 1) checked @endif value="1" name="audit_type"> 固定流程 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($bill['audit_type'] == 2) checked @endif value="2" name="audit_type"> 自由流程 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($bill['audit_type'] == 3) checked @endif value="3" name="audit_type"> 审核 </label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">表单模式</td>
|
||||
<td>
|
||||
<label class="radio-inline"><input type="radio" @if($bill['form_type'] == 0) checked @endif value="0" name="form_type"> ERP </label>
|
||||
<label class="radio-inline"><input type="radio" @if($bill['form_type'] == 1) checked @endif value="1" name="form_type"> OA </label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">支持回收站</td>
|
||||
<td>
|
||||
<label class="radio-inline"><input type="radio" @if($bill['is_trash'] == 0) checked @endif value="0" name="is_trash"> 否 </label>
|
||||
<label class="radio-inline"><input type="radio" @if($bill['is_trash'] == 1) checked @endif value="1" name="is_trash"> 是 </label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<input type="hidden" name="id" value="{{$bill->id}}">
|
||||
</form>
|
||||
@@ -0,0 +1,107 @@
|
||||
{{$header["js"]}}
|
||||
|
||||
<div class="panel no-border" id="{{$header['master_table']}}-controller">
|
||||
@include('headers')
|
||||
<div class='list-jqgrid'>
|
||||
<div id="{{$header['master_table']}}-grid" style="width:100%;" class="ag-theme-balham"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function ($) {
|
||||
var table = '{{$header["master_table"]}}';
|
||||
var config = gdoo.grids[table];
|
||||
var action = config.action;
|
||||
var search = config.search;
|
||||
|
||||
action.dialogType = 'dialog';
|
||||
|
||||
// 自定义搜索方法
|
||||
search.searchInit = function (e) {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
action.view = function(data) {
|
||||
var me = this;
|
||||
var grid = config.grid;
|
||||
var url = app.url('model/template/index', {bill_id: data.master_id});
|
||||
var index = layer.open({
|
||||
skin: 'layui-layer-frame',
|
||||
scrollbar: false,
|
||||
closeBtn: 2,
|
||||
title: data.master_name + '[视图]',
|
||||
type: 2,
|
||||
move: false,
|
||||
area: ['100%', '100%'],
|
||||
content: url,
|
||||
});
|
||||
}
|
||||
action.flow = function(data) {
|
||||
var me = this;
|
||||
var grid = config.grid;
|
||||
top.addTab('model/step/index2?bill_id=' + data.master_id, 'flow_step_index2', '单据流程');
|
||||
}
|
||||
action.permission = function(data) {
|
||||
var me = this;
|
||||
var grid = config.grid;
|
||||
var url = app.url('model/permission/index', {bill_id: data.master_id});
|
||||
var index = layer.open({
|
||||
skin: 'layui-layer-frame',
|
||||
scrollbar: false,
|
||||
closeBtn: 2,
|
||||
title: data.master_name + '[权限]',
|
||||
type: 2,
|
||||
move: false,
|
||||
area: ['100%', '100%'],
|
||||
content: url,
|
||||
});
|
||||
}
|
||||
|
||||
var options = new agGridOptions();
|
||||
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
|
||||
gridDiv.style.height = getPanelHeight(48);
|
||||
|
||||
options.remoteDataUrl = '{{url()}}';
|
||||
options.remoteParams = search.advanced.query;
|
||||
options.columnDefs = config.cols;
|
||||
options.onRowDoubleClicked = function (params) {
|
||||
if (params.node.rowPinned) {
|
||||
return;
|
||||
}
|
||||
if (params.data == undefined) {
|
||||
return;
|
||||
}
|
||||
if (params.data.master_id > 0) {
|
||||
action.edit(params.data);
|
||||
}
|
||||
};
|
||||
|
||||
new agGrid.Grid(gridDiv, options);
|
||||
|
||||
// 自定义行按钮渲染
|
||||
options.actionCellBeforeRender = function(html, act, data) {
|
||||
if (act.action == 'flow') {
|
||||
if (data.audit_type == 1) {
|
||||
return html;
|
||||
}
|
||||
return '';
|
||||
} else {
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
||||
// 读取数据
|
||||
options.remoteData({page: 1});
|
||||
|
||||
// 绑定自定义事件
|
||||
var $gridDiv = $(gridDiv);
|
||||
$gridDiv.on('click', '[data-toggle="event"]', function () {
|
||||
var data = $(this).data();
|
||||
if (data.master_id > 0) {
|
||||
action[data.action](data);
|
||||
}
|
||||
});
|
||||
config.grid = options;
|
||||
})(jQuery);
|
||||
|
||||
</script>
|
||||
@include('footers')
|
||||
Reference in New Issue
Block a user