懒羊羊
2023-08-30 71e81ed1d12e4d69f53c8ad9e066650ad4186293
提交 | 用户 | 时间
71e81e 1 /**
2  * 详情对话框
3  */
4 var LineInfoInfoDlg = {
5     data: {
6         id: "",
7         lineCode: "",
8         lineName: "",
9         workshopCode: "",
10         workCalendar: "",
11         spareField1: "",
12         spareField2: "",
13         remarks: "",
14         createUser: "",
15         createTime: "",
16         updateUser: "",
17         updateTime: ""
18     }
19 };
20
21 layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
22     var $ = layui.jquery;
23     var $ax = layui.ax;
24     var form = layui.form;
25     var admin = layui.admin;
26
27
28
29     //获取详情信息,填充表单
30     var ajax = new $ax(Feng.ctxPath + "/lineInfo/detail?id=" + Feng.getUrlParam("id"));
31     var result1 = ajax.start();
32     form.val('lineInfoForm', result1.data);
33
34     //表单提交事件
35     form.on('submit(btnSubmit)', function (data) {
36         var ajax = new $ax(Feng.ctxPath + "/lineInfo/editItem", function (data) {
37             Feng.success("更新成功!");
38             window.location.href = Feng.ctxPath + '/lineInfo'
39         }, function (data) {
40             Feng.error("更新失败!" + data.responseJSON.message)
41         });
42         ajax.set(data.field);
43         ajax.start();
44
45         return false;
46     });
47
48     $('#cancel').click(function(){
49         window.location.href = Feng.ctxPath + '/lineInfo'
50     });
51
52     $(document).ready(function () {
53         $.ajax({
54             type: "POST",
55             contentType: "application/json;charset=UTF-8",
56             url: Feng.ctxPath + '/workshopInfo/list',
57             success: function (result) {
58                 $.each(result.data, function (index, value) {
59                     $('#workshopCode').append(new Option(value.workshopCode));// 下拉菜单里添加元素
60                 });
61                 $('#workshopCode').val(result1.data.workshopCode);
62                 layui.form.render("select");//重新渲染 固定写法
63
64             },
65         });
66     });
67 });