6 changed files with 758 additions and 16 deletions
@ -0,0 +1,241 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<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-input v-model="listQuery.params.contractId" placeholder="" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="客户名称"> |
|||
<el-input v-model="listQuery.params.name" placeholder="" clearable class="filter-item"/> |
|||
</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" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</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 ref="multipleTable" :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange"> |
|||
<el-table-column fixed type="selection" align="center" width="50"/> |
|||
<el-table-column fixed label="序号" type="index" width="60" :index="indexMethod" align="center"/> |
|||
<el-table-column label="销售类型" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.saleType }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="合同编号" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.contractId }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="客户名称" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.name }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车架号" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vin }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getSelectVinsList } from '@/api/anruifinmanagement/finwaitinvoiceapply' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
|
|||
export default { |
|||
name: 'DaiKaiPiao', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
isSearchShow: false, // 主页面:隐藏查询条件按钮 |
|||
searchxianshitit: '显示查询条件', |
|||
// 查询 ----------- |
|||
tableKey: 0, |
|||
sids: [], // 用于导出的时候保存已选择的SIDs |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
typeList: [], // 选择器 |
|||
list: [], |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: '', |
|||
btnKey: 'doCreate', |
|||
btnLabel: '确定' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: '', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
// 翻页 |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
contractId: '', // 合同编号 |
|||
name: '', // 客户名称 |
|||
vinNo: '', // 车架号 |
|||
userSid: '', |
|||
orgPath: '', |
|||
vins: [] |
|||
} |
|||
}, |
|||
multipleSelection: [] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
methods: { |
|||
btnHandle(btnKey) { |
|||
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|||
switch (btnKey) { |
|||
case 'doCreate': |
|||
this.doCreate() |
|||
break |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
showData(value, contractNo, orgSidPath) { |
|||
const aa = [] |
|||
if (value.length > 0) { |
|||
for (var i = 0; i < value.length; i++) { |
|||
aa.push(value[i].vehSid) |
|||
} |
|||
this.listQuery.params.vins = aa |
|||
} else { |
|||
this.listQuery.params.vins = [] |
|||
} |
|||
this.listQuery.params.contractId = contractNo |
|||
this.listQuery.params.orgPath = orgSidPath |
|||
this.getList() |
|||
}, |
|||
// ========== 页面按钮功能 ========== |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 表中序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 信息条数 获取点击时当前的sid |
|||
handleSelectionChange(row) { |
|||
this.multipleSelection = row |
|||
const aa = [] |
|||
row.forEach(element => { |
|||
aa.push({ |
|||
contractNo: element.contractId, |
|||
vinSid: element.vinSid |
|||
}) |
|||
}) |
|||
this.sids = aa |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 点击重置 |
|||
handleReset() { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.size = 10 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.params.name = '' |
|||
this.listQuery.params.vinNo = '' |
|||
this.listQuery.params.userSid = '' |
|||
this.getList() |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid') |
|||
getSelectVinsList(this.listQuery).then(response => { // 拦截器 |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.list = response.data.records |
|||
this.listQuery.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.listQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 打开新增 |
|||
doCreate() { |
|||
if (this.sids.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行出库申请' }) |
|||
return |
|||
} |
|||
if (this.sids.length > 0) { |
|||
this.FormLoading = true |
|||
for (var i = 0; i < this.multipleSelection.length; i++) { |
|||
for (var j = i + 1; j < this.multipleSelection.length; j++) { |
|||
if (this.multipleSelection[i].contractId !== this.multipleSelection[j].contractId) { |
|||
this.$message({ |
|||
showClose: true, |
|||
message: '请选择同一合同编号的车辆!', |
|||
type: 'error' |
|||
}) |
|||
return |
|||
} |
|||
} |
|||
} |
|||
this.$emit('backData', this.multipleSelection) |
|||
} |
|||
}, |
|||
doClose() { |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,241 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<button-bar view-title="待开票车辆列表" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|||
<div class=""> |
|||
<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.params.contractId" placeholder="" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="客户名称"> |
|||
<el-input v-model="listQuery.params.name" placeholder="" clearable class="filter-item"/> |
|||
</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" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</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 ref="multipleTable" :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange"> |
|||
<el-table-column fixed type="selection" align="center" width="50"/> |
|||
<el-table-column fixed label="序号" type="index" width="60" :index="indexMethod" align="center"/> |
|||
<el-table-column label="销售类型" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.saleType }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="合同编号" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.contractId }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="客户名称" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.name }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车架号" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vin }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getSelectVinsList } from '@/api/anruifinmanagement/finwaitinvoiceapply' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
|
|||
export default { |
|||
name: 'DaiKaiPiao', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
isSearchShow: false, // 主页面:隐藏查询条件按钮 |
|||
searchxianshitit: '显示查询条件', |
|||
// 查询 ----------- |
|||
tableKey: 0, |
|||
sids: [], // 用于导出的时候保存已选择的SIDs |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
typeList: [], // 选择器 |
|||
list: [], |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: '', |
|||
btnKey: 'doCreate', |
|||
btnLabel: '确定' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: '', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
// 翻页 |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
contractId: '', // 合同编号 |
|||
name: '', // 客户名称 |
|||
vinNo: '', // 车架号 |
|||
userSid: '', |
|||
orgPath: '', |
|||
vins: [] |
|||
} |
|||
}, |
|||
multipleSelection: [] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
methods: { |
|||
btnHandle(btnKey) { |
|||
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|||
switch (btnKey) { |
|||
case 'doCreate': |
|||
this.doCreate() |
|||
break |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
showData(value, contractNo, orgSidPath) { |
|||
const aa = [] |
|||
if (value.length > 0) { |
|||
for (var i = 0; i < value.length; i++) { |
|||
aa.push(value[i].vehSid) |
|||
} |
|||
this.listQuery.params.vins = aa |
|||
} else { |
|||
this.listQuery.params.vins = [] |
|||
} |
|||
this.listQuery.params.contractId = contractNo |
|||
this.listQuery.params.orgPath = orgSidPath |
|||
this.getList() |
|||
}, |
|||
// ========== 页面按钮功能 ========== |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 表中序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 信息条数 获取点击时当前的sid |
|||
handleSelectionChange(row) { |
|||
this.multipleSelection = row |
|||
const aa = [] |
|||
row.forEach(element => { |
|||
aa.push({ |
|||
contractNo: element.contractId, |
|||
vinSid: element.vinSid |
|||
}) |
|||
}) |
|||
this.sids = aa |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 点击重置 |
|||
handleReset() { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.size = 10 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.params.name = '' |
|||
this.listQuery.params.vinNo = '' |
|||
this.listQuery.params.userSid = '' |
|||
this.getList() |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid') |
|||
getSelectVinsList(this.listQuery).then(response => { // 拦截器 |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.list = response.data.records |
|||
this.listQuery.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.listQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 打开新增 |
|||
doCreate() { |
|||
if (this.sids.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行出库申请' }) |
|||
return |
|||
} |
|||
if (this.sids.length > 0) { |
|||
this.FormLoading = true |
|||
for (var i = 0; i < this.multipleSelection.length; i++) { |
|||
for (var j = i + 1; j < this.multipleSelection.length; j++) { |
|||
if (this.multipleSelection[i].contractId !== this.multipleSelection[j].contractId) { |
|||
this.$message({ |
|||
showClose: true, |
|||
message: '请选择同一合同编号的车辆!', |
|||
type: 'error' |
|||
}) |
|||
return |
|||
} |
|||
} |
|||
} |
|||
this.$emit('backData', this.multipleSelection) |
|||
} |
|||
}, |
|||
doClose() { |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
Loading…
Reference in new issue