month-statistcs-list.html 13 KB

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