|
@@ -61,6 +61,18 @@
|
|
|
<q-img :src="inputData.col.value"
|
|
<q-img :src="inputData.col.value"
|
|
|
width="100px" />
|
|
width="100px" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template v-else-if="inputData.col.name === 'download'">
|
|
|
|
|
+ <q-btn v-if="!inputData.col.value"
|
|
|
|
|
+ color="primary"
|
|
|
|
|
+ @click="openDownloadDialog(inputData.props.row)">
|
|
|
|
|
+ <q-icon name="download"
|
|
|
|
|
+ class="q-mr-sm" />
|
|
|
|
|
+ دانلود
|
|
|
|
|
+ </q-btn>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ {{}}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template>
|
|
|
<template v-else-if="inputData.col.name === 'action'">
|
|
<template v-else-if="inputData.col.name === 'action'">
|
|
|
<q-btn color="primary"
|
|
<q-btn color="primary"
|
|
|
outline
|
|
outline
|
|
@@ -83,7 +95,7 @@
|
|
|
import { shallowRef } from 'vue'
|
|
import { shallowRef } from 'vue'
|
|
|
import { Basket } from 'src/models/Basket.js'
|
|
import { Basket } from 'src/models/Basket.js'
|
|
|
import { Product } from 'src/models/Product.js'
|
|
import { Product } from 'src/models/Product.js'
|
|
|
-import { Package } from 'src/models/Package.js'
|
|
|
|
|
|
|
+// import { Package } from 'src/models/Package.js'
|
|
|
import { mixinWidget } from 'src/mixin/Mixins.js'
|
|
import { mixinWidget } from 'src/mixin/Mixins.js'
|
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
import BtnControl from 'components/Control/btn.vue'
|
|
import BtnControl from 'components/Control/btn.vue'
|
|
@@ -133,14 +145,14 @@ export default {
|
|
|
required: true,
|
|
required: true,
|
|
|
label: 'شناسه',
|
|
label: 'شناسه',
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
- field: row => row.id
|
|
|
|
|
|
|
+ field: row => row.product_info?.id ? row.product_info.id : row.package_info.id
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'title',
|
|
name: 'title',
|
|
|
required: true,
|
|
required: true,
|
|
|
label: 'نام محصول',
|
|
label: 'نام محصول',
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
- field: row => (row.product_info || row.package_info).title
|
|
|
|
|
|
|
+ field: row => (row.product_info?.id ? row.product_info : row.package_info).title
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'is_package_or_product',
|
|
name: 'is_package_or_product',
|
|
@@ -154,14 +166,14 @@ export default {
|
|
|
required: true,
|
|
required: true,
|
|
|
label: 'دسته فروشگاه',
|
|
label: 'دسته فروشگاه',
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
- field: row => ((row.product_info || row.package_info).store_category_info?.parent?.parent?.title || '-') + '، ' + ((row.product_info || row.package_info).store_category_info?.parent?.title || '-') + '، ' + ((row.product_info || row.package_info).store_category_info?.title || '-')
|
|
|
|
|
|
|
+ field: row => ((row.product_info?.id ? row.product_info : row.package_info).store_category_info?.parent?.parent?.title || '-') + '، ' + ((row.product_info || row.package_info).store_category_info?.parent?.title || '-') + '، ' + ((row.product_info || row.package_info).store_category_info?.title || '-')
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'store_category1',
|
|
name: 'store_category1',
|
|
|
required: true,
|
|
required: true,
|
|
|
label: 'دسته محتوا',
|
|
label: 'دسته محتوا',
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
- field: row => ((row.product_info || row.package_info).content_category_info?.parent?.parent?.title || '-') + '، ' + ((row.product_info || row.package_info).content_category_info?.parent?.title || '-') + '، ' + ((row.product_info || row.package_info).content_category_info?.title || '-')
|
|
|
|
|
|
|
+ field: row => ((row.product_info?.id ? row.product_info : row.package_info).content_category_info?.parent?.parent?.title || '-') + '، ' + ((row.product_info || row.package_info).content_category_info?.parent?.title || '-') + '، ' + ((row.product_info || row.package_info).content_category_info?.title || '-')
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'count',
|
|
name: 'count',
|
|
@@ -175,7 +187,7 @@ export default {
|
|
|
required: true,
|
|
required: true,
|
|
|
label: 'نوع جنس',
|
|
label: 'نوع جنس',
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
- field: row => row.product_info ? (new Product(row.product_info)).is_physical_info.label : (new Package(row.product_info)).is_physical_info.label
|
|
|
|
|
|
|
+ field: row => (row.product_info?.id ? row.product_info : row.package_info).is_physical_info.label
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'physical_type_info',
|
|
name: 'physical_type_info',
|
|
@@ -189,7 +201,14 @@ export default {
|
|
|
required: true,
|
|
required: true,
|
|
|
label: 'قیمت',
|
|
label: 'قیمت',
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
- field: row => parseInt((row.product_info || row.package_info).unit_price.toString()).toLocaleString('fa')
|
|
|
|
|
|
|
+ field: row => parseInt((row.product_info?.id ? row.product_info : row.package_info).unit_price?.toString()).toLocaleString('fa')
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'download',
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ label: 'دانلود',
|
|
|
|
|
+ align: 'left',
|
|
|
|
|
+ field: row => (row.product_info?.id ? row.product_info : row.package_info).is_physical
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'action',
|
|
name: 'action',
|