tb-fee-statistics-list.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>日统计</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.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. <div class="c-item">
  25. <label class="c-label">收费项目:</label>
  26. <el-select v-model="p.feeType" placeholder="请选择" filterable>
  27. <el-option label="-全部-" value=""></el-option>
  28. <el-option v-for="(item,index) in feeItemList" :label="item.name" :value="item.id"
  29. :key="index">
  30. </el-option>
  31. </el-select>
  32. </div>
  33. <div class="c-item">
  34. <label class="c-label">日期范围:</label>
  35. <el-date-picker size="mini" v-model="selectDay" type="daterange" unlink-panels="false"
  36. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  37. format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
  38. </el-date-picker>
  39. </div>
  40. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  41. <br />
  42. </el-form>
  43. <!-- ------------- 快捷按钮 ------------- -->
  44. <div class="fast-btn">
  45. <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
  46. <el-button class="c-btn" type="warning" icon="el-icon" @click="exportStats()">导出</el-button>
  47. <el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印</el-button>
  48. </div>
  49. <!-- ------------- 数据列表 ------------- -->
  50. <el-table class="data-table" ref="data-table" :data="dataList" show-summary :summary-method="getSumRol">
  51. <!-- <sa-td type="selection"></sa-td>-->
  52. <sa-td name="收费项目" prop="feeTypeName"></sa-td>
  53. <sa-td name="日期" type="date" prop="dayTime"></sa-td>
  54. <sa-td name="数量" prop="num"></sa-td>
  55. <!-- <sa-td name="含税收入(元)" prop="taxMoney" ></sa-td>-->
  56. <el-table-column label="含税收入(元)">
  57. <template slot-scope="s">
  58. <span>{{Number(s.row.taxMoney).toFixed(2)}}</span>
  59. </template>
  60. </el-table-column>
  61. <!-- <sa-td name="税率" prop="taxRate" ></sa-td>-->
  62. <el-table-column label="税率(%)">
  63. <template slot-scope="s">
  64. <span>{{s.row.taxRate * 100}}</span>
  65. </template>
  66. </el-table-column>
  67. <!-- <sa-td name="税款(元)" prop="taxes" ></sa-td>-->
  68. <el-table-column label="税款(元)">
  69. <template slot-scope="s">
  70. <span v-if="s.row.taxes != null">{{Number(s.row.taxes).toFixed(2)}}</span>
  71. <span v-else>{{Number(s.row.taxMoney - s.row.noTaxMoney).toFixed(2)}}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="不含税收入(元)">
  75. <template slot-scope="s">
  76. <span>{{Number(s.row.noTaxMoney).toFixed(2)}}</span>
  77. </template>
  78. </el-table-column>
  79. <sa-td name="支付方式" prop="payType" type="enum" :jv="{3: '微信支付',5: '预存款支付'}"></sa-td>
  80. <sa-td name="开单员" prop="kaiDanPerson"></sa-td>
  81. <sa-td name="复核员" prop="diaoDuPerson"></sa-td>
  82. <sa-td name="统计稽查员" prop="jiChaPerson"></sa-td>
  83. <sa-td name="部门负责人" prop="judgeBy"></sa-td>
  84. <!-- <sa-td name="审核时间" prop="judgeTime" width="140"></sa-td> -->
  85. <el-table-column label="操作" fixed="right" width="120px" v-if="sa.isAuth('tb-fee-statistics-judge')">
  86. <template slot-scope="s">
  87. <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="judgeFn(s.row)">审核
  88. </el-button>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <!-- ------------- 分页 ------------- -->
  93. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  94. </sa-item>
  95. </div>
  96. </div>
  97. <script>
  98. var app = new Vue({
  99. components: {
  100. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  101. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  102. },
  103. el: '.vue-box',
  104. data: {
  105. p: { // 查询参数
  106. id: '', // 主键
  107. feeType: '', // 收费类型(1=核酸检测,2消杀作业,3=装卸作业,4=停车费,5=过磅费)
  108. feeTypeId: '', // 收费类型id
  109. feeTypeName: '', // 收费类型
  110. itemTypeId: '', // 业务类型id
  111. itemTypeName: '', // 业务类型
  112. year: '', // 年份
  113. month: '', // 月份
  114. dayTime: '', // 日期
  115. num: '', // 数量
  116. taxMoney: '', // 税款
  117. taxRate: '', // 税率
  118. noTaxMoney: '', // 不含税款
  119. payType: '', // 支付方式(1=微信支付)
  120. pageNo: 1, // 当前页
  121. pageSize: 10, // 页大小
  122. sortType: 9 // 排序方式
  123. },
  124. dataCount: 0,
  125. dataList: [], // 数据集合
  126. selectDay: [],
  127. selectDayRange: {
  128. beginDay: '', //查询开始时间
  129. endDay: '', //查询结束时间
  130. },
  131. feeItemList: [],
  132. tableSum: {
  133. taxMoneySum: 0,
  134. taxesSum: 0,
  135. noTaxMoneySum: 0,
  136. },
  137. },
  138. methods: {
  139. getFeeItemList() {
  140. sa.ajax('/TbFeeItem/getList', function(res) {
  141. this.feeItemList = res.data;
  142. }.bind(this));
  143. },
  144. judgeFn(data) {
  145. sa.showIframe('统计审核', 'tb-fee-details-info.html?id=' + data.id, '600px', '60%');
  146. },
  147. getSumRol(param) {
  148. const columns = param.columns;
  149. const sums = [];
  150. columns.forEach((column, index) => {
  151. if (index === 0) {
  152. sums[index] = "合计";
  153. return;
  154. }
  155. //根据当前列绑定的字段名进行判断,根据字段名决定展示什么内容
  156. switch (column.label) {
  157. //金额;
  158. case "含税收入(元)":
  159. //在这里你就可以根据需要对数据进行一些处理(保留小数位数,加上单位等)
  160. sums[index] = this.tableSum.taxMoneySum;
  161. break;
  162. //人数
  163. case "税款(元)":
  164. sums[index] = this.tableSum.taxesSum;
  165. break;
  166. //件数;
  167. case "不含税收入(元)":
  168. sums[index] = this.tableSum.noTaxMoneySum;
  169. break;
  170. //不需要计算合计的列就展示‘--’
  171. default:
  172. sums[index] = "";
  173. break;
  174. }
  175. });
  176. return sums;
  177. },
  178. calcuSum() {
  179. var taxMoneySum = 0;
  180. var taxesSum = 0;
  181. var noTaxMoneySum = 0;
  182. var len = this.dataList.length;
  183. for (var i = 0; i < len; i++) {
  184. taxMoneySum = (taxMoneySum * 100 + this.dataList[i].taxMoney * 100) / 100;
  185. taxesSum = (taxesSum * 100 + this.dataList[i].taxes * 100) / 100;
  186. noTaxMoneySum = (noTaxMoneySum * 100 + this.dataList[i].noTaxMoney * 100) / 100;
  187. }
  188. this.tableSum.taxMoneySum = Number(taxMoneySum).toFixed(2);
  189. this.tableSum.taxesSum = Number(taxesSum).toFixed(2);
  190. this.tableSum.noTaxMoneySum = Number(noTaxMoneySum).toFixed(2);
  191. },
  192. getTotalMoney() {
  193. if (this.selectDay != null && this.selectDay.length != 0) {
  194. this.selectDayRange.beginDay = this.selectDay[0];
  195. this.selectDayRange.endDay = this.selectDay[1];
  196. }
  197. sa.ajax('/TbFeeStatistics/getSum?beginDay=' + this.selectDayRange.beginDay + "&endDay=" + this
  198. .selectDayRange.endDay,
  199. sa.removeNull(this.p),
  200. function(res) {
  201. this.tableSum.taxMoneySum = res.data.taxMoneySum;
  202. this.tableSum.taxesSum = res.data.taxesSum;
  203. this.tableSum.noTaxMoneySum = res.data.noTaxMoneySum;
  204. }.bind(this));
  205. },
  206. print: function() {
  207. if (this.selectDay != null && this.selectDay.length != 0) {
  208. this.selectDayRange.beginDay = this.selectDay[0];
  209. this.selectDayRange.endDay = this.selectDay[1];
  210. }
  211. var beginDay = this.selectDayRange.beginDay;
  212. var endDay = this.selectDayRange.endDay;
  213. var feeType = this.p.feeType;
  214. var str = '';
  215. if (beginDay === '' && endDay === '') {
  216. str += '所有时间';
  217. } else {
  218. str += beginDay + "至" + endDay
  219. }
  220. if (feeType === '') {
  221. str += "、所有收费项目";
  222. } else {
  223. var feeTypeName = '';
  224. if (feeType == 1) {
  225. feeTypeName = "核酸检测";
  226. } else if (feeType == 2) {
  227. feeTypeName = "消杀作业";
  228. } else if (feeType == 3) {
  229. feeTypeName = "装卸作业";
  230. } else if (feeType == 4) {
  231. feeTypeName = "停车费";
  232. } else if (feeType == 5) {
  233. feeTypeName = "过磅费";
  234. } else if (feeType == 6) {
  235. feeTypeName = "入场管理费";
  236. } else if (feeType == 7) {
  237. feeTypeName = "充电打冷作业";
  238. }
  239. str += "、收费项目为" + feeTypeName;
  240. }
  241. this.$confirm('确定打印' + str + '的数据?', '提示', {
  242. confirmButtonText: '确定',
  243. cancelButtonText: '取消',
  244. type: 'warning'
  245. }).then(() => {
  246. sa.showIframe('打印日报表', 'dayStatsPrint.html?beginDay=' + beginDay + "&endDay=" +
  247. endDay + "&feeType=" + feeType, '100%', '100%');
  248. }).catch(() => {
  249. });
  250. },
  251. exportStats() {
  252. if (this.selectDay != null && this.selectDay.length != 0) {
  253. this.selectDayRange.beginDay = this.selectDay[0];
  254. this.selectDayRange.endDay = this.selectDay[1];
  255. }
  256. var beginDay = this.selectDayRange.beginDay;
  257. var endDay = this.selectDayRange.endDay;
  258. var feeType = this.p.feeType;
  259. var str = '';
  260. if (beginDay === '' && endDay === '') {
  261. str += '所有时间';
  262. } else {
  263. str += beginDay + "至" + endDay
  264. }
  265. if (feeType === '') {
  266. str += "、所有收费项目";
  267. } else {
  268. var feeTypeName = '';
  269. if (feeType == 1) {
  270. feeTypeName = "核酸检测";
  271. } else if (feeType == 2) {
  272. feeTypeName = "消杀作业";
  273. } else if (feeType == 3) {
  274. feeTypeName = "装卸作业";
  275. } else if (feeType == 4) {
  276. feeTypeName = "停车费";
  277. } else if (feeType == 5) {
  278. feeTypeName = "过磅费";
  279. } else if (feeType == 6) {
  280. feeTypeName = "入场管理费";
  281. } else if (feeType == 7) {
  282. feeTypeName = "充电打冷作业";
  283. }
  284. str += "、收费项目为" + feeTypeName;
  285. }
  286. this.$confirm('确定导出' + str + '的数据?', '提示', {
  287. confirmButtonText: '确定',
  288. cancelButtonText: '取消',
  289. type: 'warning'
  290. }).then(() => {
  291. sa.ajax('/TbFeeStatistics/export/stats?beginDay=' + beginDay + '&endDay=' + endDay,
  292. sa.removeNull(this.p),
  293. function(resp) {
  294. window.open(resp.data);
  295. }.bind(this));
  296. }).catch(() => {
  297. });
  298. },
  299. // 刷新
  300. f5: function() {
  301. if (this.selectDay != null && this.selectDay.length != 0) {
  302. this.selectDayRange.beginDay = this.selectDay[0];
  303. this.selectDayRange.endDay = this.selectDay[1];
  304. }
  305. sa.ajax('/TbFeeStatistics/getList?beginDay=' + this.selectDayRange.beginDay + "&endDay=" +
  306. this.selectDayRange.endDay,
  307. sa.removeNull(this.p),
  308. function(res) {
  309. this.dataList = res.data; // 数据
  310. this.dataCount = res.dataCount; // 数据总数
  311. sa.f5TableHeight(); // 刷新表格高度
  312. }.bind(this));
  313. this.getTotalMoney();
  314. },
  315. // 查看
  316. get: function(data) {
  317. sa.showIframe('数据详情', 'tb-fee-statistics-info.html?id=' + data.id, '1050px', '90%');
  318. },
  319. // 查看 - 根据选中的
  320. getBySelect: function(data) {
  321. var selection = this.$refs['data-table'].selection;
  322. if (selection.length == 0) {
  323. return sa.msg('请选择一条数据')
  324. }
  325. this.get(selection[0]);
  326. },
  327. },
  328. created: function() {
  329. this.getFeeItemList();
  330. this.f5();
  331. sa.onInputEnter();
  332. }
  333. })
  334. </script>
  335. </body>
  336. </html>