|
|
@ -22,21 +22,37 @@ |
|
|
|
<div style="text-align: right;font-weight: bold">金额单位:元</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row class="rowStyle"> |
|
|
|
<el-col :span="6" class="colOneStyle"> |
|
|
|
<div class="span-sty" style="border-right: 0px !important;">品牌:</div> |
|
|
|
<el-form-item> |
|
|
|
<el-select class="addinputInfo" :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-row> |
|
|
|
<el-col :span="16"> |
|
|
|
<div class="span-sty">申请编号</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.billNo }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<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 :span="8"> |
|
|
|
<div class="span-sty">申请日期</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">分公司</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createOrgName }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">申请部门</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">申请人</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title titleOne"> |
|
|
|
<el-button size="mini" type="primary" class="btntopblueline" @click="handleSelect()">选择</el-button> |
|
|
|
</div> |
|
|
|
<el-table :key="tableKey" :data="formobj.scmVehRebateWiths" :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 prop="purchaseSystemName" label="采购系统" align="center" width="140" /> |
|
|
|
<el-table-column prop="brandName" label="品牌" align="center" width="120" /> |
|
|
|
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" min-width="120" /> |
|
|
|
<el-table-column prop="num" label="台数" align="center" min-width="80" /> |
|
|
|
<el-table-column prop="withRebate" label="预提返利" align="center" min-width="120" /> |
|
|
@ -65,7 +81,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import req from '@/api/bikerebate/bicyclerebatewithholding' |
|
|
|
import { brandDown, fetchBySid } from '@/api/cheliang/dictcommons' |
|
|
|
import { fetchBySid } from '@/api/cheliang/dictcommons' |
|
|
|
import danchefanliselect from './relation/danchefanliselect' |
|
|
|
import danchefanliAdd from './relation/danchefanliAdd' |
|
|
|
|
|
|
@ -81,14 +97,16 @@ export default { |
|
|
|
index: 0, |
|
|
|
tableKey: 0, |
|
|
|
viewState: 1, |
|
|
|
dialogStatus: '', |
|
|
|
brand_list: [], |
|
|
|
// 表单数据 |
|
|
|
formobj: { |
|
|
|
sid: '', |
|
|
|
withApply: '', |
|
|
|
billNo: '', |
|
|
|
createTime: '', |
|
|
|
createOrgName: '', |
|
|
|
createOrgSid: '', |
|
|
|
deptName: '', |
|
|
|
deptSid: '', |
|
|
|
useOrgName: '', |
|
|
|
useOrgSid: '', |
|
|
|
remarks: '', |
|
|
@ -112,11 +130,6 @@ export default { |
|
|
|
this.formobj.useOrgName = res.data.name |
|
|
|
} |
|
|
|
}) |
|
|
|
brandDown({ useOrg: this.formobj.createOrgSid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.brand_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取日期 |
|
|
|
newDate() { |
|
|
@ -135,19 +148,27 @@ export default { |
|
|
|
this.init() |
|
|
|
this.newDate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|
|
|
|
|
|
|
this.formobj.createOrgSid = createOrgSid |
|
|
|
this.formobj.useOrgSid = createOrgSid |
|
|
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|
|
|
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) |
|
|
|
var nowDate = new Date() |
|
|
|
var date = { |
|
|
|
year: nowDate.getFullYear(), |
|
|
|
month: nowDate.getMonth() + 1, |
|
|
|
day: nowDate.getDate() |
|
|
|
} |
|
|
|
this.formobj.createTime = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day) |
|
|
|
this.viewTitle = '【新增】预提申请' |
|
|
|
}, |
|
|
|
showEdit(row) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'edit' |
|
|
|
this.viewTitle = '【编辑】预提申请' |
|
|
|
console.log('编辑回显', row.sid) |
|
|
|
req.fetchBySid(row.sid).then((resp) => { |
|
|
@ -159,22 +180,10 @@ 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.scmVehRebateWiths, this.formobj.createOrgSid, this.formobj.brandSid) |
|
|
|
this.$refs['divSelect'].showData(this.formobj.scmVehRebateWiths, this.formobj.createOrgSid) |
|
|
|
}, |
|
|
|
// 列表--选择返回数据 |
|
|
|
backData(value) { |
|
|
@ -186,7 +195,7 @@ export default { |
|
|
|
} |
|
|
|
let v = 0 |
|
|
|
for (var j in this.formobj.scmVehRebateWiths) { |
|
|
|
if (this.formobj.scmVehRebateWiths[j].rebateTypeValue === cval.rebateTypeValue) { |
|
|
|
if (this.formobj.scmVehRebateWiths[j].rebateTypeValue === cval.rebateTypeValue && this.formobj.scmVehRebateWiths[j].purchaseSystemName === cval.purchaseSystemName && this.formobj.scmVehRebateWiths[j].brandName === cval.brandName) { |
|
|
|
this.formobj.scmVehRebateWiths[j].num = parseInt(this.formobj.scmVehRebateWiths[j].num) + parseInt(1) |
|
|
|
this.formobj.scmVehRebateWiths[j].withRebate = Math.round((parseFloat(this.formobj.scmVehRebateWiths[j].withRebate !== '' ? this.formobj.scmVehRebateWiths[j].withRebate : 0) + parseFloat(cval.withRebate !== '' ? cval.withRebate : 0)) * 100) / 100 |
|
|
|
this.formobj.scmVehRebateWiths[j].expectTreatCost = Math.round((parseFloat(this.formobj.scmVehRebateWiths[j].expectTreatCost !== '' ? this.formobj.scmVehRebateWiths[j].expectTreatCost : 0) + parseFloat(cval.expectTreatCost !== '' ? cval.expectTreatCost : 0)) * 100) / 100 |
|
|
@ -206,6 +215,8 @@ export default { |
|
|
|
expectSuppCost: cval.expectSuppCost, |
|
|
|
brandName: cval.brandName, |
|
|
|
brandSid: cval.brandSid, |
|
|
|
purchaseSystemName: cval.purchaseSystemName, |
|
|
|
purchaseSystemSid: cval.purchaseSystemSid, |
|
|
|
vehRebateSids: [cval.sid], |
|
|
|
// remarks: '', |
|
|
|
sid: '', |
|
|
@ -220,7 +231,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) { |
|
|
@ -228,7 +239,7 @@ export default { |
|
|
|
let cval = value[i] |
|
|
|
let v = 0 |
|
|
|
for (var j in aa) { |
|
|
|
if (aa[j].rebateTypeValue === cval.rebateTypeValue) { |
|
|
|
if (aa[j].rebateTypeValue === cval.rebateTypeValue && aa[j].purchaseSystemName === cval.purchaseSystemName && aa[j].brandName === cval.brandName) { |
|
|
|
aa[j].num = parseInt(aa[j].num) + parseInt(1) |
|
|
|
aa[j].withRebate = Math.round((parseFloat(aa[j].withRebate !== '' ? aa[j].withRebate : 0) + parseFloat(cval.withRebate !== '' ? cval.withRebate : 0)) * 100) / 100 |
|
|
|
aa[j].expectTreatCost = Math.round((parseFloat(aa[j].expectTreatCost !== '' ? aa[j].expectTreatCost : 0) + parseFloat(cval.expectTreatCost !== '' ? cval.expectTreatCost : 0)) * 100) / 100 |
|
|
@ -248,6 +259,8 @@ export default { |
|
|
|
expectSuppCost: cval.expectSuppCost, |
|
|
|
brandName: cval.brandName, |
|
|
|
brandSid: cval.brandSid, |
|
|
|
purchaseSystemName: cval.purchaseSystemName, |
|
|
|
purchaseSystemSid: cval.purchaseSystemSid, |
|
|
|
vehRebateSids: [cval.sid], |
|
|
|
// remarks: '', |
|
|
|
sid: '', |
|
|
@ -256,7 +269,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
for (var k = 0; k < this.formobj.scmVehRebateWiths.length; k++) { |
|
|
|
if (this.formobj.scmVehRebateWiths[k].rebateTypeValue === rebateType) { |
|
|
|
if (this.formobj.scmVehRebateWiths[k].rebateTypeValue === rebateType && this.formobj.scmVehRebateWiths[k].purchaseSystemName === purchaseSystemName && this.formobj.scmVehRebateWiths[k].brandName === brandName) { |
|
|
|
this.formobj.scmVehRebateWiths[k].rebateTypeKey = aa[0].rebateTypeKey |
|
|
|
this.formobj.scmVehRebateWiths[k].rebateTypeValue = aa[0].rebateTypeValue |
|
|
|
this.formobj.scmVehRebateWiths[k].num = aa[0].num |
|
|
@ -265,13 +278,15 @@ export default { |
|
|
|
this.formobj.scmVehRebateWiths[k].expectSuppCost = aa[0].expectSuppCost |
|
|
|
this.formobj.scmVehRebateWiths[k].brandName = aa[0].brandName |
|
|
|
this.formobj.scmVehRebateWiths[k].brandSid = aa[0].brandSid |
|
|
|
this.formobj.scmVehRebateWiths[k].purchaseSystemName = aa[0].purchaseSystemName |
|
|
|
this.formobj.scmVehRebateWiths[k].purchaseSystemSid = aa[0].purchaseSystemSid |
|
|
|
this.formobj.scmVehRebateWiths[k].vehRebateSids = aa[0].vehRebateSids |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (value.length === 0) { |
|
|
|
for (var l = 0; l < this.formobj.scmVehRebateWiths.length; l++) { |
|
|
|
if (this.formobj.scmVehRebateWiths[l].rebateTypeValue === rebateType) { |
|
|
|
if (this.formobj.scmVehRebateWiths[l].rebateTypeValue === rebateType && this.formobj.scmVehRebateWiths[l].purchaseSystemName === purchaseSystemName && this.formobj.scmVehRebateWiths[l].brandName === brandName) { |
|
|
|
this.formobj.scmVehRebateWiths.splice(l, 1) |
|
|
|
break |
|
|
|
} |
|
|
@ -369,8 +384,12 @@ export default { |
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
withApply: '', |
|
|
|
billNo: '', |
|
|
|
createTime: '', |
|
|
|
createOrgName: '', |
|
|
|
createOrgSid: '', |
|
|
|
deptName: '', |
|
|
|
deptSid: '', |
|
|
|
useOrgName: '', |
|
|
|
useOrgSid: '', |
|
|
|
remarks: '', |
|
|
@ -394,7 +413,6 @@ export default { |
|
|
|
} |
|
|
|
.colOneStyle { |
|
|
|
border-right: 0px !important; |
|
|
|
border-bottom: 0px !important; |
|
|
|
} |
|
|
|
.span-sty { |
|
|
|
width: 130px !important; |
|
|
@ -406,5 +424,12 @@ export default { |
|
|
|
margin-left: 120px !important; |
|
|
|
width: calc(100% - 115px); |
|
|
|
} |
|
|
|
.titleOne { |
|
|
|
padding: 7px; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: flex-end; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|