Commit cc4303e0 by lizhilin

更新

parent 0fd866fa
......@@ -60,7 +60,7 @@ public function render()
// 这里直接创建一个modal框 model的内容由工具表单提供,这里也需要创建一个工具表单才行
return Modal::make()
->lg()
->title('添加收款' . $this->cid)
->title('添加收款')
->button("添加收款")
->body(CovenantReceiveForm::make()->payload(['cid' => $this->cid]));
//->button("<button class='btn btn-sm btn-primary'>$this->title</button>"); // 这个button就是对应上面的按钮
......
......@@ -10,6 +10,7 @@
use Dcat\Admin\Http\Controllers\AdminController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Dcat\Admin\Admin;
class PrincipalController extends AdminController
{
......@@ -95,16 +96,16 @@ protected function form()
$form->radio('wtype', '类型')
->when(1, function (Form $form) {
$form->text('company');
$form->text('tax_number');
$form->text('company')->setLabelClass(['asterisk']);
$form->text('tax_number')->setLabelClass(['asterisk']);
$form->text('tel');
$form->text('bank_name');
$form->text('bank_name', '开户银行');
$form->text('bank_account');
$form->text('contacts');
})
->when(2, function (Form $form) {
$form->text('name');
$form->text('identity_card');
$form->text('name')->setLabelClass(['asterisk']);
$form->text('identity_card')->setLabelClass(['asterisk']);
})
->options([
1 => '单位',
......@@ -133,6 +134,54 @@ protected function form()
$form->display('updated_at');
});
$form->submitted(function (Form $form) {
$wtype = isset($_POST['wtype']) ? $_POST['wtype'] : 0;
$company = isset($_POST['company']) ? $_POST['company'] : '';
$tax_number = isset($_POST['tax_number']) ? $_POST['tax_number'] : '';
$name = isset($_POST['name']) ? $_POST['name'] : ''; //姓名
$identity_card = isset($_POST['identity_card']) ? $_POST['identity_card'] : '';
if ($wtype == 1) {
if (!$company) {
$form->responseValidationMessages('company', "单位全称不为空");
}
if (!$tax_number) {
$form->responseValidationMessages('tax_number', "税号不为空");
}
} elseif ($wtype == 2) {
if (!$name) {
$form->responseValidationMessages('name', "姓名");
}
if (!$identity_card) {
$form->responseValidationMessages('identity_card', "身份证号码不为空");
}
}
});
// Admin::script(
// <<<JS
// $(function () {
// //社保
// $("input[name='wtype']").on('click', function() {
// var wtype = $(this).val();
// console.log('-----'+wtype);
// if(wtype==1) {
// $("input[name='company']").attr('required',1);
// $("input[name='tax_number']").attr('required',1);
// $("input[name='name']").removeAttr('required');
// $("input[name='identity_card']").removeAttr('required');
// } else {
// $("input[name='name']").attr('required',1);
// $("input[name='identity_card']").attr('required',1);
// $("input[name='company']").removeAttr('required');
// $("input[name='tax_number']").removeAttr('required');
// }
// });
// });
// JS
// );
return $form;
}
......
......@@ -55,7 +55,9 @@ protected function grid()
$grid->column('received_type', '收款账户')->display(function ($val) {
return $val == 1 ? '基本户' : '其它';
});
$grid->column('pay_method', '支付方式');
$grid->column('pay_method', '支付方式')->display(function ($val) {
return ModelsCovenantReceivePayment::PAYMENT_METHOD[$val];
});
$grid->column('received_at', '收款时间');
$grid->column('received_amount', '收款金额');
$grid->column('paymenter', '付款人');
......@@ -114,10 +116,10 @@ protected function form()
{
$form = Form::make(new ModelsCovenantReceivePayment(), function (Form $form) {
//$form->display('id');
$form->select('received_type', '账户类型')->options(ModelsCovenantReceivePayment::RECEIVEDTYPE);
$form->text('pay_method', '支付方式');
$form->date('received_at', '收款时间')->format('YYYY-MM-DD');
$form->text('received_amount', '收款金额');
$form->select('received_type', '账户类型')->options(ModelsCovenantReceivePayment::RECEIVEDTYPE)->required();
$form->select('pay_method', '支付方式')->options(ModelsCovenantReceivePayment::PAYMENT_METHOD)->required();
$form->date('received_at', '收款时间')->format('YYYY-MM-DD')->required();
$form->text('received_amount', '收款金额')->required();
$form->text('paymenter', '付款人');
$form->disableCreatingCheck();
......
......@@ -71,7 +71,7 @@ public function handle(array $input)
public function form()
{
$this->select('received_type', '收款账户')->options([1 => '基本户', 2 => '其它'])->required();
$this->text('pay_method', '支付方式')->required();
$this->select('pay_method', '支付方式')->options(ModelsCovenantReceivePayment::PAYMENT_METHOD)->required();
$this->date('received_at', '收款时间')->format('YYYY-MM-DD')->default(date("Y-m-d"))->required();
$this->text('received_amount', '收款金额')->required();
$this->text('paymenter', '付款人');
......
......@@ -28,6 +28,7 @@ class Covenant extends EloquentRepository
5 => '咨询和代写法律文书',
6 => '仲裁业务',
7 => '法律援助',
8 => '其它',
];
//结算方式
......
......@@ -22,6 +22,7 @@ class Covenant extends Model
5 => '咨询和代写法律文书',
6 => '仲裁业务',
7 => '法律援助',
8 => '其它',
];
//结算方式
......
......@@ -20,6 +20,15 @@ class CovenantReceivePayment extends Model
2 => '其它',
];
//支付方式
public const PAYMENT_METHOD = [
1 => '微信',
2 => '支付宝',
3 => '银行卡',
4 => '转账',
5 => '云闪付',
];
//已收款未开票
public static function getReceiptNoinvoice($lawyer_id = 0)
......
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 to comment