You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
310 lines
12 KiB
310 lines
12 KiB
<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="110px" class="tab-header">
|
|
<el-form-item label="合同编号">
|
|
<el-input v-model="listQuery.params.contractNo" placeholder="" clearable />
|
|
</el-form-item>
|
|
<el-form-item label="车型">
|
|
<el-input v-model="listQuery.params.modelName" placeholder="" clearable />
|
|
</el-form-item>
|
|
<el-form-item label="申请日期">
|
|
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="listQuery.params.createStartTime" clearable type="date" placeholder="开始日期"/>
|
|
<span style="padding: 0 8px">至</span>
|
|
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="listQuery.params.createEndTime" clearable type="date" placeholder="结束日期"/>
|
|
</el-form-item>
|
|
<el-form-item label="申请人">
|
|
<el-input v-model="listQuery.params.createByName" placeholder="" clearable />
|
|
</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>
|
|
<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%;">
|
|
<el-table-column fixed width="80px" label="编号" type="index" :index="indexMethod" align="center"/>
|
|
<el-table-column fixed label="操作" align="center" width="180">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" size="mini" :disabled="scope.row.nodeState == '发起申请' ? false : scope.row.nodeState == '待提交' ? false : true" @click="toEdit(scope.row)">办理</el-button>
|
|
<el-button type="primary" size="mini" v-if="scope.row.nodeState =='已办结'" @click="toDownload(scope.row)">下载</el-button>
|
|
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="状态" width="150" header-align="center">
|
|
<template slot-scope="scope">
|
|
<span v-if="scope.row.nodeState=='待提交'" type="primary" size="mini">待提交</span>
|
|
<span v-else @click="flowRecord(scope.row)" class="bluezi">{{ scope.row.nodeState }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="useOrgName" label="分公司" align="center" />
|
|
<el-table-column prop="applyDeptName" label="申请部门" align="center" width="120"/>
|
|
<el-table-column prop="createByName" label="申请人" align="center" />
|
|
<el-table-column prop="createTime" label="申请日期" align="center" width="120"/>
|
|
<el-table-column label="销售合同编号" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<span class="bluezi" @click="lookSales(scope.row)">{{ scope.row.contractNo }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="modelName" label="车型" align="center" width="130"/>
|
|
<el-table-column prop="vinNo" label="车架号" align="center" width="100" />
|
|
<el-table-column prop="money" label="加装配置/销售让利金额" align="center" width="200"/>
|
|
<el-table-column prop="ysMoney" label="应收手续费" align="center" width="130"/>
|
|
<el-table-column prop="ssMoney" label="实收手续费" align="center" width="130"/>
|
|
</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>
|
|
<!-- 新增或编辑 -->
|
|
<valuablecustomerAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
|
|
<!-- 详情 -->
|
|
<valuablecustomerInfo v-show="viewState == 4" ref="divInfo" @doback="resetState"/>
|
|
<!-- 查看销售订单 -->
|
|
<dingdanInfo v-show="viewState == 5" ref="divSales" @doback="resetState"/>
|
|
<!-- 查看流程审批记录 -->
|
|
<el-dialog title="" :visible.sync="centerDialogVisible" width="78%" height="1%" :before-close="closeIt" center>
|
|
<iframe frameborder="0" id="iframe" style="width:100%;" scrolling="no" :src="this.centerDialogVisible === true ? url :''"></iframe>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listPage, createPdf } from '@/api/valuablecustomer/valuablecustomer'
|
|
import Pagination from '@/components/pagination'
|
|
import pageye from '@/components/pagination/pageye'
|
|
import ButtonBar from '@/components/ButtonBar'
|
|
import valuablecustomerAdd from './valuablecustomerAdd.vue'
|
|
import valuablecustomerInfo from './valuablecustomerInfo'
|
|
import dingdanInfo from '@/components/publicPage/dingdanInfo'
|
|
import { getStorage } from '@/utils/auth'
|
|
|
|
export default {
|
|
name: 'ValuableCustomer',
|
|
components: {
|
|
Pagination,
|
|
pageye,
|
|
ButtonBar,
|
|
valuablecustomerAdd,
|
|
valuablecustomerInfo,
|
|
dingdanInfo
|
|
},
|
|
data() {
|
|
return {
|
|
url: '',
|
|
dialogHeight: '80%',
|
|
centerDialogVisible: false,
|
|
btndisabled: false,
|
|
btnList: [
|
|
{
|
|
type: 'info',
|
|
size: 'small',
|
|
icon: 'cross',
|
|
btnKey: 'doClose',
|
|
btnLabel: '关闭'
|
|
}
|
|
],
|
|
isSearchShow: false,
|
|
searchxianshitit: '显示查询条件',
|
|
viewState: 1,
|
|
// 查询条件 -----------
|
|
tableKey: 0,
|
|
list: [],
|
|
sids: [],
|
|
FormLoading: false,
|
|
listLoading: false,
|
|
listQuery: {
|
|
params: {
|
|
contractNo: '',
|
|
createByName: '',
|
|
createEndTime: '',
|
|
createStartTime: '',
|
|
menuUrl: '',
|
|
modelName: '',
|
|
orgPath: '',
|
|
userSid: ''
|
|
},
|
|
current: 1,
|
|
size: 5,
|
|
total: 0
|
|
},
|
|
rules: {}
|
|
}
|
|
},
|
|
created() {
|
|
// 加载列表
|
|
this.getList()
|
|
},
|
|
mounted() {
|
|
// 在外部vue的window上添加postMessage的监听,而且绑定处理函数handleMessage
|
|
window.addEventListener('message', this.handleMessage)
|
|
this.$refs['btnbar'].setButtonList(this.btnList)
|
|
},
|
|
methods: {
|
|
async handleMessage(event) {
|
|
var code = ''
|
|
if (event.data.params !== null && event.data.params !== undefined) {
|
|
code = event.data.params.code
|
|
}
|
|
if (code === 1) {
|
|
this.init()
|
|
this.centerDialogVisible = false
|
|
} else if (code === 2) {
|
|
this.dialogHeight = event.data.params.data
|
|
this.setIframeHeight(document.getElementById('iframe'))
|
|
}
|
|
},
|
|
closeIt() {
|
|
this.url = ''
|
|
this.centerDialogVisible = false
|
|
},
|
|
setIframeHeight(iframe) {
|
|
iframe.height = this.dialogHeight
|
|
},
|
|
flowRecord(row) {
|
|
this.centerDialogVisible = true
|
|
var params = {
|
|
deployId: row.procDefId,
|
|
procInsId: row.procInstId,
|
|
token: getStorage()
|
|
}
|
|
this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params)))
|
|
},
|
|
// 搜索条件效果
|
|
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
|
|
}
|
|
},
|
|
// 序号
|
|
indexMethod(index) {
|
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
|
var pageindex = index + 1 + pagestart
|
|
return pageindex
|
|
},
|
|
// 查询列表信息
|
|
getList() {
|
|
this.listLoading = true
|
|
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
|
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
|
|
this.listQuery.params.menuUrl = this.$route.path
|
|
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: {
|
|
contractNo: '',
|
|
createByName: '',
|
|
createEndTime: '',
|
|
createStartTime: '',
|
|
menuUrl: '',
|
|
modelName: '',
|
|
orgPath: '',
|
|
userSid: ''
|
|
},
|
|
current: 1,
|
|
size: 5,
|
|
total: 0
|
|
}
|
|
this.getList()
|
|
},
|
|
toEdit(row) {
|
|
this.viewState = 2
|
|
this.$refs['divAdd'].showEdit(row)
|
|
},
|
|
toDownload(row) {
|
|
createPdf({ sid: row.sid, userName: window.sessionStorage.getItem('name') }).then((res) => {
|
|
if (res.success) {
|
|
var xhr = new XMLHttpRequest()
|
|
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + res.data + '&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()
|
|
}
|
|
}).catch(() => {})
|
|
},
|
|
toInfo(row) {
|
|
this.viewState = 4
|
|
this.$refs['divInfo'].showInfo(row)
|
|
},
|
|
lookSales(row) {
|
|
this.viewState = 5
|
|
this.$refs['divSales'].showInfo({ sid: row.saleOrderSid })
|
|
},
|
|
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>
|
|
|