index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <div class="main">
  3. <div class="search">
  4. <el-input placeholder="请输入地址/报修人" class="search-input" clearable v-model="mixins_query.name"></el-input>
  5. <el-select v-model="mixins_query.communityId" placeholder="选择社区" clearable>
  6. <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
  7. </el-select>
  8. <el-select class="width90" placeholder="请选择工单类型" v-model="mixins_query.orderType" clearable>
  9. <el-option label="业主报修" :value="1"></el-option>
  10. <el-option label="内部报修" :value="2"></el-option>
  11. </el-select>
  12. <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
  13. <div class="search-icon">
  14. <el-tooltip class="item" effect="light" placement="bottom" content="新增">
  15. <i class="zoniot_font zoniot-icon-tianjia2" @click="addOrEdit('add')"></i>
  16. </el-tooltip>
  17. </div>
  18. </div>
  19. <zz-table
  20. :cols="cols"
  21. :settings="{ showIndex: true, stripe: true }"
  22. :loading="mixins_onQuery"
  23. :data="mixins_list"
  24. :pageset="mixins_pageset"
  25. @page-change="pageChange"
  26. >
  27. <template slot="repairFile" slot-scope="scope">
  28. <div class="imgVdio"><img :src="scope.row.repairFile" alt="" /></div>
  29. </template>
  30. <template slot-scope="scope" slot="opt">
  31. <div class="opt">
  32. <el-tooltip effect="light" placement="bottom" content="派单">
  33. <i v-if="scope.row.orderStatus !== 4" class="zoniot_font zoniot-icon-paidan" @click="dispatchTask(scope.row)"></i>
  34. <i v-else class="zoniot_font zoniot-icon-paidan ashText"></i>
  35. </el-tooltip>
  36. <el-tooltip effect="light" placement="bottom" :content="scope.row.orderStatus == 4 ? '已关闭' : '关闭'">
  37. <i
  38. v-if="scope.row.orderStatus !== 4"
  39. class="zoniot_font zoniot-icon-guanbi2 redText"
  40. @click="closeTask(scope.row)"
  41. ></i>
  42. <i v-else class="zoniot_font zoniot-icon-guanbi2 ashText"></i>
  43. </el-tooltip>
  44. </div>
  45. </template>
  46. </zz-table>
  47. </div>
  48. </template>
  49. <script>
  50. import list from '@utils/list.js';
  51. export default {
  52. mixins: [list],
  53. name: 'workOrdersManagement',
  54. data() {
  55. let _this = this;
  56. return {
  57. communityArr: [],
  58. cols: [
  59. {
  60. label: '所属社区',
  61. prop: 'communityName'
  62. },
  63. {
  64. label: '地址',
  65. prop: 'address'
  66. },
  67. {
  68. label: '工单类型',
  69. prop: 'orderType',
  70. format(val) {
  71. if (val == 1) {
  72. return '业主报修';
  73. } else if (val == 2) {
  74. return '内部报修';
  75. }
  76. return '--';
  77. }
  78. },
  79. {
  80. label: '报修人',
  81. prop: 'repairName'
  82. },
  83. {
  84. label: '手机号',
  85. prop: 'repairPhone'
  86. },
  87. {
  88. label: '内容描述',
  89. prop: 'repairContent'
  90. },
  91. {
  92. label: '图片/视频',
  93. prop: 'repairFile',
  94. slot: 'repairFile'
  95. },
  96. {
  97. label: '报修时间',
  98. prop: 'createDate'
  99. },
  100. {
  101. label: '操作',
  102. prop: 'id',
  103. slot: 'opt'
  104. }
  105. ],
  106. mixins_post: 'get'
  107. };
  108. },
  109. created() {
  110. this.getorgTree();
  111. this.mixins_dataUrl = '/sc-community-web/workOrder/page';
  112. this.mixins_query = {};
  113. this.mixins_search();
  114. },
  115. mounted() {},
  116. methods: {
  117. getorgTree() {
  118. this.$http
  119. .get('/sc-community/assets/community/list')
  120. .then((data) => {
  121. this.communityArr = data.data;
  122. this.$store.commit('setAreaSelect', data.data);
  123. })
  124. .catch(function () {});
  125. },
  126. dispatchTask(row) {
  127. console.log(row);
  128. },
  129. closeTask(data = {}) {
  130. new Promise((resolve) => {
  131. let title = '关闭工单';
  132. this.$store.dispatch('addPopup', {
  133. url: '/operationManagement/workOrders/stepPage/closeTsk.vue',
  134. width: '500px',
  135. height: '100px',
  136. props: {
  137. data,
  138. callback: resolve
  139. },
  140. notip: true,
  141. title: title
  142. });
  143. }).then(() => {
  144. this.mixins_search();
  145. });
  146. },
  147. addOrEdit() {
  148. new Promise((resolve) => {
  149. let title = '添加工单';
  150. this.$store.dispatch('addPopup', {
  151. url: '/operationManagement/workOrders/stepPage/add.vue',
  152. width: '500px',
  153. height: '500px',
  154. props: {
  155. callback: resolve
  156. },
  157. title: title
  158. });
  159. }).then(() => {
  160. this.mixins_search();
  161. });
  162. }
  163. }
  164. };
  165. </script>
  166. <style scoped lang='scss'>
  167. .imgVdio img {
  168. width: 64px;
  169. }
  170. </style>