index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <div class="content main">
  3. <organ-tree @organId="currentOrganId"></organ-tree>
  4. <div class="content-right">
  5. <div class="search">
  6. <el-radio-group v-model="chargeStatus" @change="changeRadio" class="zz-tab-button">
  7. <el-radio-button label="1">未交账单</el-radio-button>
  8. <el-radio-button label="2">已交账单</el-radio-button>
  9. </el-radio-group>
  10. <el-input
  11. clearable
  12. placeholder="输入费用名称"
  13. class="search-input"
  14. v-trim
  15. v-model.trim="mixins_query.chargeName"
  16. ></el-input>
  17. <el-button class="search-btn" type="primary" @click="mixins_search()" icon="el-icon-search">搜索</el-button>
  18. <div class="search-icon">
  19. <el-tooltip
  20. v-show="chargeStatus == 1 && chiData.type === 'room'"
  21. class="item"
  22. effect="light"
  23. placement="bottom"
  24. content="临时收款"
  25. >
  26. <i class="zoniot_font zoniot-icon-linshishoukuan" @click="collections('temporary')"></i>
  27. </el-tooltip>
  28. <el-tooltip v-show="chargeStatus == 1" class="item" effect="light" placement="bottom" content="批量收款">
  29. <i class="zoniot_font zoniot-icon-piliangshoukuan" @click="collections('bulk')"></i>
  30. </el-tooltip>
  31. <el-tooltip class="item" effect="light" placement="bottom" content="导出">
  32. <i class="zoniot_font zoniot-icon-daochu2" @click="exportExcel"></i>
  33. </el-tooltip>
  34. </div>
  35. </div>
  36. <zz-table
  37. v-if="statusTable"
  38. :settings="{ showCheckbox: chargeStatus == 1, showIndex: chargeStatus == 2, stripe: true }"
  39. :cols="chargeStatus == 1 ? cols : statusCols"
  40. :data="mixins_list"
  41. :pageset="mixins_pageset"
  42. @page-change="pageChange"
  43. :selectable="selectable"
  44. @selection-change="selectionChange"
  45. >
  46. <template slot-scope="scope" slot="payBeginTime">
  47. {{ typeTimeTransition(scope.row.payBeginTime, scope.row.payEndTime) }}
  48. </template>
  49. <template slot-scope="scope" slot="opt">
  50. <div class="opt">
  51. <el-tooltip v-show="chargeStatus == 1" class="item" effect="light" placement="bottom" content="收款">
  52. <i class="zoniot_font zoniot-icon-shoukuan" @click="collections('single', scope.row)"></i>
  53. </el-tooltip>
  54. <el-tooltip v-show="chargeStatus == 2" class="item" effect="light" placement="bottom" content="详情">
  55. <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
  56. </el-tooltip>
  57. </div>
  58. </template>
  59. </zz-table>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import list from '@/utils/list.js';
  65. export default {
  66. mixins: [list],
  67. name: 'propertyFee',
  68. data() {
  69. return {
  70. currentId: '',
  71. cols: [
  72. {
  73. label: '订单号',
  74. prop: 'billNumber'
  75. },
  76. {
  77. label: '地址',
  78. prop: 'assets'
  79. },
  80. {
  81. label: '业主',
  82. prop: 'residentName',
  83. width: '100'
  84. },
  85. {
  86. label: '费用名称',
  87. prop: 'chargeName',
  88. width: '200'
  89. },
  90. {
  91. label: '计费日期',
  92. prop: 'payBeginTime',
  93. slot: 'payBeginTime',
  94. width: '150'
  95. },
  96. {
  97. label: '费用金额(元)',
  98. prop: 'amount'
  99. },
  100. {
  101. label: '滞纳金(元)',
  102. prop: 'lateFee'
  103. },
  104. {
  105. label: '应收金额(元)',
  106. prop: 'receivableAmount'
  107. },
  108. {
  109. label: '缴费状态',
  110. prop: 'chargeStatusDict'
  111. },
  112. {
  113. label: '操作',
  114. prop: 'id',
  115. slot: 'opt'
  116. }
  117. ],
  118. statusCols: [
  119. {
  120. label: '订单号',
  121. prop: 'billNumber'
  122. },
  123. {
  124. label: '地址',
  125. prop: 'assets'
  126. },
  127. {
  128. label: '住户',
  129. prop: 'residentName'
  130. },
  131. {
  132. label: '费用名称',
  133. prop: 'chargeName',
  134. width: '200'
  135. },
  136. {
  137. label: '计费日期',
  138. prop: 'payBeginTime',
  139. slot: 'payBeginTime',
  140. width: '150'
  141. },
  142. {
  143. label: '费用金额(元)',
  144. prop: 'amount'
  145. },
  146. {
  147. label: '滞纳金(元)',
  148. prop: 'lateFee'
  149. },
  150. {
  151. label: '应收金额(元)',
  152. prop: 'receivableAmount'
  153. },
  154. {
  155. label: '实收金额(元)',
  156. prop: 'receivedAmount'
  157. },
  158. {
  159. label: '付款方式',
  160. prop: 'payTypeDict'
  161. },
  162. {
  163. label: '缴费状态',
  164. prop: 'chargeStatusDict'
  165. },
  166. {
  167. label: '操作',
  168. prop: 'id',
  169. slot: 'opt'
  170. }
  171. ],
  172. chargeStatus: 1,
  173. chiData: {
  174. type: '',
  175. value: '',
  176. address: ''
  177. },
  178. mixins_post: 'post',
  179. selectRow: [],
  180. statusTable: true
  181. };
  182. },
  183. methods: {
  184. collections(todo, row) {
  185. new Promise((resolve) => {
  186. let title = '',
  187. hideStar,
  188. height = '230px',
  189. width = '900px';
  190. if (todo == 'temporary') {
  191. title = '设置收费项目';
  192. hideStar = false;
  193. height = '270px';
  194. width = '550px';
  195. } else if (todo == 'bulk') {
  196. if (!this.selectRow.length) {
  197. this.$message.error('您尚未选择要收款项,请选择后再操作批量');
  198. return;
  199. }
  200. let tag = false;
  201. this.selectRow.map((item) => {
  202. if (this.selectRow[0].assetsId == item.assetsId) {
  203. tag = true;
  204. } else {
  205. tag = false;
  206. }
  207. });
  208. if (!tag) {
  209. this.$message.error('选择同一房间后再操作批量');
  210. return;
  211. }
  212. title = '批量收款';
  213. hideStar = true;
  214. height = '528px';
  215. width = '900px';
  216. } else if (todo == 'single') {
  217. title = '收款';
  218. hideStar = true;
  219. height = '614px';
  220. width = '614px';
  221. }
  222. this.$store.dispatch('addPopup', {
  223. url: '/payService/propertyFee/stepPage/' + todo + '.vue',
  224. // url: '/payService/propertyFee/stepPage/single.vue',
  225. width: width,
  226. height: height,
  227. props: {
  228. data: row,
  229. selectRow: this.selectRow,
  230. chiData: this.chiData,
  231. tabList: todo,
  232. callback: resolve
  233. },
  234. hideStar: hideStar,
  235. title: title
  236. });
  237. }).then(() => {
  238. this.mixins_search();
  239. });
  240. },
  241. lookDetails(row) {
  242. new Promise((resolve) => {
  243. this.$store.dispatch('addPopup', {
  244. url: '/payService/propertyFee/stepPage/details.vue',
  245. width: '615px',
  246. height: '581px',
  247. props: {
  248. id: row.id,
  249. callback: resolve
  250. },
  251. showConfirmButton: true,
  252. showCancelButton: true,
  253. hideStar: true,
  254. title: '账单详情'
  255. });
  256. }).then(() => {
  257. this.mixins_search();
  258. });
  259. },
  260. selectionChange(val) {
  261. this.selectRow = val;
  262. },
  263. currentOrganId(data) {
  264. this.currentId = data || '';
  265. },
  266. changeRadio() {
  267. this.statusTable = false;
  268. this.$nextTick(() => {
  269. this.statusTable = true;
  270. });
  271. this.mixins_query.chargeStatus = this.chargeStatus;
  272. this.mixins_search();
  273. },
  274. exportExcel() {
  275. this.__exportExcel('/sc-charge/charge/report/export/excel', this.mixins_query);
  276. },
  277. typeTimeTransition(start, end) {
  278. let text = '';
  279. if (!!end) {
  280. let f = new Date(start).getMonth(),
  281. l = new Date(end).getMonth();
  282. if (f == l) {
  283. text = `${this.$moment(new Date(start)).format('YYYY年M月')}`;
  284. } else {
  285. text = `${this.$moment(new Date(start)).format('YYYY年M月')}-${this.$moment(new Date(end)).format('YYYY年M月')}`;
  286. }
  287. }
  288. return text;
  289. },
  290. selectable(row, index) {
  291. return true;
  292. }
  293. },
  294. watch: {
  295. currentId(newValue, oldValue) {
  296. this.mixins_query.communityId = '';
  297. this.mixins_query.buildingId = '';
  298. this.mixins_query.unitName = '';
  299. this.mixins_query.houseId = '';
  300. if (newValue.type) {
  301. let newValueIds = newValue.id.split('-');
  302. this.chiData.type = newValue.type;
  303. if (newValue.type === 'community') {
  304. this.mixins_query.communityId = newValue.communityId;
  305. this.chiData.value = newValue.communityId;
  306. this.chiData.address = newValue.communityName;
  307. } else if (newValue.type === 'building') {
  308. this.mixins_query.communityId = newValue.communityId;
  309. this.mixins_query.buildingId = newValue.buildingId;
  310. this.chiData.value = newValue.buildingId;
  311. this.chiData.address = newValue.communityName + ' ' + newValue.buildingName;
  312. } else if (newValue.type === 'unit') {
  313. this.mixins_query.communityId = newValue.communityId;
  314. this.mixins_query.buildingId = newValue.buildingId;
  315. this.mixins_query.unitName = newValue.unitId;
  316. this.chiData.value = newValue.buildingId + ':' + newValue.unitId;
  317. this.chiData.address = newValue.communityName + ' ' + newValue.buildingName + ' ' + newValue.unitName;
  318. } else if (newValue.type === 'room') {
  319. this.mixins_query.communityId = newValue.communityId;
  320. this.mixins_query.buildingId = newValue.buildingId;
  321. this.mixins_query.unitName = newValue.unitId;
  322. this.mixins_query.houseId = newValue.houseId;
  323. this.chiData.value = newValue.houseId;
  324. this.chiData.address =
  325. newValue.communityName + ' ' + newValue.buildingName + ' ' + newValue.unitName + ' ' + newValue.houseName;
  326. }
  327. }
  328. this.mixins_search();
  329. }
  330. },
  331. created() {
  332. this.mixins_dataUrl = '/sc-charge/charge/bill/page'; // 分页查询接口
  333. this.mixins_query = {
  334. chargeStatus: this.chargeStatus
  335. // chargeType: 1
  336. };
  337. }
  338. };
  339. </script>
  340. <style lang='scss' scoped >
  341. @import '@assets/css/public-style.scss';
  342. .search {
  343. .zz-tab-button {
  344. margin-right: 20px;
  345. }
  346. }
  347. </style>