show.vue 34 KB

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