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
f5f80f27
authored
Jun 29, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-供应商类型-20220614' into ysx-供应商新需求-20220627
parents
52202507
35ce3993
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
71 additions
and
20 deletions
app/Http/Controllers/SupplierController.php
app/Http/Services/DataService.php
app/Http/Services/SkuService.php
app/Http/Validators/SupplierValidator.php
app/Http/routes.php
config/fixed.php
resources/views/script/AddSupplierAttachmentScript.blade.php
resources/views/script/SkuListScript.blade.php
resources/views/script/UpdateSupplierScript.blade.php
resources/views/script/supplier/SupplierBaseScript.blade.php
resources/views/web/AddSupplier.blade.php
resources/views/web/PrintSupplier.blade.php
resources/views/web/SupplierDetail.blade.php
resources/views/web/supplier/SupplierBase.blade.php
app/Http/Controllers/SupplierController.php
View file @
f5f80f27
...
@@ -67,7 +67,7 @@ class SupplierController extends Controller
...
@@ -67,7 +67,7 @@ class SupplierController extends Controller
$applyData
=
$applyService
->
getAuditSupplierShareApplyList
(
$request
->
user
->
userId
);
$applyData
=
$applyService
->
getAuditSupplierShareApplyList
(
$request
->
user
->
userId
);
$this
->
data
[
'shareApplyCount'
]
=
$applyData
[
'total'
];
$this
->
data
[
'shareApplyCount'
]
=
$applyData
[
'total'
];
$statusData
=
[];
$statusData
=
[];
foreach
(
config
(
'fixed.SupplierStatus'
)
as
$key
=>
$value
)
{
foreach
(
config
(
'fixed.SupplierStatus'
)
as
$key
=>
$value
)
{
$statusData
[]
=
[
$statusData
[]
=
[
'name'
=>
$value
,
'name'
=>
$value
,
'value'
=>
$key
,
'value'
=>
$key
,
...
@@ -210,6 +210,8 @@ class SupplierController extends Controller
...
@@ -210,6 +210,8 @@ class SupplierController extends Controller
]);
]);
$this
->
data
[
'supplier'
]
=
$supplier
;
$this
->
data
[
'supplier'
]
=
$supplier
;
$this
->
data
[
'address'
]
=
$supplierService
->
getAddress
(
$supplierId
);
$this
->
data
[
'address'
]
=
$supplierService
->
getAddress
(
$supplierId
);
$this
->
data
[
'ignore_supplier_type_change_tips'
]
=
in_array
(
$supplier
[
'supplier_name'
],
config
(
'field.SkipChangeSupplierTypeNames'
));
return
$this
->
view
(
'编辑供应商'
);
return
$this
->
view
(
'编辑供应商'
);
}
}
...
...
app/Http/Services/DataService.php
View file @
f5f80f27
...
@@ -518,5 +518,30 @@ class DataService
...
@@ -518,5 +518,30 @@ class DataService
});
});
})
->
export
(
'csv'
);
})
->
export
(
'csv'
);
}
}
public
function
exportSupplierJsonForUnited
()
{
$suppliers
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
pluck
(
'supplier_group'
,
'supplier_id'
)
->
toArray
();
$exportJson
=
[];
$items
=
array_map
(
function
(
$value
)
{
$value
=
array_get
(
config
(
'fixed.SupplierGroup'
),
$value
);
return
$value
;
},
$suppliers
);
$jsonItems
=
[];
foreach
(
$items
as
$key
=>
$item
)
{
$jsonItems
[]
=
[
'i'
=>
$key
,
'n'
=>
$item
];
}
$exportJson
=
[
'sysId'
=>
1
,
'cType'
=>
2
,
'list'
=>
$jsonItems
,
];
echo
json_encode
(
$exportJson
);
}
}
}
app/Http/Services/SkuService.php
View file @
f5f80f27
...
@@ -99,6 +99,7 @@ class SkuService
...
@@ -99,6 +99,7 @@ class SkuService
$item
[
'encoded_user_name'
]
=
array_get
(
$encodedUsers
,
$encoded
,
''
);
$item
[
'encoded_user_name'
]
=
array_get
(
$encodedUsers
,
$encoded
,
''
);
$item
[
'moq'
]
=
$item
[
'moq'
]
?:
0
;
$item
[
'moq'
]
=
$item
[
'moq'
]
?:
0
;
$item
[
'stock'
]
=
$item
[
'stock'
]
?:
0
;
$item
[
'stock'
]
=
$item
[
'stock'
]
?:
0
;
$item
[
'cp_time'
]
=
$item
[
'cp_time'
]
?
date
(
'Y-m-d H:i:s'
,
$item
[
'cp_time'
])
:
''
;
return
$item
;
return
$item
;
},
$list
);
},
$list
);
}
}
...
...
app/Http/Validators/SupplierValidator.php
View file @
f5f80f27
...
@@ -57,6 +57,7 @@ class SupplierValidator
...
@@ -57,6 +57,7 @@ class SupplierValidator
'main_brands'
=>
'required'
,
'main_brands'
=>
'required'
,
'pay_type'
=>
'required'
,
'pay_type'
=>
'required'
,
'settlement_type'
=>
'required'
,
'settlement_type'
=>
'required'
,
'established_time'
=>
'required'
,
'currency'
=>
'required'
,
'currency'
=>
'required'
,
'supplier_group'
=>
'required'
,
'supplier_group'
=>
'required'
,
'main_customers'
=>
'max:100'
,
'main_customers'
=>
'max:100'
,
...
...
app/Http/routes.php
View file @
f5f80f27
...
@@ -60,6 +60,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
...
@@ -60,6 +60,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
$resut
=
json_decode
(
'{"group_code":"G000010","source_sn":0,"company_name":"深圳大事件科技有限公司","init_nature":"原厂","company_nature":"方案商","company_type":2}'
,
true
);
(
new
\App\Http\Services\SyncSupplierService
())
->
syncSupplierToUnited
(
5
);
dd
((
new
\App\Http\Services\SyncSupplierService
())
->
syncSupplierToUnitedResult
(
$resut
));
});
});
config/fixed.php
View file @
f5f80f27
...
@@ -86,6 +86,7 @@ return [
...
@@ -86,6 +86,7 @@ return [
//账期-定期结算
//账期-定期结算
2
=>
'验货付款'
,
2
=>
'验货付款'
,
// 4 => '定金'
// 4 => '定金'
5
=>
'验货付款'
,
],
],
'SupplierApiType'
=>
[
'SupplierApiType'
=>
[
...
...
resources/views/script/AddSupplierAttachmentScript.blade.php
View file @
f5f80f27
...
@@ -8,19 +8,32 @@
...
@@ -8,19 +8,32 @@
//提交数据
//提交数据
form
.
on
(
'submit(saveSupplierAttachment)'
,
function
(
data
)
{
form
.
on
(
'submit(saveSupplierAttachment)'
,
function
(
data
)
{
layer
.
confirm
(
'确定要保存附件信息吗?'
,
function
(
index
)
{
layer
.
confirm
(
'确定要保存附件信息吗?'
,
function
(
index
)
{
let
res
=
ajax
(
'/api/supplier_attachment/SaveSupplierAttachment'
,
data
.
field
);
admin
.
showLoading
({
if
(
!
res
)
{
type
:
3
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
});
}
else
{
$
.
ajax
({
url
:
'/api/supplier_attachment/SaveSupplierAttachment'
,
type
:
'GET'
,
async
:
true
,
data
:
data
.
field
,
dataType
:
'json'
,
timeout
:
20000
,
success
:
function
(
res
)
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
admin
.
removeLoading
();
admin
.
putTempData
(
"needFreshList"
,
1
);
admin
.
putTempData
(
"needFreshList"
,
1
);
admin
.
closeThisDialog
();
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
}
else
{
admin
.
removeLoading
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
},
error
:
function
()
{
admin
.
removeLoading
();
parent
.
layer
.
msg
(
'网络错误'
,
{
icon
:
5
});
}
}
return
false
;
})
;
});
});
return
false
;
return
false
;
})
})
...
...
resources/views/script/SkuListScript.blade.php
View file @
f5f80f27
...
@@ -38,11 +38,13 @@
...
@@ -38,11 +38,13 @@
@
if
(
request
()
->
get
(
'search'
)
==
1
)
@
if
(
request
()
->
get
(
'search'
)
==
1
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'#getSupplierListButton'
).
click
();
$
(
'#getSupplierListButton'
).
click
();
},
500
);
},
500
);
@
endif
@
endif
let
cols
=
[
let
cols
=
[
{
type
:
'checkbox'
},
{
type
:
'checkbox'
},
{
field
:
'cp_time'
,
title
:
'上架有效期'
,
align
:
'center'
,
width
:
180
},
{
{
field
:
'goods_name'
,
title
:
'型号'
,
align
:
'center'
,
width
:
200
,
templet
:
function
(
data
)
{
field
:
'goods_name'
,
title
:
'型号'
,
align
:
'center'
,
width
:
200
,
templet
:
function
(
data
)
{
return
"
<
a
href
=
'{{config('
website
.
FootstoneUrl
')}}/footstone/addsku?sku_id=" + data.goods_id + "'
style
=
'color:blue'
target
=
'_blank'
>
"
return
"
<
a
href
=
'{{config('
website
.
FootstoneUrl
')}}/footstone/addsku?sku_id=" + data.goods_id + "'
style
=
'color:blue'
target
=
'_blank'
>
"
...
...
resources/views/script/UpdateSupplierScript.blade.php
View file @
f5f80f27
...
@@ -71,6 +71,9 @@
...
@@ -71,6 +71,9 @@
obj2Checked
=
true
;
obj2Checked
=
true
;
}
}
}
}
@
if
(
$ignore_supplier_type_change_tips
)
msg
=
''
;
@
endif
if
(
msg
)
{
if
(
msg
)
{
layer
.
confirm
(
msg
,
{
btn
:
[
"确认"
,
"取消"
]},
layer
.
confirm
(
msg
,
{
btn
:
[
"确认"
,
"取消"
]},
function
(
index
)
{
function
(
index
)
{
...
...
resources/views/script/supplier/SupplierBaseScript.blade.php
View file @
f5f80f27
...
@@ -54,15 +54,13 @@
...
@@ -54,15 +54,13 @@
if
(
res
.
err_code
===
-
2
)
{
if
(
res
.
err_code
===
-
2
)
{
if
(
!
ignoreCompanyCheck
)
{
if
(
!
ignoreCompanyCheck
)
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
self
.
after
(
"
<
div
id
=
'supplier_check_tip'
style
=
'margin-top: 5px'
>
" +
self
.
next
(
'#supplier_check_tip'
).
find
(
'p'
).
text
(
res
.
err_msg
);
"
<
p
style
=
'color: red;'
>
" + res.err_msg + "
<
/p></
div
>
");
$
(
'#supplier_name'
).
prop
(
'disabled'
,
false
);
$
(
'#supplier_name'
).
prop
(
'disabled'
,
false
);
}
}
}
else
{
}
else
{
//这个code代表供应商名称已经存在,自然要检测
//这个code代表供应商名称已经存在,自然要检测
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
self.after("
<
div
id
=
'supplier_check_tip'
style
=
'margin-top: 5px'
>
" +
self
.
next
(
'#supplier_check_tip'
).
find
(
'p'
).
text
(
res
.
err_msg
);
"
<
p
style
=
'color: red;'
>
" + res.err_msg + "
<
/p></
div
>
");
$
(
'#supplier_name'
).
prop
(
'disabled'
,
false
);
$
(
'#supplier_name'
).
prop
(
'disabled'
,
false
);
}
}
if
(
!
ignoreCompanyCheck
)
{
if
(
!
ignoreCompanyCheck
)
{
...
@@ -306,6 +304,7 @@
...
@@ -306,6 +304,7 @@
form
.
val
(
'supplier_form'
,
{
tax_number
:
companyInfo
.
tax_number
})
form
.
val
(
'supplier_form'
,
{
tax_number
:
companyInfo
.
tax_number
})
$
(
'#tax_number'
).
val
(
companyInfo
.
tax_number
);
$
(
'#tax_number'
).
val
(
companyInfo
.
tax_number
);
$
(
'#supplier_address'
).
val
(
companyInfo
.
supplier_address
);
$
(
'#supplier_address'
).
val
(
companyInfo
.
supplier_address
);
$
(
'#phone'
).
val
(
companyInfo
.
phone
);
$
(
'#registered_capital'
).
val
(
companyInfo
.
registered_capital
);
$
(
'#registered_capital'
).
val
(
companyInfo
.
registered_capital
);
form
.
render
();
form
.
render
();
layer
.
msg
(
'验证成功,校验公司信息通过,自动补全相关数据'
,
{
icon
:
6
})
layer
.
msg
(
'验证成功,校验公司信息通过,自动补全相关数据'
,
{
icon
:
6
})
...
@@ -313,8 +312,7 @@
...
@@ -313,8 +312,7 @@
if
(
ignoreCompanyCheck
)
{
if
(
ignoreCompanyCheck
)
{
layer
.
msg
(
'公司未进行工商注册'
,
{
icon
:
5
})
layer
.
msg
(
'公司未进行工商注册'
,
{
icon
:
5
})
}
else
{
}
else
{
$('#supplier_name').after("
<
div
id
=
'supplier_check_tip'
style
=
'margin-top: 5px'
>
" +
$
(
'#supplier_name'
).
next
(
'#supplier_check_tip'
).
find
(
'p'
).
text
(
'公司未进行工商注册,请修改后重新提交'
);
"
<
p
style
=
'color: red;'
>
公司未进行工商注册,请修改后重新提交
<
/p></
div
>
"
);
layer
.
msg
(
'验证失败,公司未进行工商注册,请修改后重新提交'
,
{
icon
:
5
})
layer
.
msg
(
'验证失败,公司未进行工商注册,请修改后重新提交'
,
{
icon
:
5
})
resetCompanyInfo
(
supplierName
!==
''
);
resetCompanyInfo
(
supplierName
!==
''
);
}
}
...
...
resources/views/web/AddSupplier.blade.php
View file @
f5f80f27
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
{!! $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',-1,[1=>'有',-1=>'无']) !!}
{!! $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',-1,[1=>'有',-1=>'无']) !!}
</div>
</div>
<div
class=
"layui-col-md3"
>
<div
class=
"layui-col-md3"
>
<label
class=
"layui-form-label"
style=
"width: 80px"
>
成立时间 :
<label
class=
"layui-form-label"
style=
"width: 80px"
>
<span
class=
"require"
>
*
</span>
成立时间 :
</label>
</label>
<div
class=
"layui-input-block"
style=
"width: 150px"
>
<div
class=
"layui-input-block"
style=
"width: 150px"
>
<input
type=
"text"
id=
"established_time"
name=
"established_time"
<input
type=
"text"
id=
"established_time"
name=
"established_time"
...
...
resources/views/web/PrintSupplier.blade.php
View file @
f5f80f27
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
style=
"text-align: left;padding-left: 20px"
>
{{$printData['supplier_address']}}
</td>
style=
"text-align: left;padding-left: 20px"
>
{{$printData['supplier_address']}}
</td>
</tr>
</tr>
<tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商办公/发货地址
*
</td>
<td
width=
"20%"
colspan=
"1"
>
供应商办公/发货地址
</td>
<td
width=
"80%"
colspan=
"5"
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['shipping_address']}}
</td>
style=
"text-align: left;padding-left: 20px"
>
{{$printData['shipping_address']}}
</td>
</tr>
</tr>
...
@@ -132,7 +132,7 @@
...
@@ -132,7 +132,7 @@
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
></td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
></td>
</tr>
</tr>
<tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商到票时间
*
</td>
<td
width=
"20%"
colspan=
"1"
>
供应商到票时间
</td>
<td
width=
"80%"
colspan=
"5"
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['ticket_time'] or ''}}
</td>
style=
"text-align: left;padding-left: 20px"
>
{{$printData['ticket_time'] or ''}}
</td>
</tr>
</tr>
...
...
resources/views/web/SupplierDetail.blade.php
View file @
f5f80f27
...
@@ -164,7 +164,7 @@
...
@@ -164,7 +164,7 @@
:{{$supplier['has_legal_ID_card_name']}}
:{{$supplier['has_legal_ID_card_name']}}
</div>
</div>
<div
class=
"layui-col-md3"
>
<div
class=
"layui-col-md3"
>
成立时间 :{{$supplier['established_time']}}
<span
class=
"required_field"
>
*
</span>
成立时间 :{{$supplier['established_time']}}
</div>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
f5f80f27
...
@@ -59,6 +59,9 @@
...
@@ -59,6 +59,9 @@
@endif"
@endif"
value=
"{{$supplier['supplier_name'] or ''}}"
value=
"{{$supplier['supplier_name'] or ''}}"
@
if
($
supplier
)
disabled
@
endif
>
@
if
($
supplier
)
disabled
@
endif
>
<div
id=
'supplier_check_tip'
style=
'margin-top: 5px'
>
<p
style=
'color: red;'
></p>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-col-md5"
>
...
@@ -68,6 +71,9 @@
...
@@ -68,6 +71,9 @@
<input
type=
"text"
name=
"tax_number"
id=
"tax_number"
placeholder=
"请输入公司税号,选择所在区域才允许输入"
<input
type=
"text"
name=
"tax_number"
id=
"tax_number"
placeholder=
"请输入公司税号,选择所在区域才允许输入"
class=
"layui-input layui-disabled"
disabled
value=
"{{$supplier['tax_number'] or ''}}"
>
class=
"layui-input layui-disabled"
disabled
value=
"{{$supplier['tax_number'] or ''}}"
>
</div>
</div>
<div
id=
'supplier_check_tip'
style=
'margin-top: 5px'
>
<p
style=
'color: red;'
></p>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-md2"
style=
"padding-left: 20px"
>
<div
class=
"layui-col-md2"
style=
"padding-left: 20px"
>
...
@@ -161,7 +167,7 @@
...
@@ -161,7 +167,7 @@
{!! $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',$supplier['has_legal_ID_card'],[1=>'有',-1=>'无']) !!}
{!! $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',$supplier['has_legal_ID_card'],[1=>'有',-1=>'无']) !!}
</div>
</div>
<div
class=
"layui-col-md3"
>
<div
class=
"layui-col-md3"
>
<label
class=
"layui-form-label"
style=
"width: 80px"
>
成立时间 :
<label
class=
"layui-form-label"
style=
"width: 80px"
>
<span
class=
"require"
>
*
</span>
成立时间 :
</label>
</label>
<div
class=
"layui-input-block"
style=
"width: 150px"
>
<div
class=
"layui-input-block"
style=
"width: 150px"
>
<input
type=
"text"
id=
"established_time"
name=
"established_time"
<input
type=
"text"
id=
"established_time"
name=
"established_time"
...
...
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