Commit d7914268 by mushishixian

fix

parent 8ad695f2
......@@ -83,6 +83,7 @@ class SupplierContactApiController extends Controller
'supplier_position',
'can_check_uids'
]);
$data = BatchTrim($data);
//先去表单验证
$validator = new SupplierContactValidator();
$validateResult = $validator->checkSave($request);
......
......@@ -375,8 +375,9 @@ class SupplierService
$logService = new LogService();
$content = "添加采购员 : " . $channelUserName;
$logService->AddLog($supplierId, LogModel::UPDATE_OPERATE, '添加采购员', $content);
}
$syncService = new SyncSupplierService();
$syncService->syncSupplierToErp($supplierId);
return $contactResult;
}
......
......@@ -13,6 +13,7 @@ class SupplierContactValidator
{
$data = $request->all();
$data = BatchTrim($data);
$rules = [
"supplier_consignee" => "required",
"supplier_email" => "required|email",
......
......@@ -54,6 +54,7 @@ class SupplierValidator
if (empty($requestData['supplier_id'])) {
$rules['purchase_uid'] = 'required';
}
//营业执照是不能为空的
$messages = $this->messages();
$validator = Validator::make($requestData, $rules, $messages);
......
......@@ -176,3 +176,15 @@ function checkPerm($perm)
$perms = request()->perms;
return in_array($perm, $perms);
}
//批量清楚前后空格
function BatchTrim($data)
{
if (!empty($data)) {
foreach ($data as &$item) {
$item = trim($item);
}
unset($item);
}
return $data;
}
......@@ -6,6 +6,7 @@
$('#supplier_email').blur(function () {
let value = $(this).val();
value = value.trim();
if (value !== '') {
let reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
if (!reg.test(value)){
......
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