@@ -35,6 +35,21 @@ class CfSuplierInfo extends Backend | |||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 | |||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 | |||
*/ | |||
public function getList(){ | |||
$name=$this->request->post('name'); | |||
$keyValue=$this->request->post('keyValue'); | |||
$this->model->field('id,supplier_name as name'); | |||
if($keyValue){ | |||
$this->model->where(['id'=>$keyValue]); | |||
}elseif($name){ | |||
$this->model->where(['supplier_name'=>['like','%'.$name.'%']]); | |||
} | |||
$result= $this->model->select(); | |||
if($keyValue){ | |||
return json(['list' => $result]); | |||
} | |||
return json(['list' => $result]); | |||
} | |||
} |
@@ -1,39 +1,17 @@ | |||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Del_flag')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-del_flag" data-rule="required" class="form-control" name="row[del_flag]" type="number" value="0"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_id')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-create_id" data-rule="required" data-source="create/index" class="form-control selectpage" name="row[create_id]" type="text" value=""> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Group_id')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-group_id" data-rule="required" data-source="group/index" class="form-control selectpage" name="row[group_id]" type="text" value=""> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Payee_id')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-payee_id" data-rule="required" data-source="payee/index" class="form-control selectpage" name="row[payee_id]" type="text" value=""> | |||
<input id="c-payee_id" data-rule="required" data-source="cf_suplier_info/getList" class="form-control selectpage" name="row[payee_id]" type="text" value=""> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
@@ -57,9 +35,9 @@ | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('状态')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number"> | |||
{:Form::radios('row[status]', [1=>"已付款",2=>"回收中",3=>"已回收"],1, ['data-rule'=>'required'])} | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
@@ -1,39 +1,15 @@ | |||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Del_flag')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-del_flag" data-rule="required" class="form-control" name="row[del_flag]" type="number" value="{$row.del_flag|htmlentities}"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_id')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-create_id" data-rule="required" data-source="create/index" class="form-control selectpage" name="row[create_id]" type="text" value="{$row.create_id|htmlentities}"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Group_id')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-group_id" data-rule="required" data-source="group/index" class="form-control selectpage" name="row[group_id]" type="text" value="{$row.group_id|htmlentities}"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Payee_id')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-payee_id" data-rule="required" data-source="payee/index" class="form-control selectpage" name="row[payee_id]" type="text" value="{$row.payee_id|htmlentities}"> | |||
<input id="c-payee_id" data-rule="required" data-source="cf_suplier_info/getList" class="form-control selectpage" name="row[payee_id]" type="text" value="{$row.payee_id|htmlentities}"> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
@@ -57,9 +33,9 @@ | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> | |||
<label class="control-label col-xs-12 col-sm-2">{:__('状态')}:</label> | |||
<div class="col-xs-12 col-sm-8"> | |||
<input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="{$row.status|htmlentities}"> | |||
{:Form::radios('row[status]', [1=>"已付款",2=>"回收中",3=>"已回收"],$row.status, ['data-rule'=>'required'])} | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
@@ -25,15 +25,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | |||
columns: [ | |||
[ | |||
{checkbox: true}, | |||
{field: 'id', title: __('Id')}, | |||
{field: 'del_flag', title: __('Del_flag'), formatter: Table.api.formatter.flag}, | |||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | |||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | |||
{field: 'create_id', title: __('Create_id')}, | |||
{field: 'group_id', title: __('Group_id')}, | |||
{field: 'payee_id', title: __('Payee_id')}, | |||
{field: 'memo', title: __('Memo'), operate: 'LIKE'}, | |||
{field: 'file', title: __('File'), operate: false}, | |||
{field: 'status', title: __('Status')}, | |||
{field: 'amount', title: __('Amount'), operate:'BETWEEN'}, | |||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | |||