Commit 16f6e6fb by linjinhong

物流方式添加uninuin字段

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