xm-law-progress-open-task-handler.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. <script>
  2. /* eslint-disable */
  3. // sd-skip-auto-import
  4. import cloneDeep from 'lodash.clonedeep'
  5. import qs from 'qs'
  6. import { router } from '@/common/router-ready'
  7. import { Modal, message } from 'ant-design-vue'
  8. import lawCassTree from '../../../../../src_product/iam/law/case/law-case-tree.vue'
  9. import LawService from '../../../../../src_product/iam/law/law-service'
  10. import XmSingleDataService from './xm-single-data-service'
  11. function at(n) {
  12. n = Math.trunc(n) || 0
  13. if (n < 0) n += this.length
  14. if (n < 0 || n >= this.length) return undefined
  15. return this[n]
  16. }
  17. const TypedArray = Reflect.getPrototypeOf(Int8Array)
  18. for (const C of [Array, String, TypedArray]) {
  19. Object.defineProperty(C.prototype, 'at', {
  20. value: at,
  21. writable: true,
  22. enumerable: false,
  23. configurable: true,
  24. })
  25. }
  26. import components from './_import-components/xm-law-progress-open-task-handler-import'
  27. var _render = function e() {
  28. var t = this,
  29. s = t._self._c
  30. const info = []
  31. if (this.strtype) {
  32. if (t.stage.length > 0) {
  33. t.stage.forEach((ti) => {
  34. info.push(
  35. s('a-select-option', { attrs: { value: ti.code }, key: ti.code }, [t._v(ti.name)])
  36. )
  37. })
  38. }
  39. } else {
  40. if (t.zxstage.length > 0) {
  41. t.zxstage.forEach((ti) => {
  42. info.push(
  43. s('a-select-option', { attrs: { value: ti.code }, key: ti.code }, [t._v(ti.name)])
  44. )
  45. })
  46. }
  47. }
  48. return s(
  49. 'div',
  50. [
  51. s(
  52. 'a-modal',
  53. {
  54. attrs: {
  55. 'destroy-on-close': '',
  56. title: t.modaltitle,
  57. width: 800,
  58. 'ok-text': '确定',
  59. 'cancel-text': '取消',
  60. 'body-style': { minHeight: '380px' },
  61. 'confirm-loading': false,
  62. 'mask-closable': false,
  63. },
  64. on: { ok: t.treeok, cancel: () => (t.treevisible = false) },
  65. model: {
  66. value: t.treevisible,
  67. callback: function (e) {
  68. t.treevisible = e
  69. },
  70. expression: 'treevisible',
  71. },
  72. },
  73. [
  74. s(
  75. 'div',
  76. [
  77. s('a-spin', { class: t.$style.spin, attrs: { spinning: t.spinning } }),
  78. t.empty ? s('a-empty') : t._e(),
  79. t.ztreeData
  80. ? s(
  81. 'a-tree',
  82. t._g(
  83. t._b(
  84. {
  85. attrs: {
  86. 'show-icon': '',
  87. selectable: true,
  88. 'tree-data': t.ztreeData,
  89. 'default-expand-parent': true,
  90. 'default-expanded-keys': t.expandedKeys,
  91. 'selected-keys': t.$attrs['selected-keys'] || t.selectedKeys,
  92. 'load-data': t.onLoadData,
  93. 'replace-fields': { title: 'text', key: 'id' },
  94. },
  95. on: { select: t.onSelect, 'update:selectedKeys': t.setSelectedKeys },
  96. scopedSlots: t._u(
  97. [
  98. {
  99. key: 'custom',
  100. fn: function (e) {
  101. return [
  102. s('span', [t._v(t._s(e.name))]),
  103. 'true' === e.props.hasPoint && t.isAdmin
  104. ? s('a-badge', {
  105. class: t.$style.badge,
  106. attrs: { status: 'error' },
  107. })
  108. : t._e(),
  109. ]
  110. },
  111. },
  112. ],
  113. null,
  114. false,
  115. 877135721
  116. ),
  117. },
  118. 'a-tree',
  119. t.$attrs,
  120. false
  121. ),
  122. t.restListeners
  123. )
  124. )
  125. : t._e(),
  126. ],
  127. 1
  128. ),
  129. ],
  130. 1
  131. ),
  132. s(
  133. 'a-modal',
  134. {
  135. attrs: {
  136. 'destroy-on-close': '',
  137. title: t.modaltitle,
  138. width: 800,
  139. 'ok-text': '确定',
  140. 'cancel-text': '取消',
  141. 'confirm-loading': false,
  142. // 'body-style': { minHeight: '200px' },
  143. 'mask-closable': false,
  144. },
  145. on: { ok: t.ok, cancel: () => (t.visible = false) },
  146. model: {
  147. value: t.visible,
  148. callback: function (e) {
  149. t.visible = e
  150. },
  151. expression: 'visible',
  152. },
  153. },
  154. [
  155. s('a-form-model', { props: { labelCol: { span: 7 }, wrapperCol: { span: 15 } } }, [
  156. s('a-form-model-item', { attrs: { label: '阶段名称', required: true } }, [
  157. s(
  158. 'a-select',
  159. {
  160. on: { change: t.handleChange },
  161. model: {
  162. value: t.Val,
  163. callback: function (e) {
  164. t.Val = e
  165. },
  166. expression: 'Val',
  167. },
  168. },
  169. info,
  170. 1
  171. ),
  172. ]),
  173. ]),
  174. ],
  175. 1
  176. ),
  177. ],
  178. 1
  179. )
  180. }
  181. var staticRenderFns = []
  182. _render._withStripped = true
  183. export default {
  184. name: 'SdBatchModifyHandler',
  185. components: { ...components, lawCassTree: lawCassTree },
  186. data() {
  187. return {
  188. visible: false,
  189. Val: '',
  190. strtype: true, // true纠纷 否则案件
  191. stage: [],
  192. zxstage: [],
  193. treevisible: false,
  194. button: {},
  195. initValues: [],
  196. childTable: void 0,
  197. selectedRows: [],
  198. event: [],
  199. spinning: true,
  200. empty: false,
  201. treeData: null,
  202. ztreeData: null,
  203. expandedKeys: [],
  204. selectedKeys: [],
  205. selectedNode: null,
  206. defaultSelectedKeys: [],
  207. isNewWindow: '',
  208. parentid: '', // 父节点
  209. jdinfo: [],
  210. modaltitle: '纠纷进展阶段',
  211. }
  212. },
  213. mounted() {
  214. LawService.getAllCaseTree().then((r) => {
  215. this.spinning = false
  216. this.expandedKeys = ['0']
  217. this.selectedKeys = ['0']
  218. const treeNode = [
  219. {
  220. id: '0',
  221. text: '案件进展阶段',
  222. leaf: false,
  223. props: {},
  224. children: r.data,
  225. key: '0',
  226. },
  227. ]
  228. this.treeData = this.transformData(treeNode)
  229. this.generateList(this.treeData)
  230. // this.ztreeData = null
  231. if (this.treeData.length < 1) this.empty = true
  232. })
  233. //获取纠纷阶段
  234. LawService.getAlljfStage().then((res) => {
  235. const stage = []
  236. res.data.data.forEach((d) => {
  237. stage.push({
  238. name: d.STAGE_NAME,
  239. code: d.STAGE_CODE,
  240. businessTypeId: d.text0,
  241. })
  242. })
  243. this.stage = stage
  244. })
  245. //获取执行进展阶段
  246. LawService.getAllcaseproStage().then((res) => {
  247. const stage = []
  248. res.data.forEach((d) => {
  249. stage.push({
  250. name: d.EXECUTE_NAME,
  251. code: d.EXECUTE_CODE,
  252. businessTypeId: d.businessTypeId,
  253. })
  254. })
  255. this.zxstage = stage
  256. })
  257. },
  258. methods: {
  259. run({ button: e, eventScript: t, context: c }) {
  260. const strtype = t.strtype === '1' // true纠纷 否则案件
  261. this.strtype = strtype
  262. this.event = t
  263. let zt = ''
  264. // 模块表单id
  265. const appModuleId = t.appModuleId
  266. //通过接口获取最新的数据
  267. const { fieldInfos } = c
  268. let flowstatus = c.args[0].STEP_NAME ? c.args[0].STEP_NAME : c.args[0].CURRENT_STATUS
  269. let beanid = 'onl:9f03a7c8fda944deb87aaaabb305953b' // 纠纷数据BEAN
  270. const id = fieldInfos.find((f) => f.name === 'id')?.value
  271. if (!strtype) {
  272. beanid = 'onl:e4097c3684fc4f6ebd1eae43679f38b0' // 案件数据BEAN
  273. }
  274. if (strtype) {
  275. const strjftype = t.strjftype === '1' // true 进展 否则结案
  276. let jfid = fieldInfos.find((f) => f.name === 'DISPUTE_ID')?.value
  277. if (jfid === null || jfid === undefined || jfid === '') {
  278. jfid = fieldInfos.find((f) => f.name === 'id')?.value
  279. }
  280. // 判断打开新建页面 还是打开正在处理中的纠纷进展
  281. LawService.getProgressData(jfid).then((res1) => {
  282. let flag = true // true 是弹出纠纷登记 false 是不弹出纠纷登记
  283. if (appModuleId === '' || appModuleId === undefined) {
  284. flag = false
  285. }
  286. let djurl = ''
  287. let jzurl = ''
  288. let parentid = ''
  289. if (res1.data.length > 1) {
  290. // 有纠纷登记
  291. djurl = res1.data[0].props.detailUrl + '/' + res1.data[0].props.detailInstid
  292. if (res1.data[0]) {
  293. parentid = res1.data[1].id
  294. }
  295. if (res1.data[1].children && res1.data[1].children.length > 0) {
  296. if (
  297. res1.data[1].children[res1.data[1].children.length - 1].props.stepStatus === '0'
  298. ) {
  299. // 有纠纷进展并且未办结
  300. jzurl =
  301. res1.data[1].children[res1.data[1].children.length - 1].props.detailUrl +
  302. '/' +
  303. res1.data[1].children[res1.data[1].children.length - 1].props.detailInstid
  304. flag = false
  305. } else {
  306. // 有纠纷登记且办结
  307. }
  308. }
  309. } else {
  310. // 无纠纷登记 弹出选择阶段名称
  311. }
  312. t.id = jfid
  313. if (appModuleId === '' || appModuleId === undefined) {
  314. // 打开查看页面 永远打开最后一个页面的
  315. this.openlastpage(res1.data, jfid)
  316. } else if (flag && strjftype) {
  317. // 新建纠纷进展
  318. t.parentid = parentid
  319. t.zt = 'progress'
  320. this.Val = ''
  321. this.visible = true
  322. } else {
  323. let url = ''
  324. if (!strjftype) {
  325. zt = 'finish'
  326. // 判断返回的是否有结案数据,无则打开结案新建页面,否则打开历史
  327. let jaflag = true // true 新建 false 为打开历史
  328. if (res1.data.length > 2) {
  329. if (res1.data[2].props.stepType === 'finish') {
  330. jaflag = false
  331. }
  332. }
  333. if (jaflag) {
  334. // 业务类型 新建纠纷结案页面
  335. t.zt = 'finish'
  336. // 判断所有纠纷进展是否都办结
  337. XmSingleDataService.getBeanByFormId(id, beanid).then((res) => {
  338. flowstatus = res.data.pageFormData.pageFieldInfos.find(
  339. (o) => o.name === 'STEP_NAME'
  340. )?.value
  341. if (!flowstatus) {
  342. flowstatus = res.data.pageFormData.pageFieldInfos.find(
  343. (o) => o.name === 'CURRENT_STATUS'
  344. )?.value
  345. }
  346. if (
  347. flowstatus === '已结束' ||
  348. flowstatus === '' ||
  349. flowstatus === undefined ||
  350. flowstatus === null
  351. ) {
  352. this.opennewja()
  353. } else {
  354. Modal.warning({
  355. title: '提示',
  356. content: '存在未发布的进展信息,无法结案',
  357. })
  358. }
  359. })
  360. } else {
  361. url = res1.data[2].props.detailUrl + '/' + res1.data[2].props.detailInstid
  362. url = url.replace('#/sd-webflow', '/law-progress-page')
  363. url = url + '?zt=' + zt + '&id=' + jfid // 打开结案页面
  364. this.open(url)
  365. }
  366. } else {
  367. if (jzurl !== '') {
  368. zt = 'progress'
  369. // 打开正在处理中的文档
  370. jzurl = jzurl.replace('#/sd-webflow', '/law-progress-page')
  371. url = jzurl + '?zt=' + zt + '&id=' + jfid // 打开登记页面
  372. } else {
  373. zt = 'regist'
  374. djurl = djurl.replace('#/sd-webflow', '/law-progress-page')
  375. url = djurl + '?zt=' + zt + '&id=' + jfid // 打开登记页面
  376. }
  377. this.open(url)
  378. }
  379. }
  380. })
  381. // })
  382. } else {
  383. // 案件 判断目前是 案件进展 案件结案 案件执行?
  384. const strcasetype = t.strcasetype // 进展1 否则结案2 执行3 执行结案4
  385. const { fieldInfos } = c
  386. let caseid = fieldInfos.find((f) => f.name === 'CASE_ID')?.value
  387. if (caseid === null || caseid === undefined || caseid === '') {
  388. caseid = fieldInfos.find((f) => f.name === 'id')?.value
  389. }
  390. LawService.getProgressData(caseid).then((res1) => {
  391. this.jdinfo = res1.data
  392. let parentid = ''
  393. // 打开列表页面
  394. if (appModuleId === '' || appModuleId === undefined) {
  395. // 打开查看页面 永远打开最后一个页面的
  396. this.openlastpage(res1.data, caseid)
  397. } else if (strcasetype === '1') {
  398. this.modaltitle = '案件进展阶段'
  399. // 判断进展数据是否有未办结的
  400. zt = 'jz'
  401. let flag = true // true 才新建案件进展,弹出选择树,否则展示进展页面
  402. let casesburl = ''
  403. let url = ''
  404. parentid = 'progress'
  405. if (res1.data.length > 1) {
  406. // 有案件登记
  407. const objsz = res1.data.filter((i) => i.props.stepType === 'progress')
  408. const obj = objsz.at(-1)
  409. if (obj && obj.id === res1.data.at(-1).id) {
  410. parentid = obj.id
  411. }
  412. if (
  413. obj &&
  414. obj.id === res1.data.at(-1).id &&
  415. obj.children &&
  416. obj.children.length > 0
  417. ) {
  418. const cobj = obj.children[obj.children.length - 1]
  419. if (cobj.children && cobj.children.length > 0) {
  420. if (cobj.children[cobj.children.length - 1].props.stepStatus === '0') {
  421. // 有案件登记并且未办结
  422. casesburl =
  423. cobj.children[cobj.children.length - 1].props.detailUrl +
  424. '/' +
  425. cobj.children[cobj.children.length - 1].props.detailInstid
  426. flag = false
  427. }
  428. }
  429. }
  430. }
  431. if (flag) {
  432. // 打开案件进展树新建页面
  433. t.id = caseid
  434. t.parentid = parentid
  435. // 获取案件类型
  436. const ini = setInterval(() => {
  437. if (this.treeData.length > 0 && this.treeData[0].children) {
  438. clearInterval(ini)
  439. const casetype = fieldInfos.find((f) => f.name === 'CASE_TYPE')?.value
  440. const objszc = this.treeData.length > 0 ? this.treeData[0]?.children : []
  441. const obj = objszc.find((i) => i.id === casetype)
  442. if (obj !== null && obj !== undefined) {
  443. this.ztreeData = [obj]
  444. this.treevisible = true
  445. }
  446. }
  447. }, 100)
  448. } else {
  449. // 展示信息
  450. // 打开正在处理中的文档
  451. casesburl = casesburl.replace('#/sd-webflow', '/case-progress-page')
  452. url = casesburl + '?id=' + caseid + '&zt=progress' // 打开登记页面
  453. this.open(url)
  454. }
  455. } else if (strcasetype === '3') {
  456. // 执行进展 3
  457. this.modaltitle = '执行进展阶段'
  458. let jxjzurl = ''
  459. let flag = true // 判断打开已办 还是新建
  460. const objsz = res1.data.filter((i) => i.props.stepType === 'execute')
  461. const obj = objsz.at(-1)
  462. parentid = 'execute'
  463. if (obj && obj.id === res1.data.at(-1).id) {
  464. parentid = obj.id
  465. }
  466. if (obj && obj.id === res1.data.at(-1).id && obj.children && obj.children.length > 0) {
  467. if (obj.children[obj.children.length - 1].props.stepStatus === '0') {
  468. // 有案件执行进展并且进展未办结
  469. jxjzurl =
  470. obj.children[obj.children.length - 1].props.detailUrl +
  471. '/' +
  472. obj.children[obj.children.length - 1].props.detailInstid
  473. flag = false
  474. } else {
  475. // 有纠纷登记且办结
  476. }
  477. parentid = obj.id
  478. // zt = obj.id
  479. }
  480. if (flag) {
  481. // 案件执行进展
  482. // 案件执行阶段获取
  483. t.id = caseid
  484. t.parentid = parentid
  485. t.zt = 'execute'
  486. this.Val = ''
  487. this.visible = true
  488. } else {
  489. // 打开正在处理中的文档
  490. jxjzurl = jxjzurl.replace('#/sd-webflow', '/case-progress-page')
  491. const url = jxjzurl + '?id=' + caseid + '&zt=execute' // 打开登记页面
  492. this.open(url)
  493. }
  494. } else {
  495. // 结案 案件结案 和执行结案 executeFinish
  496. if (strcasetype === '2') {
  497. t.zt = 'finish'
  498. } else {
  499. t.zt = 'executeFinish'
  500. beanid = 'onl:a19ea9fa44194e089af096fe243a9707'
  501. }
  502. t.id = caseid
  503. // 判断所有进展是否都办结
  504. // 判断所有执行进展是否都办结
  505. XmSingleDataService.getBeanByFormId(id, beanid).then((res) => {
  506. flowstatus = res.data.pageFormData.pageFieldInfos.find(
  507. (o) => o.name === 'STEP_NAME'
  508. )?.value
  509. if (!flowstatus) {
  510. flowstatus = res.data.pageFormData.pageFieldInfos.find(
  511. (o) => o.name === 'CURRENT_STATUS'
  512. )?.value
  513. }
  514. if (
  515. flowstatus === '已结束' ||
  516. flowstatus === '结束' ||
  517. flowstatus === '' ||
  518. flowstatus === undefined ||
  519. flowstatus === null
  520. ) {
  521. this.opennewja()
  522. } else {
  523. Modal.warning({
  524. title: '提示',
  525. content: '存在未发布的进展信息,无法结案',
  526. })
  527. }
  528. })
  529. }
  530. })
  531. }
  532. },
  533. ok() {
  534. const t = this.event
  535. let businessTypeId = ''
  536. if (this.Val !== '') {
  537. this.visible = false
  538. let url = ''
  539. if (this.strtype) {
  540. const obj = this.stage.find((o) => o.code === this.Val)
  541. businessTypeId = obj.businessTypeId.toString()
  542. XmSingleDataService.getTypeBusId(businessTypeId).then((res) => {
  543. businessTypeId = res.data[0].id
  544. url =
  545. t.comTaskLink +
  546. '/pages/draft/0?businessTypeId=' +
  547. businessTypeId +
  548. '&zt=' +
  549. t.zt +
  550. '&id=' +
  551. t.id +
  552. '&stage=' +
  553. this.Val +
  554. '&parentid=' +
  555. t.parentid
  556. this.open(url)
  557. })
  558. } else {
  559. const obj = this.zxstage.find((o) => o.code === this.Val)
  560. businessTypeId = obj.businessTypeId.toString()
  561. url =
  562. t.comTaskLink +
  563. '/pages/draft/0?businessTypeId=' +
  564. businessTypeId +
  565. '&zt=' +
  566. t.zt +
  567. '&id=' +
  568. t.id +
  569. '&stage=' +
  570. this.Val +
  571. '&parentid=' +
  572. t.parentid
  573. this.open(url)
  574. }
  575. } else {
  576. Modal.warning({
  577. title: '提示',
  578. content: '请选择阶段名称',
  579. })
  580. }
  581. },
  582. handleChange(e) {
  583. if (!this.Val) this.Val = e
  584. },
  585. treeok() {
  586. const t = this.event
  587. if (this.selectedNode.props.businessTypeId && this.selectedNode.props.businessTypeId !== '') {
  588. this.treevisible = false
  589. // 打开新建页面
  590. // 需要判断是否要增加二级节点
  591. const objsz = this.jdinfo.filter((i) => i.props.stepType === 'progress')
  592. const obj = objsz.at(-1)
  593. let parentid = t.parentid
  594. let ext = ''
  595. if (obj) {
  596. const zobj = obj.children.at(-1) // 最后一个节点是否是和当前的属于同一个类型
  597. if (obj.id === this.jdinfo.at(-1).id) {
  598. if (
  599. zobj &&
  600. this.selectedNode.props.parentCode === zobj.props.progressCode &&
  601. this.selectedNode.props.parentId === zobj.props.stagecode
  602. ) {
  603. ext = '&flag=1'
  604. parentid = zobj.id
  605. } else {
  606. parentid = obj.id
  607. }
  608. }
  609. }
  610. const businessTypeId = this.selectedNode.props.businessTypeId
  611. const url =
  612. '/case-progress-page/pages/draft/0?businessTypeId=' +
  613. businessTypeId +
  614. '&id=' +
  615. t.id +
  616. '&cs=' +
  617. this.selectedNode.props.parentId +
  618. '&stage=' +
  619. this.selectedNode.id +
  620. '&ct=' +
  621. this.selectedNode.props.parentCode +
  622. '&parentid=' +
  623. parentid +
  624. '&zt=progress' +
  625. ext
  626. this.open(url)
  627. } else {
  628. Modal.warning({
  629. title: '提示',
  630. content: '请选择程序名称',
  631. })
  632. return false
  633. }
  634. },
  635. transformData(data) {
  636. return data.map((d) => {
  637. const { children, ...rest } = d
  638. if (children && children.length > 0) {
  639. children.forEach((c) => {
  640. c.props.parentName = d.text
  641. if (c.children && c.children.length > 0) {
  642. c.children.forEach((cc) => {
  643. cc.props.parentCode = d.id
  644. })
  645. }
  646. // c.props.parentCode = d.props.parentCode ? d.props.parentCode : d.id
  647. })
  648. }
  649. return {
  650. ...rest,
  651. children: children && this.transformData(children),
  652. scopedSlots: { title: 'title' },
  653. }
  654. })
  655. },
  656. // 处理搜索用的dataList
  657. generateList(data) {
  658. for (let i = 0; i < data.length; i++) {
  659. const node = data[i]
  660. if (node.children) {
  661. if (node.children) {
  662. node.leaf = true
  663. }
  664. this.generateList(node.children)
  665. }
  666. }
  667. },
  668. onSelect(e, t) {
  669. this.selectedNode = t.node.dataRef
  670. },
  671. setSelectedKeys(e, t) {
  672. if (0 === e.length) return
  673. if (!this.$attrs['selected-keys']) this.selectedKeys = e
  674. },
  675. onLoadData(e) {
  676. if (e.dataRef.children) return Promise.resolve()
  677. let caseType = ''
  678. let caseStage = ''
  679. if (e.dataRef.props.parentId === 'root') {
  680. caseType = e.dataRef.id
  681. } else {
  682. caseType = e.dataRef.props.parentId
  683. caseStage = e.dataRef.id
  684. }
  685. return LawService.getCaseTree(caseType, caseStage).then((res) => {
  686. res.data.forEach((d) => {
  687. d.props.parentName = e.dataRef.text
  688. d.props.parentCode = e.dataRef.props.parentId
  689. })
  690. e.dataRef.children = res.data
  691. this.treeData = this.transformData([...this.treeData])
  692. this.generateList(this.treeData)
  693. })
  694. },
  695. opennewja() {
  696. const t = this.event
  697. const strtype = t.strtype === '1' // true纠纷 否则案件
  698. const strcasetype = t.strcasetype // 进展1 否则结案2 执行3 执行结案4
  699. let text = ''
  700. let confirm = ''
  701. if (strtype) {
  702. text = '纠纷'
  703. confirm = '结案后不可再编辑纠纷信息,是否确定结案?'
  704. } else {
  705. if (strcasetype === '2') {
  706. text = '案件'
  707. confirm = '结案后案件不可再继续添加阶段和程序信息,也不可编辑已发布信息'
  708. } else {
  709. text = '执行'
  710. confirm = '结案后不可再编辑案件执行信息,是否确定结案?'
  711. }
  712. }
  713. Modal.confirm({
  714. title: text + '结案',
  715. content: confirm,
  716. okText: '确定',
  717. onOk: () => {
  718. // const businessTypeId = t.businessTypeId
  719. // 模块表单id
  720. const appModuleId = t.appModuleId
  721. // 打开新建页面
  722. const extobj = { moduleId: appModuleId }
  723. const ext = qs.stringify('&extParams=' + extobj)
  724. XmSingleDataService.getTypeBusId(appModuleId).then((res) => {
  725. const businessTypeId = res.data[0].id
  726. const url =
  727. t.comTaskLink +
  728. '/pages/draft/0?businessTypeId=' +
  729. businessTypeId +
  730. ext +
  731. '&zt=' +
  732. t.zt +
  733. '&parentid=' +
  734. t.zt +
  735. '&id=' +
  736. t.id
  737. this.open(url)
  738. })
  739. },
  740. })
  741. },
  742. openlastpage(data, id) {
  743. const obj = data.at(-1)
  744. let url = ''
  745. if (obj.props.stepType === 'progress') {
  746. // 进展
  747. if (obj.children && obj.children.length > 0) {
  748. const zobj = obj.children.at(-1)
  749. if (zobj.props.detailUrl && zobj.props.detailUrl !== '') {
  750. url = this.fngetobjurl(zobj, id)
  751. } else {
  752. if (zobj.children && zobj.children.length > 0) {
  753. const zcobj = zobj.children.at(-1)
  754. if (zcobj.props.detailUrl && zcobj.props.detailUrl !== '') {
  755. url = this.fngetobjurl(zcobj, id)
  756. }
  757. }
  758. }
  759. }
  760. } else if (obj.props.stepType === 'execute') {
  761. if (obj.children && obj.children.length > 0) {
  762. const zobj = obj.children.at(-1)
  763. if (zobj.props.detailUrl && zobj.props.detailUrl !== '') {
  764. url = this.fngetobjurl(zobj, id)
  765. }
  766. }
  767. } else {
  768. if (obj.props.detailUrl && obj.props.detailUrl !== '') {
  769. url = this.fngetobjurl(obj, id)
  770. }
  771. }
  772. if (url === '') {
  773. url = this.fngetobjurl(data[0], id)
  774. }
  775. this.open(url)
  776. },
  777. fngetobjurl(obj, id) {
  778. let url = ''
  779. url = obj.props.detailUrl + '/' + obj.props.detailInstid
  780. const t = this.event
  781. const page = t.comTaskLink
  782. url = url.replace('#/sd-webflow', page)
  783. url = url + '?zt=' + obj.props.stepType + '&id=' + id // 打开结案页面
  784. return url
  785. },
  786. open(url) {
  787. const t = this.event
  788. const isNewWindow = t.newWindow === '1'
  789. const view = t.strjftype === 'view' || t.strcasetype === 'view'
  790. const query = {}
  791. if (view) {
  792. url = url + '&view=1'
  793. }
  794. const oRoute = router.resolve({
  795. path: url,
  796. query: {
  797. ...query,
  798. },
  799. })
  800. if (isNewWindow) {
  801. window.open(oRoute.href, '_blank')
  802. } else {
  803. router.push(oRoute.route.fullPath)
  804. }
  805. },
  806. },
  807. render: _render,
  808. staticRenderFns: staticRenderFns,
  809. }
  810. </script>
  811. <style module lang="scss">
  812. @use '@/common/design' as *;
  813. </style>