提交 856f2036 编写于 作者: vino's avatar vino

修改金额

上级 a472ad60
......@@ -10,6 +10,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) {
......
......@@ -78,22 +78,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 +108,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 +125,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>
......@@ -158,11 +161,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 +178,7 @@
</div>
</template>
<script>
let vm = null;
export default {
data(){
return {
......@@ -192,6 +196,7 @@ export default {
pageSize: 15,
pageNo: 1
},
batchUpdatePriceFlag: false,
setPriceForm:{
doctorId: '',
serviceType: '',
......@@ -211,6 +216,7 @@ export default {
liveBack: false,
timeClickFlag: true,
multipleSelection: [],
tempPrice: 0,
statusList: [
{
value: 0,
......@@ -249,6 +255,7 @@ export default {
}
},
mounted() {
vm = this;
this.getServiceTypeList();
// this.getDiagnoseList()
this.search()
......@@ -264,12 +271,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
......@@ -307,24 +317,50 @@ 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);
if (res.code == "000000") {
this.$message({
message: '设置价格成功',
type: "success"
});
this.setPriceVisible = false
this.search()
}else {
this.$message({
message: res.message,
type: "error"
})
}
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"
})
}
});
}
}
})
},
......@@ -341,6 +377,16 @@ export default {
},
// 刷新页面
refresh(){
this.searchParam = {
searchKey: '',
serviceTypeId: 0,
status: 0,
startTime: "",
endTime: "",
pageSize: 15,
pageNo: 1
};
this.rangeTime = "";
this.search();
},
// 批量下架
......@@ -383,7 +429,12 @@ export default {
});
return;
}
this.setSelectedList();
if(!this.setSelectedPriceList()){
return;
}
// this.setSelectedList();
this.POST(`/diagnose/doctorService/batchDeploy`, this.selectedList).then(res => {
if (res.code == "000000") {
this.$message({
......@@ -408,10 +459,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){
......@@ -430,7 +481,7 @@ export default {
message: '请先设置"问诊价格"',
type: "warning"
});
return;
return false;
}
this.selectedPriceList.push({doctorId: this.multipleSelection[i].doctorId, serviceType: this.multipleSelection[i].serviceType, price: this.multipleSelection[i].price});
}
......@@ -484,7 +535,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 +550,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 +564,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;
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册