master
lion 12 hours ago
parent 3156b6a86e
commit 0a9e100401

@ -19,6 +19,13 @@
<el-option label="未分配" value="unassigned" /> <el-option label="未分配" value="unassigned" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="退款状态">
<el-select v-model="searchForm.refund_status" placeholder="请选择退款状态" clearable @clear="handleSearch">
<el-option label="退款审核中" value="pending" />
<el-option label="已驳回" value="rejected" />
<el-option label="已退款" value="refunded" />
</el-select>
</el-form-item>
<el-form-item label="产品区域"> <el-form-item label="产品区域">
<el-select v-model="searchForm.site_id" placeholder="请选择产品区域" clearable @clear="handleSearch"> <el-select v-model="searchForm.site_id" placeholder="请选择产品区域" clearable @clear="handleSearch">
<el-option v-for="item in siteList" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in siteList" :key="item.id" :label="item.name" :value="item.id" />
@ -93,6 +100,14 @@
:edit-render="{ name: 'VxeTreeSelect', options: Array.from(pay_status), props: { multiple: false }, optionProps: { value: '0', label: '1' } }" :edit-render="{ name: 'VxeTreeSelect', options: Array.from(pay_status), props: { multiple: false }, optionProps: { value: '0', label: '1' } }"
/> />
<vxe-column
align="center"
field="refund_display_status"
width="120"
title="退款状态"
:formatter="formatRefundDisplayStatus"
/>
<vxe-column <vxe-column
align="center" align="center"
field="status" field="status"
@ -368,9 +383,17 @@ export default {
[3, '已到医院'], [3, '已到医院'],
[4, '已完成诊疗'] [4, '已完成诊疗']
]), ]),
refund_display_status: new Map([
['pending', '退款审核中'],
['rejected', '已驳回'],
['refunded', '已退款'],
['none', '—']
]),
searchForm: { searchForm: {
pay_status: '', pay_status: '',
status: '' status: '',
refund_status: '',
site_id: ''
} }
} }
}, },
@ -401,6 +424,18 @@ export default {
this.calcTableHeight() this.calcTableHeight()
}, },
methods: { methods: {
formatRefundDisplayStatus({ cellValue, row }) {
const key = cellValue || (row && row.refund_display_status)
if (key && this.refund_display_status.has(key)) {
const label = this.refund_display_status.get(key)
return label === '—' ? '' : label
}
if (row && Number(row.pay_status) === 2) return '已退款'
if (row && (row.has_pending_refund === true || row.has_pending_refund === 1 || row.has_pending_refund === '1')) {
return '退款审核中'
}
return ''
},
calcTableHeight() { calcTableHeight() {
const clientHeight = document.documentElement.clientHeight const clientHeight = document.documentElement.clientHeight
const cardTitle = document.querySelector('.el-card__header')?.getBoundingClientRect()?.height const cardTitle = document.querySelector('.el-card__header')?.getBoundingClientRect()?.height
@ -543,6 +578,7 @@ export default {
const res = await index({ const res = await index({
...this.select, ...this.select,
refund_status: this.searchForm.refund_status || '',
show_relation: ['accompanyProduct', 'userArchive', 'nurse'], show_relation: ['accompanyProduct', 'userArchive', 'nurse'],
filter: filter filter: filter
}, false) }, false)
@ -626,8 +662,9 @@ export default {
resetSearch() { resetSearch() {
this.searchForm = { this.searchForm = {
pay_status: '', pay_status: '',
site_id:'', site_id: '',
status: '' status: '',
refund_status: ''
} }
this.select.page = 1 this.select.page = 1
this.getList() this.getList()

@ -7,6 +7,11 @@
<vxe-toolbar ref="toolbar" :export="isHasAuth('export')" :print="isHasAuth('print')" custom> <vxe-toolbar ref="toolbar" :export="isHasAuth('export')" :print="isHasAuth('print')" custom>
<template #buttons> <template #buttons>
<el-input v-if="isHasAuth('search')" v-model="select.keyword" style="width: 160px;margin-right: 10px;" clearable size="small" placeholder="关键词搜索" /> <el-input v-if="isHasAuth('search')" v-model="select.keyword" style="width: 160px;margin-right: 10px;" clearable size="small" placeholder="关键词搜索" />
<el-select v-if="isHasAuth('search')" v-model="searchForm.status" style="width: 160px;margin-right: 10px;" clearable size="small" placeholder="退款状态" @change="handleSearch">
<el-option label="退款审核中" :value="0" />
<el-option label="已退款" :value="1" />
<el-option label="已驳回" :value="2" />
</el-select>
<el-button <el-button
v-if="isHasAuth('create')" v-if="isHasAuth('create')"
icon="el-icon-plus" icon="el-icon-plus"
@ -93,12 +98,19 @@
field="no" field="no"
width="180" width="180"
/> />
<vxe-column
align="center"
title="退款理由"
field="apply_reason"
min-width="180"
/>
<vxe-column <vxe-column
align="center" align="center"
field="status" field="status"
width="180" width="180"
title="状态" title="状态"
:edit-render="{ name: 'VxeSelect', options: [{'value':0,'label':'未退款'},{'value':1,'label':'退款成功'},{'value':2,'label':'退款失败'}], props: { multiple: false }, optionProps: { value: 'value', label: 'label' } }" :formatter="({ cellValue }) => ({ 0: '退款审核中', 1: '已退款', 2: '已驳回' }[cellValue] || cellValue)"
:edit-render="{ name: 'VxeSelect', options: [{'value':0,'label':'退款审核中'},{'value':1,'label':'已退款'},{'value':2,'label':'已驳回'}], props: { multiple: false }, optionProps: { value: 'value', label: 'label' } }"
/> />
<vxe-column <vxe-column
align="center" align="center"
@ -234,6 +246,9 @@ export default {
total: 0, total: 0,
allAlign: null, allAlign: null,
tableData: [], tableData: [],
searchForm: {
status: ''
},
form: { form: {
id: '', id: '',
@ -353,10 +368,19 @@ export default {
} }
}, },
handleSearch() {
this.select.page = 1
this.getList()
},
async getList() { async getList() {
this.loading = true this.loading = true
try { try {
const res = await index(this.select, false) const params = { ...this.select }
if (this.searchForm.status !== '' && this.searchForm.status !== null && this.searchForm.status !== undefined) {
params.status = this.searchForm.status
}
const res = await index(params, false)
this.tableData = res.data this.tableData = res.data
this.total = res.total this.total = res.total
this.loading = false this.loading = false

@ -31,6 +31,12 @@
<el-tag v-for="item in scope.row.site" type="danger" style="margin-right:10px">{{item.name}}</el-tag> <el-tag v-for="item in scope.row.site" type="danger" style="margin-right:10px">{{item.name}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="站点总账号" width="120" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_site_master" type="success" size="small"></el-tag>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" @click="handleEdit(scope.row)"></el-button> <el-button size="mini" @click="handleEdit(scope.row)"></el-button>
@ -76,6 +82,10 @@
<el-option v-for="item in siteList" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in siteList" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="站点总账号">
<el-switch v-model="addForm.is_site_master" active-text="" inactive-text="" />
<span class="form-tip">开启后可在工作人员小程序审核本站陪护订单退款需绑定站点</span>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false"> </el-button> <el-button @click="addDialogVisible = false"> </el-button>
@ -109,7 +119,8 @@ export default {
newPassword: '', newPassword: '',
name: '', name: '',
mobile: '', mobile: '',
site_id:'' site_id: '',
is_site_master: false
}, },
addRules: { addRules: {
username: [ username: [
@ -191,7 +202,8 @@ export default {
newPassword: '', newPassword: '',
name: '', name: '',
mobile: '', mobile: '',
site_id:'' site_id: '',
is_site_master: false
} }
}) })
}, },
@ -205,7 +217,13 @@ export default {
siteIds = row.site_id.split(",") siteIds = row.site_id.split(",")
} }
console.log("siteIds",siteIds.map(Number)) console.log("siteIds",siteIds.map(Number))
this.addForm = { ...row, password: '', newPassword: '',site_id: siteIds.map(Number)} this.addForm = {
...row,
password: '',
newPassword: '',
site_id: siteIds.map(Number),
is_site_master: !!(row.is_site_master === true || row.is_site_master === 1 || row.is_site_master === '1')
}
console.log("this.addForm",this.addForm.site_id) console.log("this.addForm",this.addForm.site_id)
}) })
}, },
@ -238,6 +256,7 @@ export default {
this.$refs.addFormRef.validate(async valid => { this.$refs.addFormRef.validate(async valid => {
if (valid) { if (valid) {
let submitData = { ...this.addForm, site_id : this.addForm.site_id?this.addForm.site_id.join(","):''} let submitData = { ...this.addForm, site_id : this.addForm.site_id?this.addForm.site_id.join(","):''}
delete submitData.site
console.log("addForm",this.addForm) console.log("addForm",this.addForm)
// this.submitData.site_id = this.addForm.site_id?this.addForm.site_id.join(","):'' // this.submitData.site_id = this.addForm.site_id?this.addForm.site_id.join(","):''
console.log("submitData",submitData) console.log("submitData",submitData)
@ -311,4 +330,12 @@ h1 {
margin-top: 20px; margin-top: 20px;
text-align: right; text-align: right;
} }
.form-tip {
display: block;
margin-top: 8px;
font-size: 12px;
color: #909399;
line-height: 1.5;
}
</style> </style>

Loading…
Cancel
Save