|
|
@ -1,36 +1,41 @@ |
|
|
|
<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> |
|
|
|
|
|
|
|
<button-bar view-title="合格证台账" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|
|
|
<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.certificationNo" placeholder="请输入合格证编号" clearable class="filter-item"/> |
|
|
|
<el-input v-model="listQuery.params.certificationNo" placeholder="请输入合格证编号" clearable |
|
|
|
class="filter-item"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="发证日期"> |
|
|
|
<el-date-picker v-model="listQuery.certificateDate" type="date" class="addinputw" format="yyyy-MM-dd" |
|
|
|
value-format="yyyy-MM-dd" placeholder="选择日期时间"/> |
|
|
|
<el-date-picker |
|
|
|
v-model="listQuery.params.certificateStartDate " |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
<span style="padding: 0 8px">至</span> |
|
|
|
<el-date-picker |
|
|
|
v-model="listQuery.params.certificateEndDate" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="合格证情况"> |
|
|
|
<el-select v-model="listQuery.certificateSituation" class="addinputw" clearable placeholder="请选择合格证情况" |
|
|
|
<el-form-item label="合格证状态"> |
|
|
|
<el-select v-model="listQuery.params.certificateState" class="addinputw" clearable placeholder="请选择合格证状态" |
|
|
|
style="width: 200px;"> |
|
|
|
<el-option v-for="item in Situation" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-button type="primary" @click="handleFilter">查询</el-button> |
|
|
|
</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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="listtop"> |
|
|
@ -53,9 +58,9 @@ |
|
|
|
<span>{{ scope.row.certificateDate }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="合格证情况" align="center"> |
|
|
|
<el-table-column label="合格证状态" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.certificateSituationValue }}</span> |
|
|
|
<span>{{ scope.row.certificateStateValue }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="到证日期" align="center"> |
|
|
@ -116,30 +121,27 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { |
|
|
|
pagerList, |
|
|
|
deleteBySids, |
|
|
|
basefinbankExportExcel |
|
|
|
} from '@/api/cheliang/basevehiclecertificate' |
|
|
|
import { typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
// 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 hegezhengtaizhangAdd from './hegezhengtaizhangAdd' |
|
|
|
import hegezhengInfo from './hegezhengInfo' |
|
|
|
import cheliangtaizhangInfo from '@/views/cheliang/cheliangtaizhang/cheliangtaizhangInfo' |
|
|
|
import CheliangtaizhangInfo from '@/views/cheliang/cheliangtaizhang/cheliangtaizhangInfo' |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { basefinbankExportExcel, deleteBySids, pagerList } from '@/api/cheliang/basevehiclecertificate' |
|
|
|
import { typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
// 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 hegezhengtaizhangAdd from './hegezhengtaizhangAdd' |
|
|
|
import hegezhengInfo from './hegezhengInfo' |
|
|
|
import CheliangtaizhangInfo from '@/views/cheliang/cheliangtaizhang/cheliangtaizhangInfo' |
|
|
|
import ButtonBar from '@/components/ButtonBar' |
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'Pinpaiguanli', |
|
|
|
components: { |
|
|
|
CheliangtaizhangInfo, |
|
|
|
Pagination, |
|
|
|
pageye, |
|
|
|
hegezhengtaizhangAdd, |
|
|
|
hegezhengInfo |
|
|
|
hegezhengInfo, |
|
|
|
ButtonBar |
|
|
|
}, |
|
|
|
// directives: { |
|
|
|
// drag: { |
|
|
@ -184,6 +186,37 @@ |
|
|
|
searchxianshitit: '显示查询条件', |
|
|
|
imgs: [], |
|
|
|
// --按钮菜单------- |
|
|
|
btndisabled: 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: '导出' |
|
|
|
} |
|
|
|
], |
|
|
|
menuState: { |
|
|
|
add: false, // 添加 |
|
|
|
edit: false, // 编辑 |
|
|
@ -204,13 +237,15 @@ |
|
|
|
FormLoading: false, |
|
|
|
listLoading: false, |
|
|
|
listQuery: { |
|
|
|
certificationNo: '', |
|
|
|
certificateDateL: '', |
|
|
|
certificateSituation: '', |
|
|
|
params: { |
|
|
|
certificateStartDate: '', |
|
|
|
certificateEndDate: '', |
|
|
|
certificateState: '', |
|
|
|
certificationNo: '' |
|
|
|
}, |
|
|
|
current: 1, |
|
|
|
size: 20 |
|
|
|
}, |
|
|
|
certificateSituation: 'certificateSituation', |
|
|
|
Situation: [], |
|
|
|
selectDate: undefined, |
|
|
|
temp: {}, // 添加和修改 |
|
|
@ -258,6 +293,9 @@ |
|
|
|
// 加载列表 |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$refs['btnbar'].setButtonList(this.btnList) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 搜索条件效果 |
|
|
|
clicksearchShow() { |
|
|
@ -281,6 +319,25 @@ |
|
|
|
// }) |
|
|
|
this.setDate() |
|
|
|
}, |
|
|
|
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 |
|
|
|
default: |
|
|
|
break |
|
|
|
} |
|
|
|
}, |
|
|
|
// 序号 |
|
|
|
indexMethod(index) { |
|
|
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|
|
@ -292,7 +349,7 @@ |
|
|
|
}, |
|
|
|
setDate() { |
|
|
|
typeValues({ |
|
|
|
type: this.certificateSituation |
|
|
|
type: 'certificateState' |
|
|
|
}).then((res) => { |
|
|
|
console.log(res) |
|
|
|
if (res.code === '200') { |
|
|
@ -303,15 +360,7 @@ |
|
|
|
// 查询列表信息 |
|
|
|
getList() { |
|
|
|
this.listLoading = true |
|
|
|
pagerList({ |
|
|
|
current: this.listQuery.current, |
|
|
|
size: this.listQuery.size, |
|
|
|
params: { |
|
|
|
certificationNo: this.listQuery.certificationNo, |
|
|
|
certificateDateL: this.listQuery.certificateDateL, |
|
|
|
certificateSituation: this.listQuery.certificateSituation |
|
|
|
} |
|
|
|
}).then((response) => { |
|
|
|
pagerList(this.listQuery).then((response) => { |
|
|
|
console.log('列表查询结果:', response) |
|
|
|
this.listLoading = false |
|
|
|
if ( |
|
|
@ -332,7 +381,20 @@ |
|
|
|
this.listQuery.current = 1 |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 重置 |
|
|
|
handleReset() { |
|
|
|
this.listQuery = { |
|
|
|
params: { |
|
|
|
certificateStartDate: '', |
|
|
|
certificateEndDate: '', |
|
|
|
certificateState: '', |
|
|
|
certificationNo: '' |
|
|
|
}, |
|
|
|
current: 1, |
|
|
|
size: 20 |
|
|
|
} |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
// ----------------------------------方法-------------------- |
|
|
|
// 添加前数据初始化 |
|
|
|
resetTemp() { |
|
|
@ -353,7 +415,7 @@ |
|
|
|
this.sids = aa |
|
|
|
}, |
|
|
|
// 打开添加 |
|
|
|
handleCreate() { |
|
|
|
toAdd() { |
|
|
|
this.viewState = 2 |
|
|
|
// this.dialogStatus = 'add' |
|
|
|
this.$refs['divadd'].showAdd() |
|
|
@ -374,13 +436,13 @@ |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 打开修改 |
|
|
|
handleUpdate() { |
|
|
|
toEdit() { |
|
|
|
if (this.sids.length === 1) { |
|
|
|
this.dialogStatus = 'update' |
|
|
|
this.viewState = 3 |
|
|
|
const sid = this.sids[0] |
|
|
|
const row = this.row |
|
|
|
this.$refs['divadd'].showEdit(sid,row) |
|
|
|
this.$refs['divadd'].showEdit(sid, row) |
|
|
|
// this.$router.push({ |
|
|
|
// path: `/cheliang/hegezhengtaizhangAdd/${this.sids[0]}` |
|
|
|
// }) |
|
|
@ -415,24 +477,33 @@ |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 根据本行ID删除数据 |
|
|
|
handleDelete() { |
|
|
|
doDel() { |
|
|
|
const _this = this |
|
|
|
if (this.sids.length > 0) { |
|
|
|
deleteBySids(this.sids).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '删除成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000 |
|
|
|
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' |
|
|
|
this.$confirm(tip, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
this.getList() |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: response.msg, |
|
|
|
type: 'error' |
|
|
|
.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 { |
|
|
|
this.$notify({ |
|
|
@ -445,7 +516,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
// 导出 |
|
|
|
handleDaoChu() { |
|
|
|
doExport() { |
|
|
|
basefinbankExportExcel(this.sids).then((res) => { |
|
|
|
const blob = new Blob([res], { |
|
|
|
type: 'application/vnd.ms-excel' |
|
|
@ -468,6 +539,7 @@ |
|
|
|
this.dialogTitle = '查看' |
|
|
|
// this.$refs.editform.initForm(row) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
@ -493,4 +565,19 @@ |
|
|
|
.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> |
|
|
|