audit-suspects-list.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <div>
  3. <a-card style="position: absolute; z-index: 9; height: 10px; padding-top: 16px">
  4. <a-radio-group name="radioGroup" :default-value="radioGroup" @change="radioGroupChange">
  5. <a-radio :value="1"> 全部 </a-radio>
  6. <a-radio :value="2"> 待处理 </a-radio>
  7. </a-radio-group>
  8. </a-card>
  9. <a-card>
  10. <div :class="[$style.btns]">
  11. <audit-advanced-export
  12. ref="export"
  13. :class-style="[$style.buttonSpacing]"
  14. :v-show="false"
  15. :config-id="81"
  16. :exclebxh="false"
  17. :expressions="filterExpressions"
  18. ></audit-advanced-export>
  19. </div>
  20. <div>
  21. <audit-advanced-query
  22. :expand="expand"
  23. :search-data="formData"
  24. :ref-name="'searchform'"
  25. :search-style="{ height: '170px', left: '10px', top: '200px' }"
  26. :search-fun="handleSearch"
  27. @searchedClick="searchedClick"
  28. @resetForm="resetForm"
  29. >
  30. <template>
  31. <a-col :span="12">
  32. <a-form-model-item :label="'\u2002\u2002\u2002\u2002编制日期'" prop="compileMan">
  33. <a-range-picker
  34. v-model="formData.compileMan"
  35. style="width: 100%"
  36. @change="dateChange"
  37. />
  38. </a-form-model-item>
  39. </a-col>
  40. <a-col :span="12">
  41. <a-form-model-item :label="'疑点名称'" prop="suspectsName">
  42. <a-input v-model="formData.suspectsName" allow-clear />
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :span="12">
  46. <a-form-model-item :label="'疑点核实单位'" prop="suspectsVerifyUnit">
  47. <a-input v-model="formData.suspectsVerifyUnit" allow-clear />
  48. </a-form-model-item>
  49. </a-col>
  50. <a-col :span="12">
  51. <a-form-model-item :label="'项目名称'" prop="projectName">
  52. <a-input v-model="formData.projectName" allow-clear />
  53. </a-form-model-item>
  54. </a-col>
  55. </template>
  56. </audit-advanced-query>
  57. </div>
  58. <sd-data-table-ex
  59. ref="iamAuditSuspectsTable"
  60. form-id="iamAuditSuspects"
  61. :data-url="'api/xcoa-mobile/v1/iamauditsuspects/all-list'"
  62. page-id="audit/suspects/iamAuditSuspects"
  63. :columns="processedColumns"
  64. :show-advance-query="true"
  65. :search-fields="['suspectsName', 'projectName', 'suspectsVerifyUnit']"
  66. :actions="actions"
  67. show-selection
  68. :filter-expressions="filterExpressions"
  69. @searchbtnClick="searchbtnClick"
  70. >
  71. <div slot="isLink" slot-scope="text, record">
  72. <a :title="text" @click="rowClick(record)">{{ text }}</a>
  73. </div>
  74. </sd-data-table-ex>
  75. </a-card>
  76. </div>
  77. </template>
  78. <script>
  79. import { message, Modal } from 'ant-design-vue'
  80. import auditAdvancedExport from '../../components/audit-advanced-export'
  81. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  82. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  83. import components from './_import-components/audit-suspects-list-import'
  84. import errorUtil from '@/common/services/error-util'
  85. import axios from '@/common/services/axios-instance'
  86. import TableActionTypes from '@/common/services/table-action-types'
  87. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  88. import TableColumnTypes from '@/common/services/table-column-types'
  89. const processedColumns = [
  90. {
  91. title: '序号',
  92. customRender: (text, record, index) => `${index + 1}`,
  93. width: '80px',
  94. },
  95. {
  96. title: '疑点名称',
  97. dataIndex: 'suspectsName',
  98. scopedSlots: { customRender: 'isLink' },
  99. },
  100. {
  101. title: '项目名称',
  102. dataIndex: 'projectName',
  103. },
  104. {
  105. title: '疑点核实单位',
  106. dataIndex: 'suspectsVerifyUnit',
  107. },
  108. {
  109. title: '是否核实',
  110. dataIndex: 'verified',
  111. width: '10%',
  112. align: 'center',
  113. customRender: (text, record, index) => {
  114. if (text === 1) {
  115. return '是'
  116. } else {
  117. return '否'
  118. }
  119. },
  120. },
  121. {
  122. title: '编制人员',
  123. dataIndex: 'compileMan',
  124. },
  125. {
  126. title: '编制日期',
  127. dataIndex: 'compileDate',
  128. sdRender: TableColumnTypes.date,
  129. width: '13%',
  130. },
  131. {
  132. title: '当前状态',
  133. dataIndex: 'flowState',
  134. width: '10%',
  135. },
  136. {
  137. title: '当前处理人',
  138. dataIndex: 'currentUser',
  139. },
  140. { dataIndex: 'instId', title: '流程ID', sdHidden: true },
  141. ]
  142. export default {
  143. name: 'AuditSuspectsList',
  144. metaInfo: {
  145. title: '已处理',
  146. },
  147. components: {
  148. auditAdvancedQuery,
  149. ...components,
  150. auditAdvancedExport,
  151. },
  152. mixins: [auditAdvancedQueryMixins],
  153. data() {
  154. return {
  155. processedColumns,
  156. expand: false,
  157. formData: {},
  158. filterExpressions: [],
  159. radioGroup: 1,
  160. actions: [
  161. {
  162. label: '刪除',
  163. id: 'delete',
  164. type: TableActionTypes.batch,
  165. permission: null, // 纯前端操作,不需要权限控制
  166. callback: this.linkToDelete,
  167. },
  168. {
  169. label: '导出',
  170. permission: null, // 纯前端操作,不需要权限控制
  171. callback: () => {
  172. this.$refs.export.exportdata()
  173. },
  174. },
  175. {
  176. label: '新建',
  177. id: 'new',
  178. type: TableActionTypes.primary, // 新建按钮,不需要回调,自动处理
  179. permission: 'create', // 纯前端操作,不需要权限控制
  180. callback: () => {
  181. const url = `/sd-flow-guide?code=PRODUCT_IAM_SJYDGL` // 新页面要打开的路由地址
  182. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  183. if (refreshFlag) {
  184. // 这里写或者调刷新的方法
  185. this.refresh()
  186. }
  187. })
  188. },
  189. },
  190. ],
  191. }
  192. },
  193. methods: {
  194. createrectplanproject() {},
  195. radioGroupChange(e) {
  196. this.radioGroup = e.target.value
  197. this.handleSearch()
  198. },
  199. linkToDelete() {
  200. const selectedRowKeys = this.$refs.iamAuditSuspectsTable.getSelectedRowKeys()
  201. if (selectedRowKeys.length === 0) {
  202. Modal.info({
  203. content: '请选择需要删除的数据!',
  204. })
  205. return
  206. }
  207. return new Promise((resolve) => {
  208. Modal.confirm({
  209. title: '您确定删除这项内容吗?',
  210. content: '删除这条数据后,就无法恢复初始的状态。',
  211. okText: '删除',
  212. okType: 'danger',
  213. onOk: () => {
  214. axios({
  215. url: 'api/xcoa-mobile/v1/iamauditsuspects/deletedSuspects',
  216. method: 'post',
  217. params: {
  218. ids: selectedRowKeys.join(','),
  219. },
  220. })
  221. .then(() => {
  222. const msg = '删除成功'
  223. message.success(msg)
  224. this.$refs.iamAuditSuspectsTable.clearSelection()
  225. this.$refs.iamAuditSuspectsTable.refresh()
  226. })
  227. .catch((err) => {
  228. const msg = errorUtil.getMessage(err) || '删除失败'
  229. message.error(msg)
  230. })
  231. .finally(resolve)
  232. },
  233. onCancel: () => {
  234. resolve()
  235. },
  236. })
  237. })
  238. },
  239. rowClick(record) {
  240. var url = ''
  241. if ((record.flowState === '起草') | (record.flowState === '开始')) {
  242. url = '/sd-webflow/pages/draft/' + record.instId
  243. } else {
  244. url = '/sd-webflow/done-pages/' + record.instId
  245. }
  246. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  247. if (refreshFlag) {
  248. this.refresh()
  249. }
  250. })
  251. },
  252. refresh() {
  253. return this.$refs.iamAuditSuspectsTable.refresh(true)
  254. },
  255. searchedClick() {
  256. this.expand = false
  257. },
  258. // 重置日期
  259. resetForm() {
  260. this.formData.startDate = null
  261. this.formData.endDate = null
  262. },
  263. dateChange(dates, dateStrings) {
  264. this.formData.startDate = Date.parse(dates[0])
  265. this.formData.endDate = Date.parse(dates[1])
  266. },
  267. handleSearch() {
  268. const formData = this.formData
  269. // 修改表格过滤条件进行,再刷新进行数据过滤
  270. // 获取当前表格过滤条件
  271. this.filterExpressions = []
  272. // 选的是待处理
  273. if (this.radioGroup === 2) {
  274. this.filterExpressions.push({
  275. dataType: 'str',
  276. name: 'currentUser',
  277. op: 'ne',
  278. stringValue: '',
  279. })
  280. }
  281. if (formData) {
  282. if (formData.startDate) {
  283. this.filterExpressions.push({
  284. dataType: 'str',
  285. name: 'compileDate',
  286. op: 'ge',
  287. stringValue: formData.startDate,
  288. })
  289. }
  290. if (formData.endDate) {
  291. this.filterExpressions.push({
  292. dataType: 'str',
  293. name: 'compileDate',
  294. op: 'le',
  295. stringValue: formData.endDate,
  296. })
  297. }
  298. if (formData.suspectsName) {
  299. this.filterExpressions.push({
  300. dataType: 'str',
  301. name: 'suspectsName',
  302. op: 'like',
  303. stringValue: formData.suspectsName,
  304. })
  305. }
  306. if (formData.suspectsVerifyUnit) {
  307. this.filterExpressions.push({
  308. dataType: 'str',
  309. name: 'suspectsVerifyUnit',
  310. op: 'like',
  311. stringValue: formData.suspectsVerifyUnit,
  312. })
  313. }
  314. if (formData.projectName) {
  315. this.filterExpressions.push({
  316. dataType: 'str',
  317. name: 'projectName',
  318. op: 'like',
  319. stringValue: formData.projectName,
  320. })
  321. }
  322. }
  323. },
  324. },
  325. }
  326. </script>
  327. <style module lang="scss">
  328. @use '@/common/design' as *;
  329. .btns {
  330. position: absolute;
  331. top: 24px;
  332. right: 20.5px;
  333. z-index: 100;
  334. }
  335. .buttonSpacing {
  336. margin-left: 5px;
  337. }
  338. .search {
  339. margin-top: 1000px;
  340. }
  341. </style>