xm-project-post-evaluation-list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <template>
  2. <div>
  3. <a-card class="reporttablecardxm">
  4. <!-- 高级搜索组件 -->
  5. <audit-advanced-query
  6. :expand="expand"
  7. :class="$style.advancedQuery"
  8. :search-data="formData"
  9. :ref-name="searchform"
  10. :search-style="{ height: '220px', left: '10px', top: '60px' }"
  11. :search-fun="handleSearch"
  12. @searchedClick="searchedClick"
  13. >
  14. <template>
  15. <a-row>
  16. <a-col :span="12">
  17. <a-form-model-item :label="'项目名称'" prop="projectName">
  18. <a-input v-model="formData.projectName" allow-clear />
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :span="12">
  22. <a-form-model-item :label="'单位名称'" prop="secUnitName">
  23. <a-input v-model="formData.secUnitName" allow-clear />
  24. </a-form-model-item>
  25. </a-col>
  26. </a-row>
  27. <a-row>
  28. <a-col :span="12">
  29. <a-form-model-item :label="'投资方式'" prop="investmentMethod">
  30. <a-input v-model="formData.investmentMethod" allow-clear />
  31. <!-- <a-select v-model="formData.investmentMethod" :allow-clear="true">
  32. <a-select-option :value="0"> 基建 </a-select-option>
  33. <a-select-option :value="1"> 并购 </a-select-option>
  34. <a-select-option :value="2"> 合作开发 </a-select-option>
  35. </a-select> -->
  36. </a-form-model-item>
  37. </a-col>
  38. <a-col :span="12">
  39. <a-form-model-item :label="'产业类别'" prop="industryCategory">
  40. <a-input v-model="formData.industryCategory" allow-clear />
  41. <!-- <a-select v-model="formData.industryCategory" :allow-clear="true">
  42. <a-select-option :value="0"> 风电 </a-select-option>
  43. <a-select-option :value="1"> 光伏 </a-select-option>
  44. <a-select-option :value="2"> 储能 </a-select-option>
  45. <a-select-option :value="3"> 其他 </a-select-option>
  46. </a-select> -->
  47. </a-form-model-item>
  48. </a-col>
  49. </a-row>
  50. <a-row>
  51. <a-col :span="23">
  52. <a-form-model-item :label="'完成竣工财务决算或并购时间'" prop="mergerTime">
  53. <a-range-picker v-model="formData.mergerTime" />
  54. <!-- <a-date-picker
  55. v-model="formData.mergerTime"
  56. required="true"
  57. format="YYYY-MM-DD"
  58. :allow-clear="true"
  59. @change="onChange"
  60. ></a-date-picker> -->
  61. </a-form-model-item>
  62. </a-col>
  63. </a-row>
  64. </template>
  65. </audit-advanced-query>
  66. <a-radio-group
  67. v-model="radioValue"
  68. allow-clear
  69. :class="$style.radioGroup"
  70. @change="radioOnChange"
  71. >
  72. <a-radio :value="1"> 全部 </a-radio>
  73. <a-radio :value="2"> 待处理 </a-radio>
  74. </a-radio-group>
  75. <sd-data-table-ex
  76. ref="SJZXDataTable"
  77. :filter-expressions="expressions"
  78. :columns="columns"
  79. :actions="actions"
  80. form-id="spicProjectPostEvaluation"
  81. :data-url="dataurl"
  82. :search-fields="[
  83. 'projectName',
  84. 'investmentMethod',
  85. 'secUnitName',
  86. 'industryCategory',
  87. 'mergerTime',
  88. ]"
  89. show-selection
  90. :show-advance-query="true"
  91. @searchbtnClick="searchbtnClick"
  92. >
  93. <div slot="islink" slot-scope="text, record">
  94. <a @click="rowClick(record)">{{ text }}</a>
  95. </div>
  96. </sd-data-table-ex>
  97. </a-card>
  98. </div>
  99. </template>
  100. <script>
  101. import { getUserInfo } from '@/common/store-mixin'
  102. import download from '@/common/services/download'
  103. import { message, Modal } from 'ant-design-vue'
  104. import PageService from '@/common/services/page-service'
  105. import axios from '@/common/services/axios-instance'
  106. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  107. import TableColumnTypes from '@/common/services/table-column-types'
  108. import TableActionTypes from '@/common/services/table-action-types'
  109. import auditAdvancedQueryMixins from '@product/iam/components/audit-advanced-query-mixins'
  110. import auditAdvancedGroupMixins from '@product/iam/components/audit-advanced-group-mixins'
  111. import auditAdvancedQuery from '@product/iam/components/audit-advanced-query.vue'
  112. import components from './_import-components/xm-project-post-evaluation-list-import'
  113. export default {
  114. name: 'XmProjectPostEvaluationList',
  115. metaInfo: {
  116. title: '后评价项目信息',
  117. },
  118. components: {
  119. ...components,
  120. auditAdvancedQuery,
  121. },
  122. mixins: [auditAdvancedQueryMixins, auditAdvancedGroupMixins],
  123. data() {
  124. return {
  125. radioValue: 1,
  126. searchform: 'searchform',
  127. dataurl: 'api/xcoa-mobile/v1/spicprojectpostevaluation/all-list',
  128. expressions: [],
  129. formData: {
  130. projectName: '',
  131. investmentMethod: null,
  132. industryCategory: null,
  133. mergerTime: '',
  134. secUnitName: '',
  135. },
  136. exportIds: [],
  137. formId: 'spicProjectPostEvaluation',
  138. columns: [
  139. {
  140. title: '序号',
  141. dataIndex: 'sortNumber',
  142. width: '80px',
  143. customRender: (text, record, index) => `${index + 1}`,
  144. },
  145. {
  146. title: '项目名称',
  147. dataIndex: 'projectName',
  148. width: '220px',
  149. scopedSlots: { customRender: 'islink' },
  150. },
  151. {
  152. title: '单位名称',
  153. dataIndex: 'secUnitName',
  154. width: '220px',
  155. },
  156. {
  157. title: '并购项目完成并购、基建项目和合作开发项目完成竣工财务决算满1年及以上',
  158. dataIndex: 'mergerProject',
  159. width: '180px',
  160. },
  161. {
  162. title: '投资额1000万元以上',
  163. dataIndex: 'investmentAmount',
  164. width: '160px',
  165. },
  166. {
  167. title: '投资方式',
  168. dataIndex: 'investmentMethod',
  169. width: '100px',
  170. },
  171. {
  172. title: '产业类别',
  173. dataIndex: 'industryCategory',
  174. width: '100px',
  175. },
  176. {
  177. title: '完成竣工财务决算或并购时间',
  178. dataIndex: 'mergerTime',
  179. sdRender: TableColumnTypes.date,
  180. sorter: true,
  181. // defaultSortOrder: 'asc',
  182. width: '180px',
  183. },
  184. {
  185. title: '编辑人员',
  186. dataIndex: 'creatorName',
  187. sdHidden: true,
  188. },
  189. {
  190. title: '编辑日期',
  191. dataIndex: 'creationTime',
  192. sortDirections: 'descend',
  193. defaultSortOrder: 'descend',
  194. sdRender: TableColumnTypes.date,
  195. sdHidden: true,
  196. },
  197. {
  198. title: '报送状态',
  199. dataIndex: 'pubStatus',
  200. width: '120px',
  201. },
  202. {
  203. title: '是否新数据',
  204. dataIndex: 'isNewData',
  205. sdHidden: true,
  206. },
  207. ],
  208. actions: [
  209. {
  210. label: '删除',
  211. id: 'delete',
  212. permission: null,
  213. type: TableActionTypes.batch,
  214. callback: this.deleteRows,
  215. },
  216. // {
  217. // label: '新建',
  218. // id: 'new',
  219. // type: TableActionTypes.primary, // 新建按钮,不需要回调,自动处理
  220. // permission: 'create', // 纯前端操作,不需要权限控制
  221. // callback: () => {
  222. // const url = '/sd-flow-guide?code=SPIC_AUDIT_HPJXMXX' // 新页面要打开的路由地址
  223. // crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  224. // if (refreshFlag) {
  225. // // 这里写或者调刷新的方法
  226. // this.refresh()
  227. // }
  228. // })
  229. // },
  230. // },
  231. {
  232. label: '生成数据',
  233. id: 'newData',
  234. permission: null,
  235. callback: this.newData, // 纯前端操作,不需要权限控制
  236. },
  237. {
  238. label: '导出',
  239. id: 'export',
  240. permission: null,
  241. callback: () => {
  242. let idArr = this.$refs.SJZXDataTable.getSelectedRowKeys()
  243. if (idArr === undefined || idArr.length === 0) {
  244. idArr = this.exportIds
  245. }
  246. this.handleExport(idArr)
  247. },
  248. },
  249. ],
  250. }
  251. },
  252. created() {},
  253. mounted() {},
  254. methods: {
  255. // 生成数据
  256. newData() {
  257. axios({
  258. url: `api/xcoa-mobile/v1/spicprojectpostevaluation/generateDatas?`,
  259. method: 'post',
  260. }).then((res) => {
  261. if (res.status === 200) {
  262. // Modal.warning({
  263. // title: '提示',
  264. // content: '生成数据成功',
  265. // })
  266. this.refresh()
  267. }
  268. })
  269. },
  270. handleExport(ids) {
  271. this.expressions = []
  272. if (this.radioValue === 1) {
  273. this.expressions.push({
  274. dataType: 'str',
  275. name: 'stateFlag',
  276. op: 'eq',
  277. stringValue: 'true',
  278. })
  279. } else if (this.radioValue === 2) {
  280. this.expressions.push({
  281. dataType: 'str',
  282. name: 'stateFlag',
  283. op: 'eq',
  284. stringValue: 'false',
  285. })
  286. }
  287. // 项目名称
  288. if (this.formData.projectName) {
  289. this.expressions.push({
  290. dataType: 'str',
  291. name: 'projectName',
  292. op: 'like',
  293. stringValue: `${this.formData.projectName}`,
  294. })
  295. }
  296. // 投资方式
  297. if (this.formData.investmentMethod) {
  298. this.expressions.push({
  299. dataType: 'str',
  300. name: 'investmentMethod',
  301. op: 'like',
  302. stringValue: `${this.formData.investmentMethod}`,
  303. })
  304. }
  305. // 产业类别
  306. if (this.formData.industryCategory) {
  307. this.expressions.push({
  308. dataType: 'str',
  309. name: 'industryCategory',
  310. op: 'like',
  311. stringValue: `${this.formData.industryCategory}`,
  312. })
  313. }
  314. // 完成竣工财务决算或并购时间
  315. if (this.strOrArr(this.formData.mergerTime)) {
  316. if (this.formData.mergerTime[0] === null) {
  317. this.formData.mergerTime = null
  318. } else {
  319. this.expressions.push({
  320. dataType: 'str',
  321. name: 'mergerTime',
  322. op: 'ge',
  323. stringValue: `${this.formData.mergerTime[0].format('YYYY-MM-DD')}`,
  324. })
  325. this.expressions.push({
  326. dataType: 'str',
  327. name: 'mergerTime',
  328. op: 'le',
  329. stringValue: `${this.formData.mergerTime[1].format('YYYY-MM-DD')}`,
  330. })
  331. }
  332. }
  333. // 单位名称
  334. if (this.formData.secUnitName) {
  335. this.expressions.push({
  336. dataType: 'str',
  337. name: 'secUnitName',
  338. op: 'like',
  339. stringValue: `${this.formData.secUnitName}`,
  340. })
  341. }
  342. axios({
  343. url: 'api/xcoa-mobile/v1/spicprojectpostevaluation/exportDatas',
  344. method: 'post',
  345. data: this.expressions,
  346. responseType: 'blob',
  347. }).then((res) => {
  348. if (res.status === 200) {
  349. const url = URL.createObjectURL(res.data)
  350. const filename = res.headers['content-disposition']
  351. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  352. download(url, decodeURI(fname))
  353. }
  354. })
  355. },
  356. // handleExport(ids) {
  357. // if (!ids || ids.length === 0) {
  358. // Modal.info({
  359. // content: '请选择需要导出的数据!',
  360. // })
  361. // } else {
  362. // axios({
  363. // url: 'api/xcoa-mobile/v1/spicprojectpostevaluation/exportDatas',
  364. // method: 'post',
  365. // data: ids,
  366. // responseType: 'blob',
  367. // }).then((res) => {
  368. // if (res.status === 200) {
  369. // const url = URL.createObjectURL(res.data)
  370. // const filename = res.headers['content-disposition']
  371. // const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  372. // download(url, decodeURI(fname))
  373. // }
  374. // })
  375. // }
  376. // },
  377. onChange(value) {
  378. if (value) {
  379. this.formData.mergerTime = value.format('YYYY-MM-DD')
  380. } else {
  381. this.formData.mergerTime = ''
  382. }
  383. },
  384. // 删除数据
  385. deleteRows(record) {
  386. const userInfo = getUserInfo()
  387. const selecteFlowState = this.$refs.SJZXDataTable.getSelectedRows()
  388. const selectedRowKeys = this.$refs.SJZXDataTable.getSelectedRowKeys()
  389. if (selectedRowKeys.length === 0) {
  390. Modal.info({
  391. content: '请选择需要删除的数据!',
  392. })
  393. return
  394. }
  395. axios({
  396. url: 'api/xcoa-mobile/v1/spicprojectpostevaluation/findHasPermission',
  397. method: 'post',
  398. }).then((res) => {
  399. if (res.data === true) {
  400. this.flagdelete()
  401. } else {
  402. let delFlag = true
  403. selecteFlowState.forEach((item) => {
  404. if (item.creatorName !== userInfo.name) {
  405. delFlag = false
  406. }
  407. })
  408. if (delFlag) {
  409. this.flagdelete()
  410. } else {
  411. Modal.warning({
  412. title: '提示',
  413. content: '删除失败,不可删除他人创建的流程!',
  414. })
  415. }
  416. }
  417. })
  418. },
  419. flagdelete() {
  420. let flag = true
  421. const rows = this.$refs.SJZXDataTable.getSelectedRows()
  422. rows.forEach((r) => {
  423. if (r.endType) {
  424. if (r.endType !== 0) {
  425. flag = false
  426. }
  427. }
  428. })
  429. if (!flag) {
  430. Modal.error({
  431. title: '删除失败:存在不是起草状态的数据',
  432. })
  433. this.loading = false
  434. } else {
  435. const selectedRowKeys = this.$refs.SJZXDataTable.getSelectedRowKeys()
  436. Modal.confirm({
  437. title: '你确定删除这项内容吗?',
  438. content: '删除这条数据后,就无法恢复初始的状态。',
  439. okText: '删除',
  440. okType: 'danger',
  441. onOk: () => {
  442. this.loading = true
  443. const params = {
  444. ids: selectedRowKeys.join(','),
  445. }
  446. PageService.delete(params, this.formId).then((res) => {
  447. message.success('删除成功')
  448. if (res.status === 200) {
  449. this.$refs.SJZXDataTable.clearSelection()
  450. this.refresh()
  451. this.loading = false
  452. }
  453. })
  454. },
  455. })
  456. }
  457. },
  458. refresh() {
  459. return this.$refs.SJZXDataTable.refresh(true)
  460. },
  461. rowClick(record) {
  462. debugger
  463. const userInfo = getUserInfo()
  464. if (record.creatorName === userInfo.name && record.endType !== 5) {
  465. window.open('#/sd-webflow/pages/draft/' + record.instId)
  466. } else if (record.creatorName === userInfo.name && record.endType === 5) {
  467. window.open('#/sd-webflow/done-pages/' + record.instId)
  468. } else {
  469. window.open('#/sd-webflow/done-pages/' + record.instId)
  470. }
  471. // axios({
  472. // url: 'api/xcoa-mobile/v1/spicprojectpostevaluation/findHasPermission',
  473. // method: 'post',
  474. // }).then((res) => {
  475. // debugger
  476. // if (res.data === true) {
  477. // if (
  478. // record.creatorName === userInfo.name &&
  479. // (record.flowState === '起草') | (record.flowState === '开始')
  480. // ) {
  481. // window.open('#/sd-webflow/pages/draft/' + record.instId)
  482. // } else {
  483. // window.open('#/sd-webflow/done-pages/' + record.instId)
  484. // }
  485. // } else if ((record.flowState === '起草') | (record.flowState === '开始')) {
  486. // window.open('#/sd-webflow/pages/draft/' + record.instId)
  487. // } else {
  488. // window.open('#/sd-webflow/done-pages/' + record.instId)
  489. // }
  490. // })
  491. },
  492. radioOnChange(e) {
  493. if (this.selectedType !== e.target.value) {
  494. this.selectedType = e.target.value
  495. if (e.target.value === 1) {
  496. this.dataurl = 'api/xcoa-mobile/v1/spicprojectpostevaluation/all-list'
  497. this.radioValue = 1
  498. } else if (e.target.value === 2) {
  499. this.dataurl = 'api/xcoa-mobile/v1/spicprojectpostevaluation/todo-list'
  500. this.radioValue = 2
  501. }
  502. }
  503. },
  504. // 判断数组或字符串为null或长度为0
  505. strOrArr(strOrArr) {
  506. return strOrArr !== null && strOrArr.length > 0
  507. },
  508. // 查询
  509. handleSearch() {
  510. this.expressions = []
  511. // 项目名称
  512. if (this.formData.projectName) {
  513. this.expressions.push({
  514. dataType: 'str',
  515. name: 'projectName',
  516. op: 'like',
  517. stringValue: `${this.formData.projectName}`,
  518. })
  519. }
  520. // 投资方式
  521. if (this.formData.investmentMethod) {
  522. this.expressions.push({
  523. dataType: 'str',
  524. name: 'investmentMethod',
  525. op: 'like',
  526. stringValue: `${this.formData.investmentMethod}`,
  527. })
  528. }
  529. // 产业类别
  530. if (this.formData.industryCategory) {
  531. this.expressions.push({
  532. dataType: 'str',
  533. name: 'industryCategory',
  534. op: 'like',
  535. stringValue: `${this.formData.industryCategory}`,
  536. })
  537. }
  538. // 完成竣工财务决算或并购时间
  539. if (this.strOrArr(this.formData.mergerTime)) {
  540. if (this.formData.mergerTime[0] === null) {
  541. this.formData.mergerTime = null
  542. } else {
  543. this.expressions.push({
  544. dataType: 'str',
  545. name: 'mergerTime',
  546. op: 'ge',
  547. stringValue: `${this.formData.mergerTime[0].format('YYYY-MM-DD')}`,
  548. // stringValue: new Date(
  549. // this.formData.mergerTime[0].format('YYYY-MM-DD') + ' 00:00:00'
  550. // ).valueOf(),
  551. })
  552. this.expressions.push({
  553. dataType: 'str',
  554. name: 'mergerTime',
  555. op: 'le',
  556. stringValue: `${this.formData.mergerTime[1].format('YYYY-MM-DD')}`,
  557. // stringValue: new Date(
  558. // this.formData.mergerTime[1].format('YYYY-MM-DD') + ' 23:59:59'
  559. // ).valueOf(),
  560. })
  561. }
  562. }
  563. // if (this.formData.mergerTime) {
  564. // const timeValue = Date.parse(new Date(this.formData.mergerTime).toString())
  565. // this.expressions.push({
  566. // dataType: 'str',
  567. // name: 'mergerTime',
  568. // op: 'eq',
  569. // stringValue: `${this.formData.mergerTime}`,
  570. // // longValue: timeValue,
  571. // })
  572. // }
  573. // 单位名称
  574. if (this.formData.secUnitName) {
  575. this.expressions.push({
  576. dataType: 'str',
  577. name: 'secUnitName',
  578. op: 'like',
  579. stringValue: `${this.formData.secUnitName}`,
  580. })
  581. }
  582. },
  583. },
  584. }
  585. </script>
  586. <style module lang="scss">
  587. @use '@/common/design' as *;
  588. .radioGroup {
  589. position: absolute;
  590. top: 30px;
  591. left: 20px;
  592. }
  593. .advancedQuery {
  594. :global(.ant-col .ant-form-item-label) {
  595. width: 20% !important;
  596. }
  597. :global(.reporttablecardxm) {
  598. :global(.ant-table-body) {
  599. height: auto !important;
  600. min-height: auto !important;
  601. overflow: auto;
  602. }
  603. }
  604. :global(.ant-col .ant-form-item-control-wrapper) {
  605. width: 80% !important;
  606. }
  607. }
  608. </style>