Browse Source

厂家回款返利分配

zhanglei
yunuo970428 2 years ago
parent
commit
4e3879a5d3
  1. 38
      anrui-scm/anrui-scm-ui/src/api/manufacturerrebates/collectionrebateallot.js
  2. 262
      anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallot.vue
  3. 254
      anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallotAdd.vue
  4. 260
      anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallotByVehicleAdd.vue
  5. 184
      anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallotInfo.vue
  6. 249
      anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/relation/collectionrebateallotSelectVehicle.vue

38
anrui-scm/anrui-scm-ui/src/api/manufacturerrebates/collectionrebateallot.js

@ -0,0 +1,38 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(data) {
return request({
url: '/scm/v1/scmcollectionrebatedistribution/listPage',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
// 获取车辆
pageList: function(data) {
return request({
url: '/base/v1/basevehicle/vehicleCollectionList',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
// 新增保存修改记录
save: function(data) {
return request({
url: '/scm/v1/scmcollectionrebatedistribution/save',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
// 通过sid查询一条记录
fetchBySid: function(data) {
return request({
url: '/scm/v1/scmcollectionrebatedistribution/fetchDetailsBySid/' + data,
method: 'get'
})
}
}

262
anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallot.vue

@ -0,0 +1,262 @@
<template>
<div class="app-container">
<!-- Start 列表页面 -->
<div v-show="viewState == 1">
<button-bar view-title="回款返利分配管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="品牌">
<el-select v-model="listQuery.params.brandSid" placeholder="请选择" filterable clearable>
<el-option v-for="item in brand_list" :key="item.sid" :label="item.name" :value="item.sid"/>
</el-select>
</el-form-item>
<el-form-item label="申请标题">
<el-input v-model="listQuery.params.withholdingApply" placeholder="" clearable></el-input>
</el-form-item>
<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>
<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="序号" type="index" :index="indexMethod" align="center" width="80px"/>
<el-table-column fixed label="操作" align="center" width="180px" >
<template slot-scope="scope">
<el-button type="primary" :disabled="scope.row.distributionState === '已分配'" size="mini" @click="toEdit(scope.row)">办理</el-button>
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.distributionState }}</span>
</template>
</el-table-column>
<el-table-column label="分公司" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.createOrgName }}</span>
</template>
</el-table-column>
<el-table-column label="品牌" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="预提申请" align="center" width="250">
<template slot-scope="scope">
<span>{{ scope.row.withholdingApply }}</span>
</template>
</el-table-column>
<el-table-column label="回款金额" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.collectionMoney }}</span>
</template>
</el-table-column>
<el-table-column label="预提返利" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.estimateRebate }}</span>
</template>
</el-table-column>
<el-table-column label="分摊参考比例" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.shareGinExaProportion }}</span>
</template>
</el-table-column>
<el-table-column label="分摊比例" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.shareProportion }}</span>
</template>
</el-table-column>
<el-table-column label="分摊返利总额" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.shareRebateTotal }}</span>
</template>
</el-table-column>
<el-table-column label="本次返利余额" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.thisRebateBalance }}</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>
<collectionrebateallotByVehicleAdd v-show="viewState == 2" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
<collectionrebateallotInfo v-show="viewState == 3" ref="divInfo" @doback="resetState"/>
</div>
</template>
<script>
import req from '@/api/manufacturerrebates/collectionrebateallot'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { brandDown, getPathSidByUserSid } from '@/api/cheliang/dictcommons'
import collectionrebateallotByVehicleAdd from './collectionrebateallotByVehicleAdd'
import collectionrebateallotInfo from './collectionrebateallotInfo'
export default {
name: 'huikuanfanlifenpei',
components: {
Pagination,
pageye,
ButtonBar,
collectionrebateallotByVehicleAdd,
collectionrebateallotInfo
},
data() {
return {
btndisabled: false,
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
viewState: 1,
// -----------
tableKey: 0,
list: [],
FormLoading: false,
listLoading: false,
brand_list: [],
listQuery: {
params: {
brandSid: '',
createOrgSid: '',
createStartTime: '',
createEndTime: '',
withholdingApply: ''
},
current: 1,
size: 5,
total: 0
},
rules: {}
}
},
created() {
//
this.init()
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
init() {
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((resp) => {
if (resp.success) {
this.listQuery.params.createOrgSid = resp.data
brandDown({ useOrg: resp.data }).then((res) => {
if (res.success) {
this.brand_list = res.data
}
})
this.getList()
}
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doClose':
this.doClose()
break
default:
break
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
req.listPage(this.listQuery).then((response) => {
console.log('列表查询结果:', response)
this.listLoading = false
if (response.success && response.data && response.data.total > 0) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
this.listQuery = {
params: {
brandSid: '',
createOrgSid: '',
createStartTime: '',
createEndTime: '',
withholdingApply: ''
},
current: 1,
size: 5,
total: 0
}
this.init()
},
toEdit(row) {
this.viewState = 2
this.$refs['divAdd'].showEdit(row, this.listQuery.params.createOrgSid)
},
toInfo(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>
</style>

254
anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallotAdd.vue

@ -0,0 +1,254 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSave()">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<div class="titwu"><span>回款返利分配</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="3" class="tleftb">
<span>回款金额</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.collectionMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span>预提返利</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.estimateRebate }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span>分摊参考比例</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.shareGinExaProportion }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3" class="tleftb">
<span>分摊比例</span>
</el-col>
<el-col :span="5">
<el-form-item>
<el-input v-model="formobj.shareProportion" clearable @keyup.native="UpNumber" placeholder="" class="addinputw"/>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span>分摊返利总额</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ shareRebateTotalSummation() }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span>本次返利余额</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ thisRebateBalanceSummation() }}</span>
</el-form-item>
</el-col>
</el-row>
<div class="title">
<div style="text-align: right">
<el-button type="primary" size="mini" class="btntopblueline" @click="handleAllocation()">分配</el-button>
</div>
</div>
<el-table :key="tableKey" :data="formobj.scmCollectionRebateDistributionVehs" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="车型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.carModelName }}</span>
</template>
</el-table-column>
<el-table-column label="车架号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span>
</template>
</el-table-column>
<el-table-column label="厂家结算价" align="center">
<template slot-scope="scope">
<span>{{ scope.row.costPrice }}</span>
</template>
</el-table-column>
<el-table-column label="入库日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.priceDate }}</span>
</template>
</el-table-column>
<el-table-column label="销售日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.salesDate }}</span>
</template>
</el-table-column>
<el-table-column label="回款返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.distributionCollectionRebate }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/manufacturerrebates/collectionrebateallot'
export default {
name: 'collectionrebateallotAdd',
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
aggregate: '',
//
formobj: {
sid: '',
brandName: '',
brandSid: '',
distributionState: '',
shareGinExaProportion: '',
shareProportion: '',
shareRebateTotal: '',
thisRebateBalance: '',
estimateRebate: '',
collectionMoney: '',
useOrgName: '',
useOrgSid: '',
createOrgName: '',
createOrgSid: '',
withholdingApply: '',
scmCollectionRebateDistributionVehs: []
},
rules: {},
submitdisabled: false
}
},
methods: {
UpNumber(e) {
e.target.value = e.target.value.replace(/[^\d.]/g, '') // ."-"
e.target.value = e.target.value.replace(/^00/, '0.') // 0
e.target.value = e.target.value.replace(/\.{2,}/g, '.') // .
e.target.value = e.target.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3') //
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') {
// 0102
e.target.value = parseFloat(e.target.value)
}
},
showEdit(val) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.formobj.sid = val.sid
this.formobj.createOrgSid = val.createOrgSid
this.formobj.useOrgSid = val.useOrgSid
this.formobj.createOrgName = val.createOrgName
this.formobj.useOrgName = val.useOrgName
this.formobj.brandName = val.brandName
this.formobj.brandSid = val.brandSid
this.formobj.collectionMoney = val.collectionMoney
this.formobj.estimateRebate = val.estimateRebate
this.formobj.withholdingApply = val.withholdingApply
this.formobj.distributionState = '已分配'
this.formobj.scmCollectionRebateDistributionVehs = val.scmCollectionRebateDistributionVehs
this.formobj.shareGinExaProportion = parseFloat(this.formobj.estimateRebate) / parseFloat(this.formobj.collectionMoney)
this.viewTitle = '回款返利分配'
},
shareRebateTotalSummation() {
if (this.formobj.shareProportion !== '') {
this.formobj.shareRebateTotal = parseFloat(this.formobj.collectionMoney) * parseFloat(this.formobj.shareProportion)
return this.formobj.shareRebateTotal
}
},
thisRebateBalanceSummation() {
if (this.formobj.shareRebateTotal !== '') {
this.formobj.thisRebateBalance = parseFloat(this.formobj.estimateRebate) - parseFloat(this.formobj.shareRebateTotal)
return this.formobj.thisRebateBalance
}
},
handleAllocation() {
for (var i = 0; i < this.formobj.scmCollectionRebateDistributionVehs.length; i++) {
this.formobj.scmCollectionRebateDistributionVehs[i].distributionCollectionRebate = parseFloat(this.formobj.scmCollectionRebateDistributionVehs[i].costPrice) * parseFloat(this.formobj.shareProportion)
}
},
handleSave() {
if (this.formobj.shareProportion === '') {
this.$message({ showClose: true, type: 'error', message: '分摊比例不能为空' })
return
}
for (var i = 0; i < this.formobj.scmCollectionRebateDistributionVehs.length; i++) {
if (this.formobj.scmCollectionRebateDistributionVehs[i].distributionCollectionRebate === '') {
this.$message({ showClose: true, type: 'error', message: '请点击分配后在保存' })
return
}
}
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.save(this.formobj).then((resp) => {
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' })
this.handleReturn()
}
}).catch(() => {
this.submitdisabled = false
})
}
})
},
// ===
handleReturn() {
//
this.formobj = {
sid: '',
brandName: '',
brandSid: '',
distributionState: '',
shareGinExaProportion: '',
shareProportion: '',
shareRebateTotal: '',
thisRebateBalance: '',
estimateRebate: '',
collectionMoney: '',
useOrgName: '',
useOrgSid: '',
createOrgName: '',
createOrgSid: '',
scmCollectionRebateDistributionVehs: []
}
this.submitdisabled = false
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
.title {
padding: 7px;
}
</style>

260
anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallotByVehicleAdd.vue

@ -0,0 +1,260 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<div class="titwu"><span>返利分配选择车辆</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="2" class="tleftb">
<span>品牌</span>
</el-col>
<el-col :span="4">
<el-form-item>
<span>{{ formobj.brandName }}</span>
</el-form-item>
</el-col>
<el-col :span="2" class="tleftb">
<span>回款金额</span>
</el-col>
<el-col :span="4">
<el-form-item>
<span>{{ formobj.collectionMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="2" class="tleftb">
<span>车辆台数</span>
</el-col>
<el-col :span="4">
<el-form-item>
<span>{{ formobj.number }}</span>
</el-form-item>
</el-col>
<el-col :span="2" class="tleftb">
<span>厂家结算价合计</span>
</el-col>
<el-col :span="4">
<el-form-item>
<span>{{ formobj.constPrice }}</span>
</el-form-item>
</el-col>
</el-row>
<div class="title">
<div style="text-align: right">
<el-button type="primary" size="mini" icon="el-icon-plus" class="btntopblueline" @click="handleSelect()">选择</el-button>
<el-button type="primary" size="mini" class="btntopblueline" @click="handleRebate()">确定</el-button>
</div>
</div>
<el-table :key="tableKey" :data="formobj.scmCollectionRebateDistributionVehs" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column fixed width="80" label="操作" align="center">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="dataDelete(scope)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="车型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.carModelName }}</span>
</template>
</el-table-column>
<el-table-column label="车架号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span>
</template>
</el-table-column>
<el-table-column label="厂家结算价" align="center">
<template slot-scope="scope">
<span>{{ scope.row.costPrice }}</span>
</template>
</el-table-column>
<el-table-column label="入库日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.priceDate }}</span>
</template>
</el-table-column>
<el-table-column label="销售日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.salesDate }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
<collectionrebateallotSelectVehicle v-show="viewState == 2" ref="divSelect" @backData="backData" @doback="resetState"/>
<collectionrebateallotAdd v-show="viewState == 3" ref="divAdd" @doback="reset"/>
</div>
</template>
<script>
import req from '@/api/manufacturerrebates/collectionrebateallot'
import { fetchBySid } from '@/api/cheliang/dictcommons'
import collectionrebateallotSelectVehicle from './relation/collectionrebateallotSelectVehicle'
import collectionrebateallotAdd from './collectionrebateallotAdd'
export default {
name: 'collectionrebateallotByVehicleAdd',
components: {
collectionrebateallotSelectVehicle,
collectionrebateallotAdd
},
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
aggregate: '',
//
formobj: {
sid: '',
brandName: '',
brandSid: '',
number: '',
constPrice: '',
estimateRebate: '',
collectionMoney: '',
withholdingApply: '',
useOrgName: '',
useOrgSid: '',
createOrgName: '',
createOrgSid: '',
scmCollectionRebateDistributionVehs: []
},
rules: {},
submitdisabled: false
}
},
methods: {
init() {
fetchBySid(this.formobj.createOrgSid).then((res) => {
if (res.success) {
this.formobj.createOrgName = res.data.name
this.formobj.useOrgName = res.data.name
}
})
},
showEdit(row, createOrgSid) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
this.init()
})
this.formobj.createOrgSid = createOrgSid
this.formobj.useOrgSid = createOrgSid
req.fetchBySid(row.sid).then((resp) => {
if (resp.success) {
this.formobj = resp.data
}
})
this.viewTitle = '【编辑】回款返利'
},
handleSelect() {
this.viewState = 2
this.$refs['divSelect'].showData(this.formobj.scmCollectionRebateDistributionVehs, this.formobj.brandSid)
},
//
dataDelete(index) {
this.formobj.scmCollectionRebateDistributionVehs.splice(index, 1)
if (this.formobj.scmCollectionRebateDistributionVehs.length === 0) {
this.formobj.number = ''
this.formobj.constPrice = ''
} else {
this.formobj.number = this.formobj.scmCollectionRebateDistributionVehs.length
for (var i = 0; i < this.formobj.scmCollectionRebateDistributionVehs.length; i++) {
if (this.formobj.scmCollectionRebateDistributionVehs[i].costPrice !== '' && i === 0) {
this.formobj.constPrice = parseFloat(this.formobj.scmCollectionRebateDistributionVehs[i].costPrice)
} else {
this.formobj.constPrice = parseFloat(this.formobj.scmCollectionRebateDistributionVehs[i].costPrice) + parseFloat(this.formobj.constPrice)
}
}
}
},
// --
backData(value) {
this.viewState = 1
if (value.length > 0) {
value.forEach((e) => {
this.formobj.scmCollectionRebateDistributionVehs.push({
carModelName: e.vehicleAlias,
carModelSid: e.carModelSid,
vinNo: e.vinNo,
costPrice: e.guidedPrice,
priceDate: e.priceDate,
salesDate: e.salesDate,
distributionCollectionRebate: '',
mainSid: '',
sid: ''
})
})
this.formobj.number = value.length
for (var i = 0; i < this.formobj.scmCollectionRebateDistributionVehs.length; i++) {
if (this.formobj.scmCollectionRebateDistributionVehs[i].costPrice !== '' && i === 0) {
this.formobj.constPrice = parseFloat(this.formobj.scmCollectionRebateDistributionVehs[i].costPrice)
} else {
this.formobj.constPrice = parseFloat(this.formobj.scmCollectionRebateDistributionVehs[i].costPrice) + parseFloat(this.formobj.constPrice)
}
}
}
},
handleRebate() {
if (this.formobj.scmCollectionRebateDistributionVehs.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择需要返利分配的车辆' })
return
} else {
if (parseFloat(this.formobj.estimateRebate) - parseFloat(this.formobj.constPrice) < 0) {
this.$message({ showClose: true, type: 'error', message: '厂家结算价之和不应大于回款金额' })
return
}
this.viewState = 3
this.$refs['divAdd'].showEdit(this.formobj)
}
},
resetState() {
this.viewState = 1
},
reset() {
this.viewState = 1
this.handleReturn('true')
},
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
//
this.formobj = {
sid: '',
brandName: '',
brandSid: '',
number: '',
constPrice: '',
withholdingApply: '',
estimateRebate: '',
collectionMoney: '',
useOrgName: '',
useOrgSid: '',
createOrgName: '',
createOrgSid: '',
scmCollectionRebateDistributionVehs: []
}
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
.title {
padding: 7px;
}
</style>

184
anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/collectionrebateallotInfo.vue

@ -0,0 +1,184 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<div class="titwu"><span>回款返利分配</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="3" class="tleftb">
<span>回款金额</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.collectionMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span>预提返利</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.estimateRebate }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span>分摊参考比例</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.shareGinExaProportion }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3" class="tleftb">
<span>分摊比例</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.shareProportion }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span>分摊返利总额</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.shareRebateTotal }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span>本次返利余额</span>
</el-col>
<el-col :span="5">
<el-form-item>
<span>{{ formobj.thisRebateBalance }}</span>
</el-form-item>
</el-col>
</el-row>
<el-table :key="tableKey" :data="formobj.scmCollectionRebateDistributionVehs" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="车型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.carModelName }}</span>
</template>
</el-table-column>
<el-table-column label="车架号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span>
</template>
</el-table-column>
<el-table-column label="厂家结算价" align="center">
<template slot-scope="scope">
<span>{{ scope.row.costPrice }}</span>
</template>
</el-table-column>
<el-table-column label="入库日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.priceDate }}</span>
</template>
</el-table-column>
<el-table-column label="销售日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.salesDate }}</span>
</template>
</el-table-column>
<el-table-column label="回款返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.distributionCollectionRebate }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/manufacturerrebates/collectionrebateallot'
export default {
name: 'collectionrebateallotInfo',
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
aggregate: '',
//
formobj: {
sid: '',
brandName: '',
brandSid: '',
distributionState: '',
shareGinExaProportion: '',
shareProportion: '',
shareRebateTotal: '',
thisRebateBalance: '',
estimateRebate: '',
collectionMoney: '',
useOrgName: '',
useOrgSid: '',
createOrgName: '',
createOrgSid: '',
withholdingApply: '',
scmCollectionRebateDistributionVehs: []
},
rules: {},
submitdisabled: false
}
},
methods: {
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.fetchBySid(row.sid).then((res) => {
if (res.success) {
this.formobj = res.data
}
})
this.viewTitle = '回款返利分配详情'
},
// ===
handleReturn() {
//
this.formobj = {
sid: '',
brandName: '',
brandSid: '',
distributionState: '',
shareGinExaProportion: '',
shareProportion: '',
shareRebateTotal: '',
thisRebateBalance: '',
estimateRebate: '',
collectionMoney: '',
useOrgName: '',
useOrgSid: '',
createOrgName: '',
createOrgSid: '',
scmCollectionRebateDistributionVehs: []
}
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>

249
anrui-scm/anrui-scm-ui/src/views/manufacturerrebates/huikuanfenpei/relation/collectionrebateallotSelectVehicle.vue

@ -0,0 +1,249 @@
<template>
<div class="app-container">
<div>
<div class="tab-header webtop">
<div>车辆查询</div>
<div>
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="120px" class="tab-header">
<el-form-item label="品牌">
<el-select v-model="listQuery.params.brandSid" disabled class="addinputw" placeholder="请选择" filterable>
<el-option v-for="item in carbrand_list" :key="item.sid" :label="item.brandName" :value="item.sid"/>
</el-select>
</el-form-item>
<el-form-item label="车型">
<el-input v-model="listQuery.params.modelNameAndCode" clearable class="addinputw" placeholder=""/>
</el-form-item>
<el-form-item label="车架号">
<el-input v-model="listQuery.params.vinNo" clearable class="addinputw" placeholder=""/>
</el-form-item>
<el-form-item label="颜色">
<el-select v-model="listQuery.params.carColorKey" placeholder="请选择" clearable class="addinputw" filterable>
<el-option v-for="item in carColor_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<el-form-item label="存放地点">
<el-select v-model="listQuery.params.location" class="addinputw" clearable placeholder="请选择" filterable>
<el-option v-for="item in location_list" :key="item.sid" :label="item.warehouseName" :value="item.sid"/>
</el-select>
</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" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column width="50px" type="selection" align="center"/>
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="品牌" align="center">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="车型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleAlias }}</span>
</template>
</el-table-column>
<el-table-column label="车架号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span>
</template>
</el-table-column>
<el-table-column label="颜色" align="center">
<template slot-scope="scope">
<span>{{ scope.row.color }}</span>
</template>
</el-table-column>
<el-table-column label="存放地点" align="center">
<template slot-scope="scope">
<span>{{ scope.row.location }}</span>
</template>
</el-table-column>
<el-table-column label="厂家结算价" align="center">
<template slot-scope="scope">
<span>{{ scope.row.guidedPrice }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<div class="tit"/>
<!-- 翻页 -->
<Pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
</div>
</template>
<script>
import Pagination from '@/components/pagination'
import req from '@/api/manufacturerrebates/collectionrebateallot'
import { brandDown, fetchByUseOrgSid, getPathSidByUserSid, typeValues } from '@/api/cheliang/dictcommons.js'
export default {
name: 'xianchechaxun',
components: {
Pagination
},
data() {
return {
carbrand_list: [], //
carColor_list: [], //
location_list: [], //
isSearchShow: false,
searchxianshitit: '隐藏查询条件',
tableKey: 0,
sids: [],
list: [],
listLoading: false,
listQuery: {
current: 1,
size: 5,
params: {
brandSid: '',
modelNameAndCode: '',
vinNo: '',
carColorKey: '',
location: '',
userSid: '',
vinNoList: []
},
total: 0
}
}
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
init() {
typeValues({ type: 'bodyColor' }).then((resp) => {
if (resp.success) {
this.carColor_list = resp.data
}
})
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => {
if (res.success) {
brandDown({ useOrg: res.data }).then((resp) => {
if (resp.success) {
this.carbrand_list = resp.data
}
})
fetchByUseOrgSid({ sid: res.data }).then((respsone) => {
if (respsone.success) {
this.location_list = respsone.data
}
})
}
})
this.getList()
},
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
handleReturn() {
this.$emit('doback')
},
//
getList() {
this.listLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
req.pageList(this.listQuery).then((response) => {
this.listLoading = false
if (response.success) {
this.listQuery.total = response.data.total
this.list = response.data.records
}
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
//
handleReset() {
this.listQuery.current = 1
this.listQuery.size = 5
this.listQuery.total = 0
this.listQuery.params.modelNameAndCode = ''
this.listQuery.params.vinNo = ''
this.listQuery.params.carColorKey = ''
this.listQuery.params.location = ''
this.listQuery.params.userSid = ''
this.getList()
},
handleSelectionChange(row) {
this.sids = []
const aa = []
row.forEach((element) => {
aa.push({
vehicleAlias: element.vehicleAlias,
carModelSid: element.carModelSid,
vinNo: element.vinNo,
guidedPrice: element.guidedPrice,
priceDate: element.priceDate,
salesDate: element.salesDate
})
})
this.sids = aa
},
showData(value, carBrandSid) {
const aa = []
if (value.length > 0) {
for (var i = 0; i < value.length; i++) {
aa.push(value[i].vinNo)
}
this.listQuery.params.vinNoList = aa
} else {
this.listQuery.params.vinNoList = []
}
this.listQuery.current = 1
this.listQuery.total = 0
this.listQuery.size = 5
this.listQuery.params.brandSid = carBrandSid
this.init()
},
//
AddUpdateReturn() {
if (this.sids.length > 0) {
this.$emit('backData', this.sids)
} else {
this.$notify({
title: '提示',
message: '请选择至少一条车型记录!',
type: 'error',
duration: 2000
})
}
}
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save