|
@@ -1,23 +1,33 @@
|
|
|
<template>
|
|
|
- <div class="lj-toast-hisprice flx-col w-full">
|
|
|
+ <div class="lj-toast-hisprice flx-col">
|
|
|
<header class="flx">
|
|
|
<span class="flx-1 text-h5-b">{{ t("business.detail.historyPrice") }}</span>
|
|
|
<el-button v-if="!hideClose" circle text :icon="Refresh" @click="refresh(id, typeid, true)"></el-button>
|
|
|
<el-button v-if="!hideClose" circle text :icon="CloseBold" @click="emit('close-toast')"></el-button>
|
|
|
</header>
|
|
|
<main class="w-full lj-toast-hisprice__main" :class="{ 'is-empty': !data.length }">
|
|
|
- <div class="lj-toast-hisprice__main-content" v-if="data.length">
|
|
|
- <HisItem
|
|
|
- :data-ref="'item' + index"
|
|
|
- v-for="(itm, index) in data"
|
|
|
- :t="t"
|
|
|
- :item="itm"
|
|
|
- :index="index"
|
|
|
- :key="index"
|
|
|
- @click="emit('todetail', itm)"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <el-empty v-else :description="t('sys.empty.nodate')" />
|
|
|
+ <el-skeleton animated :loading="loading">
|
|
|
+ <template #template>
|
|
|
+ <el-skeleton-item variant="text" style="height: 22px; width: 128px" />
|
|
|
+ <div class="flx-justify-between ml-24">
|
|
|
+ <div class="flx-col flx-center" v-for="itm in 4" :key="itm">
|
|
|
+ <el-skeleton-item variant="text" class="mt-4" style="height: 20px; width: 64px" />
|
|
|
+ <el-skeleton-item variant="text" class="mt-4" style="height: 24px; width: 90px" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="lj-toast-hisprice__main-content">
|
|
|
+ <HisItem
|
|
|
+ :data-ref="'item' + index"
|
|
|
+ v-for="(itm, index) in data"
|
|
|
+ :item="itm"
|
|
|
+ :index="index"
|
|
|
+ :key="index"
|
|
|
+ @click="emit('todetail', itm)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-skeleton>
|
|
|
+ <!-- <el-empty v-else :description="t('sys.empty.nodate')" /> -->
|
|
|
</main>
|
|
|
<footer></footer>
|
|
|
</div>
|
|
@@ -31,13 +41,10 @@ import { useUserStore } from "@/stores/modules/user";
|
|
|
import HisItem from "./components/Item.vue";
|
|
|
import { CloseBold, Refresh } from "@element-plus/icons-vue";
|
|
|
import { ElButton, ElMessage } from "element-plus";
|
|
|
+import { t } from "@/utils/i18n";
|
|
|
|
|
|
// 接收父组件参数并设置默认值
|
|
|
interface WidgetProps {
|
|
|
- /**
|
|
|
- * @description i18n
|
|
|
- */
|
|
|
- t: any;
|
|
|
/**
|
|
|
* @description 单据id
|
|
|
*/
|
|
@@ -67,7 +74,10 @@ const data = ref<any>([]);
|
|
|
const { userInfo } = useUserStore();
|
|
|
// const { prefixCls } = useDesign("toast-oa-flow");
|
|
|
|
|
|
-const refresh = async (id: number, typeid: number, tips?: boolean) => {
|
|
|
+const loading = ref(false);
|
|
|
+
|
|
|
+const refresh = (id: number, typeid: number, tips?: boolean) => {
|
|
|
+ loading.value = true;
|
|
|
let _params = {
|
|
|
dsname: "web_his_price",
|
|
|
queryparams: {
|
|
@@ -75,13 +85,19 @@ const refresh = async (id: number, typeid: number, tips?: boolean) => {
|
|
|
arg_typeid: typeid
|
|
|
}
|
|
|
};
|
|
|
- let res = await CommonDynamicSelect(_params);
|
|
|
- console.log("watch res :>> ", res);
|
|
|
- data.value = res?.datatable?.length ? res?.datatable : [];
|
|
|
+ CommonDynamicSelect(_params)
|
|
|
+ .then(res => {
|
|
|
+ console.log("watch res :>> ", res);
|
|
|
+ data.value = res?.datatable?.length ? res?.datatable : [];
|
|
|
+ loading.value = false;
|
|
|
|
|
|
- if (tips) {
|
|
|
- ElMessage.success(props.t("sys.api.sueccessToRefresh"));
|
|
|
- }
|
|
|
+ if (tips) {
|
|
|
+ ElMessage.success(t("sys.api.sueccessToRefresh"));
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
watch(
|
|
@@ -105,7 +121,7 @@ watch(
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.lj-toast-hisprice {
|
|
|
- width: 240px;
|
|
|
+ width: 480px;
|
|
|
|
|
|
:deep(.el-tabs__header) {
|
|
|
margin-bottom: 0;
|