cl
2024-01-23 6dadf36ef118fbb3b2cd5aca94cde88e29fb55dc
提交 | 用户 | 时间
71e81e 1 /**
2  * 详情对话框
3  */
4 var MaterialInfoInfoDlg = {
5     data: {
6         id: "",
7         materialCode: "",
8         materialName: "",
9         drawingNo: "",
10         materialSpecs: "",
11         unit: "",
12         materialScience: "",
13         materialAttribute: "",
14         isPurchase: "",
15         supplier: "",
16         spareField1: "",
17         spareField2: "",
18         remarks: "",
19         createUser: "",
20         createTime: "",
21         updateUser: "",
22         updateTime: "",
23         erpSpec: ""
24     }
25 };
26
27 layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
28     var $ = layui.jquery;
29     var $ax = layui.ax;
30     var form = layui.form;
31     var admin = layui.admin;
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73     //获取详情信息,填充表单
74     var ajax = new $ax(Feng.ctxPath + "/materialInfo/detail?id=" + Feng.getUrlParam("id"));
75     var result = ajax.start();
76     form.val('materialInfoForm', result.data);
77
78     //表单提交事件
79     form.on('submit(btnSubmit)', function (data) {
80         var ajax = new $ax(Feng.ctxPath + "/materialInfo/editItem", function (data) {
81             Feng.success("更新成功!");
82             window.location.href = Feng.ctxPath + '/materialInfo'
83         }, function (data) {
84             Feng.error("更新失败!" + data.responseJSON.message)
85         });
86         ajax.set(data.field);
87         ajax.start();
88
89         return false;
90     });
91
92     $('#cancel').click(function(){
93         window.location.href = Feng.ctxPath + '/materialInfo'
94     });
95
96 });