diff --git a/ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocationTask.vue b/ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocationTask.vue index 2768e61..1122922 100644 --- a/ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocationTask.vue +++ b/ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocationTask.vue @@ -109,16 +109,40 @@ export default { required: false } }, + watch: { mainId: { immediate: true, handler(val) { + var nowDate = new Date() + this.queryParam['taskCreateTimeBegin'] = new Date(nowDate.getTime() - 90 * 24 * 60 * 60 * 1000).format('yyyy-MM-dd hh:mm:ss') + this.queryParam['taskCreateTimeEnd'] = nowDate.format('yyyy-MM-dd hh:mm:ss') this.queryParam['locationCode'] = val this.loadData(1) } } }, data() { + Date.prototype.format = function(fmt) { + var o = { + 'M+': this.getMonth() + 1, //月份 + 'd+': this.getDate(), //日 + 'h+': this.getHours(), //小时 + 'm+': this.getMinutes(), //分 + 's+': this.getSeconds(), //秒 + 'q+': Math.floor((this.getMonth() + 3) / 3), //季度 + S: this.getMilliseconds() //毫秒 + } + if (/(y+)/.test(fmt)) { + fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)) + } + for (var k in o) { + if (new RegExp('(' + k + ')').test(fmt)) { + fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)) + } + } + return fmt + } return { description: '库位任务信息比较页面', disableMixinCreated: true, @@ -217,9 +241,6 @@ export default { }, created() { this.initDictData() - var nowDate = new Date() - this.queryParam['taskCreateTimeBegin'] = new Date(nowDate.getTime() - 90 * 24 * 60 * 60 * 1000) - this.queryParam['taskCreateTimeEnd'] = nowDate }, methods: { initDictData() {