Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
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
office
haoban-3
Commits
3169b6ce
Commit
3169b6ce
authored
Feb 21, 2020
by
fairyly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改门店接口
parent
8cfa80ce
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
189 additions
and
19 deletions
+189
-19
contact-tree-search.vue
src/components/company/contact-tree-search.vue
+164
-0
contact-tree.vue
src/components/company/contact-tree.vue
+12
-12
store-member.vue
src/components/company/store-member.vue
+1
-1
contacts.vue
src/views/business/contacts.vue
+12
-6
No files found.
src/components/company/contact-tree-search.vue
0 → 100644
View file @
3169b6ce
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-08-14 16:51:07
* @LastEditors : 无尘
* @LastEditTime : 2020-02-21 17:18:42
-->
<!--
<contact-tree-search :itemData="itemData" v-model="itemData" @getSearchSelectData="getSearchSelectData"></contact-tree-search>
import contactTreeSearch from '@/components/company/contact-tree-search.vue';
-->
<
template
>
<ul
class=
"m-l-10"
>
<li
v-for=
"(item, index) in itemData"
:key=
"index + 'gic'"
>
<div
class=
"li-cell cursor-pointer"
@
click=
"toggleExpand(item)"
>
<span
:class=
"['font-12 color-606266', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"
></span><span
:class=
"['font-14 p-l-10 p-r-10 iconfont', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"
></span><span
class=
"font-14 color-606266"
>
{{
item
.
departmentName
}}
</span>
</div>
<li-row
v-if=
"item.expand"
:itemData=
"item.children"
@
getSelectData=
"getSelectData"
></li-row
>
<!-- v-show="!!item.children.length && item.expand" -->
</li>
</ul>
</
template
>
<
script
>
// import showMsg from '@/common/js/showmsg';
import
{
getRequest
}
from
'@/api/api'
;
import
errMsg
from
'@/common/js/error'
;
export
default
{
name
:
'li-row'
,
components
:
{},
props
:
{
value
:
{
type
:
[
Object
,
Array
],
default
()
{
return
[];
}
},
itemData
:
{
type
:
[
Object
,
Array
],
default
()
{
return
[];
}
}
},
data
()
{
return
{
rightOption
:
{
group
:
{
name
:
'people'
,
pull
:
true
,
put
:
true
},
sort
:
true
}
};
},
computed
:
{},
methods
:
{
/**
* 改变数组数据
*/
emitter
(
value
)
{
// console.log(value);
this
.
$emit
(
'input'
,
value
);
},
changeData
(
value
)
{
// console.log(value);
},
/**
* 展开或者关闭下级
*/
async
toggleExpand
(
item
)
{
const
that
=
this
;
// console.log(item);
item
.
expand
=
item
.
expand
?
false
:
true
;
if
(
item
.
isStore
==
0
&&
!
item
.
children
.
length
)
{
item
.
children
=
await
that
.
getChildData
(
item
);
}
that
.
$emit
(
'getSelectData'
,
item
);
that
.
$forceUpdate
();
},
/**
* 获取选中部门/门店数据
*/
getSelectData
(
obj
)
{
const
that
=
this
;
that
.
selectData
=
obj
;
that
.
$emit
(
'getSelectData'
,
obj
);
},
/**
* 获取下级数据
*/
getChildData
(
item
)
{
const
that
=
this
;
let
para
=
{
parentId
:
item
.
departmentId
,
//
isStore
:
item
.
isStore
,
//
keyword
:
''
//
};
return
new
Promise
((
resolve
,
reject
)
=>
{
getRequest
(
'/haoban-manage3-web/department-list-level'
,
para
)
.
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
errorCode
==
1
)
{
if
(
resData
.
result
.
length
)
{
resData
.
result
.
forEach
(
ele
=>
{
ele
.
expand
=
false
;
ele
.
children
=
[];
ele
.
label
=
ele
.
departmentName
;
});
}
resolve
(
resData
.
result
||
[]);
return
false
;
}
resolve
([]);
errMsg
.
errorMsg
(
resData
);
})
.
catch
(
function
(
error
)
{
resolve
([]);
that
.
$message
.
error
({
duration
:
1000
,
message
:
error
.
message
});
});
});
}
},
watch
:
{
value
:
function
(
newData
,
oldData
)
{
const
that
=
this
;
that
.
trData
=
JSON
.
parse
(
JSON
.
stringify
(
newData
));
}
},
mounted
()
{
const
that
=
this
;
that
.
trData
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
value
));
}
/* beforeDestroy() {} */
};
</
script
>
<
style
lang=
"less"
scoped
>
.li-cell
{
min-height
:
26px
;
line-height
:
26px
;
}
.w-110
{
width
:
110px
;
}
.w-320
{
width
:
320px
;
}
.m-t-14
{
margin-top
:
14px
;
}
.child-row
{
padding-left
:
10px
;
}
</
style
>
src/components/company/contact-tree.vue
View file @
3169b6ce
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-08-14 16:51:07
* @LastEditors : 无尘
* @LastEditTime : 2020-02-2
0 19:37:19
* @LastEditTime : 2020-02-2
1 17:11:20
-->
<!--
<contact-tree :itemData="itemData" v-model="itemData" ></contact-tree>
...
...
@@ -13,27 +13,27 @@ import contactTree from '/components/company/contact-tree.vue';
-->
<
template
>
<ul
class=
"m-l-10"
>
<
draggable
:list=
"itemData"
class=
"wx-component"
:options=
"rightOption"
@
input=
"emitter"
@
change=
"changeData"
>
<li
v-for=
"(item, index) in itemData"
:key=
"index + 'gic'"
>
<div
class=
"li-cell cursor-pointer"
@
click=
"toggleExpand(item)"
>
<span
:class=
"['font-12 color-606266', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"
></span><span
:class=
"['font-14 p-l-10 p-r-10 iconfont', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"
></span><span
class=
"font-14 color-606266"
>
{{
item
.
departmentName
}}
</span>
</div>
<li-row
v-if=
"item.expand"
:itemData=
"item.children"
@
getSelectData=
"getSelectData"
></li-row
>
<!-- v-show="!!item.children.length && item.expand" -->
</li>
<
/draggable
>
<
!--
<draggable
:list=
"itemData"
class=
"wx-component"
:options=
"rightOption"
@
input=
"emitter"
@
change=
"changeData"
>
--
>
<li
v-for=
"(item, index) in itemData"
:key=
"index + 'gic'"
>
<div
class=
"li-cell cursor-pointer"
@
click=
"toggleExpand(item)"
>
<span
:class=
"['font-12 color-606266', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"
></span><span
:class=
"['font-14 p-l-10 p-r-10 iconfont', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"
></span><span
class=
"font-14 color-606266"
>
{{
item
.
departmentName
}}
</span>
</div>
<li-row
v-if=
"item.expand"
:itemData=
"item.children"
@
getSelectData=
"getSelectData"
></li-row
>
<!-- v-show="!!item.children.length && item.expand" -->
</li>
<
!--
</draggable>
--
>
</ul>
</
template
>
<
script
>
import
localforage
from
'localforage'
;
import
draggable
from
'vuedraggable'
;
//
import draggable from 'vuedraggable';
// import showMsg from '@/common/js/showmsg';
import
{
getRequest
}
from
'@/api/api'
;
import
errMsg
from
'@/common/js/error'
;
export
default
{
name
:
'li-row'
,
components
:
{
draggable
//
draggable
},
props
:
{
value
:
{
...
...
src/components/company/store-member.vue
View file @
3169b6ce
...
...
@@ -385,7 +385,7 @@ export default {
let
resData
=
res
.
data
;
if
(
resData
.
errorCode
==
1
)
{
that
.
tableData
=
resData
.
result
.
result
||
resData
.
result
.
list
||
[];
that
.
total
=
resData
.
result
.
totalCount
||
resData
.
result
.
total
;
that
.
total
=
resData
.
result
.
result
.
totalCount
||
resData
.
result
.
total
;
return
false
;
}
errMsg
.
errorMsg
(
resData
);
...
...
src/views/business/contacts.vue
View file @
3169b6ce
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors : 无尘
* @LastEditTime : 2020-02-2
0 20:47:46
* @LastEditTime : 2020-02-2
1 18:49:08
-->
<
template
>
<div
class=
"contacts-wrap common-set-wrap"
>
...
...
@@ -19,7 +19,8 @@
<span
class=
"iconfont iconzuzhijiagouguanli p-l-10 cursor-pointer"
@
click=
"toManage"
></span>
</div>
<div
class=
"left-tree p-t-14"
>
<contact-tree
:itemData=
"wxData"
v-model=
"wxData"
@
getSelectData=
"getSelectData"
></contact-tree>
<contact-tree
v-if=
"!searchInput"
:itemData=
"wxData"
v-model=
"wxData"
@
getSelectData=
"getSelectData"
></contact-tree>
<contact-tree-search
v-if=
"searchInput"
:itemData=
"wxData"
v-model=
"wxData"
@
getSearchSelectData=
"getSearchSelectData"
></contact-tree-search>
</div>
</div>
</div>
...
...
@@ -44,6 +45,7 @@ import contactTree from '@/components/company/contact-tree.vue';
import
departList
from
'@/components/company/depart-list.vue'
;
import
departMember
from
'@/components/company/depart-member.vue'
;
import
storeMember
from
'@/components/company/store-member.vue'
;
import
contactTreeSearch
from
'@/components/company/contact-tree-search.vue'
;
import
{
getRequest
}
from
'@/api/api'
;
import
errMsg
from
'@/common/js/error'
;
import
{
_debounce
}
from
'@/common/js/public'
;
...
...
@@ -54,7 +56,8 @@ export default {
contactTree
,
departList
,
departMember
,
storeMember
storeMember
,
contactTreeSearch
},
data
()
{
return
{
...
...
@@ -91,9 +94,7 @@ export default {
// }
],
selectData
:
{},
departObj
:
{
isStore
:
0
}
departObj
:
{}
};
},
computed
:
{},
...
...
@@ -139,6 +140,10 @@ export default {
that
.
selectData
=
obj
;
that
.
departObj
=
obj
;
},
getSearchSelectData
(
obj
)
{
const
that
=
this
;
that
.
departObj
=
obj
;
},
/**
* 路由跳转
*/
...
...
@@ -181,6 +186,7 @@ export default {
ele
.
label
=
ele
.
departmentName
;
});
}
that
.
departObj
=
resData
.
result
[
0
];
that
.
wxData
=
resData
.
result
||
[];
// console.log(that.wxData);
return
false
;
...
...
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