tb-charge-record-list.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>充值记录-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
  11. <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
  12. <script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
  13. <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
  14. <script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <script src="../../static/node_modules/crypto-js/crypto-js.js"></script>
  17. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <sa-item type="text" name="客户名称" v-model="p.customerName"></sa-item>
  25. <sa-item type="daterange" name="充值时间">
  26. <el-date-picker
  27. v-model="p.createTime"
  28. type="daterange"
  29. align="right"
  30. unlink-panels
  31. value-format="yyyy-MM-dd"
  32. range-separator="至"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期"
  35. :picker-options="pickerOptions">
  36. </el-date-picker>
  37. </sa-item>
  38. <sa-item name="复核状态" >
  39. <el-select v-model="p.reviewStatus" clearable placeholder="请选择">
  40. <el-option
  41. v-for="item in reviewStatusList"
  42. :key="item.id"
  43. :label="item.name"
  44. :value="item.id">
  45. </el-option>
  46. </el-select>
  47. </sa-item>
  48. <!-- <sa-item type="text" name="有效状态,0-无效已删除、1-有效" v-model="p.status"></sa-item>-->
  49. <!-- <sa-item type="text" name="盐" v-model="p.salt"></sa-item>-->
  50. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  51. <br />
  52. </el-form>
  53. <!-- ------------- 快捷按钮 ------------- -->
  54. <!-- <sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item>-->
  55. <!-- ------------- 数据列表 ------------- -->
  56. <el-table class="data-table" ref="data-table" :data="dataList" >
  57. <sa-td type="index" name="序号"></sa-td>
  58. <sa-td name="客户名称" prop="customerName" ></sa-td>
  59. <sa-td name="充值金额(元)" prop="preTopupMoney" ></sa-td>
  60. <sa-td name="优惠金额(元)" prop="discountMoney" ></sa-td>
  61. <!-- <sa-td name="充值渠道" prop="chargeChannel" ></sa-td>-->
  62. <sa-td name="余额" prop="totalMoney" ></sa-td>
  63. <sa-td name="付款方式" prop="payingType" type="enum" :jv="payingTypeObj"></sa-td>
  64. <sa-td name="经办人" prop="chargePeople" ></sa-td>
  65. <sa-td name="充值时间" prop="createTime" ></sa-td>
  66. <sa-td name="复核人员" prop="reviewBy" ></sa-td>
  67. <sa-td name="充值说明" prop="remark" ></sa-td>
  68. <el-table-column label="操作" fixed="right" width="240px">
  69. <template slot-scope="s">
  70. <el-button class="c-btn" type="success" icon="el-icon-view" v-if="sa.isAuth('tb-charge-record-list-print')"
  71. @click="print(s.row)">打印单据</el-button>
  72. <el-button class="c-btn" type="primary" icon="el-icon-edit"
  73. v-if="s.row.reviewStatus!=1 && sa.isAuth('tb-charge-record-list-review')"
  74. @click="toReview(s.row)">复审</el-button>
  75. <el-button class="c-btn" type="danger" icon="el-icon-delete"
  76. v-if="sa.isAuth('tb-charge-record-list-del')" @click="del(s.row)">删除</el-button>
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. <!-- ------------- 分页 ------------- -->
  81. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  82. </div>
  83. </div>
  84. <script>
  85. var app = new Vue({
  86. components: {
  87. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  88. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  89. },
  90. el: '.vue-box',
  91. data: {
  92. p: { // 查询参数
  93. id: '', // 主键
  94. accountId: '', // 客户账户id
  95. customerId: '', // 客户id
  96. customerName: '', // 客户名称
  97. money: '', // 充值金额
  98. payMoney: '', // 支付金额
  99. chargeChannel: '', // 充值渠道
  100. createTime: '', // 充值时间
  101. chargePeople: '', // 充值人
  102. no: '', // 订单号
  103. beforeBalance: '', // 充值前余额
  104. discountMoney: '', // 优惠金额
  105. totalMoney:'',
  106. payingType: '', // 付款方式
  107. remark: '', // 充值说明
  108. preTopupMoney:'',
  109. reviewBy:'',
  110. reviewTime: '', // 复核时间
  111. status: '', // 有效状态,0-无效已删除、1-有效
  112. reviewStatus:'',
  113. salt: '', // 盐
  114. pageNo: 1, // 当前页
  115. pageSize: 10, // 页大小
  116. sortType: 0 // 排序方式
  117. },
  118. pickerOptions: {
  119. shortcuts: [{
  120. text: '最近一周',
  121. onClick(picker) {
  122. const end = new Date();
  123. const start = new Date();
  124. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  125. picker.$emit('pick', [start, end]);
  126. }
  127. }, {
  128. text: '最近一个月',
  129. onClick(picker) {
  130. const end = new Date();
  131. const start = new Date();
  132. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  133. picker.$emit('pick', [start, end]);
  134. }
  135. }, {
  136. text: '最近三个月',
  137. onClick(picker) {
  138. const end = new Date();
  139. const start = new Date();
  140. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  141. picker.$emit('pick', [start, end]);
  142. }
  143. }]
  144. },
  145. reviewStatusList:[
  146. {id:2,name:'全部'},
  147. {id:0,name:'未复核'},
  148. {id:1,name:'已复核'}
  149. ],
  150. dataCount: 0,
  151. dataList: [], // 数据集合
  152. payingTypeObj: {
  153. 1: "对公转账",
  154. 2: "微信支付",
  155. 3: "支付宝支付",
  156. 4: "银联支付"
  157. },
  158. },
  159. methods: {
  160. // 刷新
  161. f5: function() {
  162. sa.ajax('/TbChargeRecord/getList', sa.removeNull(this.p), function(res) {
  163. this.dataList = res.data; // 数据
  164. this.dataList.forEach((itm)=>{
  165. itm.preTopupMoney = this.decrypt(itm.preTopupMoney);
  166. itm.beforeBalance = this.decrypt(itm.beforeBalance);
  167. itm.totalMoney = this.decrypt(itm.totalMoney);
  168. itm.discountMoney = this.decrypt(itm.discountMoney);
  169. });
  170. this.dataCount = res.dataCount; // 数据总数
  171. sa.f5TableHeight(); // 刷新表格高度
  172. }.bind(this));
  173. },
  174. // 新增
  175. add: function(data) {
  176. sa.showIframe('新增数据', 'tb-charge-record-add.html?id=-1', '1000px', '90%');
  177. },
  178. print(data) {
  179. sa.showIframe('打印充值单据', 'print-receipt.html?id=' + data.id, '1000px', '70%');
  180. },
  181. //复审
  182. toReview(data) {
  183. let ss = data.preTopupMoney?',充值金额:'+data.preTopupMoney+'元)':")";
  184. sa.confirm('您确认对('+data.customerName+ss+'复审吗?', function() {
  185. sa.ajax('/TbChargeRecord/review?id=' + data.id, function(res) {
  186. sa.ok('复审成功');
  187. this.f5();
  188. sa.f5TableHeight(); // 刷新表格高度
  189. }.bind(this))
  190. }.bind(this));
  191. },
  192. // 删除
  193. del: function(data) {
  194. let ss = data.preTopupMoney?',充值金额:'+data.preTopupMoney+'元)':")";
  195. sa.confirm('是否删除('+data.customerName+ss+',此操作不可撤销', function() {
  196. sa.ajax('/TbChargeRecord/delete?id=' + data.id, function(res) {
  197. sa.arrayDelete(this.dataList, data);
  198. sa.ok('删除成功');
  199. sa.f5TableHeight(); // 刷新表格高度
  200. }.bind(this))
  201. }.bind(this));
  202. },
  203. decrypt(word, keyStr) {
  204. if(!word){
  205. return;
  206. }
  207. keyStr = keyStr || 'h!f78tr#L3D$2Z0q';
  208. let base64 = CryptoJS.enc.Base64.parse(word);
  209. let src = CryptoJS.enc.Base64.stringify(base64);
  210. let key = CryptoJS.enc.Utf8.parse(keyStr);
  211. let decrypt = CryptoJS.AES.decrypt(src, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7});
  212. // let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
  213. return CryptoJS.enc.Utf8.stringify(decrypt).toString();
  214. },
  215. },
  216. created: function() {
  217. this.f5();
  218. sa.onInputEnter();
  219. }
  220. })
  221. </script>
  222. </body>
  223. </html>