服务包订单

This commit is contained in:
曹磊 2024-06-08 22:08:46 +08:00
parent 7b8beb6182
commit 23ee3cfd2e
2 changed files with 150 additions and 0 deletions

View File

@ -201,6 +201,13 @@
@click="handleDelete(scope.row)"
>删除
</el-button>
<el-button
size="mini"
type="danger"
style="margin: 5px"
@click="showBuyView(scope.row)"
>购买
</el-button>
</template>
</el-table-column>
</el-table>
@ -985,6 +992,83 @@
</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>
<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>
</template>
@ -1080,6 +1164,15 @@ export default {
massageLimit: 10,
massageImgPercentage:0,//
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
packageId:"",//ID
ordersNo:"",//
userId:"",//ID
quantity:0,//
payMoney:0,//
payWay:"",//
couponId:"",//ID
dialogFormVisibleBuy: false,
};
},
methods: {
@ -2091,6 +2184,61 @@ export default {
this.province= ""; //
},
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
showBuyView(row){
this.packageId = row.id;
this.userId = "";
this.quantity = 0;
this.couponId = "";
this.packagePrice = row.price;//
this.payMoney = 0;//
this.payWay = "1";//
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: () => {
},
});
}
});
},
},
mounted() {
this.handleSelect();

View File

@ -38,6 +38,7 @@
clearable
v-model="status"
style="width: 150px; margin-left: 10px">
<el-option value="0" label="待支付"></el-option>
<el-option value="1" label="已支付"></el-option>
<el-option value="2" label="已退款"></el-option>
</el-select>&nbsp;&nbsp;
@ -93,6 +94,7 @@
<el-table-column prop="payTime" label="支付时间" width="100"></el-table-column>
<el-table-column prop="status" label="订单状态" fixed="right" width="80">
<template slot-scope="scope">
<span style="color: #f56c6c;" v-if="scope.row.status==0">待支付</span>
<span style="color: #009900;" v-if="scope.row.status==1">已支付</span>
<span style="color: #FF0000;" v-if="scope.row.status==2">已退款</span>
</template>