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 }) {
},
)
}
//获取国家名称及代码
export function getAllCountryApi() {
return axios.get<never, BaseRespData<never>>(
'/logisticsAddress/getAllCountry',
)
}
/**
* @description 物流报价
......
......@@ -16,6 +16,7 @@ export interface LogisticsData {
status: boolean
logisticsWayCode: string // 物流编码
partition: string // 所在分区
logisticsWayId?: number | null
}
export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>(
......@@ -270,3 +271,29 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
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 {
version?: number
productList?: ProductList[]
orderNumber?: string
logisticsWayId?: number | null
logisticsWayName?: string
}
export interface ProductList {
id: number
......
......@@ -43,36 +43,11 @@
</el-tag>
</div>
<p
:title="
[
item.countryName,
// item.countryCode,
item.stateProvince,
// item.stateProvinceAbbr,
item.district,
// item.districtCode,
item.city,
// item.cityCode,
]
.filter((el) => el != null && el !== '')
.join(' ')
"
style="white-space: pre"
:title="getJosn(item)"
class="address"
>
{{
[
item.countryName,
// item.countryCode,
item.stateProvince,
// item.stateProvinceAbbr,
item.district,
// item.districtCode,
item.city,
// item.cityCode,
]
.filter((el) => el != null && el !== '')
.join(' ')
}}
{{ getJosn(item) }}
</p>
<p
:title="
......@@ -187,6 +162,7 @@ import {
updateAddress,
getLogisticsLog,
deleteAddressByIds,
getAllCountryApi,
} from '@/api/logistics'
import { IFormConfig } from '@/components/CustomizeForm.tsx'
......@@ -196,7 +172,7 @@ import CustomizeForm from '@/components/CustomizeForm.tsx'
import { Edit, Delete, List } from '@element-plus/icons-vue'
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 { useValue } from './hooks/useValue'
import { showConfirm } from '@/utils/ui'
......@@ -226,8 +202,9 @@ const {
const dialogVisible = ref(false)
const logDialogVisible = ref(false)
const editFormRef = ref<InstanceType<typeof CustomizeForm> | null>(null)
const countryList = ref([])
const formConfig = ref<IFormConfig[]>([
const formConfig = computed<IFormConfig[]>(() => [
{
prop: 'shipperName',
type: 'input',
......@@ -266,88 +243,101 @@ const formConfig = ref<IFormConfig[]>([
},
},
{
prop: 'city',
type: 'input',
label: '城市',
prop: 'countryCode',
type: 'select',
label: '国家代码',
attrs: {
// options: [],
placeholder: '请输入城市',
options: countryList.value,
label: 'countryCode',
value: 'countryCode',
placeholder: '请选择国家代码',
onChange: (val: ICountryObj) => {
editForm.value.countryName = val.nameCn
},
},
rules: [{ required: true, message: '请输入城市' }],
rules: [{ required: true, message: '请选择国家代码' }],
},
{
prop: 'cityCode',
type: 'input',
label: '城市编码',
prop: 'countryName',
type: 'select',
label: '国家名称',
attrs: {
// options: [],
placeholder: '请输入城市编码',
options: countryList.value,
label: 'nameCn',
value: 'nameCn',
placeholder: '请选择国家名称',
onChange: (val: ICountryObj) => {
editForm.value.countryCode = val.countryCode
},
},
rules: [{ required: true, message: '请选择国家名称' }],
},
{
prop: 'district',
prop: 'stateProvince',
type: 'input',
label: '',
label: '州/省',
attrs: {
// options: [],
placeholder: '请选择区',
placeholder: '请输入州/省',
},
},
{
prop: 'districtCode',
prop: 'stateProvinceAbbr',
type: 'input',
label: '区编码',
label: '州/省简称',
attrs: {
// options: [],
placeholder: '请选择区',
placeholder: '请输入州/省简称',
},
},
{
prop: 'postalCode',
prop: 'cityCode',
type: 'input',
label: '邮编',
label: '城市编码',
attrs: {
placeholder: '请输入邮编',
// options: [],
placeholder: '请输入城市编码',
},
},
{
prop: 'stateProvince',
prop: 'city',
type: 'input',
label: '州/省',
label: '城市',
attrs: {
// options: [],
placeholder: '请输入州/省',
placeholder: '请输入城市',
},
rules: [{ required: true, message: '请输入城市' }],
},
{
prop: 'stateProvinceAbbr',
prop: 'districtCode',
type: 'input',
label: '州/省简称',
label: '区编码',
attrs: {
// options: [],
placeholder: '请输入州/省简称',
placeholder: '请选择区',
},
},
{
prop: 'countryName',
prop: 'district',
type: 'input',
label: '国家名称',
label: '',
attrs: {
// options: [],
placeholder: '请输入国家名称',
placeholder: '请选择区',
},
rules: [{ required: true, message: '请输入国家名称' }],
},
{
prop: 'countryCode',
prop: 'postalCode',
type: 'input',
label: '国家代码',
label: '邮编',
attrs: {
// options: [],
placeholder: '请输入国家代码',
placeholder: '请输入邮编',
},
rules: [{ required: true, message: '请输入邮编' }],
},
{
prop: 'phoneNumber',
......@@ -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: 取消按钮
......
......@@ -22,3 +22,13 @@ export interface ShippingAddressObj {
updateTime?: string
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()
const getPackingData = async (code: string) => {
const loading = ElLoading.service({
fullscreen: true,
text: '加载中...',
background: 'rgba(0, 0, 0, 0.3)',
})
currentCode = code
try {
......@@ -592,6 +594,8 @@ const initOrderDetailBox = async () => {
}
const loading = ElLoading.service({
fullscreen: true,
text: '加载中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await getPodBoxListApi(factoryNo, warehouseId.value)
......@@ -800,7 +804,10 @@ const handlePrinterChange = (value: string) => {
const print = (data: OrderData, forcePrint = false, callback?: () => void) => {
const _boxIndex = boxIndex.value
if (!forcePrint && data.printResult) return
if (!forcePrint && data.printResult) {
callback && callback()
return
}
props.printOrder(data, (status: boolean) => {
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