提交 24ef2f0d 编写于 作者: vino's avatar vino

新增服务列表

上级 a1c32f18
...@@ -4,6 +4,7 @@ import App from '../App' ...@@ -4,6 +4,7 @@ import App from '../App'
const diagnosisList = r => require.ensure([], () => r(require('../views/IM/diagnosis-admin/diagnosis-list.vue')), 'diagnosisList') const diagnosisList = r => require.ensure([], () => r(require('../views/IM/diagnosis-admin/diagnosis-list.vue')), 'diagnosisList')
const diagnosisIm = r => require.ensure([], () => r(require('../views/IM/diagnosis-admin/diagnosis-im.vue')), 'diagnosisIm') const diagnosisIm = r => require.ensure([], () => r(require('../views/IM/diagnosis-admin/diagnosis-im.vue')), 'diagnosisIm')
const diagnosisLive = r => require.ensure([], () => r(require('../views/IM/diagnosis-admin/diagnosis-live.vue')), 'diagnosisLive') const diagnosisLive = r => require.ensure([], () => r(require('../views/IM/diagnosis-admin/diagnosis-live.vue')), 'diagnosisLive')
const serviceList = r => require.ensure([], () => r(require('../views/IM/diagnosis-admin/service-list.vue')), 'serviceList')
export default [{ export default [{
path: '/', path: '/',
...@@ -21,6 +22,9 @@ export default [{ ...@@ -21,6 +22,9 @@ export default [{
},{ },{
path: '/diagnosis-live', path: '/diagnosis-live',
component: diagnosisLive component: diagnosisLive
},{
path: '/service-List',
component: serviceList
} }
] ]
}] }]
...@@ -4,6 +4,13 @@ const vueFilter = { ...@@ -4,6 +4,13 @@ const vueFilter = {
return (value / 100) + '元' return (value / 100) + '元'
} }
}, },
statusFilter: (value) => {
if(value == 1) {
return '下架'
}else if(value == 2) {
return '上架'
}
},
diagnosisTypeFilter: (value) => { diagnosisTypeFilter: (value) => {
if(value == 1) { if(value == 1) {
return '音频' return '音频'
......
<template>
<div class="diagnosis-list-content">
<div class="component-content screenSet" id="screenSet">
<div class="title">服务列表</div>
<el-form ref="form" :inline="true" :model="searchParam" label-suffix=":" label-width="120px" label-position="right" style="width:100%;">
<el-row :gutter="30" type="flex" style="margin-bottom:0;">
<el-col :span="8">
<el-form-item label="服务医生">
<el-input v-model="searchParam.searchKey" size="small" placeholder="请输入医生姓名或联系电话"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="服务名称">
<el-select
v-model="searchParam.serviceTypeId"
id="statusSelector"
placeholder="请选择服务名称"
clearable
style="margin-left:20px;height: 32px;line-height: 32px;"
>
<el-option
v-for="item in serviceTypeList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30" type="flex" style="margin-bottom:0;">
<el-col style="width: 700px">
<el-form-item label="创建时间">
<el-date-picker
v-model="searchParam.startTimestamp"
size="small"
type="date"
placeholder="请选择开始时间"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions0"
></el-date-picker> ~
<el-date-picker
v-model="searchParam.endTimestamp"
size="small"
type="date"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions1"
default-time="23:59:59"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" style="padding-left: 0px;padding-right: 0px;">
<el-form-item label="状态">
<el-select
v-model="searchParam.status"
id="statusSelector"
placeholder="请选择服务状态"
clearable
style="margin-left:20px;height: 32px;line-height: 32px;"
>
<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="3" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="search(1)">搜索</el-button>
</el-col>
</el-row>
</el-form>
<el-row :gutter="30" type="flex" style="margin-bottom:0;">
<el-col :span="3" style="padding:0;text-align:right;">
<el-button type="primary" size="small" @click="refresh(1)">刷新页面</el-button>
</el-col>
<el-col :span="3" style="padding:0;text-align:right;">
<el-button type="primary" size="small" @click="batchOffline(1)">批量下架</el-button>
</el-col>
<el-col :span="3" style="padding:0;text-align:right;">
<el-button type="primary" size="small" @click="batchOnline(1)">批量上架</el-button>
</el-col>
<el-col :span="3" style="padding:0;text-align:right;">
<el-button type="primary" size="small" @click="batchSetPrice(1)">批量设置价格</el-button>
</el-col>
</el-row>
<!-- 表格 -->
<el-table
class="search-table"
:data="tableData"
style="width: 100%"
v-loading="loading"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column prop="id" label="ID" min-width="50" align="left"></el-table-column>
<el-table-column prop="serviceName" label="服务名称" min-width="100" align="left"></el-table-column>
<el-table-column prop="doctorName" label="服务医生" min-width="120" align="left"></el-table-column>
<el-table-column prop="mobilePhone" label="联系电话" min-width="120" align="left"></el-table-column>
<el-table-column prop="price" label="价格" min-width="60" align="left">
</el-table-column>
<el-table-column prop="status" label="状态" min-width="80" align="left">
<template slot-scope="scope">
<span>{{scope.row.status | statusFilter}}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="160" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="150">
<template slot-scope="scope">
<div>
<el-button v-if="scope.row.status == 1" type="primary" size="small" @click="online(scope.row)" style="margin-top: 10px;">上架</el-button>
<el-button v-if="scope.row.status == 2" type="primary" size="small" @click="offline(scope.row)" style="margin-top: 10px;">下架</el-button>
<el-button type="primary" size="small" @click="setPrice(scope.row)" style="margin-top: 10px;">设置价格</el-button>
</div>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchParam.pageNo"
:page-sizes="[15, 30, 50, 100, 200, 500, 700, 1000, 1500, 2000]"
:page-size="searchParam.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows">
</el-pagination>
</div>
<!-- 预约时间 -->
<el-dialog
title="设置价格"
:visible.sync="setPriceVisible"
width="40%">
<el-row :gutter="30" class="row search" type="flex" style="margin-bottom:0;">
<el-form ref="setPriceForm"
:rules="setPriceRules"
:model="setPriceForm"
label-width="150px"
label-suffix=":"
label-position="right"
size="mini"
style="width: 100%;">
<el-col :span="15">
<el-form-item label="价格" class="required-label">
<el-input v-model="setPriceForm.price" size="small" :min="0" :max="9999" placeholder="请输入价格"></el-input>
</el-form-item>
</el-col>
<el-col :span="15" style="margin-left: 105px;">
实际收入(接诊后实际到账金额): ¥{{setPriceForm.price * profit}}
</el-col>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="setPriceVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmSetPrice">确 定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
data(){
return {
endFlag: false,
beginFlag: false,
loading: false,
activeName: 'second',
setPriceVisible: false,
searchParam: {
searchKey: '',
serviceTypeId: '',
status: '0',
startTimestamp: "",
endTimestamp: "",
pageSize: 15,
pageNo: 1
},
setPriceForm:{
doctorId: '',
serviceType: '',
price: ''
},
timeSelect: [],
diagnosisSelect: [],
serviceTypeList: [],
tableData: [],
totalRows: 0,
setPriceRules: {
price: [
{ required: true, message: '请输入价格', trigger: 'blur'},
{ pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '请输入正确额格式,可保留两位小数' }
],
},
liveBack: false,
timeClickFlag: true,
multipleSelection: [],
statusList: [
{
value: "0",
label: "全部"
},
{
value: "1",
label: "下架"
},
{
value: "2",
label: "上架"
}],
profit: 0,
selectedList:[],
selectedPriceList:[],
pickerOptions0: {
disabledDate: time => {
if (
this.searchParam.endTimestamp != "" &&
this.searchParam.endTimestamp != null
) {
return (
time.getTime() > new Date(this.searchParam.endTimestamp).getTime()
);
}
}
},
pickerOptions1: {
disabledDate: time => {
return (
time.getTime() < new Date(this.searchParam.startTimestamp).getTime()
); //减去一天的时间代表可以选择同一天;
}
},
}
},
mounted() {
this.getServiceTypeList();
// this.getDiagnoseList()
this.search()
},
methods: {
changeBeginTime(val) {
this.beginFlag = false
this.endFlag = false
let b = new Date(val).getTime(), e
if(this.setPriceForm.endTime) {
e = new Date(this.setPriceForm.endTime).getTime()
}
if(val) this.beginFlag = b > e ? true : false
},
changeEndTime(val) {
this.beginFlag = false
this.endFlag = false
let b = new Date(val).getTime(), e
if(this.setPriceForm.beginTime) {
e = new Date(this.setPriceForm.beginTime).getTime()
}
if(val) this.endFlag = b < e ? true : false
},
// 服务名称
getServiceTypeList() {
let url = `/diagnose/doctorService/serviceType`
this.GET(url).then(res => {
if (res.code == "000000") {
this.serviceTypeList = res.data
}
})
},
// 问诊状态
getDiagnoseList() {
let url = `/basic-data/constants?typeCode=P254`
this.GET(url).then(res => {
if (res.code == "000000") {
this.diagnosisSelect = res.data
}
});
},
// tab切换
handleClick(val) {
this.searchParam.tab = val.name == 'second' ? 2: 1
this.search()
},
search(a) {
if(a) this.searchParam.pageNo = 1
this.loading = true
let url = `/diagnose/doctorService/search`
let params = this.searchParam
this.POST(url, params).then(res => {
this.loading = false
if (res.code == "000000") {
this.tableData = res.data.contentList;
this.totalRows = res.data.total;
}
});
this.tableData = [
{'orderNo': 100, 'serviceName': '语音问诊',
'doctorName': '李时珍', 'userMobile': '18888888888',
'price': '100', 'statusStr': '上架', 'appointBeginTime': '2015-10-10',
'status': '2'}
];
},
// 预约时间
timeHandle(row) {
this.beginFlag = false
this.endFlag = false
this.setPriceVisible = true
if(this.$refs.setPriceForm) {
this.$refs.setPriceForm.resetFields()
}
this.setPriceForm.diagnoseLogId = row.diagnoseLogId
this.setPriceForm.beginTime = row.appointBeginTime
this.setPriceForm.endTime = row.appointEndTime
},
confirmSetPrice() {
if(this.setPriceForm.price == ""){
this.$message({
message: '请输入问诊价格',
type: "warning"
});
return;
}
let timeoutId = null
timeoutId && clearTimeout(timeoutId)
timeoutId = setTimeout(() => {
this.clickHandle()
}, 500)
},
// 防止按钮多次点击
clickHandle() {
this.$refs.setPriceForm.validate((valid) => {
if(valid) {
this.loading = true
// openLoading(this);
this.POST('/diagnose/doctorService/updatePrice', this.setPriceForm).then(res => {
this.loading = false
// closeLoading(this);
if (res.code == "000000") {
this.$message({
message: '设置价格成功',
type: "success"
});
this.setPriceVisible = false
this.search()
}else {
this.$message({
message: res.message,
type: "error"
})
}
});
}
})
},
// 结束问诊
endDiagnosis(row) {
this.$confirm('确定结束问诊吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.POST(`/diagnose/admin/diagnose/end/${row.diagnoseLogId}`, '').then(res => {
if (res.code == "000000") {
this.$message({
message: '成功结束问诊',
type: "success"
})
this.searchParam.tab = 1
this.search()
}else {
this.$message({
message: res.message,
type: "error"
})
}
});
})
},
// 呼叫双方
callAll(row) {
this.$confirm('确定呼叫双方吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.POST(`/diagnose/admin/diagnose/call/${row.diagnoseLogId}`, '').then(res => {
if (res.code != "000000") {
this.$message({
message: res.message,
type: "error"
})
}
})
})
},
// 加入问诊
jionCommunicate(row) {
this.$confirm('确定加入问诊吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.clearSession()
this.$router.push({path: '/diagnosis-live', query: {tid: row.imTeamId, diagnoseLogId: row.diagnoseLogId}})
})
},
// 发送消息
sendMessage(row) {
this.$router.push({path: '/diagnosis-im', query: {tid: row.imTeamId}})
},
// 选择
selectBtn(row) {
this.POST(`/diagnose/admin/diagnose/choose/${row.diagnoseLogId}`, '')
.then(res => {
if (res.code == "000000") {
this.$message({
message: '选择成功',
type: "success"
});
this.searchParam.tab = 1
this.search()
}else {
this.$message({
message: res.message,
type: "error"
})
}
})
.catch((error) => {
this.$message({
message: error,
type: "error"
})
})
this.activeName = 'first'
this.searchParam.tab = 1
this.search()
},
handleSizeChange(value) {
this.searchParam.pageSize = value
this.search()
},
handleCurrentChange(value) {
this.searchParam.pageNo = value
this.search()
},
// 清除直播时间相关的seession
clearSession() {
sessionStorage.removeItem('TIME_askTime')
sessionStorage.removeItem('TIME_answerTime')
sessionStorage.removeItem('TIME_useTime')
sessionStorage.removeItem('TIME_loseTime')
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
// 刷新页面
refresh(){
},
// 批量下架
batchOffline(){
if(this.multipleSelection.length == 0){
this.$message({
message: '请先选择要操作的数据',
type: "warning"
});
return;
}
this.setSelectedList();
this.$confirm('一旦下架将无法预约您的问诊,已预约的问诊不受影响,确定下架?', '确定下架问诊吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.POST(`/diagnose/doctorService/batchUndeploy`, this.selectedList).then(res => {
if (res.code == "000000") {
this.$message({
message: '下架成功',
type: "success"
})
this.search();
}else {
this.$message({
message: res.message,
type: "error"
})
}
});
})
},
// 批量上架
batchOnline(){
if(this.multipleSelection.length == 0){
this.$message({
message: '请先选择要操作的数据',
type: "warning"
});
return;
}
this.setSelectedList();
this.POST(`/diagnose/doctorService/batchDeploy`, this.selectedList).then(res => {
if (res.code == "000000") {
this.$message({
message: '上架成功',
type: "success"
})
this.search();
}else {
this.$message({
message: res.message,
type: "error"
})
}
});
},
// 批量设置价格
batchSetPrice(){
if(this.multipleSelection.length == 0){
this.$message({
message: '请先选择要操作的数据',
type: "warning"
});
return;
}
else {
this.setSelectedPriceList();
}
this.setPrice(this.multipleSelection[0]);
},
setSelectedList(){
if(this.multipleSelection.length > 0){
this.selectedList = [];
for(let i = 0; i < this.multipleSelection.length; i++){
this.selectedList.push({doctorId: this.multipleSelection[i].doctorId, serviceType: this.multipleSelection[i].serviceType});
}
}
},
setSelectedPriceList(){
if(this.multipleSelection.length > 0){
this.selectedPriceList = [];
for(let i = 0; i < this.multipleSelection.length; i++){
if(this.multipleSelection[i].price == "" || this.multipleSelection[i].price == null){
this.$message({
message: '请先设置"问诊价格"',
type: "warning"
});
return;
}
this.selectedPriceList.push({doctorId: this.multipleSelection[i].doctorId, serviceType: this.multipleSelection[i].serviceType, price: this.multipleSelection[i].price});
}
}
},
// 上架
online(row){
if(row.price == null){
this.$message({
message: '请先设置价格',
type: "warning"
});
return;
}
this.POST(`/diagnose/doctorService/deploy`, {'doctorId': row.doctorId, 'serviceType': row.serviceType}).then(res => {
if (res.code == "000000") {
this.$message({
message: '上架成功',
type: "success"
})
this.search();
}else {
this.$message({
message: res.message,
type: "error"
})
}
});
},
// 下架
offline(row){
this.$confirm('一旦下架将无法预约您的问诊,已预约的问诊不受影响,确定下架?', '确定下架问诊吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.POST(`/diagnose/doctorService/undeploy`, {'doctorId': row.doctorId, 'serviceType': row.serviceType}).then(res => {
if (res.code == "000000") {
this.$message({
message: '下架成功',
type: "success"
})
this.search();
}else {
this.$message({
message: res.message,
type: "error"
})
}
});
})
},
setPrice(row){
this. setPriceForm.doctorId = row.doctorId;
this.setPriceForm.serviceType = row.serviceType;
this.setPriceForm.price = row.price;
this.setPriceVisible = true
if(this.$refs.setPriceForm) {
this.$refs.setPriceForm.resetFields()
}
this.getProfit(row);
},
getProfit(row){
this.POST(`/diagnose/doctorService/profit`, {doctorId: row.doctorId, serviceType: row.serviceType}).then(res => {
if (res.code == "000000") {
this.profit = res.data;
}else {
this.$message({
message: res.message,
type: "error"
})
}
});
}
}
}
</script>
<style lang="scss" scoped>
.diagnosis-list-content {
.component-content {
padding: 10px;
background: #fff;
overflow: hidden !important;
.title {
margin-bottom: 30px;
}
}
}
.required-label .el-form-item__label::before {
content: '*';
color: #F56C6C;
margin-right: 4px;
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册