Commit 5004f367 by zhuzhequan

Merge remote-tracking branch 'origin/dev' into dev

parents 67591999 4d24ae1e
...@@ -193,6 +193,12 @@ export function deleteAddressByIds(params: { ids: string }) { ...@@ -193,6 +193,12 @@ export function deleteAddressByIds(params: { ids: string }) {
}, },
) )
} }
//获取国家名称及代码
export function getAllCountryApi() {
return axios.get<never, BaseRespData<never>>(
'/logisticsAddress/getAllCountry',
)
}
/** /**
* @description 物流报价 * @description 物流报价
......
...@@ -16,6 +16,7 @@ export interface LogisticsData { ...@@ -16,6 +16,7 @@ export interface LogisticsData {
status: boolean status: boolean
logisticsWayCode: string // 物流编码 logisticsWayCode: string // 物流编码
partition: string // 所在分区 partition: string // 所在分区
logisticsWayId?: number | null
} }
export function getOrderTabData() { export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>( return axios.get<never, BaseRespData<Tab[]>>(
...@@ -270,3 +271,29 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) { ...@@ -270,3 +271,29 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
orderIds, orderIds,
) )
} }
// 更改物流
export function changeLogisticsApi(params: {
updateByIdParam: {
id: string | number
dataVersion: number
}
logisticsTrialCalculation: LogisticsData
}) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/changeLogistics',
params,
)
}
// 创建物流
export function createLogisticsOrderApi(params: {
updateByIdParam: {
id: string | number
dataVersion: number
}
logisticsTrialCalculation: LogisticsData
}) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/createLogisticsOrder',
params,
)
}
...@@ -57,6 +57,8 @@ export interface PodUsOrderListData { ...@@ -57,6 +57,8 @@ export interface PodUsOrderListData {
version?: number version?: number
productList?: ProductList[] productList?: ProductList[]
orderNumber?: string orderNumber?: string
logisticsWayId?: number | null
logisticsWayName?: string
} }
export interface ProductList { export interface ProductList {
id: number id: number
......
...@@ -43,36 +43,11 @@ ...@@ -43,36 +43,11 @@
</el-tag> </el-tag>
</div> </div>
<p <p
:title=" style="white-space: pre"
[ :title="getJosn(item)"
item.countryName,
// item.countryCode,
item.stateProvince,
// item.stateProvinceAbbr,
item.district,
// item.districtCode,
item.city,
// item.cityCode,
]
.filter((el) => el != null && el !== '')
.join(' ')
"
class="address" class="address"
> >
{{ {{ getJosn(item) }}
[
item.countryName,
// item.countryCode,
item.stateProvince,
// item.stateProvinceAbbr,
item.district,
// item.districtCode,
item.city,
// item.cityCode,
]
.filter((el) => el != null && el !== '')
.join(' ')
}}
</p> </p>
<p <p
:title=" :title="
...@@ -187,6 +162,7 @@ import { ...@@ -187,6 +162,7 @@ import {
updateAddress, updateAddress,
getLogisticsLog, getLogisticsLog,
deleteAddressByIds, deleteAddressByIds,
getAllCountryApi,
} from '@/api/logistics' } from '@/api/logistics'
import { IFormConfig } from '@/components/CustomizeForm.tsx' import { IFormConfig } from '@/components/CustomizeForm.tsx'
...@@ -196,7 +172,7 @@ import CustomizeForm from '@/components/CustomizeForm.tsx' ...@@ -196,7 +172,7 @@ import CustomizeForm from '@/components/CustomizeForm.tsx'
import { Edit, Delete, List } from '@element-plus/icons-vue' import { Edit, Delete, List } from '@element-plus/icons-vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import { ShippingAddressObj } from './types/shippingAddress.ts' import { ShippingAddressObj, ICountryObj } from './types/shippingAddress.ts'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
import { useValue } from './hooks/useValue' import { useValue } from './hooks/useValue'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
...@@ -226,8 +202,9 @@ const { ...@@ -226,8 +202,9 @@ const {
const dialogVisible = ref(false) const dialogVisible = ref(false)
const logDialogVisible = ref(false) const logDialogVisible = ref(false)
const editFormRef = ref<InstanceType<typeof CustomizeForm> | null>(null) const editFormRef = ref<InstanceType<typeof CustomizeForm> | null>(null)
const countryList = ref([])
const formConfig = ref<IFormConfig[]>([ const formConfig = computed<IFormConfig[]>(() => [
{ {
prop: 'shipperName', prop: 'shipperName',
type: 'input', type: 'input',
...@@ -266,88 +243,101 @@ const formConfig = ref<IFormConfig[]>([ ...@@ -266,88 +243,101 @@ const formConfig = ref<IFormConfig[]>([
}, },
}, },
{ {
prop: 'city', prop: 'countryCode',
type: 'input', type: 'select',
label: '城市', label: '国家代码',
attrs: { attrs: {
// options: [], options: countryList.value,
placeholder: '请输入城市', label: 'countryCode',
value: 'countryCode',
placeholder: '请选择国家代码',
onChange: (val: ICountryObj) => {
editForm.value.countryName = val.nameCn
}, },
rules: [{ required: true, message: '请输入城市' }], },
rules: [{ required: true, message: '请选择国家代码' }],
}, },
{ {
prop: 'cityCode', prop: 'countryName',
type: 'input', type: 'select',
label: '城市编码', label: '国家名称',
attrs: { attrs: {
// options: [], options: countryList.value,
placeholder: '请输入城市编码', label: 'nameCn',
value: 'nameCn',
placeholder: '请选择国家名称',
onChange: (val: ICountryObj) => {
editForm.value.countryCode = val.countryCode
},
}, },
rules: [{ required: true, message: '请选择国家名称' }],
}, },
{ {
prop: 'district', prop: 'stateProvince',
type: 'input', type: 'input',
label: '', label: '州/省',
attrs: { attrs: {
// options: [], // options: [],
placeholder: '请选择区', placeholder: '请输入州/省',
}, },
}, },
{ {
prop: 'districtCode', prop: 'stateProvinceAbbr',
type: 'input', type: 'input',
label: '区编码', label: '州/省简称',
attrs: { attrs: {
// options: [], // options: [],
placeholder: '请选择区', placeholder: '请输入州/省简称',
}, },
}, },
{ {
prop: 'postalCode', prop: 'cityCode',
type: 'input', type: 'input',
label: '邮编', label: '城市编码',
attrs: { attrs: {
placeholder: '请输入邮编', // options: [],
placeholder: '请输入城市编码',
}, },
}, },
{ {
prop: 'stateProvince', prop: 'city',
type: 'input', type: 'input',
label: '州/省', label: '城市',
attrs: { attrs: {
// options: [], // options: [],
placeholder: '请输入州/省', placeholder: '请输入城市',
}, },
rules: [{ required: true, message: '请输入城市' }],
}, },
{ {
prop: 'stateProvinceAbbr', prop: 'districtCode',
type: 'input', type: 'input',
label: '州/省简称', label: '区编码',
attrs: { attrs: {
// options: [], // options: [],
placeholder: '请输入州/省简称', placeholder: '请选择区',
}, },
}, },
{ {
prop: 'countryName', prop: 'district',
type: 'input', type: 'input',
label: '国家名称', label: '',
attrs: { attrs: {
// options: [], // options: [],
placeholder: '请输入国家名称', placeholder: '请选择区',
}, },
rules: [{ required: true, message: '请输入国家名称' }],
}, },
{ {
prop: 'countryCode', prop: 'postalCode',
type: 'input', type: 'input',
label: '国家代码', label: '邮编',
attrs: { attrs: {
// options: [], placeholder: '请输入邮编',
placeholder: '请输入国家代码',
}, },
rules: [{ required: true, message: '请输入邮编' }],
}, },
{ {
prop: 'phoneNumber', prop: 'phoneNumber',
...@@ -365,7 +355,36 @@ const formConfig = ref<IFormConfig[]>([ ...@@ -365,7 +355,36 @@ const formConfig = ref<IFormConfig[]>([
}, },
]) ])
// const loading = ref(false) async function getCountryList() {
try {
const { data } = await getAllCountryApi()
countryList.value = data
console.log(372, countryList.value)
} catch (error) {
console.log(error)
}
}
function getJosn(item: ShippingAddressObj) {
return [
[item.countryName, item.countryCode],
[item.stateProvince, item.stateProvinceAbbr],
[item.district, item.districtCode],
[item.city, item.cityCode],
]
.map(([value, code]) => {
if (value && code) return `${value} (${code})`
if (value) return value
if (code) return code // 当 value 不存在但 code 存在时,不使用括号
return null
})
.filter(Boolean)
.join(` `) // 使用三个空格作为分隔符增大间距
}
onMounted(() => {
getCountryList()
})
/** /**
* @description: 取消按钮 * @description: 取消按钮
......
...@@ -22,3 +22,13 @@ export interface ShippingAddressObj { ...@@ -22,3 +22,13 @@ export interface ShippingAddressObj {
updateTime?: string updateTime?: string
checked?: boolean checked?: boolean
} }
export interface ICountryObj {
aeCountryCode: string
continentCode: string
countryCode: string
id: number
nameCn: string
nameEn: string
needProviceAbbr: number
}
...@@ -516,6 +516,8 @@ const userStore = useUserStore() ...@@ -516,6 +516,8 @@ const userStore = useUserStore()
const getPackingData = async (code: string) => { const getPackingData = async (code: string) => {
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
text: '加载中...',
background: 'rgba(0, 0, 0, 0.3)',
}) })
currentCode = code currentCode = code
try { try {
...@@ -592,6 +594,8 @@ const initOrderDetailBox = async () => { ...@@ -592,6 +594,8 @@ const initOrderDetailBox = async () => {
} }
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
text: '加载中...',
background: 'rgba(0, 0, 0, 0.3)',
}) })
try { try {
const res = await getPodBoxListApi(factoryNo, warehouseId.value) const res = await getPodBoxListApi(factoryNo, warehouseId.value)
...@@ -800,7 +804,10 @@ const handlePrinterChange = (value: string) => { ...@@ -800,7 +804,10 @@ const handlePrinterChange = (value: string) => {
const print = (data: OrderData, forcePrint = false, callback?: () => void) => { const print = (data: OrderData, forcePrint = false, callback?: () => void) => {
const _boxIndex = boxIndex.value const _boxIndex = boxIndex.value
if (!forcePrint && data.printResult) return if (!forcePrint && data.printResult) {
callback && callback()
return
}
props.printOrder(data, (status: boolean) => { props.printOrder(data, (status: boolean) => {
callback && callback() callback && callback()
......
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