|
@@ -3,16 +3,16 @@ import ValidityPeriod from './components/ValidityPeriod.vue'
|
|
|
import TimeRange from './components/TimeRange.vue'
|
|
import TimeRange from './components/TimeRange.vue'
|
|
|
import EmailConfiguration from './components/EmailConfiguration.vue'
|
|
import EmailConfiguration from './components/EmailConfiguration.vue'
|
|
|
import FieldsTable from './components/FieldsTable.vue'
|
|
import FieldsTable from './components/FieldsTable.vue'
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
|
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
|
|
+const router = useRouter()
|
|
|
const serialNo = route.query.id as string
|
|
const serialNo = route.query.id as string
|
|
|
|
|
|
|
|
const fieldsTableRef = ref()
|
|
const fieldsTableRef = ref()
|
|
|
-
|
|
|
|
|
const customStartDate = ref('')
|
|
const customStartDate = ref('')
|
|
|
const customEndDate = ref('')
|
|
const customEndDate = ref('')
|
|
|
-
|
|
|
|
|
|
|
+const loading = ref(false)
|
|
|
const pageData: any = ref({
|
|
const pageData: any = ref({
|
|
|
validityPeriod: {
|
|
validityPeriod: {
|
|
|
type: '',
|
|
type: '',
|
|
@@ -30,27 +30,31 @@ const pageData: any = ref({
|
|
|
emailRecipients: '',
|
|
emailRecipients: '',
|
|
|
scheduleDetails: {},
|
|
scheduleDetails: {},
|
|
|
timezone: ''
|
|
timezone: ''
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ orderBy: ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- $api.getReportScheduleData({ serial_no: serialNo }).then((res: any) => {
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- console.log(res.data)
|
|
|
|
|
- pageData.value = res.data.showData
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ $api
|
|
|
|
|
+ .getReportScheduleData({ serial_no: serialNo })
|
|
|
|
|
+ .then((res: any) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ pageData.value = res.data.showData
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 提交ValidityPeriod组件数据
|
|
// 提交ValidityPeriod组件数据
|
|
|
const handleSubmitValidity = (data: any) => {
|
|
const handleSubmitValidity = (data: any) => {
|
|
|
customStartDate.value = data.startDate
|
|
customStartDate.value = data.startDate
|
|
|
customEndDate.value = data.endDate
|
|
customEndDate.value = data.endDate
|
|
|
- console.log(data)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const changeTimeRange = (data: any) => {
|
|
const changeTimeRange = (data: any) => {
|
|
|
- console.log(data, 'value')
|
|
|
|
|
const queryData = {
|
|
const queryData = {
|
|
|
startDate: data.startDate,
|
|
startDate: data.startDate,
|
|
|
endDate: data.endDate,
|
|
endDate: data.endDate,
|
|
@@ -70,6 +74,7 @@ const handleSave = () => {
|
|
|
const validityPeriod = validityPeriodRef.value.getData()
|
|
const validityPeriod = validityPeriodRef.value.getData()
|
|
|
const timeRange = timeRangeRef.value.getData()
|
|
const timeRange = timeRangeRef.value.getData()
|
|
|
const emailConfiguration = emailConfigurationRef.value.getData()
|
|
const emailConfiguration = emailConfigurationRef.value.getData()
|
|
|
|
|
+ const orderBy = fieldsTableRef.value.getData()
|
|
|
// 如果有一个返回false, 则代表有未填选项 结束保存
|
|
// 如果有一个返回false, 则代表有未填选项 结束保存
|
|
|
if (!validityPeriod || !timeRange || !emailConfiguration) return
|
|
if (!validityPeriod || !timeRange || !emailConfiguration) return
|
|
|
const queryData = {
|
|
const queryData = {
|
|
@@ -82,57 +87,69 @@ const handleSave = () => {
|
|
|
endDate: timeRange.endValue,
|
|
endDate: timeRange.endValue,
|
|
|
emailRecipients: emailConfiguration.emailRecipients,
|
|
emailRecipients: emailConfiguration.emailRecipients,
|
|
|
deliveryFrequency: emailConfiguration.deliveryFrequency,
|
|
deliveryFrequency: emailConfiguration.deliveryFrequency,
|
|
|
- scheduleDetails: emailConfiguration.scheduleDetails,
|
|
|
|
|
- timezone: emailConfiguration.timezone
|
|
|
|
|
|
|
+ timezone: emailConfiguration.timezone,
|
|
|
|
|
+ ...emailConfiguration.scheduleDetails,
|
|
|
|
|
+ orderBy
|
|
|
}
|
|
}
|
|
|
$api
|
|
$api
|
|
|
.saveReportScheduleData({
|
|
.saveReportScheduleData({
|
|
|
serial_no: serialNo,
|
|
serial_no: serialNo,
|
|
|
...queryData
|
|
...queryData
|
|
|
})
|
|
})
|
|
|
- .then((res: any) => {})
|
|
|
|
|
|
|
+ .then((res: any) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ ElMessage.success('Save Success')
|
|
|
|
|
+ router.push({ path: '/report' })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="Title">
|
|
|
|
|
- <span>Schedule Configuration - Shipment Status Report</span>
|
|
|
|
|
- <el-button @click="handleSave" class="el-button--main save_button"
|
|
|
|
|
- ><span class="font_family icon-icon_save_b icon_dark" style="margin-right: 5px"></span
|
|
|
|
|
- >Save</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="container">
|
|
|
|
|
- <div class="schedule_rule">
|
|
|
|
|
- <div class="schedule_title">
|
|
|
|
|
- <span class="stars_red">*</span>
|
|
|
|
|
- Schedule Rule Validity Period
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="schedule_container">
|
|
|
|
|
- <ValidityPeriod
|
|
|
|
|
- ref="validityPeriodRef"
|
|
|
|
|
- :data="pageData.validityPeriod"
|
|
|
|
|
- @handleSubmitValidity="handleSubmitValidity"
|
|
|
|
|
- >
|
|
|
|
|
- </ValidityPeriod>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div v-vloading="loading">
|
|
|
|
|
+ <div class="Title">
|
|
|
|
|
+ <span>Schedule Configuration - Shipment Status Report</span>
|
|
|
|
|
+ <el-button @click="handleSave" class="el-button--main save_button"
|
|
|
|
|
+ ><span class="font_family icon-icon_save_b icon_dark" style="margin-right: 5px"></span
|
|
|
|
|
+ >Save</el-button
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="schedule_rule" style="margin: 8px 0">
|
|
|
|
|
- <div class="schedule_title">Report Data Time Range</div>
|
|
|
|
|
- <div class="schedule_container">
|
|
|
|
|
- <TimeRange ref="timeRangeRef" :data="pageData.timeRange" @changeTimeRange="changeTimeRange">
|
|
|
|
|
- </TimeRange>
|
|
|
|
|
|
|
+ <div class="container">
|
|
|
|
|
+ <div class="schedule_rule">
|
|
|
|
|
+ <div class="schedule_title">
|
|
|
|
|
+ <span class="stars_red">*</span>
|
|
|
|
|
+ Schedule Rule Validity Period
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="schedule_container">
|
|
|
|
|
+ <ValidityPeriod
|
|
|
|
|
+ ref="validityPeriodRef"
|
|
|
|
|
+ :data="pageData.validityPeriod"
|
|
|
|
|
+ @handleSubmitValidity="handleSubmitValidity"
|
|
|
|
|
+ >
|
|
|
|
|
+ </ValidityPeriod>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- <div class="schedule_rule" style="margin: 8px 0">
|
|
|
|
|
- <div class="schedule_title">Report Delivery Frequency & Email Configuration</div>
|
|
|
|
|
- <div class="schedule_container">
|
|
|
|
|
- <EmailConfiguration
|
|
|
|
|
- ref="emailConfigurationRef"
|
|
|
|
|
- :data="pageData.deliveryFrequency"
|
|
|
|
|
- ></EmailConfiguration>
|
|
|
|
|
|
|
+ <div class="schedule_rule" style="margin: 8px 0">
|
|
|
|
|
+ <div class="schedule_title">Report Data Time Range</div>
|
|
|
|
|
+ <div class="schedule_container">
|
|
|
|
|
+ <TimeRange
|
|
|
|
|
+ ref="timeRangeRef"
|
|
|
|
|
+ :data="pageData.timeRange"
|
|
|
|
|
+ @changeTimeRange="changeTimeRange"
|
|
|
|
|
+ >
|
|
|
|
|
+ </TimeRange>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="schedule_rule" style="margin: 8px 0">
|
|
|
|
|
+ <div class="schedule_title">Report Delivery Frequency & Email Configuration</div>
|
|
|
|
|
+ <div class="schedule_container">
|
|
|
|
|
+ <EmailConfiguration
|
|
|
|
|
+ ref="emailConfigurationRef"
|
|
|
|
|
+ :data="pageData.deliveryFrequency"
|
|
|
|
|
+ ></EmailConfiguration>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <FieldsTable :orderBy="pageData.orderBy" ref="fieldsTableRef"></FieldsTable>
|
|
|
</div>
|
|
</div>
|
|
|
- <FieldsTable ref="fieldsTableRef"></FieldsTable>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|