9 changed files with 1762 additions and 0 deletions
@ -0,0 +1,58 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 优惠包交接分页列表
|
|||
export function listPage(data) { |
|||
return request({ |
|||
url: '/buscenter/v1/busdiscountpackagehandover/listPage', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 优惠包准备
|
|||
export function handover(data) { |
|||
return request({ |
|||
url: '/buscenter/v1/busdiscountpackagehandover/handover/' + data, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 已交接列表--照片上传
|
|||
export function uploadPicture(data) { |
|||
return request({ |
|||
url: '/buscenter/v1/busdiscountpackagehandover/uploadPicture', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 优惠包准备
|
|||
export function toDohandover(data) { |
|||
return request({ |
|||
url: '/buscenter/v1/busdiscountpackagehandover/toDohandover', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 打印交接单
|
|||
export function createPdf(data) { |
|||
return request({ |
|||
url: '/buscenter/v1/busdiscountpackagehandover/createPdf', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
} |
|||
|
@ -0,0 +1,213 @@ |
|||
<template> |
|||
<div><!----> |
|||
<el-upload class="upload-demo" :headers="accessToken" :action="uploadFile" :accept="accept" :data="uploadData" |
|||
:on-success="uploadImgSuccess_FuJian" :on-remove="handleRemove" :file-list="fileList_FuJian" |
|||
:on-preview="handlePictureCardPreview" :show-file-list="false"> |
|||
<el-button size="mini" type="primary">上传</el-button> |
|||
</el-upload> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { uploadFile } from '@/api/portal/Upload' |
|||
import { getStorage } from '@/utils/auth.js' |
|||
|
|||
export default { |
|||
model: { |
|||
prop: 'name', |
|||
event: 'change' |
|||
}, |
|||
props: { |
|||
placeholder: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
bucket: { |
|||
type: String, |
|||
default: 'abc' |
|||
}, |
|||
// 长度 |
|||
width: { |
|||
type: String, |
|||
default: '270px' |
|||
}, |
|||
limit: { |
|||
type: Number, |
|||
default: 1 |
|||
}, |
|||
accept: { |
|||
type: String, |
|||
default: |
|||
'.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx' |
|||
}, |
|||
// 文件名称 |
|||
name: { |
|||
type: Array, |
|||
required: true |
|||
}, |
|||
uploadData: { |
|||
type: Object, |
|||
default: {} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogImageUrl: '', |
|||
dialogVisible: false, |
|||
accessToken: null, |
|||
uploadFile: uploadFile, |
|||
fileList_FuJian: [], |
|||
enclosure: '', |
|||
file_add: '', |
|||
file_catch: '', |
|||
files: [], |
|||
files_list: [], |
|||
filedUrl: '', |
|||
isview: false, |
|||
nameArr: '', |
|||
loadding: false, |
|||
stateName: '', |
|||
sid: '' |
|||
} |
|||
}, |
|||
watch: { |
|||
name: { |
|||
deep: true, |
|||
immediate: true, |
|||
handler(newVal, oldVal) { |
|||
console.log('aaaa1', newVal) |
|||
this.files = newVal |
|||
console.log('aaaa2', this.files) |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.Init() |
|||
}) |
|||
}, |
|||
created() { |
|||
this.uploadFile = uploadFile // 接口 |
|||
this.accessToken = { |
|||
token: getStorage() |
|||
} |
|||
}, |
|||
methods: { |
|||
// 页面第一次加载 |
|||
Init() { |
|||
if (this.name !== undefined) { |
|||
this.files = [] |
|||
for (var i = 0; i < this.name.length; i++) { |
|||
this.files.push({ |
|||
name: this.name[i], |
|||
url: this.name[i] |
|||
}) |
|||
} |
|||
} |
|||
}, |
|||
// 上传方案--成功后执行 |
|||
uploadImgSuccess_FuJian(response, file, fileList) { |
|||
console.log('您选择的file:', file) |
|||
// console.log('您传递的data:', _this.uploadData) |
|||
if (file.response.code === '200') { |
|||
this.loadding = false |
|||
// 返显图片 |
|||
this.filedUrl = this.fileUrl + file.response.data |
|||
// var uid = file.response.data |
|||
this.files.push({ |
|||
name: file.response.data.sourceFileName, |
|||
url: file.response.data.fullUrl, |
|||
size: file.response.data.size |
|||
}) |
|||
this.$emit('change', this.files) |
|||
this.$emit('eett', this.files) |
|||
} |
|||
}, |
|||
removeImage(file, ImageFileList) { |
|||
this.files.splice(this.files.indexOf(file), 1) |
|||
const imgFiles = [] |
|||
this.files.forEach((o) => { |
|||
imgFiles.push(o.url) |
|||
}) |
|||
this.$emit('fileChange', this.files) |
|||
}, |
|||
handleRemove(file, fileList) { |
|||
console.log('file:' + JSON.stringify(file)) |
|||
console.log('fileList:' + JSON.stringify(fileList)) |
|||
this.enclosure = '' |
|||
// 1. 保存新增文件id(this.file_add) |
|||
this.getNewFileId(fileList) |
|||
// 2. 保存数据库读取的已有文件id(this.file_catch) |
|||
this.getCatchFileId(file) |
|||
// 3. 保存并拼接id |
|||
this.getFileId() |
|||
// 4. 返回拼接id |
|||
this.$emit('change', this.enclosure) |
|||
}, |
|||
// 返回this.file_add(新上传文件的id拼接集合) |
|||
getNewFileId(fileList) { |
|||
// debugger |
|||
this.file_add = '' |
|||
for (var i = 0; i < fileList.length; i++) { |
|||
if (fileList[i].response && fileList[i].response.code === '200') { |
|||
this.file_add = this.file_add + fileList[i].response.data + ',' |
|||
} |
|||
} |
|||
if (this.file_add !== '') { |
|||
this.file_add = this.file_add.substring(0, this.file_add.length - 1) |
|||
} |
|||
// console.log('1. this.file_add: ' + this.file_add) |
|||
}, |
|||
// 返回this.file_catch(数库一寸照的文件的id的拼接集合) |
|||
getCatchFileId(file) { |
|||
for (var i = 0; i < this.files_list.length; i++) { |
|||
if (this.file_catch !== '') { |
|||
// 1. 检查当前删除的文件是否是修改文件列表里面的,如果是,将修改列表里去除此id |
|||
if (this.files_list[i].name === file.name) { |
|||
// 2. 拆开file_catch到fils_arry |
|||
var fils_arry = this.file_catch.split(',') |
|||
// 3. 从fils_arry去除 this.files_list[i].id |
|||
var arry = [] |
|||
fils_arry.forEach((element) => { |
|||
// 不加载文件里面的 |
|||
if (element !== this.files_list[i].id) { |
|||
arry.push(element) |
|||
} |
|||
}) |
|||
// 4. 重新拼接成file_catch |
|||
this.file_catch = arry.join(',') |
|||
} |
|||
} |
|||
} |
|||
// console.log('2. this.file_catch:' + this.file_catch) |
|||
}, |
|||
// 保存并拼接id |
|||
getFileId() { |
|||
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add) |
|||
if (this.file_catch !== '') { |
|||
if (this.file_add !== '') { |
|||
this.enclosure = this.file_catch + ',' + this.file_add |
|||
} else { |
|||
this.enclosure = this.file_catch |
|||
} |
|||
} else { |
|||
this.enclosure = this.file_add |
|||
} |
|||
}, |
|||
handlePictureCardPreview(file) { |
|||
this.dialogImageUrl = file.url |
|||
}, |
|||
// 上传失败 |
|||
uploadError() { |
|||
this.loadding = false |
|||
}, |
|||
uploadProgrees(event, file, fileList) { |
|||
if (Number(event.percent) > 0) { |
|||
this.loadding = true |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
@ -0,0 +1,234 @@ |
|||
<template> |
|||
<div> |
|||
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken" |
|||
:action="uploadFile" accept=".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP" list-type="picture-card" |
|||
:file-list="files" :on-remove="removeImage" :on-preview="handlePictureCardPreview" |
|||
:on-progress="uploadProgrees" |
|||
:on-error="uploadError" :on-success="uploadImgSuccess_FuJian"> |
|||
<i class="el-icon-plus avatar-uploader-icon"/> |
|||
</el-upload> |
|||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true" title="查看图片"> |
|||
<img width="100%" :src="dialogImageUrl" alt=""> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { uploadFile } from '@/api/portal/Upload.js' |
|||
import { getStorage } from '@/utils/auth.js' |
|||
|
|||
export default { |
|||
model: { |
|||
prop: 'name', |
|||
event: 'change' |
|||
}, |
|||
props: { |
|||
placeholder: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
bucket: { |
|||
type: String, |
|||
default: 'abc' |
|||
}, |
|||
// 长度 |
|||
width: { |
|||
type: String, |
|||
default: '270px' |
|||
}, |
|||
limit: { |
|||
type: Number, |
|||
default: 1 |
|||
}, |
|||
accept: { |
|||
type: String, |
|||
default: |
|||
'.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx' |
|||
}, |
|||
// 文件名称 |
|||
name: { |
|||
type: Array, |
|||
required: true |
|||
}, |
|||
uploadData: { |
|||
type: Object, |
|||
default: {} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogImageUrl: '', |
|||
dialogVisible: false, |
|||
accessToken: null, |
|||
uploadFile: uploadFile, |
|||
fileList_FuJian: [], |
|||
enclosure: '', |
|||
file_add: '', |
|||
file_catch: '', |
|||
files: [], |
|||
files_list: [], |
|||
filedUrl: '', |
|||
// fileUrl: fileUrl, |
|||
// showpicture:false, |
|||
isview: false, |
|||
nameArr: '', |
|||
loadding: false, |
|||
stateName: '' |
|||
} |
|||
}, |
|||
watch: { |
|||
name: { |
|||
deep: true, |
|||
immediate: true, |
|||
handler(newVal, oldVal) { |
|||
console.log('aaaa1', newVal) |
|||
this.files = newVal |
|||
// if (this.stateName = 'xunidingjinAdd') { |
|||
// if (this.files.length > 1) { |
|||
// this.files.splice(0, 1) |
|||
// } |
|||
// } |
|||
console.log('aaaa2', this.files) |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.Init() |
|||
}) |
|||
}, |
|||
created() { |
|||
this.uploadFile = uploadFile // 接口 |
|||
this.accessToken = { |
|||
token: getStorage() |
|||
} |
|||
}, |
|||
methods: { |
|||
showImg(imgList) { |
|||
this.stateName = 'xunidingjinAdd' |
|||
this.files = imgList |
|||
console.log('回显图片', this.files) |
|||
}, |
|||
view() { |
|||
// window.open(this.filedUrl) |
|||
}, |
|||
// 页面第一次加载 |
|||
Init() { |
|||
if (this.name !== undefined) { |
|||
this.files = [] |
|||
for (var i = 0; i < this.name.length; i++) { |
|||
this.files.push({ |
|||
name: this.name[i], |
|||
url: this.name[i] |
|||
}) |
|||
} |
|||
} |
|||
}, |
|||
// 上传方案--成功后执行 |
|||
uploadImgSuccess_FuJian(response, file, fileList) { |
|||
console.log('您选择的file:', file) |
|||
if (file.response.code === '200') { |
|||
this.loadding = false |
|||
// 返显图片 |
|||
this.filedUrl = this.fileUrl + file.response.data |
|||
// var uid = file.response.data |
|||
this.files.push({ |
|||
name: file.response.data.sourceFileName, |
|||
url: file.response.data.fullUrl, |
|||
size: file.response.data.size |
|||
}) |
|||
this.$emit('change', this.files) |
|||
this.$emit('eett', this.files) |
|||
} |
|||
}, |
|||
|
|||
removeImage(file, ImageFileList) { |
|||
this.files.splice(this.files.indexOf(file), 1) |
|||
const imgFiles = [] |
|||
|
|||
this.files.forEach((o) => { |
|||
imgFiles.push(o.url) |
|||
}) |
|||
this.$emit('fileChange', this.files) |
|||
}, |
|||
handleRemove(file, fileList) { |
|||
console.log('file:' + JSON.stringify(file)) |
|||
console.log('fileList:' + JSON.stringify(fileList)) |
|||
this.enclosure = '' |
|||
// 1. 保存新增文件id(this.file_add) |
|||
this.getNewFileId(fileList) |
|||
// 2. 保存数据库读取的已有文件id(this.file_catch) |
|||
this.getCatchFileId(file) |
|||
// 3. 保存并拼接id |
|||
this.getFileId() |
|||
// 4. 返回拼接id |
|||
this.$emit('change', this.enclosure) |
|||
}, |
|||
// 返回this.file_add(新上传文件的id拼接集合) |
|||
getNewFileId(fileList) { |
|||
// debugger |
|||
this.file_add = '' |
|||
for (var i = 0; i < fileList.length; i++) { |
|||
if (fileList[i].response && fileList[i].response.code === '200') { |
|||
this.file_add = this.file_add + fileList[i].response.data + ',' |
|||
} |
|||
} |
|||
if (this.file_add !== '') { |
|||
this.file_add = this.file_add.substring(0, this.file_add.length - 1) |
|||
} |
|||
// console.log('1. this.file_add: ' + this.file_add) |
|||
}, |
|||
// 返回this.file_catch(数库一寸照的文件的id的拼接集合) |
|||
getCatchFileId(file) { |
|||
for (var i = 0; i < this.files_list.length; i++) { |
|||
if (this.file_catch !== '') { |
|||
// 1. 检查当前删除的文件是否是修改文件列表里面的,如果是,将修改列表里去除此id |
|||
if (this.files_list[i].name === file.name) { |
|||
// 2. 拆开file_catch到fils_arry |
|||
var fils_arry = this.file_catch.split(',') |
|||
// 3. 从fils_arry去除 this.files_list[i].id |
|||
var arry = [] |
|||
fils_arry.forEach((element) => { |
|||
// 不加载文件里面的 |
|||
if (element !== this.files_list[i].id) { |
|||
arry.push(element) |
|||
} |
|||
}) |
|||
// 4. 重新拼接成file_catch |
|||
this.file_catch = arry.join(',') |
|||
} |
|||
} |
|||
} |
|||
// console.log('2. this.file_catch:' + this.file_catch) |
|||
}, |
|||
// 保存并拼接id |
|||
getFileId() { |
|||
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add) |
|||
if (this.file_catch !== '') { |
|||
if (this.file_add !== '') { |
|||
this.enclosure = this.file_catch + ',' + this.file_add |
|||
} else { |
|||
this.enclosure = this.file_catch |
|||
} |
|||
} else { |
|||
this.enclosure = this.file_add |
|||
} |
|||
}, |
|||
handlePictureCardPreview(file) { |
|||
this.dialogImageUrl = file.url |
|||
this.dialogVisible = true |
|||
}, |
|||
// 上传失败 |
|||
uploadError() { |
|||
this.loadding = false |
|||
}, |
|||
uploadProgrees(event, file, fileList) { |
|||
if (Number(event.percent) > 0) { |
|||
this.loadding = true |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
@ -0,0 +1,328 @@ |
|||
<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="" @click="handleClick">待交接</el-button> |
|||
<el-button :class="{btn_style:viewState === 1}">已交接</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%;" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50" type="selection" align="center"/> |
|||
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column label="操作" width="180" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" size="mini" @click="handLook(scope.row)">查看</el-button> |
|||
<div class="upload_img"> |
|||
<uploadFile ref="uploadMoreImg" v-model="imgList" bucket="map" @eett="backData(scope.row)" :upload-data="{type:'0001'}"></uploadFile> |
|||
</div> |
|||
</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> |
|||
</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 列表页面 --> |
|||
<discountpackagehandoverInfo v-show="viewState ==2" ref="divInfo" @doback="resetState"/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listPage, createPdf, uploadPicture } from '@/api/discountpackagehandover/discountpackagehandover' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import discountpackagehandoverInfo from './discountpackagehandoverInfo' |
|||
import { getOrgSidByPath } from '@/api/dictcommons/dictcommons' |
|||
import { getStorage } from '@/utils/auth' |
|||
import uploadFile from '@/components/uploadFile/uploadFile' |
|||
|
|||
export default { |
|||
name: 'YouHuiBaoYiJiaoJie', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar, |
|||
discountpackagehandoverInfo, |
|||
uploadFile |
|||
}, |
|||
data() { |
|||
return { |
|||
viewState: 1, |
|||
btndisabled: false, |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: '', |
|||
btnKey: 'toDownLoad', |
|||
btnLabel: '打印交接单' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
// 查询条件 ----------- |
|||
tableKey: 0, |
|||
list: [], |
|||
sids: [], |
|||
imgList: [], |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
listQuery: { |
|||
params: { |
|||
useOrgSid: '', |
|||
userSid: '', |
|||
state: '3', |
|||
createStartTime: '', |
|||
createEndTime: '', |
|||
contractNo: '', |
|||
customerName: '', |
|||
recName: '' |
|||
}, |
|||
current: 1, |
|||
size: 10, |
|||
total: 0 |
|||
} |
|||
} |
|||
}, |
|||
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 'toDownLoad': |
|||
this.toDownLoad() |
|||
break |
|||
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() |
|||
} |
|||
}) |
|||
}, |
|||
handleSelectionChange(row) { |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push(element.sid) |
|||
}) |
|||
this.sids = aa |
|||
console.log('sids', this.sids) |
|||
}, |
|||
// 序号 |
|||
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) => { |
|||
console.log('列表查询结果:', 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.$parent.resetState() |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
handleReset() { |
|||
this.listQuery = { |
|||
params: { |
|||
useOrgSid: '', |
|||
userSid: '', |
|||
state: '1', |
|||
createStartTime: '', |
|||
createEndTime: '', |
|||
contractNo: '', |
|||
customerName: '', |
|||
recName: '' |
|||
}, |
|||
current: 1, |
|||
size: 10, |
|||
total: 0 |
|||
} |
|||
this.init() |
|||
}, |
|||
backData(row) { |
|||
if (this.imgList.length > 0) { |
|||
const aa = [] |
|||
for (var i = 0; i < this.imgList.length; i++) { |
|||
aa.push({ |
|||
attachType: '', |
|||
fileName: this.imgList[i].name, |
|||
filePath: this.imgList[i].url, |
|||
fileSize: this.imgList[i].size, |
|||
fileType: this.imgList[i].name.substr(this.imgList[i].name.lastIndexOf('.')), |
|||
linkSid: row.sid, |
|||
name: window.sessionStorage.getItem('name'), |
|||
createBysid: window.sessionStorage.getItem('userSid') |
|||
}) |
|||
} |
|||
uploadPicture({ sid: row.sid, busFiles: aa }).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '上传成功' }) |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
handLook(row) { |
|||
this.viewState = 2 |
|||
this.$refs['divInfo'].showInfo(row) |
|||
}, |
|||
toDownLoad() { |
|||
if (this.sids.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '请至少选择一条记录进行打印操作' }) |
|||
return |
|||
} |
|||
createPdf(this.sids).then((resp) => { |
|||
if (resp.success) { |
|||
var xhr = new XMLHttpRequest() |
|||
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + resp.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() |
|||
} |
|||
}) |
|||
}, |
|||
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> |
@ -0,0 +1,186 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">完成 |
|||
</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class="listconadd"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|||
<el-row style="border-top: 1px solid #E0E3EB"> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>合同编号</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.contractNo }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>客户名称</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.customerName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>车型</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vehModel }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>出库台数</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vehCount }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>车架号</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vinNo }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>备注</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item><el-input v-model="formobj.remarks" clearable placeholder=""/></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title"> |
|||
<div>优惠包列表</div> |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.busDiscountpackageHandoverLists" :index="index" border style="width: 100%;"> |
|||
<el-table-column fixed label="序号" type="index" :index="index + 1" align="center" width="60"></el-table-column> |
|||
<el-table-column label="优惠包名称" align="center" width="130"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.discountName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="价值" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.price }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="优惠项目说明" align="center" min-idth="200"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.packageExplain }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="数量" align="center" width="80"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.number }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="总价值" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.totalPrice }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { handover, toDohandover } from '@/api/discountpackagehandover/discountpackagehandover' |
|||
|
|||
export default { |
|||
name: 'YouHuiBaoAdd', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
submitdisabled: false, |
|||
tableKey: 0, |
|||
index: 0, |
|||
formobj: { |
|||
sid: '', |
|||
contractNo: '', |
|||
customerName: '', |
|||
vehModel: '', |
|||
vehCount: '', |
|||
vinNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
busDiscountpackageHandoverLists: [] |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
methods: { |
|||
showEdit(row) { |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '优惠包准备' |
|||
handover(row.sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|||
} |
|||
}) |
|||
}, |
|||
saveOrUpdate() { |
|||
this.$confirm('确认优惠包已准备完成,进行交接?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
toDohandover(this.formobj).then((resp) => { |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
|||
this.handleReturn('true') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.formobj = { |
|||
sid: '', |
|||
contractNo: '', |
|||
customerName: '', |
|||
vehModel: '', |
|||
vehCount: '', |
|||
vinNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
busDiscountpackageHandoverLists: [] |
|||
} |
|||
this.submitdisabled = false |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,251 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">确认 |
|||
</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class="listconadd"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|||
<el-row style="border-top: 1px solid #E0E3EB"> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>合同编号</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.contractNo }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>客户名称</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.customerName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>车型</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vehModel }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>出库台数</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vehCount }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>车架号</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vinNo }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>接收人</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.recName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>接收时间</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.recTime }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>备注</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item><el-input v-model="formobj.remarks" clearable placeholder=""/></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title"> |
|||
<div>优惠包列表</div> |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.busDiscountpackageHandoverLists" :index="index" border style="width: 100%;"> |
|||
<el-table-column fixed label="序号" type="index" :index="index + 1" align="center" width="60"></el-table-column> |
|||
<el-table-column label="优惠包名称" align="center" width="130"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.discountName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="价值" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.price }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="优惠项目说明" align="center" min-idth="200"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.packageExplain }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="数量" align="center" width="80"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.number }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="总价值" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.totalPrice }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>客户交接照片</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<uploadImg ref="uploadImg" v-model="imgList" :limit="50" bucket="map" :upload-data="{type:'0001'}"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { handover, toDohandover } from '@/api/discountpackagehandover/discountpackagehandover' |
|||
import uploadImg from '@/components/uploadFile/uploadImg' |
|||
|
|||
export default { |
|||
name: 'YouHuiBaoAddByXiaoShou', |
|||
components: { |
|||
uploadImg |
|||
}, |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
submitdisabled: false, |
|||
tableKey: 0, |
|||
index: 0, |
|||
imgList: [], |
|||
formobj: { |
|||
sid: '', |
|||
contractNo: '', |
|||
customerName: '', |
|||
vehModel: '', |
|||
vehCount: '', |
|||
vinNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
busDiscountpackageHandoverLists: [], |
|||
busFiles: [] |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
methods: { |
|||
showEdit(row) { |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '优惠包交接确认' |
|||
handover(row.sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|||
var date = new Date() |
|||
var year = date.getFullYear() // 年 |
|||
var month = date.getMonth() + 1 // 月 |
|||
var day = date.getDate() // 日 |
|||
if (month < 10) { |
|||
month = '0' + month |
|||
} |
|||
if (day < 10) { |
|||
day = '0' + day |
|||
} |
|||
this.formobj.recTime = year + '-' + month + '-' + day |
|||
} |
|||
}) |
|||
}, |
|||
saveOrUpdate() { |
|||
this.$confirm('请确认是否进行交接', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.getUrl() |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
toDohandover(this.formobj).then((resp) => { |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
|||
this.handleReturn('true') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
getUrl() { |
|||
if (this.imgList.length > 0) { |
|||
const aa = [] |
|||
for (var i = 0; i < this.imgList.length; i++) { |
|||
aa.push({ |
|||
attachType: '', |
|||
fileName: this.imgList[i].name, |
|||
filePath: this.imgList[i].url, |
|||
fileSize: this.imgList[i].size, |
|||
fileType: this.imgList[i].name.substr(this.imgList[i].name.lastIndexOf('.')), |
|||
linkSid: '', |
|||
name: window.sessionStorage.getItem('name'), |
|||
createBysid: window.sessionStorage.getItem('userSid') |
|||
}) |
|||
} |
|||
this.formobj.busFiles = aa |
|||
} |
|||
}, |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.formobj = { |
|||
sid: '', |
|||
contractNo: '', |
|||
customerName: '', |
|||
vehModel: '', |
|||
vehCount: '', |
|||
vinNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
busDiscountpackageHandoverLists: [], |
|||
busFiles: [] |
|||
} |
|||
this.submitdisabled = false |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,173 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class="listconadd"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|||
<el-row style="border-top: 1px solid #E0E3EB"> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>合同编号</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.contractNo }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>客户名称</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.customerName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>车型</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vehModel }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>出库台数</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vehCount }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>车架号</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<span>{{ formobj.vinNo }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>接收人</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.recName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>接收时间</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<span>{{ formobj.recTime }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>备注</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item><span>{{ formobj.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title"> |
|||
<div>优惠包列表</div> |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.busDiscountpackageHandoverLists" :index="index" border style="width: 100%;"> |
|||
<el-table-column fixed label="序号" type="index" :index="index + 1" align="center" width="60"></el-table-column> |
|||
<el-table-column label="优惠包名称" align="center" width="130"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.discountName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="价值" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.price }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="优惠项目说明" align="center" min-idth="200"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.packageExplain }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="数量" align="center" width="80"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.number }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="总价值" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.totalPrice }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { handover } from '@/api/discountpackagehandover/discountpackagehandover' |
|||
|
|||
export default { |
|||
name: 'YouHuiBaoInfo', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
tableKey: 0, |
|||
index: 0, |
|||
formobj: { |
|||
sid: '', |
|||
contractNo: '', |
|||
customerName: '', |
|||
vehModel: '', |
|||
vehCount: '', |
|||
vinNo: '', |
|||
remarks: '', |
|||
busDiscountpackageHandoverLists: [] |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
methods: { |
|||
showInfo(row) { |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '优惠包交接详情' |
|||
handover(row.sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
} |
|||
}) |
|||
}, |
|||
handleReturn() { |
|||
this.formobj = { |
|||
sid: '', |
|||
contractNo: '', |
|||
customerName: '', |
|||
vehModel: '', |
|||
vehCount: '', |
|||
vins: '', |
|||
remarks: '', |
|||
busDiscountpackageHandoverListVos: [] |
|||
} |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,279 @@ |
|||
<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> |
|||
</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: '' |
|||
}, |
|||
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: '' |
|||
}, |
|||
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> |
Loading…
Reference in new issue