Commit 2bf7b156 by 宋祥

1.优化:录入单据日期的页面默认都显示当天

parent be79c99f
...@@ -10,6 +10,11 @@ $(function() { ...@@ -10,6 +10,11 @@ $(function() {
}, },
"result": { "result": {
columns: [{ columns: [{
field: "receiptDate",
defaultValue: function () {
return currShortDate();
}
}, {
field: "whCode", field: "whCode",
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < whNameGlobalData.length; i++) { for (let i = 0; i < whNameGlobalData.length; i++) {
......
...@@ -10,6 +10,11 @@ $(function() { ...@@ -10,6 +10,11 @@ $(function() {
}, },
"result": { "result": {
columns: [{ columns: [{
field: "receiptDate",
defaultValue: function () {
return currShortDate();
}
}, {
field: "whCode", field: "whCode",
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < whNameGlobalData.length; i++) { for (let i = 0; i < whNameGlobalData.length; i++) {
......
...@@ -11,6 +11,11 @@ $(function() { ...@@ -11,6 +11,11 @@ $(function() {
}, },
"result": { "result": {
columns: [{ columns: [{
field: "receiptDate",
defaultValue: function () {
return currShortDate();
}
}, {
field: "whCode", field: "whCode",
title: "仓库名称", title: "仓库名称",
template: function (dataItem) { template: function (dataItem) {
......
...@@ -10,6 +10,11 @@ $(function() { ...@@ -10,6 +10,11 @@ $(function() {
pageSizes: [10, 20, 30, 50, 100, 200] pageSizes: [10, 20, 30, 50, 100, 200]
}, },
columns: [{ columns: [{
field: "dateMonth",
defaultValue: function () {
return currShortMonth();
}
}, {
field: "unit", field: "unit",
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < unitNameGlobalData.length; i++) { for (let i = 0; i < unitNameGlobalData.length; i++) {
......
...@@ -172,6 +172,31 @@ function refreshInputSelect(container, inInfo) { ...@@ -172,6 +172,31 @@ function refreshInputSelect(container, inInfo) {
} }
/** /**
* 当前日期 YYYYMMDD
*
* @returns {string}
*/
function currShortDate() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1; // 月份从0开始,需要加1
const day = date.getDate();
return year + (month < 10 ? '0' + month : month) + (day < 10 ? '0' + day : day);
}
/**
* 当前月份 YYYYMM
*
* @returns {string}
*/
function currShortMonth() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1; // 月份从0开始,需要加1
return year + (month < 10 ? '0' + month : month);
}
/**
* cookie 操作 * cookie 操作
* *
* @param c_name * @param c_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment