index.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  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="140px" :form-data="formData" :form-items="items" />
  23. <zj-form-module
  24. v-if="~[2].indexOf(formType) || (~[3].indexOf(formType) && formData.confirmBy)"
  25. title="中心审批信息"
  26. label-width="140px"
  27. :form-data="formData"
  28. :form-items="items2"
  29. />
  30. </zj-form-container>
  31. </zj-page-fill>
  32. <!-- 操作按钮 -->
  33. <div style="box-sizing: border-box; padding: 10px; text-align: right">
  34. <el-button size="mini" @click="handleClose">取 消</el-button>
  35. <el-button
  36. v-if="~[0, 1].indexOf(formType) && !formData.id"
  37. size="mini"
  38. @click="formConfirm('SAVE')"
  39. type="primary"
  40. >保 存</el-button
  41. >
  42. <el-button v-if="~[0, 1].indexOf(formType)" size="mini" @click="formConfirm('WAIT')" type="primary"
  43. >提 交</el-button
  44. >
  45. <el-button v-if="~[2].indexOf(formType)" size="mini" @click="formConfirmShenHe" type="primary"
  46. >确定</el-button
  47. >
  48. </div>
  49. </zj-page-container>
  50. </el-dialog>
  51. </div>
  52. </template-page>
  53. </template>
  54. <script>
  55. import TemplatePage from '@/components/template/template-page-1.vue'
  56. import import_mixin from '@/components/template/import_mixin.js'
  57. import operation_mixin from '@/components/template/operation_mixin.js'
  58. import ImageUpload from '@/components/file-upload'
  59. import { required, mobileRequired } from '@/components/template/rules_verify.js'
  60. import {
  61. qualityFeedbackList,
  62. qualityFeedbackListExport,
  63. qualityFeedbackDetail,
  64. qualityFeedbackAdd,
  65. qualityFeedbackUpdate,
  66. qualityFeedbackConfirm,
  67. qualityFeedbackCount,
  68. qualityFeedbackUpdateUpload
  69. } from '@/api/qualityFeedback'
  70. import { lbsAmapRegion } from '@/api/common.js'
  71. import { getClassifyList } from '@/api/goods'
  72. import { getWebsit } from '@/api/customerManagement.js'
  73. export default {
  74. components: { TemplatePage, ImageUpload },
  75. mixins: [import_mixin, operation_mixin],
  76. data() {
  77. return {
  78. // 表格属性
  79. tableAttributes: {
  80. selectColumn: true
  81. },
  82. // 表格事件
  83. tableEvents: {
  84. 'selection-change': this.selectionChange
  85. },
  86. recordSelected: [],
  87. formBool: false,
  88. formType: 0,
  89. formData: {
  90. address: '',
  91. area: '',
  92. areaId: '',
  93. bugPartCode: '',
  94. bugPartName: '',
  95. bugRemark: '',
  96. city: '',
  97. cityId: '',
  98. companyWechatId: '',
  99. companyWechatName: '',
  100. confirmBy: '',
  101. confirmTime: '',
  102. createBy: '',
  103. createTime: '',
  104. customerMobile: '',
  105. customerName: '',
  106. insideCode: '',
  107. isNeedPlan: true,
  108. isPartSend: true,
  109. isSalesBefore: true,
  110. isUpload: true,
  111. items: [],
  112. mainId: '',
  113. mainName: '',
  114. num: '',
  115. orderNo: '',
  116. outCode: '',
  117. outDate: '',
  118. productName: '',
  119. province: '',
  120. provinceId: '',
  121. remark: '',
  122. repairDate: '',
  123. seriesName: '',
  124. smallId: '',
  125. smallName: '',
  126. status: '',
  127. street: '',
  128. streetId: '',
  129. submitBy: '',
  130. submitTime: '',
  131. supplyDate: '',
  132. title: '',
  133. useDate: '',
  134. websitAnalyse: '',
  135. websitHandleMethod: '',
  136. websitId: '',
  137. websitName: '',
  138. workerMobie: '',
  139. workerName: '',
  140. fujian: [],
  141. neijitiaoma: [],
  142. waijitiaoma: [],
  143. qita: []
  144. },
  145. formRules: {},
  146. provinceList: [],
  147. cityList: [],
  148. areaList: [],
  149. streetList: [],
  150. classifyList: [],
  151. classifyListLv2: [],
  152. createWebsitList: []
  153. }
  154. },
  155. computed: {
  156. optionsEvensGroup() {
  157. return [
  158. [
  159. [
  160. this.optionsEvensAuth('add', {
  161. click: () => {
  162. this.getinitlbslist()
  163. this.getClassifyListData()
  164. this.formType = 0
  165. this.formBool = true
  166. }
  167. })
  168. ]
  169. ],
  170. [
  171. [
  172. this.optionsEvensAuth('recordedAtHeadquarters', {
  173. click: () => {
  174. if (this.recordSelected.length === 0) {
  175. this.$message.warning('请勾选数据')
  176. return
  177. }
  178. qualityFeedbackUpdateUpload({
  179. ids: this.recordSelected.map(item => item.id).join(',')
  180. }).then(res => {
  181. this.$message({
  182. type: 'success',
  183. message: '操作成功!'
  184. })
  185. this.$refs?.pageRef?.refreshList()
  186. })
  187. }
  188. })
  189. ]
  190. ]
  191. ]
  192. },
  193. items() {
  194. return [
  195. {
  196. name: 'el-input',
  197. md: 18,
  198. attributes: {
  199. disabled: [2, 3].includes(this.formType),
  200. placeholder: '请输入'
  201. },
  202. formItemAttributes: {
  203. label: '反馈主题',
  204. prop: 'title',
  205. rules: [...required]
  206. }
  207. },
  208. {
  209. md: 6,
  210. name: 'el-radio',
  211. options: [
  212. { label: '是', value: true },
  213. { label: '否', value: false }
  214. ],
  215. attributes: {
  216. disabled: [2, 3].includes(this.formType)
  217. },
  218. formItemAttributes: {
  219. label: '是否售前机',
  220. prop: 'isSalesBefore'
  221. }
  222. },
  223. {
  224. name: 'el-select',
  225. md: 12,
  226. options: this.createWebsitList.map(item => ({ ...item, label: `(${item.value})${item.label}` })),
  227. attributes: {
  228. disabled: [1, 2, 3].includes(this.formType),
  229. placeholder: '请选择',
  230. clearable: true,
  231. filterable: true
  232. },
  233. formItemAttributes: {
  234. label: '反馈网点',
  235. prop: 'websitId',
  236. rules: [...required]
  237. },
  238. events: {
  239. change: val => {
  240. this.formData.websitName = this.createWebsitList.find(item => item.value == val).label || ''
  241. }
  242. }
  243. },
  244. {
  245. name: 'el-input',
  246. md: 6,
  247. attributes: {
  248. disabled: true,
  249. placeholder: '请输入'
  250. },
  251. formItemAttributes: {
  252. label: '反馈时间',
  253. prop: 'submitTime'
  254. }
  255. },
  256. {
  257. name: 'el-input',
  258. md: 6,
  259. attributes: {
  260. disabled: [2, 3].includes(this.formType),
  261. placeholder: '请输入'
  262. },
  263. formItemAttributes: {
  264. label: '云售后4.0单号',
  265. prop: 'orderNo',
  266. rules: [...required]
  267. }
  268. },
  269. {
  270. name: 'el-input',
  271. md: 6,
  272. attributes: {
  273. disabled: [2, 3].includes(this.formType),
  274. placeholder: '请输入'
  275. },
  276. formItemAttributes: {
  277. label: '工程师名称',
  278. prop: 'workerName',
  279. rules: [...required]
  280. }
  281. },
  282. {
  283. name: 'el-input',
  284. md: 6,
  285. attributes: {
  286. disabled: [2, 3].includes(this.formType),
  287. placeholder: '请输入'
  288. },
  289. formItemAttributes: {
  290. label: '工程师电话',
  291. prop: 'workerMobie',
  292. rules: [...mobileRequired]
  293. }
  294. },
  295. {
  296. name: 'el-input',
  297. md: 6,
  298. attributes: {
  299. disabled: [2, 3].includes(this.formType),
  300. placeholder: '请输入'
  301. },
  302. formItemAttributes: {
  303. label: '客户名称',
  304. prop: 'customerName',
  305. rules: [...required]
  306. }
  307. },
  308. {
  309. name: 'el-input',
  310. md: 6,
  311. attributes: {
  312. disabled: [2, 3].includes(this.formType),
  313. placeholder: '请输入'
  314. },
  315. formItemAttributes: {
  316. label: '客户电话',
  317. prop: 'customerMobile',
  318. rules: [...mobileRequired]
  319. }
  320. },
  321. {
  322. name: 'el-select',
  323. md: 6,
  324. formItemAttributes: {
  325. label: '省',
  326. prop: 'provinceId',
  327. rules: [...required]
  328. },
  329. options: this.provinceList.map((v, i) => ({ value: v.id, label: v.name })),
  330. attributes: {
  331. disabled: [2, 3].includes(this.formType),
  332. clearable: true,
  333. filterable: true,
  334. placeholder: '请选择'
  335. },
  336. events: {
  337. change: val => {
  338. // 获取省名称
  339. this.formData.province =
  340. this.provinceList.map((v, i) => ({ value: v.id, label: v.name })).find(item => item.value === val)
  341. ?.label || ''
  342. // 清除市区街道以及详细地址数据
  343. this.delDataK(1)
  344. lbsAmapRegion({ pid: val }).then(res => {
  345. this.cityList = res.data
  346. })
  347. }
  348. }
  349. },
  350. {
  351. name: 'el-select',
  352. md: 6,
  353. formItemAttributes: {
  354. label: '市',
  355. prop: 'cityId',
  356. rules: [...required]
  357. },
  358. options: this.cityList.map((v, i) => ({ value: v.id, label: v.name })),
  359. attributes: {
  360. disabled: [2, 3].includes(this.formType),
  361. clearable: true,
  362. filterable: true,
  363. placeholder: '请选择'
  364. },
  365. events: {
  366. change: val => {
  367. // 获取市名称
  368. this.formData.city =
  369. this.cityList.map((v, i) => ({ value: v.id, label: v.name })).find(item => item.value === val)?.label ||
  370. ''
  371. // 清除区街道以及详细地址数据
  372. this.delDataK(2)
  373. lbsAmapRegion({ pid: val }).then(res => {
  374. this.areaList = res.data
  375. })
  376. }
  377. }
  378. },
  379. {
  380. name: 'el-select',
  381. md: 6,
  382. formItemAttributes: {
  383. label: '区',
  384. prop: 'areaId',
  385. rules: [...required]
  386. },
  387. options: this.areaList.map((v, i) => ({ value: v.id, label: v.name })),
  388. attributes: {
  389. disabled: [2, 3].includes(this.formType),
  390. clearable: true,
  391. filterable: true,
  392. placeholder: '请选择'
  393. },
  394. events: {
  395. change: val => {
  396. // 获取区名称
  397. this.formData.area =
  398. this.areaList.map((v, i) => ({ value: v.id, label: v.name })).find(item => item.value === val)?.label ||
  399. ''
  400. // 清除街道以及详细地址数据
  401. this.delDataK(3)
  402. lbsAmapRegion({ pid: val }).then(res => {
  403. this.streetList = res.data
  404. })
  405. }
  406. }
  407. },
  408. {
  409. name: 'el-select',
  410. md: 6,
  411. formItemAttributes: {
  412. label: '街道', //
  413. prop: 'streetId',
  414. rules: [...required]
  415. },
  416. options: this.streetList.map((v, i) => ({ value: v.id, label: v.name })),
  417. attributes: {
  418. disabled: [2, 3].includes(this.formType),
  419. clearable: true,
  420. filterable: true,
  421. placeholder: '请选择'
  422. },
  423. events: {
  424. change: val => {
  425. // 获取街道名称
  426. this.formData.street =
  427. this.streetList.map((v, i) => ({ value: v.id, label: v.name })).find(item => item.value === val)
  428. ?.label || ''
  429. // 清除详细地址数据
  430. this.delDataK(4)
  431. }
  432. }
  433. },
  434. {
  435. name: 'el-input',
  436. md: 24,
  437. attributes: {
  438. disabled: [2, 3].includes(this.formType),
  439. placeholder: '请输入'
  440. },
  441. formItemAttributes: {
  442. label: '详细地址',
  443. prop: 'address',
  444. rules: [...required]
  445. }
  446. },
  447. {
  448. name: 'el-select',
  449. md: 6,
  450. formItemAttributes: {
  451. label: '产品大类',
  452. prop: 'mainId',
  453. rules: [...required]
  454. },
  455. options: this.classifyList.map((v, i) => ({ value: v.categoryId, label: v.name })),
  456. attributes: {
  457. disabled: [2, 3].includes(this.formType),
  458. clearable: true,
  459. filterable: true,
  460. placeholder: '请选择'
  461. },
  462. events: {
  463. change: val => {
  464. this.formData.mainName =
  465. this.classifyList
  466. .map((v, i) => ({ value: v.categoryId, label: v.name }))
  467. .find(item => item.value === val)?.label || ''
  468. this.formData.smallId = ''
  469. this.formData.smallName = ''
  470. }
  471. }
  472. },
  473. {
  474. name: 'el-select',
  475. md: 6,
  476. formItemAttributes: {
  477. label: '产品小类型',
  478. prop: 'smallId',
  479. rules: [...required]
  480. },
  481. options: this.classifyListLv2
  482. .filter(item => item.parentId === this.formData.mainId)
  483. .map((v, i) => ({ value: v.categoryId, label: v.name })),
  484. attributes: {
  485. disabled: [2, 3].includes(this.formType),
  486. clearable: true,
  487. filterable: true,
  488. placeholder: '请选择'
  489. },
  490. events: {
  491. change: val => {
  492. this.formData.smallName =
  493. this.classifyListLv2
  494. .filter(item => item.parentId === this.formData.mainId)
  495. .map((v, i) => ({ value: v.categoryId, label: v.name }))
  496. .find(item => item.value === val)?.label || ''
  497. }
  498. }
  499. },
  500. {
  501. name: 'el-input',
  502. md: 6,
  503. attributes: {
  504. disabled: [2, 3].includes(this.formType),
  505. placeholder: '请输入'
  506. },
  507. formItemAttributes: {
  508. label: '系列名称',
  509. prop: 'seriesName',
  510. rules: [...required]
  511. }
  512. },
  513. {
  514. name: 'el-input',
  515. md: 6,
  516. attributes: {
  517. disabled: [2, 3].includes(this.formType),
  518. placeholder: '请输入'
  519. },
  520. formItemAttributes: {
  521. label: '机型名称',
  522. prop: 'productName',
  523. rules: [...required]
  524. }
  525. },
  526. {
  527. name: 'el-input',
  528. md: 6,
  529. attributes: {
  530. disabled: [2, 3].includes(this.formType),
  531. placeholder: '请输入',
  532. maxlength: 13
  533. },
  534. formItemAttributes: {
  535. label: '内机条码',
  536. prop: 'insideCode',
  537. rules: [...required]
  538. }
  539. },
  540. {
  541. name: 'el-input',
  542. md: 6,
  543. attributes: {
  544. disabled: [2, 3].includes(this.formType),
  545. placeholder: '请输入',
  546. maxlength: 13
  547. },
  548. formItemAttributes: {
  549. label: '外机条码',
  550. prop: 'outCode',
  551. rules: [101, 103, '101', '103'].includes(this.formData.mainId) ? [...required] : []
  552. }
  553. },
  554. {
  555. name: 'el-input',
  556. md: 6,
  557. attributes: {
  558. disabled: [2, 3].includes(this.formType),
  559. placeholder: '请输入'
  560. },
  561. formItemAttributes: {
  562. label: '发生数量',
  563. prop: 'num',
  564. rules: [...required]
  565. }
  566. },
  567. {
  568. name: 'el-date-picker',
  569. md: 6,
  570. attributes: {
  571. 'picker-options': 'pickerOptions11',
  572. 'popper-class': 'custom-popper11',
  573. 'append-to-body': true,
  574. 'value-format': 'yyyy-MM-dd HH:mm:ss',
  575. disabled: [2, 3].includes(this.formType),
  576. style: { width: '100%' },
  577. type: 'date',
  578. placeholder: '请选择'
  579. },
  580. formItemAttributes: {
  581. label: '出厂日期',
  582. prop: 'outDate'
  583. }
  584. },
  585. {
  586. name: 'el-date-picker',
  587. md: 6,
  588. attributes: {
  589. 'picker-options': 'pickerOptions11',
  590. 'popper-class': 'custom-popper11',
  591. 'append-to-body': true,
  592. 'value-format': 'yyyy-MM-dd HH:mm:ss',
  593. disabled: [2, 3].includes(this.formType),
  594. style: { width: '100%' },
  595. type: 'date',
  596. placeholder: '请选择'
  597. },
  598. formItemAttributes: {
  599. label: '安装或使用日期',
  600. prop: 'useDate',
  601. rules: [...required]
  602. }
  603. },
  604. {
  605. name: 'el-date-picker',
  606. md: 6,
  607. attributes: {
  608. 'picker-options': 'pickerOptions11',
  609. 'popper-class': 'custom-popper11',
  610. 'append-to-body': true,
  611. 'value-format': 'yyyy-MM-dd HH:mm:ss',
  612. disabled: [2, 3].includes(this.formType),
  613. style: { width: '100%' },
  614. type: 'date',
  615. placeholder: '请选择'
  616. },
  617. formItemAttributes: {
  618. label: '报修或发生日期',
  619. prop: 'repairDate',
  620. rules: [...required]
  621. }
  622. },
  623. {
  624. md: 6,
  625. isShow: true,
  626. name: 'el-radio',
  627. options: [
  628. { label: '有', value: true },
  629. { label: '无', value: false }
  630. ],
  631. attributes: {
  632. disabled: [2, 3].includes(this.formType)
  633. },
  634. formItemAttributes: {
  635. label: '有无配件寄回',
  636. prop: 'isPartSend',
  637. rules: [...required]
  638. }
  639. },
  640. {
  641. name: 'el-input',
  642. md: 6,
  643. attributes: {
  644. disabled: [2, 3].includes(this.formType),
  645. placeholder: '请输入'
  646. },
  647. formItemAttributes: {
  648. label: '故障配件名称及规格',
  649. prop: 'bugPartName'
  650. }
  651. },
  652. {
  653. name: 'el-input',
  654. md: 24,
  655. attributes: {
  656. disabled: [2, 3].includes(this.formType),
  657. type: 'textarea',
  658. rows: 3,
  659. placeholder: '请输入'
  660. },
  661. formItemAttributes: {
  662. label: '故障代码(包含检测器检测)',
  663. prop: 'bugPartCode',
  664. rules: [...required]
  665. }
  666. },
  667. {
  668. md: 6,
  669. isShow: true,
  670. name: 'el-radio',
  671. options: [
  672. { label: '是', value: true },
  673. { label: '否', value: false }
  674. ],
  675. attributes: {
  676. disabled: [2, 3].includes(this.formType)
  677. },
  678. formItemAttributes: {
  679. label: '是否需要处理方案',
  680. prop: 'isNeedPlan',
  681. rules: [...required]
  682. }
  683. },
  684. {
  685. name: 'el-date-picker',
  686. md: 6,
  687. attributes: {
  688. 'picker-options': 'pickerOptions11',
  689. 'popper-class': 'custom-popper11',
  690. 'append-to-body': true,
  691. 'value-format': 'yyyy-MM-dd HH:mm:ss',
  692. disabled: [2, 3].includes(this.formType),
  693. style: { width: '100%' },
  694. type: 'date',
  695. placeholder: '请选择'
  696. },
  697. formItemAttributes: {
  698. label: '要求提供日期',
  699. prop: 'supplyDate',
  700. rules: [...required]
  701. }
  702. },
  703. {
  704. name: 'el-input',
  705. md: 24,
  706. attributes: {
  707. disabled: [2, 3].includes(this.formType),
  708. type: 'textarea',
  709. rows: 3,
  710. placeholder: '请输入'
  711. },
  712. formItemAttributes: {
  713. label: '故障描述',
  714. prop: 'bugRemark',
  715. rules: [...required]
  716. }
  717. },
  718. {
  719. name: 'el-input',
  720. md: 24,
  721. attributes: {
  722. disabled: [2, 3].includes(this.formType),
  723. type: 'textarea',
  724. rows: 3,
  725. placeholder: '请输入'
  726. },
  727. formItemAttributes: {
  728. label: '网点分析',
  729. prop: 'websitAnalyse',
  730. rules: [...required]
  731. }
  732. },
  733. {
  734. name: 'el-input',
  735. md: 24,
  736. attributes: {
  737. disabled: [2, 3].includes(this.formType),
  738. type: 'textarea',
  739. rows: 3,
  740. placeholder: '请输入'
  741. },
  742. formItemAttributes: {
  743. label: '网点处理方法',
  744. prop: 'websitHandleMethod',
  745. rules: [...required]
  746. }
  747. },
  748. {
  749. md: 5,
  750. name: 'slot-component',
  751. formItemAttributes: {
  752. label: '内机条码',
  753. prop: 'neijitiaoma',
  754. rules: [...required]
  755. },
  756. render: (h, { props, onInput }) => {
  757. return (
  758. <ImageUpload fileList={this.formData.neijitiaoma} limit={1} isEdit={![2, 3].includes(this.formType)} />
  759. )
  760. }
  761. },
  762. {
  763. md: 5,
  764. name: 'slot-component',
  765. formItemAttributes: {
  766. label: '外机条码',
  767. prop: 'waijitiaoma',
  768. rules: []
  769. },
  770. render: (h, { props, onInput }) => {
  771. return (
  772. <ImageUpload fileList={this.formData.waijitiaoma} limit={1} isEdit={![2, 3].includes(this.formType)} />
  773. )
  774. }
  775. },
  776. {
  777. md: 14,
  778. name: 'slot-component',
  779. formItemAttributes: {
  780. label: '其他',
  781. prop: 'qita',
  782. rules: []
  783. },
  784. render: (h, { props, onInput }) => {
  785. return (
  786. <div>
  787. <ImageUpload fileList={this.formData.qita} limit={3} isEdit={![2, 3].includes(this.formType)} />
  788. <div style="color:orange">可上传最多3个图片</div>
  789. </div>
  790. )
  791. }
  792. },
  793. {
  794. md: 24,
  795. name: 'slot-component',
  796. formItemAttributes: {
  797. label: '附件',
  798. prop: 'fujian',
  799. rules: []
  800. },
  801. render: (h, { props, onInput }) => {
  802. return (
  803. <div>
  804. <ImageUpload fileList={this.formData.fujian} limit={9} isEdit={![2, 3].includes(this.formType)} />
  805. <div style="color:orange">可上传最多9个文件,不限文件格式</div>
  806. </div>
  807. )
  808. }
  809. }
  810. ]
  811. },
  812. items2() {
  813. return [
  814. {
  815. name: 'el-input',
  816. md: 6,
  817. attributes: {
  818. disabled: true,
  819. placeholder: '请输入'
  820. },
  821. formItemAttributes: {
  822. label: '网点提交人',
  823. prop: 'createBy'
  824. }
  825. },
  826. {
  827. name: 'el-input',
  828. md: 6,
  829. attributes: {
  830. disabled: true,
  831. placeholder: '请输入'
  832. },
  833. formItemAttributes: {
  834. label: '网点提交时间',
  835. prop: 'createTime'
  836. }
  837. },
  838. {
  839. name: 'el-input',
  840. md: 6,
  841. attributes: {
  842. disabled: true,
  843. placeholder: '请输入'
  844. },
  845. formItemAttributes: {
  846. label: '中心审核人',
  847. prop: 'confirmBy'
  848. }
  849. },
  850. {
  851. name: 'el-input',
  852. md: 6,
  853. attributes: {
  854. disabled: true,
  855. placeholder: '请输入'
  856. },
  857. formItemAttributes: {
  858. label: 'confirmTime',
  859. prop: 'title'
  860. }
  861. },
  862. {
  863. md: 24,
  864. name: 'el-radio',
  865. options: [
  866. { label: '通过', value: 'OK' },
  867. { label: '驳回不可修改', value: 'FAIL' },
  868. { label: '驳回可修改', value: 'REJECT' }
  869. ],
  870. attributes: {
  871. disabled: [0, 1, 3].includes(this.formType)
  872. },
  873. formItemAttributes: {
  874. label: '中心审核',
  875. prop: 'status',
  876. rules: [...required]
  877. }
  878. },
  879. {
  880. name: 'el-input',
  881. md: 24,
  882. attributes: {
  883. disabled: [0, 1, 3].includes(this.formType),
  884. type: 'textarea',
  885. rows: 3,
  886. placeholder: '请输入'
  887. },
  888. formItemAttributes: {
  889. label: '审核备注',
  890. prop: 'remark',
  891. rules: [...required]
  892. }
  893. }
  894. ]
  895. }
  896. },
  897. methods: {
  898. getClassifyListData() {
  899. // 获取产品大类小类
  900. getClassifyList({ type: 2, status: true }).then(res => {
  901. var classifyListLv2 = []
  902. this.classifyList = res.data.map(item => {
  903. var { children, ...data } = item
  904. classifyListLv2.push(...(children || []))
  905. return {
  906. ...data
  907. }
  908. })
  909. this.classifyListLv2 = classifyListLv2
  910. })
  911. // 获取可选网点
  912. getWebsit({ status: true }).then(res => {
  913. this.createWebsitList = res.data.map(item => ({
  914. value: item.websitId,
  915. label: item.name
  916. }))
  917. })
  918. },
  919. getinitlbslist() {
  920. // 初始化请求省市区街道下拉选项数据
  921. lbsAmapRegion({ pid: 0 }).then(res => {
  922. this.provinceList = res.data
  923. if (this.formData.provinceId) {
  924. lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
  925. this.cityList = res.data
  926. })
  927. }
  928. if (this.formData.cityId) {
  929. lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
  930. this.areaList = res.data
  931. })
  932. }
  933. if (this.formData.areaId) {
  934. lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
  935. this.streetList = res.data
  936. })
  937. }
  938. })
  939. },
  940. delDataK(num) {
  941. if (num <= 1) {
  942. // 删除市
  943. this.formData.cityId = ''
  944. this.formData.city = ''
  945. // 删除市选项
  946. this.cityList = []
  947. }
  948. if (num <= 2) {
  949. // 删除区
  950. this.formData.areaId = ''
  951. this.formData.area = ''
  952. // 删除区选项
  953. this.areaList = []
  954. }
  955. if (num <= 3) {
  956. // 删除街道
  957. this.formData.streetId = ''
  958. this.formData.street = ''
  959. // 删除街道选项
  960. this.streetList = []
  961. }
  962. // 删除地址
  963. this.formData.address = ''
  964. },
  965. // 列表请求函数
  966. getList: qualityFeedbackList,
  967. // 导出
  968. exportList: qualityFeedbackListExport,
  969. // 表格列解析渲染数据更改
  970. columnParsing(item, defaultData) {
  971. return defaultData
  972. },
  973. // 获取勾选框数据
  974. selectionChange(data) {
  975. this.recordSelected = data
  976. },
  977. operation() {
  978. return this.operationBtn({
  979. edit: {
  980. click: ({ row, index, column }) => {
  981. this.getClassifyListData()
  982. qualityFeedbackDetail({
  983. id: row.id
  984. }).then(res => {
  985. this.formData = {
  986. ...res.data,
  987. fujian: res.data.items.filter(item => item.type === 'FILE').map(item => ({ url: item.url })),
  988. neijitiaoma: res.data.items
  989. .filter(item => item.type === 'INSIDE_CODE')
  990. .map(item => ({ url: item.url })),
  991. waijitiaoma: res.data.items.filter(item => item.type === 'OUT_CODE').map(item => ({ url: item.url })),
  992. qita: res.data.items.filter(item => item.type === 'OTHER').map(item => ({ url: item.url }))
  993. }
  994. this.$nextTick(() => {
  995. this.getinitlbslist()
  996. this.formType = 1
  997. this.formBool = true
  998. })
  999. })
  1000. }
  1001. },
  1002. centralAudit: {
  1003. conditions: ({ row, index, column }) => {
  1004. return row.status == 'WAIT'
  1005. },
  1006. click: ({ row, index, column }) => {
  1007. this.getClassifyListData()
  1008. qualityFeedbackDetail({
  1009. id: row.id
  1010. }).then(res => {
  1011. this.formData = {
  1012. ...res.data,
  1013. fujian: res.data.items.filter(item => item.type === 'FILE').map(item => ({ url: item.url })),
  1014. neijitiaoma: res.data.items
  1015. .filter(item => item.type === 'INSIDE_CODE')
  1016. .map(item => ({ url: item.url })),
  1017. waijitiaoma: res.data.items.filter(item => item.type === 'OUT_CODE').map(item => ({ url: item.url })),
  1018. qita: res.data.items.filter(item => item.type === 'OTHER').map(item => ({ url: item.url })),
  1019. status: ''
  1020. }
  1021. this.$nextTick(() => {
  1022. this.getinitlbslist()
  1023. this.formType = 2
  1024. this.formBool = true
  1025. })
  1026. })
  1027. }
  1028. },
  1029. details: {
  1030. click: ({ row, index, column }) => {
  1031. this.getClassifyListData()
  1032. qualityFeedbackDetail({
  1033. id: row.id
  1034. }).then(res => {
  1035. this.formData = {
  1036. ...res.data,
  1037. fujian: res.data.items.filter(item => item.type === 'FILE').map(item => ({ url: item.url })),
  1038. neijitiaoma: res.data.items
  1039. .filter(item => item.type === 'INSIDE_CODE')
  1040. .map(item => ({ url: item.url })),
  1041. waijitiaoma: res.data.items.filter(item => item.type === 'OUT_CODE').map(item => ({ url: item.url })),
  1042. qita: res.data.items.filter(item => item.type === 'OTHER').map(item => ({ url: item.url }))
  1043. }
  1044. this.$nextTick(() => {
  1045. this.getinitlbslist()
  1046. this.formType = 3
  1047. this.formBool = true
  1048. })
  1049. })
  1050. }
  1051. }
  1052. })
  1053. },
  1054. handleClose() {
  1055. this.$refs?.pageRef?.refreshList()
  1056. this.$data.formData = this.$options.data().formData
  1057. this.formType = 0
  1058. this.formBool = false
  1059. },
  1060. formConfirm(status) {
  1061. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  1062. if (valid) {
  1063. ;(this.formData.id ? qualityFeedbackUpdate : qualityFeedbackAdd)({
  1064. ...this.formData,
  1065. items: [
  1066. ...this.formData.neijitiaoma.map(item => ({
  1067. qualityFeedbckId: this.formData.id || undefined,
  1068. type: 'INSIDE_CODE',
  1069. url: item.url
  1070. })),
  1071. ...this.formData.waijitiaoma.map(item => ({
  1072. qualityFeedbckId: this.formData.id || undefined,
  1073. type: 'OUT_CODE',
  1074. url: item.url
  1075. })),
  1076. ...this.formData.qita.map(item => ({
  1077. qualityFeedbckId: this.formData.id || undefined,
  1078. type: 'OTHER',
  1079. url: item.url
  1080. })),
  1081. ...this.formData.fujian.map(item => ({
  1082. qualityFeedbckId: this.formData.id || undefined,
  1083. type: 'FILE',
  1084. url: item.url
  1085. }))
  1086. ],
  1087. status,
  1088. fujian: undefined,
  1089. neijitiaoma: undefined,
  1090. waijitiaoma: undefined,
  1091. qita: undefined
  1092. }).then(res => {
  1093. this.$message({ type: 'success', message: '提交成功!' })
  1094. this.$refs.pageRef.refreshList()
  1095. this.handleClose()
  1096. })
  1097. }
  1098. })
  1099. },
  1100. formConfirmShenHe() {
  1101. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  1102. if (valid) {
  1103. qualityFeedbackConfirm({
  1104. id: this.formData.id,
  1105. status: this.formData.status,
  1106. remark: this.formData.remark
  1107. }).then(res => {
  1108. this.$message({ type: 'success', message: '审核成功!' })
  1109. this.$refs.pageRef.refreshList()
  1110. this.handleClose()
  1111. })
  1112. }
  1113. })
  1114. }
  1115. }
  1116. }
  1117. </script>
  1118. <style lang="scss" scoped>
  1119. .neibuview {
  1120. box-sizing: border-box;
  1121. padding-left: 16px;
  1122. ::v-deep & > .zj-page-fill-scroll {
  1123. box-sizing: border-box;
  1124. padding-right: 16px;
  1125. & > div:nth-child(1) {
  1126. margin-top: 20px;
  1127. }
  1128. }
  1129. }
  1130. </style>