show.vue 30 KB

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