提交 b2d71be3 authored 作者: lidongxu's avatar lidongxu

refactor(promotion): 新增:促销管理_店内执行上报_下载表格功能_常规陈列实现

上级 97571154
...@@ -157,4 +157,14 @@ export function submitSixLittleDiamondsPlan(data) { ...@@ -157,4 +157,14 @@ export function submitSixLittleDiamondsPlan(data) {
} }
} }
}); });
}
// 下载表格
export function downloadDisplayScheduleTable(params) {
return request({
url: '/operation/sales/export/download',
params,
responseType: 'blob'
})
} }
\ No newline at end of file
...@@ -29,6 +29,22 @@ ...@@ -29,6 +29,22 @@
icon="Rank" icon="Rank"
@click="openTableDialog" /> @click="openTableDialog" />
</el-tooltip> </el-tooltip>
<el-tooltip class="item"
effect="dark"
content="下载表格"
placement="top">
<el-button @click="downloadTable" type="primary">
下载表格
</el-button>
</el-tooltip>
<el-tooltip class="item"
effect="dark"
content="上传表格"
placement="top">
<el-button @click="openTableDialog" type="success">
上传表格
</el-button>
</el-tooltip>
</template> </template>
</right-toolbar> </right-toolbar>
</el-row> </el-row>
...@@ -73,7 +89,7 @@ ...@@ -73,7 +89,7 @@
<!-- 自定义渲染内容单元格 --> <!-- 自定义渲染内容单元格 -->
<div v-if="col.render" <div v-if="col.render"
class="cell-style"> class="cell-style">
<component :is="col.render(h, row, col, !isCurrentMonth(row.salesMonth))" /> <component :is="col.render(h, row, col, !isCurrentMonth(row.salesMonth))" />
</div> </div>
<!-- 公式计算 --> <!-- 公式计算 -->
<div v-else-if="col.type === 'formula'"> <div v-else-if="col.type === 'formula'">
...@@ -114,6 +130,8 @@ ...@@ -114,6 +130,8 @@
<script setup> <script setup>
import { h } from 'vue' import { h } from 'vue'
import userStore from '@/store/modules/user' import userStore from '@/store/modules/user'
const props = defineProps({ const props = defineProps({
tableData: { // 数据源 tableData: { // 数据源
type: Array, type: Array,
...@@ -143,7 +161,7 @@ const props = defineProps({ ...@@ -143,7 +161,7 @@ const props = defineProps({
default: (row, col, cellValue) => cellValue default: (row, col, cellValue) => cellValue
} }
}) })
const emit = defineEmits(['getTableList', 'updateShowSearch']) const emit = defineEmits(['getTableList', 'updateShowSearch', 'downloadTable'])
/*************** 工具栏 ***************/ /*************** 工具栏 ***************/
const showFill = userStore().hasQcMarketEmpInfo // 是否启用填报模式 const showFill = userStore().hasQcMarketEmpInfo // 是否启用填报模式
...@@ -208,6 +226,11 @@ const getTableList = () => { ...@@ -208,6 +226,11 @@ const getTableList = () => {
emit('getTableList') emit('getTableList')
} }
// 下载表格
const downloadTable = () => {
emit('downloadTable')
}
/************** 弹框控制 ***************/ /************** 弹框控制 ***************/
// 控制表格弹框显隐 // 控制表格弹框显隐
const tableContainer = ref(null) // 原始表格容器引用 const tableContainer = ref(null) // 原始表格容器引用
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:params="params" :params="params"
:isLoading="isLoading" :isLoading="isLoading"
@getTableList="getTableList" @getTableList="getTableList"
@downloadTable="downloadTable"
@updateShowSearch="v => showSearch.value = v" /> @updateShowSearch="v => showSearch.value = v" />
</template> </template>
...@@ -16,9 +17,10 @@ ...@@ -16,9 +17,10 @@
lang="jsx"> lang="jsx">
import CustomTable from '../components/Table' import CustomTable from '../components/Table'
import SearchList from '../components/SearchList' import SearchList from '../components/SearchList'
import { getDisplayList, submitDisplayPlan } from '@/api' import { getDisplayList, submitDisplayPlan, downloadDisplayScheduleTable } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getDisplayConfig } from './data.jsx' import { getDisplayConfig } from './data.jsx'
import { saveAs } from 'file-saver'
/*************** 表格操作相关 ***************/ /*************** 表格操作相关 ***************/
...@@ -111,6 +113,15 @@ ...@@ -111,6 +113,15 @@
/*************** 筛选 ***************/ /*************** 筛选 ***************/
const showSearch = ref(true) const showSearch = ref(true)
/*************** 下载表格 ***************/
const downloadTable = async () => {
const res = await downloadDisplayScheduleTable({
...params.value,
pageType: 'NORMAL_DISPLAY_EXPORT'
})
saveAs(res, '陈列计划.xlsx')
}
</script> </script>
<style lang="scss"> <style lang="scss">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论