Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-admin-protocol-center
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-admin-protocol-center
提交
79492c8b
提交
79492c8b
编写于
10月 08, 2019
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整理等
上级
f373e86b
变更
13
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
39 行增加
和
4627 行删除
+39
-4627
blacklist.vue
src/views/message/blacklist.vue
+0
-373
create-push.vue
src/views/message/create-push.vue
+0
-702
fatigue-control.vue
src/views/message/fatigue-control.vue
+0
-459
history-push.vue
src/views/message/history-push.vue
+0
-369
msg-history.vue
src/views/message/msg-history.vue
+0
-234
strategy-manage.vue
src/views/message/strategy-manage.vue
+0
-780
create-protocol copy.vue
src/views/protocol/create-protocol copy.vue
+0
-492
protocol-detail copy 2.vue
src/views/protocol/protocol-detail copy 2.vue
+0
-250
protocol-detail copy.vue
src/views/protocol/protocol-detail copy.vue
+0
-702
protocol-detail.vue
src/views/protocol/protocol-detail.vue
+23
-13
protocol-history copy.vue
src/views/protocol/protocol-history copy.vue
+0
-246
protocol-history.vue
src/views/protocol/protocol-history.vue
+14
-4
protocol-list.vue
src/views/protocol/protocol-list.vue
+2
-3
未找到文件。
src/views/message/blacklist.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"blacklist-wrap"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<el-form
ref=
"searchReq"
:model=
"searchReq"
:rules=
"searchReqRules"
label-width=
"77px"
style=
"overflow: hidden;"
>
<el-form-item
label=
"手机号"
prop=
"aimNo"
style=
"width: 200px; float: left;"
>
<el-input
v-model
.
number=
"searchReq.aimNo"
placeholder=
"请输入手机号"
maxlength=
"11"
></el-input>
</el-form-item>
<el-form-item
label=
"恶意行为"
style=
"width: 200px; float: left;"
>
<el-input
v-model=
"searchReq.remark"
placeholder=
"请输入"
></el-input>
</el-form-item>
<el-form-item
label=
"记录时间"
style=
"width: 470px; float: left;"
>
<el-date-picker
v-model=
"duringTime"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
</el-date-picker>
</el-form-item>
<div
style=
"float: right; margin-right: 28px;"
>
<el-button
type=
"primary"
style=
"float: left; margin: 0 10px 10px 0;"
@
click=
"handleSearch('searchReq')"
>
搜索
</el-button>
<el-button
type=
"primary"
style=
"float: left; margin: 0 10px 10px 0;"
@
click=
"handleRefresh"
>
刷新
</el-button>
</div>
<div
style=
"overflow: hidden; clear: both; float: right; margin-right: 28px;"
>
<el-button
type=
"primary"
style=
"float: left; margin: 0 10px 10px 0;"
@
click=
"showAddModal"
>
添加
</el-button>
</div>
</el-form>
<div
style=
"padding: 0 40px;"
>
<el-table
:data=
"tableData"
border
style=
"width: 100%;"
>
<el-table-column
align=
"center"
prop=
"aimNo"
label=
"手机号"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"remark"
label=
"恶意行为"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"modifyTime"
label=
"记录时间"
>
<template
slot-scope=
"scope"
>
{{
returnModifyTime
(
scope
.
row
.
modifyTime
)
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"modifyName"
label=
"操作人"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click
.
native
.
prevent=
"showDeleteModal(scope.row)"
type=
"text"
>
移除
</el-button>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"searchReq.pageNo"
:page-sizes=
"[10, 30, 50, 100]"
:page-size=
"searchReq.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalRows"
>
</el-pagination>
</div>
</div>
<el-dialog
title=
"添加黑名单"
:visible
.
sync=
"centerDialogVisible"
:close-on-click-modal=
"false"
width=
"700px"
@
close=
"handleCancelAdd"
center
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"手机号"
prop=
"aimNo"
style=
"width: 600px;"
>
<el-input
v-model
.
number=
"ruleForm.aimNo"
placeholder=
"请输入"
maxlength=
"11"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"恶意行为"
prop=
"remark"
style=
"width: 600px;"
>
<el-input
v-model=
"ruleForm.remark"
placeholder=
"请输入"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleCancelAdd"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmAddBlacklist('ruleForm')"
>
确 定
</el-button>
</span>
</el-dialog>
<!-- 删除 弹窗 -->
<el-dialog
:visible
.
sync=
"deleteDialogVisible"
:close-on-click-modal=
"false"
width=
"400px"
center
>
<span>
确认移除?
</span>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"deleteDialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmDeleteRow"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
export
default
{
components
:
{
BreadCrumb
,
},
data
()
{
var
checkPhone
=
(
type
,
value
,
callback
)
=>
{
// debugger;
if
(
!
Number
.
isInteger
(
value
))
{
if
(
type
==
'search'
){
this
.
searchReq
.
aimNo
=
''
;
}
else
{
this
.
ruleForm
.
aimNo
=
''
;
}
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
}
else
{
value
+=
''
;
let
arr
=
value
.
split
(
''
);
if
(
value
.
length
>=
1
){
if
(
arr
[
0
]
!=
'1'
){
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
}
else
{
if
(
value
.
length
!=
11
){
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
}
else
{
callback
();
}
}
}
else
{
callback
();
}
}
};
var
checkUnnecessaryMobile
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
)
{
checkPhone
(
'search'
,
value
,
callback
);
}
else
{
if
(
typeof
value
!=
'undefined'
&&
value
===
0
){
return
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
};
callback
();
}
};
var
checkMobile
=
(
rule
,
value
,
callback
)
=>
{
// debugger;
if
(
!
value
){
if
(
typeof
value
!=
'undefined'
&&
value
===
0
){
return
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
};
return
callback
(
new
Error
(
'请填写手机号'
));
}
else
{
checkPhone
(
'addBlackList'
,
value
,
callback
);
}
};
return
{
curmbFirst
:
"黑名单"
,
duringTime
:
""
,
centerDialogVisible
:
false
,
tableData
:
[],
searchReqRules
:
{
aimNo
:
[
{
validator
:
checkUnnecessaryMobile
}
],
},
rules
:
{
aimNo
:
[
{
required
:
true
,
message
:
'请填写手机号'
,
trigger
:
'blur'
},
{
validator
:
checkMobile
}
],
remark
:
[
{
required
:
true
,
message
:
'请填写恶意行为'
,
trigger
:
'blur'
},
],
},
ruleForm
:
{
aimNo
:
''
,
remark
:
''
,
},
totalRows
:
0
,
searchReq
:
{
aimNo
:
''
,
// 手机号
remark
:
''
,
// 恶意行为
startTime
:
''
,
endTime
:
''
,
pageNo
:
1
,
pageSize
:
10
,
},
deleteDialogVisible
:
false
,
}
},
created
()
{
this
.
getBlackList
();
},
methods
:
{
showAddModal
()
{
this
.
centerDialogVisible
=
true
;
},
handleCancelAdd
()
{
this
.
centerDialogVisible
=
false
;
this
.
resetForm
(
'ruleForm'
);
},
confirmAddBlacklist
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
handleEditSave
();
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
resetForm
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
();
},
handleEditSave
()
{
// request
let
req
=
this
.
ruleForm
;
openLoading
(
this
);
this
.
POST
(
'raytheon/black/save'
,
req
).
then
((
res
)
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
)
{
// console.log('>>>>>> 移除当前行数据 OK ', req);
this
.
centerDialogVisible
=
false
;
this
.
getBlackList
();
this
.
resetForm
(
'ruleForm'
);
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
})
},
handleSearch
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
getBlackList
();
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
// 刷新
handleRefresh
()
{
let
options
=
{
isRefresh
:
true
};
this
.
getBlackList
(
options
);
},
getBlackList
(
options
)
{
if
(
options
&&
options
.
isRefresh
){
// 刷新 请求参数置为默认
this
.
searchReq
=
{
aimNo
:
''
,
// 手机号
remark
:
''
,
// 恶意行为
startTime
:
''
,
endTime
:
''
,
pageNo
:
1
,
pageSize
:
10
,
};
this
.
duringTime
=
''
;
}
else
{
// 时间获取
// console.log('this.duringTime',this.duringTime);
if
(
this
.
duringTime
!==
''
&&
this
.
duringTime
!==
null
)
{
this
.
searchReq
.
startTime
=
this
.
duringTime
[
0
].
getTime
();
this
.
searchReq
.
endTime
=
this
.
duringTime
[
1
].
getTime
();
}
else
{
this
.
searchReq
.
startTime
=
''
;
this
.
searchReq
.
endTime
=
''
;
}
}
let
req
=
this
.
searchReq
;
openLoading
(
this
);
this
.
GET
(
"raytheon/black/list"
,
req
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
// console.log('get blackList>>>>> ', res);
if
(
res
&&
res
.
data
){
this
.
totalRows
=
res
.
data
.
total
||
0
;
this
.
tableData
=
res
.
data
.
list
||
[];
}
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
handleSizeChange
(
val
){
this
.
searchReq
.
pageSize
=
val
;
this
.
getBlackList
();
},
handleCurrentChange
(
val
)
{
this
.
searchReq
.
pageNo
=
val
;
this
.
getBlackList
();
},
returnModifyTime
(
modifyTime
)
{
if
(
modifyTime
){
return
modifyTime
.
year
+
'-'
+
modifyTime
.
monthValue
+
'-'
+
modifyTime
.
dayOfMonth
;
}
else
{
return
'-'
;
}
},
showDeleteModal
(
rowData
)
{
this
.
deleteDialogVisible
=
true
;
this
.
rowData
=
rowData
;
},
confirmDeleteRow
()
{
let
req
=
{
id
:
this
.
rowData
.
id
};
openLoading
(
this
);
this
.
POST
(
'raytheon/black/delete'
,
req
).
then
((
res
)
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
)
{
// console.log('>>>>>> 移除当前行数据 OK ', req);
this
.
deleteDialogVisible
=
false
;
this
.
getBlackList
();
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
})
},
},
}
</
script
>
<
style
lang=
"scss"
>
.blacklist-wrap
{
.el-form-item
.el-form-item__label
{
font-size
:
14px
;
}
.component-content
{
margin-top
:
60px
;
padding
:
10px
;
background
:
#fff
;
}
.el-date-editor--daterange.el-input__inner
{
width
:
380px
!
important
;
}
}
</
style
>
\ No newline at end of file
src/views/message/create-push.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"create-push"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<div
class=
"header-title"
></div>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"ruleForm"
>
<el-form-item
label=
"推送应用"
prop=
"resource"
>
<el-radio-group
v-model=
"ruleForm.appId"
>
<el-radio
label=
"yunqueyi"
>
云鹊医app
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"目标人群"
prop=
"people"
>
<el-col
:span=
"24"
>
<el-radio-group
v-model=
"ruleForm.isAll"
@
change=
"handleTargetChoose"
>
<el-radio
:label=
"1"
>
全部
</el-radio>
<el-radio
:label=
"2"
>
导入推送名单
</el-radio>
<el-radio
:label=
"3"
>
用户筛选
</el-radio>
<div
class=
"user-select"
v-if=
"ruleForm.isAll == 3"
>
<div
class=
"select-btn"
@
click=
"showUserChooseModal"
>
选择用户名单
</div>
<div
class=
"numbers"
><span
class=
"choosed"
>
{{
userChooseCount
}}
</span>
|
{{
allUserCount
}}
</div>
</div>
</el-radio-group>
</el-col>
<!--
<el-col
:span=
"14"
>
<el-upload
v-if=
"ruleForm.isAll == 2"
class=
"upload-demo"
accept=
".xlsx"
:action=
"actionUrl"
:headers =
"headers"
v-model=
"fileName"
:http-request=
"httpRequest"
:before-upload=
"beforeUpload"
:disabled=
"ruleForm.isAll == 1"
>
<el-input
class=
"update-input"
placeholder=
"文件大小不能超过10M"
:disabled=
"true"
v-model=
"fileName"
autocomplete=
"off"
></el-input>
<el-button
class=
"update-item"
size=
"small"
type=
"primary"
>
选择文件
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
@
click=
"download"
>
模板.xlsx
</div>
<div
slot=
"tip"
class=
"tip-text"
>
备注:单次任务建议不要超过10w行
</div>
</el-upload>
</el-col>
-->
</el-form-item>
<el-form-item
label=
""
>
<el-upload
v-if=
"ruleForm.isAll == 2"
class=
"upload-demo"
accept=
".xlsx"
:action=
"actionUrl"
:headers =
"headers"
v-model=
"fileName"
:http-request=
"httpRequest"
:before-upload=
"beforeUpload"
:disabled=
"ruleForm.isAll == 1"
>
<el-input
class=
"update-input"
placeholder=
"文件大小不能超过10M"
:disabled=
"true"
v-model=
"fileName"
autocomplete=
"off"
></el-input>
<el-button
class=
"update-item"
size=
"small"
type=
"primary"
>
选择文件
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
@
click=
"download"
>
模板.xlsx
</div>
<div
slot=
"tip"
class=
"tip-text"
>
备注:单次任务建议不要超过10w行
</div>
</el-upload>
</el-form-item>
<el-form-item
label=
"推送标题"
prop=
"title"
>
<el-input
v-model=
"ruleForm.title"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"推送介绍"
prop=
"content"
>
<el-input
type=
"textarea"
maxlength=
"60"
:rows=
"3"
v-model=
"ruleForm.content"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"页面去向"
prop=
"url"
>
<el-input
type=
"textarea"
:rows=
"3"
v-model=
"ruleForm.url"
maxlength=
"250"
placeholder=
"H5链接"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"系统通知"
prop=
"noticeFlag"
>
<el-radio-group
v-model=
"ruleForm.noticeFlag"
>
<el-radio
:label=
"2"
>
是
</el-radio>
<el-radio
:label=
"1"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"APP接收窗口"
prop=
"pushType"
>
<el-radio-group
v-model=
"ruleForm.pushType"
>
<el-radio
label=
"03"
>
活动提醒
</el-radio>
<el-radio
label=
"04"
>
内容提醒
</el-radio>
<el-radio
label=
"02"
>
居民管理
</el-radio>
<el-radio
label=
"01"
>
系统消息
</el-radio>
<el-radio
label=
"05"
>
直播
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
>
提交预览
</el-button>
</el-form-item>
</el-form>
<el-dialog
title=
"推送预览"
:visible
.
sync=
"dialogFormVisible"
>
<div>
<span>
主题:
{{
ruleForm
.
title
}}
</span>
<p
style=
"display: inline-block; float: right;"
>
<span
style=
"margin-left: 0px"
>
目标对象:
</span>
<span
v-if=
"ruleForm.isAll == 2"
style=
"color: #449284"
>
{{
objNum
}}
</span>
<span
v-if=
"ruleForm.isAll == 3"
style=
"color: #449284"
>
{{
userChooseCount
}}
</span>
<span
v-else
>
全部
</span>
</p>
</div>
<hr>
<el-form
:model=
"ruleForm"
class=
"rule-form"
>
<el-form-item
label=
"APP推送:"
>
云鹊医
</el-form-item>
<el-form-item
label=
"推送标题:"
>
{{
ruleForm
.
title
}}
</el-form-item>
<el-form-item
label=
"推送介绍:"
>
<p
style=
"white-space: pre-line"
>
{{
ruleForm
.
content
}}
</p>
</el-form-item>
<!--
<p
style=
"white-space: pre-line"
>
{{
ruleForm
.
content
}}
</p>
-->
<el-form-item
label=
"页面去向:"
>
{{
ruleForm
.
url
}}
</el-form-item>
<el-form-item
label=
"系统通知:"
>
{{
ruleForm
.
noticeFlag
|
getNotice
}}
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"pushSend()"
>
确 定
</el-button>
</div>
</el-dialog>
<el-dialog
title=
"用户筛选"
:visible
.
sync=
"isUserChooseModalShow"
class=
"user-choose-modal"
>
<el-form
:inline=
"true"
:model=
"userChooseForm"
>
<el-form-item
label=
"行政区划:"
>
<el-select
class=
"select-choose"
v-model=
"finalChooseData.provinceId"
placeholder=
"省"
@
change=
"handleProvinceChange(finalChooseData.provinceId)"
clearable
>
<el-option
v-for=
"item in userChooseForm.address.provinceList"
:key=
"item.provinceId"
:label=
"item.provinceName"
:value=
"item.provinceId"
>
</el-option>
</el-select>
<el-select
class=
"select-choose"
v-model=
"finalChooseData.cityId"
placeholder=
"市"
@
change=
"handleCityChange(finalChooseData.cityId)"
clearable
>
<el-option
v-for=
"item in userChooseForm.address.cityList"
:key=
"item.cityId"
:label=
"item.cityName"
:value=
"item.cityId"
>
</el-option>
</el-select>
<el-select
class=
"select-choose"
v-model=
"finalChooseData.countyId"
placeholder=
"区"
@
change=
"handleCountyChange"
clearable
>
<el-option
v-for=
"item in userChooseForm.address.countyList"
:key=
"item.countyId"
:label=
"item.countyName"
:value=
"item.countyId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"技术职称:"
class=
"block-item"
>
<el-select
v-model=
"finalChooseData.doctorTitle"
multiple
placeholder=
"不限"
@
change=
"handleDoctorTitleChange"
>
<el-option
v-for=
"item in userChooseForm.techTitleList"
:key=
"item.titleId"
:label=
"item.name"
:value=
"item.titleId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"所属机构等级:"
class=
"block-item"
>
<el-select
v-model=
"finalChooseData.hospitalLevel"
multiple
placeholder=
"不限"
@
change=
"handleHospitalLevelChange"
>
<el-option
v-for=
"item in userChooseForm.hospitalLevelList"
:key=
"item.no"
:label=
"item.value"
:value=
"item.no"
>
</el-option>
</el-select>
</el-form-item>
<div
class=
"user-number"
>
<p
class=
"title"
>
目标用户 | 用户总量
</p>
<p
class=
"number"
>
<el-button
v-if=
"!isSeeUserNumBtnClicked"
class=
"target-num"
type=
"primary"
@
click=
"getCurrentUserCount"
size=
"mini"
>
查看目标数
</el-button>
<template
v-else
>
<span
class=
"choosed"
>
{{
userChooseCount
}}
</span>
<el-button
class=
"target-num"
type=
"primary"
@
click=
"getCurrentUserCount"
size=
"mini"
>
刷新目标数
</el-button>
</
template
>
| {{allUserCount}}
</p>
</div>
<p
class=
"click-refresh-tips"
>
<
template
v-if=
"isSeeUserNumBtnClicked"
>
筛选条件变更后,需重新点击"刷新目标数"按钮获取最新数据
</
template
></p>
<el-button
class=
"user-choose-submit"
type=
"primary"
@
click=
"handleChooseSubmit"
>
确认筛选
</el-button>
</el-form>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
{
create
}
from
"domain"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
*
as
commonUtil
from
"../../utils/utils"
;
import
axios
from
'axios'
;
import
{
getBaseUrl
,
getExcel
}
from
'@/utils/index'
;
let
vm
=
null
;
export
default
{
components
:
{
BreadCrumb
},
data
()
{
return
{
// curmbFirst: "APP推送",
// curmbSecond: "创建APP推送",
curmbFirst
:
"创建APP推送"
,
ruleForm
:
{
appId
:
"yunqueyi"
,
isAll
:
1
,
title
:
""
,
content
:
""
,
url
:
""
,
noticeFlag
:
2
,
pushType
:
'03'
,
},
actionUrl
:
getBaseUrl
(
'raytheon/excel/upload'
),
fileName
:
''
,
objNum
:
0
,
sendKey
:
''
,
dialogFormVisible
:
false
,
headers
:
{
sysCode
:
12
,
token
:
localStorage
.
getItem
(
'storageToken'
),
},
rules
:
{
appId
:
[
{
required
:
true
,
message
:
"请选择推送应用"
,
trigger
:
"change"
}
],
title
:
[
{
required
:
true
,
message
:
"请输入推送标题"
,
trigger
:
"blur"
},
{
min
:
0
,
max
:
30
,
message
:
"长度在 0 到 30 个字符"
,
trigger
:
"blur"
}
],
content
:
[
{
required
:
true
,
message
:
"请输入推送介绍"
,
trigger
:
"blur"
},
{
min
:
0
,
max
:
250
,
message
:
"长度在 0 到 250 个字符"
,
trigger
:
"blur"
}
]
},
isUserChooseModalShow
:
false
,
userChooseCount
:
0
,
// 用户筛选的最终num
allUserCount
:
0
,
// 总num
userChooseForm
:
{
address
:
{
provinceList
:
[],
cityList
:
[],
countyList
:
[],
},
techTitleList
:
[],
hospitalLevelList
:
[],
},
finalChooseData
:
{
provinceId
:
''
,
cityId
:
''
,
countyId
:
''
,
doctorTitle
:
[],
hospitalLevel
:
[],
},
isSeeUserNumBtnClicked
:
false
,
};
},
computed
:
{
...
mapGetters
([
"_token"
])
},
created
()
{
vm
=
this
;
vm
.
idType
=
localStorage
.
getItem
(
"storageIdType"
);
console
.
log
(
"idType:"
,
vm
.
idType
);
},
// 挂载到Dom完成时
mounted
:
function
()
{
// commonUtil.resizeHeight();
},
methods
:
{
submitForm
(
formName
)
{
if
(
this
.
ruleForm
.
isAll
==
3
&&
this
.
userChooseCount
==
0
){
vm
.
$message
(
'请先选择用户'
);
return
;
}
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
// vm.pushSend();
if
(
vm
.
ruleForm
.
isAll
==
2
)
{
if
(
vm
.
fileName
==
''
)
{
vm
.
$message
(
'请先导入名单'
);
}
else
{
vm
.
dialogFormVisible
=
true
;
}
}
else
{
vm
.
dialogFormVisible
=
true
;
}
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
pushSend
()
{
let
req
=
{};
req
=
this
.
ruleForm
;
if
(
req
.
isAll
==
2
||
req
.
isAll
==
3
)
{
req
.
key
=
vm
.
sendKey
;
}
req
.
createdName
=
localStorage
.
getItem
(
'user_name'
);
// openLoading(vm);
vm
.
POST
(
"raytheon/push/send"
,
req
).
then
(
res
=>
{
// closeLoading(vm);
vm
.
$message
(
res
.
message
);
if
(
res
.
code
==
'000000'
)
{
vm
.
ruleForm
=
{
appId
:
"yunqueyi"
,
isAll
:
1
,
title
:
""
,
content
:
""
,
url
:
""
,
noticeFlag
:
2
,
pushType
:
'03'
,
};
}
});
vm
.
dialogFormVisible
=
false
;
vm
.
fileName
=
''
;
vm
.
sendKey
=
''
;
},
download
()
{
let
xlsxUrl
=
getExcel
();
console
.
log
(
'下载模板'
+
xlsxUrl
);
setTimeout
(()
=>
{
window
.
open
(
xlsxUrl
);
},
500
);
},
beforeUpload
(
file
)
{
// console.log(file);
let
self
=
this
;
const
isLt
=
file
.
size
/
1024
/
1024
<
10
;
if
(
!
isLt
)
{
this
.
$message
.
error
(
"文件大小不能超过10M"
);
return
;
}
else
{
vm
.
fileName
=
file
.
name
;
}
},
httpRequest
(
options
)
{
// console.log(options,options.file)
let
file
=
options
.
file
let
reader
=
new
FileReader
()
if
(
file
)
{
reader
.
readAsDataURL
(
file
)
}
reader
.
onload
=
(
e
)
=>
{
let
base64Str
=
e
.
target
.
result
.
split
(
','
)[
1
]
// console.log('e的值',e);
// let base64Str = e.target.result.substr(e.target.result.indexOf("base64,") + 7)
// vm.POST("raytheon/excel/upload", base64Str).then(res => {
// console.log(res);
// })
openLoading
(
vm
);
axios
({
headers
:
{
sysCode
:
12
,
token
:
localStorage
.
getItem
(
'storageToken'
),
'content-type'
:
'text/html'
},
url
:
getBaseUrl
(
'raytheon/excel/upload'
),
method
:
'post'
,
data
:
base64Str
,
}).
then
(
function
(
response
)
{
// console.log(response);
closeLoading
(
vm
);
vm
.
objNum
=
response
.
data
.
data
.
count
;
vm
.
sendKey
=
response
.
data
.
data
.
key
;
console
.
log
(
'vm.objNum '
,
vm
.
objNum
);
})
}
},
handleTargetChoose
()
{
if
(
this
.
ruleForm
.
isAll
==
3
){
// 初始化
this
.
isSeeUserNumBtnClicked
=
false
;
this
.
userChooseCount
=
0
;
this
.
allUserCount
=
0
;
this
.
userChooseForm
=
{
address
:
{
provinceList
:
[],
cityList
:
[],
countyList
:
[],
},
techTitleList
:
[],
hospitalLevelList
:
[],
};
this
.
finalChooseData
=
{
provinceId
:
''
,
cityId
:
''
,
countyId
:
''
,
doctorTitle
:
[],
hospitalLevel
:
[],
};
// 获取总数量
this
.
getCurrentUserCount
({
getAll
:
true
});
}
},
getCurrentUserCount
(
params
)
{
if
(
!
(
params
&&
params
.
getAll
)){
if
(
this
.
finalChooseData
.
provinceId
==
''
&&
this
.
finalChooseData
.
cityId
==
''
&&
this
.
finalChooseData
.
countyId
==
''
&&
this
.
finalChooseData
.
doctorTitle
.
length
==
0
&&
this
.
finalChooseData
.
hospitalLevel
.
length
==
0
){
this
.
isSeeUserNumBtnClicked
=
true
;
this
.
userChooseCount
=
0
;
return
;
}
}
openLoading
(
vm
,
'topIndex'
);
let
req
=
this
.
finalChooseData
;
vm
.
POST
(
"raytheon/push/screenUserCount"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
if
(
params
&&
params
.
getAll
){
this
.
allUserCount
=
res
.
data
;
}
else
{
this
.
isSeeUserNumBtnClicked
=
true
;
this
.
userChooseCount
=
res
.
data
;
}
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
showUserChooseModal
()
{
this
.
isUserChooseModalShow
=
true
;
this
.
getProvinceList
();
this
.
getTechTitleList
();
this
.
getHospitalLevelList
();
},
getProvinceList
()
{
let
req
=
{};
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
provinceList
=
res
.
data
.
provinceList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getCityList
(
params
)
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
params
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
cityList
=
res
.
data
.
cityList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getCountyList
(
params
)
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
params
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
countyList
=
res
.
data
.
countyList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
handleProvinceChange
(
id
)
{
this
.
finalChooseData
.
cityId
=
''
;
this
.
finalChooseData
.
countyId
=
''
;
// 清空省,则移除市、区列表
if
(
id
==
''
){
this
.
userChooseForm
.
address
.
cityList
=
[];
this
.
userChooseForm
.
address
.
countyList
=
[];
return
;
}
let
params
=
{
provinceId
:
id
};
this
.
getCityList
(
params
);
// this.getCurrentUserCount();
},
handleCityChange
(
id
)
{
this
.
finalChooseData
.
countyId
=
''
;
// 清空市,则移除区列表
if
(
id
==
''
){
this
.
userChooseForm
.
address
.
countyList
=
[];
return
;
}
let
params
=
{
cityId
:
id
};
this
.
getCountyList
(
params
);
// this.getCurrentUserCount();
},
handleCountyChange
()
{
// this.getCurrentUserCount();
},
handleDoctorTitleChange
()
{
// this.getCurrentUserCount();
},
handleHospitalLevelChange
()
{
// this.getCurrentUserCount();
},
getTechTitleList
()
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/doctor/title"
,
{}).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
techTitleList
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getHospitalLevelList
()
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/hospital/level"
,
{}).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
hospitalLevelList
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
// 确认筛选
handleChooseSubmit
()
{
this
.
getCurrentUserCount
();
openLoading
(
vm
);
vm
.
sendKey
=
''
;
let
req
=
this
.
finalChooseData
;
vm
.
POST
(
"raytheon/push/screenUser"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
vm
.
isUserChooseModalShow
=
false
;
vm
.
sendKey
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
}
};
</
script
>
<
style
lang=
"scss"
>
.topIndex
{
z-index
:
10000
!
important
;
}
.create-push
{
.component-content
{
margin-top
:
20px
;
padding
:
10px
;
background
:
#fff
;
.header-title
{
padding
:
10px
12px
;
font-size
:
12px
;
color
:
#449284
;
border-bottom
:
1px
solid
#efefef
;
}
.ruleForm
{
width
:
70%
;
margin-left
:
50px
;
}
.rule-form
{
margin-top
:
20px
;
margin-left
:
30px
;
.el-form-item__content
{
font-size
:
12px
;
}
}
.update-input
{
width
:
200px
;
}
.update-item
{
/* float: left; */
margin-right
:
5px
;
}
.el-upload__tip
{
// margin-top: -10px;
// margin-left: 205px;
margin-top
:
-40px
;
margin-left
:
290px
;
cursor
:
pointer
;
width
:
60px
;
color
:
#449284
;
}
.tip-text
{
margin-top
:
-40px
;
margin-left
:
380px
;
width
:
260px
;
color
:
red
;
}
.el-upload-list
{
display
:
none
;
}
.table-empty
{
img
{
width
:
100px
;
}
p
{
margin-top
:
-50px
;
}
}
.user-select
{
display
:
inline-block
;
height
:
auto
;
padding
:
5px
10px
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
.select-btn
{
display
:
inline-block
;
font-size
:
14px
;
padding
:
5px
;
border-radius
:
4px
;
background
:
#449284
!
important
;
border
:
1px
solid
#449284
!
important
;
color
:
#FFF
;
cursor
:
pointer
;
}
.numbers
{
font-size
:
14px
;
margin-left
:
10px
;
display
:
inline-block
;
.choosed
{
color
:
#449284
;
}
}
}
.user-choose-modal
{
.el-form-item__label
{
width
:
120px
;
font-size
:
14px
;
}
.select-choose
{
width
:
150px
;
}
.block-item
{
display
:
block
;
}
.user-number
{
margin
:
40px
auto
0
;
text-align
:
center
;
width
:
70%
;
height
:
34px
;
line-height
:
34px
;
border-radius
:
4px
;
border
:
1px
solid
#DCDFE6
;
.title
{
display
:
inline-block
;
}
.number
{
display
:
inline-block
;
margin-left
:
50px
;
.target-num
{
padding
:
7px
;
}
.choosed
{
color
:
#449284
;
}
}
}
.click-refresh-tips
{
text-align
:
center
;
margin
:
5px
auto
20px
;
height
:
20px
;
color
:
#e6a23c
;
}
.user-choose-submit
{
margin
:
0
auto
;
display
:
block
;
}
}
}
}
</
style
>
\ No newline at end of file
src/views/message/fatigue-control.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"fatigue-control-wrap"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<el-form
ref=
"form"
:model=
"searchReq"
label-width=
"80px"
style=
"overflow: hidden;"
>
<el-form-item
label=
"策略名称"
prop=
"startDate"
class=
"diagnose-select-style"
style=
"float: left;"
>
<el-select
v-model=
"searchReq.strategyCode"
filterable
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.strategyCode"
:label=
"item.name"
:value=
"item.strategyCode"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"修改时间"
style=
"width: 470px; float: left;"
>
<el-date-picker
v-model=
"duringTime"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
</el-date-picker>
</el-form-item>
<div
style=
"float: right; margin-right: 28px;"
>
<el-button
type=
"primary"
style=
"float: left; margin: 0 10px 10px 0;"
@
click=
"handleSearchClick"
>
搜索
</el-button>
<el-button
type=
"primary"
style=
"float: left; margin: 0 10px 10px 0;"
@
click=
"handleRefresh"
>
刷新
</el-button>
</div>
<div
style=
"overflow: hidden; clear: both; float: right; margin-right: 28px;"
>
<el-button
type=
"primary"
style=
"float: left; margin: 0 10px 10px 0;"
@
click=
"handleAddOrEdit('add')"
>
添加
</el-button>
</div>
</el-form>
<div
style=
"padding: 0 40px;"
>
<el-table
:data=
"tableData"
border
style=
"width: 100%;"
>
<el-table-column
align=
"center"
prop=
"name"
label=
"名称"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"toLimit"
label=
"频次控制"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
toLimit
+
'次/天'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"修改时间"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
modifyTime
?
scope
.
row
.
modifyTime
.
year
+
'-'
+
scope
.
row
.
modifyTime
.
monthValue
+
'-'
+
scope
.
row
.
modifyTime
.
dayOfMonth
:
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"modifyName"
label=
"操作人"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"strategyNameShow"
label=
"策略组"
:show-overflow-tooltip=
"true"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click=
"handleAddOrEdit('edit', scope.row)"
type=
"text"
>
编辑
</el-button>
<el-button
@
click=
"showDeleteModal(scope.row)"
type=
"text"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"searchReq.pageNo"
:page-sizes=
"[10, 30, 50, 100]"
:page-size=
"searchReq.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalRows"
>
</el-pagination>
</div>
</div>
<!-- 添加modal 弹窗 -->
<el-dialog
:visible
.
sync=
"centerDialogVisible"
:close-on-click-modal=
"false"
v-if=
"centerDialogVisible"
width=
"700px"
@
close=
"handleCancel"
center
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"名称"
prop=
"name"
style=
"width: 600px;"
>
<el-input
type=
"text"
placeholder=
"请输入"
maxlength=
"30"
show-word-limit
v-model=
"ruleForm.name"
>
</el-input>
</el-form-item>
<el-form-item
label=
"频次"
prop=
"toLimit"
style=
"width: 600px;"
>
<el-input
v-model
.
number=
"ruleForm.toLimit"
type=
"text"
maxlength=
"3"
placeholder=
"请输入"
style=
"width: 100px;"
>
</el-input>
<p
style=
"display: inline-block; margin-left: 10px;"
>
次/天
</p>
</el-form-item>
<el-form-item
label=
"策略组"
prop=
"strategyCodeList"
>
<el-select
v-model=
"ruleForm.strategyCodeList"
multiple
placeholder=
"请选择策略组名称(多选)"
style=
"width: 500px;"
>
<el-option
v-for=
"item in strategyList"
:key=
"item.code"
:label=
"item.name"
:value=
"item.code"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleCancel"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmAddOrEdit('ruleForm')"
>
确 定
</el-button>
</span>
</el-dialog>
<!-- 删除 弹窗 -->
<el-dialog
title=
"删除"
:close-on-click-modal=
"false"
:visible
.
sync=
"deleteDialogVisible"
width=
"400px"
center
>
<span>
确认删除?
</span>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"deleteDialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmDelete"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
export
default
{
components
:
{
BreadCrumb
,
},
data
()
{
var
checkToLimit
=
(
rule
,
value
,
callback
)
=>
{
if
(
typeof
value
!=
'undefined'
&&
value
==
0
){
return
callback
(
new
Error
(
'频次范围:1-100'
));
};
if
(
!
value
)
{
return
callback
(
new
Error
(
'频次不能为空'
));
}
else
{
if
(
!
Number
.
isInteger
(
value
))
{
this
.
ruleForm
.
toLimit
=
''
;
callback
(
new
Error
(
'频次必须为数字值'
));
}
else
{
if
(
value
<
1
||
value
>
100
)
{
callback
(
new
Error
(
'频次范围:1-100'
));
}
else
{
callback
();
}
}
}
};
return
{
curmbFirst
:
"疲劳度控制"
,
duringTime
:
""
,
ruleForm
:
{
// 新增/编辑 数据
name
:
''
,
// 名称
toLimit
:
''
,
// 频次
strategyCodeList
:
''
,
// 策略组(策略组 codelist)
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请填写名称'
,
trigger
:
'blur'
},
],
toLimit
:
[
{
required
:
true
,
message
:
'请填写频次'
,
trigger
:
'blur'
},
{
validator
:
checkToLimit
},
],
strategyCodeList
:
[
{
required
:
true
,
message
:
'请选择策略组'
,
trigger
:
'blur'
},
]
},
isCreate
:
true
,
centerDialogVisible
:
false
,
tableData
:
[],
totalRows
:
0
,
// 总页数
inputSearchName
:
''
,
searchReq
:
{
// 疲劳度列表 请求参数
strategyCode
:
''
,
pageNo
:
1
,
pageSize
:
10
,
startTime
:
''
,
endTime
:
''
,
},
strategyList
:
[],
deleteDialogVisible
:
false
,
rowData
:
{},
loading
:
false
,
options
:
[],
}
},
created
()
{
this
.
getStrategyNameList
();
this
.
getList
();
},
methods
:
{
getStrategyNameList
()
{
openLoading
(
this
);
this
.
GET
(
"raytheon/strategy/pullSelect"
,
{}).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
// console.log('get 策略下拉列表>>>>> ', res);
this
.
options
=
res
.
data
;
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
handleCancel
()
{
this
.
resetForm
(
'ruleForm'
);
this
.
centerDialogVisible
=
false
;
this
.
initRuleFormData
();
},
initRuleFormData
()
{
this
.
ruleForm
=
{
name
:
''
,
// 名称
toLimit
:
''
,
// 频次
strategyCodeList
:
''
,
// 策略组(策略组 codelist)
};
},
confirmAddOrEdit
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
isCreate
==
true
){
// 创建策略时
this
.
handleAddSave
();
}
else
{
// 编辑时
this
.
handleEditSave
();
}
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
resetForm
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
();
},
handleAddSave
()
{
let
req
=
this
.
ruleForm
;
openLoading
(
this
);
this
.
POST
(
'raytheon/fatigueControlInfo/save'
,
req
).
then
((
res
)
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
)
{
// console.log('>>>>>> 新增 编辑 OK ', req);
this
.
getList
();
this
.
centerDialogVisible
=
false
;
this
.
initRuleFormData
();
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
})
},
handleEditSave
()
{
let
req
=
this
.
ruleForm
;
openLoading
(
this
);
this
.
POST
(
'raytheon/fatigueControlInfo/update'
,
req
).
then
((
res
)
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
)
{
// console.log('>>>>>> 新增 编辑 OK ', req);
this
.
getList
();
this
.
centerDialogVisible
=
false
;
this
.
initRuleFormData
();
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
})
},
handleSearchClick
()
{
this
.
searchReq
.
pageNo
=
1
;
this
.
getList
();
},
handleRefresh
()
{
let
options
=
{
isRefresh
:
true
};
this
.
getList
(
options
);
},
handleSizeChange
(
val
){
this
.
searchReq
.
pageSize
=
val
;
this
.
getList
();
},
handleCurrentChange
(
val
)
{
this
.
searchReq
.
pageNo
=
val
;
this
.
getList
();
},
getList
(
options
)
{
if
(
options
&&
options
.
isRefresh
){
// 刷新 请求参数置为默认
this
.
searchReq
=
{
strategyCode
:
''
,
pageNo
:
1
,
pageSize
:
10
,
startTime
:
''
,
endTime
:
''
,
};
this
.
duringTime
=
''
;
}
else
{
// 时间获取
// console.log('this.duringTime',this.duringTime);
if
(
this
.
duringTime
!==
''
&&
this
.
duringTime
!==
null
)
{
this
.
searchReq
.
startTime
=
this
.
duringTime
[
0
].
getTime
();
this
.
searchReq
.
endTime
=
this
.
duringTime
[
1
].
getTime
();
}
else
{
this
.
searchReq
.
startTime
=
''
;
this
.
searchReq
.
endTime
=
''
;
}
}
let
req
=
this
.
searchReq
;
openLoading
(
this
);
this
.
GET
(
"raytheon/fatigueControlInfo/list"
,
req
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
// console.log('get 策略列表>>>>> ', res);
if
(
res
.
data
)
{
this
.
totalRows
=
res
.
data
.
total
;
}
if
(
res
.
data
&&
res
.
data
.
list
&&
res
.
data
.
list
.
length
>
0
){
this
.
tableData
=
res
.
data
.
list
;
}
else
{
this
.
tableData
=
[];
}
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
handleAddOrEdit
(
status
,
rowData
)
{
// isCreate
this
.
centerDialogVisible
=
true
;
let
req
=
{};
if
(
status
&&
status
==
'add'
){
// 添加
this
.
isCreate
=
true
;
this
.
ruleForm
=
{
name
:
''
,
// 名称
toLimit
:
''
,
// 频次
strategyCodeList
:
''
,
// 策略组(策略组 codelist)
};
req
=
{
code
:
'0'
// 添加时 code传0
};
}
else
{
// 编辑
this
.
isCreate
=
false
;
const
{
code
,
name
,
toLimit
,
strategyCodeList
}
=
rowData
;
this
.
ruleForm
=
{
code
,
// 编辑时 多传一个code
name
,
toLimit
,
strategyCodeList
,
};
req
=
{
code
,
};
}
openLoading
(
this
);
this
.
GET
(
"raytheon/strategy/pullList"
,
req
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
console
.
log
(
'获取疲劳度策略组下拉列表>>> '
,
res
.
data
)
this
.
strategyList
=
res
.
data
;
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
showDeleteModal
(
rowData
)
{
this
.
deleteDialogVisible
=
true
;
this
.
rowData
=
rowData
;
},
confirmDelete
()
{
let
req
=
{
code
:
this
.
rowData
.
code
};
openLoading
(
this
);
this
.
POST
(
'raytheon/fatigueControlInfo/delete'
,
req
).
then
((
res
)
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
)
{
console
.
log
(
'>>>>>> 新增 编辑 OK '
,
req
);
this
.
deleteDialogVisible
=
false
;
this
.
getList
();
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
})
},
},
}
</
script
>
<
style
lang=
"scss"
>
.fatigue-control-wrap
{
.el-form-item
.el-form-item__label
{
font-size
:
14px
;
}
.component-content
{
margin-top
:
60px
;
padding
:
10px
;
background
:
#fff
;
}
.el-date-editor--daterange.el-input__inner
{
width
:
380px
!
important
;
}
.pagination
{
margin
:
20px
0
;
text-align
:
right
;
}
}
</
style
>
\ No newline at end of file
src/views/message/history-push.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"history-push"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<div
class=
"header-title"
></div>
<el-row
:gutter=
"30"
class=
"row"
type=
"flex"
style=
"margin-top: 10px;"
>
<el-form
ref=
"formInline"
:model=
"formInline"
label-width=
"75px"
style=
"width:100%;"
>
<el-col
:span=
"4"
>
<el-form-item
label=
"状态"
>
<el-select
v-model=
"formInline.status"
placeholder=
"请选择"
>
<el-option
v-for=
"item in statusList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"4"
>
<el-form-item
label=
"推送类型"
>
<el-select
v-model=
"formInline.pushWay"
placeholder=
"请选择"
>
<el-option
v-for=
"item in pushWayList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"5"
>
<el-form-item
label=
"标题"
>
<el-input
v-model=
"formInline.title"
placeholder=
"推送标题"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"9"
>
<el-form-item
label=
"推送日期"
>
<el-date-picker
v-model=
"duringTime"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始时间"
end-placeholder=
"结束时间"
></el-date-picker>
</el-form-item>
</el-col>
<!--
<el-col
:span=
"5"
style=
"padding:0;text-align:right;padding-right:15px;"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"searchList"
>
搜索
</el-button>
<el-button
type=
"default"
size=
"small"
@
click=
"resetForm"
style=
"margin-left:0;"
>
刷新
</el-button>
</el-col>
-->
</el-form>
</el-row>
<el-row>
<el-col
:span=
"24"
style=
"padding:0;text-align:right;padding-right:35px;margin-bottom:15px"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"searchList"
>
搜索
</el-button>
<el-button
type=
"default"
size=
"small"
@
click=
"resetForm"
style=
"margin-left:0;"
>
重置
</el-button>
</el-col>
</el-row>
<el-table
:data=
"tableData"
style=
"width: 100%"
>
<el-table-column
prop=
"title"
label=
"推送标题"
min-width=
"100"
align=
"left"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"pushWay"
label=
"推送类型"
min-width=
"100"
align=
"left"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
pushWay
|
getPushWay
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"content"
label=
"推送介绍"
min-width=
"130"
align=
"left"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<el-button
style=
""
type=
"text"
size=
"small"
@
click=
"showDetail(scope.row)"
>
{{
scope
.
row
.
content
}}
</el-button>
<!--
<span
>
{{
scope
.
row
.
content
}}
</span>
-->
<!--
<el-button
style=
"margin-left: 15px;"
type=
"text"
size=
"small"
@
click=
"showDetail(scope.row)"
>
详情
</el-button>
-->
</
template
>
</el-table-column>
<el-table-column
prop=
"createdName"
label=
"操作人"
align=
"left"
min-width=
"100"
></el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
align=
"left"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
status
|
getPushStatus
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"createdTime"
label=
"创建时间"
min-width=
"95"
align=
"left"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createdTime
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"startPushTime"
label=
"开始推送时间"
min-width=
"95"
align=
"left"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
startPushTime
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"totalCount"
label=
"推送目标"
align=
"left"
min-width=
"100"
></el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
width=
"200"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"small"
:disabled=
"scope.row.status == 1"
@
click=
"pushStatistics(scope.row)"
>
推送统计
</el-button>
</
template
>
</el-table-column>
<div
slot=
"empty"
>
<div
class=
"table-empty"
>
<img
src=
"../../assets/image/no-content1.png"
>
<p>
没有查询到相关结果
</p>
</div>
</div>
</el-table>
<div
class=
"pagination"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"formInline.pageNo"
:page-sizes=
"[10, 30, 50, 100]"
:page-size=
"formInline.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalRows"
></el-pagination>
</div>
</div>
<el-dialog
title
:visible
.
sync=
"dialogVisible"
width=
"30%"
center
>
<p
style=
"white-space: pre-line"
>
{{ introduce }}
</p>
<p
style=
"margin-top: 20px"
>
<span>
页面去向:
</span>
<el-link
type=
"primary"
:href=
"toUrl"
target=
"_blank"
>
{{ toUrl }}
</el-link>
</p>
</el-dialog>
<el-dialog
title=
""
:visible
.
sync=
"dialogTableVisible"
center
class=
"push-census"
width=
"68%"
>
<el-table
:data=
"statistics"
>
<el-table-column
align=
"center"
property=
"totalCount"
label=
"目标用户"
min-width=
"150"
>
<
template
slot-scope=
"scope"
>
<p>
目标总量:
{{
scope
.
row
.
totalCount
}}
</p>
<p>
僵尸用户:
{{
scope
.
row
.
zombieDeviceCount
}}
</p>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
property=
"totalDevice"
label=
"设备数"
min-width=
"150"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
totalDevice
}}
</span>
<div
class=
"under-tips"
>
单个目标用户可能会存在多个设备
</div>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
property=
"toCount"
label=
"送达数/率"
min-width=
"150"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
|
getToValue
}}
</span>
<div
class=
"under-tips"
>
送达率:送达数/设备数
</div>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
property=
"clickCount"
label=
"点击数/率"
min-width=
"150"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
|
getClickValue
}}
</span>
<div
class=
"under-tips"
>
点击率:点击数/设备数
</div>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
property=
"failedCount"
label=
"提交失败"
min-width=
"150"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
|
getFailedValue
}}
</span>
<div
class=
"under-tips"
>
提交失败率:失败人数/目标用户数
</div>
<el-button
v-if=
"failedExcelUrl !== null"
style=
"margin-top: 20px;right: 0"
type=
"primary"
size=
"small"
@
click=
"download(scope.row)"
>
导出失败名单
</el-button>
</
template
>
</el-table-column>
</el-table>
<!-- <el-button style="margin-top: 20px;right: 0" type="primary" size="small" @click="download(scope.row)">导出失败名单</el-button> -->
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogTableVisible = false"
>
关闭
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
{
create
}
from
"domain"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
*
as
commonUtil
from
"../../utils/utils"
;
import
{
getBaseUrl
}
from
'@/utils/index'
;
let
vm
=
null
;
export
default
{
components
:
{
BreadCrumb
},
data
()
{
return
{
// curmbFirst: "APP推送",
// curmbSecond: "APP推送历史",
curmbFirst
:
"APP推送历史"
,
tableData
:
[],
currentPage
:
1
,
duringTime
:
0
,
totalRows
:
0
,
formInline
:
{
status
:
""
,
pushWay
:
""
,
startTime
:
""
,
endTime
:
""
,
title
:
""
,
pageNo
:
1
,
pageSize
:
10
},
duringTime
:
""
,
dialogVisible
:
false
,
introduce
:
""
,
link
:
"www.baidu.com"
,
statistics
:
[{
totalCount
:
""
,
toCount
:
""
,
toProportion
:
""
,
clickCount
:
""
,
clickProportion
:
""
,
failedCount
:
""
,
failedProportion
:
""
,
failedExcelUrl
:
null
}],
dialogTableVisible
:
false
,
toUrl
:
''
,
failedExcelUrl
:
null
,
statusList
:
[
{
value
:
1
,
label
:
"推送中"
},
{
value
:
2
,
label
:
"推送完成"
},
{
value
:
3
,
label
:
"任务中断"
}
],
pushWayList
:
[
{
value
:
''
,
label
:
"全部"
},
{
value
:
2
,
label
:
"手动推送"
},
{
value
:
1
,
label
:
"模板推送"
},
]
};
},
computed
:
{
...
mapGetters
([
"_token"
])
},
created
()
{
vm
=
this
;
vm
.
idType
=
localStorage
.
getItem
(
"storageIdType"
);
console
.
log
(
"idType:"
,
vm
.
idType
);
this
.
search
();
},
// 挂载到Dom完成时
mounted
:
function
()
{
// commonUtil.resizeHeight();
},
methods
:
{
searchList
()
{
this
.
formInline
.
pageNo
=
1
;
console
.
log
(
'this.duringTime'
,
this
.
duringTime
);
if
(
this
.
duringTime
!==
''
&&
this
.
duringTime
!==
null
)
{
this
.
formInline
.
startTime
=
this
.
duringTime
[
0
].
getTime
();
this
.
formInline
.
endTime
=
this
.
duringTime
[
1
].
getTime
();
}
else
{
this
.
formInline
.
startTime
=
''
;
this
.
formInline
.
endTime
=
''
;
}
console
.
log
(
'formInline'
,
this
.
formInline
);
this
.
search
();
},
search
()
{
let
req
=
{};
req
=
this
.
formInline
;
openLoading
(
vm
);
vm
.
GET
(
"raytheon/pushLog/list"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
vm
.
tableData
=
res
.
data
.
list
;
vm
.
totalRows
=
res
.
data
.
total
;
});
},
resetForm
()
{
vm
.
formInline
=
Object
.
assign
(
{},
{
status
:
""
,
pushWay
:
""
,
startTime
:
""
,
endTime
:
""
,
title
:
""
,
pageNo
:
1
,
pageSize
:
10
}
);
vm
.
duringTime
=
''
;
vm
.
search
();
},
pushStatistics
(
row
)
{
let
req
=
{};
vm
.
failedExcelUrl
=
null
;
openLoading
(
vm
);
vm
.
GET
(
"raytheon/pushLog/statistics/"
+
row
.
batchNo
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
console
.
log
(
res
.
data
);
vm
.
dialogTableVisible
=
true
;
vm
.
statistics
=
[];
vm
.
statistics
[
0
]
=
res
.
data
;
vm
.
failedExcelUrl
=
res
.
data
.
failedExcelUrl
;
});
},
showDetail
(
row
)
{
vm
.
dialogVisible
=
true
;
vm
.
introduce
=
row
.
content
;
vm
.
toUrl
=
row
.
url
;
},
download
()
{
let
downUrl
=
getBaseUrl
(
vm
.
failedExcelUrl
);
console
.
log
(
'导出失败名单'
,
downUrl
);
setTimeout
(()
=>
{
window
.
open
(
downUrl
);
},
500
);
},
handleSizeChange
(
val
)
{
this
.
formInline
.
pageSize
=
val
;
this
.
search
();
console
.
log
(
`每页
${
val
}
条`
);
},
handleCurrentChange
(
val
)
{
this
.
formInline
.
pageNo
=
val
;
this
.
search
();
console
.
log
(
`当前页:
${
val
}
`
);
}
}
};
</
script
>
<
style
lang=
"scss"
>
.history-push
{
.component-content
{
margin-top
:
20px
;
padding
:
10px
;
background
:
#fff
;
.header-title
{
padding
:
10px
12px
;
font-size
:
12px
;
color
:
#449284
;
border-bottom
:
1px
solid
#efefef
;
}
.table-empty
{
img
{
width
:
100px
;
}
p
{
margin-top
:
-50px
;
}
}
}
.push-census
{
.el-table
td
{
vertical-align
:
top
;
}
.under-tips
{
margin-top
:
6px
;
color
:
#909399
;
}
}
}
</
style
>
\ No newline at end of file
src/views/message/msg-history.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"msg-history-wrap"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<el-form
ref=
"searchReq"
:rules=
"rules"
:model=
"searchReq"
label-width=
"100px"
style=
"margin-bottom: 20px;"
>
<el-row>
<el-col
style=
"width:270px;"
>
<el-form-item
label=
"手机号"
prop=
"mobile"
>
<el-input
v-model
.
number=
"searchReq.mobile"
placeholder=
"请输入手机号"
maxlength=
"11"
></el-input>
</el-form-item>
</el-col>
<el-col
style=
"width:290px;"
>
<el-form-item
label=
"内容关键字"
prop=
"content"
>
<el-input
v-model=
"searchReq.content"
placeholder=
"请输入内容关键字"
></el-input>
</el-form-item>
</el-col>
<el-col
style=
"width: 200px; margin-left: 60px;"
>
<el-button
type=
"primary"
@
click=
"handleSearchClick('searchReq')"
>
搜索
</el-button>
</el-col>
</el-row>
</el-form>
<div
style=
"padding: 0 40px;"
>
<el-table
:data=
"tableData"
border
style=
"width: 100%;"
>
<el-table-column
align=
"center"
prop=
"mobile"
label=
"手机号"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"content"
label=
"内容"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"发送时间"
>
<template
slot-scope=
"scope"
>
{{
returnSendTime
(
scope
.
row
.
creatTime
)
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"统计"
>
<
template
slot-scope=
"scope"
>
<p
:class=
"returnStatusStyle(scope.row.code)"
>
{{
returnStatusText
(
scope
.
row
.
code
)
}}
</p>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"searchReq.pageNo"
:page-sizes=
"[10, 30, 50, 100]"
:page-size=
"searchReq.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalRows"
>
</el-pagination>
</div>
</div>
</div>
</div>
</template>
<
script
>
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
export
default
{
components
:
{
BreadCrumb
,
},
data
()
{
var
checkMobiles
=
(
rule
,
value
,
callback
)
=>
{
// debugger;
if
(
value
)
{
if
(
!
Number
.
isInteger
(
value
))
{
this
.
searchReq
.
mobile
=
''
;
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
}
else
{
value
+=
''
;
let
arr
=
value
.
split
(
''
);
if
(
value
.
length
>=
1
){
if
(
arr
[
0
]
!=
'1'
){
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
}
else
{
if
(
value
.
length
!=
11
){
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
}
else
{
callback
();
}
}
}
else
{
callback
();
}
}
}
else
{
if
(
typeof
value
!=
'undefined'
&&
value
===
0
){
callback
(
new
Error
(
'手机号必须是以1开头的11位纯数字'
));
};
callback
();
}
};
return
{
curmbFirst
:
"短信历史"
,
searchReq
:
{
mobile
:
''
,
content
:
''
,
pageNo
:
1
,
pageSize
:
10
,
},
totalRows
:
0
,
tableData
:
[],
rules
:
{
mobile
:
[
{
validator
:
checkMobiles
}
],
},
}
},
created
()
{
this
.
getSMSList
();
},
methods
:
{
getSMSList
()
{
let
req
=
this
.
searchReq
;
openLoading
(
this
);
this
.
GET
(
"raytheon/sms/list"
,
req
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
// console.log('get SMS列表>>>>> ', res);
if
(
res
&&
res
.
data
){
this
.
totalRows
=
res
.
data
.
total
||
0
;
this
.
tableData
=
res
.
data
.
list
||
[];
}
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
handleSearchClick
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
searchReq
.
pageNo
=
1
;
this
.
getSMSList
();
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
handleSizeChange
(
val
){
this
.
searchReq
.
pageSize
=
val
;
this
.
getSMSList
();
},
handleCurrentChange
(
val
)
{
this
.
searchReq
.
pageNo
=
val
;
this
.
getSMSList
();
},
returnSendTime
(
creatTime
){
if
(
creatTime
){
return
creatTime
.
year
+
'-'
+
creatTime
.
monthValue
+
'-'
+
creatTime
.
dayOfMonth
+
' '
+
creatTime
.
hour
+
':'
+
creatTime
.
minute
;
}
else
{
return
'-'
;
}
},
returnStatusText
(
code
){
if
(
typeof
code
!=
'undefined'
){
if
(
code
==
0
||
code
==
3
){
return
'成功'
;
}
else
if
(
code
==
1
){
return
'处理中'
;
}
else
if
(
code
==
2
||
code
==
4
){
return
'失败'
;
}
else
{
return
'失败'
;
}
}
else
{
return
'-'
;
}
},
returnStatusStyle
(
code
){
let
basic
=
'status-tj '
;
if
(
typeof
code
!=
'undefined'
){
if
(
code
==
0
||
code
==
3
){
basic
+=
'success'
;
}
else
if
(
code
==
1
){
basic
+=
'pending'
;
}
else
if
(
code
==
2
||
code
==
4
){
basic
+=
'fail'
;
}
else
{
basic
+=
'fail'
;
}
}
else
{
basic
+=
''
;
}
return
basic
;
}
},
}
</
script
>
<
style
lang=
"scss"
>
.msg-history-wrap
{
.el-form-item
.el-form-item__label
{
font-size
:
14px
;
}
.component-content
{
margin-top
:
60px
;
padding
:
10px
;
background
:
#fff
;
}
.pagination
{
margin
:
20px
0
;
text-align
:
right
;
}
.status-tj
{
&
.success
{
color
:
#409EFF
;
}
}
}
</
style
>
src/views/message/strategy-manage.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"strategy-manage-wrap"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<!-- 顶部输入框 -->
<div>
<el-form
label-width=
"80px"
style=
"overflow: hidden;"
>
<el-form-item
label=
"策略名称"
style=
"width: 300px; float: left;"
>
<el-input
v-model=
"stratetyRequest.name"
placeholder=
"请输入名称"
></el-input>
</el-form-item>
<el-button
type=
"primary"
style=
"margin-left: 50px;"
@
click=
"handleSearchClick"
>
搜索
</el-button>
</el-form>
</div>
<!-- 策略列表 -->
<div
class=
"table-wrap"
>
<el-button
type=
"primary"
style=
"float: right;"
@
click=
"handleCreateStrategy"
>
创建策略
</el-button>
<el-table
:data=
"tableData"
border
style=
"width: 100%; margin-top: 70px;"
>
<el-table-column
align=
"center"
prop=
"name"
label=
"策略名称"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"code"
label=
"策略编码"
>
<template
slot-scope=
"scope"
>
<span
:id=
"returnCopyClass(scope.$index)"
>
{{
scope
.
row
.
code
}}
</span>
<span
style=
"color: #409EFF; cursor:pointer;"
@
click=
"copyCode(scope.row.code, scope.$index)"
>
复制
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"APP系统推送"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click
.
native
.
prevent=
"editTemplate(scope)"
type=
"text"
>
{{
scope
&&
scope
.
row
&&
scope
.
row
.
templateCode
?
'编辑模板'
:
'新建模板'
}}
</el-button>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"修改时间"
>
<
template
slot-scope=
"scope"
>
{{
returnModifyTime
(
scope
.
row
.
modifyTime
)
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"modifyName"
label=
"操作人"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click
.
native
.
prevent=
"editRow(scope.$index, tableData)"
type=
"text"
>
编辑
</el-button>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"stratetyRequest.pageNo"
:page-sizes=
"[10, 30, 50, 100]"
:page-size=
"stratetyRequest.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalRows"
>
</el-pagination>
</div>
</div>
<!-- 创建/编辑策略 弹窗 -->
<el-dialog
:visible
.
sync=
"stragetyDialogVisible"
width=
"700px"
:close-on-click-modal=
"false"
@
close=
"handleCancelCreateOrEdit"
center
>
<el-form
:model=
"createOrEditRequest"
:rules=
"rules"
ref=
"createOrEditRequest"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"策略名称"
prop=
"name"
style=
"width: 600px;"
>
<el-input
type=
"text"
placeholder=
"请输入"
v-model=
"createOrEditRequest.name"
maxlength=
"30"
show-word-limit
>
</el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleCancelCreateOrEdit"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirmCreateOrEdit('createOrEditRequest')"
>
确 定
</el-button>
</span>
</el-dialog>
<!-- 新增/编辑模板 弹窗 -->
<el-dialog
class=
"template-modal-wrap"
title=
"APP推送"
:visible
.
sync=
"templateDialogVisible"
:close-on-click-modal=
"false"
width=
"800px"
@
close=
"handleCloseTemplateModal"
center
>
<el-form
:model=
"templateRuleForm"
:rules=
"templateRules"
ref=
"templateRuleForm"
label-width=
"120px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"APP"
prop=
"channel"
class=
"app-channel-item"
>
<el-radio-group
v-model=
"templateRuleForm.channel"
>
<el-radio
label=
"4"
>
云鹊医
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"APP接收窗口"
prop=
"parentPushType"
>
<el-radio-group
v-model=
"templateRuleForm.parentPushType"
>
<el-radio
label=
"01"
>
系统消息
</el-radio>
<el-radio
label=
"02"
>
居民管理
</el-radio>
<el-radio
label=
"03"
>
活动提醒
</el-radio>
<el-radio
label=
"04"
>
内容提醒
</el-radio>
<el-radio
label=
"05"
>
直播
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"系统通知"
prop=
"noticeFlag"
>
<el-radio-group
v-model=
"templateRuleForm.noticeFlag"
>
<el-radio
:label=
"2"
>
是
</el-radio>
<el-radio
:label=
"1"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
<!-- pushtype 4位数字,需写校验***************************************************************************** -->
<el-form-item
label=
"PushType"
prop=
"pushType"
style=
"width: 650px;"
>
<el-input
type=
"text"
placeholder=
"请输入"
v-model=
"templateRuleForm.pushType"
maxlength=
"4"
show-word-limit
>
</el-input>
<p
style=
"position: absolute; right:-70px; top: 0; color: #449284; cursor: pointer;"
@
click=
"showPushTypeRule(true)"
>
填写规则
</p>
</el-form-item>
<el-form-item
label=
"标题"
prop=
"title"
style=
"width: 650px;"
>
<el-input
type=
"text"
placeholder=
"请输入"
v-model=
"templateRuleForm.title"
maxlength=
"30"
show-word-limit
>
</el-input>
</el-form-item>
<el-form-item
label=
"摘要"
style=
"width: 650px;"
>
<el-input
type=
"textarea"
placeholder=
"请输入"
v-model=
"templateRuleForm.summary"
maxlength=
"60"
show-word-limit
>
</el-input>
</el-form-item>
<el-form-item
label=
"内容"
prop=
"content"
style=
"width: 650px;"
>
<el-input
type=
"textarea"
placeholder=
"请输入"
v-model=
"templateRuleForm.content"
maxlength=
"60"
show-word-limit
>
</el-input>
</el-form-item>
</el-form>
<div
class=
"bottom-tips"
>
变量占位符用%s标识
<span>
示例:您的管理者权限,已从【%s】更改至【%s】
</span></div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleCloseTemplateModal"
>
关闭
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm('templateRuleForm')"
>
确 认
</el-button>
</span>
</el-dialog>
<!-- 填写规则 弹窗 -->
<el-dialog
class=
"input-rule-wrap"
title=
"填写规则"
:visible
.
sync=
"inputRuleTableVisible"
:close-on-click-modal=
"false"
width=
"800px"
center
>
<el-table
:data=
"inputRuleTableData"
border
style=
"width: 100%; margin-top: 70px;"
>
<el-table-column
align=
"center"
label=
"系统提醒"
>
<
template
slot-scope=
"scope"
>
<span
:class=
"isCurrentExist(scope.row.activityTips, existPushTypeList) ? 'active' : 'not-active'"
>
{{
scope
.
row
.
activityTips
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"居民管理提醒"
>
<
template
slot-scope=
"scope"
>
<span
:class=
"isCurrentExist(scope.row.contentTips, existPushTypeList) ? 'active' : 'not-active'"
>
{{
scope
.
row
.
contentTips
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"活动提醒"
>
<
template
slot-scope=
"scope"
>
<span
:class=
"isCurrentExist(scope.row.patientsManager, existPushTypeList) ? 'active' : 'not-active'"
>
{{
scope
.
row
.
patientsManager
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"内容提醒"
>
<
template
slot-scope=
"scope"
>
<span
:class=
"isCurrentExist(scope.row.systemInfo, existPushTypeList) ? 'active' : 'not-active'"
>
{{
scope
.
row
.
systemInfo
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"直播提醒"
>
<
template
slot-scope=
"scope"
>
<span
:class=
"isCurrentExist(scope.row.liveVideo, existPushTypeList) ? 'active' : 'not-active'"
>
{{
scope
.
row
.
liveVideo
}}
</span>
</
template
>
</el-table-column>
</el-table>
<span
slot=
"footer"
class=
"dialog-footer"
>
<p
class=
"input-bottom-tips"
>
说明:01、02、03、04、05开头的编码分别表示消息落地的接收窗为:系统提醒、居民管理提醒、活动提醒、内容提醒、直播提醒,高亮的编码表示已经被使用的编码,黑色表示可以使用的编码
</p>
<!-- <el-button @click="inputRuleTableVisible = false">关闭</el-button>
<el-button type="primary">确 认</el-button> -->
<div
style=
"width:100%; height: 40px;"
></div>
</span>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
let
vm
=
null
;
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
export
default
{
components
:
{
BreadCrumb
,
},
data
()
{
var
checkPushType
=
(
rule
,
value
,
callback
)
=>
{
// debugger;
if
(
!
value
)
{
return
callback
(
new
Error
(
'PushType不能为空'
));
}
else
{
if
(
value
.
length
!=
4
){
// 必须长度为4
callback
(
new
Error
(
'必须是以 01/02/03/04/05 开头的四位纯数字'
));
}
else
{
let
arr
=
value
.
split
(
''
);
let
beginReg
=
/
[
1-5
]
/g
if
(
arr
[
0
]
!=
'0'
||
!
beginReg
.
test
(
parseInt
(
arr
[
1
])
)
){
// 判断是以01-05开头
callback
(
new
Error
(
'必须是以 01/02/03/04/05 开头的四位纯数字'
));
}
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
){
// 必须四位都是纯数字
let
reg
=
/
\d
/g
;
if
(
!
reg
.
test
(
parseInt
(
arr
[
i
])
)
){
callback
(
new
Error
(
'必须是以 01/02/03/04/05 开头的四位纯数字'
));
}
}
callback
();
}
}
};
return
{
curmbFirst
:
"策略管理"
,
tableData
:
[],
stragetyDialogVisible
:
false
,
// 创建/编辑 策略 请求参数
createOrEditRequest
:
{
name
:
''
,
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入策略名称'
,
trigger
:
'blur'
},
],
},
// 模板弹窗
templateDialogVisible
:
false
,
initTemplateRuleForm
:
{
channel
:
'4'
,
parentPushType
:
''
,
noticeFlag
:
''
,
pushType
:
''
,
title
:
''
,
summary
:
''
,
content
:
''
,
strategyId
:
null
,
//策略id
id
:
null
,
// 模板id
},
templateRuleForm
:
{
channel
:
'4'
,
parentPushType
:
''
,
noticeFlag
:
''
,
pushType
:
''
,
title
:
''
,
summary
:
''
,
content
:
''
,
strategyId
:
null
,
//策略id
id
:
null
,
// 模板id
},
// 分页
totalRows
:
0
,
templateRules
:
{
channel
:
[
{
required
:
true
,
message
:
'请选择APP'
,
trigger
:
'blur'
},
],
parentPushType
:
[
{
required
:
true
,
message
:
'请选择APP接收窗口'
,
trigger
:
'blur'
},
],
noticeFlag
:
[
{
required
:
true
,
message
:
'请选择系统通知'
,
trigger
:
'blur'
},
],
pushType
:
[
{
required
:
true
,
message
:
'请输入PushType值'
},
{
validator
:
checkPushType
}
],
title
:
[
{
required
:
true
,
message
:
'请填写标题'
,
trigger
:
'blur'
},
],
content
:
[
{
required
:
true
,
message
:
'请填写内容'
,
trigger
:
'blur'
},
],
},
stratetyRequest
:
{
// 策略列表 请求参数
pageNo
:
1
,
pageSize
:
10
,
name
:
''
,
},
isCreate
:
true
,
rowData
:
{},
inputRuleTableVisible
:
false
,
// 填写规则 弹窗
inputRuleTableData
:
[
// { //demo
// activityTips: 0100,
// contentTips: 0200,
// patientsManager: 0300,
// systemInfo: 0400,
// liveVideo: 0500,
// },
],
existPushTypeList
:
[],
// 已存在的 pushType list (高亮回显用)
}
},
created
()
{
vm
=
this
;
this
.
getStrategyList
();
},
methods
:
{
returnCopyClass
(
index
)
{
// console.log('>>>>>>>>>index ', index)
return
'copyCode_'
+
index
;
},
returnModifyTime
(
modifyTime
){
if
(
modifyTime
){
return
modifyTime
.
year
+
'-'
+
modifyTime
.
monthValue
+
'-'
+
modifyTime
.
dayOfMonth
;
}
else
{
return
'-'
;
}
},
handleCreateStrategy
()
{
this
.
isCreate
=
true
;
this
.
createOrEditRequest
.
name
=
''
;
// 清空input
this
.
stragetyDialogVisible
=
true
;
},
handleCancelCreateOrEdit
()
{
this
.
resetForm
(
'createOrEditRequest'
);
this
.
stragetyDialogVisible
=
false
},
handleSizeChange
(
val
){
this
.
stratetyRequest
.
pageSize
=
val
;
this
.
getStrategyList
();
},
handleCurrentChange
(
val
)
{
this
.
stratetyRequest
.
pageNo
=
val
;
this
.
getStrategyList
();
},
handleConfirmCreateOrEdit
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
req
=
{};
if
(
this
.
isCreate
==
true
){
// 创建策略时
req
=
{
bizCode
:
''
,
channel
:
''
,
code
:
''
,
name
:
this
.
createOrEditRequest
.
name
,
sysCode
:
''
,
templateCode
:
''
,
};
this
.
goToSaveStrategy
(
req
,
()
=>
{
this
.
getStrategyList
()
});
}
else
{
// 编辑时
req
.
id
=
this
.
rowData
.
id
;
req
.
name
=
this
.
createOrEditRequest
.
name
;
this
.
goToEditStrategy
(
req
,
()
=>
{
this
.
getStrategyList
()
})
}
this
.
stragetyDialogVisible
=
false
;
//
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
success
才关闭?????
// empty input value
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
// 创建 策略
goToSaveStrategy
(
req
,
cb
)
{
openLoading
(
this
);
this
.
POST
(
'raytheon/strategy/save'
,
req
).
then
((
res
)
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
)
{
// console.log('>>>>>> 新增 编辑 OK ', req)
cb
&&
cb
();
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
})
},
goToEditStrategy
(
req
,
cb
)
{
openLoading
(
this
);
this
.
POST
(
'raytheon/strategy/update'
,
req
).
then
((
res
)
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
)
{
// console.log('>>>>>> 新增 编辑 OK ', req)
cb
&&
cb
();
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
})
},
editRow
(
index
,
list
)
{
this
.
rowData
=
{};
this
.
isCreate
=
false
;
this
.
createOrEditRequest
.
name
=
list
[
index
].
name
;
this
.
stragetyDialogVisible
=
true
;
this
.
rowData
=
list
[
index
];
},
editTemplate
(
scope
)
{
this
.
templateRuleForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
initTemplateRuleForm
));
this
.
templateDialogVisible
=
true
;
// console.log('scope.row >>>> ', scope.row)
this
.
templateRuleForm
.
strategyId
=
scope
.
row
.
id
;
if
(
scope
.
row
.
templateCode
){
// 编辑,请求接口回显
let
req
=
{
templateCode
:
scope
.
row
.
templateCode
};
this
.
getTemplateDetail
(
req
);
}
else
{
// 新增
this
.
templateRuleForm
.
id
=
null
;
}
// 获取填写规则
this
.
getInputRuleData
();
},
// 搜索
handleSearchClick
()
{
this
.
stratetyRequest
.
pageNo
=
1
;
this
.
getStrategyList
();
},
// 复制功能
copyCode
(
code
,
index
)
{
let
elementID
=
'copyCode_'
+
index
;
var
text
=
document
.
getElementById
(
elementID
);
// debugger;
if
(
document
.
body
.
createTextRange
)
{
var
range
=
document
.
body
.
createTextRange
();
range
.
moveToElementText
(
text
);
range
.
select
();
}
else
if
(
window
.
getSelection
)
{
var
selection
=
window
.
getSelection
();
var
range
=
document
.
createRange
();
range
.
selectNodeContents
(
text
);
selection
.
removeAllRanges
();
selection
.
addRange
(
range
);
}
else
{
this
.
$message
({
message
:
'策略编码 复制失败'
,
type
:
'warning'
});
return
;
}
document
.
execCommand
(
'Copy'
);
this
.
$message
({
message
:
'策略编码 复制成功!'
,
type
:
'success'
});
},
// 获取 模板详细 回显
getTemplateDetail
(
req
)
{
openLoading
(
this
);
this
.
GET
(
"raytheon/msgTemplateInfo/getByCode"
,
req
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
// console.log('>>>>> g获取模板详细 ', res)
if
(
res
.
data
){
let
data
=
res
.
data
;
// 回显处理 其他key
// channel: 4,
// parentPushType: '',
// noticeFlag: '',
// pushType: '',
// title:'',
// summary: '',
// content: '',
// strategyId: null, //策略id
// id: null, // 模板id
this
.
templateRuleForm
.
channel
=
data
.
channel
;
this
.
templateRuleForm
.
parentPushType
=
data
.
parentPushType
;
this
.
templateRuleForm
.
noticeFlag
=
data
.
noticeFlag
;
this
.
templateRuleForm
.
pushType
=
data
.
pushType
;
this
.
templateRuleForm
.
title
=
data
.
title
;
this
.
templateRuleForm
.
summary
=
data
.
summary
;
this
.
templateRuleForm
.
content
=
data
.
content
;
this
.
templateRuleForm
.
id
=
data
.
id
;
}
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
// 获取 策略列表
getStrategyList
()
{
let
req
=
this
.
stratetyRequest
;
openLoading
(
this
);
this
.
GET
(
"raytheon/strategy/list"
,
req
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
// console.log('get 策略列表>>>>> ', res);
if
(
res
.
data
)
{
this
.
totalRows
=
res
.
data
.
total
;
}
if
(
res
.
data
&&
res
.
data
.
list
&&
res
.
data
.
list
.
length
>
0
){
this
.
tableData
=
res
.
data
.
list
;
}
else
{
this
.
tableData
=
[];
}
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
showPushTypeRule
(
status
)
{
// 计算出 table 列表
this
.
inputRuleTableVisible
=
true
;
},
getInputRuleData
()
{
let
tempArr
=
[];
for
(
let
i
=
0
;
i
<
100
;
i
++
)
{
// 行 0-99
let
index
=
i
<
10
?
'0'
+
i
:
i
;
let
obj
=
{
activityTips
:
'01'
+
index
,
contentTips
:
'02'
+
index
,
patientsManager
:
'03'
+
index
,
systemInfo
:
'04'
+
index
,
liveVideo
:
'05'
+
index
,
};
tempArr
.
push
(
obj
);
}
this
.
inputRuleTableData
=
tempArr
;
// 请求已存在的 pushType list
this
.
getExistPushTypeList
()
},
// 获取 策略列表
getExistPushTypeList
(
req
)
{
req
=
req
||
{};
openLoading
(
this
);
this
.
GET
(
"raytheon/msgTemplateInfo/pushTypelist"
,
req
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
if
(
res
.
data
&&
res
.
data
.
length
>
0
){
this
.
existPushTypeList
=
res
.
data
;
}
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
// 是否存在
isCurrentExist
(
item
,
arr
)
{
let
has
=
false
;
if
(
arr
&&
arr
.
length
>
0
){
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
){
if
(
arr
[
i
].
pushType
==
item
){
return
true
;
}
}
return
false
;
}
else
{
return
false
;
}
},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
req
=
this
.
templateRuleForm
;
this
.
goToSaveTemplate
(
req
,
()
=>
{
// 恢复 模板默认传参 && 关闭弹窗
this
.
templateRuleForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
initTemplateRuleForm
));
this
.
templateDialogVisible
=
false
;
this
.
getStrategyList
()
})
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
// 模板 保存
goToSaveTemplate
(
req
,
cb
)
{
openLoading
(
this
);
this
.
POST
(
'raytheon/msgTemplateInfo/save'
,
req
).
then
((
res
)
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
)
{
cb
&&
cb
();
}
else
{
this
.
$message
({
message
:
res
.
message
||
'接口请求失败'
,
type
:
'warning'
});
}
})
},
resetForm
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
();
},
handleCloseTemplateModal
()
{
this
.
resetForm
(
'templateRuleForm'
);
this
.
templateDialogVisible
=
false
;
}
}
}
</
script
>
<
style
lang=
"scss"
>
.strategy-manage-wrap
{
.pagination
{
margin
:
20px
0
;
text-align
:
right
;
}
.el-form-item
.el-form-item__label
{
font-size
:
14px
;
}
.component-content
{
margin-top
:
60px
;
padding
:
10px
;
background
:
#fff
;
}
.table-wrap
{
padding
:
0
80px
;
overflow
:
hidden
;
}
.template-modal-wrap
{
.el-dialog--center
{
margin-top
:
3vh
!
important
;
}
.el-dialog__header
{
text-align
:
left
;
}
.el-dialog__body
{
padding-top
:
0
;
padding-bottom
:
15px
;
.app-channel-item
{
margin-bottom
:
0
;
}
.el-textarea__inner
{
padding
:
5px
42px
5px
15px
;
}
}
}
.bottom-tips
{
text-indent
:
120px
;
margin-top
:
28px
;
span
{
color
:
#449284
;
margin-left
:
20px
;
}
}
.input-rule-wrap
{
.el-dialog--center
{
margin-top
:
3vh
!
important
;
}
.el-dialog__body
{
height
:
400px
;
overflow
:
hidden
;
overflow-y
:
scroll
;
padding-bottom
:
0
;
.el-table
{
margin-top
:
0
!
important
;
.el-table__row
{
.active
{
color
:
#409EFF
;
}
.not-active
{
color
:
#606266
;
}
}
}
}
.el-dialog__footer
{
.input-bottom-tips
{
color
:
red
;
text-align
:
left
;
margin
:
12px
0
;
}
}
}
}
</
style
>
\ No newline at end of file
src/views/protocol/create-protocol copy.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"create-push"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<div
class=
"header-title"
></div>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"ruleForm"
>
<el-form-item
label=
"协议标题"
prop=
"title"
>
<el-input
v-model=
"ruleForm.title"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
</el-form>
<!--
<el-dialog
title=
"推送预览"
:visible
.
sync=
"dialogFormVisible"
>
<div>
<span>
主题:
{{
ruleForm
.
title
}}
</span>
<p
style=
"display: inline-block; float: right;"
>
<span
style=
"margin-left: 0px"
>
目标对象:
</span>
<span
v-if=
"ruleForm.isAll == 2"
style=
"color: #449284"
>
{{
objNum
}}
</span>
<span
v-if=
"ruleForm.isAll == 3"
style=
"color: #449284"
>
{{
userChooseCount
}}
</span>
<span
v-else
>
全部
</span>
</p>
</div>
<hr>
<el-form
:model=
"ruleForm"
class=
"rule-form"
>
<el-form-item
label=
"APP推送:"
>
云鹊医
</el-form-item>
<el-form-item
label=
"推送标题:"
>
{{
ruleForm
.
title
}}
</el-form-item>
<el-form-item
label=
"推送介绍:"
>
<p
style=
"white-space: pre-line"
>
{{
ruleForm
.
content
}}
</p>
</el-form-item>
<el-form-item
label=
"页面去向:"
>
{{
ruleForm
.
url
}}
</el-form-item>
<el-form-item
label=
"系统通知:"
>
{{
ruleForm
.
noticeFlag
|
getNotice
}}
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"pushSend()"
>
确 定
</el-button>
</div>
</el-dialog>
-->
</div>
</div>
</
template
>
<
script
>
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
let
vm
=
null
;
export
default
{
components
:
{
BreadCrumb
},
data
()
{
return
{
curmbFirst
:
"创建APP推送"
,
ruleForm
:
{
title
:
""
,
content
:
""
,
},
};
},
computed
:
{
// ...mapGetters(["_token"])
},
created
()
{
vm
=
this
;
// vm.idType = localStorage.getItem("storageIdType");
// console.log("idType:", vm.idType);
},
// 挂载到Dom完成时
mounted
:
function
()
{
// commonUtil.resizeHeight();
},
methods
:
{
submitForm
(
formName
)
{
if
(
this
.
ruleForm
.
isAll
==
3
&&
this
.
userChooseCount
==
0
){
vm
.
$message
(
'请先选择用户'
);
return
;
}
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
// vm.pushSend();
if
(
vm
.
ruleForm
.
isAll
==
2
)
{
if
(
vm
.
fileName
==
''
)
{
vm
.
$message
(
'请先导入名单'
);
}
else
{
vm
.
dialogFormVisible
=
true
;
}
}
else
{
vm
.
dialogFormVisible
=
true
;
}
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
pushSend
()
{
let
req
=
{};
req
=
this
.
ruleForm
;
if
(
req
.
isAll
==
2
||
req
.
isAll
==
3
)
{
req
.
key
=
vm
.
sendKey
;
}
req
.
createdName
=
localStorage
.
getItem
(
'user_name'
);
// openLoading(vm);
vm
.
POST
(
"raytheon/push/send"
,
req
).
then
(
res
=>
{
// closeLoading(vm);
vm
.
$message
(
res
.
message
);
if
(
res
.
code
==
'000000'
)
{
vm
.
ruleForm
=
{
appId
:
"yunqueyi"
,
isAll
:
1
,
title
:
""
,
content
:
""
,
url
:
""
,
noticeFlag
:
2
,
pushType
:
'03'
,
};
}
});
vm
.
dialogFormVisible
=
false
;
vm
.
fileName
=
''
;
vm
.
sendKey
=
''
;
},
download
()
{
let
xlsxUrl
=
getExcel
();
console
.
log
(
'下载模板'
+
xlsxUrl
);
setTimeout
(()
=>
{
window
.
open
(
xlsxUrl
);
},
500
);
},
beforeUpload
(
file
)
{
// console.log(file);
let
self
=
this
;
const
isLt
=
file
.
size
/
1024
/
1024
<
10
;
if
(
!
isLt
)
{
this
.
$message
.
error
(
"文件大小不能超过10M"
);
return
;
}
else
{
vm
.
fileName
=
file
.
name
;
}
},
httpRequest
(
options
)
{
// console.log(options,options.file)
let
file
=
options
.
file
let
reader
=
new
FileReader
()
if
(
file
)
{
reader
.
readAsDataURL
(
file
)
}
reader
.
onload
=
(
e
)
=>
{
let
base64Str
=
e
.
target
.
result
.
split
(
','
)[
1
]
// console.log('e的值',e);
// let base64Str = e.target.result.substr(e.target.result.indexOf("base64,") + 7)
// vm.POST("raytheon/excel/upload", base64Str).then(res => {
// console.log(res);
// })
openLoading
(
vm
);
axios
({
headers
:
{
sysCode
:
12
,
token
:
localStorage
.
getItem
(
'storageToken'
),
'content-type'
:
'text/html'
},
url
:
getBaseUrl
(
'raytheon/excel/upload'
),
method
:
'post'
,
data
:
base64Str
,
}).
then
(
function
(
response
)
{
// console.log(response);
closeLoading
(
vm
);
vm
.
objNum
=
response
.
data
.
data
.
count
;
vm
.
sendKey
=
response
.
data
.
data
.
key
;
console
.
log
(
'vm.objNum '
,
vm
.
objNum
);
})
}
},
handleTargetChoose
()
{
if
(
this
.
ruleForm
.
isAll
==
3
){
// 初始化
this
.
isSeeUserNumBtnClicked
=
false
;
this
.
userChooseCount
=
0
;
this
.
allUserCount
=
0
;
this
.
userChooseForm
=
{
address
:
{
provinceList
:
[],
cityList
:
[],
countyList
:
[],
},
techTitleList
:
[],
hospitalLevelList
:
[],
};
this
.
finalChooseData
=
{
provinceId
:
''
,
cityId
:
''
,
countyId
:
''
,
doctorTitle
:
[],
hospitalLevel
:
[],
};
// 获取总数量
this
.
getCurrentUserCount
({
getAll
:
true
});
}
},
getCurrentUserCount
(
params
)
{
if
(
!
(
params
&&
params
.
getAll
)){
if
(
this
.
finalChooseData
.
provinceId
==
''
&&
this
.
finalChooseData
.
cityId
==
''
&&
this
.
finalChooseData
.
countyId
==
''
&&
this
.
finalChooseData
.
doctorTitle
.
length
==
0
&&
this
.
finalChooseData
.
hospitalLevel
.
length
==
0
){
this
.
isSeeUserNumBtnClicked
=
true
;
this
.
userChooseCount
=
0
;
return
;
}
}
openLoading
(
vm
,
'topIndex'
);
let
req
=
this
.
finalChooseData
;
vm
.
POST
(
"raytheon/push/screenUserCount"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
if
(
params
&&
params
.
getAll
){
this
.
allUserCount
=
res
.
data
;
}
else
{
this
.
isSeeUserNumBtnClicked
=
true
;
this
.
userChooseCount
=
res
.
data
;
}
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
showUserChooseModal
()
{
this
.
isUserChooseModalShow
=
true
;
this
.
getProvinceList
();
this
.
getTechTitleList
();
this
.
getHospitalLevelList
();
},
getProvinceList
()
{
let
req
=
{};
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
provinceList
=
res
.
data
.
provinceList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getCityList
(
params
)
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
params
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
cityList
=
res
.
data
.
cityList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getCountyList
(
params
)
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
params
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
countyList
=
res
.
data
.
countyList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
handleProvinceChange
(
id
)
{
this
.
finalChooseData
.
cityId
=
''
;
this
.
finalChooseData
.
countyId
=
''
;
// 清空省,则移除市、区列表
if
(
id
==
''
){
this
.
userChooseForm
.
address
.
cityList
=
[];
this
.
userChooseForm
.
address
.
countyList
=
[];
return
;
}
let
params
=
{
provinceId
:
id
};
this
.
getCityList
(
params
);
// this.getCurrentUserCount();
},
handleCityChange
(
id
)
{
this
.
finalChooseData
.
countyId
=
''
;
// 清空市,则移除区列表
if
(
id
==
''
){
this
.
userChooseForm
.
address
.
countyList
=
[];
return
;
}
let
params
=
{
cityId
:
id
};
this
.
getCountyList
(
params
);
// this.getCurrentUserCount();
},
handleCountyChange
()
{
// this.getCurrentUserCount();
},
handleDoctorTitleChange
()
{
// this.getCurrentUserCount();
},
handleHospitalLevelChange
()
{
// this.getCurrentUserCount();
},
getTechTitleList
()
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/doctor/title"
,
{}).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
techTitleList
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getHospitalLevelList
()
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/hospital/level"
,
{}).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
hospitalLevelList
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
// 确认筛选
handleChooseSubmit
()
{
this
.
getCurrentUserCount
();
openLoading
(
vm
);
vm
.
sendKey
=
''
;
let
req
=
this
.
finalChooseData
;
vm
.
POST
(
"raytheon/push/screenUser"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
vm
.
isUserChooseModalShow
=
false
;
vm
.
sendKey
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
}
};
</
script
>
<
style
lang=
"scss"
>
.topIndex
{
z-index
:
10000
!
important
;
}
.create-push
{
.component-content
{
margin-top
:
20px
;
padding
:
10px
;
background
:
#fff
;
.header-title
{
padding
:
10px
12px
;
font-size
:
12px
;
color
:
#449284
;
border-bottom
:
1px
solid
#efefef
;
}
.ruleForm
{
width
:
70%
;
margin-left
:
50px
;
}
.rule-form
{
margin-top
:
20px
;
margin-left
:
30px
;
.el-form-item__content
{
font-size
:
12px
;
}
}
.update-input
{
width
:
200px
;
}
.update-item
{
/* float: left; */
margin-right
:
5px
;
}
.el-upload__tip
{
// margin-top: -10px;
// margin-left: 205px;
margin-top
:
-40px
;
margin-left
:
290px
;
cursor
:
pointer
;
width
:
60px
;
color
:
#449284
;
}
.tip-text
{
margin-top
:
-40px
;
margin-left
:
380px
;
width
:
260px
;
color
:
red
;
}
.el-upload-list
{
display
:
none
;
}
.table-empty
{
img
{
width
:
100px
;
}
p
{
margin-top
:
-50px
;
}
}
.user-select
{
display
:
inline-block
;
height
:
auto
;
padding
:
5px
10px
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
.select-btn
{
display
:
inline-block
;
font-size
:
14px
;
padding
:
5px
;
border-radius
:
4px
;
background
:
#449284
!
important
;
border
:
1px
solid
#449284
!
important
;
color
:
#FFF
;
cursor
:
pointer
;
}
.numbers
{
font-size
:
14px
;
margin-left
:
10px
;
display
:
inline-block
;
.choosed
{
color
:
#449284
;
}
}
}
.user-choose-modal
{
.el-form-item__label
{
width
:
120px
;
font-size
:
14px
;
}
.select-choose
{
width
:
150px
;
}
.block-item
{
display
:
block
;
}
.user-number
{
margin
:
40px
auto
0
;
text-align
:
center
;
width
:
70%
;
height
:
34px
;
line-height
:
34px
;
border-radius
:
4px
;
border
:
1px
solid
#DCDFE6
;
.title
{
display
:
inline-block
;
}
.number
{
display
:
inline-block
;
margin-left
:
50px
;
.target-num
{
padding
:
7px
;
}
.choosed
{
color
:
#449284
;
}
}
}
.click-refresh-tips
{
text-align
:
center
;
margin
:
5px
auto
20px
;
height
:
20px
;
color
:
#e6a23c
;
}
.user-choose-submit
{
margin
:
0
auto
;
display
:
block
;
}
}
}
}
</
style
>
\ No newline at end of file
src/views/protocol/protocol-detail copy 2.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"create-protocol"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<!--
<div
class=
"header-title"
></div>
-->
<el-form
:model=
"ruleForm"
ref=
"ruleForm"
label-width=
"100px"
class=
"ruleForm"
>
<el-form-item>
<el-button
size=
"small"
class=
"user-choose-submit right"
style=
"margin-left:20px;"
type=
"default"
@
click=
"goBack()"
>
返回
</el-button>
</el-form-item>
<el-form-item
label=
"协议标题"
>
{{
ruleForm
.
protocolName
}}
</el-form-item>
<el-form-item
label=
"协议内容"
>
<div
v-html=
"ruleForm.content"
></div>
<!--
<textarea
v-model=
"ruleForm.content"
id=
"detailEditor"
>
</textarea>
-->
</el-form-item>
<el-form-item
label=
"签署居民数量"
>
{{
ruleForm
.
signNum
}}
</el-form-item>
<el-form-item
label=
"创建人"
>
{{
ruleForm
.
createdName
}}
</el-form-item>
<el-form-item
label=
"创建时间"
>
{{
ruleForm
.
createTime
}}
</el-form-item>
</el-form>
</div>
</div>
</
template
>
<
script
>
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
let
detailEditor
=
null
;
let
vm
=
null
;
export
default
{
components
:
{
BreadCrumb
},
data
()
{
return
{
curmbFirst
:
'查看协议'
,
ruleForm
:
{
protocolName
:
''
,
content
:
''
,
signNum
:
''
,
createdName
:
''
,
createTime
:
''
,
},
isUpdate
:
false
,
protocolId
:
0
};
},
computed
:
{
// ...mapGetters(['_token'])
},
created
()
{
vm
=
this
;
this
.
isUpdate
=
this
.
$route
.
query
&&
this
.
$route
.
query
.
isUpdate
||
this
.
isUpdate
;
this
.
protocolId
=
this
.
$route
.
query
&&
this
.
$route
.
query
.
protocolId
||
0
;
// vm.idType = localStorage.getItem("storageIdType");
// console.log("idType:", vm.idType);
},
// 挂载到Dom完成时
mounted
:
function
()
{
vm
.
getProtocolDetailById
(
vm
.
protocolId
);
// commonUtil.resizeHeight();
// CKEDITOR.replace( 'detailEditor' );
// if(this.isUpdate) { // 只在修改时监听富文本的Ready事件
// CKEDITOR.on('instanceReady', function (event) {
// detailEditor = event.editor;
// detailEditor.execCommand("toolbarCollapse");
// detailEditor.setReadOnly(true); //只读
// // 获取数据
// vm.getProtocolDetailById(vm.protocolId);
// });
// }
},
methods
:
{
// 根据协议ID获取协议详情
getProtocolDetailById
(
protocolId
)
{
vm
.
GET
(
"/smartcontract/protocolManage/protocol"
,
{
protocolId
:
protocolId
}).
then
(
res
=>
{
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
if
(
res
&&
res
.
data
){
vm
.
ruleForm
.
protocolName
=
res
.
data
.
protocolName
;
vm
.
ruleForm
.
content
=
res
.
data
.
contents
;
vm
.
ruleForm
.
signNum
=
res
.
data
.
signNum
;
vm
.
ruleForm
.
createdName
=
res
.
data
.
createdName
;
vm
.
ruleForm
.
createTime
=
res
.
data
.
createTime
;
detailEditor
.
setData
(
res
.
data
.
contents
);
}
}
else
{
vm
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
goBack
()
{
this
.
$router
.
push
({
path
:
'/protocol-list'
})
}
},
};
</
script
>
<
style
lang=
"scss"
>
.topIndex
{
z-index
:
10000
!
important
;
}
.create-protocol
{
.component-content
{
margin-top
:
80px
;
padding
:
10px
;
background
:
#fff
;
.header-title
{
padding
:
10px
12px
;
font-size
:
12px
;
color
:
#449284
;
border-bottom
:
1px
solid
#efefef
;
}
.ruleForm
{
width
:
70%
;
margin-left
:
50px
;
}
.rule-form
{
margin-top
:
20px
;
margin-left
:
30px
;
.el-form-item__content
{
font-size
:
12px
;
}
}
.update-input
{
width
:
200px
;
}
.update-item
{
/* float: left; */
margin-right
:
5px
;
}
.el-upload__tip
{
// margin-top: -10px;
// margin-left: 205px;
margin-top
:
-40px
;
margin-left
:
290px
;
cursor
:
pointer
;
width
:
60px
;
color
:
#449284
;
}
.tip-text
{
margin-top
:
-40px
;
margin-left
:
380px
;
width
:
260px
;
color
:
red
;
}
.el-upload-list
{
display
:
none
;
}
.table-empty
{
img
{
width
:
100px
;
}
p
{
margin-top
:
-50px
;
}
}
.user-select
{
display
:
inline-block
;
height
:
auto
;
padding
:
5px
10px
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
.select-btn
{
display
:
inline-block
;
font-size
:
14px
;
padding
:
5px
;
border-radius
:
4px
;
background
:
#449284
!
important
;
border
:
1px
solid
#449284
!
important
;
color
:
#FFF
;
cursor
:
pointer
;
}
.numbers
{
font-size
:
14px
;
margin-left
:
10px
;
display
:
inline-block
;
.choosed
{
color
:
#449284
;
}
}
}
.user-choose-modal
{
.el-form-item__label
{
width
:
120px
;
font-size
:
14px
;
}
.select-choose
{
width
:
150px
;
}
.block-item
{
display
:
block
;
}
.user-number
{
margin
:
40px
auto
0
;
text-align
:
center
;
width
:
70%
;
height
:
34px
;
line-height
:
34px
;
border-radius
:
4px
;
border
:
1px
solid
#DCDFE6
;
.title
{
display
:
inline-block
;
}
.number
{
display
:
inline-block
;
margin-left
:
50px
;
.target-num
{
padding
:
7px
;
}
.choosed
{
color
:
#449284
;
}
}
}
.click-refresh-tips
{
text-align
:
center
;
margin
:
5px
auto
20px
;
height
:
20px
;
color
:
#e6a23c
;
}
.user-choose-submit
{
margin
:
0
auto
;
display
:
block
;
}
}
}
}
.valid-content
{
color
:
#F56C6C
;
font-size
:
12px
;
line-height
:
26px
;
}
</
style
>
\ No newline at end of file
src/views/protocol/protocol-detail copy.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"create-push"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<div
class=
"header-title"
></div>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"ruleForm"
>
<el-form-item
label=
"推送应用"
prop=
"resource"
>
<el-radio-group
v-model=
"ruleForm.appId"
>
<el-radio
label=
"yunqueyi"
>
云鹊医app
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"目标人群"
prop=
"people"
>
<el-col
:span=
"24"
>
<el-radio-group
v-model=
"ruleForm.isAll"
@
change=
"handleTargetChoose"
>
<el-radio
:label=
"1"
>
全部
</el-radio>
<el-radio
:label=
"2"
>
导入推送名单
</el-radio>
<el-radio
:label=
"3"
>
用户筛选
</el-radio>
<div
class=
"user-select"
v-if=
"ruleForm.isAll == 3"
>
<div
class=
"select-btn"
@
click=
"showUserChooseModal"
>
选择用户名单
</div>
<div
class=
"numbers"
><span
class=
"choosed"
>
{{
userChooseCount
}}
</span>
|
{{
allUserCount
}}
</div>
</div>
</el-radio-group>
</el-col>
<!--
<el-col
:span=
"14"
>
<el-upload
v-if=
"ruleForm.isAll == 2"
class=
"upload-demo"
accept=
".xlsx"
:action=
"actionUrl"
:headers =
"headers"
v-model=
"fileName"
:http-request=
"httpRequest"
:before-upload=
"beforeUpload"
:disabled=
"ruleForm.isAll == 1"
>
<el-input
class=
"update-input"
placeholder=
"文件大小不能超过10M"
:disabled=
"true"
v-model=
"fileName"
autocomplete=
"off"
></el-input>
<el-button
class=
"update-item"
size=
"small"
type=
"primary"
>
选择文件
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
@
click=
"download"
>
模板.xlsx
</div>
<div
slot=
"tip"
class=
"tip-text"
>
备注:单次任务建议不要超过10w行
</div>
</el-upload>
</el-col>
-->
</el-form-item>
<el-form-item
label=
""
>
<el-upload
v-if=
"ruleForm.isAll == 2"
class=
"upload-demo"
accept=
".xlsx"
:action=
"actionUrl"
:headers =
"headers"
v-model=
"fileName"
:http-request=
"httpRequest"
:before-upload=
"beforeUpload"
:disabled=
"ruleForm.isAll == 1"
>
<el-input
class=
"update-input"
placeholder=
"文件大小不能超过10M"
:disabled=
"true"
v-model=
"fileName"
autocomplete=
"off"
></el-input>
<el-button
class=
"update-item"
size=
"small"
type=
"primary"
>
选择文件
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
@
click=
"download"
>
模板.xlsx
</div>
<div
slot=
"tip"
class=
"tip-text"
>
备注:单次任务建议不要超过10w行
</div>
</el-upload>
</el-form-item>
<el-form-item
label=
"推送标题"
prop=
"title"
>
<el-input
v-model=
"ruleForm.title"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"推送介绍"
prop=
"content"
>
<el-input
type=
"textarea"
maxlength=
"60"
:rows=
"3"
v-model=
"ruleForm.content"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"页面去向"
prop=
"url"
>
<el-input
type=
"textarea"
:rows=
"3"
v-model=
"ruleForm.url"
maxlength=
"250"
placeholder=
"H5链接"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"系统通知"
prop=
"noticeFlag"
>
<el-radio-group
v-model=
"ruleForm.noticeFlag"
>
<el-radio
:label=
"2"
>
是
</el-radio>
<el-radio
:label=
"1"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"APP接收窗口"
prop=
"pushType"
>
<el-radio-group
v-model=
"ruleForm.pushType"
>
<el-radio
label=
"03"
>
活动提醒
</el-radio>
<el-radio
label=
"04"
>
内容提醒
</el-radio>
<el-radio
label=
"02"
>
居民管理
</el-radio>
<el-radio
label=
"01"
>
系统消息
</el-radio>
<el-radio
label=
"05"
>
直播
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
>
提交预览
</el-button>
</el-form-item>
</el-form>
<el-dialog
title=
"推送预览"
:visible
.
sync=
"dialogFormVisible"
>
<div>
<span>
主题:
{{
ruleForm
.
title
}}
</span>
<p
style=
"display: inline-block; float: right;"
>
<span
style=
"margin-left: 0px"
>
目标对象:
</span>
<span
v-if=
"ruleForm.isAll == 2"
style=
"color: #449284"
>
{{
objNum
}}
</span>
<span
v-if=
"ruleForm.isAll == 3"
style=
"color: #449284"
>
{{
userChooseCount
}}
</span>
<span
v-else
>
全部
</span>
</p>
</div>
<hr>
<el-form
:model=
"ruleForm"
class=
"rule-form"
>
<el-form-item
label=
"APP推送:"
>
云鹊医
</el-form-item>
<el-form-item
label=
"推送标题:"
>
{{
ruleForm
.
title
}}
</el-form-item>
<el-form-item
label=
"推送介绍:"
>
<p
style=
"white-space: pre-line"
>
{{
ruleForm
.
content
}}
</p>
</el-form-item>
<!--
<p
style=
"white-space: pre-line"
>
{{
ruleForm
.
content
}}
</p>
-->
<el-form-item
label=
"页面去向:"
>
{{
ruleForm
.
url
}}
</el-form-item>
<el-form-item
label=
"系统通知:"
>
{{
ruleForm
.
noticeFlag
|
getNotice
}}
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"pushSend()"
>
确 定
</el-button>
</div>
</el-dialog>
<el-dialog
title=
"用户筛选"
:visible
.
sync=
"isUserChooseModalShow"
class=
"user-choose-modal"
>
<el-form
:inline=
"true"
:model=
"userChooseForm"
>
<el-form-item
label=
"行政区划:"
>
<el-select
class=
"select-choose"
v-model=
"finalChooseData.provinceId"
placeholder=
"省"
@
change=
"handleProvinceChange(finalChooseData.provinceId)"
clearable
>
<el-option
v-for=
"item in userChooseForm.address.provinceList"
:key=
"item.provinceId"
:label=
"item.provinceName"
:value=
"item.provinceId"
>
</el-option>
</el-select>
<el-select
class=
"select-choose"
v-model=
"finalChooseData.cityId"
placeholder=
"市"
@
change=
"handleCityChange(finalChooseData.cityId)"
clearable
>
<el-option
v-for=
"item in userChooseForm.address.cityList"
:key=
"item.cityId"
:label=
"item.cityName"
:value=
"item.cityId"
>
</el-option>
</el-select>
<el-select
class=
"select-choose"
v-model=
"finalChooseData.countyId"
placeholder=
"区"
@
change=
"handleCountyChange"
clearable
>
<el-option
v-for=
"item in userChooseForm.address.countyList"
:key=
"item.countyId"
:label=
"item.countyName"
:value=
"item.countyId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"技术职称:"
class=
"block-item"
>
<el-select
v-model=
"finalChooseData.doctorTitle"
multiple
placeholder=
"不限"
@
change=
"handleDoctorTitleChange"
>
<el-option
v-for=
"item in userChooseForm.techTitleList"
:key=
"item.titleId"
:label=
"item.name"
:value=
"item.titleId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"所属机构等级:"
class=
"block-item"
>
<el-select
v-model=
"finalChooseData.hospitalLevel"
multiple
placeholder=
"不限"
@
change=
"handleHospitalLevelChange"
>
<el-option
v-for=
"item in userChooseForm.hospitalLevelList"
:key=
"item.no"
:label=
"item.value"
:value=
"item.no"
>
</el-option>
</el-select>
</el-form-item>
<div
class=
"user-number"
>
<p
class=
"title"
>
目标用户 | 用户总量
</p>
<p
class=
"number"
>
<el-button
v-if=
"!isSeeUserNumBtnClicked"
class=
"target-num"
type=
"primary"
@
click=
"getCurrentUserCount"
size=
"mini"
>
查看目标数
</el-button>
<template
v-else
>
<span
class=
"choosed"
>
{{
userChooseCount
}}
</span>
<el-button
class=
"target-num"
type=
"primary"
@
click=
"getCurrentUserCount"
size=
"mini"
>
刷新目标数
</el-button>
</
template
>
| {{allUserCount}}
</p>
</div>
<p
class=
"click-refresh-tips"
>
<
template
v-if=
"isSeeUserNumBtnClicked"
>
筛选条件变更后,需重新点击"刷新目标数"按钮获取最新数据
</
template
></p>
<el-button
class=
"user-choose-submit"
type=
"primary"
@
click=
"handleChooseSubmit"
>
确认筛选
</el-button>
</el-form>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
{
create
}
from
"domain"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
*
as
commonUtil
from
"../../utils/utils"
;
import
axios
from
'axios'
;
import
{
getBaseUrl
,
getExcel
}
from
'@/utils/index'
;
let
vm
=
null
;
export
default
{
components
:
{
BreadCrumb
},
data
()
{
return
{
// curmbFirst: "APP推送",
// curmbSecond: "创建APP推送",
curmbFirst
:
"创建APP推送"
,
ruleForm
:
{
appId
:
"yunqueyi"
,
isAll
:
1
,
title
:
""
,
content
:
""
,
url
:
""
,
noticeFlag
:
2
,
pushType
:
'03'
,
},
actionUrl
:
getBaseUrl
(
'raytheon/excel/upload'
),
fileName
:
''
,
objNum
:
0
,
sendKey
:
''
,
dialogFormVisible
:
false
,
headers
:
{
sysCode
:
12
,
token
:
localStorage
.
getItem
(
'storageToken'
),
},
rules
:
{
appId
:
[
{
required
:
true
,
message
:
"请选择推送应用"
,
trigger
:
"change"
}
],
title
:
[
{
required
:
true
,
message
:
"请输入推送标题"
,
trigger
:
"blur"
},
{
min
:
0
,
max
:
30
,
message
:
"长度在 0 到 30 个字符"
,
trigger
:
"blur"
}
],
content
:
[
{
required
:
true
,
message
:
"请输入推送介绍"
,
trigger
:
"blur"
},
{
min
:
0
,
max
:
250
,
message
:
"长度在 0 到 250 个字符"
,
trigger
:
"blur"
}
]
},
isUserChooseModalShow
:
false
,
userChooseCount
:
0
,
// 用户筛选的最终num
allUserCount
:
0
,
// 总num
userChooseForm
:
{
address
:
{
provinceList
:
[],
cityList
:
[],
countyList
:
[],
},
techTitleList
:
[],
hospitalLevelList
:
[],
},
finalChooseData
:
{
provinceId
:
''
,
cityId
:
''
,
countyId
:
''
,
doctorTitle
:
[],
hospitalLevel
:
[],
},
isSeeUserNumBtnClicked
:
false
,
};
},
computed
:
{
...
mapGetters
([
"_token"
])
},
created
()
{
vm
=
this
;
vm
.
idType
=
localStorage
.
getItem
(
"storageIdType"
);
console
.
log
(
"idType:"
,
vm
.
idType
);
},
// 挂载到Dom完成时
mounted
:
function
()
{
// commonUtil.resizeHeight();
},
methods
:
{
submitForm
(
formName
)
{
if
(
this
.
ruleForm
.
isAll
==
3
&&
this
.
userChooseCount
==
0
){
vm
.
$message
(
'请先选择用户'
);
return
;
}
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
// vm.pushSend();
if
(
vm
.
ruleForm
.
isAll
==
2
)
{
if
(
vm
.
fileName
==
''
)
{
vm
.
$message
(
'请先导入名单'
);
}
else
{
vm
.
dialogFormVisible
=
true
;
}
}
else
{
vm
.
dialogFormVisible
=
true
;
}
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
pushSend
()
{
let
req
=
{};
req
=
this
.
ruleForm
;
if
(
req
.
isAll
==
2
||
req
.
isAll
==
3
)
{
req
.
key
=
vm
.
sendKey
;
}
req
.
createdName
=
localStorage
.
getItem
(
'user_name'
);
// openLoading(vm);
vm
.
POST
(
"raytheon/push/send"
,
req
).
then
(
res
=>
{
// closeLoading(vm);
vm
.
$message
(
res
.
message
);
if
(
res
.
code
==
'000000'
)
{
vm
.
ruleForm
=
{
appId
:
"yunqueyi"
,
isAll
:
1
,
title
:
""
,
content
:
""
,
url
:
""
,
noticeFlag
:
2
,
pushType
:
'03'
,
};
}
});
vm
.
dialogFormVisible
=
false
;
vm
.
fileName
=
''
;
vm
.
sendKey
=
''
;
},
download
()
{
let
xlsxUrl
=
getExcel
();
console
.
log
(
'下载模板'
+
xlsxUrl
);
setTimeout
(()
=>
{
window
.
open
(
xlsxUrl
);
},
500
);
},
beforeUpload
(
file
)
{
// console.log(file);
let
self
=
this
;
const
isLt
=
file
.
size
/
1024
/
1024
<
10
;
if
(
!
isLt
)
{
this
.
$message
.
error
(
"文件大小不能超过10M"
);
return
;
}
else
{
vm
.
fileName
=
file
.
name
;
}
},
httpRequest
(
options
)
{
// console.log(options,options.file)
let
file
=
options
.
file
let
reader
=
new
FileReader
()
if
(
file
)
{
reader
.
readAsDataURL
(
file
)
}
reader
.
onload
=
(
e
)
=>
{
let
base64Str
=
e
.
target
.
result
.
split
(
','
)[
1
]
// console.log('e的值',e);
// let base64Str = e.target.result.substr(e.target.result.indexOf("base64,") + 7)
// vm.POST("raytheon/excel/upload", base64Str).then(res => {
// console.log(res);
// })
openLoading
(
vm
);
axios
({
headers
:
{
sysCode
:
12
,
token
:
localStorage
.
getItem
(
'storageToken'
),
'content-type'
:
'text/html'
},
url
:
getBaseUrl
(
'raytheon/excel/upload'
),
method
:
'post'
,
data
:
base64Str
,
}).
then
(
function
(
response
)
{
// console.log(response);
closeLoading
(
vm
);
vm
.
objNum
=
response
.
data
.
data
.
count
;
vm
.
sendKey
=
response
.
data
.
data
.
key
;
console
.
log
(
'vm.objNum '
,
vm
.
objNum
);
})
}
},
handleTargetChoose
()
{
if
(
this
.
ruleForm
.
isAll
==
3
){
// 初始化
this
.
isSeeUserNumBtnClicked
=
false
;
this
.
userChooseCount
=
0
;
this
.
allUserCount
=
0
;
this
.
userChooseForm
=
{
address
:
{
provinceList
:
[],
cityList
:
[],
countyList
:
[],
},
techTitleList
:
[],
hospitalLevelList
:
[],
};
this
.
finalChooseData
=
{
provinceId
:
''
,
cityId
:
''
,
countyId
:
''
,
doctorTitle
:
[],
hospitalLevel
:
[],
};
// 获取总数量
this
.
getCurrentUserCount
({
getAll
:
true
});
}
},
getCurrentUserCount
(
params
)
{
if
(
!
(
params
&&
params
.
getAll
)){
if
(
this
.
finalChooseData
.
provinceId
==
''
&&
this
.
finalChooseData
.
cityId
==
''
&&
this
.
finalChooseData
.
countyId
==
''
&&
this
.
finalChooseData
.
doctorTitle
.
length
==
0
&&
this
.
finalChooseData
.
hospitalLevel
.
length
==
0
){
this
.
isSeeUserNumBtnClicked
=
true
;
this
.
userChooseCount
=
0
;
return
;
}
}
openLoading
(
vm
,
'topIndex'
);
let
req
=
this
.
finalChooseData
;
vm
.
POST
(
"raytheon/push/screenUserCount"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
if
(
params
&&
params
.
getAll
){
this
.
allUserCount
=
res
.
data
;
}
else
{
this
.
isSeeUserNumBtnClicked
=
true
;
this
.
userChooseCount
=
res
.
data
;
}
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
showUserChooseModal
()
{
this
.
isUserChooseModalShow
=
true
;
this
.
getProvinceList
();
this
.
getTechTitleList
();
this
.
getHospitalLevelList
();
},
getProvinceList
()
{
let
req
=
{};
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
provinceList
=
res
.
data
.
provinceList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getCityList
(
params
)
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
params
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
cityList
=
res
.
data
.
cityList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getCountyList
(
params
)
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/region"
,
params
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
address
.
countyList
=
res
.
data
.
countyList
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
handleProvinceChange
(
id
)
{
this
.
finalChooseData
.
cityId
=
''
;
this
.
finalChooseData
.
countyId
=
''
;
// 清空省,则移除市、区列表
if
(
id
==
''
){
this
.
userChooseForm
.
address
.
cityList
=
[];
this
.
userChooseForm
.
address
.
countyList
=
[];
return
;
}
let
params
=
{
provinceId
:
id
};
this
.
getCityList
(
params
);
// this.getCurrentUserCount();
},
handleCityChange
(
id
)
{
this
.
finalChooseData
.
countyId
=
''
;
// 清空市,则移除区列表
if
(
id
==
''
){
this
.
userChooseForm
.
address
.
countyList
=
[];
return
;
}
let
params
=
{
cityId
:
id
};
this
.
getCountyList
(
params
);
// this.getCurrentUserCount();
},
handleCountyChange
()
{
// this.getCurrentUserCount();
},
handleDoctorTitleChange
()
{
// this.getCurrentUserCount();
},
handleHospitalLevelChange
()
{
// this.getCurrentUserCount();
},
getTechTitleList
()
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/doctor/title"
,
{}).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
techTitleList
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
getHospitalLevelList
()
{
openLoading
(
vm
);
vm
.
GET
(
"raytheon/constants/hospital/level"
,
{}).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
this
.
userChooseForm
.
hospitalLevelList
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
// 确认筛选
handleChooseSubmit
()
{
this
.
getCurrentUserCount
();
openLoading
(
vm
);
vm
.
sendKey
=
''
;
let
req
=
this
.
finalChooseData
;
vm
.
POST
(
"raytheon/push/screenUser"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
){
vm
.
isUserChooseModalShow
=
false
;
vm
.
sendKey
=
res
.
data
;
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
});
},
}
};
</
script
>
<
style
lang=
"scss"
>
.topIndex
{
z-index
:
10000
!
important
;
}
.create-push
{
.component-content
{
margin-top
:
20px
;
padding
:
10px
;
background
:
#fff
;
.header-title
{
padding
:
10px
12px
;
font-size
:
12px
;
color
:
#449284
;
border-bottom
:
1px
solid
#efefef
;
}
.ruleForm
{
width
:
70%
;
margin-left
:
50px
;
}
.rule-form
{
margin-top
:
20px
;
margin-left
:
30px
;
.el-form-item__content
{
font-size
:
12px
;
}
}
.update-input
{
width
:
200px
;
}
.update-item
{
/* float: left; */
margin-right
:
5px
;
}
.el-upload__tip
{
// margin-top: -10px;
// margin-left: 205px;
margin-top
:
-40px
;
margin-left
:
290px
;
cursor
:
pointer
;
width
:
60px
;
color
:
#449284
;
}
.tip-text
{
margin-top
:
-40px
;
margin-left
:
380px
;
width
:
260px
;
color
:
red
;
}
.el-upload-list
{
display
:
none
;
}
.table-empty
{
img
{
width
:
100px
;
}
p
{
margin-top
:
-50px
;
}
}
.user-select
{
display
:
inline-block
;
height
:
auto
;
padding
:
5px
10px
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
.select-btn
{
display
:
inline-block
;
font-size
:
14px
;
padding
:
5px
;
border-radius
:
4px
;
background
:
#449284
!
important
;
border
:
1px
solid
#449284
!
important
;
color
:
#FFF
;
cursor
:
pointer
;
}
.numbers
{
font-size
:
14px
;
margin-left
:
10px
;
display
:
inline-block
;
.choosed
{
color
:
#449284
;
}
}
}
.user-choose-modal
{
.el-form-item__label
{
width
:
120px
;
font-size
:
14px
;
}
.select-choose
{
width
:
150px
;
}
.block-item
{
display
:
block
;
}
.user-number
{
margin
:
40px
auto
0
;
text-align
:
center
;
width
:
70%
;
height
:
34px
;
line-height
:
34px
;
border-radius
:
4px
;
border
:
1px
solid
#DCDFE6
;
.title
{
display
:
inline-block
;
}
.number
{
display
:
inline-block
;
margin-left
:
50px
;
.target-num
{
padding
:
7px
;
}
.choosed
{
color
:
#449284
;
}
}
}
.click-refresh-tips
{
text-align
:
center
;
margin
:
5px
auto
20px
;
height
:
20px
;
color
:
#e6a23c
;
}
.user-choose-submit
{
margin
:
0
auto
;
display
:
block
;
}
}
}
}
</
style
>
\ No newline at end of file
src/views/protocol/protocol-detail.vue
浏览文件 @
79492c8b
...
@@ -17,9 +17,12 @@
...
@@ -17,9 +17,12 @@
<!--
<el-input
v-model=
"ruleForm.protocolName"
maxlength=
"30"
show-word-limit
></el-input>
-->
<!--
<el-input
v-model=
"ruleForm.protocolName"
maxlength=
"30"
show-word-limit
></el-input>
-->
</el-form-item>
</el-form-item>
<el-form-item
label=
"协议内容"
>
<el-form-item
label=
"协议内容"
>
<textarea
v-model=
"ruleForm.content"
id=
"detailEditor"
>
<
!--
<
textarea
v-model=
"ruleForm.content"
id=
"detailEditor"
>
</textarea>
</textarea>
-->
<div
style=
"width:375px;"
v-html=
"ruleForm.content"
>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"签署居民数量"
>
<el-form-item
label=
"签署居民数量"
>
<el-input
size=
"small"
v-model=
"ruleForm.signNum"
maxlength=
"50"
disabled
style=
"widht:200px;"
show-word-limit
></el-input>
<el-input
size=
"small"
v-model=
"ruleForm.signNum"
maxlength=
"50"
disabled
style=
"widht:200px;"
show-word-limit
></el-input>
...
@@ -69,17 +72,18 @@ export default {
...
@@ -69,17 +72,18 @@ export default {
},
},
// 挂载到Dom完成时
// 挂载到Dom完成时
mounted
:
function
()
{
mounted
:
function
()
{
// commonUtil.resizeHeight();
CKEDITOR
.
replace
(
'detailEditor'
);
if
(
this
.
isUpdate
)
{
// 只在修改时监听富文本的Ready事件
CKEDITOR
.
on
(
'instanceReady'
,
function
(
event
)
{
detailEditor
=
event
.
editor
;
detailEditor
.
execCommand
(
"toolbarCollapse"
);
detailEditor
.
setReadOnly
(
true
);
//只读
// 获取数据
vm
.
getProtocolDetailById
(
vm
.
protocolId
);
vm
.
getProtocolDetailById
(
vm
.
protocolId
);
});
// commonUtil.resizeHeight();
}
// CKEDITOR.replace( 'detailEditor' );
// if(this.isUpdate) { // 只在修改时监听富文本的Ready事件
// CKEDITOR.on('instanceReady', function (event) {
// detailEditor = event.editor;
// detailEditor.execCommand("toolbarCollapse");
// detailEditor.setReadOnly(true); //只读
// // 获取数据
// vm.getProtocolDetailById(vm.protocolId);
// });
// }
},
},
methods
:
{
methods
:
{
// 根据协议ID获取协议详情
// 根据协议ID获取协议详情
...
@@ -92,7 +96,7 @@ export default {
...
@@ -92,7 +96,7 @@ export default {
vm
.
ruleForm
.
signNum
=
res
.
data
.
signNum
;
vm
.
ruleForm
.
signNum
=
res
.
data
.
signNum
;
vm
.
ruleForm
.
createdName
=
res
.
data
.
createdName
;
vm
.
ruleForm
.
createdName
=
res
.
data
.
createdName
;
vm
.
ruleForm
.
createTime
=
res
.
data
.
createTime
;
vm
.
ruleForm
.
createTime
=
res
.
data
.
createTime
;
detailEditor
.
setData
(
res
.
data
.
contents
);
//
detailEditor.setData(res.data.contents);
}
}
}
else
{
}
else
{
vm
.
$message
({
vm
.
$message
({
...
@@ -108,6 +112,12 @@ export default {
...
@@ -108,6 +112,12 @@ export default {
})
})
}
}
},
},
beforeDestroy
()
{
if
(
detailEditor
)
detailEditor
.
destroy
();
},
destroy
()
{
if
(
detailEditor
)
detailEditor
.
destroy
();
}
};
};
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
...
src/views/protocol/protocol-history copy.vue
已删除
100644 → 0
浏览文件 @
f373e86b
<
template
>
<div
class=
"msg-history-wrap"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
></bread-crumb>
<div
class=
"component-content screenSet"
id=
"screenSet"
>
<el-form
ref=
"formData"
:model=
"formData"
label-width=
"100px"
style=
"margin-bottom: 20px;margin-left: 7px;"
>
<input
type=
"hidden"
v-model=
"formData.all"
value=
5
>
<el-row>
<el-col
style=
"width:290px;"
>
<el-form-item
label=
"协议名称"
prop=
"protocolName"
>
<el-input
size=
"small"
v-model=
"formData.protocolName"
placeholder=
"请输入协议名称"
></el-input>
</el-form-item>
</el-col>
<el-col
style=
"position:relative; top: 4px; width: 200px; margin-left: 20px;"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"handleSearchClick()"
>
查询
</el-button>
</el-col>
</el-row>
</el-form>
<div
style=
"padding: 0 40px;"
>
<el-table
:data=
"tableData"
border
style=
"width: 100%;"
>
<!--
<el-table-column
align=
"center"
prop=
"mobile"
label=
"编号"
width=
"60"
>
</el-table-column>
-->
<el-table-column
align=
"center"
type=
"index"
label=
"编号"
width=
"50"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"protocolName"
label=
"协议名称"
width=
"400"
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"signNum"
label=
"签署数量"
width=
"120"
>
</el-table-column>
<!--
<el-table-column
align=
"center"
prop=
"protocolType"
label=
"协议类型"
>
</el-table-column>
-->
<!--
<el-table-column
align=
"center"
prop=
"versionNo"
label=
"协议版本"
>
</el-table-column>
-->
<el-table-column
align=
"center"
prop=
"createdName"
label=
"创建人姓名"
width=
"120"
>
</el-table-column>
<!--
<el-table-column
align=
"center"
prop=
"creatTime"
label=
"创建时间"
>
<template
slot-scope=
"scope"
>
{{
returnSendTime
(
scope
.
row
.
creatTime
)
}}
</
template
>
</el-table-column>
-->
<el-table-column
align=
"center"
label=
"最近更新时间"
prop=
"updateTime"
width=
"160"
>
<!-- <template slot-scope="scope">
{{ returnSendTime(scope.row.updateTime) }}
</template> -->
</el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
min-width=
"200"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click=
"gotoDetail(scope.row, 0)"
type=
"primary"
size=
"small"
>
查看详情
</el-button>
<el-button
@
click=
"gotoUpdate(scope.row, 0)"
type=
"primary"
size=
"small"
>
更新版本
</el-button>
<el-button
@
click=
"gotoHistoryList(scope.row, 0)"
type=
"primary"
size=
"small"
>
历史版本
</el-button>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"formData.pageNo"
:page-sizes=
"[10, 30, 50, 100]"
:page-size=
"formData.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalRows"
>
</el-pagination>
</div>
</div>
</div>
</div>
</template>
<
script
>
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
export
default
{
components
:
{
BreadCrumb
,
},
data
()
{
return
{
curmbFirst
:
"协议管理"
,
formData
:
{
all
:
1
,
protocolName
:
''
,
protocolType
:
5
,
pageNo
:
1
,
pageSize
:
10
,
},
totalRows
:
0
,
tableData
:
[{}],
}
},
created
()
{
this
.
getProtocolList
({
all
:
1
,
protocolType
:
5
});
},
methods
:
{
// 跳转到详情页面(预览页面)
gotoDetail
(
row
)
{
this
.
$router
.
push
({
path
:
'/protocol-detail'
,
query
:
{
protocolId
:
row
.
protocolId
}
})
},
// 跳转到添加或修改页面
gotoUpdate
(
row
)
{
this
.
$router
.
push
({
path
:
'/create-protocol'
,
query
:
{
protocolId
:
row
.
protocolId
}
})
},
// 跳转到历史版本页面
gotoHistoryList
(
row
)
{
this
.
$router
.
push
({
path
:
'/protocol-history'
,
query
:
{
protocolId
:
row
.
protocolId
}
})
},
// 获取协议列表
getProtocolList
(
params
)
{
openLoading
(
this
);
this
.
GET
(
"/smartcontract/protocolManage/protocols"
,
params
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
if
(
res
&&
res
.
data
){
this
.
tableData
=
res
.
data
;
// this.totalRows = res.data.total || 0;
// this.tableData = res.data.list || [];
}
}
else
{
this
.
$message
({
message
:
'接口请求失败'
,
type
:
'warning'
});
}
});
},
handleSearchClick
()
{
console
.
log
(
this
.
formData
);
this
.
getProtocolList
(
this
.
formData
);
},
handleSizeChange
(
val
){
this
.
formData
.
pageSize
=
val
;
this
.
getSMSList
();
},
handleCurrentChange
(
val
)
{
this
.
formData
.
pageNo
=
val
;
this
.
getSMSList
();
},
returnSendTime
(
creatTime
){
if
(
creatTime
){
return
creatTime
.
year
+
'-'
+
creatTime
.
monthValue
+
'-'
+
creatTime
.
dayOfMonth
+
' '
+
creatTime
.
hour
+
':'
+
creatTime
.
minute
;
}
else
{
return
'-'
;
}
}
},
}
</
script
>
<
style
lang=
"scss"
>
.msg-history-wrap
{
.el-form-item
.el-form-item__label
{
font-size
:
14px
;
}
.component-content
{
margin-top
:
60px
;
padding
:
10px
;
background
:
#fff
;
}
.pagination
{
margin
:
20px
0
;
text-align
:
right
;
}
.status-tj
{
&
.success
{
color
:
#409EFF
;
}
}
}
</
style
>
src/views/protocol/protocol-history.vue
浏览文件 @
79492c8b
...
@@ -192,12 +192,23 @@
...
@@ -192,12 +192,23 @@
})
})
},
},
// // 跳转到历史版本页面
// gotoHistoryList(row) {
// this.$router.push({
// path: '/protocol-history',
// query: {
// protocolId: row.protocolId
// }
// })
// },
// 跳转到历史版本页面
// 跳转到历史版本页面
gotoHistoryList
(
row
)
{
gotoHistoryList
(
row
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
'/protocol-history'
,
path
:
'/protocol-history'
,
query
:
{
query
:
{
protocolId
:
row
.
protocolId
protocolId
:
row
.
protocolId
,
protocolType
:
row
.
protocolType
}
}
})
})
},
},
...
@@ -209,9 +220,8 @@
...
@@ -209,9 +220,8 @@
closeLoading
(
this
);
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
if
(
res
&&
res
.
data
){
if
(
res
&&
res
.
data
){
this
.
tableData
=
res
.
data
;
this
.
tableData
=
res
.
data
.
list
||
[]
// this.totalRows = res.data.total || 0;
this
.
totalRows
=
res
.
data
.
totalRows
||
0
;
// this.tableData = res.data.list || [];
}
}
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
...
...
src/views/protocol/protocol-list.vue
浏览文件 @
79492c8b
...
@@ -218,9 +218,8 @@
...
@@ -218,9 +218,8 @@
closeLoading
(
this
);
closeLoading
(
this
);
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
if
(
res
&&
res
.
data
){
if
(
res
&&
res
.
data
){
this
.
tableData
=
res
.
data
;
this
.
tableData
=
res
.
data
.
list
||
[]
// this.totalRows = res.data.total || 0;
this
.
totalRows
=
res
.
data
.
totalRows
||
0
;
// this.tableData = res.data.list || [];
}
}
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录