123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <script lang="ts" setup>
- /**
- * @Name: index.vue
- * @Description: 审批查看(直销)
- * @Author: xinyan
- */
- import VerticalDivider from '/src/components/VerticalDivider/index.vue';
- import { RefreshLeft, Search } from '@element-plus/icons-vue';
- import { useResponse } from '/@/utils/useResponse';
- import { useTemplateRef } from 'vue';
- import * as api from './api';
- import DataTable from './component/DataTable.vue';
- import { useTableHeight } from '/@/utils/useTableHeight';
- const titleContainer: Ref<HTMLElement | null> = useTemplateRef('titleContainer');
- const queryContainer: Ref<HTMLElement | null> = useTemplateRef('queryContainer');
- const { tableHeight } = useTableHeight(titleContainer, queryContainer);
- const tableRef: Ref<any> = useTemplateRef('table');
- const btnLoading = ref(false);
- const resetLoading = ref(false);
- const formInline = reactive<any>({
- description: '',
- platform: '',
- station: '',
- });
- provide('query-parameter', formInline);
- const stationOptions = <any>ref([]);
- const platformOptions = <any>ref([]);
- provide('stationOptions', stationOptions);
- provide('platformOptions', platformOptions);
- onBeforeMount(() => {
- fetchOptions();
- });
- async function fetchOptions() {
- const resp = (await useResponse(api.getCostOptions)).data;
- platformOptions.value = resp.platform_list;
- stationOptions.value = resp.station_list;
- }
- async function handleQuery() {
- btnLoading.value = true;
- await tableRef.value?.fetchList(true);
- btnLoading.value = false;
- }
- async function resetParameter() {
- for (const key in formInline) {
- formInline[key] = '';
- }
- resetLoading.value = true;
- await tableRef.value?.fetchList(true);
- resetLoading.value = false;
- }
- </script>
- <template>
- <div class="p-5">
- <el-card class="h-full" style="color: rgba(0, 0, 0, 0.88)">
- <div ref="titleContainer" class="text-xl font-semibold pb-5">成本查看</div>
- <!-- 查询条件 -->
- <div ref="queryContainer" class="flex justify-between">
- <div class="flex flex-1">
- <div class="w-full whitespace-nowrap">
- <el-row :gutter="20" style="margin-bottom: 5px">
- <el-col :span="5">
- <div class="flex items-center">
- <span class="mr-2">SKU</span>
- <el-input v-model="formInline.description" clearable placeholder="请输入SKU" />
- </div>
- </el-col>
- <el-col :span="5">
- <div class="flex items-center">
- <span class="mr-2">平 台</span>
- <el-select v-model="formInline.platform" placeholder="请选择平台">
- <el-option v-for="item in platformOptions" :key="item" :label="item" :value="item"> </el-option>
- </el-select>
- </div>
- </el-col>
- <el-col :span="5" class="flex">
- <div class="flex items-center">
- <span class="mr-2">地 区</span>
- <el-select v-model="formInline.station" clearable placeholder="请输入店铺">
- <el-option></el-option>
- </el-select>
- </div>
- </el-col>
- <el-col :span="5">
- <div class="flex items-center">
- <span class="mr-2">销售模式</span>
- <el-select v-model="formInline.description" clearable placeholder="请输入ASIN">
- <el-option></el-option>
- </el-select>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- <VerticalDivider />
- <div class="flex gap-1.5 ml-5">
- <el-button :icon="Search" :loading="btnLoading" type="primary" @click="handleQuery"> 查 询 </el-button>
- <el-button :icon="RefreshLeft" :loading="resetLoading" color="#ECECF1C9" style="width: 88px; color: #3c3c3c" @click="resetParameter">
- 重 置
- </el-button>
- </div>
- </div>
- <el-divider ref="dividerContainer" style="margin: 20px 0 12px 0" />
- <div :style="{ height: tableHeight + 'px' }">
- <DataTable ref="table" />
- </div>
- </el-card>
- </div>
- </template>
- <style scoped></style>
|