服务包订单

This commit is contained in:
曹磊 2024-06-12 15:40:23 +08:00
parent a41637bc75
commit ab210afc51
2 changed files with 202 additions and 170 deletions

View File

@ -201,13 +201,20 @@
@click="handleDelete(scope.row)"
>删除
</el-button>
<el-button
size="mini"
type="danger"
style="margin: 5px"
@click="showBuyView(scope.row)"
>购买
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- style="margin: 5px"-->
<!-- @click="showBuyView(scope.row)"-->
<!-- >购买-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- style="margin: 5px"-->
<!-- @click="showPayView()"-->
<!-- >支付-->
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>
@ -992,83 +999,92 @@
</el-dialog>
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<服务项目<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -->
<!-- 购买 -->
<el-dialog title="购买" :visible.sync="dialogFormVisibleBuy" center>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right">订单号</span>
<el-input
style="width: 50%"
v-model="ordersNo"
type="text"
min="0"
placeholder="请输入订单号"
></el-input>
</div>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right">用户</span>
<el-input
style="width: 50%"
v-model="userId"
type="number"
min="0"
placeholder="请输入用户ID"
></el-input>
</div>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right">优惠价</span>
<span style="width: 50%; display: inline-block; text-align: left">{{ packagePrice }}</span>
</div>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right">购买数量</span>
<el-input
style="width: 50%"
v-model="quantity"
type="number"
min="0"
placeholder="请输入购买数量"
></el-input>
</div>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right">支付金额</span>
<el-input
style="width: 50%"
v-model="payMoney"
type="number"
min="0"
placeholder="请输入支付金额"
></el-input>
</div>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right">支付方式</span>
<el-select
clearable
v-model="payWay"
style="width: 150px;">
<el-option value="1" label="app微信"></el-option>
<el-option value="2" label="微信公众号"></el-option>
<el-option value="3" label="微信小程序"></el-option>
<el-option value="4" label="微信公众号浏览器支付"></el-option>
<el-option value="5" label="零钱"></el-option>
<el-option value="6" label="支付宝"></el-option>
</el-select>
</div>
<div style="margin-bottom: 10px">
<span style="width: 200px; display: inline-block; text-align: right">代金卷ID</span>
<el-input
style="width: 50%"
v-model="couponId"
type="text"
min="0"
placeholder="请输入代金卷ID"
></el-input>
</div>
<!-- &lt;!&ndash; 购买 &ndash;&gt;-->
<!-- <el-dialog title="购买" :visible.sync="dialogFormVisibleBuy" center>-->
<!-- <div style="margin-bottom: 10px">-->
<!-- <span style="width: 200px; display: inline-block; text-align: right">用户</span>-->
<!-- <el-input-->
<!-- style="width: 50%"-->
<!-- v-model="userId"-->
<!-- type="number"-->
<!-- min="0"-->
<!-- placeholder="请输入用户ID"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- <div style="margin-bottom: 10px">-->
<!-- <span style="width: 200px; display: inline-block; text-align: right">会员优惠比</span>-->
<!-- <el-input-->
<!-- style="width: 50%"-->
<!-- v-model="vipRate"-->
<!-- type="number"-->
<!-- min="0"-->
<!-- placeholder="请输入会员优惠比"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- <div style="margin-bottom: 10px">-->
<!-- <span style="width: 200px; display: inline-block; text-align: right">购买数量</span>-->
<!-- <el-input-->
<!-- style="width: 50%"-->
<!-- v-model="quantity"-->
<!-- type="number"-->
<!-- min="0"-->
<!-- placeholder="请输入购买数量"-->
<!-- ></el-input>-->
<!-- </div>-->
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisibleBuy = false"> </el-button>
<el-button type="primary" @click="handleBuy()"> </el-button>
</div>
</el-dialog>
<!-- <div style="margin-bottom: 10px">-->
<!-- <span style="width: 200px; display: inline-block; text-align: right">总金额</span>-->
<!-- <el-input-->
<!-- style="width: 50%"-->
<!-- v-model="oldSumMoney"-->
<!-- type="number"-->
<!-- min="0"-->
<!-- placeholder="请输入总金额"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- <div style="margin-bottom: 10px">-->
<!-- <span style="width: 200px; display: inline-block; text-align: right">应付总金额</span>-->
<!-- <el-input-->
<!-- style="width: 50%"-->
<!-- v-model="sumMoney"-->
<!-- type="number"-->
<!-- min="0"-->
<!-- placeholder="请输入应付总金额"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- <div style="margin-bottom: 10px">-->
<!-- <span style="width: 200px; display: inline-block; text-align: right">代金卷ID</span>-->
<!-- <el-input-->
<!-- style="width: 50%"-->
<!-- v-model="couponId"-->
<!-- type="text"-->
<!-- min="0"-->
<!-- placeholder="请输入代金卷ID"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button @click="dialogFormVisibleBuy = false"> </el-button>-->
<!-- <el-button type="primary" @click="handleBuy()"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<!-- &lt;!&ndash; 支付 &ndash;&gt;-->
<!-- <el-dialog title="支付" :visible.sync="dialogFormVisiblePay" center>-->
<!-- <div style="margin-bottom: 10px">-->
<!-- <span style="width: 200px; display: inline-block; text-align: right">订单ID</span>-->
<!-- <el-input-->
<!-- style="width: 50%"-->
<!-- v-model="ordersId"-->
<!-- type="text"-->
<!-- min="0"-->
<!-- placeholder="请输入订单ID"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button @click="dialogFormVisiblePay = false"> </el-button>-->
<!-- <el-button type="primary" @click="handlePay()"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
</div>
</template>
@ -1165,14 +1181,21 @@ export default {
massageImgPercentage:0,//
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
packageId:"",//ID
ordersNo:"",//
userId:"",//ID
quantity:0,//
payMoney:0,//
payWay:"",//
couponId:"",//ID
dialogFormVisibleBuy: false,
// packageId:"",//ID
// ordersNo:"",//
// userId:"",//ID
// quantity:0,//
// payMoney:0,//
// payWay:"",//
// couponId:"",//ID
// dialogFormVisibleBuy: false,
//
// vipRate: 100,
// oldSumMoney: 0,
// sumMoney: 0,
//
// ordersId: "",
// dialogFormVisiblePay: false,
};
},
methods: {
@ -2187,58 +2210,98 @@ export default {
showBuyView(row){
this.packageId = row.id;
this.userId = "";
this.quantity = 0;
this.couponId = "";
this.userId = 400;
this.quantity = 5;
this.couponId = "2636,2635";
this.packagePrice = row.price;//
this.payMoney = 0;//
this.payWay = "1";//
this.vipRate = 90;
this.oldSumMoney = 835;
this.sumMoney = 751.5;
this.dialogFormVisibleBuy = true;
},
handleBuy(){
if(this.quantity <= 0){
this.$message({
message: "购买失败购买数量必须大于0",
type: "warning",
duration: 1500
});
return;
}
this.$http({
url: this.$http.adornUrl("app/user/package/order/buy"),
method: "post",
params: this.$http.adornParams({
ordersNo: this.ordersNo,
packageId: this.packageId,
userId: this.userId,
quantity: this.quantity,
payMoney: this.payMoney,
couponId: this.couponId,
payWay: this.payWay,
}),
}).then(({data}) => {
if (data.code == 0) {
this.$message({
message: "购买成功",
type: "success",
duration: 1500,
onClose: () => {
},
});
this.dialogFormVisibleBuy = false;
} else {
this.$message({
message: data.msg,
type: "warning",
duration: 1500,
onClose: () => {
},
});
}
});
},
// handleBuy(){
// if(this.quantity <= 0){
// this.$message({
// message: "0",
// type: "warning",
// duration: 1500
// });
// return;
// }
// this.$http({
// url: this.$http.adornUrl("app/user/package/order/insertOrders"),
// method: "post",
// // params: this.$http.adornParams({
// data: this.$http.adornData({
// ordersPackageList: [{
// packageId: this.packageId,
// num: this.quantity,
// }],
// vipRate: this.vipRate,
// oldSumMoney: this.oldSumMoney,
// sumMoney: this.sumMoney,
// couponId: this.couponId,
// userId: this.userId,
// }),
// }).then(({data}) => {
// if (data.code == 0) {
// this.$message({
// message: "",
// type: "success",
// duration: 1500,
// onClose: () => {
// },
// });
// this.dialogFormVisibleBuy = false;
// } else {
// this.$message({
// message: data.msg,
// type: "warning",
// duration: 1500,
// onClose: () => {
// },
// });
// }
// });
// },
//
// showPayView(){
// this.ordersId = "";
// this.dialogFormVisiblePay = true;
// },
//
// handlePay(){
// this.$http({
// url: this.$http.adornUrl("app/user/package/order/payOrder"),
// method: "post",
// params: this.$http.adornParams({
// // data: this.$http.adornData({
// ordersId: this.ordersId,
// }),
// }).then(({data}) => {
// if (data.code == 0) {
// this.$message({
// message: "",
// type: "success",
// duration: 1500,
// onClose: () => {
// },
// });
// this.dialogFormVisiblePay = false;
// } else {
// this.$message({
// message: data.msg,
// type: "warning",
// duration: 1500,
// onClose: () => {
// },
// });
// }
// });
// },
},
mounted() {
this.handleSelect();

View File

@ -10,28 +10,6 @@
>
</el-input>
</div>
<div style="position: relative; display: inline-block">
<span>服务类型</span>
<el-select
clearable
v-model="type"
style="width: 150px; margin-left: 10px">
<el-option
v-for="item in typeDictData"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>&nbsp;&nbsp;
</div>
<div style="position: relative; display: inline-block">
<span>服务名称</span>
<el-input
style="width: 200px"
placeholder="请输入服务名称"
v-model="packageName">
</el-input>
</div>
<div style="position: relative; display: inline-block">
<span>状态</span>
<el-select
@ -64,20 +42,11 @@
<el-table-column prop="ordersId" label="编号" width="60" fixed="left"></el-table-column>
<el-table-column prop="ordersNo" label="订单号" width="180" fixed="left"></el-table-column>
<el-table-column prop="userName" label="下单用户"></el-table-column>
<el-table-column prop="type" label="服务类型" width="80">
<template slot-scope="scope">
{{ showDictValue(scope.row.type, typeDictData) }}
</template>
</el-table-column>
<el-table-column prop="packageName" label="服务名称" width="150">
</el-table-column>
<el-table-column prop="vipRate" label="会员优惠比" width="120">
<template slot-scope="scope">
<span>{{ scope.row.vipRate }}%</span>
</template>
</el-table-column>
<el-table-column prop="price" label="单价" width="80"></el-table-column>
<el-table-column prop="quantity" label="数量" width="80"></el-table-column>
<el-table-column prop="oldSumMoney" label="金额" width="80"></el-table-column>
<el-table-column prop="sumMoney" label="应付金额" width="80"></el-table-column>
<el-table-column prop="payMoney" label="支付金额" width="80"></el-table-column>
@ -153,7 +122,7 @@
</el-table>
</el-dialog>
<!-- 显示详情 -->
<!-- 显示详情 需改造订单映射表取数据在匹配服务包再匹配服务包详情-->
<el-dialog title="订单项目详情" :visible.sync="dialogVisibleDetail" center>
<el-table v-loading="detailTableDataLoading" :data="detailTableData">
<el-table-column prop="massageTypeId" label="项目编号"></el-table-column>