index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div class="app-container workManage" v-if="this.pageShow">
  3. <!-- 筛选start -->
  4. <div class="filter-container mb-10">
  5. <div>
  6. <div class="filter-item">
  7. 站点:
  8. <el-select v-model="region" placeholder="请选择" style="width: 200px">
  9. <el-option label="站点一" value="1"></el-option>
  10. <el-option label="站点二" value="2"></el-option>
  11. </el-select>
  12. </div>
  13. <div class="filter-item">
  14. 工单来源:
  15. <el-select v-model="workFrom" placeholder="请选择" style="width: 200px">
  16. <el-option label="来源一" value="1"></el-option>
  17. <el-option label="来源二" value="2"></el-option>
  18. </el-select>
  19. </div>
  20. <div class="filter-item">
  21. 当前处理人:
  22. <el-select v-model="dealWorker" placeholder="请选择" style="width: 200px">
  23. <el-option label="处理人一" value="1"></el-option>
  24. <el-option label="处理人二" value="2"></el-option>
  25. </el-select>
  26. </div>
  27. <el-button type="primary" icon="el-icon-search" class="search-button">
  28. 搜索
  29. </el-button>
  30. <el-button icon="el-icon-plus" type="success" @click="addItem()">
  31. 新增
  32. </el-button>
  33. </div>
  34. </div>
  35. <!-- 筛选end -->
  36. <!-- tab切换 -->
  37. <div class="tab-section">
  38. <el-button class="search-button timeTab" @click="num2 = 0" :type="num2 == 0 ? 'primary' : ''">
  39. 待抢单(0)
  40. </el-button>
  41. <el-button class="search-button timeTab" @click="num2 = 1" :type="num2 == 1 ? 'primary' : ''">
  42. 待指派(0)
  43. </el-button>
  44. <el-button class="search-button timeTab" @click="num2 = 2" :type="num2 == 2 ? 'primary' : ''">
  45. 待接单(0)
  46. </el-button>
  47. <el-button class="search-button timeTab" @click="num2 = 3" :type="num2 == 3 ? 'primary' : ''">
  48. 待处理(0)
  49. </el-button>
  50. <el-button class="search-button timeTab" @click="num2 = 4" :type="num2 == 4 ? 'primary' : ''">
  51. 待关单(0)
  52. </el-button>
  53. <el-button class="search-button timeTab" @click="num2 = 5" :type="num2 == 5 ? 'primary' : ''">
  54. 已完成(0)
  55. </el-button>
  56. <el-checkbox v-model="checked2">显示我的代办</el-checkbox>
  57. </div>
  58. <!-- tab切换end -->
  59. <!-- 表格start -->
  60. <el-table :data="tableData" border stripe :header-cell-style="headClass" :cell-style="cellStyle">
  61. <el-table-column fixed prop="workCode" label="编号" width="260px"></el-table-column>
  62. <el-table-column prop="workDes" label="工作描述" width=""></el-table-column>
  63. <el-table-column prop="workType" label="工单类型" width="">
  64. <template #default="scope">
  65. <div>
  66. <img src="@/assets/images/jianxiu.svg" alt="" class="jianxiu">
  67. {{ scope.row.workType }}
  68. </div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="stationName" label="站点" width=""></el-table-column>
  72. <el-table-column prop="status" label="状态" width="350">
  73. <template #default="scope">
  74. <div>
  75. {{ scope.row.status }}
  76. <span class="workStatusBtn">超时</span>
  77. <!-- <el-button size="mini" round>超时</el-button> -->
  78. </div>
  79. </template>
  80. </el-table-column>
  81. <el-table-column prop="createTime" label="创建时间" width=""></el-table-column>
  82. <el-table-column prop="handleMan" label="当前处理人" width=""></el-table-column>
  83. <el-table-column fixed="right" label="操作" width="">
  84. <template #default="scope">
  85. <el-button type="primary" size="small" @click.prevent="editRow(scope.row)" link>
  86. 编辑
  87. </el-button>
  88. <el-button @click="goDhandlePage()" type="danger" size="small" link>
  89. 待您处理
  90. </el-button>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <!-- 表格end -->
  95. <!--弹框组件开始-----------------------start-->
  96. <dialog-component v-if="showDialog" ref="dialogComponent" :dialog-title="dialogTitle" :item-info="tableItem"
  97. @closeDialog="closeDialog"></dialog-component>
  98. <!--弹框组件开始-----------------------end-->
  99. </div>
  100. <handle-detail :pageShow="pageShow" @func="getMsgFormSon" v-else></handle-detail>
  101. </template>
  102. <script>
  103. import DialogComponent from './dialogComponent'
  104. import HandleDetail from './handleDetail'
  105. // import { mapGetters } from "vuex";
  106. export default {
  107. // name: "Dashboard",
  108. // computed: {
  109. // ...mapGetters(["name"]),
  110. // },
  111. components: { DialogComponent, HandleDetail },
  112. data() {
  113. return {
  114. pageShow: true,
  115. region: '',
  116. dealWorker: '',
  117. workFrom: '',
  118. num2: 0,
  119. showDialog: false,
  120. input: '请输入编号',
  121. tableData: [
  122. {
  123. workCode: 'TSRP23_20210916165634493',
  124. workDes: '测试',
  125. workType: '检修',
  126. stationName: ' 万众实业变电站',
  127. status: '待指派',
  128. createTime: '10',
  129. handleMan: '运维管理员',
  130. },
  131. ],
  132. }
  133. },
  134. methods: {
  135. getMsgFormSon() {
  136. this.pageShow = !this.pageShow
  137. },
  138. goDhandlePage() {
  139. this.pageShow = !this.pageShow
  140. },
  141. // 表头样式设置
  142. headClass() {
  143. return 'background:#FAFAFA;'
  144. },
  145. //自定义列样式
  146. cellStyle({ row, column, rowIndex, columnIndex }) {
  147. row, column, rowIndex
  148. if (columnIndex === 2 || columnIndex === 0) {
  149. return `color:#89b7eb;`
  150. } else {
  151. return ''
  152. }
  153. },
  154. // 添加操作
  155. addItem() {
  156. this.tableItem = {
  157. id: '',
  158. workCode: '',
  159. workDes: '',
  160. stationName: '',
  161. siteList: [],
  162. done: '',
  163. guaZai: '',
  164. }
  165. this.dialogTitle = '新增'
  166. this.showDialog = true
  167. this.$nextTick(() => {
  168. this.$refs['dialogComponent'].showDialog = true
  169. })
  170. },
  171. // 编辑操作
  172. editRow(row) {
  173. console.log(row)
  174. this.tableItem = row
  175. this.dialogTitle = '编辑'
  176. this.showDialog = true
  177. this.$nextTick(() => {
  178. this.$refs['dialogComponent'].showDialog = true
  179. })
  180. },
  181. // 关闭操作
  182. closeDialog(flag) {
  183. if (flag) {
  184. // 重新刷新表格内容
  185. this.fetchData()
  186. }
  187. this.showDialog = false
  188. },
  189. //删除操作
  190. handleDelete(index, row) {
  191. console.log(index, row)
  192. alert(index)
  193. },
  194. },
  195. }
  196. </script>
  197. <style lang="scss" scoped></style>