Commit 1d482d76 by sunyang

Merge branch 'dev' into 'master'

feat: POD(CN)订单添加更新报关信息功能

See merge request !134
parents 61969d95 b923062b
...@@ -16,7 +16,6 @@ declare module 'vue' { ...@@ -16,7 +16,6 @@ declare module 'vue' {
ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxButton: typeof import('element-plus/es')['ElCheckboxButton']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol'] ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
...@@ -55,6 +54,7 @@ declare module 'vue' { ...@@ -55,6 +54,7 @@ declare module 'vue' {
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline'] ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload'] ElUpload: typeof import('element-plus/es')['ElUpload']
......
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
LogisticsData, LogisticsData,
ExportParams, ExportParams,
IconfirmSubmit, IconfirmSubmit,
CustomDeclarationInfoForm,
} from '@/types/api/podCnOrder' } from '@/types/api/podCnOrder'
import { import {
InterceptStateGroupData, InterceptStateGroupData,
...@@ -42,7 +43,6 @@ export function getEmployeeListApi() { ...@@ -42,7 +43,6 @@ export function getEmployeeListApi() {
return axios.get(`/factory/factoryUser/list`) return axios.get(`/factory/factoryUser/list`)
} }
// 播种墙配货 扫码放入箱子 // 播种墙配货 扫码放入箱子
export function getPackingCnDataApi( export function getPackingCnDataApi(
code: string, code: string,
...@@ -566,7 +566,11 @@ export function getListCraftApi() { ...@@ -566,7 +566,11 @@ export function getListCraftApi() {
} }
// 批量下载 列表 // 批量下载 列表
export function batchDownloadApi(params: SearchForm, currentPage: number, pageSize: number) { export function batchDownloadApi(
params: SearchForm,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
`factory/podBatchDownload/cn/list_page`, `factory/podBatchDownload/cn/list_page`,
{ {
...@@ -751,3 +755,27 @@ export function allErpCodeListApi() { ...@@ -751,3 +755,27 @@ export function allErpCodeListApi() {
'/logisticsCompany/allErpCodeList', '/logisticsCompany/allErpCodeList',
) )
} }
export function updateCustomDeclarationInfoApi({
params,
ids,
}: {
params: CustomDeclarationInfoForm
ids: string
}) {
const formData = new FormData()
formData.append('ids', ids)
Object.keys(params).forEach((key) => {
const value = params[key as keyof CustomDeclarationInfoForm]
if (value !== undefined && value !== null) {
formData.append(key, String(value))
}
})
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderCn/batchUpdateCustomsClearanceInfo',
formData,
{
headers: { 'content-type': 'multipart/form-data' },
},
)
}
...@@ -240,3 +240,10 @@ export interface PackingData { ...@@ -240,3 +240,10 @@ export interface PackingData {
podJomallNo?: string // POD 平台号(JMPSC/GCPS 经过正则提取) podJomallNo?: string // POD 平台号(JMPSC/GCPS 经过正则提取)
sku?: string // 普通 SKU(兜底) sku?: string // 普通 SKU(兜底)
} }
export interface CustomDeclarationInfoForm {
customsNameEnglish?: string
customsNameChinese?: string
customsWeight?: number | string
customsValue?: string
customsCode?: string
}
<template>
<ElDialog
v-model="visible"
width="700px"
title="更新报关信息"
:close-on-click-modal="false"
>
<ElForm :model="form" label-width="100px" inline>
<ElFormItem label="英文名称" prop="customsNameEnglish">
<ElInput
v-model="form.customsNameEnglish"
clearable
style="width: 200px"
placeholder="请输入英文名称"
/>
</ElFormItem>
<ElFormItem label="中文名称" prop="customsNameChinese">
<ElInput
v-model="form.customsNameChinese"
clearable
style="width: 200px"
placeholder="请输入中文名称"
/>
</ElFormItem>
<ElFormItem label="申报重量(g)" prop="customsWeight">
<ElInput
v-model="form.customsWeight"
style="width: 200px"
placeholder="请输入申报重量"
clearable
/>
</ElFormItem>
<ElFormItem label="申报价值(美金)" prop="customsValue">
<ElInput
v-model="form.customsValue"
placeholder="请输入申报价值"
style="width: 200px"
clearable
/>
</ElFormItem>
<ElFormItem label="海关编码" prop="customsCode">
<ElInput
v-model="form.customsCode"
placeholder="请输入海关编码"
clearable
style="width: 200px"
/>
</ElFormItem>
</ElForm>
<template #footer>
<div class="dialog-footer">
<ElButton @click="closeDialog">取消</ElButton>
<ElButton type="primary" @click="submit">提交</ElButton>
</div>
</template>
</ElDialog>
</template>
<script setup lang="ts">
import { updateCustomDeclarationInfoApi } from '@/api/podCnOrder'
import {
CustomDeclarationInfoForm,
PodCnOrderListData,
} from '@/types/api/podCnOrder'
defineOptions({
name: 'UpdateCustomDeclarationInfoDialog',
})
const props = defineProps<{
modelValue: boolean
orderSelection: PodCnOrderListData[]
}>()
const emit = defineEmits<{
(e: 'update:modelValue', value: boolean): void
(e: 'refreshTable'): void
}>()
const visible = computed({
get() {
return props.modelValue
},
set(value) {
emit('update:modelValue', value)
},
})
const form = ref<CustomDeclarationInfoForm>({
customsNameEnglish: '',
customsNameChinese: '',
customsWeight: '',
customsValue: '',
customsCode: '',
})
const resetForm = () => {
form.value = {
customsNameEnglish: '',
customsNameChinese: '',
customsWeight: '',
customsValue: '',
customsCode: '',
}
}
const closeDialog = async () => {
visible.value = false
}
const submit = async () => {
try {
const res = await updateCustomDeclarationInfoApi({
params: form.value,
ids: props.orderSelection.map((item) => item.id).join(','),
})
if (res.code !== 200) return
ElMessage.success('更新成功')
visible.value = false
emit('refreshTable')
} catch (error) {
console.error(error)
}
}
defineExpose({
resetForm,
})
</script>
<style scoped lang="scss">
.dialog-footer {
text-align: center;
}
</style>
...@@ -838,20 +838,6 @@ ...@@ -838,20 +838,6 @@
拦截失败 拦截失败
</ElButton> </ElButton>
</span> </span>
<!-- <span
v-if="
status === 'TO_BE_CONFIRMED' ||
status === 'PICKING' ||
status === 'STOCK_OUT' ||
status === 'TO_BE_REPLENISHMENT' ||
status === 'IN_PRODUCTION'
"
class="item"
>
<ElButton type="success" @click="refreshMaterial">
刷新素材
</ElButton>
</span> -->
<span <span
v-if=" v-if="
[ [
...@@ -958,6 +944,11 @@ ...@@ -958,6 +944,11 @@
>打印库存sku标签</ElButton >打印库存sku标签</ElButton
> >
</span> </span>
<span v-if="status === 'CREATE_LOGISTICS'" class="item">
<ElButton type="success" @click="onUpdateCustomsDeclarationInfo">
更新报关信息
</ElButton>
</span>
</ElFormItem> </ElFormItem>
</ElForm> </ElForm>
</div> </div>
...@@ -1616,7 +1607,17 @@ ...@@ -1616,7 +1607,17 @@
</span> </span>
</div> </div>
<div <div
v-if="['TO_BE_CONFIRMED','EXCEPTION_ORDER', 'STOCK_OUT', 'CREATE_LOGISTICS', 'TO_BE_ARRANGE', 'WAIT_SHIPMENT', 'WAIT_WEIGHING'].includes(status)" v-if="
[
'TO_BE_CONFIRMED',
'EXCEPTION_ORDER',
'STOCK_OUT',
'CREATE_LOGISTICS',
'TO_BE_ARRANGE',
'WAIT_SHIPMENT',
'WAIT_WEIGHING',
].includes(status)
"
class="order-detail-item" class="order-detail-item"
> >
<span class="order-detail-item-label">订单延期时间:</span> <span class="order-detail-item-label">订单延期时间:</span>
...@@ -1648,16 +1649,6 @@ ...@@ -1648,16 +1649,6 @@
</el-tooltip> </el-tooltip>
</span> </span>
</div> </div>
<!-- v-if="
[
'TO_BE_CONFIRMED',
'EXCEPTION_ORDER',
'STOCK_OUT',
'CREATE_LOGISTICS',
'WAIT_SHIPMENT',
'INTERCEPTED',
].includes(status)
" -->
<div class="order-price-item"> <div class="order-price-item">
<span class="order-price-item-label">预收运费¥:</span> <span class="order-price-item-label">预收运费¥:</span>
<span class="order-price-item-value"> <span class="order-price-item-value">
...@@ -2146,7 +2137,7 @@ ...@@ -2146,7 +2137,7 @@
: cardItem?.notPassNum || 0 : cardItem?.notPassNum || 0
}} }}
<span title="订单延期时间" class="delayTime red-time"> <span title="订单延期时间" class="delayTime red-time">
{{ calculateDelayTime(cardItem) }} {{ calculateDelayTime(cardItem) }}
</span> </span>
</span> </span>
</div> </div>
...@@ -2163,8 +2154,18 @@ ...@@ -2163,8 +2154,18 @@
<span class="grid-item-label">补胚数量:</span> <span class="grid-item-label">补胚数量:</span>
<span class="grid-item-value"> <span class="grid-item-value">
{{ cardItem?.replenishmentNum || 0 }} {{ cardItem?.replenishmentNum || 0 }}
<span v-if="!['IN_PRODUCTION','PICKING','TO_BE_ARRANGE'].includes(status)" title="订单延期时间" class="delayTime red-time"> <span
{{ calculateDelayTime(cardItem) }} v-if="
![
'IN_PRODUCTION',
'PICKING',
'TO_BE_ARRANGE',
].includes(status)
"
title="订单延期时间"
class="delayTime red-time"
>
{{ calculateDelayTime(cardItem) }}
</span> </span>
</span> </span>
</div> </div>
...@@ -2738,6 +2739,12 @@ ...@@ -2738,6 +2739,12 @@
} }
" "
/> />
<UpdateCustomDeclarationInfoDialog
ref="updateCustomDeclarationInfoDialogRef"
v-model="updateCustomDeclarationInfoDialogVisible"
:order-selection="selection"
@refresh-table="search"
/>
</template> </template>
<script setup lang="tsx"> <script setup lang="tsx">
import WeightDialog from './components/WeightDialog.vue' import WeightDialog from './components/WeightDialog.vue'
...@@ -2859,6 +2866,7 @@ import { ...@@ -2859,6 +2866,7 @@ import {
type NavigationGuardNext, type NavigationGuardNext,
type RouteLocationNormalized, type RouteLocationNormalized,
} from 'vue-router' } from 'vue-router'
import UpdateCustomDeclarationInfoDialog from './components/UpdateCustomDeclarationInfoDialog.vue'
declare global { declare global {
interface Window { interface Window {
...@@ -2883,19 +2891,13 @@ const tabsNav = ref<Tab[]>() ...@@ -2883,19 +2891,13 @@ const tabsNav = ref<Tab[]>()
const isAuto = ref(true) const isAuto = ref(true)
const printWarehouseSkuDialogRef = ref() const printWarehouseSkuDialogRef = ref()
const weightDialogRef = ref() const weightDialogRef = ref()
const updateCustomDeclarationInfoDialogRef = ref()
const updateCustomDeclarationInfoDialogVisible = ref(false)
const calculatedPrice = (item: ProductList) => { const calculatedPrice = (item: ProductList) => {
const templatePrice = new BigNumber(item.templatePrice || 0) const templatePrice = new BigNumber(item.templatePrice || 0)
const craftPrice = new BigNumber(item.craftPrice || 0) const craftPrice = new BigNumber(item.craftPrice || 0)
return templatePrice.plus(craftPrice).toString() return templatePrice.plus(craftPrice).toString()
} }
// const PREPAID_STATUSES = [
// 'TO_BE_CONFIRMED',
// 'EXCEPTION_ORDER',
// 'STOCK_OUT',
// 'CREATE_LOGISTICS',
// 'WAIT_SHIPMENT',
// 'INTERCEPTED',
// ] as const
const totalAmountPrice = (item: PodCnOrderListData): string => { const totalAmountPrice = (item: PodCnOrderListData): string => {
// const usePrepaid = PREPAID_STATUSES.includes(status.value as typeof PREPAID_STATUSES[number]) // const usePrepaid = PREPAID_STATUSES.includes(status.value as typeof PREPAID_STATUSES[number])
...@@ -5871,6 +5873,16 @@ useEnterKeyTrigger({ ...@@ -5871,6 +5873,16 @@ useEnterKeyTrigger({
search() search()
}, },
}) })
const onUpdateCustomsDeclarationInfo = () => {
if (selection.value.length === 0) {
ElMessage.error('请至少选择一条数据')
return
}
updateCustomDeclarationInfoDialogVisible.value = true
nextTick(() => {
updateCustomDeclarationInfoDialogRef.value?.resetForm()
})
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-filter-form { .header-filter-form {
...@@ -5957,12 +5969,11 @@ useEnterKeyTrigger({ ...@@ -5957,12 +5969,11 @@ useEnterKeyTrigger({
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
} }
.grid-item-value{ .grid-item-value {
position: relative; position: relative;
} }
.delayTime{ .delayTime {
position: absolute; position: absolute;
right: 0; right: 0;
font-size: 14px; font-size: 14px;
...@@ -6240,14 +6251,6 @@ useEnterKeyTrigger({ ...@@ -6240,14 +6251,6 @@ useEnterKeyTrigger({
color: white; color: white;
font-weight: bold; font-weight: bold;
} }
// .search-form {
// ::v-deep .el-radio-button {
// width: 75px;
// .el-radio-button__inner {
// width: 100%;
// }
// }
// }
.triangle-container-wrap { .triangle-container-wrap {
position: absolute; position: absolute;
top: 0; top: 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment