index.vue 32 KB

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