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
2009e605
authored
Aug 04, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复bug
parent
d791b15d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
53 additions
and
19 deletions
app/Http/Controllers/Api/SupplierShareApplyApiController.php
app/Http/Services/SupplierContactService.php
app/Http/Services/SupplierShareApplyService.php
app/Http/Services/SupplierTagService.php
app/Http/routes.php
app/Model/SupplierShareApplyModel.php
resources/views/script/ApplySupplierShareScript.blade.php
resources/views/script/AuditSupplierShareApplyScript.blade.php
resources/views/web/ApplySupplierShare.blade.php
resources/views/web/supplier/SupplierFile.blade.php
app/Http/Controllers/Api/SupplierShareApplyApiController.php
View file @
2009e605
...
...
@@ -54,10 +54,10 @@ class SupplierShareApplyApiController extends Controller
public
function
SaveSupplierShareApply
(
$request
)
{
$map
=
$request
->
only
([
'department_id'
,
'
apply_
department_id'
,
'supplier_id'
,
]);
if
(
empty
(
$map
[
'department_id'
])
||
empty
(
$map
[
'supplier_id'
]))
{
if
(
empty
(
$map
[
'
apply_
department_id'
])
||
empty
(
$map
[
'supplier_id'
]))
{
$this
->
response
(
-
1
,
'缺少参数'
);
}
$map
[
'apply_code_id'
]
=
$request
->
user
->
codeId
;
...
...
app/Http/Services/SupplierContactService.php
View file @
2009e605
...
...
@@ -175,7 +175,23 @@ class SupplierContactService
$contact
[
'supplier_id'
]
=
$supplierId
;
$contact
[
'add_time'
]
=
time
();
$contact
[
'admin_id'
]
=
request
()
->
user
->
userId
;
return
$contactModel
->
insert
(
$contact
);
$result
=
$contactModel
->
insert
(
$contact
);
if
(
$result
)
{
$channelUids
=
$contacts
=
$contactModel
->
where
(
'supplier_id'
,
$supplierId
)
->
pluck
(
'can_check_uids'
)
->
toArray
();
$supplierModel
=
new
SupplierChannelModel
();
$result
=
$supplierModel
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'channel_uid'
=>
implode
(
','
,
$channelUids
),
'update_time'
=>
time
(),
]);
$adminService
=
new
AdminUserService
();
$user
=
$adminService
->
getAdminUserInfoByCodeId
(
$channelUid
);
$channelUserName
=
array_get
(
$user
,
'name'
);
//还要记录日志
$logService
=
new
LogService
();
$content
=
"共用申请审核通过,添加采购员 : "
.
$channelUserName
;
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'添加采购员'
,
$content
);
}
return
$result
;
}
}
\ No newline at end of file
app/Http/Services/SupplierShareApplyService.php
View file @
2009e605
...
...
@@ -68,7 +68,10 @@ class SupplierShareApplyService
$data
=
$map
;
$data
[
'status'
]
=
0
;
$data
[
'create_time'
]
=
time
();
$data
[
'create_uid'
]
=
$map
[
'apply_code_id'
];
$data
[
'create_uid'
]
=
request
()
->
user
->
userId
;
$departmentService
=
new
DepartmentService
();
$department
=
$departmentService
->
getTopDepartmentByUserId
(
$data
[
'create_uid'
]);
$data
[
'department_id'
]
=
$department
[
'department_id'
];
$applyModel
=
new
SupplierShareApplyModel
();
return
$applyModel
->
insert
(
$data
);
}
...
...
@@ -78,8 +81,8 @@ class SupplierShareApplyService
{
$applyModel
=
new
SupplierShareApplyModel
();
$count
=
$applyModel
->
where
(
'supplier_id'
,
$map
[
'supplier_id'
])
->
where
(
'apply_code_id'
,
$map
[
'apply_code_id'
])
->
where
(
'department_id'
,
$map
[
'department_id'
])
->
whereNotIn
(
'status'
,
[
$
this
::
STATUS_AUDIT_REJECT
,
$this
::
STATUS_REVIEW_REJECT
])
->
count
();
->
where
(
'apply_code_id'
,
$map
[
'apply_code_id'
])
->
where
(
'department_id'
,
$map
[
'
apply_
department_id'
])
->
whereNotIn
(
'status'
,
[
$
applyModel
::
STATUS_AUDIT_REJECT
,
$applyModel
::
STATUS_REVIEW_REJECT
])
->
count
();
return
$count
;
}
...
...
app/Http/Services/SupplierTagService.php
View file @
2009e605
...
...
@@ -46,6 +46,15 @@ class SupplierTagService
return
!
empty
(
$data
[
'data'
])
?
$data
[
'data'
]
:
[];
}
//获取供应商对应的自定义标签
public
function
getCustomerTagsBySupplierId
(
$supplierId
)
{
// $supplierId = 1;
$response
=
$this
->
client
->
get
(
'/get?tag_use=4&req_id='
.
$supplierId
);
$data
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
return
!
empty
(
$data
[
'data'
])
?
$data
[
'data'
]
:
[];
}
//新增/修改标签和供应商id对应关系到标签系统
public
function
saveTags
(
$supplierId
,
$tagUse
,
$newTags
,
$oldTags
)
{
...
...
@@ -76,7 +85,7 @@ class SupplierTagService
'modifier_name'
=>
'admin'
,
'data'
=>
[
[
'id'
=>
$supplierId
,
'id'
=>
(
int
)
$supplierId
,
'tag_status'
=>
0
,
]
]
...
...
@@ -105,6 +114,9 @@ class SupplierTagService
RequestOptions
::
JSON
=>
$params
,
]);
$data
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
// if ($tagUse==4) {
// dd($params,$data);
// }
if
(
!
empty
(
$data
[
'status'
])
&&
$data
[
'status'
]
==
1
)
{
return
true
;
}
else
{
...
...
app/Http/routes.php
View file @
2009e605
...
...
@@ -45,5 +45,9 @@ Route::group(['middleware' => ['web'], 'namespace' => 'Api'], function () {
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
$service
=
new
\App\Http\Services\DataService
();
// $service->initSystemTag();
$service
->
transferFileData
();
// $service->transferFileData();
$tagService
=
new
\App\Http\Services\SupplierTagService
();
// $res = $tagService->getSystemTagsBySupplierId(12293);
$res
=
$tagService
->
getCustomerTagsBySupplierId
(
12293
);
dd
(
$res
);
});
app/Model/SupplierShareApplyModel.php
View file @
2009e605
...
...
@@ -40,7 +40,7 @@ class SupplierShareApplyModel extends Model
public
function
apply_user
()
{
return
$this
->
hasOne
(
UserInfoModel
::
class
,
'userId'
,
'
apply_code_
id'
);
return
$this
->
hasOne
(
UserInfoModel
::
class
,
'userId'
,
'
create_u
id'
);
}
}
resources/views/script/ApplySupplierShareScript.blade.php
View file @
2009e605
...
...
@@ -47,7 +47,7 @@
$
.
each
(
res
.
data
,
function
(
index
,
value
)
{
optionHtml
+=
"
<
option
value
=
'" + value.department_id + "'
>
" + value.department_name + "
<
/option>
"
})
$
(
'#department_id'
).
html
(
optionHtml
);
$
(
'#
apply_
department_id'
).
html
(
optionHtml
);
form
.
render
(
'select'
);
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
...
...
@@ -55,17 +55,15 @@
});
form
.
on
(
'submit(save_supplier_share_apply)'
,
function
(
data
)
{
admin
.
btnLoading
(
'.submit-loading'
);
let
url
=
'/api/supplier_share_apply/SaveSupplierShareApply'
;
let
res
=
ajax
(
url
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
//
admin.closeThisDialog();
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
admin
.
btnLoading
(
'.submit-loading'
,
false
);
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
...
...
resources/views/script/AuditSupplierShareApplyScript.blade.php
View file @
2009e605
...
...
@@ -19,8 +19,8 @@
}
},
{
field
:
'
apply_department_name'
,
title
:
'被
申请部门'
,
width
:
150
,
align
:
'center'
,
templet
:
function
(
d
)
{
return
d
.
apply_department
?
d
.
apply_
department
.
department_name
:
''
;
field
:
'
department_name'
,
title
:
'
申请部门'
,
width
:
150
,
align
:
'center'
,
templet
:
function
(
d
)
{
return
d
.
department
?
d
.
department
.
department_name
:
''
;
}
},
{
...
...
@@ -29,8 +29,8 @@
}
},
{
field
:
'department_name'
,
title
:
'被申请部门'
,
width
:
150
,
align
:
'center'
,
templet
:
function
(
d
)
{
return
d
.
department
?
d
.
department
.
department_name
:
''
;
field
:
'
apply_
department_name'
,
title
:
'被申请部门'
,
width
:
150
,
align
:
'center'
,
templet
:
function
(
d
)
{
return
d
.
apply_department
?
d
.
apply_
department
.
department_name
:
''
;
}
},
{
field
:
'create_time'
,
title
:
'申请时间'
,
width
:
150
,
align
:
'center'
},
...
...
resources/views/web/ApplySupplierShare.blade.php
View file @
2009e605
...
...
@@ -28,7 +28,7 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
被申请部门 :
</label>
<div
class=
"layui-inline"
style=
"width: 250px"
>
<select
name=
"
department_id"
lay-filter=
"department_id"
id=
"
department_id"
>
<select
name=
"
apply_department_id"
lay-filter=
"apply_department_id"
id=
"apply_
department_id"
>
<option
value=
""
>
请选择一个部门
</option>
</select>
</div>
...
...
resources/views/web/supplier/SupplierFile.blade.php
View file @
2009e605
...
...
@@ -36,7 +36,7 @@
@foreach($attachment[$name] as $k=>$item)
<span
class=
"single_file_div"
>
<a
href=
"{{$item['url']}}"
target=
"_blank"
>
{{
$item['file_name']
}}
{{
array_get($item,'file_name','未知文件名')
}}
</a>
<i
class=
"layui-icon delete_file"
style=
"font-size: 15px !important; color: red;cursor: pointer;margin-left: 3px;"
>
X
</i>
...
...
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