|
|
@ -1,193 +1,181 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<div v-show="viewState === 1"> |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<div>车辆台账</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" @click="handleCreate()">新增</el-button> |
|
|
|
<el-button type="primary" size="small" @click="handleUpdate()">修改</el-button> |
|
|
|
<el-button type="danger" size="small" @click="handleDelete()">删除</el-button> |
|
|
|
<!-- <el-button type="primary" size="small" @click="handleDaoRu()">导入</el-button> --> |
|
|
|
<el-button type="success" size="small" @click="handleDaoChu()">导出</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<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-input v-model="listQuery.location" placeholder="请输入存放地点" clearable class="filter-item"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="车型名称"> |
|
|
|
<el-input v-model="listQuery.modelName" placeholder="请输入车型名称" clearable class="filter-item"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="库存状态"> |
|
|
|
<el-select v-model="temp.vehicleState" class="addinputw" clearable placeholder=""> |
|
|
|
<el-option v-for="(item,index) in typeOptions" :label="item.dictValue" :key="item.dictKey" |
|
|
|
:value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="车架号"> |
|
|
|
<el-input v-model="listQuery.vinNo" placeholder="请输入车架号" clearable class="filter-item"/> |
|
|
|
</el-form-item> |
|
|
|
<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.location" class="addinputw" clearable placeholder=""> |
|
|
|
<el-option v-for="(item,index) in location_list" :key="item.sid" :label="item.warehouseName" |
|
|
|
:value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="车型名称"> |
|
|
|
<el-input v-model="listQuery.params.modelName" placeholder="请输入车型名称" clearable class="filter-item"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="库存状态"> |
|
|
|
<el-select v-model="listQuery.params.vehicleState" class="addinputw" clearable placeholder=""> |
|
|
|
<el-option v-for="(item,index) in vehicleState_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.vinNo" placeholder="请输入车架号" clearable class="filter-item"/> |
|
|
|
</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="handleReset">重置</el-button> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="listtop"> |
|
|
|
<div class="tit">车辆台账信息列表</div> |
|
|
|
<pageye v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" |
|
|
|
class="pagination" @pagination="getList"/> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<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 width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="操作" align="center" width="280px" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-button size="mini" type="primary" @click="handleCheck(row)">查看</el-button> |
|
|
|
<el-button size="mini" type="primary" @click="cheLiangXiangXiPeiZhi(row)">车型配置</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车型名称" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.modelName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车架号" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vinNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="发动机号/许可证" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.engineNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="存放地点" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.locationName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="库存状态" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleStateValue }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<div class="pages"> |
|
|
|
<!-- 翻页 --> |
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" |
|
|
|
class="pagination" @pagination="getList"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="listtop"> |
|
|
|
<div class="tit">车辆台账信息列表</div> |
|
|
|
<pageye v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" |
|
|
|
class="pagination" @pagination="getList"/> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<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 width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="车型名称" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.modelName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车架号" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vinNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="发动机号/许可证" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.engineNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="存放地点" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.location }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="库存状态" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleStateValue }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column label="库龄" align="center">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <span>{{ scope.row.phone }}</span>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<el-table-column label="操作" align="center" width="280px" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-button size="mini" type="primary" @click="handleCheck(row)">查看</el-button> |
|
|
|
<el-button size="mini" type="primary" @click="cheLiangXiangXiPeiZhi(row)">车型配置</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<div class="pages"> |
|
|
|
<!-- 翻页 --> |
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" |
|
|
|
class="pagination" @pagination="getList"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<cheliangtaizhang-add v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" |
|
|
|
@reloadlist="getList"></cheliangtaizhang-add> |
|
|
|
<cheliangtaizhang-info v-show="viewState == 4" ref="divinfo" @doback="resetState"></cheliangtaizhang-info> |
|
|
|
<!-- 车辆配置 --> |
|
|
|
<changyongpeizhi-add v-show="viewState == 5" ref="divPeizhi" @doback="resetState"/> |
|
|
|
<changyongpeizhi-info v-show="viewState == 5" ref="divPeizhi" @doback="resetState"></changyongpeizhi-info> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { basefinbankExportExcel, deleteBySids, pagerList } from '@/api/cheliang/basevehicle' |
|
|
|
import { |
|
|
|
basefinbankExportExcel, |
|
|
|
deleteBySids, |
|
|
|
fetchByUseOrgSid, |
|
|
|
getUseOrgByUserSid, |
|
|
|
pagerList |
|
|
|
} from '@/api/cheliang/basevehicle' |
|
|
|
import { typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
import cheliangtaizhangAdd from './cheliangtaizhangAdd' |
|
|
|
import chexingpeizhiInfo from '../chexingpeizhi/changyongpeizhi' |
|
|
|
// import { getFileType, parseDate, parseTime, ConvertMenuState } from "@/utils"; |
|
|
|
// import { findButtonByUserId } from '@/api/sys/permission' |
|
|
|
import Pagination from '@/components/pagination' |
|
|
|
import pageye from '@/components/pagination/pageye' |
|
|
|
import CheliangtaizhangInfo from './cheliangtaizhangInfo' |
|
|
|
import changyongpeizhiAdd from '@/views/cheliang/chexingpeizhi/changyongpeizhiAdd' |
|
|
|
import ChangyongpeizhiInfo from '@/views/cheliang/chexingpeizhi/changyongpeizhiInfo' |
|
|
|
import ButtonBar from '@/components/ButtonBar' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'Pinpaiguanli', |
|
|
|
components: { |
|
|
|
CheliangtaizhangInfo, |
|
|
|
ChangyongpeizhiInfo, |
|
|
|
Pagination, |
|
|
|
pageye, |
|
|
|
ButtonBar, |
|
|
|
cheliangtaizhangAdd, |
|
|
|
chexingpeizhiInfo, |
|
|
|
changyongpeizhiAdd |
|
|
|
CheliangtaizhangInfo |
|
|
|
}, |
|
|
|
// 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, |
|
|
|
// --按钮菜单------- |
|
|
|
menuState: { |
|
|
|
add: false, // 添加 |
|
|
|
edit: false, // 编辑 |
|
|
|
delete: false, // 删除 |
|
|
|
view: false, // 查看 |
|
|
|
audit: false, // 审核 |
|
|
|
input: false, // 导入 |
|
|
|
output: false, // 导出 |
|
|
|
upload: false, // 同步 |
|
|
|
release: false // 下发 |
|
|
|
}, |
|
|
|
btnList: [ |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: 'el-icon-plus', |
|
|
|
btnKey: 'toAdd', |
|
|
|
btnLabel: '新增' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: 'el-icon-edit', |
|
|
|
btnKey: 'toEdit', |
|
|
|
btnLabel: '编辑' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'danger', |
|
|
|
size: 'small', |
|
|
|
icon: 'el-icon-delete', |
|
|
|
btnKey: 'doDel', |
|
|
|
btnLabel: '删除' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'success', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'doExport', |
|
|
|
btnLabel: '导出' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'info', |
|
|
|
size: 'small', |
|
|
|
icon: 'el-icon-close', |
|
|
|
btnKey: 'doClose', |
|
|
|
btnLabel: '关闭' |
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
// 查询 ----------- |
|
|
|
tableKey: 0, |
|
|
|
// list: null, |
|
|
|
list: [], |
|
|
|
total: 1, |
|
|
|
FormLoading: false, |
|
|
|
FormLoading: false, |
|
|
|
listLoading: false, |
|
|
|
listQuery: { |
|
|
|
// pageNumber: 1, |
|
|
|
// pageSize: 20, |
|
|
|
vinNo: '', |
|
|
|
modelName: '', |
|
|
|
// vehicleState: '', |
|
|
|
params: { |
|
|
|
location: '', |
|
|
|
modelName: '', |
|
|
|
vehicleState: '', |
|
|
|
vinNo: '' |
|
|
|
}, |
|
|
|
current: 1, |
|
|
|
size: 20 |
|
|
|
}, |
|
|
@ -203,336 +191,364 @@ export default { |
|
|
|
dialogFormVisible: false, // 添加修改对话框状态 |
|
|
|
dialogFormShowVisible: false, // 查看对话框默认关闭状态 |
|
|
|
dialogStatus: '', // 对话框状态 |
|
|
|
typeOptions: [] |
|
|
|
typeOptions: [], |
|
|
|
location_list: [], |
|
|
|
vehicleState_list: [] |
|
|
|
|
|
|
|
// ------------------------------------ |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapGetters([ |
|
|
|
'id', |
|
|
|
'roles', |
|
|
|
'rolesIds', |
|
|
|
'departmentId', |
|
|
|
'departmentCode' |
|
|
|
]) |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// 初始化变量 |
|
|
|
this.init() |
|
|
|
// 加载列表 |
|
|
|
this.getList() |
|
|
|
this.getUseOrg() |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$refs['btnbar'].setButtonList(this.btnList) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 搜索条件效果 |
|
|
|
clicksearchShow() { |
|
|
|
this.isSearchShow = !this.isSearchShow |
|
|
|
if (this.isSearchShow) { |
|
|
|
this.searchxianshitit = '隐藏查询条件' |
|
|
|
} else { |
|
|
|
this.searchxianshitit = '显示查询条件' |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapGetters([ |
|
|
|
'id', |
|
|
|
'roles', |
|
|
|
'rolesIds', |
|
|
|
'departmentId', |
|
|
|
'departmentCode' |
|
|
|
]) |
|
|
|
init() { |
|
|
|
// 根据当前用户. 加载当前页面的按钮权限 |
|
|
|
// findButtonByUserId(this.$route.path).then(response => { |
|
|
|
// if ( |
|
|
|
// response.code === 20000 && |
|
|
|
// response.data && |
|
|
|
// response.data.length > 0 |
|
|
|
// ) { |
|
|
|
// this.menuState = ConvertMenuState(response.data) // 处理各按钮显示状态 |
|
|
|
// } |
|
|
|
// }) |
|
|
|
this.setDater() |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// 初始化变量 |
|
|
|
this.init() |
|
|
|
// 加载列表 |
|
|
|
this.getList() |
|
|
|
// 序号 |
|
|
|
indexMethod(index) { |
|
|
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|
|
|
var pageindex = index + 1 + pagestart |
|
|
|
return pageindex |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 搜索条件效果 |
|
|
|
clicksearchShow() { |
|
|
|
this.isSearchShow = !this.isSearchShow |
|
|
|
if (this.isSearchShow) { |
|
|
|
this.searchxianshitit = '隐藏查询条件' |
|
|
|
} else { |
|
|
|
this.searchxianshitit = '显示查询条件' |
|
|
|
resetState() { |
|
|
|
this.viewState = 1 |
|
|
|
}, |
|
|
|
btnHandle(btnKey) { |
|
|
|
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|
|
|
switch (btnKey) { |
|
|
|
case 'toAdd': |
|
|
|
this.toAdd() |
|
|
|
break |
|
|
|
case 'toEdit': |
|
|
|
this.toEdit() |
|
|
|
break |
|
|
|
case 'doDel': |
|
|
|
this.doDel() |
|
|
|
break |
|
|
|
case 'doExport': |
|
|
|
this.doExport() |
|
|
|
break |
|
|
|
case 'doClose': |
|
|
|
this.doClose() |
|
|
|
break |
|
|
|
default: |
|
|
|
break |
|
|
|
} |
|
|
|
}, |
|
|
|
setDater() { |
|
|
|
typeValues({ type: 'vehicleLedgerState' }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.vehicleState_list = res.data |
|
|
|
} |
|
|
|
}, |
|
|
|
init() { |
|
|
|
// 根据当前用户. 加载当前页面的按钮权限 |
|
|
|
// findButtonByUserId(this.$route.path).then(response => { |
|
|
|
// if ( |
|
|
|
// response.code === 20000 && |
|
|
|
// response.data && |
|
|
|
// response.data.length > 0 |
|
|
|
// ) { |
|
|
|
// this.menuState = ConvertMenuState(response.data) // 处理各按钮显示状态 |
|
|
|
// } |
|
|
|
// }) |
|
|
|
this.setDater() |
|
|
|
}, |
|
|
|
// 序号 |
|
|
|
indexMethod(index) { |
|
|
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|
|
|
var pageindex = index + 1 + pagestart |
|
|
|
return pageindex |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.viewState = 1 |
|
|
|
}, |
|
|
|
setDater() { |
|
|
|
typeValues({ type: 'vehicleLedgerState' }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.typeOptions = res.data |
|
|
|
console.log(JSON.stringify(this.typeOptions), 22222222222) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 查询列表信息 |
|
|
|
getList() { |
|
|
|
this.listLoading = true |
|
|
|
pagerList({ |
|
|
|
current: this.listQuery.current, |
|
|
|
size: this.listQuery.size, |
|
|
|
params: { |
|
|
|
vinNo: this.listQuery.vinNo, |
|
|
|
modelName: this.listQuery.modelName, |
|
|
|
location: this.listQuery.location, |
|
|
|
vehicleState: this.listQuery.vehicleState |
|
|
|
} |
|
|
|
}).then((response) => { |
|
|
|
// console.log('列表查询结果:' + JSON.stringify(response)) |
|
|
|
this.listLoading = false |
|
|
|
if ( |
|
|
|
response.code === '200' && |
|
|
|
response.data && |
|
|
|
response.data.total > 0 |
|
|
|
) { |
|
|
|
this.list = response.data.records |
|
|
|
this.total = response.data.total |
|
|
|
} else { |
|
|
|
this.list = [] |
|
|
|
this.total = 0 |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 查询按钮 |
|
|
|
handleFilter() { |
|
|
|
this.listQuery.current = 1 |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
// 重置 |
|
|
|
handleReset() { |
|
|
|
this.listQuery = { |
|
|
|
vinNo: '', |
|
|
|
modelName: '', |
|
|
|
location: '', |
|
|
|
vehicleState: '', |
|
|
|
// vehicleState: '', |
|
|
|
current: 1, |
|
|
|
size: 20 |
|
|
|
}) |
|
|
|
}, |
|
|
|
getUseOrg() { |
|
|
|
const userSid = window.sessionStorage.getItem('userSid') |
|
|
|
getUseOrgByUserSid({ userSid: userSid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.useOrgName = res.data.name |
|
|
|
this.useOrg = res.data.sid |
|
|
|
this.getLocation(res.data.sid) |
|
|
|
} |
|
|
|
}, |
|
|
|
// ----------------------------------方法-------------------- |
|
|
|
// 添加前数据初始化 |
|
|
|
resetTemp() { |
|
|
|
this.temp = { |
|
|
|
jc: '', // false string |
|
|
|
organizationId: '', // false string |
|
|
|
qc: '', // false string |
|
|
|
remark: '', // false |
|
|
|
string: '', // |
|
|
|
state: '' // 状态 |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 根据组织获得存放地点 |
|
|
|
getLocation(useOrg) { |
|
|
|
// 存放地点 |
|
|
|
fetchByUseOrgSid({ |
|
|
|
sid: useOrg |
|
|
|
}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.location_list = res.data |
|
|
|
console.log('存放地点', this.location_list) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSelectionChange(row) { |
|
|
|
this.multipleSelection = row |
|
|
|
const aa = [] |
|
|
|
row.forEach((element) => { |
|
|
|
aa.push(element.sid) |
|
|
|
}) |
|
|
|
this.sids = aa |
|
|
|
}, |
|
|
|
// 打开添加 |
|
|
|
handleCreate() { |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divadd'].showAdd() |
|
|
|
// this.$router.push({ path: '/cheliang/cheliangtaizhangAdd/0' }) |
|
|
|
}, |
|
|
|
// 打开配置 |
|
|
|
cheLiangXiangXiPeiZhi(row) { |
|
|
|
this.viewState = 5 |
|
|
|
this.$refs['divPeizhi'].showEdit(row) |
|
|
|
// console.log(78988888, row) |
|
|
|
// this.$router.push({ |
|
|
|
// path: '/cheliang/xiangxipeizhi', |
|
|
|
// query: { sid: row.sid } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 提交添加数据 |
|
|
|
createData() { |
|
|
|
// console.log('提交:' + JSON.stringify(this.temp)) |
|
|
|
// this.$refs['dataForm'].validate(valid => { |
|
|
|
// if (valid) { |
|
|
|
// this.FormLoading = true |
|
|
|
// addServiceType(this.temp).then(response => { |
|
|
|
// // console.log('数据聚聚聚' + JSON.stringify(response)) |
|
|
|
// this.FormLoading = false |
|
|
|
// if (response.code === 20000) { |
|
|
|
// this.dialogFormVisible = false |
|
|
|
// this.$notify({ |
|
|
|
// title: '提示', |
|
|
|
// message: '添加成功', |
|
|
|
// type: 'success', |
|
|
|
// duration: 2000 |
|
|
|
// }) |
|
|
|
// this.getList() |
|
|
|
// } else { |
|
|
|
// this.$notify({ |
|
|
|
// title: '提示', |
|
|
|
// message: '添加失败', |
|
|
|
// type: 'error', |
|
|
|
// duration: 2000 |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 打开修改 |
|
|
|
handleUpdate() { |
|
|
|
if (this.sids.length === 1) { |
|
|
|
this.dialogStatus = 'update' |
|
|
|
this.viewState = 3 |
|
|
|
const sid = this.sids[0] |
|
|
|
this.$refs['divadd'].showEdit(sid) |
|
|
|
// this.$router.push({ |
|
|
|
// path: `/cheliang/cheliangtaizhangAdd/${this.sids[0]}` |
|
|
|
// }) |
|
|
|
} else if (this.sids.length > 1) { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '不能选中多个车辆台账修改!!', |
|
|
|
type: 'info', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 查询列表信息 |
|
|
|
getList() { |
|
|
|
this.listLoading = true |
|
|
|
pagerList(this.listQuery).then((response) => { |
|
|
|
// console.log('列表查询结果:' + JSON.stringify(response)) |
|
|
|
this.listLoading = false |
|
|
|
if ( |
|
|
|
response.code === '200' && |
|
|
|
response.data && |
|
|
|
response.data.total > 0 |
|
|
|
) { |
|
|
|
this.list = response.data.records |
|
|
|
this.total = response.data.total |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '没有选择车辆台账!!', |
|
|
|
type: 'error', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
this.list = [] |
|
|
|
this.total = 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
// 打开查看 |
|
|
|
handleCheck(row) { |
|
|
|
console.log('88888888888', row) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 查询按钮 |
|
|
|
handleFilter() { |
|
|
|
this.listQuery.current = 1 |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
// 重置 |
|
|
|
handleReset() { |
|
|
|
this.listQuery = { |
|
|
|
params: { |
|
|
|
location: '', |
|
|
|
modelName: '', |
|
|
|
vehicleState: '', |
|
|
|
vinNo: '' |
|
|
|
}, |
|
|
|
current: 1, |
|
|
|
size: 20 |
|
|
|
} |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
// ----------------------------------方法-------------------- |
|
|
|
// 添加前数据初始化 |
|
|
|
resetTemp() { |
|
|
|
this.temp = { |
|
|
|
jc: '', // false string |
|
|
|
organizationId: '', // false string |
|
|
|
qc: '', // false string |
|
|
|
remark: '', // false |
|
|
|
string: '', // |
|
|
|
state: '' // 状态 |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSelectionChange(row) { |
|
|
|
this.multipleSelection = row |
|
|
|
const aa = [] |
|
|
|
row.forEach((element) => { |
|
|
|
aa.push(element.sid) |
|
|
|
}) |
|
|
|
this.sids = aa |
|
|
|
}, |
|
|
|
// 打开添加 |
|
|
|
toAdd() { |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divadd'].showAdd() |
|
|
|
// this.$router.push({ path: '/cheliang/cheliangtaizhangAdd/0' }) |
|
|
|
}, |
|
|
|
// 打开配置 |
|
|
|
cheLiangXiangXiPeiZhi(row) { |
|
|
|
this.viewState = 5 |
|
|
|
this.$refs['divPeizhi'].showInfo(row.modelConfigSid) |
|
|
|
// console.log(78988888, row) |
|
|
|
// this.$router.push({ |
|
|
|
// path: '/cheliang/xiangxipeizhi', |
|
|
|
// query: { sid: row.sid } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 提交添加数据 |
|
|
|
createData() { |
|
|
|
// console.log('提交:' + JSON.stringify(this.temp)) |
|
|
|
// this.$refs['dataForm'].validate(valid => { |
|
|
|
// if (valid) { |
|
|
|
// this.FormLoading = true |
|
|
|
// addServiceType(this.temp).then(response => { |
|
|
|
// // console.log('数据聚聚聚' + JSON.stringify(response)) |
|
|
|
// this.FormLoading = false |
|
|
|
// if (response.code === 20000) { |
|
|
|
// this.dialogFormVisible = false |
|
|
|
// this.$notify({ |
|
|
|
// title: '提示', |
|
|
|
// message: '添加成功', |
|
|
|
// type: 'success', |
|
|
|
// duration: 2000 |
|
|
|
// }) |
|
|
|
// this.getList() |
|
|
|
// } else { |
|
|
|
// this.$notify({ |
|
|
|
// title: '提示', |
|
|
|
// message: '添加失败', |
|
|
|
// type: 'error', |
|
|
|
// duration: 2000 |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 打开修改 |
|
|
|
toEdit() { |
|
|
|
if (this.sids.length === 1) { |
|
|
|
this.dialogStatus = 'update' |
|
|
|
this.viewState = 3 |
|
|
|
const sid = this.sids[0] |
|
|
|
this.$refs['divadd'].showEdit(sid) |
|
|
|
// this.$router.push({ |
|
|
|
// path: '/cheliang/cheliangtaizhangInfo', |
|
|
|
// query: { sid: row.sid } |
|
|
|
// path: `/cheliang/cheliangtaizhangAdd/${this.sids[0]}` |
|
|
|
// }) |
|
|
|
this.viewState = 4 |
|
|
|
const sid = row.sid |
|
|
|
this.$refs['divinfo'].showInfo(sid) |
|
|
|
}, |
|
|
|
// 根据本行ID删除数据 |
|
|
|
handleDelete() { |
|
|
|
if (this.sids.length > 0) { |
|
|
|
const _this = this |
|
|
|
const tip = '请确认是否删除所选 ' + this.multipleSelection.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)' |
|
|
|
}) |
|
|
|
deleteBySids(this.sids) |
|
|
|
.then(resp => { |
|
|
|
loading.close() |
|
|
|
_this.$message({ type: 'success', message: resp.msg, showClose: true }) |
|
|
|
_this.getList() |
|
|
|
}) |
|
|
|
.catch(e => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
} 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('88888888888', row) |
|
|
|
// this.$router.push({ |
|
|
|
// path: '/cheliang/cheliangtaizhangInfo', |
|
|
|
// query: { sid: row.sid } |
|
|
|
// }) |
|
|
|
this.viewState = 4 |
|
|
|
const sid = row.sid |
|
|
|
this.$refs['divinfo'].showInfo(sid) |
|
|
|
}, |
|
|
|
// 根据本行ID删除数据 |
|
|
|
doDel() { |
|
|
|
if (this.sids.length > 0) { |
|
|
|
const _this = this |
|
|
|
const tip = '请确认是否删除所选 ' + this.multipleSelection.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)' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '没有选择车辆台账!!', |
|
|
|
type: 'error', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// this.$confirm('此操作将永久删除该行数据, 是否继续?', '提示', { |
|
|
|
// confirmButtonText: '确定', |
|
|
|
// cancelButtonText: '取消', |
|
|
|
// type: 'warning', |
|
|
|
// }) |
|
|
|
// .then(() => { |
|
|
|
// const tempData = Object.assign({}, row) // copy obj |
|
|
|
// // console.log('测试删除ID' + JSON.stringify(tempData.id)) |
|
|
|
// delServiceType(tempData.id).then(response => { |
|
|
|
// if (response.code === 20000) { |
|
|
|
// // console.log('测试删除' + JSON.stringify(response)) |
|
|
|
// this.$notify({ |
|
|
|
// title: '提示', |
|
|
|
// message: '删除成功', |
|
|
|
// type: 'success', |
|
|
|
// duration: 2000 |
|
|
|
// }) |
|
|
|
// this.getList() |
|
|
|
// } else { |
|
|
|
// this.$notify({ |
|
|
|
// title: '失败', |
|
|
|
// message: response.msg, |
|
|
|
// type: 'error' |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// .catch(() => { |
|
|
|
// this.$message({ |
|
|
|
// type: 'info', |
|
|
|
// message: '已取消删除' |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 导出 |
|
|
|
handleDaoChu() { |
|
|
|
// this.$confirm('确定要导出数据, 是否继续?', '提示', { |
|
|
|
// confirmButtonText: '确定', |
|
|
|
// cancelButtonText: '取消', |
|
|
|
// type: 'warning' |
|
|
|
// }) |
|
|
|
basefinbankExportExcel(this.sids).then((res) => { |
|
|
|
const blob = new Blob([res], { |
|
|
|
type: 'application/vnd.ms-excel' |
|
|
|
deleteBySids(this.sids) |
|
|
|
.then(resp => { |
|
|
|
loading.close() |
|
|
|
_this.$message({ type: 'success', message: resp.msg, showClose: true }) |
|
|
|
_this.getList() |
|
|
|
}) |
|
|
|
.catch(e => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
}) |
|
|
|
const objectUrl = URL.createObjectURL(blob) |
|
|
|
window.location.href = objectUrl |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '导出成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000 |
|
|
|
.catch(() => { |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '没有选择车辆台账!!', |
|
|
|
type: 'error', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
}, |
|
|
|
// 导出 |
|
|
|
doExport() { |
|
|
|
// this.$confirm('确定要导出数据, 是否继续?', '提示', { |
|
|
|
// confirmButtonText: '确定', |
|
|
|
// cancelButtonText: '取消', |
|
|
|
// type: 'warning' |
|
|
|
// }) |
|
|
|
basefinbankExportExcel(this.sids).then((res) => { |
|
|
|
const blob = new Blob([res], { |
|
|
|
type: 'application/vnd.ms-excel' |
|
|
|
}) |
|
|
|
const objectUrl = URL.createObjectURL(blob) |
|
|
|
window.location.href = objectUrl |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '导出成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
doClose(){ |
|
|
|
this.$store.dispatch('tagsView/delView', this.$route); |
|
|
|
this.$router.go(-1) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
/deep/ .el-collapse { |
|
|
|
border-top: 0px solid #e6ebf5; |
|
|
|
border-bottom: 0px solid #e6ebf5; |
|
|
|
} |
|
|
|
/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__content { |
|
|
|
margin: 0; |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-collapse-item__wrap { |
|
|
|
border-bottom: 0px solid #ebeef5; |
|
|
|
} |
|
|
|
/deep/ .el-collapse-item__wrap { |
|
|
|
border-bottom: 0px solid #ebeef5; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-collapse-item__header { |
|
|
|
border-bottom: 0px solid #e6ebf5; |
|
|
|
} |
|
|
|
/deep/ .el-collapse-item__header { |
|
|
|
border-bottom: 0px solid #e6ebf5; |
|
|
|
} |
|
|
|
|
|
|
|
.btn { |
|
|
|
padding-top: 20px; |
|
|
|
} |
|
|
|
.btn { |
|
|
|
padding-top: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.searchli { |
|
|
|
padding: 5px 100px; |
|
|
|
} |
|
|
|
.searchli { |
|
|
|
padding: 5px 100px; |
|
|
|
} |
|
|
|
|
|
|
|
.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> |
|
|
|