lizhenhao преди 2 години
родител
ревизия
6e947cf2ef
променени са 2 файла, в които са добавени 18 реда и са изтрити 0 реда
  1. 5 0
      src/views/modules/cw/invoice/InvoiceFormTask.vue
  2. 13 0
      src/views/modules/finance/invoice/InvoiceFormTask.vue

+ 5 - 0
src/views/modules/cw/invoice/InvoiceFormTask.vue

@@ -816,6 +816,11 @@
             if (this.status === 'audit' || this.status === 'taskFormDetail') {
               method = 'view'
             }
+            if (this.status === 'audit') {
+              if (this.commonJS.isEmpty(this.inputForm.billingDate)) {
+                this.inputForm.billingDate = this.moment(new Date()).format('YYYY-MM-DD')
+              }
+            }
             if (!this.commonJS.isEmpty(this.status) && this.status === 'audit' && this.inputForm.financeInvoiceDetailDTOList.length === 0) {
               this.inputForm.financeInvoiceDetailDTOList.push({
                 code: '',

+ 13 - 0
src/views/modules/finance/invoice/InvoiceFormTask.vue

@@ -275,6 +275,7 @@
           <el-col :span="12" >
             <el-form-item label="开票时间" prop="billingDate"
                           :rules="[
+                          {required: true, message:'开票时间不能为空', trigger:'blur'}
                  ]">
               <el-date-picker
                 v-model="inputForm.billingDate"
@@ -791,6 +792,11 @@
             if (this.status === 'audit' || this.status === 'taskFormDetail') {
               method = 'view'
             }
+            if (this.status === 'audit') {
+              if (this.commonJS.isEmpty(this.inputForm.billingDate)) {
+                this.inputForm.billingDate = this.moment(new Date()).format('YYYY-MM-DD')
+              }
+            }
             if (!this.commonJS.isEmpty(this.status) && this.status === 'audit' && this.inputForm.financeInvoiceDetailDTOList.length === 0) {
               this.inputForm.financeInvoiceDetailDTOList.push({
                 code: '',
@@ -913,6 +919,13 @@
             throw new Error()
           }
         }
+        if (this.status === 'audit') {
+          if (this.commonJS.isEmpty(this.inputForm.billingDate)) {
+            this.$message.error('开票时间不可以为空')
+            this.loading = false
+            throw new Error('开票时间不可以为空')
+          }
+        }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
             this.loading = true