cl
2024-01-19 e0fac38b26845f25de479783e0c76cf12a5311e0
提交 | 用户 | 时间
71e81e 1 /**
2  * 详情对话框
3  */
4 var ProductionOrdeInfoInfoDlg = {
5     data: {
6         id: "",
7         salesOrderNo: "",
8         workOrderNo: "",
9         productionLine: "",
10         drawingNo: "",
11         materialCode: "",
12         materialName: "",
13         planQty: "",
14         actualQty: "",
15         scrapQty: "",
16         repairQty: "",
17         actualOnlineQty: "",
18         onlineCompletionMark: "",
19         demandDate: "",
20         planStartTime: "",
21         planEndTime: "",
22         actualStartTime: "",
23         actualEndTime: "",
24         serialNumber: "",
25         orderStatus: "",
26         spareField1: "",
27         spareField2: "",
28         spareField3: "",
29         spareField4: "",
30         createTime: "",
31         updateTime: "",
32         createUser: "",
33         updateUser: "",
34         streamNumber: "",
35         custom: "",
36         marketAreaCode: "",
37         softwareVersionCode: "",
38         productCompanyCode: "",
39         remarks: ""
40     }
41 };
42
43 layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
44     var $ = layui.jquery;
45     var $ax = layui.ax;
46     var form = layui.form;
47     var admin = layui.admin;
48
49     //获取详情信息,填充表单
50     var ajax = new $ax(Feng.ctxPath + "/productionOrdeInfo/detail?id=" + Feng.getUrlParam("id"));
51     var resultForm = ajax.start();
52     form.val('productionOrdeInfoForm', resultForm.data);
53
54     $(document).ready(function () {
55         $.ajax({
56             type: "POST",
57             contentType: "application/json;charset=UTF-8",
58             url: Feng.ctxPath + '/dict/listDictsByCode?dictTypeCode=MARKET_AREA_CODE',
59             success: function (result) {
60                 $.each(result.data, function (index, value) {
61                     $('#marketAreaCode').append(new Option(value.code));// 下拉菜单里添加元素
62                 });
63                 $('#marketAreaCode').val(resultForm.data.marketAreaCode);// 下拉菜单里添加元素
64                 layui.form.render("select");//重新渲染 固定写法
65             },
66         });
67         $.ajax({
68             type: "POST",
69             contentType: "application/json;charset=UTF-8",
70             url: Feng.ctxPath + '/dict/listDictsByCode?dictTypeCode=SOFTWARE_VERSION_CODE',
71             success: function (result) {
72                 $.each(result.data, function (index, value) {
73                     $('#softwareVersionCode').append(new Option(value.code));// 下拉菜单里添加元素
74                 });
75                 $('#softwareVersionCode').val(resultForm.data.softwareVersionCode);// 下拉菜单里添加元素
76                 layui.form.render("select");//重新渲染 固定写法
77             },
78         });
79         $.ajax({
80             type: "POST",
81             contentType: "application/json;charset=UTF-8",
82             url: Feng.ctxPath + '/dict/listDictsByCode?dictTypeCode=PRODUCT_COMPANY_CODE',
83             success: function (result) {
84                 $.each(result.data, function (index, value) {
85                     $('#productCompanyCode').append(new Option(value.code));// 下拉菜单里添加元素
86                 });
87                 $('#productCompanyCode').val(resultForm.data.productCompanyCode);// 下拉菜单里添加元素
88                 layui.form.render("select");//重新渲染 固定写法
89             },
90         });
91     });
92
93     $('#custom').click(function () {
94         layer.open({
95             type: 2,
96             area: ['1000px', '600px'],
97             title: '客户配置',
98             content: Feng.ctxPath + '/productionOrdeInfo/customInfo',
99             end: function () {
100                 let msg = JSON.parse(window.localStorage.getItem('message'));
101                 console.log("选择工单_id", msg.id)
102                 console.log(msg)
103                 $('#custom').val(msg.customerCode);
104             }
105         });
106     });
107
108
109     //表单提交事件
110     form.on('submit(btnSubmit)', function (data) {
111         var ajax = new $ax(Feng.ctxPath + "/productionOrdeInfo/editItem", function (data) {
112             Feng.success("更新成功!");
113             window.location.href = Feng.ctxPath + '/productionOrdeInfo'
114         }, function (data) {
115             Feng.error("更新失败!" + data.responseJSON.message)
116         });
117         ajax.set(data.field);
118         ajax.start();
119
120         return false;
121     });
122
123     $('#cancel').click(function(){
124         window.location.href = Feng.ctxPath + '/productionOrdeInfo'
125     });
126 });