@@ -80,6 +80,16 @@ {{ scope.row.uploadMoney }} + + + + + + @@ -355,6 +392,18 @@ export default { secondRebate: '', adjustmentMoney: '', cost: '' + }, + dialogFileVisible: false, + updateAction: '', + fileList: [], + uploadResultMesssage: '', + uploadData: { + sid: '', + userSid: '', + orgPath: '' + }, + headers: { + token: window.sessionStorage.getItem('token') } } }, @@ -399,9 +448,6 @@ export default { case 'toAdd': this.toAdd() break - case 'doImport': - this.doImport() - break case 'doClose': this.doClose() break @@ -631,6 +677,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/scmspecialrebate/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/scmspecialrebate/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() + } } } } diff --git a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/relation/daifeipeizhuanxiang.vue b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/relation/daifeipeizhuanxiang.vue index d25c4f7bca..edec40a88a 100644 --- a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/relation/daifeipeizhuanxiang.vue +++ b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/relation/daifeipeizhuanxiang.vue @@ -35,11 +35,6 @@ - - -