|
|
@ -173,8 +173,10 @@ export default { |
|
|
|
this.viewTitle = '【编辑】专项返利分配申请' |
|
|
|
console.log('编辑回显', row.sid) |
|
|
|
req.fetchDetailsBySid(row.sid).then((resp) => { |
|
|
|
this.formobj = resp.data |
|
|
|
this.formobj.instanceId = resp.data.procInstId |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
this.formobj.instanceId = resp.data.procInstId |
|
|
|
} |
|
|
|
}).catch((e) => { |
|
|
|
this.formobj = row |
|
|
|
}) |
|
|
@ -233,36 +235,31 @@ export default { |
|
|
|
estimateRebate: e.estimateRebate, |
|
|
|
uploadMoney: e.uploadMoney, |
|
|
|
disNum: e.disNum, |
|
|
|
unitSetAllocationMoney: (parseInt(e.uploadMoney)) / (parseInt(e.disNum)) |
|
|
|
unitSetAllocationMoney: Math.round((parseFloat(e.uploadMoney) / parseFloat(e.disNum)) * 100) / 100 |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
changeBrand(value) { |
|
|
|
let bb = null |
|
|
|
this.brand_list.forEach((e) => { |
|
|
|
if (e.brandName === value) { |
|
|
|
bb = { |
|
|
|
name: e.brandName, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.formobj.brandSid = bb.sid |
|
|
|
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() { |
|
|
|
console.log(this.formobj) |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.formobj.scmSpecialrebatedistributedetails.length === 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '专项返利分配申请列表不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.submitdisabled = true |
|
|
|
req.saveOrUpdate(this.formobj).then((resp) => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'success', |
|
|
|
message: resp.msg |
|
|
|
}) |
|
|
|
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
this.handleReturn('true') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
@ -274,24 +271,24 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
submitVehicleApply() { |
|
|
|
if (this.formobj.scmSpecialrebatedistributedetails.length === 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '专项返利分配申请列表不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
req.submitVehicleApply(this.formobj).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'success', |
|
|
|
message: '提交成功' |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.formobj.scmSpecialrebatedistributedetails.length === 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '专项返利分配申请列表不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.submitdisabled = true |
|
|
|
req.submitVehicleApply(this.formobj).then((resp) => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
this.handleReturn('true') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '提交失败' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|