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

修改金额

上级 a472ad60
...@@ -10,6 +10,17 @@ const vueFilter = { ...@@ -10,6 +10,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) {
......
...@@ -78,22 +78,22 @@ ...@@ -78,22 +78,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 +108,10 @@ ...@@ -108,7 +108,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 +125,7 @@ ...@@ -122,7 +125,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>
...@@ -158,11 +161,11 @@ ...@@ -158,11 +161,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 +178,7 @@ ...@@ -175,6 +178,7 @@
</div> </div>
</template> </template>
<script> <script>
let vm = null;
export default { export default {
data(){ data(){
return { return {
...@@ -192,6 +196,7 @@ export default { ...@@ -192,6 +196,7 @@ export default {
pageSize: 15, pageSize: 15,
pageNo: 1 pageNo: 1
}, },
batchUpdatePriceFlag: false,
setPriceForm:{ setPriceForm:{
doctorId: '', doctorId: '',
serviceType: '', serviceType: '',
...@@ -211,6 +216,7 @@ export default { ...@@ -211,6 +216,7 @@ export default {
liveBack: false, liveBack: false,
timeClickFlag: true, timeClickFlag: true,
multipleSelection: [], multipleSelection: [],
tempPrice: 0,
statusList: [ statusList: [
{ {
value: 0, value: 0,
...@@ -249,6 +255,7 @@ export default { ...@@ -249,6 +255,7 @@ export default {
} }
}, },
mounted() { mounted() {
vm = this;
this.getServiceTypeList(); this.getServiceTypeList();
// this.getDiagnoseList() // this.getDiagnoseList()
this.search() this.search()
...@@ -264,12 +271,15 @@ export default { ...@@ -264,12 +271,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
...@@ -307,7 +317,31 @@ export default { ...@@ -307,7 +317,31 @@ 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);
...@@ -326,6 +360,8 @@ export default { ...@@ -326,6 +360,8 @@ export default {
} }
}); });
} }
}
}) })
}, },
handleSizeChange(value) { handleSizeChange(value) {
...@@ -341,6 +377,16 @@ export default { ...@@ -341,6 +377,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,7 +429,12 @@ export default { ...@@ -383,7 +429,12 @@ export default {
}); });
return; return;
} }
this.setSelectedList();
if(!this.setSelectedPriceList()){
return;
}
// this.setSelectedList();
this.POST(`/diagnose/doctorService/batchDeploy`, this.selectedList).then(res => { this.POST(`/diagnose/doctorService/batchDeploy`, this.selectedList).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.$message({ this.$message({
...@@ -408,10 +459,10 @@ export default { ...@@ -408,10 +459,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){
...@@ -430,7 +481,7 @@ export default { ...@@ -430,7 +481,7 @@ export default {
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});
} }
...@@ -484,7 +535,8 @@ export default { ...@@ -484,7 +535,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 +550,13 @@ export default { ...@@ -498,8 +550,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 +564,14 @@ export default { ...@@ -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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册