Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-baoshen-excel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何远江
topsun-baoshen-excel
Commits
0a3bd4b3
Commit
0a3bd4b3
authored
Apr 17, 2025
by
tanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源库页面调整
parent
a68e3b96
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
24 deletions
+93
-24
index.ts
src/router/index.ts
+16
-1
InformationList.vue
src/views/information/InformationList.vue
+34
-14
information-info-dialog.vue
src/views/information/components/information-info-dialog.vue
+18
-8
upload-information-info-dialog.vue
...information/components/upload-information-info-dialog.vue
+25
-1
No files found.
src/router/index.ts
View file @
0a3bd4b3
...
...
@@ -176,6 +176,19 @@ export const routes = [
title
:
'产品对照'
}
},
]
},
{
path
:
'/customer-excel'
,
name
:
'CustomerExcel'
,
component
:
Layout
,
meta
:
{
title
:
'资料库'
},
children
:
[
// 客户资料管理相关菜单
{
path
:
'/customer-excel'
,
...
...
@@ -188,6 +201,7 @@ export const routes = [
{
path
:
'/customer-excel-list'
,
name
:
'CustomerExcelList'
,
hidden
:
true
,
meta
:
{
title
:
'客户资料'
},
...
...
@@ -195,6 +209,7 @@ export const routes = [
},
]
},
{
path
:
'/online-excel'
,
name
:
'OnlineExcel'
,
...
...
src/views/information/InformationList.vue
View file @
0a3bd4b3
<
template
>
<div
class=
"w-full h-full bg-white p-4"
>
<p
class=
"font-bold text-lg leading-10 border-b-2"
>
资料库管理
</p>
<el-form
class=
"pt-4"
ref=
"formRef"
:model=
"form"
inline
>
<el-form-item
v-for=
"(item, index) in formColumn"
:label=
"item"
:key=
"index"
:prop=
"item"
>
<el-input
v-model=
"form[item]"
placeholder=
""
clearable
/>
</el-form-item>
<el-form-item>
<el-button
type=
"default"
@
click=
"onReset"
>
重置
</el-button>
<el-button
type=
"primary"
@
click=
"onSearch"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"onCopy"
>
查询参数
</el-button>
</el-form-item>
</el-form>
<p
class=
"font-bold text-lg leading-10 border-b-2"
>
{{
route
.
query
.
informationType
}}
</p>
<vxe-form
title-overflow
title-colon
title-width=
"120"
title-align=
"right"
:data=
"form"
@
submit=
"onSearch"
@
reset=
"onReset"
>
<vxe-form-item
v-for=
"(item, index) in formColumn"
:key=
"index"
:field=
"item"
:title=
"item"
span=
"6"
:item-render=
"item"
>
<template
#
default
>
<vxe-input
v-model=
"form[item]"
></vxe-input>
</
template
>
</vxe-form-item>
<vxe-form-item
align=
"right"
span=
"24"
:item-render=
"{}"
>
<
template
#
default
>
<vxe-button
type=
"submit"
status=
"primary"
content=
"查询"
></vxe-button>
<vxe-button
type=
"reset"
content=
"重置"
></vxe-button>
<vxe-button
type=
"primary"
@
click=
"onCopy"
>
查询参数
</vxe-button>
</
template
>
</vxe-form-item>
</vxe-form>
<div>
<vxe-toolbar>
<
template
#
buttons
>
...
...
@@ -19,7 +33,8 @@
<!--
<el-button
type=
"danger"
@
click=
"handleDel"
>
删除
</el-button>
-->
</
template
>
</vxe-toolbar>
<vxe-table
ref=
"xTable"
size=
"small"
min-height=
"460"
border
:loading=
"loading"
:data=
"tableData"
>
<vxe-table
ref=
"xTable"
min-height=
"460"
border
:loading=
"loading"
:data=
"tableData"
:row-config=
"{keyField:'id'}"
>
<vxe-column
field=
"id"
title=
"ID"
width=
"100"
></vxe-column>
<vxe-column
v-for=
"(row, index) in tableColumn"
:field=
"row"
min-width=
"150"
:title=
"row"
:key=
"index"
/>
<vxe-column
title=
"操作"
width=
"100"
fixed=
"right"
>
<
template
#
default=
"{ row }"
>
...
...
@@ -52,6 +67,8 @@ const loading = ref(false)
const
formRef
=
ref
<
FormInstance
>
()
const
formColumn
=
ref
([])
const
form
=
ref
<
any
>
({})
const
defualtForm
=
ref
<
any
>
({})
const
total
=
ref
(
0
)
const
xTable
=
ref
<
VxeTableInstance
>
()
const
tableData
=
ref
([])
...
...
@@ -81,6 +98,7 @@ const initData = async () => {
})
formColumn
.
value
.
forEach
((
ele
:
any
)
=>
{
form
.
value
[
ele
]
=
""
defualtForm
.
value
[
ele
]
=
""
});
getInformationListApi
(
params
).
then
((
res
)
=>
{
if
(
res
.
data
?.
code
==
200
)
{
...
...
@@ -156,18 +174,20 @@ const onChange = (type: any) => {
if
(
type
!=
'close'
)
{
onReset
()
}
onReset
()
}
const
handleAdd
=
()
=>
{
visible
.
value
=
true
title
.
value
=
"新增资料"
informationInfo
.
value
=
f
orm
.
value
informationInfo
.
value
=
defualtF
orm
.
value
}
const
handleUpdate
=
(
row
:
any
)
=>
{
visible
.
value
=
true
title
.
value
=
"修改资料"
informationInfo
.
value
=
Object
.
assign
(
form
.
value
,
row
)
informationInfo
.
value
=
row
//Object.assign(form.value, row)
}
const
handleDel
=
async
(
row
:
any
)
=>
{
...
...
src/views/information/components/information-info-dialog.vue
View file @
0a3bd4b3
<
template
>
<vxe-modal
v-model=
"show"
:z-index=
"1006"
@
hide=
"onClose"
:title=
"title"
width=
"
6
00"
esc-closable
mask-closable
<vxe-modal
v-model=
"show"
:z-index=
"1006"
@
hide=
"onClose"
:title=
"title"
width=
"
8
00"
esc-closable
mask-closable
show-footer
>
<template
#
default
>
<el-form
ref=
"formRef"
:model=
"form"
inline
label-position=
"right"
>
<template
v-for=
"(item, index) in formColumn"
:key=
"index"
>
<el-form-item
v-if=
"!['id', '_X_ROW_KEY'].includes(item)"
:label=
"item"
:prop=
"item"
>
<el-input
v-model=
"form[item]"
placeholder=
""
clearable
/>
</el-form-item>
<vxe-form
title-overflow
title-colon
title-width=
"120"
title-align=
"right"
ref=
"formRef"
:data=
"form"
>
<vxe-form-item
v-for=
"(item, index) in formColumn"
:key=
"index"
:field=
"item"
:title=
"item"
span=
"12"
:item-render=
"item"
>
<template
#
default
>
<vxe-input
v-model=
"form[item]"
></vxe-input>
</
template
>
</el-form>
</vxe-form-item>
</vxe-form>
</template>
<
template
#
footer
>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
确认
</el-button>
...
...
@@ -69,6 +77,8 @@ const addInformationInfo = async () => {
}
}
const updateInformationInfo = async () => {
delete form.value['_X_ROW_KEY']
const params = {
...
...
src/views/information/components/upload-information-info-dialog.vue
View file @
0a3bd4b3
...
...
@@ -2,7 +2,19 @@
<vxe-modal
v-model=
"show"
:z-index=
"1006"
@
hide=
"onClose"
title=
"导入"
width=
"600"
esc-closable
mask-closable
show-footer
>
<template
#
default
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
label-position=
"left"
label-width=
"100px"
>
<el-form-item
label=
"品牌编码"
prop=
"brandCode"
>
<el-input
v-model=
"form.brandCode"
clearable
/>
</el-form-item>
<el-form-item
label=
"客户编码"
prop=
"customerCode"
>
<el-input
v-model=
"form.customerCode"
disabled
>
<template
#
append
>
<el-button
:icon=
"MoreFilled"
@
click=
"customerVisible = true"
/>
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"资料类型"
prop=
"informationType"
>
<el-input
v-model=
"form.informationType"
:disabled=
"!!route.query.informationType"
clearable
/>
</el-form-item>
...
...
@@ -47,6 +59,8 @@
<el-button
type=
"primary"
@
click=
"onSubmit"
>
确认
</el-button>
</
template
>
</vxe-modal>
<CustomerModal
v-model:visible=
"customerVisible"
@
confirm=
"confirmCustomer"
/>
</template>
<
script
lang=
"ts"
setup
name=
"UploadInformationInfoDialog"
>
...
...
@@ -54,9 +68,12 @@ import { ref, reactive, watch } from 'vue'
import
{
useRoute
}
from
'vue-router'
import
{
uploadFile
}
from
'@/api/excel'
import
{
importInformationApi
}
from
'@/api/customer'
import
{
MoreFilled
}
from
'@element-plus/icons-vue'
import
CustomerModal
from
'@/components/CustomerModal/CustomerModal.vue'
import
{
ElMessage
,
genFileId
,
type
FormInstance
,
type
UploadInstance
}
from
'element-plus'
const
route
=
useRoute
()
const
customerVisible
=
ref
(
false
)
const
props
=
defineProps
({
visible
:
{
...
...
@@ -91,6 +108,11 @@ watch(
}
}
)
const
confirmCustomer
=
(
list
:
any
)
=>
{
const
[
item
]
=
list
if
(
!
item
)
return
form
.
customerCode
=
item
.
customerCode
}
const
importInformation
=
async
()
=>
{
const
temp
=
tableData
.
value
.
reduce
((
acc
:
any
,
cur
:
any
)
=>
{
...
...
@@ -99,6 +121,8 @@ const importInformation = async () => {
},
{})
const
params
=
{
informationType
:
form
.
informationType
,
customerCode
:
form
.
customerCode
,
brandCode
:
form
.
brandCode
,
filePath
:
form
.
filePath
,
defaultJson
:
temp
}
...
...
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