|
|
@@ -1,4 +1,4 @@
|
|
|
-var ExcelData,ExcelKind;
|
|
|
+var ExcelData, ExcelKind;
|
|
|
function ConfirmImport() {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
@@ -31,76 +31,76 @@ layui.config({
|
|
|
//- 筛选条件-日期
|
|
|
var laydate = layui.laydate;
|
|
|
var layCreateDate = laydate.render({
|
|
|
-elem: '#CreateDate',
|
|
|
-type: 'datetime',
|
|
|
-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);
|
|
|
-}
|
|
|
-}
|
|
|
-});
|
|
|
-var layApplyDate = laydate.render({
|
|
|
-elem: '#ApplyDate',
|
|
|
-trigger: 'click',
|
|
|
-type: 'datetime',
|
|
|
-range: true,
|
|
|
-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;
|
|
|
-layApplyDate.hint('日期范围请不要超过1个月');
|
|
|
-setTimeout(function () {
|
|
|
-$(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
-}, 1);
|
|
|
-}
|
|
|
-} else {
|
|
|
-op = false;
|
|
|
-layApplyDate.hint('日期范围请不要超过1个月');
|
|
|
-setTimeout(function () {
|
|
|
-$(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
-}, 1);
|
|
|
-}
|
|
|
-if (op) {
|
|
|
-$('#ApplyDate').val(value);
|
|
|
-}
|
|
|
-}
|
|
|
-});
|
|
|
+ elem: '#CreateDate',
|
|
|
+ type: 'datetime',
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var layApplyDate = laydate.render({
|
|
|
+ elem: '#ApplyDate',
|
|
|
+ trigger: 'click',
|
|
|
+ type: 'datetime',
|
|
|
+ range: true,
|
|
|
+ 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;
|
|
|
+ layApplyDate.hint('日期范围请不要超过1个月');
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
+ }, 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ op = false;
|
|
|
+ layApplyDate.hint('日期范围请不要超过1个月');
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
+ }, 1);
|
|
|
+ }
|
|
|
+ if (op) {
|
|
|
+ $('#ApplyDate').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/PreSendStockDetail/Sort?r=" + Math.random(1),
|
|
|
@@ -111,37 +111,36 @@ $('#ApplyDate').val(value);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
//列表数据
|
|
|
table.render({
|
|
|
elem: '#LAY-list-manage'
|
|
|
, url: '/Admin/PreSendStockDetail/IndexData' //模拟接口
|
|
|
, cols: [[
|
|
|
{ type: 'checkbox', fixed: 'left' }
|
|
|
- , {field:'Id', fixed: 'left', title:'ID', width:80, sort: true, unresize: true}
|
|
|
- ,{field:'StoreIdStoreName', width: 200, title:'仓库仓库名称', sort: true}
|
|
|
-,{field:'StoreIdStoreNo', width: 200, title:'仓库仓库编号', sort: true}
|
|
|
-,{field:'CreateDate', width: 200, title:'创建时间', sort: true}
|
|
|
-,{field:'BrandId', width: 200, title:'产品类型', sort: true}
|
|
|
-,{field:'SnNo', width: 200, title:'SN编号', sort: true}
|
|
|
-,{field:'SnId', width: 200, title:'SNID', sort: true}
|
|
|
-,{field:'ToUserIdMakerCode', width: 200, title:'收货人创客编号', sort: true}
|
|
|
-,{field:'ToUserIdRealName', 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:'ApplyFlagName', width: 200, title:'申请标记', sort: true}
|
|
|
-,{field:'ApplyDate', width: 200, title:'申请时间', sort: true}
|
|
|
-,{field:'FromUserIdMakerCode', width: 200, title:'出货创客创客编号', sort: true}
|
|
|
-,{field:'FromUserIdRealName', width: 200, title:'出货创客真实姓名', sort: true}
|
|
|
-,{field:'FromStoreIdStoreNo', width: 200, title:'出货仓库仓库编号', sort: true}
|
|
|
-,{field:'FromStoreIdStoreName', width: 200, title:'出货仓库仓库名称', sort: true}
|
|
|
-,{field:'CancelFlagName', width: 200, title:'撤回标记', sort: true}
|
|
|
-,{field:'CancelDate', width: 200, title:'撤回时间', sort: true}
|
|
|
-
|
|
|
- , {field:'Sort', fixed: 'right', title:'排序', width:80, edit: 'text'}
|
|
|
- , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
|
|
|
+ , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
|
|
|
+ , { field: 'StoreIdStoreName', width: 200, title: '仓库名称', sort: true }
|
|
|
+ , { field: 'StoreIdStoreNo', width: 200, title: '仓库编号', sort: true }
|
|
|
+ , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
|
|
|
+ , { field: 'BrandId', width: 200, title: '产品类型', sort: true }
|
|
|
+ , { field: 'SnNo', width: 200, title: 'SN编号', sort: true }
|
|
|
+ , { field: 'SnId', width: 200, title: 'SNID', sort: true }
|
|
|
+ , { field: 'ToUserIdMakerCode', width: 200, title: '收货人创客编号', sort: true }
|
|
|
+ , { field: 'ToUserIdRealName', 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: 'ApplyFlagName', width: 200, title: '申请标记', sort: true }
|
|
|
+ , { field: 'ApplyDate', width: 200, title: '申请时间', sort: true }
|
|
|
+ , { field: 'FromUserIdMakerCode', width: 200, title: '出货创客编号', sort: true }
|
|
|
+ , { field: 'FromUserIdRealName', width: 200, title: '出货创客真实姓名', sort: true }
|
|
|
+ , { field: 'FromStoreIdStoreNo', width: 200, title: '出货仓库编号', sort: true }
|
|
|
+ , { field: 'FromStoreIdStoreName', width: 200, title: '出货仓库名称', sort: true }
|
|
|
+ , { field: 'CancelFlagName', width: 200, title: '撤回标记', sort: true }
|
|
|
+ , { field: 'CancelDate', width: 200, title: '撤回时间', sort: true }
|
|
|
+ // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }s
|
|
|
+ , { title: '操作', width: 180, align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
|
|
|
]]
|
|
|
, where: {
|
|
|
StoreId: StoreId
|
|
|
@@ -166,7 +165,7 @@ $('#ApplyDate').val(value);
|
|
|
data: "Id=" + data.Id,
|
|
|
dataType: "text",
|
|
|
success: function (data) {
|
|
|
- if (data == "success") {
|
|
|
+ if (data == "success") {
|
|
|
obj.del();
|
|
|
layer.close(index);
|
|
|
} else {
|
|
|
@@ -189,20 +188,20 @@ $('#ApplyDate').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) {
|
|
|
@@ -213,7 +212,7 @@ $('#ApplyDate').val(value);
|
|
|
}
|
|
|
//提交 Ajax 成功后,静态更新表格中的数据
|
|
|
//$.ajax({});
|
|
|
-
|
|
|
+
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: "/Admin/PreSendStockDetail/Edit?r=" + Math.random(1),
|
|
|
@@ -306,20 +305,20 @@ $('#ApplyDate').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) {
|
|
|
@@ -330,7 +329,7 @@ $('#ApplyDate').val(value);
|
|
|
}
|
|
|
//提交 Ajax 成功后,静态更新表格中的数据
|
|
|
//$.ajax({});
|
|
|
-
|
|
|
+
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: "/Admin/PreSendStockDetail/Add?r=" + Math.random(1),
|
|
|
@@ -387,9 +386,9 @@ $('#ApplyDate').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 + ",";
|
|
|
@@ -416,9 +415,9 @@ $('#ApplyDate').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 + ",";
|