|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<a-modal
|
|
|
|
|
class="CsModal"
|
|
|
|
|
title="编辑配置"
|
|
|
|
|
:width="1100"
|
|
|
|
|
:visible="visible"
|
|
|
|
@ -10,165 +11,18 @@
|
|
|
|
|
<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>
|
|
|
|
|
<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-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-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-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
@ -179,21 +33,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 +57,7 @@ export default {
|
|
|
|
|
visible: false,
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
|
tenantData: [],
|
|
|
|
|
portLoadingData: [],
|
|
|
|
|
portTransitData: [],
|
|
|
|
|
portDischargeData: [],
|
|
|
|
|
carrierData: []
|
|
|
|
|
Data
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
@ -218,21 +69,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 +79,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('编辑成功')
|
|
|
|
@ -278,3 +113,12 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.CsModal {
|
|
|
|
|
height: 40vh;
|
|
|
|
|
.ant-modal-body {
|
|
|
|
|
height: 600px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|