懒羊羊
2023-11-14 036dcdcec6235d82b008f5c736d27a0d1f90d4a2
提交 | 用户 | 时间
1ac2bc 1 /**
2  * 添加或者修改页面
3  */
4 var ProductBomInfoInfoDlg = {
5     data: {
6         id: "",
7         bomCode: "",
8         bomName: "",
9         productCode: "",
10         productName: "",
11         version: "",
12         status: "",
13         spareField1: "",
14         spareField2: "",
15         remark: "",
16         createUser: "",
17         createTime: "",
18         updateUser: "",
19         updateTime: ""
20     }
21 };
22
23 layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
24     var $ = layui.jquery;
25     var $ax = layui.ax;
26     var form = layui.form;
27     var admin = layui.admin;
28
abb175 29     $('#productCode').click(function () {
30         layer.open({
31             type: 2,
32             area: ['1000px', '600px'],
33             title: '物料信息',
34             content: Feng.ctxPath + '/workOrder/productListing',
35             success: function (layero, index) {
36                 window.materialType = 'PRODUCE';
37             },
38             end: function () {
39                 let msg = JSON.parse(window.localStorage.getItem('message'));
40                 $('#productCode').val(msg.materialCode);
41                 $('#productName').val(msg.materialName);
42             }
43         });
44     });
1ac2bc 45
46     //表单提交事件
47     form.on('submit(btnSubmit)', function (data) {
48         var ajax = new $ax(Feng.ctxPath + "/productBomInfo/addItem", function (data) {
49             Feng.success("添加成功!");
50             window.location.href = Feng.ctxPath + '/productBomInfo'
51         }, function (data) {
52             Feng.error("添加失败!" + data.responseJSON.message)
53         });
54         ajax.set(data.field);
55         ajax.start();
56
57         return false;
58     });
59
60     $('#cancel').click(function(){
61         window.location.href = Feng.ctxPath + '/productBomInfo'
62     });
63
64 });