|
|
@ -48,17 +48,24 @@ |
|
|
|
<div class="listtop"> |
|
|
|
<div class="tit">单车返利待核对列表</div> |
|
|
|
<div> |
|
|
|
<el-button size="mini" type="success">导入</el-button> |
|
|
|
<el-button size="mini" type="success">导出</el-button> |
|
|
|
<el-button size="mini" type="success">一次导出</el-button> |
|
|
|
<el-button size="mini" type="success">一次导入</el-button> |
|
|
|
<el-button size="mini" type="success">二次导出</el-button> |
|
|
|
<el-button size="mini" type="success">二次导入</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class=""> |
|
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column fixed type="selection" align="center" width="50px"/> |
|
|
|
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80px"/> |
|
|
|
<el-table-column label="上传状态" align="center" width="200"> |
|
|
|
<el-table-column label="上传状态" align="center" width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.uploadState == '0' ? '未调整' : scope.row.uploadState == '1' ? '已调整' : scope.row.uploadState == '2' ? '未上传' : scope.row.uploadState == '3' ? '已上传' : ''}}</span> |
|
|
|
<span>{{ scope.row.uploadState == '0' ? '未上传' : scope.row.uploadState == '1' ? '已上传' : ''}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="调整状态" align="center" width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.uploadState == '0' ? '未调整' : scope.row.uploadState == '1' ? '已调整' : ''}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="品牌" align="center" width="200"> |
|
|
@ -113,12 +120,12 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="上传日期" align="center" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-date-picker v-model="scope.row.uploadDate" type="date" style="width: 160px" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/> |
|
|
|
<el-date-picker v-model="scope.row.uploadDate" :disabled="scope.row.secondaryUploadDate !== ''" type="date" style="width: 160px" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="上传金额" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.uploadMoney" @keyup.native="UpNumber" @keydown.native="UpNumber" clearable placeholder=""></el-input> |
|
|
|
<el-input v-model="scope.row.uploadMoney" :disabled="scope.row.secondaryUploadDate !== ''" @input="isAdjustmentInput(scope.row)" @keyup.native="scope.row.uploadMoney = getNumber(scope.row.uploadMoney, 2)" clearable placeholder=""></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="二次上传日期" align="center" width="120"> |
|
|
@ -133,17 +140,17 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="待确定金额" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.stayDetermineMoney" @keyup.native="UpNumber" @keydown.native="UpNumber" clearable placeholder=""></el-input> |
|
|
|
<el-input v-model="scope.row.stayDetermineMoney" @input="isAdjustmentInput(scope.row)" @keyup.native="scope.row.stayDetermineMoney = getNumber(scope.row.stayDetermineMoney, 2)" clearable placeholder=""></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="费用" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.money" @keyup.native="UpNumber" @keydown.native="UpNumber" clearable placeholder=""></el-input> |
|
|
|
<el-input v-model="scope.row.money" @input="isAdjustmentInput(scope.row)" @keyup.native="scope.row.money = getNumber(scope.row.money, 2)" clearable placeholder=""></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="是否调整" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.isAdjustment" :disabled="scope.row.stayDetermineMoney > 0 || (scope.row.stayDetermineMoney == '0' && scope.row.adjustmentMoney == '0')" @change="changeIsAdjustment(scope.row)" placeholder="" filterable> |
|
|
|
<el-select v-model="scope.row.isAdjustment" :disabled="!scope.row.adjustOrNot" @change="isAdjustmentChange($event, scope.row)" placeholder="" filterable> |
|
|
|
<el-option v-for="item in whether_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
@ -155,13 +162,13 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="调整说明" align="center" width="300"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input :disabled="scope.row.isAdjustment === '' || scope.row.isAdjustment === '否'" v-model="scope.row.adjustmentRemarks" clearable placeholder=""></el-input> |
|
|
|
<el-input v-model="scope.row.adjustmentRemarks" clearable placeholder=""></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" width="180px" > |
|
|
|
<el-table-column label="操作" align="center" width="180px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" size="mini" @click="toSave(scope.row)">保存</el-button> |
|
|
|
<el-button type="primary" :disabled="scope.row.isAdjustment === '' || scope.row.isAdjustment === '是'" size="mini" @click="toAdjust(scope.row)">调整</el-button> |
|
|
|
<el-button type="primary" v-if="scope.row.adjustmentState == '0'" size="mini" @click="toSave(scope.row)">保存</el-button> |
|
|
|
<el-button type="primary" v-if="scope.row.isAdjustment == '否' || (scope.row.uploadState == '3' && scope.row.adjustmentState == '0')" size="mini" @click="toAdjust(scope.row)">调整</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -172,8 +179,11 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 核对审核申请分页列表 --> |
|
|
|
<bicyclerebatecheck v-show="viewState == 2" ref="divCheck" @doback="resetState"/> |
|
|
|
<!-- 新增核对审核申请 --> |
|
|
|
<bicyclerebatecheckAdd v-show="viewState == 3" ref="divCheckAdd" @doback="resetState"/> |
|
|
|
<!-- 二次调整页面 --> |
|
|
|
<el-dialog center :visible.sync="dialogVisible" width="60%"> |
|
|
|
<div class="app-container"> |
|
|
|
<div class="tab-header webtop"> |
|
|
@ -201,13 +211,13 @@ |
|
|
|
<span>其中含费用</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item><el-input v-model="formobj.firstCost" clearable placeholder=""/></el-form-item> |
|
|
|
<el-form-item><el-input v-model="formobj.firstCost" @input="firstCostInput" clearable placeholder=""/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>其中含返利</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item><el-input v-model="formobj.firstRebate" clearable placeholder=""/></el-form-item> |
|
|
|
<el-form-item><span>{{ formobj.firstRebate }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title"> |
|
|
@ -243,13 +253,13 @@ |
|
|
|
<span>其中含费用</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item><el-input v-model="formobj.secondCost" clearable placeholder=""/></el-form-item> |
|
|
|
<el-form-item><el-input v-model="formobj.secondCost" @input="secondCostInput" clearable placeholder=""/></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>其中含返利</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item><el-input v-model="formobj.secondRebate" clearable placeholder=""/></el-form-item> |
|
|
|
<el-form-item><span>{{ formobj.secondRebate }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
@ -257,7 +267,7 @@ |
|
|
|
<span>调整金额合计</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="20"> |
|
|
|
<el-form-item><span>{{ adjustmentMoneyAdd() }}</span></el-form-item> |
|
|
|
<el-form-item><span>{{ formobj.adjustmentMoney }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
@ -295,13 +305,6 @@ export default { |
|
|
|
btnKey: 'toAdd', |
|
|
|
btnLabel: '核对审核申请' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'toClick', |
|
|
|
btnLabel: '调整' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'info', |
|
|
|
size: 'small', |
|
|
@ -373,7 +376,8 @@ export default { |
|
|
|
secondaryUploadMoney: '', |
|
|
|
secondCost: '', |
|
|
|
secondRebate: '', |
|
|
|
adjustmentMoney: '' |
|
|
|
adjustmentMoney: '', |
|
|
|
cost: '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -451,7 +455,7 @@ export default { |
|
|
|
req.listPage(this.listQuery).then((response) => { |
|
|
|
console.log('列表查询结果:', response) |
|
|
|
this.listLoading = false |
|
|
|
if (response.success && response.data && response.data.total > 0) { |
|
|
|
if (response.success) { |
|
|
|
this.list = response.data.records |
|
|
|
this.listQuery.total = response.data.total |
|
|
|
} else { |
|
|
@ -486,96 +490,67 @@ export default { |
|
|
|
} |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
UpNumber(e) { |
|
|
|
e.target.value = e.target.value.replace(/[^\d]/g, '') // 清除“数字”和“.”"-"以外的字符 |
|
|
|
e.target.value = e.target.value.replace(/^00/, '0') // 开头不能有两个0 |
|
|
|
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { |
|
|
|
// 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 |
|
|
|
console.log(e.target.value) |
|
|
|
e.target.value = parseFloat(e.target.value) |
|
|
|
} |
|
|
|
}, |
|
|
|
changeIsAdjustment(row) { |
|
|
|
if (row.isAdjustment === '是') { |
|
|
|
if (row.uploadMoney === '') { |
|
|
|
row.isAdjustment = '' |
|
|
|
this.$message({ showClose: true, type: 'error', message: '上传金额不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (row.money === '') { |
|
|
|
row.isAdjustment = '' |
|
|
|
this.$message({ showClose: true, type: 'error', message: '费用不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (row.stayDetermineMoney === '') { |
|
|
|
row.isAdjustment = '' |
|
|
|
this.$message({ showClose: true, type: 'error', message: '待确定金额不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (row.uploadMoney !== '' && row.money !== '' && row.stayDetermineMoney !== '') { |
|
|
|
row.adjustmentMoney = parseInt(row.uploadMoney) - parseInt(row.money) - parseInt(row.stayDetermineMoney) - parseInt(row.estimateRebate) |
|
|
|
} |
|
|
|
} else if (row.isAdjustment === '否') { |
|
|
|
row.adjustmentMoney = 0 |
|
|
|
row.adjustmentRemarks = '' |
|
|
|
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 |
|
|
|
}, |
|
|
|
adjustmentMoneyAdd() { |
|
|
|
this.formobj.adjustmentMoney = parseInt(this.formobj.firstRebate - 0) + parseInt(this.formobj.secondRebate - 0) - parseInt(this.formobj.surplusRebate - 0) |
|
|
|
return this.formobj.adjustmentMoney |
|
|
|
}, |
|
|
|
handleSave() { |
|
|
|
let aa = null |
|
|
|
if (!this.checked) { |
|
|
|
aa = { |
|
|
|
sid: this.formobj.sid, |
|
|
|
stayDetermineMoney: 0, |
|
|
|
cost: this.formobj.firstCost, |
|
|
|
secondaryUploadDate: '', |
|
|
|
secondaryUploadMoney: 0, |
|
|
|
adjustmentMoney: this.formobj.firstRebate |
|
|
|
isAdjustmentInput(row) { |
|
|
|
let money = '0' |
|
|
|
// 上传金额 - 费用 - 待确定金额 - 预提返利 |
|
|
|
money = parseFloat(row.uploadMoney !== '' ? row.uploadMoney : 0) - parseFloat(row.money !== '' ? row.money : 0) - parseFloat(row.stayDetermineMoney !== '' ? row.stayDetermineMoney : 0) - parseFloat(row.estimateRebate !== '' ? row.estimateRebate : 0) |
|
|
|
if (row.stayDetermineMoney === '0') { |
|
|
|
if (parseFloat(money) > 0) { |
|
|
|
row.isAdjustment = '是' |
|
|
|
row.adjustmentMoney = parseFloat(money) |
|
|
|
row.adjustOrNot = true |
|
|
|
} else if (parseFloat(money) === 0) { |
|
|
|
row.isAdjustment = '是' |
|
|
|
row.adjustmentMoney = parseFloat(money) |
|
|
|
row.adjustOrNot = false |
|
|
|
} else { |
|
|
|
row.isAdjustment = '否' |
|
|
|
row.adjustmentMoney = '0' |
|
|
|
row.adjustmentRemarks = '' |
|
|
|
row.adjustOrNot = true |
|
|
|
} |
|
|
|
} else { |
|
|
|
aa = { |
|
|
|
sid: this.formobj.sid, |
|
|
|
stayDetermineMoney: 0, |
|
|
|
cost: parseInt(this.formobj.firstCost) + parseInt(this.formobj.secondCost), |
|
|
|
secondaryUploadDate: this.formobj.secondaryUploadDate, |
|
|
|
secondaryUploadMoney: this.formobj.secondaryUploadMoney, |
|
|
|
adjustmentMoney: this.formobj.adjustmentMoney |
|
|
|
} |
|
|
|
row.isAdjustment = '否' |
|
|
|
row.adjustmentMoney = '0' |
|
|
|
row.adjustmentRemarks = '' |
|
|
|
row.adjustOrNot = false |
|
|
|
} |
|
|
|
req.adjustment(aa).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
|
|
this.getList() |
|
|
|
this.handleReturn() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn() { |
|
|
|
this.dialogVisible = false |
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
stayDetermineMoney: '', |
|
|
|
firstCost: '', |
|
|
|
firstRebate: '', |
|
|
|
surplusRebate: '', |
|
|
|
secondaryUploadDate: '', |
|
|
|
secondaryUploadMoney: '', |
|
|
|
secondCost: '', |
|
|
|
secondRebate: '', |
|
|
|
adjustmentMoney: '' |
|
|
|
isAdjustmentChange(val, row) { |
|
|
|
if (val === '是') { |
|
|
|
row.adjustmentMoney = parseFloat(row.uploadMoney !== '' ? row.uploadMoney : 0) - parseFloat(row.money !== '' ? row.money : 0) - parseFloat(row.stayDetermineMoney !== '' ? row.stayDetermineMoney : 0) - parseFloat(row.estimateRebate !== '' ? row.estimateRebate : 0) |
|
|
|
} else if (val === '否') { |
|
|
|
row.adjustmentMoney = '0' |
|
|
|
row.adjustmentRemarks = '' |
|
|
|
} |
|
|
|
this.checked = false |
|
|
|
}, |
|
|
|
handleClick() { |
|
|
|
this.viewState = 2 |
|
|
|
}, |
|
|
|
// 新增核对审核申请 |
|
|
|
toAdd() { |
|
|
|
this.viewState = 3 |
|
|
|
this.$refs['divCheckAdd'].showAdd(this.listQuery.params.createOrgSid) |
|
|
|
}, |
|
|
|
// 保存 |
|
|
|
toSave(row) { |
|
|
|
if (row.uploadDate === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '上传日期不能为空' }) |
|
|
@ -593,41 +568,6 @@ export default { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '费用不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (row.stayDetermineMoney !== '0') { |
|
|
|
if (row.isAdjustment === '是') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '因待确定金额大于0,是否调整选项需选择否' }) |
|
|
|
return |
|
|
|
} |
|
|
|
} else if (row.stayDetermineMoney === '0') { |
|
|
|
if (row.adjustmentMoney.toString().indexOf('-') !== -1) { |
|
|
|
if (row.isAdjustment === '是') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '因待确定金额等于0且调整金额小于0,是否调整选项需选择否' }) |
|
|
|
return |
|
|
|
} |
|
|
|
} else if (row.adjustmentMoney !== '0') { |
|
|
|
if (row.isAdjustment === '否') { |
|
|
|
if ((parseInt(row.uploadMoney) - parseInt(row.estimateRebate)) > 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '因待确定金额等于0且调整金额大于0,是否调整选项需选择是' }) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (row.adjustmentMoney === '0') { |
|
|
|
if (row.isAdjustment === '否') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '因待确定金额等于0且调整金额等于0,是否调整选项需选择是' }) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (row.isAdjustment === '是') { |
|
|
|
if (row.adjustmentMoney === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '调整金额不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (row.adjustmentRemarks === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '调整说明不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
req.updateDate(row).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
|
@ -635,10 +575,7 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
toInfo(row) { |
|
|
|
this.viewState = 4 |
|
|
|
this.$refs['divInfo'].showInfo(row) |
|
|
|
}, |
|
|
|
// 二次调整 |
|
|
|
toAdjust(row) { |
|
|
|
this.dialogVisible = true |
|
|
|
this.formobj.stayDetermineMoney = row.stayDetermineMoney |
|
|
@ -648,7 +585,71 @@ export default { |
|
|
|
this.formobj.secondCost = 0 |
|
|
|
this.formobj.secondRebate = 0 |
|
|
|
this.formobj.secondaryUploadMoney = 0 |
|
|
|
this.formobj.surplusRebate = parseInt(row.estimateRebate) - parseInt(row.uploadMoney) |
|
|
|
this.formobj.cost = row.money |
|
|
|
this.formobj.surplusRebate = parseFloat(row.estimateRebate !== '' ? row.estimateRebate : 0) - parseFloat(row.uploadMoney !== '' ? row.uploadMoney : 0) |
|
|
|
}, |
|
|
|
// 二次调整页面--待确定金额模块 |
|
|
|
firstCostInput() { |
|
|
|
// 其中含返利 = 待确定金额 - 其中含费用 |
|
|
|
this.formobj.firstRebate = parseFloat(this.formobj.stayDetermineMoney !== '' ? this.formobj.stayDetermineMoney : 0) - parseFloat(this.formobj.firstCost !== '' ? this.formobj.firstCost : 0) |
|
|
|
this.adjustmentMoneyAdd() |
|
|
|
}, |
|
|
|
// 二次调整页面--返利二次上传模块 |
|
|
|
secondCostInput() { |
|
|
|
// 其中含返利 = 二次上传金额 - 其中含费用 |
|
|
|
this.formobj.secondRebate = parseFloat(this.formobj.secondaryUploadMoney !== '' ? this.formobj.secondaryUploadMoney : 0) - parseFloat(this.formobj.secondCost !== '' ? this.formobj.secondCost : 0) |
|
|
|
this.adjustmentMoneyAdd() |
|
|
|
}, |
|
|
|
// 二次调整页面--返利二次上传模块 |
|
|
|
adjustmentMoneyAdd() { |
|
|
|
// 调整金额合计 = 其中含返利之和 - 剩余预提返利 |
|
|
|
this.formobj.adjustmentMoney = parseFloat(this.formobj.firstRebate !== '' ? this.formobj.firstRebate : 0) + parseFloat(this.formobj.secondRebate !== '' ? this.formobj.secondRebate : 0) - parseFloat(this.formobj.surplusRebate !== '' ? this.formobj.surplusRebate : 0) |
|
|
|
}, |
|
|
|
handleSave() { |
|
|
|
let aa = null |
|
|
|
if (!this.checked) { |
|
|
|
aa = { |
|
|
|
sid: this.formobj.sid, |
|
|
|
stayDetermineMoney: 0, |
|
|
|
cost: parseFloat(this.formobj.cost !== '' ? this.formobj.cost : 0) + parseFloat(this.formobj.firstCost !== '' ? this.formobj.firstCost : 0), |
|
|
|
secondaryUploadDate: '', |
|
|
|
secondaryUploadMoney: 0, |
|
|
|
adjustmentMoney: this.formobj.adjustmentMoney |
|
|
|
} |
|
|
|
} else { |
|
|
|
aa = { |
|
|
|
sid: this.formobj.sid, |
|
|
|
stayDetermineMoney: 0, |
|
|
|
cost: parseFloat(this.formobj.cost !== '' ? this.formobj.cost : 0) + parseFloat(this.formobj.firstCost !== '' ? this.formobj.firstCost : 0) + parseFloat(this.formobj.secondCost !== '' ? this.formobj.secondCost : 0), |
|
|
|
secondaryUploadDate: this.formobj.secondaryUploadDate, |
|
|
|
secondaryUploadMoney: this.formobj.secondaryUploadMoney, |
|
|
|
adjustmentMoney: this.formobj.adjustmentMoney |
|
|
|
} |
|
|
|
} |
|
|
|
req.adjustment(aa).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
|
|
this.getList() |
|
|
|
this.handleReturn() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn() { |
|
|
|
this.dialogVisible = false |
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
stayDetermineMoney: '', |
|
|
|
firstCost: '', |
|
|
|
firstRebate: '', |
|
|
|
surplusRebate: '', |
|
|
|
secondaryUploadDate: '', |
|
|
|
secondaryUploadMoney: '', |
|
|
|
secondCost: '', |
|
|
|
secondRebate: '', |
|
|
|
adjustmentMoney: '', |
|
|
|
cost: '' |
|
|
|
} |
|
|
|
this.checked = false |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.viewState = 1 |
|
|
|