123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <template-page ref="pageRef" :get-list="getList" :export-list="exportList" :column-parsing="columnParsing" :options-evens-group="optionsEvensGroup" />
- </template>
- <script>
- import TemplatePage from '@/components/template/template-page-1.vue'
- import import_mixin from '@/components/template/import_mixin.js'
- import { getcustomerFrontList, partsNewInExport, kunCunImportData, kunCunTiaoImportData, downloadkunCunDownload } from '@/api/stock'
- export default {
- components: { TemplatePage },
- mixins: [import_mixin],
- data() {
- return {
- // 事件组合
- optionsEvensGroup: [[
- [
- {
- name: '导入',
- render: this.importButton(kunCunImportData, '库存初始化')
- }
- ]
- ],
- [
- [
- {
- name: '导入',
- render: this.importButton(kunCunTiaoImportData, '库存调整')
- }
- ]
- ],
- [
- [
- {
- name: '导入模版',
- click: () => {
- downloadkunCunDownload({}, `${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 getcustomerFrontList(...p)
- },
- // 列表导出函数
- exportList: partsNewInExport,
- // 表格列解析渲染数据更改
- columnParsing(_item, defaultData) {
- return defaultData
- },
- // 监听勾选变化
- selectionChange(data) {
- this.recordSelected = data
- }
- // 批量删除
- // dels() {
- // if (this.recordSelected.length) {
- // this.$confirm('此操作将删除数据, 是否继续?', '提示', {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning'
- // })
- // .then(() => {
- // partsOldOutDel({
- // ids: this.recordSelected.map(item => item.id).join(',')
- // })
- // .then(res => {
- // this.$refs.pageRef.refreshList()
- // this.$message({
- // type: 'success',
- // message: '删除成功!'
- // })
- // })
- // .catch(() => {
- // this.$message({
- // type: 'error',
- // message: '删除失败'
- // })
- // })
- // })
- // .catch(() => {
- // this.$message({
- // type: 'info',
- // message: '已取消删除'
- // })
- // })
- // } else {
- // this.$message({
- // type: 'info',
- // message: '请先勾选需要删除的数据!'
- // })
- // }
- // }
- }
- }
- </script>
- <style lang="scss" scoped></style>
|