@@ -923,9 +923,11 @@ export default {
Promise.all([request1, request2])
.then(([res1, res2]) => {
if (res1.success) {
- this.tempList = res1.data;
if (res1.data.length > 0) {
this.templateId = res1.data[0].id;
+ this.tempList = res1.data;
+ } else {
+ this.tempList = []
}
} else {
this.$message.error(res1.message);
@@ -938,12 +940,13 @@ export default {
this.toShipPKId = res2.data.ext[0].toShipList[0].pkId;
}
} else {
- this.sendShip = {};
+ this.sendShip = { fromShip: {}, toShipList: [] }
}
} else {
this.$message.error(res2.data.msg);
}
- const data1 = {
+ if (this.templateId && this.sendShip.fromShip.pkId && this.toShipPKId) {
+ const data1 = {
taskId: this.$route.query.taskPKId,
templateId: this.templateId,
fromShipPKId: this.sendShip.fromShip.pkId,
@@ -957,6 +960,9 @@ export default {
this.$message.error(res.data.msg)
}
})
+ } else {
+ this.sendLoad = false;
+ }
})
.catch(error => {
console.error('Error fetching data:', error);
@@ -1305,7 +1311,7 @@ export default {
})
},
handleRefsh() {
- RefreshBookingorder({ nominationId: this.$route.query.taskPKId }).then(res => {
+ RefreshBookingorder({ taskPkId: this.$route.query.taskPKId }).then(res => {
if (res.data.succ) {
this.$message.success('操作成功')
} else {
diff --git a/src/views/main/vesselinfo/addForm.vue b/src/views/main/vesselinfo/addForm.vue
index 5c13d48..92be22d 100644
--- a/src/views/main/vesselinfo/addForm.vue
+++ b/src/views/main/vesselinfo/addForm.vue
@@ -392,6 +392,8 @@ export default {
portTransitId: record.portTransitId,
portDischargeId: record.portDischargeId,
portTransit: record.portTransit,
+ portLoadingId: '',
+ portLoading: '',
portDischarge: record.portDischarge,
etd: record.etd,
closingDate: record.closingDate,
diff --git a/src/views/main/vesselinfo/editForm.vue b/src/views/main/vesselinfo/editForm.vue
index 90931b7..ef183a4 100644
--- a/src/views/main/vesselinfo/editForm.vue
+++ b/src/views/main/vesselinfo/editForm.vue
@@ -4,7 +4,6 @@
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
- @ok="handleSubmit"
@cancel="handleCancel"
>
@@ -227,6 +226,11 @@
+
+ 关闭
+ 保存并复制
+ 保存
+
@@ -304,6 +308,103 @@ export default {
console.log(this.form.getFieldsValue())
}, 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
+ }
+ })
+ }
+ 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 (this.yardData.length) {
+ this.yardData.forEach(item => {
+ if (item.code == values.yardCode) {
+ values.yard = item.name
+ }
+ })
+ }
+ 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({
+ vessel: record.vessel,
+ voyno: record.voyno,
+ portTransitId: record.portTransitId,
+ portDischargeId: record.portDischargeId,
+ portTransit: record.portTransit,
+ portLoadingId: '',
+ portLoading: '',
+ 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
+ })
+ }, 100)
+ },
// tenantSearch(data) {
// SysTenantPage({ Name: data }).then(res => {
// this.tenantData = res.data.rows