MyTaskFinish.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <a-card :bordered="false">
  3. <div v-if="visible">
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline">
  6. <a-row :gutter="48">
  7. <a-col :md="8" :sm="24">
  8. <a-form-item label="关键字">
  9. <a-input v-model.trim="queryParam.keyword" placeholder="请输单号"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="8 || 24" :sm="24">
  13. <span class="table-page-search-submitButtons">
  14. <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
  15. <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
  16. </span>
  17. </a-col>
  18. </a-row>
  19. </a-form>
  20. </div>
  21. <s-table
  22. ref="table"
  23. size="small"
  24. rowKey="id"
  25. :columns="columns"
  26. :data="loadData"
  27. :scroll="{x: 1500, y: BaseTool.Constant.scrollY}"
  28. showPagination="auto"
  29. >
  30. <span slot="action" slot-scope="record">
  31. <template>
  32. <a @click="handleView(record)">查看</a>
  33. </template>
  34. </span>
  35. </s-table>
  36. </div>
  37. <detail-audit-scrap :audit="false" ref="detailAuditScrapModal" @ok="handleOk"/>
  38. </a-card>
  39. </template>
  40. <script>
  41. import { STable, Ellipsis } from '@/components'
  42. import AssignForm from './modules/AssignForm'
  43. import DetailAuditScrap from '@/views/sb/scraps/modules/DetailAudit'
  44. import { getLocalTaskPageFinish } from '@/api/activiti/activiti'
  45. import { fetchCustomFieldTemplateVOData } from '@/api/customize/fieldTemplateData'
  46. import { fetchOutStoreForm } from '@/api/store/outstoreform'
  47. export default {
  48. name: 'TaskList',
  49. components: {
  50. STable,
  51. Ellipsis,
  52. DetailAuditScrap,
  53. AssignForm
  54. },
  55. data () {
  56. return {
  57. mdl: {},
  58. statusMap: {},
  59. // 查询参数
  60. queryParam: {
  61. },
  62. // 表头
  63. columns: [
  64. {
  65. title: '序号',
  66. dataIndex: 'index',
  67. checked: true,
  68. width: 80,
  69. customRender: (text, record, index) => {
  70. return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
  71. }
  72. },
  73. {
  74. title: '类型',
  75. dataIndex: 'targetCode',
  76. checked: true,
  77. width: 120,
  78. customRender: (text, record, index) => {
  79. return this.DictCache.VALUE.SB_INFO_AUDIT_MODEL_NAME[text]
  80. }
  81. },
  82. {
  83. title: '任务名称',
  84. checked: true,
  85. width: 120,
  86. dataIndex: 'targetName'
  87. },
  88. {
  89. title: '单号',
  90. checked: true,
  91. width: 180,
  92. dataIndex: 'no'
  93. },
  94. {
  95. title: '申请人',
  96. checked: true,
  97. width: 120,
  98. dataIndex: 'userName'
  99. },
  100. {
  101. title: '创建时间',
  102. checked: true,
  103. width: 150,
  104. dataIndex: 'applyTime'
  105. },
  106. {
  107. title: '审批时间',
  108. checked: true,
  109. width: 150,
  110. dataIndex: 'createTime'
  111. },
  112. {
  113. title: '审批意见',
  114. checked: true,
  115. width: 120,
  116. dataIndex: 'opinion'
  117. },
  118. {
  119. title: '状态',
  120. checked: true,
  121. width: 100,
  122. dataIndex: 'status',
  123. fixed: 'right',
  124. customRender: (text, record, index) => {
  125. return this.BaseTool.Table.statusCustomRenderDict(this, text, record,
  126. this.DictCache.COLOR.SB_ALLOCATE_APPLY_STATUS, this.statusMap)
  127. }
  128. },
  129. {
  130. title: '操作',
  131. key: 'action',
  132. width: '220px',
  133. checked: true,
  134. fixed: 'right',
  135. align: 'center',
  136. scopedSlots: { customRender: 'action' }
  137. }
  138. ],
  139. // 加载数据方法 必须为 Promise 对象
  140. loadData: parameter => {
  141. return getLocalTaskPageFinish(Object.assign(parameter, this.queryParam))
  142. .then(res => {
  143. return res.data
  144. })
  145. },
  146. selectedRowKeys: [],
  147. selectedRows: [],
  148. menus: [],
  149. visible: true,
  150. options: {
  151. alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
  152. rowSelection: {
  153. selectedRowKeys: this.selectedRowKeys,
  154. onChange: this.onSelectChange
  155. }
  156. },
  157. optionAlertShow: false
  158. }
  159. },
  160. created () {
  161. this.tableOption()
  162. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
  163. },
  164. methods: {
  165. tableOption () {
  166. if (!this.optionAlertShow) {
  167. this.options = {
  168. alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
  169. rowSelection: {
  170. selectedRowKeys: this.selectedRowKeys,
  171. onChange: this.onSelectChange,
  172. getCheckboxProps: record => ({
  173. props: {
  174. disabled: false,
  175. name: record.id
  176. }
  177. })
  178. }
  179. }
  180. this.optionAlertShow = true
  181. } else {
  182. this.options = {
  183. alert: false,
  184. rowSelection: null
  185. }
  186. this.optionAlertShow = false
  187. }
  188. },
  189. handleView (record) {
  190. this.visible = false
  191. if (record.targetCode === 'out_store_back') { // 仓库审批跳转到仓库审批页面
  192. fetchOutStoreForm({ id: record.targetId }).then(res => {
  193. const templateData = res.data
  194. const recordTemp = res.data
  195. recordTemp.taskId = record.taskId
  196. recordTemp.remark = record.targetCode
  197. this.$refs.detailAuditScrapModal.base(recordTemp, templateData)
  198. })
  199. } else {
  200. fetchCustomFieldTemplateVOData({ id: record.targetId }).then(res => {
  201. const templateData = JSON.parse(res.data.data)
  202. const recordTemp = res.data
  203. recordTemp.taskId = record.taskId
  204. this.$refs.detailAuditScrapModal.base(recordTemp, templateData)
  205. })
  206. }
  207. /* fetchCustomFieldTemplateData({ id: record.targetId }).then(res => {
  208. const templateData = JSON.parse(res.data.data)
  209. this.$refs.detailAuditScrapModal.base(record, templateData)
  210. }) */
  211. },
  212. handleOk () {
  213. this.visible = true
  214. this.$refs.table.refresh()
  215. },
  216. onSelectChange (selectedRowKeys, selectedRows) {
  217. this.selectedRowKeys = selectedRowKeys
  218. this.selectedRows = selectedRows
  219. },
  220. resetSearchForm () {
  221. this.queryParam = {
  222. }
  223. this.$refs.table.refresh(true)
  224. }
  225. }
  226. }
  227. </script>
  228. <style lang="less" scoped>
  229. </style>