Commit 24a9a03f by 杨树贤

修复bug

parent f5fee41a
...@@ -79,6 +79,7 @@ class SupplierAttachmentService ...@@ -79,6 +79,7 @@ class SupplierAttachmentService
'field_name' => $attachmentData['field_name'][$key], 'field_name' => $attachmentData['field_name'][$key],
'validity_type' => $attachmentData['validity_type'][$key], 'validity_type' => $attachmentData['validity_type'][$key],
'create_uid' => request()->user->userId, 'create_uid' => request()->user->userId,
'create_time' => time(),
'create_name' => request()->user->name, 'create_name' => request()->user->name,
'description' => $attachmentData['description'][$key], 'description' => $attachmentData['description'][$key],
'type_name' => array_get(config('fixed.FileNameMapping'), $attachmentData['field_name'][$key]), 'type_name' => array_get(config('fixed.FileNameMapping'), $attachmentData['field_name'][$key]),
......
...@@ -13,7 +13,7 @@ class SupplierAttachmentValidator ...@@ -13,7 +13,7 @@ class SupplierAttachmentValidator
public function checkSave($request) public function checkSave($request)
{ {
//整理下请求数据 //整理下请求数据
$receipt = $request->all(); $attachment = $request->all();
$rules = [ $rules = [
'field_name' => 'required', 'field_name' => 'required',
'validity_type' => 'required', 'validity_type' => 'required',
...@@ -22,12 +22,16 @@ class SupplierAttachmentValidator ...@@ -22,12 +22,16 @@ class SupplierAttachmentValidator
]; ];
$messages = $this->messages(); $messages = $this->messages();
$validator = Validator::make($receipt, $rules, $messages); $validator = Validator::make($attachment, $rules, $messages);
//判断联系方式的表单验证
if ($validator->fails()) { if ($validator->fails()) {
return $validator->errors()->first(); return $validator->errors()->first();
} }
if ($attachment['validity_type'] == 2 && !$attachment['validity_period']) {
return '附件有效期为自定义的时候,时间区间必须选择';
}
} }
private function messages() private function messages()
......
...@@ -97,11 +97,12 @@ ...@@ -97,11 +97,12 @@
//删除文件操作 //删除文件操作
$(document).on('click', '.delete_file', function () { $(document).on('click', '.delete_file', function () {
// layer.confirm('确定要删除该文件吗?', function (index) { var self = $(this);
//找出对应的div删除 layer.confirm('确定要删除该文件吗?', function (index) {
$(this).parents('.single_file_div').remove(); self.parents('.single_file_div').remove();
// return false; layer.closeAll();
// }); });
return false;
}); });
}); });
......
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