|
|
|
@ -0,0 +1,301 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<a-card :bordered="false" :bodyStyle="tstyle">
|
|
|
|
|
<div
|
|
|
|
|
class="table-page-search-wrapper"
|
|
|
|
|
v-if="hasPerm('BookingTemplate:page')"
|
|
|
|
|
:class="advanced ? 'Open' : 'Close'"
|
|
|
|
|
>
|
|
|
|
|
<a-form layout="inline">
|
|
|
|
|
<a-row :gutter="48">
|
|
|
|
|
<a-col :md="18">
|
|
|
|
|
<a-row :gutter="48">
|
|
|
|
|
<a-col :md="8" :sm="24" v-for="item in ColumnsQuery" :key="`${item.dataIndex}1`" v-show="item.checked">
|
|
|
|
|
<a-form-item :label="item.title">
|
|
|
|
|
<a-input v-model="queryParam[item.dataIndex]" allow-clear :placeholder="`请输入${item.title}`" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :md="6" :sm="24">
|
|
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
|
|
<a-popover placement="bottom" v-model="setVisible" trigger="click">
|
|
|
|
|
<template #content>
|
|
|
|
|
<columnSetting :columns="ColumnsQuery" @columnChange="columnChange"></columnSetting>
|
|
|
|
|
</template>
|
|
|
|
|
<span class="tab-btn"> <a-icon type="setting" :style="{ fontSize: '16px' }" /> 设置 </span>
|
|
|
|
|
</a-popover>
|
|
|
|
|
<a-button type="primary" @click="FnGetData">查询</a-button>
|
|
|
|
|
<a-button style="margin-left: 8px" @click="init">重置</a-button>
|
|
|
|
|
<a @click="toggleAdvanced" style="margin-left: 8px">
|
|
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
|
|
<a-icon :type="advanced ? 'up' : 'down'" />
|
|
|
|
|
</a>
|
|
|
|
|
</span>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
</a-card>
|
|
|
|
|
<a-card :bordered="false">
|
|
|
|
|
<vxe-toolbar>
|
|
|
|
|
<template #buttons>
|
|
|
|
|
<a-button type="primary" icon="plus" @click="$refs.addForm.add()">
|
|
|
|
|
新增客户
|
|
|
|
|
</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
<template #tools>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<a-popover placement="bottom" v-model="setVisible1" trigger="click">
|
|
|
|
|
<template #content>
|
|
|
|
|
<columnSetting :columns="TableColumns" @columnChange="columnChange1"></columnSetting>
|
|
|
|
|
</template>
|
|
|
|
|
<span class="tab-btn"> <a-icon type="setting" :style="{ fontSize: '16px' }" /> 设置 </span>
|
|
|
|
|
</a-popover>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-toolbar>
|
|
|
|
|
<vxe-table :data="loadData" border :loading="loading" empty-text="没有更多数据了!" v-if="!TableType">
|
|
|
|
|
<vxe-column type="seq" width="40" fixed="left"></vxe-column>
|
|
|
|
|
<vxe-column
|
|
|
|
|
v-for="item in TableColumns"
|
|
|
|
|
:key="`${item.dataIndex}3`"
|
|
|
|
|
:field="item.dataIndex"
|
|
|
|
|
:width="item.width"
|
|
|
|
|
:title="item.title"
|
|
|
|
|
:align="item.align"
|
|
|
|
|
v-if="item.checked"
|
|
|
|
|
></vxe-column>
|
|
|
|
|
<vxe-column title="操作" fixed="right" width="200" align="center">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<vxe-button type="text" @click="$refs.editForm.edit(row)">编辑</vxe-button>
|
|
|
|
|
<vxe-button type="text" @click="BookingPrintTemplateDelete(row)">删除</vxe-button>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
</vxe-table>
|
|
|
|
|
<vxe-pager
|
|
|
|
|
:loading="loading"
|
|
|
|
|
:current-page="queryParam.currentPage"
|
|
|
|
|
:page-size="queryParam.pageSize"
|
|
|
|
|
:total="queryParam.totalResult"
|
|
|
|
|
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
|
|
|
|
|
@page-change="handlePageChange"
|
|
|
|
|
>
|
|
|
|
|
</vxe-pager>
|
|
|
|
|
<add-form ref="addForm" @ok="handleOk" />
|
|
|
|
|
<edit-form ref="editForm" @ok="handleOk" />
|
|
|
|
|
</a-card>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { BookingPrintTemplatePage, BookingPrintTemplateDelete } from '@/api/modular/main/bookingprinttemplate'
|
|
|
|
|
import { DjyCustomerGet, DjyUserConfigAdd } from '@/api/modular/main/CustomerInformationManagement'
|
|
|
|
|
import addForm from './addForm.vue'
|
|
|
|
|
import editForm from './editForm.vue'
|
|
|
|
|
import columnSetting from '@/components/tableColumnSetting'
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
|
title: '类型名称',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '60',
|
|
|
|
|
dataIndex: 'typeName'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '租户名称',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '60',
|
|
|
|
|
dataIndex: 'tenantName'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
addForm,
|
|
|
|
|
editForm,
|
|
|
|
|
columnSetting
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 高级搜索 展开/关闭
|
|
|
|
|
TableType: false,
|
|
|
|
|
advanced: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
setVisible: false,
|
|
|
|
|
setVisible1: false,
|
|
|
|
|
queryParam: {
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
totalResult: 1
|
|
|
|
|
},
|
|
|
|
|
ColumnsQuery: [],
|
|
|
|
|
TableColumns: [],
|
|
|
|
|
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
|
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
|
|
loadData: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.init()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
columnChange(data) {
|
|
|
|
|
this.ColumnsQuery = [...data]
|
|
|
|
|
let Data = []
|
|
|
|
|
data.forEach(item => {
|
|
|
|
|
if (item.checked) {
|
|
|
|
|
Data.push(item.dataIndex)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
DjyUserConfigAdd({
|
|
|
|
|
type: 'printing_cond_cfg',
|
|
|
|
|
configJson: JSON.stringify(Data)
|
|
|
|
|
}).then(res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
columnChange1(data) {
|
|
|
|
|
this.TableType = true
|
|
|
|
|
this.TableColumns = data
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.TableType = false
|
|
|
|
|
})
|
|
|
|
|
let Data = []
|
|
|
|
|
data.forEach(item => {
|
|
|
|
|
if (item.checked) {
|
|
|
|
|
Data.push(item.dataIndex)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
DjyUserConfigAdd({
|
|
|
|
|
type: 'printing_list_col',
|
|
|
|
|
configJson: JSON.stringify(Data)
|
|
|
|
|
}).then(res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
toggleAdvanced() {
|
|
|
|
|
this.advanced = !this.advanced
|
|
|
|
|
},
|
|
|
|
|
init() {
|
|
|
|
|
Object.assign(this.$data, this.$options.data())
|
|
|
|
|
columns.forEach(item => {
|
|
|
|
|
item.checked = true
|
|
|
|
|
})
|
|
|
|
|
columns.forEach(item => {
|
|
|
|
|
this.ColumnsQuery.push({ ...item, checked: true })
|
|
|
|
|
})
|
|
|
|
|
DjyCustomerGet({ type: 'printing_list_col' }).then(res => {
|
|
|
|
|
if (res.data && JSON.parse(res.data.configJson).length) {
|
|
|
|
|
columns.forEach(item => {
|
|
|
|
|
item.checked = false
|
|
|
|
|
})
|
|
|
|
|
let Arr = []
|
|
|
|
|
JSON.parse(res.data.configJson).forEach(item => {
|
|
|
|
|
columns.forEach(item2 => {
|
|
|
|
|
if (item2.dataIndex == item) {
|
|
|
|
|
item2.checked = true
|
|
|
|
|
Arr.push(item2)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
columns.forEach(item => {
|
|
|
|
|
let type = true
|
|
|
|
|
Arr.forEach(item2 => {
|
|
|
|
|
if (item.dataIndex == item2.dataIndex) {
|
|
|
|
|
type = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (type) {
|
|
|
|
|
Arr.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.TableColumns = Arr
|
|
|
|
|
} else {
|
|
|
|
|
this.TableColumns = columns
|
|
|
|
|
}
|
|
|
|
|
this.FnGetData()
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
})
|
|
|
|
|
DjyCustomerGet({ type: 'printing_cond_cfg' }).then(res => {
|
|
|
|
|
if (JSON.parse(res.data.configJson).length) {
|
|
|
|
|
this.ColumnsQuery = []
|
|
|
|
|
columns.forEach(item => {
|
|
|
|
|
this.ColumnsQuery.push({ ...item, checked: false })
|
|
|
|
|
})
|
|
|
|
|
let Arr = []
|
|
|
|
|
JSON.parse(res.data.configJson).forEach(item => {
|
|
|
|
|
this.ColumnsQuery.forEach(item2 => {
|
|
|
|
|
if (item == item2.dataIndex) {
|
|
|
|
|
item2.checked = true
|
|
|
|
|
Arr.push(item2)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.ColumnsQuery.forEach(item => {
|
|
|
|
|
let type = true
|
|
|
|
|
Arr.forEach(item2 => {
|
|
|
|
|
if (item.dataIndex == item2.dataIndex) {
|
|
|
|
|
type = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (type) {
|
|
|
|
|
Arr.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.ColumnsQuery = Arr
|
|
|
|
|
}
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handlePageChange({ currentPage, pageSize }) {
|
|
|
|
|
this.queryParam.pageNo = currentPage
|
|
|
|
|
this.queryParam.pageSize = pageSize
|
|
|
|
|
this.FnGetData()
|
|
|
|
|
},
|
|
|
|
|
FnGetData() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
BookingPrintTemplatePage(this.queryParam).then(res => {
|
|
|
|
|
this.loadData = res.data.rows
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.queryParam.currentPage = res.data.pageNo
|
|
|
|
|
this.queryParam.pageSize = res.data.pageSize
|
|
|
|
|
this.queryParam.totalResult = res.data.totalRows
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 查询参数组装
|
|
|
|
|
*/
|
|
|
|
|
switchingDate() {
|
|
|
|
|
const obj = JSON.parse(JSON.stringify(this.queryParam))
|
|
|
|
|
return obj
|
|
|
|
|
},
|
|
|
|
|
BookingPrintTemplateDelete(record) {
|
|
|
|
|
BookingPrintTemplateDelete(record).then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
|
this.FnGetData()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('删除失败') // + res.message
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleOk() {
|
|
|
|
|
this.FnGetData()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.table-operator {
|
|
|
|
|
margin-bottom: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button {
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
}
|
|
|
|
|
.Open {
|
|
|
|
|
}
|
|
|
|
|
.Close {
|
|
|
|
|
height: 45px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
</style>
|