Commit 24a9a03f by 杨树贤

修复bug

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