index.vue 16 KB

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