张同海 2 years ago
parent 0dd69192d0
commit 5b212ae7f2

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

@ -10,7 +10,7 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="12">
<!-- <a-col :span="12">
<a-form-item label="类型" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择类型"
@ -26,10 +26,10 @@
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-col> -->
<a-col :span="24">
<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-col :span="6" v-for="item2 in item.children" :key="item2.code">
<a-checkbox :value="item2.code">{{ item2.name }}</a-checkbox>
@ -69,14 +69,10 @@ export default {
Data,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
TypeData: []
form: this.$form.createForm(this)
}
},
mounted() {
this.TypeData = this.$options.filters['dictData']('customer_config_type')
console.log(this.TypeData)
},
mounted() {},
methods: {
//
add(record) {
@ -101,7 +97,8 @@ export default {
values[key] = JSON.stringify(values[key])
}
}
DjyTenantConfigAdd(values)
values.configJson = values.WebData
DjyTenantConfigAdd({ ...values, type: 'booking_form_col' })
.then(res => {
if (res.success) {
this.$message.success('新增成功')

@ -10,165 +10,15 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="12">
<a-form-item label="租户" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-select
placeholder="请选择租户"
v-decorator="['tenantId', { 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 tenantData" :key="item.id" :value="item.id">
{{ 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 :span="24">
<a-form-item label="必填项" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-checkbox-group v-decorator="['WebData']" :style="{ width: '100%', marginTop: '10px' }">
<a-row v-for="item in Data" :key="item.title">
<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-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-row>
</a-checkbox-group>
</a-form-item>
</a-col>
</a-row>
@ -179,21 +29,22 @@
<script>
import { DjyTenantConfigEdit } from '@/api/modular/main/TenantConfig'
import Data from './Data.json'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
sm: { span: 3 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
sm: { span: 20 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 5 }
sm: { span: 6 }
},
wrapperCol2: {
xs: { span: 24 },
@ -202,11 +53,7 @@ export default {
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
tenantData: [],
portLoadingData: [],
portTransitData: [],
portDischargeData: [],
carrierData: []
Data
}
},
mounted() {},
@ -218,21 +65,8 @@ export default {
this.visible = true
setTimeout(() => {
this.form.setFieldsValue({
tenantId: record.tenantId,
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
WebData: JSON.parse(record.configJson)
})
console.log(this.form.getFieldsValue())
}, 100)
},
handleSubmit() {
@ -241,18 +75,15 @@ export default {
} = this
this.confirmLoading = true
validateFields((errors, values) => {
console.log(errors, values)
if (!errors) {
for (const key in values) {
console.log(key, 1)
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
console.log(this.form, values.gid)
values.id = this.data.id
console.log(values)
DjyTenantConfigEdit(values)
values.configJson = values.WebData
DjyTenantConfigEdit({ ...values, type: 'booking_form_col' })
.then(res => {
if (res.success) {
this.$message.success('编辑成功')

@ -1,14 +1,18 @@
<template>
<div>
<a-card :bordered="false" :bodyStyle="tstyle">
<!-- <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-input placeholder="请输入关键词" v-model="queryParam.KeyWord" />
<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>
@ -17,16 +21,16 @@
<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">
<a @click="toggleAdvanced" style="margin-left: 8px">
{{ advanced ? '收起' : '展开' }}
<a-icon :type="advanced ? 'up' : 'down'" />
</a> -->
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
</a-card>
</a-card> -->
<a-card :bordered="false">
<vxe-toolbar>
<template #buttons>
@ -35,9 +39,9 @@
</a-button>
</template>
</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
<!-- <vxe-column
v-for="item in columns"
:key="item.dataIndex"
:field="item.dataIndex"
@ -46,6 +50,16 @@
: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 }">
@ -62,9 +76,10 @@
</div>
</template>
<script>
import { DjyTenantConfigPage, DjyTenantConfigDelete } from '@/api/modular/main/TenantConfig'
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,
@ -72,26 +87,23 @@ export default {
},
data() {
return {
TypeData: [],
// /
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
// currentPage: 1,
// pageSize: 10,
// totalResult: 1
Type: 'booking_form_col'
},
ColumnsQuery: [],
columns: [
{
title: '租户Id',
title: '租户',
align: 'center',
dataIndex: 'type'
dataIndex: 'tenantId'
},
{
title: '船名',
title: '必填项',
align: 'center',
dataIndex: 'configJson'
}
@ -103,7 +115,9 @@ export default {
WCodeData: [],
ModulesData: [],
carrierCodeData: [],
UserList: []
UserList: [],
TenantData: [],
Data
}
},
created() {},
@ -111,11 +125,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({ Ids: data.id }).then(res => {
DjyTenantConfigDelete({ id: data.id }).then(res => {
this.$message.success('删除成功')
this.FnGetData()
})
@ -127,6 +164,9 @@ export default {
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

Loading…
Cancel
Save