Browse Source

fix:发票管理发票内容字典添加

ly 11 tháng trước cách đây
mục cha
commit
e54c963527
1 tập tin đã thay đổi với 10 bổ sung1 xóa
  1. 10 1
      src/views/business/invoice/form.vue

+ 10 - 1
src/views/business/invoice/form.vue

@@ -115,7 +115,7 @@
                                     <el-option v-for="item in invoice_type" :key="item.value" :label="item.label"
                                         :value="item.id"></el-option>
                                 </el-select>
-                                <span v-else>{{ form.invoiceContent }}</span>
+                                <span v-else>{{ invoiceContent(form.invoiceContent) }}</span>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
@@ -683,6 +683,15 @@
             form.value = response.data
         })
     }
+const invoiceContent = (invoiceContent) =>{
+      if(invoiceContent !== null){
+        const map = invoice_type.value.reduce((pre, cur) => {
+          pre[cur.id] = cur.label;
+          return pre
+        }, {})
+        return map[invoiceContent];
+      }
+}
 const statusFormat = (invoiceStatus)=>{
       switch (invoiceStatus){
         case 0: