ali пре 3 година
родитељ
комит
5f3653c348
1 измењених фајлова са 15 додато и 1 уклоњено
  1. 15 1
      src/components/Widgets/Invoice/AdminInvoiceList/AdminInvoiceList.vue

+ 15 - 1
src/components/Widgets/Invoice/AdminInvoiceList/AdminInvoiceList.vue

@@ -45,7 +45,7 @@ export default {
   name: 'AdminInvoiceList',
   components: { EntityIndex },
   mixins: [mixinWidget],
-  data: () => {
+  data () {
     return {
       api: APIGateway.invoice.APIAdresses.base,
       tableKeys: {
@@ -107,6 +107,13 @@ export default {
             align: 'left',
             field: row => row.owner_info.national_code
           },
+          {
+            name: 'id',
+            required: true,
+            label: 'عنوان',
+            align: 'left',
+            field: row => this.getInvoiceTitle(row)
+          },
           {
             name: 'id',
             required: true,
@@ -160,6 +167,13 @@ export default {
     this.mounted = true
   },
   methods: {
+    getInvoiceTitle (invoice) {
+      if (invoice.item_info.item_type === 'CLASSROOM') {
+        return invoice.item_info.title
+      } else {
+        return invoice.item_info.title || '-'
+      }
+    },
     setActionBtn () {
       this.inputs.forEach((item, index) => {
         if (item.name === 'btn') {