提交 | 用户 | 时间
|
1ac2bc
|
1 |
/** |
懒 |
2 |
* 详情对话框 |
|
3 |
*/ |
|
4 |
var ExcelExportDeployInfoDlg = { |
|
5 |
data: { |
|
6 |
name: "", |
|
7 |
title: "", |
|
8 |
nid: "", |
|
9 |
template: "", |
|
10 |
dataSource: "", |
|
11 |
status: "" |
|
12 |
} |
|
13 |
}; |
|
14 |
|
|
15 |
layui.use(['form', 'admin', 'ax', 'upload'], function () { |
|
16 |
var $ = layui.jquery; |
|
17 |
var $ax = layui.ax; |
|
18 |
var form = layui.form; |
|
19 |
var admin = layui.admin; |
|
20 |
var upload = layui.upload; |
|
21 |
// 执行上传实例 |
|
22 |
var uploadInst = upload.render({ |
|
23 |
elem : '#templateUplod', // 绑定元素 |
|
24 |
url : 'uploadTemplate', // 上传接口 |
|
25 |
accept : 'file', // 只允许上传图片 |
|
26 |
acceptMime : 'file/xls', // 只筛选图片 |
|
27 |
done : function(res) { |
|
28 |
// 上传完毕回调 |
|
29 |
if (res.code == 200) { |
|
30 |
$("#template").val(res.data); |
|
31 |
Feng.success("上传成功!"); |
|
32 |
$("#src").text(res.data); |
|
33 |
$("#templateUplod").text("重新上传"); |
|
34 |
} else { |
|
35 |
Feng.error("上传失败!" + res.message) |
|
36 |
} |
|
37 |
}, |
|
38 |
error : function() { |
|
39 |
// 请求异常回调 |
|
40 |
Feng.error("上传失败!") |
|
41 |
} |
|
42 |
}); |
|
43 |
|
|
44 |
//获取详情信息,填充表单 |
|
45 |
var ajax = new $ax(Feng.ctxPath + "/excelExportDeploy/detail?id=" + Feng.getUrlParam("id")); |
|
46 |
var result = ajax.start(); |
|
47 |
form.val('excelExportDeployForm', result.data); |
|
48 |
$("#src").text(result.data.template); |
|
49 |
//表单提交事件 |
|
50 |
form.on('submit(btnSubmit)', function (data) { |
|
51 |
var ajax = new $ax(Feng.ctxPath + "/excelExportDeploy/editItem", function (data) { |
|
52 |
Feng.success("更新成功!"); |
|
53 |
|
|
54 |
//传给上个页面,刷新table用 |
|
55 |
admin.putTempData('formOk', true); |
|
56 |
|
|
57 |
//关掉对话框 |
|
58 |
admin.closeThisDialog(); |
|
59 |
|
|
60 |
}, function (data) { |
|
61 |
Feng.error("更新失败!" + data.responseJSON.message) |
|
62 |
}); |
|
63 |
ajax.set(data.field); |
|
64 |
ajax.start(); |
|
65 |
|
|
66 |
return false; |
|
67 |
}); |
|
68 |
|
|
69 |
}); |