Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
5003fd35
Commit
5003fd35
authored
May 29, 2025
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
申报规则页面完成
parent
6a0c26ab
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
115 additions
and
5 deletions
+115
-5
src/api/logistics.ts
+31
-1
src/components/CustomizeForm.tsx
+30
-2
src/components/Form.vue/Select.vue
+3
-0
src/router/index.ts
+7
-0
src/router/menu.ts
+5
-1
src/views/logistics/declarationRule.vue
+0
-0
src/views/logistics/types/declarationRule.ts
+38
-0
vite.config.ts
+1
-1
No files found.
src/api/logistics.ts
View file @
5003fd35
...
@@ -49,7 +49,6 @@ export function deleteLogisticsWay(ids: string) {
...
@@ -49,7 +49,6 @@ export function deleteLogisticsWay(ids: string) {
params
:
{
ids
:
ids
},
params
:
{
ids
:
ids
},
})
})
}
}
//获取申报规则列表
//获取申报规则列表
export
function
getRuleList
()
{
export
function
getRuleList
()
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
...
@@ -163,3 +162,34 @@ export function getLogisticsQuotationByID(params: any) {
...
@@ -163,3 +162,34 @@ export function getLogisticsQuotationByID(params: any) {
{
params
},
{
params
},
)
)
}
}
/**
* @description 申报规则
*/
//列表
export
function
getLogisticsCustomsRuleList
(
params
:
any
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/logisticsCustomsRule/list_page'
,
params
,
)
}
//新增
export
function
addLogisticsCustomsRule
(
params
:
any
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/logisticsCustomsRule/add'
,
params
,
)
}
//修改
export
function
updateLogisticsCustomsRule
(
params
:
any
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/logisticsCustomsRule/update'
,
params
,
)
}
//删除
export
function
deleteLogisticsCustomsRule
(
params
:
any
)
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
'/logisticsCustomsRule/delete'
,
{
params
,
})
}
src/components/CustomizeForm.tsx
View file @
5003fd35
...
@@ -13,12 +13,14 @@ import type { FormItemRule } from 'element-plus'
...
@@ -13,12 +13,14 @@ import type { FormItemRule } from 'element-plus'
// 定义表单项配置接口
// 定义表单项配置接口
export
interface
IFormConfig
{
export
interface
IFormConfig
{
fixed
?:
string
title
?:
string
title
?:
string
prop
?:
string
prop
?:
string
label
?:
string
label
?:
string
type
?:
string
type
?:
string
btn
?:
JSX
.
Element
|
(()
=>
JSX
.
Element
)
btn
?:
JSX
.
Element
|
(()
=>
JSX
.
Element
)
attrs
?:
Record
<
string
,
unknown
>
attrs
?:
Record
<
string
,
unknown
>
isIncludeProp
?:
boolean
rules
?:
FormItemRule
|
FormItemRule
[]
rules
?:
FormItemRule
|
FormItemRule
[]
render
?:
(
render
?:
(
item
?:
IFormConfig
,
item
?:
IFormConfig
,
...
@@ -77,7 +79,15 @@ export default defineComponent({
...
@@ -77,7 +79,15 @@ export default defineComponent({
setup
(
props
,
{
emit
,
attrs
})
{
setup
(
props
,
{
emit
,
attrs
})
{
const
formRef
=
ref
<
FormInstance
>
()
const
formRef
=
ref
<
FormInstance
>
()
const
formData
=
ref
<
Record
<
string
,
unknown
>>
(
props
.
modelValue
)
const
formData
=
ref
<
Record
<
string
,
unknown
>>
(
props
.
modelValue
)
const
tableConfig
=
ref
<
any
[]
>
([])
watch
(
()
=>
props
.
config
,
(
val
)
=>
{
tableConfig
.
value
=
val
},
{
immediate
:
true
,
deep
:
true
},
)
// 监听表单数据变化
// 监听表单数据变化
watch
(
watch
(
()
=>
formData
.
value
,
()
=>
formData
.
value
,
...
@@ -91,7 +101,7 @@ export default defineComponent({
...
@@ -91,7 +101,7 @@ export default defineComponent({
watch
(
watch
(
()
=>
props
.
modelValue
,
()
=>
props
.
modelValue
,
(
val
)
=>
{
(
val
)
=>
{
//
console.log(84, val)
console
.
log
(
84
,
val
)
formData
.
value
=
val
formData
.
value
=
val
},
},
...
@@ -120,6 +130,22 @@ export default defineComponent({
...
@@ -120,6 +130,22 @@ export default defineComponent({
await
formRef
.
value
?.
resetFields
()
await
formRef
.
value
?.
resetFields
()
}
}
function
refashConfig
(
showFields
:
string
[])
{
if
(
showFields
.
length
)
{
const
filterArr
=
props
.
config
.
filter
((
item
)
=>
showFields
.
includes
(
item
.
prop
as
string
),
)
tableConfig
.
value
=
[
...
props
.
config
.
filter
((
item
)
=>
!
item
.
isIncludeProp
),
...
filterArr
,
]
.
filter
((
item
)
=>
!
item
.
fixed
)
.
concat
(
tableConfig
.
value
.
filter
((
item
)
=>
item
.
fixed
))
}
console
.
log
(
'tableConfig'
,
tableConfig
.
value
)
}
return
{
return
{
formRef
,
formRef
,
formData
,
formData
,
...
@@ -127,6 +153,8 @@ export default defineComponent({
...
@@ -127,6 +153,8 @@ export default defineComponent({
resetFields
,
resetFields
,
getFormAttrs
,
getFormAttrs
,
getComponentAttrs
,
getComponentAttrs
,
refashConfig
,
tableConfig
,
}
}
},
},
render
()
{
render
()
{
...
@@ -142,7 +170,7 @@ export default defineComponent({
...
@@ -142,7 +170,7 @@ export default defineComponent({
style=
{
{
display
:
'flex'
,
flexWrap
:
'wrap'
}
}
style=
{
{
display
:
'flex'
,
flexWrap
:
'wrap'
}
}
class=
"customForm"
class=
"customForm"
>
>
{
this
.
c
onfig
.
map
((
item
,
index
)
=>
{
this
.
tableC
onfig
.
map
((
item
,
index
)
=>
item
.
title
?
(
item
.
title
?
(
<
div
<
div
style=
{
{
style=
{
{
...
...
src/components/Form.vue/Select.vue
View file @
5003fd35
...
@@ -36,6 +36,7 @@ const props = withDefaults(
...
@@ -36,6 +36,7 @@ const props = withDefaults(
initChange
?:
boolean
// 首次是否触发change事件
initChange
?:
boolean
// 首次是否触发change事件
modelValue
?:
string
|
number
modelValue
?:
string
|
number
isRefresh
?:
boolean
isRefresh
?:
boolean
isValueKey
?:
boolean
load
?:
(
arg
:
(
val
:
boolean
)
=>
void
)
=>
void
// focus后再加载数据的
load
?:
(
arg
:
(
val
:
boolean
)
=>
void
)
=>
void
// focus后再加载数据的
}
>
(),
}
>
(),
{
{
...
@@ -48,6 +49,7 @@ const props = withDefaults(
...
@@ -48,6 +49,7 @@ const props = withDefaults(
modelValue
:
''
,
modelValue
:
''
,
isRefresh
:
false
,
isRefresh
:
false
,
load
:
null
,
load
:
null
,
isValueKey
:
false
,
},
},
)
)
...
@@ -91,6 +93,7 @@ const getOptions = computed(() => {
...
@@ -91,6 +93,7 @@ const getOptions = computed(() => {
const
changeFn
=
(
id
)
=>
{
const
changeFn
=
(
id
)
=>
{
const
value
=
props
.
labelIsValue
?
fields
.
label
:
fields
.
value
const
value
=
props
.
labelIsValue
?
fields
.
label
:
fields
.
value
const
findItem
=
props
.
options
.
find
((
item
)
=>
item
[
value
]
===
id
)
const
findItem
=
props
.
options
.
find
((
item
)
=>
item
[
value
]
===
id
)
if
(
findItem
)
{
if
(
findItem
)
{
emits
(
'change'
,
findItem
,
id
)
emits
(
'change'
,
findItem
,
id
)
}
}
...
...
src/router/index.ts
View file @
5003fd35
...
@@ -141,6 +141,13 @@ const router = createRouter({
...
@@ -141,6 +141,13 @@ const router = createRouter({
},
},
component
:
()
=>
import
(
'@/views/logistics/logisticsQuotation.vue'
),
component
:
()
=>
import
(
'@/views/logistics/logisticsQuotation.vue'
),
},
},
{
path
:
'/logistics/declarationRule'
,
meta
:
{
title
:
'申报规则'
,
},
component
:
()
=>
import
(
'@/views/logistics/declarationRule.vue'
),
},
{
{
path
:
'/warehouse/manage'
,
path
:
'/warehouse/manage'
,
...
...
src/router/menu.ts
View file @
5003fd35
...
@@ -144,7 +144,11 @@ const menu: MenuItem[] = [
...
@@ -144,7 +144,11 @@ const menu: MenuItem[] = [
id
:
1
,
id
:
1
,
label
:
'物流报价'
,
label
:
'物流报价'
,
},
},
{
index
:
'/logistics/declarationRule'
,
id
:
1
,
label
:
'申报规则'
,
},
],
],
},
},
// {
// {
...
...
src/views/logistics/declarationRule.vue
0 → 100644
View file @
5003fd35
This diff is collapsed.
Click to expand it.
src/views/logistics/types/declarationRule.ts
0 → 100644
View file @
5003fd35
export
interface
DeclarationRuleList
{
countries
:
string
createTime
:
string
currency
:
string
defaulted
:
string
fixedValue
:
string
fixedWeight
:
string
id
:
number
name
:
string
orderPercent
:
number
remark
:
string
shops
:
string
type
:
number
valueUp
:
number
wayIds
:
string
wayNames
:
string
weightPercent
:
number
weightUp
:
number
}
export
interface
AddDeclarationRuleObj
{
currency
?:
string
fixedValue
?:
string
fixedWeight
?:
string
id
?:
number
limitAmountType
?:
string
limitWeightType
?:
string
name
?:
string
orderPercent
?:
number
|
string
|
null
remark
?:
string
shops
?:
string
type
?:
number
valueUp
?:
number
|
string
|
null
weightPercent
?:
number
|
string
|
null
weightUp
?:
number
|
string
|
null
}
vite.config.ts
View file @
5003fd35
...
@@ -13,7 +13,7 @@ export default defineConfig({
...
@@ -13,7 +13,7 @@ export default defineConfig({
host
:
true
,
host
:
true
,
proxy
:
{
proxy
:
{
'/api'
:
{
'/api'
:
{
target
:
'http://10.168.
31.194
:8060'
,
target
:
'http://10.168.
1.132
:8060'
,
},
},
},
},
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment