|
@@ -9,6 +9,7 @@ const router = useRouter()
|
|
|
|
|
|
|
|
const allData = ref<any>({})
|
|
const allData = ref<any>({})
|
|
|
const loading = ref(false)
|
|
const loading = ref(false)
|
|
|
|
|
+const messageTips = ref('')
|
|
|
const generalInfo = ref({
|
|
const generalInfo = ref({
|
|
|
baseInfo: [
|
|
baseInfo: [
|
|
|
{
|
|
{
|
|
@@ -81,7 +82,8 @@ const handleColumns = (columns: any) => {
|
|
|
const newColumns = columns.map((item: any) => {
|
|
const newColumns = columns.map((item: any) => {
|
|
|
let curColumn: any = {
|
|
let curColumn: any = {
|
|
|
title: item.title,
|
|
title: item.title,
|
|
|
- field: item.field
|
|
|
|
|
|
|
+ field: item.field,
|
|
|
|
|
+ minWidth: 30
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 添加编辑插槽
|
|
// 添加编辑插槽
|
|
@@ -212,6 +214,9 @@ const getData = () => {
|
|
|
})
|
|
})
|
|
|
.then((res: any) => {
|
|
.then((res: any) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
|
|
+ if (res.data.msg) {
|
|
|
|
|
+ messageTips.value = res.data.msg
|
|
|
|
|
+ }
|
|
|
allData.value = res.data
|
|
allData.value = res.data
|
|
|
convertData(res.data?.general_information)
|
|
convertData(res.data?.general_information)
|
|
|
tableData.value.columns = handleColumns(
|
|
tableData.value.columns = handleColumns(
|
|
@@ -219,7 +224,7 @@ const getData = () => {
|
|
|
)
|
|
)
|
|
|
tableData.value.data = res.data?.detail_information?.detail_information_data
|
|
tableData.value.data = res.data?.detail_information?.detail_information_data
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
- tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
|
|
+ // tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
tableData.value.columns.forEach((item) => {
|
|
tableData.value.columns.forEach((item) => {
|
|
|
if (item.title === 'SN') {
|
|
if (item.title === 'SN') {
|
|
|
item.width = 50
|
|
item.width = 50
|
|
@@ -241,7 +246,78 @@ getData()
|
|
|
const handleGoBack = () => {
|
|
const handleGoBack = () => {
|
|
|
router.push({ name: 'Tracking' })
|
|
router.push({ name: 'Tracking' })
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const isVerificationError = ref({
|
|
|
|
|
+ submitter: false,
|
|
|
|
|
+ signature: false,
|
|
|
|
|
+ authorized_email: false,
|
|
|
|
|
+ authorized_tel: false
|
|
|
|
|
+})
|
|
|
|
|
+const verificationData = () => {
|
|
|
|
|
+ if (!generalInfo.value.formData.is_send) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (
|
|
|
|
|
+ generalInfo.value.formData.Submitter === null ||
|
|
|
|
|
+ generalInfo.value.formData.Submitter === undefined ||
|
|
|
|
|
+ generalInfo.value.formData.Submitter === ''
|
|
|
|
|
+ ) {
|
|
|
|
|
+ isVerificationError.value.submitter = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ isVerificationError.value.submitter = false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (
|
|
|
|
|
+ generalInfo.value.formData.signature === null ||
|
|
|
|
|
+ generalInfo.value.formData.signature === undefined ||
|
|
|
|
|
+ generalInfo.value.formData.signature === ''
|
|
|
|
|
+ ) {
|
|
|
|
|
+ isVerificationError.value.signature = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ isVerificationError.value.signature = false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (
|
|
|
|
|
+ generalInfo.value.formData.authorized_email === null ||
|
|
|
|
|
+ generalInfo.value.formData.authorized_email === undefined ||
|
|
|
|
|
+ generalInfo.value.formData.authorized_email === ''
|
|
|
|
|
+ ) {
|
|
|
|
|
+ isVerificationError.value.authorized_email = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ isVerificationError.value.authorized_email = false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (
|
|
|
|
|
+ generalInfo.value.formData.authorized_tel === null ||
|
|
|
|
|
+ generalInfo.value.formData.authorized_tel === undefined ||
|
|
|
|
|
+ generalInfo.value.formData.authorized_tel === ''
|
|
|
|
|
+ ) {
|
|
|
|
|
+ isVerificationError.value.authorized_tel = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ isVerificationError.value.authorized_tel = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const isVerification = (value) => {
|
|
|
|
|
+ if (value) {
|
|
|
|
|
+ verificationData()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ isVerificationError.value = {
|
|
|
|
|
+ submitter: false,
|
|
|
|
|
+ signature: false,
|
|
|
|
|
+ authorized_email: false,
|
|
|
|
|
+ authorized_tel: false
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
const handleSave = () => {
|
|
const handleSave = () => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ generalInfo.value.formData.is_send &&
|
|
|
|
|
+ (isVerificationError.value.submitter ||
|
|
|
|
|
+ isVerificationError.value.submitter ||
|
|
|
|
|
+ isVerificationError.value.authorized_email ||
|
|
|
|
|
+ isVerificationError.value.authorized_tel)
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const generalData = {
|
|
const generalData = {
|
|
|
all_carrier_booking: generalInfo.value.baseInfo['Carrier Booking No.'],
|
|
all_carrier_booking: generalInfo.value.baseInfo['Carrier Booking No.'],
|
|
|
submitter: generalInfo.value.formData.Submitter,
|
|
submitter: generalInfo.value.formData.Submitter,
|
|
@@ -313,13 +389,17 @@ const stopScroll = (evt) => {
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<div class="vgm" v-vloading="loading">
|
|
<div class="vgm" v-vloading="loading">
|
|
|
|
|
+ <div v-if="messageTips" class="vgm-message-tips">
|
|
|
|
|
+ <span class="font_family icon-icon_tipsfilled_b"></span>
|
|
|
|
|
+ <span class="text-content">{{ messageTips }}</span>
|
|
|
|
|
+ </div>
|
|
|
<div class="header">
|
|
<div class="header">
|
|
|
<div class="title">Add VGM</div>
|
|
<div class="title">Add VGM</div>
|
|
|
<div class="right-option">
|
|
<div class="right-option">
|
|
|
<el-button class="el-button--default" @click="handleGoBack"
|
|
<el-button class="el-button--default" @click="handleGoBack"
|
|
|
><span class="font_family icon-icon_return_b"></span> Cancel</el-button
|
|
><span class="font_family icon-icon_return_b"></span> Cancel</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button class="el-button--main" @click="handleSave">
|
|
|
|
|
|
|
+ <el-button v-if="!messageTips" class="el-button--main" @click="handleSave">
|
|
|
<span class="font_family icon-icon_save_b"></span>
|
|
<span class="font_family icon-icon_save_b"></span>
|
|
|
Save</el-button
|
|
Save</el-button
|
|
|
>
|
|
>
|
|
@@ -339,22 +419,32 @@ const stopScroll = (evt) => {
|
|
|
<div class="form">
|
|
<div class="form">
|
|
|
<div class="form-row">
|
|
<div class="form-row">
|
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
|
- <div class="label">Submitter <span class="require-asterisk">*</span></div>
|
|
|
|
|
|
|
+ <div class="label">
|
|
|
|
|
+ Submitter
|
|
|
|
|
+ <span v-if="generalInfo.formData.is_send" class="require-asterisk">*</span>
|
|
|
|
|
+ </div>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<el-input
|
|
<el-input
|
|
|
|
|
+ :class="{ 'is-error': isVerificationError.submitter }"
|
|
|
v-model="generalInfo.formData.Submitter"
|
|
v-model="generalInfo.formData.Submitter"
|
|
|
placeholder="Please enter..."
|
|
placeholder="Please enter..."
|
|
|
clearable
|
|
clearable
|
|
|
|
|
+ @blur="verificationData"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
|
- <div class="label">Signature <span class="require-asterisk">*</span></div>
|
|
|
|
|
|
|
+ <div class="label">
|
|
|
|
|
+ Signature
|
|
|
|
|
+ <span v-if="generalInfo.formData.is_send" class="require-asterisk">*</span>
|
|
|
|
|
+ </div>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<el-input
|
|
<el-input
|
|
|
|
|
+ :class="{ 'is-error': isVerificationError.signature }"
|
|
|
v-model="generalInfo.formData.signature"
|
|
v-model="generalInfo.formData.signature"
|
|
|
placeholder="Please enter..."
|
|
placeholder="Please enter..."
|
|
|
clearable
|
|
clearable
|
|
|
|
|
+ @blur="verificationData"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -362,32 +452,44 @@ const stopScroll = (evt) => {
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-row">
|
|
<div class="form-row">
|
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
|
- <div class="label">Authorized Email <span class="require-asterisk">*</span></div>
|
|
|
|
|
|
|
+ <div class="label">
|
|
|
|
|
+ Authorized Email
|
|
|
|
|
+ <span v-if="generalInfo.formData.is_send" class="require-asterisk">*</span>
|
|
|
|
|
+ </div>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<el-input
|
|
<el-input
|
|
|
|
|
+ :class="{ 'is-error': isVerificationError.authorized_email }"
|
|
|
v-model="generalInfo.formData.authorized_email"
|
|
v-model="generalInfo.formData.authorized_email"
|
|
|
placeholder="Please enter..."
|
|
placeholder="Please enter..."
|
|
|
clearable
|
|
clearable
|
|
|
|
|
+ @blur="verificationData"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
|
<div class="label">
|
|
<div class="label">
|
|
|
Authorized Tel
|
|
Authorized Tel
|
|
|
- <span class="require-asterisk">*</span>
|
|
|
|
|
|
|
+ <span class="require-asterisk" v-if="generalInfo.formData.is_send">*</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<el-input
|
|
<el-input
|
|
|
|
|
+ :class="{ 'is-error': isVerificationError.authorized_tel }"
|
|
|
v-model="generalInfo.formData.authorized_tel"
|
|
v-model="generalInfo.formData.authorized_tel"
|
|
|
placeholder="Please enter..."
|
|
placeholder="Please enter..."
|
|
|
clearable
|
|
clearable
|
|
|
|
|
+ @blur="verificationData"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="form-item" style="flex: 0 0 130px">
|
|
|
|
|
|
|
+ <div class="form-item" style="flex: 0 0 130px; display: flex; align-items: flex-end">
|
|
|
<div class="label"></div>
|
|
<div class="label"></div>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
- <el-checkbox v-model="generalInfo.formData.is_send" label="Is Send" size="large" />
|
|
|
|
|
|
|
+ <el-checkbox
|
|
|
|
|
+ @change="isVerification"
|
|
|
|
|
+ v-model="generalInfo.formData.is_send"
|
|
|
|
|
+ label="Is Send"
|
|
|
|
|
+ size="large"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -447,6 +549,31 @@ const stopScroll = (evt) => {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.vgm {
|
|
.vgm {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ .vgm-message-tips {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 53px;
|
|
|
|
|
+ left: 10%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ width: 80%;
|
|
|
|
|
+ height: 40px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ background-color: #fef5eb;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+ .font_family {
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .text-content {
|
|
|
|
|
+ margin-left: 4px;
|
|
|
|
|
+ margin-top: 2px;
|
|
|
|
|
+ }
|
|
|
|
|
+ span {
|
|
|
|
|
+ color: #f19d38;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.header {
|
|
.header {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
@@ -510,14 +637,17 @@ const stopScroll = (evt) => {
|
|
|
.form-item {
|
|
.form-item {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
.label {
|
|
.label {
|
|
|
- height: 16px;
|
|
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
margin-bottom: 8px;
|
|
margin-bottom: 8px;
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
line-height: 16px;
|
|
line-height: 16px;
|
|
|
color: var(--dashboard-text-color);
|
|
color: var(--dashboard-text-color);
|
|
|
|
|
+
|
|
|
.require-asterisk {
|
|
.require-asterisk {
|
|
|
- margin-left: -3px;
|
|
|
|
|
|
|
+ margin-left: 2px;
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
|
|
+ line-height: 16px;
|
|
|
color: #c9353f;
|
|
color: #c9353f;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -528,6 +658,11 @@ const stopScroll = (evt) => {
|
|
|
.el-input {
|
|
.el-input {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
+ .is-error {
|
|
|
|
|
+ :deep(.el-input__wrapper) {
|
|
|
|
|
+ box-shadow: 0 0 0 1px red;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|