|
|
@@ -125,12 +125,36 @@
|
|
|
@click="handleUpdateFlow(scope.row)"
|
|
|
v-if="scope.row.deptId !== 1 && deptLimit"
|
|
|
>充值流量</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleDeductFlow(scope.row)"
|
|
|
+ v-if="scope.row.deptId !== 1 && deptLimit"
|
|
|
+ >扣减流量</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleFlowDetail(scope.row)"
|
|
|
+ v-if="scope.row.deptId !== 1 && deptLimit"
|
|
|
+ >流量明细</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
@click="handleUpdateRedPackage(scope.row)"
|
|
|
v-if="scope.row.deptId !== 1 && deptLimit"
|
|
|
>充值红包</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleDeductRedPackage(scope.row)"
|
|
|
+ v-if="scope.row.deptId !== 1 && deptLimit"
|
|
|
+ >扣减红包</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleRedMoneyDetail(scope.row)"
|
|
|
+ v-if="scope.row.deptId !== 1 && deptLimit"
|
|
|
+ >红包明细</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
@@ -167,11 +191,39 @@
|
|
|
style="width: 100%;"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="充值金额" prop="pad" v-if="resourceForm.type != 0">
|
|
|
+ <el-form-item label="充值金额" prop="pad" v-if="resourceForm.type == 2">
|
|
|
+ <el-input type="number" v-model="resourceForm.money" :min=0>
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ <span style="color: #fb1c1c;display: inline-block">{{flowPrice}}元 / GB</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark" v-if="resourceForm.type == 2">
|
|
|
+ <el-input type="textarea" v-model="resourceForm.remark" placeholder="请输入备注信息" :rows="3" maxlength="200" show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="扣减金额" prop="pad" v-if="resourceForm.type == 3">
|
|
|
+ <el-input type="number" v-model="resourceForm.money" :min=0>
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ <span style="color: #fb1c1c;display: inline-block">{{flowPrice}}元 / GB</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark" v-if="resourceForm.type == 3">
|
|
|
+ <el-input type="textarea" v-model="resourceForm.remark" placeholder="请输入备注信息" :rows="3" maxlength="200" show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="充值金额" prop="pad" v-if="resourceForm.type == 1">
|
|
|
<el-input type="number" v-model="resourceForm.money" :min=0>
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
- <span style="color: #fb1c1c;display: inline-block" v-if="resourceForm.type == 2">{{flowPrice}}元 / GB</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark" v-if="resourceForm.type == 1">
|
|
|
+ <el-input type="textarea" v-model="resourceForm.remark" placeholder="请输入备注信息" :rows="3" maxlength="200" show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="扣减金额" prop="pad" v-if="resourceForm.type == 4">
|
|
|
+ <el-input type="number" v-model="resourceForm.money" :min=0>
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark" v-if="resourceForm.type == 4">
|
|
|
+ <el-input type="textarea" v-model="resourceForm.remark" placeholder="请输入备注信息" :rows="3" maxlength="200" show-word-limit />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -232,11 +284,101 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 流量明细对话框 -->
|
|
|
+ <el-dialog title="部门流量明细" :visible.sync="openFlowDetail" width="1200px" append-to-body>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExportFlowDetail">导出</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table v-loading="flowDetailLoading" :data="flowDetailList">
|
|
|
+ <el-table-column label="操作时间" align="center" prop="createTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作类型" align="center" prop="operateType" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag :type="scope.row.operateType === 0 ? 'success' : 'danger'">
|
|
|
+ {{ scope.row.operateType === 0 ? '充值' : '扣减' }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作数量" align="center" prop="num" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ formatBalance(scope.row.num) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作前余额" align="center" prop="firstNum" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ formatBalance(scope.row.firstNum) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作后余额" align="center" prop="lastNum" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ formatBalance(scope.row.lastNum) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作人" align="center" prop="createBy" width="120" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="flowDetailTotal>0"
|
|
|
+ :total="flowDetailTotal"
|
|
|
+ :page.sync="flowDetailQuery.pageNum"
|
|
|
+ :limit.sync="flowDetailQuery.pageSize"
|
|
|
+ @pagination="getFlowDetailList"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 红包明细对话框 -->
|
|
|
+ <el-dialog title="部门红包明细" :visible.sync="openRedMoneyDetail" width="1200px" append-to-body>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExportRedMoneyDetail">导出</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table v-loading="redMoneyDetailLoading" :data="redMoneyDetailList">
|
|
|
+ <el-table-column label="操作时间" align="center" prop="createTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作类型" align="center" prop="operateType" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag :type="scope.row.operateType === 0 ? 'success' : 'danger'">
|
|
|
+ {{ scope.row.operateType === 0 ? '充值' : '扣减' }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作金额(元)" align="center" prop="num" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.num }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作前余额(元)" align="center" prop="firstNum" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.firstNum }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作后余额(元)" align="center" prop="lastNum" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.lastNum }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作人" align="center" prop="createBy" width="120" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="redMoneyDetailTotal>0"
|
|
|
+ :total="redMoneyDetailTotal"
|
|
|
+ :page.sync="redMoneyDetailQuery.pageNum"
|
|
|
+ :limit.sync="redMoneyDetailQuery.pageSize"
|
|
|
+ @pagination="getRedMoneyDetailList"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild, updatePadNum, addRedMoney, addFlowNum } from "@/api/system/dept";
|
|
|
+import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild, updatePadNum, addRedMoney, addFlowNum, deductFlowNum, flowDetailList, redMoneyDetailList, deductRedMoney, exportRedMoneyDetail, exportFlowDetail } from "@/api/system/dept";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import { addOrEditDeptResource, getDeptResource } from '@/api/system/resourceManagement'
|
|
|
@@ -272,6 +414,26 @@ export default {
|
|
|
// 是否展开
|
|
|
expand: false,
|
|
|
flowPrice: 0,
|
|
|
+ // 流量明细对话框
|
|
|
+ openFlowDetail: false,
|
|
|
+ flowDetailLoading: false,
|
|
|
+ flowDetailList: [],
|
|
|
+ flowDetailTotal: 0,
|
|
|
+ flowDetailQuery: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ deptId: undefined
|
|
|
+ },
|
|
|
+ // 红包明细对话框
|
|
|
+ openRedMoneyDetail: false,
|
|
|
+ redMoneyDetailLoading: false,
|
|
|
+ redMoneyDetailList: [],
|
|
|
+ redMoneyDetailTotal: 0,
|
|
|
+ redMoneyDetailQuery: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ deptId: undefined
|
|
|
+ },
|
|
|
// 状态数据字典
|
|
|
statusOptions: [],
|
|
|
// 查询参数
|
|
|
@@ -435,6 +597,16 @@ export default {
|
|
|
type: 1,
|
|
|
deptId: row.deptId,
|
|
|
money: 0,
|
|
|
+ remark: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleDeductRedPackage(row) {
|
|
|
+ this.openResource = true;
|
|
|
+ this.resourceForm = {
|
|
|
+ type: 4,
|
|
|
+ deptId: row.deptId,
|
|
|
+ money: 0,
|
|
|
+ remark: ''
|
|
|
}
|
|
|
},
|
|
|
handleUpdateFlow(row) {
|
|
|
@@ -443,8 +615,64 @@ export default {
|
|
|
type: 2,
|
|
|
deptId: row.deptId,
|
|
|
money: 0,
|
|
|
+ remark: ''
|
|
|
}
|
|
|
},
|
|
|
+ handleDeductFlow(row) {
|
|
|
+ this.openResource = true;
|
|
|
+ this.resourceForm = {
|
|
|
+ type: 3,
|
|
|
+ deptId: row.deptId,
|
|
|
+ money: 0,
|
|
|
+ remark: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 查看流量明细 */
|
|
|
+ handleFlowDetail(row) {
|
|
|
+ this.openFlowDetail = true;
|
|
|
+ this.flowDetailQuery.deptId = row.deptId;
|
|
|
+ this.flowDetailQuery.pageNum = 1;
|
|
|
+ this.getFlowDetailList();
|
|
|
+ },
|
|
|
+ /** 查询流量明细列表 */
|
|
|
+ getFlowDetailList() {
|
|
|
+ this.flowDetailLoading = true;
|
|
|
+ flowDetailList(this.flowDetailQuery).then(response => {
|
|
|
+ this.flowDetailList = response.rows;
|
|
|
+ this.flowDetailTotal = response.total;
|
|
|
+ this.flowDetailLoading = false;
|
|
|
+ }).catch(() => {
|
|
|
+ this.flowDetailLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 查看红包明细 */
|
|
|
+ handleRedMoneyDetail(row) {
|
|
|
+ this.openRedMoneyDetail = true;
|
|
|
+ this.redMoneyDetailQuery.deptId = row.deptId;
|
|
|
+ this.redMoneyDetailQuery.pageNum = 1;
|
|
|
+ this.getRedMoneyDetailList();
|
|
|
+ },
|
|
|
+ /** 查询红包明细列表 */
|
|
|
+ getRedMoneyDetailList() {
|
|
|
+ this.redMoneyDetailLoading = true;
|
|
|
+ redMoneyDetailList(this.redMoneyDetailQuery).then(response => {
|
|
|
+ this.redMoneyDetailList = response.rows;
|
|
|
+ this.redMoneyDetailTotal = response.total;
|
|
|
+ this.redMoneyDetailLoading = false;
|
|
|
+ }).catch(() => {
|
|
|
+ this.redMoneyDetailLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 导出流量明细 */
|
|
|
+ handleExportFlowDetail() {
|
|
|
+ this.download('/system/dept/exportFlowDetail?deptId=' + this.flowDetailQuery.deptId, {
|
|
|
+ }, `部门流量明细_${new Date().getTime()}.xlsx`);
|
|
|
+ },
|
|
|
+ /** 导出红包明细 */
|
|
|
+ handleExportRedMoneyDetail() {
|
|
|
+ this.download('/system/dept/exportRedMoneyDetail?deptId=' + this.redMoneyDetailQuery.deptId, {
|
|
|
+ }, `部门红包明细_${new Date().getTime()}.xlsx`);
|
|
|
+ },
|
|
|
formatBalance(flow){
|
|
|
//对流量值进行判断,换算成GB或TB
|
|
|
if(!flow){
|
|
|
@@ -519,6 +747,28 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ if(this.resourceForm.type == 3){
|
|
|
+ deductFlowNum(this.resourceForm).then(response => {
|
|
|
+ if(response.code === 200){
|
|
|
+ this.msgSuccess("扣减成功");
|
|
|
+ this.openResource = false;
|
|
|
+ this.getList();
|
|
|
+ }else{
|
|
|
+ this.msgError(response.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if(this.resourceForm.type == 4){
|
|
|
+ deductRedMoney(this.resourceForm).then(response => {
|
|
|
+ if(response.code === 200){
|
|
|
+ this.msgSuccess("扣减成功");
|
|
|
+ this.openResource = false;
|
|
|
+ this.getList();
|
|
|
+ }else{
|
|
|
+ this.msgError(response.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|