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
21169948
authored
Nov 23, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
云芯设置
parent
1173a10a
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
5 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/SupplierService.php
resources/views/script/AddSupplierScript.blade.php
resources/views/script/UpdateSupplierScript.blade.php
resources/views/script/supplier/SupplierBaseScript.blade.php
resources/views/web/AddSupplier.blade.php
resources/views/web/supplier/SupplierBase.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
21169948
...
...
@@ -705,4 +705,15 @@ class SupplierApiController extends Controller
$this
->
response
(
0
,
'申请审核成功'
);
}
//判断是否有阶梯价设置
public
function
checkHasLadderPriceSetting
(
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
$exists
=
SupplierService
::
checkHasLadderPriceSetting
(
$supplierId
);
if
(
$exists
)
{
$this
->
response
(
0
,
'ok'
);
}
$this
->
response
(
-
1
,
'不存在'
);
}
}
app/Http/Services/SupplierService.php
View file @
21169948
...
...
@@ -650,4 +650,13 @@ class SupplierService
return
$validator
->
checkSave
(
$supplier
,
true
);
}
//检验供应商是否有设置对应的阶梯价格系数
public
static
function
checkHasLadderPriceSetting
(
$supplierId
)
{
$supplierCode
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'supplier_code'
);
$redis
=
new
RedisModel
();
$rule
=
$redis
->
hget
(
'magic_cube_price_rule'
,
$supplierCode
);
return
(
bool
)
$rule
;
}
}
\ No newline at end of file
resources/views/script/AddSupplierScript.blade.php
View file @
21169948
...
...
@@ -16,6 +16,14 @@
}
});
//不让选,也不隐藏
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
();
}
});
//图片上传
upload
.
render
({
elem
:
'.upload-img'
...
...
resources/views/script/UpdateSupplierScript.blade.php
View file @
21169948
...
...
@@ -11,6 +11,35 @@
});
//点击云芯
form
.
on
(
'checkbox(stockup_type_filter)'
,
function
(
data
)
{
if
(
data
.
elem
.
checked
&&
data
.
elem
.
name
===
"stockup_type[5]"
)
{
let
url
=
'/api/supplier/checkHasLadderPriceSetting?supplier_id='
+
getQueryVariable
(
'supplier_id'
);
let
elem
=
data
.
elem
;
let
self
=
$
(
this
);
$
.
ajax
({
url
:
url
,
type
:
'POST'
,
async
:
true
,
data
:
data
.
field
,
dataType
:
'json'
,
timeout
:
20000
,
success
:
function
(
res
)
{
if
(
res
.
err_code
===
0
)
{
}
else
{
layer
.
msg
(
'请先去魔方系统配置阶梯系数,再新建云芯账号'
,
{
icon
:
5
})
$
(
'input[name="stockup_type[5]"]'
).
next
().
click
();
}
},
error
:
function
()
{
layer
.
msg
(
'网络错误'
,
{
icon
:
5
});
}
});
}
});
form
.
on
(
'submit(updateSupplier)'
,
function
(
data
)
{
let
confirmMessage
=
''
;
if
(
data
.
field
.
status
===
'-2'
)
{
...
...
resources/views/script/supplier/SupplierBaseScript.blade.php
View file @
21169948
...
...
@@ -236,7 +236,6 @@
dataType
:
'json'
,
timeout
:
10000
,
success
:
function
(
res
)
{
console
.
log
(
res
)
if
(
!
res
)
return
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
if
(
res
.
err_code
===
0
)
{
cb
(
res
.
data
,
res
.
last_page
);
...
...
resources/views/web/AddSupplier.blade.php
View file @
21169948
...
...
@@ -235,7 +235,7 @@
<input
type=
"hidden"
name=
"stockup_type"
value=
"{{$supplier['stockup_type'] or ''}}"
>
@foreach(config('fixed.StockupType') as $k=>$type)
<input
type=
"checkbox"
name=
"stockup_type[{{$k}}]"
<input
type=
"checkbox"
name=
"stockup_type[{{$k}}]"
lay-filter=
"stockup_type_filter"
lay-skin=
"primary"
title=
"{{$type}}"
>
@endforeach
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
21169948
...
...
@@ -244,10 +244,8 @@
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
合作类型
</label>
<div
class=
"layui-input-block"
>
{{--
<input
type=
"hidden"
name=
"stockup_type"
--
}}
{{
--
value=
"{{$supplier['stockup_type'] or ''}}"
>
--}}
@foreach(config('fixed.StockupType') as $k=>$type)
<input
type=
"checkbox"
name=
"stockup_type[{{$k}}]"
<input
type=
"checkbox"
lay-filter=
"stockup_type_filter"
name=
"stockup_type[{{$k}}]"
lay-skin=
"primary"
@
if
(!
empty
($
supplier
['
stockup_type_data
'])&&
in_array
($
k
,$
supplier
['
stockup_type_data
']))
checked
...
...
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