service.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div class="hui-flex hui-content">
  3. <div class="hui-flex">
  4. <div class="hui-content-title">
  5. <div class="hui-title-item active">维修工单</div>
  6. </div>
  7. <div class="hui-flex-box hui-flex hui-table">
  8. <list-filter type="order" @filter="filterInit"></list-filter>
  9. <div class="hui-content-insert">
  10. <el-button type="primary" size="medium" @click="insert">新增工单</el-button>
  11. </div>
  12. <div class="hui-flex-box">
  13. <el-table :data="tableData" row-key="id" border height="100%">
  14. <el-table-column label="序号" width="50">
  15. <template slot-scope="scope">
  16. <div style="text-align: center;">{{scope.$index + 1}}</div>
  17. </template>
  18. </el-table-column>
  19. <el-table-column label="楼宇" prop="code"></el-table-column>
  20. <el-table-column label="租客" prop="name">
  21. <template slot-scope="scope">
  22. {{scope.row.tenantType === 1 ? scope.row.merchantName: scope.row.clientName}}
  23. </template>
  24. </el-table-column>
  25. <el-table-column label="房号" prop="projectItemTargetRoomIds">
  26. <template slot-scope="scope">
  27. <div class="hui-ellipsis">
  28. <span v-for="(item,index) in scope.row.roomMap">
  29. {{item}}、
  30. </span>
  31. </div>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="开始日" prop="startDate"></el-table-column>
  35. <el-table-column label="结束日" prop="endDate"></el-table-column>
  36. <el-table-column label="运营跟进人" prop="operatorName"></el-table-column>
  37. <el-table-column label="操作" width="150">
  38. <template slot-scope="scope">
  39. <div class="hui-table-operation">
  40. <span class="table-operation" @click="detailItem(scope.row)">
  41. 详情
  42. </span>
  43. <span class="table-operation" @click="updateItem(scope.row)">
  44. 编辑
  45. </span>
  46. <span class="table-operation" @click="deleteItem(scope.row)">
  47. 删除
  48. </span>
  49. </div>
  50. </template>
  51. </el-table-column>
  52. <template slot="empty">
  53. <empty description="暂无数据"></empty>
  54. </template>
  55. </el-table>
  56. </div>
  57. <div class="hui-content-pagination">
  58. <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
  59. @current-change="currentChange">
  60. </el-pagination>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import edit from '@/components/work/contract/list/edit'
  68. import detail from '@/components/work/contract/list/detail'
  69. import listFilter from '@/components/common/listFilter'
  70. import {
  71. getContractListByPage,
  72. deleteContractById
  73. } from '@/httpApi/contract'
  74. export default {
  75. data() {
  76. return {
  77. tableData: [],
  78. currPage: 1,
  79. pageSize: 10,
  80. totalCount: 0,
  81. detailId: '',
  82. filterOption: {}
  83. }
  84. },
  85. created() {
  86. this.init();
  87. },
  88. methods: {
  89. init() {
  90. let postData = {
  91. currPage: this.currPage,
  92. pageSize: this.pageSize,
  93. organizationId: this.$store.getters.organization.id,
  94. projectId: this.$store.getters.project.id
  95. }
  96. postData = Object.assign(postData, this.filterOption);
  97. },
  98. filterInit(option) {
  99. this.filterOption = option;
  100. this.currPage = 1;
  101. this.init();
  102. },
  103. insert() {
  104. this.$message.warning('功能开发中')
  105. },
  106. currentChange(currPage) {
  107. this.currPage = currPage;
  108. this.init();
  109. },
  110. detailItem(item) {
  111. this.detailId = item.id;
  112. },
  113. updateItem(item) {
  114. this.detailId = item.id;
  115. },
  116. deleteItem(item) {
  117. this.$confirm('确定要删除该合同文件?', () => {
  118. deleteContractById(item.id).then(res => {
  119. if (res.state) {
  120. this.$message({
  121. type: 'success',
  122. message: '操作成功'
  123. })
  124. this.init();
  125. }
  126. })
  127. });
  128. },
  129. callback(type) {
  130. if (type === 'init') this.init();
  131. this.type = 'list';
  132. }
  133. },
  134. components: {
  135. edit,
  136. detail,
  137. listFilter
  138. },
  139. }
  140. </script>
  141. <style>
  142. </style>