Commit 580073d4 by linjinhong
parents b9d7b2a2 68d7c71b
...@@ -148,7 +148,7 @@ export function getUniuniList() { ...@@ -148,7 +148,7 @@ export function getUniuniList() {
} }
// 获取tictok物流承运商 // 获取tictok物流承运商
export function getTiktokCarrier() { export function getTiktokCarrier() {
return axios.get<never, BaseRespData<{ name: string; id: number }[]>>( return axios.get<never, BaseRespData<{ name: string; id: string,typeCode:string,label:string }[]>>(
'logisticsWay/getTiktokShippingProvider', 'logisticsWay/getTiktokShippingProvider',
) )
} }
......
...@@ -44,6 +44,7 @@ export interface SearchForm { ...@@ -44,6 +44,7 @@ export interface SearchForm {
interceptStatus?: number | string interceptStatus?: number | string
sizeType?: number | null sizeType?: number | null
tagsId?: string tagsId?: string
source?: string
tagsIdArr?: (number | null)[] tagsIdArr?: (number | null)[]
} }
export interface PodCnOrderListData { export interface PodCnOrderListData {
...@@ -222,9 +223,9 @@ export interface CraftListData { ...@@ -222,9 +223,9 @@ export interface CraftListData {
craftCode: string craftCode: string
} }
export interface PackingData { export interface PackingData {
podProductionNo?: string; // 生产单号(PSCD 开头) podProductionNo?: string // 生产单号(PSCD 开头)
jomallCustomNo?: string; // 一件定制号(16 位数字 或 S- 开头) jomallCustomNo?: string // 一件定制号(16 位数字 或 S- 开头)
jomallPsdCustomNo?: string; // 满印定制号(JMSC/GCSC 开头) jomallPsdCustomNo?: string // 满印定制号(JMSC/GCSC 开头)
podJomallNo?: string; // POD 平台号(JMPSC/GCPS 经过正则提取) podJomallNo?: string // POD 平台号(JMPSC/GCPS 经过正则提取)
sku?: string; // 普通 SKU(兜底) sku?: string // 普通 SKU(兜底)
} }
\ No newline at end of file
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
v-model="editForm" v-model="editForm"
:config="formConfig" :config="formConfig"
form-item-width="100%" form-item-width="100%"
labelWidth="110" label-width="110"
> >
</CustomizeForm> </CustomizeForm>
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
defineOptions({ defineOptions({
name: 'LogisticsMethod', name: 'LogisticsMethod',
}) })
import LogisticsWaySelect from './components/LogisticsWaySelect.tsx'
import { import {
getLogisticsWayList, getLogisticsWayList,
addLogisticsWay, addLogisticsWay,
...@@ -83,7 +84,7 @@ import { ...@@ -83,7 +84,7 @@ import {
getUniuniList, getUniuniList,
getTiktokCarrier, getTiktokCarrier,
} from '@/api/logistics' } from '@/api/logistics'
import type { FormItemRule } from 'element-plus'
import { WarehouseListData } from '@/types/api/podUsOrder' import { WarehouseListData } from '@/types/api/podUsOrder'
import { ISeachFormConfig } from '@/types/searchType' import { ISeachFormConfig } from '@/types/searchType'
import { TableColumn } from '@/components/VxeTable' import { TableColumn } from '@/components/VxeTable'
...@@ -103,6 +104,7 @@ import { showConfirm } from '@/utils/ui' ...@@ -103,6 +104,7 @@ import { showConfirm } from '@/utils/ui'
import { Edit, Delete, List, WarningFilled } from '@element-plus/icons-vue' import { Edit, Delete, List, WarningFilled } from '@element-plus/icons-vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import UPARCELImage from '@/assets/images/UPARCEL物流编码.png' import UPARCELImage from '@/assets/images/UPARCEL物流编码.png'
const [searchForm] = useValue({}) const [searchForm] = useValue({})
const [editForm, resetEditForm] = useValue<LogisticsMethod>({ const [editForm, resetEditForm] = useValue<LogisticsMethod>({
platformList: [ platformList: [
...@@ -140,6 +142,7 @@ const warehouseList = ref<WarehouseListData[]>([]) ...@@ -140,6 +142,7 @@ const warehouseList = ref<WarehouseListData[]>([])
interface ImageList { interface ImageList {
[key: string]: string [key: string]: string
} }
const imgeList = ref<ImageList>({ const imgeList = ref<ImageList>({
UPARCEL: UPARCELImage, UPARCEL: UPARCELImage,
}) })
...@@ -182,6 +185,45 @@ const platformList = ref([]) ...@@ -182,6 +185,45 @@ const platformList = ref([])
const ruleNameList = ref([]) const ruleNameList = ref([])
const uniuniList = ref([]) const uniuniList = ref([])
const logisticsCompanyList = ref([]) const logisticsCompanyList = ref([])
watch(
() => JSON.parse(JSON.stringify(editForm.value.platformList)),
(newValue, oldValue) => {
if (oldValue.length && newValue.length) {
// 遍历旧值数组
oldValue.forEach(
(
oldItem: { logisticsName: string; showPlatform: string[] },
index: number,
) => {
// 检查旧值项是否符合条件
if (
Array.isArray(oldItem.showPlatform) &&
oldItem.showPlatform.length === 1 &&
oldItem.showPlatform[0] === 'TIKTOK' &&
oldItem.logisticsName
) {
// 获取对应的新值项
const newItem = newValue[index]
// 检查新值项是否不再满足条件
if (
newItem &&
(!Array.isArray(newItem.showPlatform) ||
newItem.showPlatform.length === 0 ||
!newItem.showPlatform.includes('TIKTOK') ||
newItem.showPlatform.length > 1)
) {
// 清除 logisticsName
editForm.value.platformList[index].logisticsName = ''
}
}
},
)
}
},
{ deep: true },
)
const formConfig = computed<IFormConfig[]>(() => [ const formConfig = computed<IFormConfig[]>(() => [
{ title: '物流基础信息' }, { title: '物流基础信息' },
{ {
...@@ -370,9 +412,7 @@ const formConfig = computed<IFormConfig[]>(() => [ ...@@ -370,9 +412,7 @@ const formConfig = computed<IFormConfig[]>(() => [
{ {
title: '平台物流名称', title: '平台物流名称',
fixed: 'last', fixed: 'last',
render: (item, formData) => { render: (_, formData) => {
console.log(283, item, formData)
return (formData?.platformList as platformObj[])?.map( return (formData?.platformList as platformObj[])?.map(
(item: platformObj, index: number) => ( (item: platformObj, index: number) => (
<div style="display: flex; width:100%"> <div style="display: flex; width:100%">
...@@ -415,21 +455,21 @@ const formConfig = computed<IFormConfig[]>(() => [ ...@@ -415,21 +455,21 @@ const formConfig = computed<IFormConfig[]>(() => [
required: true, required: true,
message: '请输入物流名称', message: '请输入物流名称',
trigger: 'blur', trigger: 'blur',
validator: (
_: FormItemRule,
value: string,
callback: (error?: string) => void,
) => {
if (value) callback()
},
}, },
]} ]}
> >
<el-select <LogisticsWaySelect
v-model={item.logisticsName} v-model={item.logisticsName as string | number}
placeholder="请选择物流名称" isRadio={true}
> companyList={tiktokCarriers.value as ICompanyList[]}
{tiktokCarriers.value?.map((el) => ( ></LogisticsWaySelect>
<el-option
label={el.name}
value={el.name}
key={el.id}
></el-option>
))}{' '}
</el-select>
</el-form-item> </el-form-item>
) : ( ) : (
<el-form-item <el-form-item
...@@ -466,7 +506,7 @@ const formConfig = computed<IFormConfig[]>(() => [ ...@@ -466,7 +506,7 @@ const formConfig = computed<IFormConfig[]>(() => [
{index >= 1 && ( {index >= 1 && (
<el-button <el-button
style="margin-left: 10px" style="margin-left: 10px"
type="primary" type="danger"
onClick={() => deleteCol(index)} onClick={() => deleteCol(index)}
> >
删除 删除
...@@ -534,7 +574,16 @@ const tableConfig = ref<TableColumn[]>([ ...@@ -534,7 +574,16 @@ const tableConfig = ref<TableColumn[]>([
</span> </span>
<span> <span>
<span>{'物流名称:'}</span> <span>{'物流名称:'}</span>
<span class="logistics-name">{el.logisticsName}</span> {el.platform === 'TIKTOK' ? (
<span class="logistics-name">
{tiktokCarriers.value
?.flatMap((company) => company.wayList)
?.find((item) => el.logisticsName === item.id)?.name ||
el.logisticsName}
</span>
) : (
<span class="logistics-name">{el.logisticsName}</span>
)}
</span> </span>
</div> </div>
)), )),
...@@ -868,13 +917,33 @@ async function getAllList() { ...@@ -868,13 +917,33 @@ async function getAllList() {
} }
} }
const tiktokCarriers = ref<{ name: string; id: number }[]>([]) interface ICompanyList {
warehouseName: string
wayList: IwayList[]
}
interface IwayList {
name: string
id: string
}
const tiktokCarriers = ref<ICompanyList[]>([])
/** /**
* @description: 获取tictok物流承运商 * @description: 获取tictok物流承运商
*/ */
async function getTiktokCarriers() { async function getTiktokCarriers() {
const { data } = await getTiktokCarrier() const { data } = await getTiktokCarrier()
tiktokCarriers.value = data const labelTypeList = Array.from(new Set(data.map((e) => e.label)))
const result: ICompanyList[] = []
labelTypeList.forEach((label) => {
result.push({
warehouseName: label,
wayList: data.filter((e) => e.label === label),
})
})
tiktokCarriers.value = result
console.log(893, tiktokCarriers.value)
} }
/** /**
...@@ -885,7 +954,9 @@ interface LogList { ...@@ -885,7 +954,9 @@ interface LogList {
createTime?: string createTime?: string
description?: string description?: string
} }
const logList = ref<LogList[]>([]) const logList = ref<LogList[]>([])
async function showLog(row: LogisticsMethod) { async function showLog(row: LogisticsMethod) {
logDialogVisible.value = true logDialogVisible.value = true
try { try {
...@@ -909,9 +980,11 @@ async function showLog(row: LogisticsMethod) { ...@@ -909,9 +980,11 @@ async function showLog(row: LogisticsMethod) {
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
.user-operate-btn { .user-operate-btn {
margin-bottom: 10px; margin-bottom: 10px;
} }
.dialog-footer { .dialog-footer {
text-align: center; text-align: center;
} }
......
...@@ -72,10 +72,10 @@ ...@@ -72,10 +72,10 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input <el-input
ref="testingInput" ref="testingInputRef"
v-model="barcode" v-model="barcode"
style="width: 400px" style="width: 400px"
placeholder="'请输入生产单号/ 主SKU'" placeholder="请输入生产单号/ 主SKU"
@keyup.enter="barcodeInput" @keyup.enter="barcodeInput"
></el-input> ></el-input>
</el-form-item> </el-form-item>
......
...@@ -353,6 +353,22 @@ ...@@ -353,6 +353,22 @@
></ElOption> ></ElOption>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="订单来源">
<ElSelect
v-model="searchForm.source"
placeholder="请选择"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in sourceList"
:key="index"
:value="item.id"
:label="item.name"
></ElOption>
</ElSelect>
</ElFormItem>
</ElForm> </ElForm>
<template #reference> <template #reference>
<el-button type="warning" @click="searchVisible = !searchVisible"> <el-button type="warning" @click="searchVisible = !searchVisible">
...@@ -1327,6 +1343,19 @@ ...@@ -1327,6 +1343,19 @@
</el-icon> </el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">订单来源:</span>
<span class="order-detail-item-value">
{{
row.source
? {
'jomall-erp': 'erp推送',
'third-party': '第三方推送',
}[row.source as 'jomall-erp' | 'third-party']
: ''
}}
</span>
</div>
<div class="order-detail-item">
<span class="order-detail-item-label">总克重:</span> <span class="order-detail-item-label">总克重:</span>
<span v-if="row.weight" class="order-detail-item-value"> <span v-if="row.weight" class="order-detail-item-value">
{{ row.weight }}g {{ row.weight }}g
...@@ -2620,6 +2649,17 @@ const exportForm = ref({ ...@@ -2620,6 +2649,17 @@ const exportForm = ref({
resource: '', resource: '',
}) })
const sourceList = [
{
name: 'erp推送',
id: 'jomall-erp',
},
{
name: '第三方推送',
id: 'third-party',
},
]
const exportData = () => { const exportData = () => {
exportVisible.value = true exportVisible.value = true
} }
......
<template> <template>
<div class="card flex-column h-100 overflow-hidden"> <div class="card flex-column h-100 overflow-hidden">
<div class="header-filter-form"> <div class="header-filter-form">
<ElForm class="search-form" label-position="right" label-width="70px" :model="searchForm" size="default" inline> <ElForm
class="search-form"
label-position="right"
label-width="70px"
:model="searchForm"
size="default"
inline
>
<!-- <div> --> <!-- <div> -->
<ElFormItem label="仓库"> <ElFormItem label="仓库">
<ElSelect <ElSelect
...@@ -126,8 +133,8 @@ ...@@ -126,8 +133,8 @@
v-model="searchForm.customizedQuantity" v-model="searchForm.customizedQuantity"
@click.stop="(e: Event) => handleRadioGroupClick(e)" @click.stop="(e: Event) => handleRadioGroupClick(e)"
> >
<el-radio-button label="single">单面</el-radio-button> <el-radio-button label="single">单面</el-radio-button>
<el-radio-button label="multiple">多面</el-radio-button> <el-radio-button label="multiple">多面</el-radio-button>
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem>
<ElFormItem label="数量"> <ElFormItem label="数量">
...@@ -322,7 +329,7 @@ ...@@ -322,7 +329,7 @@
style="width: 150px" style="width: 150px"
> >
<ElOption <ElOption
v-for="(item, index) in logisticsWayList " v-for="(item, index) in logisticsWayList"
:key="index" :key="index"
:value="item.id" :value="item.id"
:label="item.name" :label="item.name"
...@@ -338,7 +345,7 @@ ...@@ -338,7 +345,7 @@
style="width: 150px" style="width: 150px"
> >
<ElOption <ElOption
v-for="(item, index) in sourceList " v-for="(item, index) in sourceList"
:key="index" :key="index"
:value="item.id" :value="item.id"
:label="item.name" :label="item.name"
...@@ -1508,9 +1515,10 @@ ...@@ -1508,9 +1515,10 @@
<span class="order-detail-item-value"> <span class="order-detail-item-value">
{{ {{
row.source row.source
? { 'jomall-erp': 'erp', 'third-party': '第三方推送' }[ ? {
row.source as 'jomall-erp' | 'third-party' 'jomall-erp': 'erp推送',
] 'third-party': '第三方推送',
}[row.source as 'jomall-erp' | 'third-party']
: '' : ''
}} }}
</span> </span>
...@@ -2899,7 +2907,8 @@ import { ...@@ -2899,7 +2907,8 @@ import {
changeToFinished, changeToFinished,
updateTrackingNumberAndRegister, updateTrackingNumberAndRegister,
countTrackRegisterApi, countTrackRegisterApi,
getCustomTagListApi, getLogisticsWayApi, getCustomTagListApi,
getLogisticsWayApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -2971,18 +2980,18 @@ declare global { ...@@ -2971,18 +2980,18 @@ declare global {
} }
const sourceList = [ const sourceList = [
{ {
name:'erp推送', name: 'erp推送',
id:'jomall-erp' id: 'jomall-erp',
}, },
{ {
name:'第三方推送', name: '第三方推送',
id:'third-party' id: 'third-party',
} },
] ]
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const isAuto = ref(true) const isAuto = ref(true)
const countryList = ref([]) const countryList = ref([])
const logisticsWayList = ref<{name:string,id:number}[]>([]) const logisticsWayList = ref<{ name: string; id: number }[]>([])
const currentRow = ref<AddressInfo>({ const currentRow = ref<AddressInfo>({
receiverName: '', receiverName: '',
receiverPhone: '', receiverPhone: '',
...@@ -6169,8 +6178,8 @@ const getTagName = (row: ProductList) => { ...@@ -6169,8 +6178,8 @@ const getTagName = (row: ProductList) => {
: '' : ''
} }
const getLogisticsWay = async ()=>{ const getLogisticsWay = async () => {
const {data} = await getLogisticsWayApi() const { data } = await getLogisticsWayApi()
logisticsWayList.value = data logisticsWayList.value = data
} }
...@@ -6525,15 +6534,14 @@ useRouter().beforeEach((to, from, next) => { ...@@ -6525,15 +6534,14 @@ useRouter().beforeEach((to, from, next) => {
color: white; color: white;
font-weight: bold; font-weight: bold;
} }
.search-form{ .search-form {
::v-deep .el-radio-button{ ::v-deep .el-radio-button {
width: 75px; width: 75px;
.el-radio-button__inner{ .el-radio-button__inner {
width: 100%; width: 100%;
} }
} }
} }
</style> </style>
<style lang="scss"> <style lang="scss">
.customize-select-style { .customize-select-style {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"module": "ESNext", "module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"], "lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true, "skipLibCheck": true,
"types":[],
/* Bundler mode */ /* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "bundler",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
......
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