张同海 2 years ago
parent 30370d5980
commit b535b7c6a4

@ -10,6 +10,16 @@ export function DjyTenantConfigPage(parameter) {
params: parameter
})
}
/**
* 获取用户自定义配置
*/
export function DjyTenantConfigGet(parameter) {
return axios({
url: '/DjyTenantConfig/get',
method: 'get',
params: parameter
})
}
/**
* 新增
*/
@ -40,78 +50,3 @@ export function DjyTenantConfigDelete(data) {
data: data
})
}
/**
* 分页查询租户
*/
export function SysTenantPage(parameter) {
return axios({
url: '/sysTenant/page',
method: 'get',
params: {
pageNo: 1,
pageSize: 999999,
...parameter
}
})
}
/**
* 起始港
*/
export function GetPortloadlist(parameter) {
return axios({
url: '/commondb/portloadlist',
method: 'get',
params: parameter
})
}
/**
* 目的港 (中转)
*/
export function GetPortlist(parameter) {
return axios({
url: '/commondb/portlist',
method: 'get',
params: parameter
})
}
/**
* 获取船公司
* @params CnName
*/
export function GetCarrierlist(parameter) {
return axios({
url: '/commondb/carrierlist',
method: 'get',
params: parameter
})
}
/**
* 分页查询用户
*/
export function SysUserPage(parameter) {
return axios({
url: '/sysUser/page',
method: 'get',
params: { PageNo: 1, PageSize: 999 }
})
}
/**
* 获取订舱打印模板列表带有当前用户打印历史排序
*/
export function BookingPrintTemplatePage(parameter) {
return axios({
url: '/BookingPrintTemplate/page',
method: 'get',
params: { PageNo: 1, PageSize: 999 }
})
}
/**
* 获取订舱打印模板列表带有当前用户打印历史排序
*/
export function BookingPrintTemplateGetPrintTemplateList(parameter) {
return axios({
url: '/BookingPrintTemplate/GetPrintTemplateList',
method: 'get',
params: { PageNo: 1, PageSize: 999 }
})
}

@ -414,7 +414,7 @@
v-decorator="['closingdate']"
:style="{ width: '100%' }"
placeholder="请选择截港时间"
valueFormat="YYYY-MM-DD HH"
valueFormat="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH"
/>
</a-form-item>
@ -431,7 +431,7 @@
v-decorator="['closedocdate']"
:style="{ width: '100%' }"
placeholder="请选择截单时间"
valueFormat="YYYY-MM-DD HH"
valueFormat="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH"
/>
</a-form-item>

@ -165,6 +165,9 @@ export default {
RData = item.name
}
})
if (!RData) {
RData = data
}
return RData
},
FncarrierCode(data) {

@ -1,123 +1,42 @@
<template>
<template>
<div>
<!-- <a-card :bordered="false" :bodyStyle="tstyle">
<div class="table-page-search-wrapper" :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">
<a-form-item label="租户:">
<a-select v-model="queryParam.tenantId">
<a-select-option v-for="item in TenantData" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :md="6" :sm="24">
<span class="table-page-search-submitButtons">
<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-row>
<a-col :span="3" :offset="21">
<a-button @click="handleSubmit" type="primary">
保存
</a-button>
</template>
</vxe-toolbar>
<vxe-table :data="loadData" border :loading="loading" height="670px" empty-text="">
<vxe-column type="seq" width="50" fixed="left"></vxe-column>
<!-- <vxe-column
v-for="item in columns"
:key="item.dataIndex"
:field="item.dataIndex"
:min-width="item.width"
:title="item.title"
:align="item.align"
:show-overflow="true"
>
</vxe-column> -->
<vxe-column title="租户" align="center" width="150">
<template #default="{ row }">
{{ FnRtenant(row.tenantId) }}
</template>
</vxe-column>
<vxe-column title="必填项" align="center">
<template #default="{ row }">
{{ FnRjson(row.configJson) }}
</template>
</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>
<a-popconfirm title="是否确认删除?" ok-text="" cancel-text="" @confirm="confirm(row)">
<vxe-button type="text">删除</vxe-button>
</a-popconfirm>
</template>
</vxe-column>
</vxe-table>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
<a-button @click="FnGetData" type="primary" :style="{ marginLeft: '10px' }">
重置
</a-button>
</a-col>
<a-col :span="24">
<a-checkbox-group v-model="WebData" :style="{ width: '100%', marginTop: '10px' }">
<a-row v-for="item in Data" :key="item.title">
<a-divider orientation="left">
{{ item.title }}
</a-divider>
<a-col :span="6" v-for="item2 in item.children" :key="item2.code">
<a-checkbox :value="item2.code">{{ item2.name }}</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
</a-col>
</a-row>
</a-card>
</div>
</template>
<script>
import { DjyTenantConfigPage, DjyTenantConfigDelete, SysTenantPage } from '@/api/modular/main/TenantConfig'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
import { DjyTenantConfigGet, DjyTenantConfigEdit } from '@/api/modular/main/TenantConfig'
import Data from './Data.json'
export default {
components: {
addForm,
editForm
},
data() {
return {
// /
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
Data,
WebData: [],
queryParam: {
Type: 'booking_form_col'
},
ColumnsQuery: [],
columns: [
{
title: '租户',
align: 'center',
dataIndex: 'tenantId'
},
{
title: '必填项',
align: 'center',
dataIndex: 'configJson'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: [],
CodeData: [],
WCodeData: [],
ModulesData: [],
carrierCodeData: [],
UserList: [],
TenantData: [],
Data
}
}
},
created() {},
@ -125,79 +44,34 @@ export default {
this.init()
},
methods: {
FnRtenant(id) {
let RData = '-'
this.TenantData.forEach(item => {
if (item.id == id) {
RData = item.name
}
})
return RData
},
FnRjson(data) {
let Rdata = ''
JSON.parse(data).forEach(item => {
console.log(item)
Data.forEach(ele => {
ele.children.forEach(e => {
if (item == e.code) {
Rdata ? (Rdata = `${Rdata},${e.name}`) : (Rdata = e.name)
}
})
})
})
return Rdata
},
confirm(e) {
this.FnDel(e)
},
FnDel(data) {
DjyTenantConfigDelete({ id: data.id }).then(res => {
this.$message.success('删除成功')
this.FnGetData()
})
},
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
SysTenantPage().then(res => {
this.TenantData = res.data.rows
})
},
FnGetData() {
this.loading = true
DjyTenantConfigPage(this.queryParam).then(res => {
DjyTenantConfigGet(this.queryParam).then(res => {
if (res.code == 200) {
this.loadData = res.data.rows
this.WebData = JSON.parse(res.data.configJson)
this.id = res.data.id
} else {
this.loadData = []
this.WebData = []
this.$message.warning(res.message)
}
this.loading = false
})
},
handleOk() {
this.FnGetData()
handleSubmit() {
DjyTenantConfigEdit({ id: this.id, configJson: JSON.stringify(this.WebData), type: 'booking_form_col' }).then(
res => {
if (res.success) {
this.$message.success('保存成功')
this.FnGetData()
} else {
this.$message.error(`保存失败,${res.message}`)
}
}
)
}
}
}
</script>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.Open {
}
.Close {
height: 45px;
overflow: hidden;
}
</style>
<style lang="less"></style>

@ -0,0 +1,203 @@
<template>
<div>
<!-- <a-card :bordered="false" :bodyStyle="tstyle">
<div class="table-page-search-wrapper" :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">
<a-form-item label="租户:">
<a-select v-model="queryParam.tenantId">
<a-select-option v-for="item in TenantData" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :md="6" :sm="24">
<span class="table-page-search-submitButtons">
<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>
</vxe-toolbar>
<vxe-table :data="loadData" border :loading="loading" height="670px" empty-text="">
<vxe-column type="seq" width="50" fixed="left"></vxe-column>
<!-- <vxe-column
v-for="item in columns"
:key="item.dataIndex"
:field="item.dataIndex"
:min-width="item.width"
:title="item.title"
:align="item.align"
:show-overflow="true"
>
</vxe-column> -->
<vxe-column title="租户" align="center" width="150">
<template #default="{ row }">
{{ FnRtenant(row.tenantId) }}
</template>
</vxe-column>
<vxe-column title="必填项" align="center">
<template #default="{ row }">
{{ FnRjson(row.configJson) }}
</template>
</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>
<a-popconfirm title="是否确认删除?" ok-text="" cancel-text="" @confirm="confirm(row)">
<vxe-button type="text">删除</vxe-button>
</a-popconfirm>
</template>
</vxe-column>
</vxe-table>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { DjyTenantConfigPage, DjyTenantConfigDelete, SysTenantPage } from '@/api/modular/main/TenantConfig'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
import Data from './Data.json'
export default {
components: {
addForm,
editForm
},
data() {
return {
// /
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
Type: 'booking_form_col'
},
ColumnsQuery: [],
columns: [
{
title: '租户',
align: 'center',
dataIndex: 'tenantId'
},
{
title: '必填项',
align: 'center',
dataIndex: 'configJson'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: [],
CodeData: [],
WCodeData: [],
ModulesData: [],
carrierCodeData: [],
UserList: [],
TenantData: [],
Data
}
},
created() {},
mounted() {
this.init()
},
methods: {
FnRtenant(id) {
let RData = '-'
this.TenantData.forEach(item => {
if (item.id == id) {
RData = item.name
}
})
return RData
},
FnRjson(data) {
let Rdata = ''
JSON.parse(data).forEach(item => {
console.log(item)
Data.forEach(ele => {
ele.children.forEach(e => {
if (item == e.code) {
Rdata ? (Rdata = `${Rdata},${e.name}`) : (Rdata = e.name)
}
})
})
})
return Rdata
},
confirm(e) {
this.FnDel(e)
},
FnDel(data) {
DjyTenantConfigDelete({ id: data.id }).then(res => {
this.$message.success('删除成功')
this.FnGetData()
})
},
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
SysTenantPage().then(res => {
this.TenantData = res.data.rows
})
},
FnGetData() {
this.loading = true
DjyTenantConfigPage(this.queryParam).then(res => {
if (res.code == 200) {
this.loadData = res.data.rows
} else {
this.loadData = []
this.$message.warning(res.message)
}
this.loading = false
})
},
handleOk() {
this.FnGetData()
}
}
}
</script>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.Open {
}
.Close {
height: 45px;
overflow: hidden;
}
</style>
Loading…
Cancel
Save