audit-rectfeedback-list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <a-card>
  3. <!-- 高级搜索区域 -->
  4. <audit-advanced-query
  5. :expand="expand"
  6. :search-data="advSearchForm"
  7. :ref-name="searchform"
  8. :search-style="{ height: '170px', left: '20px', top: '60px' }"
  9. :search-fun="advSearch"
  10. @searchedClick="searchedClick"
  11. @resetForm="resetForm"
  12. >
  13. <template>
  14. <a-row>
  15. <a-col :span="12">
  16. <a-form-model-item label="项目名称" prop="projectName">
  17. <a-input v-model="advSearchForm.projectName" />
  18. </a-form-model-item>
  19. </a-col>
  20. <a-col :span="12">
  21. <a-form-model-item label="项目编号" prop="projectCode">
  22. <a-input v-model="advSearchForm.projectCode" />
  23. </a-form-model-item>
  24. </a-col>
  25. </a-row>
  26. <a-row>
  27. <a-col :span="12">
  28. <a-form-model-item label="整改责任主体" prop="auditedUnit">
  29. <sd-group-picker
  30. ref="unitSelect"
  31. v-model="advSearchForm.auditedUnit"
  32. :single="true"
  33. :read-only="false"
  34. @change="changeunit"
  35. />
  36. </a-form-model-item>
  37. </a-col>
  38. <a-col :span="12">
  39. <a-form-model-item :label="'状\u2003\u2003态'" prop="planStatus">
  40. <sd-select
  41. v-model="advSearchForm.planStatus"
  42. :allow-clear="true"
  43. :options="itemStatusOptions"
  44. />
  45. </a-form-model-item>
  46. </a-col>
  47. </a-row>
  48. </template>
  49. </audit-advanced-query>
  50. <div :class="[$style.btns]">
  51. <audit-advanced-export
  52. ref="exportExcel"
  53. :v-if="true"
  54. :class-style="[$style.buttonSpacing]"
  55. :config-id="191"
  56. :exclebxh="false"
  57. ></audit-advanced-export>
  58. </div>
  59. <div :class="$style.rectPlanProjectlist">
  60. <!-- data-url="api/xcoa-mobile/v1/iam-work-rect-feedback/all-list" -->
  61. <sd-data-table-ex
  62. ref="dataTable"
  63. :projectlist="true"
  64. :class="$style.rectfeedbacklist"
  65. :columns="columns"
  66. :actions="actions"
  67. show-selection
  68. form-id="iamWorkRectFeedback"
  69. data-url="api/xcoa-mobile/v1/rect-feed-back/list"
  70. :filter-expressions="tableExpressions"
  71. :show-advance-query="true"
  72. :search-fields="['projectName']"
  73. @searchbtnClick="searchbtnClick"
  74. >
  75. <div slot="isLink" slot-scope="text, record">
  76. <a :title="text" @click="linkProject(record)">{{ text }}</a>
  77. </div>
  78. <div slot="isnum" slot-scope="text, record">
  79. <span style="padding-left:43%">{{ text }}</span>
  80. </div>
  81. <div slot="opt" slot-scope="text, record" :class="$style.operatecol">
  82. <!-- 管理员 项目组长 项目副组长 则可以变更 -->
  83. <span v-for="(bt, index) in buttonsfortable" :key="index">
  84. <a-button
  85. v-if="record.changeButtons === 'true'"
  86. :key="index"
  87. type="link"
  88. size="small"
  89. @click="optbuttonClick(bt.id, record)"
  90. >{{ bt.label }}
  91. <!-- <sd-icon :type="bt.icontype" :theme="bt.theme"/> -->
  92. </a-button>
  93. </span>
  94. </div>
  95. </sd-data-table-ex>
  96. </div>
  97. <div v-show="false">
  98. <sd-user-picker
  99. ref="assignTeamLeader"
  100. v-model="mainSendUnit"
  101. :single="true"
  102. :read-only="false"
  103. @change="change"
  104. />
  105. </div>
  106. </a-card>
  107. </template>
  108. <script>
  109. import axios from '@/common/services/axios-instance'
  110. import TableActionTypes from '@/common/services/table-action-types'
  111. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  112. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  113. import auditAdvancedExport from '../../components/audit-advanced-export'
  114. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  115. // import AuditRectplanprojectService from './audit-rectplanproject-service'
  116. import components from './_import-components/audit-rectfeedback-list-import'
  117. export default {
  118. name: 'AuditRectfeedbackList',
  119. metaInfo: {
  120. title: '整改反馈列表',
  121. },
  122. components: { ...components, auditAdvancedQuery, auditAdvancedExport },
  123. mixins: [auditAdvancedQueryMixins],
  124. data() {
  125. return {
  126. searchYear: '',
  127. yearArry: [],
  128. searchValue: '',
  129. mainSendUnit: [],
  130. checkboxValue: false,
  131. pageId: 'audit/rectFeedback/iamWorkRectFeedback',
  132. columns: [
  133. {
  134. title: '序号',
  135. customRender: (text, record, index) => `${index + 1}`,
  136. width: '80px',
  137. },
  138. {
  139. title: '项目名称',
  140. dataIndex: 'projectName',
  141. width: '450px',
  142. scopedSlots: { customRender: 'isLink' },
  143. },
  144. {
  145. title: '编号',
  146. dataIndex: 'rectPlanId',
  147. defaultSortOrder: 'descend',
  148. sdHidden: true,
  149. },
  150. {
  151. title: '项目编号',
  152. dataIndex: 'projectCode',
  153. sorter: true,
  154. width: '200px',
  155. sortDirections: ['ascend', 'descend'],
  156. },
  157. {
  158. title: '项目Id',
  159. dataIndex: 'projectId',
  160. sdHidden: true,
  161. },
  162. {
  163. title: '跟踪人账号',
  164. dataIndex: 'resppersonsAccount',
  165. sdHidden: true,
  166. width: '100px',
  167. },
  168. {
  169. title: '项目来源',
  170. dataIndex: 'projectSource',
  171. sdHidden: true,
  172. },
  173. {
  174. title: '跟踪人姓名',
  175. dataIndex: 'resppersonsName',
  176. sdHidden: true,
  177. },
  178. {
  179. title: '整改责任主体',
  180. dataIndex: 'auditedUnitName',
  181. sorter: true,
  182. width: '150px',
  183. sortDirections: ['ascend', 'descend'],
  184. },
  185. {
  186. title: '整改责任主体联系人',
  187. width: '180px',
  188. dataIndex: 'auditedContactsName',
  189. },
  190. {
  191. title: '需整改问题数量',
  192. dataIndex: 'rectProblemNum',
  193. scopedSlots: { customRender: 'isnum' },
  194. width: '150px',
  195. },
  196. {
  197. title: '整改中数量',
  198. dataIndex: 'rectDoProblemNum',
  199. scopedSlots: { customRender: 'isnum' },
  200. width: '150px',
  201. },
  202. {
  203. title: '整改完成数量',
  204. dataIndex: 'rectFinishNum',
  205. scopedSlots: { customRender: 'isnum' },
  206. width: '150px',
  207. },
  208. {
  209. title: '风险接受数量',
  210. dataIndex: 'riskAcceptNum',
  211. scopedSlots: { customRender: 'isnum' },
  212. width: '150px',
  213. },
  214. {
  215. title: '当前状态',
  216. sorter: true,
  217. dataIndex: 'rectFeedStatus',
  218. width: '150px',
  219. },
  220. {
  221. title: '当前处理人',
  222. dataIndex: 'currentUser',
  223. width: '150px',
  224. },
  225. {
  226. title: '操作',
  227. dataIndex: 'id',
  228. scopedSlots: { customRender: 'opt' },
  229. width: '100px',
  230. },
  231. {
  232. title: '流程ID',
  233. dataIndex: 'instId',
  234. sdHidden: true,
  235. },
  236. ],
  237. actions: [
  238. // {
  239. // label: '新建',
  240. // id: 'new',
  241. // type: TableActionTypes.primary, // 新建按钮,不需要回调,自动处理
  242. // permission: null, // 纯前端操作,不需要权限控制
  243. // callback: this.createrectfeedback,
  244. // },
  245. {
  246. label: '删除',
  247. id: 'delete',
  248. type: TableActionTypes.ex.delete, // 删除按钮,不需要回调,会自动处理(对sd-data-table无效)
  249. },
  250. {
  251. label: '导出',
  252. permission: null, // 纯前端操作,不需要权限控制
  253. callback: () => {
  254. this.$refs.exportExcel.exportdata()
  255. },
  256. },
  257. ],
  258. tableExpressions: [],
  259. buttonsfortable: [
  260. {
  261. label: '变更',
  262. id: 'changeleader',
  263. showCondition: '',
  264. },
  265. ],
  266. searchform: 'searchform',
  267. expand: false,
  268. advSearchForm: {
  269. projectName: '',
  270. projectCode: '',
  271. auditedUnit: '',
  272. planStatus: '',
  273. },
  274. itemStatusOptions: [],
  275. auditTypeOptions: [],
  276. auditModeOptions: [],
  277. projectId: '',
  278. setType: '',
  279. unitName: '',
  280. }
  281. },
  282. mounted() {
  283. // 初始化数据字典信息
  284. this.initDictionaryInfo()
  285. },
  286. methods: {
  287. changeunit(values) {
  288. this.unitName = ''
  289. values.forEach((element) => {
  290. this.unitName = element.name
  291. })
  292. },
  293. createrectfeedback() {
  294. const url = `/sd-flow-guide?code=PRODUCT_IAM_ZGFK` // 新页面要打开的路由地址
  295. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  296. if (refreshFlag) {
  297. this.$refs.dataTable.refresh()
  298. }
  299. })
  300. },
  301. initDictionaryInfo() {
  302. axios({
  303. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=RECT_FEED_STATUS',
  304. method: 'get',
  305. }).then((res) => {
  306. if (res.status === 200) {
  307. this.itemStatusOptions = res.data
  308. }
  309. })
  310. },
  311. onSearch(value) {
  312. this.tableExpressions = []
  313. if (value) {
  314. const expressions = []
  315. // 项目名称
  316. expressions.push({
  317. dataType: 'str',
  318. name: 'projectName',
  319. op: 'like',
  320. stringValue: `%${value}%`,
  321. })
  322. // 项目编号
  323. expressions.push({
  324. dataType: 'str',
  325. name: 'projectCode',
  326. op: 'like',
  327. stringValue: `%${value}%`,
  328. })
  329. this.tableExpressions.push({
  330. dataType: 'exps',
  331. op: 'or',
  332. expressionsValue: expressions,
  333. })
  334. }
  335. },
  336. advSearch() {
  337. this.tableExpressions = []
  338. // 项目名称
  339. if (this.advSearchForm.projectName) {
  340. this.tableExpressions.push({
  341. dataType: 'str',
  342. name: 'projectName',
  343. op: 'like',
  344. stringValue: `%${this.advSearchForm.projectName}%`,
  345. })
  346. }
  347. // 项目编号
  348. if (this.advSearchForm.projectCode) {
  349. this.tableExpressions.push({
  350. dataType: 'str',
  351. name: 'projectCode',
  352. op: 'like',
  353. stringValue: `%${this.advSearchForm.projectCode}%`,
  354. })
  355. }
  356. // 项目组长
  357. if (this.advSearchForm.auditedUnit) {
  358. this.tableExpressions.push({
  359. dataType: 'str',
  360. name: 'auditedUnitName',
  361. op: 'like',
  362. stringValue: `%${this.unitName}%`,
  363. })
  364. }
  365. if (this.advSearchForm.planStatus[0]) {
  366. this.tableExpressions.push({
  367. dataType: 'str',
  368. name: 'rectFeedStatus',
  369. op: 'eq',
  370. stringValue: `${this.advSearchForm.planStatus[0].id}`,
  371. })
  372. }
  373. },
  374. searchedClick() {
  375. this.expand = !this.expand
  376. },
  377. // 重置年份
  378. resetForm() {
  379. this.advSearchForm.auditedUnit = ''
  380. this.unitName = ''
  381. },
  382. linkProject(record) {
  383. // if (record.flowState === '起草') {
  384. // const url = '/sd-webflow/pages/draft/' + record.instId // 编辑面要打开的路由地址
  385. // crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  386. // if (refreshFlag) {
  387. // // 这里写或者调刷新的方法
  388. // this.$refs.dataTable.refresh()
  389. // }
  390. // })
  391. // } else {
  392. window.open('#/sd-webflow/done-pages/' + record.instId)
  393. // }
  394. },
  395. // // 项目组长配置保存
  396. change(val) {
  397. let codes = ''
  398. let names = ''
  399. if (val.length > 0) {
  400. val.forEach((e) => {
  401. codes += e.code + ','
  402. names += e.name + ','
  403. })
  404. codes = codes.substr(0, codes.length - 1)
  405. names = names.substr(0, names.length - 1)
  406. }
  407. return new Promise((resolve) => {
  408. // AuditRectplanprojectService.changeTeamEditor(this.projectId, codes, names).then((res) => {
  409. // if (res.data) {
  410. // this.$refs.dataTable.clearSelection()
  411. // this.$refs.dataTable.refresh()
  412. // }
  413. // })
  414. })
  415. },
  416. AdvSearchClick() {
  417. this.expand = !this.expand
  418. },
  419. optbuttonClick(val, record) {
  420. // 变更编辑人
  421. if (val === 'changeleader') {
  422. const jsonArry = []
  423. if (record.resppersonsAccount !== '' && record.resppersonsAccount !== null) {
  424. if (record.resppersonsAccount.indexOf(',') > -1) {
  425. const codes = record.resppersonsAccount.split(',')
  426. const names = record.resppersonsName.split(',')
  427. for (let i = 0; i < codes.length; i++) {
  428. jsonArry.push({ type: 'User', code: codes[i], name: names[i], attrs: [] })
  429. }
  430. } else {
  431. jsonArry.push({
  432. type: 'User',
  433. code: record.resppersonsAccount,
  434. name: record.resppersonsName,
  435. attrs: [],
  436. })
  437. }
  438. }
  439. this.mainSendUnit = jsonArry
  440. this.projectId = record.id
  441. setTimeout(() => {
  442. this.$refs.assignTeamLeader.openPicker()
  443. }, 0)
  444. }
  445. },
  446. },
  447. }
  448. </script>
  449. <style module lang="scss">
  450. @use '@/common/design' as *;
  451. .btns {
  452. position: absolute;
  453. top: 24px;
  454. right: 20.5px;
  455. z-index: 100;
  456. display: none;
  457. }
  458. .operatecol {
  459. display: flex;
  460. flex-wrap: wrap;
  461. justify-content: flex-end;
  462. :global(.ant-btn-sm) {
  463. padding: 0 3px;
  464. }
  465. }
  466. .advSearchBtn {
  467. width: 35px;
  468. padding: 0px;
  469. }
  470. :global(.ant-card .searchcard_audit-advanced-query_product) {
  471. right: 17px !important;
  472. }
  473. .buttonSpacing {
  474. margin-left: 5px;
  475. }
  476. .search-icon {
  477. font-size: 12px;
  478. margin-left: 1px !important;
  479. }
  480. // .rectfeedbacklist {
  481. // :global(.ant-table-column-title) {
  482. // white-space: normal;
  483. // }
  484. // }
  485. </style>