index.vue 34 KB

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