1404/11/04- first

This commit is contained in:
2026-01-24 17:45:54 +03:30
commit edf1824229
554 changed files with 59581 additions and 0 deletions
@@ -0,0 +1,49 @@
<template>
<ADropdown :trigger="['click']" v-if="props.more">
<span class="mr-2 mb-1 cursor-pointer">...</span>
<template #overlay>
<a-menu class="flex flex-col">
<a-menu-item
v-for="(item, index) in statusList"
:key="index"
class="border-none px-2 py-1 rounded m-1"
:style="{ color: item[1].color }"
@click="changeHandler(item)"
>
<div class="flex items-center">
<!-- <BaseIcon :icon="item[1].icon" size="18" />-->
<span class="font-normal pr-1">{{ item[1].title }}</span>
</div>
</a-menu-item>
</a-menu>
</template>
</ADropdown>
</template>
<script setup lang="ts">
import { status } from '@/pages/menuPages/withdraw/information/hooks/status'
import { toNumber } from 'lodash'
interface Props {
sts: number
more?: boolean
}
const props = withDefaults(defineProps<Props>(), {
more: false
})
const statusList = computed(() => {
return Object.entries(status).filter((item) => toNumber(item[0]) !== props.sts)
})
const emit = defineEmits<{
(e: 'change-sts', value: any): void
}>()
const changeHandler = (item: any) => {
emit('change-sts', item)
}
</script>
<style scoped></style>
@@ -0,0 +1,64 @@
<template>
<div
class="flex justify-center border-none flex-inline items-center px-2 py-1 rounded w-fit"
:style="{ background: currentStatus?.bgColor, color: currentStatus?.color }"
>
<!-- <BaseIcon :icon="currentStatus?.icon" size="18" />-->
<span class="font-normal pr-1">{{ currentStatus?.title }}</span>
<WithdrawSelector :more="props.more" :sts="props.sts" @change-sts="changeStatusHandler" />
<!-- <ADropdown :trigger="['click']" v-if="props.more">-->
<!-- <span class="mr-2 mb-1 cursor-pointer">...</span>-->
<!-- <template #overlay>-->
<!-- <a-menu class="flex flex-col">-->
<!-- <a-menu-item-->
<!-- v-for="(item, index) in Object.entries(status)"-->
<!-- :key="index"-->
<!-- class="border-none px-2 py-1 rounded m-1"-->
<!-- :style="{ color: item[1].color }"-->
<!-- @click="changeHandler(item)"-->
<!-- >-->
<!-- <div class="flex items-center">-->
<!-- <BaseIcon :icon="item[1].icon" size="18" />-->
<!-- <span class="font-normal pr-1">{{ item[1].title }}</span>-->
<!-- </div>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </template>-->
<!-- </ADropdown>-->
</div>
<!-- <ATag :color="currentStatus.color" > 1111 </ATag>-->
</template>
<script setup lang="ts">
import { get } from 'lodash'
import { status } from '@/pages/menuPages/withdraw/information/hooks/status'
import type { WithdrawStatus } from '@/model/wallet'
import Icon from '@core/components/BaseIcon/src/Icon.vue'
import WithdrawSelector from '@/pages/menuPages/withdraw/components/WithdrawSelector.vue'
interface Props {
sts: number
more?: boolean
}
const props = withDefaults(defineProps<Props>(), {
more: false
})
const emit = defineEmits<{
(e: 'change-sts', value: any): void
}>()
const currentStatus = computed<WithdrawStatus>(() => {
return get(status, props.sts)
})
const changeStatusHandler = (item) => {
emit('change-sts', item)
}
// onMounted(() => {
// console.log(currentStatus.value, 'current')
// })
</script>
<style scoped></style>
@@ -0,0 +1,182 @@
<template>
<div>
<BasicShowContext title="لیست برداشت و واریز">
<BaseTable v-bind="tblProps" @register="submit" ref="tbl">
<template #extraHeader>
<!-- <BaseButton type="primary" size="small" class="flex" @click="emits('add')">
<div>افزودن مشتری عمده</div>
<BaseIcon icon="vuesax-linear:user-add" Size="16px" />
</BaseButton>-->
</template>
<template #tracked="{ column, record }">
<div v-if="record.tracked_number">{{ record.tracked_number }}</div>
<div v-else>
<BaseButton @click="emits('withdraw', record.id)">تایید برداشت</BaseButton>
</div>
</template>
<template #action="{ column, record }">
<div class="gap-2 flex justify-center">
<div class="flex gap-2" v-if="record.sts <= 70 && record.sts >= 50">
<a-tooltip class="cursor-pointer">
<template #title><span>دریافت فاکتور</span></template>
<Icon
icon="vuesax-linear:document-download"
color="#1D4ED8"
@click="$router.push({ name: 'factor', params: { id: record.id } })"
/>
</a-tooltip>
<a-tooltip class="cursor-pointer">
<template #title><span>وضعیت</span></template>
<ADropdown :trigger="['click']">
<Icon icon="vuesax-linear:status-up" color="#CA8A04" @click="test(record)" />
<template #overlay>
<a-menu class="flex flex-col">
<a-menu-item
v-for="(item, index) in statusList"
:key="index"
class="border-none px-2 py-1 rounded m-1"
:style="{ color: item[1].color }"
@click="changeStatusHandler(item)"
>
<div class="flex items-center">
<BaseIcon :icon="item[1].icon" size="18" />
<span class="font-normal pr-1">{{ item[1].title }}</span>
</div>
</a-menu-item>
</a-menu>
</template>
</ADropdown>
</a-tooltip>
</div>
<!-- <div v-if="record.sts == 53">-->
<a-tooltip class="cursor-pointer">
<template #title><span>تعیین وزن</span></template>
<Icon
icon="vuesax-linear:3d-cube-scan"
color="#1D4ED8"
@click="emits('weight', record)"
/>
</a-tooltip>
<!-- </div>-->
</div>
</template>
</BaseTable>
</BasicShowContext>
</div>
</template>
<script lang="tsx" setup>
import type { TableInput } from '@core/type/baseTable'
import useBaseTable from '@core/components/BaseTableOld/hooks/useBaseTable'
import Icon from '@core/components/BaseIcon/src/Icon.vue'
import { changeCustomerActivation, getCustomerTable } from '@/api/customer'
import { cols } from '../hooks/withdrawColumns'
import { useUserStore } from '@/store/userStore'
import { usePrefix } from '@core/composable/usePrefix'
import { message } from 'ant-design-vue'
import { getOrderTable } from '@/api/order'
import {getWithdrawTable, updateSts} from '@/api/wallet'
const [submit, reload] = useBaseTable()
/*const select = (val) => {
val.sts === 1 ? return ['1'] : ['2']
}*/
//emits
const emits = defineEmits(['delete', 'edit', 'add', 'withdraw', 'weight'])
const { prefixCls } = usePrefix('pophoverstatus')
//permission
function checkPermission(temp: string) {
const store = useUserStore()
return store.canAccess(temp)
}
//define table
const table = ref(null)
const tblProps = ref<any>({
columns: cols,
api: (params: TableInput) => {
return getWithdrawTable(params)
}
//bordered: true
})
const loading = ref<boolean>(false)
async function changeCustomerActivationFunction(id: number) {
try {
loading.value = true
await changeCustomerActivation(id)
reload()
message.success('تغییر وضعیت با موفقیت انجام شد')
} catch (e) {
console.error(e)
} finally {
loading.value = false
}
}
const fetch = () => {
// console.log('sss')
reload()
}
// const spinTable = (val: boolean) => {
// // console.log('sss')
// table?.value?.loading.value = val
// }
defineExpose({
fetch
// spinTable
})
import { status } from '@/pages/menuPages/withdraw/information/hooks/status'
import {toNumber} from "lodash";
const withdrawId = ref(null)
const sts = ref()
const statusList = computed(() => {
return Object.entries(status).filter((item) => toNumber(item[0]) !== sts.value)
})
const test = (record: any) => {
sts.value = record.sts
withdrawId.value = record.id
}
const changeStatusHandler = async (status: any) => {
try {
await changeStatus(withdrawId.value as number, status)
reload()
} catch (e: any) {
console.log(e)
}
}
const changeStatus = async (id: number, status: any) => {
try {
await updateSts(id, { sts: status[0] })
message.success(`وضعیت ثبت شد `)
} catch (e) {
console.log(e)
message.error('خطا در ثبت اطلاعات')
}
}
</script>
<style lang="less">
@prefix: ~'@{prefixCls}-pophoverstatus';
.@{prefix} {
.ant-menu-rtl.ant-menu-inline,
.ant-menu-rtl.ant-menu-vertical {
border-left: none;
}
.ant-menu-item-only-child {
border-radius: @border-radius-base;
}
//bor
/* .ant-input-group-addon:first-child {
!* border: #d9d9d9 1px solid;
border-radius: 0 6px 6px 0;*!
}*/
}
</style>
@@ -0,0 +1,163 @@
<template>
<div :class="[prefixCls]">
<ACard v-if="withdraw" class="my-4 mx-auto !p-3 h-print max-w-[700px]">
<div class="h-16 flex justify-center items-center mt-[4rem]">
<!-- <img class="h-16" src="@/assets/img/logo.svg" alt="logo" />-->
<div class="logo flex justify-center w-full flex-col items-center">
<img :src="getConfigApp('avatar')" class="w-[150px]" />
</div>
</div>
<div class="mt-[6rem] p-2 flex bg-gray-50 border border-solid rounded-lg border-gray-300">
<div class="w-3/5 flex justify-center items-center">
<span class="text-sm font-medium">فاکتور فروش</span>
</div>
<div class="w-2/5 flex flex-col gap-2">
<!-- <div class="flex items-center justify-between">
<span class="text-gray-500 text-xs font-medium">وضعیت سفارش :</span>
<span class="text-gray-700 text-sm font-medium">{{ withdraw?.transaction?.sts_str }}</span>
</div>-->
<div class="flex items-center justify-between">
<span class="text-gray-500 text-xs font-medium">تاریخ سفارش :</span>
<span class="text-gray-700 text-sm font-medium">{{ toJalaliNoTime(withdraw?.created_at) }}</span>
</div>
<div class="flex items-center justify-between">
<span class="text-gray-500 text-xs font-medium">شماره سفارش :</span>
<span class="text-gray-700 text-sm font-medium">{{ withdraw?.id }}</span>
</div>
</div>
</div>
<div
class="mt-2 p-2 flex flex-col gap-2 bg-gray-50 border border-solid rounded-lg border-gray-300"
>
<div class="grid grid-cols-3">
<div class="col-span-1 flex items-center gap-2">
<span class="text-xs font-medium text-gray-500">خریدار</span>
<span class="text-sm font-medium text-gray-700">{{ withdraw?.customer?.name }}</span>
</div>
<div class="col-span-1 flex items-center gap-2">
<span class="text-xs font-medium text-gray-500">شماره تلفن همراه</span>
<span class="text-sm font-medium text-gray-700">{{ withdraw?.customer?.mobile }}</span>
</div>
<!-- <div class="col-span-1 flex items-center gap-2">
<span class="text-xs font-medium text-gray-500">تلفن ثابت</span>
<span class="text-sm font-medium text-gray-700">{{ withdraw?.address?.phone }}</span>
</div>-->
</div>
<div class="grid grid-cols-3">
<!-- <div class="col-span-1 flex items-center gap-2">
<span class="text-xs font-medium text-gray-500">کد پستی</span>
<span class="text-sm font-medium text-gray-700">{{ withdraw?.address?.zip }}</span>
</div>-->
<div class="col-span-1 flex items-center gap-2">
<span class="text-xs font-medium text-gray-500">استان</span>
<span class="text-sm font-medium text-gray-700">{{ withdraw?.address?.province }}</span>
</div>
<div class="col-span-1 flex items-center gap-2">
<span class="text-xs font-medium text-gray-500">شهر</span>
<span class="text-sm font-medium text-gray-700">{{ withdraw?.address?.city }}</span>
</div>
</div>
<div class="flex items-center gap-2">
<span class="text-xs font-medium text-gray-500">آدرس</span>
<span class="text-sm font-medium text-gray-700">{{ withdraw?.address?.address }}</span>
</div>
</div>
<ADivider class="!my-4" />
<div class="h-7 grid grid grid-cols-10 bg-[#091A38] rounded-t-lg">
<span class="col-span-2 text-white flex justify-center">ردیف</span>
<span class="col-span-6 text-white flex justify-center">عنوان</span>
<!-- <span class="col-span-1 text-white flex justify-center">کد محصول</span>-->
<!-- <span class="col-span-1 text-white flex justify-center">قیمت</span>-->
<span class="col-span-2 text-white flex justify-center">تعداد</span>
<!-- <span class="col-span-2 text-white flex justify-center">قیمت کل</span>-->
</div>
<div class="flex flex-col" >
<div v-for="(item, index) in withdraw?.transaction">
<div class="grid grid-cols-10">
<span class="col-span-2 text-xs font-medium py-[8px] px-[10px] flex justify-center">{{
index + 1
}}</span>
<span class="col-span-6 text-xs font-medium py-[8px] px-[10px] flex justify-center">{{
item?.title
}}</span>
<!-- <span class="col-span-1 text-xs font-medium py-[8px] px-[10px] flex justify-center">{{-->
<!-- item.product.code-->
<!-- }}</span>-->
<!-- <span class="col-span-1 text-xs font-medium py-[8px] px-[10px] flex justify-center">{{
usePrice(item.price?? 0, true, '')
}}</span>-->
<span class="col-span-2 text-xs font-medium py-[8px] px-[10px] flex justify-center">{{
item.gold * -1
}}</span>
<!-- <span class="col-span-2 text-xs font-medium py-[8px] px-[10px] flex justify-center">{{
usePrice(item.total_price?? 0, true, '')
}}</span>-->
</div>
<ADivider class="!my-0" />
</div>
</div>
<!-- <div class="h-7 flex justify-between items-center bg-gray-100 rounded-b-lg px-2">
<span class="text-xs font-medium">جمع سفارش ها</span>
<span class="w-1/10 ml-4 text-xs font-bold"></span>
</div>-->
<div class="mt-4 flex gap-2 no-print">
<AButton class="flex gap-2 items-center" type="primary" @click="printFactor">
<Icon icon="vuesax-linear:printer" size="15" color="#fff" />
<span>چاپ فاکتور</span>
</AButton>
<AButton type="primary" danger @click="$router.push({ name: 'withdrawMain' })"
>بازگشت</AButton
>
</div>
</ACard>
</div>
</template>
<script setup lang="ts">
import { usePrefix } from '@core/composable/usePrefix'
import type { Withdraw } from '@/model/wallet'
import { getWithdrawById , getWithdrawTable } from '@/api/wallet'
import { onMounted } from 'vue'
import { usePrice } from '@core/utils/usePrice'
import Icon from '@core/components/BaseIcon/src/Icon.vue'
import {toJalaliNoTime} from "../../../../core/utils/useDataTime";
import {forEach} from "lodash";
import {getConfigApp} from "@/utils/config";
const { prefixCls } = usePrefix('factor')
const router = useRouter()
const withdraw = ref<null | Withdraw>(null)
const id = computed(() => {
return parseInt(router.currentRoute.value.params.id as string)
})
const getWithdraw = async () => {
withdraw.value = await getWithdrawById(id.value)
console.log('hello')
console.log(withdraw.value)
// totalPrice.value = usePrice(withdraw.value.total_price as number, true, '')
}
const printFactor = () => {
window.print()
}
onMounted(async () => {
await getWithdraw()
})
</script>
<style lang="less">
@prefix: ~'@{prefixCls}-factor';
.@{prefix} {
}
@media print {
.h-print {
height: calc(100vh - 32px);
}
.no-print {
display: none !important;
}
}
</style>
@@ -0,0 +1,226 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalali, toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
import { usePrice } from '@core/utils/usePrice'
import WithdrawStatus from "@/pages/menuPages/withdraw/components/WithdrawStatus.vue";
/*import BudgetSelect from '@/components/BudgetSelect.vue'
import { useStaticApiListsStore } from '@/store/staticApisStore'
import type { FilterSelect } from '@/model/filterSelect'
import type { DocItem } from '@/model/docType'*/
//define store
//const store = useStaticApiListsStore()
//document types
/*let docTypes: DocItem[]*/
/*onMounted(async () => {
docTypes = await store.readyDocTypeList()
})
const filteredDocTypes: FilterSelect = docTypes?.map((x: DocItem) => {
return {
label: x.title,
value: x.id
}
})*/
export const cols: BaseTableColumn[] = [
{
title: 'ردیف',
dataIndex: 'id',
key: 'id',
filterable: false,
sortable: false,
customRender: (record: any) => {
return record.index + 1
}
},
{
title: 'علت تراکنش',
dataIndex: 'note',
key: 'note',
type: 'Number'
// className: 'column-money'
},
{
title: 'شماره پیگیری',
dataIndex: 'tracked_number',
key: 'tracked_number',
type: 'Number',
slot: 'tracked',
customRender: (record: any) => record.record.tracked_number ?? '__'
// className: 'column-money'
},
{
title: 'کد سفارش',
dataIndex: 'id',
key: 'id',
type: 'Number'
// className: 'column-money'
},
{
title: 'کد کاربر',
dataIndex: 'customer_id',
key: 'customer_id',
type: 'Number'
},
{
title: 'نام و نام خانوادگی',
dataIndex: 'customer.name',
key: 'customer.name',
type: 'Text'
},
{
title: 'مقدار (ریال)',
dataIndex: 'cash',
key: 'cash',
type: 'Number',
customRender: ({ record }) => {
return (
<div class="flex justify-center">
<div class={'font-bold px-6 text-red'}>{usePrice(record.cash ?? 0, true, '')}</div>
</div>
)
}
},
{
title: 'طلا',
dataIndex: 'gold',
key: 'gold',
type: 'Number',
},
{
title: 'شماره کارت',
dataIndex: 'bank_account.cart_number',
key: 'bank_account.cart_number',
type: 'Number',
customRender: (data) => {
return data.record.bank_account?.cart_number ?? '_'
}
},
{
title: 'وضعیت',
dataIndex: 'sts',
key: 'sts',
filterable: false,
/*customRender: ({ record }) => {
switch (record.sts) {
case 1:
return (
<div class="flex justify-center font-bold">
<CustomTag textColor="#ca8a04" bgColor="#fef3c7" class="px-2">
{record.sts_str}
</CustomTag>
</div>
)
case 2:
return (
<div class="flex justify-center font-bold px-2">
<CustomTag textColor="#25855A" bgColor="#E3F4E9" class="px-2">
{record.sts_str}
</CustomTag>
</div>
)
case 4:
return (
<div class="flex justify-center font-bold px-2">
<CustomTag textColor="#25855A" bgColor="#E3F4E9" class="px-2">
{record.sts_str}
</CustomTag>
</div>
)
default:
return (
<div class="flex justify-center font-bold px-2">
<CustomTag textColor="#C53030" bgColor="#FECACA" class="px-2">
{record.sts_str}
</CustomTag>
</div>
)
}
}*/
customRender: ({ record }) => {
return (
<CustomTag textColor='#ca8a04' bgColor='#fef3c7'>{record?.sts_str}</CustomTag>
)
},
},
{
title: 'تاریخ ثبت',
dataIndex: 'created_at',
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalali(record.record.created_at)
}
},
{
title: 'عملیات',
dataIndex: 'action',
key: 'action',
width: 200,
slot: 'action',
filterable: false
}
/* {
title: 'تاریخ تایید',
dataIndex: 'updated_at',
key: 'updated_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalaliNoTime(record.record.created_at)
}
},*/
/*{
title: 'نقش',
dataIndex: 'user_type_record',
key: 'user_type_record',
type: 'Select',
filterable: false,
sortable: false,
filterComponentProps: {
multiple: true
},
filterField: 'user_type_obj.id',
filterComponent: ReadyUserTypeSelect,
/!* customRender: (record: any) => {
return record.record.user_type_record?.value
}*!/
customRender: ({ record }) => {
const items = record.is_admin ? (
<CustomTag textColor="#25855A" bgColor="#E3F4E9">
ادمین
</CustomTag>
) : (
record.user_type_obj.map((item: { title: any }, index: any) => {
if (item) {
return (
<CustomTag textColor="#25855A" bgColor="#E3F4E9">
{item?.title}
</CustomTag>
)
}
})
)
return <div class="flex justify-center items-center gap-2">{items}</div>
}
},
{
title: 'حوزه',
dataIndex: 'section',
key: 'section'
},
{
title: 'شماره موبایل',
dataIndex: 'mobile',
type: 'Number',
key: 'mobile'
},*/
/* {
title: 'عملیات',
dataIndex: 'action',
key: 'action',
slot: 'action',
fixed: 'right',
filterable: false
}*/
]
+291
View File
@@ -0,0 +1,291 @@
<template>
<div>
<BasicMainCard>
<div class="flex w-full h-full">
<tbl
ref="table"
class="w-full h-full"
@edit="edit"
@delete="deleteItem"
@withdraw="openWithdraw"
@weight="openWeight"
/>
<!-- <BasicMenu :menu="menu" width="13rem" @onChange="tabSelected" />
<component :is="selectedComponent" class="mr-5" />-->
<!-- <BasicShowContext title="پروژه ها"> <Search /> </BasicShowContext>-->
</div>
</BasicMainCard>
<BasicModal
v-model:visible="confirmWithdrawVisible"
width="15rem"
title="تایید برداشت"
@ok="okWithdraw"
:loading="loading"
@close="confirmWithdrawVisible = false"
>
<a-form :model="form" ref="formRef" autocomplete="off">
<div class="">
<a-form-item label="شماره پیگیری" name="tracked_number" :rules="inputRules()">
<BasicInput v-model:value="form.tracked_number" type="number" />
</a-form-item>
<a-form-item label="تاریخ" name="date_at">
<BaseDatePicker v-model:value="form.date_at" show-time format="YYYY-MM-DD HH:mm" />
<!-- format="YYYY-MM-DD HH:mm"-->
<!-- <DatePicker show-time />-->
</a-form-item>
</div>
</a-form>
</BasicModal>
<!-- <BasicInfoModal
v-model:visible="userInfoVisible"
@close="userInfoVisible = false"
:title="infoParams.title"
:date="infoParams.date"
:time="infoParams.time"
:type="infoParams.type"
:name="infoParams.name"
:items="infoParams.items"
/>-->
<BasicModal
v-model:visible="confirmWeightVisible"
width="40rem"
title="ثبت اطلاعات"
:loading="loading"
@close="confirmWeightVisible = false"
>
<div v-for="(item, index) in confirmWithdraw?.transaction">
<div class="bg-gray-100 rounded-lg p-4 mt-2">
<div class="mb-4">{{ item?.title }} ({{ (item.gold * -1) }} عدد)</div>
<ADivider class="!my-0 "/>
<div v-if="item.gold && item.gold * -1 > 0">
<div class="h-7 grid grid grid-cols-3">
<span class="col-span-1 flex "></span>
<span class="col-span-1 flex justify-center">وزن جدید</span>
</div>
<div v-for="i in Math.abs(item.gold * -1)" class="grid grid-cols-3 gap-2 mb-2" >
<!-- <span class="col-span-1 text-xs font-medium py-[8px] px-[10px]">{{
i
}}</span>-->
<span class="col-span-1 text-xs font-medium py-[8px] px-[10px]">{{ item?.title }} {{ i }}</span>
<BasicInput class="col-span-1 text-xs font-medium w-10rem" v-model:value="newWeightArray[i]" />
<BaseButton class="col-span-1 text-xs font-medium w-4rem mr-4" @click="ok(i)">ثبت</BaseButton>
</div>
</div>
</div>
</div>
</BasicModal>
</div>
</template>
<script setup lang="ts">
// import BasicInfoModal from '@/components/BasicInfoModal'
import { inputLenRules, inputRules } from '@/utils/inputRules'
import { useStaticApiListsStore } from '@/store/staticApisStore'
import { ref } from 'vue'
import { DatePicker } from 'ant-design-vue'
import tbl from './components/table.vue'
import type { FormInstance } from 'ant-design-vue'
import BasicInfoModal from '@/components/BasicInfoModal/index.vue'
import { message } from 'ant-design-vue/es'
import type { Info } from '@/components/BasicInfoModal/model/Info'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { confirmDeleteItem } from '@/utils/confirmModal'
import { cloneDeep } from 'lodash'
import type { Item } from '@/model/Item'
import type { Customer } from '@/model/customer'
import { createCustomer, deleteCustomer, updateCustomer } from '@/api/customer'
import type { Order } from '@/model/order'
import type { Wallet, Withdraw } from '@/model/wallet'
import {completeWithdraw, sendWeights} from '@/api/wallet'
import Button from "@core/components/BaseButton";
//import DatePicker from '@core/components/_sample/components/datePicker.vue'
//loading
const loading = ref<boolean>(false)
//define store
const store = useStaticApiListsStore()
//define tbl
const table = ref(null)
const refreshTable = () => table?.value?.fetch()
let updateKey = ref<number>(0)
//form
const form = ref<Withdraw>({})
const formRef = ref<FormInstance>()
//info
let infoParams = reactive<Info>({})
/*
function info(val: Order) {
infoParams.name = val.customer.name
infoParams.type = val.customer.mobile
infoParams.date = toJalaliNoTime(val.created_at)
infoParams.time = toTime(val.created_at)
infoParams.itemsTitle = 'اطلاعات کاربری'
infoParams.items = [
{
key: 'مقدار (گرم)',
value: val.amount ?? '-'
},
{
key: 'قیمت هر گرم طلا برای مشتری (ریال)',
value: val.price ?? '-'
},
{
key: 'قیمت کل برای مشتری (ریال)',
value: val.total_price ?? '-'
},
{
key: '/قیمت هر گرم طلا بدون سود (ریال)',
value: val.price_original ?? '-'
},
{
key: 'قیمت کل بدون سود (ریال)',
value: val.total_price_original ?? '-'
},
{
key: 'سود هر گرم (ریال)',
value: val.fee ?? '-'
},
{
key: 'سود کل (ریال)',
value: val.total_fee ?? '-'
},
{
key: 'کد کاربری',
value: val.customer.id ?? '-'
},
{
key: 'شماره ملی',
value: val.customer.n_code ?? '-'
},
{
key: 'تاریخ تولد',
value: toJalaliNoTime(val.customer.birth_date) ?? '-'
},
{
key: 'نام فروشگاه',
value: val.customer.shop_name ?? '-'
},
{
key: 'شماره تلفن فروشگاه',
value: val.customer.phone_number ?? '-'
},
{
key: 'نام استان',
value: val.customer.province ?? '-'
},
{
key: 'نام شهر',
value: val.customer.city ?? '-'
}
/!* {
key: 'نام چاپی',
value: val.print_name ?? '-'
}*!/
]
userInfoVisible.value = true
}
*/
//edit
let editId: number | undefined = undefined
async function edit(record: Customer) {
confirmWithdrawVisible.value = true
editId = record.id
form.value = cloneDeep(record)
}
//add
/*async function add() {
loading.value = true
editId = undefined
// await store.getUsersList()
confirmWithdrawVisible.value = true
updateKey.value++
resetData()
loading.value = false
}*/
function openWithdraw(val: Withdraw) {
confirmWithdraw = val
confirmWithdrawVisible.value = true
}
//reset data
const resetData = () => {
formRef.value?.resetFields()
form.value = {
tracked_number: undefined
}
}
//delete
const deleteItem = (id: number) => confirmDeleteItem('کاربر', id, deleteCustomer, refreshTable)
//define selects
onMounted(async () => {
loading.value = true
// await getResponsible()
// await getQC()
// await getManager()
loading.value = false
})
//add project modal
const confirmWithdrawVisible = ref<boolean>(false)
const confirmWeightVisible = ref<boolean>(false)
let confirmWithdraw: Withdraw
// const userInfoVisible = ref<boolean>(false)
//submit weight
async function okWithdraw() {
formRef.value?.validateFields().then(async () => {
// console.log('salam', form.value)
// return
loading.value = true
try {
form.value.id = confirmWithdraw
await completeWithdraw(form.value)
confirmWithdrawVisible.value = false
refreshTable()
resetData()
message.success('شماره پیگیری با موفقیت تایید شد')
// await getResponsible()
// await getQC()
// await getManager()
} catch (e) {
console.error(e)
// message.error('خطا در بارگذاری اطلاعات')
} finally {
loading.value = false
}
})
}
const newWeightArray = ref([])
function openWeight(val) {
confirmWithdraw = val
confirmWeightVisible.value = true
}
function ok(i) {
try {
// await sendWeights()
message.success('با موفقیت ثبت شد')
} catch (e) {
// message.error('خطا در بارگذاری اطلاعات')
console.error(e)
} finally {
console.log()
}
}
</script>
<style scoped></style>
@@ -0,0 +1,132 @@
<svg width="264" height="259" viewBox="0 0 264 259" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="264" height="259" fill="white"/>
<g id="&#217;&#133;&#219;&#140;&#216;&#178; &#218;&#169;&#216;&#167;&#216;&#177;" clip-path="url(#clip0_508_4188)">
<rect width="1920" height="1080" transform="translate(-1159 -659)" fill="#F6F7F9"/>
<rect id="Rectangle 5" x="-1127" y="-563" width="1856" height="952" rx="10" fill="white"/>
<g id="Rectangle 7" opacity="0.25" filter="url(#filter0_dd_508_4188)">
<rect x="-1159" y="-595" width="1920" height="1016" fill="black"/>
</g>
<g id="Frame 35660" filter="url(#filter1_dd_508_4188)">
<rect x="-767" y="-518" width="1135.05" height="863" rx="8" fill="white" shape-rendering="crispEdges"/>
<g id="Frame 35659">
<g id="Frame 35658">
<g id="Frame 35657">
<g id="Frame 35640">
<g id="16" opacity="0.5">
<g id="Group">
<path id="Vector" d="M250 120C250 146.93 240.983 171.902 225.873 191.978C217.587 202.75 207.595 212.298 196.141 219.642C177.619 231.883 155.442 238.983 131.559 238.983C66.0019 238.983 12.874 185.612 12.874 120C12.874 54.1429 66.0019 1.0166 131.315 1.0166C155.198 1.0166 177.376 8.11643 195.897 20.1127C207.351 27.4573 217.343 37.0054 225.629 47.7775C240.983 68.0977 250 92.8247 250 120Z" fill="#EAEEF9"/>
<path id="Vector_2" d="M20.8227 222.892C23.016 222.892 24.9657 221.179 24.9657 218.73C24.9657 216.527 23.2597 214.568 20.8227 214.568C18.6293 214.568 16.6797 216.282 16.6797 218.73C16.6797 220.934 18.3856 222.892 20.8227 222.892Z" fill="url(#paint0_linear_508_4188)"/>
<path id="Vector_3" d="M56.6754 35.2923C58.8688 35.2923 60.5747 33.5785 60.5747 31.3752C60.5747 29.1718 58.8688 27.458 56.6754 27.458C54.4821 27.458 52.7761 29.1718 52.7761 31.3752C52.7761 33.5785 54.4821 35.2923 56.6754 35.2923Z" fill="url(#paint1_linear_508_4188)"/>
</g>
<g id="Recipt 1">
<g id="Vector_4" filter="url(#filter2_d_508_4188)">
<path d="M241.714 19.3782V217.684C241.714 221.111 237.815 222.825 235.377 220.377L231.234 216.46C229.772 214.991 227.335 214.991 225.873 216.46L218.074 224.049C216.612 225.518 214.175 225.518 212.713 224.049L204.914 216.46C203.452 214.991 201.015 214.991 199.553 216.46L191.754 224.049C190.292 225.518 187.855 225.518 186.393 224.049L178.594 216.46C177.132 214.991 174.695 214.991 173.232 216.46L165.678 224.049C164.215 225.518 161.778 225.518 160.316 224.049L152.517 216.46C151.055 214.991 148.618 214.991 147.156 216.46L139.357 224.049C137.895 225.518 135.458 225.518 133.996 224.049L126.197 216.46C124.735 214.991 122.298 214.991 120.836 216.46L113.037 224.049C111.575 225.518 109.138 225.518 107.676 224.049L97.4399 213.767L96.7088 214.501L90.6161 220.377C88.1791 222.825 84.2798 221.111 84.2798 217.684V19.3782C84.2798 15.9507 88.1791 14.2369 90.6161 16.6852L94.7591 20.6023C96.2214 22.0712 98.6584 22.0712 100.121 20.6023L107.919 13.0128C109.382 11.5439 111.819 11.5439 113.281 13.0128L121.079 20.6023C122.542 22.0712 124.979 22.0712 126.441 20.6023L134.24 13.0128C135.702 11.5439 138.139 11.5439 139.601 13.0128L147.4 20.6023C148.862 22.0712 151.299 22.0712 152.761 20.6023L160.56 13.0128C162.022 11.5439 164.459 11.5439 165.921 13.0128L173.476 20.6023C174.938 22.0712 177.375 22.0712 178.838 20.6023L186.636 13.0128C188.099 11.5439 190.536 11.5439 191.998 13.0128L199.796 20.6023C201.259 22.0712 203.696 22.0712 205.158 20.6023L212.957 13.0128C214.419 11.5439 216.856 11.5439 218.318 13.0128L226.117 20.6023C227.579 22.0712 230.016 22.0712 231.478 20.6023L235.621 16.6852C237.815 14.2369 241.714 15.9507 241.714 19.3782Z" fill="white"/>
</g>
<g id="Group_2">
<path id="Vector_5" d="M212.226 63.9347H195.166C193.46 63.9347 191.998 62.4658 191.998 60.752C191.998 59.0383 193.46 57.5693 195.166 57.5693H212.226C213.932 57.5693 215.394 59.0383 215.394 60.752C215.394 62.4658 213.932 63.9347 212.226 63.9347Z" fill="#C5CCDE"/>
<path id="Vector_6" d="M179.569 63.9347H112.306C110.6 63.9347 109.138 62.4658 109.138 60.752C109.138 59.0383 110.6 57.5693 112.306 57.5693H179.569C181.275 57.5693 182.737 59.0383 182.737 60.752C182.737 62.4658 181.275 63.9347 179.569 63.9347Z" fill="#C5CCDE"/>
<path id="Vector_7" d="M212.226 94.2931H182.981C181.275 94.2931 179.813 92.8242 179.813 91.1104C179.813 89.3967 181.275 87.9277 182.981 87.9277H212.226C213.932 87.9277 215.394 89.3967 215.394 91.1104C215.394 92.8242 213.932 94.2931 212.226 94.2931Z" fill="#C5CCDE"/>
<path id="Vector_8" d="M167.384 94.2931H137.408C135.702 94.2931 134.24 92.8242 134.24 91.1104C134.24 89.3967 135.702 87.9277 137.408 87.9277H167.627C169.333 87.9277 170.795 89.3967 170.795 91.1104C170.795 92.8242 169.089 94.2931 167.384 94.2931Z" fill="#C5CCDE"/>
<path id="Vector_9" d="M125.71 94.2931H112.306C110.6 94.2931 109.138 92.8242 109.138 91.1104C109.138 89.3967 110.6 87.9277 112.306 87.9277H125.71C127.416 87.9277 128.878 89.3967 128.878 91.1104C128.878 92.8242 127.416 94.2931 125.71 94.2931Z" fill="#4988FD"/>
<path id="Vector_10" d="M162.266 124.896H139.113C137.408 124.896 135.945 123.427 135.945 121.713C135.945 119.999 137.408 118.53 139.113 118.53H162.266C163.971 118.53 165.434 119.999 165.434 121.713C165.434 123.427 163.971 124.896 162.266 124.896Z" fill="#C5CCDE"/>
<path id="Vector_11" d="M126.685 124.896H112.306C110.6 124.896 109.138 123.427 109.138 121.713C109.138 119.999 110.6 118.53 112.306 118.53H126.685C128.391 118.53 129.853 119.999 129.853 121.713C129.853 123.427 128.391 124.896 126.685 124.896Z" fill="#4988FD"/>
<path id="Vector_12" d="M162.266 155.254H112.306C110.6 155.254 109.138 153.785 109.138 152.071C109.138 150.358 110.6 148.889 112.306 148.889H162.266C163.972 148.889 165.434 150.358 165.434 152.071C165.434 153.785 163.972 155.254 162.266 155.254Z" fill="#C5CCDE"/>
<path id="Vector_13" d="M162.266 179.491C144.719 179.491 129.853 179.491 112.306 179.491C108.163 179.491 108.163 185.612 112.306 185.612C131.559 185.612 143.257 185.612 162.266 185.612C163.972 185.612 165.434 184.143 165.434 182.429C165.434 180.715 163.972 179.491 162.266 179.491Z" fill="#C5CCDE"/>
</g>
<g id="Group_3">
<path id="Vector_14" d="M202.964 189.041C200.527 189.041 198.578 187.082 198.578 184.634V179.982C194.922 179.737 191.51 178.758 188.586 177.534C186.392 176.555 185.418 174.106 186.149 171.658C186.88 169.7 188.586 168.475 190.535 168.475C191.267 168.475 191.754 168.72 192.485 168.965C194.435 169.944 197.603 170.924 201.502 170.924C206.864 170.924 210.519 167.986 210.519 163.824C210.519 159.907 207.839 157.459 201.502 154.765C193.46 151.583 186.149 147.421 186.149 138.118C186.149 130.528 191.267 124.408 199.309 122.694V117.797C199.309 115.349 201.258 113.391 203.696 113.391C206.133 113.391 208.082 115.349 208.082 117.797V122.204C211.007 122.449 213.444 122.939 215.881 123.918C218.074 124.897 219.293 127.59 218.318 129.794C217.587 131.507 215.881 132.732 213.931 132.732C213.2 132.732 212.713 132.732 212.225 132.487C209.788 131.507 207.351 131.018 204.67 131.018C198.821 131.018 196.872 134.2 196.872 137.138C196.872 140.566 199.065 142.524 206.864 145.707C217.099 149.869 221.486 155.255 221.486 163.334C221.486 171.413 215.881 177.779 207.595 179.492V184.634C207.351 187.082 205.402 189.041 202.964 189.041Z" fill="#C5CCDE"/>
</g>
</g>
<g id="Vector_15" filter="url(#filter3_d_508_4188)">
<path d="M140.332 86.2151V157.213C140.332 161.62 136.92 165.048 132.534 165.048H15.7986C11.4119 165.048 8 161.62 8 157.213V86.2151C8 81.8084 11.4119 78.3809 15.7986 78.3809H132.534C136.92 78.3809 140.332 82.0532 140.332 86.2151Z" fill="url(#paint2_linear_508_4188)"/>
</g>
<g id="Group_4">
<path id="Vector_16" d="M39.6816 127.59H21.6474C20.1851 127.59 18.7229 126.365 18.7229 124.652C18.7229 123.183 19.9414 121.714 21.6474 121.714H39.6816C41.1439 121.714 42.6061 122.938 42.6061 124.652C42.3624 126.365 41.1439 127.59 39.6816 127.59Z" fill="#4260FF"/>
<path id="Vector_17" d="M68.9262 127.59H50.892C49.4298 127.59 47.9675 126.365 47.9675 124.652C47.9675 123.183 49.1861 121.714 50.892 121.714H68.9262C70.3885 121.714 71.8507 122.938 71.8507 124.652C71.607 126.365 70.3885 127.59 68.9262 127.59Z" fill="#4260FF"/>
<path id="Vector_18" d="M98.1709 127.59H80.1366C78.6744 127.59 77.2122 126.365 77.2122 124.652C77.2122 123.183 78.4307 121.714 80.1366 121.714H98.1709C99.6331 121.714 101.095 122.938 101.095 124.652C100.852 126.365 99.6331 127.59 98.1709 127.59Z" fill="#4260FF"/>
<path id="Vector_19" d="M127.416 149.623H94.0282C92.566 149.623 91.1038 148.399 91.1038 146.685C91.1038 145.216 92.3223 143.747 94.0282 143.747H127.172C128.634 143.747 130.097 144.971 130.097 146.685C130.097 148.399 128.878 149.623 127.416 149.623Z" fill="#4260FF"/>
<path id="Vector_20" d="M127.416 127.59H109.382C107.92 127.59 106.457 126.365 106.457 124.652C106.457 123.183 107.676 121.714 109.382 121.714H127.416C128.878 121.714 130.34 122.938 130.34 124.652C130.097 126.365 128.878 127.59 127.416 127.59Z" fill="#4260FF"/>
</g>
<path id="Vector_21" d="M37.7322 154.764C42.0392 154.764 45.5308 151.257 45.5308 146.93C45.5308 142.603 42.0392 139.096 37.7322 139.096C33.4251 139.096 29.9336 142.603 29.9336 146.93C29.9336 151.257 33.4251 154.764 37.7322 154.764Z" fill="#4260FF"/>
<path id="Vector_22" d="M27.2527 154.764C31.5597 154.764 35.0513 151.257 35.0513 146.93C35.0513 142.603 31.5597 139.096 27.2527 139.096C22.9456 139.096 19.4541 142.603 19.4541 146.93C19.4541 151.257 22.9456 154.764 27.2527 154.764Z" fill="#B3C6FF"/>
<path id="Vector_23" d="M140.332 92.8242H8V109.472H140.332V92.8242Z" fill="#4260FF"/>
</g>
<rect x="-133.5" y="-441.5" width="485" height="770" rx="3.5" stroke="#E5E7EB"/>
</g>
</g>
</g>
</g>
</g>
</g>
<defs>
<filter id="filter0_dd_508_4188" x="-1171" y="-597" width="1944" height="1040" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feMorphology radius="4" operator="erode" in="SourceAlpha" result="effect1_dropShadow_508_4188"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="3"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_508_4188"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feMorphology radius="3" operator="erode" in="SourceAlpha" result="effect2_dropShadow_508_4188"/>
<feOffset dy="10"/>
<feGaussianBlur stdDeviation="7.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="effect1_dropShadow_508_4188" result="effect2_dropShadow_508_4188"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_508_4188" result="shape"/>
</filter>
<filter id="filter1_dd_508_4188" x="-779" y="-520" width="1159.05" height="887" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feMorphology radius="4" operator="erode" in="SourceAlpha" result="effect1_dropShadow_508_4188"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="3"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_508_4188"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feMorphology radius="3" operator="erode" in="SourceAlpha" result="effect2_dropShadow_508_4188"/>
<feOffset dy="10"/>
<feGaussianBlur stdDeviation="7.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="effect1_dropShadow_508_4188" result="effect2_dropShadow_508_4188"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_508_4188" result="shape"/>
</filter>
<filter id="filter2_d_508_4188" x="62.2798" y="0.911133" width="201.434" height="257.239" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="11"/>
<feGaussianBlur stdDeviation="11"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.397708 0 0 0 0 0.47749 0 0 0 0 0.575 0 0 0 0.18 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_508_4188"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_508_4188" result="shape"/>
</filter>
<filter id="filter3_d_508_4188" x="0" y="75.3809" width="148.332" height="102.667" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="5"/>
<feGaussianBlur stdDeviation="4"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.1125 0 0 0 0 0.295916 0 0 0 0 1 0 0 0 0.22 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_508_4188"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_508_4188" result="shape"/>
</filter>
<linearGradient id="paint0_linear_508_4188" x1="16.5729" y1="218.813" x2="25.1056" y2="218.813" gradientUnits="userSpaceOnUse">
<stop stop-color="#FF66A9"/>
<stop offset="1" stop-color="#F53689"/>
</linearGradient>
<linearGradient id="paint1_linear_508_4188" x1="52.6756" y1="31.4532" x2="60.7064" y2="31.4532" gradientUnits="userSpaceOnUse">
<stop stop-color="#FF66A9"/>
<stop offset="1" stop-color="#F53689"/>
</linearGradient>
<linearGradient id="paint2_linear_508_4188" x1="41.3173" y1="90.7679" x2="114.71" y2="159.233" gradientUnits="userSpaceOnUse">
<stop stop-color="#83A6FF"/>
<stop offset="1" stop-color="#5A78FF"/>
</linearGradient>
<clipPath id="clip0_508_4188">
<rect width="1920" height="1080" fill="white" transform="translate(-1159 -659)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,152 @@
<template>
<div>
<div class="mx-3 relative">
<div class="absolute z-10 w-full">
<div class="flex justify-between items-center bg-gray-50 rounded p-3 w-full">
<span class="text-base font-bold">اقلام سفارش</span>
<Button type="primary" size="small" v-if="edit" @click="updateOrders"
>ثبت اطلاعات
</Button>
<span v-else>
<BaseIcon
icon="vuesax-linear:edit-2"
class="cursor-pointer"
size="21"
@click="emit('update:edit', true)"
/>
</span>
</div>
<div class="border-t border-t-solid border-t-gray-200 border-1 mt-4"></div>
</div>
<div class="h-18"></div>
</div>
<div>
<div
class="grid grid-cols-1 md:grid-cols-4 border border-solid border-gray-200 p-6 rounded-lg mb-4 mt-4"
v-for="(item, index) in _withdraw?.items"
>
<div class="col-span-1 w-25 mb-5 md:mb-0">
<img
v-if="item.product?.original_image?.src"
class="w-25 h-25 object-contain"
:src="item.product?.original_image?.src"
:alt="item?.product?.title_fa"
/>
<img :src="Logo" class="w-25 h-25 object-contain" :alt="item?.product?.title_fa" v-else />
</div>
<div class="col-span-3 mr-3 text-sm">
<div class="mb-6">
<span class="text-gray-400 font-normal">نام محصول:</span>
<span class="font-bold text-gray-800 mr-2">{{ item?.product?.title_fa }}</span>
</div>
<div class="mb-6">
<span class="text-gray-400 font-normal">قیمت:</span>
<span v-if="item?.price === null || undefined" class="font-bold text-gray-800 mr-2"
>0</span
>
<span class="font-bold text-gray-800 mr-2">{{ usePrice(item?.price, true, '') }}</span>
<span class="mr-1 text-xs">تومان</span>
</div>
<div class="flex justify-between mb-6">
<div>
<span class="text-gray-400 font-normal">جمع قیمت اقلام:</span>
<span class="font-bold text-gray-800 mr-2">{{
usePrice(item.price * item.qty, true, '')
}}</span>
<span class="mr-1 text-xs">تومان</span>
</div>
<div>
<span class="text-gray-400 font-normal">تعداد:</span>
<BasicInput
place-holder="تعداد"
v-if="props.edit === true"
type="number"
v-model:value="(_withdraw as Withdraw).items[index].qty"
/>
<span v-else class="font-bold text-gray-800 mr-2">{{ item?.qty }} عدد</span>
</div>
</div>
<div class="flex justify-between mb-6">
<div>
<span class="text-gray-400 font-normal">کد محصول:</span>
<span class="font-bold text-gray-800 mr-2">{{ item?.product.code }}</span>
</div>
<div>
<span class="text-gray-400 font-normal">رنگ:</span>
<span class="font-bold text-gray-800 mr-2">{{
item?.product?.color ? item?.product?.color : '---'
}}</span>
</div>
</div>
<!-- <div>-->
<!-- <div class="mb-2">توضیحات:</div>-->
<!-- <div>-->
<!-- {{ item?.product?.body }}-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import BaseIcon from '@core/components/BaseIcon'
import Button from '@core/components/BaseButton/src/button.vue'
import Logo from '@/assets/img/saminLogo_.png'
import { ref } from 'vue'
import type { Withdraw } from '@/model/wallet'
import { cloneDeep } from 'lodash'
// import { updateOrder, getOrderById } from '@/api/orders'
import { message } from 'ant-design-vue'
import { usePrice } from '@core/utils/usePrice'
const _withdraw = ref<Withdraw | null>(null)
interface Props {
edit: boolean
order: Withdraw
loading: boolean
}
const props = withDefaults(defineProps<Props>(), {
edit: false,
loading: false
})
const emit = defineEmits<{
(e: 'update:edit', value: boolean): void
(e: 'update:loading', value: boolean): void
(e: 'update'): void
}>()
watch(
() => props.order,
() => {
// console.log('watch')
// console.log(props.order, 'fhkldakfdghajkg')
_withdraw.value = cloneDeep(props.order)
},
{ immediate: true }
)
const updateOrders = async () => {
try {
emit('update:loading', true)
let id = _withdraw.value?.id
await updateOrder(id as number, _withdraw.value as Withdraw)
message.success('سفارش به روز شد.')
// _order.value = await getOrderById(id as number)
emit('update')
} catch (e) {
message.error('خطا در ثبت اطلاعات')
console.log(e)
} finally {
emit('update:loading', false)
emit('update:edit', false)
}
}
</script>
<style scoped></style>
@@ -0,0 +1,46 @@
import { message } from 'ant-design-vue'
import { updateSts } from '@/api/wallet'
export const status = {
'50': {
icon: 'vuesax-linear:truck-tick',
color: '#16A34A',
bgColor: '#DCFCE7',
title: 'در انتظار ارسال'
},
'51': {
icon: 'vuesax-linear:profile-tick',
color: '#2563EB',
bgColor: '#DBEAFE',
title: 'ارسال شده'
},
'52': {
icon: 'vuesax-linear:empty-wallet-time',
color: '#EA580C',
bgColor: '#FFEDD5',
title: 'لغو شده'
},
'53': {
icon: 'vuesax-linear:3d-cube-scan',
color: '#c62050',
bgColor: '#FFEDD5',
title: 'در انتظار تعیین مجدد قیمت'
},
}
export const changeStatus = async (id: number, status: any) => {
try {
await updateSts(id, { sts: status[0] })
message.success(`وضعیت ثبت شد `)
} catch (e) {
console.log(e)
message.error('خطا در ثبت اطلاعات')
}
}
const statusArray = Object.entries(status).map(([key, value]) => {
return {
key: key,
value: value.title
}
})
@@ -0,0 +1,225 @@
<template>
<BasicModal
:visible="props.visible"
width="70rem"
height="90rem"
title="جزئیات سفارش"
:custom-footer="true"
@close="handleCancel"
:destroyOnClose="true"
>
<ASpin tip="در حال دریافت اطلاعات..." :indicator="indicator" :spinning="loading">
<div class="grid grid-cols-1 md:grid-cols-5 md:gap-3 relative p-2" :class="[prefixCls]">
<div class="col-span-2 border border-solid border-gray-200 rounded-lg mb-2">
<div class="flex justify-between m-3">
<WithdrawStatus :sts="orderInfo?.sts" :more="true" @change-sts="changeSts" />
<Button
type="primary"
size="small"
@click="$router.push({ name: 'factor', params: { id: orderInfo?.id } })"
>
<span class="text-xs"> دریافت فاکتور </span>
<BaseIcon icon="vuesax-linear:document-download" size="18" />
</Button>
</div>
<div class="mx-3">
<ADivider class="divider" />
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mx-3">
<div class="col-span-1 grid justify-start gap-4">
<div>
<span class="text-gray-400 font-normal text-sm">شماره سفارش:</span>
<span class="text-gray-800 font-bold text-sm mr-2">{{ orderInfo?.id }}</span>
</div>
<div>
<span class="text-gray-400 font-normal text-sm">مبلغ سفارش:</span>
<span class="text-gray-800 font-bold text-sm mr-2">
{{ usePrice(orderInfo?.total_price, true, '') }}
</span>
<span class="text-gray-800 font-normal text-xs"> تومان</span>
</div>
</div>
<div class="col-span-1 grid justify-start gap-4">
<div>
<span class="text-gray-400 font-normal text-sm">تاریخ سفارش:</span>
<span class="text-gray-600 font-bold text-sm mr-2">{{ orderInfo?.caj }}</span>
</div>
<div>
<span class="text-gray-400 font-normal text-sm"> تعداد آیتم:</span>
<span class="text-gray-800 font-bold text-sm mr-2">
{{ orderInfo?.items?.length }}
</span>
<span class="text-gray-800 font-normal text-xs"> عدد</span>
</div>
</div>
</div>
<div class="mx-3">
<ADivider class="divider" />
</div>
<div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mx-3">
<div class="grid-cols-1 grid justify-start gap-4">
<div>
<span class="text-gray-400 font-normal text-sm"> تحویل گیرنده:</span>
<span class="text-gray-600 font-bold text-sm mr-2">
{{ orderInfo?.customer?.name }}
</span>
</div>
<div>
<span class="text-gray-400 font-normal text-sm"> شماره همراه:</span>
<span class="text-gray-600 font-bold text-sm mr-2">
{{ orderInfo?.customer?.mobile }}
</span>
</div>
</div>
<div class="col-span-1 grid justify-start gap-4">
<!-- <div>-->
<!-- <span class="text-gray-400 font-normal text-sm"> نام فروشگاه:</span>-->
<!-- <span class="text-gray-600 font-bold text-sm mr-2">-->
<!-- {{ orderInfo?.customer?.shop_name }}</span-->
<!-- >-->
<!-- </div>-->
<div>
<span class="text-gray-400 font-normal text-sm"> تلفن ثابت:</span>
<span class="text-gray-600 font-bold text-sm mr-2">
{{ orderInfo?.customer?.phone_number }}
</span>
</div>
</div>
</div>
<div class="mx-3">
<ADivider class="divider" />
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mx-3">
<div>
<span class="text-sm font-normal text-gray-400">استان:</span>
<span class="text-sm font-bold text-gray-600 mr-2">
{{ orderInfo?.customer?.province }}
</span>
</div>
<div>
<span class="text-sm font-normal text-gray-400">شهر:</span>
<span class="text-sm font-bold text-gray-600 mr-2">{{
orderInfo?.customer?.city
}}</span>
</div>
</div>
<div class="mx-3 my-4">
<span class="text-sm font-normal text-gray-400">کد پستی:</span>
<span class="text-sm font-bold text-gray-600 mr-2">{{
orderInfo?.address?.zip
}}</span>
</div>
<div class="mr-3">
<span class="text-sm font-normal text-gray-400">آدرس:</span>
<span class="text-sm font-bold text-gray-600 mr-2">{{
orderInfo?.address?.address
}}</span>
</div>
<div class="flex justify-center mt-3">
<img :src="detail" width="150" height="150" alt="" />
</div>
</div>
</div>
<WithdrawItems
class="col-span-3"
:order="orderInfo as Orders"
v-model:edit="edit"
v-model:loading="loading"
@update="updateTable"
/>
</div>
</ASpin>
</BasicModal>
</template>
<script setup lang="ts">
import { usePrefix } from '@core/composable/usePrefix'
import { ref } from 'vue'
import detail from './assets/order1.svg'
import type { Withdraw } from '@/model/wallet'
import WithdrawStatus from '@/pages/menuPages/withdraw/components/WithdrawStatus.vue'
import WithdrawItems from '@/pages/menuPages/withdraw/information/components/WithdrawItems.vue'
import Button from '@core/components/BaseButton/src/button.vue'
import { changeStatus } from '@/pages/menuPages/withdraw/information/hooks/status'
import { LoadingOutlined } from '@ant-design/icons-vue'
import { cloneDeep } from 'lodash'
import { getWithdrawById } from '@/api/wallet'
import { usePrice } from '@core/utils/usePrice'
const indicator = h(LoadingOutlined, {
style: {
fontSize: '24px'
},
spin: true
})
interface Props {
visible?: boolean
order?: Withdraw
}
const edit = ref<boolean>(false)
const loading = ref<boolean>(false)
const orderInfo = ref<Withdraw | null>(null)
const { prefixCls } = usePrefix('informationIndex')
const props = withDefaults(defineProps<Props>(), {
visible: false
})
watch(
() => props.order,
() => {
// console.log('watch')
orderInfo.value = cloneDeep(props.order)
},
{ immediate: true }
)
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void
(e: 'update'): void
}>()
const handleCancel = () => {
emit('update:visible', false)
edit.value = false
}
const changeSts = async (status: any) => {
try {
let orderId = props.order?.id
loading.value = true
await changeStatus(orderId as number, status)
orderInfo.value = await getWithdrawById(orderId as number)
updateTable()
} catch (e: any) {
console.log(e)
} finally {
loading.value = false
}
}
const updateTable = () => {
emit('update')
}
</script>
<style scoped lang="less">
@prefix: ~'@{prefixCls}-AppHeader';
.@{prefix} {
}
.classOne {
color: #9ca3af;
font-weight: 400;
font-size: 14px;
}
.divider {
margin-top: 16px;
margin-bottom: 16px;
}
</style>