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
fd501f54
authored
Aug 07, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
e2317386
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
29 deletions
resources/views/script/AddSupplierReceiptScript.blade.php
resources/views/script/AddSupplierReceiptScript.blade.php
View file @
fd501f54
...
...
@@ -2,28 +2,34 @@
<
script
>
document
.
addEventListener
(
'alpine:init'
,
()
=>
{
Alpine
.
data
(
'receiptForm'
,
()
=>
({
receiptType
:
$
(
'#receipt_type'
)
.
val
()
,
init
()
{
receiptType
:
$
(
'#receipt_type'
)
.
val
()
,
init
()
{
let
g
=
this
;
layui
.
use
([
'form'
,
'upload'
,
'admin'
],
function
()
{
layui
.
use
([
'form'
,
'upload'
,
'admin'
],
function
()
{
const
form
=
layui
.
form
const
upload
=
layui
.
upload
;
const
admin
=
layui
.
admin
;
//提交数据
form
.
on
(
'submit(addSupplierReceipt)'
,
function
(
data
)
{
form
.
on
(
'submit(addSupplierReceipt)'
,
function
(
data
)
{
// layer.confirm('确定要保存银行信息吗?一旦保存,该供应商就会再次进入审核阶段', function (index) {
layer
.
confirm
(
'确定要保存银行信息吗?'
,
function
(
index
)
{
layer
.
confirm
(
'确定要保存银行信息吗?'
,
function
(
index
)
{
let
res
=
ajax
(
'/api/supplier_receipt/AddSupplierReceipt'
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
admin
.
putTempData
(
"needFreshList"
,
1
);
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
return
false
;
...
...
@@ -31,44 +37,59 @@
return
false
;
})
form
.
on
(
'radio(receipt_type)'
,
function
(
data
)
{
form
.
on
(
'radio(receipt_type)'
,
function
(
data
)
{
g
.
receiptType
=
data
.
value
;
if
(
data
.
value
===
'1'
)
{
$
(
'#bank_address_require_span'
)
.
hide
();
$
(
'#nation_id'
)
.
val
(
'36'
);
$
(
'#nation_id'
)
.
attr
(
'disabled'
,
true
);
$
(
'#nation_id'
)
.
addClass
(
'layui-disabled'
);
form
.
render
(
'select'
);
disableNationId
();
}
else
{
$
(
'#nation_id'
)
.
val
(
''
);
$
(
'#nation_id'
)
.
attr
(
'disabled'
,
false
);
$
(
'#nation_id'
)
.
removeClass
(
'layui-disabled'
);
form
.
render
(
'select'
);
enableNationId
();
}
});
if
(
g
.
receiptType
===
'1'
)
{
disableNationId
();
}
else
{
enableNationId
();
}
function
disableNationId
()
{
$
(
'#nation_id'
)
.
val
(
36
);
form
.
render
(
'select'
);
$
(
'#nation_id'
)
.
attr
(
'disabled'
,
true
);
$
(
'#nation_id'
)
.
addClass
(
'layui-disabled'
);
form
.
render
(
'select'
);
}
function
enableNationId
()
{
$
(
'#nation_id'
)
.
attr
(
'disabled'
,
false
);
$
(
'#nation_id'
)
.
removeClass
(
'layui-disabled'
);
form
.
render
(
'select'
);
}
//图片上传
upload
.
render
({
elem
:
'.upload-img'
,
url
:
UploadImgUrl
,
field
:
'upload'
,
data
:
{
k1
:
k1
,
k2
:
k2
,
source
:
1
,
cancel_time_verify
:
1
,
}
k1
:
k1
,
k2
:
k2
,
source
:
1
,
cancel_time_verify
:
1
,
}
,
accept
:
'file'
,
exts
:
'jpg|png|bmp|jpeg|zip|pdf'
,
size
:
20000
,
before
:
function
(
obj
)
{
,
before
:
function
(
obj
)
{
layer
.
msg
(
'加载中'
,
{
icon
:
16
,
shade
:
0.01
});
let
item
=
this
.
item
;
//预读本地文件示例,不支持ie8
obj
.
preview
(
function
(
index
,
file
,
result
)
{
obj
.
preview
(
function
(
index
,
file
,
result
)
{
// if (file.type.indexOf('image') !== -1){
// $('#' + item.attr('preview')).attr('src', result); //图片链接(base64)
// }else{
...
...
@@ -76,20 +97,26 @@
// }
});
}
,
done
:
function
(
res
)
{
,
done
:
function
(
res
)
{
if
(
res
.
code
===
200
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
6
});
layer
.
msg
(
'上传成功'
,
{
icon
:
6
});
let
item
=
this
.
item
;
$
(
'#'
+
item
.
attr
(
'data-obj'
))
.
val
(
res
.
data
[
0
]);
$
(
'#certificate_url'
)
.
text
(
res
.
data
[
0
]);
return
false
;
}
else
{
layer
.
msg
(
'上传失败,'
+
res
.
message
,
{
icon
:
5
});
layer
.
msg
(
'上传失败,'
+
res
.
message
,
{
icon
:
5
});
return
false
;
}
}
,
error
:
function
(
res
)
{
layer
.
msg
(
'上传失败:'
+
res
.
message
,
{
icon
:
5
});
,
error
:
function
(
res
)
{
layer
.
msg
(
'上传失败:'
+
res
.
message
,
{
icon
:
5
});
return
false
;
}
});
...
...
@@ -97,4 +124,5 @@
}
}));
});
</
script
>
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