4 changed files with 381 additions and 12 deletions
@ -0,0 +1,266 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>选择车辆页面</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<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="库存状态:" class="searchlist"> |
|||
<el-select v-model="listQuery.params.vehicleState" placeholder="请选择" filterable clearable> |
|||
<el-option v-for="item in vehicleState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="车型:" class="searchlist"> |
|||
<el-input v-model="listQuery.params.vehicleAlias" placeholder="" clearable style="width: 150px"/> |
|||
</el-form-item> |
|||
<el-form-item label="配置:" class="searchlist"> |
|||
<el-input v-model="listQuery.params.configName" placeholder="" clearable style="width: 150px"/> |
|||
</el-form-item> |
|||
<el-form-item label="车架号:" class="searchlist"> |
|||
<el-input v-model="listQuery.params.vinNo" placeholder="" clearable style="width: 150px"/> |
|||
</el-form-item> |
|||
<el-form-item label="颜色:" class="searchlist"> |
|||
<el-select v-model="listQuery.params.carColorKey" placeholder="请选择" filterable clearable> |
|||
<el-option v-for="item in bodyColor_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="存放地点:" class="searchlist"> |
|||
<el-input v-model="listQuery.params.location" placeholder="" clearable style="width: 150px"/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="listtop"> |
|||
<div class="tit">车辆列表</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-table :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50" type="selection" align="center"/> |
|||
<el-table-column width="80" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<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.brandName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车型" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vehicleAlias }}</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.carColor }}</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> |
|||
</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> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import { sendFinCustomerTrue, vehicleCrmList } from '@/api/jichuxinxi/crmcustomer' |
|||
import { typeValues, getPathSidByUserSid } from '@/api/dictcommons/dictcommons' |
|||
|
|||
export default { |
|||
name: 'vehicleSelect', |
|||
components: { |
|||
Pagination |
|||
}, |
|||
data() { |
|||
return { |
|||
isSearchShow: false, |
|||
searchxianshitit: '隐藏查询条件', |
|||
tableKey: 0, |
|||
sids: [], |
|||
list: [], |
|||
number: '', |
|||
listLoading: false, |
|||
vehicleState_list: [], |
|||
bodyColor_list: [], |
|||
userName: '', |
|||
userSid: '', |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
vehicleState: '', |
|||
vehicleAlias: '', |
|||
configName: '', |
|||
vinNo: '', |
|||
carColorKey: '', |
|||
location: '', |
|||
createOrgSid: '', |
|||
orgSidPath: '' |
|||
}, |
|||
total: 0 |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
init() { |
|||
this.shujuzidian() |
|||
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((resp) => { |
|||
if (resp.success) { |
|||
this.listQuery.params.createOrgSid = resp.data |
|||
this.getList() |
|||
} |
|||
}) |
|||
}, |
|||
shujuzidian() { |
|||
typeValues({ type: 'vehicleState' }).then((res) => { |
|||
if (res.success) { |
|||
this.vehicleState_list = res.data |
|||
} |
|||
}) |
|||
typeValues({ type: 'bodyColor' }).then((res) => { |
|||
if (res.success) { |
|||
this.bodyColor_list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 返回 |
|||
handleReturn() { |
|||
this.$emit('doback') |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
this.listQuery.params.orgSidPath = window.sessionStorage.getItem('orgSidPath') |
|||
vehicleCrmList(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.listQuery.total = response.data.total |
|||
this.list = response.data.records |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 重置按钮 |
|||
handleReset() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
vehicleState: '', |
|||
vehicleAlias: '', |
|||
configName: '', |
|||
vinNo: '', |
|||
carColorKey: '', |
|||
location: '', |
|||
createOrgSid: '', |
|||
orgSidPath: '' |
|||
}, |
|||
total: 0 |
|||
} |
|||
this.init() |
|||
}, |
|||
handleSelectionChange(row) { |
|||
this.sids = [] |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push({ |
|||
name: this.userName, |
|||
sid: this.userSid, |
|||
vinNo: element.vinNo |
|||
}) |
|||
}) |
|||
this.sids = aa |
|||
}, |
|||
showData(userName, userSid) { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.size = 5 |
|||
this.userName = userName |
|||
this.userSid = userSid |
|||
this.init() |
|||
}, |
|||
// 添加修改返回 |
|||
AddUpdateReturn() { |
|||
if (this.sids.length > 0) { |
|||
var aa = '' |
|||
for (var i = 0; i < this.sids.length; i++) { |
|||
if (i === 0) { |
|||
aa = aa + 1 + '.' + this.sids[i].name + this.sids[i].vinNo + ';' |
|||
} else { |
|||
aa = aa + parseInt(i + 1) + '.' + this.sids[i].name + this.sids[i].vinNo + ';' |
|||
} |
|||
} |
|||
const tip = '你已选择' + this.sids.length + '台车,我们会在金蝶创建:' + aa.slice(0, aa.length - 1) + '的客户信息,请相关人员进行账务处理!' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '关闭', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
sendFinCustomerTrue(this.sids).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '推送成功' }) |
|||
} |
|||
}) |
|||
}) |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '请选择至少一条车型记录!', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
Loading…
Reference in new issue