123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122 |
- <template>
- <template-page
- ref="pageRef"
- :getList="getList"
- :exportList="exportList"
- :columnParsing="columnParsing"
- :optionsEvensGroup="optionsEvensGroup"
- :tableAttributes="tableAttributes"
- :tableEvents="tableEvents"
- :operation="operation()"
- >
- <div class="cartographer_big">
- <el-dialog title="配置" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
- <zj-page-container v-if="formBool">
- <zj-page-fill class="neibuview">
- <zj-form-container
- ref="formRef"
- :form-data="formData"
- :form-rules="formRules"
- :form-attributes="{ size: 'mini' }"
- >
- <zj-form-module title="申请信息" label-width="140px" :form-data="formData" :form-items="items" />
- <zj-form-module
- v-if="~[2, 3].indexOf(formType)"
- title="中心审批信息"
- label-width="140px"
- :form-data="formData"
- :form-items="items2"
- />
- </zj-form-container>
- </zj-page-fill>
- <!-- 操作按钮 -->
- <div style="box-sizing: border-box; padding: 10px; text-align: right">
- <el-button size="mini" @click="handleClose">取 消</el-button>
- <el-button v-if="~[0, 1].indexOf(formType)" size="mini" @click="formConfirm" type="primary"
- >提 交</el-button
- >
- <el-button v-if="~[2].indexOf(formType)" size="mini" @click="formConfirmShenHe" type="primary"
- >确定</el-button
- >
- </div>
- </zj-page-container>
- </el-dialog>
- </div>
- </template-page>
- </template>
- <script>
- import TemplatePage from '@/components/template/template-page-1.vue'
- import import_mixin from '@/components/template/import_mixin.js'
- import operation_mixin from '@/components/template/operation_mixin.js'
- import ImageUpload from '@/components/file-upload'
- import { required } from '@/components/template/rules_verify.js'
- import {
- qualityFeedbackList,
- qualityFeedbackListExport,
- qualityFeedbackDetail,
- qualityFeedbackAdd,
- qualityFeedbackUpdate,
- qualityFeedbackConfirm,
- qualityFeedbackCount,
- qualityFeedbackUpdateUpload
- } from '@/api/qualityFeedback'
- import { lbsAmapRegion } from '@/api/common.js'
- import { getClassifyList } from '@/api/goods'
- import { getWebsit } from '@/api/customerManagement.js'
- export default {
- components: { TemplatePage, ImageUpload },
- mixins: [import_mixin, operation_mixin],
- data() {
- return {
- // 表格属性
- tableAttributes: {
- selectColumn: true
- },
- // 表格事件
- tableEvents: {
- 'selection-change': this.selectionChange
- },
- recordSelected: [],
- formBool: false,
- formType: 0,
- formData: {
- address: '',
- area: '',
- areaId: '',
- bugPartCode: '',
- bugPartName: '',
- bugRemark: '',
- city: '',
- cityId: '',
- companyWechatId: '',
- companyWechatName: '',
- confirmBy: '',
- confirmTime: '',
- createBy: '',
- createTime: '',
- customerMobile: '',
- customerName: '',
- insideCode: '',
- isNeedPlan: true,
- isPartSend: true,
- isSalesBefore: true,
- isUpload: true,
- items: [],
- mainId: '',
- mainName: '',
- num: '',
- orderNo: '',
- outCode: '',
- outDate: '',
- productName: '',
- province: '',
- provinceId: '',
- remark: '',
- repairDate: '',
- seriesName: '',
- smallId: '',
- smallName: '',
- status: '',
- street: '',
- streetId: '',
- submitBy: '',
- submitTime: '',
- supplyDate: '',
- title: '',
- useDate: '',
- websitAnalyse: '',
- websitHandleMethod: '',
- websitId: '',
- websitName: '',
- workerMobie: '',
- workerName: '',
- fujian: [],
- neijitiaoma: [],
- waijitiaoma: [],
- qita: []
- },
- formRules: {},
- provinceList: [],
- cityList: [],
- areaList: [],
- streetList: [],
- classifyList: [],
- classifyListLv2: [],
- createWebsitList: []
- }
- },
- computed: {
- optionsEvensGroup() {
- return [
- [
- [
- this.optionsEvensAuth('add', {
- click: () => {
- this.getinitlbslist()
- this.getClassifyListData()
- this.formType = 0
- this.formBool = true
- }
- })
- ]
- ],
- [
- [
- this.optionsEvensAuth('recordedAtHeadquarters', {
- click: () => {
- if (this.recordSelected.length === 0) {
- this.$message.warning('请勾选数据')
- return
- }
- qualityFeedbackUpdateUpload({
- ids: this.recordSelected.map(item => item.id).join(',')
- }).then(res => {
- this.$message({
- type: 'success',
- message: '操作成功!'
- })
- this.$refs?.pageRef?.refreshList()
- })
- }
- })
- ]
- ]
- ]
- },
- items() {
- return [
- {
- name: 'el-input',
- md: 18,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '反馈主题',
- prop: 'title',
- rules: [...required]
- }
- },
- {
- md: 6,
- name: 'el-radio',
- options: [
- { label: '是', value: true },
- { label: '否', value: false }
- ],
- attributes: {
- disabled: [2, 3].includes(this.formType)
- },
- formItemAttributes: {
- label: '是否售前机',
- prop: 'isSalesBefore'
- }
- },
- {
- name: 'el-select',
- md: 12,
- options: this.createWebsitList.map(item => ({ ...item, label: `(${item.value})${item.label}` })),
- attributes: {
- disabled: [1, 2, 3].includes(this.formType),
- placeholder: '请选择',
- clearable: true,
- filterable: true
- },
- formItemAttributes: {
- label: '反馈网点',
- prop: 'websitId',
- rules: [...required]
- },
- events: {
- change: val => {
- this.formData.websitName = this.createWebsitList.find(item => item.value == val).label || ''
- }
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: true,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '反馈时间',
- prop: 'submitTime'
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '云售后4.0单号',
- prop: 'orderNo',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '工程师名称',
- prop: 'workerName',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '工程师电话',
- prop: 'workerMobie',
- rules: [...mobileRequired]
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '客户名称',
- prop: 'customerName',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '客户电话',
- prop: 'customerMobile',
- rules: [...mobileRequired]
- }
- },
- {
- name: 'el-select',
- md: 6,
- formItemAttributes: {
- label: '省',
- prop: 'provinceId',
- rules: [...required]
- },
- options: this.provinceList.map((v, i) => ({ value: v.id, label: v.name })),
- attributes: {
- disabled: [2, 3].includes(this.formType),
- clearable: true,
- filterable: true,
- placeholder: '请选择'
- },
- events: {
- change: val => {
- // 获取省名称
- this.formData.province =
- this.provinceList.map((v, i) => ({ value: v.id, label: v.name })).find(item => item.value === val)
- ?.label || ''
- // 清除市区街道以及详细地址数据
- this.delDataK(1)
- lbsAmapRegion({ pid: val }).then(res => {
- this.cityList = res.data
- })
- }
- }
- },
- {
- name: 'el-select',
- md: 6,
- formItemAttributes: {
- label: '市',
- prop: 'cityId',
- rules: [...required]
- },
- options: this.cityList.map((v, i) => ({ value: v.id, label: v.name })),
- attributes: {
- disabled: [2, 3].includes(this.formType),
- clearable: true,
- filterable: true,
- placeholder: '请选择'
- },
- events: {
- change: val => {
- // 获取市名称
- this.formData.city =
- this.cityList.map((v, i) => ({ value: v.id, label: v.name })).find(item => item.value === val)?.label ||
- ''
- // 清除区街道以及详细地址数据
- this.delDataK(2)
- lbsAmapRegion({ pid: val }).then(res => {
- this.areaList = res.data
- })
- }
- }
- },
- {
- name: 'el-select',
- md: 6,
- formItemAttributes: {
- label: '区',
- prop: 'areaId',
- rules: [...required]
- },
- options: this.areaList.map((v, i) => ({ value: v.id, label: v.name })),
- attributes: {
- disabled: [2, 3].includes(this.formType),
- clearable: true,
- filterable: true,
- placeholder: '请选择'
- },
- events: {
- change: val => {
- // 获取区名称
- this.formData.area =
- this.areaList.map((v, i) => ({ value: v.id, label: v.name })).find(item => item.value === val)?.label ||
- ''
- // 清除街道以及详细地址数据
- this.delDataK(3)
- lbsAmapRegion({ pid: val }).then(res => {
- this.streetList = res.data
- })
- }
- }
- },
- {
- name: 'el-select',
- md: 6,
- formItemAttributes: {
- label: '街道', //
- prop: 'streetId',
- rules: [...required]
- },
- options: this.streetList.map((v, i) => ({ value: v.id, label: v.name })),
- attributes: {
- disabled: [2, 3].includes(this.formType),
- clearable: true,
- filterable: true,
- placeholder: '请选择'
- },
- events: {
- change: val => {
- // 获取街道名称
- this.formData.street =
- this.streetList.map((v, i) => ({ value: v.id, label: v.name })).find(item => item.value === val)
- ?.label || ''
- // 清除详细地址数据
- this.delDataK(4)
- }
- }
- },
- {
- name: 'el-input',
- md: 24,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '详细地址',
- prop: 'address',
- rules: [...required]
- }
- },
- {
- name: 'el-select',
- md: 6,
- formItemAttributes: {
- label: '产品大类',
- prop: 'mainId',
- rules: [...required]
- },
- options: this.classifyList.map((v, i) => ({ value: v.categoryId, label: v.name })),
- attributes: {
- disabled: [2, 3].includes(this.formType),
- clearable: true,
- filterable: true,
- placeholder: '请选择'
- },
- events: {
- change: val => {
- this.formData.mainName =
- this.classifyList
- .map((v, i) => ({ value: v.categoryId, label: v.name }))
- .find(item => item.value === val)?.label || ''
- this.formData.smallId = ''
- this.formData.smallName = ''
- }
- }
- },
- {
- name: 'el-select',
- md: 6,
- formItemAttributes: {
- label: '产品小类型',
- prop: 'smallId',
- rules: [...required]
- },
- options: this.classifyListLv2
- .filter(item => item.parentId === this.formData.mainId)
- .map((v, i) => ({ value: v.categoryId, label: v.name })),
- attributes: {
- disabled: [2, 3].includes(this.formType),
- clearable: true,
- filterable: true,
- placeholder: '请选择'
- },
- events: {
- change: val => {
- this.formData.smallName =
- this.classifyListLv2
- .filter(item => item.parentId === this.formData.mainId)
- .map((v, i) => ({ value: v.categoryId, label: v.name }))
- .find(item => item.value === val)?.label || ''
- }
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '系列名称',
- prop: 'seriesName',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '机型名称',
- prop: 'productName',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入',
- maxlength: 13
- },
- formItemAttributes: {
- label: '内机条码',
- prop: 'insideCode',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入',
- maxlength: 13
- },
- formItemAttributes: {
- label: '外机条码',
- prop: 'outCode'
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '发生数量',
- prop: 'num',
- rules: [...required]
- }
- },
- {
- name: 'el-date-picker',
- md: 6,
- attributes: {
- 'picker-options': 'pickerOptions11',
- 'popper-class': 'custom-popper11',
- 'append-to-body': true,
- 'value-format': 'yyyy-MM-dd HH:mm:ss',
- disabled: [2, 3].includes(this.formType),
- style: { width: '100%' },
- type: 'date',
- placeholder: '请选择'
- },
- formItemAttributes: {
- label: '出厂日期',
- prop: 'outDate'
- }
- },
- {
- name: 'el-date-picker',
- md: 6,
- attributes: {
- 'picker-options': 'pickerOptions11',
- 'popper-class': 'custom-popper11',
- 'append-to-body': true,
- 'value-format': 'yyyy-MM-dd HH:mm:ss',
- disabled: [2, 3].includes(this.formType),
- style: { width: '100%' },
- type: 'date',
- placeholder: '请选择'
- },
- formItemAttributes: {
- label: '安装或使用日期',
- prop: 'useDate',
- rules: [...required]
- }
- },
- {
- name: 'el-date-picker',
- md: 6,
- attributes: {
- 'picker-options': 'pickerOptions11',
- 'popper-class': 'custom-popper11',
- 'append-to-body': true,
- 'value-format': 'yyyy-MM-dd HH:mm:ss',
- disabled: [2, 3].includes(this.formType),
- style: { width: '100%' },
- type: 'date',
- placeholder: '请选择'
- },
- formItemAttributes: {
- label: '报修或发生日期',
- prop: 'repairDate',
- rules: [...required]
- }
- },
- {
- md: 6,
- isShow: true,
- name: 'el-radio',
- options: [
- { label: '有', value: true },
- { label: '无', value: false }
- ],
- attributes: {
- disabled: [2, 3].includes(this.formType)
- },
- formItemAttributes: {
- label: '有无配件寄回',
- prop: 'isPartSend',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '故障配件名称及规格',
- prop: 'bugPartName'
- }
- },
- {
- name: 'el-input',
- md: 24,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- type: 'textarea',
- rows: 3,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '故障代码(包含检测器检测)',
- prop: 'bugPartCode',
- rules: [...required]
- }
- },
- {
- md: 6,
- isShow: true,
- name: 'el-radio',
- options: [
- { label: '是', value: true },
- { label: '否', value: false }
- ],
- attributes: {
- disabled: [2, 3].includes(this.formType)
- },
- formItemAttributes: {
- label: '是否需要处理方案',
- prop: 'isNeedPlan',
- rules: [...required]
- }
- },
- {
- name: 'el-date-picker',
- md: 6,
- attributes: {
- 'picker-options': 'pickerOptions11',
- 'popper-class': 'custom-popper11',
- 'append-to-body': true,
- 'value-format': 'yyyy-MM-dd HH:mm:ss',
- disabled: [2, 3].includes(this.formType),
- style: { width: '100%' },
- type: 'date',
- placeholder: '请选择'
- },
- formItemAttributes: {
- label: '要求提供日期',
- prop: 'supplyDate',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 24,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- type: 'textarea',
- rows: 3,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '故障描述',
- prop: 'bugRemark',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 24,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- type: 'textarea',
- rows: 3,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '网点分析',
- prop: 'websitAnalyse',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 24,
- attributes: {
- disabled: [2, 3].includes(this.formType),
- type: 'textarea',
- rows: 3,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '网点处理方法',
- prop: 'websitHandleMethod',
- rules: [...required]
- }
- },
- {
- md: 5,
- name: 'slot-component',
- formItemAttributes: {
- label: '内机条码',
- prop: 'neijitiaoma',
- rules: [...required]
- },
- render: (h, { props, onInput }) => {
- return (
- <ImageUpload fileList={this.formData.neijitiaoma} limit={1} isEdit={![2, 3].includes(this.formType)} />
- )
- }
- },
- {
- md: 5,
- name: 'slot-component',
- formItemAttributes: {
- label: '外机条码',
- prop: 'waijitiaoma',
- rules: []
- },
- render: (h, { props, onInput }) => {
- return (
- <ImageUpload fileList={this.formData.waijitiaoma} limit={1} isEdit={![2, 3].includes(this.formType)} />
- )
- }
- },
- {
- md: 14,
- name: 'slot-component',
- formItemAttributes: {
- label: '其他',
- prop: 'qita',
- rules: []
- },
- render: (h, { props, onInput }) => {
- return (
- <div>
- <ImageUpload fileList={this.formData.qita} limit={3} isEdit={![2, 3].includes(this.formType)} />
- <div style="color:orange">可上传最多3个图片</div>
- </div>
- )
- }
- },
- {
- md: 24,
- name: 'slot-component',
- formItemAttributes: {
- label: '附件',
- prop: 'fujian',
- rules: []
- },
- render: (h, { props, onInput }) => {
- return (
- <div>
- <ImageUpload fileList={this.formData.fujian} limit={9} isEdit={![2, 3].includes(this.formType)} />
- <div style="color:orange">可上传最多9个文件,不限文件格式</div>
- </div>
- )
- }
- }
- ]
- },
- items2() {
- return [
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: true,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '网点提交人',
- prop: 'createBy'
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: true,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '网点提交时间',
- prop: 'createTime'
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: true,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '中心审核人',
- prop: 'confirmBy'
- }
- },
- {
- name: 'el-input',
- md: 6,
- attributes: {
- disabled: true,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: 'confirmTime',
- prop: 'title'
- }
- },
- {
- md: 24,
- name: 'el-radio',
- options: [
- { label: '通过', value: 'OK' },
- { label: '驳回不可修改', value: 'FAIL' },
- { label: '驳回可修改', value: 'REJECT' }
- ],
- attributes: {
- disabled: [0, 1, 3].includes(this.formType)
- },
- formItemAttributes: {
- label: '中心审核',
- prop: 'status',
- rules: [...required]
- }
- },
- {
- name: 'el-input',
- md: 24,
- attributes: {
- disabled: [0, 1, 3].includes(this.formType),
- type: 'textarea',
- rows: 3,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '审核备注',
- prop: 'remark',
- rules: [...required]
- }
- }
- ]
- }
- },
- methods: {
- getClassifyListData() {
- // 获取产品大类小类
- getClassifyList({ type: 2, status: true }).then(res => {
- var classifyListLv2 = []
- this.classifyList = res.data.map(item => {
- var { children, ...data } = item
- classifyListLv2.push(...(children || []))
- return {
- ...data
- }
- })
- this.classifyListLv2 = classifyListLv2
- })
- // 获取可选网点
- getWebsit({ status: true }).then(res => {
- this.createWebsitList = res.data.map(item => ({
- value: item.websitId,
- label: item.name
- }))
- })
- },
- getinitlbslist() {
- // 初始化请求省市区街道下拉选项数据
- lbsAmapRegion({ pid: 0 }).then(res => {
- this.provinceList = res.data
- if (this.formData.provinceId) {
- lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
- this.cityList = res.data
- })
- }
- if (this.formData.cityId) {
- lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
- this.areaList = res.data
- })
- }
- if (this.formData.areaId) {
- lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
- this.streetList = res.data
- })
- }
- })
- },
- delDataK(num) {
- if (num <= 1) {
- // 删除市
- this.formData.cityId = ''
- this.formData.city = ''
- // 删除市选项
- this.cityList = []
- }
- if (num <= 2) {
- // 删除区
- this.formData.areaId = ''
- this.formData.area = ''
- // 删除区选项
- this.areaList = []
- }
- if (num <= 3) {
- // 删除街道
- this.formData.streetId = ''
- this.formData.street = ''
- // 删除街道选项
- this.streetList = []
- }
- // 删除地址
- this.formData.address = ''
- },
- // 列表请求函数
- getList: qualityFeedbackList,
- // 导出
- exportList: qualityFeedbackListExport,
- // 表格列解析渲染数据更改
- columnParsing(item, defaultData) {
- return defaultData
- },
- // 获取勾选框数据
- selectionChange(data) {
- this.recordSelected = data
- },
- operation() {
- return this.operationBtn({
- edit: {
- click: ({ row, index, column }) => {
- this.getClassifyListData()
- qualityFeedbackDetail({
- id: row.id
- }).then(res => {
- this.formData = {
- ...res.data,
- fujian: res.data.items.filter(item => item.type === 'FILE').map(item => ({ url: item.url })),
- neijitiaoma: res.data.items
- .filter(item => item.type === 'INSIDE_CODE')
- .map(item => ({ url: item.url })),
- waijitiaoma: res.data.items.filter(item => item.type === 'OUT_CODE').map(item => ({ url: item.url })),
- qita: res.data.items.filter(item => item.type === 'OTHER').map(item => ({ url: item.url }))
- }
- this.$nextTick(() => {
- this.getinitlbslist()
- this.formType = 1
- this.formBool = true
- })
- })
- }
- },
- centralAudit: {
- click: ({ row, index, column }) => {
- this.getClassifyListData()
- qualityFeedbackDetail({
- id: row.id
- }).then(res => {
- this.formData = {
- ...res.data,
- fujian: res.data.items.filter(item => item.type === 'FILE').map(item => ({ url: item.url })),
- neijitiaoma: res.data.items
- .filter(item => item.type === 'INSIDE_CODE')
- .map(item => ({ url: item.url })),
- waijitiaoma: res.data.items.filter(item => item.type === 'OUT_CODE').map(item => ({ url: item.url })),
- qita: res.data.items.filter(item => item.type === 'OTHER').map(item => ({ url: item.url }))
- }
- this.$nextTick(() => {
- this.getinitlbslist()
- this.formType = 2
- this.formBool = true
- })
- })
- }
- },
- details: {
- click: ({ row, index, column }) => {
- this.getClassifyListData()
- qualityFeedbackDetail({
- id: row.id
- }).then(res => {
- this.formData = {
- ...res.data,
- fujian: res.data.items.filter(item => item.type === 'FILE').map(item => ({ url: item.url })),
- neijitiaoma: res.data.items
- .filter(item => item.type === 'INSIDE_CODE')
- .map(item => ({ url: item.url })),
- waijitiaoma: res.data.items.filter(item => item.type === 'OUT_CODE').map(item => ({ url: item.url })),
- qita: res.data.items.filter(item => item.type === 'OTHER').map(item => ({ url: item.url }))
- }
- this.$nextTick(() => {
- this.getinitlbslist()
- this.formType = 3
- this.formBool = true
- })
- })
- }
- }
- })
- },
- handleClose() {
- this.$refs?.pageRef?.refreshList()
- this.$data.formData = this.$options.data().formData
- this.formType = 0
- this.formBool = false
- },
- formConfirm() {
- this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
- if (valid) {
- ;(this.formData.id ? qualityFeedbackUpdate : qualityFeedbackAdd)({
- ...this.formData,
- items: [
- ...this.formData.neijitiaoma.map(item => ({
- qualityFeedbckId: this.formData.id || undefined,
- type: 'INSIDE_CODE',
- url: item.url
- })),
- ...this.formData.waijitiaoma.map(item => ({
- qualityFeedbckId: this.formData.id || undefined,
- type: 'OUT_CODE',
- url: item.url
- })),
- ...this.formData.qita.map(item => ({
- qualityFeedbckId: this.formData.id || undefined,
- type: 'OTHER',
- url: item.url
- })),
- ...this.formData.fujian.map(item => ({
- qualityFeedbckId: this.formData.id || undefined,
- type: 'FILE',
- url: item.url
- }))
- ],
- fujian: undefined,
- neijitiaoma: undefined,
- waijitiaoma: undefined,
- qita: undefined
- }).then(res => {
- this.$message({ type: 'success', message: '提交成功!' })
- this.$refs.pageRef.refreshList()
- this.handleClose()
- })
- }
- })
- },
- formConfirmShenHe() {
- this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
- if (valid) {
- qualityFeedbackConfirm({
- id: this.formData.id,
- status: this.formData.status,
- remark: this.formData.remark
- }).then(res => {
- this.$message({ type: 'success', message: '审核成功!' })
- this.$refs.pageRef.refreshList()
- this.handleClose()
- })
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .neibuview {
- box-sizing: border-box;
- padding-left: 16px;
- ::v-deep & > .zj-page-fill-scroll {
- box-sizing: border-box;
- padding-right: 16px;
- & > div:nth-child(1) {
- margin-top: 20px;
- }
- }
- }
- </style>
|