|
@@ -29,6 +29,7 @@ const isetaFocused = ref(false)
|
|
|
const ManageVisible = ref(false)
|
|
const ManageVisible = ref(false)
|
|
|
const AddNewAddressVisible = ref(false)
|
|
const AddNewAddressVisible = ref(false)
|
|
|
const NoPermissionVisible = ref(false)
|
|
const NoPermissionVisible = ref(false)
|
|
|
|
|
+const CancelRulesVisible = ref(false)
|
|
|
const NoEligibleVisible = ref(false)
|
|
const NoEligibleVisible = ref(false)
|
|
|
const isDisabled = ref(false)
|
|
const isDisabled = ref(false)
|
|
|
const SaveedVisible = ref(false)
|
|
const SaveedVisible = ref(false)
|
|
@@ -262,22 +263,15 @@ const getInitBookingData = () => {
|
|
|
}
|
|
}
|
|
|
// 查询Shipments
|
|
// 查询Shipments
|
|
|
const SearchShipment = () => {
|
|
const SearchShipment = () => {
|
|
|
- $api
|
|
|
|
|
- .BookingTableSearch({
|
|
|
|
|
- serial_no: a != undefined ? a: '',
|
|
|
|
|
|
|
+ let obj = {
|
|
|
text_search: CreateNewBOokingSearch.value,
|
|
text_search: CreateNewBOokingSearch.value,
|
|
|
vessel: VesselNametest.value,
|
|
vessel: VesselNametest.value,
|
|
|
- eta_start: ETATimeList.value.length != 0 ? ETATimeList.value[0] : '',
|
|
|
|
|
- eta_end: ETATimeList.value.length != 0 ? ETATimeList.value[1] : '',
|
|
|
|
|
- ata_start: ATATimeList.value.length != 0 ? ATATimeList.value[0] : '',
|
|
|
|
|
- ata_end: ATATimeList.value.length != 0 ? ATATimeList.value[1] : ''
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- .then((res: any) => {
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- console.log(res.data)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ eta_start: ETATimeList.value != null ? ETATimeList.value[0] : '',
|
|
|
|
|
+ eta_end: ETATimeList.value != null ? ETATimeList.value[1] : '',
|
|
|
|
|
+ ata_start: ATATimeList.value != null ? ATATimeList.value[0] : '',
|
|
|
|
|
+ ata_end: ATATimeList.value != null ? ATATimeList.value[1] : ''
|
|
|
|
|
+ }
|
|
|
|
|
+ bookingTableRef.value.searchTableData(obj)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 选择shipments获取address book
|
|
// 选择shipments获取address book
|
|
@@ -300,29 +294,31 @@ const areAllDateRangesSame = (date: any) => {
|
|
|
}
|
|
}
|
|
|
// 遍历日期
|
|
// 遍历日期
|
|
|
const getDateRangeArray = (startDateStr, endDateStr) => {
|
|
const getDateRangeArray = (startDateStr, endDateStr) => {
|
|
|
- const parseDate = (str) => {
|
|
|
|
|
- const [year, month, day] = str.split('.').map(Number);
|
|
|
|
|
- return new Date(year, month - 1, day); // 月份从0开始计数
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ if(startDateStr != '' && endDateStr != '') {
|
|
|
|
|
+ const parseDate = (str) => {
|
|
|
|
|
+ const [year, month, day] = str.split('.').map(Number);
|
|
|
|
|
+ return new Date(year, month - 1, day); // 月份从0开始计数
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- const startDate = parseDate(startDateStr);
|
|
|
|
|
- const endDate = parseDate(endDateStr);
|
|
|
|
|
|
|
+ const startDate = parseDate(startDateStr);
|
|
|
|
|
+ const endDate = parseDate(endDateStr);
|
|
|
|
|
|
|
|
- const dateArray = [];
|
|
|
|
|
- const currentDate = new Date(startDate);
|
|
|
|
|
-
|
|
|
|
|
- while (currentDate <= endDate) {
|
|
|
|
|
- // 格式化为 YYYY.MM.DD
|
|
|
|
|
- const formattedDate = [
|
|
|
|
|
- currentDate.getFullYear(),
|
|
|
|
|
- (currentDate.getMonth() + 1).toString().padStart(2, '0'),
|
|
|
|
|
- currentDate.getDate().toString().padStart(2, '0')
|
|
|
|
|
- ].join('.');
|
|
|
|
|
- dateArray.push(formattedDate);
|
|
|
|
|
- currentDate.setDate(currentDate.getDate() + 1);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const dateArray = [];
|
|
|
|
|
+ const currentDate = new Date(startDate);
|
|
|
|
|
+
|
|
|
|
|
+ while (currentDate <= endDate) {
|
|
|
|
|
+ // 格式化为 YYYY.MM.DD
|
|
|
|
|
+ const formattedDate = [
|
|
|
|
|
+ currentDate.getFullYear(),
|
|
|
|
|
+ (currentDate.getMonth() + 1).toString().padStart(2, '0'),
|
|
|
|
|
+ currentDate.getDate().toString().padStart(2, '0')
|
|
|
|
|
+ ].join('.');
|
|
|
|
|
+ dateArray.push(formattedDate);
|
|
|
|
|
+ currentDate.setDate(currentDate.getDate() + 1);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return dateArray;
|
|
|
|
|
|
|
+ return dateArray;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
const selectChangeEvent = (val: any, date: any, submitInfo: any) => {
|
|
const selectChangeEvent = (val: any, date: any, submitInfo: any) => {
|
|
|
checkShipmentsSubmitInfo.value = submitInfo
|
|
checkShipmentsSubmitInfo.value = submitInfo
|
|
@@ -401,17 +397,17 @@ onMounted(() => {
|
|
|
<div v-if="a == undefined">Create New Booking</div>
|
|
<div v-if="a == undefined">Create New Booking</div>
|
|
|
<div v-else>Modify Booking</div>
|
|
<div v-else>Modify Booking</div>
|
|
|
<div class="flex">
|
|
<div class="flex">
|
|
|
- <el-button class="el-button--default create-button"><span class="font_family icon-icon_return_b"></span> Cancel</el-button>
|
|
|
|
|
|
|
+ <el-button @click="CancelRulesVisible = true" class="el-button--default create-button"><span class="font_family icon-icon_return_b"></span> Cancel</el-button>
|
|
|
<el-button :disabled="isNotSubmit" @click="SubmitBooking" class="el-button--main create-button"><span class="font_family icon-icon_submit_b"></span> Submit</el-button>
|
|
<el-button :disabled="isNotSubmit" @click="SubmitBooking" class="el-button--main create-button"><span class="font_family icon-icon_submit_b"></span> Submit</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="booking-info">
|
|
|
|
|
|
|
+ <div class="booking-info" v-if="a != undefined">
|
|
|
<div class="booking-no">
|
|
<div class="booking-no">
|
|
|
<span class="no">Booking No.{{ booking }}</span>
|
|
<span class="no">Booking No.{{ booking }}</span>
|
|
|
<v-tag class="tag" type="Pending Approval">{{ status }}</v-tag>
|
|
<v-tag class="tag" type="Pending Approval">{{ status }}</v-tag>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-divider style="margin: 8px 0" />
|
|
|
|
|
|
|
+ <el-divider v-if="a != undefined" style="margin: 8px 0" />
|
|
|
<!-- Select Shipments -->
|
|
<!-- Select Shipments -->
|
|
|
<div class="select_shipments">
|
|
<div class="select_shipments">
|
|
|
<div style="margin-bottom: 16px;"><span class="stars_red">*</span>Select Shipments</div>
|
|
<div style="margin-bottom: 16px;"><span class="stars_red">*</span>Select Shipments</div>
|
|
@@ -687,6 +683,31 @@ onMounted(() => {
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+ <!-- 取消保存 -->
|
|
|
|
|
+ <el-dialog v-model="CancelRulesVisible" width="480">
|
|
|
|
|
+ <div style="font-weight: 400">You have unsaved changes.</div>
|
|
|
|
|
+ <div style="font-weight: 400">Are you sure you want to leave this page?</div>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button type="default" @click="CancelRulesVisible = false" style="width: 100px"
|
|
|
|
|
+ >Cancel</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button class="el-button--warning" @click="router.back()" style="width: 100px">
|
|
|
|
|
+ OK
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #header>
|
|
|
|
|
+ <div class="cancel_header">
|
|
|
|
|
+ <span class="iconfont_icon iconfont_warning">
|
|
|
|
|
+ <svg class="iconfont icon_warning" aria-hidden="true">
|
|
|
|
|
+ <use xlink:href="#icon-icon_tipsfilled_b"></use>
|
|
|
|
|
+ </svg>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ Unsaved Changes
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
<!-- 當選擇非建議日期内的date時給出的提示 -->
|
|
<!-- 當選擇非建議日期内的date時給出的提示 -->
|
|
|
<el-dialog v-model="isRecommendDate" width="480">
|
|
<el-dialog v-model="isRecommendDate" width="480">
|
|
|
<div>{{ recommendateWarning }}</div>
|
|
<div>{{ recommendateWarning }}</div>
|