index.vue 32 KB

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