liuxiaoxue 2 years ago
commit 360a40b06b

@ -33,11 +33,11 @@ export function DjyTenantConfigEdit(parameter) {
/** /**
* 删除 * 删除
*/ */
export function DjyTenantConfigDelete(parameter) { export function DjyTenantConfigDelete(data) {
return axios({ return axios({
url: '/DjyTenantConfig/delete', url: '/DjyTenantConfig/delete',
method: 'get', method: 'post',
params: parameter data: data
}) })
} }
/** /**

@ -1,5 +1,6 @@
<template> <template>
<a-modal <a-modal
class="CsModal"
title="新增配置" title="新增配置"
:width="1100" :width="1100"
:visible="visible" :visible="visible"
@ -10,7 +11,7 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form :form="form">
<a-row> <a-row>
<a-col :span="12"> <!-- <a-col :span="12">
<a-form-item label="类型" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="类型" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select <a-select
placeholder="请选择类型" placeholder="请选择类型"
@ -26,11 +27,14 @@
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col> -->
<a-col :span="24"> <a-col :span="24">
<a-form-item label="必填项" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="必填项" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-checkbox-group v-decorator="['WebData']" style="width: 100%"> <a-checkbox-group v-decorator="['WebData']" :style="{ width: '100%', marginTop: '-10px' }">
<a-row v-for="item in Data" :key="item.title"> <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-col :span="6" v-for="item2 in item.children" :key="item2.code">
<a-checkbox :value="item2.code">{{ item2.name }}</a-checkbox> <a-checkbox :value="item2.code">{{ item2.name }}</a-checkbox>
</a-col> </a-col>
@ -69,14 +73,10 @@ export default {
Data, Data,
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this), form: this.$form.createForm(this)
TypeData: []
} }
}, },
mounted() { mounted() {},
this.TypeData = this.$options.filters['dictData']('customer_config_type')
console.log(this.TypeData)
},
methods: { methods: {
// //
add(record) { add(record) {
@ -101,7 +101,8 @@ export default {
values[key] = JSON.stringify(values[key]) values[key] = JSON.stringify(values[key])
} }
} }
DjyTenantConfigAdd(values) values.configJson = values.WebData
DjyTenantConfigAdd({ ...values, type: 'booking_form_col' })
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success('新增成功') this.$message.success('新增成功')
@ -127,3 +128,12 @@ export default {
} }
} }
</script> </script>
<style lang="less">
.CsModal {
height: 40vh;
.ant-modal-body {
height: 600px;
overflow-y: auto;
}
}
</style>

@ -1,5 +1,6 @@
<template> <template>
<a-modal <a-modal
class="CsModal"
title="编辑配置" title="编辑配置"
:width="1100" :width="1100"
:visible="visible" :visible="visible"
@ -10,165 +11,18 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form :form="form">
<a-row> <a-row>
<a-col :span="12"> <a-col :span="24">
<a-form-item label="租户" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback> <a-form-item label="必填项" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select <a-checkbox-group v-decorator="['WebData']" :style="{ width: '100%', marginTop: '10px' }">
placeholder="请选择租户" <a-row v-for="item in Data" :key="item.title">
v-decorator="['tenantId', { rules: [{ required: true, message: '请选择租户!' }] }]" <a-divider orientation="left">
show-search {{ item.title }}
:default-active-first-option="false" </a-divider>
:show-arrow="false" <a-col :span="6" v-for="item2 in item.children" :key="item2.code">
:filter-option="false" <a-checkbox :value="item2.code">{{ item2.name }}</a-checkbox>
:not-found-content="null" </a-col>
> </a-row>
<a-select-option v-for="item in tenantData" :key="item.id" :value="item.id"> </a-checkbox-group>
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="船名" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input
placeholder="请输入船名"
v-decorator="['vessel', { rules: [{ required: true, message: '请输入船名!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="航次" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input
placeholder="请输入航次"
v-decorator="['voyno', { rules: [{ required: true, message: '请输入航次!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="装货港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择装货港"
v-decorator="['portLoadingId', { rules: [{ required: true, message: '请选择装货港!' }] }]"
show-search
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in portLoadingData" :key="item.code" :value="item.code">
{{ item.enName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="中转港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择中转港"
v-decorator="['portTransitId', { rules: [{ required: true, message: '请选择中转港!' }] }]"
show-search
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in portTransitData" :key="item.code" :value="item.code">
{{ item.enName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="卸货港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择卸货港"
v-decorator="['portDischargeId', { rules: [{ required: true, message: '请选择卸货港!' }] }]"
show-search
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in portDischargeData" :key="item.code" :value="item.code">
{{ item.enName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="开船日期" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-date-picker
show-time
:style="{ width: '100%' }"
placeholder="请选择开船日期"
v-decorator="['etd', { rules: [{ required: true, message: '请选择开船日期!' }] }]"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="截港日期" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-date-picker
show-time
:style="{ width: '100%' }"
placeholder="请选择截港日期"
v-decorator="['closingDate', { rules: [{ required: true, message: '请选择截港日期!' }] }]"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="预抵日期" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-date-picker
show-time
:style="{ width: '100%' }"
placeholder="请选择预抵日期"
v-decorator="['eta', { rules: [{ required: true, message: '请选择预抵日期!' }] }]"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="默认码头" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input
placeholder="请输入默认码头"
v-decorator="['wharf', { rules: [{ required: true, message: '请输入默认码头!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="实际离港日期" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-date-picker
show-time
:style="{ width: '100%' }"
placeholder="请选择实际离港日期"
v-decorator="['atd', { rules: [{ required: true, message: '请选择实际离港日期!' }] }]"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="船公司" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择船公司"
v-decorator="['carrierid', { rules: [{ required: true, message: '请选择船公司!' }] }]"
show-search
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in carrierData" :key="item.code" :value="item.code">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="内部航次" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input
placeholder="请输入内部航次"
v-decorator="['voynoInside', { rules: [{ required: true, message: '请输入内部航次!' }] }]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -179,21 +33,22 @@
<script> <script>
import { DjyTenantConfigEdit } from '@/api/modular/main/TenantConfig' import { DjyTenantConfigEdit } from '@/api/modular/main/TenantConfig'
import Data from './Data.json'
export default { export default {
data() { data() {
return { return {
TypeData: [], TypeData: [],
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 6 } sm: { span: 3 }
}, },
wrapperCol: { wrapperCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 16 } sm: { span: 20 }
}, },
labelCol2: { labelCol2: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 5 } sm: { span: 6 }
}, },
wrapperCol2: { wrapperCol2: {
xs: { span: 24 }, xs: { span: 24 },
@ -202,11 +57,7 @@ export default {
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
tenantData: [], Data
portLoadingData: [],
portTransitData: [],
portDischargeData: [],
carrierData: []
} }
}, },
mounted() {}, mounted() {},
@ -218,21 +69,8 @@ export default {
this.visible = true this.visible = true
setTimeout(() => { setTimeout(() => {
this.form.setFieldsValue({ this.form.setFieldsValue({
tenantId: record.tenantId, WebData: JSON.parse(record.configJson)
vessel: record.vessel,
voyno: record.voyno,
portLoadingId: record.portLoadingId,
portTransitId: record.portTransitId,
portDischargeId: record.portDischargeId,
etd: record.etd,
closingDate: record.closingDate,
eta: record.eta,
wharf: record.wharf,
atd: record.atd,
carrierid: record.carrierid,
voynoInside: record.voynoInside
}) })
console.log(this.form.getFieldsValue())
}, 100) }, 100)
}, },
handleSubmit() { handleSubmit() {
@ -241,18 +79,15 @@ export default {
} = this } = this
this.confirmLoading = true this.confirmLoading = true
validateFields((errors, values) => { validateFields((errors, values) => {
console.log(errors, values)
if (!errors) { if (!errors) {
for (const key in values) { for (const key in values) {
console.log(key, 1)
if (typeof values[key] === 'object' && !(values[key] === null)) { if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key]) values[key] = JSON.stringify(values[key])
} }
} }
console.log(this.form, values.gid)
values.id = this.data.id values.id = this.data.id
console.log(values) values.configJson = values.WebData
DjyTenantConfigEdit(values) DjyTenantConfigEdit({ ...values, type: 'booking_form_col' })
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success('编辑成功') this.$message.success('编辑成功')
@ -278,3 +113,12 @@ export default {
} }
} }
</script> </script>
<style lang="less">
.CsModal {
height: 40vh;
.ant-modal-body {
height: 600px;
overflow-y: auto;
}
}
</style>

@ -1,14 +1,18 @@
<template> <template>
<div> <div>
<a-card :bordered="false" :bodyStyle="tstyle"> <!-- <a-card :bordered="false" :bodyStyle="tstyle">
<div class="table-page-search-wrapper" :class="advanced ? 'Open' : 'Close'"> <div class="table-page-search-wrapper" :class="advanced ? 'Open' : 'Close'">
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="48"> <a-row :gutter="48">
<a-col :md="18"> <a-col :md="18">
<a-row :gutter="48"> <a-row :gutter="48">
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-form-item label="关键词:"> <a-form-item label="租户:">
<a-input placeholder="请输入关键词" v-model="queryParam.KeyWord" /> <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-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -17,16 +21,16 @@
<span class="table-page-search-submitButtons"> <span class="table-page-search-submitButtons">
<a-button type="primary" @click="FnGetData"></a-button> <a-button type="primary" @click="FnGetData"></a-button>
<a-button style="margin-left: 8px" @click="init"></a-button> <a-button style="margin-left: 8px" @click="init"></a-button>
<!-- <a @click="toggleAdvanced" style="margin-left: 8px"> <a @click="toggleAdvanced" style="margin-left: 8px">
{{ advanced ? '收起' : '展开' }} {{ advanced ? '收起' : '展开' }}
<a-icon :type="advanced ? 'up' : 'down'" /> <a-icon :type="advanced ? 'up' : 'down'" />
</a> --> </a>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
</a-card> </a-card> -->
<a-card :bordered="false"> <a-card :bordered="false">
<vxe-toolbar> <vxe-toolbar>
<template #buttons> <template #buttons>
@ -35,9 +39,9 @@
</a-button> </a-button>
</template> </template>
</vxe-toolbar> </vxe-toolbar>
<vxe-table :data="loadData" border :loading="loading" height="600px" empty-text=""> <vxe-table :data="loadData" border :loading="loading" height="670px" empty-text="">
<vxe-column type="seq" width="50" fixed="left"></vxe-column> <vxe-column type="seq" width="50" fixed="left"></vxe-column>
<vxe-column <!-- <vxe-column
v-for="item in columns" v-for="item in columns"
:key="item.dataIndex" :key="item.dataIndex"
:field="item.dataIndex" :field="item.dataIndex"
@ -46,6 +50,16 @@
:align="item.align" :align="item.align"
:show-overflow="true" :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>
<vxe-column title="操作" fixed="right" width="200" align="center"> <vxe-column title="操作" fixed="right" width="200" align="center">
<template #default="{ row }"> <template #default="{ row }">
@ -62,9 +76,10 @@
</div> </div>
</template> </template>
<script> <script>
import { DjyTenantConfigPage, DjyTenantConfigDelete } from '@/api/modular/main/TenantConfig' import { DjyTenantConfigPage, DjyTenantConfigDelete, SysTenantPage } from '@/api/modular/main/TenantConfig'
import addForm from './addForm.vue' import addForm from './addForm.vue'
import editForm from './editForm.vue' import editForm from './editForm.vue'
import Data from './Data.json'
export default { export default {
components: { components: {
addForm, addForm,
@ -72,26 +87,23 @@ export default {
}, },
data() { data() {
return { return {
TypeData: [],
// / // /
advanced: false, advanced: false,
loading: false, loading: false,
setVisible: false, setVisible: false,
setVisible1: false, setVisible1: false,
queryParam: { queryParam: {
// currentPage: 1, Type: 'booking_form_col'
// pageSize: 10,
// totalResult: 1
}, },
ColumnsQuery: [], ColumnsQuery: [],
columns: [ columns: [
{ {
title: '租户Id', title: '租户',
align: 'center', align: 'center',
dataIndex: 'type' dataIndex: 'tenantId'
}, },
{ {
title: '船名', title: '必填项',
align: 'center', align: 'center',
dataIndex: 'configJson' dataIndex: 'configJson'
} }
@ -103,7 +115,9 @@ export default {
WCodeData: [], WCodeData: [],
ModulesData: [], ModulesData: [],
carrierCodeData: [], carrierCodeData: [],
UserList: [] UserList: [],
TenantData: [],
Data
} }
}, },
created() {}, created() {},
@ -111,11 +125,34 @@ export default {
this.init() this.init()
}, },
methods: { 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) { confirm(e) {
this.FnDel(e) this.FnDel(e)
}, },
FnDel(data) { FnDel(data) {
DjyTenantConfigDelete({ Ids: data.id }).then(res => { DjyTenantConfigDelete({ id: data.id }).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.FnGetData() this.FnGetData()
}) })
@ -127,6 +164,9 @@ export default {
Object.assign(this.$data, this.$options.data()) Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns this.ColumnsQuery = this.columns
this.FnGetData() this.FnGetData()
SysTenantPage().then(res => {
this.TenantData = res.data.rows
})
}, },
FnGetData() { FnGetData() {
this.loading = true this.loading = true

Loading…
Cancel
Save