提交 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 = {
}else if(value == 2) {
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) => {
if(value == 1) {
......
......@@ -4,12 +4,12 @@
<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-col :span="12">
<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-col>
<el-col :span="10" style="margin-left: 255px;">
<el-col :span="10" style="margin-left: 65px;">
<el-form-item label="服务名称">
<el-select
v-model="searchParam.serviceTypeId"
......@@ -29,7 +29,7 @@
</el-col>
</el-row>
<el-row :gutter="30" type="flex" style="margin-bottom:0;">
<el-col style="width: 700px">
<el-col :span="15">
<el-form-item label="创建时间">
<!-- <el-date-picker-->
<!-- v-model="searchParam.startTime"-->
......@@ -55,6 +55,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 100%;"
:picker-options="pickerOptions1">
</el-date-picker>
</el-form-item>
......@@ -66,7 +67,7 @@
id="statusSelector"
placeholder="请选择服务状态"
clearable
style="margin-left:20px;height: 32px;line-height: 32px;"
style="margin-left:16px;height: 32px;line-height: 32px;"
>
<el-option
v-for="item in statusList"
......@@ -78,22 +79,22 @@
</el-form-item>
</el-col>
<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-row>
</el-form>
<el-row :gutter="30" type="flex" style="margin-bottom:0;float: right;">
<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 :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 :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 :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-row>
<!-- 表格 -->
......@@ -108,7 +109,10 @@
<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 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 prop="status" label="状态" min-width="80" align="left">
<template slot-scope="scope">
......@@ -122,7 +126,7 @@
<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>
<el-button type="primary" size="small" @click="setPrice(scope.row, false)" style="margin-top: 10px;">设置价格</el-button>
</div>
</template>
</el-table-column>
......@@ -134,7 +138,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
: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"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows">
......@@ -158,11 +162,11 @@
style="width: 100%;">
<el-col :span="15">
<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-col>
<el-col :span="15" style="margin-left: 105px;">
实际收入(接诊后实际到账金额): ¥{{setPriceForm.price * profit}}
实际收入(接诊后实际到账金额): ¥{{tempPrice | rounding}}
</el-col>
</el-form>
</el-row>
......@@ -175,6 +179,7 @@
</div>
</template>
<script>
let vm = null;
export default {
data(){
return {
......@@ -189,9 +194,10 @@ export default {
status: 0,
startTime: "",
endTime: "",
pageSize: 15,
pageSize: 10,
pageNo: 1
},
batchUpdatePriceFlag: false,
setPriceForm:{
doctorId: '',
serviceType: '',
......@@ -211,6 +217,7 @@ export default {
liveBack: false,
timeClickFlag: true,
multipleSelection: [],
tempPrice: 0,
statusList: [
{
value: 0,
......@@ -249,6 +256,7 @@ export default {
}
},
mounted() {
vm = this;
this.getServiceTypeList();
// this.getDiagnoseList()
this.search()
......@@ -264,12 +272,15 @@ export default {
})
},
search(a) {
search() {
if(this.rangeTime){
this.searchParam.startTime = this.rangeTime[0];
this.searchParam.endTime = this.rangeTime[1];
}
if(a) this.searchParam.pageNo = 1
else {
this.searchParam.startTime = "";
this.searchParam.endTime = "";
}
this.loading = true
let url = `/diagnose/doctorService/search`
let params = this.searchParam
......@@ -289,7 +300,7 @@ export default {
},
confirmSetPrice() {
if(this.setPriceForm.price == "" || this.setPriceForm.price == undefined){
if(this.setPriceForm.price != 0 && (this.setPriceForm.price == "" || this.setPriceForm.price == undefined)){
this.$message({
message: '请输入问诊价格',
type: "warning"
......@@ -307,7 +318,31 @@ export default {
this.$refs.setPriceForm.validate((valid) => {
if(valid) {
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.loading = false
// closeLoading(this);
......@@ -326,6 +361,8 @@ export default {
}
});
}
}
})
},
handleSizeChange(value) {
......@@ -341,6 +378,16 @@ export default {
},
// 刷新页面
refresh(){
this.searchParam = {
searchKey: '',
serviceTypeId: 0,
status: 0,
startTime: "",
endTime: "",
pageSize: 15,
pageNo: 1
};
this.rangeTime = "";
this.search();
},
// 批量下架
......@@ -383,8 +430,13 @@ export default {
});
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") {
this.$message({
message: '上架成功',
......@@ -408,10 +460,10 @@ export default {
});
return;
}
else {
this.setSelectedPriceList();
}
this.setPrice(this.multipleSelection[0]);
// else {
// this.setSelectedPriceList();
// }
this.setPrice(this.multipleSelection[0], true);
},
setSelectedList(){
if(this.multipleSelection.length > 0){
......@@ -425,15 +477,16 @@ export default {
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){
if(this.multipleSelection[i].price != 0 && (this.multipleSelection[i].price == "" || this.multipleSelection[i].price == null)){
this.$message({
message: '请先设置"问诊价格"',
type: "warning"
});
return;
return false;
}
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 {
});
})
},
setPrice(row){
setPrice(row, batchUpdatePriceFlag){
this.batchUpdatePriceFlag = batchUpdatePriceFlag;
this. setPriceForm.doctorId = row.doctorId;
this.setPriceForm.serviceType = row.serviceType;
this.setPriceForm.price = row.price;
......@@ -498,8 +552,13 @@ export default {
getProfit(row){
this.POST(`/diagnose/doctorService/profit`, {doctorId: row.doctorId, serviceType: row.serviceType}).then(res => {
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 {
this.$message({
message: res.message,
......@@ -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 {
color: #F56C6C;
margin-right: 4px;
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册