123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>充值记录-列表</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <!-- 所有的 css & js 资源 -->
- <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
- <link rel="stylesheet" href="../../static/sa.css">
- <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
- <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
- <script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
- <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
- <script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
- <script src="../../static/sa.js"></script>
- <script src="../../static/node_modules/crypto-js/crypto-js.js"></script>
- </head>
- <body>
- <div class="vue-box" style="display: none;" :style="'display: block;'">
- <div class="c-panel">
- <!-- ------------- 检索参数 ------------- -->
- <div class="c-title">检索参数</div>
- <el-form ref="form" :model='p' @submit.native.prevent>
- <sa-item type="text" name="客户名称" v-model="p.customerName"></sa-item>
- <sa-item type="daterange" name="充值时间">
- <el-date-picker
- v-model="p.createTime"
- type="daterange"
- align="right"
- unlink-panels
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="pickerOptions">
- </el-date-picker>
- </sa-item>
- <sa-item name="复核状态" >
- <el-select v-model="p.reviewStatus" clearable placeholder="请选择">
- <el-option
- v-for="item in reviewStatusList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </sa-item>
- <!-- <sa-item type="text" name="有效状态,0-无效已删除、1-有效" v-model="p.status"></sa-item>-->
- <!-- <sa-item type="text" name="盐" v-model="p.salt"></sa-item>-->
- <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
- <br />
- </el-form>
- <!-- ------------- 快捷按钮 ------------- -->
- <!-- <sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item>-->
- <!-- ------------- 数据列表 ------------- -->
- <el-table class="data-table" ref="data-table" :data="dataList" >
- <sa-td type="index" name="序号"></sa-td>
- <sa-td name="客户名称" prop="customerName" ></sa-td>
- <sa-td name="充值金额(元)" prop="preTopupMoney" ></sa-td>
- <sa-td name="优惠金额(元)" prop="discountMoney" ></sa-td>
- <!-- <sa-td name="充值渠道" prop="chargeChannel" ></sa-td>-->
- <sa-td name="余额" prop="totalMoney" ></sa-td>
- <sa-td name="付款方式" prop="payingType" type="enum" :jv="payingTypeObj"></sa-td>
- <sa-td name="经办人" prop="chargePeople" ></sa-td>
- <sa-td name="充值时间" prop="createTime" ></sa-td>
- <sa-td name="复核人员" prop="reviewBy" ></sa-td>
- <sa-td name="充值说明" prop="remark" ></sa-td>
- <el-table-column label="操作" fixed="right" width="240px">
- <template slot-scope="s">
- <el-button class="c-btn" type="success" icon="el-icon-view" v-if="sa.isAuth('tb-charge-record-list-print')"
- @click="print(s.row)">打印单据</el-button>
- <el-button class="c-btn" type="primary" icon="el-icon-edit"
- v-if="s.row.reviewStatus!=1 && sa.isAuth('tb-charge-record-list-review')"
- @click="toReview(s.row)">复审</el-button>
- <el-button class="c-btn" type="danger" icon="el-icon-delete"
- v-if="sa.isAuth('tb-charge-record-list-del')" @click="del(s.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- ------------- 分页 ------------- -->
- <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
- </div>
- </div>
- <script>
- var app = new Vue({
- components: {
- "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
- "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
- },
- el: '.vue-box',
- data: {
- p: { // 查询参数
- id: '', // 主键
- accountId: '', // 客户账户id
- customerId: '', // 客户id
- customerName: '', // 客户名称
- money: '', // 充值金额
- payMoney: '', // 支付金额
- chargeChannel: '', // 充值渠道
- createTime: '', // 充值时间
- chargePeople: '', // 充值人
- no: '', // 订单号
- beforeBalance: '', // 充值前余额
- discountMoney: '', // 优惠金额
- totalMoney:'',
- payingType: '', // 付款方式
- remark: '', // 充值说明
- preTopupMoney:'',
- reviewBy:'',
- reviewTime: '', // 复核时间
- status: '', // 有效状态,0-无效已删除、1-有效
- reviewStatus:'',
- salt: '', // 盐
- pageNo: 1, // 当前页
- pageSize: 10, // 页大小
- sortType: 0 // 排序方式
- },
- pickerOptions: {
- shortcuts: [{
- text: '最近一周',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近一个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近三个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit('pick', [start, end]);
- }
- }]
- },
- reviewStatusList:[
- {id:2,name:'全部'},
- {id:0,name:'未复核'},
- {id:1,name:'已复核'}
- ],
- dataCount: 0,
- dataList: [], // 数据集合
- payingTypeObj: {
- 1: "对公转账",
- 2: "微信支付",
- 3: "支付宝支付",
- 4: "银联支付"
- },
- },
- methods: {
- // 刷新
- f5: function() {
- sa.ajax('/TbChargeRecord/getList', sa.removeNull(this.p), function(res) {
- this.dataList = res.data; // 数据
- this.dataList.forEach((itm)=>{
- itm.preTopupMoney = this.decrypt(itm.preTopupMoney);
- itm.beforeBalance = this.decrypt(itm.beforeBalance);
- itm.totalMoney = this.decrypt(itm.totalMoney);
- itm.discountMoney = this.decrypt(itm.discountMoney);
- });
- this.dataCount = res.dataCount; // 数据总数
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this));
- },
- // 新增
- add: function(data) {
- sa.showIframe('新增数据', 'tb-charge-record-add.html?id=-1', '1000px', '90%');
- },
- print(data) {
- sa.showIframe('打印充值单据', 'print-receipt.html?id=' + data.id, '1000px', '70%');
- },
- //复审
- toReview(data) {
- let ss = data.preTopupMoney?',充值金额:'+data.preTopupMoney+'元)':")";
- sa.confirm('您确认对('+data.customerName+ss+'复审吗?', function() {
- sa.ajax('/TbChargeRecord/review?id=' + data.id, function(res) {
- sa.ok('复审成功');
- this.f5();
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this))
- }.bind(this));
- },
- // 删除
- del: function(data) {
- let ss = data.preTopupMoney?',充值金额:'+data.preTopupMoney+'元)':")";
- sa.confirm('是否删除('+data.customerName+ss+',此操作不可撤销', function() {
- sa.ajax('/TbChargeRecord/delete?id=' + data.id, function(res) {
- sa.arrayDelete(this.dataList, data);
- sa.ok('删除成功');
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this))
- }.bind(this));
- },
- decrypt(word, keyStr) {
- if(!word){
- return;
- }
- keyStr = keyStr || 'h!f78tr#L3D$2Z0q';
- let base64 = CryptoJS.enc.Base64.parse(word);
- let src = CryptoJS.enc.Base64.stringify(base64);
- let key = CryptoJS.enc.Utf8.parse(keyStr);
- let decrypt = CryptoJS.AES.decrypt(src, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7});
- // let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
- return CryptoJS.enc.Utf8.stringify(decrypt).toString();
- },
- },
- created: function() {
- this.f5();
- sa.onInputEnter();
- }
- })
- </script>
- </body>
- </html>
|