Browse Source

销售订单查询

master
yunuo970428 2 years ago
parent
commit
50101d48f6
  1. 21
      anrui-buscenter/anrui-buscenter-ui/src/api/jichuxinxi/dingdanchaxun.js
  2. 289
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/dingdanchaxun/xiaoshoudingdanchaxun.vue

21
anrui-buscenter/anrui-buscenter-ui/src/api/jichuxinxi/dingdanchaxun.js

@ -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
})
}
}

289
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/dingdanchaxun/xiaoshoudingdanchaxun.vue

@ -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…
Cancel
Save