Browse Source

首页审批日期修改

wengyuwen 4 years ago
parent
commit
a8e11e0040
1 changed files with 11 additions and 4 deletions
  1. 11 4
      src/views/startApproval.vue

+ 11 - 4
src/views/startApproval.vue

@@ -25,7 +25,7 @@
 
         <el-form-item disabled label="审批日期">
                 <el-date-picker
-                  v-model="dataForm.auditItenm"
+                  v-model="dataForm.auditItem"
                   size="large"
                   type="date"
                   value-format="timestamp"
@@ -56,7 +56,7 @@ import Global from '@/layout/components/global'
           actId: null,
           auditMsg: null,
           auditUserId: null,
-          auditItenm: null
+          auditItem: null
         },
         visible: false,
         optionsBranch: []
@@ -80,7 +80,14 @@ import Global from '@/layout/components/global'
         this.dataForm.id = id
         this.dataForm.billId = id
         this.dataForm.actId = actId
-        this.$set(this.dataForm, 'auditItenm', Date.parse(new Date()))
+        this.$set(this.dataForm, 'auditItem', Date.parse(new Date()))
+      },
+      getTime(){
+        var date = new Date(this.dataForm.auditItem)
+        var y = date.getFullYear()
+        var m = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
+        var d = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate())
+        this.$set(this.dataForm, 'auditItem', y + '-' + m + '-' + d)
       },
       approved () {
         this.$confirm(`是否通过审批?`, '提示', {
@@ -88,7 +95,7 @@ import Global from '@/layout/components/global'
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          // this.dataForm.auditItenm =
+          this.getTime()
           return  listCharge(this.dataForm,'/warehouse/paths/approved')
           }).then(data => {
             if (data && data.code == 200) {