Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElectricitySheep
Project
Project
Details
Activity
Releases
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
黄媛媛
ElectricitySheep
Commits
29f23935
Commit
29f23935
authored
Oct 30, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
282cce2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
46 deletions
+33
-46
ServiceManageEdit.vue
src/components/offlineService/ServiceManageEdit.vue
+33
-46
No files found.
src/components/offlineService/ServiceManageEdit.vue
View file @
29f23935
...
...
@@ -96,8 +96,9 @@
<!--已指定商品类别选择-->
<el-dialog
title=
"已指定商品类别"
:visible
.
sync=
"category"
width=
"714px"
>
<div
style=
"height:400px;overflow:auto;"
>
<el-tree
:data=
"ProductCategoryTreeList"
show-checkbox
:check-strictly=
"true"
:check-on-click-node=
"true"
default-expand-all
node-key=
"Id"
ref=
"tree"
:default-checked-keys=
"checkedkeys"
@
check=
"TreeList"
:props=
"defaultProps"
>
<el-tree
:data=
"ProductCategoryTreeList"
show-checkbox
:check-strictly=
"true"
:check-on-click-node=
"true"
default-expand-all
node-key=
"Id"
ref=
"tree"
:default-checked-keys=
"checkedkeys"
@
check=
"TreeList"
:props=
"defaultProps"
>
</el-tree>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -301,11 +302,11 @@
let
ProductList
=
[]
this
.
checkedkeys
=
e
.
checkedKeys
;
if
(
e
.
checkedNodes
.
length
>
0
)
{
this
.
checkedkeys
.
forEach
(
x
=>
{
var
objList
=
this
.
getObjById
(
this
.
ProductCategoryTreeList
,
x
);
if
(
objList
)
{
for
(
var
i
=
0
;
i
<
this
.
AppointList
.
length
;
i
++
)
{
if
(
this
.
AppointList
[
i
].
ProductId
==
objList
.
Id
)
{
this
.
checkedkeys
.
forEach
(
x
=>
{
var
objList
=
this
.
getObjById
(
this
.
ProductCategoryTreeList
,
x
);
if
(
objList
)
{
for
(
var
i
=
0
;
i
<
this
.
AppointList
.
length
;
i
++
)
{
if
(
this
.
AppointList
[
i
].
ProductId
==
objList
.
Id
)
{
return
;
}
}
...
...
@@ -327,9 +328,9 @@
}
},
deletecommod
(
data
,
index
)
{
this
.
tableData
.
forEach
(
x
=>
{
if
(
data
.
Id
==
x
.
Id
)
{
x
.
disabled
=
false
this
.
tableData
.
forEach
(
x
=>
{
if
(
data
.
Id
==
x
.
Id
)
{
x
.
disabled
=
false
this
.
commoditylist
.
splice
(
index
,
1
)
}
})
...
...
@@ -339,16 +340,7 @@
this
.
apipost
(
"/api/OSGoods/GetOfflineGoodsPageList"
,
this
.
msg2
,
res
=>
{
this
.
loading_t
=
false
;
if
(
res
.
data
.
resultCode
==
1
)
{
let
pageData
=
res
.
data
.
data
.
pageData
;
for
(
let
i
=
0
;
i
<
pageData
.
length
;
i
++
)
{
pageData
[
i
].
disabled
=
false
;
this
.
commoditylist
.
forEach
(
x
=>
{
if
(
pageData
[
i
].
Id
==
x
.
Id
)
{
pageData
[
i
].
disabled
=
true
;
}
})
}
this
.
tableData
=
pageData
this
.
tableData
=
res
.
data
.
data
.
pageData
this
.
count
=
res
.
data
.
data
.
count
}
})
...
...
@@ -505,44 +497,39 @@
this
.
getProductCategoryTreeList
();
for
(
let
i
=
0
;
i
<
ProductList
.
length
;
i
++
)
{
this
.
checkedkeys
.
push
(
ProductList
[
i
].
ProductId
)
var
objList
=
this
.
getObjById
(
this
.
ProductCategoryTreeList
,
ProductList
[
i
].
ProductId
);
if
(
objList
)
{
var
objList
=
this
.
getObjById
(
this
.
ProductCategoryTreeList
,
ProductList
[
i
].
ProductId
);
if
(
objList
)
{
this
.
AppointList
.
push
({
ProductId
:
objList
.
Id
,
Name
:
objList
.
Name
ProductId
:
objList
.
Id
,
Name
:
objList
.
Name
})
}
}
}
if
(
res
.
data
.
data
.
ServiceType
==
2
)
{
let
ProductList
=
res
.
data
.
data
.
ProductList
;
let
newData
=
[]
for
(
let
i
=
0
;
i
<
ProductList
.
length
;
i
++
)
{
this
.
apipost
(
"/api/product/GetProductGoodsPageList"
,
{
pageIndex
:
1
,
pageSize
:
15
,
Name
:
''
,
GoodsStatus
:
0
,
IsSelectSellOut
:
0
,
CategoryIds
:
''
,
Id
:
ProductList
[
i
].
ProductId
,
StartTime
:
''
,
EndTime
:
''
,
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
let
pageData
=
res
.
data
.
data
.
pageData
;
newData
.
push
(
pageData
[
0
])
}
this
.
commoditylist
=
[];
var
myTable
=
[];
this
.
apipost
(
"/api/OSGoods/GetOfflineGoodsPageList"
,
this
.
msg2
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
myTable
=
res
.
data
.
data
.
pageData
;
}
myTable
.
forEach
(
x
=>
{
this
.
addMsg
.
ProductList
.
forEach
(
y
=>
{
if
(
y
.
ProductId
==
x
.
Id
)
{
this
.
commoditylist
.
push
(
x
);
x
.
disabled
=
true
;
}
})
})
}
this
.
commoditylist
=
newData
this
.
tableData
=
myTable
;
})
}
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
})
},
getObjById
(
list
,
id
)
{
getObjById
(
list
,
id
)
{
if
(
!
list
instanceof
Array
)
{
return
null
}
...
...
@@ -554,7 +541,7 @@
}
else
{
//查不到继续遍历
if
(
item
.
ChildList
)
{
let
value
=
this
.
getObjById
(
item
.
ChildList
,
id
)
let
value
=
this
.
getObjById
(
item
.
ChildList
,
id
)
//查询到直接返回
if
(
value
)
{
return
value
...
...
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