zhifuyichang.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div>
  3. <el-row>
  4. <el-col :span="24" class="first-row">
  5. <div class="tag">支付异常</div>
  6. </el-col>
  7. </el-row>
  8. <el-row>
  9. <el-col :span="24" class="second-row">
  10. <el-form :inline="true" class="demo-form-inline">
  11. <el-form-item label="选择:" class="shuibiaoId">
  12. <el-select v-model="drom_options.value" placeholder="请选择" class="my-select"
  13. @change="selectGetBuild(drom_options.value)">
  14. <el-option v-for="item in drom_options.builds" :key="item.value" :label="item.label"
  15. :value="item.value">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. </el-form>
  20. </el-col>
  21. </el-row>
  22. <hr style="background-color: #CCCCCC;height: 1px;border: 0;">
  23. <el-row>
  24. <el-col :span="24" class="third-row">
  25. <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
  26. highlight-current-row>
  27. <el-table-column align="center" label="姓名" width="200">
  28. <template slot-scope="scope">{{ scope.row.stu_number }}</template>
  29. </el-table-column>
  30. <el-table-column prop="user_name" label="学号" align="center" width="200"></el-table-column>
  31. <el-table-column prop="user_name" label="充值宿舍号" align="center" width="200"></el-table-column>
  32. <el-table-column prop="balance" label="金额(元)" align="center" show-overflow-tooltip></el-table-column>
  33. <el-table-column prop="balance" label="时间" align="center" show-overflow-tooltip></el-table-column>
  34. <el-table-column label="操作" align="center" width="380">
  35. <template slot-scope="scope">
  36. <el-button type="text" v-if="handle"
  37. @click="handleShowDialog(scope.$index, scope.row)">未处理</el-button>
  38. <el-button type="text" class="exception" v-else>已处理</el-button>
  39. </template>
  40. </el-table-column>
  41. </el-table>
  42. <div style="margin-top: 20px" class="table-footer">
  43. <div class="pages">
  44. <el-pagination layout="prev, pager, next" :current-page.sync="currentPage"
  45. :hide-on-single-page="true" :page-size="pageRows" :total="rows_total"
  46. @current-change="handleCurrentChange"></el-pagination>
  47. </div>
  48. </div>
  49. </el-col>
  50. </el-row>
  51. <el-row>
  52. <el-col :span="24" class="forth-row">
  53. <!-- 操作对话框 -->
  54. <el-dialog title="用水异常处理" :visible.sync="detail_dialogFormVisible" width="640px" top="0vh"
  55. class="my-dialog" :close-on-click-modal="false" :close-on-press-escape="false">
  56. <hr
  57. style="width: 100%; position: absolute; top: 60px; left: 0px;background-color: #CCCCCC;height: 1px;border: 0;">
  58. <el-form :inline="true" class="demo-form-inline">
  59. <el-form-item label="姓名:" class="shuibiaoId">
  60. <el-input v-model="detail_userName" placeholder="请输入姓名" clearable></el-input>
  61. </el-form-item>
  62. <el-form-item>
  63. <el-button type="primary" @click="onSearch">查找</el-button>
  64. </el-form-item>
  65. </el-form>
  66. <el-table ref="multipleTable" :data="detail_tableData" tooltip-effect="dark" style="width: 100%"
  67. highlight-current-row>
  68. <el-table-column align="center" label="学号">
  69. <template slot-scope="scope">{{ scope.row.stu_number }}</template>
  70. </el-table-column>
  71. <el-table-column align="center" prop="user_name" label="姓名" show-overflow-tooltip>
  72. </el-table-column>
  73. <el-table-column align="center" prop="use_amount" label="用水量" show-overflow-tooltip>
  74. </el-table-column>
  75. </el-table>
  76. <div slot="footer" class="dialog-footer">
  77. <div class="dialog-pages">
  78. <el-pagination layout="prev, pager, next"
  79. :current-page.sync="control_table.detail_current_page" :hide-on-single-page="true"
  80. :page-size="control_table.detail_page_rows" @current-change="handleCurrentChange"
  81. :total="control_table.detail_total_rows"></el-pagination>
  82. </div>
  83. </div>
  84. </el-dialog>
  85. </el-col>
  86. </el-row>
  87. </div>
  88. </template>
  89. <script>
  90. export default {
  91. data() {
  92. return {
  93. drom_value: 0, // 楼栋号编码
  94. drom: '', // 楼栋号
  95. // 楼栋号下拉列表
  96. drom_options: { // 下拉列表的数据绑定
  97. builds: [{
  98. value: 0,
  99. label: '电费'
  100. },{
  101. value: 1,
  102. label: '水费'
  103. }],
  104. value: 0
  105. },
  106. currentPage: 1, // 余额列表当前页
  107. pageRows: 8, // 每页记录数
  108. tableData: [], // 异常列表
  109. rows_total: 0, // 总行数
  110. // 详情对话框相关参数
  111. detail_dialogFormVisible: false, // 控制详情对话框显示、隐藏
  112. detail_userName: '', // 姓名用于查询
  113. detail_tableData: [],
  114. control_table: {
  115. detail_current_page: 1,
  116. detail_page_rows: 8,
  117. detail_total_rows: 0
  118. },
  119. handle: true
  120. }
  121. },
  122. created() {
  123. // 获取余额列表
  124. let params = {
  125. page: this.currentPage,
  126. rows: this.pageRows
  127. }
  128. // 异常列表
  129. this.get_exception_list(params)
  130. },
  131. methods: {
  132. /**
  133. * 列表改变页码
  134. * @param {Object} val
  135. */
  136. handleCurrentChange(val) {
  137. // console.log(val);
  138. this.currentPage = val
  139. var params = {}
  140. if (this.searchformUser != '' & typeof(this.searchformUser) != 'undefined') {
  141. params = {
  142. page: this.currentPage,
  143. rows: this.pageRows,
  144. user_name: this.searchformUser
  145. }
  146. } else {
  147. params = {
  148. page: this.currentPage,
  149. rows: this.pageRows
  150. }
  151. }
  152. // 获取余额列表
  153. // this.get_amount_list(params)
  154. },
  155. /**
  156. * 处理异常
  157. * @param {Object} index
  158. * @param {Object} row
  159. */
  160. handleShowDialog(index, row) {
  161. console.log(index, row)
  162. },
  163. /**
  164. * 获取余额列表
  165. */
  166. get_exception_list(params) {
  167. var _this = this
  168. _this.tableData = []
  169. // _this.rows_total = 0
  170. this.$axios.get('/jxch-smartmp-api/HotWaters/waterMoney.action', {
  171. params: params
  172. })
  173. .then(res => {
  174. // console.log(res.data);
  175. if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(res.data) !=
  176. '{}') {
  177. // _this.$message.success('数据加载成功!');
  178. _this.tableData = res.data.rows
  179. _this.rows_total = res.data.total
  180. } else {
  181. _this.$message.success('【获取余额列表】暂无数据!');
  182. }
  183. })
  184. .catch(err => {
  185. // console.log(err);
  186. _this.$message.error('【获取余额列表】请求异常: ' + err);
  187. })
  188. },
  189. /**
  190. * 选择楼栋号
  191. */
  192. selectGetBuild(vId) {
  193. // console.log(vId);
  194. this.drom_value = vId
  195. let obj = {};
  196. obj = this.drom_options.builds.find((item) => {
  197. return item.value === vId; //筛选出匹配数据
  198. });
  199. // console.log(obj);
  200. this.drom_options.value = obj.value
  201. this.drom_options.label = obj.label
  202. // 获取楼栋号
  203. this.drom = this.drom_options.label
  204. // 共用部分
  205. // this.updateData()
  206. },
  207. /**
  208. * 详情页面查找
  209. */
  210. onSearch() {
  211. this.control_table.detail_current_page = 1
  212. // this.show_detail()
  213. }
  214. }
  215. }
  216. </script>
  217. <style scoped>
  218. @import url("zhifuyichang.css");
  219. </style>