feat: add request.js utility, service page, and fix hospital image URLs
- Add request.js for unified API calls with loading/error handling - Add service page (service type listing) - Fix hospital list to load from API with proper image URL construction - Add service types dynamic loading on index page - Various mini program improvements (order, care, wallet pages) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
70
rlz-ui/src/api/finance/settlement.js
Normal file
70
rlz-ui/src/api/finance/settlement.js
Normal file
@@ -0,0 +1,70 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询待结算订单列表
|
||||
export function listPendingSettlement(query) {
|
||||
return request({
|
||||
url: '/system/settlement/pending',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 单个结算
|
||||
export function settleOrder(orderId) {
|
||||
return request({
|
||||
url: '/system/settlement/settle/' + orderId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量结算
|
||||
export function batchSettleOrder(orderIds) {
|
||||
return request({
|
||||
url: '/system/settlement/batchSettle',
|
||||
method: 'post',
|
||||
data: orderIds
|
||||
})
|
||||
}
|
||||
|
||||
// 查询平台配置列表
|
||||
export function listPlatformConfig(query) {
|
||||
return request({
|
||||
url: '/system/platformConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取平台配置详情
|
||||
export function getPlatformConfig(id) {
|
||||
return request({
|
||||
url: '/system/platformConfig/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增平台配置
|
||||
export function addPlatformConfig(data) {
|
||||
return request({
|
||||
url: '/system/platformConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改平台配置
|
||||
export function updatePlatformConfig(data) {
|
||||
return request({
|
||||
url: '/system/platformConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除平台配置
|
||||
export function delPlatformConfig(id) {
|
||||
return request({
|
||||
url: '/system/platformConfig/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
146
rlz-ui/src/views/finance/platformConfig/index.vue
Normal file
146
rlz-ui/src/views/finance/platformConfig/index.vue
Normal file
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="配置键" align="center" prop="configKey" width="180" />
|
||||
<el-table-column label="配置值" align="center" prop="configValue" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="warning" size="small">{{ scope.row.configValue }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="描述" align="center" prop="description" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.updateTime || scope.row.createTime || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="配置键" prop="configKey">
|
||||
<el-input v-model="form.configKey" placeholder="请输入配置键" :disabled="isEdit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配置值" prop="configValue">
|
||||
<el-input v-model="form.configValue" placeholder="请输入配置值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" :rows="2" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPlatformConfig, getPlatformConfig, addPlatformConfig, updatePlatformConfig, delPlatformConfig } from "@/api/finance/settlement";
|
||||
|
||||
export default {
|
||||
name: "PlatformConfig",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
configList: [],
|
||||
dialogOpen: false,
|
||||
dialogTitle: "",
|
||||
isEdit: false,
|
||||
form: {},
|
||||
rules: {
|
||||
configKey: [{ required: true, message: "配置键不能为空", trigger: "blur" }],
|
||||
configValue: [{ required: true, message: "配置值不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPlatformConfig({}).then(response => {
|
||||
this.configList = response.rows || response.data || [];
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
reset() {
|
||||
this.form = {};
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.dialogTitle = "新增配置";
|
||||
this.isEdit = false;
|
||||
this.dialogOpen = true;
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.dialogTitle = "修改配置";
|
||||
this.isEdit = true;
|
||||
getPlatformConfig(row.id).then(response => {
|
||||
this.form = response.data;
|
||||
this.dialogOpen = true;
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.isEdit) {
|
||||
updatePlatformConfig(this.form).then(() => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPlatformConfig(this.form).then(() => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const id = row.id || this.ids[0];
|
||||
if (!id) {
|
||||
this.$modal.msgWarning("请选择要删除的配置");
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm('确认删除该配置?').then(() => {
|
||||
return delPlatformConfig(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,18 +1,8 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="订单编号" prop="orderNumber">
|
||||
<el-input v-model="queryParams.orderNumber" placeholder="请输入订单编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="陪护姓名" prop="userbName">
|
||||
<el-input v-model="queryParams.userbName" placeholder="请输入陪护姓名" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结算状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="全部" :value="null" />
|
||||
<el-option label="待结算" value="4" />
|
||||
<el-option label="已结算" value="8" />
|
||||
</el-select>
|
||||
<el-form-item label="订单编号" prop="yuliu1">
|
||||
<el-input v-model="queryParams.yuliu1" placeholder="请输入订单编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@@ -22,87 +12,56 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-money" size="mini" :disabled="multiple" @click="handleBatchSettle">批量结算</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="订单编号" align="center" prop="orderNumber" min-width="160" />
|
||||
<el-table-column label="患者" align="center" prop="usercName" width="100" />
|
||||
<el-table-column label="陪护" align="center" prop="userbName" width="100" />
|
||||
<el-table-column label="医院" align="center" prop="hospitalName" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="结算金额" align="center" prop="jiesuanMoney" width="110">
|
||||
<el-table-column label="订单编号" align="center" prop="yuliu1" width="180" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="支付时间" align="center" prop="updateTime" width="160" />
|
||||
<el-table-column label="订单金额" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.jiesuanMoney || scope.row.yuguMoney || '-' }}
|
||||
<span style="color: #E6A23C; font-weight: bold;">¥{{ scope.row.jiesuanMoney || scope.row.yuguMoney || '0' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="90">
|
||||
<el-table-column label="平台抽成" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.status)" size="small">
|
||||
{{ statusMap[scope.row.status] || scope.row.status }}
|
||||
</el-tag>
|
||||
<span v-if="scope.row.kouchuMoney" style="color: #F56C6C;">¥{{ scope.row.kouchuMoney }}</span>
|
||||
<span v-else style="color: #C0C4CC;">待计算</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成时间" align="center" prop="endTime" width="160" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
|
||||
<el-table-column label="抽成比例" align="center" prop="fanxianTax" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" icon="el-icon-bank-card" @click="handleSettle(scope.row)"
|
||||
v-if="scope.row.status == '4'">结算</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">详情</el-button>
|
||||
{{ scope.row.fanxianTax ? scope.row.fanxianTax + '%' : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="应发金额" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span style="color: #67C23A; font-weight: bold;">¥{{ scope.row.fanxianMoney || '0' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付状态" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.isZhifu === '1'" type="success" size="small">已结算</el-tag>
|
||||
<el-tag v-else type="warning" size="small">待结算</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.isZhifu !== '1'" size="mini" type="primary" @click="handleSettle(scope.row)">结算</el-button>
|
||||
<span v-else style="color: #67C23A;">已打款</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 结算对话框 -->
|
||||
<el-dialog title="订单结算" :visible.sync="dialogOpen" width="450px" append-to-body>
|
||||
<el-form ref="settleForm" :model="settleForm" :rules="settleRules" label-width="100px">
|
||||
<el-form-item label="订单编号">
|
||||
<span>{{ settleForm.orderNumber }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="陪护姓名">
|
||||
<span>{{ settleForm.userbName }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算金额" prop="jiesuanMoney">
|
||||
<el-input v-model="settleForm.jiesuanMoney" placeholder="请输入结算金额">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitSettle">确认结算</el-button>
|
||||
<el-button @click="dialogOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog title="订单详情" :visible.sync="detailOpen" width="650px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="订单编号">{{ detail.orderNumber }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<el-tag :type="statusTagType(detail.status)" size="small">
|
||||
{{ statusMap[detail.status] || detail.status }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="患者">{{ detail.usercName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="陪护">{{ detail.userbName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="医院">{{ detail.hospitalName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="结算金额">{{ detail.jiesuanMoney || detail.yuguMoney || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="扣费">{{ detail.kouchuMoney || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="返现">{{ detail.fanxianMoney || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间" :span="2">{{ detail.createTime }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listSettlementOrders, settleOrder } from "@/api/system/finance";
|
||||
import { getOrderInfo } from "@/api/system/order";
|
||||
import { listPendingSettlement, settleOrder, batchSettleOrder } from "@/api/finance/settlement";
|
||||
|
||||
export default {
|
||||
name: "Settlement",
|
||||
@@ -110,34 +69,25 @@ export default {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
orderList: [],
|
||||
dialogOpen: false,
|
||||
detailOpen: false,
|
||||
detail: {},
|
||||
settleForm: { orderId: null, orderNumber: '', userbName: '', jiesuanMoney: '' },
|
||||
settleRules: {
|
||||
jiesuanMoney: [{ required: true, message: '请输入结算金额', trigger: 'blur' }]
|
||||
},
|
||||
statusMap: { '4': '已完成', '8': '已结算' },
|
||||
queryParams: {
|
||||
pageNum: 1, pageSize: 10,
|
||||
orderNumber: null, userbName: null, status: null,
|
||||
}
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
yuliu1: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
statusTagType(status) {
|
||||
const map = { '4': 'success', '8': 'info' };
|
||||
return map[status] || '';
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSettlementOrders(this.queryParams).then(response => {
|
||||
listPendingSettlement(this.queryParams).then(response => {
|
||||
this.orderList = response.data;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@@ -149,42 +99,34 @@ export default {
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.orderId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleSettle(row) {
|
||||
this.settleForm = {
|
||||
orderId: row.orderId,
|
||||
orderNumber: row.orderNumber,
|
||||
userbName: row.userbName,
|
||||
jiesuanMoney: row.jiesuanMoney || row.yuguMoney || ''
|
||||
};
|
||||
this.dialogOpen = true;
|
||||
const orderId = row.orderId;
|
||||
this.$modal.confirm('确认结算该订单?将向陪诊员打款 ¥' + (row.fanxianMoney || '0')).then(() => {
|
||||
return settleOrder(orderId);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("结算完成");
|
||||
}).catch(() => {});
|
||||
},
|
||||
submitSettle() {
|
||||
this.$refs["settleForm"].validate(valid => {
|
||||
if (valid) {
|
||||
settleOrder(this.settleForm.orderId, {
|
||||
jiesuanMoney: this.settleForm.jiesuanMoney
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("结算成功");
|
||||
this.dialogOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDetail(row) {
|
||||
getOrderInfo(row.orderId).then(response => {
|
||||
this.detail = response.data;
|
||||
this.detailOpen = true;
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('system/view/export', { ...this.queryParams },
|
||||
`settlement_${new Date().getTime()}.xlsx`)
|
||||
handleBatchSettle() {
|
||||
if (this.ids.length === 0) {
|
||||
this.$modal.msgWarning("请选择订单");
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm('确认批量结算 ' + this.ids.length + ' 个订单?').then(() => {
|
||||
return batchSettleOrder(this.ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("批量结算完成");
|
||||
}).catch(() => {});
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@@ -94,6 +94,12 @@
|
||||
<span style="color: #f56c6c; font-weight: bold;">{{ scope.row.price }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图标" align="center" prop="icon" width="80">
|
||||
<template slot-scope="scope">
|
||||
<img v-if="scope.row.icon" :src="scope.row.icon" style="width:40px;height:40px;border-radius:4px;" />
|
||||
<span v-else style="color:#ccc;">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务描述" align="center" prop="description" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
@@ -170,6 +176,9 @@
|
||||
<el-form-item label="服务描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入服务内容描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图标URL" prop="icon">
|
||||
<el-input v-model="form.icon" placeholder="请输入图标URL地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sortOrder">
|
||||
<el-input-number v-model="form.sortOrder" :min="0" style="width: 100%" placeholder="请输入排序号" />
|
||||
</el-form-item>
|
||||
@@ -315,6 +324,7 @@ export default {
|
||||
typeCode: null,
|
||||
price: null,
|
||||
description: null,
|
||||
icon: null,
|
||||
status: '0',
|
||||
sortOrder: 0,
|
||||
remark: null,
|
||||
|
||||
Reference in New Issue
Block a user