首页业务处理

This commit is contained in:
13405411873 2024-10-24 22:29:31 +08:00 committed by xvv
parent 89ae9c0b56
commit e2f5eb7bde
2 changed files with 280 additions and 280 deletions

View File

@ -56,7 +56,7 @@ export function exportOrderInfoExcel(params) {
export function toPay(params) {
return request({
url: '/admin-api/pay/toPay',
url: '/admin-api/pay/toPayCode',
method: 'get',
params
})

View File

@ -1,289 +1,289 @@
<!--<template>-->
<!-- <div class="app-container">-->
<!-- &lt;!&ndash; 搜索工作栏 &ndash;&gt;-->
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
<!-- <el-form-item label="订单号" prop="orderNo">-->
<!-- <el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="服务名称" prop="goodsTitle">-->
<!-- <el-input v-model="queryParams.goodsTitle" placeholder="请输入服务名称" clearable-->
<!-- @keyup.enter.native="handleQuery"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="客户姓名" prop="cusName">-->
<!-- <el-input v-model="queryParams.cusName" placeholder="请输入服务名称" clearable-->
<!-- @keyup.enter.native="handleQuery"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="支付方式" prop="payType">-->
<!-- <el-select v-model="queryParams.payType" placeholder="请选择支付方式">-->
<!-- <el-option v-for="dict in this.getDictDatas(DICT_TYPE.REPAIR_PAY_TYPE)"-->
<!-- :key="dict.value" :label="dict.label" :value="dict.value"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="订单状态" prop="orderStatus">-->
<!-- <el-select v-model="queryParams.orderStatus" placeholder="请选择订单状态">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>-->
<!-- <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="订单号" prop="orderNo">
<el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="服务名称" prop="goodsTitle">
<el-input v-model="queryParams.goodsTitle" placeholder="请输入服务名称" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户姓名" prop="cusName">
<el-input v-model="queryParams.cusName" placeholder="请输入服务名称" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="支付方式" prop="payType">
<el-select v-model="queryParams.payType" placeholder="请选择支付方式">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.REPAIR_PAY_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="订单状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择订单状态">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- &lt;!&ndash; 操作工具栏 &ndash;&gt;-->
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"/>-->
<!-- </el-row>-->
<!-- <div class="census">-->
<!-- <span class="credited">已入账&nbsp;:&nbsp;{{ census?.credited || 0 }}</span>-->
<!-- <span class="notCredited">待入账&nbsp;:&nbsp;{{ census?.notCredited || 0 }}</span>-->
<!-- <span class="onlinePay">线上支付&nbsp;:&nbsp;{{ census?.onlinePay || 0 }}</span>-->
<!-- <span class="cashPay">线下支付&nbsp;:&nbsp;{{ census?.cashPay || 0 }}</span>-->
<!-- <span class="signedPay">签单/挂账&nbsp;:&nbsp;{{ census?.signedPay || 0 }}</span>-->
<!-- </div>-->
<!-- <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">-->
<!-- <el-table-column label="订单号" align="center" prop="orderNo"/>-->
<!-- <el-table-column label="服务名称" align="center" prop="goodsTitle"/>-->
<!-- <el-table-column label="消费类型" align="center" prop="goodsType">-->
<!-- <template v-slot="scope">-->
<!-- <span v-if="scope.row.goodsType == '1'">会员充值</span>-->
<!-- <span v-if="scope.row.goodsType == '2'">维修服务</span>-->
<!-- <span v-if="scope.row.goodsType == '3'">保养卡</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="客户姓名" align="center" prop="cusName"/>-->
<!-- <el-table-column label="客户手机号" align="center" prop="cusPhone"/>-->
<!-- <el-table-column label="商品原价(元)" align="center" prop="goodsPrice"/>-->
<!-- <el-table-column label="实付金额(元)" align="center" prop="payMoney"/>-->
<!-- <el-table-column label="下单时间" align="center" prop="orderTime" width="180">-->
<!-- <template v-slot="scope">-->
<!-- <span>{{ parseTime(scope.row.orderTime) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="支付时间" align="center" prop="payTime" width="180">-->
<!-- <template v-slot="scope">-->
<!-- <span>{{ parseTime(scope.row.payTime) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="支付方式" align="center" prop="payType">-->
<!-- <template v-slot="scope">-->
<!-- <dict-tag :type="DICT_TYPE.REPAIR_PAY_TYPE" :value="scope.row.payType"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="订单状态" align="center" prop="orderStatus">-->
<!-- <template v-slot="scope">-->
<!-- <el-tag type="warning" v-if="scope.row.orderStatus === '0'">待支付</el-tag>-->
<!-- <el-tag type="success" v-if="scope.row.orderStatus === '1'">已支付</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" width="150" align="center" class-name="small-padding fixed-width">-->
<!-- <template v-slot="scope">-->
<!-- <el-button v-if="scope.row.orderStatus === '0'" size="mini" type="text" icon="el-icon-edit"-->
<!-- @click="toPay(scope.row)"-->
<!-- v-hasPermi="['repair:order-info:update']">支付-->
<!-- </el-button>-->
<!-- &lt;!&ndash; <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"&ndash;&gt;-->
<!-- &lt;!&ndash; v-hasPermi="['repair:order-info:update']">修改&ndash;&gt;-->
<!-- &lt;!&ndash; </el-button>&ndash;&gt;-->
<!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['repair:order-info:delete']">删除-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- &lt;!&ndash; 展示形式二维码 URL &ndash;&gt;-->
<!-- <el-dialog title="微信扫一扫" :visible.sync="qrCode.visible" width="700px" append-to-body-->
<!-- :close-on-press-escape="false">-->
<!-- <qrcode-vue :value="qrCode.url" size="500" level="L"/>-->
<!-- </el-dialog>-->
<!-- &lt;!&ndash; 分页组件 &ndash;&gt;-->
<!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"/>-->
<!-- &lt;!&ndash; 对话框(添加 / 修改) &ndash;&gt;-->
<!-- <OrderInfoForm ref="formRef" @success="getList"/>-->
<!-- </div>-->
<!--</template>-->
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"/>
</el-row>
<div class="census">
<span class="credited">已入账&nbsp;:&nbsp;{{ census?.credited || 0 }}</span>
<span class="notCredited">待入账&nbsp;:&nbsp;{{ census?.notCredited || 0 }}</span>
<span class="onlinePay">线上支付&nbsp;:&nbsp;{{ census?.onlinePay || 0 }}</span>
<span class="cashPay">线下支付&nbsp;:&nbsp;{{ census?.cashPay || 0 }}</span>
<span class="signedPay">签单/挂账&nbsp;:&nbsp;{{ census?.signedPay || 0 }}</span>
</div>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="订单号" align="center" prop="orderNo"/>
<el-table-column label="服务名称" align="center" prop="goodsTitle"/>
<el-table-column label="消费类型" align="center" prop="goodsType">
<template v-slot="scope">
<span v-if="scope.row.goodsType == '1'">会员充值</span>
<span v-if="scope.row.goodsType == '2'">维修服务</span>
<span v-if="scope.row.goodsType == '3'">保养卡</span>
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="cusName"/>
<el-table-column label="客户手机号" align="center" prop="cusPhone"/>
<el-table-column label="商品原价(元)" align="center" prop="goodsPrice"/>
<el-table-column label="实付金额(元)" align="center" prop="payMoney"/>
<el-table-column label="下单时间" align="center" prop="orderTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.orderTime) }}</span>
</template>
</el-table-column>
<el-table-column label="支付时间" align="center" prop="payTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column label="支付方式" align="center" prop="payType">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.REPAIR_PAY_TYPE" :value="scope.row.payType"/>
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" prop="orderStatus">
<template v-slot="scope">
<el-tag type="warning" v-if="scope.row.orderStatus === '0'">待支付</el-tag>
<el-tag type="success" v-if="scope.row.orderStatus === '1'">已支付</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button v-if="scope.row.orderStatus === '0'" size="mini" type="text" icon="el-icon-edit"
@click="toPay(scope.row)"
v-hasPermi="['repair:order-info:update']">支付
</el-button>
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"-->
<!-- v-hasPermi="['repair:order-info:update']">修改-->
<!-- </el-button>-->
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['repair:order-info:delete']">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 展示形式二维码 URL -->
<el-dialog title="微信扫一扫" :visible.sync="qrCode.visible" width="700px" append-to-body
:close-on-press-escape="false">
<qrcode-vue :value="qrCode.url" size="500" level="L"/>
</el-dialog>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<OrderInfoForm ref="formRef" @success="getList"/>
</div>
</template>
<!--<script>-->
<!--import * as OrderInfoApi from '@/api/repair/orderinfo';-->
<!--import OrderInfoForm from './OrderInfoForm.vue';-->
<!--import QrcodeVue from 'qrcode.vue'-->
<!--import {getOrderCensus} from "@/api/repair/orderinfo";-->
<script>
import * as OrderInfoApi from '@/api/repair/orderinfo';
import OrderInfoForm from './OrderInfoForm.vue';
import QrcodeVue from 'qrcode.vue'
import {getOrderCensus} from "@/api/repair/orderinfo";
<!--export default {-->
<!-- name: "OrderInfo",-->
<!-- components: {-->
<!-- OrderInfoForm,-->
<!-- QrcodeVue-->
<!-- },-->
<!-- data() {-->
<!-- return {-->
<!-- qrCode: { // -->
<!-- url: '',-->
<!-- title: '',-->
<!-- visible: false,-->
<!-- },-->
<!-- options: [{-->
<!-- value: '0',-->
<!-- label: '待支付'-->
<!-- }, {-->
<!-- value: '1',-->
<!-- label: '已支付'-->
<!-- }],-->
<!-- // -->
<!-- loading: true,-->
<!-- // -->
<!-- exportLoading: false,-->
<!-- // -->
<!-- showSearch: true,-->
<!-- // -->
<!-- total: 0,-->
<!-- // -->
<!-- list: [],-->
<!-- // -->
<!-- isExpandAll: true,-->
<!-- // -->
<!-- refreshTable: true,-->
<!-- // -->
<!-- currentRow: {},-->
<!-- // -->
<!-- queryParams: {-->
<!-- pageNo: 1,-->
<!-- pageSize: 10,-->
<!-- orderNo: null,-->
<!-- goodsTitle: null,-->
<!-- goodsType: null,-->
<!-- cusName: null,-->
<!-- payType: null,-->
<!-- orderStatus: null-->
<!-- },-->
<!-- census: {-->
<!-- credited: null,-->
<!-- notCredited: null,-->
<!-- onlinePay: null,-->
<!-- cashPay: null,-->
<!-- signedPay: null-->
<!-- }-->
<!-- };-->
<!-- },-->
<!-- created() {-->
<!-- this.getList();-->
<!-- this.getCensus()-->
<!-- },-->
<!-- methods: {-->
<!-- /** 查询列表 */-->
<!-- async getList() {-->
<!-- try {-->
<!-- this.loading = true;-->
<!-- const res = await OrderInfoApi.getOrderInfoPage(this.queryParams);-->
<!-- this.list = res.data.records;-->
<!-- this.total = res.data.total;-->
<!-- } finally {-->
<!-- this.loading = false;-->
<!-- }-->
<!-- },-->
<!-- /** 搜索按钮操作 */-->
<!-- handleQuery() {-->
<!-- this.queryParams.pageNo = 1;-->
<!-- this.getList();-->
<!-- },-->
<!-- /** 重置按钮操作 */-->
<!-- resetQuery() {-->
<!-- this.resetForm("queryForm");-->
<!-- this.handleQuery();-->
<!-- },-->
<!-- async toPay(row) {-->
<!-- if (row.payType == '01') {-->
<!-- const orderId = row.id-->
<!-- let data = {-->
<!-- orderId: orderId-->
<!-- }-->
<!-- const res = await OrderInfoApi.toPay(data);-->
<!-- console.log(res, 208)-->
<!-- this.qrCode = {-->
<!-- url: res.data.code_url,-->
<!-- visible: true-->
<!-- }-->
<!-- } else {-->
<!-- await this.$modal.confirm('本订单为线下支付订单或挂账订单,点击确定前请确认客户是否已支付')-->
<!-- let data = {-->
<!-- orderNo: row.orderNo,-->
<!-- }-->
<!-- await OrderInfoApi.updateOrderInfo(data);-->
<!-- this.$modal.msgSuccess("支付成功");-->
<!-- this.getList()-->
<!-- }-->
export default {
name: "OrderInfo",
components: {
OrderInfoForm,
QrcodeVue
},
data() {
return {
qrCode: { //
url: '',
title: '',
visible: false,
},
options: [{
value: '0',
label: '待支付'
}, {
value: '1',
label: '已支付'
}],
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
isExpandAll: true,
//
refreshTable: true,
//
currentRow: {},
//
queryParams: {
pageNo: 1,
pageSize: 10,
orderNo: null,
goodsTitle: null,
goodsType: null,
cusName: null,
payType: null,
orderStatus: null
},
census: {
credited: null,
notCredited: null,
onlinePay: null,
cashPay: null,
signedPay: null
}
};
},
created() {
this.getList();
this.getCensus()
},
methods: {
/** 查询列表 */
async getList() {
try {
this.loading = true;
const res = await OrderInfoApi.getOrderInfoPage(this.queryParams);
this.list = res.data.records;
this.total = res.data.total;
} finally {
this.loading = false;
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
async toPay(row) {
if (row.payType == '01') {
const orderId = row.id
let data = {
orderId: orderId
}
const res = await OrderInfoApi.toPay(data);
console.log(res, 208)
this.qrCode = {
url: res.data.code_url,
visible: true
}
} else {
await this.$modal.confirm('本订单为线下支付订单或挂账订单,点击确定前请确认客户是否已支付')
let data = {
orderNo: row.orderNo,
}
await OrderInfoApi.updateOrderInfo(data);
this.$modal.msgSuccess("支付成功");
this.getList()
}
<!-- },-->
<!-- /** 添加/修改操作 */-->
<!-- openForm(id) {-->
<!-- this.$refs["formRef"].open(id);-->
<!-- },-->
<!-- /** 删除按钮操作 */-->
<!-- async handleDelete(row) {-->
<!-- const id = row.id;-->
<!-- await this.$modal.confirm('是否确认删除维修模块 订单编号为"' + row.orderNo + '"的数据项?')-->
<!-- try {-->
<!-- await OrderInfoApi.deleteOrderInfo(id);-->
<!-- await this.getList();-->
<!-- this.$modal.msgSuccess("删除成功");-->
<!-- } catch {-->
<!-- }-->
<!-- },-->
<!-- /** 导出按钮操作 */-->
<!-- async handleExport() {-->
<!-- await this.$modal.confirm('是否确认导出所有维修模块 订单数据项?');-->
<!-- try {-->
<!-- this.exportLoading = true;-->
<!-- const data = await OrderInfoApi.exportOrderInfoExcel(this.queryParams);-->
<!-- this.$download.excel(data, '维修模块 订单.xls');-->
<!-- } catch {-->
<!-- } finally {-->
<!-- this.exportLoading = false;-->
<!-- }-->
<!-- },-->
<!-- async getCensus() {-->
<!-- const res = await getOrderCensus()-->
<!-- this.census = res.data-->
<!-- },-->
<!-- }-->
<!--};-->
<!--</script>-->
<!--<style scoped lang="scss">-->
<!--.census {-->
<!-- display: flex;-->
<!-- justify-content: right;-->
<!-- font-weight: bold;-->
<!-- font-size: 16px;-->
<!-- margin: 1rem 1rem 1rem 0;-->
<!--}-->
},
/** 添加/修改操作 */
openForm(id) {
this.$refs["formRef"].open(id);
},
/** 删除按钮操作 */
async handleDelete(row) {
const id = row.id;
await this.$modal.confirm('是否确认删除维修模块 订单编号为"' + row.orderNo + '"的数据项?')
try {
await OrderInfoApi.deleteOrderInfo(id);
await this.getList();
this.$modal.msgSuccess("删除成功");
} catch {
}
},
/** 导出按钮操作 */
async handleExport() {
await this.$modal.confirm('是否确认导出所有维修模块 订单数据项?');
try {
this.exportLoading = true;
const data = await OrderInfoApi.exportOrderInfoExcel(this.queryParams);
this.$download.excel(data, '维修模块 订单.xls');
} catch {
} finally {
this.exportLoading = false;
}
},
async getCensus() {
const res = await getOrderCensus()
this.census = res.data
},
}
};
</script>
<style scoped lang="scss">
.census {
display: flex;
justify-content: right;
font-weight: bold;
font-size: 16px;
margin: 1rem 1rem 1rem 0;
}
<!--.census > span {-->
<!-- padding-left: 3rem;-->
<!--}-->
.census > span {
padding-left: 3rem;
}
<!--.credited {-->
<!-- color: green;-->
<!--}-->
.credited {
color: green;
}
<!--.notCredited {-->
<!-- color: gray;-->
<!--}-->
.notCredited {
color: gray;
}
<!--.onlinePay {-->
<!-- color: blue;-->
<!--}-->
.onlinePay {
color: blue;
}
<!--.cashPay {-->
<!-- color: goldenrod;-->
<!--}-->
.cashPay {
color: goldenrod;
}
<!--.signedPay {-->
<!-- color: orange;-->
<!--}-->
<!--</style>-->
.signedPay {
color: orange;
}
</style>