index.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  1. <template>
  2. <template-page
  3. v-if="pageShow"
  4. ref="pageRef"
  5. :get-list="getList"
  6. :exportList="exportList"
  7. :table-attributes="tableAttributes"
  8. :table-events="tableEvents"
  9. :options-evens-group="optionsEvensGroup"
  10. :moreParameters="moreParameters"
  11. :column-parsing="columnParsing"
  12. :operation="operation()"
  13. key="pageType"
  14. >
  15. <div class="cartographer_big">
  16. <el-dialog title="工作联络函" width="100%" :modal="false" :visible.sync="formDialog" :before-close="handleClose">
  17. <zj-page-container>
  18. <zj-page-fill>
  19. <div style="box-sizing: border-box; padding: 20px 20px 0 20px">
  20. <zj-form-container
  21. v-if="formDialog"
  22. ref="formRef"
  23. :form-data="formData"
  24. :form-attributes="{ size: 'mini' }"
  25. >
  26. <zj-form-module title="基本信息" label-width="100px" :form-data="formData" :form-items="formItems">
  27. </zj-form-module>
  28. <template v-if="[-1].includes(openType) && formData.leLetterItems && formData.leLetterItems.length">
  29. <template v-for="(item, index) in formData.leLetterItems">
  30. <zj-form-module
  31. :key="`${index}1`"
  32. :title="`网点审核${index + 1}`"
  33. label-width="100px"
  34. :form-data="item"
  35. :form-items="formItems1"
  36. >
  37. </zj-form-module>
  38. <zj-form-module
  39. :key="`${index}2`"
  40. :title="`中心审核${index + 1}`"
  41. label-width="100px"
  42. :form-data="item"
  43. :form-items="formItems2"
  44. >
  45. </zj-form-module>
  46. </template>
  47. </template>
  48. </zj-form-container>
  49. <zj-form-container
  50. v-if="formDialog && [1, 2].includes(openType)"
  51. ref="formRef1"
  52. :form-data="formData1"
  53. :form-attributes="{ size: 'mini' }"
  54. >
  55. <zj-form-module title="网点审核" label-width="100px" :form-data="formData1" :form-items="formItems1">
  56. </zj-form-module>
  57. </zj-form-container>
  58. <zj-form-container
  59. v-if="formDialog && [2].includes(openType)"
  60. ref="formRef2"
  61. :form-data="formData2"
  62. :form-attributes="{ size: 'mini' }"
  63. >
  64. <zj-form-module title="中心审核" label-width="100px" :form-data="formData2" :form-items="formItems2">
  65. </zj-form-module>
  66. </zj-form-container>
  67. </div>
  68. </zj-page-fill>
  69. <div style="text-align: right; box-sizing: border-box; padding: 16px 20px">
  70. <el-button size="mini" @click="handleClose">取消</el-button>
  71. <el-button v-if="openType == 0" size="mini" type="primary" @click="save">保存</el-button>
  72. <el-button v-if="openType == 1" size="mini" type="primary" @click="networkAudit">网点审核</el-button>
  73. <el-button v-if="openType == 2" size="mini" type="primary" @click="centralAudit">中心审核</el-button>
  74. </div>
  75. </zj-page-container>
  76. </el-dialog>
  77. </div>
  78. </template-page>
  79. </template>
  80. <script>
  81. import TemplatePage from '@/components/template/template-page-1.vue'
  82. import import_mixin from '@/components/template/import_mixin.js'
  83. import operation_mixin from '@/components/template/operation_mixin.js'
  84. import {
  85. letterProcessList,
  86. letterProcessListExport,
  87. letterProcessDetailLetter,
  88. letterProcessAddLetter,
  89. letterProcessUpdateLetter,
  90. letterProcessDelLetter,
  91. letterProcessAppeal, // 网点申诉
  92. letterProcessCancel, // 作废
  93. letterProcessExamine, // 中心批复
  94. letterProcessReject, // 驳回
  95. letterProcessSend // 发送
  96. } from '@/api/workContactLetterPage.js'
  97. import { required } from '@/components/template/rules_verify.js'
  98. import { getWebsit } from '@/api/customerManagement.js'
  99. import { letterManagerList } from '@/api/departmentSetting.js'
  100. import { letterManagerListProject } from '@/api/assessmentItemSetting.js'
  101. import { listPageV2 } from '@/api/workOrder/orderType'
  102. import { getClassifyList } from '@/api/goods'
  103. import ImageUpload from '@/components/file-upload'
  104. import { orderBaseDetail } from '@/api/workOrderPool.js'
  105. export default {
  106. components: { TemplatePage, ImageUpload },
  107. mixins: [import_mixin, operation_mixin],
  108. data() {
  109. return {
  110. pageType: 'list',
  111. pageShow: true,
  112. // 表格属性
  113. tableAttributes: {
  114. // 启用勾选列
  115. selectColumn: true
  116. },
  117. // 表格事件
  118. tableEvents: {
  119. 'selection-change': this.selectionChange
  120. },
  121. // 勾选选中行
  122. recordSelected: [],
  123. /** 表单变量 */
  124. formDialog: false,
  125. formData: {
  126. belongCompany: '',
  127. belongCompanyCode: '',
  128. companyWechatId: '',
  129. companyWechatName: '',
  130. context: '',
  131. dapartment: '',
  132. dapartmentId: '',
  133. examineFration: 0,
  134. examineName: '',
  135. examinePrice: 0,
  136. examineStatus: '',
  137. examineTime: '',
  138. fraction: 0,
  139. leLetterId: '',
  140. leLetterItems: [],
  141. letteWebsitNum: 0,
  142. letterNum: 0,
  143. letterNumber: '',
  144. mainId: '',
  145. mainName: '',
  146. orderCreateTime: '',
  147. orderId: '',
  148. orderSmallType: '',
  149. orderSmallTypeText: '',
  150. price: 0,
  151. projectId: '',
  152. projectName: '',
  153. projectReg: '',
  154. projectText: '',
  155. remark: '',
  156. sendTime: '',
  157. status: '',
  158. type: '',
  159. websitId: '',
  160. websitName: '',
  161. fileUrl: []
  162. },
  163. websitList: [],
  164. managerList: [],
  165. managerListProject: [],
  166. orderSmallTypeData: [],
  167. classifyList: [],
  168. openType: 0,
  169. formData1: {
  170. appealRemark: '',
  171. appealUrl: [],
  172. createBy: '',
  173. createTime: '',
  174. examineFration: 0,
  175. examineName: '',
  176. examinePrice: 0,
  177. examineRemark: '',
  178. examineStatus: '',
  179. examineTime: '',
  180. leLetterId: '',
  181. leLetterItemId: '',
  182. websitAppeal: ''
  183. },
  184. formData2: {
  185. appealRemark: '',
  186. appealUrl: '',
  187. createBy: '',
  188. createTime: '',
  189. examineFration: 0,
  190. examineName: '',
  191. examinePrice: 0,
  192. examineRemark: '',
  193. examineStatus: '',
  194. examineTime: '',
  195. leLetterId: '',
  196. leLetterItemId: '',
  197. websitAppeal: ''
  198. }
  199. }
  200. },
  201. computed: {
  202. // 事件组合
  203. optionsEvensGroup() {
  204. return [
  205. [
  206. [
  207. this.optionsEvensAuth('add', {
  208. click: this.openForm
  209. })
  210. ]
  211. ],
  212. [
  213. [
  214. this.optionsEvensAuth('void', {
  215. click: () => {
  216. if (this.recordSelected.length === 0) {
  217. this.$message.warning('请勾选数据')
  218. return
  219. }
  220. this.$confirm(' 是否继续?', '提示', {
  221. confirmButtonText: '确定',
  222. cancelButtonText: '取消',
  223. type: 'warning'
  224. })
  225. .then(() => {
  226. letterProcessCancel({
  227. ids: this.recordSelected.map(item => item.id)
  228. })
  229. .then(res => {
  230. this.$refs?.pageRef?.refreshList()
  231. this.recordSelected = []
  232. this.$message({
  233. message: '操作成功',
  234. type: 'success'
  235. })
  236. })
  237. .catch(err => {
  238. this.$message.error('操作失败')
  239. })
  240. })
  241. .catch(() => {})
  242. }
  243. })
  244. ]
  245. ],
  246. [
  247. [
  248. this.optionsEvensAuth('send', {
  249. click: () => {
  250. if (this.recordSelected.length === 0) {
  251. this.$message.warning('请勾选数据')
  252. return
  253. }
  254. this.$confirm(' 是否继续?', '提示', {
  255. confirmButtonText: '确定',
  256. cancelButtonText: '取消',
  257. type: 'warning'
  258. })
  259. .then(() => {
  260. letterProcessSend({
  261. ids: this.recordSelected.map(item => item.id)
  262. })
  263. .then(res => {
  264. this.$refs?.pageRef?.refreshList()
  265. this.recordSelected = []
  266. this.$message({
  267. message: '操作成功',
  268. type: 'success'
  269. })
  270. })
  271. .catch(err => {
  272. this.$message.error('操作失败')
  273. })
  274. })
  275. .catch(() => {})
  276. }
  277. })
  278. ]
  279. ],
  280. [
  281. [
  282. this.optionsEvensAuth('oneCaseRejected', {
  283. click: () => {
  284. if (this.recordSelected.length === 0) {
  285. this.$message.warning('请勾选数据')
  286. return
  287. }
  288. this.$confirm(' 是否继续?', '提示', {
  289. confirmButtonText: '确定',
  290. cancelButtonText: '取消',
  291. type: 'warning'
  292. })
  293. .then(() => {
  294. letterProcessReject({
  295. ids: this.recordSelected.map(item => item.id)
  296. })
  297. .then(res => {
  298. this.$refs?.pageRef?.refreshList()
  299. this.recordSelected = []
  300. this.$message({
  301. message: '操作成功',
  302. type: 'success'
  303. })
  304. })
  305. .catch(err => {
  306. this.$message.error('操作失败')
  307. })
  308. })
  309. .catch(() => {})
  310. }
  311. })
  312. ]
  313. ]
  314. ]
  315. },
  316. // 更多参数
  317. moreParameters() {
  318. return []
  319. },
  320. formItems() {
  321. return [
  322. {
  323. md: 6,
  324. name: 'el-input',
  325. attributes: {
  326. disabled: true
  327. },
  328. formItemAttributes: {
  329. label: '联络函编号',
  330. prop: 'letterNumber',
  331. rules: []
  332. }
  333. },
  334. {
  335. md: 6,
  336. name: 'el-input',
  337. attributes: {
  338. disabled: true
  339. },
  340. formItemAttributes: {
  341. label: '下发时间',
  342. prop: 'sendTime',
  343. rules: []
  344. }
  345. },
  346. {
  347. name: 'el-radio',
  348. options: [
  349. { label: '考核函', value: '考核函' },
  350. { label: '奖励函', value: '奖励函' },
  351. { label: '整改函', value: '整改函' }
  352. ],
  353. md: 6,
  354. attributes: {
  355. disabled: this.openType != 0,
  356. placeholder: '请输入'
  357. },
  358. formItemAttributes: {
  359. label: '函件类型',
  360. prop: 'type',
  361. rules: [...required]
  362. }
  363. },
  364. {
  365. name: 'el-select',
  366. options: this.managerList.map(item => ({
  367. data: item,
  368. label: item.dapartment,
  369. value: item.id
  370. })),
  371. echoInsertion: true,
  372. md: 6,
  373. attributes: {
  374. disabled: this.openType != 0,
  375. placeholder: '请选择',
  376. clearable: true,
  377. filterable: true
  378. },
  379. formItemAttributes: {
  380. label: '来源科室',
  381. prop: 'dapartmentId',
  382. propName: 'dapartment',
  383. rules: [...required]
  384. },
  385. events: {
  386. change: val => {
  387. if (val) {
  388. this.formData.dapartment = this.managerList?.find(item => item.id === val)?.dapartment
  389. } else {
  390. this.formData.dapartment = ''
  391. }
  392. }
  393. }
  394. },
  395. {
  396. md: 6,
  397. name: 'el-input',
  398. attributes: {
  399. disabled: this.openType != 0
  400. },
  401. formItemAttributes: {
  402. label: '工单编号',
  403. prop: 'orderId',
  404. rules: [...required]
  405. },
  406. events: {
  407. input: val => {
  408. if (val) {
  409. orderBaseDetail({
  410. orderBaseId: val,
  411. returnErr: true
  412. })
  413. .then(res => {
  414. if (res.data.orderProducts.length == 1) {
  415. this.formData.mainId = res.data.orderProducts?.[0]?.mainId || ''
  416. this.formData.mainName = res.data.orderProducts?.[0]?.mainName || ''
  417. }
  418. this.formData.orderSmallType = res.data?.orderSmallType || ''
  419. this.formData.orderSmallTypeText = res.data?.orderSmallTypeText || ''
  420. this.formData.orderCreateTime = res.data?.createTime || ''
  421. })
  422. .catch(err => {
  423. this.formData.mainId = ''
  424. this.formData.mainName = ''
  425. this.formData.orderSmallType = ''
  426. this.formData.orderSmallTypeText = ''
  427. this.formData.orderCreateTime = ''
  428. })
  429. }
  430. }
  431. }
  432. },
  433. {
  434. name: 'el-select',
  435. options: this.classifyList.map(item => ({
  436. data: item,
  437. label: item.name,
  438. value: item.categoryId
  439. })),
  440. echoInsertion: true,
  441. md: 6,
  442. attributes: {
  443. disabled: this.openType != 0,
  444. placeholder: '请选择',
  445. clearable: true,
  446. filterable: true
  447. },
  448. formItemAttributes: {
  449. label: '产品大类',
  450. prop: 'mainId',
  451. propName: 'mainName',
  452. rules: [...required]
  453. },
  454. events: {
  455. change: val => {
  456. if (val) {
  457. this.formData.mainName = this.classifyList?.find(item => item.categoryId === val)?.name
  458. } else {
  459. this.formData.mainName = ''
  460. }
  461. }
  462. }
  463. },
  464. {
  465. name: 'el-select',
  466. md: 6,
  467. options: this.orderSmallTypeData,
  468. attributes: {
  469. disabled: this.openType != 0,
  470. placeholder: '请选择',
  471. clearable: true,
  472. filterable: true
  473. },
  474. formItemAttributes: {
  475. label: '工单类型',
  476. prop: 'orderSmallType',
  477. rules: [...required]
  478. },
  479. events: {
  480. change: val => {
  481. if (val) {
  482. this.orderInfo.orderSmallTypeText = this.orderSmallTypeData.find(item => item.value == val).label
  483. } else {
  484. this.orderInfo.orderSmallTypeText = ''
  485. }
  486. }
  487. }
  488. },
  489. {
  490. md: 6,
  491. name: 'el-date-picker',
  492. attributes: {
  493. disabled: this.openType != 0,
  494. style: { width: '100%' },
  495. type: 'datetime',
  496. 'value-format': 'yyyy-MM-dd HH:mm:ss'
  497. },
  498. formItemAttributes: {
  499. label: '工单创建日期',
  500. prop: 'orderCreateTime',
  501. rules: []
  502. }
  503. },
  504. {
  505. name: 'el-select',
  506. options: this.websitList.map(item => ({
  507. data: item,
  508. label: item.name,
  509. value: item.websitId
  510. })),
  511. echoInsertion: true,
  512. md: 12,
  513. attributes: {
  514. disabled: this.openType != 0,
  515. placeholder: '请选择',
  516. clearable: true,
  517. filterable: true
  518. },
  519. formItemAttributes: {
  520. label: '接收网点',
  521. prop: 'websitId',
  522. propName: 'websitName',
  523. rules: [...required]
  524. },
  525. events: {
  526. change: val => {
  527. if (val) {
  528. this.formData.websitName = this.websitList?.find(item => item.websitId === val)?.name
  529. } else {
  530. this.formData.websitName = ''
  531. }
  532. }
  533. }
  534. },
  535. {
  536. name: 'el-select',
  537. options: this.managerListProject.map(item => ({
  538. data: item,
  539. label: item.projectName,
  540. value: item.projectId
  541. })),
  542. echoInsertion: true,
  543. md: 12,
  544. attributes: {
  545. disabled: this.openType != 0,
  546. placeholder: '请选择',
  547. clearable: true,
  548. filterable: true
  549. },
  550. formItemAttributes: {
  551. label: '考核项目',
  552. prop: 'projectId',
  553. propName: 'projectName',
  554. rules: [...required]
  555. },
  556. events: {
  557. change: val => {
  558. if (val) {
  559. var data = this.managerListProject?.find(item => item.projectId === val)
  560. this.formData.projectName = data?.projectName
  561. this.formData.projectReg = data?.projectReg || ''
  562. this.formData.projectText = data?.projectText || ''
  563. this.formData.price = data?.price || ''
  564. this.formData.fraction = data?.fraction || ''
  565. } else {
  566. this.formData.projectReg = ''
  567. this.formData.projectText = ''
  568. this.formData.price = ''
  569. this.formData.fraction = ''
  570. this.formData.projectName = ''
  571. }
  572. }
  573. }
  574. },
  575. {
  576. md: 12,
  577. name: 'el-input',
  578. attributes: {
  579. disabled: true
  580. },
  581. formItemAttributes: {
  582. label: '考核条例',
  583. prop: 'projectReg',
  584. rules: [...required]
  585. }
  586. },
  587. {
  588. md: 24,
  589. name: 'el-input',
  590. attributes: {
  591. disabled: true,
  592. type: 'textarea',
  593. rows: 3
  594. },
  595. formItemAttributes: {
  596. label: '考核规定',
  597. prop: 'projectText',
  598. rules: [...required]
  599. }
  600. },
  601. {
  602. md: 6,
  603. name: 'el-input',
  604. attributes: {
  605. disabled: true
  606. },
  607. formItemAttributes: {
  608. label: '考核金额',
  609. prop: 'price',
  610. rules: [...required]
  611. }
  612. },
  613. {
  614. md: 6,
  615. name: 'el-input',
  616. attributes: {
  617. disabled: true
  618. },
  619. formItemAttributes: {
  620. label: '考核分数',
  621. prop: 'fraction',
  622. rules: [...required]
  623. }
  624. },
  625. {
  626. md: 24,
  627. name: 'el-input',
  628. attributes: {
  629. disabled: this.openType != 0,
  630. type: 'textarea',
  631. rows: 3
  632. },
  633. formItemAttributes: {
  634. label: '函件内容',
  635. prop: 'context',
  636. rules: [...required]
  637. }
  638. },
  639. {
  640. md: 24,
  641. name: 'el-input',
  642. attributes: {
  643. disabled: this.openType != 0,
  644. type: 'textarea',
  645. rows: 3
  646. },
  647. formItemAttributes: {
  648. label: '备注',
  649. prop: 'remark',
  650. rules: []
  651. }
  652. },
  653. {
  654. md: 24,
  655. isShow: true,
  656. name: 'slot-component',
  657. formItemAttributes: {
  658. label: '附件',
  659. prop: 'fileUrl',
  660. rules: []
  661. },
  662. render: (h, { props, onInput }) => {
  663. return (
  664. <div>
  665. <ImageUpload fileList={this.formData.fileUrl} limit={1} isEdit={this.openType == 0} />
  666. </div>
  667. )
  668. }
  669. }
  670. ]
  671. },
  672. formItems1() {
  673. return [
  674. {
  675. name: 'el-radio',
  676. options: [
  677. { label: '接受', value: 'OK' },
  678. { label: '申诉', value: 'AP' }
  679. ],
  680. md: 8,
  681. attributes: {
  682. disabled: [-1, 2].includes(this.openType),
  683. placeholder: '请输入'
  684. },
  685. formItemAttributes: {
  686. label: '核实结果',
  687. prop: 'websitAppeal',
  688. rules: [...required]
  689. }
  690. },
  691. {
  692. md: 8,
  693. name: 'el-input',
  694. attributes: {
  695. disabled: true
  696. },
  697. formItemAttributes: {
  698. label: '申诉人',
  699. prop: 'createBy',
  700. rules: []
  701. }
  702. },
  703. {
  704. md: 8,
  705. name: 'el-input',
  706. attributes: {
  707. disabled: true
  708. },
  709. formItemAttributes: {
  710. label: '申诉时间',
  711. prop: 'createTime',
  712. rules: []
  713. }
  714. },
  715. {
  716. md: 24,
  717. name: 'el-input',
  718. attributes: {
  719. disabled: [-1, 2].includes(this.openType),
  720. type: 'textarea',
  721. rows: 3
  722. },
  723. formItemAttributes: {
  724. label: '申诉内容',
  725. prop: 'appealRemark',
  726. rules: [...required]
  727. }
  728. },
  729. {
  730. md: 24,
  731. name: 'slot-component',
  732. formItemAttributes: {
  733. label: '申诉附件',
  734. prop: 'appealUrl',
  735. rules: []
  736. },
  737. render: (h, { props, onInput }) => {
  738. return (
  739. <div>
  740. <ImageUpload fileList={this.formData1.appealUrl} limit={1} isEdit={this.openType == 1} />
  741. </div>
  742. )
  743. }
  744. }
  745. ]
  746. },
  747. formItems2() {
  748. return [
  749. {
  750. name: 'el-radio',
  751. options: [
  752. { label: '通过', value: 'OK' },
  753. { label: '驳回', value: 'FAIL' },
  754. { label: '减免', value: 'SUB' }
  755. ],
  756. md: 24,
  757. attributes: {
  758. disabled: [-1].includes(this.openType),
  759. placeholder: '请输入'
  760. },
  761. formItemAttributes: {
  762. label: '审核结果',
  763. prop: 'examineStatus',
  764. rules: [...required]
  765. }
  766. },
  767. {
  768. md: 6,
  769. name: 'el-input',
  770. attributes: {
  771. disabled: [-1].includes(this.openType)
  772. },
  773. formItemAttributes: {
  774. label: '审批金额',
  775. prop: 'examinePrice',
  776. rules: [...required]
  777. }
  778. },
  779. {
  780. md: 6,
  781. name: 'el-input',
  782. attributes: {
  783. disabled: [-1].includes(this.openType)
  784. },
  785. formItemAttributes: {
  786. label: '审批分数',
  787. prop: 'examineFration',
  788. rules: [...required]
  789. }
  790. },
  791. {
  792. md: 6,
  793. name: 'el-input',
  794. attributes: {
  795. disabled: true
  796. },
  797. formItemAttributes: {
  798. label: '审批人',
  799. prop: 'examineName',
  800. rules: []
  801. }
  802. },
  803. {
  804. md: 6,
  805. name: 'el-input',
  806. attributes: {
  807. disabled: true
  808. },
  809. formItemAttributes: {
  810. label: '审批时间',
  811. prop: 'createTime',
  812. rules: []
  813. }
  814. },
  815. {
  816. md: 24,
  817. name: 'el-input',
  818. attributes: {
  819. disabled: [-1].includes(this.openType),
  820. type: 'textarea',
  821. rows: 3
  822. },
  823. formItemAttributes: {
  824. label: '审批内容',
  825. prop: 'examineRemark',
  826. rules: [...required]
  827. }
  828. }
  829. ]
  830. }
  831. },
  832. methods: {
  833. // 列表请求函数
  834. getList: letterProcessList,
  835. // 列表导出函数
  836. exportList: letterProcessListExport,
  837. // 表格列解析渲染数据更改
  838. columnParsing(item, defaultData) {
  839. return defaultData
  840. },
  841. // 监听勾选变化
  842. selectionChange(data) {
  843. this.recordSelected = data
  844. },
  845. // 打开创建弹窗
  846. openForm() {
  847. Promise.all([
  848. getWebsit({ status: true }),
  849. letterManagerList({ pageNum: 1, pageSize: -1, params: [] }),
  850. letterManagerListProject({ pageNum: 1, pageSize: -1, params: [] }),
  851. listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.status', compare: '=', value: 'true' }] }),
  852. getClassifyList({ type: 2, status: true })
  853. ]).then(([res2, res3, res4, res5, res6]) => {
  854. this.openType = 0
  855. this.websitList = res2.data
  856. this.managerList = res3.data.records
  857. this.managerListProject = res4.data.records
  858. this.orderSmallTypeData = res5.data.records.map(item => ({
  859. value: item.id,
  860. label: item.orderSmallTypeText
  861. }))
  862. this.classifyList = res6.data.map(item => {
  863. var { children, ...data } = item
  864. return {
  865. ...data
  866. }
  867. })
  868. this.formDialog = true
  869. })
  870. },
  871. // 打开详情弹窗
  872. openDetailForm(row) {
  873. Promise.all([
  874. letterProcessDetailLetter({ id: row.leLetterId }),
  875. getWebsit({ status: true }),
  876. letterManagerList({ pageNum: 1, pageSize: -1, params: [] }),
  877. letterManagerListProject({ pageNum: 1, pageSize: -1, params: [] }),
  878. listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.status', compare: '=', value: 'true' }] }),
  879. getClassifyList({ type: 2, status: true })
  880. ]).then(([res1, res2, res3, res4, res5, res6]) => {
  881. this.formData = {
  882. ...res1.data,
  883. fileUrl: res1.data.fileUrl ? res1.data.fileUrl.split(',') : []
  884. }
  885. // 中心审批时需要把申述数据转换到formData1
  886. if (this.openType == 2 && res1.data.leLetterItems?.[0]) {
  887. this.formData1 = {
  888. ...res1.data.leLetterItems?.[0],
  889. appealUrl: res1.data.leLetterItems?.[0]?.appealUrl ? res1.data.leLetterItems?.[0]?.appealUrl.split(',') : []
  890. }
  891. }
  892. // 查看详情数据转换
  893. if (this.openType == -1) {
  894. this.formData = {
  895. ...this.formData,
  896. leLetterItems: this.formData.leLetterItems
  897. ? this.formData.leLetterItems.map(item => {
  898. return {
  899. ...item,
  900. appealUrl: item?.appealUrl ? item?.appealUrl.split(',') : []
  901. }
  902. })
  903. : []
  904. }
  905. }
  906. this.websitList = res2.data
  907. this.managerList = res3.data.records
  908. this.managerListProject = res4.data.records
  909. this.orderSmallTypeData = res5.data.records.map(item => ({
  910. value: item.id,
  911. label: item.orderSmallTypeText
  912. }))
  913. this.classifyList = res6.data.map(item => {
  914. var { children, ...data } = item
  915. return {
  916. ...data
  917. }
  918. })
  919. this.formDialog = true
  920. })
  921. },
  922. handleClose() {
  923. this.$refs?.formRef?.resetFields()
  924. this.$data.formData = this.$options.data().formData
  925. this.$data.formData1 = this.$options.data().formData1
  926. this.$data.formData2 = this.$options.data().formData2
  927. this.formDialog = false
  928. this.openType = 0
  929. },
  930. // 操作按钮
  931. operation() {
  932. return this.operationBtn({
  933. details: {
  934. click: ({ row, index, column }) => {
  935. this.openType = -1
  936. this.openDetailForm(row)
  937. }
  938. },
  939. edit: {
  940. conditions: ({ row, index, column }) => {
  941. return row.status === 'WAIT'
  942. },
  943. click: ({ row, index, column }) => {
  944. this.openType = 0
  945. this.openDetailForm(row)
  946. }
  947. },
  948. networkAppeal: {
  949. conditions: ({ row, index, column }) => {
  950. return row.status === 'SEND'
  951. },
  952. click: ({ row, index, column }) => {
  953. this.openType = 1
  954. this.openDetailForm(row)
  955. }
  956. },
  957. centralRebatch: {
  958. conditions: ({ row, index, column }) => {
  959. return row.status === 'WAIT_EXAMINE'
  960. },
  961. click: ({ row, index, column }) => {
  962. this.openType = 2
  963. this.openDetailForm(row)
  964. }
  965. }
  966. // del: {
  967. // conditions: ({ row, index, column }) => {
  968. // return true
  969. // },
  970. // prompt: '确定删除?',
  971. // click: ({ row, index, column }) => {
  972. // letterProcessDelLetter({
  973. // id: row.id
  974. // })
  975. // .then(res => {
  976. // this.$refs.pageRef.refreshList()
  977. // this.$message({
  978. // type: 'success',
  979. // message: `删除成功!`
  980. // })
  981. // })
  982. // .catch(err => {
  983. // console.log(err)
  984. // })
  985. // }
  986. // }
  987. })
  988. },
  989. // 保存
  990. save() {
  991. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  992. if (valid) {
  993. ;(this.formData?.leLetterId ? letterProcessUpdateLetter : letterProcessAddLetter)({
  994. ...this.formData,
  995. fileUrl: this.formData.fileUrl.length ? this.formData.fileUrl.map(item => item.url).join(',') : ''
  996. }).then(res => {
  997. this.$message({
  998. type: 'success',
  999. message: '保存成功'
  1000. })
  1001. this.handleClose()
  1002. this.$refs.pageRef.refreshList()
  1003. })
  1004. }
  1005. })
  1006. },
  1007. networkAudit() {
  1008. this.$refs.formRef1.validate((valid, invalidFields, errLabels) => {
  1009. if (valid) {
  1010. letterProcessAppeal({
  1011. ...this.formData1,
  1012. appealUrl: this.formData1.appealUrl.length ? this.formData1.appealUrl.map(item => item.url).join(',') : '',
  1013. leLetterId: this.formData?.leLetterId
  1014. }).then(res => {
  1015. this.$message({
  1016. type: 'success',
  1017. message: '审核成功'
  1018. })
  1019. this.handleClose()
  1020. this.$refs.pageRef.refreshList()
  1021. })
  1022. }
  1023. })
  1024. },
  1025. centralAudit() {
  1026. this.$refs.formRef2.validate((valid, invalidFields, errLabels) => {
  1027. if (valid) {
  1028. letterProcessExamine({
  1029. ...this.formData2,
  1030. leLetterItemId: this.formData.leLetterItems?.[0]?.leLetterItemId,
  1031. leLetterId: this.formData?.leLetterId
  1032. }).then(res => {
  1033. this.$message({
  1034. type: 'success',
  1035. message: '审核成功'
  1036. })
  1037. this.handleClose()
  1038. this.$refs.pageRef.refreshList()
  1039. })
  1040. }
  1041. })
  1042. }
  1043. }
  1044. }
  1045. </script>
  1046. <style lang="scss" scoped></style>