李志伟 2 years ago
parent
commit
5315213ccf
1 changed files with 10 additions and 25 deletions
  1. 10
    25
      src/pages/invoice/fill.vue

+ 10
- 25
src/pages/invoice/fill.vue View File

200
       })
200
       })
201
       formData.invoiceName = res.name
201
       formData.invoiceName = res.name
202
     } else {
202
     } else {
203
-
204
-      getInvoiceModel(route.query.invoiceId, { invoicePersonId: formData.invoicePersonId, personId }).then(val => {
205
-        const info = {
206
-          ...(val.detail || val.tpl),
207
-          invoiceName: res.name
208
-        }
209
-        Object.assign(formData, info)
210
-        itemList.value = info.itemList
211
-      }).catch(err => {
212
-        console.log(err);
213
-      })
203
+      getDetail({invoiceName: res.name})      
214
     }
204
     }
215
   }).catch(err => {
205
   }).catch(err => {
216
     console.log(err)
206
     console.log(err)
217
   })
207
   })
218
-
219
-
220
-
221
-
222
-
223
-  formData.status = router.currentRoute._rawValue.params.status
224
-  formData.mergeRemark = '否'
225
-
226
 })
208
 })
227
 
209
 
228
 const onFailed = (errorInfo) => {
210
 const onFailed = (errorInfo) => {
263
     console.log(value);
245
     console.log(value);
264
     formData.personName = value.name
246
     formData.personName = value.name
265
     formData.invoicePersonId = value.invoicePersonId
247
     formData.invoicePersonId = value.invoicePersonId
266
-    getDetail()
248
+    getDetail({
249
+      invoiceName:formData.name,
250
+      invoicePersonId: formData.invoicePersonId,
251
+      personName: formData.personName,
252
+      orgId: formData.orgId,
253
+      invoiceOrgName: formData.invoiceOrgName
254
+    })
267
   }
255
   }
268
   showPersonPicker.value = false;
256
   showPersonPicker.value = false;
269
 };
257
 };
270
 //获取模板详情
258
 //获取模板详情
271
-const getDetail = () => {
259
+const getDetail = (data) => {
272
   getInvoiceModel(formData.invoiceId, { invoicePersonId: formData.invoicePersonId, personId: user.value.personId }).then(res => {
260
   getInvoiceModel(formData.invoiceId, { invoicePersonId: formData.invoicePersonId, personId: user.value.personId }).then(res => {
273
     const info = {
261
     const info = {
274
       ...(res.detail || res.tpl),
262
       ...(res.detail || res.tpl),
275
-      invoicePersonId: formData.invoicePersonId,
276
-      personName: formData.personName,
277
-      orgId: formData.orgId,
278
-      invoiceOrgName: formData.invoiceOrgName
263
+      ...data
279
     }
264
     }
280
     Object.assign(formData, info)
265
     Object.assign(formData, info)
281
     itemList.value = info.itemList
266
     itemList.value = info.itemList