diff --git a/src/views/wpm/mlog6_form.vue b/src/views/wpm/mlog6_form.vue index c28a42c7..122131d0 100644 --- a/src/views/wpm/mlog6_form.vue +++ b/src/views/wpm/mlog6_form.vue @@ -609,6 +609,10 @@ export default { this.form.material_out = this.material_out; this.form.handle_date = this.handle_date; this.form.mgroup = this.mgroup; + if(this.mode == "add"){ + let date = new Date(); + this.form.work_start_time = this.$TOOL.dateFormat1(date); + } }, methods: { getRouteOptions() { @@ -683,10 +687,6 @@ export default { open(mode = "add") { this.mode = mode; this.visible = true; - if(this.mode == "add"){ - let date = new Date(); - this.form.work_start_time = this.$TOOL.dateFormat1(date); - } return this; }, countNotOkSun() { diff --git a/src/views/wpm/otherlog_form.vue b/src/views/wpm/otherlog_form.vue index 7b378835..46cc7a84 100644 --- a/src/views/wpm/otherlog_form.vue +++ b/src/views/wpm/otherlog_form.vue @@ -68,16 +68,16 @@ export default { }; }, mounted() { + if(this.mode == "add"){ + let date = new Date(); + this.form.work_start_time = this.$TOOL.dateFormat1(date); + } }, methods: { //显示 open(mode = "add") { this.mode = mode; this.visible = true; - if(this.mode == "add"){ - let date = new Date(); - this.form.work_start_time = this.$TOOL.dateFormat1(date); - } return this; }, //提交 diff --git a/src/views/wpm/worktask_form.vue b/src/views/wpm/worktask_form.vue index 8db3eb39..283a3fdf 100644 --- a/src/views/wpm/worktask_form.vue +++ b/src/views/wpm/worktask_form.vue @@ -1075,6 +1075,9 @@ export default { let handle_date = year + "-" + month + "-" + day; let dateNow = "" + year + month + day; this.dateNow = dateNow; + if(this.mode == "add"){ + this.form.work_start_time = this.$TOOL.dateFormat1(date); + } this.form.material_out = this.material_out; this.form.material_in = this.material_in; this.form.mtask = this.mtask; @@ -1304,10 +1307,6 @@ export default { open(mode = "add") { this.mode = mode; this.visible = true; - if(this.mode == "add"){ - let date = new Date(); - this.form.work_start_time = this.$TOOL.dateFormat1(date); - } return this; }, countNotOkSun() {