month-statistcs-list.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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="selectMonth" type="monthrange" unlink-panels="false"
  36. range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" format="yyyy 年 MM 月"
  37. value-format="yyyy-MM">
  38. </el-date-picker>
  39. </div>
  40. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  41. <el-button class="c-btn" type="warning" icon="el-icon" @click="exportStats()">导出</el-button>
  42. <el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印</el-button>
  43. <br />
  44. </el-form>
  45. <!-- ------------- 数据列表 ------------- -->
  46. <el-table class="data-table" ref="data-table" :data="dataList" show-summary :summary-method="getSumRol">
  47. <sa-td name="收费项目" prop="feeTypeName"></sa-td>
  48. <sa-td name="月份" prop="month"></sa-td>
  49. <sa-td name="数量" prop="num"></sa-td>
  50. <!-- <sa-td name="含税收入(元)" prop="statisticsMoney"></sa-td>-->
  51. <el-table-column label="含税收入(元)">
  52. <template slot-scope="s">
  53. <span>{{Number(s.row.taxMoney).toFixed(2)}}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="税率(%)">
  57. <template slot-scope="s">
  58. <span>{{s.row.taxRate * 100}}</span>
  59. </template>
  60. </el-table-column>
  61. <!-- <sa-td name="税款(元)" prop="taxes" ></sa-td>-->
  62. <el-table-column label="税款(元)">
  63. <template slot-scope="s">
  64. <span>{{Number(s.row.taxes).toFixed(2)}}</span>
  65. </template>
  66. </el-table-column>
  67. <!-- <sa-td name="不含税收入(元)" prop="noTaxMoney" ></sa-td>-->
  68. <el-table-column label="不含税收入(元)">
  69. <template slot-scope="s">
  70. <span>{{Number(s.row.noTaxMoney).toFixed(2)}}</span>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <!-- ------------- 分页 ------------- -->
  75. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  76. </sa-item>
  77. </div>
  78. <el-dialog title="提示" :visible.sync="emodel.visible" width="38%">
  79. <!-- 日期选择器 -->
  80. <div class="c-item">
  81. <label class="c-label">月份:</label>
  82. <el-date-picker type="month" value-format="yyyy-MM" v-model="emodel.form.exportMonth"
  83. placeholder="选择月份"></el-date-picker>
  84. </div>
  85. <span slot="footer" class="dialog-footer">
  86. <el-button @click="emodel.visible = false">取 消</el-button>
  87. <el-button type="primary" @click="sureExport">确 定</el-button>
  88. </span>
  89. </el-dialog>
  90. </div>
  91. <script>
  92. var app = new Vue({
  93. components: {
  94. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  95. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  96. },
  97. el: '.vue-box',
  98. data: {
  99. p: { // 查询参数
  100. id: '', // 主键
  101. feeType: '', // 收费类型(1=核酸检测,2=消杀作业,3=装卸作业,4=停车费,5=过磅费,6=入场管理费)
  102. itemTypeId: '', // 业务类型id
  103. itemTypeName: '', // 业务类型
  104. year: '', // 年份
  105. month: '', // 月份
  106. day: '', // 天
  107. dayTime: '', // 日期
  108. num: '', // 数量
  109. taxMoney: '', // 税款
  110. taxRate: '', // 税率
  111. noTaxMoney: '', // 不含税款
  112. payType: '', // 支付方式(1=微信支付)
  113. isMonth: 1,
  114. pageNo: 1, // 当前页
  115. pageSize: 10, // 页大小
  116. sortType: 0 // 排序方式
  117. },
  118. dataCount: 0,
  119. dataList: [], // 数据集合
  120. selectMonth: [],
  121. selectMonthRange: {
  122. beginMonth: '', //查询开始时间
  123. endMonth: '', //查询结束时间
  124. },
  125. emodel: {
  126. visible: false,
  127. form: {
  128. exportMonth: '', //导出月份
  129. }
  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. getSumRol(param) {
  145. const columns = param.columns;
  146. const sums = [];
  147. columns.forEach((column, index) => {
  148. if (index === 0) {
  149. sums[index] = "合计";
  150. return;
  151. }
  152. //根据当前列绑定的字段名进行判断,根据字段名决定展示什么内容
  153. switch (column.label) {
  154. //金额;
  155. case "含税收入(元)":
  156. //在这里你就可以根据需要对数据进行一些处理(保留小数位数,加上单位等)
  157. sums[index] = this.tableSum.taxMoneySum;
  158. break;
  159. //人数
  160. case "税款(元)":
  161. sums[index] = this.tableSum.taxesSum;
  162. break;
  163. //件数;
  164. case "不含税收入(元)":
  165. sums[index] = this.tableSum.noTaxMoneySum;
  166. break;
  167. //不需要计算合计的列就展示‘--’
  168. default:
  169. sums[index] = "";
  170. break;
  171. }
  172. });
  173. return sums;
  174. },
  175. calcuSum() {
  176. var taxMoneySum = 0;
  177. var taxesSum = 0;
  178. var noTaxMoneySum = 0;
  179. var len = this.dataList.length;
  180. for (var i = 0; i < len; i++) {
  181. taxMoneySum = (taxMoneySum * 100 + this.dataList[i].taxMoney * 100) / 100;
  182. taxesSum = (taxesSum * 100 + this.dataList[i].taxes * 100) / 100;
  183. noTaxMoneySum = (noTaxMoneySum * 100 + this.dataList[i].noTaxMoney * 100) / 100;
  184. }
  185. this.tableSum.taxMoneySum = Number(taxMoneySum).toFixed(2);
  186. this.tableSum.taxesSum = Number(taxesSum).toFixed(2);
  187. this.tableSum.noTaxMoneySum = Number(noTaxMoneySum).toFixed(2);
  188. },
  189. getTotalMoney() {
  190. if (this.selectMonth != null && this.selectMonth.length != 0) {
  191. this.selectMonthRange.beginMonth = this.selectMonth[0];
  192. this.selectMonthRange.endMonth = this.selectMonth[1];
  193. }
  194. sa.ajax('/TbFeeStatistics/getSum?beginMonth=' + this.selectMonthRange.beginMonth + "&endMonth=" +
  195. this.selectMonthRange.endMonth,
  196. sa.removeNull(this.p),
  197. function(res) {
  198. this.tableSum.taxMoneySum = res.data.taxMoneySum;
  199. this.tableSum.taxesSum = res.data.taxesSum;
  200. this.tableSum.noTaxMoneySum = res.data.noTaxMoneySum;
  201. }.bind(this));
  202. },
  203. print: function() {
  204. if (this.selectMonth != null && this.selectMonth.length != 0) {
  205. this.selectMonthRange.beginMonth = this.selectMonth[0];
  206. this.selectMonthRange.endMonth = this.selectMonth[1];
  207. }
  208. var beginMonth = this.selectMonthRange.beginMonth;
  209. var endMonth = this.selectMonthRange.endMonth;
  210. var feeType = this.p.feeType;
  211. var str = '';
  212. if (beginMonth === '' && endMonth === '') {
  213. str += '所有月份';
  214. } else {
  215. str += beginMonth + "至" + endMonth
  216. }
  217. if (feeType === '') {
  218. str += "、所有收费项目";
  219. } else {
  220. var feeTypeName = '';
  221. if (feeType == 1) {
  222. feeTypeName = "核酸检测";
  223. } else if (feeType == 2) {
  224. feeTypeName = "消杀作业";
  225. } else if (feeType == 3) {
  226. feeTypeName = "装卸作业";
  227. } else if (feeType == 4) {
  228. feeTypeName = "停车费";
  229. } else if (feeType == 5) {
  230. feeTypeName = "过磅费";
  231. } else if (feeType == 6) {
  232. feeTypeName = "入场管理费";
  233. } else if (feeType == 7) {
  234. feeTypeName = "充电打冷作业";
  235. }
  236. str += "、收费项目为" + feeTypeName;
  237. }
  238. this.$confirm('确定打印' + str + '的数据?', '提示', {
  239. confirmButtonText: '确定',
  240. cancelButtonText: '取消',
  241. type: 'warning'
  242. }).then(() => {
  243. sa.showIframe('打印月报表', 'monthStatsPrint.html?beginMonth=' + beginMonth +
  244. "&endMonth=" + endMonth + "&feeType=" + feeType + "&isMonth=1", '1000px',
  245. '100%');
  246. }).catch(() => {
  247. });
  248. },
  249. exportStats() {
  250. if (this.selectMonth != null && this.selectMonth.length != 0) {
  251. this.selectMonthRange.beginMonth = this.selectMonth[0];
  252. this.selectMonthRange.endMonth = this.selectMonth[1];
  253. }
  254. var beginMonth = this.selectMonthRange.beginMonth;
  255. var endMonth = this.selectMonthRange.endMonth;
  256. var feeType = this.p.feeType;
  257. var str = '';
  258. if (beginMonth === '' && endMonth === '') {
  259. str += '所有月份';
  260. } else {
  261. str += beginMonth + "至" + endMonth
  262. }
  263. if (feeType === '') {
  264. str += "、所有收费项目";
  265. } else {
  266. var feeTypeName = '';
  267. if (feeType == 1) {
  268. feeTypeName = "核酸检测";
  269. } else if (feeType == 2) {
  270. feeTypeName = "消杀作业";
  271. } else if (feeType == 3) {
  272. feeTypeName = "装卸作业";
  273. } else if (feeType == 4) {
  274. feeTypeName = "停车费";
  275. } else if (feeType == 5) {
  276. feeTypeName = "过磅费";
  277. } else if (feeType == 6) {
  278. feeTypeName = "入场管理费";
  279. } else if (feeType == 7) {
  280. feeTypeName = "充电打冷作业";
  281. }
  282. str += "、收费项目为" + feeTypeName;
  283. }
  284. this.$confirm('确定导出' + str + '的数据?', '提示', {
  285. confirmButtonText: '确定',
  286. cancelButtonText: '取消',
  287. type: 'warning'
  288. }).then(() => {
  289. sa.ajax('/TbFeeStatistics/export/stats?beginMonth=' + beginMonth + '&endMonth=' +
  290. endMonth, sa.removeNull(this.p),
  291. function(resp) {
  292. window.open(resp.data);
  293. }.bind(this));
  294. }).catch(() => {
  295. });
  296. },
  297. exportFn() {
  298. Object.assign(this.emodel, {
  299. visible: true,
  300. })
  301. },
  302. sureExport() {
  303. if (this.emodel.form.exportMonth == '') {
  304. sa.msg("请选择月份");
  305. return;
  306. }
  307. sa.ajax('/TbFeeStatistics/export/monthStatistics', this.emodel.form, function(resp) {
  308. window.open(resp.data);
  309. this.emodel.visible = false;
  310. }.bind(this));
  311. },
  312. // 刷新
  313. f5: function() {
  314. if (this.selectMonth != null && this.selectMonth.length != 0) {
  315. this.selectMonthRange.beginMonth = this.selectMonth[0];
  316. this.selectMonthRange.endMonth = this.selectMonth[1];
  317. }
  318. sa.ajax('/TbFeeStatistics/getMonth?beginMonth=' + this.selectMonthRange.beginMonth +
  319. "&endMonth=" + this.selectMonthRange.endMonth,
  320. sa.removeNull(this.p),
  321. function(res) {
  322. this.dataList = res.data; // 数据
  323. this.dataCount = res.dataCount; // 数据总数
  324. sa.f5TableHeight(); // 刷新表格高度
  325. }.bind(this));
  326. this.getTotalMoney();
  327. },
  328. // 查看
  329. get: function(data) {
  330. sa.showIframe('数据详情', 'month-statistcs-info.html?id=' + data.id, '1050px', '90%');
  331. },
  332. // 查看 - 根据选中的
  333. getBySelect: function(data) {
  334. var selection = this.$refs['data-table'].selection;
  335. if (selection.length == 0) {
  336. return sa.msg('请选择一条数据')
  337. }
  338. this.get(selection[0]);
  339. },
  340. },
  341. created: function() {
  342. this.getFeeItemList();
  343. this.f5();
  344. sa.onInputEnter();
  345. }
  346. })
  347. </script>
  348. </body>
  349. </html>