ggooalice пре 2 година
родитељ
комит
7470ebaa6e
1 измењених фајлова са 23 додато и 11 уклоњено
  1. 23 11
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/index.vue

+ 23 - 11
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/index.vue

@@ -412,23 +412,35 @@ export default {
             }
             this.editForm.items = JSON.stringify(this.invoiceList)
             this.editForm.totalAmount = this.totalCost
-            this.$axios.post("/expense-sheet/add", this.editForm)
+            // 获取新的票据编号
+            this.$axios.post("/expense-sheet/getNextCode", {})
             .then(res => {
                 if(res.code == "ok") {
-                    this.$toast.success('填报成功')
-                    this.editForm = {
-                        ownerId: '',
-                        createDate: '',
-                        ticketNum: 0,
-                        type: 0,
-                        remark: ''
-                    }
-                    this.invoiceList = []
-                    this.uploader = []
+                    this.editForm.code = res.data
+                    // 提交
+                    this.$axios.post("/expense-sheet/add", this.editForm)
+                    .then(res => {
+                        if(res.code == "ok") {
+                            this.$toast.success('填报成功')
+                            this.editForm = {
+                                ownerId: '',
+                                createDate: '',
+                                ticketNum: 0,
+                                type: 0,
+                                remark: ''
+                            }
+                            this.invoiceList = []
+                            this.uploader = []
+                        } else {
+                            this.$toast.fail('获取失败');
+                        }
+                    }).catch(err=> {this.$toast.clear();console.log(err)});
                 } else {
                     this.$toast.fail('获取失败');
                 }
             }).catch(err=> {this.$toast.clear();console.log(err)});
+
+            
         },
     // #endregion