audit-sqapply-list.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <div class="auditsqapplylist">
  3. <a-card>
  4. <a-radio-group v-model="radioValue" allow-clear @change="radioOnChange">
  5. <a-radio :value="1">
  6. 全部
  7. </a-radio>
  8. <a-radio :value="2">
  9. 待处理
  10. </a-radio>
  11. </a-radio-group>
  12. <!-- 高级搜索组件 -->
  13. <audit-advanced-query
  14. :expand="expand"
  15. :search-data="formData"
  16. :ref-name="searchform"
  17. :search-style="{ height: '150px', left: '20px', top: '80px' }"
  18. :search-fun="handleSearch"
  19. @searchedClick="searchedClick"
  20. >
  21. <template>
  22. <a-col :span="12">
  23. <a-form-model-item :label="'申请人'" prop="creatorName">
  24. <a-input v-model="formData.creatorName" allow-clear />
  25. </a-form-model-item>
  26. </a-col>
  27. <a-col :span="12">
  28. <a-form-model-item :label="'申请单位'" prop="unitName">
  29. <a-input v-model="formData.unitName" allow-clear />
  30. </a-form-model-item>
  31. </a-col>
  32. </template>
  33. </audit-advanced-query>
  34. <sd-data-table-ex
  35. ref="sqapplyDataTable"
  36. :filter-expressions="expressions"
  37. :columns="columns"
  38. :actions="actions"
  39. form-id="iamAuditSqapply"
  40. data-url="api/xcoa-mobile/v1/iamauditsqapply/iamModelSqapplyList"
  41. :search-fields="['creatorName']"
  42. show-selection
  43. :show-advance-query="true"
  44. @searchbtnClick="searchbtnClick"
  45. >
  46. <div slot="isLink" slot-scope="text, record">
  47. <a :title="text" @click="rowClick(record)">{{ text }}</a>
  48. </div>
  49. </sd-data-table-ex>
  50. </a-card>
  51. <audit-advanced-export
  52. ref="export"
  53. :v-if="false"
  54. :exclebxh="false"
  55. table-id="iamAuditSqapply"
  56. :expressions="exportExpressions"
  57. :config-id="161"
  58. />
  59. </div>
  60. </template>
  61. <script>
  62. import TableColumnTypes from '@/common/services/table-column-types'
  63. import TableActionTypes from '@/common/services/table-action-types'
  64. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  65. import { getUserInfo } from '@/common/store-mixin'
  66. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  67. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  68. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  69. import auditAdvancedExport from '../../components/audit-advanced-export.vue'
  70. import components from './_import-components/audit-sqapply-list-import'
  71. export default {
  72. name: 'AuditSqapplyList',
  73. metaInfo: {
  74. title: '授权申请',
  75. },
  76. components: {
  77. ...components,
  78. auditAdvancedQuery,
  79. auditAdvancedExport,
  80. },
  81. mixins: [auditAdvancedQueryMixins, auditAdvancedGroupMixins],
  82. data() {
  83. return {
  84. searchform: 'searchform',
  85. radioValue: 1,
  86. expressions: [],
  87. exportExpressions: [],
  88. formData: {
  89. creatorName: '',
  90. unitName: '',
  91. },
  92. formId: 'iamAuditSqapply',
  93. columns: [
  94. {
  95. title: '序号',
  96. dataIndex: 'sortNumber',
  97. width: '80px',
  98. customRender: (text, record, index) => `${index + 1}`,
  99. },
  100. {
  101. title: '申请人',
  102. dataIndex: 'creatorName',
  103. },
  104. {
  105. title: '申请单位',
  106. dataIndex: 'unitName',
  107. },
  108. {
  109. title: '模型名称',
  110. dataIndex: 'modelName',
  111. scopedSlots: { customRender: 'isLink' },
  112. },
  113. {
  114. title: '授权类型',
  115. dataIndex: 'empowerType',
  116. },
  117. {
  118. title: '授权开始日期',
  119. dataIndex: 'startDate',
  120. sdRender: TableColumnTypes.date,
  121. },
  122. {
  123. title: '授权截止日期',
  124. dataIndex: 'endDate',
  125. sdRender: TableColumnTypes.date,
  126. },
  127. {
  128. title: '申请日期',
  129. dataIndex: 'creationTime',
  130. sdRender: TableColumnTypes.date,
  131. defaultSortOrder: 'desc',
  132. sorter: true,
  133. },
  134. {
  135. title: '当前状态',
  136. dataIndex: 'flowState',
  137. },
  138. {
  139. title: '当前处理人',
  140. dataIndex: 'currentUser',
  141. },
  142. ],
  143. actions: [
  144. {
  145. label: '授权申请',
  146. id: 'sqapply',
  147. permission: null,
  148. type: TableActionTypes.primary,
  149. callback: () => {
  150. // PRODUCT_IAM_SQSQ 原来
  151. const url = '/sd-flow-guide?code=PRODUCT_IAM_MLSQSQ' // 新页面要打开的路由地址
  152. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  153. if (refreshFlag) {
  154. // 这里写或者调刷新的方法
  155. this.refreshDataTable()
  156. }
  157. })
  158. },
  159. },
  160. {
  161. label: '导出',
  162. id: 'export',
  163. permission: null,
  164. callback: () => {
  165. this.fnexport()
  166. },
  167. },
  168. {
  169. label: '删除',
  170. id: 'delete',
  171. type: TableActionTypes.ex.delete, // 删除按钮,不需要回调,会自动处理(对sd-data-table无效)
  172. },
  173. ],
  174. }
  175. },
  176. methods: {
  177. radioOnChange(e) {
  178. if (this.selectedType !== e.target.value) {
  179. this.expressions = []
  180. this.selectedType = e.target.value
  181. if (e.target.value === 1) {
  182. this.expressions.push({
  183. dataType: 'str',
  184. name: 'stateFlag',
  185. op: 'eq',
  186. stringValue: 'true',
  187. })
  188. } else if (e.target.value === 2) {
  189. this.expressions.push({
  190. dataType: 'str',
  191. name: 'stateFlag',
  192. op: 'eq',
  193. stringValue: 'false',
  194. })
  195. }
  196. }
  197. this.$refs.sqapplyDataTable.clearSelection()
  198. },
  199. fnexport: function() {
  200. this.exportExpressions = []
  201. this.exportExpressions = [
  202. { dataType: 'str', name: 'docType', op: 'eq', stringValue: 'model_apply' },
  203. ]
  204. setTimeout(() => {
  205. this.$refs.export.exportdata()
  206. }, 200)
  207. },
  208. refreshDataTable() {
  209. this.$refs.sqapplyDataTable.clearSelection()
  210. this.$refs.sqapplyDataTable.refresh()
  211. },
  212. handleSearch() {
  213. this.expressions = []
  214. if (this.radioValue === 1) {
  215. this.expressions.push({
  216. dataType: 'str',
  217. name: 'stateFlag',
  218. op: 'eq',
  219. stringValue: 'true',
  220. })
  221. } else if (this.radioValue === 2) {
  222. this.expressions.push({
  223. dataType: 'str',
  224. name: 'stateFlag',
  225. op: 'eq',
  226. stringValue: 'false',
  227. })
  228. }
  229. // 申请人
  230. if (this.formData.creatorName) {
  231. this.expressions.push({
  232. dataType: 'str',
  233. name: 'creatorName',
  234. op: 'like',
  235. stringValue: `%${this.formData.creatorName}%`,
  236. })
  237. }
  238. // 申请单位
  239. if (this.formData.unitName) {
  240. this.expressions.push({
  241. dataType: 'str',
  242. name: 'unitName',
  243. op: 'like',
  244. stringValue: `%${this.formData.unitName}%`,
  245. })
  246. }
  247. },
  248. rowClick(record) {
  249. // 判断权限
  250. if (
  251. (record.flowState === '起草') | (record.flowState === '开始') &&
  252. record.creatorAccount === getUserInfo().account
  253. ) {
  254. const url = '/sd-webflow/pages/draft/' + record.instId // 编辑面要打开的路由地址
  255. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  256. if (refreshFlag) {
  257. // 这里写或者调刷新的方法
  258. this.refreshDataTable()
  259. }
  260. })
  261. } else {
  262. window.open('#/sd-webflow/done-pages/' + record.instId)
  263. }
  264. },
  265. },
  266. }
  267. </script>
  268. <style module lang="scss">
  269. @use '@/common/design' as *;
  270. </style>