Просмотр исходного кода

代码提交:
1022审批通过时间格式修改

sunruiqi 2 лет назад
Родитель
Сommit
592c425c06

+ 16 - 5
src/views/modules/program/registered/ProofreadIssuedForm.vue

@@ -178,6 +178,7 @@
 <script>
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import ProofreadIssuedService from '@/api/sys/ProofreadIssuedService'
+  import moment from "moment";
   export default {
     props: {
       businessId: {
@@ -213,7 +214,8 @@
           consultingReport: '',
           sealType: '',
           status: '',
-          agreeTime: ''
+          agreeTime: '',
+          agreeUserId: ''
         },
         keyWatch: '',
         yesOrNo: [
@@ -250,7 +252,6 @@
       this.proofreadIssuedService.findProjectInfoById(this.businessId).then(({data}) => {
         this.inputForm = this.recover(this.inputForm, data)
         this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
-        this.loading = false
       })
     },
     computed: {
@@ -305,7 +306,8 @@
           consultingReport: '',
           sealType: '',
           status: '',
-          agreeTime: ''
+          agreeTime: '',
+          agreeUserId: ''
         }
         this.inputForm.projectId = id
         this.visible = true
@@ -318,6 +320,12 @@
               this.inputForm = this.recover(this.inputForm, data)
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.loading = false
+            } else {
+              this.proofreadIssuedService.findProjectInfoById(this.businessId).then(({data}) => {
+                this.inputForm = this.recover(this.inputForm, data)
+                this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+                this.loading = false
+              })
             }
           })
         })
@@ -361,7 +369,9 @@
             if (valid) {
               this.loading = true
               this.inputForm.status = '5'
-              this.inputForm.agreeTime = new Date()
+              this.inputForm.agreeTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+              let userId = JSON.parse(localStorage.getItem('user')).id
+              this.inputForm.agreeUserId = userId
               this.proofreadIssuedService.save(this.inputForm).then(({data}) => {
                 callback(data.businessTable, data.businessId, this.inputForm)
                 this.loading = false
@@ -414,7 +424,8 @@
           consultingReport: '',
           sealType: '',
           status: '',
-          agreeTime: ''
+          agreeTime: '',
+          agreeUserId: ''
         }
         this.$refs.inputForm.resetFields()
         this.visible = false

+ 2 - 1
src/views/modules/program/registered/RegisItemForm.vue

@@ -672,6 +672,7 @@
   import ProgramProjectListInfoService from '@/api/program/ProgramProjectListInfoService'
   import SelectTree from '@/components/treeSelect/treeSelect.vue'
   import XEUtils from 'xe-utils'
+  import moment from "moment";
   export default {
     props: {
       businessId: {
@@ -976,7 +977,7 @@
         } else if (status === 'agree') {
           // 审核同意
           this.inputForm.status = '5'
-          this.inputForm.agreeTime = new Date()
+          this.inputForm.agreeTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
           let userId = JSON.parse(localStorage.getItem('user')).id
           this.inputForm.agreeUserId = userId
         }