Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-operator-master
Commits
0948b630
Commit
0948b630
authored
Jun 20, 2022
by
黄卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选择产品类型和产品
parent
cdeb8f0a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
product.js
src/api/ecw/product.js
+8
-0
edit.vue
src/views/ecw/customer/edit.vue
+22
-11
No files found.
src/api/ecw/product.js
View file @
0948b630
...
...
@@ -34,6 +34,14 @@ export function getProduct(id) {
})
}
// 获得产品列表
export
function
getProductList
()
{
return
request
({
url
:
'
/ecw/product/list
'
,
method
:
'
get
'
})
}
// 获得产品分页
export
function
getProductPage
(
query
)
{
return
request
({
...
...
src/views/ecw/customer/edit.vue
View file @
0948b630
...
...
@@ -74,16 +74,16 @@
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"主营类别"
prop=
"productType"
>
<el-cascader
:options=
"productTypeList"
:props=
"
{label: 'titleZh', value: 'id', lazy: true, lazyLoad}">
</el-cascader
>
<!--
<el-cascader
:options=
"productTypeList"
:props=
"
{label: 'titleZh', value: 'id', lazy: true, lazyLoad}">
</el-cascader>
--
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"11"
>
<el-select
v-model=
"form.productType"
placeholder=
"请选择产品类别"
>
<
!--
<el-option
label=
"请选择字典生成"
value=
""
/>
--
>
<el-select
v-model=
"form.productType"
placeholder=
"请选择产品类别"
@
change=
"form.productId = ''"
>
<
el-option
:label=
"item.titleZh"
:value=
"item.id"
v-for=
"(item) in productTypeList"
:key=
"item.id"
/
>
</el-select>
</el-col>
<el-col
:span=
"11"
>
<el-select
v-model=
"form.product
Type"
placeholder=
"请选择主营类别
"
>
<
!--
<el-option
label=
"请选择字典生成"
value=
""
/>
--
>
<el-select
v-model=
"form.product
Id"
placeholder=
"请选择
"
>
<
el-option
:label=
"item.titleZh"
:value=
"parseInt(item.id)"
v-for=
"(item) in productListFilter"
:key=
"item.id"
/
>
</el-select>
</el-col>
</el-row>
...
...
@@ -359,6 +359,7 @@ import upload from '@/components/ImageUpload'
import
{
createCustomer
,
getCustomer
,
updateCustomer
}
from
'
@/api/ecw/customer
'
import
{
getNodeList
}
from
"
@/api/ecw/node
"
import
{
getProductTypeList
}
from
'
@/api/ecw/productType
'
import
{
getProductList
}
from
'
@/api/ecw/product
'
export
default
{
name
:
"
edit
"
,
...
...
@@ -368,16 +369,20 @@ export default {
created
()
{
this
.
customerId
=
this
.
$route
.
params
&&
this
.
$route
.
params
.
customerId
;
console
.
log
(
this
.
customerId
)
if
(
!!
this
.
customerId
)
this
.
reset
()
if
(
this
.
customerId
!==
'
0
'
)
this
.
getCustomer
(
this
.
customerId
)
getNodeList
().
then
(
r
=>
{
this
.
nodeList
=
r
.
data
})
getProductTypeList
().
then
(
r
=>
{
this
.
productTypeList
=
r
.
data
})
getProductList
().
then
(
r
=>
{
this
.
productList
=
r
.
data
})
},
data
(){
return
{
...
...
@@ -402,12 +407,15 @@ export default {
// 网点
nodeList
:
[],
productTypeList
:
[],
productList
:
[],
showLine
:
false
}
},
methods
:
{
lazyLoad
(
node
,
resolve
)
{
const
r
=
this
.
productList
.
filter
((
p
)
=>
p
.
typeId
===
node
.
value
)
console
.
log
(
r
)
resolve
(
r
)
},
/** 取消按钮 */
cancel
()
{
...
...
@@ -479,14 +487,17 @@ export default {
this
.
resetForm
(
"
form
"
);
},
getCustomer
(
id
)
{
this
.
reset
();
getCustomer
(
id
).
then
(
response
=>
{
this
.
form
=
{
...
this
.
form
,
...
response
.
data
};
this
.
open
=
true
;
this
.
title
=
"
修改客户
"
;
});
}
},
computed
:
{
productListFilter
(){
return
this
.
productList
.
filter
((
p
)
=>
p
.
typeId
===
this
.
form
.
productType
)
}
}
}
</
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