rc1-changed deposit search
This commit is contained in:
parent
5724d30ce0
commit
930f51ee69
@ -55,7 +55,7 @@
|
||||
</li>
|
||||
<li><a href="/admin/disputes">Споры</a></li>
|
||||
<li><a href="/admin/payouts">Выплаты</a></li>
|
||||
<li><a href="/admin/orders">Заявки</a></li>
|
||||
<li><a href="/admin/orders">Депозиты</a></li>
|
||||
{#if jwtDecode(getAuthInfo()?.a)?.role == "4"}
|
||||
<li><a href="/admin/merchants">Мерчанты</a></li>
|
||||
<li><a href="/admin/currencies">Валюты</a></li>
|
||||
@ -156,7 +156,7 @@
|
||||
on:click={() => {
|
||||
showMenu = false;
|
||||
}}
|
||||
href="/admin/orders">Заявки</a
|
||||
href="/admin/orders">Депозиты</a
|
||||
>
|
||||
<div class="absolute right-0 top-[2px] pointer-events-none">
|
||||
<ChevronRightIcon />
|
||||
|
||||
@ -26,28 +26,28 @@
|
||||
|
||||
let showFoundedOrderWindow = false;
|
||||
let showLoadingFind = false;
|
||||
let foundedDispute;
|
||||
let foundedDisputes = [];
|
||||
let selectedDispute;
|
||||
|
||||
let currentDepositSearchPage = 1;
|
||||
let maxDepositSearchPages = 1;
|
||||
|
||||
let external_uuidValue = "";
|
||||
let uuidValue = "";
|
||||
let external_user_idValue = "";
|
||||
let searchValue = "";
|
||||
|
||||
async function findDispute() {
|
||||
if (searchValue.length < 5 || showLoadingFind) return;
|
||||
|
||||
showLoadingFind = true;
|
||||
let sData = {};
|
||||
if (external_uuidValue !== "") {
|
||||
sData["external_uuid"] = external_uuidValue;
|
||||
} else if (uuidValue !== "") {
|
||||
sData["uuid"] = uuidValue;
|
||||
} else if (external_user_idValue !== "") {
|
||||
sData["external_user_id"] = external_user_idValue;
|
||||
} else {
|
||||
showLoadingFind = false;
|
||||
return;
|
||||
}
|
||||
let sData = {
|
||||
searchData: searchValue.trim(),
|
||||
page: currentDepositSearchPage,
|
||||
};
|
||||
|
||||
const res = await makePost(
|
||||
"admin/findOrder",
|
||||
"admin/deposit/search",
|
||||
sData,
|
||||
makeAuthHeaderForAxios(getAuthInfo()?.a)
|
||||
);
|
||||
@ -57,9 +57,12 @@
|
||||
showLoadingFind = false;
|
||||
return;
|
||||
}
|
||||
foundedDispute = res.data;
|
||||
console.log(foundedDispute);
|
||||
showFoundedOrderWindow = true;
|
||||
console.log(res.data);
|
||||
|
||||
foundedDisputes = res.data.data;
|
||||
maxDepositSearchPages = Number(res.data.pages);
|
||||
console.log(foundedDisputes);
|
||||
// showFoundedOrderWindow = true;
|
||||
showLoadingFind = false;
|
||||
}
|
||||
|
||||
@ -70,7 +73,7 @@
|
||||
"admin/rollbackOrder",
|
||||
{
|
||||
id: uuid,
|
||||
summa: foundedDispute["summa"],
|
||||
summa: selectedDispute["summa"],
|
||||
},
|
||||
makeAuthHeaderForAxios(getAuthInfo()?.a)
|
||||
);
|
||||
@ -192,13 +195,13 @@
|
||||
let img64 = "";
|
||||
let qrCode = false;
|
||||
|
||||
$: if (foundedDispute && foundedDispute["cardnumber"].length > 16) {
|
||||
$: if (selectedDispute && selectedDispute["cardnumber"].length > 16) {
|
||||
qrCode = true;
|
||||
QRCode.toDataURL(foundedDispute["cardnumber"], { type: "image/jpeg" }).then(
|
||||
(url) => {
|
||||
img64 = url;
|
||||
}
|
||||
);
|
||||
QRCode.toDataURL(selectedDispute["cardnumber"], {
|
||||
type: "image/jpeg",
|
||||
}).then((url) => {
|
||||
img64 = url;
|
||||
});
|
||||
} else {
|
||||
qrCode = false;
|
||||
}
|
||||
@ -207,28 +210,20 @@
|
||||
<div class="w-full flex flex-col gap-8">
|
||||
<div class="flex gap-4">
|
||||
<div class="bg-accent rounded-[4px] w-[10px] h-full"></div>
|
||||
<h1 class="text-2xl font-semibold">Поиск по заявкам</h1>
|
||||
<h1 class="text-2xl font-semibold">Поиск по депозитам</h1>
|
||||
</div>
|
||||
<div class="w-full flex flex-col p-4 rounded-box bg-base-300">
|
||||
<p class="text-sm mt-2">external_uuid</p>
|
||||
<input
|
||||
bind:value={external_uuidValue}
|
||||
type="text"
|
||||
class="input input-bordered"
|
||||
/>
|
||||
|
||||
<p class="text-sm mt-2">uuid</p>
|
||||
<input bind:value={uuidValue} type="text" class="input input-bordered" />
|
||||
|
||||
<p class="text-sm mt-2">external_user_id</p>
|
||||
<input
|
||||
bind:value={external_user_idValue}
|
||||
bind:value={searchValue}
|
||||
placeholder="UUID, External UUID или External User ID"
|
||||
type="text"
|
||||
class="input input-bordered"
|
||||
/>
|
||||
|
||||
<button
|
||||
on:click={() => {
|
||||
maxDepositSearchPages = 1;
|
||||
currentDepositSearchPage = 1;
|
||||
findDispute();
|
||||
}}
|
||||
class="btn btn-outline mt-2"
|
||||
@ -236,10 +231,85 @@
|
||||
{#if showLoadingFind}
|
||||
<span class="loading loading-dots loading-xs"></span>
|
||||
{:else}
|
||||
{"Найти заявку"}
|
||||
{"Найти депозиты"}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
<div class="w-full flex flex-col p-4 rounded-box bg-base-300">
|
||||
<div class="flex w-full justify-center items-center">
|
||||
<button
|
||||
class="btn"
|
||||
on:click={() => {
|
||||
if (currentDepositSearchPage <= 1) return;
|
||||
currentDepositSearchPage -= 1;
|
||||
findDispute();
|
||||
}}
|
||||
>
|
||||
<
|
||||
</button>
|
||||
<div class="btn cursor-default hover:cursor-default">
|
||||
{"Страница"}
|
||||
{currentDepositSearchPage}
|
||||
</div>
|
||||
<button
|
||||
class="btn"
|
||||
on:click={() => {
|
||||
if (currentDepositSearchPage >= maxDepositSearchPages) return;
|
||||
currentDepositSearchPage += 1;
|
||||
findDispute();
|
||||
}}
|
||||
>
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
<p class="opacity-50 text-sm self-center mt-1">
|
||||
{"Всего страниц:"}
|
||||
{maxDepositSearchPages}
|
||||
</p>
|
||||
{#if showLoadingFind}
|
||||
<span class="loading loading-lg self-center mt-4"></span>
|
||||
{:else}
|
||||
<table class="w-full mt-4">
|
||||
<thead>
|
||||
<th></th>
|
||||
<th class="text-left px-2">{"Статус"}</th>
|
||||
<th class="text-left px-2">{"Сумма"}</th>
|
||||
<th class="text-left px-2">{"Банк"}</th>
|
||||
<th class="text-left px-2">{"Время создания"}</th>
|
||||
<th class="text-left px-2">{"Трейдер"}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each foundedDisputes as dep}
|
||||
<tr class="border-b-2 border-b-base-200">
|
||||
<td
|
||||
><button
|
||||
class="btn btn-info"
|
||||
on:click={() => {
|
||||
selectedDispute = dep;
|
||||
console.log(selectedDispute, "11231");
|
||||
|
||||
showFoundedOrderWindow = true;
|
||||
}}
|
||||
>
|
||||
<div
|
||||
class="bg-info border-2 outline-white rounded-full w-5 h-5 flex-shrink-0 flex justify-center items-center text-white"
|
||||
>
|
||||
i
|
||||
</div>
|
||||
</button></td
|
||||
>
|
||||
<td class="px-2 py-2">{orderStatusMap[dep["status"]]}</td>
|
||||
<td class="px-2">{Number(dep["summa"])} {dep["currency_code"]}</td
|
||||
>
|
||||
<td class="px-2">{dep["bank_name"]}</td>
|
||||
<td class="px-2">{dep["creationtime"]}</td>
|
||||
<td class="px-2">{dep["trader_name"]} {dep["surname"]}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if showFoundedOrderWindow}
|
||||
@ -250,49 +320,49 @@
|
||||
class="flex flex-col p-4 bg-base-100 rounded-md overflow-y-auto max-h-[90%]"
|
||||
>
|
||||
<p class="text-sm">UUID</p>
|
||||
<p class="font-semibold">{foundedDispute["uuid"]}</p>
|
||||
<p class="font-semibold">{selectedDispute["uuid"]}</p>
|
||||
<!-- <p class="text-sm mt-3">ID заявки</p>
|
||||
<p class="font-semibold">{foundedDispute["id"]}</p> -->
|
||||
<p class="text-sm mt-3">ID клиента</p>
|
||||
<p class="font-semibold">{foundedDispute["external_user_id"]}</p>
|
||||
<p class="font-semibold">{selectedDispute["external_user_id"]}</p>
|
||||
<p class="text-sm mt-3">External ID</p>
|
||||
<p class="font-semibold">{foundedDispute["external_uuid"]}</p>
|
||||
<p class="font-semibold">{selectedDispute["external_uuid"]}</p>
|
||||
<p class="text-sm mt-3">Статус</p>
|
||||
<p class="">{orderStatusMap[foundedDispute["status"]]}</p>
|
||||
{#if foundedDispute["token"] !== ""}
|
||||
<p class="">{orderStatusMap[selectedDispute["status"]]}</p>
|
||||
{#if selectedDispute["token"] !== ""}
|
||||
<p class="text-sm mt-3">Токен трейдера</p>
|
||||
<p>{foundedDispute["token"]}</p>
|
||||
<p>{selectedDispute["token"]}</p>
|
||||
{/if}
|
||||
{#if foundedDispute["trader_name"] !== ""}
|
||||
{#if selectedDispute["trader_name"] !== ""}
|
||||
<p class="text-sm mt-3">Трейдер</p>
|
||||
<p>{foundedDispute["trader_name"]} {foundedDispute["surname"]}</p>
|
||||
<p>{selectedDispute["trader_name"]} {selectedDispute["surname"]}</p>
|
||||
{/if}
|
||||
{#if foundedDispute["close_reason"] !== ""}
|
||||
{#if selectedDispute["close_reason"] !== ""}
|
||||
<p class="text-sm mt-3">Причина отклонения</p>
|
||||
<p>{foundedDispute["close_reason"]}</p>
|
||||
<p>{selectedDispute["close_reason"]}</p>
|
||||
{/if}
|
||||
<p class="text-sm mt-3">Сумма</p>
|
||||
<p>
|
||||
{toValidNumberFormat(foundedDispute["summa"])}
|
||||
{foundedDispute["currency_code"]}
|
||||
{toValidNumberFormat(selectedDispute["summa"])}
|
||||
{selectedDispute["currency_code"]}
|
||||
<!-- ({(
|
||||
Number(foundedDispute["summa"]) / Number(foundedDispute["rate"])
|
||||
).toFixed(2)} USDT) -->
|
||||
</p>
|
||||
<!-- <p class="text-sm mt-3">Курс</p>
|
||||
<p>{foundedDispute["rate"]} {foundedDispute["currency_code"]}</p> -->
|
||||
{#if foundedDispute["bank_name"] !== ""}
|
||||
{#if selectedDispute["bank_name"] !== ""}
|
||||
<p class="text-sm mt-3">Банк</p>
|
||||
<p>{foundedDispute["bank_name"]}</p>
|
||||
<p>{selectedDispute["bank_name"]}</p>
|
||||
{/if}
|
||||
{#if foundedDispute["name"] !== ""}
|
||||
{#if selectedDispute["name"] !== ""}
|
||||
<p class="text-sm mt-3">Владелец</p>
|
||||
<p>{foundedDispute["name"]}</p>
|
||||
<p>{selectedDispute["name"]}</p>
|
||||
{/if}
|
||||
{#if foundedDispute["cardnumber"] !== ""}
|
||||
{#if foundedDispute["cardnumber"].length <= 16}
|
||||
{#if selectedDispute["cardnumber"] !== ""}
|
||||
{#if selectedDispute["cardnumber"].length <= 16}
|
||||
<p class="text-sm mt-3">Карта</p>
|
||||
<p>{foundedDispute["cardnumber"]}</p>
|
||||
<p>{selectedDispute["cardnumber"]}</p>
|
||||
{:else}
|
||||
<p class="text-sm mt-3">QR</p>
|
||||
<img
|
||||
@ -303,20 +373,20 @@
|
||||
/>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if foundedDispute["phone"] !== ""}
|
||||
{#if selectedDispute["phone"] !== ""}
|
||||
<p class="text-sm mt-3">Телефон</p>
|
||||
<p>{foundedDispute["phone"]}</p>
|
||||
<p>{selectedDispute["phone"]}</p>
|
||||
{/if}
|
||||
<p class="text-sm mt-3">Время создания</p>
|
||||
<p>{foundedDispute["creationtime"]}</p>
|
||||
{#if foundedDispute["closetime"] && foundedDispute["closetime"] !== ""}
|
||||
<p>{selectedDispute["creationtime"]}</p>
|
||||
{#if selectedDispute["closetime"] && selectedDispute["closetime"] !== ""}
|
||||
<p class="text-sm mt-3">Время закрытия</p>
|
||||
<p>{foundedDispute["closetime"]}</p>
|
||||
<p>{selectedDispute["closetime"]}</p>
|
||||
{/if}
|
||||
<!-- <p>{foundedDispute["closetime"]}</p> -->
|
||||
<button
|
||||
on:click={() => {
|
||||
rollbackOrder(foundedDispute["uuid"]);
|
||||
rollbackOrder(selectedDispute["uuid"]);
|
||||
}}
|
||||
class="btn btn-outline btn-info mt-4"
|
||||
>
|
||||
@ -334,7 +404,7 @@
|
||||
>
|
||||
<button
|
||||
on:click={() => {
|
||||
sendCallbackToServer(foundedDispute["uuid"]);
|
||||
sendCallbackToServer(selectedDispute["uuid"]);
|
||||
}}
|
||||
class="btn btn-warning btn-outline mt-1"
|
||||
>
|
||||
@ -377,7 +447,7 @@
|
||||
class="fixed inset-0 z-[1001] bg-black bg-opacity-50 flex justify-center items-center"
|
||||
>
|
||||
<div class="flex flex-col p-4 bg-base-100 rounded-md gap-1">
|
||||
<p>Укажите новую сумму ({foundedDispute["currency_code"]})</p>
|
||||
<p>Укажите новую сумму ({selectedDispute["currency_code"]})</p>
|
||||
<input
|
||||
bind:value={newSum}
|
||||
type="number"
|
||||
@ -385,7 +455,7 @@
|
||||
/>
|
||||
<button
|
||||
on:click={() => {
|
||||
changeSum(foundedDispute["uuid"]);
|
||||
changeSum(selectedDispute["uuid"]);
|
||||
}}
|
||||
class="btn btn-outline btn-info"
|
||||
>
|
||||
@ -397,7 +467,7 @@
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
changeSumWithoutBalance(foundedDispute["uuid"]);
|
||||
changeSumWithoutBalance(selectedDispute["uuid"]);
|
||||
}}
|
||||
class="btn btn-outline btn-info"
|
||||
>
|
||||
@ -430,7 +500,7 @@
|
||||
/>
|
||||
<button
|
||||
on:click={() => {
|
||||
changeToken(foundedDispute["uuid"], newTokenValue);
|
||||
changeToken(selectedDispute["uuid"], newTokenValue);
|
||||
}}
|
||||
class="btn btn-outline btn-info"
|
||||
>
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
disablePagesPayouts = false;
|
||||
} else {
|
||||
let s = searchFilter.trim();
|
||||
let useUUID = s.includes("-") && s.length === 36;
|
||||
let useUUID = true;
|
||||
if (useUUID) {
|
||||
const result = await makePost(
|
||||
"admin/payout/search",
|
||||
@ -106,36 +106,6 @@
|
||||
numOfPagesPayouts = 1;
|
||||
disablePagesPayouts = false;
|
||||
}
|
||||
} else if ((s.length === 16 || s.length === 22) && /^\d+$/.test(s)) {
|
||||
const result = await makePost(
|
||||
"admin/payout/search",
|
||||
{
|
||||
page: currentPagePayouts,
|
||||
requisite: s,
|
||||
},
|
||||
// @ts-ignore
|
||||
makeAuthHeaderForAxios(getAuthInfo()?.a)
|
||||
);
|
||||
console.log(result);
|
||||
if (result.error) {
|
||||
payouts = [];
|
||||
numOfPagesPayouts = 1;
|
||||
disablePagesPayouts = false;
|
||||
sayError("Ошибка поиска");
|
||||
return;
|
||||
}
|
||||
if (typeof result.data !== "string") {
|
||||
payouts = result.data.data;
|
||||
numOfPagesPayouts = result.data.pages === 0 ? 1 : result.data?.pages;
|
||||
disablePagesPayouts = false;
|
||||
} else {
|
||||
payouts = [];
|
||||
numOfPagesPayouts = 1;
|
||||
disablePagesPayouts = false;
|
||||
}
|
||||
} else {
|
||||
sayError("Проверьте данные для поиска");
|
||||
disablePagesPayouts = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -526,7 +496,7 @@
|
||||
bind:value={searchFilter}
|
||||
type="text"
|
||||
class="input input-bordered max-w-full w-full rounded-[10px]"
|
||||
placeholder="UUID или Реквизит"
|
||||
placeholder="UUID, External ID или Реквизит"
|
||||
/>
|
||||
<div class="flex gap-[5px]">
|
||||
<button
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user