
16 changed files with 1149 additions and 788 deletions
@ -0,0 +1,261 @@ |
|||
<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-input v-model="listQuery.params.createOrgName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="采购系统"> |
|||
<el-input v-model="listQuery.params.purchaseSystemName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="品牌"> |
|||
<el-input v-model="listQuery.params.brandName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="状态"> |
|||
<el-select v-model="listQuery.params.state" placeholder="请选择" clearable> |
|||
<el-option v-for="item in state_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="提交日期"> |
|||
<el-date-picker v-model="listQuery.params.subitDateStart" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker v-model="listQuery.params.subitDateEnd" 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="80" /> |
|||
<el-table-column fixed label="操作" align="center" width="180"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" :disabled="scope.row.state !== '审核中'" 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.state }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="createOrgName" label="分公司" align="center" min-width="150" /> |
|||
<el-table-column prop="purchaseSystemName" label="采购系统" align="center" width="140" /> |
|||
<el-table-column prop="brandName" label="品牌" align="center" width="120" /> |
|||
<el-table-column prop="subitDate" label="提交日期" align="center" width="120" /> |
|||
<el-table-column prop="shareGinExaProportion" label="分摊参考比例" align="center" width="150" /> |
|||
<el-table-column prop="shareProportion" label="分摊比例" align="center" width="120" /> |
|||
<el-table-column prop="shareRebateTotal" label="分摊返利总额" align="center" width="150" /> |
|||
<el-table-column prop="num" label="车辆台数" align="center" width="120" /> |
|||
</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> |
|||
<collectionrebateallotAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/> |
|||
<collectionrebateallotInfo v-show="viewState == 4" 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 { getOrgSidByPath } from '@/api/cheliang/dictcommons' |
|||
import collectionrebateallotAdd from './collectionrebateallotAdd' |
|||
import collectionrebateallotInfo from './collectionrebateallotInfo' |
|||
|
|||
export default { |
|||
name: 'HuiKuanShenHe', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar, |
|||
collectionrebateallotAdd, |
|||
collectionrebateallotInfo |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
btnList: [ |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
viewState: 1, |
|||
// 查询条件 ----------- |
|||
tableKey: 0, |
|||
list: [], |
|||
state_list: [ |
|||
{ |
|||
dictKey: '1', |
|||
dictValue: '审核中' |
|||
}, |
|||
{ |
|||
dictKey: '2', |
|||
dictValue: '已审核' |
|||
}, |
|||
{ |
|||
dictKey: '3', |
|||
dictValue: '已退回' |
|||
} |
|||
], |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
listQuery: { |
|||
params: { |
|||
createOrgName: '', |
|||
purchaseSystemName: '', |
|||
brandName: '', |
|||
createOrgSid: '', |
|||
subitDateStart: '', |
|||
subitDateEnd: '', |
|||
state: '', |
|||
isAuit: true, |
|||
orgPath: '', |
|||
userSid: '', |
|||
menuUrl: '' |
|||
}, |
|||
current: 1, |
|||
size: 5, |
|||
total: 0 |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
created() { |
|||
// 加载列表 |
|||
this.init() |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
methods: { |
|||
init() { |
|||
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => { |
|||
if (resp.success) { |
|||
this.listQuery.params.createOrgSid = resp.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 |
|||
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid') |
|||
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
|||
this.listQuery.params.menuUrl = this.$route.path |
|||
req.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 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
handleReset() { |
|||
this.listQuery = { |
|||
params: { |
|||
createOrgName: '', |
|||
purchaseSystemName: '', |
|||
brandName: '', |
|||
createOrgSid: '', |
|||
subitDateStart: '', |
|||
subitDateEnd: '', |
|||
state: '', |
|||
isAuit: true, |
|||
orgPath: '', |
|||
userSid: '', |
|||
menuUrl: '' |
|||
}, |
|||
current: 1, |
|||
size: 5, |
|||
total: 0 |
|||
} |
|||
this.init() |
|||
}, |
|||
toEdit(row) { |
|||
this.viewState = 3 |
|||
this.$refs['divAdd'].showEdit(row, this.listQuery.params.createOrgSid) |
|||
}, |
|||
toInfo(row) { |
|||
this.viewState = 4 |
|||
this.$refs['divInfo'].showInfo(row) |
|||
}, |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
/*表格列设置fixed后固定列出现下边框的设置*/ |
|||
/deep/ .el-table__fixed { |
|||
height: 100% !important; |
|||
} |
|||
/*表格列设置fixed后固定列出现下边框的设置*/ |
|||
/deep/ .el-table__fixed-right { |
|||
height: 100% !important; |
|||
} |
|||
</style> |
@ -0,0 +1,218 @@ |
|||
<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="handleConfirm()">确认</el-button> |
|||
<el-button type="danger" size="small" :disabled="submitdisabled" @click="handleBack()">退回</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="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #E0E3EB"> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">分公司</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createOrgName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">采购系统</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseSystemName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">品牌</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.brandName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">提交日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.subitDate }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">分摊参考比例</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.shareGinExaProportion }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">分摊比例</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.shareProportion }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">分摊返利总额</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.shareRebateTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">台数</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.number }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">附件</div> |
|||
<el-form-item><el-image class="addinputInfo" style="width: 150px;height: 150px" v-for="(item, index) in formobj.urls" :key="index" :src="item" :preview-src-list="formobj.urls" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">回款返利分摊车辆列表</div> |
|||
<el-table :key="tableKey" :data="formobj.scmCollectionRebateVehs" :index="index" border style="width: 100%"> |
|||
<el-table-column width="80" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="carModelName" label="车型" align="center" min-width="150" /> |
|||
<el-table-column prop="vinNo" label="车架号" align="center" width="120" /> |
|||
<el-table-column prop="costPrice" label="厂家结算价" align="center" width="130" /> |
|||
<el-table-column prop="priceDate" label="入库日期" align="center" width="120" /> |
|||
<el-table-column prop="salesDate" label="销售日期" align="center" width="120" /> |
|||
<el-table-column prop="solidDate" label="买断日期" align="center" width="120" /> |
|||
<el-table-column prop="distributionCollectionRebate" label="分摊金额" align="center" width="130" /> |
|||
</el-table> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/manufacturerrebates/collectionrebateallot' |
|||
|
|||
export default { |
|||
name: 'HuiKuanFanLiFenPeiAdd', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
index: 0, |
|||
tableKey: 0, |
|||
viewState: 1, |
|||
// 表单数据 |
|||
formobj: { |
|||
sid: '', |
|||
useOrgName: '', |
|||
useOrgSid: '', |
|||
createOrgName: '', |
|||
createOrgSid: '', |
|||
purchaseSystemSid: '', |
|||
purchaseSystemName: '', |
|||
brandName: '', |
|||
brandSid: '', |
|||
subitDate: '', |
|||
shareGinExaProportion: '', |
|||
shareProportion: '', |
|||
shareRebateTotal: '', |
|||
number: '', |
|||
remarks: '', |
|||
state: '', |
|||
urls: [], |
|||
scmCollectionRebateVehs: [] |
|||
}, |
|||
rules: {}, |
|||
submitdisabled: false |
|||
} |
|||
}, |
|||
methods: { |
|||
showEdit(val) { |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '回款返利分摊' |
|||
req.fetchBySid(val.sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.formobj.number = this.formobj.scmCollectionRebateVehs.length |
|||
if (this.formobj.urls.length > 0) { |
|||
const aa = [] |
|||
this.formobj.urls.forEach((e) => { |
|||
aa.push(e.url) |
|||
}) |
|||
this.formobj.urls = aa |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
handleConfirm() { |
|||
const tip = '请确认是否通过该申请?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.formobj.state = '2' |
|||
this.submitdisabled = true |
|||
req.save(this.formobj).then((resp) => { |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
|||
this.handleReturn('true') |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
}) |
|||
}, |
|||
handleBack() { |
|||
const tip = '请确认是否退回该申请?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.formobj.state = '3' |
|||
this.submitdisabled = true |
|||
req.save(this.formobj).then((resp) => { |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
|||
this.handleReturn('true') |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
}) |
|||
}, |
|||
// 返回(===既判断) |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
// 表单数据 |
|||
this.formobj = { |
|||
sid: '', |
|||
useOrgName: '', |
|||
useOrgSid: '', |
|||
createOrgName: '', |
|||
createOrgSid: '', |
|||
purchaseSystemSid: '', |
|||
purchaseSystemName: '', |
|||
brandName: '', |
|||
brandSid: '', |
|||
subitDate: '', |
|||
shareGinExaProportion: '', |
|||
shareProportion: '', |
|||
shareRebateTotal: '', |
|||
number: '', |
|||
remarks: '', |
|||
state: '', |
|||
urls: [], |
|||
scmCollectionRebateVehs: [] |
|||
} |
|||
this.submitdisabled = false |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
.span-sty { |
|||
width: 140px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 130px !important; |
|||
} |
|||
</style> |
|||
|
@ -0,0 +1,176 @@ |
|||
<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"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #E0E3EB"> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">分公司</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createOrgName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">采购系统</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseSystemName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">品牌</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.brandName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">提交日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.subitDate }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">分摊参考比例</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.shareGinExaProportion }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">分摊比例</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.shareProportion }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">分摊返利总额</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.shareRebateTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">台数</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.number }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">附件</div> |
|||
<el-form-item><el-image class="addinputInfo" style="width: 150px;height: 150px" v-for="(item, index) in formobj.urls" :key="index" :src="item" :preview-src-list="formobj.urls" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">回款返利分摊车辆列表</div> |
|||
<el-table :key="tableKey" :data="formobj.scmCollectionRebateVehs" :index="index" border style="width: 100%"> |
|||
<el-table-column width="80" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="carModelName" label="车型" align="center" min-width="150" /> |
|||
<el-table-column prop="vinNo" label="车架号" align="center" width="120" /> |
|||
<el-table-column prop="costPrice" label="厂家结算价" align="center" width="130" /> |
|||
<el-table-column prop="priceDate" label="入库日期" align="center" width="120" /> |
|||
<el-table-column prop="salesDate" label="销售日期" align="center" width="120" /> |
|||
<el-table-column prop="solidDate" label="买断日期" align="center" width="120" /> |
|||
<el-table-column prop="distributionCollectionRebate" label="分摊金额" align="center" width="130" /> |
|||
</el-table> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/manufacturerrebates/collectionrebateallot' |
|||
|
|||
export default { |
|||
name: 'HuiKuanFanLiFenPeiInfo', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
index: 0, |
|||
tableKey: 0, |
|||
viewState: 1, |
|||
// 表单数据 |
|||
formobj: { |
|||
sid: '', |
|||
useOrgName: '', |
|||
useOrgSid: '', |
|||
createOrgName: '', |
|||
createOrgSid: '', |
|||
purchaseSystemSid: '', |
|||
purchaseSystemName: '', |
|||
brandName: '', |
|||
brandSid: '', |
|||
subitDate: '', |
|||
shareGinExaProportion: '', |
|||
shareProportion: '', |
|||
shareRebateTotal: '', |
|||
number: '', |
|||
remarks: '', |
|||
state: '', |
|||
urls: [], |
|||
scmCollectionRebateVehs: [] |
|||
}, |
|||
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.formobj.number = this.formobj.scmCollectionRebateVehs.length |
|||
if (this.formobj.urls.length > 0) { |
|||
const aa = [] |
|||
this.formobj.urls.forEach((e) => { |
|||
aa.push(e.url) |
|||
}) |
|||
this.formobj.urls = aa |
|||
} |
|||
} |
|||
}) |
|||
this.viewTitle = '回款返利分摊详情' |
|||
}, |
|||
// 返回(===既判断) |
|||
handleReturn() { |
|||
// 表单数据 |
|||
this.formobj = { |
|||
sid: '', |
|||
useOrgName: '', |
|||
useOrgSid: '', |
|||
createOrgName: '', |
|||
createOrgSid: '', |
|||
purchaseSystemSid: '', |
|||
purchaseSystemName: '', |
|||
brandName: '', |
|||
brandSid: '', |
|||
subitDate: '', |
|||
shareGinExaProportion: '', |
|||
shareProportion: '', |
|||
shareRebateTotal: '', |
|||
number: '', |
|||
remarks: '', |
|||
state: '', |
|||
urls: [], |
|||
scmCollectionRebateVehs: [] |
|||
} |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 140px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 130px !important; |
|||
} |
|||
</style> |
|||
|
@ -1,260 +0,0 @@ |
|||
<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" @input="shareProportionInput" @keyup.native="formobj.shareProportion = getNumber(formobj.shareProportion, 2)" clearable 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>{{ 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> |
|||
<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: 'HuiKuanFanLiFenPeiAdd', |
|||
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: '', |
|||
orgPath: '', |
|||
scmCollectionRebateDistributionVehs: [] |
|||
}, |
|||
rules: {}, |
|||
submitdisabled: false |
|||
} |
|||
}, |
|||
methods: { |
|||
getNumber(val, limit) { |
|||
val = val.replace(/[^0-9.]/g, '') // 保留数字 |
|||
val = val.replace(/^00/, '0.') // 开头不能有两个0 |
|||
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. |
|||
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 |
|||
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点 |
|||
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 |
|||
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' |
|||
const reg = new RegExp(str) |
|||
if (limit === 0) { |
|||
// 不需要小数点 |
|||
val = val.replace(reg, '$1') |
|||
} else { |
|||
// 通过正则保留小数点后指定的位数 |
|||
val = val.replace(reg, '$1.$2') |
|||
} |
|||
return val |
|||
}, |
|||
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 = Math.round((parseFloat(this.formobj.estimateRebate !== '' ? this.formobj.estimateRebate : 0) / parseFloat(this.formobj.collectionMoney !== '' ? this.formobj.collectionMoney : 0)) * 100) / 100 |
|||
this.viewTitle = '回款返利分配' |
|||
}, |
|||
shareProportionInput() { |
|||
// 计算分摊返利总额 = 回款金额 * 分摊比例 |
|||
this.formobj.shareRebateTotal = Math.round((parseFloat(this.formobj.collectionMoney !== '' ? this.formobj.collectionMoney : 0) * parseFloat(this.formobj.shareProportion !== '' ? this.formobj.shareProportion : 0)) * 100) / 100 |
|||
// 计算本次返利金额 = 预提返利 - 分摊返利总额 |
|||
this.formobj.thisRebateBalance = parseFloat(this.formobj.estimateRebate !== '' ? this.formobj.estimateRebate : 0) - parseFloat(this.formobj.shareRebateTotal !== '' ? this.formobj.shareRebateTotal : 0) |
|||
}, |
|||
handleAllocation() { |
|||
for (var i = 0; i < this.formobj.scmCollectionRebateDistributionVehs.length; i++) { |
|||
// 计算每台车的回款返利 = 厂家结算价 * 分摊比例 |
|||
this.formobj.scmCollectionRebateDistributionVehs[i].distributionCollectionRebate = Math.round((parseFloat(this.formobj.scmCollectionRebateDistributionVehs[i].costPrice !== '' ? this.formobj.scmCollectionRebateDistributionVehs[i].costPrice : 0) * (parseFloat(this.formobj.shareProportion !== '' ? this.formobj.shareProportion : 0) / 100)) * 100) / 100 |
|||
} |
|||
}, |
|||
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: '', |
|||
orgPath: '', |
|||
scmCollectionRebateDistributionVehs: [] |
|||
} |
|||
this.submitdisabled = false |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
.title { |
|||
padding: 7px; |
|||
} |
|||
</style> |
|||
|
@ -1,184 +0,0 @@ |
|||
<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: 'HuiKuanFanLiFenPeiInfo', |
|||
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> |
|||
|
Loading…
Reference in new issue