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.
 
 
 
 
 
 

275 lines
9.9 KiB

<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar view-title="验车管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<!-- <div class="switch_btn">-->
<!-- <el-button :class="{btn_style:viewState === 1}">待验车列表</el-button>-->
<!-- <el-button class="" @click="handleInvoiceList">已验车列表</el-button>-->
<!-- </div>-->
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{ isSearchShow ? '隐藏查询条件' : '显示查询条件' }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="车型">
<el-select v-model="listQuery.params.model" placeholder="请选择" filterable clearable
class="addinputw addinputw_chexing">
<el-option v-for="item in modelName_list" :key="item.sid" :label="item.modelName" :value="item.sid"/>
</el-select>
<!-- <el-input v-model="listQuery.params.warehouseAttribute" placeholder="请输入存放地点属性" clearable/>-->
</el-form-item>
<el-form-item label="车架号">
<el-input v-model="listQuery.params.vin" placeholder="请输入车架号" clearable/>
</el-form-item>
<el-form-item label="订单类型">
<el-select v-model="listQuery.params.purchaseType" placeholder="请选择" clearable class="addinputw">
<el-option v-for="item in purchaseType_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"/>
</el-select>
<!-- <el-input v-model="listQuery.params.warehouseContract" placeholder="请输入负责人" clearable/>-->
</el-form-item>
<el-form-item label="验车日期">
<el-date-picker v-model="listQuery.params.inspectedStartDate" class="filter-item" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择"/>
<label>至</label>
<el-date-picker v-model="listQuery.params.inspectedEndDate" class="filter-item" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择"/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" size="small" @click="getList">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!--Start 项目列表头部-->
<div class="listtop">
<div class="tit">车辆列表</div>
<pageye v-show="dataList.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="loadList"/>
</div>
<!--End 项目列表头部-->
<!--Start 项目列表-->
<div class=""> <!--@selection-change="handleSelectionChange"-->
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <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="130px" class-name="small-padding fixed-width">
<template slot-scope="{row}"><!--v-show="!row.result"-->
<el-button size="mini" type="primary" v-show="row.showInspectedBtn" @click="handleYanche(row)">验车
</el-button>
<el-button size="mini" type="primary" @click="handleCheck(row)">查看</el-button>
</template>
</el-table-column>
<el-table-column width="200px" prop="vin" label="车架号" align="center"/>
<el-table-column prop="model" label="车型" align="center"/>
<el-table-column width="160px" prop="purchaseType" label="订单类型" align="center"/>
<el-table-column width="140px" prop="dispatchedDate" label="发车日期" align="center"/>
<el-table-column width="140px" prop="inspectedDate" label="验车日期" align="center"/>
<el-table-column width="140px" prop="inspectedName" label="验车人" align="center"/>
<el-table-column width="150px" prop="inspectedType" label="验车结果" align="center"/>
</el-table>
</div>
<!--End 项目列表-->
<div class="pages">
<div class="tit"/>
<!-- 翻页 -->
<pagination
v-show="dataList.length > 0"
:total="listQuery.total"
:page.sync="listQuery.current"
:limit.sync="listQuery.size"
class="pagination"
@pagination="loadList"
/>
</div>
</div>
</div>
<!--End 查询和其列表部分-->
<!--新增修改部分组件-->
<yancheguanli-add v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="getList"/>
<!--详情部分组件-->
<yancheguanli-info v-show="viewState == 4" ref="divinfo" @doback="resetState"/>
</div>
</template>
<script>
import { selectCarInspectedList, typeValues } from '@/api/supplychain/yancheguanli'
import { getUseOrgByUserSid, selectModelName } from '@/api/cheliang/basevehicle'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import yancheguanliAdd from '@/views/supplychain/yancheguanli/yancheguanliAdd'
import yancheguanliInfo from '@/views/supplychain/yancheguanli/yancheguanliInfo'
export default {
name: 'yancheguanli',
components: {
ButtonBar,
Pagination,
pageye,
yancheguanliAdd,
yancheguanliInfo
},
data() {
return {
btndisabled: false,
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
isSearchShow: false,
tableLoading: false,
dataList: [],
useOrg_list: [],
modelName_list: [],
purchaseType_list: [],
useOrg: '', // 使用组织
useOrgSid: '', // 使用组织sid
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
vin: '',
model: '',
purchaseType: '',
inspectedStartDate:'',
inspectedEndDate:'',
userSid: window.sessionStorage.getItem('userSid')
}
},
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
multipleSelection: []
}
},
created() {
this.getList()
this.getType()
// this.getUseOrg()
this.getModelName()
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doClose':
this.doClose()
break
default:
break
}
},
handleYanche(row) {
this.viewState = 2
this.$refs['divadd'].showAdd(row)
},
handleCheck(row) {
this.$refs['divinfo'].showInfo(row)
console.log('详情回显', row)
this.viewState = 4
},
getList() {
this.listQuery.current = 1
this.loadList()
},
resetQuery() {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
vin: '',
model: '',
purchaseType: '',
inspectedStartDate:'',
inspectedEndDate:'',
userSid: window.sessionStorage.getItem('userSid')
}
}
this.getList()
},
loadList() {
const _this = this
this.tableLoading = true
selectCarInspectedList(this.listQuery)
.then(resp => {
_this.tableLoading = false
const data = resp.data
_this.listQuery.total = data.total
_this.dataList = data.records
for (var i = 0; i < this.dataList.length; i++) {
if (this.dataList[i].inspectedType == '1') {
this.dataList[i].inspectedType = '待验车'
} else {
this.dataList[i].inspectedType = '已验车'
}
}
})
.catch(() => {
_this.tableLoading = false
})
},
getType() {
typeValues({
type: 'purchaseOrderType '
}).then((response) => {
if (response.code === '200' && response.data) {
this.purchaseType_list = response.data
}
})
},
// 车型名称下拉框
getModelName() {
selectModelName({ name: '' }).then((response) => {
if (response.code === '200') {
this.modelName_list = response.data
}
})
},
// 根据个人sid查询个人分公司
getUseOrg() {
const userSid = window.sessionStorage.getItem('userSid')
getUseOrgByUserSid({ userSid: userSid }).then((res) => {
if (res.success) {
this.useOrg = res.data.name // 使用组织
this.useOrgSid = res.data.sid // 使用组织sid
this.listQuery.params.useOrgSid = res.data.sid
this.loadList()
}
})
},
// 序号
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
.addinputw_chexing {
width: 500px;
}
</style>