yantian yue
2023-10-23 0d7d6a88080dc8759ef84ed5ad7875f25642df6c
提交 | 用户 | 时间
1ac2bc 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     var formSelects = layui.formSelects;
27
28
29     $.ajax({
30         type: "POST",
31         contentType: "application/json;charset=UTF-8",
32         url: Feng.ctxPath + '/workshopInfo/list',
33         success: function (result) {
34             $.each(result.data, function (index, value) {
35                 $('#workshopCode').append(new Option(value.workshopCode));// 下拉菜单里添加元素
36             });
37             $('#workshopCode').val(result1.data.workshopCode);
38             layui.form.render("select");//重新渲染 固定写法
39         },
40     });
41
42     //获取详情信息,填充表单
43     var ajax = new $ax(Feng.ctxPath + "/lineInfo/detail?id=" + Feng.getUrlParam("id"));
44     var result1 = ajax.start();
45     form.val('lineInfoForm', result1.data);
46
47     //表单提交事件
48     form.on('submit(btnSubmit)', function (data) {
49         var ajax = new $ax(Feng.ctxPath + "/lineInfo/editItem", function (data) {
50             Feng.success("更新成功!");
51             window.location.href = Feng.ctxPath + '/lineInfo'
52         }, function (data) {
53             Feng.error("更新失败!" + data.responseJSON.message)
54         });
55         ajax.set(data.field);
56         ajax.start();
57
58         return false;
59     });
60
61     $('#cancel').click(function(){
62         window.location.href = Feng.ctxPath + '/lineInfo'
63     });
64 });