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
5949aa2c
Commit
5949aa2c
authored
May 29, 2025
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加防抖函数已经修改bug
parent
6721290f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
42 deletions
+55
-42
src/components/CustomizeForm.tsx
+6
-0
src/views/logistics/declarationRule.vue
+6
-4
src/views/logistics/logisticsMethod.vue
+3
-2
src/views/logistics/logisticsPartition.vue
+32
-16
src/views/logistics/logisticsQuotation.vue
+3
-2
src/views/logistics/shippingAddress.vue
+5
-18
No files found.
src/components/CustomizeForm.tsx
View file @
5949aa2c
...
...
@@ -125,6 +125,11 @@ export default defineComponent({
if
(
!
formRef
.
value
)
return
false
return
await
formRef
.
value
.
validate
()
}
// 表单验证方法
const
clearValidate
=
async
()
=>
{
if
(
!
formRef
.
value
)
return
false
return
await
formRef
.
value
.
clearValidate
()
}
// 重置表单
const
resetFields
=
async
()
=>
{
...
...
@@ -158,6 +163,7 @@ export default defineComponent({
getComponentAttrs
,
refashConfig
,
tableConfig
,
clearValidate
,
}
},
render
()
{
...
...
src/views/logistics/declarationRule.vue
View file @
5949aa2c
...
...
@@ -83,7 +83,7 @@ import { IFormConfig } from '@/components/CustomizeForm.tsx'
import
usePageList
from
'@/utils/hooks/usePageList'
import
{
useValue
}
from
'./hooks/useValue'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
debounce
}
from
'lodash-es'
import
{
DeclarationRuleList
,
AddDeclarationRuleObj
,
...
...
@@ -177,14 +177,15 @@ const formConfig = ref<IFormConfig[]>([
if
(
value
===
2
)
{
editForm
.
value
.
fixedValue
=
''
editForm
.
value
.
fixedWeight
=
''
editFormRef
.
value
?.
clearValidate
()
}
else
{
editForm
.
value
.
orderPercent
=
''
editForm
.
value
.
valueUp
=
''
editForm
.
value
.
weightPercent
=
''
editForm
.
value
.
weightUp
=
''
editFormRef
.
value
?.
clearValidate
()
}
editFormRef
.
value
?.
refashConfig
(
mapData
.
value
.
get
(
value
)
as
string
[])
editFormRef
.
value
?.
validate
()
},
},
rules
:
[
...
...
@@ -442,7 +443,7 @@ async function checkData() {
return
{
isValid
,
postData
}
}
async
function
save
()
{
const
save
=
debounce
(
async
()
=>
{
const
{
isValid
,
postData
}
=
await
checkData
()
if
(
isValid
)
{
try
{
...
...
@@ -467,7 +468,8 @@ async function save() {
return
}
}
}
},
400
)
function
addDialog
()
{
dialogVisible
.
value
=
true
nextTick
(()
=>
{
...
...
src/views/logistics/logisticsMethod.vue
View file @
5949aa2c
...
...
@@ -87,6 +87,7 @@ import usePageList from '@/utils/hooks/usePageList'
import
{
useValue
}
from
'./hooks/useValue'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
Edit
,
Delete
,
List
}
from
'@element-plus/icons-vue'
import
{
debounce
}
from
'lodash-es'
const
[
searchForm
]
=
useValue
({})
const
[
editForm
,
resetEditForm
]
=
useValue
<
LogisticsMethod
>
({
...
...
@@ -538,7 +539,7 @@ async function checkData() {
return
{
isValid
,
postData
}
}
async
function
save
()
{
const
save
=
debounce
(
async
()
=>
{
const
{
isValid
,
postData
}
=
await
checkData
()
if
(
isValid
)
{
try
{
...
...
@@ -563,7 +564,7 @@ async function save() {
return
}
}
}
}
,
400
)
function
addDialog
()
{
dialogVisible
.
value
=
true
}
...
...
src/views/logistics/logisticsPartition.vue
View file @
5949aa2c
...
...
@@ -37,6 +37,7 @@
v-model=
"tableData"
:config=
"tableConfig"
:merge-cells=
"mergeCells"
@
edit-closed=
"editClosed"
:tableEditConfig=
"{
enabled: true,
}"
...
...
@@ -92,6 +93,7 @@ import { useValue } from './hooks/useValue'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
Edit
}
from
'@element-plus/icons-vue'
import
{
ElInput
}
from
'element-plus'
import
{
debounce
}
from
'lodash-es'
const
[
searchForm
]
=
useValue
({})
const
[
editForm
,
resetEditForm
]
=
useValue
({
logisticsList
:
[]
})
...
...
@@ -277,7 +279,7 @@ async function checkData() {
return
{
isValid
,
postData
}
}
async
function
save
()
{
const
save
=
debounce
(
async
()
=>
{
const
{
isValid
,
postData
}
=
await
checkData
()
if
(
isValid
)
{
try
{
...
...
@@ -285,10 +287,6 @@ async function save() {
await
addLogisticsZone
({
...
postData
,
})
}
else
{
await
updateLogisticsZone
({
...
postData
,
})
}
ElMessage
({
message
:
'保存成功'
,
...
...
@@ -302,7 +300,7 @@ async function save() {
return
}
}
}
}
,
400
)
function
addDialog
()
{
dialogVisible
.
value
=
true
}
...
...
@@ -351,6 +349,7 @@ async function deleteFn() {
}
}
const
loading
=
ref
(
false
)
const
editParams
=
ref
({})
async
function
getList
(
data
?)
{
loading
.
value
=
true
try
{
...
...
@@ -381,7 +380,18 @@ async function getList(data?) {
edit
:
({
row
})
=>
{
return
(
<
div
>
{
/* <ElInput v-model={row[key]?.codePrefix} /> */
}
<
ElInput
style
=
{{
height
:
'24px'
}}
modelValue
=
{
row
[
key
]?.
codePrefix
}
onInput
=
{(
e
)
=>
{
row
[
key
].
codePrefix
=
e
editParams
.
value
=
{
zoneName
:
row
.
zoneName
,
logistics
:
key
,
codePrefix
:
e
||
''
,
}
}}
/
>
<
/div
>
)
},
...
...
@@ -400,8 +410,6 @@ async function getList(data?) {
}
}
tableConfig
.
value
=
[...
oldConfig
,
...
newConfig
]
console
.
log
(
'tableConfig'
,
tableConfig
.
value
)
console
.
log
(
' tableData'
,
tableData
.
value
)
}
catch
(
e
)
{
console
.
log
(
e
)
}
...
...
@@ -505,13 +513,21 @@ async function exportExcel(file) {
}
}
watch
(
()
=>
loading
.
value
,
(
val
)
=>
{
console
.
log
(
442
,
val
)
},
{
deep
:
true
,
immediate
:
true
},
)
async
function
editClosed
()
{
console
.
log
(
1111111
,
editParams
.
value
)
try
{
if
(
Object
.
keys
(
editParams
.
value
).
length
)
{
await
updateLogisticsZone
(
editParams
.
value
)
ElMessage
.
success
(
'修改成功!'
)
getList
(
searchForm
.
value
)
}
}
catch
{
ElMessage
.
error
(
'修改失败!'
)
getList
(
searchForm
.
value
)
}
finally
{
editParams
.
value
=
{}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/logistics/logisticsQuotation.vue
View file @
5949aa2c
...
...
@@ -116,6 +116,7 @@ import usePageList from '@/utils/hooks/usePageList'
import
{
useValue
}
from
'./hooks/useValue'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
Edit
}
from
'@element-plus/icons-vue'
import
{
debounce
}
from
'lodash-es'
const
[
searchForm
]
=
useValue
({})
const
[
editForm
,
resetEditForm
]
=
useValue
({
unit
:
'oz'
})
...
...
@@ -477,7 +478,7 @@ async function checkData() {
return
{
isValid
,
postData
}
}
async
function
save
()
{
const
save
=
debounce
(
async
()
=>
{
const
{
isValid
,
postData
}
=
await
checkData
()
if
(
isValid
)
{
try
{
...
...
@@ -502,7 +503,7 @@ async function save() {
return
}
}
}
}
,
400
)
function
addDialog
()
{
dialogVisible
.
value
=
true
console
.
log
(
502
,
editForm
.
value
)
...
...
src/views/logistics/shippingAddress.vue
View file @
5949aa2c
...
...
@@ -185,6 +185,7 @@ import { LogisticsQuotation } from './types/logisticsQuotation.ts'
import
LogDialog
from
'./components/LogDialog.tsx'
import
CustomizeForm
from
'@/components/CustomizeForm.tsx'
import
{
Edit
,
Delete
,
List
}
from
'@element-plus/icons-vue'
import
{
debounce
}
from
'lodash-es'
import
usePageList
from
'@/utils/hooks/usePageList'
import
{
useValue
}
from
'./hooks/useValue'
...
...
@@ -293,14 +294,7 @@ const formConfig = ref<IFormConfig[]>([
placeholder
:
'请选择区'
,
},
},
{
prop
:
'cspAccount'
,
type
:
'input'
,
label
:
'CSP账号'
,
attrs
:
{
placeholder
:
'请输入CSP账号'
,
},
},
{
prop
:
'postalCode'
,
type
:
'input'
,
...
...
@@ -355,14 +349,7 @@ const formConfig = ref<IFormConfig[]>([
placeholder
:
'请输入电话'
,
},
},
{
prop
:
'rfcTaxId'
,
type
:
'input'
,
label
:
'RFC税号'
,
attrs
:
{
placeholder
:
'请输入RFC税号'
,
},
},
{
prop
:
'swDefault'
,
type
:
'switch'
,
...
...
@@ -432,7 +419,7 @@ async function checkData() {
return
{
isValid
,
postData
}
}
async
function
save
()
{
const
save
=
debounce
(
async
()
=>
{
const
{
isValid
,
postData
}
=
await
checkData
()
if
(
isValid
)
{
try
{
...
...
@@ -457,7 +444,7 @@ async function save() {
return
}
}
}
}
,
400
)
function
addDialog
()
{
dialogVisible
.
value
=
true
...
...
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