|
|
@ -7,10 +7,8 @@ |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<!--start 添加修改按钮--> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="save()">保存 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="save()">保存</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -18,63 +16,40 @@ |
|
|
|
<!--Start 新增修改部分--> |
|
|
|
<div class="listconadd"> |
|
|
|
<div class="titwu"><span>{{ formobj.withApply }}专项返利预提申请</span></div> |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|
|
|
<el-row class="rowStyle"> |
|
|
|
<el-col :span="24" class="tleftb colOneStyle"> |
|
|
|
<div><span style="font-size: 16px">金额单位:元</span></div> |
|
|
|
<el-col :span="24" class="colOneStyle"> |
|
|
|
<div style="text-align: right;font-weight: bold">金额单位:元</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<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="handleSelect()">选择</el-button> |
|
|
|
<el-col :span="18" class="colOneStyle"> |
|
|
|
<div style="text-align: right"><el-button size="small" type="primary" class="btntopblueline" @click="handleSelect()">选择</el-button></div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-table :key="tableKey" :data="formobj.scmSpecialRebateWiths" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries"> |
|
|
|
<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.rebateTypeValue }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="台数" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.num }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="withRebate" label="预提返利" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.withRebate }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="明细" align="center"> |
|
|
|
<el-table-column prop="purchaseSystemName" label="采购系统" align="center" min-width="120" /> |
|
|
|
<el-table-column prop="brandName" label="品牌" align="center" min-width="100" /> |
|
|
|
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" min-width="120" /> |
|
|
|
<el-table-column prop="withRebate" label="预提返利" align="center" min-width="120" /> |
|
|
|
<el-table-column prop="expectItureCost" label="其中支出费用" align="center" min-width="130" /> |
|
|
|
<el-table-column prop="expectTreatCost" label="其中待支付费用" align="center" min-width="150" /> |
|
|
|
<el-table-column prop="expectSuppCost" label="其中抵顶费用" align="center" min-width="130" /> |
|
|
|
<el-table-column label="明细" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column label="备注" align="center">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-input v-model="scope.row.remarks" clearable placeholder="" class="addinputw"></el-input>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
</el-table> |
|
|
|
<el-row> |
|
|
|
<el-col :span="2" class="tleftb"> |
|
|
|
<span>备注</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="22"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="formobj.remarks" clearable placeholder="" class="addinputw"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-col :span="24"> |
|
|
|
<div class="span-sty">备注</div> |
|
|
|
<el-form-item><el-input v-model="formobj.remarks" clearable placeholder="" class="addinputInfo addinputw"></el-input></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
@ -88,7 +63,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import req from '@/api/specialrebate/specialrebatewithholding' |
|
|
|
import { brandDown, fetchBySid } from '@/api/cheliang/dictcommons' |
|
|
|
import { fetchBySid } from '@/api/cheliang/dictcommons' |
|
|
|
import zhuanxiangfanliselect from './relation/zhuanxiangfanliselect' |
|
|
|
import zhuanxiangfanliAdd from './relation/zhuanxiangfanliAdd' |
|
|
|
|
|
|
@ -105,13 +80,12 @@ export default { |
|
|
|
tableKey: 0, |
|
|
|
viewState: 1, |
|
|
|
dialogStatus: '', |
|
|
|
brand_list: [], |
|
|
|
// 表单数据 |
|
|
|
formobj: { |
|
|
|
brandName: '', |
|
|
|
brandSid: '', |
|
|
|
sid: '', |
|
|
|
withApply: '', |
|
|
|
deptName: '', |
|
|
|
deptSid: '', |
|
|
|
createOrgName: '', |
|
|
|
createOrgSid: '', |
|
|
|
useOrgName: '', |
|
|
@ -137,17 +111,12 @@ export default { |
|
|
|
this.formobj.useOrgName = res.data.name |
|
|
|
} |
|
|
|
}) |
|
|
|
brandDown({ useOrg: this.formobj.createOrgSid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.brand_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取日期 |
|
|
|
newDate() { |
|
|
|
let date = new Date() |
|
|
|
let year = date.getFullYear() // 年 |
|
|
|
let month = date.getMonth() + 1 // 月 |
|
|
|
let month = date.getMonth() // 月 |
|
|
|
this.formobj.withApply = year + '年' + month + '月' |
|
|
|
}, |
|
|
|
showAdd(createOrgSid) { |
|
|
@ -158,10 +127,12 @@ export default { |
|
|
|
}) |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|
|
|
this.formobj.createByName = window.sessionStorage.getItem('name') |
|
|
|
this.formobj.createOrgSid = createOrgSid |
|
|
|
this.formobj.useOrgSid = createOrgSid |
|
|
|
this.formobj.createByName = window.sessionStorage.getItem('name') |
|
|
|
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) { |
|
|
@ -180,26 +151,15 @@ export default { |
|
|
|
this.formobj = row |
|
|
|
}) |
|
|
|
}, |
|
|
|
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 = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
// 列表--选择 |
|
|
|
handleSelect() { |
|
|
|
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.scmSpecialRebateWiths, this.formobj.createOrgSid, this.formobj.brandSid) |
|
|
|
this.$refs['divSelect'].showData(this.formobj.scmSpecialRebateWiths, this.formobj.createOrgSid) |
|
|
|
}, |
|
|
|
// 列表--选择返回数据 |
|
|
|
backData(value) { |
|
|
|
this.viewState = 1 |
|
|
|
value = JSON.parse(JSON.stringify(value)) |
|
|
|
for (var i in value) { |
|
|
|
let cval = value[i] |
|
|
|
if (!this.formobj.scmSpecialRebateWiths || this.formobj.scmSpecialRebateWiths.length === 0) { |
|
|
@ -207,9 +167,11 @@ export default { |
|
|
|
} |
|
|
|
let v = 0 |
|
|
|
for (var j in this.formobj.scmSpecialRebateWiths) { |
|
|
|
if (this.formobj.scmSpecialRebateWiths[j].rebateTypeValue === cval.rebateTypeValue) { |
|
|
|
this.formobj.scmSpecialRebateWiths[j].num = parseInt(this.formobj.scmSpecialRebateWiths[j].num) + parseInt(1) |
|
|
|
this.formobj.scmSpecialRebateWiths[j].withRebate = parseFloat(this.formobj.scmSpecialRebateWiths[j].withRebate !== '' ? this.formobj.scmSpecialRebateWiths[j].withRebate : 0) + parseFloat(cval.withRebate !== '' ? cval.withRebate : 0) |
|
|
|
if (this.formobj.scmSpecialRebateWiths[j].rebateTypeValue === cval.rebateTypeValue && this.formobj.scmSpecialRebateWiths[j].purchaseSystemName === cval.purchaseSystemName && this.formobj.scmSpecialRebateWiths[j].brandName === cval.brandName) { |
|
|
|
this.formobj.scmSpecialRebateWiths[j].withRebate = Math.round((parseFloat(this.formobj.scmSpecialRebateWiths[j].withRebate !== '' ? this.formobj.scmSpecialRebateWiths[j].withRebate : 0) + parseFloat(cval.withRebate !== '' ? cval.withRebate : 0)) * 100) / 100 |
|
|
|
this.formobj.scmSpecialRebateWiths[j].expectItureCost = Math.round((parseFloat(this.formobj.scmSpecialRebateWiths[j].expectItureCost !== '' ? this.formobj.scmSpecialRebateWiths[j].expectItureCost : 0) + parseFloat(cval.expectItureCost !== '' ? cval.expectItureCost : 0)) * 100) / 100 |
|
|
|
this.formobj.scmSpecialRebateWiths[j].expectTreatCost = Math.round((parseFloat(this.formobj.scmSpecialRebateWiths[j].expectTreatCost !== '' ? this.formobj.scmSpecialRebateWiths[j].expectTreatCost : 0) + parseFloat(cval.expectTreatCost !== '' ? cval.expectTreatCost : 0)) * 100) / 100 |
|
|
|
this.formobj.scmSpecialRebateWiths[j].expectSuppCost = Math.round((parseFloat(this.formobj.scmSpecialRebateWiths[j].expectSuppCost !== '' ? this.formobj.scmSpecialRebateWiths[j].expectSuppCost : 0) + parseFloat(cval.expectSuppCost !== '' ? cval.expectSuppCost : 0)) * 100) / 100 |
|
|
|
this.formobj.scmSpecialRebateWiths[j].specialRebateSids.push(cval.sid) |
|
|
|
v = 1 |
|
|
|
break |
|
|
@ -217,14 +179,17 @@ export default { |
|
|
|
} |
|
|
|
if (v === 0) { |
|
|
|
this.formobj.scmSpecialRebateWiths.push({ |
|
|
|
purchaseSystemName: cval.purchaseSystemName, |
|
|
|
purchaseSystemSid: cval.purchaseSystemSid, |
|
|
|
brandName: cval.brandName, |
|
|
|
brandSid: cval.brandSid, |
|
|
|
rebateTypeKey: cval.rebateTypeKey, |
|
|
|
rebateTypeValue: cval.rebateTypeValue, |
|
|
|
num: 1, |
|
|
|
withRebate: cval.withRebate, |
|
|
|
brandName: cval.brandName, |
|
|
|
brandSid: cval.brandSid, |
|
|
|
expectItureCost: cval.expectItureCost, |
|
|
|
expectTreatCost: cval.expectTreatCost, |
|
|
|
expectSuppCost: cval.expectSuppCost, |
|
|
|
specialRebateSids: [cval.sid], |
|
|
|
// remarks: '', |
|
|
|
sid: '', |
|
|
|
mainSid: '' |
|
|
|
}) |
|
|
@ -237,7 +202,7 @@ export default { |
|
|
|
this.$refs['divAdd'].showInfo(row) |
|
|
|
}, |
|
|
|
// 明细--查看返回数据 |
|
|
|
backAdd(value, rebateType) { |
|
|
|
backAdd(value, rebateType, purchaseSystemName, brandName) { |
|
|
|
this.viewState = 1 |
|
|
|
const aa = [] |
|
|
|
if (value.length > 0) { |
|
|
@ -245,9 +210,11 @@ export default { |
|
|
|
let cval = value[i] |
|
|
|
let v = 0 |
|
|
|
for (var j in aa) { |
|
|
|
if (aa[j].rebateTypeValue === cval.rebateTypeValue) { |
|
|
|
aa[j].num = parseInt(aa[j].num) + parseInt(1) |
|
|
|
aa[j].withRebate = parseFloat(aa[j].withRebate !== '' ? aa[j].withRebate : 0) + parseFloat(cval.withRebate !== '' ? cval.withRebate : 0) |
|
|
|
if (aa[j].rebateTypeValue === cval.rebateTypeValue && aa[j].purchaseSystemName === cval.purchaseSystemName && aa[j].brandName === cval.brandName) { |
|
|
|
aa[j].withRebate = Math.round((parseFloat(aa[j].withRebate !== '' ? aa[j].withRebate : 0) + parseFloat(cval.withRebate !== '' ? cval.withRebate : 0)) * 100) / 100 |
|
|
|
aa[j].expectItureCost = Math.round((parseFloat(aa[j].expectItureCost !== '' ? aa[j].expectItureCost : 0) + parseFloat(cval.expectItureCost !== '' ? cval.expectItureCost : 0)) * 100) / 100 |
|
|
|
aa[j].expectTreatCost = Math.round((parseFloat(aa[j].expectTreatCost !== '' ? aa[j].expectTreatCost : 0) + parseFloat(cval.expectTreatCost !== '' ? cval.expectTreatCost : 0)) * 100) / 100 |
|
|
|
aa[j].expectSuppCost = Math.round((parseFloat(aa[j].expectSuppCost !== '' ? aa[j].expectSuppCost : 0) + parseFloat(cval.expectSuppCost !== '' ? cval.expectSuppCost : 0)) * 100) / 100 |
|
|
|
aa[j].specialRebateSids.push(cval.sid) |
|
|
|
v = 1 |
|
|
|
break |
|
|
@ -255,34 +222,41 @@ export default { |
|
|
|
} |
|
|
|
if (v === 0) { |
|
|
|
aa.push({ |
|
|
|
purchaseSystemName: cval.purchaseSystemName, |
|
|
|
purchaseSystemSid: cval.purchaseSystemSid, |
|
|
|
brandName: cval.brandName, |
|
|
|
brandSid: cval.brandSid, |
|
|
|
rebateTypeKey: cval.rebateTypeKey, |
|
|
|
rebateTypeValue: cval.rebateTypeValue, |
|
|
|
num: 1, |
|
|
|
withRebate: cval.withRebate, |
|
|
|
brandName: cval.brandName, |
|
|
|
brandSid: cval.brandSid, |
|
|
|
expectItureCost: cval.expectItureCost, |
|
|
|
expectTreatCost: cval.expectTreatCost, |
|
|
|
expectSuppCost: cval.expectSuppCost, |
|
|
|
specialRebateSids: [cval.sid], |
|
|
|
// remarks: '', |
|
|
|
sid: '', |
|
|
|
mainSid: '' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
for (var k = 0; k < this.formobj.scmSpecialRebateWiths.length; k++) { |
|
|
|
if (this.formobj.scmSpecialRebateWiths[k].rebateTypeValue === rebateType) { |
|
|
|
if (this.formobj.scmSpecialRebateWiths[k].rebateTypeValue === rebateType && this.formobj.scmSpecialRebateWiths[k].purchaseSystemName === purchaseSystemName && this.formobj.scmSpecialRebateWiths[k].brandName === brandName) { |
|
|
|
this.formobj.scmSpecialRebateWiths[k].purchaseSystemName = aa[0].purchaseSystemName |
|
|
|
this.formobj.scmSpecialRebateWiths[k].purchaseSystemSid = aa[0].purchaseSystemSid |
|
|
|
this.formobj.scmSpecialRebateWiths[k].brandName = aa[0].brandName |
|
|
|
this.formobj.scmSpecialRebateWiths[k].brandSid = aa[0].brandSid |
|
|
|
this.formobj.scmSpecialRebateWiths[k].rebateTypeKey = aa[0].rebateTypeKey |
|
|
|
this.formobj.scmSpecialRebateWiths[k].rebateTypeValue = aa[0].rebateTypeValue |
|
|
|
this.formobj.scmSpecialRebateWiths[k].num = aa[0].num |
|
|
|
this.formobj.scmSpecialRebateWiths[k].withRebate = aa[0].withRebate |
|
|
|
this.formobj.scmSpecialRebateWiths[k].brandName = aa[0].brandName |
|
|
|
this.formobj.scmSpecialRebateWiths[k].brandSid = aa[0].brandSid |
|
|
|
this.formobj.scmSpecialRebateWiths[k].expectItureCost = aa[0].expectItureCost |
|
|
|
this.formobj.scmSpecialRebateWiths[k].expectTreatCost = aa[0].expectTreatCost |
|
|
|
this.formobj.scmSpecialRebateWiths[k].expectSuppCost = aa[0].expectSuppCost |
|
|
|
this.formobj.scmSpecialRebateWiths[k].specialRebateSids = aa[0].specialRebateSids |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (value.length === 0) { |
|
|
|
for (var l = 0; l < this.formobj.scmSpecialRebateWiths.length; l++) { |
|
|
|
if (this.formobj.scmSpecialRebateWiths[l].rebateTypeValue === rebateType) { |
|
|
|
if (this.formobj.scmSpecialRebateWiths[l].rebateTypeValue === rebateType && this.formobj.scmSpecialRebateWiths[l].purchaseSystemName === purchaseSystemName) { |
|
|
|
this.formobj.scmSpecialRebateWiths.splice(l, 1) |
|
|
|
break |
|
|
|
} |
|
|
@ -349,21 +323,6 @@ export default { |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
this.formobj.withRebateTotal = 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 |
|
|
@ -373,10 +332,10 @@ export default { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
// 表单数据 |
|
|
|
this.formobj = { |
|
|
|
brandName: '', |
|
|
|
brandSid: '', |
|
|
|
sid: '', |
|
|
|
withApply: '', |
|
|
|
deptName: '', |
|
|
|
deptSid: '', |
|
|
|
createOrgName: '', |
|
|
|
createOrgSid: '', |
|
|
|
useOrgName: '', |
|
|
@ -404,4 +363,10 @@ export default { |
|
|
|
border-right: 0px !important; |
|
|
|
border-bottom: 0px !important; |
|
|
|
} |
|
|
|
.span-sty { |
|
|
|
width: 130px !important; |
|
|
|
} |
|
|
|
.addinputInfo { |
|
|
|
margin-left: 120px !important; |
|
|
|
} |
|
|
|
</style> |
|
|
|