懒羊羊
2023-11-14 036dcdcec6235d82b008f5c736d27a0d1f90d4a2
提交 | 用户 | 时间
1ac2bc 1 /**
2  * 详情对话框
3  */
4 var WorkshopInfoInfoDlg = {
5     data: {
6         id: "",
7         workshopCode: "",
8         workshopName: "",
9         spareField1: "",
10         spareField2: "",
11         remarks: "",
12         createUser: "",
13         createTime: "",
14         updateUser: "",
15         updateTime: ""
16     }
17 };
18
19 layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
20     var $ = layui.jquery;
21     var $ax = layui.ax;
22     var form = layui.form;
23     var admin = layui.admin;
24
25
26     //获取详情信息,填充表单
27     var ajax = new $ax(Feng.ctxPath + "/workshopInfo/detail?id=" + Feng.getUrlParam("id"));
28     var result = ajax.start();
29     console.log(result.data)
30     form.val('workshopInfoForm', result.data);
31
32     //表单提交事件
33     form.on('submit(btnSubmit)', function (data) {
34         var ajax = new $ax(Feng.ctxPath + "/workshopInfo/editItem", function (data) {
35             Feng.success("更新成功!");
36             window.location.href = Feng.ctxPath + '/workshopInfo'
37         }, function (data) {
38             Feng.error("更新失败!" + data.responseJSON.message)
39         });
40         ajax.set(data.field);
41         ajax.start();
42
43         return false;
44     });
45
46     $('#cancel').click(function(){
47         window.location.href = Feng.ctxPath + '/workshopInfo'
48     });
49 });