Browse Source

完善专项返利核对

zhanglei
yunuo970428 8 months ago
parent
commit
68d7097b8f
  1. 293
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatetobechecked.vue

293
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatetobechecked.vue

@ -53,9 +53,14 @@
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> <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 type="selection" align="center" width="50px"/>
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80px"/> <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"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="品牌" align="center" width="200"> <el-table-column label="品牌" align="center" width="200">
@ -85,12 +90,12 @@
</el-table-column> </el-table-column>
<el-table-column label="上传日期" align="center" width="200"> <el-table-column label="上传日期" align="center" width="200">
<template slot-scope="scope"> <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" type="date" :disabled="scope.row.secondaryUploadDate !== ''" style="width: 160px" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上传金额" align="center" width="150"> <el-table-column label="上传金额" align="center" width="150">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="二次上传日期" align="center" width="120"> <el-table-column label="二次上传日期" align="center" width="120">
@ -105,36 +110,35 @@
</el-table-column> </el-table-column>
<el-table-column label="待确定金额" align="center" width="150"> <el-table-column label="待确定金额" align="center" width="150">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="费用" align="center" width="150"> <el-table-column label="费用" align="center" width="150">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否调整" align="center" width="100"> <el-table-column label="是否调整" align="center" width="100">
<template slot-scope="scope"><!--@change="changeIsAdjustment(scope.row)" --> <template slot-scope="scope">
<el-select v-model="scope.row.isAdjustment" @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-option v-for="item in whether_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="调整金额" align="center" width="150"> <el-table-column label="调整金额" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-input :disabled="scope.row.isAdjustment === '' || scope.row.isAdjustment === '否'" v-model="scope.row.adjustmentMoney" clearable placeholder=""></el-input>-->
<span>{{ scope.row.adjustmentMoney }}</span> <span>{{ scope.row.adjustmentMoney }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="调整说明" align="center" width="300"> <el-table-column label="调整说明" align="center" width="300">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="180px" > <el-table-column label="操作" align="center" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="toSave(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" :disabled="scope.row.isAdjustment === '' || scope.row.isAdjustment === '是'" size="mini" @click="toAdjust(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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -145,8 +149,11 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 核对审核申请分页列表 -->
<specialrebatecheck v-show="viewState == 2" ref="divCheck" @doback="resetState"/> <specialrebatecheck v-show="viewState == 2" ref="divCheck" @doback="resetState"/>
<!-- 新增核对审核申请 -->
<specialrebatecheckAdd v-show="viewState == 3" ref="divCheckAdd" @doback="resetState"/> <specialrebatecheckAdd v-show="viewState == 3" ref="divCheckAdd" @doback="resetState"/>
<!-- 二次调整页面 -->
<el-dialog center :visible.sync="dialogVisible" width="60%"> <el-dialog center :visible.sync="dialogVisible" width="60%">
<div class="app-container"> <div class="app-container">
<div class="tab-header webtop"> <div class="tab-header webtop">
@ -268,13 +275,6 @@ export default {
btnKey: 'toAdd', btnKey: 'toAdd',
btnLabel: '核对审核申请' btnLabel: '核对审核申请'
}, },
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toClick',
btnLabel: '调整'
},
{ {
type: 'info', type: 'info',
size: 'small', size: 'small',
@ -353,7 +353,8 @@ export default {
secondaryUploadMoney: '', secondaryUploadMoney: '',
secondCost: '', secondCost: '',
secondRebate: '', secondRebate: '',
adjustmentMoney: '' adjustmentMoney: '',
cost: ''
} }
} }
}, },
@ -401,9 +402,6 @@ export default {
case 'doImport': case 'doImport':
this.doImport() this.doImport()
break break
case 'doDel':
this.doDel()
break
case 'doClose': case 'doClose':
this.doClose() this.doClose()
break break
@ -434,7 +432,7 @@ export default {
req.listPage(this.listQuery).then((response) => { req.listPage(this.listQuery).then((response) => {
console.log('列表查询结果:', response) console.log('列表查询结果:', response)
this.listLoading = false this.listLoading = false
if (response.success && response.data && response.data.total > 0) { if (response.success) {
this.list = response.data.records this.list = response.data.records
this.listQuery.total = response.data.total this.listQuery.total = response.data.total
} else { } else {
@ -468,88 +466,57 @@ export default {
} }
this.init() this.init()
}, },
UpNumber(e) { getNumber(val, limit) {
e.target.value = e.target.value.replace(/[^\d]/g, '') // ."-" val = val.replace(/[^0-9.]/g, '') //
e.target.value = e.target.value.replace(/^00/, '0') // 0 val = val.replace(/^00/, '0.') // 0
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { val = val.replace(/^\./g, '0.') // 0.
// 0102 val = val.replace(/\.{2,}/g, '.') //
console.log(e.target.value) val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //
e.target.value = parseFloat(e.target.value) /^0\d+/.test(val) ? val = val.slice(1) : '' // 0
} const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
}, const reg = new RegExp(str)
changeIsAdjustment(row) { if (limit === 0) {
if (row.isAdjustment === '是') { //
if (row.uploadMoney === '') { val = val.replace(reg, '$1')
row.isAdjustment = '' } else {
this.$message({ showClose: true, type: 'error', message: '上传金额不能为空' }) //
return val = val.replace(reg, '$1.$2')
}
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 = ''
} }
return val
}, },
adjustmentMoneyAdd() { isAdjustmentInput(row) {
this.formobj.adjustmentMoney = parseInt(this.formobj.firstRebate - 0) + parseInt(this.formobj.secondRebate - 0) - parseInt(this.formobj.surplusRebate - 0) let money = '0'
return this.formobj.adjustmentMoney // - - -
}, 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)
handleSave() { if (row.stayDetermineMoney === '0') {
let aa = null if (parseFloat(money) > 0) {
if (!this.checked) { row.isAdjustment = '是'
aa = { row.adjustmentMoney = parseFloat(money)
sid: this.formobj.sid, row.adjustOrNot = true
stayDetermineMoney: 0, } else if (parseFloat(money) === 0) {
cost: this.formobj.firstCost, row.isAdjustment = '是'
secondaryUploadDate: '', row.adjustmentMoney = parseFloat(money)
secondaryUploadMoney: 0, row.adjustOrNot = false
adjustmentMoney: this.formobj.firstRebate } else {
row.isAdjustment = '否'
row.adjustmentMoney = '0'
row.adjustmentRemarks = ''
row.adjustOrNot = true
} }
} else { } else {
aa = { row.isAdjustment = '否'
sid: this.formobj.sid, row.adjustmentMoney = '0'
stayDetermineMoney: 0, row.adjustmentRemarks = ''
cost: parseInt(this.formobj.firstCost) + parseInt(this.formobj.secondCost), row.adjustOrNot = false
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() { isAdjustmentChange(val, row) {
this.dialogVisible = false if (val === '是') {
this.formobj = { 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)
sid: '', } else if (val === '否') {
stayDetermineMoney: '', row.adjustmentMoney = '0'
firstCost: '', row.adjustmentRemarks = ''
firstRebate: '',
surplusRebate: '',
secondaryUploadDate: '',
secondaryUploadMoney: '',
secondCost: '',
secondRebate: '',
adjustmentMoney: ''
} }
this.checked = false
}, },
handleClick() { handleClick() {
this.viewState = 2 this.viewState = 2
@ -576,41 +543,6 @@ export default {
this.$message({ showClose: true, type: 'error', message: '费用不能为空' }) this.$message({ showClose: true, type: 'error', message: '费用不能为空' })
return 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) => { req.updateDate(row).then((resp) => {
if (resp.success) { if (resp.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' }) this.$message({ showClose: true, type: 'success', message: '保存成功' })
@ -618,10 +550,6 @@ export default {
} }
}) })
}, },
toInfo(row) {
this.viewState = 4
this.$refs['divInfo'].showInfo(row)
},
toAdjust(row) { toAdjust(row) {
this.dialogVisible = true this.dialogVisible = true
this.formobj.stayDetermineMoney = row.stayDetermineMoney this.formobj.stayDetermineMoney = row.stayDetermineMoney
@ -631,37 +559,72 @@ export default {
this.formobj.secondCost = 0 this.formobj.secondCost = 0
this.formobj.secondRebate = 0 this.formobj.secondRebate = 0
this.formobj.secondaryUploadMoney = 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)
}, },
doDel() { // --
if (this.sids.length === 0) { firstCostInput() {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) // = -
return 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
}
} }
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' req.adjustment(aa).then((resp) => {
this.$confirm(tip, '提示', { if (resp.success) {
confirmButtonText: '确定', this.$message({ showClose: true, type: 'success', message: '保存成功' })
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.delete(this.sids).then(resp => {
if (resp.success) {
this.$message({ type: 'success', message: resp.msg, showClose: true })
}
this.getList() this.getList()
loading.close() this.handleReturn()
}).catch(e => { }
loading.close()
})
}).catch(() => {
}) })
}, },
handleReturn() {
this.dialogVisible = false
this.formobj = {
sid: '',
stayDetermineMoney: '',
firstCost: '',
firstRebate: '',
surplusRebate: '',
secondaryUploadDate: '',
secondaryUploadMoney: '',
secondCost: '',
secondRebate: '',
adjustmentMoney: '',
cost: ''
}
this.checked = false
},
resetState() { resetState() {
this.viewState = 1 this.viewState = 1
}, },

Loading…
Cancel
Save