Browse Source

优惠包交接

zhanglei
yunuo970428 2 years ago
parent
commit
4e4ec45b1d
  1. 58
      anrui-buscenter/anrui-buscenter-ui/src/api/discountpackagehandover/discountpackagehandover.js
  2. 213
      anrui-buscenter/anrui-buscenter-ui/src/components/uploadFile/uploadFile.vue
  3. 234
      anrui-buscenter/anrui-buscenter-ui/src/components/uploadFile/uploadImg.vue
  4. 40
      anrui-buscenter/anrui-buscenter-ui/src/router/index.js
  5. 328
      anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagehandover.vue
  6. 186
      anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagehandoverAdd.vue
  7. 251
      anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagehandoverAddByXiaoShou.vue
  8. 173
      anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagehandoverInfo.vue
  9. 279
      anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagetobehandover.vue

58
anrui-buscenter/anrui-buscenter-ui/src/api/discountpackagehandover/discountpackagehandover.js

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

213
anrui-buscenter/anrui-buscenter-ui/src/components/uploadFile/uploadFile.vue

@ -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_catchid
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_catchfils_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>

234
anrui-buscenter/anrui-buscenter-ui/src/components/uploadFile/uploadImg.vue

@ -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_catchid
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_catchfils_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>

40
anrui-buscenter/anrui-buscenter-ui/src/router/index.js

@ -361,6 +361,46 @@ export const constantRoutes = [
}
]
},
// 优惠包
{
path: '/discountpackagehandover',
component: Layout,
redirect: '/discountpackagehandover',
meta: {
title: '优惠包交接'
},
children: [
{
path: '/discountpackagehandover',
component: () =>
import('@/views/discountpackagehandover/discountpackagetobehandover.vue'),
name: 'YouHuiBaoDaiJiaoJie',
meta: {
title: '优惠包交接'
}
}
]
},
// 优惠包
{
path: '/discountpackagehandover',
component: Layout,
redirect: '/discountpackagehandover',
meta: {
title: '优惠包交接'
},
children: [
{
path: '/discountpackagehandover',
component: () =>
import('@/views/discountpackagehandover/discountpackagetobehandover.vue'),
name: 'YouHuiBaoDaiJiaoJie',
meta: {
title: '优惠包交接'
}
}
]
},
// 流程所需页面路径
// 订金收取审批、发起人详情页面
{

328
anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagehandover.vue

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

186
anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagehandoverAdd.vue

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

251
anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagehandoverAddByXiaoShou.vue

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

173
anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagehandoverInfo.vue

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

279
anrui-buscenter/anrui-buscenter-ui/src/views/discountpackagehandover/discountpackagetobehandover.vue

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