Commit 8f8074b6 by 前端

更新紧急版本代码

1 parent 8eac9ab5
...@@ -149,6 +149,39 @@ export default { ...@@ -149,6 +149,39 @@ export default {
url, url,
data: params data: params
}) })
},
// 获取白名单列表
getWhiteListPage(params){
params.method = 'marketing.api.activityRedEnvelope.whiteList.page'
return http({
url,
data: params
})
},
// 校验红包活动白名单导入
checkImportWhiteList(params){
params.method = 'marketing.api.activityRedEnvelope.whiteList.checkImport'
return http({
url,
data: params
})
},
// 红包活动白名单导入
whiteListImport(params){
params.method = 'marketing.api.activityRedEnvelope.whiteList.import'
return http({
url,
data: params
})
},
whiteListDelete(params){
params.method = 'marketing.api.activityRedEnvelope.whiteList.delete'
return http({
url,
data: params
})
} }
} }
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</div> </div>
<link-detail :linkDetailObj.sync="linkDetailObj"></link-detail> <link-detail :linkDetailObj.sync="linkDetailObj"></link-detail>
<edit :editObj.sync="editObj"></edit> <edit :editObj.sync="editObj"></edit>
<whiteList :linkDetailObj.sync="whiteListObj"> <whiteList :whiteListObj.sync="whiteListObj">
</whiteList> </whiteList>
</div> </div>
</template> </template>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
bigTitle="白名单" bigTitle="白名单"
:hasFooter="true" :hasFooter="true"
:before-close="handleClose" :before-close="handleClose"
:visible.sync="linkDetailObj.show" :visible.sync="whiteListObj.show"
@onOk="handleConfirm" @onOk="handleConfirm"
@onCancel="handleClose" @onCancel="handleClose"
> >
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
<div class="component"> <div class="component">
<component <component
:is="currentComponent" :is="currentComponent"
:DetailObj="whiteListObj"
v-if="currentComponent"
ref="componentRef" ref="componentRef"
></component> ></component>
</div> </div>
...@@ -35,7 +37,7 @@ export default { ...@@ -35,7 +37,7 @@ export default {
WhiteListSearch, WhiteListSearch,
WhiteListImport }, WhiteListImport },
props: { props: {
linkDetailObj: { whiteListObj: {
type: Object, type: Object,
default: () => { } default: () => { }
} }
...@@ -56,16 +58,25 @@ export default { ...@@ -56,16 +58,25 @@ export default {
} }
}, },
mounted () { mounted () {
// this.currentComponent = this.tabPaneList[0].name;
}, },
methods: { methods: {
handleConfirm(){ handleConfirm(){
if (this.currentComponent == 'WhiteListSearch'){
this.$message.success('确定成功')
this.handleClose()
}
if (this.currentComponent == 'WhiteListImport'){ if (this.currentComponent == 'WhiteListImport'){
this.$refs.componentRef.handleConfirm() this.$refs.componentRef.handleConfirm()
} }
}, },
handleClose () { handleClose () {
this.$emit('update:linkDetailObj', {}) this.$emit('update:whiteListObj', {
id:this.whiteListObj.id,
show:false
})
this.currentComponent = this.tabPaneList[0].name;
}, },
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
>下载导入模板</a> >下载导入模板</a>
<template v-if="recordForm.exportUrl"> <template v-if="recordForm.exportUrl">
<div class="file-info flex"> <div class="file-info flex">
{{fileName}} {{ fileName }}
<div class="el-icon-success"></div> <div class="el-icon-success"></div>
</div> </div>
</template> </template>
...@@ -55,10 +55,17 @@ import commonFun from "../common/fun"; ...@@ -55,10 +55,17 @@ import commonFun from "../common/fun";
export default { export default {
name: "whiteListImport", name: "whiteListImport",
data(){ props: {
return{ DetailObj: {
type: Object,
default: () => {
}
}
},
data() {
return {
recordForm: { recordForm: {
importType: 5, activityRedEnvelopeId: this.DetailObj.id,
exportUrl: '' exportUrl: ''
}, },
configRules: { configRules: {
...@@ -73,44 +80,44 @@ export default { ...@@ -73,44 +80,44 @@ export default {
fileError: '' fileError: ''
} }
}, },
methods:{ methods: {
handleClose () { handleClose() {
this.recordForm = this.$options.data.call(this).recordForm this.recordForm = this.$options.data.call(this).recordForm
this.fileError = '' this.fileError = ''
this.$refs.recordRef.resetFields() this.$refs.recordRef.resetFields()
this.$emit('update:show', false) this.$emit('update:show', false)
}, },
handleConfirm () { handleConfirm() {
this.$refs.recordRef.validate(async (valid) => { this.$refs.recordRef.validate(async (valid) => {
if (valid) { if (valid) {
try { try {
const { recordForm } = this, const {recordForm} = this,
res = await this.$apis.redenvelope.importRedEnvelopeRecord(recordForm) res = await this.$apis.redenvelope.whiteListImport(recordForm)
if (res) { if (res) {
this.$message({ this.$message({
message: '导入成功', message: '导入成功',
type: 'success' type: 'success'
}) })
this.handleClose() this.handleClose()
this.$parent.handleSearch() this.$parent.handleClose()
} }
else throw '导入成功'
} catch (error) { } catch (error) {
this.$message.error(error) this.$message.error(error)
} }
} }
}) })
}, },
async uploadFile (e) { async uploadFile(e) {
try { try {
const { url, name } = await commonFun.uploadFile(e, this), const {url, name} = await commonFun.uploadFile(e, this),
{ importType } = this.recordForm {activityRedEnvelopeId} = this.recordForm
this.$refs.file.value = '' this.$refs.file.value = ''
const res = await this.$apis.redenvelope.checkImport({ importType, exportUrl: url }) const res = await this.$apis.redenvelope.checkImportWhiteList({activityRedEnvelopeId, exportUrl: url})
if (res) { if (res) {
if (res.totalCount == 0 || res.failCount > 0) { if (res.totalCount == 0 || res.failCount > 0) {
this.fileError = res.errorUrl this.fileError = res.errorUrl
this.$message.error('红包记录导入失败') this.$message.error('导入失败')
this.recordForm.exportUrl = '' this.recordForm.exportUrl = ''
return return
} }
...@@ -123,7 +130,6 @@ export default { ...@@ -123,7 +130,6 @@ export default {
this.fileName = name this.fileName = name
} }
} catch (error) { } catch (error) {
console.log(error)
if (error) this.$message.error(error) if (error) this.$message.error(error)
} }
} }
...@@ -132,20 +138,24 @@ export default { ...@@ -132,20 +138,24 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.whiteListImport{ .whiteListImport {
margin-top: 20px; margin-top: 20px;
} }
.activity-link { .activity-link {
display: flex; display: flex;
width: 500px; width: 500px;
.upload-btn { .upload-btn {
position: relative; position: relative;
width: 110px; width: 110px;
height: 32px; height: 32px;
.el-button--small { .el-button--small {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
input { input {
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
...@@ -156,6 +166,7 @@ export default { ...@@ -156,6 +166,7 @@ export default {
font-size: 0px; font-size: 0px;
} }
} }
a, a,
.error { .error {
margin-left: 8px; margin-left: 8px;
...@@ -163,12 +174,15 @@ export default { ...@@ -163,12 +174,15 @@ export default {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
} }
.file-info { .file-info {
margin-left: 8px; margin-left: 8px;
.el-icon-success { .el-icon-success {
margin-left: 8px; margin-left: 8px;
color: #67c23a; color: #67c23a;
} }
.el-icon-error { .el-icon-error {
margin-left: 8px; margin-left: 8px;
color: red; color: red;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
:getListApi="getListApi" :getListApi="getListApi"
:tableData="tableData" :tableData="tableData"
:noDataImg="url" :noDataImg="url"
:searchForm="searchForm"
:tableParams="tableParams" :tableParams="tableParams"
@refreshTable="refreshTable" @refreshTable="refreshTable"
:tableTotal="tableTotal" :tableTotal="tableTotal"
...@@ -35,22 +36,29 @@ ...@@ -35,22 +36,29 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import * as dayjs from "dayjs"; import * as dayjs from "dayjs";
export default { export default {
name: "whiteListSearch", name: "whiteListSearch",
data () { props: {
DetailObj: {
type: Object,
default: () => {
}
}
},
data() {
return { return {
url, url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count'},
searchForm: { searchForm: {
status: '', activityRedEnvelopeId:this.DetailObj.id,
wechatName: '', phone: ''
userPhone: ''
}, },
getListApi: this.$apis.redenvelope.getRedEnvelopeRecordList, getListApi: this.$apis.redenvelope.getWhiteListPage,
searchFormData: [ searchFormData: [
{ {
label: '手机号码', label: '手机号码',
name: 'userPhone', name: 'phone',
type: 'input', type: 'input',
maxlength: 11 maxlength: 11
} }
...@@ -61,13 +69,13 @@ export default { ...@@ -61,13 +69,13 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '手机号', label: '手机号',
prop: 'userPhone', prop: 'phone',
minWidth: 100 minWidth: 100
}, },
{ {
label: '导入时间', label: '导入时间',
prop: 'exportTime', prop: 'importTime',
minWidth: 180 minWidth: 180
}, },
...@@ -92,31 +100,39 @@ export default { ...@@ -92,31 +100,39 @@ export default {
}, },
methods: { methods: {
handleSearch () { handleSearch() {
console.log(this.DetailObj)
this.$refs.listRef.refreshTable() this.$refs.listRef.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch() this.handleSearch()
}, },
showDelFun({id}){ showDelFun({id}) {
const params ={ this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const params = {
id id
} }
this.$apis.redenvelope.deleteWhiteList(params).then(res => { this.$apis.redenvelope.whiteListDelete(params).then(res => {
if (res){ if (res) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.handleSearch() this.handleSearch()
} }
}) })
})
.catch(() => {})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.whiteListSearch{ .whiteListSearch {
margin-top: 20px; margin-top: 20px;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!