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
6640143b
authored
Jul 26, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
77caa55a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
app/Http/Controllers/Api/SupplierApiController.php
resources/views/script/supplier/SupplierFileScript.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
6640143b
...
@@ -118,7 +118,8 @@ class SupplierApiController extends Controller
...
@@ -118,7 +118,8 @@ class SupplierApiController extends Controller
if
(
$validateResult
)
{
if
(
$validateResult
)
{
$this
->
response
(
-
1
,
$validateResult
);
$this
->
response
(
-
1
,
$validateResult
);
}
}
$channel
=
$request
->
only
(
$this
->
channelMap
);
$channelMap
=
array_merge
(
$this
->
channelMap
,
config
(
'field.AttachmentFields'
));
$channel
=
$request
->
only
(
$channelMap
);
$service
=
new
SupplierService
();
$service
=
new
SupplierService
();
$result
=
$service
->
saveSupplier
(
$channel
);
$result
=
$service
->
saveSupplier
(
$channel
);
if
(
!
$result
)
{
if
(
!
$result
)
{
...
...
resources/views/script/supplier/SupplierFileScript.blade.php
View file @
6640143b
...
@@ -22,28 +22,29 @@
...
@@ -22,28 +22,29 @@
});
});
upload
.
render
({
upload
.
render
({
elem
:
'#upload_button'
elem
:
'#upload_button'
,
,
url
:
'{{config('
website
.
UploadUrl
')}}'
//改成您自己的上传接口
url
:
'{{config('
website
.
UploadUrl
')}}'
,
//改成您自己的上传接口
,
accept
:
'file'
//文件
accept
:
'file'
,
//文件
,
field
:
'upload'
field
:
'upload'
,
,
data
:
{
data
:
{
k1
:
k1
,
k1
:
k1
,
k2
:
k2
,
k2
:
k2
,
source
:
1
,
source
:
1
,
cancel_time_verify
:
1
,
cancel_time_verify
:
1
,
}
},
,
exts
:
'jpg|png|bmp|jpeg|zip|pdf'
multiple
:
true
,
,
size
:
20000
exts
:
'jpg|png|bmp|jpeg|zip|pdf'
,
,
before
:
function
()
{
size
:
20000
,
before
:
function
()
{
}
}
,
,
choose
:
function
(
obj
)
{
choose
:
function
(
obj
)
{
var
files
=
this
.
files
=
obj
.
pushFile
();
var
files
=
this
.
files
=
obj
.
pushFile
();
let
recentFile
=
files
[
Object
.
keys
(
files
)[
Object
.
keys
(
files
)
.
length
-
1
]]
let
recentFile
=
files
[
Object
.
keys
(
files
)[
Object
.
keys
(
files
)
.
length
-
1
]]
fileName
=
recentFile
.
name
;
fileName
=
recentFile
.
name
;
loadIndex
=
layer
.
load
(
1
);
loadIndex
=
layer
.
load
(
1
);
}
}
,
,
done
:
function
(
res
,
index
,
upload
)
{
done
:
function
(
res
,
index
,
upload
)
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
//动态添加js
//动态添加js
let
fileTemplateObj
=
$
(
'#file_template'
)
let
fileTemplateObj
=
$
(
'#file_template'
)
...
@@ -58,7 +59,7 @@
...
@@ -58,7 +59,7 @@
}
}
delete
this
.
files
[
index
];
delete
this
.
files
[
index
];
layer
.
close
(
loadIndex
);
layer
.
close
(
loadIndex
);
}
}
,
});
});
//删除文件操作
//删除文件操作
...
...
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