index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  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-select v-model="mixins_querys.chargeType" placeholder="费用类型" clearable class="width120">
  18. <el-option label="物业费" :value="1"></el-option>
  19. <el-option label="水费" :value="2"></el-option>
  20. <el-option label="电费" :value="3"></el-option>
  21. <el-option label="卫生费" :value="6"></el-option>
  22. <el-option label="车位管理费" :value="4"></el-option>
  23. <el-option label="其他费用" :value="7"></el-option>
  24. </el-select>
  25. <!-- 已交 -->
  26. <template v-if="chargeStatus == 2">
  27. <el-select v-model="mixins_query.payType" class="width120" placeholder="缴费方式" clearable>
  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="6"></el-option>
  32. <el-option label="其他" :value="5"></el-option>
  33. </el-select>
  34. <el-date-picker
  35. v-model="times"
  36. value-format="yyyy-MM-dd"
  37. type="daterange"
  38. range-separator="至"
  39. start-placeholder="选择开始日期"
  40. end-placeholder="选择结束日期"
  41. @change="effectiveDateToggle"
  42. ></el-date-picker>
  43. </template>
  44. <el-date-picker
  45. v-else
  46. v-model="times"
  47. value-format="yyyy-MM"
  48. type="monthrange"
  49. range-separator="至"
  50. start-placeholder="选择开始月"
  51. end-placeholder="选择结束月"
  52. @change="effectiveDateToggle"
  53. ></el-date-picker>
  54. <el-button class="search-btn" type="primary" @click="mixins_search()" icon="el-icon-search">搜索</el-button>
  55. <div class="search-icon">
  56. <el-tooltip
  57. v-show="chargeStatus == 1 && chiData.type === 'room'"
  58. class="item"
  59. effect="light"
  60. placement="bottom"
  61. content="临时收款"
  62. >
  63. <i class="zoniot_font zoniot-icon-linshishoukuan" @click="collections('temporary')"></i>
  64. </el-tooltip>
  65. <el-tooltip v-show="chargeStatus == 1" class="item" effect="light" placement="bottom" content="批量收款">
  66. <i class="zoniot_font zoniot-icon-piliangshoukuan" @click="collections('bulk')"></i>
  67. </el-tooltip>
  68. <el-tooltip class="item" effect="light" placement="bottom" content="导出">
  69. <i class="zoniot_font zoniot-icon-daochu2" @click="exportExcel"></i>
  70. </el-tooltip>
  71. </div>
  72. </div>
  73. <zz-table
  74. v-if="statusTable"
  75. :settings="{ showCheckbox: chargeStatus == 1, showIndex: chargeStatus == 2, stripe: true }"
  76. :cols="chargeStatus == 1 ? cols : statusCols"
  77. :data="mixins_list"
  78. :pageset="mixins_pageset"
  79. @page-change="pageChange"
  80. :selectable="selectable"
  81. @selection-change="selectionChange"
  82. >
  83. <template slot-scope="scope" slot="payBeginTime">
  84. {{ typeTimeTransition(scope.row.payBeginTime, scope.row.payEndTime) }}
  85. </template>
  86. <template slot-scope="scope" slot="opt">
  87. <div class="opt">
  88. <el-tooltip v-show="chargeStatus == 1" class="item" effect="light" placement="bottom" content="收款">
  89. <i class="zoniot_font zoniot-icon-shoukuan" @click="collections('single', scope.row)"></i>
  90. </el-tooltip>
  91. <el-tooltip v-show="chargeStatus == 1" class="item" effect="light" placement="bottom" content="修改金额">
  92. <i class="zoniot_font zoniot-icon-koufeijilu" @click="editAmount(scope.row)"></i>
  93. </el-tooltip>
  94. <el-tooltip v-show="chargeStatus == 2" class="item" effect="light" placement="bottom" content="详情">
  95. <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
  96. </el-tooltip>
  97. </div>
  98. </template>
  99. </zz-table>
  100. </div>
  101. </div>
  102. </template>
  103. <script>
  104. import list from '@/utils/list.js';
  105. export default {
  106. mixins: [list],
  107. name: 'propertyFee',
  108. data() {
  109. return {
  110. mixins_querys: {
  111. chargeType: ''
  112. },
  113. currentId: '',
  114. cols: [
  115. {
  116. label: '订单号',
  117. prop: 'billNumber'
  118. },
  119. {
  120. label: '地址',
  121. prop: 'assets'
  122. },
  123. {
  124. label: '业主',
  125. prop: 'residentName',
  126. width: '100'
  127. },
  128. {
  129. label: '费用名称',
  130. prop: 'chargeName',
  131. width: '200'
  132. },
  133. {
  134. label: '计费日期',
  135. prop: 'payBeginTime',
  136. slot: 'payBeginTime',
  137. width: '150'
  138. },
  139. {
  140. label: '费用金额(元)',
  141. prop: 'amount'
  142. },
  143. {
  144. label: '滞纳金(元)',
  145. prop: 'lateFee'
  146. },
  147. {
  148. label: '应收金额(元)',
  149. prop: 'receivableAmount'
  150. },
  151. {
  152. label: '缴费状态',
  153. prop: 'chargeStatusDict'
  154. },
  155. {
  156. label: '操作',
  157. prop: 'id',
  158. slot: 'opt'
  159. }
  160. ],
  161. statusCols: [
  162. {
  163. label: '订单号',
  164. prop: 'billNumber'
  165. },
  166. {
  167. label: '地址',
  168. prop: 'assets'
  169. },
  170. {
  171. label: '住户',
  172. prop: 'residentName'
  173. },
  174. {
  175. label: '费用名称',
  176. prop: 'chargeName'
  177. },
  178. {
  179. label: '计费日期',
  180. prop: 'payBeginTime',
  181. slot: 'payBeginTime',
  182. width: '150'
  183. },
  184. {
  185. label: '应收金额(元)',
  186. prop: 'receivableAmount'
  187. },
  188. {
  189. label: '实收金额(元)',
  190. prop: 'receivedAmount'
  191. },
  192. {
  193. label: '付款方式',
  194. prop: 'payTypeDict'
  195. },
  196. {
  197. label: '缴费状态',
  198. prop: 'chargeStatusDict'
  199. },
  200. {
  201. label: '缴费时间',
  202. prop: 'chargeDate',
  203. width: '150'
  204. },
  205. {
  206. label: '操作',
  207. prop: 'id',
  208. slot: 'opt'
  209. }
  210. ],
  211. chargeStatus: 1,
  212. chiData: {
  213. type: '',
  214. value: '',
  215. address: ''
  216. },
  217. mixins_post: 'post',
  218. selectRow: [],
  219. statusTable: true,
  220. times: []
  221. };
  222. },
  223. methods: {
  224. mixins_search() {
  225. this.mixins_pageset.pageNum = 1;
  226. if (!!this.mixins_querys.chargeType) {
  227. this.mixins_query.chargeType = this.mixins_querys.chargeType;
  228. } else {
  229. this.mixins_query.chargeType = '1,2,3,4,5,6,7';
  230. }
  231. if (this.chargeStatus == 1) {
  232. this.mixins_query.payType = '';
  233. }
  234. this.getList();
  235. },
  236. editAmount(row) {
  237. new Promise((resolve) => {
  238. this.$store.dispatch('addPopup', {
  239. url: '/payService/propertyFee/stepPage/editAmount.vue',
  240. width: '550px',
  241. height: '180px',
  242. props: {
  243. data: row,
  244. callback: resolve
  245. },
  246. title: '修改应收金额'
  247. });
  248. }).then(() => {
  249. this.mixins_search();
  250. });
  251. },
  252. collections(todo, row) {
  253. new Promise((resolve) => {
  254. let title = '',
  255. hideStar,
  256. height = '230px',
  257. width = '900px';
  258. if (todo == 'temporary') {
  259. title = '设置收费项目';
  260. hideStar = false;
  261. height = '270px';
  262. width = '550px';
  263. } else if (todo == 'bulk') {
  264. if (!this.selectRow.length) {
  265. this.$message.error('您尚未选择要收款项,请选择后再操作批量');
  266. return;
  267. }
  268. let tag = false;
  269. this.selectRow.map((item) => {
  270. if (this.selectRow[0].houseId == item.houseId) {
  271. tag = true;
  272. } else {
  273. tag = false;
  274. }
  275. });
  276. if (!tag) {
  277. this.$message.error('选择同一房间后再操作批量');
  278. return;
  279. }
  280. title = '批量收款';
  281. hideStar = true;
  282. height = '528px';
  283. width = '900px';
  284. } else if (todo == 'single') {
  285. title = '收款';
  286. hideStar = true;
  287. height = '614px';
  288. width = '614px';
  289. }
  290. this.$store.dispatch('addPopup', {
  291. url: '/payService/propertyFee/stepPage/' + todo + '.vue',
  292. // url: '/payService/propertyFee/stepPage/single.vue',
  293. width: width,
  294. height: height,
  295. props: {
  296. data: row,
  297. selectRow: this.selectRow,
  298. chiData: this.chiData,
  299. tabList: todo,
  300. communityId: this.mixins_query.communityId,
  301. callback: resolve
  302. },
  303. hideStar: hideStar,
  304. title: title
  305. });
  306. }).then(() => {
  307. this.mixins_search();
  308. });
  309. },
  310. effectiveDateToggle(va) {
  311. let arr = va;
  312. if (!arr) {
  313. arr = ['', ''];
  314. }
  315. this.mixins_query.startTime = arr[0];
  316. this.mixins_query.endTime = arr[1];
  317. },
  318. lookDetails(row) {
  319. new Promise((resolve) => {
  320. this.$store.dispatch('addPopup', {
  321. url: '/payService/propertyFee/stepPage/details.vue',
  322. width: '615px',
  323. height: '581px',
  324. props: {
  325. id: row.id,
  326. callback: resolve
  327. },
  328. showConfirmButton: true,
  329. showCancelButton: true,
  330. hideStar: true,
  331. title: '账单详情'
  332. });
  333. }).then(() => {
  334. this.mixins_search();
  335. });
  336. },
  337. selectionChange(val) {
  338. this.selectRow = val;
  339. },
  340. currentOrganId(data) {
  341. this.currentId = data || '';
  342. },
  343. changeRadio() {
  344. this.statusTable = false;
  345. this.$nextTick(() => {
  346. this.statusTable = true;
  347. });
  348. this.times = [];
  349. this.Object_Set(['startTime', 'endTime', 'chargeStatus'], ['', '', this.chargeStatus]);
  350. this.mixins_search();
  351. },
  352. exportExcel() {
  353. this.__exportExcel('/sc-charge/charge/bill/export/excel', this.mixins_query);
  354. },
  355. typeTimeTransition(start, end) {
  356. let text = '';
  357. if (!!end) {
  358. let f = new Date(start).getMonth(),
  359. l = new Date(end).getMonth();
  360. if (f == l) {
  361. text = `${this.$moment(new Date(start)).format('YYYY年M月')}`;
  362. } else {
  363. text = `${this.$moment(new Date(start)).format('YYYY年M月')}-${this.$moment(new Date(end)).format('YYYY年M月')}`;
  364. }
  365. }
  366. return text;
  367. },
  368. selectable(row, index) {
  369. return true;
  370. },
  371. Object_Set(thisObj, val, editThisObj) {
  372. if (thisObj instanceof Array && val instanceof Array) {
  373. if (!!editThisObj) {
  374. thisObj.map((item, index) => {
  375. this[editThisObj][item] = val[index];
  376. });
  377. } else {
  378. thisObj.map((item, index) => {
  379. this['mixins_query'][item] = val[index];
  380. });
  381. }
  382. } else {
  383. if (!!editThisObj) {
  384. this[editThisObj][thisObj] = val;
  385. } else {
  386. this['mixins_query'][thisObj] = val;
  387. }
  388. }
  389. }
  390. },
  391. watch: {
  392. currentId(newValue, oldValue) {
  393. this.Object_Set(['communityId', 'buildingId', 'unitName', 'houseId'], ['', '', '', '']);
  394. if (newValue.type) {
  395. this.chiData.type = newValue.type;
  396. if (newValue.type === 'community') {
  397. this.Object_Set(['communityId'], [newValue.communityId]);
  398. this.Object_Set(['value', 'address'], [newValue.communityId, newValue.communityName], 'chiData');
  399. } else if (newValue.type === 'building') {
  400. this.Object_Set(['communityId', 'buildingId'], [newValue.communityId, newValue.buildingId]);
  401. this.Object_Set(
  402. ['value', 'address'],
  403. [newValue.buildingId, newValue.communityName + ' ' + newValue.buildingName],
  404. 'chiData'
  405. );
  406. } else if (newValue.type === 'unit') {
  407. this.Object_Set(
  408. ['communityId', 'buildingId', 'unitName'],
  409. [newValue.communityId, newValue.buildingId, newValue.unitId]
  410. );
  411. this.Object_Set(
  412. ['value', 'address'],
  413. [
  414. newValue.buildingId + ':' + newValue.unitId,
  415. newValue.communityName + ' ' + newValue.buildingName + ' ' + newValue.unitName
  416. ],
  417. 'chiData'
  418. );
  419. } else if (newValue.type === 'room') {
  420. this.Object_Set(
  421. ['communityId', 'buildingId', 'unitName', 'houseId'],
  422. [newValue.communityId, newValue.buildingId, newValue.unitId, newValue.houseId]
  423. );
  424. this.Object_Set(
  425. ['value', 'address'],
  426. [
  427. newValue.houseId,
  428. newValue.communityName + ' ' + newValue.buildingName + ' ' + newValue.unitName + ' ' + newValue.houseName
  429. ],
  430. 'chiData'
  431. );
  432. }
  433. }
  434. this.mixins_search();
  435. }
  436. },
  437. created() {
  438. this.mixins_dataUrl = '/sc-charge/charge/bill/page'; // 分页查询接口
  439. this.mixins_query = {
  440. chargeStatus: this.chargeStatus,
  441. chargeType: '1,2,3,4,5,6,7',
  442. payType: ''
  443. };
  444. }
  445. };
  446. </script>
  447. <style lang='scss' scoped >
  448. @import '@assets/css/public-style.scss';
  449. .search {
  450. .zz-tab-button {
  451. margin-right: 20px;
  452. }
  453. .width120 {
  454. width: rem(120);
  455. }
  456. }
  457. </style>