123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <template>
- <template-page
- ref="pageRef"
- :get-list="getList"
- :export-list="exportList"
- :operation="operation()"
- :options-evens-group="optionsEvensGroup"
- :column-parsing="columnParsing"
- :replace-or-not-map="false"
- >
- <popu v-if="visible">
- <el-page-header slot="head" :content="content" @back="handleClose" />
- <transfer-order-form :details-id="detailsId" :module-type="moduleType" @close="handleClose" />
- </popu>
- </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 TransferOrderForm from './transferOrderForm.vue'
- import { getListTransferV2, exportListTransferV2 } from '@/api/transferOrder'
- import { mapGetters } from 'vuex'
- export default {
- components: { TemplatePage, Popu, TransferOrderForm },
- mixins: [import_mixin, add_callback_mixin],
- data() {
- return {
- visible: false,
- // 表格属性
- tableAttributes: {
- // 启用勾选列
- selectColumn: true
- }, // 关闭新增弹窗
- // 表格事件
- tableEvents: {
- 'selection-change': this.selectionChange
- },
- recordSelected: [],
- detailsId: '',
- moduleType: 1
- }
- },
- computed: {
- ...mapGetters(['isCustomer']),
- content() {
- const titleArr = ['新增', '详情', '审核', '编辑']
- return titleArr[this.moduleType - 1]
- },
- // 事件组合
- optionsEvensGroup() {
- return [
- ...[
- this.isCustomer ? [
- [
- {
- name: '新增',
- click: this.addOn(() => {
- this.visible = true
- this.moduleType = 1
- })
- }
- ]
- ] : []
- ]
- ]
- }
- },
- methods: {
- // 列表请求函数
- getList(...p) {
- this.recordSelected = []
- return getListTransferV2(...p)
- },
- // 列表导出函数
- exportList: exportListTransferV2,
- // 表格列解析渲染数据更改
- columnParsing(item, defaultData) {
- return defaultData
- },
- // 监听勾选变化
- selectionChange(data) {
- this.recordSelected = data
- },
- operation() {
- return (h, { row, index, column }) => {
- return (
- <div class='operation-btns'>
- <el-button
- size='mini'
- type='text'
- onClick={() => {
- this.visible = true
- this.detailsId = row.id
- this.moduleType = 2
- }}
- >
- 查看
- </el-button>
- {row.status === 'WAIT' || row.status === 'SAVE' ? (
- <el-button
- size='mini'
- type='text'
- onClick={() => {
- this.visible = true
- this.detailsId = row.id
- this.moduleType = 3
- }}
- >
- 审核
- </el-button>
- ) : null}
- {row.status === 'WAIT' ? (
- <el-button
- size='mini'
- type='text'
- onClick={() => {
- this.visible = true
- this.detailsId = row.id
- this.moduleType = 4
- }}
- >
- 编辑
- </el-button>
- ) : null}
- </div>
- )
- }
- },
- handleClose() {
- this.moduleType = 1
- this.detailsId = null
- this.addOff(() => {
- this.visible = false
- })()
- this.$refs.pageRef.refreshList()
- }
- }
- }
- </script>
- <style lang="scss" scoped></style>
|