index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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-input
  7. clearable
  8. placeholder="输入费用名称"
  9. class="search-input"
  10. v-trim
  11. v-model.trim="mixins_query.chargeName"
  12. ></el-input>
  13. <el-button class="search-btn" type="primary" @click="mixins_search()" icon="el-icon-search">搜索</el-button>
  14. <div class="search-icon">
  15. <el-tooltip class="item" effect="light" placement="bottom" content="设置收费项">
  16. <i class="zoniot_font zoniot-icon-shoufeishezhi" @click="addOrEdit('add')"></i>
  17. </el-tooltip>
  18. </div>
  19. </div>
  20. <div class="redText title">注:房屋若没有单独设置收费项目,将使用社区、楼栋或单元设置的收费项(以最下级设置的收费项目为准)</div>
  21. <zz-table
  22. :settings="{ showIndex: true, stripe: true }"
  23. :cols="cols"
  24. :data="mixins_list"
  25. :pageset="mixins_pageset"
  26. @page-change="pageChange"
  27. >
  28. <template slot-scope="scope" slot="chargeMode">
  29. <span v-if="scope.row.chargeMode === 1">固定收费 </span>
  30. <span v-if="scope.row.chargeMode === 2">价格*面积收费</span>
  31. <span v-if="scope.row.chargeMode === 3">阶梯计费 </span>
  32. <span v-if="scope.row.chargeMode === 4">单价*用量</span>
  33. </template>
  34. <template slot-scope="scope" slot="chargePrice">
  35. <!-- <template v-if="scope.row.chargePriceLadder !== 'null' || scope.row.chargePriceLadder !== null">
  36. <div v-for="(item, index) in JSON.parse(scope.row.chargePriceLadder)" :key="index">
  37. <div>
  38. <span v-if="item.ladder === 1">一 阶价格:{{ item.price }}</span>
  39. <span v-else-if="item.ladder === 2">二 阶价格:{{ item.price }}</span>
  40. <span v-else-if="item.ladder === 3">三 阶价格:{{ item.price }}</span>
  41. <span v-else-if="item.ladder === 4">四 阶价格:{{ item.price }}</span>
  42. <span v-else-if="item.ladder === 5">五 阶价格:{{ item.price }}</span>
  43. <span v-else>{{ scope.row.chargePrice }}</span>
  44. </div>
  45. </div>
  46. </template> -->
  47. <div >{{ scope.row.chargePrice }}</div>
  48. </template>
  49. <template slot-scope="scope" slot="opt">
  50. <div class="opt">
  51. <el-tooltip class="item" effect="light" placement="bottom" content="移除">
  52. <i class="zoniot_font zoniot-icon-shanchu redText" @click="deleteRow(scope.row)"></i>
  53. </el-tooltip>
  54. </div>
  55. </template>
  56. </zz-table>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import list from '@/js/list.js';
  62. export default {
  63. mixins: [list],
  64. name: 'chargeSetting',
  65. data() {
  66. return {
  67. currentId: '',
  68. cols: [
  69. {
  70. label: '地址',
  71. prop: 'address'
  72. },
  73. {
  74. label: '费用名称',
  75. prop: 'chargeName'
  76. },
  77. {
  78. label: '费用类型',
  79. prop: 'chargeType',
  80. format(val) {
  81. if (val == '1') {
  82. return '物业费';
  83. } else if (val == '2') {
  84. return '水费';
  85. } else if (val == '3') {
  86. return '电费';
  87. } else if (val == '4') {
  88. return '车位费';
  89. } else if (val == '6') {
  90. return '卫生费';
  91. } else if (val == '7') {
  92. return '其他费用';
  93. }
  94. }
  95. },
  96. {
  97. label: '计费方式',
  98. prop: 'chargeMode',
  99. slot: 'chargeMode'
  100. },
  101. {
  102. label: '价格(元)',
  103. prop: 'chargePrice',
  104. slot: 'chargePrice'
  105. },
  106. {
  107. label: '计费周期',
  108. prop: 'chargeCycle',
  109. format(val) {
  110. if (val) {
  111. return val + '个月';
  112. }
  113. }
  114. },
  115. {
  116. label: '首次生效时间',
  117. prop: 'firstEffectiveDate'
  118. },
  119. {
  120. label: '操作',
  121. prop: 'id',
  122. slot: 'opt'
  123. }
  124. ],
  125. chiData: {
  126. type: '',
  127. value: '',
  128. address: ''
  129. }
  130. };
  131. },
  132. methods: {
  133. addOrEdit(todo) {
  134. new Promise((resolve) => {
  135. let title = '设置收费项目';
  136. this.$store.dispatch('addPopup', {
  137. url: '/payService/chargeSetting/stepPage/add.vue',
  138. width: '524px',
  139. height: '415px',
  140. props: {
  141. data: this.chiData,
  142. todo,
  143. productOptions: this.productOptions,
  144. callback: resolve
  145. },
  146. title: title
  147. });
  148. }).then(() => {
  149. this.mixins_search();
  150. });
  151. },
  152. deleteRow(row) {
  153. const { chargeName } = row;
  154. let title = `您确定要移除“${chargeName}”`;
  155. this.$msgBox(title)
  156. .then(() => {
  157. this.$http
  158. .postForm('/sc-charge/scChargeStrategyConfig/delete', { id: row.id })
  159. .then(({ status, msg }) => {
  160. if (0 === status) {
  161. this.$message.success(msg);
  162. this.mixins_search('del');
  163. } else {
  164. this.$message.error(msg);
  165. }
  166. })
  167. .catch(() => {});
  168. })
  169. .catch(() => {});
  170. },
  171. currentOrganId(data) {
  172. this.currentId = data || '';
  173. }
  174. },
  175. watch: {
  176. currentId(newValue, oldValue) {
  177. if (newValue.type) {
  178. let newValueIds = newValue.id.split('-');
  179. this.chiData.type = newValueIds.length;
  180. if (newValue.type === 'community') {
  181. this.mixins_query.value = newValue.communityId;
  182. this.mixins_query.type = 1;
  183. this.chiData.value = newValue.communityId;
  184. this.chiData.address = newValue.communityName;
  185. } else if (newValue.type === 'building') {
  186. this.mixins_query.value = newValue.buildingId;
  187. this.mixins_query.type = 2;
  188. this.chiData.value = newValue.buildingId;
  189. this.chiData.address = newValue.communityName + ' ' + newValue.buildingName;
  190. } else if (newValue.type === 'unit') {
  191. this.mixins_query.value = newValue.buildingId + ':' + newValue.unitId;
  192. this.mixins_query.type = 3;
  193. this.chiData.value = newValue.buildingId + ':' + newValue.unitId;
  194. this.chiData.address = newValue.communityName + ' ' + newValue.buildingName + ' ' + newValue.unitName;
  195. } else if (newValue.type === 'room') {
  196. this.mixins_query.value = newValue.houseId;
  197. this.mixins_query.type = 4;
  198. this.chiData.value = newValue.houseId;
  199. this.chiData.address =
  200. newValue.communityName + ' ' + newValue.buildingName + ' ' + newValue.unitName + ' ' + newValue.houseName;
  201. }
  202. }
  203. this.mixins_search();
  204. }
  205. },
  206. created() {
  207. this.mix_path = ''; // 权限
  208. this.mixins_dataUrl = '/sc-charge/scChargeStrategyConfig/page'; // 分页查询接口
  209. this.mixins_query = {};
  210. }
  211. };
  212. </script>
  213. <style lang='scss' scoped >
  214. .title {
  215. font-size: 12px;
  216. background: white;
  217. padding: 20px;
  218. }
  219. </style>