InventoryNew.js
6.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
let action = null,
app = null;
layui.config({
base: "/js/",
version: 2
}).use(['system'], function () {
var form = layui.form,
$ = layui.jquery,
table = layui.table,
layer = layui.layer,
system = layui.system,
u = new system.u(),
sendData = {
queryConfig: null
},
urlBase = $('#ReUrl').val(),
areaName = 'warehous',
tableName = 'Inventory';
action = {
exportOptions: function () {
var options = {
fromId: "listForm",
url: urlBase + "api/WMS/GetInventoriesWithPage",
isDefault: false,
ajaxOpt: {
contentType: "application/json",
jsonStr: true
},
sendDataWhere: (function () {
app.methods.queryParameter();
sendData.pageNumber = 1;
sendData.perPageCount = 100000000
return sendData;
})(),
excelCols: {
head: app.data.cols
}
}
return options;
},
btnExportBefore: function (sysU, parm, formData, tableObj, fnCallBack) {
fetch(parm.url, {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify(formData)
}).then(r => r.json()).then(result => {
if (sysU.successBefore(result)) return false;
var excelParm = typeof parm.isDefault == "undefined" ? tableObj : parm;
sysU.ExcelExportData(excelParm, {
Result: result.Result.Data
});
})
},
queryOptions: function () {
var options = {
resetFrom: "form[lay-filter=listForm]",
fromId: "listForm",
urlExport: urlBase +"api/WMS/GetInventoriesWithPage",
urlQuery: urlBase + "api/WMS/GetInventoriesWithPage",
ajaxOpt: {
contentType: "application/json",
},
sendDataWhere: (function () {
app.methods.queryParameter();
return sendData;
})(),
mainTable: app.data.tableIns
}
return options;
},
queryBefore: (sysU, toolbarId, fromValueObj, callBack) => {
if (callBack != null) callBack();
},
//所有动作成功之后
actionSuccess: (flag) => {
u.refreshTable(app, u, null, flag);
}
}
app = {
data: {
cols: [[
{ checkbox: true, fixed: true },
{ field: "Id", width: 150, sort: true, fixed: false, title: "id", hide: true },
{ field: "BillNo", width: 150, fixed: false, title: "billNo", hide: true },
{ field: "WarehouseCode", width: 150, sort: false, fixed: false, title: "仓库编码" },
{ field: "LocationCode", width: 150, sort: false, fixed: false, title: "库位编码" },
{ field: "ContainerCode", width: 150, sort: false, fixed: false, title: "容器号" },
{ field: "MaterialCode", width: 150, sort: true, fixed: false, title: "物料编码" },
{ field: "MaterialName", width: 150, sort: false, fixed: false, title: "物料名称" },
{ field: "MaterialSpec", width: 150, sort: false, fixed: false, title: "物料规格" },
{ field: "Batch", width: 150, sort: false, fixed: false, title: "批次" },
{ field: "MaterialPipeSize", width: 150, sort: false, fixed: false, title: "管径" },
{ field: "MaterialWallthickness", width: 150, sort: false, fixed: false, title: "壁厚" },
{ field: "MaterialTextures", width: 150, sort: false, fixed: false, title: "材质" },
{ field: "MaterialUnit", width: 150, sort: false, fixed: false, title: "物料单位" },
{ field: "Qty", width: 150, sort: true, fixed: false, title: "数量" },
{ field: "TrackingCode", width: 150, sort: false, fixed: false, title: "跟踪码" },
{ field: "Len", width: 150, sort: true, fixed: false, title: "长度" },
{ field: "InTime", width: 150, sort: true, fixed: false, title: "入库时间" },
{ field: "Status", width: 150, sort: true, fixed: false, title: "状态", hide: true },
]],
tableIns: null,
tableElem: "mainList",
//下拉框配置
selectOption: {
//返回的数据 用于后续操作
selectData: {
}
}
},
methods: {
initTable: function (opts) {
var config = {};
if (opts != undefined) $.extend(config, opts);
let options = {
elem: "#" + app.data.tableElem,
contentType: "application/json",
url: urlBase + "api/WMS/GetInventoriesWithPage",
cols: u.columnRecord(app.data.tableElem, app.data.cols),
toolbar: '#toolbarTable',
where: config,
request: {
pageName: "pageNumber",
limitName: "perPageCount",
},//用于对分页请求的参数:page、limit重新设定名称
parseDataExtend: function (res) {
if (res.Code == 200 || res.code == 200) {
return {
Code: res.Code,
Message: res.Message,
Count: res.Result.TotalCount,
Result: res.Result.Data
}
}
return {
Code: -1,
Message: res.msg,
Count: 0,
Result: []
}
},
doneExtend: function () {
}
}
if ("".GetUrlParam("menuFlag") === -2) options["height"] = 'full-55';
app.data.tableIns = u.initTable(options);
},
queryParameter() {
sendData.queryConfig= form.val("listForm");
},
initFrom() {
}
},
registerEvent: function () {
},
init: function () {
app.methods.queryParameter();
app.methods.initFrom();
app.methods.initTable(sendData);
app.registerEvent();
}
};
app.init();
});