index.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  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. v-if="!!item.examineStatus"
  41. :key="`${index}2`"
  42. :title="`中心审核${index + 1}`"
  43. label-width="100px"
  44. :form-data="item"
  45. :form-items="formItems2"
  46. >
  47. </zj-form-module>
  48. </template>
  49. </template>
  50. </zj-form-container>
  51. <zj-form-container
  52. v-if="formDialog && [1, 2].includes(openType)"
  53. ref="formRef1"
  54. :form-data="formData1"
  55. :form-attributes="{ size: 'mini' }"
  56. >
  57. <zj-form-module title="网点审核" label-width="100px" :form-data="formData1" :form-items="formItems1">
  58. </zj-form-module>
  59. </zj-form-container>
  60. <zj-form-container
  61. v-if="formDialog && [2].includes(openType)"
  62. ref="formRef2"
  63. :form-data="formData2"
  64. :form-attributes="{ size: 'mini' }"
  65. >
  66. <zj-form-module title="中心审核" label-width="100px" :form-data="formData2" :form-items="formItems2">
  67. </zj-form-module>
  68. </zj-form-container>
  69. </div>
  70. </zj-page-fill>
  71. <div style="text-align: right; box-sizing: border-box; padding: 16px 20px">
  72. <el-button size="mini" @click="handleClose">取消</el-button>
  73. <el-button v-if="openType == 0" size="mini" type="primary" @click="save()">保存</el-button>
  74. <el-button v-if="openType == 0" size="mini" type="primary" @click="save('SEND')">发送</el-button>
  75. <el-button v-if="openType == 1" size="mini" type="primary" @click="networkAudit">网点申诉</el-button>
  76. <el-button v-if="openType == 2" size="mini" type="primary" @click="centralAudit">中心审核</el-button>
  77. </div>
  78. </zj-page-container>
  79. </el-dialog>
  80. </div>
  81. </template-page>
  82. </template>
  83. <script>
  84. import TemplatePage from '@/components/template/template-page-1.vue'
  85. import import_mixin from '@/components/template/import_mixin.js'
  86. import operation_mixin from '@/components/template/operation_mixin.js'
  87. import {
  88. letterProcessList,
  89. letterProcessListExport,
  90. letterProcessDetailLetter,
  91. letterProcessAddLetter,
  92. letterProcessUpdateLetter,
  93. letterProcessDelLetter,
  94. letterProcessAppeal, // 网点申诉
  95. letterProcessCancel, // 作废
  96. letterProcessExamine, // 中心批复
  97. letterProcessReject, // 驳回
  98. letterProcessSend // 发送
  99. } from '@/api/workContactLetterPage.js'
  100. import { required } from '@/components/template/rules_verify.js'
  101. import { getWebsit } from '@/api/customerManagement.js'
  102. import { letterManagerListProject } from '@/api/assessmentItemSetting.js'
  103. import { listPageV2 } from '@/api/workOrder/orderType'
  104. import { getClassifyList } from '@/api/goods'
  105. import { orderBaseDetail } from '@/api/workOrderPool.js'
  106. import { letterManagerListUser } from '@/api/department.js'
  107. import ImageUpload from '@/components/file-upload'
  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: '此单是今日下发联络函,请贵司自接到联络函起3天内系统提交申诉,逾期未申诉默认网点无异议。',
  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: null,
  174. appealUrl: [],
  175. createBy: null,
  176. createTime: null,
  177. examineFration: 0,
  178. examineName: null,
  179. examinePrice: 0,
  180. examineRemark: null,
  181. examineStatus: null,
  182. examineTime: null,
  183. leLetterId: null,
  184. leLetterItemId: null,
  185. websitAppeal: null
  186. },
  187. formData2: {
  188. appealRemark: null,
  189. appealUrl: null,
  190. createBy: null,
  191. createTime: null,
  192. examineFration: 0,
  193. examineName: null,
  194. examinePrice: 0,
  195. examineRemark: null,
  196. examineStatus: null,
  197. examineTime: null,
  198. leLetterId: null,
  199. leLetterItemId: null,
  200. websitAppeal: null
  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. 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: this.openType == -1 ? true : ['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. var { value } = props
  790. return (
  791. <div>
  792. <ImageUpload fileList={value} limit={100} isEdit={this.openType == 1} />
  793. </div>
  794. )
  795. }
  796. }
  797. ]
  798. },
  799. formItems2() {
  800. return [
  801. {
  802. name: 'el-radio',
  803. options: [
  804. { label: '通过', value: 'OK' },
  805. { label: '驳回', value: 'FAIL' },
  806. { label: '减免', value: 'SUB' }
  807. ],
  808. md: 24,
  809. attributes: {
  810. disabled: [-1].includes(this.openType),
  811. placeholder: '请输入'
  812. },
  813. formItemAttributes: {
  814. label: '审核结果',
  815. prop: 'examineStatus',
  816. rules: [...required]
  817. },
  818. events: {
  819. change: val => {
  820. if (val == 'OK') {
  821. this.formData2.examinePrice = 0
  822. this.formData2.examineFration = 0
  823. } else if (val == 'FAIL') {
  824. this.formData2.examinePrice = this.formData.price
  825. this.formData2.examineFration = this.formData.fraction
  826. } else if (val == 'SUB') {
  827. this.formData2.examinePrice = ''
  828. this.formData2.examineFration = ''
  829. }
  830. }
  831. }
  832. },
  833. {
  834. md: 6,
  835. name: 'el-input',
  836. attributes: {
  837. disabled: [-1].includes(this.openType) || ['OK', 'FAIL'].includes(this.formData2.examineStatus)
  838. },
  839. formItemAttributes: {
  840. label: '审批金额',
  841. prop: 'examinePrice',
  842. rules: [...required]
  843. }
  844. },
  845. {
  846. md: 6,
  847. name: 'el-input',
  848. attributes: {
  849. disabled: [-1].includes(this.openType) || ['OK', 'FAIL'].includes(this.formData2.examineStatus)
  850. },
  851. formItemAttributes: {
  852. label: '审批分数',
  853. prop: 'examineFration',
  854. rules: [...required]
  855. }
  856. },
  857. {
  858. isShow: this.userData.type != 0,
  859. md: 6,
  860. name: 'el-input',
  861. attributes: {
  862. disabled: true
  863. },
  864. formItemAttributes: {
  865. label: '审批人',
  866. prop: 'examineName',
  867. rules: []
  868. }
  869. },
  870. {
  871. md: 6,
  872. name: 'el-input',
  873. attributes: {
  874. disabled: true
  875. },
  876. formItemAttributes: {
  877. label: '审批时间',
  878. prop: 'createTime',
  879. rules: []
  880. }
  881. },
  882. {
  883. md: 24,
  884. name: 'el-input',
  885. attributes: {
  886. disabled: [-1].includes(this.openType),
  887. type: 'textarea',
  888. rows: 3
  889. },
  890. formItemAttributes: {
  891. label: '审批内容',
  892. prop: 'examineRemark',
  893. rules: [...required]
  894. }
  895. }
  896. ]
  897. }
  898. },
  899. created() {
  900. if (this.$route?.query?.orderBaseId) {
  901. const loading = this.$loading({
  902. lock: true,
  903. text: '正在前往创建工作联络函页面......',
  904. spinner: 'el-icon-loading',
  905. background: 'rgba(0, 0, 0, 0.7)'
  906. })
  907. this.openForm(() => {
  908. this.formData.orderId = this.$route?.query?.orderBaseId
  909. orderBaseDetail({
  910. orderBaseId: this.$route?.query?.orderBaseId,
  911. returnErr: true
  912. })
  913. .then(res => {
  914. loading.close()
  915. if (res.data.orderProducts.length == 1) {
  916. this.formData.mainId = res.data.orderProducts?.[0]?.mainId || ''
  917. this.formData.mainName = res.data.orderProducts?.[0]?.mainName || ''
  918. }
  919. this.formData.orderSmallType = res.data?.orderSmallType || ''
  920. this.formData.orderSmallTypeText = res.data?.orderSmallTypeText || ''
  921. this.formData.orderCreateTime = res.data?.createTime || ''
  922. this.formData.websitId = res.data?.websitId || ''
  923. this.formData.websitName = res.data?.websitName || ''
  924. })
  925. .catch(err => {
  926. this.formData.mainId = ''
  927. this.formData.mainName = ''
  928. this.formData.orderSmallType = ''
  929. this.formData.orderSmallTypeText = ''
  930. this.formData.orderCreateTime = ''
  931. this.formData.websitId = ''
  932. this.formData.websitName = ''
  933. })
  934. })
  935. }
  936. },
  937. methods: {
  938. // 列表请求函数
  939. getList(p, cb) {
  940. var pam = JSON.parse(JSON.stringify(p))
  941. try {
  942. if (pam.status) {
  943. pam.params.push({ param: 'a.status', compare: '=', value: pam.status })
  944. }
  945. cb && cb(pam)
  946. return letterProcessList(pam)
  947. } catch (e) {
  948. console.log(e)
  949. }
  950. },
  951. // 列表导出函数
  952. exportList: letterProcessListExport,
  953. // 列表字段解析渲染数据更改
  954. fieldBeansHook(data) {
  955. return data.filter(item => {
  956. return this.userData.type == 0 ? !['create_by', 'examine_name'].includes(item.colName) : true
  957. })
  958. },
  959. // 表格列解析渲染数据更改
  960. columnParsing(item, defaultData) {
  961. return defaultData
  962. },
  963. // 监听勾选变化
  964. selectionChange(data) {
  965. this.recordSelected = data
  966. },
  967. // 打开创建弹窗
  968. openForm(cb) {
  969. Promise.all([
  970. getWebsit({ status: true }),
  971. letterManagerListUser({
  972. pageNum: 1,
  973. pageSize: -1,
  974. params: [
  975. {
  976. param: 'a.user_name',
  977. compare: '=',
  978. value: JSON.parse(localStorage.getItem('greemall_user'))?.userName
  979. }
  980. ]
  981. }),
  982. letterManagerListProject({
  983. pageNum: 1,
  984. pageSize: -1,
  985. params: [{ param: 'a.status', compare: '=', value: 'ON' }]
  986. }),
  987. listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.status', compare: '=', value: 'true' }] }),
  988. getClassifyList({ type: 2, status: true })
  989. ]).then(([res2, res3, res4, res5, res6]) => {
  990. this.openType = 0
  991. this.websitList = res2.data
  992. this.managerList = res3.data.records
  993. if (this.managerList.length == 1) {
  994. this.formData.dapartmentId = this.managerList?.[0]?.id
  995. this.formData.dapartment = this.managerList?.[0]?.dapartment
  996. }
  997. this.managerListProject = res4.data.records
  998. this.orderSmallTypeData = res5.data.records.map(item => ({
  999. value: item.id,
  1000. label: item.orderSmallTypeText
  1001. }))
  1002. this.classifyList = res6.data.map(item => {
  1003. var { children, ...data } = item
  1004. return {
  1005. ...data
  1006. }
  1007. })
  1008. cb?.()
  1009. this.formDialog = true
  1010. })
  1011. },
  1012. // 打开详情弹窗
  1013. openDetailForm(row) {
  1014. Promise.all([
  1015. letterProcessDetailLetter({ id: row.leLetterId }),
  1016. getWebsit({ status: true }),
  1017. letterManagerListUser({
  1018. pageNum: 1,
  1019. pageSize: -1,
  1020. params: [
  1021. {
  1022. param: 'a.user_name',
  1023. compare: '=',
  1024. value: JSON.parse(localStorage.getItem('greemall_user'))?.userName
  1025. }
  1026. ]
  1027. }),
  1028. letterManagerListProject({
  1029. pageNum: 1,
  1030. pageSize: -1,
  1031. params: [{ param: 'a.status', compare: '=', value: 'ON' }]
  1032. }),
  1033. listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.status', compare: '=', value: 'true' }] }),
  1034. getClassifyList({ type: 2, status: true })
  1035. ]).then(([res1, res2, res3, res4, res5, res6]) => {
  1036. this.formData = {
  1037. ...res1.data,
  1038. fileUrl: res1.data.fileUrl ? res1.data.fileUrl.split(',').map(url => ({ url })) : []
  1039. }
  1040. // 中心审批时需要把申述数据转换到formData1
  1041. if (this.openType == 2 && res1.data.leLetterItems?.[0]) {
  1042. this.formData1 = {
  1043. ...res1.data.leLetterItems?.[0],
  1044. appealUrl: res1.data.leLetterItems?.[0]?.appealUrl
  1045. ? res1.data.leLetterItems?.[0]?.appealUrl.split(',').map(url => ({ url }))
  1046. : []
  1047. }
  1048. }
  1049. // 查看详情数据转换
  1050. if (this.openType == -1) {
  1051. this.formData = {
  1052. ...this.formData,
  1053. leLetterItems: this.formData.leLetterItems
  1054. ? this.formData.leLetterItems.map(item => {
  1055. return {
  1056. ...item,
  1057. appealUrl: item?.appealUrl ? item?.appealUrl.split(',').map(url => ({ url })) : []
  1058. }
  1059. })
  1060. : []
  1061. }
  1062. }
  1063. this.websitList = res2.data
  1064. this.managerList = res3.data.records
  1065. this.managerListProject = res4.data.records
  1066. this.orderSmallTypeData = res5.data.records.map(item => ({
  1067. value: item.id,
  1068. label: item.orderSmallTypeText
  1069. }))
  1070. this.classifyList = res6.data.map(item => {
  1071. var { children, ...data } = item
  1072. return {
  1073. ...data
  1074. }
  1075. })
  1076. this.formDialog = true
  1077. })
  1078. },
  1079. handleClose() {
  1080. this.$refs?.formRef?.resetFields()
  1081. this.$data.formData = this.$options.data().formData
  1082. this.$data.formData1 = this.$options.data().formData1
  1083. this.$data.formData2 = this.$options.data().formData2
  1084. this.formDialog = false
  1085. this.openType = 0
  1086. },
  1087. // 操作按钮
  1088. operation() {
  1089. return this.operationBtn({
  1090. details: {
  1091. click: ({ row, index, column }) => {
  1092. this.openType = -1
  1093. this.openDetailForm(row)
  1094. }
  1095. },
  1096. edit: {
  1097. conditions: ({ row, index, column }) => {
  1098. return row.status === 'WAIT'
  1099. },
  1100. click: ({ row, index, column }) => {
  1101. this.openType = 0
  1102. this.openDetailForm(row)
  1103. }
  1104. },
  1105. networkAppeal: {
  1106. conditions: ({ row, index, column }) => {
  1107. return row.status === 'SEND'
  1108. },
  1109. click: ({ row, index, column }) => {
  1110. this.openType = 1
  1111. this.openDetailForm(row)
  1112. }
  1113. },
  1114. centralRebatch: {
  1115. conditions: ({ row, index, column }) => {
  1116. return row.status === 'WAIT_EXAMINE'
  1117. },
  1118. click: ({ row, index, column }) => {
  1119. this.openType = 2
  1120. this.openDetailForm(row)
  1121. }
  1122. }
  1123. // del: {
  1124. // conditions: ({ row, index, column }) => {
  1125. // return true
  1126. // },
  1127. // prompt: '确定删除?',
  1128. // click: ({ row, index, column }) => {
  1129. // letterProcessDelLetter({
  1130. // id: row.id
  1131. // })
  1132. // .then(res => {
  1133. // this.$refs.pageRef.refreshList()
  1134. // this.$message({
  1135. // type: 'success',
  1136. // message: `删除成功!`
  1137. // })
  1138. // })
  1139. // .catch(err => {
  1140. // console.log(err)
  1141. // })
  1142. // }
  1143. // }
  1144. })
  1145. },
  1146. // 保存
  1147. save(status) {
  1148. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  1149. if (valid) {
  1150. ;(this.formData?.leLetterId ? letterProcessUpdateLetter : letterProcessAddLetter)({
  1151. ...this.formData,
  1152. status: status || this.formData.status,
  1153. fileUrl: this.formData.fileUrl.length ? this.formData.fileUrl.map(item => item.url).join(',') : ''
  1154. }).then(res => {
  1155. this.$message({
  1156. type: 'success',
  1157. message: '保存成功'
  1158. })
  1159. this.handleClose()
  1160. this.$refs.pageRef.refreshList()
  1161. })
  1162. }
  1163. })
  1164. },
  1165. networkAudit() {
  1166. this.$refs.formRef1.validate((valid, invalidFields, errLabels) => {
  1167. if (valid) {
  1168. letterProcessAppeal({
  1169. ...this.formData1,
  1170. appealUrl: this.formData1.appealUrl.length ? this.formData1.appealUrl.map(item => item.url).join(',') : '',
  1171. leLetterId: this.formData?.leLetterId
  1172. }).then(res => {
  1173. this.$message({
  1174. type: 'success',
  1175. message: '审核成功'
  1176. })
  1177. this.handleClose()
  1178. this.$refs.pageRef.refreshList()
  1179. })
  1180. }
  1181. })
  1182. },
  1183. centralAudit() {
  1184. this.$refs.formRef2.validate((valid, invalidFields, errLabels) => {
  1185. if (valid) {
  1186. letterProcessExamine({
  1187. ...this.formData2,
  1188. leLetterItemId: this.formData.leLetterItems?.[0]?.leLetterItemId,
  1189. leLetterId: this.formData?.leLetterId
  1190. }).then(res => {
  1191. this.$message({
  1192. type: 'success',
  1193. message: '审核成功'
  1194. })
  1195. this.handleClose()
  1196. this.$refs.pageRef.refreshList()
  1197. })
  1198. }
  1199. })
  1200. }
  1201. }
  1202. }
  1203. </script>
  1204. <style lang="scss" scoped></style>