tb-charge-record-list.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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="selection"></sa-td>
  58. <sa-td name="主键" prop="id" v-if="false"></sa-td>
  59. <sa-td name="客户账户id" prop="accountId" v-if="false"></sa-td>
  60. <sa-td name="客户id" prop="customerId" ></sa-td>
  61. <sa-td name="客户名称" prop="customerName" ></sa-td>
  62. <sa-td name="充值金额(元)" prop="preTopupMoney" ></sa-td>
  63. <sa-td name="优惠金额(元)" prop="discountMoney" ></sa-td>
  64. <!-- <sa-td name="充值渠道" prop="chargeChannel" ></sa-td>-->
  65. <sa-td name="余额" prop="totalMoney" ></sa-td>
  66. <sa-td name="付款方式" prop="payingType" type="enum" :jv="payingTypeObj"></sa-td>
  67. <sa-td name="经办人" prop="chargePeople" ></sa-td>
  68. <sa-td name="充值时间" prop="createTime" ></sa-td>
  69. <sa-td name="复核人员" prop="reviewBy" ></sa-td>
  70. <sa-td name="充值说明" prop="remark" ></sa-td>
  71. <el-table-column label="操作" fixed="right" width="240px">
  72. <template slot-scope="s">
  73. <el-button class="c-btn" type="success" icon="el-icon-view" v-if="sa.isAuth('tb-charge-record-list-print')"
  74. @click="print(s.row)">打印单据</el-button>
  75. <el-button class="c-btn" type="primary" icon="el-icon-edit"
  76. v-if="s.row.reviewStatus!=1 && sa.isAuth('tb-charge-record-list-review')"
  77. @click="toReview(s.row)">复审</el-button>
  78. <el-button class="c-btn" type="danger" icon="el-icon-delete"
  79. v-if="sa.isAuth('tb-charge-record-list-del')" @click="del(s.row)">删除</el-button>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. <!-- ------------- 分页 ------------- -->
  84. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  85. </div>
  86. </div>
  87. <script>
  88. var app = new Vue({
  89. components: {
  90. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  91. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  92. },
  93. el: '.vue-box',
  94. data: {
  95. p: { // 查询参数
  96. id: '', // 主键
  97. accountId: '', // 客户账户id
  98. customerId: '', // 客户id
  99. customerName: '', // 客户名称
  100. money: '', // 充值金额
  101. payMoney: '', // 支付金额
  102. chargeChannel: '', // 充值渠道
  103. createTime: '', // 充值时间
  104. chargePeople: '', // 充值人
  105. no: '', // 订单号
  106. beforeBalance: '', // 充值前余额
  107. discountMoney: '', // 优惠金额
  108. totalMoney:'',
  109. payingType: '', // 付款方式
  110. remark: '', // 充值说明
  111. preTopupMoney:'',
  112. reviewBy:'',
  113. reviewTime: '', // 复核时间
  114. status: '', // 有效状态,0-无效已删除、1-有效
  115. reviewStatus:'',
  116. salt: '', // 盐
  117. pageNo: 1, // 当前页
  118. pageSize: 10, // 页大小
  119. sortType: 0 // 排序方式
  120. },
  121. pickerOptions: {
  122. shortcuts: [{
  123. text: '最近一周',
  124. onClick(picker) {
  125. const end = new Date();
  126. const start = new Date();
  127. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  128. picker.$emit('pick', [start, end]);
  129. }
  130. }, {
  131. text: '最近一个月',
  132. onClick(picker) {
  133. const end = new Date();
  134. const start = new Date();
  135. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  136. picker.$emit('pick', [start, end]);
  137. }
  138. }, {
  139. text: '最近三个月',
  140. onClick(picker) {
  141. const end = new Date();
  142. const start = new Date();
  143. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  144. picker.$emit('pick', [start, end]);
  145. }
  146. }]
  147. },
  148. reviewStatusList:[
  149. {id:2,name:'全部'},
  150. {id:0,name:'未复核'},
  151. {id:1,name:'已复核'}
  152. ],
  153. dataCount: 0,
  154. dataList: [], // 数据集合
  155. payingTypeObj: {
  156. 1: "对公转账",
  157. 2: "微信支付",
  158. 3: "支付宝支付",
  159. 4: "银联支付"
  160. },
  161. },
  162. methods: {
  163. // 刷新
  164. f5: function() {
  165. sa.ajax('/TbChargeRecord/getList', sa.removeNull(this.p), function(res) {
  166. this.dataList = res.data; // 数据
  167. this.dataList.forEach((itm)=>{
  168. itm.preTopupMoney = this.decrypt(itm.preTopupMoney);
  169. itm.beforeBalance = this.decrypt(itm.beforeBalance);
  170. itm.totalMoney = this.decrypt(itm.totalMoney);
  171. itm.discountMoney = this.decrypt(itm.discountMoney);
  172. });
  173. this.dataCount = res.dataCount; // 数据总数
  174. sa.f5TableHeight(); // 刷新表格高度
  175. }.bind(this));
  176. },
  177. // 新增
  178. add: function(data) {
  179. sa.showIframe('新增数据', 'tb-charge-record-add.html?id=-1', '1000px', '90%');
  180. },
  181. print(data) {
  182. this.$confirm(' 点击确定开始打印!', '提示', {
  183. confirmButtonText: '确定',
  184. cancelButtonText: '取消',
  185. }).then(() => {
  186. sa.showIframe('打印充值单据', 'print-receipt.html?id=' + data.id, '1000px', '100%');
  187. }).catch(() => {
  188. });
  189. },
  190. //复审
  191. toReview(data) {
  192. let ss = data.preTopupMoney?',充值金额:'+data.preTopupMoney+'元)':")";
  193. sa.confirm('您确认对('+data.customerName+ss+'复审吗?', function() {
  194. sa.ajax('/TbChargeRecord/review?id=' + data.id, function(res) {
  195. sa.ok('复审成功');
  196. this.f5();
  197. sa.f5TableHeight(); // 刷新表格高度
  198. }.bind(this))
  199. }.bind(this));
  200. },
  201. // 删除
  202. del: function(data) {
  203. let ss = data.preTopupMoney?',充值金额:'+data.preTopupMoney+'元)':")";
  204. sa.confirm('是否删除('+data.customerName+ss+',此操作不可撤销', function() {
  205. sa.ajax('/TbChargeRecord/delete?id=' + data.id, function(res) {
  206. sa.arrayDelete(this.dataList, data);
  207. sa.ok('删除成功');
  208. sa.f5TableHeight(); // 刷新表格高度
  209. }.bind(this))
  210. }.bind(this));
  211. },
  212. decrypt(word, keyStr) {
  213. if(!word){
  214. return;
  215. }
  216. keyStr = keyStr || 'h!f78tr#L3D$2Z0q';
  217. let base64 = CryptoJS.enc.Base64.parse(word);
  218. let src = CryptoJS.enc.Base64.stringify(base64);
  219. let key = CryptoJS.enc.Utf8.parse(keyStr);
  220. let decrypt = CryptoJS.AES.decrypt(src, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7});
  221. // let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
  222. return CryptoJS.enc.Utf8.stringify(decrypt).toString();
  223. },
  224. },
  225. created: function() {
  226. this.f5();
  227. sa.onInputEnter();
  228. }
  229. })
  230. </script>
  231. </body>
  232. </html>