2 changed files with 310 additions and 0 deletions
@ -0,0 +1,21 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export default { |
|||
// 查询分页列表
|
|||
listPage: function(data) { |
|||
return request({ |
|||
url: '/buscenter/v1/bussalesorder/getSaleOrdersByOrgPath', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 通过sid作废一条或多条记录
|
|||
createPdf: function(data) { |
|||
return request({ |
|||
url: '/buscenter/v1/bussalesorder/createPdf', |
|||
method: 'post', |
|||
params: data |
|||
}) |
|||
} |
|||
} |
@ -0,0 +1,289 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!-- Start 列表页面 --> |
|||
<div v-show="viewState == 1"> |
|||
<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.name" clearable placeholder=""/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" @click="handleFilter" icon="el-icon-search" size="small">查询</el-button> |
|||
<el-button type="primary" @click="handleReset" icon="el-icon-refresh" size="small">重置</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 :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50" type="selection" align="center"/> |
|||
<el-table-column fixed label="序号" width="60" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column fixed label="操作" width="100" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" v-show="scope.row.printOrderBtn" size="mini" @click="handlePrint(scope.row)">下载打印</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="订单编号" width="100px" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span class="bluezi" @click="handleLook(scope.row)">{{ scope.row.saleOrderId }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="合同编号" align="center" width="120"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.contractId }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="客户名称" align="center" width="120"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.customerName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="手机号" align="center" width="120"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.mobile }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="销售专员" align="center" width="120"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.saler }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="付款方式" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.carPurchaseType }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="订单状态" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.saleOrderState }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="创建日期" align="center" width="120"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.createdDate }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="订金合计" align="center" width="120"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.deposit }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车型" align="center" min-width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.modelInfo.model }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="品牌" align="center" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.modelInfo.brand }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="成交价" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.modelInfo.price }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="数量" align="center" width="80"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.modelInfo.number }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- End 列表页面 --> |
|||
<xiaoshoudingdanInfo ref="divInfo" v-show="viewState == 2" @doback="resetState"/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import req from '@/api/jichuxinxi/dingdanchaxun' |
|||
import { getStorage } from '@/utils/auth' |
|||
import xiaoshoudingdanInfo from '../../xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdanInfo' |
|||
|
|||
export default { |
|||
name: 'XiaoShouDingDanChaXun', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar, |
|||
xiaoshoudingdanInfo |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
viewState: 1, |
|||
btnList: [ |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
// 查询条件 ----------- |
|||
tableKey: 0, |
|||
list: [], |
|||
sids: [], |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
listQuery: { |
|||
params: { |
|||
orgPath: '', |
|||
name: '' |
|||
}, |
|||
current: 1, |
|||
size: 10, |
|||
total: 0 |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
// 初始化变量 |
|||
this.init() |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
methods: { |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
btnHandle(btnKey) { |
|||
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|||
switch (btnKey) { |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
init() { |
|||
this.getList() |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
handleSelectionChange(row) { |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push(element.saleOrderSid) |
|||
}) |
|||
this.sids = aa |
|||
console.log('sids', this.sids) |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
|||
req.listPage(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 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
handleReset() { |
|||
this.listQuery = { |
|||
params: { |
|||
orgPath: '', |
|||
name: '' |
|||
}, |
|||
current: 1, |
|||
size: 10, |
|||
total: 0 |
|||
} |
|||
this.getList() |
|||
}, |
|||
handlePrint(row) { |
|||
req.createPdf({ sid: row.saleOrderSid, userName: window.sessionStorage.getItem('name') }).then((resp) => { |
|||
if (resp.success && resp.data.pdfPath !== '') { |
|||
var xhr = new XMLHttpRequest() |
|||
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + resp.data.pdfPath + '&outFileName=' + '销售订单', true) |
|||
xhr.setRequestHeader('token', getStorage()) |
|||
xhr.responseType = 'blob' |
|||
xhr.onload = function(e) { |
|||
// 如果请求执行成功 |
|||
var blob = this.response |
|||
var filename = '销售订单.pdf' |
|||
var a = document.createElement('a') |
|||
// blob.type="application/octet-stream"; |
|||
// 创键临时url对象 |
|||
var url = URL.createObjectURL(blob) |
|||
a.href = url |
|||
a.download = filename |
|||
a.click() |
|||
// 释放之前创建的URL对象 |
|||
window.URL.revokeObjectURL(url) |
|||
} |
|||
// 发送请求 |
|||
xhr.send() |
|||
} |
|||
}) |
|||
}, |
|||
handleLook(row) { |
|||
this.viewState = 2 |
|||
let aa = null |
|||
aa = { |
|||
sid: row.saleOrderSid |
|||
} |
|||
this.$refs['divInfo'].showInfo(aa) |
|||
}, |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
/*表格列设置fixed后固定列出现下边框的设置*/ |
|||
/deep/ .el-table__fixed { |
|||
height: 100% !important; |
|||
} |
|||
/*表格列设置fixed后固定列出现下边框的设置*/ |
|||
/deep/ .el-table__fixed-right { |
|||
height: 100% !important; |
|||
} |
|||
</style> |
Loading…
Reference in new issue