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,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>