张延森 2 years ago
parent
commit
387bb207ed
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/pages/invoice/fill.vue

+ 4
- 2
src/pages/invoice/fill.vue View File

@@ -140,7 +140,7 @@
140 140
 </template>
141 141
 
142 142
 <script setup>
143
-import { onMounted, reactive, ref } from 'vue';
143
+import { computed, onMounted, reactive, ref } from 'vue';
144 144
 import { useRouter, useRoute } from 'vue-router'
145 145
 import { Dialog, Toast } from 'vant'
146 146
 import dayjs from 'dayjs'
@@ -180,6 +180,8 @@ const router = useRouter();
180 180
 const route = useRoute();
181 181
 const { user } = useModel('user')
182 182
 
183
+const personId = computed(() => route.query.personId || user.personId)
184
+
183 185
 onMounted(() => {
184 186
   //不是扫码进入
185 187
   if (!route.query.invoiceId) {
@@ -199,7 +201,7 @@ onMounted(() => {
199 201
       formData.invoiceName = res.name
200 202
     } else {
201 203
 
202
-      getInvoiceModel(route.query.invoiceId, { invoicePersonId: formData.invoicePersonId, personId: user.value.personId }).then(val => {
204
+      getInvoiceModel(route.query.invoiceId, { invoicePersonId: formData.invoicePersonId, personId }).then(val => {
203 205
         const info = {
204 206
           ...(val.detail || val.tpl),
205 207
           invoiceName: res.name