Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
office-web
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
office-web
Commits
79dbb354
Commit
79dbb354
authored
Mar 23, 2019
by
zhu_yu_dan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加企业公告应用
parent
7c257ecb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
919 additions
and
11 deletions
+919
-11
index.js
src/router/index.js
+39
-11
addNotice.vue
src/views/enterpriseApp/notice/addNotice.vue
+311
-0
index.vue
src/views/enterpriseApp/notice/index.vue
+235
-0
noticeList.vue
src/views/enterpriseApp/notice/noticeList.vue
+334
-0
No files found.
src/router/index.js
View file @
79dbb354
...
...
@@ -166,19 +166,23 @@ export const constantRouterMap = [
path
:
'/dailyRecord'
,
name
:
'云日报记录'
,
component
:
_import
(
'enterpriseApp/cloudDaily'
,
'dailyRecord'
)
},
{
},
{
path
:
'/dailyDetail'
,
name
:
'日报详情'
,
component
:
_import
(
'enterpriseApp/cloudDaily'
,
'dailyDetail'
)
},
{
},
{
path
:
'/taskAssign'
,
name
:
'任务下发设置'
,
component
:
_import
(
'enterpriseApp/cloudDaily'
,
'taskAssign'
)
},
{
},
{
path
:
'/systemReport'
,
name
:
'系统报表'
,
component
:
_import
(
'enterpriseApp/cloudDaily'
,
'systemReport'
)
},
{
},
{
path
:
'/customReport'
,
name
:
'自定义报表'
,
component
:
_import
(
'enterpriseApp/cloudDaily'
,
'customReport'
)
...
...
@@ -195,15 +199,35 @@ export const constantRouterMap = [
path
:
'/taskRecord'
,
name
:
'话务任务记录'
,
component
:
_import
(
'enterpriseApp/trafficTask'
,
'taskRecord'
)
},
{
},
{
path
:
'/taskDetail'
,
name
:
'话务任务详情'
,
component
:
_import
(
'enterpriseApp/trafficTask'
,
'taskDetail'
)
},
{
},
{
path
:
'/trafficTaskSet'
,
name
:
'话务任务设置'
,
component
:
_import
(
'enterpriseApp/trafficTask'
,
'trafficTaskSet'
)
}
]
},
{
path
:
'/noticeList'
,
name
:
'企业公告'
,
redirect
:
'/noticeList'
,
component
:
_import
(
'enterpriseApp/notice'
,
'index'
),
children
:
[
{
path
:
'/noticeList'
,
name
:
'企业公告列表'
,
component
:
_import
(
'enterpriseApp/notice'
,
'noticeList'
)
},
{
path
:
'/addNotice'
,
name
:
'新建公告'
,
component
:
_import
(
'enterpriseApp/notice'
,
'addNotice'
)
}
]
},
{
...
...
@@ -211,19 +235,23 @@ export const constantRouterMap = [
name
:
'不良评价'
,
redirect
:
'/badEvaluateRecord'
,
component
:
_import
(
'enterpriseApp/badEvaluate'
,
'index'
),
children
:
[{
children
:
[
{
path
:
'/badEvaluateRecord'
,
name
:
'不良评价记录'
,
component
:
_import
(
'enterpriseApp/badEvaluate'
,
'badEvaluateRecord'
)
},
{
},
{
path
:
'/badEvaluateDetail'
,
name
:
'不良评价详情'
,
component
:
_import
(
'enterpriseApp/badEvaluate'
,
'badEvaluateDetail'
)
},
{
},
{
path
:
'/badEvaluateSet'
,
name
:
'不良评价设置'
,
component
:
_import
(
'enterpriseApp/badEvaluate'
,
'badEvaluateSet'
)
},
]
}
]
}
]
},
...
...
@@ -326,7 +354,7 @@ export const constantRouterMap = [
component
:
errorPage
},
{
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
}
];
];
export
default
new
Router
({
// mode:'history',
routes
:
constantRouterMap
,
...
...
src/views/enterpriseApp/notice/addNotice.vue
0 → 100644
View file @
79dbb354
<
template
>
<div
class=
"notice-list-wrap"
>
<div
class=
"notice-list"
>
<common-detail-top
:topMenuData=
"topMenuData"
:activeId=
"activeId"
></common-detail-top>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"120px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"发送范围"
prop=
"sendArea"
class=
"input-item"
>
<!--
<el-input
v-model=
"ruleForm.sendArea"
></el-input>
-->
<div
class=
"flex-column item-cell-select inline-block"
>
<div
class=
"depart-item-wrap"
>
<div
style=
"width:560px"
class=
"el-select el-select--large depart-item-content"
@
click=
"showDialogLayer('store', defaultStoreList)"
>
<div
class=
"el-select__tags"
style=
"max-width: 181px;"
>
<span>
<template
v-for=
"(item, index) in defaultStoreList"
>
<span
class=
"el-tag el-tag--info el-tag--small"
:key=
"index"
>
<span
class=
"el-select__tags-text"
>
{{
item
.
name
||
item
.
storeName
}}
</span
><i
class=
"el-tag__close el-icon-close"
@
click
.
stop=
"delDepart(index, defaultStoreList)"
></i>
</span>
</
template
>
</span>
</div>
</div>
</div>
</div>
</el-form-item>
<el-form-item
label=
"发送对象"
prop=
"receiveType"
>
<el-radio-group
v-model=
"ruleForm.receiveType"
>
<el-radio
label=
"0"
>
仅店长
</el-radio>
<el-radio
label=
"1"
>
所有人
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"公告标题"
prop=
"title"
class=
"input-item"
>
<limitInput
:inputWidth=
"560"
:inputValue
.
sync=
"ruleForm.title"
:holder=
"'请输入公告标题'"
:maxLength=
"15"
>
</limitInput>
</el-form-item>
<el-form-item
label=
"封面图片"
prop=
"img"
>
<el-upload
class=
"upload-demo"
:action=
"uploadUrl()"
:show-file-list=
"false"
:before-upload=
"beforeAvatarUpload"
>
<el-button
size=
"mini"
type=
"primary"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
建议尺寸700*525,支持 jpg、jpeg、bmp、png 类型文件,3M以内
</div>
</el-upload>
</el-form-item>
<el-form-item
label=
"公告内容"
prop=
"content"
class=
"input-item "
>
<limitTextarea
:inputWidth=
"560"
:inputValue
.
sync=
"ruleForm.content"
:holder=
"'请输入公告内容'"
:maxLength=
"200"
>
</limitTextarea>
</el-form-item>
<el-form-item
label=
"发送方式"
prop=
"sendType"
>
<el-radio-group
v-model=
"ruleForm.sendType"
>
<el-radio
label=
"0"
>
立即发送
</el-radio>
<el-radio
label=
"1"
>
定时发送
</el-radio>
</el-radio-group>
<el-date-picker
class=
"my-date-picker"
v-model=
"dateValue"
type=
"datetime"
placeholder=
"选择日期时间"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<div
class=
"btn-wrap"
>
<el-button
@
click=
"cancelSend"
plain
>
取消
</el-button>
<el-button
@
click=
"sendData('ruleForm')"
type=
"primary"
>
发布
</el-button>
</div>
</el-form-item>
</el-form>
</div>
<!-- 发送范围的门店选择 -->
<vue-select-store
ref=
"storeSelector"
:currentBrand=
"activeGroup"
:appScene=
"appScene"
:treeSet=
"storeTreeSet"
:selectType=
"'group-store'"
:defaultList=
"defaultStoreList"
@
handleSelectedList=
"handleSelectedList"
>
</vue-select-store>
<vue-gic-footer></vue-gic-footer>
</div>
</template>
<
script
>
import
commonDetailTop
from
'@/components/app/common-detail-top.vue'
;
import
limitInput
from
'@/components/limit-input.vue'
;
import
vueSelectStore
from
'components/common/vueSelectStore'
;
import
limitTextarea
from
'@/components/limit-textarea.vue'
;
import
{
postRequest
}
from
'@/api/api'
;
export
default
{
name
:
'addNotice'
,
props
:
{
brandId
:
{
type
:
String
,
default
()
{
return
''
;
}
},
activeGroupId
:
{
type
:
String
,
default
()
{
return
''
;
}
}
},
data
()
{
return
{
projectName
:
'haoban-manage-web'
,
topMenuData
:
[
{
id
:
'1'
,
name
:
'企业公告列表'
},
{
id
:
'2'
,
name
:
'新建公告'
}
],
activeId
:
'2'
,
// 详情头部选中 id
activeBrand
:
this
.
brandId
,
// 商户(品牌) id
activeGroup
:
this
.
activeGroupId
,
// 商户(品牌) groupId
// brandId: '',
ruleForm
:
{
sendArea
:
''
,
receiveType
:
'0'
,
title
:
''
,
img
:
''
,
content
:
''
,
sendType
:
'0'
,
sendTime
:
''
},
rules
:
{
sendArea
:
[{
required
:
true
,
message
:
'请输入发送范围'
,
trigger
:
'blur'
}],
receiveType
:
[{
required
:
true
,
message
:
'请选择发送对象'
,
trigger
:
'change'
}],
title
:
[{
required
:
true
,
message
:
'请输入公告标题'
,
trigger
:
'blur'
}],
content
:
[{
required
:
true
,
message
:
'请输入公告内容'
,
trigger
:
'blur'
}],
sendType
:
[{
required
:
true
,
message
:
'请选择发送方式'
,
trigger
:
'change'
}]
},
wxFlag
:
1
,
actionUrl
:
'/haoban-manage-web/upload-img'
,
dateValue
:
''
,
// 门店选择
appScene
:
2
,
defaultStoreList
:
[],
// 默认的数据
storeTreeSet
:
{
isSelectPerson
:
true
,
// 控制只能选部门(false)
dialogVisible
:
false
,
// 控制显示/隐藏
isSingle
:
false
// 是否单选
}
};
},
methods
:
{
// 返回 的 brandId
selectBrandId
(
id
,
groupId
)
{
this
.
brandId
=
id
;
},
// 获取 action 的 url
uploadUrl
()
{
let
host
=
window
.
location
.
origin
;
let
baseUrl
;
if
(
host
.
indexOf
(
'localhost'
)
!=
'-1'
)
{
baseUrl
=
'http://www.gicdev.com'
;
}
else
{
baseUrl
=
host
;
}
let
upUrl
=
baseUrl
+
this
.
actionUrl
+
'?wxFlag='
+
this
.
wxFlag
+
'&requestProject='
+
this
.
projectName
;
return
upUrl
;
},
// 上传之前回调
beforeAvatarUpload
(
file
)
{
let
that
=
this
;
const
isJPG
=
file
.
type
===
'image/jpg'
||
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/png'
||
file
.
type
===
'image/bmp'
;
const
isLt3M
=
file
.
size
/
1024
/
1024
<
3
;
if
(
!
isJPG
)
{
that
.
$message
.
error
(
'上传图片必须是JPG/JPEG/BMP/PNG 格式!'
);
}
if
(
!
isLt3M
)
{
that
.
$message
.
error
(
'上传图片大小不能超过 3MB!'
);
}
const
isSize
=
new
Promise
(
function
(
resolve
,
reject
)
{
let
width
=
700
;
let
height
=
525
;
let
_URL
=
window
.
URL
||
window
.
webkitURL
;
let
img
=
new
Image
();
img
.
onload
=
function
()
{
let
valid
=
img
.
width
>=
width
&&
img
.
height
>=
height
;
valid
?
resolve
()
:
reject
();
};
img
.
src
=
_URL
.
createObjectURL
(
file
);
}).
then
(
()
=>
{
return
file
;
},
()
=>
{
this
.
$message
.
error
(
'上传图片的尺寸必须是700*525!'
);
return
Promise
.
reject
();
}
);
return
isJPG
&&
isLt3M
&&
isSize
;
},
// 取消
cancelSend
()
{
this
.
$confirm
(
'是否确认返回,返回后当前页面内容将丢失'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
this
.
$router
.
push
(
'/noticeList'
);
})
.
catch
(()
=>
{});
},
// 门店弹窗显示
showDialogLayer
(
type
,
selData
)
{
const
that
=
this
;
that
.
defaultStoreList
=
selData
;
that
.
storeTreeSet
=
{
dialogVisible
:
true
,
isSingle
:
false
,
isSelectPerson
:
false
};
},
/**
* 处理已选部门
*/
handleSelectedList
(
group
)
{
// type: 1:员工,2:部门,3:门店;
// that.defaultStoreList = group;
},
// 发布
sendData
(
formName
)
{
let
that
=
this
;
that
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
let
para
=
{
groupIds
:
''
,
storeIds
:
''
,
receiveType
:
that
.
ruleForm
.
receiveType
,
title
:
that
.
ruleForm
.
title
,
imgUrl
:
that
.
ruleForm
.
img
,
content
:
that
.
ruleForm
.
content
,
sendType
:
that
.
ruleForm
.
sendType
,
sendTime
:
that
.
ruleForm
.
sendTime
,
brandId
:
that
.
brandId
,
userId
:
''
,
enterpriseId
:
''
};
postRequest
(
'/haoban-app-announcement-web/announcement-add'
,
para
).
then
(
res
=>
{
let
data
=
res
.
data
;
if
(
data
.
errorCode
==
1
)
{
that
.
$message
.
success
(
'发布成功'
);
}
else
{
that
.
$message
.
error
(
data
.
message
);
}
});
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
}
},
components
:
{
commonDetailTop
,
limitInput
,
limitTextarea
,
vueSelectStore
}
};
</
script
>
<
style
type=
"text/scss"
lang=
"scss"
scoped
>
.notice-list-wrap
{
height
:
100%
;
.notice-list
{
background
:
#fff
;
margin-bottom
:
34px
;
min-height
:
100%
;
//
min-height
:
calc
(
100%
+
24px
);
}
}
.demo-ruleForm
{
padding-top
:
30px
;
}
.input-item
{
width
:
680px
;
position
:
relative
;
}
.input-item-textarea
/
deep
/
textarea
{
height
:
94px
;
font-size
:
14px
;
color
:
#606266
;
font-family
:
'Helvetica Neue'
;
}
.el-upload__tip
{
line-height
:
20px
;
}
.active-info-num
{
position
:
absolute
;
right
:
0
;
bottom
:
-31px
;
color
:
#909399
;
font-size
:
12px
;
}
.my-date-picker
{
margin-left
:
15px
;
}
.demo-ruleForm
/
deep
/
.el-form-item__label
{
color
:
#606266
;
}
.btn-wrap
{
font-size
:
0
;
}
//
发送范围
.depart-item-content
{
width
:
100%
;
height
:
32px
;
overflow
:
hidden
;
white-space
:
nowrap
;
border-radius
:
4px
;
border
:
1px
solid
#dcdfe6
;
cursor
:
pointer
;
box-sizing
:
border-box
;
}
.item-cell-select
{
/deep/
.el-select__tags
{
white-space
:
nowrap
;
overflow
:
hidden
;
}
}
</
style
>
src/views/enterpriseApp/notice/index.vue
0 → 100644
View file @
79dbb354
<
template
>
<div
class=
"my-customer-wrap common-set-wrap"
>
<div
class=
"right-content"
>
<common-app-top
:appName=
"appName"
:appIcon=
"appIcon"
@
selectBrandId=
"selectBrandId"
>
</common-app-top>
<div
class=
"right-box"
:style=
"
{ 'min-height': bgHeight }">
<div
class=
"apps-content flex"
:style=
"
{ height: bgHeight }">
<div
class=
"apps-content-right"
>
<transition
name=
"fade"
mode=
"out-in"
>
<router-view
:brandId=
"activeBrand"
:activeGroupId=
"activeGroup"
></router-view>
</transition>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
appDetail
from
'@/components/app/app-detail.vue'
;
import
commonAppTop
from
'@/components/app/common-app-top.vue'
;
import
commonDetailLeft
from
'@/components/app/app-detail-left.vue'
;
export
default
{
name
:
'reviewed'
,
data
()
{
return
{
bgHeight
:
window
.
screen
.
availHeight
-
380
+
'px'
,
appName
:
'企业公告'
,
appIcon
:
'icon-gonggao'
,
activeSelTab
:
'1'
,
activeTab
:
'1'
,
tabListData
:
[
{
id
:
'1'
,
name
:
'企业公告列表'
},
{
id
:
'2'
,
name
:
'新建公告'
}
],
activeBrand
:
''
,
// 商户(品牌) id
activeGroup
:
''
// 商户(品牌) groupId
};
},
computed
:
{},
methods
:
{
/**
* 路由跳转
*/
changeRoute
(
path
)
{
this
.
$router
.
push
(
path
);
},
/**
* 返回 的 brandId
*/
selectBrandId
(
id
,
groupId
)
{
let
that
=
this
;
that
.
activeBrand
=
id
;
that
.
activeGroup
=
groupId
;
}
},
watch
:
{
activeBrand
:
function
(
newData
,
oldData
)
{
const
that
=
this
;
that
.
activeBrand
=
newData
;
},
activeGroup
:
function
(
newData
,
oldData
)
{
const
that
=
this
;
that
.
activeGroup
=
newData
;
}
},
mounted
()
{
document
.
documentElement
.
style
.
backgroundColor
=
'#f0f2f5'
;
},
destroyed
()
{
document
.
documentElement
.
style
.
backgroundColor
=
'#fff'
;
},
components
:
{
appDetail
,
commonAppTop
,
commonDetailLeft
}
};
</
script
>
<
style
type=
"text/scss"
lang=
"scss"
scoped
>
.my-customer-wrap
{
height
:
100%
;
}
.right-content
{
/*width: 100%;*/
padding
:
24px
;
min-height
:
calc
(
100%
-
160px
);
.my-customer-top
{
position
:
relative
;
height
:
43px
;
line-height
:
43px
;
.my-customer-return
{
position
:
absolute
;
left
:
0px
;
bottom
:
10px
;
width
:
78px
;
height
:
32px
;
border-radius
:
18px
;
}
.my-customer-brand
{
position
:
absolute
;
right
:
0
;
bottom
:
18px
;
width
:
93px
;
height
:
32px
;
}
.my-customer-name
{
width
:
200px
;
margin
:
0
auto
;
i
{
font-size
:
14px
;
color
:
#fff
;
}
span
{
font-size
:
16px
;
color
:
#000
;
}
.app-icon
{
display
:
inline-block
;
width
:
22px
;
height
:
22px
;
line-height
:
22px
;
text-align
:
center
;
border-radius
:
4px
;
background
:
-webkit-linear-gradient
(
left
,
#7ab6fb
,
#508bfe
);
background
:
-moz-linear-gradient
(
left
,
#7ab6fb
,
#508bfe
);
background
:
linear-gradient
(
left
,
#7ab6fb
,
#508bfe
);
}
}
}
.right-box
{
//
background
:
#fff
;
min-height
:
500px
;
padding
:
0px
;
.apps-content
{
.apps-content-left
{
height
:
100%
;
background
:
#fff
;
overflow-x
:
hidden
;
overflow-y
:
auto
;
.apps-content-left__title
{
height
:
55px
;
line-height
:
55px
;
padding
:
0
0
0
18px
;
}
.tab-left-list-cell
{
position
:
relative
;
text-align
:
left
;
margin-top
:
15px
;
height
:
30px
;
line-height
:
30px
;
white-space
:
nowrap
;
overflow
:
hidden
;
cursor
:
pointer
;
&:hover
{
background
:
rgba
(
24
,
144
,
255
,
0.06
);
i
{
color
:
#1890ff
;
}
}
&
.active-tab
{
background
:
rgba
(
24
,
144
,
255
,
0.06
);
&::before
{
content
:
' '
;
position
:
absolute
;
left
:
0
;
top
:
0
;
bottom
:
0
;
width
:
2px
;
background
:
#1890ff
;
z-index
:
1
;
}
i
{
color
:
#1890ff
;
}
}
.child-tab-left-list
{
li
{
position
:
relative
;
text-align
:
left
;
height
:
30px
;
line-height
:
30px
;
white-space
:
nowrap
;
overflow
:
hidden
;
cursor
:
pointer
;
&:hover
{
background
:
rgba
(
24
,
144
,
255
,
0.06
);
i
{
color
:
#1890ff
;
}
}
&
.active-tab
{
background
:
rgba
(
24
,
144
,
255
,
0.06
);
&::before
{
content
:
' '
;
position
:
absolute
;
left
:
0
;
top
:
0
;
bottom
:
0
;
width
:
2px
;
background
:
#1890ff
;
z-index
:
1
;
}
i
{
color
:
#1890ff
;
}
}
}
}
}
}
.apps-content-right
{
width
:
100%
;
background
:
#fff
;
}
}
}
}
</
style
>
src/views/enterpriseApp/notice/noticeList.vue
0 → 100644
View file @
79dbb354
<
template
>
<div
class=
"notice-list-wrap"
>
<div
class=
"notice-list"
>
<common-detail-top
:topMenuData=
"topMenuData"
:activeId=
"activeId"
></common-detail-top>
<div
class=
"notice-list-table"
>
<div
class=
"search-wrap"
>
<el-input
@
keyup
.
enter
.
native=
"searchNotice"
class=
"search-input"
placeholder=
"请输入公告标题"
prefix-icon=
"el-icon-search"
v-model=
"searchTitle"
>
</el-input>
<el-date-picker
@
change=
"changeDate"
class=
"search-date"
format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
v-model=
"dateValue"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
</el-date-picker>
<el-button
@
click=
"addNotice"
class=
"fr"
type=
"primary"
>
新建公告
</el-button>
</div>
<el-table
:data=
"tableData"
style=
"width: 100%"
v-loading=
"loading"
>
<el-table-column
prop=
"title"
label=
"公告标题"
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"公告封面"
width=
"120"
>
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.imgUrl"
alt=
""
width=
"46"
height=
"40"
/>
</
template
>
</el-table-column>
<el-table-column
prop=
"content"
label=
"公告内容"
>
<
template
slot-scope=
"scope"
>
<p
class=
"notice-content-wrap"
:title=
"scope.row.content"
>
{{
scope
.
row
.
content
}}
</p>
</
template
>
</el-table-column>
<el-table-column
prop=
"address"
label=
"读取情况"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click=
"readDetail(scope.row.announcementId)"
type=
"text"
>
{{
scope
.
row
.
readCount
}}
/
{{
scope
.
row
.
sendCount
}}
</el-button>
</
template
>
</el-table-column>
<el-table-column
prop=
"address"
label=
"发布时间"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.sendTime"
class=
"time-wrap"
>
<p>
{{
scope
.
row
.
sendTime
|
formatTimeYMD
}}
</p>
<p>
{{
scope
.
row
.
sendTime
|
formatTimeHMS
}}
</p>
</div>
<div
v-else
>
--
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"opr"
label=
"操作"
width=
"100"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click=
"handlePreview(scope.row.announcementId)"
type=
"text"
>
预览
</el-button>
<el-button
@
click=
"delNotice(scope.row.announcementId, scope.$index)"
type=
"text"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination"
v-if=
"totalCount > 0"
>
<el-pagination
background
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"pageSize"
:current-page=
"currentPage"
layout=
"total, sizes, prev, pager, next"
:total=
"totalCount"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
>
</el-pagination>
</div>
</div>
</div>
<!-- 企业公告读取情况 -->
<el-dialog
title=
"读取情况"
:visible
.
sync=
"dialogNoticeVisible"
width=
"618px"
>
<div
class=
"read-list-wrap"
>
<div
class=
"read-list-lt"
>
<div
class=
"read-list-title"
>
已读(30)
</div>
<ul
class=
"read-list"
>
<li
v-for=
"(item, index) in readList"
:key=
"index"
>
{{ item }}
</li>
</ul>
</div>
<div
class=
"read-list-rt"
>
<div
class=
"read-list-title"
>
未读(30)
</div>
<ul
class=
"read-list"
>
<li
v-for=
"(item, index) in noReadList"
:key=
"index"
>
{{ item }}
</li>
</ul>
</div>
</div>
</el-dialog>
<!-- 预览 -->
<qrcode-dialog
ref=
"qrcodePreview"
v-model=
"dialogVisible"
></qrcode-dialog>
<vue-gic-footer></vue-gic-footer>
</div>
</template>
<
script
>
import
commonAppTop
from
'@/components/app/common-app-top.vue'
;
import
commonDetailTop
from
'@/components/app/common-detail-top.vue'
;
import
qrcodeDialog
from
'@/components/app/qrcode-dialog.vue'
;
import
{
getRequest
}
from
'@/api/api'
;
export
default
{
name
:
'noticeList'
,
props
:
{
brandId
:
{
type
:
String
,
default
()
{
return
''
;
}
},
activeGroupId
:
{
type
:
String
,
default
()
{
return
''
;
}
}
},
data
()
{
return
{
topMenuData
:
[
{
id
:
'1'
,
name
:
'企业公告列表'
}
],
activeId
:
'1'
,
activeBrand
:
this
.
brandId
,
// 商户(品牌) id
activeGroup
:
this
.
activeGroupId
,
// 商户(品牌) groupId
searchTitle
:
''
,
dateValue
:
''
,
startTime
:
''
,
endTime
:
''
,
tableData
:
[],
pageSize
:
20
,
currentPage
:
1
,
totalCount
:
0
,
readList
:
[],
noReadList
:
[],
loading
:
false
,
dialogNoticeVisible
:
false
,
dialogVisible
:
false
};
},
filters
:
{
formatTimeYMD
(
data
)
{
let
date
=
new
Date
(
data
);
let
month
=
date
.
getMonth
()
+
1
;
let
day
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
();
let
newMonth
=
month
<
10
?
'0'
+
month
:
month
;
return
date
.
getFullYear
()
+
'-'
+
newMonth
+
'-'
+
day
;
},
formatTimeHMS
(
data
)
{
let
date
=
new
Date
(
data
);
let
hours
=
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
();
let
minutes
=
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
();
return
hours
+
':'
+
minutes
;
}
},
watch
:
{
brandId
:
function
(
newData
,
oldData
)
{
let
that
=
this
;
if
(
!!
newData
)
{
that
.
activeBrand
=
newData
;
that
.
getNoticeList
();
}
},
activeGroupId
:
function
(
newData
,
oldData
)
{
let
that
=
this
;
if
(
!!
newData
)
{
that
.
activeGroup
=
newData
;
}
}
},
methods
:
{
// 获取公告列表
getNoticeList
()
{
this
.
loading
=
true
;
let
para
=
{
startTime
:
this
.
startTime
,
brandId
:
this
.
activeBrand
,
title
:
this
.
searchTitle
,
endTime
:
this
.
endTime
,
currentPage
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
};
getRequest
(
'/haoban-app-announcement-web/announcement-list'
,
para
).
then
(
res
=>
{
let
data
=
res
.
data
;
this
.
loading
=
false
;
if
(
data
.
errorCode
==
1
)
{
this
.
tableData
=
data
.
result
.
result
;
this
.
totalCount
=
data
.
result
.
totalCount
;
}
});
},
// 选择日期
changeDate
(
val
)
{
this
.
startTime
=
val
[
0
];
this
.
endTime
=
val
[
1
];
this
.
currentPage
=
1
;
this
.
getNoticeList
();
},
// 搜索
searchNotice
()
{
this
.
currentPage
=
1
;
this
.
getNoticeList
();
},
// 删除公告
delNotice
(
id
,
index
)
{
this
.
$confirm
(
'是否要删除选中的公告?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
let
para
=
{
announcementId
:
id
};
getRequest
(
'/haoban-app-announcement-web/announcement-delete'
,
para
).
then
(
res
=>
{
let
data
=
res
.
data
;
if
(
data
.
errorCode
==
1
)
{
this
.
totalCount
--
;
this
.
tableData
.
splice
(
index
,
1
);
if
(
this
.
tableData
.
length
==
0
)
{
if
(
this
.
currentPage
>
1
)
{
this
.
getNoticeList
();
}
}
this
.
$message
.
success
(
'删除成功'
);
}
else
{
this
.
$message
.
error
(
data
.
message
);
}
});
})
.
catch
(()
=>
{});
},
// 读取详情
readDetail
(
id
)
{
this
.
dialogNoticeVisible
=
true
;
let
para
=
{
announcementId
:
id
};
getRequest
(
'/haoban-app-announcement-web/announcement-detail'
,
para
).
then
(
res
=>
{
let
data
=
res
.
data
;
if
(
data
.
errorCode
==
1
)
{
this
.
noReadList
=
data
.
result
.
noReadEmployeeList
;
this
.
readList
=
data
.
result
.
employeeList
;
}
else
{
this
.
$message
.
error
(
data
.
message
);
}
});
},
// 分页
handleSizeChange
(
val
)
{
this
.
pageSize
=
val
;
this
.
getNoticeList
();
},
handleCurrentChange
(
val
)
{
this
.
currentPage
=
val
;
this
.
getNoticeList
();
},
// 预览
handlePreview
(
id
)
{
this
.
$refs
.
qrcodePreview
.
qrcode
(
id
);
this
.
dialogVisible
=
true
;
},
// 新建公告
addNotice
()
{
this
.
$router
.
push
(
'/addNotice'
);
}
},
components
:
{
commonDetailTop
,
qrcodeDialog
}
};
</
script
>
<
style
type=
"text/scss"
lang=
"scss"
scoped
>
.notice-list-wrap
{
height
:
100%
;
.notice-list
{
background
:
#fff
;
margin-bottom
:
34px
;
min-height
:
100%
;
//
min-height
:
calc
(
100%
+
24px
);
}
}
.notice-list-table
{
padding
:
9px
24px
24px
;
background-color
:
#fff
;
}
.search-wrap
{
font-size
:
0
;
margin-bottom
:
22px
;
.search-input
{
width
:
264px
;
}
.search-date
{
width
:
300px
;
margin-left
:
10px
;
}
}
.pagination
{
margin-top
:
24px
;
text-align
:
right
;
}
.read-list-wrap
{
display
:
flex
;
width
:
100%
;
margin-bottom
:
20px
;
.read-list
{
padding
:
15px
0
15px
10px
;
height
:
346px
;
overflow
:
auto
;
li
{
height
:
32px
;
line-height
:
32px
;
color
:
#909399
;
padding
:
0
15px
;
border-radius
:
4px
;
margin-right
:
10px
;
margin-bottom
:
10px
;
box-sizing
:
border-box
;
float
:
left
;
}
}
.read-list-title
{
height
:
32px
;
line-height
:
32px
;
background
:
#ebeef5
;
text-align
:
center
;
color
:
#303133
;
}
.read-list-lt
{
flex
:
0
0
283px
;
width
:
283px
;
border
:
1px
solid
#e4e7ed
;
border-top
:
none
;
li
{
background
:
#f3f6f9
;
}
}
.read-list-rt
{
flex
:
1
;
border-bottom
:
1px
solid
#e4e7ed
;
border-right
:
1px
solid
#e4e7ed
;
li
{
border
:
1px
solid
#e4e7ed
;
color
:
#303133
;
}
}
}
.time-wrap
p
{
line-height
:
14px
;
}
.notice-content-wrap
{
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
}
</
style
>
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