index.vue 33 KB

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