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
4fbb7ab7
Commit
4fbb7ab7
authored
May 30, 2025
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改编辑
parent
ef6bb62a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
192 deletions
+81
-192
src/api/logistics.ts
+1
-1
src/views/logistics/declarationRule.vue
+1
-1
src/views/logistics/logisticsPartition.vue
+43
-176
src/views/logistics/logisticsQuotation.vue
+36
-14
No files found.
src/api/logistics.ts
View file @
4fbb7ab7
...
@@ -9,7 +9,7 @@ interface Ikey {
...
@@ -9,7 +9,7 @@ interface Ikey {
[
key
:
string
]:
unknown
[
key
:
string
]:
unknown
}
}
interface
ILogisticsParams
{
interface
ILogisticsParams
{
logType
:
'logistics_way'
|
'logistics_address'
logType
:
string
relaId
:
number
|
string
relaId
:
number
|
string
}
}
//获取日志
//获取日志
...
...
src/views/logistics/declarationRule.vue
View file @
4fbb7ab7
...
@@ -539,7 +539,7 @@ async function showLog(row) {
...
@@ -539,7 +539,7 @@ async function showLog(row) {
logDialogVisible
.
value
=
true
logDialogVisible
.
value
=
true
try
{
try
{
const
{
data
}
=
await
getLogisticsLog
({
const
{
data
}
=
await
getLogisticsLog
({
logType
:
'logistics_
way
'
,
logType
:
'logistics_
customs_rule
'
,
relaId
:
row
.
id
,
relaId
:
row
.
id
,
})
})
logList
.
value
=
data
logList
.
value
=
data
...
...
src/views/logistics/logisticsPartition.vue
View file @
4fbb7ab7
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
<SearchForm
<SearchForm
:config=
"searchConfig"
:config=
"searchConfig"
@
search=
"search"
@
search=
"search"
@
add=
"addDialog"
:isAddBtn=
"false"
:isAddBtn=
"false"
@
delete=
"deleteFn"
@
delete=
"deleteFn"
v-model=
"searchForm"
v-model=
"searchForm"
...
@@ -47,29 +46,6 @@
...
@@ -47,29 +46,6 @@
</div>
</div>
</div>
</div>
</div>
</div>
<LogDialog
:title=
"editForm.id ? '编辑物流方式' : '新增物流方式'"
dialogWidth=
"1000px"
v-model=
"dialogVisible"
@
close=
"cancelFn"
>
<CustomizeForm
ref=
"editFormRef"
v-model=
"editForm"
:config=
"formConfig"
formItemWidth=
"100%"
>
</CustomizeForm>
<
template
#
footer
>
<div
style=
"text-align: center"
>
<ElButton
@
click=
"cancelFn"
>
取消
</ElButton>
<ElButton
type=
"primary"
@
click=
"save"
>
保存
</ElButton>
</div>
</
template
>
</LogDialog>
</template>
</template>
<
script
setup
lang=
"tsx"
>
<
script
setup
lang=
"tsx"
>
...
@@ -133,171 +109,43 @@ const searchConfig = ref([
...
@@ -133,171 +109,43 @@ const searchConfig = ref([
},
},
])
])
const
formConfig
=
ref
([
{
title
:
'物流基础信息'
},
{
prop
:
'zone1'
,
type
:
'input'
,
label
:
'ZONE 1'
,
attrs
:
{
placeholder
:
'请输入ZONE 1'
,
},
},
{
prop
:
'zone2'
,
type
:
'input'
,
label
:
'ZONE 2'
,
attrs
:
{
placeholder
:
'请输入ZONE 2'
,
},
},
{
prop
:
'zone3'
,
type
:
'input'
,
label
:
'ZONE 3'
,
attrs
:
{
placeholder
:
'请输入ZONE 3'
,
},
},
{
prop
:
'zone4'
,
type
:
'input'
,
label
:
'ZONE 4'
,
attrs
:
{
placeholder
:
'请输入ZONE 4'
,
},
},
{
prop
:
'zone5'
,
type
:
'input'
,
label
:
'ZONE 5'
,
attrs
:
{
placeholder
:
'请输入ZONE 5'
,
},
},
{
prop
:
'zone6'
,
type
:
'input'
,
label
:
'ZONE 6'
,
attrs
:
{
placeholder
:
'请输入ZONE 6'
,
},
},
{
prop
:
'zone7'
,
type
:
'input'
,
label
:
'ZONE 7'
,
attrs
:
{
placeholder
:
'请输入ZONE 7'
,
},
},
{
prop
:
'zone8'
,
type
:
'input'
,
label
:
'ZONE 8'
,
attrs
:
{
placeholder
:
'请输入ZONE 8'
,
},
},
{
prop
:
'zone9'
,
type
:
'input'
,
label
:
'ZONE 9'
,
attrs
:
{
placeholder
:
'请输入ZONE 9'
,
},
},
])
const
tableConfig
=
ref
([])
const
tableConfig
=
ref
([])
onMounted
(()
=>
{
onMounted
(()
=>
{
// loading.value = true
getAllList
()
getAllList
()
})
})
/**
* @description: 搜索
*/
async
function
search
()
{
async
function
search
()
{
await
getList
(
searchForm
.
value
)
await
getList
(
searchForm
.
value
)
setCellStyle
()
setCellStyle
()
}
}
/**
* @description: 转换表格数据
*/
function
getTableData
(
arr
)
{
function
getTableData
(
arr
)
{
// 防御式编程:处理非数组或空输入
if
(
!
Array
.
isArray
(
arr
)
||
arr
.
length
===
0
)
return
[]
if
(
!
Array
.
isArray
(
arr
)
||
arr
.
length
===
0
)
return
[]
// 使用 map 替代 forEach 实现不可变数据
return
arr
.
map
((
parentItem
)
=>
{
return
arr
.
map
((
parentItem
)
=>
{
// 使用可选链 + 空值合并运算符处理嵌套数据
const
quotationList
=
parentItem
.
logisticsZoneList
??
[]
const
quotationList
=
parentItem
.
logisticsZoneList
??
[]
// 使用 Object.fromEntries 优化属性合并
quotationList
?.
forEach
((
el
)
=>
{
quotationList
?.
forEach
((
el
)
=>
{
parentItem
[
el
.
logistics
]
=
{
parentItem
[
el
.
logistics
]
=
{
codePrefix
:
el
.
codePrefix
||
''
,
codePrefix
:
el
.
codePrefix
||
''
,
highlight
:
el
.
highlight
,
highlight
:
el
.
highlight
,
logisticsId
:
el
.
logisticsId
,
}
}
})
})
// 返回新对象保持不可变性
return
{
return
{
...
parentItem
,
// 保留原属性
...
parentItem
,
}
}
})
})
}
}
function
cancelFn
()
{
/**
dialogVisible
.
value
=
false
* @description: 删除按钮
editFormRef
.
value
?.
resetFields
()
*/
resetEditForm
()
}
async
function
checkData
()
{
const
[
isValid
,
postData
]
=
await
Promise
.
all
([
new
Promise
<
boolean
>
((
resolve
)
=>
{
editFormRef
.
value
?.
validate
()
.
then
(()
=>
resolve
(
true
))
.
catch
((
err
)
=>
{
resolve
(
false
)
console
.
log
(
err
)
})
}),
new
Promise
<
any
>
((
resolve
)
=>
{
const
params
=
{
...
editForm
.
value
}
resolve
(
params
)
}),
])
console
.
log
(
isValid
,
postData
)
return
{
isValid
,
postData
}
}
const
save
=
debounce
(
async
()
=>
{
const
{
isValid
,
postData
}
=
await
checkData
()
if
(
isValid
)
{
try
{
if
(
!
postData
.
id
)
{
await
addLogisticsZone
({
...
postData
,
})
}
ElMessage
({
message
:
'保存成功'
,
type
:
'success'
,
offset
:
window
.
innerHeight
/
2
,
})
cancelFn
()
search
()
}
catch
(
e
)
{
return
}
}
},
400
)
function
addDialog
()
{
dialogVisible
.
value
=
true
}
async
function
deleteFn
()
{
async
function
deleteFn
()
{
if
(
!
selection
.
value
.
length
)
{
if
(
!
selection
.
value
.
length
)
{
return
ElMessage
({
return
ElMessage
({
...
@@ -342,8 +190,13 @@ async function deleteFn() {
...
@@ -342,8 +190,13 @@ async function deleteFn() {
// showError(e)
// showError(e)
}
}
}
}
const
loading
=
ref
(
false
)
const
loading
=
ref
(
false
)
const
editParams
=
ref
({})
const
editParams
=
ref
({})
/**
* @description: 获取列表
*/
async
function
getList
(
data
?)
{
async
function
getList
(
data
?)
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
...
@@ -352,7 +205,7 @@ async function getList(data?) {
...
@@ -352,7 +205,7 @@ async function getList(data?) {
})
})
tableData
.
value
=
[...
res
.
data
]
tableData
.
value
=
[...
res
.
data
]
try
{
const
arr
=
await
getTableData
(
tableData
.
value
)
const
arr
=
await
getTableData
(
tableData
.
value
)
const
whiteList
=
[
'logisticsZoneList'
,
'zoneName'
]
const
whiteList
=
[
'logisticsZoneList'
,
'zoneName'
]
...
@@ -378,11 +231,13 @@ async function getList(data?) {
...
@@ -378,11 +231,13 @@ async function getList(data?) {
style
=
{{
height
:
'24px'
}}
style
=
{{
height
:
'24px'
}}
modelValue
=
{
row
[
key
]?.
codePrefix
}
modelValue
=
{
row
[
key
]?.
codePrefix
}
onInput
=
{(
e
)
=>
{
onInput
=
{(
e
)
=>
{
console
.
log
(
233
,
row
)
row
[
key
].
codePrefix
=
e
row
[
key
].
codePrefix
=
e
editParams
.
value
=
{
editParams
.
value
=
{
zoneName
:
row
.
zoneName
,
zoneName
:
row
.
zoneName
,
logistics
:
key
,
logistics
:
key
,
codePrefix
:
e
||
''
,
codePrefix
:
e
||
''
,
logisticsId
:
row
[
key
].
logisticsId
,
}
}
}}
}}
/
>
/
>
...
@@ -404,9 +259,7 @@ async function getList(data?) {
...
@@ -404,9 +259,7 @@ async function getList(data?) {
}
}
}
}
tableConfig
.
value
=
[...
oldConfig
,
...
newConfig
]
tableConfig
.
value
=
[...
oldConfig
,
...
newConfig
]
}
catch
(
e
)
{
console
.
log
(
545
,
tableConfig
.
value
)
console
.
log
(
e
)
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
finally
{
}
finally
{
...
@@ -414,17 +267,21 @@ async function getList(data?) {
...
@@ -414,17 +267,21 @@ async function getList(data?) {
}
}
}
}
/**
* @description: 处理复选框
*/
function
handleCheckboxRecords
(
value
:
never
[])
{
function
handleCheckboxRecords
(
value
:
never
[])
{
console
.
log
(
351
,
value
)
console
.
log
(
351
,
value
)
selection
.
value
=
value
selection
.
value
=
value
}
}
/**
* @description: 设置单元格样式
*/
function
setCellStyle
()
{
function
setCellStyle
()
{
const
[
cell
,
primaryCell
]
=
[
'.tableCell'
,
'.primaryCell'
].
map
((
selector
)
=>
const
[
cell
,
primaryCell
]
=
[
'.tableCell'
,
'.primaryCell'
].
map
((
selector
)
=>
document
.
querySelectorAll
(
selector
),
document
.
querySelectorAll
(
selector
),
)
)
console
.
log
(
404
,
cell
)
const
getAncestor
=
(
element
,
level
=
2
)
=>
{
const
getAncestor
=
(
element
,
level
=
2
)
=>
{
let
current
=
element
let
current
=
element
while
(
level
--
>
0
&&
current
)
{
while
(
level
--
>
0
&&
current
)
{
...
@@ -452,17 +309,21 @@ function setCellStyle() {
...
@@ -452,17 +309,21 @@ function setCellStyle() {
}
}
}
}
/**
* @description: 获取物流方式列表
*/
async
function
getAllList
()
{
async
function
getAllList
()
{
try
{
try
{
const
res
=
await
Promise
.
all
([
getlogisticsWayAllList
(),
getList
()])
const
res
=
await
Promise
.
all
([
getlogisticsWayAllList
(),
getList
()])
// console.log(545, res)
searchConfig
.
value
[
0
].
attrs
!
.
options
=
[...(
res
[
0
]?.
data
||
[])]
searchConfig
.
value
[
0
].
attrs
!
.
options
=
[...(
res
[
0
]?.
data
||
[])]
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
}
}
}
/**
* @description: 上传文件
*/
function
onBeforeUploadImage
(
file
)
{
function
onBeforeUploadImage
(
file
)
{
const
isIMAGE
=
const
isIMAGE
=
file
.
type
==
file
.
type
==
...
@@ -474,16 +335,15 @@ function onBeforeUploadImage(file) {
...
@@ -474,16 +335,15 @@ function onBeforeUploadImage(file) {
return
isIMAGE
return
isIMAGE
}
}
/**
* @description: 下载模版
*/
async
function
downloadExcel
()
{
async
function
downloadExcel
()
{
try
{
try
{
const
res
=
await
exportExcelLogisticsZone
()
const
res
=
await
exportExcelLogisticsZone
()
// console.log(483, data)
const
blob
=
new
Blob
([
res
])
const
blob
=
new
Blob
([
res
])
// 2. 解析文件名(从响应头或自定义)
const
filename
=
'物流分区模版.xlsx'
const
filename
=
'物流分区模版.xlsx'
// 3. 创建临时链接并触发下载
const
link
=
document
.
createElement
(
'a'
)
const
link
=
document
.
createElement
(
'a'
)
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
)
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
)
link
.
download
=
filename
link
.
download
=
filename
...
@@ -492,6 +352,10 @@ async function downloadExcel() {
...
@@ -492,6 +352,10 @@ async function downloadExcel() {
console
.
log
(
error
)
console
.
log
(
error
)
}
}
}
}
/**
* @description: 导入
*/
async
function
exportExcel
(
file
)
{
async
function
exportExcel
(
file
)
{
try
{
try
{
const
formData
=
new
FormData
()
const
formData
=
new
FormData
()
...
@@ -507,6 +371,9 @@ async function exportExcel(file) {
...
@@ -507,6 +371,9 @@ async function exportExcel(file) {
}
}
}
}
/**
* @description: table编辑关闭事件
*/
async
function
editClosed
()
{
async
function
editClosed
()
{
console
.
log
(
1111111
,
editParams
.
value
)
console
.
log
(
1111111
,
editParams
.
value
)
try
{
try
{
...
...
src/views/logistics/logisticsQuotation.vue
View file @
4fbb7ab7
...
@@ -94,6 +94,17 @@
...
@@ -94,6 +94,17 @@
</div>
</div>
</
template
>
</
template
>
</LogDialog>
</LogDialog>
<LogDialog
title=
"操作日志"
v-model=
"logDialogVisible"
@
close=
"logDialogVisible = false"
>
<div
v-for=
"item in logList"
:key=
"item.id"
style=
"margin-bottom: 8px"
>
<span
style=
"margin-right: 10px"
>
{{ item.createTime }}
</span>
<span>
{{ item.description }}
</span>
</div>
</LogDialog>
</template>
</template>
<
script
setup
lang=
"tsx"
>
<
script
setup
lang=
"tsx"
>
...
@@ -108,6 +119,7 @@ import {
...
@@ -108,6 +119,7 @@ import {
deleteLogisticsQuotation
,
deleteLogisticsQuotation
,
importLogisticsQuotation
,
importLogisticsQuotation
,
downloadLogisticsQuotationTemplate
,
downloadLogisticsQuotationTemplate
,
getLogisticsLog
,
}
from
'@/api/logistics'
}
from
'@/api/logistics'
import
type
{
LogisticsMethod
}
from
'@/types/api/logistics'
import
type
{
LogisticsMethod
}
from
'@/types/api/logistics'
import
SearchForm
from
'@/components/SearchForm.tsx'
import
SearchForm
from
'@/components/SearchForm.tsx'
...
@@ -118,7 +130,7 @@ import type { VxeTablePropTypes } from 'vxe-table'
...
@@ -118,7 +130,7 @@ import type { VxeTablePropTypes } from 'vxe-table'
import
usePageList
from
'@/utils/hooks/usePageList'
import
usePageList
from
'@/utils/hooks/usePageList'
import
{
useValue
}
from
'./hooks/useValue'
import
{
useValue
}
from
'./hooks/useValue'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
Edit
}
from
'@element-plus/icons-vue'
import
{
Edit
,
List
}
from
'@element-plus/icons-vue'
import
{
debounce
}
from
'lodash-es'
import
{
debounce
}
from
'lodash-es'
const
[
searchForm
]
=
useValue
({
logisticsIdList
:
[]
})
const
[
searchForm
]
=
useValue
({
logisticsIdList
:
[]
})
...
@@ -373,6 +385,15 @@ const tableConfig = ref([
...
@@ -373,6 +385,15 @@ const tableConfig = ref([
>
>
<
Edit
/>
<
Edit
/>
<
/el-icon
>
<
/el-icon
>
<
el
-
icon
size
=
"24"
title
=
"日志"
color
=
"#008aff"
style
=
"cursor: pointer; vertical-align: middle"
onclick
=
{()
=>
showLog
(
row
)}
>
<
List
/>
<
/el-icon
>
<
/div
>
<
/div
>
),
),
},
},
...
@@ -568,11 +589,7 @@ async function downloadExcel() {
...
@@ -568,11 +589,7 @@ async function downloadExcel() {
const
res
=
await
downloadLogisticsQuotationTemplate
()
const
res
=
await
downloadLogisticsQuotationTemplate
()
console
.
log
(
483
,
data
)
console
.
log
(
483
,
data
)
const
blob
=
new
Blob
([
res
])
const
blob
=
new
Blob
([
res
])
// 2. 解析文件名(从响应头或自定义)
const
filename
=
'物流报价模版.xlsx'
const
filename
=
'物流报价模版.xlsx'
// 3. 创建临时链接并触发下载
const
link
=
document
.
createElement
(
'a'
)
const
link
=
document
.
createElement
(
'a'
)
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
)
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
)
link
.
download
=
filename
link
.
download
=
filename
...
@@ -612,15 +629,20 @@ async function updateExcel(file) {
...
@@ -612,15 +629,20 @@ async function updateExcel(file) {
}
}
}
}
watch
(
const
logList
=
ref
([])
()
=>
editForm
.
value
,
const
logDialogVisible
=
ref
(
false
)
(
val
)
=>
{
async
function
showLog
(
row
)
{
console
.
log
(
'editForm'
,
val
)
logDialogVisible
.
value
=
true
const
bool
=
editForm
.
value
?.[
'id'
]
?
true
:
false
try
{
console
.
log
(
'bool'
,
bool
)
const
{
data
}
=
await
getLogisticsLog
({
},
logType
:
'logistics_quotation'
,
{
deep
:
true
,
immediate
:
true
},
relaId
:
row
.
id
,
)
})
logList
.
value
=
data
}
catch
(
error
)
{
console
.
log
(
error
)
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
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