month-statistcs-list.html 17 KB

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