index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :exportList="exportList"
  6. :columnParsing="columnParsing"
  7. :optionsEvensGroup="optionsEvensGroup"
  8. :tableAttributes="tableAttributes"
  9. :tableEvents="tableEvents"
  10. :operation="operation()"
  11. >
  12. <div class="cartographer_big">
  13. <el-dialog title="配置" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
  14. <zj-page-container v-if="formBool">
  15. <zj-page-fill class="neibuview">
  16. <zj-form-container
  17. ref="formRef"
  18. :form-data="formData"
  19. :form-rules="formRules"
  20. :form-attributes="{ size: 'mini' }"
  21. >
  22. <zj-form-module title="评价信息" label-width="100px" :form-data="formData" :form-items="items" />
  23. <zj-form-module title="申诉信息" label-width="100px" :form-data="formData" :form-items="items2" />
  24. <zj-form-module
  25. v-if="[3, 4, 5].includes(formType)"
  26. title="中心审核信息"
  27. label-width="140px"
  28. :form-data="formData"
  29. :form-items="items3"
  30. />
  31. </zj-form-container>
  32. </zj-page-fill>
  33. <!-- 操作按钮 -->
  34. <div style="box-sizing: border-box; padding: 10px; text-align: right">
  35. <el-button size="mini" @click="handleClose">取 消</el-button>
  36. <el-button v-if="~[0, 1, 2].indexOf(formType)" size="mini" @click="formConfirm" type="primary"
  37. >确 定</el-button
  38. >
  39. <el-button v-if="~[3, 4].indexOf(formType)" size="mini" @click="quedingshenhe" type="primary"
  40. >确 定</el-button
  41. >
  42. </div>
  43. </zj-page-container>
  44. </el-dialog>
  45. </div>
  46. </template-page>
  47. </template>
  48. <script>
  49. import TemplatePage from '@/components/template/template-page-1.vue'
  50. import import_mixin from '@/components/template/import_mixin.js'
  51. import {
  52. appraiseApplyApplyList,
  53. appraiseApplyApplyListExport,
  54. appraiseApplyApplyDetail,
  55. appraiseApplyApplySubmit,
  56. appraiseApplyApplyConfirm,
  57. appraiseApplyBatchUpdateEnd,
  58. appraiseApplyBatchUpdateReset
  59. } from '@/api/appraisalStatement'
  60. import operation_mixin from '@/components/template/operation_mixin.js'
  61. import { required, requiredValueMin } from '@/components/template/rules_verify.js'
  62. import { orderBaseDetail } from '@/api/workOrderPool.js'
  63. import { EventBus } from '@/utils/eventBus'
  64. export default {
  65. components: { TemplatePage },
  66. mixins: [import_mixin, operation_mixin],
  67. data() {
  68. return {
  69. // 表格属性
  70. tableAttributes: {
  71. selectColumn: true
  72. },
  73. // 表格事件
  74. tableEvents: {
  75. 'selection-change': this.selectionChange
  76. },
  77. recordSelected: [],
  78. formBool: false,
  79. formType: 0, //0新增,1指定申诉,2二次申诉,3第一次审核信息部审核,4第二次审核结算组审核,5详情
  80. formData: {
  81. applyBy: '',
  82. applyTime: '',
  83. appraiseContent: '',
  84. appraiseStatus: '',
  85. categoryId: '',
  86. categoryName: '',
  87. examineResult: '',
  88. infoConfirmTime: '',
  89. isWebsitCall: '',
  90. items: [],
  91. orderBaseId: '',
  92. orderSmallType: '',
  93. orderSmallTypeText: '',
  94. orderType: '',
  95. overTime: '',
  96. parentCategoryId: '',
  97. parentCategoryName: '',
  98. reason: '',
  99. settleConfirmTime: '',
  100. websitId: '',
  101. websitName: '',
  102. websitResult: '',
  103. workerId: '',
  104. workerIdcard: '',
  105. workerMobile: '',
  106. workerName: '',
  107. workerNumber: '',
  108. workerResult: ''
  109. },
  110. formRules: {}
  111. }
  112. },
  113. computed: {
  114. optionsEvensGroup() {
  115. return [
  116. [
  117. [
  118. this.optionsEvensAuth('add', {
  119. click: () => {
  120. this.formType = 0
  121. this.formBool = true
  122. }
  123. })
  124. ],
  125. [
  126. this.optionsEvensAuth('dismissedWithoutAppeal', {
  127. click: () => {
  128. if (this.recordSelected.length === 0) {
  129. this.$message.warning('请勾选工单')
  130. return
  131. }
  132. appraiseApplyBatchUpdateEnd({ ids: this.recordSelected.map(item => item.id).join(',') }).then(res => {
  133. this.$message({ type: 'success', message: '成功!' })
  134. this.$refs.pageRef.refreshList()
  135. })
  136. }
  137. })
  138. ],
  139. [
  140. this.optionsEvensAuth('reappealDenied', {
  141. click: () => {
  142. if (this.recordSelected.length === 0) {
  143. this.$message.warning('请勾选工单')
  144. return
  145. }
  146. appraiseApplyBatchUpdateReset({ ids: this.recordSelected.map(item => item.id).join(',') }).then(res => {
  147. this.$message({ type: 'success', message: '成功!' })
  148. this.$refs.pageRef.refreshList()
  149. })
  150. }
  151. })
  152. ]
  153. ]
  154. ]
  155. },
  156. items() {
  157. return [
  158. ...(() => {
  159. if (this.formType == 0) {
  160. return [
  161. {
  162. name: 'el-input',
  163. md: 6,
  164. attributes: {
  165. disabled: false,
  166. placeholder: '请输入'
  167. },
  168. formItemAttributes: {
  169. label: '工单单号',
  170. prop: 'orderBaseId',
  171. rules: [...required]
  172. },
  173. slots: {
  174. append: (h, { props, onInput }) => {
  175. return (
  176. <el-button type="primary" onClick={this.fuzhigongdanneirong}>
  177. 确定
  178. </el-button>
  179. )
  180. }
  181. }
  182. }
  183. ]
  184. } else {
  185. return [
  186. {
  187. name: 'el-input',
  188. md: 6,
  189. attributes: {
  190. disabled: true,
  191. placeholder: '请输入'
  192. },
  193. formItemAttributes: {
  194. label: '工单单号',
  195. prop: 'orderBaseId',
  196. rules: [...required]
  197. }
  198. }
  199. ]
  200. }
  201. })(),
  202. {
  203. name: 'el-input',
  204. md: 6,
  205. attributes: {
  206. disabled: true,
  207. placeholder: '请输入'
  208. },
  209. formItemAttributes: {
  210. label: '工单类型',
  211. prop: 'orderSmallTypeText',
  212. rules: []
  213. }
  214. },
  215. {
  216. name: 'el-input',
  217. md: 6,
  218. attributes: {
  219. disabled: true,
  220. placeholder: '请输入'
  221. },
  222. formItemAttributes: {
  223. label: '客户姓名',
  224. prop: 'userName',
  225. rules: []
  226. }
  227. },
  228. {
  229. name: 'el-input',
  230. md: 6,
  231. attributes: {
  232. disabled: true,
  233. placeholder: '请输入'
  234. },
  235. formItemAttributes: {
  236. label: '联系电话',
  237. prop: 'userMobile',
  238. rules: []
  239. }
  240. },
  241. {
  242. name: 'el-input',
  243. md: 12,
  244. attributes: {
  245. disabled: true,
  246. placeholder: '请输入'
  247. },
  248. formItemAttributes: {
  249. label: '联系地址',
  250. prop: 'address',
  251. rules: []
  252. }
  253. },
  254. {
  255. name: 'el-input',
  256. md: 6,
  257. attributes: {
  258. disabled: true,
  259. placeholder: '请输入'
  260. },
  261. formItemAttributes: {
  262. label: '主要工程师',
  263. prop: 'workerName',
  264. rules: []
  265. }
  266. },
  267. {
  268. name: 'el-input',
  269. md: 6,
  270. attributes: {
  271. disabled: true,
  272. placeholder: '请输入'
  273. },
  274. formItemAttributes: {
  275. label: '完工时间',
  276. prop: 'overTime',
  277. rules: []
  278. }
  279. },
  280. {
  281. name: 'el-select',
  282. options: [
  283. { label: '默认好评', value: 'D' },
  284. { label: '好评', value: 'A' },
  285. { label: '中评', value: 'B' },
  286. { label: '差评', value: 'C' },
  287. { label: '未评价', value: 'N' },
  288. { label: '其他', value: 'O' }
  289. ],
  290. md: 6,
  291. attributes: { disabled: true, placeholder: '请选择', width: '100%' },
  292. formItemAttributes: { label: '评价类型', prop: 'appraiseStatus' }
  293. },
  294. {
  295. name: 'el-input',
  296. md: 18,
  297. attributes: {
  298. disabled: !!this?.formData?.id,
  299. placeholder: '请输入'
  300. },
  301. formItemAttributes: {
  302. label: '评价内容',
  303. prop: 'appraiseContent',
  304. rules: [...required]
  305. }
  306. }
  307. ]
  308. },
  309. items2() {
  310. return [
  311. {
  312. name: 'el-input',
  313. md: 6,
  314. attributes: {
  315. disabled: true,
  316. placeholder: '请输入'
  317. },
  318. formItemAttributes: {
  319. label: '所属网点',
  320. prop: 'websitName',
  321. rules: []
  322. }
  323. },
  324. {
  325. name: 'el-input',
  326. md: 6,
  327. attributes: {
  328. disabled: true,
  329. placeholder: '请输入'
  330. },
  331. formItemAttributes: {
  332. label: '申诉人',
  333. prop: 'applyBy',
  334. rules: []
  335. }
  336. },
  337. {
  338. name: 'el-input',
  339. md: 6,
  340. attributes: {
  341. disabled: true,
  342. placeholder: '请输入'
  343. },
  344. formItemAttributes: {
  345. label: '申诉时间',
  346. prop: 'applyTime',
  347. rules: []
  348. }
  349. },
  350. {
  351. name: 'el-input',
  352. md: 24,
  353. attributes: {
  354. disabled: false,
  355. type: 'textarea',
  356. rows: 3,
  357. placeholder: '请输入'
  358. },
  359. formItemAttributes: {
  360. label: '申诉理由',
  361. prop: 'reason',
  362. rules: [...required]
  363. }
  364. },
  365. {
  366. name: 'el-input',
  367. md: 24,
  368. attributes: {
  369. disabled: false,
  370. type: 'textarea',
  371. rows: 3,
  372. placeholder: '请输入'
  373. },
  374. formItemAttributes: {
  375. label: '申诉备注',
  376. prop: '',
  377. rules: []
  378. }
  379. }
  380. ]
  381. },
  382. items3() {
  383. return [
  384. {
  385. name: 'el-input',
  386. md: 6,
  387. attributes: {
  388. disabled: true,
  389. placeholder: '请输入'
  390. },
  391. formItemAttributes: {
  392. label: '问题大类',
  393. prop: 'parentCategoryId',
  394. rules: [...required]
  395. }
  396. },
  397. {
  398. name: 'el-input',
  399. md: 6,
  400. attributes: {
  401. disabled: true,
  402. placeholder: '请输入'
  403. },
  404. formItemAttributes: {
  405. label: '问题小类',
  406. prop: 'categoryId',
  407. rules: [...required]
  408. }
  409. },
  410. {
  411. name: 'el-input',
  412. md: 6,
  413. attributes: {
  414. disabled: true,
  415. placeholder: '请输入'
  416. },
  417. formItemAttributes: {
  418. label: '审核人',
  419. prop: 'confirmBy',
  420. rules: []
  421. }
  422. },
  423. ...(() => {
  424. if (this.formData.isSecond) {
  425. return [
  426. {
  427. name: 'el-input',
  428. md: 6,
  429. attributes: {
  430. disabled: true,
  431. placeholder: '请输入'
  432. },
  433. formItemAttributes: {
  434. label: '审核时间',
  435. prop: 'settleConfirmTime',
  436. rules: []
  437. }
  438. }
  439. ]
  440. } else {
  441. return [
  442. {
  443. name: 'el-input',
  444. md: 6,
  445. attributes: {
  446. disabled: true,
  447. placeholder: '请输入'
  448. },
  449. formItemAttributes: {
  450. label: '审核时间',
  451. prop: 'infoConfirmTime',
  452. rules: []
  453. }
  454. }
  455. ]
  456. }
  457. })(),
  458. {
  459. md: 24,
  460. isShow: true,
  461. name: 'el-radio',
  462. options: [
  463. { label: '是', value: true },
  464. { label: '否', value: false }
  465. ],
  466. attributes: {},
  467. formItemAttributes: {
  468. label: '网点是否指引用户接听400回访电话',
  469. prop: 'isWebsitCall',
  470. rules: [...required]
  471. }
  472. },
  473. {
  474. md: 24,
  475. isShow: true,
  476. name: 'el-radio',
  477. options: [
  478. { label: '无责', value: 'NOT' },
  479. { label: '全责', value: 'ALL' },
  480. { label: '半责', value: 'HALF' }
  481. ],
  482. attributes: {},
  483. formItemAttributes: {
  484. label: '判定网点',
  485. prop: 'websitResult',
  486. rules: [...required]
  487. }
  488. },
  489. {
  490. md: 24,
  491. isShow: true,
  492. name: 'el-radio',
  493. options: [
  494. { label: '无责', value: 'NOT' },
  495. { label: '全责', value: 'ALL' },
  496. { label: '半责', value: 'HALF' }
  497. ],
  498. attributes: {},
  499. formItemAttributes: {
  500. label: '判定服务人员',
  501. prop: 'workerResult',
  502. rules: [...required]
  503. }
  504. },
  505. {
  506. name: 'el-input',
  507. md: 24,
  508. attributes: {
  509. disabled: false,
  510. type: 'textarea',
  511. rows: 3,
  512. placeholder: '请输入'
  513. },
  514. formItemAttributes: {
  515. label: '审核备注',
  516. prop: 'examineResult',
  517. rules: [...required]
  518. }
  519. }
  520. ]
  521. }
  522. },
  523. created() {
  524. if (this.pageType == 'zhidingshenshu') {
  525. this.formData.orderBaseId = this.pageCode
  526. this.fuzhigongdanneirong()
  527. this.formType = 1
  528. this.formBool = true
  529. }
  530. },
  531. methods: {
  532. fuzhigongdanneirong() {
  533. if (!this.formData.orderBaseId) {
  534. return
  535. }
  536. orderBaseDetail({
  537. orderBaseId: this.formData.orderBaseId
  538. }).then(res => {
  539. var {
  540. orderSmallType,
  541. orderSmallTypeText,
  542. orderType,
  543. orderTypeText,
  544. websitId,
  545. websitName,
  546. workerId,
  547. workerIdcard,
  548. workerMobile,
  549. workerName,
  550. workerNumber,
  551. userName,
  552. address,
  553. userMobile,
  554. overTime,
  555. appraiseStatus,
  556. appraiseContent
  557. } = res.data
  558. Object.assign(this.formData, {
  559. orderSmallType,
  560. orderSmallTypeText,
  561. orderType,
  562. orderTypeText,
  563. websitId,
  564. websitName,
  565. workerId,
  566. workerIdcard,
  567. workerMobile,
  568. workerName,
  569. workerNumber,
  570. userName,
  571. address,
  572. userMobile,
  573. overTime,
  574. appraiseStatus,
  575. appraiseContent
  576. })
  577. })
  578. },
  579. // 列表请求函数
  580. getList: appraiseApplyApplyList,
  581. // 导出
  582. exportList: appraiseApplyApplyListExport,
  583. // 表格列解析渲染数据更改
  584. columnParsing(item, defaultData) {
  585. return defaultData
  586. },
  587. // 获取勾选框数据
  588. selectionChange(data) {
  589. this.recordSelected = data
  590. },
  591. handleClose() {
  592. if (this.pageType == 'zhidingshenshu') {
  593. EventBus.$emit('closeSelectedTag_wb')
  594. } else {
  595. this.$refs?.pageRef?.refreshList()
  596. this.$data.formData = this.$options.data().formData
  597. this.formType = 0
  598. this.formBool = false
  599. }
  600. },
  601. formConfirm() {
  602. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  603. if (valid) {
  604. appraiseApplyApplySubmit(this.formData).then(res => {
  605. this.$message({ type: 'success', message: '成功!' })
  606. if (this.pageType == 'zhidingshenshu') {
  607. // EventBus.$emit('closeSelectedTag_wb')
  608. this.$router.push({
  609. name: 'appraisalStatement'
  610. })
  611. } else {
  612. this.$refs.pageRef.refreshList()
  613. this.handleClose()
  614. }
  615. })
  616. }
  617. })
  618. },
  619. quedingshenhe() {
  620. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  621. if (valid) {
  622. appraiseApplyApplyConfirm(this.formData).then(res => {
  623. this.$message({ type: 'success', message: '成功!' })
  624. this.$refs.pageRef.refreshList()
  625. this.handleClose()
  626. })
  627. }
  628. })
  629. },
  630. operation() {
  631. return this.operationBtn({
  632. // 详情
  633. details: {
  634. click: ({ row, index, column }) => {
  635. appraiseApplyApplyDetail({
  636. id: row.id
  637. }).then(res => {
  638. this.formData = { ...res.data }
  639. this.$nextTick(() => {
  640. this.formType = 5
  641. this.formBool = true
  642. })
  643. })
  644. }
  645. },
  646. // 二次申诉
  647. secondStatement: {
  648. conditions: ({ row, index, column }) => {
  649. return row.isSecond == false && row.websitResult == 'All' && row.status == 'OK'
  650. },
  651. click: ({ row, index, column }) => {
  652. appraiseApplyApplyDetail({
  653. id: row.id
  654. }).then(res => {
  655. this.formData = { ...res.data }
  656. this.$nextTick(() => {
  657. this.formType = 2
  658. this.formBool = true
  659. })
  660. })
  661. }
  662. },
  663. // 信息部审核
  664. InfoDepartmentAudit: {
  665. conditions: ({ row, index, column }) => {
  666. return row.isSecond == false && row.status == 'OK'
  667. },
  668. click: ({ row, index, column }) => {
  669. appraiseApplyApplyDetail({
  670. id: row.id
  671. }).then(res => {
  672. this.formData = { ...res.data }
  673. this.$nextTick(() => {
  674. this.formType = 3
  675. this.formBool = true
  676. })
  677. })
  678. }
  679. },
  680. // 结算组审核
  681. clearingSectionAudit: {
  682. conditions: ({ row, index, column }) => {
  683. return true
  684. },
  685. click: ({ row, index, column }) => {
  686. appraiseApplyApplyDetail({
  687. id: row.id
  688. }).then(res => {
  689. this.formData = { ...res.data }
  690. this.$nextTick(() => {
  691. this.formType = 4
  692. this.formBool = true
  693. })
  694. })
  695. }
  696. }
  697. })
  698. }
  699. }
  700. }
  701. </script>
  702. <style lang="scss" scoped>
  703. .neibuview {
  704. box-sizing: border-box;
  705. padding-left: 16px;
  706. ::v-deep & > .zj-page-fill-scroll {
  707. box-sizing: border-box;
  708. padding-right: 16px;
  709. & > div:nth-child(1) {
  710. margin-top: 20px;
  711. }
  712. }
  713. }
  714. </style>