index.vue 14 KB

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