|
@@ -0,0 +1,179 @@
|
|
|
+<template>
|
|
|
+ <div class="page">
|
|
|
+ <el-form :inline="true" class="query-form m-b-10" v-if="searchVisible" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
|
+ <!-- 搜索框-->
|
|
|
+ <el-form-item label="公司类型名称" prop="name">
|
|
|
+ <el-input v-model="searchForm.name" placeholder="请输入公司类型名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
|
|
|
+ <el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div class="jp-table top" style="">
|
|
|
+ <vxe-toolbar :refresh="{query: refreshList}" ref="toolbarRef" custom>
|
|
|
+ <template #buttons>
|
|
|
+ <el-button v-if="hasPermission('wdt:merchantCompanyType:add')" type="primary" icon="el-icon-plus" @click="add()">新建</el-button>
|
|
|
+ <el-button v-if="hasPermission('wdt:merchantCompanyType:del')" type="danger" icon="el-icon-delete" @click="del()" :disabled="$refs.infoTable && $refs.infoTable.getCheckboxRecords().length === 0" plain>删除</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-toolbar>
|
|
|
+ <div style="height: calc(100% - 80px)">
|
|
|
+ <vxe-table
|
|
|
+ border="inner"
|
|
|
+ auto-resize
|
|
|
+ resizable
|
|
|
+ height="auto"
|
|
|
+ :loading="loading"
|
|
|
+ ref="infoTable"
|
|
|
+ show-header-overflow
|
|
|
+ show-overflow
|
|
|
+ highlight-hover-row
|
|
|
+ :menu-config="{}"
|
|
|
+ :sort-config="{remote:true}"
|
|
|
+ :data="dataList"
|
|
|
+ :checkbox-config="{}">
|
|
|
+ <vxe-column type="seq" width="60" title="序号"></vxe-column>
|
|
|
+ <vxe-column type="checkbox" width="60" ></vxe-column>
|
|
|
+ <vxe-column min-width="130" title="公司类型名称" field="productName" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-link type="primary" :underline="false" v-if="hasPermission('wdt:merchantCompanyType:view')" @click="view(scope.row.id)">{{scope.row.name}}</el-link>
|
|
|
+ <span v-else>{{scope.row.name}}</span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="120" title="排序" field="sort" align="center"></vxe-column>
|
|
|
+ <vxe-column width="180" title="创建时间" field="createTime" align="center"></vxe-column>
|
|
|
+
|
|
|
+ <vxe-column title="操作" width="130px" fixed="right" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button v-if="hasPermission('wdt:merchantCompanyType:edit')" text type="primary" @click="edit(scope.row)">修改</el-button>
|
|
|
+ <el-button v-if="hasPermission('wdt:merchantCompanyType:del')" text type="primary" @click="del(scope.row.id)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ <vxe-pager
|
|
|
+ background
|
|
|
+ :current-page="tablePage.currentPage"
|
|
|
+ :page-size="tablePage.pageSize"
|
|
|
+ :total="tablePage.total"
|
|
|
+ :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
|
|
|
+ :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
|
|
|
+ @page-change="currentChangeHandle">
|
|
|
+ </vxe-pager>
|
|
|
+
|
|
|
+ <MerchantCompanyTypeForm ref="merchantCompanyTypeForm" @refreshDataList="refreshList"></MerchantCompanyTypeForm>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import merchantCompanyTypeService from '@/api/wdt/merchantCompanyType/MerchantCompanyTypeService'
|
|
|
+ import MerchantCompanyTypeForm from './MerchantCompanyTypeForm'
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ searchVisible: true,
|
|
|
+ num: 0,
|
|
|
+ visable: false,
|
|
|
+ searchForm: {
|
|
|
+ name: '',
|
|
|
+ type: [],
|
|
|
+ },
|
|
|
+ dataList: [],
|
|
|
+ tablePage: {
|
|
|
+ total: 0,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ orders: []
|
|
|
+ },
|
|
|
+ loading: false,
|
|
|
+ isAdmin: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ MerchantCompanyTypeForm
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ //将表格和工具栏进行关联
|
|
|
+ const $table = this.$refs.infoTable;
|
|
|
+ const $toolbar = this.$refs.toolbarRef;
|
|
|
+ $table.connect($toolbar);
|
|
|
+ })
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ userName () {
|
|
|
+ return this.$store.state.user.name
|
|
|
+ },
|
|
|
+ user () {
|
|
|
+ this.create = this.$store.state.user.id
|
|
|
+ console.log('createId', this.create)
|
|
|
+ return this.$store.state.user
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 新增
|
|
|
+ add () {
|
|
|
+ this.$refs.merchantCompanyTypeForm.init('add', '')
|
|
|
+ },
|
|
|
+
|
|
|
+ // 查看
|
|
|
+ view (id) {
|
|
|
+ this.$refs.merchantCompanyTypeForm.init('view', id)
|
|
|
+ },
|
|
|
+ edit (row) {
|
|
|
+ this.$refs.merchantCompanyTypeForm.init('edit', row.id)
|
|
|
+ },
|
|
|
+ // 获取数据列表
|
|
|
+ refreshList () {
|
|
|
+ this.loading = true
|
|
|
+ merchantCompanyTypeService.list({
|
|
|
+ 'current': this.tablePage.currentPage,
|
|
|
+ 'size': this.tablePage.pageSize,
|
|
|
+ 'orders': this.tablePage.orders,
|
|
|
+ ...this.searchForm
|
|
|
+ }).then((data) => {
|
|
|
+ this.dataList = data.records
|
|
|
+ this.tablePage.total = data.total
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ del (id) {
|
|
|
+ let ids = id || this.$refs.infoTable.getCheckboxRecords().map(item => {
|
|
|
+ return item.id
|
|
|
+ }).join(',')
|
|
|
+ this.$confirm(`确定删除所选项吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true
|
|
|
+ merchantCompanyTypeService.delete(ids).then((data) => {
|
|
|
+ this.$message.success(data)
|
|
|
+ this.refreshList()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resetSearch () {
|
|
|
+ this.$refs.searchForm.resetFields()
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ // 当前页
|
|
|
+ currentChangeHandle ({ currentPage, pageSize }) {
|
|
|
+ this.tablePage.currentPage = currentPage
|
|
|
+ this.tablePage.pageSize = pageSize
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|