|
|
|
@ -7,32 +7,13 @@
|
|
|
|
|
@cancel="handleCancel"
|
|
|
|
|
>
|
|
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
|
|
<a-form :form="form">
|
|
|
|
|
<a-form-model ref="ruleForm" :model="form" :rules="rules" >
|
|
|
|
|
<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
|
|
|
|
|
@focus="tenantSearch"
|
|
|
|
|
@search="tenantSearch"
|
|
|
|
|
: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-form-model-item label="船名" prop="vessel" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
placeholder="请选择船名"
|
|
|
|
|
v-decorator="['vessel', { rules: [{ required: true, message: '请选择船名!' }] }]"
|
|
|
|
|
v-model="form.vessel"
|
|
|
|
|
show-search
|
|
|
|
|
@focus="vesselSearch"
|
|
|
|
|
@search="vesselSearch"
|
|
|
|
@ -45,14 +26,15 @@
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="船公司" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="船公司" prop="carrierid" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
placeholder="请选择船公司"
|
|
|
|
|
v-decorator="['carrierid', { rules: [{ required: true, message: '请选择船公司!' }] }]"
|
|
|
|
|
show-search
|
|
|
|
|
v-model="form.carrierid"
|
|
|
|
|
@focus="carrierSearch"
|
|
|
|
|
@search="carrierSearch"
|
|
|
|
|
:default-active-first-option="false"
|
|
|
|
@ -64,141 +46,129 @@
|
|
|
|
|
{{ item.cnName }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="内部航次" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="内部航次" prop="voynoInside" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入内部航次"
|
|
|
|
|
v-model="form.voynoInside"
|
|
|
|
|
v-decorator="['voynoInside', { rules: [{ required: true, message: '请输入内部航次!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="航次" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="航次" prop="voyno" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入航次"
|
|
|
|
|
v-model="form.voyno"
|
|
|
|
|
v-decorator="['voyno', { rules: [{ required: true, message: '请输入航次!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="云港通ETD" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="云港通ETD" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-date-picker
|
|
|
|
|
show-time
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
v-model="form.ygtETD"
|
|
|
|
|
placeholder="请选择云港通ETD"
|
|
|
|
|
v-decorator="['ygtETD']"
|
|
|
|
|
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="开船日期" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="开船日期" prop="etd" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-date-picker
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
v-model="form.etd"
|
|
|
|
|
placeholder="请选择开船日期"
|
|
|
|
|
v-decorator="['etd', { rules: [{ required: true, message: '请选择开船日期!' }] }]"
|
|
|
|
|
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="截港时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="截港时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-date-picker
|
|
|
|
|
show-time
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
placeholder="请选择截港时间"
|
|
|
|
|
v-decorator="['closingDate']"
|
|
|
|
|
v-model="form.closingDate"
|
|
|
|
|
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="截单时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="截单时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-date-picker
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
v-model="form.closeDocTime"
|
|
|
|
|
placeholder="请选择截单时间"
|
|
|
|
|
show-time
|
|
|
|
|
v-decorator="['closeDocTime']"
|
|
|
|
|
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="实际开船" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="实际开船" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-date-picker
|
|
|
|
|
show-time
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
v-model="form.atd"
|
|
|
|
|
placeholder="请选择实际开船时间"
|
|
|
|
|
v-decorator="['atd']"
|
|
|
|
|
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="装货港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
placeholder="请选择装货港"
|
|
|
|
|
v-decorator="['portLoadingId']"
|
|
|
|
|
show-search
|
|
|
|
|
@focus="portLoadingSearch"
|
|
|
|
|
@search="portLoadingSearch"
|
|
|
|
|
: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-form-model-item label="装货港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<selectView
|
|
|
|
|
type="portloadid"
|
|
|
|
|
:defaultVal="form.portLoading"
|
|
|
|
|
searchApi="GetPortloadlist"
|
|
|
|
|
size="default"
|
|
|
|
|
:searchQuery="{ KeyWord: '' }"
|
|
|
|
|
:isCopy="false"
|
|
|
|
|
:showLabel="['ediCode', 'enName']"
|
|
|
|
|
:openSearch="true"
|
|
|
|
|
@change="getSelectViewRes"></selectView>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="中转港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
placeholder="请选择中转港"
|
|
|
|
|
v-decorator="['portTransitId']"
|
|
|
|
|
show-search
|
|
|
|
|
@focus="portTransitSearch"
|
|
|
|
|
@search="portTransitSearch"
|
|
|
|
|
: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-form-model-item label="中转港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<selectView
|
|
|
|
|
type="transportid"
|
|
|
|
|
:defaultVal="form.portTransit"
|
|
|
|
|
searchApi="GetPortlist"
|
|
|
|
|
:searchQuery="{ KeyWord: '' }"
|
|
|
|
|
:showLabel="['ediCode', 'enName']"
|
|
|
|
|
size="default"
|
|
|
|
|
:openSearch="true"
|
|
|
|
|
:isCopy="false"
|
|
|
|
|
@change="getSelectViewRes"></selectView>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="卸货港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
placeholder="请选择卸货港"
|
|
|
|
|
v-decorator="['portDischargeId']"
|
|
|
|
|
show-search
|
|
|
|
|
@focus="portDischargeSearch"
|
|
|
|
|
@search="portDischargeSearch"
|
|
|
|
|
: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-form-model-item label="卸货港" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<selectView
|
|
|
|
|
type="portdischargeid"
|
|
|
|
|
:defaultVal="form.portDischarge"
|
|
|
|
|
searchApi="GetPortlist"
|
|
|
|
|
:searchQuery="{ KeyWord: '' }"
|
|
|
|
|
:showLabel="['ediCode', 'enName']"
|
|
|
|
|
size="default"
|
|
|
|
|
:openSearch="true"
|
|
|
|
|
:isCopy="false"
|
|
|
|
|
@change="getSelectViewRes"></selectView>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="默认场站" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="默认场站" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
placeholder="请选择默认场站"
|
|
|
|
|
v-decorator="['yardCode']"
|
|
|
|
|
v-model="form.yardCode"
|
|
|
|
|
show-search
|
|
|
|
|
@focus="yardSearch"
|
|
|
|
|
@search="yardSearch"
|
|
|
|
@ -211,25 +181,25 @@
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-item label="预抵日期" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-form-model-item label="预抵日期" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
|
|
|
|
|
<a-date-picker
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
placeholder="请选择预抵日期"
|
|
|
|
|
v-decorator="['eta']"
|
|
|
|
|
v-model="form.eta"
|
|
|
|
|
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-form-model>
|
|
|
|
|
</a-spin>
|
|
|
|
|
<template slot="footer">
|
|
|
|
|
<a-button type="danger" @click="handleCancel">关闭</a-button>
|
|
|
|
|
<a-button type="primary" @click="handleCopySave">保存并复制</a-button>
|
|
|
|
|
<a-button type="primary" @click="handleSubmit">保存</a-button>
|
|
|
|
|
<a-button type="primary" @click="handleSubmit(true)">保存并复制</a-button>
|
|
|
|
|
<a-button type="primary" @click="handleSubmit(false)">保存</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</template>
|
|
|
|
@ -244,10 +214,18 @@ import {
|
|
|
|
|
GetVessellist,
|
|
|
|
|
GetYardlist
|
|
|
|
|
} from '@/api/modular/main/vesselinfo'
|
|
|
|
|
import selectView from '../BookingLedger/detail/components/selectView.vue'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
TypeData: [],
|
|
|
|
|
rules: {
|
|
|
|
|
voynoInside: [{ required: true, message: '请输入内部航次!', trigger: 'blur' }],
|
|
|
|
|
etd: [{ required: true, message: '请选择开船日期', trigger: 'blur' }],
|
|
|
|
|
voyno: [{ required: true, message: '请输入航次', trigger: 'blur' }],
|
|
|
|
|
carrierid: [{ required: true, message: '请选择船公司', trigger: 'blur' }],
|
|
|
|
|
vessel: [{ required: true, message: '请选择船名', trigger: 'blur' }]
|
|
|
|
|
},
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 6 }
|
|
|
|
@ -276,114 +254,36 @@ export default {
|
|
|
|
|
yardData: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
selectView
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
methods: {
|
|
|
|
|
// 初始化方法
|
|
|
|
|
edit(record) {
|
|
|
|
|
this.data = record
|
|
|
|
|
console.log(record)
|
|
|
|
|
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,
|
|
|
|
|
portLoading: record.portLoading,
|
|
|
|
|
portTransit: record.portTransit,
|
|
|
|
|
portDischarge: record.portDischarge,
|
|
|
|
|
etd: record.etd,
|
|
|
|
|
closingDate: record.closingDate,
|
|
|
|
|
eta: record.eta,
|
|
|
|
|
yard: record.yard,
|
|
|
|
|
ygtETD: record.ygtETD,
|
|
|
|
|
yardCode: record.yardCode,
|
|
|
|
|
atd: record.atd,
|
|
|
|
|
carrierid: record.carrierid,
|
|
|
|
|
voynoInside: record.voynoInside,
|
|
|
|
|
closeDocTime: record.closeDocTime
|
|
|
|
|
})
|
|
|
|
|
console.log(this.form.getFieldsValue())
|
|
|
|
|
this.form = record
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}, 100)
|
|
|
|
|
},
|
|
|
|
|
handleCopySave() {
|
|
|
|
|
const {
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
} = 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])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!values.carrier) {
|
|
|
|
|
values.carrier = this.data.carrier
|
|
|
|
|
}
|
|
|
|
|
values.id = this.data.id
|
|
|
|
|
if (this.portLoadingData.length) {
|
|
|
|
|
this.portLoadingData.forEach(item => {
|
|
|
|
|
if (item.code == values.portLoadingId) {
|
|
|
|
|
values.portLoading = item.enName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.portTransitData.length) {
|
|
|
|
|
this.portTransitData.forEach(item => {
|
|
|
|
|
if (item.code == values.portTransitId) {
|
|
|
|
|
values.portTransit = item.enName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
getSelectViewRes({ type, res }) {
|
|
|
|
|
if (type === 'portloadid') {
|
|
|
|
|
this.form.portLoadingId = res.ediCode
|
|
|
|
|
}
|
|
|
|
|
if (this.portDischargeData.length) {
|
|
|
|
|
this.portDischargeData.forEach(item => {
|
|
|
|
|
if (item.code == values.portDischargeId) {
|
|
|
|
|
values.portDischarge = item.enName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.carrierData.length) {
|
|
|
|
|
this.carrierData.forEach(item => {
|
|
|
|
|
if (item.code == values.carrierid) {
|
|
|
|
|
values.carrier = item.cnName
|
|
|
|
|
if (type === 'portdischargeid') {
|
|
|
|
|
this.form.portDischargeId = res.ediCode
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.yardData.length) {
|
|
|
|
|
this.yardData.forEach(item => {
|
|
|
|
|
if (item.code == values.yardCode) {
|
|
|
|
|
values.yard = item.name
|
|
|
|
|
if (type === 'transportid') {
|
|
|
|
|
this.form.portTransitId = res.ediCode
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
DjyVesselInfoServiceAddOrUpdate(values)
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('编辑成功')
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
this.editRow(values)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`编辑失败,${res.message}`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.finally(res => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
editRow(record) {
|
|
|
|
|
this.data = record
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
this.form = {
|
|
|
|
|
vessel: record.vessel,
|
|
|
|
|
voyno: record.voyno,
|
|
|
|
|
portTransitId: record.portTransitId,
|
|
|
|
@ -402,14 +302,10 @@ export default {
|
|
|
|
|
carrierid: record.carrierid,
|
|
|
|
|
voynoInside: record.voynoInside,
|
|
|
|
|
closeDocTime: record.closeDocTime
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}, 100)
|
|
|
|
|
},
|
|
|
|
|
// tenantSearch(data) {
|
|
|
|
|
// SysTenantPage({ Name: data }).then(res => {
|
|
|
|
|
// this.tenantData = res.data.rows
|
|
|
|
|
// })
|
|
|
|
|
// },
|
|
|
|
|
portLoadingSearch(data) {
|
|
|
|
|
GetPortloadlist({ KeyWord: data }).then(res => {
|
|
|
|
|
this.portLoadingData = res.data
|
|
|
|
@ -440,80 +336,74 @@ export default {
|
|
|
|
|
this.yardData = res.data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
const {
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
} = 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])
|
|
|
|
|
handleSubmit(isCopy) {
|
|
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (!this.form.carrier) {
|
|
|
|
|
this.form.carrier = this.data.carrier
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!values.carrier) {
|
|
|
|
|
values.carrier = this.data.carrier
|
|
|
|
|
}
|
|
|
|
|
values.id = this.data.id
|
|
|
|
|
if (this.portLoadingData.length) {
|
|
|
|
|
this.portLoadingData.forEach(item => {
|
|
|
|
|
if (item.code == values.portLoadingId) {
|
|
|
|
|
values.portLoading = item.enName
|
|
|
|
|
if (item.ediCode == this.form.portLoadingId) {
|
|
|
|
|
this.form.portLoading = item.enName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.portTransitData.length) {
|
|
|
|
|
this.portTransitData.forEach(item => {
|
|
|
|
|
if (item.code == values.portTransitId) {
|
|
|
|
|
values.portTransit = item.enName
|
|
|
|
|
if (item.ediCode == this.form.portTransitId) {
|
|
|
|
|
this.form.portTransit = item.enName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.portDischargeData.length) {
|
|
|
|
|
this.portDischargeData.forEach(item => {
|
|
|
|
|
if (item.code == values.portDischargeId) {
|
|
|
|
|
values.portDischarge = item.enName
|
|
|
|
|
if (item.ediCode == this.form.portDischargeId) {
|
|
|
|
|
this.form.portDischarge = item.enName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.carrierData.length) {
|
|
|
|
|
this.carrierData.forEach(item => {
|
|
|
|
|
if (item.code == values.carrierid) {
|
|
|
|
|
values.carrier = item.cnName
|
|
|
|
|
if (item.code == this.form.carrierid) {
|
|
|
|
|
this.form.carrier = item.cnName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.yardData.length) {
|
|
|
|
|
this.yardData.forEach(item => {
|
|
|
|
|
if (item.code == values.yardCode) {
|
|
|
|
|
values.yard = item.name
|
|
|
|
|
if (item.code == this.form.yardCode) {
|
|
|
|
|
this.form.yard = item.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
DjyVesselInfoServiceAddOrUpdate(values)
|
|
|
|
|
if (!isCopy) {
|
|
|
|
|
this.form.id = this.data.id
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
DjyVesselInfoServiceAddOrUpdate(this.form)
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('编辑成功')
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
this.$emit('ok', this.form)
|
|
|
|
|
if (isCopy) {
|
|
|
|
|
this.editRow(this.form)
|
|
|
|
|
} else {
|
|
|
|
|
this.handleCancel()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`编辑失败,${res.message}`)
|
|
|
|
|
}
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
.finally(res => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleCancel() {
|
|
|
|
|
this.form.resetFields()
|
|
|
|
|
this.visible = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|