index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  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 == 1" class="item" effect="light" placement="bottom" content="删除">
  95. <i class="zoniot_font zoniot-icon-shanchu redText" @click="deluserbyidFn(scope.row.id)"></i>
  96. </el-tooltip>
  97. <el-tooltip v-show="chargeStatus == 2" class="item" effect="light" placement="bottom" content="详情">
  98. <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
  99. </el-tooltip>
  100. </div>
  101. </template>
  102. </zz-table>
  103. </div>
  104. </div>
  105. </template>
  106. <script>
  107. import list from '@/utils/list.js';
  108. export default {
  109. mixins: [list],
  110. name: 'propertyFee',
  111. data() {
  112. return {
  113. mixins_querys: {
  114. chargeType: ''
  115. },
  116. currentId: '',
  117. cols: [
  118. {
  119. label: '订单号',
  120. prop: 'billNumber'
  121. },
  122. {
  123. label: '地址',
  124. prop: 'assets'
  125. },
  126. {
  127. label: '业主',
  128. prop: 'residentName',
  129. width: '100'
  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: 'chargeStatusDict'
  157. },
  158. {
  159. label: '操作',
  160. prop: 'id',
  161. slot: 'opt'
  162. }
  163. ],
  164. statusCols: [
  165. {
  166. label: '订单号',
  167. prop: 'billNumber'
  168. },
  169. {
  170. label: '地址',
  171. prop: 'assets'
  172. },
  173. {
  174. label: '住户',
  175. prop: 'residentName'
  176. },
  177. {
  178. label: '费用名称',
  179. prop: 'chargeName'
  180. },
  181. {
  182. label: '计费日期',
  183. prop: 'payBeginTime',
  184. slot: 'payBeginTime',
  185. width: '150'
  186. },
  187. {
  188. label: '应收金额(元)',
  189. prop: 'receivableAmount'
  190. },
  191. {
  192. label: '实收金额(元)',
  193. prop: 'receivedAmount'
  194. },
  195. {
  196. label: '付款方式',
  197. prop: 'payTypeDict'
  198. },
  199. {
  200. label: '缴费状态',
  201. prop: 'chargeStatusDict'
  202. },
  203. {
  204. label: '缴费时间',
  205. prop: 'chargeDate',
  206. width: '150'
  207. },
  208. {
  209. label: '操作',
  210. prop: 'id',
  211. slot: 'opt'
  212. }
  213. ],
  214. chargeStatus: 1,
  215. chiData: {
  216. type: '',
  217. value: '',
  218. address: ''
  219. },
  220. mixins_post: 'post',
  221. selectRow: [],
  222. statusTable: true,
  223. times: []
  224. };
  225. },
  226. methods: {
  227. mixins_search() {
  228. this.mixins_pageset.pageNum = 1;
  229. if (!!this.mixins_querys.chargeType) {
  230. this.mixins_query.chargeType = this.mixins_querys.chargeType;
  231. } else {
  232. this.mixins_query.chargeType = '1,2,3,4,5,6,7';
  233. }
  234. if (this.chargeStatus == 1) {
  235. this.mixins_query.payType = '';
  236. }
  237. this.getList();
  238. },
  239. editAmount(row) {
  240. new Promise((resolve) => {
  241. this.$store.dispatch('addPopup', {
  242. url: '/payService/propertyFee/stepPage/editAmount.vue',
  243. width: '550px',
  244. height: '180px',
  245. props: {
  246. data: row,
  247. callback: resolve
  248. },
  249. title: '修改应收金额'
  250. });
  251. }).then(() => {
  252. this.mixins_search();
  253. });
  254. },
  255. collections(todo, row) {
  256. new Promise((resolve) => {
  257. let title = '',
  258. hideStar,
  259. height = '230px',
  260. width = '900px';
  261. if (todo == 'temporary') {
  262. title = '设置收费项目';
  263. hideStar = false;
  264. height = '270px';
  265. width = '550px';
  266. } else if (todo == 'bulk') {
  267. if (!this.selectRow.length) {
  268. this.$message.error('您尚未选择要收款项,请选择后再操作批量');
  269. return;
  270. }
  271. let tag = false;
  272. this.selectRow.map((item) => {
  273. if (this.selectRow[0].houseId == item.houseId) {
  274. tag = true;
  275. } else {
  276. tag = false;
  277. }
  278. });
  279. if (!tag) {
  280. this.$message.error('选择同一房间后再操作批量');
  281. return;
  282. }
  283. title = '批量收款';
  284. hideStar = true;
  285. height = '528px';
  286. width = '900px';
  287. } else if (todo == 'single') {
  288. title = '收款';
  289. hideStar = true;
  290. height = '614px';
  291. width = '614px';
  292. }
  293. this.$store.dispatch('addPopup', {
  294. url: '/payService/propertyFee/stepPage/' + todo + '.vue',
  295. // url: '/payService/propertyFee/stepPage/single.vue',
  296. width: width,
  297. height: height,
  298. props: {
  299. data: row,
  300. selectRow: this.selectRow,
  301. chiData: this.chiData,
  302. tabList: todo,
  303. communityId: this.mixins_query.communityId,
  304. callback: resolve
  305. },
  306. hideStar: hideStar,
  307. title: title
  308. });
  309. }).then(() => {
  310. this.mixins_search();
  311. });
  312. },
  313. effectiveDateToggle(va) {
  314. let arr = va;
  315. if (!arr) {
  316. arr = ['', ''];
  317. }
  318. this.mixins_query.startTime = arr[0];
  319. this.mixins_query.endTime = arr[1];
  320. },
  321. deluserbyidFn(id) {
  322. const h = this.$createElement;
  323. this.$msgBox(`删除账单`, '删除后将无法恢复,请问是否继续?')
  324. .then(() => {
  325. this.$http.get('/sc-charge/charge/bill/delete', { billId: id }).then(({ status, data, msg }) => {
  326. if (0 === status) {
  327. this.$message({
  328. type: 'success',
  329. message: '删除成功!'
  330. });
  331. this.mixins_search();
  332. } else {
  333. this.$message.error(msg);
  334. }
  335. });
  336. })
  337. .catch(() => {});
  338. },
  339. lookDetails(row) {
  340. new Promise((resolve) => {
  341. this.$store.dispatch('addPopup', {
  342. url: '/payService/propertyFee/stepPage/details.vue',
  343. width: '615px',
  344. height: '581px',
  345. props: {
  346. id: row.id,
  347. callback: resolve
  348. },
  349. showConfirmButton: true,
  350. showCancelButton: true,
  351. hideStar: true,
  352. title: '账单详情'
  353. });
  354. }).then(() => {
  355. this.mixins_search();
  356. });
  357. },
  358. selectionChange(val) {
  359. this.selectRow = val;
  360. },
  361. currentOrganId(data) {
  362. this.currentId = data || '';
  363. },
  364. changeRadio() {
  365. this.statusTable = false;
  366. this.$nextTick(() => {
  367. this.statusTable = true;
  368. });
  369. this.times = [];
  370. this.Object_Set(['startTime', 'endTime', 'chargeStatus'], ['', '', this.chargeStatus]);
  371. this.mixins_search();
  372. },
  373. exportExcel() {
  374. this.__exportExcel('/sc-charge/charge/bill/export/excel', this.mixins_query);
  375. },
  376. typeTimeTransition(start, end) {
  377. let text = '';
  378. if (!!end) {
  379. let f = new Date(start).getMonth(),
  380. l = new Date(end).getMonth();
  381. if (f == l) {
  382. text = `${this.$moment(new Date(start)).format('YYYY年M月')}`;
  383. } else {
  384. text = `${this.$moment(new Date(start)).format('YYYY年M月')}-${this.$moment(new Date(end)).format('YYYY年M月')}`;
  385. }
  386. }
  387. return text;
  388. },
  389. selectable(row, index) {
  390. return true;
  391. },
  392. Object_Set(thisObj, val, editThisObj) {
  393. if (thisObj instanceof Array && val instanceof Array) {
  394. if (!!editThisObj) {
  395. thisObj.map((item, index) => {
  396. this[editThisObj][item] = val[index];
  397. });
  398. } else {
  399. thisObj.map((item, index) => {
  400. this['mixins_query'][item] = val[index];
  401. });
  402. }
  403. } else {
  404. if (!!editThisObj) {
  405. this[editThisObj][thisObj] = val;
  406. } else {
  407. this['mixins_query'][thisObj] = val;
  408. }
  409. }
  410. }
  411. },
  412. watch: {
  413. currentId(newValue, oldValue) {
  414. this.Object_Set(['communityId', 'buildingId', 'unitName', 'houseId'], ['', '', '', '']);
  415. if (newValue.type) {
  416. this.chiData.type = newValue.type;
  417. if (newValue.type === 'community') {
  418. this.Object_Set(['communityId'], [newValue.communityId]);
  419. this.Object_Set(['value', 'address'], [newValue.communityId, newValue.communityName], 'chiData');
  420. } else if (newValue.type === 'building') {
  421. this.Object_Set(['communityId', 'buildingId'], [newValue.communityId, newValue.buildingId]);
  422. this.Object_Set(
  423. ['value', 'address'],
  424. [newValue.buildingId, newValue.communityName + ' ' + newValue.buildingName],
  425. 'chiData'
  426. );
  427. } else if (newValue.type === 'unit') {
  428. this.Object_Set(
  429. ['communityId', 'buildingId', 'unitName'],
  430. [newValue.communityId, newValue.buildingId, newValue.unitId]
  431. );
  432. this.Object_Set(
  433. ['value', 'address'],
  434. [
  435. newValue.buildingId + ':' + newValue.unitId,
  436. newValue.communityName + ' ' + newValue.buildingName + ' ' + newValue.unitName
  437. ],
  438. 'chiData'
  439. );
  440. } else if (newValue.type === 'room') {
  441. this.Object_Set(
  442. ['communityId', 'buildingId', 'unitName', 'houseId'],
  443. [newValue.communityId, newValue.buildingId, newValue.unitId, newValue.houseId]
  444. );
  445. this.Object_Set(
  446. ['value', 'address'],
  447. [
  448. newValue.houseId,
  449. newValue.communityName + ' ' + newValue.buildingName + ' ' + newValue.unitName + ' ' + newValue.houseName
  450. ],
  451. 'chiData'
  452. );
  453. }
  454. }
  455. this.mixins_search();
  456. }
  457. },
  458. created() {
  459. this.mixins_dataUrl = '/sc-charge/charge/bill/page'; // 分页查询接口
  460. this.mixins_query = {
  461. chargeStatus: this.chargeStatus,
  462. chargeType: '1,2,3,4,5,6,7',
  463. payType: ''
  464. };
  465. }
  466. };
  467. </script>
  468. <style lang='scss' scoped >
  469. @import '@assets/css/public-style.scss';
  470. .search {
  471. .zz-tab-button {
  472. margin-right: 20px;
  473. }
  474. .width120 {
  475. width: rem(120);
  476. }
  477. }
  478. </style>