This commit is contained in:
张良(004796)
2024-02-05 10:30:25 +08:00
parent ef3a7792d3
commit 862455ff7f
9 changed files with 317 additions and 13 deletions

View File

@@ -54,6 +54,7 @@
<cai-dict-tag :options="genderList" :value="scope.row.gender"/>
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="auditTime" width="180"/>
<el-table-column label="审核时间" align="center" prop="auditTime" width="180"/>
<!-- <el-table-column label="审核备注" align="center" prop="auditRemark"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">

View File

@@ -0,0 +1,104 @@
<template>
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入标题" />
</el-form-item>
<el-form-item label="充值金额" prop="price">
<el-input v-model="form.price" 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="remark">
<el-input v-model="form.remark" placeholder="请输入说明" type="textarea" :rows="2"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="open = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addGoods, getGoods, updateGoods } from '@/api/cai/goods'
export default {
components: {
},
data () {
return {
open: false,
title: '',
form:{
id: undefined,
name: undefined,
price: undefined,
amount: undefined,
remark: undefined,
},
// 表单校验
rules: {
amount: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
price: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
},
buttonLoading: false,
}
},
created() {
},
methods: {
init (id) {
this.form.id = id || undefined;
this.title = (id ? "修改" : "新增") + "充值配置";
this.open = true;
this.$nextTick(() => {
this.$refs['form'].resetFields();
if(this.form.id){
getGoods(id).then(response => {
this.form = response.data;
});
}
})
},
// 表单提交
submitForm () {
this.$refs['form'].validate((valid) => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateGoods(this.form).then(data => {
this.$modal.msgSuccess("修改成功");
this.$modal.buttonLoading = false;
this.open = false
this.$emit('refreshDataList')
}).finally(() => {
this.buttonLoading = false;
});
}else{
addGoods(this.form).then(data => {
this.$modal.msgSuccess("新增成功");
this.buttonLoading = false;
this.open = false
this.$emit('refreshDataList')
}).finally(() => {
this.buttonLoading = false;
});
}
}
})
},
}
}
</script>

View File

@@ -15,6 +15,20 @@
</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="['cai:goods:add']"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
<el-table-column label="ID" align="center" prop="id"/>
<el-table-column label="名称" align="center" prop="name" />
@@ -31,8 +45,8 @@
</template>
</el-table-column>
<el-table-column label="说明" align="center" prop="remark" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@@ -48,7 +62,7 @@
v-hasPermi="['cai:goods:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table-column>
</el-table>
<pagination
@@ -58,16 +72,23 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<goods-add-or-update-dialog v-if="goodsAddOrUpdateDialogVisible" ref="goodsAddOrUpdateDialog" @refreshDataList="getList" />
</div>
</template>
<script>
import {listGoods, updateGoods} from "@/api/cai/goods";
import { delGoods, listGoods, updateGoods } from '@/api/cai/goods'
import GoodsAddOrUpdateDialog from '@/views/cai/goods/goods-add-or-update-dialog.vue'
export default {
name: "Goods",
components: {
GoodsAddOrUpdateDialog
},
data() {
return {
goodsAddOrUpdateDialogVisible: false,
// 遮罩层
loading: true,
// 选中数组
@@ -133,6 +154,31 @@ export default {
row.status = row.status === 1 ? 0 : 1
})
},
handleAdd(){
this.goodsAddOrUpdateDialogVisible = true
this.$nextTick(() => {
this.$refs.goodsAddOrUpdateDialog.init()
})
},
handleUpdate(row){
this.goodsAddOrUpdateDialogVisible = true
this.$nextTick(() => {
this.$refs.goodsAddOrUpdateDialog.init(row.id)
})
},
handleDelete(row){
this.$modal.confirm('是否确认删除充值配置为"' + row.name + '"的数据项?').then(() => {
this.loading = true;
return delGoods(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
}
}
};
</script>

View File

@@ -76,9 +76,9 @@
<image-preview :src="scope.row.photo" width="33px" height="33px"/>
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="createTime" width="160"/>
<el-table-column label="审核次数" align="center" prop="auditCount" />
<el-table-column label="操作ip" align="center" prop="operateIp" show-overflow-tooltip />
<el-table-column label="提交时间" align="center" prop="createTime" width="160"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="90" fixed="right">
<template v-slot="scope">
<el-button

View File

@@ -6,6 +6,21 @@
<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="['cai:withdrawExchange:add']"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="withdrawExchangeList" @selection-change="handleSelectionChange">
<el-table-column label="ID" align="center" prop="id"/>
<el-table-column label="兑换金额" align="center" prop="money" />
@@ -21,8 +36,8 @@
</template>
</el-table-column>
<el-table-column label="说明" align="center" prop="remark" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@@ -38,7 +53,7 @@
v-hasPermi="['cai:withdrawExchange:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table-column>
</el-table>
<pagination
@@ -48,16 +63,23 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<withdraw-exchange-add-or-update-dialog v-if="withdrawExchangeAddOrUpdateDialogVisible" ref="withdrawExchangeAddOrUpdateDialog" @refreshDataList="getList" />
</div>
</template>
<script>
import {listWithdrawExchange, updateWithdrawExchange} from "@/api/cai/withdrawExchange";
import { delWithdrawExchange, listWithdrawExchange, updateWithdrawExchange } from '@/api/cai/withdrawExchange'
import WithdrawExchangeAddOrUpdateDialog from '@/views/cai/withdrawExchange/withdraw-exchange-add-or-update-dialog.vue'
export default {
name: "WithdrawExchange",
components:{
WithdrawExchangeAddOrUpdateDialog
},
data() {
return {
withdrawExchangeAddOrUpdateDialogVisible: false,
// 遮罩层
loading: true,
// 选中数组
@@ -110,7 +132,7 @@ export default {
},
handleStatusChange(row) {
let text = row.status === 0 ? '开启' : '取消'
this.$confirm('确认要' + text + '[' + row.name + ']吗?', '警告', {
this.$confirm('确认要' + text + '[' + row.id + ']吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -122,6 +144,31 @@ export default {
row.status = row.status === 1 ? 0 : 1
})
},
handleAdd(){
this.withdrawExchangeAddOrUpdateDialogVisible = true
this.$nextTick(() => {
this.$refs.withdrawExchangeAddOrUpdateDialog.init()
})
},
handleUpdate(row){
this.withdrawExchangeAddOrUpdateDialogVisible = true
this.$nextTick(() => {
this.$refs.withdrawExchangeAddOrUpdateDialog.init(row.id)
})
},
handleDelete(row){
this.$modal.confirm('是否确认删除提现兑换配置id为"' + row.id + '"的数据项?').then(() => {
this.loading = true;
return delWithdrawExchange(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
}
}
};
</script>

View File

@@ -0,0 +1,97 @@
<template>
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="兑换金额" prop="money">
<el-input v-model="form.money" placeholder="请输入充值金额" />
</el-form-item>
<el-form-item label="所需货币" prop="coinNum">
<el-input v-model="form.coinNum" placeholder="请输入云贝数量" />
</el-form-item>
<el-form-item label="说明" prop="remark">
<el-input v-model="form.remark" placeholder="请输入说明" type="textarea" :rows="2"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="open = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addWithdrawExchange, getWithdrawExchange, updateWithdrawExchange } from '@/api/cai/withdrawExchange'
export default {
components: {
},
data () {
return {
open: false,
title: '',
form:{
id: undefined,
money: undefined,
coinNum: undefined,
remark: undefined,
},
// 表单校验
rules: {
money: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
coinNum: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
},
buttonLoading: false,
}
},
created() {
},
methods: {
init (id) {
this.form.id = id || undefined;
this.title = (id ? "修改" : "新增") + "提现兑换配置";
this.open = true;
this.$nextTick(() => {
this.$refs['form'].resetFields();
if(this.form.id){
getWithdrawExchange(id).then(response => {
this.form = response.data;
});
}
})
},
// 表单提交
submitForm () {
this.$refs['form'].validate((valid) => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateWithdrawExchange(this.form).then(data => {
this.$modal.msgSuccess("修改成功");
this.$modal.buttonLoading = false;
this.open = false
this.$emit('refreshDataList')
}).finally(() => {
this.buttonLoading = false;
});
}else{
addWithdrawExchange(this.form).then(data => {
this.$modal.msgSuccess("新增成功");
this.buttonLoading = false;
this.open = false
this.$emit('refreshDataList')
}).finally(() => {
this.buttonLoading = false;
});
}
}
})
},
}
}
</script>