month-statistcs-list.html 17 KB

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