服务包明细中增加优惠价格,增加服务项目,修改价格,数量,状态时更新服务包现价

This commit is contained in:
曹磊 2024-06-07 15:58:13 +08:00
parent f6eaa90f9d
commit 0afe64710f
1 changed files with 98 additions and 17 deletions

View File

@ -514,6 +514,7 @@
:visible.sync="dialogFormVisibleDetail"
center
width="80%"
@close="closeDetail"
>
<div style="text-align: right; display: inline-block">
<el-button
@ -567,7 +568,7 @@
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
@change="changeDetailStatus(scope.row.massageTypeId, scope.row.status)"
@change="changeDetailStatus(scope.row)"
:active-value="openValue"
:inactive-value="closeValue"
active-color="#13ce66"
@ -576,6 +577,20 @@
</el-switch>
</template>
</el-table-column>
<el-table-column prop="packagePrice" label="优惠价" width="150">
<template slot-scope="scope">
<span>{{ scope.row.packagePrice }}</span>
<el-button
size="mini"
type="primary"
plain
@click="showUpdatePriceView(scope.row)"
style="margin: 5px"
>修改
</el-button
>
</template>
</el-table-column>
<el-table-column prop="serviceCount" label="次数" width="150">
<template slot-scope="scope">
<span>{{ scope.row.serviceCount }}</span>
@ -630,20 +645,35 @@
</div>
</el-dialog>
<!-- 修改价格 -->
<el-dialog title="修改优惠价" :visible.sync="dialogFormVisiblePrice" center>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right">优惠价</span>
<el-input
style="width: 50%"
v-model="packagePrice"
type="number"
min="0"
placeholder="请输入优惠价"
></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisiblePrice = false"> </el-button>
<el-button type="primary" @click="updatePrice()"> </el-button>
</div>
</el-dialog>
<!-- 修改次数 -->
<el-dialog title="修改次数" :visible.sync="dialogFormVisibleCount" center>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right"
>次数</span
>
<span style="width: 200px; display: inline-block; text-align: right">次数</span>
<el-input
style="width: 50%"
v-model="serviceCount"
type="number"
min="0"
placeholder="请输入次数"
>
</el-input>
></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisibleCount = false"> </el-button>
@ -654,17 +684,14 @@
<!-- 修改间隔 -->
<el-dialog title="修改间隔" :visible.sync="dialogFormVisibleIntervalDays" center>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right"
>间隔()</span
>
<span style="width: 200px; display: inline-block; text-align: right">间隔()</span>
<el-input
style="width: 50%"
v-model="intervalDays"
type="number"
min="0"
placeholder="请输入天数"
>
</el-input>
></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisibleIntervalDays = false"> </el-button>
@ -873,7 +900,7 @@
</div>
</el-dialog>
<!-- 项目列表弹框 -->
<el-dialog title="服务项目列表" :visible.sync="dialogFormVisibleMassageList" width="80%">
<el-dialog title="服务项目列表" :visible.sync="dialogFormVisibleMassageList" width="80%" center>
<div style="position: relative; display: inline-block; margin: 5px">
<span>项目类型</span>
<el-select
@ -1030,6 +1057,7 @@ export default {
detailTableData: {},
mainId: "",//ID
massageTypeId: "",//ID
packagePrice: 0,
serviceCount: 1,
intervalDays: 0,
detailPage: 1,
@ -1039,6 +1067,7 @@ export default {
applyPeople: "",//
duration: "",//
jianjie: "",//
dialogFormVisiblePrice: false,
dialogFormVisibleCount: false,
dialogFormVisibleIntervalDays: false,
dialogFormVisibleAddMassage: false,
@ -1543,6 +1572,10 @@ export default {
},
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
closeDetail(){
this.handleSelect();
},
showDetailView(row){
this.mainId = row.id;
this.handleSelectDetail();
@ -1588,14 +1621,16 @@ export default {
this.handleSelectDetail();
},
changeDetailStatus(massageTypeId, status){
//
changeDetailStatus(row){
this.$http({
url: this.$http.adornUrl(`massage/packageDetail/updateStatus`),
method: "post",
params: this.$http.adornParams({
// data: this.$http.adornData({
massageTypeId: massageTypeId,
status: status,
massageTypeId: row.massageTypeId,
status: row.status,
mainId: row.mainId,
}),
}).then(({data}) => {
this.$message({
@ -1603,15 +1638,58 @@ export default {
type: "success",
duration: 1500,
onClose: () => {
this.handleSelect();
this.handleSelectDetail();
},
});
});
},
//
showUpdatePriceView(row) {
this.id = row.id;
this.mainId = row.mainId;
this.packagePrice = row.packagePrice;
this.dialogFormVisiblePrice = true;
},
//
updatePrice() {
this.$http({
url: this.$http.adornUrl("massage/packageDetail/updatePrice"),
method: "post",
params: this.$http.adornParams({
// data: this.$http.adornData({
id: this.id,
packagePrice: this.packagePrice,
mainId: this.mainId,
}),
}).then(({data}) => {
if (data.code == 0) {
this.$message({
message: "修改成功",
type: "success",
duration: 1500,
onClose: () => {
this.handleSelectDetail();
},
});
this.dialogFormVisiblePrice = false;
} else {
this.$message({
message: data.msg,
type: "warning",
duration: 1500,
onClose: () => {
},
});
}
});
},
//
showUpdateCountView(row) {
this.id = row.id;
this.mainId = row.mainId;
this.serviceCount = row.serviceCount;
this.dialogFormVisibleCount = true;
},
@ -1625,6 +1703,7 @@ export default {
// data: this.$http.adornData({
id: this.id,
serviceCount: this.serviceCount,
mainId: this.mainId,
}),
}).then(({data}) => {
if (data.code == 0) {
@ -1702,6 +1781,7 @@ export default {
params: this.$http.adornParams({
// data: this.$http.adornData({
id: row.id,
mainId: row.mainId
}),
}).then(({data}) => {
if (data.code == 0) {
@ -1864,6 +1944,7 @@ export default {
type: this.type,
jianjie: this.jianjie,
mainId: this.mainId,
packagePrice: this.price,
serviceCount: this.serviceCount,
intervalDays: this.intervalDays,
}),
@ -1897,6 +1978,7 @@ export default {
params: this.$http.adornParams({
// data: this.$http.adornData({
mainId: this.mainId,
packagePrice: row.price,
massageTypeId: row.massageTypeId,
serviceCount: this.serviceCount,
intervalDays: this.intervalDays,
@ -1925,7 +2007,6 @@ export default {
},
showMassageView(){
this.serviceCount = 1;
this.intervalDays = 0;
this.handleSelectMassage();