|
|
@ -20,64 +20,30 @@ |
|
|
|
<div class="titwu"><span>{{ formobj.title }}专项返利分配申请</span></div> |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|
|
|
<el-row class="rowStyle"> |
|
|
|
<el-col :span="2" class="tleftb colOneStyle"> |
|
|
|
<span>品牌:</span> |
|
|
|
<el-col :span="6" class="colOneStyle"> |
|
|
|
<div class="span-sty" style="border-right: 0px !important;">分公司:</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createOrgName }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="colOneStyle"> |
|
|
|
<el-form-item> |
|
|
|
<el-select :disabled="dialogStatus === 'edit'" v-model="formobj.brandName" placeholder="请选择" filterable clearable @change="changeBrand"> |
|
|
|
<el-option v-for="item in brand_list" :key="item.sid" :label="item.brandName" :value="item.brandName"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="18" class="tleftb colOneStyle"> |
|
|
|
<el-button size="small" type="primary" @click="handleAdd()">添加</el-button> |
|
|
|
<el-button size="small" type="danger" @click="handleDelete()">删除</el-button> |
|
|
|
<el-col :span="18" class="colOneStyle"> |
|
|
|
<div style="text-align: right"> |
|
|
|
<el-button size="small" type="primary" @click="handleAdd()">添加</el-button> |
|
|
|
<el-button size="small" type="danger" @click="handleDelete()">删除</el-button> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-table :key="tableKey" :data="formobj.scmSpecialrebatedistributedetails" :index="index" border style="width: 100%" @selection-change="handleSelectionChange" show-summary :summary-method="getSummaries"> |
|
|
|
<el-table-column fixed type="selection" align="center" width="60px"/> |
|
|
|
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" 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.createTime }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="返利名称" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.rebateName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="返利类型" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.rebateTypeValue }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="estimateRebate" label="预提返利" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.estimateRebate }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="uploadMoney" label="上传总金额" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.uploadMoney }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="分配数量" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.disNum }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="单车分配金额" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.unitSetAllocationMoney }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="purchaseSystemName" label="采购系统" align="center" width="120" /> |
|
|
|
<el-table-column prop="brandName" label="品牌" align="center" width="120" /> |
|
|
|
<el-table-column prop="rebateName" label="返利名称" align="center" min-width="150" /> |
|
|
|
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" width="140" /> |
|
|
|
<el-table-column prop="palceGenDate" label="所属年月" align="center" width="140" /> |
|
|
|
<el-table-column prop="withholdingDate" label="预提日期" align="center" width="140" /> |
|
|
|
<el-table-column prop="estimateRebate" label="预提返利" align="center" width="140" /> |
|
|
|
<el-table-column prop="uploadMoney" label="上传返利总金额" align="center" width="160" /> |
|
|
|
<el-table-column prop="disNum" label="分配车辆" align="center" width="120" /> |
|
|
|
<el-table-column prop="unitSetAllocationMoney" label="单车分配金额" align="center" width="150" /> |
|
|
|
</el-table> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
@ -90,7 +56,7 @@ |
|
|
|
<script> |
|
|
|
import req from '@/api/specialrebate/specialrebatedistribution' |
|
|
|
import daifeipeizhuanxiang from './relation/daifeipeizhuanxiang' |
|
|
|
import { fetchBySid, brandDown } from '@/api/cheliang/dictcommons' |
|
|
|
import { fetchBySid } from '@/api/cheliang/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'SpecialRebateDistributionAdd', |
|
|
@ -103,14 +69,12 @@ export default { |
|
|
|
viewState: 1, |
|
|
|
index: 0, |
|
|
|
tableKey: 0, |
|
|
|
brand_list: [], |
|
|
|
sids: [], |
|
|
|
// 表单数据 |
|
|
|
formobj: { |
|
|
|
sid: '', // 一条数据的sid |
|
|
|
approvalCompleteDate: '', |
|
|
|
brandName: '', |
|
|
|
brandSid: '', |
|
|
|
deptName: '', |
|
|
|
deptSid: '', |
|
|
|
createOrgName: '', |
|
|
|
createOrgSid: '', |
|
|
|
distributionMoneyTotal: '', |
|
|
@ -126,7 +90,6 @@ export default { |
|
|
|
scmSpecialrebatedistributedetails: [] |
|
|
|
}, |
|
|
|
rules: {}, |
|
|
|
dialogStatus: '', |
|
|
|
submitdisabled: false |
|
|
|
} |
|
|
|
}, |
|
|
@ -138,17 +101,12 @@ export default { |
|
|
|
this.formobj.useOrgName = res.data.name |
|
|
|
} |
|
|
|
}) |
|
|
|
brandDown({ useOrg: this.formobj.createOrgSid }).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.brand_list = resp.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取制单日期 |
|
|
|
newDate() { |
|
|
|
let date = new Date() |
|
|
|
let year = date.getFullYear() // 年 |
|
|
|
let month = date.getMonth() + 1 // 月 |
|
|
|
let month = date.getMonth() // 月 |
|
|
|
this.formobj.title = year + '年' + month + '月' |
|
|
|
}, |
|
|
|
showAdd(createOrgSid) { |
|
|
@ -157,19 +115,19 @@ export default { |
|
|
|
this.init() |
|
|
|
this.newDate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.formobj.createOrgSid = createOrgSid |
|
|
|
this.formobj.useOrgSid = createOrgSid |
|
|
|
this.formobj.createByName = window.sessionStorage.getItem('name') |
|
|
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|
|
|
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
|
|
|
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1) |
|
|
|
this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) |
|
|
|
this.viewTitle = '【新增】专项返利分配申请' |
|
|
|
}, |
|
|
|
showEdit(row) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'edit' |
|
|
|
this.viewTitle = '【编辑】专项返利分配申请' |
|
|
|
console.log('编辑回显', row.sid) |
|
|
|
req.fetchDetailsBySid(row.sid).then((resp) => { |
|
|
@ -183,12 +141,8 @@ export default { |
|
|
|
}, |
|
|
|
// 明细表添加一行数据 |
|
|
|
handleAdd() { |
|
|
|
if (this.formobj.brandName === '' || this.formobj.brandName === null || this.formobj.brandName === undefined) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请先选择品牌' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divSelect'].showData(this.formobj.scmSpecialrebatedistributedetails, this.formobj.createOrgSid, this.formobj.brandSid) |
|
|
|
this.$refs['divSelect'].showData(this.formobj.scmSpecialrebatedistributedetails, this.formobj.createOrgSid) |
|
|
|
}, |
|
|
|
handleSelectionChange(row) { |
|
|
|
const aa = [] |
|
|
@ -227,11 +181,14 @@ export default { |
|
|
|
mainSid: '', |
|
|
|
sid: '', |
|
|
|
specialRebateSid: e.specialRebateSid, |
|
|
|
purchaseSystemName: e.purchaseSystemName, |
|
|
|
purchaseSystemSid: e.purchaseSystemSid, |
|
|
|
brandName: e.brandName, |
|
|
|
brandSid: e.brandSid, |
|
|
|
createTime: e.createTime, |
|
|
|
rebateName: e.rebateName, |
|
|
|
rebateTypeValue: e.rebateTypeValue, |
|
|
|
palceGenDate: e.palceGenDate, |
|
|
|
withholdingDate: e.withholdingDate, |
|
|
|
estimateRebate: e.estimateRebate, |
|
|
|
uploadMoney: e.uploadMoney, |
|
|
|
disNum: e.disNum, |
|
|
@ -240,14 +197,6 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
changeBrand(value) { |
|
|
|
const choose = this.brand_list.filter((item) => item.brandName === value) |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
|
this.formobj.brandSid = choose[0].sid |
|
|
|
} else { |
|
|
|
this.formobj.brandSid = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
@ -324,21 +273,6 @@ export default { |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
this.formobj.distributionMoneyTotal = sums[index] += '' |
|
|
|
} else { |
|
|
|
if (!values.every(value => isNaN(value))) { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr) |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr |
|
|
|
} else { |
|
|
|
return prev |
|
|
|
} |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
this.amount = sums[index] += '' |
|
|
|
} else { |
|
|
|
sums[index] = '' |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
return sums |
|
|
@ -348,9 +282,8 @@ export default { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj = { |
|
|
|
sid: '', // 一条数据的sid |
|
|
|
approvalCompleteDate: '', |
|
|
|
brandName: '', |
|
|
|
brandSid: '', |
|
|
|
deptName: '', |
|
|
|
deptSid: '', |
|
|
|
createOrgName: '', |
|
|
|
createOrgSid: '', |
|
|
|
distributionMoneyTotal: '', |
|
|
@ -383,5 +316,11 @@ export default { |
|
|
|
border-right: 0px !important; |
|
|
|
border-bottom: 0px !important; |
|
|
|
} |
|
|
|
.span-sty { |
|
|
|
width: 130px !important; |
|
|
|
} |
|
|
|
.addinputInfo { |
|
|
|
margin-left: 120px !important; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|