Quellcode durchsuchen

invoices list and show for user

ali vor 3 Jahren
Ursprung
Commit
df86af5e4a

+ 4 - 7
src/assets/js/Assist.js

@@ -1,5 +1,5 @@
-// ToDo: use moment-jalaali
-// import * as PersianDate from 'persian-date'
+import moment from 'moment-jalaali'
+moment.loadPersian()
 const PersianDate = null
 
 class Assist {
@@ -25,15 +25,12 @@ class Assist {
     }
   }
 
-  static miladiToShamsi(miladi, justDate) {
+  static miladiToShamsi(miladi, format = 'jYYYY/jMM/jDD HH:mm:ss') {
     if (!miladi) {
       return null
     }
 
-    if (justDate) {
-      return new PersianDate(new Date(miladi)).format('YYYY/MM/DD')
-    }
-    return new PersianDate(new Date(miladi)).format('HH:mm:ss YYYY/MM/DD')
+    return moment(miladi, 'YYYY/M/D').locale('fa').format(format)
   }
 
   static diffDate(date1, date2, diffType) {

+ 2 - 1
src/pages/User/Invoice/List.vue

@@ -13,11 +13,12 @@ export default {
   mixins: [mixinPageOptions],
   data: () => {
     return {
-      sections: [{ data: { rows: [{ cols: [{ widgets: [{ name: 'InvoiceList' }], options: { style: { paddingTop: '124px' } } }], options: {} }] } }]
+      sections: [{ data: { rows: [{ cols: [{ widgets: [{ name: 'InvoiceList' }], options: { style: { paddingTop: '100px' } } }], options: { className: '', height: 'auto', boxed: true, boxedWidth: 1200, gutterXSize: 'md', gutterYSize: 'md', absolute: 'none', paddingOfBoxedInFullWidth: '30px', style: { maxWidth: '1200px', width: '1200px' } } }] } }]
     }
   },
   created() {
     this.currenSections = this.sections
+    this.pageBuilderLoading = false
   }
 }
 </script>

+ 2 - 1
src/pages/User/Invoice/Show.vue

@@ -13,11 +13,12 @@ export default {
   mixins: [mixinPageOptions],
   data: () => {
     return {
-      sections: [{ data: { rows: [{ cols: [{ widgets: [{ name: 'InvoiceShow' }], options: { style: { paddingTop: '124px' } } }], options: {} }] } }]
+      sections: [{ data: { rows: [{ cols: [{ widgets: [{ name: 'InvoiceShow' }], options: { style: { paddingTop: '124px' } } }], options: { className: '', height: 'auto', boxed: true, boxedWidth: 1200, gutterXSize: 'md', gutterYSize: 'md', absolute: 'none', paddingOfBoxedInFullWidth: '30px', style: { maxWidth: '1200px', width: '1200px' } } }] } }]
     }
   },
   created() {
     this.currenSections = this.sections
+    this.pageBuilderLoading = false
   }
 }
 </script>

+ 3 - 1
src/pages/User/Invoice/Thankyou.vue

@@ -1,7 +1,8 @@
 <template>
   <q-page-builder v-model:sections="currenSections"
                   v-model:options="pageConfig"
-                  :editable="pageBuilderEditable" />
+                  :editable="pageBuilderEditable"
+                  :loading="pageBuilderLoading" />
 </template>
 
 <script>
@@ -17,6 +18,7 @@ export default {
   },
   created() {
     this.currenSections = this.sections
+    this.pageBuilderLoading = false
   }
 }
 </script>