|
|
@@ -1,4 +1,4 @@
|
|
|
-var ExcelData,ExcelKind;
|
|
|
+var ExcelData, ExcelKind;
|
|
|
function ConfirmImport() {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
@@ -31,49 +31,49 @@ layui.config({
|
|
|
//- 筛选条件-日期
|
|
|
var laydate = layui.laydate;
|
|
|
var layCreateDate = laydate.render({
|
|
|
-elem: '#CreateDate',
|
|
|
-type: 'date',
|
|
|
-range: true,
|
|
|
-trigger: 'click',
|
|
|
-change: function (value, date, endDate) {
|
|
|
-var op = true;
|
|
|
-if (date.year == endDate.year && endDate.month - date.month <= 1) {
|
|
|
-if (endDate.month - date.month == 1 && endDate.date > date.date) {
|
|
|
-op = false;
|
|
|
-layCreateDate.hint('日期范围请不要超过1个月');
|
|
|
-setTimeout(function () {
|
|
|
-$(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
-}, 1);
|
|
|
-}
|
|
|
-} else {
|
|
|
-op = false;
|
|
|
-layCreateDate.hint('日期范围请不要超过1个月');
|
|
|
-setTimeout(function () {
|
|
|
-$(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
-}, 1);
|
|
|
-}
|
|
|
-if (op) {
|
|
|
-$('#CreateDate').val(value);
|
|
|
-}
|
|
|
-}
|
|
|
-});
|
|
|
+ elem: '#CreateDate',
|
|
|
+ type: 'date',
|
|
|
+ range: true,
|
|
|
+ trigger: 'click',
|
|
|
+ change: function (value, date, endDate) {
|
|
|
+ var op = true;
|
|
|
+ if (date.year == endDate.year && endDate.month - date.month <= 1) {
|
|
|
+ if (endDate.month - date.month == 1 && endDate.date > date.date) {
|
|
|
+ op = false;
|
|
|
+ layCreateDate.hint('日期范围请不要超过1个月');
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
+ }, 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ op = false;
|
|
|
+ layCreateDate.hint('日期范围请不要超过1个月');
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
+ }, 1);
|
|
|
+ }
|
|
|
+ if (op) {
|
|
|
+ $('#CreateDate').val(value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
|
|
|
//excel导入
|
|
|
- excel = layui.excel;
|
|
|
+ excel = layui.excel;
|
|
|
$('#ExcelFile').change(function (e) {
|
|
|
var files = e.target.files;
|
|
|
- excel.importExcel(files, { }, function (data) {
|
|
|
+ excel.importExcel(files, {}, function (data) {
|
|
|
ExcelData = data[0].sheet1;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
//监听单元格编辑
|
|
|
- table.on('edit(LAY-list-manage)', function(obj){
|
|
|
+ table.on('edit(LAY-list-manage)', function (obj) {
|
|
|
var value = obj.value //得到修改后的值
|
|
|
- ,data = obj.data //得到所在行所有键值
|
|
|
- ,field = obj.field; //得到字段
|
|
|
- if(field == "Sort"){
|
|
|
+ , data = obj.data //得到所在行所有键值
|
|
|
+ , field = obj.field; //得到字段
|
|
|
+ if (field == "Sort") {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: "/Admin/StoreChangeHistory/Sort?r=" + Math.random(1),
|
|
|
@@ -84,32 +84,32 @@ $('#CreateDate').val(value);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
//列表数据
|
|
|
table.render({
|
|
|
elem: '#LAY-list-manage'
|
|
|
, url: '/Admin/StoreChangeHistory/IndexData' //模拟接口
|
|
|
, cols: [[
|
|
|
{ type: 'checkbox', fixed: 'left' }
|
|
|
- ,{field:'StoreIdStoreNo', width: 200, title:'仓库编号', sort: true}
|
|
|
- ,{field:'StoreIdStoreName', width: 200, title:'仓库名称', sort: true}
|
|
|
- ,{field:'UserIdMakerCode', width: 200, title:'创客编号', sort: true}
|
|
|
- ,{field:'UserIdRealName', width: 200, title:'创客姓名', sort: true}
|
|
|
- ,{field:'TUserIdMakerCode', width: 200, title:'收货创客编号', sort: true}
|
|
|
- ,{field:'TUserIdRealName', width: 200, title:'收货创客姓名', sort: true}
|
|
|
- ,{field:'BrandId', width: 200, title:'产品类型', sort: true}
|
|
|
- ,{field:'TransType', width: 200, title:'交易类型', sort: true}
|
|
|
- ,{field:'SnNo', width: 200, title:'SN编号', sort: true}
|
|
|
- ,{field:'SnType', width: 200, title:'SN机具类型', sort: true}
|
|
|
- ,{field:'StockOpDirect', width: 200, title:'库存操作方向', sort: true}
|
|
|
- ,{field:'ToStoreIdStoreNo', width: 200, title:'收货仓库编号', sort: true}
|
|
|
- ,{field:'ToStoreIdStoreName', width: 200, title:'收货仓库名称', sort: true}
|
|
|
- ,{field:'SourceStoreIdStoreNo', width: 200, title:'源仓库编号', sort: true}
|
|
|
- ,{field:'SourceStoreIdStoreName', width: 200, title:'源仓库名称', sort: true}
|
|
|
- ,{field:'CreateDate', width: 200, title:'变动时间', sort: true}
|
|
|
+ , { field: 'StoreIdStoreNo', width: 200, title: '仓库编号', sort: true }
|
|
|
+ , { field: 'StoreIdStoreName', width: 200, title: '仓库名称', sort: true }
|
|
|
+ , { field: 'UserIdMakerCode', width: 200, title: '创客编号', sort: true }
|
|
|
+ , { field: 'UserIdRealName', width: 200, title: '创客姓名', sort: true }
|
|
|
+ , { field: 'TUserIdMakerCode', width: 200, title: '收货创客编号', sort: true }
|
|
|
+ , { field: 'TUserIdRealName', width: 200, title: '收货创客姓名', sort: true }
|
|
|
+ , { field: 'BrandId', width: 200, title: '产品类型', sort: true }
|
|
|
+ , { field: 'TransType', width: 200, title: '交易类型', sort: true }
|
|
|
+ , { field: 'SnNo', width: 200, title: 'SN编号', sort: true }
|
|
|
+ , { field: 'SnType', width: 200, title: 'SN机具类型', sort: true }
|
|
|
+ , { field: 'StockOpDirect', width: 200, title: '库存操作方向', sort: true }
|
|
|
+ , { field: 'ToStoreIdStoreNo', width: 200, title: '收货仓库编号', sort: true }
|
|
|
+ , { field: 'ToStoreIdStoreName', width: 200, title: '收货仓库名称', sort: true }
|
|
|
+ , { field: 'SourceStoreIdStoreNo', width: 200, title: '源仓库编号', sort: true }
|
|
|
+ , { field: 'SourceStoreIdStoreName', width: 200, title: '源仓库名称', sort: true }
|
|
|
+ , { field: 'CreateDate', width: 200, title: '变动时间', sort: true }
|
|
|
]]
|
|
|
, where: {
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
, page: true
|
|
|
, limit: 30
|
|
|
@@ -131,7 +131,7 @@ $('#CreateDate').val(value);
|
|
|
data: "Id=" + data.Id,
|
|
|
dataType: "text",
|
|
|
success: function (data) {
|
|
|
- if (data == "success") {
|
|
|
+ if (data == "success") {
|
|
|
obj.del();
|
|
|
layer.close(index);
|
|
|
} else {
|
|
|
@@ -154,20 +154,20 @@ $('#CreateDate').val(value);
|
|
|
, submitID = 'LAY-list-front-submit'
|
|
|
, submit = layero.find('iframe').contents().find('#' + submitID);
|
|
|
|
|
|
- setTimeout(function () {
|
|
|
+ setTimeout(function () {
|
|
|
layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
|
|
|
var errObj = $(this).find('.layui-form-danger');
|
|
|
if (errObj.length > 0) {
|
|
|
iframeWindow.element.tabChange('mytabbar', String(i + 1));
|
|
|
submit.click();
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
}, 300);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//监听提交
|
|
|
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
|
|
@@ -178,7 +178,7 @@ $('#CreateDate').val(value);
|
|
|
}
|
|
|
//提交 Ajax 成功后,静态更新表格中的数据
|
|
|
//$.ajax({});
|
|
|
-
|
|
|
+
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: "/Admin/StoreChangeHistory/Edit?r=" + Math.random(1),
|
|
|
@@ -271,20 +271,20 @@ $('#CreateDate').val(value);
|
|
|
, submitID = 'LAY-list-front-submit'
|
|
|
, submit = layero.find('iframe').contents().find('#' + submitID);
|
|
|
|
|
|
- setTimeout(function () {
|
|
|
+ setTimeout(function () {
|
|
|
layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
|
|
|
var errObj = $(this).find('.layui-form-danger');
|
|
|
if (errObj.length > 0) {
|
|
|
iframeWindow.element.tabChange('mytabbar', String(i + 1));
|
|
|
submit.click();
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
}, 300);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//监听提交
|
|
|
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
|
|
@@ -295,7 +295,7 @@ $('#CreateDate').val(value);
|
|
|
}
|
|
|
//提交 Ajax 成功后,静态更新表格中的数据
|
|
|
//$.ajax({});
|
|
|
-
|
|
|
+
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: "/Admin/StoreChangeHistory/Add?r=" + Math.random(1),
|
|
|
@@ -352,9 +352,9 @@ $('#CreateDate').val(value);
|
|
|
, Open: function () {
|
|
|
var checkStatus = table.checkStatus('LAY-list-manage')
|
|
|
, data = checkStatus.data; //得到选中的数据
|
|
|
- if(data.length < 1){
|
|
|
+ if (data.length < 1) {
|
|
|
parent.layer.msg("请选择要开启的项");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
var ids = "";
|
|
|
$.each(data, function (index, value) {
|
|
|
ids += data[index].Id + ",";
|
|
|
@@ -381,9 +381,9 @@ $('#CreateDate').val(value);
|
|
|
, Close: function () {
|
|
|
var checkStatus = table.checkStatus('LAY-list-manage')
|
|
|
, data = checkStatus.data; //得到选中的数据
|
|
|
- if(data.length < 1){
|
|
|
+ if (data.length < 1) {
|
|
|
parent.layer.msg("请选择要关闭的项");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
var ids = "";
|
|
|
$.each(data, function (index, value) {
|
|
|
ids += data[index].Id + ",";
|