show.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. <template>
  2. <q-card>
  3. <q-tabs v-model="tab"
  4. dense
  5. class="text-grey"
  6. active-color="primary"
  7. indicator-color="primary"
  8. align="justify"
  9. narrow-indicator>
  10. <q-tab name="userInfo"
  11. label="اطلاعات کاربری" />
  12. <q-tab name="educations"
  13. label="سوابق آموزشی" />
  14. <q-tab name="financial"
  15. label="سوابق مالی" />
  16. <q-tab name="movies2"
  17. label="سوابق دوره های مباحثاتی" />
  18. <q-tab name="movies3"
  19. label="سوابق رویدادها" />
  20. <q-tab name="movies4"
  21. label="سوابق باشگاه اندیشه جویان" />
  22. <q-tab name="movies5"
  23. label="درخواست مدرک و گواهی" />
  24. </q-tabs>
  25. <q-separator />
  26. <q-tab-panels v-model="tab"
  27. animated>
  28. <q-tab-panel name="userInfo">
  29. <entity-edit v-if="mounted"
  30. ref="entityEdit"
  31. v-model:value="inputs"
  32. title="اطلاعات کاربری"
  33. :api="api"
  34. :after-load-input-data="afterLoadInputData"
  35. :entity-id-key="entityIdKey"
  36. :entity-param-key="entityParamKey"
  37. :show-route-name="showRouteName"
  38. :default-layout="false"
  39. :show-close-button="false"
  40. :show-edit-button="false"
  41. :show-expand-button="false"
  42. :show-save-button="false"
  43. :show-reload-button="false">
  44. <template #after-form-builder>
  45. <div class="flex justify-end">
  46. <q-btn color="primary"
  47. label="بروزرسانی اطلاعات"
  48. @click="editEntity" />
  49. </div>
  50. </template>
  51. </entity-edit>
  52. </q-tab-panel>
  53. <q-tab-panel name="educations">
  54. <entity-index v-if="mounted"
  55. ref="registrationsList"
  56. v-model:value="registrationsListInputs"
  57. title="لیست دوره ها"
  58. :api="registrationsListApi"
  59. :table="registrationsListTable"
  60. :table-keys="registrationsListTableKeys"
  61. :show-search-button="false"
  62. :show-reload-button="false"
  63. :show-expand-button="false">
  64. <template v-slot:entity-index-table-cell="{inputData}">
  65. <template v-if="inputData.col.name === 'number'">
  66. {{ inputData.rowNumber }}
  67. </template>
  68. <template v-else-if="inputData.col.name === 'action'">
  69. <div class="action-column-entity-index">
  70. <q-btn color="primary"
  71. label="جزییات" />
  72. </div>
  73. </template>
  74. <template v-else>
  75. {{ inputData.col.value }}
  76. </template>
  77. </template>
  78. </entity-index>
  79. <q-separator class="q-my-md" />
  80. <entity-index v-if="mounted"
  81. ref="registrationsActivitySheetList"
  82. v-model:value="registrationsActivitySheetListInputs"
  83. title="لیست فعالت های کلاسی"
  84. :api="registrationsActivitySheetListApi"
  85. :table="registrationsActivitySheetListTable"
  86. :table-keys="registrationsActivitySheetListTableKeys"
  87. :show-search-button="false"
  88. :show-reload-button="false"
  89. :show-expand-button="false">
  90. <template v-slot:entity-index-table-cell="{inputData}">
  91. <template v-if="inputData.col.name === 'number'">
  92. {{ inputData.rowNumber }}
  93. </template>
  94. <template v-else-if="inputData.col.name === 'action'">
  95. <div class="action-column-entity-index">
  96. <q-btn color="primary"
  97. label="جزییات" />
  98. </div>
  99. </template>
  100. <template v-else>
  101. {{ inputData.col.value }}
  102. </template>
  103. </template>
  104. </entity-index>
  105. <q-skeleton v-else
  106. type="rect"
  107. height="200px" />
  108. </q-tab-panel>
  109. <q-tab-panel name="financial">
  110. <entity-index v-if="mounted"
  111. ref="invoiceList"
  112. v-model:value="invoiceListInputs"
  113. title="لیست صورتحساب ها"
  114. :api="invoiceListApi"
  115. :table="invoiceListTable"
  116. :table-keys="invoiceListTableKeys"
  117. :show-search-button="false"
  118. :show-reload-button="false"
  119. :show-expand-button="false">
  120. <template v-slot:entity-index-table-cell="{inputData}">
  121. <template v-if="inputData.col.name === 'number'">
  122. {{ inputData.rowNumber }}
  123. </template>
  124. <template v-else-if="inputData.col.name === 'action'">
  125. <div class="action-column-entity-index">
  126. <q-btn color="primary"
  127. label="جزییات"
  128. :to="{name: 'Admin.Invoice.Show', params: {id: inputData.props.row.id}}" />
  129. </div>
  130. </template>
  131. <template v-else>
  132. {{ inputData.col.value }}
  133. </template>
  134. </template>
  135. </entity-index>
  136. <q-separator class="q-my-md" />
  137. <entity-index v-if="mounted"
  138. ref="paymentList"
  139. v-model:value="paymentListInputs"
  140. title="لیست پرداخت ها"
  141. :api="paymentListApi"
  142. :table="paymentListTable"
  143. :table-keys="paymentListTableKeys"
  144. :show-search-button="false"
  145. :show-reload-button="false"
  146. :show-expand-button="false">
  147. <template v-slot:entity-index-table-cell="{inputData}">
  148. <template v-if="inputData.col.name === 'number'">
  149. {{ inputData.rowNumber }}
  150. </template>
  151. <template v-else-if="inputData.col.name === 'action'">
  152. <div class="action-column-entity-index">
  153. <q-btn color="primary"
  154. label="جزییات" />
  155. </div>
  156. </template>
  157. <template v-else>
  158. {{ inputData.col.value }}
  159. </template>
  160. </template>
  161. </entity-index>
  162. <q-separator class="q-my-md" />
  163. <entity-index v-if="mounted"
  164. ref="transactionList"
  165. v-model:value="transactionListInputs"
  166. title="لیست تراکنش ها"
  167. :api="transactionListApi"
  168. :table="transactionListTable"
  169. :table-keys="transactionListTableKeys"
  170. :show-search-button="false"
  171. :show-reload-button="false"
  172. :show-expand-button="false">
  173. <template v-slot:entity-index-table-cell="{inputData}">
  174. <template v-if="inputData.col.name === 'number'">
  175. {{ inputData.rowNumber }}
  176. </template>
  177. <template v-else-if="inputData.col.name === 'action'">
  178. <div class="action-column-entity-index">
  179. <q-btn color="primary"
  180. label="جزییات" />
  181. </div>
  182. </template>
  183. <template v-else>
  184. {{ inputData.col.value }}
  185. </template>
  186. </template>
  187. </entity-index>
  188. <q-skeleton v-else
  189. type="rect"
  190. height="200px" />
  191. </q-tab-panel>
  192. <q-tab-panel name="movies2">
  193. سوابق باشگاه اندیشه جویان
  194. </q-tab-panel>
  195. <q-tab-panel name="movies3">
  196. سوابق رویدادها
  197. </q-tab-panel>
  198. <q-tab-panel name="movies4">
  199. سوابق باشگاه اندیشه جویان
  200. </q-tab-panel>
  201. <q-tab-panel name="movies5">
  202. درخواست مدرک و گواهی
  203. </q-tab-panel>
  204. </q-tab-panels>
  205. </q-card>
  206. </template>
  207. <script>
  208. import Assist from 'assets/js/Assist.js'
  209. import Enums from 'src/assets/Enums/Enums.js'
  210. import { APIGateway } from 'src/api/APIGateway.js'
  211. import { EntityEdit, EntityIndex } from 'quasar-crud'
  212. import { Classroom } from 'src/models/Classroom'
  213. import { Registration } from 'src/models/Registration'
  214. import { Invoice } from 'src/models/Invoice'
  215. import { Payment } from 'src/models/Payment'
  216. export default {
  217. name: 'Admin.User.Show',
  218. components: { EntityEdit, EntityIndex },
  219. data () {
  220. const userId = this.$route.params.id
  221. return {
  222. tab: 'userInfo',
  223. api: APIGateway.user.APIAdresses.byId(userId),
  224. mounted: false,
  225. entityIdKey: 'id',
  226. entityParamKey: 'id',
  227. showRouteName: 'Admin.User.Show',
  228. inputs: [
  229. { type: 'separator', name: 'space', label: 'نقش و وضعیت ها', className: 'custom-separator', col: 'col-12' },
  230. {
  231. type: 'select',
  232. name: 'roles',
  233. responseKey: 'roles',
  234. options: Enums.groups,
  235. multiple: true,
  236. label: 'نقش',
  237. placeholder: ' ',
  238. col: 'col-md-3 col-12'
  239. },
  240. { type: 'separator', name: 'space', placeholder: ' ', label: 'اطلاعات ضروری', className: 'custom-separator', col: 'col-12' },
  241. { type: 'input', name: 'email', placeholder: ' ', label: 'ایمیل', responseKey: 'email', col: 'col-md-3 col-12' },
  242. { type: 'input', name: 'mobile_number', placeholder: ' ', label: 'تلفن همراه', responseKey: 'mobile_number', col: 'col-md-3 col-12' },
  243. { type: 'optionGroupRadio', name: 'is_valid_national_code', responseKey: 'is_valid_national_code', label: 'اتباع خارجی', options: [{ label: 'نیست', value: true }, { label: 'هست', value: false }], value: true, col: 'col-md-3 col-12' },
  244. { type: 'input', name: 'national_code', placeholder: ' ', label: 'کدملی/کد اتباع غیر ایرانی', responseKey: 'national_code', col: 'col-md-3 col-12' },
  245. { type: 'separator', name: 'space', label: 'اطلاعات پروفایل', className: 'custom-separator', col: 'col-12' },
  246. { type: 'file', name: 'picture', placeholder: ' ', label: 'عکس پروفایل', responseKey: 'picture', col: 'col-md-3 col-12' },
  247. { type: 'separator', name: 'space', size: '0', col: 'col-12' },
  248. { type: 'input', name: 'firstname', placeholder: ' ', label: 'نام', responseKey: 'firstname', col: 'col-md-3 col-12' },
  249. { type: 'input', name: 'lastname', placeholder: ' ', label: 'نام خانوادگی', responseKey: 'lastname', col: 'col-md-3 col-12' },
  250. {
  251. type: 'select',
  252. name: 'gender',
  253. responseKey: 'gender',
  254. options: Enums.genders,
  255. value: null,
  256. label: 'جنسیت',
  257. placeholder: ' ',
  258. col: 'col-md-3 col-12'
  259. },
  260. { type: 'date', name: 'birthdate', placeholder: ' ', label: 'تولد', responseKey: 'birthdate', col: 'col-md-3 col-12' },
  261. {
  262. type: 'select',
  263. name: 'marital_status',
  264. responseKey: 'marital_status',
  265. options: Enums.maritalStatuses,
  266. value: null,
  267. label: 'وضعیت تاهل',
  268. placeholder: ' ',
  269. col: 'col-md-3 col-12'
  270. },
  271. { type: 'input', name: 'mobile_number', placeholder: ' ', label: 'تلفن همراه جهت تماس', responseKey: 'mobile_number', col: 'col-md-3 col-12' },
  272. { type: 'input', name: 'on_social_network_mobile_number', placeholder: ' ', label: 'تلفن همراه جهت شبکه های اجتماعی', responseKey: 'on_social_network_mobile_number', col: 'col-md-3 col-12' },
  273. { type: 'input', name: 'phone_number', placeholder: ' ', label: 'تلفن منزل', responseKey: 'phone_number', col: 'col-md-3 col-12' },
  274. {
  275. type: 'select',
  276. name: 'last_academic_degree',
  277. responseKey: 'last_academic_degree',
  278. options: Enums.academicDegree,
  279. value: null,
  280. label: 'آخرین مقطع تحصیلی',
  281. placeholder: ' ',
  282. col: 'col-md-3 col-12'
  283. },
  284. { type: 'input', name: 'last_academic_degree_field', placeholder: ' ', label: 'رشته تحصیلی', responseKey: 'last_academic_degree_field', col: 'col-md-3 col-12' },
  285. { type: 'input', name: 'last_academy_name', placeholder: ' ', label: 'نام دانشگاه یا حوزه تحصیلی', responseKey: 'last_academy_name', col: 'col-md-3 col-12' },
  286. {
  287. type: 'select',
  288. name: 'educational_status',
  289. responseKey: 'educational_status',
  290. options: Enums.educationalStatus,
  291. value: null,
  292. label: 'وضعیت تحصیلی',
  293. placeholder: ' ',
  294. col: 'col-md-3 col-12'
  295. },
  296. { type: 'checkbox', name: 'is_abroad_birth_address', placeholder: ' ', label: 'محل تولد خارج از کشور است؟', responseKey: 'is_abroad_birth_address', className: 'require', col: 'col-12' },
  297. { type: 'input', name: 'birth_country', placeholder: ' ', label: 'کشور محل تولد', responseKey: 'birth_country', col: 'col-md-4 col-12' },
  298. { type: 'input', name: 'birth_province', placeholder: ' ', label: 'استان محل تولد', responseKey: 'birth_province', col: 'col-md-4 col-12' },
  299. { type: 'input', name: 'birth_city', placeholder: ' ', label: 'شهر محل تولد', responseKey: 'birth_city', col: 'col-md-4 col-12' },
  300. { type: 'checkbox', name: 'is_abroad_living_address', placeholder: ' ', label: 'محل زندگی فعلی خارج از کشور است؟', responseKey: 'is_abroad_living_address', className: 'require', col: 'col-12' },
  301. { type: 'input', name: 'living_country', placeholder: ' ', label: 'کشور محل زندگی فعلی', responseKey: 'living_country', col: 'col-md-4 col-12' },
  302. { type: 'input', name: 'living_province', placeholder: ' ', label: 'استان محل زندگی فعلی', responseKey: 'living_province', col: 'col-md-4 col-12' },
  303. { type: 'input', name: 'living_city', placeholder: ' ', label: 'شهر محل زندگی فعلی', responseKey: 'living_city', col: 'col-md-4 col-12' },
  304. { type: 'input', name: 'living_postal_code', placeholder: ' ', label: 'کد پستی محل زندگی', responseKey: 'living_postal_code', col: 'col-md-3 col-12' },
  305. { type: 'input', name: 'living_address', placeholder: ' ', label: 'آدرس پستی محل زندگی', responseKey: 'living_address', col: 'col-md-6 col-12' },
  306. { type: 'hidden', name: 'id', responseKey: 'id', label: 'id', col: 'col-12' },
  307. { type: 'hidden', name: 'is_active', responseKey: 'is_active', label: 'is_active', col: 'col-12' }
  308. ],
  309. registrationsListInputs: [
  310. { type: 'hidden', name: 'owner', value: userId }
  311. ],
  312. registrationsListApi: APIGateway.registration.APIAdresses.base,
  313. registrationsListTable: {
  314. columns: [
  315. {
  316. name: 'number',
  317. required: true,
  318. label: 'شماره',
  319. align: 'left',
  320. field: () => ''
  321. },
  322. {
  323. name: 'id',
  324. required: true,
  325. label: 'شناسه',
  326. align: 'left',
  327. field: row => row.id
  328. },
  329. {
  330. name: 'classroom_info.item_type_info',
  331. required: true,
  332. label: 'نوع',
  333. align: 'left',
  334. field: row => (new Classroom(row.classroom_info)).item_type_info.label
  335. },
  336. {
  337. name: 'classroom_info.unit_info.title',
  338. required: true,
  339. label: 'نام درس',
  340. align: 'left',
  341. field: row => row.classroom_info.unit_info.title
  342. },
  343. {
  344. name: 'classroom_infoaudience_gender_type_info',
  345. required: true,
  346. label: 'جنسیت',
  347. align: 'left',
  348. field: row => (new Classroom(row.classroom_info)).audience_gender_type_info.label
  349. },
  350. {
  351. name: 'holding_time',
  352. required: true,
  353. label: 'تاریخ شروع',
  354. align: 'left',
  355. field: row => row.classroom_info.holding_month + ' ' + row.classroom_info.holding_year
  356. },
  357. {
  358. name: 'classroom_info.holding_type_info.label',
  359. required: true,
  360. label: 'نوع برگزاری',
  361. align: 'left',
  362. field: row => (new Classroom(row.classroom_info)).holding_type_info.label
  363. },
  364. {
  365. name: 'classroom_info.professor_info',
  366. required: true,
  367. label: 'استاد',
  368. align: 'left',
  369. field: row => row.classroom_info.professor_info.firstname + ' ' + row.classroom_info.professor_info.lastname
  370. },
  371. {
  372. name: 'classroom_info.sessions_info.length',
  373. required: true,
  374. label: 'تعداد جلسات',
  375. align: 'left',
  376. field: row => row.classroom_info.sessions_info.length
  377. },
  378. {
  379. name: 'id',
  380. required: true,
  381. label: 'وضعیت',
  382. align: 'left',
  383. field: row => (new Registration(row)).status_info.label
  384. },
  385. {
  386. name: 'creation_time',
  387. required: true,
  388. label: 'زمان ثبت نام',
  389. align: 'left',
  390. field: row => Assist.miladiToShamsi(row.creation_time)
  391. },
  392. {
  393. name: 'id',
  394. required: true,
  395. label: 'وضعیت مالی',
  396. align: 'left',
  397. field: row => (new Invoice(row.invoice_info)).status_info.label
  398. },
  399. {
  400. name: 'action',
  401. required: true,
  402. label: 'جزییات',
  403. align: 'left',
  404. field: ''
  405. }
  406. ],
  407. data: []
  408. },
  409. registrationsListTableKeys: {
  410. data: 'results',
  411. total: 'count',
  412. currentPage: 'current',
  413. perPage: 'per_page',
  414. pageKey: 'page'
  415. },
  416. registrationsActivitySheetListInputs: [
  417. { type: 'hidden', name: 'owner', value: userId }
  418. ],
  419. registrationsActivitySheetListApi: APIGateway.classroom.APIAdresses.activitySheet,
  420. registrationsActivitySheetListTable: {
  421. columns: [
  422. {
  423. name: 'number',
  424. required: true,
  425. label: 'شماره',
  426. align: 'left',
  427. field: () => ''
  428. },
  429. {
  430. name: 'id',
  431. required: true,
  432. label: 'شناسه',
  433. align: 'left',
  434. field: row => row.id
  435. },
  436. {
  437. name: 'classroom_info.item_type_info',
  438. required: true,
  439. label: 'نوع',
  440. align: 'left',
  441. field: row => (new Classroom(row.classroom_info)).item_type_info.label
  442. },
  443. {
  444. name: 'classroom_info.unit_info.title',
  445. required: true,
  446. label: 'نام درس',
  447. align: 'left',
  448. field: row => row.classroom_info?.unit_info?.title
  449. },
  450. {
  451. name: 'classroom_infoaudience_gender_type_info',
  452. required: true,
  453. label: 'جنسیت',
  454. align: 'left',
  455. field: row => (new Classroom(row.classroom_info)).audience_gender_type_info.label
  456. },
  457. {
  458. name: 'holding_time',
  459. required: true,
  460. label: 'تاریخ شروع',
  461. align: 'left',
  462. field: row => row.classroom_info?.holding_month + ' ' + row.classroom_info?.holding_year
  463. },
  464. {
  465. name: 'classroom_info.holding_type_info.label',
  466. required: true,
  467. label: 'نوع برگزاری',
  468. align: 'left',
  469. field: row => (new Classroom(row.classroom_info)).holding_type_info.label
  470. },
  471. {
  472. name: 'classroom_info.professor_info',
  473. required: true,
  474. label: 'استاد',
  475. align: 'left',
  476. field: row => row.classroom_info?.professor_info?.firstname + ' ' + row.classroom_info?.professor_info?.lastname
  477. },
  478. {
  479. name: 'classroom_info.sessions_info.length',
  480. required: true,
  481. label: 'تعداد جلسات',
  482. align: 'left',
  483. field: row => row.classroom_info?.sessions_info ? row.classroom_info.sessions_info.length : '-'
  484. },
  485. {
  486. name: 'id',
  487. required: true,
  488. label: 'وضعیت',
  489. align: 'left',
  490. field: row => (new Registration(row)).status_info.label
  491. },
  492. {
  493. name: 'creation_time',
  494. required: true,
  495. label: 'زمان ثبت نام',
  496. align: 'left',
  497. field: row => Assist.miladiToShamsi(row.creation_time)
  498. },
  499. {
  500. name: 'id',
  501. required: true,
  502. label: 'وضعیت مالی',
  503. align: 'left',
  504. field: row => (new Invoice(row.invoice_info)).status_info.label
  505. },
  506. {
  507. name: 'action',
  508. required: true,
  509. label: 'جزییات',
  510. align: 'left',
  511. field: ''
  512. }
  513. ],
  514. data: []
  515. },
  516. registrationsActivitySheetListTableKeys: {
  517. data: 'results',
  518. total: 'count',
  519. currentPage: 'current',
  520. perPage: 'per_page',
  521. pageKey: 'page'
  522. },
  523. invoiceListInputs: [
  524. { type: 'hidden', name: 'owner', value: userId }
  525. ],
  526. invoiceListApi: APIGateway.invoice.APIAdresses.base,
  527. invoiceListTable: {
  528. columns: [
  529. {
  530. name: 'number',
  531. required: true,
  532. label: 'شماره',
  533. align: 'left',
  534. field: () => ''
  535. },
  536. {
  537. name: 'id',
  538. required: true,
  539. label: 'شناسه',
  540. align: 'left',
  541. field: row => row.id
  542. },
  543. {
  544. name: 'id',
  545. required: true,
  546. label: 'سفارش دهنده',
  547. align: 'left',
  548. field: row => row.owner_info.firstname + ' ' + row.owner_info.lastname
  549. },
  550. {
  551. name: 'id',
  552. required: true,
  553. label: 'کدملی سفارش دهنده',
  554. align: 'left',
  555. field: row => row.owner_info.national_code
  556. },
  557. {
  558. name: 'id',
  559. required: true,
  560. label: 'نوع صورتحساب',
  561. align: 'left',
  562. field: row => (new Invoice(row)).type_info.label
  563. },
  564. {
  565. name: 'amount',
  566. required: true,
  567. label: 'مبلغ تراکنش(ریال)',
  568. align: 'left',
  569. field: row => row.amount.toLocaleString('fa')
  570. },
  571. {
  572. name: 'id',
  573. required: true,
  574. label: 'وضعیت تراکنش',
  575. align: 'left',
  576. field: row => (new Invoice(row)).status_info.label
  577. },
  578. {
  579. name: 'creation_time',
  580. required: true,
  581. label: 'زمان ثبت',
  582. align: 'left',
  583. field: row => Assist.miladiToShamsi(row.creation_time)
  584. },
  585. {
  586. name: 'last_modification_time',
  587. required: true,
  588. label: 'زمان آخرین بروز رسانی',
  589. align: 'left',
  590. field: row => Assist.miladiToShamsi(row.last_modification_time)
  591. },
  592. {
  593. name: 'action',
  594. required: true,
  595. label: 'جزییات',
  596. align: 'left',
  597. field: row => ''
  598. }
  599. ]
  600. },
  601. invoiceListTableKeys: {
  602. data: 'results',
  603. total: 'count',
  604. currentPage: 'current',
  605. perPage: 'per_page',
  606. pageKey: 'page'
  607. },
  608. paymentListInputs: [
  609. { type: 'hidden', name: 'owner', value: userId }
  610. ],
  611. paymentListApi: APIGateway.payment.APIAdresses.base,
  612. paymentListTable: {
  613. columns: [
  614. {
  615. name: 'number',
  616. required: true,
  617. label: 'شماره',
  618. align: 'left',
  619. field: () => ''
  620. },
  621. {
  622. name: 'id',
  623. required: true,
  624. label: 'شناسه',
  625. align: 'left',
  626. field: row => row.id
  627. },
  628. {
  629. name: 'invoice_info.title',
  630. required: true,
  631. label: 'عنوان',
  632. align: 'left',
  633. field: row => row.invoice_info?.title
  634. },
  635. {
  636. name: 'type',
  637. required: true,
  638. label: 'نوع تراکنش',
  639. align: 'left',
  640. field: row => (new Payment(row)).type_info.label
  641. },
  642. {
  643. name: 'invoice_info.status',
  644. required: true,
  645. label: 'وضعیت',
  646. align: 'left',
  647. field: row => (new Invoice(row.invoice_info)).status_info.label
  648. },
  649. {
  650. name: 'amount',
  651. required: true,
  652. label: 'مبلغ تراکنش (ریال)',
  653. align: 'left',
  654. field: row => row.amount.toLocaleString('fa')
  655. },
  656. {
  657. name: 'creation_time',
  658. required: true,
  659. label: 'زمان',
  660. align: 'left',
  661. field: row => Assist.miladiToShamsi(row.creation_time)
  662. },
  663. {
  664. name: 'action',
  665. required: true,
  666. label: 'جزییات',
  667. align: 'left',
  668. field: row => ''
  669. }
  670. ]
  671. },
  672. paymentListTableKeys: {
  673. data: 'results',
  674. total: 'count',
  675. currentPage: 'current',
  676. perPage: 'per_page',
  677. pageKey: 'page'
  678. },
  679. transactionListInputs: [
  680. { type: 'hidden', name: 'owner', value: userId }
  681. ],
  682. transactionListApi: APIGateway.transaction.APIAdresses.base,
  683. transactionListTable: {
  684. columns: [
  685. {
  686. name: 'number',
  687. required: true,
  688. label: 'شماره',
  689. align: 'left',
  690. field: () => ''
  691. },
  692. {
  693. name: 'id',
  694. required: true,
  695. label: 'شناسه',
  696. align: 'left',
  697. field: row => row.id
  698. },
  699. {
  700. name: 'amount',
  701. required: true,
  702. label: 'مبلغ تراکنش (ریال)',
  703. align: 'left',
  704. field: row => row.amount.toLocaleString('fa')
  705. },
  706. {
  707. name: 'description',
  708. required: true,
  709. label: 'توضیحات',
  710. align: 'left',
  711. field: row => row.description
  712. },
  713. {
  714. name: 'reference_code',
  715. required: true,
  716. label: 'کد مرجع',
  717. align: 'left',
  718. field: row => row.reference_code
  719. },
  720. {
  721. name: 'creation_time',
  722. required: true,
  723. label: 'تاریخ ایجاد',
  724. align: 'left',
  725. field: row => Assist.miladiToShamsi(row.creation_time)
  726. },
  727. {
  728. name: 'action',
  729. required: true,
  730. label: 'جزییات',
  731. align: 'left',
  732. field: row => ''
  733. }
  734. ]
  735. },
  736. transactionListTableKeys: {
  737. data: 'results',
  738. total: 'count',
  739. currentPage: 'current',
  740. perPage: 'per_page',
  741. pageKey: 'page'
  742. }
  743. }
  744. },
  745. mounted () {
  746. this.mounted = true
  747. },
  748. methods: {
  749. afterLoadInputData (responseData, setNewInputData) {
  750. // const roles = responseData.roles.map(role => {
  751. // return {
  752. // label: this.getRoleTitle(role),
  753. // value: role
  754. // }
  755. // }).filter(role => role.value)
  756. // console.log('roles', roles)
  757. // this.setInputValue('roles', roles)
  758. // setNewInputData(this.inputs)
  759. },
  760. setInputValue (name, value) {
  761. const inputIndex = this.inputs.findIndex(input => input.name === name)
  762. this.inputs[inputIndex].value = value
  763. },
  764. getRoleTitle (roleName) {
  765. const target = Enums.groups.find(item => item.value === roleName)
  766. if (!target) {
  767. return '-'
  768. }
  769. return target.label
  770. },
  771. editEntity () {
  772. this.$refs.entityEdit.editEntity()
  773. }
  774. }
  775. }
  776. </script>
  777. <style scoped>
  778. </style>