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
de503a64
authored
Apr 26, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
离职判断
parent
5384ad1e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
14 deletions
app/Http/Controllers/Api/SupplierContactApiController.php
app/Http/Services/LogService.php
app/Http/Transformers/LogTransformer.php
resources/views/script/AllocatePurchaseUserScript.blade.php
app/Http/Controllers/Api/SupplierContactApiController.php
View file @
de503a64
...
...
@@ -7,6 +7,7 @@ use App\Http\Services\LogService;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Transformers\SupplierContactTransformer
;
use
App\Http\Validators\SupplierContactValidator
;
use
App\Model\LogModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
Illuminate\Http\Request
;
...
...
@@ -85,16 +86,16 @@ class SupplierContactApiController extends Controller
if
(
$userNum
===
1
)
{
//如果只有一个,那就可以去主表删除对应的采购员了
$supplierModel
=
new
SupplierChannelModel
();
$supplier
=
$supplierModel
->
where
(
'supplier_id'
,
$contact
[
'supplier_id'
])
->
first
();
$channelUid
=
explode
(
','
,
$supplier
[
'channel_uid'
]);
$supplier
=
$supplierModel
->
where
(
'supplier_id'
,
$contact
[
'supplier_id'
])
->
first
();
$channelUid
=
explode
(
','
,
$supplier
[
'channel_uid'
]);
if
(
in_array
(
$canCheckUids
,
$channelUid
))
{
//删除
$channelUid
=
array_filter
(
$channelUid
,
function
(
$value
)
use
(
$canCheckUids
)
{
$channelUid
=
array_filter
(
$channelUid
,
function
(
$value
)
use
(
$canCheckUids
)
{
return
$value
!=
$canCheckUids
;
});
$supplierModel
->
where
(
'supplier_id'
,
$contact
[
'supplier_id'
])
->
update
([
$supplierModel
->
where
(
'supplier_id'
,
$contact
[
'supplier_id'
])
->
update
([
'channel_uid'
=>
implode
(
','
,
$channelUid
),
'update_time'
=>
time
(),
'update_time'
=>
time
(),
]);
}
}
...
...
@@ -108,6 +109,10 @@ class SupplierContactApiController extends Controller
'update_time'
=>
time
(),
'status'
=>
1
,
]);
$logService
=
new
LogService
();
$content
=
'删除联系人'
;
$remark
=
json_encode
(
$contact
);
$logService
->
AddLog
(
$contact
[
'supplier_id'
],
LogModel
::
UPDATE_OPERATE
,
'修改供应商基本资料'
,
$content
,
$remark
);
$this
->
response
(
0
,
'删除成功'
);
}
$this
->
response
(
-
1
,
'找不到删除对象'
);
...
...
app/Http/Services/LogService.php
View file @
de503a64
...
...
@@ -124,8 +124,8 @@ class LogService
$newFee
=
json_decode
(
$newSupplier
[
'extra_fee'
],
true
);
$content
=
"采购附加费由 [商品总价不满"
.
$oldFee
[
'cn'
][
'max'
]
.
"元,收取"
.
$oldFee
[
'cn'
][
'price'
]
.
"元;商品总价不满"
.
$oldFee
[
'cn'
][
'max'
]
.
"美金,收取"
.
$oldFee
[
'cn'
][
'price'
]
.
"元;] 修改为 [商品总价不满"
.
$newFee
[
'
cn'
][
'max'
]
.
"元,收取"
.
$newFee
[
'cn
'
][
'price'
]
.
"元;商品总价不满"
.
$newFee
[
'
cn'
][
'max'
]
.
"美金,收取"
.
$newFee
[
'cn
'
][
'price'
]
.
"元;]"
;
"元;] 修改为 [商品总价不满"
.
$newFee
[
'
hk'
][
'max'
]
.
"元,收取"
.
$newFee
[
'hk
'
][
'price'
]
.
"元;商品总价不满"
.
$newFee
[
'
hk'
][
'max'
]
.
"美金,收取"
.
$newFee
[
'hk
'
][
'price'
]
.
"元;]"
;
$result
[]
=
$content
;
}
}
...
...
app/Http/Transformers/LogTransformer.php
View file @
de503a64
...
...
@@ -24,12 +24,14 @@ class LogTransformer
$item
[
'type'
]
=
array_get
(
config
(
'fixed.LogType'
),
$item
[
'type'
]);
//如果action是修改供应商,就要做对比处理
if
(
$item
[
'action'
]
===
'修改供应商基本资料'
)
{
$logService
=
new
LogService
();
$remark
=
json_decode
(
$item
[
'remark'
],
true
);
$oldSupplier
=
array_get
(
$remark
,
'old_supplier'
);
$newSupplier
=
array_get
(
$remark
,
'new_supplier'
);
$content
=
$logService
->
compareSupplierChange
(
$newSupplier
,
$oldSupplier
);
$item
[
'content'
]
=
$content
;
if
(
$item
[
'content'
]
===
'修改供应商'
)
{
$logService
=
new
LogService
();
$remark
=
json_decode
(
$item
[
'remark'
],
true
);
$oldSupplier
=
array_get
(
$remark
,
'old_supplier'
);
$newSupplier
=
array_get
(
$remark
,
'new_supplier'
);
$content
=
$logService
->
compareSupplierChange
(
$newSupplier
,
$oldSupplier
);
$item
[
'content'
]
=
$content
;
}
}
return
$item
;
}
...
...
resources/views/script/AllocatePurchaseUserScript.blade.php
View file @
de503a64
...
...
@@ -30,7 +30,7 @@
,
page
:
{}
});
form
.
on
(
'submit(auditSupplier)'
,
function
(
data
)
{
//
admin.btnLoading('.submit-loading');
admin
.
btnLoading
(
'.submit-loading'
);
let
supplierId
=
getQueryVariable
(
'supplier_id'
);
let
url
=
'/api/supplier/AllocatePurchaseUser?supplier_id='
+
supplierId
;
let
res
=
ajax
(
url
,
data
.
field
);
...
...
@@ -42,6 +42,7 @@
//修改罗盘显示数量(cao)
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
admin
.
btnLoading
(
'.submit-loading'
,
false
);
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
...
...
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