You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
872 lines
30 KiB
872 lines
30 KiB
<template>
|
|
<div class="app-container">
|
|
<!--Start 列表页面-->
|
|
<div v-show="viewState === 1">
|
|
<button-bar view-title="常用配置管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
|
<div class="main-content">
|
|
<div class="searchcon">
|
|
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
|
<div v-show="isSearchShow" class="search">
|
|
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
|
|
<el-form-item label="颜色">
|
|
<el-select v-model="listQuery.params.carColorKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in carColor_list" :key="item.dictKey" :label="item.dictValue"
|
|
:value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="缓速器">
|
|
<el-select v-model="listQuery.params.slowMachineKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in slowMachine_list" :key="item.dictKey" :label="item.dictValue"
|
|
:value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="后视镜">
|
|
<el-select v-model="listQuery.params.rearViewMirrorKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in rearViewMirror_list" :key="item.dictKey" :label="item.dictValue"
|
|
:value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="轮胎">
|
|
<el-select v-model="listQuery.params.tireSizeKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in tireSize_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="驾驶室">
|
|
<el-select v-model="listQuery.params.specificationKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in specification_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="后桥速比">
|
|
<el-select v-model="listQuery.params.rearAxleRatioKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in rearAxleRatio_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="空调">
|
|
<el-select v-model="listQuery.params.airConditionerKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in airConditioner_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="轮毂材质">
|
|
<el-select v-model="listQuery.params.hubMaterialKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in hubMaterial_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="导流罩">
|
|
<el-select v-model="listQuery.params.baffleModelKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in baffleModel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="悬架">
|
|
<el-select v-model="listQuery.params.suspensionKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in suspension_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="座椅">
|
|
<el-select v-model="listQuery.params.seatKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in seat_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="护轮罩">
|
|
<el-select v-model="listQuery.params.tireCoverKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in tireCover_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="鞍座">
|
|
<el-select v-model="listQuery.params.saddleKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in saddle_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="轴距">
|
|
<el-select v-model="listQuery.params.wheelbaseKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in wheelbase_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="保险杠">
|
|
<el-select v-model="listQuery.params.bumperKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in bumper_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="配置包">
|
|
<el-select v-model="listQuery.params.configuringBaoKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in configuringBao_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="独立热源">
|
|
<el-select v-model="listQuery.params.independentSourcesKey" placeholder="请选择" filterable clearable
|
|
class="addinputw">
|
|
<el-option v-for="item in independentSources_list" :key="item.dictKey" :label="item.dictValue"
|
|
:value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="燃料箱">
|
|
<el-select v-model="listQuery.params.fuelTankKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in fuelTank_list" :key="item.dictKey" :label="item.dictValue"
|
|
:value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="多媒体">
|
|
<el-select v-model="listQuery.params.multimediaKey" placeholder="请选择" filterable clearable class="addinputw">
|
|
<el-option v-for="item in multimedia_list" :key="item.dictKey" :label="item.dictValue"
|
|
:value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="常用配置名称">
|
|
<el-input v-model="listQuery.params.configName" maxlength="125" placeholder="请输入常用配置名称"
|
|
class="addinputw" clearable/>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div class="btn" style="text-align: center;">
|
|
<el-button type="primary" @click="handleFilter">查询</el-button>
|
|
<el-button type="primary" @click="resetQuery">重置</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="listtop">
|
|
<div class="tit">常用配置列表</div>
|
|
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
|
:limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
|
</div>
|
|
<div class="">
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;"
|
|
@selection-change="handleSelectionChange">
|
|
<el-table-column width="50px" type="selection" align="center"/>
|
|
<el-table-column fixed width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
|
|
<el-table-column fixed label="操作" align="center" width="80px" class-name="small-padding fixed-width">
|
|
<template slot-scope="{row}">
|
|
<el-button size="mini" type="primary" @click="handleCheck(row)">查看</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="关联状态" align="center">
|
|
<template slot-scope="scope">
|
|
<span class="bluezi" @click="handleOpen(scope.row)">{{
|
|
scope.row.isRelationState === 1 ? '已关联' : '未关联'
|
|
}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="使用状态" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.isUseState === 1 ? '已使用' : '未使用' }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="颜色" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.carColor }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="缓速器" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.slowMachine }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="后视镜" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.rearViewMirror }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="轮胎" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.tireSize }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="驾驶室" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.specification }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="后桥速比" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.rearAxleRatio }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="空调" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.airConditioner }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="轮毂材质" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.hubMaterial }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="导流罩" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.baffleModel }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="悬架" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.suspension }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="座椅" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.seat }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="护轮罩" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.tireCover }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="鞍座" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.saddle }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="轴距" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.wheelbase }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="保险杠" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.bumper }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="配置包" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.configuringBao }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="独立热源" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.independentSources }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="燃料箱" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.fuelTank }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="多媒体" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.multimedia }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="货箱" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.packingCase }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div class="pages">
|
|
<!-- 翻页 -->
|
|
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
|
:limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--End 列表页面-->
|
|
<changyongpeizhi-add v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="getList"></changyongpeizhi-add>
|
|
<changyongpeizhi-info v-show="viewState == 4" ref="divinfo" @doback="resetState"></changyongpeizhi-info>
|
|
<changyongpeizhi-rel v-show="viewState == 5" ref="relation" @doback="resetState" @reloadlist="getList"></changyongpeizhi-rel>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { deleteBySids, getList, pullDown } from '@/api/cheliang/basemodelconfig'
|
|
import Pagination from '@/components/pagination'
|
|
import pageye from '@/components/pagination/pageye'
|
|
import ButtonBar from '@/components/ButtonBar'
|
|
import changyongpeizhiAdd from './changyongpeizhiAdd'
|
|
import changyongpeizhiInfo from './changyongpeizhiInfo'
|
|
import changyongpeizhiRel from './ohter/changyongpeizhiRel'
|
|
|
|
export default {
|
|
name: 'chexingpeizhi',
|
|
components: {
|
|
changyongpeizhiRel,
|
|
Pagination,
|
|
pageye,
|
|
ButtonBar,
|
|
changyongpeizhiAdd,
|
|
changyongpeizhiInfo,
|
|
},
|
|
// directives: {
|
|
// drag: {
|
|
// // 指令的定义
|
|
// bind: function(el) {
|
|
// const odiv = el // 获取当前元素
|
|
// el.onmousedown = (e) => {
|
|
// // 算出鼠标相对元素的位置
|
|
// const disX = e.clientX - odiv.offsetLeft
|
|
// const disY = e.clientY - odiv.offsetTop
|
|
// let left = ''
|
|
// let top = ''
|
|
// document.onmousemove = (e) => {
|
|
// // 用鼠标的位置减去鼠标相对元素的位置,得到元素的位置
|
|
// left = e.clientX - disX
|
|
// top = e.clientY - disY
|
|
// // 绑定元素位置到positionX和positionY上面
|
|
// // 移动当前元素
|
|
// odiv.style.left = left + 'px'
|
|
// odiv.style.top = top + 'px'
|
|
// }
|
|
// document.onmouseup = (e) => {
|
|
// document.onmousemove = null
|
|
// document.onmouseup = null
|
|
// }
|
|
// }
|
|
// }
|
|
// },
|
|
// // 注册一个局部的自定义指令 v-focus
|
|
// focus: {
|
|
// // 指令的定义
|
|
// inserted: function(el) {
|
|
// // 聚焦元素
|
|
// el.querySelector('input').focus()
|
|
// }
|
|
// }
|
|
// },
|
|
data() {
|
|
return {
|
|
viewState: 1,
|
|
isSearchShow: false,
|
|
searchxianshitit: '显示查询条件',
|
|
btndisabled: false,
|
|
btnList: [
|
|
{
|
|
type: 'primary',
|
|
size: 'small',
|
|
icon: 'plus',
|
|
btnKey: 'toAdd',
|
|
btnLabel: '新增'
|
|
},
|
|
{
|
|
type: 'primary',
|
|
size: 'small',
|
|
icon: 'edit',
|
|
btnKey: 'toEdit',
|
|
btnLabel: '编辑'
|
|
},
|
|
{
|
|
type: 'danger',
|
|
size: 'small',
|
|
icon: 'del',
|
|
btnKey: 'doDel',
|
|
btnLabel: '删除'
|
|
},
|
|
{
|
|
type: 'info',
|
|
size: 'small',
|
|
icon: 'cross',
|
|
btnKey: 'doClose',
|
|
btnLabel: '关闭'
|
|
}
|
|
],
|
|
// 查询 -----------
|
|
tableKey: 0,
|
|
// list: null,
|
|
list: [],
|
|
namesArr: '',
|
|
vehicleSid: '',
|
|
FormLoading: false,
|
|
listLoading: false,
|
|
listQuery: {
|
|
params: {
|
|
airConditionerKey: '', // 空调key
|
|
baffleModelKey: '',
|
|
bumperKey: '',
|
|
carColorKey: '',
|
|
configName: '',
|
|
configuringBaoKey: '',
|
|
fuelTankKey: '',
|
|
hubMaterialKey: '',
|
|
independentSourcesKey: '',
|
|
multimediaKey: '',
|
|
rearAxleRatioKey: '',
|
|
rearViewMirrorKey: '',
|
|
saddleKey: '',
|
|
seatKey: '',
|
|
slowMachineKey: '',
|
|
specificationKey: '',
|
|
suspensionKey: '',
|
|
tireCoverKey: '',
|
|
tireSizeKey: '',
|
|
wheelbaseKey: ''
|
|
},
|
|
current: 1,
|
|
total: 0,
|
|
size: 10
|
|
},
|
|
selectDate: undefined,
|
|
temp: {}, // 添加和修改
|
|
templook: {}, // 查看实体
|
|
textMap: {
|
|
update: '编辑',
|
|
create: '创建'
|
|
},
|
|
sids: [],
|
|
names: '', // [ {{names}} ]
|
|
chesid: '',
|
|
dialogFormVisible: false, // 添加修改对话框状态
|
|
dialogFormShowVisible: false, // 查看对话框默认关闭状态
|
|
dialogStatus: '', // 对话框状态
|
|
typeOptions: [],
|
|
carColor_list: [], // 车身颜色
|
|
slowMachine_list: [], // 缓速器
|
|
rearViewMirror_list: [], // 后视镜
|
|
tireSize_list: [], // 轮胎规格
|
|
specification_list: [], // 驾驶室
|
|
rearAxleRatio_list: [], // 后桥速比
|
|
airConditioner_list: [], // 空调
|
|
hubMaterial_list: [], // 轮毂材质
|
|
baffleModel_list: [], // 导流罩
|
|
suspension_list: [], // 悬架
|
|
seat_list: [], // 座椅
|
|
tireCover_list: [], // 护轮罩
|
|
saddle_list: [], // 鞍座
|
|
wheelbase_list: [], // 轴距
|
|
bumper_list: [], // 保险杠
|
|
configuringBao_list: [], // 配置包
|
|
independentSources_list: [], // 独立热源
|
|
fuelTank_list: [], // 油箱
|
|
multimedia_list: [], // 多媒体
|
|
rules: {}
|
|
}
|
|
},
|
|
mounted() {
|
|
this.$refs["btnbar"].setButtonList(this.btnList)
|
|
},
|
|
created() {
|
|
this.getList() // 加载列表
|
|
this.getType()
|
|
},
|
|
methods: {
|
|
// 搜索条件效果
|
|
clicksearchShow() {
|
|
this.isSearchShow = !this.isSearchShow
|
|
if (this.isSearchShow) {
|
|
this.searchxianshitit = '隐藏查询条件'
|
|
} else {
|
|
this.searchxianshitit = '显示查询条件'
|
|
}
|
|
},
|
|
init() {
|
|
var name = this.$store.state.modelName
|
|
console.log('789988888', name)
|
|
this.names = name
|
|
console.log('9639636', this.names)
|
|
},
|
|
btnHandle(btnKey) {
|
|
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
|
switch (btnKey) {
|
|
case 'toAdd':
|
|
this.toAdd()
|
|
break
|
|
case 'toEdit':
|
|
this.toEdit()
|
|
break
|
|
case 'doDel':
|
|
this.doDel()
|
|
break
|
|
case 'doClose':
|
|
this.doClose()
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
},
|
|
getType() {
|
|
// 下拉框-车身颜色
|
|
pullDown({
|
|
type: 'bodyColor'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.carColor_list = res.data
|
|
console.log('下拉框请求111', res.data)
|
|
}
|
|
})
|
|
// 缓速器
|
|
pullDown({
|
|
type: 'slowMachine '
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.slowMachine_list = res.data
|
|
console.log('下拉框请求缓速器', res.data)
|
|
}
|
|
})
|
|
// 后视镜
|
|
pullDown({
|
|
type: 'rearviewMirror '
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.rearViewMirror_list = res.data
|
|
console.log('下拉框请求后视镜', res.data)
|
|
}
|
|
})
|
|
// 轮胎规格
|
|
pullDown({
|
|
type: 'tiresize '
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.tireSize_list = res.data
|
|
console.log('下拉框请求轮胎规格', res.data)
|
|
}
|
|
})
|
|
// 驾驶室
|
|
pullDown({
|
|
type: 'specification '
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.specification_list = res.data
|
|
console.log('下拉框请求驾驶室', res.data)
|
|
}
|
|
})
|
|
// 后桥速比
|
|
pullDown({
|
|
type: 'rearAxleRatio'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.rearAxleRatio_list = res.data
|
|
console.log('下拉框请求后桥速比', res.data)
|
|
}
|
|
})
|
|
// 空调
|
|
pullDown({
|
|
type: 'whether'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.airConditioner_list = res.data
|
|
console.log('下拉框请求空调', res.data)
|
|
}
|
|
})
|
|
// 轮毂材质
|
|
pullDown({
|
|
type: 'hubMaterial'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.hubMaterial_list = res.data
|
|
console.log('下拉框请求轮毂材质', res.data)
|
|
}
|
|
})
|
|
// 导流罩
|
|
pullDown({
|
|
type: 'whether'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.baffleModel_list = res.data
|
|
console.log('下拉框请求导流罩', res.data)
|
|
}
|
|
})
|
|
// 悬架
|
|
pullDown({
|
|
type: 'suspension'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.suspension_list = res.data
|
|
console.log('下拉框请求悬架', res.data)
|
|
}
|
|
})
|
|
// 座椅
|
|
pullDown({
|
|
type: 'seat'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.seat_list = res.data
|
|
console.log('下拉框请求座椅', res.data)
|
|
}
|
|
})
|
|
// 护轮罩
|
|
pullDown({
|
|
type: 'whether'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.tireCover_list = res.data
|
|
console.log('下拉框请求护轮罩', res.data)
|
|
}
|
|
})
|
|
// 鞍座
|
|
pullDown({
|
|
type: 'saddle'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.saddle_list = res.data
|
|
console.log('下拉框请求护鞍座', res.data)
|
|
}
|
|
})
|
|
// 轴距
|
|
pullDown({
|
|
type: 'wheelbase'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.wheelbase_list = res.data
|
|
console.log('下拉框请求护轴距', res.data)
|
|
}
|
|
})
|
|
// 保险杠
|
|
pullDown({
|
|
type: 'bumper'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.bumper_list = res.data
|
|
console.log('下拉框请求护保险杠', res.data)
|
|
}
|
|
})
|
|
// 配置包
|
|
pullDown({
|
|
type: 'configuringBao'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.configuringBao_list = res.data
|
|
console.log('下拉框请求护配置包', res.data)
|
|
}
|
|
})
|
|
// 独立热源
|
|
pullDown({
|
|
type: 'whether'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.independentSources_list = res.data
|
|
console.log('下拉框请求护独立热源', res.data)
|
|
}
|
|
})
|
|
// 下拉框-油箱
|
|
pullDown({
|
|
type: 'fuelTank'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.fuelTank_list = res.data
|
|
console.log('下拉框请求111', res.data)
|
|
}
|
|
})
|
|
// 多媒体
|
|
pullDown({
|
|
type: 'whether'
|
|
}).then((res) => {
|
|
if (res.code === '200') {
|
|
this.multimedia_list = res.data
|
|
console.log('下拉框请求多媒体', res.data)
|
|
}
|
|
})
|
|
},
|
|
handleOpen(row) {
|
|
this.viewState = 5
|
|
this.$refs['relation'].init(row.sid)
|
|
},
|
|
// 返回
|
|
doClose() {
|
|
this.$store.dispatch('tagsView/delView', this.$route);
|
|
this.$router.go(-1)
|
|
},
|
|
// 序号
|
|
indexMethod(index) {
|
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
|
var pageindex = index + 1 + pagestart
|
|
return pageindex
|
|
},
|
|
resetState() {
|
|
this.viewState = 1
|
|
},
|
|
handleSelectionChange(row) {
|
|
const aa = []
|
|
row.forEach((element) => {
|
|
aa.push({
|
|
sid: element.sid,
|
|
relationState: element.isRelationState
|
|
})
|
|
})
|
|
this.sids = aa
|
|
console.log('选择的数据', this.sids)
|
|
},
|
|
// 查询列表信息
|
|
getList() {
|
|
this.listLoading = true
|
|
getList(this.listQuery).then((response) => {
|
|
this.listLoading = false
|
|
if (
|
|
response.code === '200' &&
|
|
response.data &&
|
|
response.data.total > 0
|
|
) {
|
|
this.list = response.data.records
|
|
this.listQuery.total = response.data.total
|
|
} else {
|
|
this.list = []
|
|
this.listQuery.total = 0
|
|
}
|
|
})
|
|
},
|
|
// 查询按钮
|
|
handleFilter() {
|
|
this.listQuery.current = 1
|
|
this.getList()
|
|
},
|
|
// 重置
|
|
resetQuery() {
|
|
this.listQuery.params = {
|
|
airConditionerKey: '', // 空调key
|
|
baffleModelKey: '',
|
|
bumperKey: '',
|
|
carColorKey: '',
|
|
configName: '',
|
|
configuringBaoKey: '',
|
|
fuelTankKey: '',
|
|
hubMaterialKey: '',
|
|
independentSourcesKey: '',
|
|
multimediaKey: '',
|
|
rearAxleRatioKey: '',
|
|
rearViewMirrorKey: '',
|
|
saddleKey: '',
|
|
seatKey: '',
|
|
slowMachineKey: '',
|
|
specificationKey: '',
|
|
suspensionKey: '',
|
|
tireCoverKey: '',
|
|
tireSizeKey: '',
|
|
wheelbaseKey: ''
|
|
}
|
|
this.getList()
|
|
},
|
|
// 打开添加
|
|
toAdd() {
|
|
this.viewState = 2
|
|
this.$refs['divadd'].showAdd()
|
|
},
|
|
// 打开修改
|
|
toEdit() {
|
|
if (this.sids.length === 1) {
|
|
this.dialogStatus = 'update'
|
|
this.viewState = 3
|
|
const sid = this.sids[0]
|
|
this.$refs['divadd'].showEdit(sid)
|
|
} else if (this.sids.length > 1) {
|
|
this.$notify({
|
|
title: '提示',
|
|
message: '不能选中多个车型配置修改!!',
|
|
type: 'info',
|
|
duration: 2000
|
|
})
|
|
} else {
|
|
this.$notify({
|
|
title: '提示',
|
|
message: '没有选择车型配置!!',
|
|
type: 'error',
|
|
duration: 2000
|
|
})
|
|
return
|
|
}
|
|
},
|
|
// 打开查看
|
|
handleCheck(row) {
|
|
console.log('111', row)
|
|
this.viewState = 4
|
|
const sid = row.sid
|
|
this.$refs['divinfo'].showInfo(sid, row)
|
|
},
|
|
// 根据本行ID删除数据
|
|
doDel() {
|
|
console.log('删除', this.sids)
|
|
const _this = this
|
|
const bb = []
|
|
this.sids.forEach((e) => {
|
|
bb.push(e.sid)
|
|
})
|
|
console.log(bb, 666666)
|
|
if (this.sids.length > 0) {
|
|
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
|
this.$confirm(tip, '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
.then(() => {
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: 'Loading',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
})
|
|
var sids = bb.join(',')
|
|
console.log('删除的数据', sids)
|
|
const params = {
|
|
sids:sids,
|
|
userSid:window.sessionStorage.getItem('userSid')
|
|
}
|
|
deleteBySids(params).then(resp => {
|
|
if (resp.success && resp.code == '200'){
|
|
loading.close()
|
|
_this.$message({ type: 'success', message: resp.msg, showClose: true })
|
|
_this.getList()
|
|
}else {
|
|
loading.close()
|
|
// _this.$message({ type: 'error', message: resp.msg, showClose: true })
|
|
}
|
|
})
|
|
.catch(e => {
|
|
loading.close()
|
|
})
|
|
})
|
|
.catch(() => {
|
|
})
|
|
} else {
|
|
this.$message({
|
|
showClose: true,
|
|
message: '没有选择车型配置!!',
|
|
type: 'warning'
|
|
})
|
|
return
|
|
}
|
|
},
|
|
// 导出
|
|
handleDaoChu() {
|
|
this.$confirm('确定要导出数据, 是否继续?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style scoped>
|
|
/deep/ .el-collapse {
|
|
border-top: 0px solid #e6ebf5;
|
|
border-bottom: 0px solid #e6ebf5;
|
|
}
|
|
|
|
/deep/ .el-collapse-item__content {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
/deep/ .el-collapse-item__wrap {
|
|
border-bottom: 0px solid #ebeef5;
|
|
}
|
|
|
|
/deep/ .el-collapse-item__header {
|
|
border-bottom: 0px solid #e6ebf5;
|
|
}
|
|
.listtop {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
border: 1px solid #dfe4ed;
|
|
height: 40px;
|
|
}
|
|
|
|
.tit {
|
|
margin-bottom: -10px;
|
|
}
|
|
|
|
.pagination {
|
|
margin-bottom: -10px;
|
|
}
|
|
|
|
.btn {
|
|
padding: 15px 0 15px 0;
|
|
border: 1px solid #e0e3eb;
|
|
}
|
|
|
|
.tab-header {
|
|
background-color: #edf1f7;
|
|
padding: 8px 20px;
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.tab-header /deep/ .el-form-item {
|
|
margin-bottom: 10px;
|
|
}
|
|
</style>
|
|
|