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
81e404f5
authored
Jul 06, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
禁用理由
parent
31cd327c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
16 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/SupplierController.php
app/Http/Services/SupplierContactService.php
resources/views/script/BatchAllocatePurchaseUserScript.blade.php
resources/views/script/DisableSupplierScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/web/DisableSupplier.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
81e404f5
...
...
@@ -218,6 +218,10 @@ class SupplierApiController extends Controller
{
//禁用不是直接修改为无法交易,而是改为审核中,然后审核通过后,变成无法交易
$supplierId
=
$request
->
get
(
'supplier_id'
);
$disableReason
=
$request
->
get
(
'disable_reason'
);
if
(
empty
(
$disableReason
))
{
$this
->
response
(
-
1
,
'禁用理由必填'
);
}
$model
=
new
SupplierChannelModel
();
//先保存原来的状态
$supplier
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
...
...
@@ -226,6 +230,7 @@ class SupplierApiController extends Controller
$result
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'update_time'
=>
time
(),
'status'
=>
$model
::
STATUS_DISABLE
,
'disable_reason'
=>
$disableReason
,
]);
if
(
$result
)
{
//写日志
...
...
app/Http/Controllers/SupplierController.php
View file @
81e404f5
...
...
@@ -330,6 +330,16 @@ class SupplierController extends Controller
return
$this
->
view
(
'加入黑名单'
);
}
//禁用供应商
public
function
DisableSupplier
(
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
$supplierModel
=
new
SupplierChannelModel
();
$supplier
=
$supplierModel
->
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
$this
->
data
[
'supplier'
]
=
$supplier
;
return
$this
->
view
(
'禁用供应商'
);
}
//导出供应商详情表格
public
function
PrintSupplier
(
$request
)
{
...
...
app/Http/Services/SupplierContactService.php
View file @
81e404f5
...
...
@@ -88,9 +88,8 @@ class SupplierContactService
$newContact
=
$model
->
where
(
'contact_id'
,
$contactId
)
->
first
()
->
toArray
();
if
(
$result
)
{
//如果修改的只是qq和传真,则不需要转成审核
$needAudit
=
$this
->
checkNeedAudit
(
$oldContact
,
$newContact
);
if
(
$needAudit
||
empty
(
$contact
[
'contact_id'
])
)
{
if
(
$needAudit
)
{
//修改供应商为审核状态
$supplierModel
->
where
(
'supplier_id'
,
$contact
[
'supplier_id'
])
->
update
([
'update_time'
=>
time
(),
...
...
@@ -138,6 +137,7 @@ class SupplierContactService
return
false
;
}
$diff
=
array_merge
(
array_diff
(
$oldContact
,
$newContact
),
array_diff
(
$newContact
,
$oldContact
));
unset
(
$diff
[
'update_time'
]);
$changeField
=
array_keys
(
$diff
);
...
...
resources/views/script/BatchAllocatePurchaseUserScript.blade.php
View file @
81e404f5
...
...
@@ -5,21 +5,32 @@
let
table
=
layui
.
table
let
element
=
layui
.
element
;
form
.
on
(
'submit(auditSupplier)'
,
function
(
data
)
{
admin
.
btnLoading
(
'.submit-loading'
);
admin
.
showLoading
({
type
:
3
});
let
supplierIds
=
getQueryVariable
(
'supplier_ids'
);
let
url
=
'/api/supplier/BatchAllocatePurchaseUser?supplier_ids='
+
supplierIds
;
let
res
=
ajax
(
url
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
$
.
ajax
({
url
:
url
,
type
:
'GET'
,
async
:
true
,
data
:
data
.
field
,
dataType
:
'json'
,
timeout
:
20000
,
success
:
function
(
res
)
{
admin
.
removeLoading
();
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
admin
.
btnLoading
(
'.submit-loading'
,
false
);
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
},
error
:
function
()
{
admin
.
removeLoading
();
parent
.
layer
.
msg
(
'网络错误'
,
{
icon
:
5
});
}
});
return
false
;
});
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
...
...
resources/views/script/DisableSupplierScript.blade.php
0 → 100644
View file @
81e404f5
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'layer'
,
'admin'
],
function
()
{
let
admin
=
layui
.
admin
;
let
form
=
layui
.
form
;
form
.
on
(
'submit(blockSupplier)'
,
function
(
data
)
{
let
supplierId
=
getQueryVariable
(
'supplier_id'
);
let
url
=
'/api/supplier/DisableSupplier?supplier_id='
+
supplierId
;
let
res
=
ajax
(
url
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
return
false
;
});
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
admin
.
closeThisDialog
();
});
});
</script>
\ No newline at end of file
resources/views/script/SupplierListScript.blade.php
View file @
81e404f5
...
...
@@ -155,6 +155,9 @@
}
else
{
return
data
.
status_name
;
}
switch
(
data
.
status
){
case
3
:
}
}
},
{
field
:
'channel_username'
,
title
:
'采购员'
,
align
:
'center'
,
width
:
130
},
...
...
@@ -492,17 +495,16 @@
return
;
}
if
((
status
===
3
||
status
===
2
||
status
===
0
)
&&
!
hasSku
)
{
layer
.
confirm
(
'确定要禁用该供应商吗?'
,
function
(
index
)
{
let
supplierId
=
data
[
0
].
supplier_id
;
let
res
=
ajax
(
'/api/supplier/DisableSupplier'
,
{
supplier_id
:
supplierId
})
if
(
res
.
err_code
===
0
)
{
layer
.
open
({
type
:
2
,
content
:
'/supplier/DisableSupplier?view=iframe&supplier_id='
+
supplierId
,
area
:
[
'700px'
,
'70%'
],
title
:
'禁用供应商'
,
end
:
function
()
{
saveRefreshData
(
'detail'
,
supplierId
)
table
.
reload
(
'list'
)
table
.
reload
(
'list'
)
;
supplierStatistics
();
layer
.
closeAll
();
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
})
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
})
}
});
}
else
{
...
...
resources/views/web/DisableSupplier.blade.php
0 → 100644
View file @
81e404f5
<style>
.layui-form-item
{
margin-bottom
:
5px
;
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<form
class=
"layui-form"
action=
""
>
<input
type=
"hidden"
name=
"supplier_id"
value=
"{{$supplier['supplier_id']}}"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
基本信息
</b>
</blockquote>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
供应商名称 :
</label>
<div
class=
"layui-input-block block-42"
style=
"padding-top: 7px"
>
{{$supplier['supplier_name']}}
<a
style=
"color: dodgerblue;margin-left: 20px"
ew-href=
"/supplier/SupplierDetail?view=iframe&supplier_id={{$supplier['supplier_id']}}"
ew-title=
'供应商详情 - {{$supplier['
supplier_code
']}}'
>
{{$supplier['supplier_code']}}
</a>
</div>
</div>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
注意
</b>
<br>
对应供应商设为禁用后,猎芯将无法与其进行交易,如要再次启用,则须再次走审核流程。
</blockquote>
<div
class=
"layui-form-item layui-form-text"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
原因说明 :
</label>
<div
class=
"layui-input-block"
>
<textarea
name=
"disable_reason"
required
placeholder=
"请填写禁用原因"
class=
"layui-textarea"
></textarea>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
lay-filter=
"blockSupplier"
>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
取消
</button>
</div>
</div>
</form>
</div>
</div>
\ No newline at end of file
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