AddSupplierExaminationScript.blade.php
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<script>
layui.use(['table', 'form', 'element', 'table', 'layer', 'admin', 'xmSelect','laydate'], function () {
let admin = layui.admin;
let form = layui.form;
let element = layui.element;
let laydate = layui.laydate;
let xmSelect = layui.xmSelect;
laydate.render({
elem: '#examine_time'
, type: 'date'
, format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#stock_in_date'
, type: 'date'
, format: 'yyyy-MM-dd'
});
form.on('submit(addSupplierExamination)', function (data) {
layer.confirm('是否确认新增IQC检测资料?', function (index) {
let url = '/api/supplier_examination/AddSupplierExamination';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
} else {
let errMsg = res.err_msg;
let msg = '';
$.each(errMsg.split('|'), function (index, value) {
msg += "<span>" + value + "</span><br>"
});
parent.layer.msg(msg, {icon: 5})
}
}
return false;
});
});
form.on('submit(cancel)', function (data) {
layer.confirm('是否退出新增IQC检测资料?', function (index) {
admin.closeThisDialog();
});
});
});
</script>