From eed20a11b2ad45e9b753bb44d80fc619e61f5fd2 Mon Sep 17 00:00:00 2001 From: dev <182542500@qq.com> Date: Tue, 15 Jul 2025 08:47:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=90=A5=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/amz/inquiryRequest/types.ts | 3 + src/api/amz/logisticsQuote/index.ts | 4 +- src/api/amz/logisticsQuote/types.ts | 5 + src/api/amz/sendOrder/types.ts | 8 + src/api/amz/shipmentPlan/types.ts | 2 +- src/views/amz/inquiryRequest/index.vue | 161 +++++++++++++++---- src/views/amz/purchaseOrderConfirm/index.vue | 4 +- src/views/amz/sendOrder/index.vue | 1 + src/views/amz/sendOrderConfirm/index.vue | 100 ++++++++++-- src/views/amz/sendOrderLast/index.vue | 41 +++-- src/views/amz/shipmentPlanAsk/index.vue | 40 +++-- src/views/amz/shipmentPlanSend/index.vue | 38 +---- 12 files changed, 292 insertions(+), 115 deletions(-) diff --git a/src/api/amz/inquiryRequest/types.ts b/src/api/amz/inquiryRequest/types.ts index fec3b94..74c3f52 100644 --- a/src/api/amz/inquiryRequest/types.ts +++ b/src/api/amz/inquiryRequest/types.ts @@ -62,6 +62,9 @@ export interface InquiryRequestVO { * 报价有效的结束日期 */ effectiveEndTime: string; + + type: string; + shipmentId: string | number; } export interface InquiryRequestItemVO { diff --git a/src/api/amz/logisticsQuote/index.ts b/src/api/amz/logisticsQuote/index.ts index e6ece8a..0c4192a 100644 --- a/src/api/amz/logisticsQuote/index.ts +++ b/src/api/amz/logisticsQuote/index.ts @@ -33,9 +33,9 @@ export const queryLogisticsQuote = (destination: string | number, channelId: str }); }; -export const queryLogisticsQuoteWithDes = (destination: string | number, date: string): AxiosPromise => { +export const queryLogisticsQuoteWithDes = (destination: string | number, date: string,shipmentId: string | number): AxiosPromise => { return request({ - url: '/amz/logisticsQuote/queryWithDes/' + destination + '/' + date, + url: '/amz/logisticsQuote/queryWithDes/' + destination + '/' + date + '/' + shipmentId, method: 'get' }); }; diff --git a/src/api/amz/logisticsQuote/types.ts b/src/api/amz/logisticsQuote/types.ts index eeddda8..d9b8987 100644 --- a/src/api/amz/logisticsQuote/types.ts +++ b/src/api/amz/logisticsQuote/types.ts @@ -153,6 +153,11 @@ export interface LogisticsQuoteForm extends BaseEntity { * 单位 */ unit?: string; + + type: string; + shipmentId: string | number; + + totalPrice: number; } export interface LogisticsMostQuoteForm extends BaseEntity { diff --git a/src/api/amz/sendOrder/types.ts b/src/api/amz/sendOrder/types.ts index 94fe754..af987f1 100644 --- a/src/api/amz/sendOrder/types.ts +++ b/src/api/amz/sendOrder/types.ts @@ -1,3 +1,5 @@ +import { ShipmentPlanVO } from '@/api/amz/shipmentPlan/types'; + export interface SendOrderVO { /** * 主键ID @@ -58,6 +60,12 @@ export interface SendOrderVO { * 发货状态(pending=未发货,confirm=确认发货, processing=发货中,completed=发货完成) */ sendStatus: string; + + createTime: string; + + sendName: string; + + bizShipmentPlans: ShipmentPlanVO[]; } export interface SendOrderForm extends BaseEntity { diff --git a/src/api/amz/shipmentPlan/types.ts b/src/api/amz/shipmentPlan/types.ts index f28b931..75f7629 100644 --- a/src/api/amz/shipmentPlan/types.ts +++ b/src/api/amz/shipmentPlan/types.ts @@ -495,7 +495,7 @@ export interface ShipmentPlanQuery extends PageQuery { /** * 货件编号 */ - shipmentId?: string | number; + shipmentId?: string; /** * 货件名称 diff --git a/src/views/amz/inquiryRequest/index.vue b/src/views/amz/inquiryRequest/index.vue index 4fa9df2..41daf38 100644 --- a/src/views/amz/inquiryRequest/index.vue +++ b/src/views/amz/inquiryRequest/index.vue @@ -112,8 +112,74 @@ + + + + + + @@ -239,15 +305,24 @@ - +
- +
+ +
+ + + +
+
@@ -305,7 +380,7 @@ @@ -325,11 +400,15 @@ import { InquiryRequestVO, InquiryRequestQuery, InquiryRequestForm } from '@/api import { LogisticsMostQuoteForm, LogisticsQuoteForm } from '@/api/amz/logisticsQuote/types'; import { addMostLogisticsQuote, checkPriceQuoteByBo, getTodayQuoteStatus } from '@/api/amz/logisticsQuote'; import { ShipmentPlanVO } from '@/api/amz/shipmentPlan/types'; +import { formatText } from '@/utils/asinkj'; +import { ElTable } from 'element-plus'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { biz_shipping_method } = toRefs(proxy?.useDict('biz_shipping_method')); +const { request_type } = toRefs(proxy?.useDict('request_type')); + const { back_logistics_type } = toRefs(proxy?.useDict('back_logistics_type')); const { sys_yes_no } = toRefs(proxy?.useDict('sys_yes_no')); @@ -347,6 +426,7 @@ const minDay = ref(0); const queryFormRef = ref(); const inquiryRequestFormRef = ref(); +const logisticsQuoteFormRef = ref({}); const dialog = reactive({ visible: false, @@ -358,6 +438,14 @@ const quoteDialog = reactive({ title: '' }); +const validatePrice = (rule, value, callback) => { + if (quoteForm.value.price > 0 || quoteForm.value.totalPrice > 0) { + callback(); + } else { + callback(new Error('请填写价格')); + } +}; + const initFormData: InquiryRequestForm = { id: undefined, inquiryNo: undefined, @@ -402,7 +490,8 @@ const data = reactive>({ channelName: [{ required: true, message: '渠道名称不能为空', trigger: 'blur' }], effectiveStartTime: [{ required: true, message: '报价有效的开始日期不能为空', trigger: 'blur' }], effectiveEndTime: [{ required: true, message: '报价有效的结束日期不能为空', trigger: 'blur' }], - price: [{ required: true, message: '基础价格不能为空', trigger: 'blur' }], + price: [{ validator: validatePrice, trigger: 'blur' }], + totalPrice: [{ validator: validatePrice, trigger: 'blur' }], leadTime: [{ required: true, message: '时效不能为空', trigger: 'blur' }], surcharge: [{ required: true, message: '附加费不能为空', trigger: 'blur' }], quoteDate: [{ required: true, message: '报价生效日期不能为空', trigger: 'blur' }], @@ -432,7 +521,7 @@ const quoteForm = ref({ userId: undefined, destination: undefined, transportChannel: undefined, - price: 10, + price: 0, minLeadTime: 10, leadTime: 10, surcharge: 0, @@ -446,7 +535,10 @@ const quoteForm = ref({ channelId: undefined, isDdp: 'Y', unit: 'kg', - backLogisticsType: '快递' + backLogisticsType: '快递', + type: 'general', + shipmentId: undefined, + totalPrice: 0 }); const handleChannelChange = ({ value, node }) => { @@ -557,34 +649,40 @@ const submitQuoteForm = async () => { quoteForm.value.quoteEndDate = quoteForm.value.quoteDate[1]; quoteForm.value.isSubmitted = 'Y'; console.log('submitQuoteForm', quoteForm.value); - const res = await checkPriceQuoteByBo(quoteForm.value); - console.log('submitQuoteForm', res); - if (res.code === 200) { - // ElMessage.success('提交成功'); - // quoteDialog.visible = false; - - if (res.data === true) { - const res = await addMostLogisticsQuote(quoteForm.value); + logisticsQuoteFormRef.value?.validate(async (valid: boolean) => { + if (valid) { + console.log('quoteForm', quoteForm.value); + return; + const res = await checkPriceQuoteByBo(quoteForm.value); + console.log('submitQuoteForm', res); if (res.code === 200) { - ElMessage.success('提交成功'); - quoteDialog.visible = false; - } - } else { - ElMessageBox.confirm('价格没有竞争力,是否需要修改价格?', '提示', { - confirmButtonText: '确认提交', - cancelButtonText: '修改价格', - type: 'warning' - }) - .then(async () => { + // ElMessage.success('提交成功'); + // quoteDialog.visible = false; + + if (res.data === true) { const res = await addMostLogisticsQuote(quoteForm.value); if (res.code === 200) { ElMessage.success('提交成功'); quoteDialog.visible = false; } - }) - .catch(() => {}); + } else { + ElMessageBox.confirm('价格没有竞争力,是否需要修改价格?', '提示', { + confirmButtonText: '确认提交', + cancelButtonText: '修改价格', + type: 'warning' + }) + .then(async () => { + const res = await addMostLogisticsQuote(quoteForm.value); + if (res.code === 200) { + ElMessage.success('提交成功'); + quoteDialog.visible = false; + } + }) + .catch(() => {}); + } + } } - } + }); }; const saveQuoteForm = () => { @@ -616,7 +714,7 @@ const handleSubmit = async (row?: InquiryRequestVO) => { userId: undefined, destination: undefined, transportChannel: undefined, - price: 10, + price: 0, minLeadTime: 10, leadTime: 10, surcharge: 0, @@ -630,7 +728,10 @@ const handleSubmit = async (row?: InquiryRequestVO) => { channelId: undefined, isDdp: 'Y', unit: 'kg', - backLogisticsType: '快递' + backLogisticsType: '快递', + type: 'general', + shipmentId: undefined, + totalPrice: 0 }; quoteForm.value.id = row.id; quoteForm.value.destination = row.destination; @@ -638,6 +739,8 @@ const handleSubmit = async (row?: InquiryRequestVO) => { quoteForm.value.channelId = row.channelId; quoteForm.value.channelName = row.channelName; quoteForm.value.customsFlag = row.customsFlag; + quoteForm.value.type = row.type; + quoteForm.value.shipmentId = row.shipmentId; quoteDialog.visible = true; console.log(row.effectiveStartTime); diff --git a/src/views/amz/purchaseOrderConfirm/index.vue b/src/views/amz/purchaseOrderConfirm/index.vue index 99919a8..af4cc0e 100644 --- a/src/views/amz/purchaseOrderConfirm/index.vue +++ b/src/views/amz/purchaseOrderConfirm/index.vue @@ -257,9 +257,7 @@ diff --git a/src/views/amz/sendOrder/index.vue b/src/views/amz/sendOrder/index.vue index c7b5a94..66672c6 100644 --- a/src/views/amz/sendOrder/index.vue +++ b/src/views/amz/sendOrder/index.vue @@ -231,6 +231,7 @@ import { listSendOrder, getSendOrder, delSendOrder, addSendOrder, updateSendOrde import { SendOrderVO, SendOrderQuery, SendOrderForm } from '@/api/amz/sendOrder/types'; import { getPurchaseOrder } from '@/api/amz/purchaseOrder'; import { Close, Plus } from '@element-plus/icons-vue'; +import { formatText } from '@/utils/asinkj'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { send_status } = toRefs(proxy?.useDict('send_status')); diff --git a/src/views/amz/sendOrderConfirm/index.vue b/src/views/amz/sendOrderConfirm/index.vue index 33ae1de..e3205bc 100644 --- a/src/views/amz/sendOrderConfirm/index.vue +++ b/src/views/amz/sendOrderConfirm/index.vue @@ -59,6 +59,79 @@ + + + @@ -74,18 +147,18 @@ - - - + + + + + + + + + + + + @@ -180,7 +253,8 @@