Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
78a864ee
authored
Aug 21, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into Dev
parents
d3bd307b
a4d055e2
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
48 additions
and
22 deletions
app/Http/Controllers/Api/ExternalApiController.php
app/Http/Services/DataService.php
app/Http/Services/SyncSupplierService.php
app/Http/Validators/SupplierAccountValidator.php
app/Http/routes.php
resources/views/script/AddSupplierScript.blade.php
resources/views/script/SupplierAccountListScript.blade.php
resources/views/script/UpdateSupplierScript.blade.php
resources/views/script/supplier/SupplierAttachmentScript.blade.php
resources/views/web/AddSupplierAccount.blade.php
resources/views/web/UpdateSupplierAccount.blade.php
resources/views/web/supplier/SupplierBase.blade.php
app/Http/Controllers/Api/ExternalApiController.php
View file @
78a864ee
...
...
@@ -94,4 +94,19 @@ class ExternalApiController extends Controller
(
new
MessageService
())
->
sendMessage
(
'supplier_apply_admin_notify'
,
$data
,
'vendor@ichunt.com'
,
true
);
$this
->
externalResponse
(
0
,
'申请供应商成功'
);
}
//判断是否有芯链账号
public
function
checkSupplierAccountExist
(
Request
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
if
(
empty
(
$supplierId
))
{
$this
->
externalResponse
(
-
1
,
'供应商ID不能为空'
);
}
$supplierAccount
=
SupplierAccountModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
();
if
(
$supplierAccount
)
{
$this
->
externalResponse
(
0
,
'ok'
,
'有芯链账号'
);
}
$this
->
externalResponse
(
-
1
,
'没有找到芯链账号'
);
}
}
app/Http/Services/DataService.php
View file @
78a864ee
...
...
@@ -826,7 +826,7 @@ class DataService
}
$nation
=
$nation
[
0
];
NationModel
::
where
(
'nation_id'
,
$item
[
'nation_id'
])
->
update
([
'
nation_id
'
=>
$nation
[
'abb2'
],
'
international_code
'
=>
$nation
[
'abb2'
],
]);
}
}
...
...
@@ -857,7 +857,7 @@ class DataService
public
static
function
initSupplierReceiptNationId
()
{
ini_set
(
'memory_limit'
,
'2048M'
);
$supplierReceiptList
=
SupplierReceiptModel
::
where
(
'
r
ation_id'
,
0
)
->
get
()
->
toArray
();
$supplierReceiptList
=
SupplierReceiptModel
::
where
(
'
n
ation_id'
,
0
)
->
get
()
->
toArray
();
foreach
(
$supplierReceiptList
as
$supplierReceipt
)
{
$supplierReceipt
[
'nation_id'
]
=
0
;
$receiptType
=
$supplierReceipt
[
'receipt_type'
];
...
...
@@ -874,6 +874,10 @@ class DataService
//同步供应商到erp
public
static
function
syncSupplierToErp
()
}
}
public
static
function
repaireSkuUploadRuler
()
{
$supplierIds
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'group_code'
,
'!='
,
''
)
->
pluck
(
'supplier_id'
)
->
toArray
();
...
...
app/Http/Services/SyncSupplierService.php
View file @
78a864ee
...
...
@@ -88,7 +88,7 @@ class SyncSupplierService
if
(
!
empty
(
$supplier
[
'nation_id'
]))
{
$countryIsocode
=
NationModel
::
where
(
'nation_id'
,
$supplier
[
'nation_id'
])
->
value
(
'international_code'
);
$message
[
'country_isocode'
]
=
$countryIsocode
;
$message
[
'country_isocode'
]
=
!
empty
(
$countryIsocode
)
?
$countryIsocode
:
""
;
}
...
...
@@ -124,7 +124,7 @@ class SyncSupplierService
'recid'
=>
$receipt
[
'receipt_id'
],
'intermediaryBank'
=>
$receipt
[
'intermediary_bank'
],
'remark'
=>
$receipt
[
'remark'
],
'country_isocode'
=>
$receipt
[
'nation'
][
'international_code'
]
,
'country_isocode'
=>
!
empty
(
$receipt
[
'nation'
][
'international_code'
])
?
$receipt
[
'nation'
][
'international_code'
]
:
""
,
];
}
}
...
...
app/Http/Validators/SupplierAccountValidator.php
View file @
78a864ee
...
...
@@ -5,7 +5,7 @@ namespace App\Http\Validators;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
Validator
;
use
Illuminate\Support\Facades\
Validator
;
class
SupplierAccountValidator
{
...
...
@@ -18,6 +18,7 @@ class SupplierAccountValidator
$rules
=
[
"supplier_code"
=>
"required"
,
"contacts_name"
=>
"required"
,
'email'
=>
'required|email'
,
"mobile"
=>
"required|regex:/^1[0-9][0-9]
{
9
}
$/"
,
"password_raw"
=>
"required"
,
"a_type"
=>
"required"
,
...
...
@@ -34,7 +35,7 @@ class SupplierAccountValidator
$yunxinChannelUid
=
$supplierModel
->
where
(
'supplier_code'
,
$account
[
'supplier_code'
])
->
value
(
'yunxin_channel_uid'
);
if
(
empty
(
$yunxinChannelUid
))
{
return
'该供应商没有绑定SKU采购,请完善相关信息'
;
//
return '该供应商没有绑定SKU采购,请完善相关信息';
}
$model
=
new
SupplierAccountModel
();
$supplierCount
=
$model
->
where
(
'supplier_code'
,
$account
[
'supplier_code'
])
...
...
@@ -61,6 +62,8 @@ class SupplierAccountValidator
'mobile.required'
=>
'登录账号不能为空'
,
'mobile.regex'
=>
'账号格式必须为手机号'
,
'password_raw.required'
=>
'账号密码不能为空'
,
'email.required'
=>
'邮箱不能为空'
,
'email.email'
=>
'邮箱格式不对'
,
];
}
}
\ No newline at end of file
}
app/Http/routes.php
View file @
78a864ee
...
...
@@ -78,6 +78,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Api'], function () {
Route
::
get
(
'/api/external/searchSupplier'
,
'ExternalApiController@searchSupplier'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/checkSupplierApply'
,
'ExternalApiController@checkSupplierApply'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/applySupplier'
,
'ExternalApiController@applySupplier'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/checkSupplierAccountExist'
,
'ExternalApiController@checkSupplierAccountExist'
);
});
//同步相关的接口
...
...
@@ -91,5 +92,10 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
// DataService::initSupplierNationId();
// DataService::initSupplierReceiptNationId();
\App\Model\NationModel
::
where
(
'nation_id'
,
0
)
->
update
([
'nation_id'
=>
'1'
,
]);
DataService
::
repairNationInternationalCode
();
});
resources/views/script/AddSupplierScript.blade.php
View file @
78a864ee
...
...
@@ -8,7 +8,7 @@
let
element
=
layui
.
element
;
let
xmSelect
=
layui
.
xmSelect
;
form
.
on
(
'radio(
supplier
_type)'
,
function
(
data
)
{
form
.
on
(
'radio(
receipt
_type)'
,
function
(
data
)
{
if
(
data
.
value
==
1
)
{
$
(
'#swift_code_div'
).
hide
();
$
(
'#account_name_label'
).
text
(
'账户名称 : '
);
...
...
@@ -32,8 +32,7 @@
//不让选,也不隐藏
form
.
on
(
'checkbox(stockup_type_filter)'
,
function
(
data
)
{
if
(
data
.
elem
.
checked
&&
data
.
elem
.
name
===
"stockup_type[5]"
)
{
layer
.
msg
(
'新增供应商没法设置为芯链账号类型,设置芯链账号要先去魔方系统配置阶梯系数'
,
{
icon
:
5
})
$
(
'input[name="stockup_type[5]"]'
).
next
().
click
();
}
});
...
...
resources/views/script/SupplierAccountListScript.blade.php
View file @
78a864ee
...
...
@@ -28,7 +28,7 @@
{
field: '
password_raw
', title: '
密码
', align: '
center
', width: 170,
templet: function (data) {
let text = canViewAccountInfo ? '
查看
' : '';
let text = canViewAccountInfo ? '' : '';
return '
<
span
>
' + data.password_raw + '
<
/span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="password_raw" id="' + data.id + '">' + text + '</
span
>
';
}
},
...
...
@@ -41,8 +41,8 @@
{
field
:
'supplier_code'
,
title
:
'供应商编码'
,
align
:
'center'
,
width
:
120
},
{
field
:
'supplier_name'
,
title
:
'供应商名称'
,
align
:
'center'
},
{
field
:
'type_name'
,
title
:
'账号类型'
,
align
:
'center'
},
{
field
:
'supplier_name'
,
title
:
'供应商名称'
,
align
:
'center'
,
width
:
180
},
{
field
:
'type_name'
,
title
:
'账号类型'
,
align
:
'center'
,
width
:
120
},
{
field
:
'is_entity'
,
title
:
'实体名单'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
let
color
=
''
;
...
...
resources/views/script/UpdateSupplierScript.blade.php
View file @
78a864ee
...
...
@@ -28,8 +28,8 @@
if
(
res
.
err_code
===
0
)
{
}
else
{
layer
.
msg
(
'请先去魔方系统配置阶梯系数,再新建芯链账号'
,
{
icon
:
5
})
$
(
'input[name="stockup_type[5]"]'
).
next
().
click
();
//
layer.msg('请先去魔方系统配置阶梯系数,再新建芯链账号', {icon: 5})
//
$('input[name="stockup_type[5]"]').next().click();
}
},
error
:
function
()
{
...
...
resources/views/script/supplier/SupplierAttachmentScript.blade.php
View file @
78a864ee
...
...
@@ -38,7 +38,7 @@
},
{
field
:
'description'
,
title
:
'附件说明'
,
align
:
'center'
,
width
:
250
},
{
field
:
'validity_period'
,
title
:
'
<
span
class
=
"require"
>*
<
/span>有效期', align: 'center', width: 220}
,
{
field
:
'create_name'
,
title
:
'
线上采购员
'
,
align
:
'center'
,
width
:
100
},
{
field
:
'create_name'
,
title
:
'
上传人
'
,
align
:
'center'
,
width
:
100
},
{
field
:
'create_time'
,
title
:
'上传时间'
,
align
:
'center'
,
width
:
150
},
]],
id
:
'attachmentList'
,
...
...
resources/views/web/AddSupplierAccount.blade.php
View file @
78a864ee
...
...
@@ -23,7 +23,7 @@
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
邮箱 :
</label>
<label
class=
"layui-form-label"
>
<span
class=
"require"
>
*
</span>
邮箱 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"email"
id=
"email"
placeholder=
"请输入邮箱"
class=
"layui-input"
value=
"{{$account['email'] or ''}}"
>
</div>
...
...
resources/views/web/UpdateSupplierAccount.blade.php
View file @
78a864ee
...
...
@@ -24,7 +24,7 @@
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
邮箱 :
</label>
<label
class=
"layui-form-label"
>
<span
class=
"require"
>
*
</span>
邮箱 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"email"
id=
"email"
placeholder=
"请输入邮箱"
class=
"layui-input"
value=
"{{$account['email'] or ''}}"
>
</div>
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
78a864ee
...
...
@@ -32,18 +32,18 @@
?>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-md
2
"
>
<div
class=
"layui-col-md
3
"
>
@inject('singleSelectPresenter','App\Presenters\SingleSelectPresenter')
{!! $singleSelectPresenter->render('supplier_type','供应商类别',!empty($supplier)?array_get($supplier,'supplier_type',0):'1',$supplierType,$option) !!}
</div>
<div
class=
"layui-col-md
4
"
>
<div
class=
"layui-col-md
5
"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('region','所在区域 : ',$supplier['region'],
config('fixed.Region'),['required'=>true,'width'=>'150px']) !!}
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('nation_id','所在国家/地区: ',!empty($supplier)?$supplier['nation_id']:'',$nationList,['required'=>true,'width'=>'110px','label_width'=>'90px']) !!}
</div>
<div
class=
"layui-col-md
6
"
>
<div
class=
"layui-col-md
4
"
>
<div
class=
"city-div"
style=
"display: none"
>
<label
class=
"layui-form-label"
>
选择省市 :
</label>
<div
class=
"city-selector"
id=
"city-selector"
></div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment