提交 ae323c0d 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-consultation-0506' of...

Merge branch 'dev-consultation-0506' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-admin-consultation into dev-consultation-0506

* 'dev-consultation-0506' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-admin-consultation:
  修改批量上架和下架
  修改分页
  修改服务医生样式
  修改样式
  修改创建时间
  修改金额
...@@ -11,6 +11,17 @@ const vueFilter = { ...@@ -11,6 +11,17 @@ const vueFilter = {
}else if(value == 2) { }else if(value == 2) {
return '上架' return '上架'
} }
},
rounding (value) {
if(value != "" && value != null && value != "null"){
return value.toFixed(2);
}
else if(value == 0){
return value.toFixed(2);
}
else {
return value;
}
}, },
diagnosisTypeFilter: (value) => { diagnosisTypeFilter: (value) => {
if(value == 1) { if(value == 1) {
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<div class="title">服务列表</div> <div class="title">服务列表</div>
<el-form ref="form" :inline="true" :model="searchParam" label-suffix=":" label-width="120px" label-position="right" style="width:100%;"> <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-row :gutter="30" type="flex" style="margin-bottom:0;">
<el-col :span="8"> <el-col :span="12">
<el-form-item label="服务医生"> <el-form-item label="服务医生">
<el-input v-model="searchParam.searchKey" size="small" placeholder="请输入医生姓名或联系电话"></el-input> <el-input v-model="searchParam.searchKey" size="middle" placeholder="请输入医生姓名或联系电话" style="width: 120%;"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10" style="margin-left: 255px;"> <el-col :span="10" style="margin-left: 65px;">
<el-form-item label="服务名称"> <el-form-item label="服务名称">
<el-select <el-select
v-model="searchParam.serviceTypeId" v-model="searchParam.serviceTypeId"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="30" type="flex" style="margin-bottom:0;"> <el-row :gutter="30" type="flex" style="margin-bottom:0;">
<el-col style="width: 700px"> <el-col :span="15">
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<!-- <el-date-picker--> <!-- <el-date-picker-->
<!-- v-model="searchParam.startTime"--> <!-- v-model="searchParam.startTime"-->
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
style="width: 100%;"
:picker-options="pickerOptions1"> :picker-options="pickerOptions1">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
id="statusSelector" id="statusSelector"
placeholder="请选择服务状态" placeholder="请选择服务状态"
clearable clearable
style="margin-left:20px;height: 32px;line-height: 32px;" style="margin-left:16px;height: 32px;line-height: 32px;"
> >
<el-option <el-option
v-for="item in statusList" v-for="item in statusList"
...@@ -78,22 +79,22 @@ ...@@ -78,22 +79,22 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3" style="text-align:right;padding-right:55px;"> <el-col :span="3" style="text-align:right;padding-right:55px;">
<el-button type="primary" size="small" @click="search(1)">搜索</el-button> <el-button type="primary" size="small" @click="search()">搜索</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-row :gutter="30" type="flex" style="margin-bottom:0;float: right;"> <el-row :gutter="30" type="flex" style="margin-bottom:0;float: right;">
<el-col :span="5" style="text-align:right;margin-bottom: 10px;"> <el-col :span="5" style="text-align:right;margin-bottom: 10px;">
<el-button type="primary" size="small" @click="refresh(1)">刷新页面</el-button> <el-button type="primary" size="small" @click="refresh()">刷新页面</el-button>
</el-col> </el-col>
<el-col :span="5" style="text-align:right;"> <el-col :span="5" style="text-align:right;">
<el-button type="primary" size="small" @click="batchOffline(1)">批量下架</el-button> <el-button type="primary" size="small" @click="batchOffline()">批量下架</el-button>
</el-col> </el-col>
<el-col :span="5" style="text-align:right;"> <el-col :span="5" style="text-align:right;">
<el-button type="primary" size="small" @click="batchOnline(1)">批量上架</el-button> <el-button type="primary" size="small" @click="batchOnline()">批量上架</el-button>
</el-col> </el-col>
<el-col :span="5" style="text-align:right;"> <el-col :span="5" style="text-align:right;">
<el-button type="primary" size="small" @click="batchSetPrice(1)">批量设置价格</el-button> <el-button type="primary" size="small" @click="batchSetPrice()">批量设置价格</el-button>
</el-col> </el-col>
</el-row> </el-row>
<!-- 表格 --> <!-- 表格 -->
...@@ -108,7 +109,10 @@ ...@@ -108,7 +109,10 @@
<el-table-column prop="serviceName" label="服务名称" min-width="100" 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="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="mobilePhone" label="联系电话" min-width="120" align="left"></el-table-column>
<el-table-column prop="price" label="价格" min-width="60" align="left"> <el-table-column prop="price" label="价格(元)" min-width="60" align="left">
<template slot-scope="scope">
<span>{{scope.row.price | rounding}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="状态" min-width="80" align="left"> <el-table-column prop="status" label="状态" min-width="80" align="left">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -122,7 +126,7 @@ ...@@ -122,7 +126,7 @@
<div> <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 == 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 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> <el-button type="primary" size="small" @click="setPrice(scope.row, false)" style="margin-top: 10px;">设置价格</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -134,7 +138,7 @@ ...@@ -134,7 +138,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="searchParam.pageNo" :current-page="searchParam.pageNo"
:page-sizes="[15, 30, 50, 100, 200, 500, 700, 1000, 1500, 2000]" :page-sizes="[10, 15, 30, 50, 100, 200, 500, 700, 1000, 1500, 2000]"
:page-size="searchParam.pageSize" :page-size="searchParam.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"> :total="totalRows">
...@@ -158,11 +162,11 @@ ...@@ -158,11 +162,11 @@
style="width: 100%;"> style="width: 100%;">
<el-col :span="15"> <el-col :span="15">
<el-form-item label="价格" class="required-label"> <el-form-item label="价格" class="required-label">
<el-input-number v-model="setPriceForm.price" size="small" :precision="2" :min="0" :max="9999" placeholder="请输入价格"></el-input-number> <el-input-number v-model="setPriceForm.price" size="small" :precision="2" :min="0" :max="9999" placeholder="请输入价格" @change="changePrice($event)"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="15" style="margin-left: 105px;"> <el-col :span="15" style="margin-left: 105px;">
实际收入(接诊后实际到账金额): ¥{{setPriceForm.price * profit}} 实际收入(接诊后实际到账金额): ¥{{tempPrice | rounding}}
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
...@@ -175,6 +179,7 @@ ...@@ -175,6 +179,7 @@
</div> </div>
</template> </template>
<script> <script>
let vm = null;
export default { export default {
data(){ data(){
return { return {
...@@ -189,9 +194,10 @@ export default { ...@@ -189,9 +194,10 @@ export default {
status: 0, status: 0,
startTime: "", startTime: "",
endTime: "", endTime: "",
pageSize: 15, pageSize: 10,
pageNo: 1 pageNo: 1
}, },
batchUpdatePriceFlag: false,
setPriceForm:{ setPriceForm:{
doctorId: '', doctorId: '',
serviceType: '', serviceType: '',
...@@ -211,6 +217,7 @@ export default { ...@@ -211,6 +217,7 @@ export default {
liveBack: false, liveBack: false,
timeClickFlag: true, timeClickFlag: true,
multipleSelection: [], multipleSelection: [],
tempPrice: 0,
statusList: [ statusList: [
{ {
value: 0, value: 0,
...@@ -249,6 +256,7 @@ export default { ...@@ -249,6 +256,7 @@ export default {
} }
}, },
mounted() { mounted() {
vm = this;
this.getServiceTypeList(); this.getServiceTypeList();
// this.getDiagnoseList() // this.getDiagnoseList()
this.search() this.search()
...@@ -264,12 +272,15 @@ export default { ...@@ -264,12 +272,15 @@ export default {
}) })
}, },
search(a) { search() {
if(this.rangeTime){ if(this.rangeTime){
this.searchParam.startTime = this.rangeTime[0]; this.searchParam.startTime = this.rangeTime[0];
this.searchParam.endTime = this.rangeTime[1]; this.searchParam.endTime = this.rangeTime[1];
} }
if(a) this.searchParam.pageNo = 1 else {
this.searchParam.startTime = "";
this.searchParam.endTime = "";
}
this.loading = true this.loading = true
let url = `/diagnose/doctorService/search` let url = `/diagnose/doctorService/search`
let params = this.searchParam let params = this.searchParam
...@@ -289,7 +300,7 @@ export default { ...@@ -289,7 +300,7 @@ export default {
}, },
confirmSetPrice() { confirmSetPrice() {
if(this.setPriceForm.price == "" || this.setPriceForm.price == undefined){ if(this.setPriceForm.price != 0 && (this.setPriceForm.price == "" || this.setPriceForm.price == undefined)){
this.$message({ this.$message({
message: '请输入问诊价格', message: '请输入问诊价格',
type: "warning" type: "warning"
...@@ -307,24 +318,50 @@ export default { ...@@ -307,24 +318,50 @@ export default {
this.$refs.setPriceForm.validate((valid) => { this.$refs.setPriceForm.validate((valid) => {
if(valid) { if(valid) {
this.loading = true this.loading = true
// openLoading(this); // 批量设置价格
if(this.batchUpdatePriceFlag){
let setPriceList = [];
for(let i = 0; i < this.multipleSelection.length; i++){
setPriceList.push({doctorId: this.multipleSelection[i].doctorId, serviceType: this.multipleSelection[i].serviceType, price: this.setPriceForm.price});
}
this.POST('/diagnose/doctorService/batchUpdatePrice', setPriceList).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"
})
}
});
}
else {
this.POST('/diagnose/doctorService/updatePrice', this.setPriceForm).then(res => { this.POST('/diagnose/doctorService/updatePrice', this.setPriceForm).then(res => {
this.loading = false this.loading = false
// closeLoading(this); // closeLoading(this);
if (res.code == "000000") { if (res.code == "000000") {
this.$message({ this.$message({
message: '设置价格成功', message: '设置价格成功',
type: "success" type: "success"
}); });
this.setPriceVisible = false this.setPriceVisible = false
this.search() this.search()
}else { }else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "error" type: "error"
}) })
} }
}); });
}
} }
}) })
}, },
...@@ -341,6 +378,16 @@ export default { ...@@ -341,6 +378,16 @@ export default {
}, },
// 刷新页面 // 刷新页面
refresh(){ refresh(){
this.searchParam = {
searchKey: '',
serviceTypeId: 0,
status: 0,
startTime: "",
endTime: "",
pageSize: 15,
pageNo: 1
};
this.rangeTime = "";
this.search(); this.search();
}, },
// 批量下架 // 批量下架
...@@ -383,8 +430,13 @@ export default { ...@@ -383,8 +430,13 @@ export default {
}); });
return; return;
} }
this.setSelectedList();
this.POST(`/diagnose/doctorService/batchDeploy`, this.selectedList).then(res => { if(!this.setSelectedPriceList()){
return;
}
// this.setSelectedList();
this.POST(`/diagnose/doctorService/batchDeploy`, this.selectedPriceList).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.$message({ this.$message({
message: '上架成功', message: '上架成功',
...@@ -408,10 +460,10 @@ export default { ...@@ -408,10 +460,10 @@ export default {
}); });
return; return;
} }
else { // else {
this.setSelectedPriceList(); // this.setSelectedPriceList();
} // }
this.setPrice(this.multipleSelection[0]); this.setPrice(this.multipleSelection[0], true);
}, },
setSelectedList(){ setSelectedList(){
if(this.multipleSelection.length > 0){ if(this.multipleSelection.length > 0){
...@@ -425,15 +477,16 @@ export default { ...@@ -425,15 +477,16 @@ export default {
if(this.multipleSelection.length > 0){ if(this.multipleSelection.length > 0){
this.selectedPriceList = []; this.selectedPriceList = [];
for(let i = 0; i < this.multipleSelection.length; i++){ for(let i = 0; i < this.multipleSelection.length; i++){
if(this.multipleSelection[i].price == "" || this.multipleSelection[i].price == null){ if(this.multipleSelection[i].price != 0 && (this.multipleSelection[i].price == "" || this.multipleSelection[i].price == null)){
this.$message({ this.$message({
message: '请先设置"问诊价格"', message: '请先设置"问诊价格"',
type: "warning" type: "warning"
}); });
return; return false;
} }
this.selectedPriceList.push({doctorId: this.multipleSelection[i].doctorId, serviceType: this.multipleSelection[i].serviceType, price: this.multipleSelection[i].price}); this.selectedPriceList.push({doctorId: this.multipleSelection[i].doctorId, serviceType: this.multipleSelection[i].serviceType, price: this.multipleSelection[i].price});
} }
return true;
} }
}, },
...@@ -484,7 +537,8 @@ export default { ...@@ -484,7 +537,8 @@ export default {
}); });
}) })
}, },
setPrice(row){ setPrice(row, batchUpdatePriceFlag){
this.batchUpdatePriceFlag = batchUpdatePriceFlag;
this. setPriceForm.doctorId = row.doctorId; this. setPriceForm.doctorId = row.doctorId;
this.setPriceForm.serviceType = row.serviceType; this.setPriceForm.serviceType = row.serviceType;
this.setPriceForm.price = row.price; this.setPriceForm.price = row.price;
...@@ -498,8 +552,13 @@ export default { ...@@ -498,8 +552,13 @@ export default {
getProfit(row){ getProfit(row){
this.POST(`/diagnose/doctorService/profit`, {doctorId: row.doctorId, serviceType: row.serviceType}).then(res => { this.POST(`/diagnose/doctorService/profit`, {doctorId: row.doctorId, serviceType: row.serviceType}).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.profit = res.data; vm.profit = res.data;
if(vm.setPriceForm.price != 0 && (vm.setPriceForm.price == "" || vm.setPriceForm.price == null)){
this.tempPrice = "";
}
else {
this.tempPrice = this.setPriceForm.price * this.profit;
}
}else { }else {
this.$message({ this.$message({
message: res.message, message: res.message,
...@@ -507,6 +566,14 @@ export default { ...@@ -507,6 +566,14 @@ export default {
}) })
} }
}); });
},
changePrice(e){
if(this.setPriceForm.price != 0 && (this.setPriceForm.price == "" || this.setPriceForm.price == undefined)){
this.tempPrice = "";
}
else {
this.tempPrice = this.setPriceForm.price * this.profit;
}
} }
} }
...@@ -528,4 +595,5 @@ export default { ...@@ -528,4 +595,5 @@ export default {
color: #F56C6C; color: #F56C6C;
margin-right: 4px; margin-right: 4px;
} }
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册