Commit c809d666 by linjinhong

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

parents 41208115 16f6e6fb
......@@ -133,6 +133,17 @@ export function getPlatformList() {
export function getLogisticsCompanyList() {
return axios.get<never, BaseRespData<never>>('/logisticsCompany/all_options')
}
//获取物流公司列表
export function getUniuniList() {
return axios.get<never, BaseRespData<never>>(
'/logistics/logisticsUinuinWarehouse/listByCountryCode',
{
params: {
countryCode: 'US',
},
},
)
}
/**
* @description 发货地址
......
......@@ -86,7 +86,6 @@ export default defineComponent({
watch(
() => props.config,
(val) => {
console.log('tableConfig', val)
tableConfig.value = val
},
{ immediate: true, deep: true },
......@@ -104,8 +103,6 @@ export default defineComponent({
watch(
() => props.modelValue,
(val) => {
console.log(84, val)
formData.value = val
},
{ immediate: true, deep: true },
......@@ -128,9 +125,9 @@ export default defineComponent({
return await formRef.value.validate()
}
// 表单验证方法
const clearValidate = async () => {
const clearValidate = async (clearFields?: string[]) => {
if (!formRef.value) return false
return await formRef.value.clearValidate()
return await formRef.value.clearValidate(clearFields)
}
// 重置表单
......@@ -151,7 +148,9 @@ export default defineComponent({
.filter((item) => !item.fixed)
.concat(tableConfig.value.filter((item) => item.fixed))
} else {
tableConfig.value = [...props.config]
tableConfig.value = [
...props.config.filter((item) => !item.isIncludeProp),
]
console.log(tableConfig.value)
}
}
......
......@@ -80,6 +80,7 @@ import {
getPlatformList,
getLogisticsLog,
getLogisticsCompanyList,
getUniuniList,
} from '@/api/logistics'
import { ISeachFormConfig } from '@/types/searchType'
import { TableColumn } from '@/components/VxeTable'
......@@ -166,6 +167,7 @@ const searchConfig = ref<ISeachFormConfig[]>([
const platformList = ref([])
const warehouseList = ref([])
const ruleNameList = ref([])
const uniuniList = ref([])
const logisticsCompanyList = ref([])
const formConfig = computed<IFormConfig[]>(() => [
{ title: '物流基础信息' },
......@@ -212,8 +214,20 @@ const formConfig = computed<IFormConfig[]>(() => [
label: 'name',
value: 'id',
options: [...(logisticsCompanyList.value || [])],
onChange: (value: { name: string; id: string | number }) => {
onChange: (value: {
code: string
name: string
id: string | number
}) => {
console.log(222, value)
editForm.value.company = value.name
if (value.code === 'UINUIN') {
editFormRef.value?.refashConfig(['uinuinWarehouseId'])
} else {
editFormRef.value?.refashConfig([])
editFormRef.value?.clearValidate(['uinuinWarehouseId'])
editForm.value.uinuinWarehouseId = undefined
}
},
},
rules: [
......@@ -224,9 +238,28 @@ const formConfig = computed<IFormConfig[]>(() => [
],
},
{
prop: 'uinuinWarehouseId',
type: 'select',
label: 'uniuni仓库',
isIncludeProp: true,
attrs: {
placeholder: '请选择uniuni仓库',
label: 'warehouseName',
value: 'warehouseId',
options: [...(uniuniList.value || [])],
},
rules: [
{
required: true,
message: '请选择uniuni仓库',
},
],
},
{
prop: 'ruleId',
type: 'select',
label: '申报规则',
fixed: 'last',
attrs: {
placeholder: '请选择申报规则',
label: 'name',
......@@ -248,6 +281,7 @@ const formConfig = computed<IFormConfig[]>(() => [
prop: 'serviceCode',
type: 'input',
label: '物流编码',
fixed: 'last',
attrs: {
placeholder: '请输入物流编码',
},
......@@ -262,6 +296,7 @@ const formConfig = computed<IFormConfig[]>(() => [
prop: 'siteUrl',
type: 'input',
label: '查询网址',
fixed: 'last',
attrs: {
placeholder: '请输入查询网址',
},
......@@ -276,6 +311,7 @@ const formConfig = computed<IFormConfig[]>(() => [
prop: 'status',
type: 'switch',
label: '启用状态',
fixed: 'last',
attrs: {
activeValue: 1,
inactiveValue: 0,
......@@ -283,6 +319,7 @@ const formConfig = computed<IFormConfig[]>(() => [
},
{
title: '平台物流名称',
fixed: 'last',
render: (item, formData) => {
console.log(283, item, formData)
......@@ -631,6 +668,9 @@ const save = debounce(async () => {
*/
function addDialog() {
dialogVisible.value = true
nextTick(() => {
editFormRef.value?.refashConfig([])
})
}
/**
......@@ -702,17 +742,22 @@ async function getAllList() {
getRuleList(),
getPlatformList(),
getLogisticsCompanyList(),
getUniuniList(),
])
res.forEach((item, index) => {
if (item.code === 200) {
if (index == 0) {
warehouseList.value = item.data || []
} else if (index == 1) {
ruleNameList.value = item.data || []
} else if (index == 2) {
platformList.value = item.data || []
} else if (index == 3) {
logisticsCompanyList.value = item.data || []
if (item.status === 'fulfilled') {
if (item.value.code === 200) {
if (index == 0) {
warehouseList.value = item.value.data || []
} else if (index == 1) {
ruleNameList.value = item.value.data || []
} else if (index == 2) {
platformList.value = item.value.data || []
} else if (index == 3) {
logisticsCompanyList.value = item.value.data || []
} else if (index == 4) {
uniuniList.value = item.value.data || []
}
}
}
})
......
......@@ -348,7 +348,15 @@ function setCellStyle() {
async function getAllList() {
try {
const res = await Promise.allSettled([getlogisticsWayAllList(), getList()])
searchConfig.value[0].attrs!.options = [...(res[0]?.data || [])]
res.forEach((item, index) => {
if (item.status === 'fulfilled') {
if (item.value.code === 200) {
if (index == 0) {
searchConfig.value[0].attrs!.options = [...(item.value.data || [])]
}
}
}
})
} catch (error) {
console.log(error)
}
......
......@@ -628,8 +628,15 @@ const logisticsWayList = ref([])
async function getAllList() {
try {
const res = await Promise.allSettled([getlogisticsWayAllList(), getList()])
console.log(545, res)
logisticsWayList.value = res[0]?.data || []
res.forEach((item, index) => {
if (item.status === 'fulfilled') {
if (item.value.code === 200) {
if (index == 0) {
logisticsWayList.value = [...(item.value.data || [])]
}
}
}
})
} catch (error) {
console.log(error)
}
......
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