Commit fd91f39a by 叶明星

Merge branch 'ymx-账期管理-2018091009' into development

parents c56dd8ca 4164ebaf
......@@ -16,11 +16,11 @@ class PaymentDaysModel extends Model
$collert=Request::only('user_id','ac_id','status','limit','p','Export');
$limit=!empty($collert['limit'])?$collert['limit']:10;
$p=!empty($collert['p'])?$collert['p']:1;
$Select=['id','lie_payment_days.user_id','add_time','com_name','lie_payment_days.mobile','ac_id','lie_payment_days.status','lie_user_main.mobile as usmobile','email'];
$Select=['id','auth_cause','lie_payment_days.user_id','add_time','com_name','lie_payment_days.mobile','ac_id','lie_payment_days.status','lie_user_main.mobile as usmobile','email'];
$list=$this->where(function($query) use ($collert){
if(!empty($collert['ac_id'])) $query->where('ac_id','=',$collert['ac_id']);
if(!empty($collert['status'])) $query->whereIn('lie_payment_days.status',explode(',',rtrim($collert['status'],',')));
})->leftJoin('lie_user_main',function($join) use($collert){
})->join('lie_user_main',function($join) use($collert){
if(!empty($collert['user_id'])){
$join->on('lie_payment_days.user_id','=','lie_user_main.user_id')
->where('lie_user_main.mobile','=',$collert['user_id'])->orWhere('lie_user_main.email','=',$collert['user_id']);
......@@ -51,7 +51,7 @@ class PaymentDaysModel extends Model
$collert=Request::only('id');
$Select=['lie_payment_days.id','lie_payment_days.status','lie_payment_days.com_name','lie_payment_days.user_id','lie_payment_days.mobile','add_time',
'lie_user_main.mobile as usmobile','email','company_id','com_telphone','tax_no','bank_name','com_area_id','com_address',
'com_city_id','com_province_id'];
'com_city_id','com_province_id','auth_cause'];
$info=$this->where('id','=',$collert['id'])
->leftJoin('lie_user_main','lie_payment_days.user_id','=','lie_user_main.user_id')
->leftJoin('lie_user_company','lie_user_main.company_id','=','lie_user_company.com_id')
......@@ -66,9 +66,9 @@ class PaymentDaysModel extends Model
}
public function ApiAuthPaymentDays($AdminId){
$collert=Request::only('id','status');
$collert=Request::only('id','status','auth_cause');
if(empty($collert['id']) || empty($collert['status'])) return [10002,'审核失败'];
$result=$this->where('id','=',$collert['id'])->update(['status'=>$collert['status'],'auth_id'=>$AdminId,'update_time'=>time()]);
$result=$this->where('id','=',$collert['id'])->update(['auth_cause'=>$collert['auth_cause'],'status'=>$collert['status'],'auth_id'=>$AdminId,'update_time'=>time()]);
if(!$result) return [10001,'审核失败'];
return [0,'审核成功'];
}
......
......@@ -5,7 +5,9 @@ layui.use('form', function() {
var form=layui.form;
form.on('submit(load)', function(data) {
layer.prompt({formType: 2,maxlength:100,title:'填写原因'},function(val, index){
if(!val) layer.msg('请填写原因',{icon:5});
if(!val) {
return layer.msg('请填写原因',{icon:5});
}
layer.msg('提交中', {
icon: 16
,shade: 0.01
......
......@@ -28,6 +28,7 @@ layui.use(['table','form','laydate','layer'], function() {
,{field:'ac_id', title: '活动ID'}
,{field:'add_time', title: '申请时间',templet:'#add_time'}
,{field:'status', title: '申请状态',templet:'#status'}
,{field:'auth_cause', title: '原因'}
,{field:'experience', title: '操作',templet:'#edit',fixed:'right'}
]]
,id:'list'
......
......@@ -70,19 +70,26 @@
</tbody>
</table>
</fieldset>
@if($info['status']==1)
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;padding-bottom: 200px">
<legend>审核</legend>
<input type="hidden" name="id" value="{{$info['id'] or ''}}">
<div class="layui-form-item">
<div class="layui-input-block">
<input type="radio" lay-verify="required" name="status" value="2" title="审核通过" checked>
<input type="radio" lay-verify="required" name="status" value="3" title="审核不通过">
<div class="layui-form-item" style="margin-top: 20px">
<div class="layui-input-inline" style="width: auto">
<label class="layui-form-label">审核结果:</label>
<input type="radio" lay-verify="required" name="status" value="2" title="审核通过" @if($info['status']==1 || $info['status']==2) checked @endif @if($info['status']!=1) disabled @endif>
<input type="radio" lay-verify="required" name="status" value="3" title="审核不通过" @if($info['status']==3) checked @endif @if($info['status']!=1) disabled @endif>
</div>
<div class="layui-input-block" style="text-align: center">
<button class="layui-btn" lay-submit lay-filter="load">立即提交</button>
@if($info['status']==1)
{{--<div class="layui-input-block" style="text-align: center">--}}
{{--<button class="layui-btn" lay-submit lay-filter="load">立即提交</button>--}}
{{--</div>--}}
@else
<div class="layui-input-inline" style="width: auto">
<label class="layui-form-label">审核原因:</label>
<div class="layui-form-mid">{{$info['auth_cause'] or ''}}</div>
</div>
@endif
</div>
</fieldset>
@endif
</div>
\ No newline at end of file
......@@ -52,5 +52,5 @@
@{{# if(d.usmobile){ }} @{{ d.usmobile }} @{{# }else{ }} @{{ d.email }} @{{# } }}
</script>
<script type="text/html" id="add_time">
@{{ date('Y-m-d H:i',1539072714)}}
@{{ date('Y-m-d H:i',d.add_time)}}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment