Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-admin
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
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
吴迪
gs1-admin
Commits
6faec595
Commit
6faec595
authored
Jan 18, 2022
by
林家欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联调商品分类
parent
6666637e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
633 additions
and
0 deletions
+633
-0
pcategory-add-or-update.vue
src/views/modules/plate/pcategory-add-or-update.vue
+84
-0
pcategory.vue
src/views/modules/plate/pcategory.vue
+182
-0
branch-add-or-update.vue
src/views/modules/service/branch-add-or-update.vue
+156
-0
branch.vue
src/views/modules/service/branch.vue
+211
-0
No files found.
src/views/modules/plate/pcategory-add-or-update.vue
0 → 100644
View file @
6faec595
<
template
>
<el-dialog
:title=
"!dataForm.categoryid ? '新增' : '修改'"
:close-on-click-modal=
"false"
:visible
.
sync=
"visible"
>
<el-form
:model=
"dataForm"
:rules=
"dataRule"
ref=
"dataForm"
@
keyup
.
enter
.
native=
"dataFormSubmit()"
label-width=
"80px"
>
<el-form-item
label=
"分类名称"
prop=
"category"
>
<el-input
v-model=
"dataForm.category"
placeholder=
"请输入分类名称"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"visible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"dataFormSubmit()"
>
确定
</el-button>
</span>
</el-dialog>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
visible
:
false
,
dataForm
:
{
categoryid
:
0
,
category
:
''
,
},
dataRule
:
{
category
:
[
{
required
:
true
,
message
:
'分类名称不能为空'
,
trigger
:
'blur'
}
],
}
}
},
methods
:
{
init
(
id
)
{
this
.
dataForm
.
categoryid
=
id
||
0
this
.
visible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'dataForm'
].
resetFields
()
if
(
this
.
dataForm
.
categoryid
)
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
`/office/pcategory/info/
${
this
.
dataForm
.
categoryid
}
`
),
method
:
'get'
,
params
:
this
.
$http
.
adornParams
()
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
dataForm
.
category
=
data
.
pcategory
.
category
}
})
}
})
},
// 表单提交
dataFormSubmit
()
{
this
.
$refs
[
'dataForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
`/office/pcategory/
${
!
this
.
dataForm
.
categoryid
?
'save'
:
'update'
}
`
),
method
:
'post'
,
data
:
this
.
$http
.
adornData
({
'categoryid'
:
this
.
dataForm
.
categoryid
||
undefined
,
'category'
:
this
.
dataForm
.
category
,
})
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
$message
({
message
:
'操作成功'
,
type
:
'success'
,
duration
:
1500
,
onClose
:
()
=>
{
this
.
visible
=
false
this
.
$emit
(
'refreshDataList'
)
}
})
}
else
{
this
.
$message
.
error
(
data
.
msg
)
}
})
}
})
}
}
}
</
script
>
src/views/modules/plate/pcategory.vue
0 → 100644
View file @
6faec595
<
template
>
<div
class=
"mod-config"
>
<div
class=
"add-btn"
>
<el-button
v-if=
"isAuth('manage:center:save')"
type=
"primary"
@
click=
"addOrUpdateHandle()"
>
+ 添加分类
</el-button
>
</div>
<el-table
:data=
"dataList"
border
v-loading=
"dataListLoading"
@
selection-change=
"selectionChangeHandle"
style=
"width: 100%"
>
<el-table-column
prop=
"categoryid"
header-align=
"center"
align=
"center"
label=
"编号"
width=
"100"
>
</el-table-column>
<el-table-column
prop=
"category"
header-align=
"center"
align=
"center"
label=
"类型"
>
</el-table-column>
<el-table-column
fixed=
"right"
header-align=
"center"
align=
"center"
width=
"150"
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
size=
"small"
@
click=
"addOrUpdateHandle(scope.row.categoryid)"
>
编辑
</el-button
>
<el-button
type=
"text"
size=
"small"
@
click=
"deleteHandle(scope.row.categoryid)"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
<el-pagination
@
size-change=
"sizeChangeHandle"
@
current-change=
"currentChangeHandle"
:current-page=
"pageIndex"
:page-sizes=
"[10, 20, 50, 100]"
:page-size=
"pageSize"
:total=
"totalPage"
layout=
"total, sizes, prev, pager, next, jumper"
>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if=
"addOrUpdateVisible"
ref=
"addOrUpdate"
@
refreshDataList=
"getDataList"
></add-or-update>
</div>
</template>
<
script
>
import
AddOrUpdate
from
"./pcategory-add-or-update"
;
export
default
{
data
()
{
return
{
dataForm
:
{
key
:
""
,
},
dataList
:
[],
pageIndex
:
1
,
pageSize
:
10
,
totalPage
:
0
,
dataListLoading
:
false
,
dataListSelections
:
[],
addOrUpdateVisible
:
false
,
};
},
components
:
{
AddOrUpdate
,
},
activated
()
{
this
.
getDataList
();
},
methods
:
{
// 获取数据列表
getDataList
()
{
this
.
dataListLoading
=
true
;
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
"/office/pcategory/list"
),
method
:
"get"
,
params
:
this
.
$http
.
adornParams
({
page
:
this
.
pageIndex
,
limit
:
this
.
pageSize
,
key
:
this
.
dataForm
.
key
,
}),
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
dataList
=
data
.
page
.
list
;
this
.
totalPage
=
data
.
page
.
totalCount
;
}
else
{
this
.
dataList
=
[];
this
.
totalPage
=
0
;
}
this
.
dataListLoading
=
false
;
});
},
// 每页数
sizeChangeHandle
(
val
)
{
this
.
pageSize
=
val
;
this
.
pageIndex
=
1
;
this
.
getDataList
();
},
// 当前页
currentChangeHandle
(
val
)
{
this
.
pageIndex
=
val
;
this
.
getDataList
();
},
// 多选
selectionChangeHandle
(
val
)
{
this
.
dataListSelections
=
val
;
},
// 新增 / 修改
addOrUpdateHandle
(
id
)
{
this
.
addOrUpdateVisible
=
true
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
addOrUpdate
.
init
(
id
);
});
},
// 删除
deleteHandle
(
id
)
{
var
ids
=
id
?
[
id
]
:
this
.
dataListSelections
.
map
((
item
)
=>
{
return
item
.
categoryid
;
});
this
.
$confirm
(
`确定对[id=
${
ids
.
join
(
","
)}
]进行[
${
id
?
"删除"
:
"批量删除"
}
]操作?`
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
,
}
).
then
(()
=>
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
"/office/pcategory/delete"
),
method
:
"post"
,
data
:
this
.
$http
.
adornData
(
ids
,
false
),
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
$message
({
message
:
"操作成功"
,
type
:
"success"
,
duration
:
1500
,
onClose
:
()
=>
{
this
.
getDataList
();
},
});
}
else
{
this
.
$message
.
error
(
data
.
msg
);
}
});
});
},
},
};
</
script
>
src/views/modules/service/branch-add-or-update.vue
0 → 100644
View file @
6faec595
<
template
>
<el-dialog
:title=
"!dataForm.branchCode ? '新增' : '修改'"
:close-on-click-modal=
"false"
:visible
.
sync=
"visible"
>
<el-form
:model=
"dataForm"
:rules=
"dataRule"
ref=
"dataForm"
@
keyup
.
enter
.
native=
"dataFormSubmit()"
label-width=
"80px"
>
<el-form-item
label=
"$
{column.comments}" prop="branchName">
<el-input
v-model=
"dataForm.branchName"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
<el-form-item
label=
"$
{column.comments}" prop="branchAddress">
<el-input
v-model=
"dataForm.branchAddress"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
<el-form-item
label=
"$
{column.comments}" prop="branchPostcode">
<el-input
v-model=
"dataForm.branchPostcode"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
<el-form-item
label=
"$
{column.comments}" prop="branchContact">
<el-input
v-model=
"dataForm.branchContact"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
<el-form-item
label=
"$
{column.comments}" prop="tel1">
<el-input
v-model=
"dataForm.tel1"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
<el-form-item
label=
"$
{column.comments}" prop="tel2">
<el-input
v-model=
"dataForm.tel2"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
<el-form-item
label=
"$
{column.comments}" prop="fax">
<el-input
v-model=
"dataForm.fax"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
<el-form-item
label=
"$
{column.comments}" prop="rockkey">
<el-input
v-model=
"dataForm.rockkey"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
<el-form-item
label=
"$
{column.comments}" prop="branchSimname">
<el-input
v-model=
"dataForm.branchSimname"
placeholder=
"$
{column.comments}">
</el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"visible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"dataFormSubmit()"
>
确定
</el-button>
</span>
</el-dialog>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
visible
:
false
,
dataForm
:
{
branchCode
:
0
,
branchName
:
''
,
branchAddress
:
''
,
branchPostcode
:
''
,
branchContact
:
''
,
tel1
:
''
,
tel2
:
''
,
fax
:
''
,
rockkey
:
''
,
branchSimname
:
''
},
dataRule
:
{
branchName
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
],
branchAddress
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
],
branchPostcode
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
],
branchContact
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
],
tel1
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
],
tel2
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
],
fax
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
],
rockkey
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
],
branchSimname
:
[
{
required
:
true
,
message
:
'${column.comments}不能为空'
,
trigger
:
'blur'
}
]
}
}
},
methods
:
{
init
(
id
)
{
this
.
dataForm
.
branchCode
=
id
||
0
this
.
visible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'dataForm'
].
resetFields
()
if
(
this
.
dataForm
.
branchCode
)
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
`/office/branch/info/
${
this
.
dataForm
.
branchCode
}
`
),
method
:
'get'
,
params
:
this
.
$http
.
adornParams
()
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
dataForm
.
branchName
=
data
.
branch
.
branchName
this
.
dataForm
.
branchAddress
=
data
.
branch
.
branchAddress
this
.
dataForm
.
branchPostcode
=
data
.
branch
.
branchPostcode
this
.
dataForm
.
branchContact
=
data
.
branch
.
branchContact
this
.
dataForm
.
tel1
=
data
.
branch
.
tel1
this
.
dataForm
.
tel2
=
data
.
branch
.
tel2
this
.
dataForm
.
fax
=
data
.
branch
.
fax
this
.
dataForm
.
rockkey
=
data
.
branch
.
rockkey
this
.
dataForm
.
branchSimname
=
data
.
branch
.
branchSimname
}
})
}
})
},
// 表单提交
dataFormSubmit
()
{
this
.
$refs
[
'dataForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
`/manage/branch/
${
!
this
.
dataForm
.
branchCode
?
'save'
:
'update'
}
`
),
method
:
'post'
,
data
:
this
.
$http
.
adornData
({
'branchCode'
:
this
.
dataForm
.
branchCode
||
undefined
,
'branchName'
:
this
.
dataForm
.
branchName
,
'branchAddress'
:
this
.
dataForm
.
branchAddress
,
'branchPostcode'
:
this
.
dataForm
.
branchPostcode
,
'branchContact'
:
this
.
dataForm
.
branchContact
,
'tel1'
:
this
.
dataForm
.
tel1
,
'tel2'
:
this
.
dataForm
.
tel2
,
'fax'
:
this
.
dataForm
.
fax
,
'rockkey'
:
this
.
dataForm
.
rockkey
,
'branchSimname'
:
this
.
dataForm
.
branchSimname
})
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
$message
({
message
:
'操作成功'
,
type
:
'success'
,
duration
:
1500
,
onClose
:
()
=>
{
this
.
visible
=
false
this
.
$emit
(
'refreshDataList'
)
}
})
}
else
{
this
.
$message
.
error
(
data
.
msg
)
}
})
}
})
}
}
}
</
script
>
src/views/modules/service/branch.vue
0 → 100644
View file @
6faec595
<
template
>
<div
class=
"mod-config"
>
<el-form
:inline=
"true"
:model=
"dataForm"
@
keyup
.
enter
.
native=
"getDataList()"
>
<el-form-item>
<el-input
v-model=
"dataForm.key"
placeholder=
"参数名"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button
@
click=
"getDataList()"
>
查询
</el-button>
<el-button
v-if=
"isAuth('manage:branch:save')"
type=
"primary"
@
click=
"addOrUpdateHandle()"
>
新增
</el-button>
<el-button
v-if=
"isAuth('manage:branch:delete')"
type=
"danger"
@
click=
"deleteHandle()"
:disabled=
"dataListSelections.length
<
=
0
"
>
批量删除
</el-button>
</el-form-item>
</el-form>
<el-table
:data=
"dataList"
border
v-loading=
"dataListLoading"
@
selection-change=
"selectionChangeHandle"
style=
"width: 100%;"
>
<el-table-column
type=
"selection"
header-align=
"center"
align=
"center"
width=
"50"
>
</el-table-column>
<el-table-column
prop=
"branchCode"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"branchName"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"branchAddress"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"branchPostcode"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"branchContact"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"tel1"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"tel2"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"fax"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"rockkey"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
prop=
"branchSimname"
header-align=
"center"
align=
"center"
label=
"$
{column.comments}">
</el-table-column>
<el-table-column
fixed=
"right"
header-align=
"center"
align=
"center"
width=
"150"
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
size=
"small"
@
click=
"addOrUpdateHandle(scope.row.branchCode)"
>
修改
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"deleteHandle(scope.row.branchCode)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<el-pagination
@
size-change=
"sizeChangeHandle"
@
current-change=
"currentChangeHandle"
:current-page=
"pageIndex"
:page-sizes=
"[10, 20, 50, 100]"
:page-size=
"pageSize"
:total=
"totalPage"
layout=
"total, sizes, prev, pager, next, jumper"
>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if=
"addOrUpdateVisible"
ref=
"addOrUpdate"
@
refreshDataList=
"getDataList"
></add-or-update>
</div>
</template>
<
script
>
import
AddOrUpdate
from
'./branch-add-or-update'
export
default
{
data
()
{
return
{
dataForm
:
{
key
:
''
},
dataList
:
[],
pageIndex
:
1
,
pageSize
:
10
,
totalPage
:
0
,
dataListLoading
:
false
,
dataListSelections
:
[],
addOrUpdateVisible
:
false
}
},
components
:
{
AddOrUpdate
},
activated
()
{
this
.
getDataList
()
},
methods
:
{
// 获取数据列表
getDataList
()
{
this
.
dataListLoading
=
true
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
'/office/branch/list'
),
method
:
'get'
,
params
:
this
.
$http
.
adornParams
({
'page'
:
this
.
pageIndex
,
'limit'
:
this
.
pageSize
,
'key'
:
this
.
dataForm
.
key
})
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
dataList
=
data
.
page
.
list
this
.
totalPage
=
data
.
page
.
totalCount
}
else
{
this
.
dataList
=
[]
this
.
totalPage
=
0
}
this
.
dataListLoading
=
false
})
},
// 每页数
sizeChangeHandle
(
val
)
{
this
.
pageSize
=
val
this
.
pageIndex
=
1
this
.
getDataList
()
},
// 当前页
currentChangeHandle
(
val
)
{
this
.
pageIndex
=
val
this
.
getDataList
()
},
// 多选
selectionChangeHandle
(
val
)
{
this
.
dataListSelections
=
val
},
// 新增 / 修改
addOrUpdateHandle
(
id
)
{
this
.
addOrUpdateVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
.
addOrUpdate
.
init
(
id
)
})
},
// 删除
deleteHandle
(
id
)
{
var
ids
=
id
?
[
id
]
:
this
.
dataListSelections
.
map
(
item
=>
{
return
item
.
branchCode
})
this
.
$confirm
(
`确定对[id=
${
ids
.
join
(
','
)}
]进行[
${
id
?
'删除'
:
'批量删除'
}
]操作?`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
'/office/branch/delete'
),
method
:
'post'
,
data
:
this
.
$http
.
adornData
(
ids
,
false
)
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
$message
({
message
:
'操作成功'
,
type
:
'success'
,
duration
:
1500
,
onClose
:
()
=>
{
this
.
getDataList
()
}
})
}
else
{
this
.
$message
.
error
(
data
.
msg
)
}
})
})
}
}
}
</
script
>
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