10 changed files with 542 additions and 377 deletions
@ -0,0 +1,271 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>待调账车辆列表</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="handleConfirm()">确定</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<div class="webcon"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</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.shuntingTypeKey" placeholder="请选择" clearable class="addinputw"> |
|||
<el-option v-for="item in shuntingType_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/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" size="small" icon="el-icon-refresh" @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 style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50px" fixed type="selection" align="center"/> |
|||
<el-table-column width="80px" fixed label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column label="车架号" fixed 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.shuntingTypeValue }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="调出分公司" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.buyerOrgName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="调入分公司" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.sellerOrgName }}</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> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import { fetchVeh } from '@/api/supplychain/tiaozhangshenqing.js' |
|||
import { typeValues } from '@/api/cheliang/dictcommons' |
|||
|
|||
export default { |
|||
name: 'tiaozhangcheliangList', |
|||
components: { |
|||
Pagination, |
|||
pageye |
|||
}, |
|||
data() { |
|||
return { |
|||
createPage: '', |
|||
dialogVisible: false, // 弹窗 |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
btndisabled: false, |
|||
viewState: 1, // 1、列表 2、添加-车辆预定 3、编辑 4、查看 5、订金-定金收取 |
|||
shuntingType_list: [], |
|||
// 查询 ----------- |
|||
tableKey: 0, |
|||
list: [], |
|||
sids: [], |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
shuntingTypeKey: '', |
|||
vinNo: '', |
|||
accadjTypeKey: '', |
|||
callOutOrgSid: '', |
|||
callInOrgSid: '', |
|||
sids: [] |
|||
}, |
|||
total: 0 |
|||
}, |
|||
requiredPar: {}, |
|||
selectDate: undefined, |
|||
temp: {}, // 添加和编辑 |
|||
vinNoList: [], |
|||
vehicleList: [], |
|||
visible: true, |
|||
hetongdanganguanliInfoShow: false |
|||
// ------------------------------------ |
|||
} |
|||
}, |
|||
methods: { |
|||
// 初始化 |
|||
init() { |
|||
//shuntingType |
|||
}, |
|||
getType() { |
|||
typeValues({ |
|||
type: 'shuntingType' |
|||
}).then((response) => { |
|||
if (response.code === '200' && response.data) { |
|||
this.shuntingType_list = response.data |
|||
} |
|||
}) |
|||
}, |
|||
showCheList(accadjTypeKey, callOutOrgSid, callInOrgSid, vinNoList) { |
|||
this.listQuery.params.accadjTypeKey = accadjTypeKey |
|||
this.listQuery.params.callOutOrgSid = callOutOrgSid |
|||
this.listQuery.params.callInOrgSid = callInOrgSid |
|||
this.listQuery.params.sids = vinNoList |
|||
this.requiredPar = { |
|||
accadjTypeKey: accadjTypeKey, |
|||
callOutOrgSid: callOutOrgSid, |
|||
callInOrgSid: callInOrgSid, |
|||
sids: vinNoList |
|||
} |
|||
this.handleFilter() |
|||
this.getType() |
|||
}, |
|||
// 勾选 |
|||
handleSelectionChange(row) { |
|||
console.log('row', row) |
|||
this.vehicleList = row |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push(element.sid) |
|||
}) |
|||
this.sids = aa |
|||
console.log('选择sid', this.sids) |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 重置 |
|||
handleReset() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
shuntingTypeKey: '', |
|||
vinNo: '', |
|||
accadjTypeKey: this.requiredPar.accadjTypeKey, |
|||
callOutOrgSid: this.requiredPar.callOutOrgSid, |
|||
callInOrgSid: this.requiredPar.callInOrgSid, |
|||
sids: this.requiredPar.sids |
|||
}, |
|||
total: 0 |
|||
} |
|||
this.getList() |
|||
}, |
|||
|
|||
// 确认 |
|||
handleConfirm() { |
|||
if (this.vehicleList.length > 0) { |
|||
// if (this.vinNoList.length > 0) { |
|||
// console.log('已选择的数据', this.vinNoList) |
|||
// for (var i = 0; i < this.vinNoList.length; i++) { |
|||
// for (var j = 0; j < this.vehicleList.length; j++) { |
|||
// if (this.vinNoList[i] == this.vehicleList[j].vinNo) { |
|||
// const index = this.vehicleList.findIndex(val => { |
|||
// return this.vehicleList[j].vinNo === this.vinNoList[i] |
|||
// }) |
|||
// this.vehicleList.splice(index, 1) |
|||
// console.log('进入if判断', index) |
|||
// } |
|||
// } |
|||
// } |
|||
// } |
|||
this.$emit('handleVehicle', this.vehicleList) |
|||
this.$nextTick(() => { |
|||
this.$refs.multipleTable.clearSelection() |
|||
}) |
|||
this.handleReturn() |
|||
} else { |
|||
this.$message({ |
|||
showClose: true, |
|||
message: '请选择车辆!', |
|||
type: 'error' |
|||
}) |
|||
return |
|||
} |
|||
}, |
|||
// 返回 |
|||
handleReturn() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
shuntingType: '', |
|||
vinNo: '', |
|||
accadjTypeKey: '', |
|||
callOutOrgSid: '', |
|||
callInOrgSid: '', |
|||
sids: [] |
|||
} |
|||
} |
|||
this.$emit('doback') // 到父页面 |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
fetchVeh(this.listQuery).then((response) => { |
|||
console.log('列表查询结果:', 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() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
Loading…
Reference in new issue