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
9c4cf04a
authored
Mar 21, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-财务信息金蝶同步-20240319'
parents
890bffcd
4909d17f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
108 additions
and
26 deletions
app/Http/Controllers/Api/SupplierReceiptApiController.php
app/Http/Controllers/Api/SupplierShareApplyApiController.php
app/Http/Controllers/LogController.php
app/Http/Services/SyncSupplierService.php
app/Http/Transformers/LogTransformer.php
app/Http/Validators/ReceiptValidator.php
public/plugins/assets/js/alpine.js
resources/views/iframe.blade.php
resources/views/script/AddSupplierReceiptScript.blade.php
resources/views/script/supplier/SupplierReceiptScript.blade.php
resources/views/web.blade.php
resources/views/web/AddSupplierReceipt.blade.php
app/Http/Controllers/Api/SupplierReceiptApiController.php
View file @
9c4cf04a
...
...
@@ -58,6 +58,7 @@ class SupplierReceiptApiController extends Controller
'certificate'
,
'account_name'
,
'remark'
,
//'international_code'
]);
$receipt
[
'account_adderss'
]
=
empty
(
$receipt
[
'account_adderss'
])
?
' '
:
$receipt
[
'account_adderss'
];
if
(
$receipt
[
'receipt_type'
]
==
1
)
{
...
...
@@ -80,12 +81,12 @@ class SupplierReceiptApiController extends Controller
//如果修改的只是备注,则不需要转成审核
$needAudit
=
$this
->
checkNeedAudit
(
$oldReceipt
,
$newReceipt
);
if
(
$needAudit
||
empty
(
$request
->
get
(
'receipt_id'
)))
{
//
$supplierModel = new SupplierChannelModel();
$supplierModel
=
new
SupplierChannelModel
();
//修改供应商为审核状态
//
$supplierModel->where('supplier_id', $supplierId)->update([
//
'update_time' => time(),
//
'status' => SupplierChannelModel::STATUS_PENDING,
//
]);
$supplierModel
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'update_time'
=>
time
(),
'status'
=>
SupplierChannelModel
::
STATUS_PENDING
,
]);
}
$logService
=
new
LogService
();
...
...
@@ -95,7 +96,7 @@ class SupplierReceiptApiController extends Controller
(
new
SyncSupplierService
())
->
syncSupplierToErp
(
$supplierId
);
$this
->
response
(
0
,
'操作成功'
);
}
$this
->
response
(
-
1
,
'操作失败'
);
$this
->
response
(
-
1
,
'
没有内容变更,
操作失败'
);
}
//判断是否要进入审核中状态,因为部分字段修改是不需要走审核的
...
...
@@ -127,8 +128,24 @@ class SupplierReceiptApiController extends Controller
public
function
DeleteSupplierReceipt
(
$request
)
{
$receiptId
=
$request
->
get
(
'receipt_id'
);
$receipt
=
SupplierReceiptModel
::
where
(
'receipt_id'
,
$receiptId
)
->
first
()
->
toArray
();
$model
=
new
SupplierReceiptModel
();
$supplierModel
=
new
SupplierChannelModel
();
$supplier
=
$supplierModel
->
where
(
'supplier_id'
,
$receipt
[
'supplier_id'
]);
$supplierId
=
$supplier
[
'supplier_id'
];
//修改供应商为审核状态
$supplierModel
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'update_time'
=>
time
(),
'status'
=>
SupplierChannelModel
::
STATUS_PENDING
,
]);
$result
=
$model
->
where
(
'receipt_id'
,
$receiptId
)
->
delete
();
$logService
=
new
LogService
();
$content
=
'删除银行信息'
;
$remark
=
json_encode
(
$receipt
);
$logService
->
AddLog
(
$receipt
[
'supplier_id'
],
LogModel
::
UPDATE_OPERATE
,
'修改供应商基本资料'
,
$content
,
$remark
);
(
new
SyncSupplierService
())
->
syncSupplierToErp
(
$supplierId
);
if
(
$result
)
{
$this
->
response
(
0
,
'操作成功'
);
}
...
...
app/Http/Controllers/Api/SupplierShareApplyApiController.php
View file @
9c4cf04a
...
...
@@ -61,8 +61,7 @@ class SupplierShareApplyApiController extends Controller
$q
->
orWhere
(
'purchase_uid'
,
$codeId
)
->
orwhere
(
'channel_uid'
,
'like'
,
"%
$codeId
%"
);
}
})
->
where
(
'is_type'
,
0
)
->
first
();
})
->
where
(
'is_type'
,
0
)
->
first
();
if
(
$isOwn
)
{
$this
->
response
(
-
1
,
'你已经可以管理该供应商,无需申请共用'
);
}
...
...
app/Http/Controllers/LogController.php
View file @
9c4cf04a
...
...
@@ -41,6 +41,7 @@ class LogController extends Controller
return
$this
->
errhtml
(
'Not'
,
'没有这个页面'
);
}
//供应商详情的操作日志
public
function
SupplierLog
(
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
,
1
);
...
...
app/Http/Services/SyncSupplierService.php
View file @
9c4cf04a
...
...
@@ -93,11 +93,16 @@ class SyncSupplierService
$message
[
'bankinfo'
][]
=
[
"bank"
=>
$receipt
[
'bank_adderss'
],
'bankaccount'
=>
$receipt
[
'account_no'
],
'supplier'
=>
$receipt
[
'bank_name'
],
'swiftCode'
=>
$receipt
[
'swift_code'
],
'beneficiary'
=>
$receipt
[
'account_name'
],
'bankAddress'
=>
$receipt
[
'account_adderss'
],
'infoEvidence'
=>
$receipt
[
'certificate'
],
//'bankaccount' => $receipt['international_code'],
];
}
}
//dd($message);
if
(
$conn
)
{
}
else
{
...
...
@@ -106,7 +111,6 @@ class SyncSupplierService
config
(
'database.connections.rabbitmq.login'
),
config
(
'database.connections.rabbitmq.password'
));
}
$channel
=
$conn
->
channel
();
$channel
->
queue_declare
(
'supplier_sync'
,
false
,
true
,
false
,
false
);
...
...
app/Http/Transformers/LogTransformer.php
View file @
9c4cf04a
...
...
@@ -33,12 +33,46 @@ class LogTransformer
$item
[
'content'
]
=
$content
;
}
if
(
!
is_array
(
$item
[
'content'
])
&&
strpos
(
$item
[
'content'
],
'联系'
)
!==
false
)
{
$item
[
'content'
]
=
$item
[
'content'
]
.
':'
.
$logService
->
getContactDesc
(
$item
[
'remark'
]);
//如果是和银行信息有关的,还要把具体的信息展示出来
if
(
is_string
(
$item
[
'content'
]))
{
if
(
strpos
(
$item
[
'content'
],
'银行信息'
)
!==
FALSE
)
{
if
(
!
empty
(
$item
[
'remark'
]))
{
//获取当前的信息
$oldReceipt
=
json_decode
(
$item
[
'remark'
],
true
);
//新增
if
(
empty
(
$oldReceipt
[
'receipt_id'
]))
{
$item
[
'content'
]
.=
' : '
.
"银行名称 :
{
$oldReceipt
[
'bank_name'
]
}
| 账户号码 :
{
$oldReceipt
[
'account_no'
]
}
"
;
}
}
}
}
if
(
!
is_array
(
$item
[
'content'
])
&&
strpos
(
$item
[
'content'
],
'联系'
)
!==
false
)
{
$item
[
'content'
]
=
$item
[
'content'
]
.
':'
.
$logService
->
getContactDesc
(
$item
[
'remark'
]);
}
$item
[
'content'
]
=
$item
[
'content'
]
?:
'没有内容变化'
;
}
return
$item
;
}
public
static
function
transformReceiptLog
(
$oldReceipt
,
$receipt
)
{
if
(
empty
(
$oldReceipt
[
'receipt_id'
]))
{
//新增日志
$content
=
"银行名称 :
{
$oldReceipt
[
'bank_name'
]
}
| 账户号码 :
{
$oldReceipt
[
'account_no'
]
}
"
;
}
else
{
if
(
$receipt
)
{
//修改日志
}
else
{
//删除日志
}
}
}
}
app/Http/Validators/ReceiptValidator.php
View file @
9c4cf04a
...
...
@@ -23,6 +23,9 @@ class ReceiptValidator
];
if
(
$receipt
[
'receipt_type'
]
==
2
)
{
$rules
[
"swift_code"
]
=
'required'
;
$rules
[
"account_adderss"
]
=
'required'
;
$rules
[
"account_name"
]
=
'required'
;
//$rules["international_code"] = 'required';
}
$messages
=
$this
->
messages
();
$validator
=
Validator
::
make
(
$receipt
,
$rules
,
$messages
);
...
...
@@ -47,6 +50,8 @@ class ReceiptValidator
'account_no.required'
=>
'银行账号 不能为空'
,
'account_name.required'
=>
'账户名称 不能为空'
,
'certificate.required'
=>
'银行信息凭证 不能为空'
,
'account_adderss.required'
=>
'银行地址 不能为空'
,
//'international_code.required' => '国际代码 不能为空',
];
}
}
public/plugins/assets/js/alpine.js
0 → 100644
View file @
9c4cf04a
This diff is collapsed.
Click to expand it.
resources/views/iframe.blade.php
View file @
9c4cf04a
...
...
@@ -10,6 +10,7 @@
<script
src=
"/js/jquery-2.2.1.js"
></script>
<script
type=
"text/javascript"
src=
"/plugins/assets/libs/layui/layui.js"
></script>
<script
type=
"text/javascript"
src=
"/plugins/assets/js/common.js?version={{time()}}"
></script>
<script
type=
"text/javascript"
src=
"/plugins/assets/js/alpine.js"
defer
></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
...
...
resources/views/script/AddSupplierReceiptScript.blade.php
View file @
9c4cf04a
{
!!
Autograph
()
!!
}
<
script
>
document
.
addEventListener
(
'alpine:init'
,
()
=>
{
Alpine
.
data
(
'receiptForm'
,
()
=>
({
receiptType
:
$
(
'#receipt_type'
)
.
val
(),
init
()
{
let
g
=
this
;
layui
.
use
([
'form'
,
'upload'
,
'admin'
],
function
()
{
const
form
=
layui
.
form
const
upload
=
layui
.
upload
;
...
...
@@ -27,11 +32,7 @@
})
form
.
on
(
'radio(receipt_type)'
,
function
(
data
)
{
if
(
data
.
value
==
1
)
{
$
(
'#swift_code_div'
)
.
hide
();
}
else
{
$
(
'#swift_code_div'
)
.
show
();
}
g
.
receiptType
=
data
.
value
;
});
//图片上传
...
...
@@ -81,4 +82,7 @@
}
});
});
}
}));
});
</
script
>
resources/views/script/supplier/SupplierReceiptScript.blade.php
View file @
9c4cf04a
...
...
@@ -34,6 +34,7 @@
{
field
:
'account_no'
,
title
:
'
<
span
class
=
"require"
>*
<
/span>银行账号', align: 'center', width: 130}
,
{
field
:
'account_name'
,
title
:
'账户名称'
,
align
:
'center'
,
width
:
150
},
{
field
:
'swift_code'
,
title
:
'电汇号码'
,
align
:
'center'
,
width
:
130
},
// {field: 'international_code', title: '国际代码', align: 'center', width: 130},
{
field
:
'certificate'
,
title
:
'
<
span
class
=
"require"
>*
<
/span>信息凭证'
,
...
...
resources/views/web.blade.php
View file @
9c4cf04a
...
...
@@ -45,6 +45,7 @@
<!-- js部分 -->
<script
type=
"text/javascript"
src=
"/plugins/assets/libs/layui/layui.js"
></script>
<script
type=
"text/javascript"
src=
"/plugins/assets/js/common.js?v=317"
></script>
<script
type=
"text/javascript"
src=
"/plugins/assets/js/alpine.js"
></script>
<script>
layui
.
use
([
'index'
,
'layer'
,
'admin'
],
function
()
{
var
$
=
layui
.
jquery
;
...
...
resources/views/web/AddSupplierReceipt.blade.php
View file @
9c4cf04a
...
...
@@ -5,12 +5,13 @@
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<form
class=
"layui-form"
action=
""
>
<form
class=
"layui-form"
action=
""
x-data=
"receiptForm"
>
<input
type=
"hidden"
name=
"supplier_id"
value=
"{{request()->get('supplier_id')}}"
>
<input
type=
"hidden"
name=
"receipt_id"
value=
"{{request()->get('receipt_id')}}"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
银行类型 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"hidden"
id=
"receipt_type"
value=
"{{$receipt['receipt_type'] or 1}}"
>
<input
type=
"radio"
name=
"receipt_type"
lay-filter=
"receipt_type"
value=
"1"
title=
"国内"
@
if
((!
empty
($
receipt
['
receipt_type
'])&&$
receipt
['
receipt_type
']==
1
)||
empty
($
receipt
))
checked
...
...
@@ -48,7 +49,10 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户名称 :
</label>
<label
class=
"layui-form-label"
>
<span
x-show=
"receiptType === '1'"
>
账户名称 :
</span>
<span
x-show=
"receiptType === '2'"
><span
style=
"color: red"
>
*
</span>
国外受益人 :
</span>
</label>
<div
class=
"layui-input-block block-42"
>
<input
type=
"text"
name=
"account_name"
id=
"account_name"
placeholder=
"请输入账户名称"
class=
"layui-input"
...
...
@@ -56,16 +60,26 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
银行地址 :
</label>
<label
class=
"layui-form-label"
>
<span
style=
"color: red"
x-show=
"receiptType === '2'"
>
*
</span>
银行地址 :
</label>
<div
class=
"layui-input-block block-42"
>
<input
type=
"text"
name=
"account_adderss"
id=
"account_adderss"
placeholder=
"请输入银行具体地址,精确到街道"
class=
"layui-input"
value=
"{{$receipt['account_adderss'] or ''}}"
>
</div>
</div>
<div
class=
"layui-form-item"
id=
"swift_code_div"
@
if
((!
empty
($
receipt
['
receipt_type
'])&&$
receipt
['
receipt_type
']==
1
)||
empty
($
receipt
['
receipt_type
']))
style=
"display: none"
@
endif
>
{{--
<div
class=
"layui-form-item"
x-show=
"receiptType === '2'"
>
--}}
{{--
<label
class=
"layui-form-label"
>
--}}
{{--
<span
style=
"color: red"
>
*
</span>
--}}
{{-- 国际代码 :
</label>
--}}
{{--
<div
class=
"layui-input-block block-42"
>
--}}
{{--
<input
type=
"text"
name=
"international_code"
id=
"international_code"
--
}}
{{
--
placeholder=
"请输入银行国际代码"
class=
"layui-input"
--
}}
{{
--
value=
"{{$receipt['international_code'] or ''}}"
>
--}}
{{--
</div>
--}}
{{--
</div>
--}}
<div
class=
"layui-form-item"
id=
"swift_code_div"
x-show=
"receiptType === '2'"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
Swift Code :
</label>
<div
class=
"layui-input-block block-42"
>
<input
type=
"text"
name=
"swift_code"
id=
"Swift Code"
...
...
@@ -84,9 +98,10 @@
<button
type=
"button"
class=
"layui-btn upload-img"
preview=
"preview"
data-obj=
"certificate"
>
<i
class=
"layui-icon"
>

</i>
上传文件
</button>
<a
target=
"_blank"
id=
"certificate_url"
href=
"{{$receipt['certificate'] or ''}}"
>
{{$receipt['certificate'] or ''}}
</a>
{{--
<img
@
if
(!
empty
($
receipt
['
certificate
']))
src=
"{{$receipt['certificate'] or ''}}"
--
}}
{{
--
@
endif
class=
"layui-upload-img"
width=
"50px"
height=
"50px"
id=
"preview"
>
--}}
<a
target=
"_blank"
id=
"certificate_url"
href=
"{{$receipt['certificate'] or ''}}"
>
{{$receipt['certificate'] or ''}}
</a>
{{--
<img
@
if
(!
empty
($
receipt
['
certificate
']))
src=
"{{$receipt['certificate'] or ''}}"
--
}}
{{
--
@
endif
class=
"layui-upload-img"
width=
"50px"
height=
"50px"
id=
"preview"
>
--}}
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
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