1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <template>
- <template-page
- ref="pageRef"
- :get-list="getList"
- :export-list="exportList"
- :options-evens-group="optionsEvensGroup"
- :column-parsing="columnParsing"
- >
- <Popu v-if="visible" />
- </template-page>
- </template>
- <script>
- import TemplatePage from '@/components/template/template-page-1.vue'
- import import_mixin from '@/components/template/import_mixin.js'
- import add_callback_mixin from '@/components/template/add_callback_mixin.js'
- import Popu from '@/components/template/popu.vue'
- import { getListCustomerCheckV2, exportListCustomerCheck, importListCustomerCheck, listCustomerCheckDownload } from '@/api/barcode'
- export default {
- components: { TemplatePage, Popu },
- mixins: [import_mixin, add_callback_mixin],
- data() {
- return {
- visible: false,
- // 事件组合
- optionsEvensGroup: [
- [
- [
- {
- name: '导入',
- render: this.importButton(importListCustomerCheck)
- }
- ]
- ],
- [
- [
- {
- name: '导入模版',
- click: () => {
- listCustomerCheckDownload({}, `${this.$route.meta.title}`)
- .then(res => {
- this.$message({
- message: '下载成功',
- type: 'success'
- })
- })
- .catch(_err => {
- this.$message.error('下载失败')
- })
- }
- }
- ]
- ]
- ],
- // 表格属性
- tableAttributes: {
- // 启用勾选列
- selectColumn: true
- }, // 关闭新增弹窗
- // 表格事件
- tableEvents: {
- 'selection-change': this.selectionChange
- },
- recordSelected: []
- }
- },
- methods: {
- // 列表请求函数
- getList(...p) {
- this.recordSelected = []
- return getListCustomerCheckV2(...p)
- },
- // 列表导出函数
- exportList: exportListCustomerCheck,
- // 表格列解析渲染数据更改
- columnParsing(item, defaultData) {
- return defaultData
- },
- // 监听勾选变化
- selectionChange(data) {
- this.recordSelected = data
- },
- operation() {
- return (h, { row, index, column }) => {
- return <div class='operation-btns'></div>
- }
- },
- handleClose() {
- this.addOff(() => {
- this.visible = false
- })()
- }
- }
- }
- </script>
- <style lang="scss" scoped></style>
|