kpi-indi-task-list.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <a-card>
  3. <div :class="$style.wrapHeight">
  4. <sd-data-table-ex
  5. ref="kpiIndiTaskTable"
  6. form-id="kpiIndiTask"
  7. data-url="api/xcoa-mobile/v1/kpi-indi-task/all-list"
  8. :columns="columns"
  9. :actions="actions"
  10. show-selection
  11. :filter-expressions="expressions"
  12. :search-fields="['taskName']"
  13. >
  14. <template slot="islink" slot-scope="text, record">
  15. <a @click="open(record)">{{ text }}</a>
  16. </template>
  17. </sd-data-table-ex>
  18. <div :class="[$style.btns]">
  19. <a-col :span="13" :offset="0">
  20. <a-radio-group v-model="radioValue" @change="radioOnChange">
  21. <a-radio :value="'0'">
  22. 全部
  23. </a-radio>
  24. <a-radio :value="'1'">
  25. 待处理
  26. </a-radio>
  27. </a-radio-group>
  28. </a-col>
  29. </div>
  30. </div>
  31. </a-card>
  32. </template>
  33. <script>
  34. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  35. import TableColumnTypes from '@/common/services/table-column-types'
  36. import components from './_import-components/kpi-indi-task-list-import'
  37. export default {
  38. name: 'KpiIndiTaskList',
  39. metaInfo: {
  40. title: '指标报送任务',
  41. },
  42. components,
  43. data() {
  44. return {
  45. columns: [
  46. {
  47. title: '序号',
  48. customRender: (text, record, index) => `${index + 1}`,
  49. width: '80px',
  50. },
  51. { dataIndex: 'id', sdHidden: true },
  52. { dataIndex: 'instId', sdHidden: true },
  53. {
  54. title: '任务名称',
  55. dataIndex: 'taskName',
  56. scopedSlots: { customRender: 'islink' },
  57. },
  58. {
  59. title: '任务来源',
  60. dataIndex: 'taskFrom',
  61. },
  62. {
  63. title: '报送人',
  64. dataIndex: 'submitterName',
  65. },
  66. {
  67. title: '创建日期',
  68. dataIndex: 'creationTime',
  69. sdRender: TableColumnTypes.date,
  70. defaultSortOrder: 'descend',
  71. },
  72. {
  73. title: '当前状态',
  74. dataIndex: 'flowState',
  75. },
  76. {
  77. title: '当前处理人',
  78. dataIndex: 'nowUser',
  79. },
  80. { title: '文档状态', dataIndex: 'endType', width: '120px', sdHidden: true },
  81. ],
  82. actions: [],
  83. radioType: false,
  84. radioValue: '0',
  85. expressions: [],
  86. }
  87. },
  88. created() {},
  89. methods: {
  90. open(record) {
  91. const url = `/sd-webflow/done-pages/` + record.instId
  92. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  93. if (refreshFlag) {
  94. // 这里写或者调刷新的方法
  95. this.refresh()
  96. }
  97. })
  98. },
  99. // 状态筛选单选按钮变化时
  100. radioOnChange(e, info) {
  101. this.radioValue = e.target.value
  102. this.radioType = true
  103. this.expressions.forEach((item) => {
  104. if (item.name === 'pending') {
  105. item.stringValue = this.radioValue
  106. this.radioType = false
  107. }
  108. })
  109. if (this.radioType) {
  110. this.expressions.push({
  111. dataType: 'str',
  112. name: 'pending',
  113. op: 'eq',
  114. stringValue: this.radioValue,
  115. })
  116. }
  117. this.expressions = [...this.expressions]
  118. this.$refs.kpiIndiTaskTable.clearSelection()
  119. },
  120. },
  121. }
  122. </script>
  123. <style module lang="scss">
  124. @use '@/common/design' as *;
  125. .btns {
  126. position: absolute;
  127. top: 20px;
  128. right: 0;
  129. left: 20px;
  130. z-index: 100;
  131. width: calc(100% - 400px);
  132. span {
  133. // color: blue;
  134. }
  135. }
  136. </style>