|
|
@ -48,10 +48,10 @@ |
|
|
|
<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" @click="exportByFirst">一次导出</el-button> |
|
|
|
<el-button size="mini" type="success" @click="importByFirst">一次导入</el-button> |
|
|
|
<el-button size="mini" type="success" @click="exportBySecond">二次导出</el-button> |
|
|
|
<el-button size="mini" type="success" @click="importBySecond">二次导入</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class=""> |
|
|
@ -274,6 +274,41 @@ |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<!-- 导入、导出 --> |
|
|
|
<el-dialog :visible.sync="dialogFileVisible" width="70%" :show-close="false"> |
|
|
|
<el-card class="box-card"> |
|
|
|
<div> |
|
|
|
<el-upload |
|
|
|
ref="upload" |
|
|
|
class="upload-demo" |
|
|
|
accept=".xls" |
|
|
|
name="file" |
|
|
|
:action="updateAction" |
|
|
|
:on-success="handleSuccess" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:file-list="fileList" |
|
|
|
:auto-upload="false" |
|
|
|
:multiple="false" |
|
|
|
:limit="1" |
|
|
|
:data="uploadData" |
|
|
|
:headers="headers" |
|
|
|
> |
|
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
|
|
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button> |
|
|
|
</el-upload> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<h3>文件上传结果</h3> |
|
|
|
<el-card class="box-card"> |
|
|
|
<div>{{ uploadResultMesssage }}</div> |
|
|
|
</el-card> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
<div slot="footer" class="dialog-footer" style="text-align: center"> |
|
|
|
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button> |
|
|
|
<el-button size="small" @click="dialogFileVisible = false">取消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@ -378,6 +413,18 @@ export default { |
|
|
|
secondRebate: '', |
|
|
|
adjustmentMoney: '', |
|
|
|
cost: '' |
|
|
|
}, |
|
|
|
dialogFileVisible: false, |
|
|
|
updateAction: '', |
|
|
|
fileList: [], |
|
|
|
uploadResultMesssage: '', |
|
|
|
uploadData: { |
|
|
|
sid: '', |
|
|
|
userSid: '', |
|
|
|
orgPath: '' |
|
|
|
}, |
|
|
|
headers: { |
|
|
|
token: window.sessionStorage.getItem('token') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -422,9 +469,6 @@ export default { |
|
|
|
case 'toAdd': |
|
|
|
this.toAdd() |
|
|
|
break |
|
|
|
case 'doImport': |
|
|
|
this.doImport() |
|
|
|
break |
|
|
|
case 'doClose': |
|
|
|
this.doClose() |
|
|
|
break |
|
|
@ -510,8 +554,8 @@ export default { |
|
|
|
}, |
|
|
|
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) |
|
|
|
// 上传金额(一次上传金额 + 二次上传金额) - 费用 - 待确定金额 - 预提返利 |
|
|
|
money = parseFloat(row.uploadMoney !== '' ? row.uploadMoney : 0) + parseFloat(row.secondaryUploadMoney !== '' ? row.secondaryUploadMoney : 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 = '是' |
|
|
@ -536,7 +580,7 @@ export default { |
|
|
|
}, |
|
|
|
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) |
|
|
|
row.adjustmentMoney = parseFloat(row.uploadMoney !== '' ? row.uploadMoney : 0) + parseFloat(row.secondaryUploadMoney !== '' ? row.secondaryUploadMoney : 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 = '' |
|
|
@ -657,6 +701,96 @@ export default { |
|
|
|
doClose() { |
|
|
|
this.$store.dispatch('tagsView/delView', this.$route) |
|
|
|
this.$router.go(-1) |
|
|
|
}, |
|
|
|
exportByFirst() { |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: 'Loading', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
req.excelListOne(this.listQuery.params).then((resp) => { |
|
|
|
loading.close() |
|
|
|
const blob = new Blob([resp], { |
|
|
|
type: 'application/vnd.ms-excel' |
|
|
|
}) |
|
|
|
const fileName = '一次导入模版' + '.xls' |
|
|
|
const elink = document.createElement('a') |
|
|
|
elink.download = fileName |
|
|
|
elink.style.display = 'nonde' |
|
|
|
elink.href = URL.createObjectURL(blob) |
|
|
|
document.body.appendChild(elink) |
|
|
|
elink.click() |
|
|
|
URL.revokeObjectURL(elink.href) |
|
|
|
document.body.removeChild(elink) |
|
|
|
}).catch(() => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
}, |
|
|
|
importByFirst() { |
|
|
|
this.dialogFileVisible = true |
|
|
|
this.updateAction = process.env.VUE_APP_BASE_API + '/scm/v1/scmvehrebate/getExcelOneInfo' |
|
|
|
this.fileList = [] |
|
|
|
this.uploadResultMesssage = '' |
|
|
|
}, |
|
|
|
exportBySecond() { |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: 'Loading', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
req.excelListTwo(this.listQuery.params).then((resp) => { |
|
|
|
loading.close() |
|
|
|
const blob = new Blob([resp], { |
|
|
|
type: 'application/vnd.ms-excel' |
|
|
|
}) |
|
|
|
const fileName = '二次导入模版' + '.xls' |
|
|
|
const elink = document.createElement('a') |
|
|
|
elink.download = fileName |
|
|
|
elink.style.display = 'nonde' |
|
|
|
elink.href = URL.createObjectURL(blob) |
|
|
|
document.body.appendChild(elink) |
|
|
|
elink.click() |
|
|
|
URL.revokeObjectURL(elink.href) |
|
|
|
document.body.removeChild(elink) |
|
|
|
}).catch(() => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
}, |
|
|
|
importBySecond() { |
|
|
|
this.dialogFileVisible = true |
|
|
|
this.updateAction = process.env.VUE_APP_BASE_API + '/scm/v1/scmvehrebate/getExcelTwoInfo' |
|
|
|
this.fileList = [] |
|
|
|
this.uploadResultMesssage = '' |
|
|
|
}, |
|
|
|
handleRemove() { |
|
|
|
this.uploadResultMesssage = '' |
|
|
|
}, |
|
|
|
submitUpload() { |
|
|
|
this.uploadData.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
this.uploadData.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
|
|
|
this.$refs.upload.submit() |
|
|
|
}, |
|
|
|
handleSuccess(resp, file, fileList) { |
|
|
|
const _this = this |
|
|
|
if (resp.success) { |
|
|
|
_this.uploadResultMesssage = resp.msg |
|
|
|
} else { |
|
|
|
_this.uploadResultMesssage = resp.msg |
|
|
|
} |
|
|
|
}, |
|
|
|
handleConfirm() { |
|
|
|
if (this.uploadResultMesssage === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请先上传单车返利模版' }) |
|
|
|
return |
|
|
|
} else { |
|
|
|
this.dialogFileVisible = false |
|
|
|
this.updateAction = '' |
|
|
|
this.uploadData.userSid = '' |
|
|
|
this.uploadData.orgPath = '' |
|
|
|
this.getList() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|