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.
 
 
 
 
 
 

291 lines
11 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="switch_btn">
<el-button :class="{btn_style:viewState === 1}">待交接</el-button>
<el-button class="" @click="handleClick">已交接</el-button>
</div>
<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" class="tab-header">
<el-form-item label="创建日期">
<el-date-picker v-model="listQuery.params.createStartTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
<span style="padding: 0 8px">至</span>
<el-date-picker v-model="listQuery.params.createEndTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="合同编号">
<el-input v-model="listQuery.params.contractNo" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
<el-form-item label="客户名称">
<el-input v-model="listQuery.params.customerName" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
<el-form-item label="接收人">
<el-input v-model="listQuery.params.recName" clearable placeholder="" class="addinputw"></el-input>
</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 label="序号" width="60" type="index" :index="indexMethod" align="center"/>
<el-table-column fixed label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button v-show="scope.row.state == 1 && scope.row.showHandover" type="primary" size="mini" @click="handJiaojie(scope.row)">交接</el-button>
<el-button v-show="scope.row.state == 2 && scope.row.showToDoHandover" type="primary" size="mini" @click="handConFirm(scope.row)">确认</el-button>
<el-button type="primary" size="mini" @click="handLook(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>{{ scope.row.state == 1 ? '待准备' : scope.row.state == 2 ? '待交接' : scope.row.state == 3 ? '已交接' : '其他' }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="合同编号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.contractNo }}</span>
</template>
</el-table-column>
<el-table-column label="客户名称" align="center" width="180">
<template slot-scope="scope">
<span>{{ scope.row.customerName }}</span>
</template>
</el-table-column>
<el-table-column label="车型" align="center" width="180">
<template slot-scope="scope">
<span>{{ scope.row.vehModel }}</span>
</template>
</el-table-column>
<el-table-column label="出库台数" align="center" width="180">
<template slot-scope="scope">
<span>{{ scope.row.vehCount }}</span>
</template>
</el-table-column>
<el-table-column label="待接收人" align="center" width="180">
<template slot-scope="scope">
<span>{{ scope.row.recName }}</span>
</template>
</el-table-column>
<el-table-column label="待接收人电话" align="center" width="180">
<template slot-scope="scope">
<span>{{ scope.row.recPhone }}</span>
</template>
</el-table-column>
<el-table-column label="移交人" align="center" width="180">
<template slot-scope="scope">
<span>{{ scope.row.transferName }}</span>
</template>
</el-table-column>
<el-table-column label="移交人电话" align="center" width="180">
<template slot-scope="scope">
<span>{{ scope.row.transferPhone }}</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 列表页面 -->
<discountpackagehandoverAdd v-show="viewState == 2" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
<discountpackagehandoverInfo v-show="viewState == 3" ref="divInfo" @doback="resetState"/>
<discountpackagehandover v-show="viewState == 4" ref="divYiJiao" @doback="resetState"/>
<discountpackagehandoverAddByXiaoShou v-show="viewState == 5" ref="divAddByXiaoShou" @doback="resetState" @reloadlist="getList"/>
</div>
</template>
<script>
import { listPage } from '@/api/discountpackagehandover/discountpackagehandover'
import { getOrgSidByPath } from '@/api/dictcommons/dictcommons'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import discountpackagehandoverAdd from './discountpackagehandoverAdd'
import discountpackagehandoverInfo from './discountpackagehandoverInfo'
import discountpackagehandover from './discountpackagehandover'
import discountpackagehandoverAddByXiaoShou from './discountpackagehandoverAddByXiaoShou'
export default {
name: 'YouHuiBaoDaiJiaoJie',
components: {
Pagination,
pageye,
ButtonBar,
discountpackagehandoverAdd,
discountpackagehandoverInfo,
discountpackagehandover,
discountpackagehandoverAddByXiaoShou
},
data() {
return {
viewState: 1,
btndisabled: false,
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
// 查询条件 -----------
tableKey: 0,
list: [],
FormLoading: false,
listLoading: false,
listQuery: {
params: {
useOrgSid: '',
userSid: '',
state: '1',
createStartTime: '',
createEndTime: '',
contractNo: '',
customerName: '',
recName: '',
transferName: ''
},
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() {
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
if (res.success) {
this.listQuery.params.useOrgSid = res.data
// 加载列表
this.getList()
}
})
},
// 序号
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.userSid = window.sessionStorage.getItem('userSid')
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
}
})
},
handleClick() {
this.viewState = 4
this.$refs['divYiJiao'].init()
},
// 查询按钮
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
this.listQuery = {
params: {
useOrgSid: '',
userSid: '',
state: '1',
createStartTime: '',
createEndTime: '',
contractNo: '',
customerName: '',
recName: '',
transferName: ''
},
current: 1,
size: 10,
total: 0
}
this.init()
},
// 交接
handJiaojie(row) {
this.viewState = 2
this.$refs['divAdd'].showEdit(row)
},
// 确认
handConFirm(row) {
this.viewState = 5
this.$refs['divAddByXiaoShou'].showEdit(row)
},
handLook(row) {
this.viewState = 3
this.$refs['divInfo'].showInfo(row)
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
.btn_style {
background-color: #018ad2;
color: white;
font-weight: 600;
}
</style>