|
|
|
|
@ -0,0 +1,307 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
|
|
|
|
|
<el-form-item label="团队名称" prop="deptName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.deptName"
|
|
|
|
|
placeholder="支持模糊搜索"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="类型" prop="orderType">
|
|
|
|
|
<el-select v-model="queryParams.orderType" placeholder="全部" clearable style="width: 140px">
|
|
|
|
|
<el-option v-for="item in orderTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
v-hasPermi="['ai:order:add']"
|
|
|
|
|
>新增</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate"
|
|
|
|
|
v-hasPermi="['ai:order:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
v-hasPermi="['ai:order:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['ai:order:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="groupChargeOrderList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="ID" align="center" prop="id" width="72" />
|
|
|
|
|
<el-table-column label="团队名称" align="center" prop="deptName" min-width="120" show-overflow-tooltip />
|
|
|
|
|
<el-table-column label="类型" align="center" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ orderTypeLabel(scope.row.orderType) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="金额(元)" align="center" prop="money" width="100" />
|
|
|
|
|
<el-table-column label="积分" align="center" prop="amount" width="100" />
|
|
|
|
|
<el-table-column label="状态" align="center" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ statusLabel(scope.row.status) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="时间" align="center" prop="createTime" width="160">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" min-width="160" show-overflow-tooltip />
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['ai:order:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
v-hasPermi="['ai:order:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</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="title" :visible.sync="open" width="560px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
|
|
<el-form-item label="团队ID" prop="deptId">
|
|
|
|
|
<el-input v-model="form.deptId" placeholder="请输入团队ID" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="类型" prop="orderType">
|
|
|
|
|
<el-select v-model="form.orderType" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option v-for="item in orderTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="金额(元)" prop="money">
|
|
|
|
|
<el-input v-model="form.money" placeholder="可选,对账用金额" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="积分" prop="amount">
|
|
|
|
|
<el-input v-model="form.amount" placeholder="充值/退款填正数;手动修改可填负数表示扣减" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
|
<el-select v-model="form.status" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option label="进行中" :value="0" />
|
|
|
|
|
<el-option label="已完成" :value="1" />
|
|
|
|
|
<el-option label="失败" :value="2" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="订单编号" prop="orderNum" v-if="form.id != null">
|
|
|
|
|
<el-input v-model="form.orderNum" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="对账说明、打款信息等" maxlength="500" show-word-limit />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
listGroupChargeOrder,
|
|
|
|
|
getGroupChargeOrder,
|
|
|
|
|
delGroupChargeOrder,
|
|
|
|
|
addGroupChargeOrder,
|
|
|
|
|
updateGroupChargeOrder
|
|
|
|
|
} from "@/api/ai/groupChargeOrder"
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "GroupChargeOrder",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
loading: true,
|
|
|
|
|
ids: [],
|
|
|
|
|
single: true,
|
|
|
|
|
multiple: true,
|
|
|
|
|
showSearch: true,
|
|
|
|
|
total: 0,
|
|
|
|
|
groupChargeOrderList: [],
|
|
|
|
|
title: "",
|
|
|
|
|
open: false,
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
deptName: null,
|
|
|
|
|
orderType: null
|
|
|
|
|
},
|
|
|
|
|
form: {},
|
|
|
|
|
rules: {
|
|
|
|
|
deptId: [{ required: true, message: "请输入团队ID", trigger: "blur" }],
|
|
|
|
|
orderType: [{ required: true, message: "请选择类型", trigger: "change" }],
|
|
|
|
|
amount: [{ required: true, message: "请填写积分", trigger: "blur" }],
|
|
|
|
|
status: [{ required: true, message: "请选择状态", trigger: "change" }]
|
|
|
|
|
},
|
|
|
|
|
orderTypeOptions: [
|
|
|
|
|
{ label: "充值", value: 0 },
|
|
|
|
|
{ label: "退款", value: 1 },
|
|
|
|
|
{ label: "手动修改", value: 2 }
|
|
|
|
|
],
|
|
|
|
|
statusOptions: [
|
|
|
|
|
{ label: "进行中", value: 0 },
|
|
|
|
|
{ label: "已完成", value: 1 },
|
|
|
|
|
{ label: "失败", value: 2 }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
orderTypeLabel(orderType) {
|
|
|
|
|
const n = orderType !== undefined && orderType !== null ? Number(orderType) : null
|
|
|
|
|
const hit = this.orderTypeOptions.find(o => o.value === n)
|
|
|
|
|
return hit ? hit.label : "—"
|
|
|
|
|
},
|
|
|
|
|
statusLabel(status) {
|
|
|
|
|
const n = status !== undefined && status !== null ? Number(status) : null
|
|
|
|
|
const hit = this.statusOptions.find(o => o.value === n)
|
|
|
|
|
return hit ? hit.label : "—"
|
|
|
|
|
},
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
listGroupChargeOrder(this.queryParams).then(response => {
|
|
|
|
|
this.groupChargeOrderList = response.rows
|
|
|
|
|
this.total = response.total
|
|
|
|
|
this.loading = false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false
|
|
|
|
|
this.reset()
|
|
|
|
|
},
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
id: null,
|
|
|
|
|
deptId: undefined,
|
|
|
|
|
orderType: 0,
|
|
|
|
|
money: undefined,
|
|
|
|
|
amount: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
status: 1,
|
|
|
|
|
orderNum: undefined
|
|
|
|
|
}
|
|
|
|
|
this.resetForm("form")
|
|
|
|
|
},
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.resetForm("queryForm")
|
|
|
|
|
this.handleQuery()
|
|
|
|
|
},
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
|
this.single = selection.length !== 1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset()
|
|
|
|
|
this.open = true
|
|
|
|
|
this.title = "新增团队充值退款订单"
|
|
|
|
|
},
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset()
|
|
|
|
|
const id = row.id || this.ids[0]
|
|
|
|
|
getGroupChargeOrder(id).then(response => {
|
|
|
|
|
this.form = response.data
|
|
|
|
|
this.open = true
|
|
|
|
|
this.title = "修改团队充值退款订单"
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (!valid) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const payload = { ...this.form }
|
|
|
|
|
if (payload.id == null) {
|
|
|
|
|
addGroupChargeOrder(payload).then(() => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功")
|
|
|
|
|
this.open = false
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
updateGroupChargeOrder(payload).then(() => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功")
|
|
|
|
|
this.open = false
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const ids = row.id || this.ids
|
|
|
|
|
this.$modal.confirm("是否确认删除所选团队充值退款订单?").then(() => {
|
|
|
|
|
return delGroupChargeOrder(ids)
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList()
|
|
|
|
|
this.$modal.msgSuccess("删除成功")
|
|
|
|
|
}).catch(() => {})
|
|
|
|
|
},
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download("ai/group/chargeorder/export", {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `group_charge_order_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|