Commit 8eac9ab5 by 前端

Merge branch 'v3.21.1_10' of http://192.168.3.233:8090/saas/outbound into v3.21.0_10

 Conflicts:
	src/views/redEnvelope/components/RedEnvelopeConfig/index.vue
2 parents 14b2c236 dd469526
......@@ -47,6 +47,8 @@
</div>
<link-detail :linkDetailObj.sync="linkDetailObj"></link-detail>
<edit :editObj.sync="editObj"></edit>
<whiteList :linkDetailObj.sync="whiteListObj">
</whiteList>
</div>
</template>
......@@ -55,9 +57,11 @@ import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
import linkDetail from './linkDetail.vue'
import edit from './edit.vue'
import { exportFn, activityStatusList } from '@/common/constant'
import whiteList from './whiteList'
import {exportFn, activityStatusList} from '@/common/constant'
export default {
components: { linkDetail, edit },
components: {linkDetail, edit, whiteList},
name: 'RedEnvelopeConfig',
data () {
return {
......@@ -117,7 +121,7 @@ export default {
prop: 'questionCount',
minWidth: 100,
formatter: cell => {
return `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')}`
return cell.activityStartTime ? `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')} `: ''
}
},
{
......@@ -170,10 +174,21 @@ export default {
listeners: {
click: row => this.jumpDetail(row)
}
},
{
type: 'el-button',
name: '白名单',
attrs: {
type: 'text',
},
listeners: {
click: row => this.whiteList(row)
}
}
],
editObj: {},
linkDetailObj: {},
whiteListObj: {},
tableSearchForm: {}
}
},
......@@ -204,6 +219,12 @@ export default {
id: e.id
}
},
whiteList(e) {
this.whiteListObj = {
show: true,
id: e.id
}
},
showEditFun (e) {
this.editObj = {
show: true,
......@@ -257,4 +278,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<GLDialog
mode="big"
class="muti link"
bigTitle="白名单"
:hasFooter="true"
:before-close="handleClose"
:visible.sync="linkDetailObj.show"
@onOk="handleConfirm"
@onCancel="handleClose"
>
<div class="tabs">
<GLTabs
v-model="currentComponent"
:tabPaneList="tabPaneList"
@tab-click="handleClick"
></GLTabs>
</div>
<div class="component">
<component
:is="currentComponent"
ref="componentRef"
></component>
</div>
</GLDialog>
</template>
<script type='text/ecmascript-6'>
import WhiteListImport from "./whiteListImport";
import WhiteListSearch from "./whiteListSearch";
export default {
name: '',
components: {
WhiteListSearch,
WhiteListImport },
props: {
linkDetailObj: {
type: Object,
default: () => { }
}
},
data () {
return {
currentComponent: 'WhiteListSearch',
tabPaneList: [
{
label: '白名单列表',
name: 'WhiteListSearch'
},
{
label: '导入白名单',
name: 'WhiteListImport'
},
],
}
},
mounted () {
},
methods: {
handleConfirm(){
if (this.currentComponent == 'WhiteListImport'){
this.$refs.componentRef.handleConfirm()
}
},
handleClose () {
this.$emit('update:linkDetailObj', {})
},
}
}
</script>
<style scoped lang='scss'>
.link {
/deep/.el-form-item--small {
width: fit-content;
}
}
</style>
<template>
<div class="whiteListImport">
<el-form
ref="recordRef"
label-width="154px"
:rules="configRules"
:model="recordForm"
>
<el-form-item
label="导入白名单:"
prop="exportUrl"
class="m-t-20"
>
<div class="activity-link">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
上传文件
</el-button>
<input
type="file"
style="opacity: 0"
ref="file"
accept="*"
@change="uploadFile"
/>
</div>
<a
href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/白名单模板.xlsx"
target="_blank"
>下载导入模板</a>
<template v-if="recordForm.exportUrl">
<div class="file-info flex">
{{fileName}}
<div class="el-icon-success"></div>
</div>
</template>
<template v-if="fileError">
<div class="file-info flex error">
<a
:href="fileError"
target="_blank"
>下载失败列表</a>
<div class="el-icon-error"></div>
</div>
</template>
</div>
</el-form-item>
</el-form>
</div>
</template>
<script>
import commonFun from "../common/fun";
export default {
name: "whiteListImport",
data(){
return{
recordForm: {
importType: 5,
exportUrl: ''
},
configRules: {
exportUrl: [
{
required: true,
message: '请导入白名单',
}
],
},
fileName: '',
fileError: ''
}
},
methods:{
handleClose () {
this.recordForm = this.$options.data.call(this).recordForm
this.fileError = ''
this.$refs.recordRef.resetFields()
this.$emit('update:show', false)
},
handleConfirm () {
this.$refs.recordRef.validate(async (valid) => {
if (valid) {
try {
const { recordForm } = this,
res = await this.$apis.redenvelope.importRedEnvelopeRecord(recordForm)
if (res) {
this.$message({
message: '导入成功',
type: 'success'
})
this.handleClose()
this.$parent.handleSearch()
}
else throw '导入成功'
} catch (error) {
this.$message.error(error)
}
}
})
},
async uploadFile (e) {
try {
const { url, name } = await commonFun.uploadFile(e, this),
{ importType } = this.recordForm
this.$refs.file.value = ''
const res = await this.$apis.redenvelope.checkImport({ importType, exportUrl: url })
if (res) {
if (res.totalCount == 0 || res.failCount > 0) {
this.fileError = res.errorUrl
this.$message.error('红包记录导入失败')
this.recordForm.exportUrl = ''
return
}
this.$message({
message: '导入成功',
type: 'success'
})
this.fileError = ''
this.recordForm.exportUrl = url
this.fileName = name
}
} catch (error) {
console.log(error)
if (error) this.$message.error(error)
}
}
}
}
</script>
<style scoped lang='scss'>
.whiteListImport{
margin-top: 20px;
}
.activity-link {
display: flex;
width: 500px;
.upload-btn {
position: relative;
width: 110px;
height: 32px;
.el-button--small {
width: 100%;
height: 100%;
}
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
a,
.error {
margin-left: 8px;
color: #5850ff;
font-size: 14px;
cursor: pointer;
}
.file-info {
margin-left: 8px;
.el-icon-success {
margin-left: 8px;
color: #67c23a;
}
.el-icon-error {
margin-left: 8px;
color: red;
}
}
}
</style>
<template>
<div class="whiteListSearch">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<GLTable
ref="listRef"
:getListApi="getListApi"
:tableData="tableData"
:noDataImg="url"
:tableParams="tableParams"
@refreshTable="refreshTable"
:tableTotal="tableTotal"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import * as dayjs from "dayjs";
export default {
name: "whiteListSearch",
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
searchForm: {
status: '',
wechatName: '',
userPhone: ''
},
getListApi: this.$apis.redenvelope.getRedEnvelopeRecordList,
searchFormData: [
{
label: '手机号码',
name: 'userPhone',
type: 'input',
maxlength: 11
}
],
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '导入时间',
prop: 'exportTime',
minWidth: 180
},
]
},
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
},
listeners: {
click: row => this.showDelFun(row)
}
}
],
tableData: [],
tableTotal: 0
}
},
methods: {
handleSearch () {
this.$refs.listRef.refreshTable()
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
showDelFun({id}){
const params ={
id
}
this.$apis.redenvelope.deleteWhiteList(params).then(res => {
if (res){
this.$message.success('删除成功')
this.handleSearch()
}
})
}
}
}
</script>
<style lang="scss" scoped>
.whiteListSearch{
margin-top: 20px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!