12.31开源admin代码更新

This commit is contained in:
hejinfu1026
2021-12-31 15:58:40 +08:00
parent ad99c24532
commit f5a9772176
545 changed files with 9743 additions and 139371 deletions

View File

@@ -1,277 +0,0 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" :inline="true" label-width="55px" label-position="left">
<el-form-item label="状态:">
<el-select v-model="tableFrom.status" placeholder="请选择状态" clearable class="selWidth">
<el-option :label="item.label" :value="item.value" v-for="(item, index) in switchData" :key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="名称:">
<el-input v-model="tableFrom.title" placeholder="请输入模板名称" class="selWidth" size="small" clearable></el-input>
</el-form-item>
<el-form-item label="ID">
<el-input v-model="tableFrom.tempId" placeholder="请输入模板ID" class="selWidth" size="small" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="seachList" size="small">查询</el-button>
</el-form-item>
</el-form>
<router-link :to=" { path:'/appSetting/publicRoutine/publicRoutineTemplate' } ">
<el-button type="primary" size="small" class="mr10">添加</el-button>
</router-link>
<el-button type="primary" size="small" class="mr10" @click="checkTemp">一键同步我的模板</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
class="table"
highlight-current-row
>
<el-table-column
label="ID"
width="80"
prop="id"
/>
<el-table-column
prop="tempId"
label="模板ID"
min-width="320"
/>
<el-table-column
prop="title"
label="模板名"
min-width="150"
/>
<el-table-column
label="模板关键字"
min-width="250">
<template slot-scope="scope" v-if="scope.row.extra">
<span v-for="item in JSON.parse(scope.row.extra)" :key="item.kid" class="mr5">{{item.name}}</span>
</template>
<template slot-scope="scope" v-else>
<span class="mr5">-</span>
</template>
</el-table-column>
<el-table-column
label="状态"
min-width="100"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
class="demo"
active-text="开启"
inactive-text="关闭"
:active-value="true"
:inactive-value="false"
@click.native="onchangeIsShow(scope.row)"
/>
</template>
</el-table-column>
<el-table-column
label="应用场景"
min-width="150"
>
<template slot-scope="scope">
<el-select v-model="scope.row.type" placeholder="请选择" clearable @change="onchangeType(scope.row)">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="createTime"
label="添加时间"
min-width="150"
/>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to=" { path:'/appSetting/publicRoutine/creatPublicTemplate/' + scope.row.tid + '/0/' + scope.row.id } ">
<el-button size="small" type="text" class="mr10">编辑</el-button>
</router-link>
<!--<el-button type="text" size="small" @click="handleDelete(scope.row, scope.$index)">删除</el-button>-->
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<!--编辑-->
<el-dialog
title="编辑订单"
:visible.sync="dialogVisible"
width="500px"
:before-close="handleClose">
<zb-parser
v-if="dialogVisible"
:form-id="105"
:is-create="isCreate"
:edit-data="editData"
@submit="handlerSubmit"
@resetForm="resetForm"
/>
</el-dialog>
</div>
</template>
<script>
import { tempAsyncApi, myTempTypeApi, myTempListApi, wechatTemplateStatusApi, wechatTemplateSaveApi, wechatTemplateUpdateApi, wechatTemplateDeleteApi, myTempStatusApi} from '@/api/wxApi'
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
export default {
name: "MyTemplates",
components: { zbParser },
data() {
return {
value: '',
options: [{
value: 'paySubscribe',
label: '支付成功'
}, {
value: 'orderSubscribe',
label: '订单相关'
}, {
value: 'extrctSubscribe',
label: '提现消息'
}, {
value: 'orderRefundSubscribe',
label: '订单退款'
}, {
value: 'rechargeSubscribe',
label: '充值成功'
}],
labelPosition:'right',
isCreate: 0,
editData: {},
dialogVisible: false,
switchData: this.$constants.switchStatus,
tableFrom: {
page: 1,
limit: 20,
status: null,
title: null,
tempId: null
},
tableData: {
data: [],
total: 0
},
listLoading: true,
tempId: null
}
},
mounted() {
this.getList()
},
methods: {
resetForm(formValue) {
this.dialogVisible = false
},
checkTemp() {
this.$modalSure('同步我的模板到小程序').then(() => {
tempAsyncApi().then(() => {
this.$message.success('同步成功')
})
})
},
seachList() {
this.tableFrom.page = 1
this.getList()
},
// 订单删除
handleDelete(row, idx) {
this.$modalSure().then(() => {
wechatTemplateDeleteApi( row.id ).then(() => {
this.$message.success('删除成功')
this.tableData.data.splice(idx, 1)
})
})
},
handleClose() {
this.dialogVisible = false
this.editData = {}
},
handlerSubmit(formValue) {
this.isCreate === 0 ? wechatTemplateSaveApi(formValue).then(data => {
this.$message.success('新增成功')
this.dialogVisible = false
this.editData = {}
this.getList()
}) : wechatTemplateUpdateApi(this.tempId, formValue).then(data => {
this.$message.success('编辑成功')
this.dialogVisible = false
this.getList()
})
},
add() {
this.dialogVisible = true
},
edit(row) {
this.tempId = row.id
this.dialogVisible = true
this.isCreate = 1
this.editData = JSON.parse(JSON.stringify(row))
},
// 列表
getList() {
this.listLoading = true
myTempListApi(this.tableFrom).then(res => {
this.tableData.data = res.list || []
this.tableData.total = res.total
this.listLoading = false
}).catch(() => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
},
// 修改状态
onchangeIsShow(row) {
myTempStatusApi({status: row.status , id: row.id}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
row.status = !row.status
})
},
// 修改场景
onchangeType(row) {
myTempTypeApi({type: row.type , id: row.id}).then(() => {
this.$message.success('修改成功')
this.getList()
})
}
}
}
</script>
<style scoped lang="scss">
.selWidth {
width: 350px;
}
</style>

View File

@@ -1,272 +0,0 @@
<template>
<div class="divBox">
<el-card class="box-card" v-loading="loadingAll">
<el-alert
:closable="false"
title="你可用该标题的模板搭配不同的关键词使用,配置提交后关键词种类和顺序将不能修改"
type="warning">
</el-alert>
<el-divider></el-divider>
<el-row>
<el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
<div class="tmplmsg-box">
<div class="tmplmsg-preview">
<div class="tmplmsg-preview-title mb35" v-text="form.title"></div>
<div class="acea-row row-middle tmplmsg-preview-cont mb10" v-for="(item, index) in KeywordCheck" :key="item.kid">
<label v-text="item.name"></label>
<span v-text="item.example"></span>
</div>
</div>
</div>
</el-col>
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
<div class="tmplmsg-form">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" size="mini">
<el-form-item label="配置关键词" prop="checkList">
<div class="tmplmsg-form-cont">
<el-checkbox-group v-model="form.checkList" :max="5" @change="handleChecked">
<el-checkbox :label="item.kid" v-for="item in KeywordList" :key="item.kid">{{item.name}}</el-checkbox>
</el-checkbox-group>
</div>
</el-form-item>
<el-form-item :label=" '已选择(' + KeywordCheck.length + '/5)'">
<span v-if="KeywordCheck.length ===0 ">请先从上方选择关键词</span>
<div v-else class="tmplmsg-form-check">
<div class="tmplmsg-form-check-list mb10 acea-row row-between" v-for="(item, index) in KeywordCheck" :key="item.kid"
draggable="true"
@dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)"
@dragover="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)">
<span v-text="item.name"></span>
<i class="el-icon-close" @click="closeCheck(index)"></i>
</div>
</div>
</el-form-item>
<el-form-item label="场景说明" prop="sceneDesc">
<el-input
type="textarea"
:rows="2"
placeholder="请输入场景说明"
v-model="form.sceneDesc">
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="loading" @click="onSubmit('form')">提交</el-button>
</el-form-item>
</el-form>
</div>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import { getWeChatKeywordsByTidApi, myTempSaveApi, publicTempInfoApi, myTempInfoApi, myTempUpdateApi } from '@/api/wxApi'
export default {
name: "creatPublicTemplate",
data() {
return {
KeywordList: [],
form: {
checkList: [],
kid: '',
sceneDesc: '',
tid: '',
title: '',
extra: ''
},
KeywordCheck: [],
loading: false,
loadingAll: false,
rules: {
sceneDesc: [
{ required: true, message: '请填写场景说明', trigger: 'blur' }
],
checkList: [
{ type: 'array', required: true, message: '请至少选择一个关键词', trigger: 'change' }
]
},
tempRoute: {}
}
},
created() {
this.tempRoute = Object.assign({}, this.$route)
},
mounted() {
this.getKeywordList()
if( this.$route.params.id !== '0' )this.getTitle()
if( this.$route.params.myId!== '0'){
this.setTagsViewTitle()
this.wxInfo()
}
},
methods: {
// 设置tab标题
setTagsViewTitle() {
const title = '编辑模板'
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.myId}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
},
handleChecked(val) {
this.KeywordCheck = this.KeywordList.filter(item=> val.some(ele=>ele == item.kid))
},
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let data = {
kid: this.form.checkList.join(','),
sceneDesc: this.form.sceneDesc,
tid: this.$route.params.tid,
title: this.form.title,
extra: JSON.stringify(this.KeywordCheck)
}
this.loading = true
this.$route.params.myId === '0' ? myTempSaveApi(data).then(res => {
this.$message.success('提交成功')
this.$router.push('/appSetting/publicRoutine/publicRoutineTemplate')
this.loading = false
}).catch(()=>{
this.loading = false
}) : myTempUpdateApi({id: this.$route.params.myId}, data).then(res => {
this.$message.success('提交成功')
this.$router.push('/appSetting/publicRoutine/routineTemplate')
this.loading = false
}).catch(()=>{
this.loading = false
})
} else {
return false;
}
});
},
closeCheck(i) {
this.form.checkList.splice(i, 1)
},
// 详情
wxInfo() {
myTempInfoApi({ id: this.$route.params.myId}).then(res => {
this.form = {
checkList: res.kid.split(',').map(Number),
sceneDesc: res.sceneDesc,
tid: res.tid,
title: res.title,
extra: res.extra
}
this.KeywordCheck = JSON.parse(res.extra)
})
},
// 标题
getTitle() {
publicTempInfoApi({ id: this.$route.params.id}).then(res => {
this.form.title = res.title
})
},
// 关键字列表
getKeywordList() {
this.loadingAll = true
getWeChatKeywordsByTidApi({ tid: this.$route.params.tid}).then(res => {
this.KeywordList = res
for (let i=0;i<res; i++) {
this.$set(this.form.checkList, i,res[i])
}
this.loadingAll = false
}).catch(() => {
this.loadingAll = false
})
},
// 移动
handleDragStart (e, item) {
this.dragging = item;
},
handleDragEnd (e, item) {
this.dragging = null
},
handleDragOver (e) {
e.dataTransfer.dropEffect = 'move'
},
handleDragEnter (e, item) {
e.dataTransfer.effectAllowed = 'move'
if (item === this.dragging) {
return
}
const newItems = [...this.KeywordCheck]
const src = newItems.indexOf(this.dragging)
const dst = newItems.indexOf(item)
newItems.splice(dst, 0, ...newItems.splice(src, 1))
this.KeywordCheck = newItems;
}
}
}
</script>
<style scoped lang="scss">
.tmplmsg{
&-box{
border: 1px solid #E7E7EB;
border-radius: 5px;
width: 90%;
min-width: 325px;
margin-right: 30px;
}
&-preview{
min-height: 230px;
padding: 15px;
&-title{
font-size: 14px;
}
&-cont{
font-size: 13px;
label{
width: 100px;
}
}
}
&-form{
position: relative;
width: 60%;
height: auto;
background: #f6f8f9;
background-clip: padding-box;
padding: 20px 20px;
&-cont{
width: 100%;
height: auto;
background: #fff;
padding: 15px;
max-height: 250px;
overflow-y: auto;
/deep/.el-checkbox{
display: block !important;
}
}
&-check{
&-list{
width: 100%;
background: #fff;
line-height: 37px;
height: 37px;
align-items: center;
padding: 0 15px;
box-sizing: border-box;
cursor: pointer;
}
/deep/.el-alert--success{
line-height: normal !important;
}
}
}
&-form::after {
content:"";
position: absolute;
right: 100%;
top: 26px;
width: 0;
height: 0;
border-top: 13px solid transparent;
border-right: 26px solid #f6f8f9;
border-bottom: 13px solid transparent;
}
}
</style>

View File

@@ -1,156 +0,0 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" :inline="true">
<el-form-item label="所属类目:">
<el-select v-model="tableFrom.categoryId" placeholder="请选择状态" clearable class="selWidth" @change="seachList">
<el-option :label="item.name" :value="item.id" v-for="item in categoryList" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模板类型:">
<el-select v-model="tableFrom.type" placeholder="请选择类型" clearable class="selWidth" @change="seachList">
<el-option label="一次性订阅" value="2"></el-option>
<el-option label="长期订阅" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模板标题:">
<el-input v-model="tableFrom.title" placeholder="请输入模板标题" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
</el-input>
</el-form-item>
</el-form>
</div>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
class="table"
highlight-current-row
>
<el-table-column
label="ID"
width="80"
prop="id"
/>
<el-table-column
prop="tid"
label="模板ID"
min-width="100"
/>
<el-table-column
prop="title"
label="模版标题"
min-width="150"
/>
<el-table-column
label="所属类目"
min-width="100"
>
<template slot-scope="scope">
<span>{{ scope.row.categoryId | wxCategoryFilter }}</span>
</template>
</el-table-column>
<el-table-column
label="模版类型"
min-width="100"
>
<template slot-scope="scope">
<span>{{ scope.row.type | wxTypeFilter }}</span>
</template>
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
min-width="150"
/>
<el-table-column label="操作" min-width="80" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to=" { path:'/appSetting/publicRoutine/creatPublicTemplate/' + scope.row.tid + '/' + scope.row.id + '/0' } ">
<el-button size="small" type="text" class="mr10">选用</el-button>
</router-link>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import { publicTempListApi, categoryApi } from '@/api/wxApi'
import Cookies from 'js-cookie'
export default {
name: "index",
data() {
return {
tableData: {
data: [],
total: 0
},
listLoading: true,
tableFrom: {
page: 1,
limit: 20,
title: '',
type: '',
categoryId: ''
},
categoryList: []
}
},
mounted() {
this.getList()
this.getCategoryList()
},
methods: {
seachList() {
this.tableFrom.page = 1
this.getList()
},
// 列表
getList() {
this.listLoading = true
publicTempListApi(this.tableFrom).then(res => {
this.tableData.data = res.list || []
this.tableData.total = res.total
this.listLoading = false
}).catch(() => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
},
// 所属类目
getCategoryList() {
categoryApi().then(res => {
this.categoryList = res
Cookies.set('WxCategory', res)
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -27,19 +27,9 @@
<div v-if="formValidate.type === 'news'">
<div class="newsBox">
<!--<div class="news_pic mb15" style="backgroundImage: url('@/assets/imgs/mobilefoot.png');backgroundSize:'100% 100%'}" />-->
<div class="news_pic mb15" :style="{backgroundImage: 'url(' + (formValidate.contents.articleData.imageInput?formValidate.contents.articleData.imageInput[0]:'') + ')',backgroundSize:'100% 100%'}" />
<div class="news_pic mb15" :style="{backgroundImage: 'url(' + (formValidate.contents.articleData.imageInput?formValidate.contents.articleData.imageInput:'') + ')',backgroundSize:'100% 100%'}" />
<span class="news_sp">{{ formValidate.contents.articleData.title }}</span>
</div>
<!--<div v-for="(j, i) in formValidate.contents.list" :key="i">-->
<!--<div v-if="i === 0">-->
<!--<div class="news_pic mb15" :style="{backgroundImage: 'url(' + (j.image_input) + ')',backgroundSize:'100% 100%'}" />-->
<!--<span class="news_sp">{{ j.title }}</span>-->
<!--</div>-->
<!--<div v-else class="news_cent">-->
<!--<span v-if="j.synopsis" class="news_sp1">{{ j.title }}</span>-->
<!--<div v-if="j.image_input.length!==0" class="news_cent_img"><img :src="j.image_input"></div>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</div>
@@ -141,6 +131,7 @@
type="primary"
class="ml50"
@click="submenus('formValidate')"
v-hasPermi="['admin:wechat:keywords:reply:update']"
>保存并发布
</el-button>
</div>
@@ -155,6 +146,7 @@
import { getToken } from '@/utils/auth'
import { replySaveApi, replyEditApi, replyInfoApi, replyListApi, keywordsInfoApi, replyUpdateApi } from '@/api/wxApi'
import { wechatUploadApi } from '@/api/systemSetting'
import {Debounce} from '@/utils/validate'
export default {
name: 'Index',
components: { },
@@ -381,7 +373,7 @@ export default {
this.val = ''
},
// 保存
submenus(name) {
submenus:Debounce(function(name) {
this.$refs[name].validate((valid) => {
if (valid) {
this.formValidate.keywords = this.labelarr.join(',')
@@ -398,15 +390,19 @@ export default {
})
} else {
this.$route.path.indexOf('follow') !== -1 ? this.formValidate.keywords = 'subscribe' : this.formValidate.keywords ='default'
replyUpdateApi({id:this.formValidate.id}, this.formValidate).then(async res => {
this.formValidate.id !== null ? replyUpdateApi({id:this.formValidate.id}, this.formValidate).then(async res => {
this.$message.success('操作成功')
}) : replySaveApi(this.formValidate).then(async res => {
this.operation()
}).catch(res => {
this.$message.error(res.message)
})
}
} else {
return false
}
})
},
}),
// 保存成功操作
operation() {
this.$modalSure('继续添加').then(() => {

View File

@@ -14,15 +14,15 @@
</el-form-item>
<el-form-item label="关键字:">
<el-input v-model="tableFrom.keywords" placeholder="请输入关键字" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" v-hasPermi="['admin:wechat:keywords:reply:info:keywords']" />
</el-input>
</el-form-item>
</el-form>
<router-link :to="{path: '/appSetting/publicAccount/wxReply/keyword/save'}">
<el-button size="small" type="primary">添加关键字</el-button>
<el-button size="small" type="primary" v-hasPermi="['admin:wechat:keywords:reply:save']">添加关键字</el-button>
</router-link>
</div>
</div>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
@@ -53,7 +53,7 @@
label="是否显示"
min-width="100"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="checkPermi(['admin:wechat:keywords:reply:status'])">
<el-switch
v-model="scope.row.status"
:active-value="true"
@@ -67,9 +67,11 @@
<el-table-column label="操作" min-width="100">
<template slot-scope="scope">
<router-link :to="{path: '/appSetting/publicAccount/wxReply/keyword/save/' + scope.row.id}">
<el-button type="text" size="small">编辑</el-button>
<el-button type="text" size="small"
v-if="scope.row.keywords !=='subscribe' && scope.row.keywords !=='default'"
v-hasPermi="['admin:wechat:keywords:reply:info']">编辑</el-button>
</router-link>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)">删除</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" v-hasPermi="['admin:wechat:keywords:reply:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -91,6 +93,7 @@
<script>
import { replyListApi, replyDeleteApi, replyUpdateApi, replyStatusApi } from '@/api/wxApi'
import { getToken } from '@/utils/auth'
import { checkPermi } from "@/utils/permission";
export default {
name: 'WechatKeyword',
data() {
@@ -112,6 +115,7 @@ export default {
this.getList()
},
methods: {
checkPermi,
seachList() {
this.tableFrom.page = 1
this.getList()

View File

@@ -47,7 +47,7 @@
<div v-if="checkedMenuId !== null">
<div class="dividerTitle acea-row row-between row-bottom">
<span class="title">菜单信息</span>
<el-button slot="extra" size="small" type="danger" @click="deltMenus">删除</el-button>
<el-button slot="extra" size="small" type="danger" @click="deltMenus" v-hasPermi="['admin:wechat:menu:public:delete']">删除</el-button>
<el-divider />
</div>
<el-col :span="24" class="userAlert">
@@ -95,7 +95,10 @@
</el-col>
</div>
<el-col v-if="isTrue" :span="24">
<el-button size="mini" type="primary" style="display: block;margin: 10px auto;" @click="submenus('formValidate')">保存并发布</el-button>
<el-button size="mini" type="primary"
style="display: block;margin: 10px auto;"
@click="submenus('formValidate')"
v-hasPermi="['admin:wechat:menu:public:create']">保存并发布</el-button>
</el-col>
</el-col>
</el-row>
@@ -105,6 +108,7 @@
<script>
import { wechatMenuApi, wechatMenuAddApi } from '@/api/wxApi'
import {Debounce} from '@/utils/validate'
export default {
name: 'WechatMenus',
data() {
@@ -191,7 +195,7 @@
})
},
// 点击保存提交
submenus(name) {
submenus:Debounce(function(name) {
if (this.isTrue && !this.checkedMenuId && this.checkedMenuId !== 0) {
this.putData()
} else {
@@ -203,7 +207,7 @@
}
})
}
},
}),
// 新增data
putData() {
const data = {

View File

@@ -1,225 +1,5 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" :inline="true" >
<el-form-item label="状态:">
<el-select v-model="tableFrom.status" placeholder="请选择状态" clearable class="selWidth" @change="seachList">
<el-option :label="item.label" :value="item.value" v-for="(item, index) in switchData" :key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模板名称:">
<el-input v-model="tableFrom.name" placeholder="请输入模板名称" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
</el-input>
</el-form-item>
</el-form>
<!--<el-button type="primary" @click="add" size="small">添加模板消息</el-button>-->
</div>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
class="table"
highlight-current-row
>
<el-table-column
label="ID"
width="80"
prop="id"
/>
<el-table-column
prop="tempKey"
label="模板编号"
min-width="150"
/>
<el-table-column
prop="tempId"
label="模板ID"
min-width="340"
/>
<el-table-column
prop="name"
label="模板名"
min-width="150"
/>
<el-table-column
label="回复内容"
min-width="200"
>
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.content.split('\n')" :key="index" style="display: block">{{item}}</span>
</template>
</el-table-column>
<el-table-column
label="状态"
width="100"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
class="demo"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="0"
@click.native="onchangeIsShow(scope.row)"
/>
</template>
</el-table-column>
<el-table-column
prop="createTime"
label="添加时间"
min-width="150"
/>
<!--<el-table-column label="操作" min-width="150" fixed="right" align="center">-->
<!--<template slot-scope="scope">-->
<!--<el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>-->
<!--<el-button type="text" size="small" @click="handleDelete(scope.row, scope.$index)">删除</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
<div class="block">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<!--编辑-->
<el-dialog
:title="isCreate===0 ? '添加模板' : '编辑模板'"
:visible.sync="dialogVisible"
width="500px"
:before-close="handleClose">
<zb-parser
v-if="dialogVisible"
:form-id="105"
:is-create="isCreate"
:edit-data="editData"
@submit="handlerSubmit"
@resetForm="resetForm"
/>
</el-dialog>
<div>
</div>
</template>
<script>
import { wechatTemplateListApi, wechatTemplateStatusApi, wechatTemplateSaveApi, wechatTemplateUpdateApi, wechatTemplateDeleteApi} from '@/api/wxApi'
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
export default {
name: "Templates",
components: { zbParser },
data() {
return {
labelPosition:'right',
isCreate: 0,
editData: {},
dialogVisible: false,
switchData: this.$constants.switchStatus,
tableFrom: {
page: 1,
limit: 20,
status: '',
name: '',
type: this.$route.params.type
},
tableData: {
data: [],
total: 0
},
listLoading: true,
tempId: null
}
},
mounted() {
this.getList()
},
methods: {
resetForm(formValue) {
this.dialogVisible = false
},
seachList() {
this.tableFrom.page = 1
this.getList()
},
// 订单删除
handleDelete(row, idx) {
this.$modalSure().then(() => {
wechatTemplateDeleteApi( row.id ).then(() => {
this.$message.success('删除成功')
this.tableData.data.splice(idx, 1)
})
})
},
handleClose() {
this.dialogVisible = false
this.editData = {}
},
handlerSubmit(formValue) {
this.isCreate === 0 ? wechatTemplateSaveApi(formValue).then(data => {
this.$message.success('新增成功')
this.dialogVisible = false
this.editData = {}
this.getList()
}) : wechatTemplateUpdateApi(this.tempId, formValue).then(data => {
this.$message.success('编辑成功')
this.dialogVisible = false
this.getList()
})
},
add() {
this.dialogVisible = true
},
edit(row) {
this.tempId = row.id
this.dialogVisible = true
this.isCreate = 1
this.editData = JSON.parse(JSON.stringify(row))
},
// 列表
getList() {
this.listLoading = true
wechatTemplateListApi(this.tableFrom).then(res => {
this.tableData.data = res.list || []
this.tableData.total = res.total
this.listLoading = false
}).catch(() => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
},
// 修改状态
onchangeIsShow(row) {
wechatTemplateStatusApi(row.id, {status: row.status}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
row.status = !row.status
})
}
}
}
</script>
<style scoped lang="scss">
.selWidth {
width: 350px;
}
</style>
</template>

View File

@@ -9,7 +9,7 @@
<el-form-item label="作者" prop="author" :rules="[{required:true, message:'请填作者', trigger:['blur','change']}]">
<el-input v-model="pram.author" placeholder="作者" maxlength="20"/>
</el-form-item>
<el-form-item label="文章分类">
<el-form-item label="文章分类" :rules="[{required:true, message:'请选择分类', trigger:['blur','change']}]">
<el-select v-model="pram.cid" placeholder="请选择" style="width:100%;">
<el-option
v-for="item in categoryTreeData"
@@ -27,29 +27,11 @@
</div>
</div>
</el-form-item>
<!--<el-form-item label="微信公众号封面" prop="imageInput" :rules="[{ required: true, message: '请上传图文封面', trigger: 'change' }]">-->
<!--<div class="upLoadPicBox">-->
<!--<div v-if="pram.imageInput" class="pictrue"><img :src="pram.imageInput"></div>-->
<!--<el-upload-->
<!--v-else-->
<!--class="upload-demo mr10 mb15"-->
<!--action-->
<!--:http-request="handleUploadForm"-->
<!--:headers="myHeaders"-->
<!--:show-file-list="false"-->
<!--multiple-->
<!--&gt;-->
<!--<div class="upLoad">-->
<!--<i class="el-icon-camera cameraIconfont" />-->
<!--</div>-->
<!--</el-upload>-->
<!--</div>-->
<!--</el-form-item>-->
<el-form-item label="文章简介" prop="synopsis" :rules="[{required:true, message:'请填写文章简介', trigger:['blur','change']}]">
<el-input v-model="pram.synopsis" maxlength="100" type="textarea" :rows="2" resize="none" placeholder="文章简介" />
</el-form-item>
<el-form-item label="文章内容" prop="content" :rules="[{required:true, message:'请填写文章内容', trigger:['blur','change']}]">
<ueditor-from v-model="pram.content" :content="pram.content" />
<Tinymce v-model="pram.content"></Tinymce>
</el-form-item>
<el-form-item label="是否Banner">
<el-switch v-model="pram.isBanner" />
@@ -57,12 +39,8 @@
<el-form-item label="是否热门">
<el-switch v-model="pram.isHot" />
</el-form-item>
<!--<el-form-item label="原文链接">-->
<!--<p>原文链接选填填写之后在图文左下方会出现此链接</p>-->
<!--<el-input v-model="pram.url" placeholder="原文链接" />-->
<!--</el-form-item>-->
<el-form-item>
<el-button type="primary" :loading="loading" @click="handerSubmit('pram')">保存</el-button>
<el-button type="primary" :loading="loading" @click="handerSubmit('pram')" v-hasPermi="['admin:article:update']">保存</el-button>
</el-form-item>
</el-form>
</div>
@@ -77,6 +55,7 @@ import * as articleApi from '@/api/article.js'
import * as selfUtil from '@/utils/ZBKJIutil.js'
import { fileImageApi } from '@/api/systemSetting'
import { getToken } from '@/utils/auth'
import {Debounce} from '@/utils/validate'
export default {
// name: "edit",
components: { Tinymce },
@@ -96,7 +75,7 @@ export default {
pram: {
author: null,
cid: null,
content: null,
content: '', //<span>My Document\'s Title</span>
imageInput: '',
isBanner: false,
isHot: null,
@@ -110,7 +89,9 @@ export default {
// mediaId: null
},
editData: {},
myHeaders: { 'X-Token': getToken() }
myHeaders: { 'X-Token': getToken() },
editorContentLaebl:"",
// basicForm:{editorContent:""}
}
},
created() {
@@ -126,29 +107,8 @@ export default {
methods: {
getInfo (){
categoryApi.articleInfoApi({ id: this.$route.params.id }).then(data => {
this.editData = data
this.hadlerInitEditData()
})
},
// 上传
handleUploadForm(param){
const formData = new FormData()
formData.append('media', param.file)
let loading = this.$loading({
lock: true,
text: '上传中,请稍候...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
fileImageApi(formData, {type: 'image'}).then(res => {
loading.close()
this.pram.mediaId = res.mediaId
// this.formValidate.contents.mediaId = res.mediaId
// this.formValidate.contents.srcUrl = res.url
this.$message.success('上传成功')
}).catch(() => {
loading.close()
this.editData = data
this.hadlerInitEditData()
})
},
modalPicTap(tit) {
@@ -182,7 +142,7 @@ export default {
localStorage.setItem('articleClass', JSON.stringify(data.list))
})
},
handerSubmit(form) {
handerSubmit:Debounce(function(form) {
this.$refs[form].validate(valid => {
if (!valid) return
if (!this.$route.params.id) {
@@ -191,7 +151,7 @@ export default {
this.handlerUpdate()
}
})
},
}),
handlerUpdate() {
this.loading = true
this.pram.cid = Array.isArray(this.pram.cid) ? this.pram.cid[0] : this.pram.cid

View File

@@ -5,42 +5,59 @@
<div class="container">
<el-form inline size="small">
<el-form-item label="文章分类:">
<el-select v-model="listPram.cid" clearable class="selWidth" placeholder="请选择文章分类" @change="handerSearch">
<el-select
v-model="listPram.cid"
clearable
class="selWidth"
placeholder="请选择文章分类"
@change="handerSearch"
>
<el-option
v-for="item in categoryTreeData"
:key="item.id"
:label="item.name"
:value="item.id">
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="关键词:">
<el-input v-model="listPram.keywords" placeholder="请输入关键词" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="handerSearch" size="small"/>
<el-input
v-model="listPram.keywords"
placeholder="请输入关键词"
class="selWidth"
size="small"
clearable
>
<el-button
slot="append"
icon="el-icon-search"
@click="handerSearch"
size="small"
/>
</el-input>
</el-form-item>
</el-form>
</div>
<router-link :to=" { path:'/content/articleCreat' } ">
<el-button size="small" type="primary" class="mr10">添加文章</el-button>
<router-link :to="{ path: '/content/articleCreat' }">
<el-button size="small" type="primary" class="mr10" v-hasPermi="['admin:article:save']">添加文章</el-button>
</router-link>
<!--<el-button size="mini" type="primary" @click="handlerOpenEdit(0)">添加文章</el-button>-->
</div>
<el-table :data="listData.list" size="mini"
class="table"
highlight-current-row>
<el-table-column
prop="id"
label="ID"
min-width="50"
/>
<el-table
v-loading="listLoading"
:data="listData.list"
size="mini"
class="table"
highlight-current-row
:header-cell-style=" {fontWeight:'bold'}">
<el-table-column prop="id" label="ID" min-width="50" />
<el-table-column label="图片" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.imageInput[0]"
:preview-src-list="[scope.row.imageInput[0]]"
:src="scope.row.imageInput"
:preview-src-list="[scope.row.imageInput]"
/>
</div>
</template>
@@ -57,17 +74,32 @@
</template>
</el-table-column>
<el-table-column prop="author" label="作者" min-width="180" />
<el-table-column prop="synopsis" label="文章简介" show-overflow-tooltip min-width="250"/>
<el-table-column prop="shareTitle" label="分享标题" show-overflow-tooltip min-width="200"/>
<el-table-column prop="updateTime" label="更新时间" min-width="180"/>
<el-table-column label="操作" min-width="100" fixed="right" align="center">
<el-table-column
prop="synopsis"
label="文章简介"
show-overflow-tooltip
min-width="250"
/>
<el-table-column prop="updateTime" label="更新时间" min-width="180" />
<el-table-column
label="操作"
min-width="100"
fixed="right"
align="center"
>
<template slot-scope="scope">
<router-link :to=" { path:'/content/articleCreat/'+ scope.row.id } ">
<el-button size="small" type="text" class="mr10">编辑</el-button>
<router-link
:to="{ path: '/content/articleCreat/' + scope.row.id }"
>
<el-button size="small" type="text" class="mr10" v-hasPermi="['admin:article:info']">编辑</el-button>
</router-link>
<!--<el-button type="text" size="small" @click="handlerOpenEdit(1, scope.row)">编辑</el-button>-->
<!--<el-button type="text" size="small" disabled>关联产品</el-button>-->
<el-button type="text" size="small" @click="handlerDelete(scope.row)">删除</el-button>
<el-button
type="text"
size="small"
@click="handlerDelete(scope.row)"
v-hasPermi="['admin:article:delete']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@@ -82,7 +114,7 @@
</el-card>
<el-dialog
:visible.sync="editDialogConfig.visible"
:title="editDialogConfig.isEdit === 0?'创建文章':'编辑文章'"
:title="editDialogConfig.isEdit === 0 ? '创建文章' : '编辑文章'"
top="1vh"
width="900px"
destroy-on-close
@@ -101,10 +133,10 @@
</template>
<script>
import * as articleApi from '@/api/article.js'
import * as categoryApi from '@/api/categoryApi.js'
import * as selfUtil from '@/utils/ZBKJIutil.js'
import edit from './edit'
import * as articleApi from "@/api/article.js";
import * as categoryApi from "@/api/categoryApi.js";
import * as selfUtil from "@/utils/ZBKJIutil.js";
import edit from "./edit";
export default {
// name: "list",
components: { edit },
@@ -115,53 +147,57 @@ export default {
keywords: null,
cid: null,
page: 1,
limit: this.$constants.page.limit[0]
limit: this.$constants.page.limit[0],
},
listData: { list: [], total: 0 },
editDialogConfig: {
visible: false,
data: {},
isEdit: 0 // 0=add 1=edit
isEdit: 0, // 0=add 1=edit
},
listLoading: true,
categoryTreeData: [],
categoryProps: {
value: 'id',
label: 'name',
children: 'child',
expandTrigger: 'hover',
value: "id",
label: "name",
children: "child",
expandTrigger: "hover",
checkStrictly: true,
emitPath: false
}
}
emitPath: false,
},
};
},
mounted() {
this.handlerGetListData(this.listPram)
this.handlerGetTreeList()
this.handlerGetListData(this.listPram);
this.handlerGetTreeList();
},
methods: {
handlerGetTreeList() {
categoryApi.listCategroy({ type: 3, status: '' }).then(data => {
this.categoryTreeData = data.list
localStorage.setItem('articleClass', JSON.stringify(data.list))
})
categoryApi.listCategroy({ type: 3, status: "" }).then((data) => {
this.categoryTreeData = data.list;
localStorage.setItem("articleClass", JSON.stringify(data.list));
});
},
handerSearch() {
this.listPram.page = 1
this.handlerGetListData(this.listPram)
this.listPram.page = 1;
this.handlerGetListData(this.listPram);
},
handlerGetListData(pram) {
articleApi.ListArticle(pram).then(data => {
this.listData = data
})
this.listLoading = true
articleApi.ListArticle(pram).then((data) => {
this.listData = data;
this.listLoading = false
});
},
handlerOpenEdit(isEdit, editData) { // 0=add 1=edit
handlerOpenEdit(isEdit, editData) {
// 0=add 1=edit
if (isEdit === 1) {
this.editDialogConfig.isEdit = 1
this.editDialogConfig.editData = editData
}else{
this.editDialogConfig.isEdit = 0
this.editDialogConfig.isEdit = 1;
this.editDialogConfig.editData = editData;
} else {
this.editDialogConfig.isEdit = 0;
}
this.editDialogConfig.visible = true
this.editDialogConfig.visible = true;
},
// handlerGetCategoryTreeData() {
// const _pram = { type: constants.categoryType[2].value, status: 1 }
@@ -170,31 +206,31 @@ export default {
// })
// },
handlerHideDialog() {
this.handlerGetListData(this.listPram)
this.editDialogConfig.visible = false
this.handlerGetListData(this.listPram);
this.editDialogConfig.visible = false;
},
handlerDelete(rowData) {
this.$confirm('确定删除当前数据', '提示').then(result => {
articleApi.DelArticle(rowData).then(data => {
this.$message.success('删除数据成功')
this.handlerGetListData(this.listPram)
})
})
this.$confirm("确定删除当前数据", "提示").then((result) => {
articleApi.DelArticle(rowData).then((data) => {
this.$message.success("删除数据成功");
this.handlerGetListData(this.listPram);
});
});
},
handleSizeChange(val) {
this.listPram.limit = val
this.handlerGetListData(this.listPram)
this.listPram.limit = val;
this.handlerGetListData(this.listPram);
},
handleCurrentChange(val) {
this.listPram.page = val
this.handlerGetListData(this.listPram)
}
}
}
this.listPram.page = val;
this.handlerGetListData(this.listPram);
},
},
};
</script>
<style scoped lang="scss">
.articleModal{
.articleModal {
z-index: 333 !important;
}
</style>

View File

@@ -1,82 +1,86 @@
<template>
<div class="divBox">
<el-row :gutter="24" class="baseInfo">
<div class="divBox" style="padding-bottom:0;">
<el-row :gutter="20" class="baseInfo">
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div slot="header" class="acea-row row-between-wrapper">
<span>销售额</span>
<el-tag type="success">昨日</el-tag>
</div>
<div class="content" v-if="sales">
<span class="content-number spBlock mb15">{{ sales.count }}</span>
<div>
<span class="content-time mr20">日环比<i class="content-is" :class="Number(sales.dayRate)>=0?'up':'down'">{{ sales.dayRate }}%</i><i :class="Number(sales.dayRate)>=0?'el-icon-caret-top':'el-icon-caret-bottom'" /></span>
<span class="content-time">周环比<i class="content-is" :class="Number(sales.weekRate)>=0?'up':'down'">{{ sales.weekRate }}%</i><i :class="Number(sales.weekRate)>=0?'el-icon-caret-top':'el-icon-caret-bottom'" /></span>
<div class="acea-row row-between-wrapper">
<div class="acea-row align-center">
<!-- <div class="main_badge">
<span class="iconfont iconxiaoshoue"></span>
</div> -->
<span class="main_tit">销售额</span>
</div>
<el-tag type="primary">今日</el-tag>
</div>
<div class="content" v-if="viewData">
<span class="content-number spBlock my15">{{ viewData.sales }}</span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">总销售额</span>
<span>{{sales.total}} </span>
<span class="content-time">昨日数据</span>
<span class="content-time">{{viewData.yesterdaySales}} </span>
</div>
</div>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div slot="header" class="acea-row row-between-wrapper">
<span>用户访问量</span>
<el-tag type="success">昨日</el-tag>
</div>
<div class="content" v-if="views">
<span class="content-number spBlock mb15">{{ views.count }}</span>
<div>
<span class="content-time mr20">日环比<i class="content-is" :class="Number(views.dayRate)>=0?'up':'down'">{{ views.dayRate }}%</i><i :class="Number(views.dayRate)>=0?'el-icon-caret-top':'el-icon-caret-bottom'" /></span>
<span class="content-time">周环比<i class="content-is" :class="Number(views.weekRate)>=0?'up':'down'">{{ views.weekRate }}%</i><i :class="Number(views.weekRate)>=0?'el-icon-caret-top':'el-icon-caret-bottom'" /></span>
<div class="acea-row row-between-wrapper">
<div class="acea-row align-center">
<!-- <div class="main_badge">
<span class="iconfont iconyonghu"></span>
</div> -->
<span class="main_tit">用户访问量</span>
</div>
<el-tag type="primary">今日</el-tag>
</div>
<div class="content" v-if="viewData">
<span class="content-number spBlock my15">{{ viewData.pageviews }}</span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">总访问量</span>
<span>{{ views.total }} Pv</span>
<span class="content-time">昨日数据</span>
<span class="content-time">{{ viewData.yesterdayPageviews }}</span>
</div>
</div>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div slot="header" class="acea-row row-between-wrapper">
<span>订单量</span>
<el-tag type="success">昨日</el-tag>
</div>
<div class="content" v-if="order">
<span class="content-number spBlock mb15">{{ order.count }}</span>
<div>
<span class="content-time mr20">日环比<i class="content-is" :class="Number(order.dayRate)>=0?'up':'down'">{{ order.dayRate }}%</i><i :class="Number(order.dayRate)>=0?'el-icon-caret-top':'el-icon-caret-bottom'" /></span>
<span class="content-time">周环比<i class="content-is" :class="Number(order.weekRate)>=0?'up':'down'">{{ order.weekRate }}%</i><i :class="Number(order.weekRate)>=0?'el-icon-caret-top':'el-icon-caret-bottom'" /></span>
<div class="acea-row row-between-wrapper">
<div class="acea-row align-center">
<!-- <div class="main_badge">
<span class="iconfont icondingdan"></span>
</div> -->
<span class="main_tit">订单量</span>
</div>
<el-tag type="primary">今日</el-tag>
</div>
<div class="content" v-if="viewData">
<span class="content-number spBlock my15">{{ viewData.orderNum }}</span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">总订单量</span>
<span>{{ order.total }} </span>
<span class="content-time">昨日数据</span>
<span class="content-time">{{ viewData.yesterdayOrderNum }}</span>
</div>
</div>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div slot="header" class="acea-row row-between-wrapper">
<span>新增用户</span>
<el-tag type="success">昨日</el-tag>
</div>
<div class="content" v-if="user">
<span class="content-number spBlock mb15">{{ user.count }}</span>
<div>
<span class="content-time mr20">日环比<i class="content-is" :class="Number(user.dayRate)>=0?'up':'down'">{{ user.dayRate }}%</i><i :class="Number(user.dayRate)>=0?'el-icon-caret-top':'el-icon-caret-bottom'" /></span>
<span class="content-time">周环比<i class="content-is" :class="Number(user.weekRate)>=0?'up':'down'">{{ user.weekRate }}%</i><i :class="Number(user.weekRate)>=0?'el-icon-caret-top':'el-icon-caret-bottom'" /></span>
<div class="acea-row row-between-wrapper">
<div class="acea-row align-center">
<!-- <div class="main_badge">
<span class="iconfont iconxinzengyonghu"></span>
</div> -->
<span class="main_tit">新增用户</span>
</div>
<el-tag type="primary">今日</el-tag>
</div>
<div class="content" v-if="viewData">
<span class="content-number spBlock my15">{{ viewData.newUserNum }}</span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">总用户</span>
<span>{{ user.total }} </span>
<span class="content-time">昨日数据</span>
<span class="content-time">{{ viewData.yesterdayNewUserNum }} </span>
</div>
</div>
</el-card>
@@ -85,66 +89,29 @@
</div>
</template>
<script>
import {statisticsOrderApi, statisticsSalesApi, statisticsUserApi, statisticsViewsApi} from '@/api/dashboard'
import {viewModelApi} from '@/api/dashboard'
export default {
data() {
return {
infoList: [],
grid: {
xl: 6,
lg: 6,
md: 12,
sm: 12,
xs: 24
},
excessStyle: {
color: '#f56a00',
backgroundColor: '#fde3cf'
},
avatarList: [],
sales: null,
order: null,
user: null,
views: null
grid: { xl: 6, lg: 6, md: 12, sm: 12, xs: 24},
viewData:{}
}
},
methods: {
// 订单量
statisticsOrder() {
statisticsOrderApi().then(async res => {
this.order = res
viewModelApi().then(async res => {
this.viewData = res;
})
},
// 销售额
statisticsSales() {
statisticsSalesApi().then(async res => {
this.sales = res
})
},
// 新增用户
statisticsUser() {
statisticsUserApi().then(async res => {
this.user = res
})
},
// 用户访问量
statisticsViews() {
statisticsViewsApi().then(async res => {
this.views = res
})
}
},
mounted() {
this.statisticsOrder();
this.statisticsSales();
this.statisticsUser();
this.statisticsViews();
}
}
</script>
<style scoped lang="scss">
.ivu-mb{
margin-bottom: 10px;
margin-bottom: 20px;
}
.up, .el-icon-caret-top {
color: #F5222D;
@@ -157,7 +124,33 @@
font-size: 12px;
/*opacity: 100% !important;*/
}
.main_tit{
color: #333;
font-size: 14px;
font-weight: 500;
}
.content-time{
font-size: 14px;
color:#333;
font-weight: 500;
}
.main_badge{
width: 30px;
height: 30px;
border-radius: 5px;
margin-right: 10px;
background: #2C90FF;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
.my15{
margin: 15px 0 15px;
}
.align-center{
align-items: center;
}
.baseInfo {
/deep/ .el-card__header {
padding: 15px 20px !important;
@@ -167,10 +160,14 @@
.content {
&-number {
font-size: 30px;
font-weight: 600;
font-family: PingFangSC-Semibold, PingFang SC;
color: #333;
}
&-time{
font-size:14px;
/*color: #8C8C8C;*/
color: #333333;
font-weight: 400;
}
}
</style>
</style>

View File

@@ -1,7 +1,7 @@
<template>
<div class="divBox">
<el-row :gutter="24" class="dashboard-console-grid">
<el-col v-bind="grid" class="ivu-mb">
<el-col v-bind="grid" class="ivu-mb" v-if="checkPermi(['admin:user:list'])">
<el-card :bordered="false">
<router-link :to="{path:'/user/index'}">
<i class="el-icon-user" style="color:#69c0ff" />
@@ -9,7 +9,7 @@
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-col v-bind="grid" class="ivu-mb" v-if="checkPermi(['admin:system:config:info'])">
<el-card :bordered="false">
<router-link :to="{path:'/operation/setting'}">
<i class="el-icon-setting" style="color:#95de64" />
@@ -17,7 +17,7 @@
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-col v-bind="grid" class="ivu-mb" v-if="checkPermi(['admin:product:list'])">
<el-card :bordered="false">
<router-link :to="{path:'/store/index'}">
<i class="el-icon-goods" style="color:#ff9c6e" />
@@ -25,7 +25,7 @@
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-col v-bind="grid" class="ivu-mb" v-if="checkPermi(['admin:order:list'])">
<el-card :bordered="false">
<router-link :to="{path:'/order/index'}">
<i class="el-icon-s-order" style="color:#b37feb" />
@@ -33,7 +33,7 @@
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-col v-bind="grid" class="ivu-mb" v-if="checkPermi(['admin:pass:login'])">
<el-card :bordered="false">
<router-link :to="{path:'/operation/systemSms/config'}">
<i class="el-icon-message" style="color:#ffd666" />
@@ -41,7 +41,7 @@
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-col v-bind="grid" class="ivu-mb" v-if="checkPermi(['admin:article:list'])">
<el-card :bordered="false">
<router-link :to="{path:'/content/articleManager'}">
<i class="el-icon-notebook-1" style="color:#5cdbd3" />
@@ -49,7 +49,7 @@
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-col v-bind="grid" class="ivu-mb" v-if="checkPermi(['admin:retail:list'])">
<el-card :bordered="false">
<router-link :to="{path:'/distribution/index'}">
<i class="el-icon-s-finance" style="color:#ff85c0" />
@@ -57,7 +57,7 @@
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-col v-bind="grid" class="ivu-mb" v-if="checkPermi(['admin:coupon:list'])">
<el-card :bordered="false">
<router-link :to="{path:'/marketing/coupon/list'}">
<i class="el-icon-s-ticket" style="color:#ffc069" />
@@ -69,6 +69,7 @@
</div>
</template>
<script>
import { checkPermi } from "@/utils/permission";
export default {
data () {
return {
@@ -80,12 +81,15 @@
xs: 8
}
}
},
methods:{
checkPermi
}
}
</script>
<style lang="scss" scoped>
.ivu-mb{
margin-bottom: 10px;
// margin-bottom: 10px;
}
.divBox {
padding: 0 20px !important;

View File

@@ -1,35 +1,22 @@
<template>
<div class="divBox">
<el-row :gutter="24">
<el-col :xl="16" :lg="12" :md="24" :sm="24" :xs="24" class="ivu-mb mb10 dashboard-console-visit">
<el-col class="ivu-mb mb10 dashboard-console-visit">
<el-card :bordered="false" dis-hover>
<div slot="header">
<div class="acea-row row-middle">
<el-avatar icon="el-icon-s-operation" size="small" style="color:#1890ff;background:#e6f7ff;font-size: 13px"/>
<span class="ivu-pl-8">用户</span>
<div class="header_title">用户统计</div>
</div>
</div>
<echarts-from ref="userChart" :echartsTitle="line" :xAxis="xAxis" :seriesData="series" v-if="infoList"></echarts-from>
</el-card>
</el-col>
<el-col :xl="8" :lg="12" :md="24" :sm="24" :xs="24">
<el-card :bordered="false" dis-hover class="dashboard-console-visit">
<div slot="header">
<div class="acea-row row-middle">
<el-avatar icon="el-icon-picture-outline-round" size="small" style="color:#1890ff;background:#e6f7ff;font-size: 13px" />
<span class="ivu-pl-8">购买用户统计</span>
</div>
</div>
<echarts-from ref="visitChart" :echartsTitle="circle" :legendData="legendData"
:seriesData="seriesUser" v-if="chartBuy"></echarts-from>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import {chartUserApi, chartBuyApi} from '@/api/dashboard';
import {chartUserApi} from '@/api/dashboard';
import echartsFrom from '@/components/echarts/index';
export default {
@@ -83,41 +70,6 @@
// this.bing_xdata = res.bing_xdata;
})
},
// 用户购买统计
getRank() {
chartBuyApi().then(async res => {
this.chartBuy = res
this.legendData = ["未消费用户", "消费一次用户", "留存客户", "回流客户"]
this.seriesUser = [{
"name": "未消费用户",
"value": res.zero,
"itemStyle": {
"color": "#5cadff"
}
},
{
"name": "消费一次用户",
"value": res.one,
"itemStyle": {
"color": "#b37feb"
}
},
{
"name": "留存客户",
"value": res.history,
"itemStyle": {
"color": "#19be6b"
}
},
{
"name": "回流客户",
"value": res.back,
"itemStyle": {
"color": "#ff9900"
}
}]
})
},
// 监听页面宽度变化,刷新表格
handleResize() {
if (this.infoList && this.series.length !== 0) this.$refs.userChart.handleResize();
@@ -126,7 +78,6 @@
},
mounted() {
this.getStatistics();
this.getRank();
},
beforeDestroy() {
if (this.visitChart) {
@@ -145,6 +96,23 @@
line-height: 22px;
}
}
.header_title{
font-size: 16px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #000000;
padding-left:8px;
position: relative;
&::before{
position: absolute;
content: '';
width: 2px;
height: 18px;
background: #1890FF;
top:0;
left:0;
}
}
.ivu-pl-8{
margin-left: 8px;
font-size: 14px;

View File

@@ -1,20 +1,21 @@
<template>
<div class="divBox">
<el-row :gutter="24">
<el-col san="24" class="ivu-mb">
<el-row :gutter="24" v-if="checkPermi(['admin:statistics:home:chart:order','admin:statistics:home:chart:order:week','admin:statistics:home:chart:order:month','admin:statistics:home:chart:order:year'])" >
<el-col san="24">
<el-card :bordered="false" class="dashboard-console-visit">
<div slot="header">
<div class="acea-row row-between-wrapper">
<div class="acea-row row-middle">
<el-avatar icon="el-icon-s-data" size="small" style="color:#1890ff;background:#e6f7ff;font-size: 13px" />
<span class="ivu-pl-8">订单</span>
<!-- <el-avatar icon="el-icon-s-data" size="small" style="color:#1890ff;background:#e6f7ff;font-size: 13px" />
<span class="ivu-pl-8">订单</span> -->
<div class="header_title">订单统计</div>
</div>
<div class="checkTime">
<el-radio-group v-model="visitDate" class="ivu-mr-8">
<el-radio label="last30" @change="handleChangeVisitType">30天</el-radio>
<el-radio label="week" @change="handleChangeWeek"></el-radio>
<el-radio label="month" @change="handleChangeMonth"></el-radio>
<el-radio label="year" @change="handleChangeYear"></el-radio>
<el-radio-group v-model="visitDate" class="ivu-mr-8" @change="radioChange">
<el-radio-button label="last30">30</el-radio-button>
<el-radio-button label="week"></el-radio-button>
<el-radio-button label="month"></el-radio-button>
<el-radio-button label="year"></el-radio-button>
</el-radio-group>
</div>
</div>
@@ -29,6 +30,7 @@
<script>
import { chartOrder30Api, chartOrderWeekApi, chartOrderMonthApi, chartOrderYearApi } from '@/api/dashboard';
import echartsFrom from '@/components/echarts/index';
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
components: {echartsFrom},
@@ -93,6 +95,23 @@
]
},
methods: {
checkPermi,
radioChange(val){
switch (val) {
case 'week':
this.handleChangeWeek();
break;
case 'month':
this.handleChangeMonth();
break;
case 'year':
this.handleChangeYear();
break;
default:
this.handleChangeVisitType();
break;
}
},
// 时间改变
handleChangeVisitType() {
this.xAxis = []
@@ -113,27 +132,8 @@
name:"订单金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#69cdff"
},
{
"offset":0.5,
"color":"#3eb3f7"
},
{
"offset":1,
"color":"#1495eb"
}
]
}
normal:{
color:'#5B8FF9',
}
},
data: pices
@@ -141,29 +141,11 @@
{
name:"订单数",
type:"line",
smooth: true,
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#6fdeab"
},
{
"offset":0.5,
"color":"#44d693"
},
{
"offset":1,
"color":"#2cc981"
}
]
}
}
normal:{
color:'#4BCAD5',
}
},
yAxisIndex: 1,
data: qualitys
@@ -198,27 +180,8 @@
name :"上周金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#69cdff"
},
{
"offset":0.5,
"color":"#3eb3f7"
},
{
"offset":1,
"color":"#1495eb"
}
]
}
normal:{
color:'#5B8FF9',
}
},
data: prePrice
@@ -227,57 +190,16 @@
name:"本周金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#69cdff"
},
{
"offset":0.5,
"color":"#3eb3f7"
},
{
"offset":1,
"color":"#1495eb"
}
]
}
}
normal:{color:'#4BCAD5',}
},
data: price
},
{
name:"上周订单数",
type:"line",
smooth: true,
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#6fdeab"
},
{
"offset":0.5,
"color":"#44d693"
},
{
"offset":1,
"color":"#2cc981"
}
]
}
}
normal:{color:'#E6A23C',}
},
yAxisIndex: 1,
data: preQuality
@@ -285,29 +207,9 @@
{
name:"本周订单数",
type:"line",
smooth: true,
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#6fdeab"
},
{
"offset":0.5,
"color":"#44d693"
},
{
"offset":1,
"color":"#2cc981"
}
]
}
}
normal:{color:'#768A9C',}
},
yAxisIndex: 1,
data: qualitys
@@ -344,26 +246,7 @@
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#69cdff"
},
{
"offset":0.5,
"color":"#3eb3f7"
},
{
"offset":1,
"color":"#1495eb"
}
]
}
color:'#5B8FF9',
}
},
data: prePrice
@@ -373,26 +256,7 @@
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#69cdff"
},
{
"offset":0.5,
"color":"#3eb3f7"
},
{
"offset":1,
"color":"#1495eb"
}
]
}
color:'#4BCAD5'
}
},
data: price
@@ -400,28 +264,10 @@
{
name:"上月订单数",
type:"line",
smooth: true,
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#6fdeab"
},
{
"offset":0.5,
"color":"#44d693"
},
{
"offset":1,
"color":"#2cc981"
}
]
}
color:'#E6A23C'
}
},
yAxisIndex: 1,
@@ -430,28 +276,10 @@
{
name:"本月订单数",
type:"line",
smooth: true,
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#6fdeab"
},
{
"offset":0.5,
"color":"#44d693"
},
{
"offset":1,
"color":"#2cc981"
}
]
}
color:'#768A9C'
}
},
yAxisIndex: 1,
@@ -483,32 +311,13 @@
for (let key in res.quality) {
qualitys.push(Number(res.quality[key]))
}
this.series = [
this.series = [ ////let col = ["#B37FEB", "#FFAB2B", "#1890FF", "#00C050"];
{
name:"去年金额",
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#69cdff"
},
{
"offset":0.5,
"color":"#3eb3f7"
},
{
"offset":1,
"color":"#1495eb"
}
]
}
color:'#5B8FF9'
}
},
data: prePrice
@@ -518,26 +327,7 @@
type:"bar",
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#69cdff"
},
{
"offset":0.5,
"color":"#3eb3f7"
},
{
"offset":1,
"color":"#1495eb"
}
]
}
color:'#4BCAD5'
}
},
data: price
@@ -545,28 +335,10 @@
{
name:"去年订单数",
type:"line",
smooth: true,
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#6fdeab"
},
{
"offset":0.5,
"color":"#44d693"
},
{
"offset":1,
"color":"#2cc981"
}
]
}
color:'#E6A23C'
}
},
yAxisIndex: 1,
@@ -575,28 +347,10 @@
{
name:"今年订单数",
type:"line",
smooth: true,
itemStyle:{
"normal":{
"color":{
"x":0,
"y":0,
"x2":0,
"y2":1,
"colorStops":[
{
"offset":0,
"color":"#6fdeab"
},
{
"offset":0.5,
"color":"#44d693"
},
{
"offset":1,
"color":"#2cc981"
}
]
}
color:'#768A9C'
}
},
yAxisIndex: 1,
@@ -623,6 +377,23 @@
line-height: 22px;
}
}
.header_title{
font-size: 16px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #000000;
padding-left:8px;
position: relative;
&::before{
position: absolute;
content: '';
width: 2px;
height: 18px;
background: #1890FF;
top:0;
left:0;
}
}
.checkTime{
/deep/.el-radio__input{
display: none;

View File

@@ -1,39 +1,34 @@
<template>
<div>
<!--头部-->
<base-info ref="baseInfo"/>
<base-info ref="baseInfo" v-if="checkPermi(['admin:statistics:home:index'])" />
<!--小方块-->
<grid-menu class="mb20"/>
<!--订单统计-->
<visit-chart ref="visitChart"/>
<!--用户-->
<user-chart ref="userChart" class="mb20"/>
<user-chart ref="userChart" class="mb20" v-if="checkPermi(['admin:statistics:home:chart:user'])" />
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import baseInfo from './components/baseInfo';
import baseInfo from './components/baseInfo';
import gridMenu from './components/gridMenu';
import visitChart from './components/visitChart';
import userChart from './components/userChart';
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'Dashboard',
components: { baseInfo, gridMenu, visitChart, userChart },
components: { baseInfo, gridMenu, visitChart, userChart},
data() {
return {
currentRole: 'adminDashboard'
authStatus:null,
authHost:'',
authQueryStatus:false
}
},
computed: {
...mapGetters([
'roles'
])
methods:{
checkPermi,
},
created() {
if (!this.roles.includes('admin')) {
this.currentRole = 'editorDashboard'
}
}
}
</script>

View File

View File

@@ -1,15 +0,0 @@
<template>
<div>
<router-view />
</div>
</template>
<script>
export default {
}
</script>
<style lang="sass" scoped>
</style>

View File

@@ -1,13 +0,0 @@
<template>
<div>商品数据</div>
</template>
<script>
export default {
}
</script>
<style lang="sass" scoped>
</style>

View File

@@ -1,15 +0,0 @@
<template>
<div>
<router-view />
</div>
</template>
<script>
export default {
}
</script>
<style lang="sass" scoped>
</style>

View File

@@ -1,13 +0,0 @@
<template>
<div>订单数据</div>
</template>
<script>
export default {
}
</script>
<style lang="sass" scoped>
</style>

View File

@@ -1,7 +1,7 @@
<template>
<div class="divBox">
<el-card class="box-card">
<el-form ref="promoterForm" :model="promoterForm" :rules="rules" label-width="200px" class="demo-promoterForm">
<el-form ref="promoterForm" :model="promoterForm" :rules="rules" label-width="200px" class="demo-promoterForm" v-loading="loading">
<el-form-item prop="brokerageFuncStatus">
<span slot="label">
<span>分销启用</span>
@@ -14,7 +14,20 @@
<el-radio label="0">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="storeBrokerageStatus">
<el-form-item prop="storeBrokerageQuota">
<span slot="label">
<span>满额分销最低金额</span>
<el-tooltip class="item" effect="dark" content="满额分销满足金额开通分销权限" placement="top-start">
<i class="el-icon-warning-outline" />
</el-tooltip>
</span>
<el-input-number
v-model="promoterForm.storeBrokerageQuota"
placeholder="满额分销满足金额开通分销权限" :min="-1"
:step="1" class="selWidth"
@keydown.native="channelInputLimit"></el-input-number>
</el-form-item>
<!-- <el-form-item prop="storeBrokerageStatus">
<span slot="label">
<span>分销模式</span>
<el-tooltip class="item" effect="dark" content="人人分销”默认每个人都可以分销,“指定分销”仅可后台手动设置推广员" placement="top-start">
@@ -24,9 +37,8 @@
<el-radio-group v-model="promoterForm.storeBrokerageStatus">
<el-radio label="1">指定分销</el-radio>
<el-radio label="2">人人分销</el-radio>
<!--<el-radio label="3">满额分销</el-radio>-->
</el-radio-group>
</el-form-item>
</el-form-item> -->
<el-form-item prop="brokerageBindind">
<span slot="label">
<span>分销关系绑定</span>
@@ -38,6 +50,18 @@
<el-radio label="0">所有用户</el-radio>
<el-radio label="1">新用户</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="storeBrokerageIsBubble">
<span slot="label">
<span>分销气泡</span>
<el-tooltip class="item" effect="dark" content="基础商品详情页分销气泡功能开启关闭" placement="top-start">
<i class="el-icon-warning-outline" />
</el-tooltip>
</span>
<el-radio-group v-model="promoterForm.storeBrokerageIsBubble">
<el-radio label="1">开启</el-radio>
<el-radio label="0">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="storeBrokerageRatio">
<span slot="label">
@@ -66,7 +90,7 @@
<i class="el-icon-warning-outline" />
</el-tooltip>
</span>
<el-input-number v-model="promoterForm.userExtractMinPrice" :min="0" :precision="2" :step="0.1" class="selWidth" placeholder="用户提现最低金额"></el-input-number>
<el-input-number v-model="promoterForm.userExtractMinPrice" :min="0" :step="1" class="selWidth" placeholder="用户提现最低金额"></el-input-number>
</el-form-item>
<el-form-item prop="userExtractBank">
<span slot="label">
@@ -91,17 +115,8 @@
</span>
<el-input-number v-model="promoterForm.extractTime" :min="0" class="selWidth" placeholder="佣金冻结时间(天)"></el-input-number>
</el-form-item>
<!--<el-form-item prop="storeBrokeragePrice">-->
<!--<span slot="label">-->
<!--<span>满额分销最低金额</span>-->
<!--<el-tooltip class="item" effect="dark" content="满额分销满足金额开通分销权限" placement="top-start">-->
<!--<i class="el-icon-warning-outline" />-->
<!--</el-tooltip>-->
<!--</span>-->
<!--<el-input-number v-model="promoterForm.storeBrokeragePrice" placeholder="满额分销满足金额开通分销权限" :min="0" :precision="2" :step="0.1" class="selWidth"></el-input-number>-->
<!--</el-form-item>-->
<el-form-item>
<el-button size="mini" type="primary" :loading="loading" @click="submitForm('promoterForm')">提交</el-button>
<el-button type="primary" :loading="loading" @click="submitForm('promoterForm')" v-hasPermi="['admin:retail:spread:manage:set']">提交</el-button>
</el-form-item>
</el-form>
</el-card>
@@ -111,12 +126,14 @@
<script>
import { configApi, configUpdateApi, productCheckApi } from '@/api/distribution'
import * as selfUtil from '@/utils/ZBKJIutil.js'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
import {Debounce} from '@/utils/validate'
export default {
name: 'Index',
data() {
return {
promoterForm: {},
loading: false,
loading: true,
rules: {
brokerageFuncStatus: [
{ required: true, message: '请选择是否启用分销', trigger: 'change' }
@@ -134,14 +151,29 @@
this.getDetal()
},
methods: {
checkPermi,
channelInputLimit(e){
let key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
getDetal() {
this.loading = true;
configApi().then(res => {
this.promoterForm = res
this.loading = false;
this.promoterForm = res;
this.promoterForm.storeBrokerageIsBubble = res.storeBrokerageIsBubble.toString();
this.promoterForm.brokerageFuncStatus = res.brokerageFuncStatus.toString();
this.promoterForm.brokerageBindind = res.brokerageBindind.toString();
}).catch((res) => {
this.$message.error(res.message)
})
},
submitForm(formName) {
submitForm:Debounce(function(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(selfUtil.Add(this.promoterForm.storeBrokerageRatio,this.promoterForm.storeBrokerageTwo)>100) return this.$message.warning('返佣比例相加不能超过100%')
@@ -156,14 +188,14 @@
// this.$message.error(message)
// })
// })
}).catch((res) => {
}).catch((err) => {
this.loading = false
})
} else {
return false
}
})
}
})
}
}
</script>

View File

@@ -17,7 +17,7 @@
</el-form-item>
</el-form>
</div>
<cards-data :cardLists="cardLists"></cards-data>
<!-- <cards-data :cardLists="cardLists"></cards-data> -->
</div>
<el-table
v-loading="listLoading"
@@ -99,6 +99,18 @@
:sort-method="(a,b)=>{return a.brokeragePrice - b.brokeragePrice}"
prop="brokeragePrice"
/>
<el-table-column
sortable
label="冻结中佣金"
min-width="120"
:sort-method="(a,b)=>{return a.freezeBrokeragePrice - b.freezeBrokeragePrice}"
prop="freezeBrokeragePrice"
/>
<el-table-column
prop="promoterTime"
label="成为推广员时间"
min-width="150"
/>
<el-table-column
prop="spreadNickname"
label="上级推广人"
@@ -106,15 +118,15 @@
/>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" class="mr10" @click="onSpread(scope.row.uid, 'man','推广人')">推广人</el-button>
<el-button type="text" size="small" class="mr10" @click="onSpread(scope.row.uid, 'man','推广人')" v-hasPermi="['admin:retail:spread:list']">推广人</el-button>
<el-dropdown>
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="onSpreadOrder(scope.row.uid, 'order','推广订单')">推广订单</el-dropdown-item>
<el-dropdown-item @click.native="onSpreadOrder(scope.row.uid, 'order','推广订单')" v-if="checkPermi(['admin:retail:spread:order:list'])">推广订单</el-dropdown-item>
<!--<el-dropdown-item @click.native="onSpreadType(scope.row.uid)">推广方式</el-dropdown-item>-->
<el-dropdown-item @click.native="clearSpread(scope.row)" v-if="scope.row.spreadNickname && scope.row.spreadNickname!=='无'">清除上级推广人</el-dropdown-item>
<el-dropdown-item @click.native="clearSpread(scope.row)" v-if="scope.row.spreadNickname && scope.row.spreadNickname!=='无'" v-hasPermi="['admin:retail:spread:clean']">清除上级推广人</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@@ -275,6 +287,7 @@
<script>
import { promoterListApi, spreadStatisticsApi, spreadListApi, spreadOrderListApi, spreadClearApi } from '@/api/distribution'
import cardsData from '@/components/cards/index'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'AccountsUser',
components: { cardsData },
@@ -315,26 +328,27 @@
}
},
mounted() {
this.spreadStatistics()
// this.spreadStatistics()
this.getList()
},
methods: {
checkPermi,
seachList() {
this.tableFrom.page = 1
this.getList()
},
// 统计
spreadStatistics() {
spreadStatisticsApi({ dateLimit: this.tableFrom.dateLimit, keywords: this.tableFrom.nickName}).then((res) => {
this.cardLists = [
{ name: '分销人员人数', count: res.distributionNum },
{ name: '发展会员人数', count: res.developNum },
{ name: '推广总数', count: res.orderNum },
{ name: '推广金额(元)', count: res.orderPriceCount },
{ name: '提现次数', count: res.withdrawCount }
]
})
},
// spreadStatistics() {
// spreadStatisticsApi({ dateLimit: this.tableFrom.dateLimit, keywords: this.tableFrom.nickName}).then((res) => {
// this.cardLists = [
// { name: '分销人员人数', count: res.distributionNum },
// { name: '发展会员人数', count: res.developNum },
// { name: '推广订单总数', count: res.orderNum },
// { name: '推广订单金额(元)', count: res.orderPriceCount },
// { name: '提现次数', count: res.withdrawCount }
// ]
// })
// },
// 清除
clearSpread(row) {
this.$modalSure('解除【' + row.nickname + '】的上级推广人吗').then(() => {
@@ -429,7 +443,7 @@
this.tableFrom.dateLimit = tab
this.tableFrom.page = 1
this.timeVal = []
this.spreadStatistics()
// this.spreadStatistics()
this.getList()
},
// 具体日期

View File

@@ -19,7 +19,7 @@
</router-link>
</li>
<li class="link-type">
<a href="https://www.taobao.com/">随便看看</a>
<a href="https://www.crmeb.com/">随便看看</a>
</li>
<li><a href="#" @click.prevent="dialogVisible=true">点我看图</a></li>
</ul>

View File

@@ -3,23 +3,19 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" label-width="100px" :inline="true">
<el-form-item label="关键字:">
<el-input v-model="tableFrom.keywords" placeholder="昵称/ID" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="getList(1)" />
</el-input>
</el-form-item>
<el-form-item label="佣金范围:">
<el-col :span="11">
<el-input v-model="tableFrom.min" placeholder="请输入最小金额" type="number" clearable></el-input>
</el-col>
<el-col class="line" :span="2" style="text-align: center;">-</el-col>
<el-col :span="11">
<el-input v-model="tableFrom.max" placeholder="请输入最大金额" type="number" clearable></el-input>
</el-col>
<el-form label-width="100px" :inline="true">
<el-form-item>
<el-select v-model="tableFrom.type" clearable placeholder="请选择">
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getList(1)" size="mini">查询</el-button>
<el-button type="primary" @click="getList(1)" size="small">查询</el-button>
</el-form-item>
</el-form>
</div>
@@ -33,44 +29,31 @@
highlight-current-row
>
<el-table-column
prop="uid"
label="会员ID"
prop="id"
label="ID"
width="80"
/>
<el-table-column label="佣金变动" min-width="100">
<template slot-scope="scope">
<span :class="scope.row.type == 1 ? 'color_red': 'color_green'">{{scope.row.type == 1 ? '+' : '-' }}{{scope.row.price}}</span>
</template>
</el-table-column>
<el-table-column
prop="nickname"
label="昵称"
min-width="130"
/>
<el-table-column
sortable
prop="totalBrokerage"
label="总佣金金额"
min-width="120"
/>
<el-table-column
sortable
label="账户余额"
min-width="100"
prop="nowMoney"
/>
<el-table-column
sortable
:default-sort = "{prop: 'brokerage', order: 'descending'}"
prop="brokerage"
label="账户佣金"
min-width="100"
/>
<el-table-column
sortable
prop="totalExtract"
label="到账佣金"
prop="mark"
label="变动信息"
min-width="150"
/>
<el-table-column label="操作" min-width="130" fixed="right">
<template slot-scope="scope">
<el-button size="small" type="text" @click="handlerOpenInfo(scope.row)">详情</el-button>
</template>
<el-table-column
label="变动类型"
min-width="130"
prop="title"
/>
<el-table-column
prop="userName"
label="用户信息"
min-width="150"
/>
<el-table-column label="时间" min-width="130" prop="updateTime">
</el-table-column>
</el-table>
<div class="block">
@@ -85,75 +68,11 @@
/>
</div>
</el-card>
<el-dialog
title="佣金详情"
:visible.sync="Visible"
width="900px"
v-if="Visible"
:before-close="Close">
<div>
<div class="acea-row row-middle" v-if="userDetail">
<div class="dashboard-workplace-header-tip-desc">
<span class="dashboard-workplace-header-tip-desc-sp">姓名: {{ userDetail.nickname }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">上级推广人: {{ userDetail.spreadName | filterEmpty }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">佣金总收入: {{ userDetail.totalBrokerage }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">账户余额: {{ userDetail.nowMoney }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">创建时间: {{ userDetail.createTime }}</span>
</div>
</div>
<el-divider></el-divider>
<el-form size="small" label-position="left" label-width="90px">
<el-form-item label="时间选择:" class="width100">
<el-radio-group v-model="userTableFrom.dateLimit" type="button" class="mr20" size="small" @change="selectChangeUser(userTableFrom.dateLimit)">
<el-radio-button v-for="(item,i) in fromList.fromTxt" :key="i" :label="item.val">{{ item.text }}</el-radio-button>
</el-radio-group>
<el-date-picker v-model="timeValUser" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTimeUser" />
</el-form-item>
</el-form>
<el-divider></el-divider>
<el-table
v-loading="tablistLoading"
:data="userDetailData.data"
style="width: 100%"
size="mini"
class="table"
highlight-current-row
>
<el-table-column
prop="price"
label="佣金金额"
min-width="100"
/>
<el-table-column
prop="updateTime"
label="获得时间"
min-width="120"
/>
<el-table-column
label="备注"
min-width="150"
prop="mark"
/>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[10, 20, 30, 40]"
:page-size="userTableFrom.limit"
:current-page="userTableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="userDetailData.total"
@size-change="userHandleSizeChange"
@current-change="userPageChange"
/>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { brokerageListApi, monitorListDetailApi } from '@/api/financial'
import { brokerageListApi } from '@/api/financial'
export default {
name: 'AccountsCapital',
data() {
@@ -163,15 +82,9 @@
data: [],
total: 0
},
userDetailData: {
data: [],
total: 0
},
listLoading: true,
tableFrom: {
min: '',
max: '',
keywords: '',
type:'',
page: 1,
limit: 20
},
@@ -182,10 +95,13 @@
},
fromList: this.$constants.fromList,
options: [],
Visible: false,
tablistLoading: false,
userDetail: {},
timeValUser: []
typeOptions:[
{ value: 1, label: '订单返佣'},
{ value: 2, label: '申请提现'},
{ value: 3, label: '提现失败'},
{ value: 4, label: '提现成功'},
{ value: 5, label: '佣金转余额'},
],
}
},
mounted() {
@@ -193,47 +109,6 @@
this.getList()
},
methods: {
Close(){
this.Visible = false
},
handlerOpenInfo(row){
this.userDetail = row
this.Visible = true
this.tablistLoading = true
this.userTableFrom.limit = 10
this.getUserList()
},
getUserList(num){
this.userTableFrom.page = num ? num : this.userTableFrom.page;
monitorListDetailApi(this.userDetail.uid, this.userTableFrom).then(res => {
this.userDetailData.data = res.list
this.userDetailData.total = res.total
this.tablistLoading = false
}).catch((res) => {
this.tablistLoading = false
})
},
selectChangeUser (tab) {
this.userTableFrom.dateLimit = tab
this.timeValUser = []
this.userTableFrom.page = 1;
this.getUserList()
},
userPageChange(page) {
this.userTableFrom.page = page
this.getUserList()
},
userHandleSizeChange(val) {
this.userTableFrom.limit = val
this.getUserList()
},
// 具体日期
onchangeTimeUser(e) {
this.timeValUser = e
this.userTableFrom.dateLimit = e ? this.timeValUser.join(',') : ''
this.userTableFrom.page = 1;
this.getUserList()
},
// 列表
getList(num) {
this.listLoading = true
@@ -326,4 +201,10 @@
.selWidth{
width: 300px;
}
.color_red{
color:#F5222D;
}
.color_green{
color:#7ABE5C;
}
</style>

View File

@@ -1,10 +1,10 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="clearfix">
<div class="container">
<el-form size="small" label-width="100px">
<el-form-item label="时间选择:" class="width100">
<el-form-item label="时间选择:" class="width100">
<el-radio-group v-model="tableFrom.dateLimit" type="button" class="mr20" size="small" @change="selectChange(tableFrom.dateLimit)">
<el-radio-button v-for="(item,i) in fromList.fromTxt" :key="i" :label="item.val">{{ item.text }}</el-radio-button>
</el-radio-group>
@@ -33,9 +33,13 @@
</el-form-item>
</el-form>
</div>
<cards-data :cardLists="cardLists"></cards-data>
</div>
<el-table
</el-card>
<div class="mt20">
<cards-data :cardLists="cardLists" v-if="checkPermi(['admin:finance:apply:balance'])"></cards-data>
</div>
<el-card class="box-card">
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
@@ -119,8 +123,8 @@
<span class="spBlock">{{ scope.row.status | extractStatusFilter }}</span>
<span v-if="scope.row.status === -1">拒绝原因{{scope.row.failMsg}}</span>
<template v-if="scope.row.status === 0">
<el-button type="danger" icon="el-icon-close" size="mini" @click="onExamine(scope.row.id)">未通过</el-button>
<el-button type="primary" icon="el-icon-check" size="mini" @click="ok(scope.row.id)">通过</el-button>
<el-button type="danger" icon="el-icon-close" size="mini" @click="onExamine(scope.row.id)" v-hasPermi="['admin:finance:apply:apply']">未通过</el-button>
<el-button type="primary" icon="el-icon-check" size="mini" @click="ok(scope.row.id)" v-hasPermi="['admin:finance:apply:apply']">通过</el-button>
</template>
</template>
</el-table-column>
@@ -139,7 +143,7 @@
/>
<el-table-column label="操作" min-width="80" fixed="right" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.status !== 1" type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.status !== 1" type="text" size="small" @click="handleEdit(scope.row)" v-hasPermi="['admin:finance:apply:update']">编辑</el-button>
<span v-else></span>
</template>
</el-table-column>
@@ -155,7 +159,7 @@
@current-change="pageChange"
/>
</div>
</el-card>
</el-card>
<!--编辑-->
<el-dialog
@@ -198,6 +202,8 @@
import { applyListApi, applyBalanceApi, applyUpdateApi, applyStatusApi } from '@/api/financial'
import cardsData from '@/components/cards/index'
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
import {Debounce} from '@/utils/validate'
export default {
name: 'AccountsExtract',
components: {
@@ -234,6 +240,7 @@
this.getBalance()
},
methods: {
checkPermi,
resetForm(){
this.dialogVisible = false;
},
@@ -244,7 +251,7 @@
this.isCreate = 1;
this.editData = JSON.parse(JSON.stringify(row));
},
handlerSubmit(formValue) {
handlerSubmit:Debounce(function(formValue) {
formValue.id = this.applyId;
formValue.extractType = this.extractType;
applyUpdateApi(formValue).then(data => {
@@ -252,7 +259,7 @@
this.dialogVisible = false
this.getList()
})
},
}),
handleClose() {
this.dialogVisible = false
this.editData = {}
@@ -297,10 +304,10 @@
getBalance() {
applyBalanceApi({dateLimit: this.tableFrom.dateLimit}).then(res => {
this.cardLists = [
{ name: '待提现金额', count: res.toBeWithdrawn },
{ name: '佣金总金额', count: res.commissionTotal },
{ name: '已提现金额', count: res.withdrawn },
{ name: '未提现金额', count: res.unDrawn }
{ name: '待提现金额', count: res.toBeWithdrawn,color:'#1890FF',class:'one',icon:'iconzhichujine1' },
{ name: '佣金总金额', count: res.commissionTotal,color:'#A277FF',class:'two',icon:'iconzhifuyongjinjine1' },
{ name: '已提现金额', count: res.withdrawn,color:'#EF9C20',class:'three',icon:'iconyingyee1' },
{ name: '未提现金额', count: res.unDrawn,color:'#1BBE6B',class:'four',icon:'iconyuezhifujine2' }
]
})
},

View File

@@ -1,7 +1,7 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="clearfix">
<div class="container">
<el-form size="small" label-width="100px" inline>
<el-form-item label="时间选择:" class="width100">
@@ -10,13 +10,6 @@
</el-radio-group>
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
</el-form-item>
<!--<el-form-item label="是否支付:">-->
<!--<el-radio-group v-model="tableFrom.paid" type="button" size="small" @change="getList(1)">-->
<!--<el-radio-button label="">全部</el-radio-button>-->
<!--<el-radio-button label="1">已支付</el-radio-button>-->
<!--<el-radio-button label="0">未支付</el-radio-button>-->
<!--</el-radio-group>-->
<!--</el-form-item>-->
<el-form-item label="用户id">
<el-input v-model="tableFrom.uid" placeholder="用户id" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="getList(1)" />
@@ -29,8 +22,12 @@
</el-form-item>
</el-form>
</div>
<cards-data :card-lists="cardLists" />
</div>
</el-card>
<div class="mt20">
<cards-data :card-lists="cardLists" v-if="checkPermi(['admin:recharge:balance'])" />
</div>
<el-card class="box-card">
<el-table
v-loading="listLoading"
:data="tableData.data"
@@ -81,14 +78,6 @@
prop="givePrice"
:sort-method="(a,b)=>{return a.givePrice - b.givePrice}"
/>
<!--<el-table-column-->
<!--label="是否支付"-->
<!--min-width="80"-->
<!--&gt;-->
<!--<template slot-scope="scope">-->
<!--<span class="spBlock">{{ scope.row.paid | payStatusFilter }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column
label="充值类型"
min-width="80"
@@ -105,12 +94,6 @@
<span class="spBlock">{{ scope.row.payTime || '无' }}</span>
</template>
</el-table-column>
<!--<el-table-column label="操作" min-width="120" fixed="right" align="center">-->
<!--<template slot-scope="scope">-->
<!--<el-button type="text" size="small" @click="handleDelete(scope.row)" v-if="!scope.row.paid">删除</el-button>-->
<!--<el-button type="text" size="small" @click="handleRefund(scope.row)" v-if="parseFloat(scope.row.refundPrice) <= 0 && scope.row.paid">退款</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
<div class="block">
<el-pagination
@@ -146,6 +129,7 @@
import { topUpLogListApi, balanceApi, topUpLogDeleteApi, refundApi } from '@/api/financial'
import cardsData from '@/components/cards/index'
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'AccountsBill',
components: { cardsData, zbParser },
@@ -177,6 +161,7 @@
this.getStatistics()
},
methods: {
checkPermi,
resetForm(formValue) {
this.handleClose();
},
@@ -246,10 +231,9 @@
balanceApi().then(res => {
const stat = res
this.cardLists = [
{ name: '充值总金额', count: stat.total, icon: 'el-icon-s-goods' },
{ name: '充值退款金额', count: stat.refund, icon: 'el-icon-s-order' },
{ name: '小程序充值金额', count: stat.routine, icon: 'el-icon-s-cooperation' },
{ name: '公众号充值金额', count: stat.weChat, icon: 'el-icon-s-finance' }
{ name: '充值总金额', count: stat.total, color:'#1890FF',class:'one',icon:'iconchongzhijine' },
{ name: '小程序充值金额', count: stat.routine, color:'#A277FF',class:'two',icon:'iconweixinzhifujine' },
{ name: '公众号充值金额', count: stat.weChat, color:'#EF9C20',class:'three',icon:'iconyuezhifujine1' }
]
})
}

View File

@@ -10,21 +10,21 @@
</el-radio-group>
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
</el-form-item>
<!--<el-form-item label="明细类型:">-->
<!--<el-select class="selWidth" v-model="tableFrom.type" filterable clearable placeholder="请选择" @change="getList(1)">-->
<!--<el-option-->
<!--v-for="(item, index) in optionList"-->
<!--:key="index"-->
<!--:label="item.title"-->
<!--:value="item.type"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="关键字:" class="width100">
<el-form-item label="关键字" class="width100">
<el-input v-model="tableFrom.keywords" placeholder="微信昵称/ID" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="getList(1)" />
</el-input>
</el-form-item>
<el-form-item label="明细类型">
<el-select v-model="tableFrom.title" size="small" clearable placeholder="请选择" @change="selectType">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</div>
@@ -47,12 +47,15 @@
min-width="130"
/>
<el-table-column
prop="number"
label="金额"
sortable
:sort-method="(a,b)=>{return a.number - b.number}"
min-width="120"
/>
>
<template slot-scope="scope">
<div>
<span :class="scope.row.pm == 1 ? 'color_red': 'color_green'">{{scope.row.pm == 1 ? '+' : '-' }}{{scope.row.number}}</span>
</div>
</template>>
</el-table-column>
<el-table-column
label="明细类型"
min-width="100"
@@ -97,28 +100,27 @@
},
listLoading: true,
tableFrom: {
// type: '',
title: '',
dateLimit: '',
keywords: '',
page: 1,
limit: 20
limit: 20,
},
categoryId: '',
fromList: this.$constants.fromList,
optionList: []
options:[
{value: 'recharge',label: '充值支付'},
{value: 'admin',label: '后台操作'},
{value: 'productRefund',label: '商品退款'},
{value: 'payProduct',label: '购买商品'},
]
}
},
mounted() {
// this.getTypes()
this.getOptionList()
this.getList()
},
methods: {
getOptionList() {
monitorListOptionApi().then(res => {
this.optionList = res
})
},
selectChange(tab) {
this.tableFrom.dateLimit = tab
this.timeVal = []
@@ -152,6 +154,9 @@
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
},
selectType(e){
this.getList();
}
}
}
@@ -161,4 +166,10 @@
.selWidth{
width: 300px;
}
.color_red{
color:#F5222D;
}
.color_green{
color:#7ABE5C;
}
</style>

View File

@@ -15,3 +15,4 @@ export default {
}
}
</script>

View File

@@ -599,4 +599,4 @@ export default {
right: 0;
bottom: 6px;
}
</style>
</style>

View File

@@ -1,24 +1,139 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div class="acea-row row-center-wrapper">
<el-button type="primary" @click="onClick">申请授权</el-button>
</div>
<div class="page_title">授权证书申请</div>
<div class="page_desc">您的支持是我们不断进步的动力商业授权更多是一个保障和附加的增值服务让您优先享受新版本的强大功能和安全保障</div>
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
<el-form-item label="企业名称" prop="company_name">
<el-input v-model="form.company_name" placeholder="请填写您的企业名称"></el-input>
</el-form-item>
<el-form-item label="企业域名" prop="domain_name">
<el-input v-model="form.domain_name" placeholder="请输入域名格式baidu.com"></el-input>
</el-form-item>
<el-form-item label="订单号" prop="order_id">
<el-input v-model="form.order_id" placeholder="请输入您在淘宝或小程序购买的源码订单号"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="form.phone" placeholder="负责人电话"></el-input>
</el-form-item>
<el-form-item label="授权产品">
<el-input value="java" disabled></el-input>
</el-form-item>
<el-form-item label="验证码" prop="captcha">
<div class="captcha">
<el-input
ref="username"
v-model="form.captcha"
style="width: 218px;"
prefix-icon="el-icon-message"
placeholder="验证码"
name="username"
type="text"
tabindex="3"
autocomplete="on"
/>
<div class="imgs" @click="getCaptcha()">
<img :src="captchs">
</div>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('form')">提交</el-button>
<el-button @click="resetForm('form')">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
name: "index",
methods:{
onClick() {
window.open('http://crmeb.com/web/auth/apply')
import {authCertSubmit} from '@/api/authInformation'
import {configSaveUniq} from '@/api/systemConfig'
import {Debounce} from '@/utils/validate'
export default {
name: "index",
data() {
return {
form: {
company_name: '',
domain_name:'',
order_id:'',
captcha:'',
phone:'',
label:22
},
captchs: 'http://authorize.crmeb.net/api/captchs/',
rules:{
company_name: [
{required: true, message: '请填写您的企业名称', trigger: 'blur'}
],
domain_name: [
{ required: true, message: '请输入域名格式baidu.com', trigger: 'blur' }
],
order_id: [
{ required: true, message: '请输入您购买的源码订单号', trigger: 'blur' }
],
phone: [
{ required: true, message: '请输入负责人电话', trigger: 'blur' }
],
captcha: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
]
}
}
}
},
mounted(){
this.getCaptcha();
},
methods: {
getCaptcha(){
this.captchs = this.captchs + Date.parse(new Date());
},
submitForm:Debounce(function(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
authCertSubmit(this.form).then(res=>{
if(res.status === 200){
this.$modal.msgSuccess(res.msg);
configSaveUniq({key:'authHost',value:this.form.domain_name})
}else{
this.$modal.msgError(res.msg);
}
}).catch(res => {
this.getCaptcha();
return this.$modal.msgError(res.msg);
})
} else {
return false;
}
});
}),
resetForm(formName) {
this.$refs[formName].resetFields();
}
},
};
</script>
<style scoped>
<style scoped lang="scss">
.page_title{
text-align: center;
font-size: 30px;
padding:20px 0 20px;
}
.page_desc{
font-size: 18px;
text-align: center;
margin-bottom: 40px;
}
.captcha{
display: flex;
align-items: flex-start;
}
.imgs{
margin-left:20px;
img{
height: 36px;
}
}
</style>

View File

@@ -20,7 +20,8 @@
<!-- </el-form-item>-->
</el-form>
</div>
<el-button type="primary" size="mini" @click="handlerOpenEditData({},0)" v-if="((formData.id==55 || formData.name==='签到天数配置') && dataList.list.length<7) || (formData.id!=55|| formData.name!=='签到天数配置')">添加数据</el-button>
<el-button type="primary" size="mini" @click="handlerOpenEditData({},0)" v-hasPermi="['admin:system:group:data:save']">添加数据</el-button>
<!-- v-if="((formData.id==55 || formData.name==='签到天数配置') && dataList.list.length<7) || (formData.id!=55|| formData.name!=='签到天数配置')" -->
<el-dialog
:title="editDataConfig.isCreate === 0?'添加数据':'编辑数据'"
:visible.sync="editDataConfig.visible"
@@ -39,6 +40,7 @@
<el-table
:data="dataList.list"
style="width: 100%;margin-bottom: 20px;"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column label="编号" prop="id" />
<el-table-column
@@ -65,8 +67,8 @@
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handlerOpenEditData(scope.row,1)">编辑</el-button>
<el-button type="text" size="small" @click="handlerDelete(scope.row)">删除</el-button>
<el-button type="text" size="small" @click="handlerOpenEditData(scope.row,1)" v-hasPermi="['admin:system:group:data:update','admin:system:group:data:info']">编辑</el-button>
<el-button type="text" size="small" @click="handlerDelete(scope.row)" v-if="formMark !== 99" v-hasPermi="['admin:system:group:data:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -110,7 +112,8 @@ export default {
editData: {}
},
formConf: { fields: [] },
dataList: { list: [], total: 0 }
dataList: { list: [], total: 0 },
formMark:0
}
},
mounted() {
@@ -145,6 +148,7 @@ export default {
handlerGetFormConfig() { // 获取表单配置后生成table列
const _pram = { id: this.formData.formId }
systemFormConfigApi.getFormConfigInfo(_pram).then(data => {
this.formMark = parseInt(data.id);
this.formConf = JSON.parse(data.content)
})
},

View File

@@ -7,12 +7,8 @@
<el-form-item
label="状态"
prop="status"
:rules="[{ required: true, message:'正确操作状态', trigger:['change'] }]"
>
<el-switch
v-model="selfForm.status"
/>
:rules="[{ required: true, message:'正确操作状态', trigger:['change'] }]">
<el-switch v-model="selfForm.status"/>
</el-form-item>
</el-form>
<parser
@@ -30,6 +26,7 @@
import parser from '@/components/FormGenerator/components/parser/Parser'
import * as systemGroupDataApi from '@/api/systemGroupData.js'
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
import {Debounce} from '@/utils/validate'
export default {
// name: "combineEdit"
components: { parser },
@@ -71,9 +68,9 @@ export default {
this.formConf = JSON.parse(data.content)
})
},
handlerSubmit(formValue) {
handlerSubmit:Debounce(function(formValue) {
this.isCreate === 0 ? this.handlerSave(formValue) : this.handlerEdit(formValue)
},
}),
handlerSave(formValue) {
const _pram = this.buildFormPram(formValue)
systemGroupDataApi.groupDataSave(_pram).then(data => {

View File

@@ -11,21 +11,22 @@
</el-form-item>
</el-form>
</div>
<el-button size="mini" type="primary" @click="handlerOpenEdit({},0)">添加数据组</el-button>
<el-button size="mini" type="primary" @click="handlerOpenEdit({},0)" v-hasPermi="['admin:system:group:save']">添加数据组</el-button>
</div>
<el-table
:data="dataList.list"
style="width: 100%;margin-bottom: 20px;"
size="mini"
highlight-current-row
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column label="数据组名称" prop="name" min-width="150"/>
<el-table-column label="简介" prop="info" min-width="150"/>
<el-table-column label="操作" fixed="right" min-width="180">
<template slot-scope="scope">
<el-button size="small" type="text" @click="handleDataList(scope.row)">数据列表</el-button>
<el-button size="small" type="text" @click="handlerOpenEdit(scope.row, 1)">编辑</el-button>
<el-button size="small" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-button size="small" type="text" @click="handleDataList(scope.row)" v-hasPermi="['admin:system:group:data:list']">数据列表</el-button>
<el-button size="small" type="text" @click="handlerOpenEdit(scope.row, 1)" v-hasPermi="['admin:system:group:info','admin:system:group:update']">编辑</el-button>
<el-button size="small" type="text" @click="handleDelete(scope.row)" v-hasPermi="['admin:system:group:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>

View File

@@ -37,6 +37,7 @@
<script>
import formConfigList from '@/views/maintain/formConfig'
import * as systemGroupApi from '@/api/systemGroup'
import {Debounce} from '@/utils/validate'
export default {
// name: "combinedDataEdit"
components: { formConfigList },
@@ -81,12 +82,12 @@ export default {
this.editPram.formId = this.selectedFormConfigData.id
this.selectFormDialogConfig.visible = false
},
handlerSubmit(form) {
handlerSubmit:Debounce(function(form) {
this.$refs[form].validate(result => {
if (!result) return
this.isCreate === 0 ? this.handlerSave(this.editPram) : this.handlerEdit(this.editPram)
})
},
}),
handlerSave(pram) {
systemGroupApi.groupSave(pram).then(data => {
this.$message.success('添加组合数据成功')

View File

@@ -53,6 +53,7 @@
<script>
import * as categoryApi from '@/api/categoryApi.js'
import * as selfUtil from '@/utils/ZBKJIutil.js'
import {Debounce} from '@/utils/validate'
export default {
// name: "configCategotyEdit"
props: {
@@ -120,12 +121,12 @@ export default {
this.editPram.extra = extra
}
},
handlerSubmit(formName) {
handlerSubmit:Debounce(function(formName) {
this.$refs[formName].validate((valid) => {
if (!valid) return
this.handlerSaveOrUpdate(this.isCreate === 0)
})
},
}),
handlerSaveOrUpdate(isSave) {
if (isSave) {
this.editPram.pid = this.prent.id

View File

@@ -14,7 +14,7 @@
</el-form-item>
</el-form>
</div>
<el-button size="mini" type="primary" @click="handlerEditData({},0)" v-if="!selectModel">创建表单</el-button>
<el-button size="mini" type="primary" @click="handlerEditData({},0)" v-if="!selectModel" v-hasPermi="['admin:system:form:save']">创建表单</el-button>
</div>
<el-table
:data="dataList.list"
@@ -22,6 +22,7 @@
size="mini"
class="table"
@current-change="handleCurrentRowChange"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column label="ID" prop="id" width="80"/>
<el-table-column label="名称" prop="name" min-width="180"/>
@@ -29,7 +30,7 @@
<el-table-column label="更新时间" prop="updateTime" min-width="200" />
<el-table-column v-if="!selectModel" label="操作" min-width="80" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handlerEditData(scope.row,1)">编辑</el-button>
<el-button type="text" size="small" @click="handlerEditData(scope.row,1)" v-hasPermi="['admin:system:form:info']">编辑</el-button>
</template>
</el-table-column>
</el-table>

View File

@@ -0,0 +1,228 @@
<template>
<div class="divBox">
<el-card class="box-card">
<el-table
v-loading="listLoading"
:data="tableData"
size="mini"
class="table"
row-key="cityId"
highlight-current-row
border
lazy
:load="load"
:header-cell-style=" {fontWeight:'bold'}"
        :tree-props="{children: 'child', hasChildren: 'hasChildren'}"
>
<el-table-column
prop="cityId"
label="编号"
min-width="100"
/>
<el-table-column
prop="parentName"
label="上级名称"
min-width="100"
>
<!-- <div>{{ parentName }}</div> -->
</el-table-column>
<el-table-column
prop="name"
min-width="250"
label="地区名称"
>
</el-table-column>
<el-table-column
fixed="right"
min-width="80"
label="操作"
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="editCity(scope.row)" v-hasPermi="['admin:system:city:update']">编辑</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose"
>
<parser v-if="formShow" :form-conf="formConf" :form-edit-data="formData" :is-edit="isCreate === 1" @submit="submit" />
</el-dialog>
</div>
</template>
<script>
import parser from '@/components/FormGenerator/components/parser/Parser'
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
import * as logistics from '@/api/logistics.js'
import {Debounce} from '@/utils/validate'
export default {
name: 'CityList',
components: { parser },
data() {
return {
// 表单
formConf: { fields: [] },
// 生成表单id
formId: 70,
tableData: [],
// 上级名称
parentName: '中国',
// 父级城市id
parentId: 0,
loading: false,
listLoading: true,
dialogVisible: false,
// 选中id
editId: 0,
formShow: false,
formData: {},
isCreate: 0,
}
},
created() {
this.getCityList()
},
methods: {
// 获取城市数据
getCityList() {
this.listLoading = true
logistics.cityList({
parentId: this.parentId
}).then(data => {
this.listLoading = false
let arr = [];
data.forEach((item) => {
let str = {};
str = item;
str.hasChildren = true;
str.parentName = '中国';
arr.push(str);
});
this.tableData = arr;
})
},
// 状态
cityStatus(e) {
logistics.updateStatus({
id: e.id,
cityId: e.cityId,
status: e.isShow
}).then(res => {
this.$message.success('操作成功')
}).catch(() => {
e.isShow = !e.isShow
})
},
// 编辑
editCity(item) {
this.$confirm('请勿频繁修改此配置项', '提示', {
confirmButtonText: '确定修改',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.editId = item.id
this.parentId = item.parentId;
const _pram = { id: this.formId }
systemFormConfigApi.getFormConfigInfo(_pram).then(data => {
this.formShow = false
this.isCreate = 0
this.getCityInfo()
this.dialogVisible = true
this.formConf = JSON.parse(data.content)
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
// 详情
getCityInfo() {
logistics.cityInfo({
id: this.editId
}).then(res => {
this.isCreate = 1
this.formData = res
this.formData.parentName = this.parentName
setTimeout(() => { // 让表单重复渲染待编辑数据
this.formShow = true
}, 80)
})
},
submit:Debounce(function(data) {
const param = {
id: this.editId,
parentId: this.parentId,
name: data.name
}
logistics.cityUpdate(param).then(res => {
this.$message.success('修改成功')
this.dialogVisible = false
// this.getCityList()
})
}),
// 关闭模态框
handleClose(done) {
this.formConf.fields = []
this.dialogVisible = false
},
load(tree, treeNode, resolve){
logistics.cityList({
parentId: tree.cityId,
}).then(data => {
let arr = [];
data.forEach((item) => {
let str = {};
str = item;
str.hasChildren = true; //给每个省市节点赋一个可展开的值
str.parentName = tree.name
this.parentName = tree.name
if(item.level == 2){
str.hasChildren = false;//当节点为三级时,不可展开
}
arr.push(str);
});
resolve(arr)
})
}
}
}
</script>
<style lang="scss" scoped>
.el-icon-plus {
margin-right: 5px;
}
.demo .el-switch__label {
position: absolute;
display: none;
color: #fff;
}
/*打开时文字位置设置*/
.demo .el-switch__label--right {
z-index: 1;
}
/*关闭时文字位置设置*/
.demo .el-switch__label--left {
z-index: 1;
left: 19px;
}
/*显示文字*/
.demo .el-switch__label.is-active {
display: block;
}
.demo.el-switch .el-switch__core,
.el-switch .el-switch__label {
width: 60px !important;
}
</style>

View File

@@ -0,0 +1,299 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form ref="form" inline :model="form">
<el-form-item label="关键字:">
<el-input v-model="form.keywords" placeholder="请输入关键字" class="selWidth" size="small" clearable>
<el-button slot="append" size="small" icon="el-icon-search" @click="handlerSearch" v-hasPermi="['admin:express:list']"/>
</el-input>
</el-form-item>
</el-form>
</div>
<el-button type="primary" size="small" @click="addExpress" v-hasPermi="['admin:express:sync']">同步物流公司</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData.list"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
label="ID"
min-width="180"
/>
<el-table-column
label="物流公司名称"
min-width="150"
prop="name"
/>
<el-table-column
min-width="200"
label="编码"
prop="code"
/>
<el-table-column
min-width="100"
label="排序"
prop="sort"
sortable
/>
<el-table-column
label="是否显示"
min-width="100"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
class="demo"
:active-value="true" :inactive-value="false"
active-text="开启"
inactive-text="关闭"
@change="bindStatus(scope.row)"
v-if="checkPermi(['admin:express:update:show'])"
/>
</template>
</el-table-column>
<el-table-column
prop="address"
fixed="right"
min-width="120"
label="操作"
>
<template slot-scope="scope">
<el-button v-if="scope.row.net" type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['admin:express:info']">收件网点名称编辑</el-button>
<el-button v-else-if="scope.row.partnerId" type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['admin:express:info']">月结账号编辑</el-button>
<el-button v-else type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['admin:express:info']">编辑</el-button>
</template>
</el-table-column>
</el-table>`
<div class="block-pagination">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableData.limit"
:current-page="tableData.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@current-change="pageChange"
@size-change="handleSizeChange"
/>
</div>
</el-card>
<el-dialog
title="编辑物流公司"
:visible.sync="dialogVisible"
width="700px"
:before-close="handleClose"
>
<el-form :model="formData" :rules="rules" ref="formData" label-width="100px" class="demo-ruleForm">
<el-form-item label="月结账号" prop="account" v-if="formData.partnerId">
<el-input v-model="formData.account" placeholder="请输入月结账号"></el-input>
</el-form-item>
<el-form-item label="月结密码" prop="password" v-if="formData.partnerKey">
<el-input v-model="formData.password" placeholder="请输入月结密码"></el-input>
</el-form-item>
<el-form-item label="网点名称" prop="netName" v-if="formData.net">
<el-input v-model="formData.netName" placeholder="请输入网点名称"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="formData.sort" :min="0" :max="9999" label="排序"></el-input-number>
</el-form-item>
<el-form-item label="是否启用" prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="false">关闭</el-radio>
<el-radio :label="true">开启</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit('formData')" v-hasPermi="['admin:express:update']">确 定</el-button>
</span>
<!--<parser v-if="formShow" ref="formBox" class="formBox" :form-conf="formConf" :form-edit-data="formData" :is-edit="isCreate === 1" @submit="submit" />-->
</el-dialog>
</div>
</template>
<script>
import parser from '@/components/FormGenerator/components/parser/Parser'
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
import * as logistics from '@/api/logistics.js'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
import {Debounce} from '@/utils/validate'
export default {
name: 'CompanyList',
components: { parser },
data() {
return {
constants:this.$constants,
// 表单
formConf: { fields: [] },
form: {
keywords: ''
},
tableData: {},
page: 1,
limit: 20,
loading: false,
dialogVisible: false,
fromType: 'add',
formData: {
status: false
},
isCreate: 0,
formShow: false,
editId: 0,
rules: {
sort: [
{ required: true, message: '请输入排序', trigger: 'blur' },
],
account: [
{ required: true, message: '请输入月结账号', trigger: 'blur' },
],
password: [
{ required: true, message: '请输入月结密码', trigger: 'blur' },
],
netName: [
{ required: true, message: '请输入网点名称', trigger: 'blur' },
]
}
}
},
created() {
this.getExpressList()
},
methods: {
checkPermi,
handlerSearch() {
this.page = 1
this.getExpressList()
},
// 获取物流公司列表
getExpressList() {
this.loading = true
logistics.expressList({
page: this.page,
limit: this.limit,
keywords: this.form.keywords
}).then(res => {
this.loading = false
this.tableData = res
}).catch(()=>{
this.loading = false
})
},
// 物流开关
bindStatus(item) {
logistics.expressUpdateShow({
account: item.account,
code: item.code,
id: item.id,
isShow: item.isShow,
name: item.name,
sort: item.sort
}).then(res => {
this.$message.success('操作成功')
// this.getExpressList()
}).catch(() => {
item.isShow = !item.isShow
})
},
// 分页
pageChange(e) {
this.page = e
this.getExpressList()
},
handleSizeChange(e) {
this.limit = e
this.getExpressList()
},
// 添加物流公司
addExpress() {
logistics.expressSyncApi().then(data => {
this.page = 1
this.getExpressList()
})
},
// 删除物流公司
bindDelete(item) {
this.$modalSure().then(() => {
logistics.expressDelete({ id: item.id }).then(res => {
this.$message.success('删除成功')
this.getExpressList()
})
})
},
// 表单提交
submit:Debounce(function(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
logistics.expressUpdate(this.formData).then(res => {
this.$message.success('操作成功')
this.handleClose()
this.getExpressList()
})
} else {
return false;
}
});
}),
// 关闭模态框
handleClose(done) {
this.formShow = false
// this.formData = {}
this.formConf.fields = []
this.dialogVisible = false
this.isCreate = 0
},
// 编辑
bindEdit(item) {
this.dialogVisible = true
this.editId = item.id
logistics.expressInfo({ id: item.id }).then(res => {
this.formData = res
})
}
}
}
</script>
<style lang="scss" scoped>
.selWidth{
width: 350px;
}
.el-icon-plus {
margin-right: 5px;
}
.demo .el-switch__label {
position: absolute;
display: none;
color: #fff;
}
/*打开时文字位置设置*/
.demo .el-switch__label--right {
z-index: 1;
}
/*关闭时文字位置设置*/
.demo .el-switch__label--left {
z-index: 1;
left: 19px;
}
/*显示文字*/
.demo .el-switch__label.is-active {
display: block;
}
.demo.el-switch .el-switch__core,
.el-switch .el-switch__label {
width: 60px !important;
}
.formBox{
.el-input-number--medium{
width: 100px;
}
}
</style>

View File

@@ -0,0 +1,508 @@
<template>
<el-dialog
v-if="dialogVisible"
title="运费模板"
:visible.sync="dialogVisible"
width="1000px"
:before-close="handleClose"
>
<el-form ref="ruleForm" :model="ruleForm" label-width="120px" size="mini" v-if="dialogVisible" :rules="rules">
<el-form-item label="模板名称" prop="name">
<el-input v-model="ruleForm.name" class="withs" placeholder="请输入模板名称" />
</el-form-item>
<el-form-item label="计费方式" prop="type">
<el-radio-group v-model="ruleForm.type" @change="changeRadio(ruleForm.type)">
<el-radio :label="1">按件数</el-radio>
<el-radio :label="2">按重量</el-radio>
<el-radio :label="3">按体积</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="配送区域及运费" prop="region">
<el-table v-loading="listLoading" :data="ruleForm.region" border fit highlight-current-row style="width: 100%" size="mini" class="tempBox">
<el-table-column align="center" label="可配送区域" min-width="260">
<template slot-scope="scope">
<span v-if="scope.$index === 0">默认全国</span>
<el-cascader
v-else
v-model="scope.row.city_ids"
style="width: 98%"
:options="cityList"
:props="props"
collapse-tags
clearable
filterable
@change="changeRegion"
/>
</template>
</el-table-column>
<el-table-column min-width="130px" align="center" :label="columns.title" prop="first">
<template slot-scope="scope">
<el-form-item :rules="rules.first" :prop="'region.'+scope.$index+'.first'">
<el-input-number v-model="scope.row.first" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="120px" align="center" label="运费(元)" prop="firstPrice">
<template slot-scope="scope">
<el-form-item :rules="rules.firstPrice" :prop="'region.'+scope.$index+'.firstPrice'">
<el-input-number v-model="scope.row.firstPrice" controls-position="right" />
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="120px" align="center" :label="columns.title2" prop="renewal">
<template slot-scope="scope">
<el-form-item :rules="rules.renewal" :prop="'region.'+scope.$index+'.renewal'">
<el-input-number v-model="scope.row.renewal" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column class-name="status-col" align="center" label="续费(元)" min-width="120" prop="renewalPrice">
<template slot-scope="scope">
<el-form-item :rules="rules.renewalPrice" :prop="'region.'+scope.$index+'.renewalPrice'">
<el-input-number v-model="scope.row.renewalPrice" controls-position="right" />
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="操作" min-width="80">
<template slot-scope="scope">
<el-button
v-if="scope.$index > 0"
type="text"
size="small"
@click="confirmEdit(ruleForm.region,scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" icon="el-icon-edit" @click="addRegion(ruleForm.region)">
添加配送区域
</el-button>
</el-form-item>
<el-form-item label="指定包邮" prop="appoint">
<el-radio-group v-model="ruleForm.appoint">
<el-radio :label="true">开启</el-radio>
<el-radio :label="false">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="ruleForm.appoint === true" prop="free">
<el-table v-loading="listLoading" :data="ruleForm.free" border fit highlight-current-row style="width: 100%" size="mini">
<el-table-column align="center" label="选择地区" min-width="220">
<template slot-scope="{row}">
<el-cascader
v-model="row.city_ids"
style="width: 95%"
:options="cityList"
:props="props"
collapse-tags
clearable
/>
</template>
</el-table-column>
<el-table-column min-width="180px" align="center" :label="columns.title3">
<template slot-scope="{row}">
<el-input-number v-model="row.number" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
</template>
</el-table-column>
<el-table-column min-width="120px" align="center" label="包邮金额(元)">
<template slot-scope="{row}">
<el-input-number v-model="row.price" controls-position="right" />
</template>
</el-table-column>
<el-table-column align="center" label="操作" min-width="120">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="confirmEdit(ruleForm.free,scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item v-if="ruleForm.appoint === true">
<el-button type="primary" size="mini" icon="el-icon-edit" @click="addFree(ruleForm.free)">
添加指定包邮区域
</el-button>
</el-form-item>
<!--<el-row :gutter="20">-->
<!--<el-col :span="7">-->
<!--<el-form-item label="指定区域不配送" prop="undelivery">-->
<!--<el-radio-group v-model="ruleForm.undelivery">-->
<!--<el-radio :label="1">开启</el-radio>-->
<!--<el-radio :label="0">关闭</el-radio>-->
<!--</el-radio-group>-->
<!--</el-form-item>-->
<!--</el-col>-->
<!--<el-col :span="14">-->
<!--<el-form-item v-if="ruleForm.undelivery === 1" class="noBox" prop="city_id3">-->
<!--<el-cascader-->
<!--v-model="ruleForm.city_id3"-->
<!--placeholder="请选择不配送区域"-->
<!--:options="cityList"-->
<!--:props="props"-->
<!--collapse-tags-->
<!--clearable-->
<!--style="width: 46%"-->
<!--/>-->
<!--</el-form-item>-->
<!--</el-col>-->
<!--</el-row>-->
<el-form-item label="排序">
<el-input v-model="ruleForm.sort" class="withs" placeholder="请输入排序" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="onClose('ruleForm')"> </el-button>
<el-button type="primary" :loading="loading" @click="onsubmit('ruleForm')"> </el-button>
</span>
</el-dialog>
</template>
<script>
import * as logistics from '@/api/logistics'
import { Loading } from 'element-ui'
const defaultRole = {
name: '',
type: 1,
appoint: false,
sort: 0,
region: [{
first: 0,
firstPrice: 0,
renewal: 0,
renewalPrice: 0,
city_ids: []
}],
undelivery: 0,
free: [],
undelives: {},
city_id3: []
}
const kg = '重量kg'
const m = '体积'
const statusMap = [
{
title: '首件',
title2: '续件',
title3: '包邮件数'
},
{
title: `首件${kg}`,
title2: `续件${kg}`,
title3: `包邮${kg}`
},
{
title: `首件${m}`,
title2: `续件${m}`,
title3: `包邮${m}`
}
]
export default {
name: 'CreatTemplates',
components: {
},
data() {
return {
loading : false,
rules: {
name: [
{ required: true, message: '请输入模板名称', trigger: 'blur' }
],
free: [
{ type: 'array', required: true, message: '请至少添加一个地区', trigger: 'change' }
],
appoint: [
{ required: true, message: '请选择是否指定包邮', trigger: 'change' }
],
undelivery: [
{ required: true, message: '请选择是否指定区域不配送', trigger: 'change' }
],
type: [
{ required: true, message: '请选择计费方式', trigger: 'change' }
],
region: [
{ required: true, message: '请选择活动区域', trigger: 'change' }
],
city_id3: [
{ type: 'array', required: true, message: '请至少选择一个地区', trigger: 'change' }
],
first: [
{ required: true, message: '请输入', trigger: 'blur' }
],
renewal: [
{ required: true, message: '请输入', trigger: 'blur' }
],
firstPrice: [
{ required: true, message: '请输入运费', trigger: 'blur' }
],
renewalPrice: [
{ required: true, message: '请输入续费', trigger: 'blur' }
]
},
nodeKey: 'city_id',
props: {
children: 'child',
label: 'name',
value: 'cityId',
multiple: true
},
dialogVisible: false,
ruleForm: Object.assign({}, defaultRole),
listLoading: false,
cityList: [],
columns: {
title: '首件',
title2: '续件',
title3: '包邮件数'
},
tempId: 0,
type: 0 // 0添加 1编辑
}
},
mounted() {
setTimeout(()=>{
let cityList = JSON.parse(sessionStorage.getItem('cityList'));
this.cityList = cityList;
},1000);
},
methods: {
changType(type) {
this.type = type
},
onClose(formName) {
this.dialogVisible = false
this.$refs[formName].resetFields()
},
confirmEdit(row, index) {
row.splice(index, 1)
},
popoverHide() {},
handleClose() {
// this.$refs['ruleForm'].resetFields()
this.dialogVisible = false
this.ruleForm={
name: '',
type: 1,
appoint: false,
sort: 0,
region: [{
first: 0,
firstPrice: 0,
renewal: 0,
renewalPrice: 0,
city_ids: []
}],
undelivery: 0,
free: [],
undelives: {},
city_id3: []
}
},
changeRegion(value) {
console.log(value)
},
changeRadio(num) {
this.columns = Object.assign({}, statusMap[num - 1])
},
// 添加配送区域
addRegion(region) {
region.push(Object.assign({}, {
first: 0,
firstPrice: 0,
renewal: 0,
renewalPrice: 0,
city_ids: []
}))
},
addFree(Free) {
Free.push(Object.assign({}, {
city_id: [],
number: 1,
price: 1,
city_ids: []
}))
},
/**
* 详情
* id 模板id
* appoint true包邮 false不包邮
**/
getInfo(id, appoint) {
this.tempId = id
const loadingInstance = Loading.service({ fullscreen: true })
logistics.templateDetailApi({ id }).then(res => {
this.dialogVisible = true
const info = res
this.ruleForm = Object.assign(this.ruleForm, {
name: info.name,
type: info.type,
appoint: info.appoint,
sort: info.sort
})
this.columns = Object.assign({}, statusMap[this.ruleForm.type - 1])
this.$nextTick(() => {
loadingInstance.close()
})
// 不包邮地区
this.shippingRegion()
// 包邮地区
if (info.appoint) {
this.shippingFree()
}
}).catch(res => {
// console.integralLog(res)
this.$message.error(res.message)
this.$nextTick(() => {
loadingInstance.close()
})
})
},
// 不包邮
shippingRegion() {
logistics.shippingRegion({ tempId: this.tempId }).then(res => {
res.forEach((item, index) => {
item.title = JSON.parse(item.title)
item.city_ids = item.title
})
this.ruleForm.region = res
})
},
// 包邮
shippingFree() {
logistics.shippingFree({ tempId: this.tempId }).then(res => {
res.forEach((item, index) => {
item.title = JSON.parse(item.title)
item.city_ids = item.title
})
this.ruleForm.free = res
})
},
// 列表
getCityList() {
logistics.cityListTree().then(res => {
sessionStorage.setItem('cityList',JSON.stringify(res));
let cityList = JSON.parse(sessionStorage.getItem('cityList'));
this.cityList = cityList;
}).catch(res => {
this.$message.error(res.message)
})
},
change(idBox) {
idBox.map(item => {
const ids = []
item.city_ids.map(j => {
j.splice(0, 1)
ids.push(j[0])
})
item.city_id = ids
})
return idBox
},
changeOne(idBox) {
const city_ids = []
idBox.map(item => {
item.splice(0, 1)
city_ids.push(item[0])
})
return city_ids
},
onsubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.loading = true;
const param = {
appoint: this.ruleForm.appoint,
name: this.ruleForm.name,
sort: this.ruleForm.sort,
type: this.ruleForm.type,
// 配送区域及运费
// shippingTemplatesRegionRequestList: [],
// // 指定包邮设置
// shippingTemplatesFreeRequestList: []
}
this.ruleForm.region.forEach((el, index) => {
el.title = el.city_ids.length > 0 ? JSON.stringify(el.city_ids) : JSON.stringify([[0, 0]])
for (var i = 0; i < el.city_ids.length; i++) {
el.city_ids[i].shift()
}
el.cityId = el.city_ids.length > 0 ? el.city_ids.join(',') : 'all'
})
param.shippingTemplatesRegionRequestList = this.ruleForm.region
param.shippingTemplatesRegionRequestList.forEach((el, index) => {
// delete el.city_ids
// delete el.city_id
})
if (this.ruleForm.appoint) {
this.ruleForm.free.forEach((el, index) => {
el.title = el.city_ids.length > 0 ? JSON.stringify(el.city_ids) : JSON.stringify([[0, 0]])
for (var i = 0; i < el.city_ids.length; i++) {
el.city_ids[i].shift()
}
el.cityId = el.city_ids.length > 0 ? el.city_ids.join(',') : 'all'
})
param.shippingTemplatesFreeRequestList = this.ruleForm.free
param.shippingTemplatesFreeRequestList.forEach((el, index) => {
// delete el.city_ids
// delete el.city_id
})
}
if (this.type === 0) {
logistics.shippingSave(param).then(res => {
this.$message.success('操作成功')
this.handleClose()
this.$nextTick(() => {
this.dialogVisible = false
})
setTimeout(() => {
this.$emit('getList')
}, 600)
this.loading = false;
})
} else {
logistics.shippingUpdate(param, { id: this.tempId }).then(res => {
this.$message.success('操作成功')
setTimeout(() => {
this.$emit('getList')
this.handleClose()
}, 600)
this.$nextTick(() => {
this.dialogVisible = false
})
this.loading = false;
})
}
} else {
return false
}
})
},
clear() {
this.ruleForm.name = ''
this.ruleForm.sort = 0
}
}
}
</script>
<style scoped lang="scss">
.withs{
width: 50%;
}
.noBox{
/deep/.el-form-item__content{
margin-left: 0 !important;
}
}
.tempBox{
/deep/.el-input-number--mini{
width: 100px !important;
}
}
</style>

View File

@@ -0,0 +1,187 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form ref="form" inline :model="form">
<el-form-item label="模板名称:">
<el-input v-model="form.keywords" placeholder="请输入模板名称" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="handleSearch" v-hasPermi="['admin:shipping:templates:list']" />
</el-input>
</el-form-item>
</el-form>
</div>
<el-button type="primary" size="mini" @click="handleSubmit()" v-hasPermi="['admin:shipping:templates:save']">添加运费模板</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData.list"
style="width: 100%"
size="small"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
label="ID"
min-width="60"
/>
<el-table-column
label="模板名称"
min-width="180"
prop="name"
/>
<el-table-column
min-width="100"
label="计费方式"
prop="type"
>
<template slot-scope="{row}">
<p>{{ row.type | typeFilter }}</p>
</template>
</el-table-column>
<el-table-column
min-width="100"
label="指定包邮"
prop="appoint"
>
<template slot-scope="{row}">
<p>{{ row.appoint | statusFilter }}</p>
</template>
</el-table-column>
<el-table-column
label="排序"
min-width="100"
prop="sort"
/>
<el-table-column
label="添加时间"
min-width="150"
prop="createTime"
/>
<el-table-column
prop="address"
fixed="right"
width="120"
label="操作"
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['admin:shipping:templates:info']">修改</el-button>
<el-button type="text" size="small" @click="bindDelete(scope.row)" v-hasPermi="['admin:shipping:templates:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block-pagination">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableData.limit"
:current-page="tableData.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@current-change="pageChange"
@size-change="handleSizeChange"
/>
</div>
</el-card>
<CreatTemplates ref="addTemplates" @getList="getList"/>
</div>
</template>
<script>
import CreatTemplates from './creatTemplates'
import * as logistics from '@/api/logistics.js'
export default {
name: 'ShippingTemplates',
filters: {
statusFilter(status) {
const statusMap = {
true: '开启',
false: '关闭'
}
return statusMap[status]
},
typeFilter(status) {
const statusMap = {
1: '按件数',
2: '按重量',
3: '按体积'
}
return statusMap[status]
}
},
components: { CreatTemplates },
data() {
return {
isShow: false,
dialogVisible: false,
form: {
keywords: ''
},
tableData: '',
page: 1,
limit: 20,
loading: false
}
},
created() {
this.getDataList()
},
methods: {
// 添加
handleSubmit() {
this.$refs.addTemplates.dialogVisible = true
this.$refs.addTemplates.getCityList()
this.$refs.addTemplates.changType(0)
},
handleSearch() {
this.page = 1
this.getDataList()
},
// 分页
pageChange(e) {
this.page = e
this.getDataList()
},
handleSizeChange(e) {
this.limit = e
this.getDataList()
},
// 数据列表
getDataList() {
this.loading = true
logistics.shippingTemplatesList({
keywords: this.form.keywords,
page: this.page,
limit: this.limit
}).then(res => {
this.loading = false
this.tableData = res
})
},
// 编辑
bindEdit(item) {
this.$refs.addTemplates.getCityList()
this.$refs.addTemplates.getInfo(item.id, item.appoint)
this.$refs.addTemplates.changType(1)
},
// 删除
bindDelete(item) {
this.$modalSure().then(() => {
logistics.shippingDetete({ id: item.id }).then(res => {
this.$message.success('删除成功')
this.getDataList()
})
})
// logistics.shippingDetete()
},
getList() {
this.getDataList()
}
}
}
</script>
<style scoped lang="scss">
.selWidth{
width: 350px;
}
</style>

View File

@@ -14,7 +14,7 @@
<el-form-item label="新密码" prop="pwd">
<el-input
v-model="pram.pwd"
placeholder="管理员密码,不更改可以不填写"
placeholder="管理员密码"
clearable
@input="handlerPwdInput"
@clear="handlerPwdInput"
@@ -35,6 +35,7 @@
<script>
import * as systemAdminApi from '@/api/systemadmin.js'
import Cookies from 'js-cookie'
import {Debounce} from '@/utils/validate'
export default {
name: "index",
data() {
@@ -47,15 +48,16 @@
callback()
}
}
const JavaInfo = JSON.parse(Cookies.get('JavaInfo'));
return {
password: '',
JavaInfo: JSON.parse(Cookies.get('JavaInfo')),
pram: {
account: JSON.parse(Cookies.get('JavaInfo')).account,
account:JavaInfo.account,
pwd: null,
repwd: null,
realName: null,
id: JSON.parse(Cookies.get('JavaInfo')).id
realName: JavaInfo.realName,
id: JavaInfo.id
},
roleList: [],
rules: {
@@ -63,7 +65,6 @@
pwd: [{ required: true, message: '请填管理员密码', trigger: ['blur', 'change'] }],
repwd: [{ required: true, message: '确认密码密码', validator: validatePass, trigger: ['blur', 'change'] }],
realName: [{ required: true, message: '管理员姓名', trigger: ['blur', 'change'] }],
roles: [{ required: true, message: '管理员身份', trigger: ['blur', 'change'] }]
}
}
},
@@ -71,17 +72,18 @@
close(formName) {
this.$refs[formName].resetFields();
},
handlerSubmit(formName) {
handlerSubmit:Debounce(function(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
systemAdminApi.adminUpdate(this.pram).then(data => {
this.$message.success('提交成功')
this.$router.go(-1)
})
} else {
return false;
}
});
},
}),
handlerPwdInput(val) {
if (!val) {
this.rules.pwd = []

View File

@@ -70,11 +70,11 @@
<el-input v-model="formValidate.title" maxlength="249" placeholder="请输入砍价活动名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="砍价活动简介:" prop="info">
<el-input v-model="formValidate.info" maxlength="250" type="textarea" :rows="3" placeholder="请输入砍价活动简介" />
</el-form-item>
</el-col>
<!-- <el-col :span="24">-->
<!-- <el-form-item label="砍价活动简介:" prop="info">-->
<!-- <el-input v-model="formValidate.info" maxlength="250" type="textarea" :rows="3" placeholder="请输入砍价活动简介" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col v-bind="grid2">
<el-form-item label="单位:" prop="unitName">
<el-input v-model="formValidate.unitName" placeholder="请输入单位" class="selWidthd"/>
@@ -216,7 +216,7 @@
<!-- 商品详情-->
<div v-show="currentTab === 2">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
<Tinymce v-model="formValidate.content"></Tinymce>
</el-form-item>
</div>
<el-form-item style="margin-top:30px;">
@@ -248,6 +248,7 @@
class="submission"
size="small"
@click="handleSubmit('formValidate')"
v-hasPermi="['admin:bargain:update']"
>提交</el-button>
</el-form-item>
</el-form>
@@ -257,11 +258,14 @@
</template>
<script>
import Tinymce from '@/components/Tinymce/index'
import { productDetailApi, categoryApi } from '@/api/store'
import { shippingTemplatesList } from '@/api/logistics'
import { getSeckillList } from '@/libs/public'
import { bargainSaveApi, bargainUpdateApi, bargainInfoApi } from '@/api/marketing'
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
import {formatDates} from "@/utils";
import {Debounce} from '@/utils/validate'
const defaultObj = {
image: '',
images: '',
@@ -330,7 +334,7 @@
}
export default {
name: "creatSeckill",
components: { CreatTemplates },
components: { CreatTemplates,Tinymce },
data() {
return {
pickerOptions: {
@@ -450,8 +454,10 @@
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
// tmp['value' + i] = { title: o.attrName }
// tmpTab['value' + i] = ''
tmp[o.attrName] = { title: o.attrName };
tmpTab[o.attrName] = '';
})
this.manyTabTit = tmp
this.manyTabDate = tmpTab
@@ -544,11 +550,12 @@
imagess: JSON.parse(res.sliderImage),
title: res.storeName,
info: res.storeInfo,
proName: res.storeName,
storeName: res.storeName,
unitName: res.unitName,
sort: res.sort,
tempId: res.tempId,
attr: res.attr,
attrValue: res.attrValue,
selectRule: res.selectRule,
content: res.content,
specType: res.specType,
@@ -564,12 +571,16 @@
peopleNum : 1
}
if(res.specType){
res.attrValues.forEach((row) => {
res.attrValue.forEach((row) => {
row.quota = row.stock;
row.attrValue = JSON.parse(row.attrValue);
for (let attrValueKey in row.attrValue) {
row[attrValueKey] = row.attrValue[attrValueKey];
}
row.image = this.$selfUtil.setDomain(row.image)
});
this.ManyAttrValue = res.attrValues
this.multipleSelection = res.attrValues
this.ManyAttrValue = res.attrValue
this.multipleSelection = res.attrValue
}else{
res.attrValue.forEach((row) => {
row.quota = row.stock;
@@ -577,7 +588,7 @@
});
this.ManyAttrValue = res.attrValue
this.radio = res.attrValue[0]
this.formValidate.attr = []
// this.formValidate.attr = []
}
this.fullscreenLoading = false
}).catch(res => {
@@ -591,13 +602,13 @@
image: this.$selfUtil.setDomain(res.image),
imagess: JSON.parse(res.sliderImage),
title: res.title,
proName: res.title,
storeName: res.storeName,
info: res.info,
unitName: res.unitName,
sort: res.sort,
tempId: res.tempId,
attr: res.attr,
selectRule: res.selectRule,
selectRule: res.selectRule,
content: res.content,
specType: res.specType,
productId: res.productId,
@@ -605,18 +616,23 @@
ficti: res.ficti,
startTime: res.startTime || '',
stopTime: res.stopTime || '',
timeVal: res.startTime && res.stopTime ? [res.startTime, res.stopTime] : [],
timeVal: res.startTime && res.stopTime ? [ formatDates(new Date(res.startTime), 'yyyy-MM-dd'), formatDates(new Date(res.stopTime), 'yyyy-MM-dd')] : [],
status: res.status,
num : res.num,
bargainNum : res.bargainNum,
peopleNum : res.peopleNum
peopleNum : res.peopleNum,
id: res.id
}
if(res.specType){
this.ManyAttrValue = res.attrValues;
this.ManyAttrValue = res.attrValue;
this.$nextTick(() => {
this.ManyAttrValue.forEach((item, index) => {
item.attrValue = JSON.parse(item.attrValue);
for (let attrValueKey in item.attrValue) {
item[attrValueKey] = item.attrValue[attrValueKey];
}
item.image = this.$selfUtil.setDomain(item.image)
if (item.checked) {
if (item.id) {
this.radio = item
}
})
@@ -626,7 +642,7 @@
this.ManyAttrValue.forEach((item, index) => {
item.image = this.$selfUtil.setDomain(item.image)
})
this.formValidate.attr = [];
// this.formValidate.attr = [];
this.radio = res.attrValue[0];
}
@@ -655,13 +671,16 @@
});
},
// 提交
handleSubmit(name) {
handleSubmit:Debounce(function(name) {
if(!this.formValidate.specType){
this.formValidate.attr = []
// this.formValidate.attr = []
this.formValidate.attrValue = this.ManyAttrValue
}else{
this.radio.attrValue = JSON.stringify(this.radio.attrValue);
this.formValidate.attrValue = [this.radio]
}
this.formValidate.startTime = this.formValidate.timeVal[0];
this.formValidate.stopTime = this.formValidate.timeVal[1];
this.formValidate.images = JSON.stringify(this.formValidate.imagess)
this.$refs[name].validate((valid) => {
if (valid) {
@@ -711,7 +730,7 @@
}
});
},
}),
handleSubmitUp() {
if (this.currentTab-- < 0) this.currentTab = 0;
},

View File

@@ -18,9 +18,9 @@
</el-form>
</div>
<router-link :to=" { path:'/marketing/bargain/creatBargain' }">
<el-button size="mini" type="primary" class="mr10">添加砍价商品</el-button>
<el-button size="mini" type="primary" class="mr10" v-hasPermi="['admin:bargain:save']">添加砍价商品</el-button>
</router-link>
<el-button size="mini" class="mr10" @click="exportList">导出</el-button>
<el-button size="mini" class="mr10" @click="exportList" v-hasPermi="['admin:export:excel:bargain']">导出</el-button>
</div>
<el-table
v-loading="listLoading"
@@ -28,6 +28,7 @@
style="width: 100%"
size="mini"
ref="multipleTable"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
@@ -45,51 +46,65 @@
</div>
</template>
</el-table-column>
<el-table-column
label="砍价名称"
prop="title"
min-width="100"
/>
<el-table-column label="砍价名称" prop="title" min-width="300">
<template slot-scope="scope">
<el-popover trigger="hover" placement="right" :open-delay="800">
<div class="text_overflow" slot="reference">{{scope.row.title}}</div>
<div class="pup_card">{{scope.row.title}}</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
label="砍价价格"
prop="price"
min-width="100"
align="center"
/>
<el-table-column
label="最低价"
prop="minPrice"
min-width="100"
align="center"
/>
<el-table-column
label="参与人数"
prop="countPeopleAll"
min-width="100"
align="center"
/>
<el-table-column
label="帮忙砍价人数"
prop="countPeopleHelp"
min-width="100"
align="center"
/>
<el-table-column
label="砍价成功人数"
prop="countPeopleSuccess"
min-width="100"
align="center"
/>
<el-table-column
label="限量"
min-width="100"
prop="quotaShow"
align="center"
/>
<el-table-column
label="限量剩余"
prop="surplusQuota"
min-width="100"
align="center"
/>
<el-table-column
prop="stopTime"
label="结束时间"
min-width="130"
/>
label="活动时间"
min-width="160"
>
<template slot-scope="scope">
{{scope.row.startTime + ' ~ ' + scope.row.stopTime}}
</template>
</el-table-column>
<el-table-column
label="砍价状态"
min-width="150"
@@ -102,15 +117,16 @@
active-text="开启"
inactive-text="关闭"
@change="onchangeIsShow(scope.row)"
v-if="checkPermi(['admin:bargain:update:status'])"
/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="130" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to="{ path:'/marketing/bargain/creatBargain/' + scope.row.id}">
<el-button type="text" size="small">编辑</el-button>
<el-button type="text" size="small" v-hasPermi="['admin:bargain:info']">编辑</el-button>
</router-link>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10">删除</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10" v-hasPermi="['admin:bargain:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -123,6 +139,7 @@
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
v-if="checkPermi(['admin:bargain:list'])"
/>
</div>
</el-card>
@@ -131,6 +148,7 @@
<script>
import { bargainListApi,bargainDeleteApi,bargainStatusApi,exportBargainApi } from '@/api/marketing'
import { checkPermi, checkRole } from "@/utils/permission";
export default {
name: "index",
data() {
@@ -146,12 +164,77 @@
data: [],
total: 0
},
afterData: []
}
},
mounted() {
// 源数据
var oldData = [
{
city_id: 1,
city_name: '北京',
city_img: "http://dfknbdjknvkjsfnvlkjdn.png",
city_country: "中国"
},
{
city_id: 2,
city_name: '上海',
city_img: "http://wergerbe.png",
city_country: "中国"
},
{
city_id: 3,
city_name: '广州',
city_img: "http://hrthhr.png",
city_country: "中国"
},
{
city_id: 4,
city_name: '西雅图',
city_img: "http://frevfd.png",
city_country: "美国"
},
{
city_id: 5,
city_name: '纽约',
city_img: "http://反而个.png",
city_country: "美国"
}
]
// 把源数据先变成目标数据的规则
var oldDataRule = []
oldData.forEach(el => {
var oldObj = {
name: el.city_country,
citys:[]
}
var cityObj = {
city_name: el.city_name,
city_img: el.city_img,
city_id: el.city_id
}
oldObj.citys.push(cityObj)
oldDataRule.push(oldObj)
})
var newData = []
var newObj = {}
oldDataRule.forEach((el, i) => {
if (!newObj[el.name]) {
newData.push(el);
newObj[el.name] = true;
} else {
newData.forEach(el => {
if (el.name === oldDataRule[i].name) {
el.citys = el.citys.concat(oldDataRule[i].citys);
// el.citys = [...el.citys, ...oldDataRule[i].citys]; // es6语法
}
})
}
})
this.getList()
},
methods: {
checkPermi, //权限控制
//导出
exportList(){
exportBargainApi({keywords: this.tableFrom.keywords, status:this.tableFrom.status}).then((res) => {
@@ -160,12 +243,13 @@
},
// 删除
handleDelete(id, idx) {
this.$modalSure().then(() => {
let that = this;
this.$modal.confirm('确认删除该商品吗').then(function() {
bargainDeleteApi({id: id}).then(() => {
this.$message.success('删除成功')
this.tableData.data.splice(idx, 1)
that.$message.success('删除成功')
that.getList();
})
})
}).catch(() => {});
},
onchangeIsShow(row) {
bargainStatusApi({id:row.id, status: row.status})
@@ -209,5 +293,22 @@
</script>
<style scoped>
.el-table__body {
width: 100%;
table-layout: fixed !important;
}
.text_overflow{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 400px;
}
.pup_card{
width: 200px;
border-radius: 5px;
padding: 5px;
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
}
</style>

View File

@@ -26,6 +26,7 @@
style="width: 100%"
size="mini"
ref="multipleTable"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
@@ -53,11 +54,14 @@
prop="addTime"
min-width="150"
/>
<el-table-column
label="砍价商品"
prop="title"
min-width="100"
/>
<el-table-column label="砍价商品" prop="title" min-width="300">
<template slot-scope="scope">
<el-popover trigger="hover" placement="right" :open-delay="800">
<div class="text_overflow" slot="reference">{{scope.row.title}}</div>
<div class="pup_card">{{scope.row.title}}</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
label="最低价"
prop="bargainPriceMin"
@@ -241,5 +245,22 @@
</script>
<style scoped>
.el-table__body {
width: 100%;
table-layout: fixed !important;
}
.text_overflow{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 400px;
}
.pup_card{
width: 200px;
border-radius: 5px;
padding: 5px;
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
}
</style>

View File

@@ -49,7 +49,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="使用有效期限(天)" prop="day" v-if="!ruleForm.isFixedTime">
<el-input-number v-model="ruleForm.day" :min="0" label="描述文字"></el-input-number>
<el-input-number v-model="ruleForm.day" :min="0" :max="999" label="描述文字"></el-input-number>
</el-form-item>
<el-form-item label="使用有效期限" prop="resource" v-if="ruleForm.isFixedTime">
<el-date-picker
@@ -109,7 +109,7 @@
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" @click="submitForm('ruleForm')" :loading="loading">立即创建</el-button>
<el-button size="mini" type="primary" @click="submitForm('ruleForm')" :loading="loading" v-hasPermi="['admin:coupon:save']">立即创建</el-button>
<!--<el-button @click="resetForm('ruleForm')">重置</el-button>-->
</el-form-item>
</el-form>
@@ -120,13 +120,15 @@
<script>
import { couponSaveApi, couponInfoApi } from '@/api/marketing'
import { categoryApi } from '@/api/store'
import {Debounce} from '@/utils/validate'
export default {
name: "creatCoupon",
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date().setTime(new Date().getTime() - 3600 * 1000 * 24);
// return time.getTime() < new Date().setTime(new Date().getTime() - 3600 * 1000 * 24); //不限制未来时间
return time.getTime() < Date.now() - 8.64e7 || time.getTime() > Date.now() + 600 * 8.64e7; //限制未来时间
}
},
loading: false,
@@ -246,7 +248,7 @@
_this.ruleForm.checked = row
},'many',_this.ruleForm.checked)
},
submitForm(formName) {
submitForm:Debounce(function(formName) {
if( (this.ruleForm.isFixedTime && !this.termTime) || this.ruleForm.isFixedTime && !this.termTime.length) return this.$message.warning("请选择使用有效期限")
if( (this.ruleForm.isForever && !this.isForeverTime) || (this.ruleForm.isForever && !this.isForeverTime.length)) return this.$message.warning("请选择请选择领取时间")
if( this.ruleForm.useType === 2 ) this.ruleForm.primaryKey = this.ruleForm.checked.map(item => {return item.id}).join(',')
@@ -274,7 +276,8 @@
return false;
}
});
},
}),
}
}
</script>

View File

@@ -11,12 +11,12 @@
</el-select>
<span class="seachTiele">优惠券名称</span>
<el-input v-model="tableFrom.name" placeholder="请输入优惠券名称" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" />
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
</el-input>
</div>
</div>
<router-link :to=" { path: '/marketing/coupon/list/save' } ">
<el-button size="small" type="primary">添加优惠劵</el-button>
<el-button size="small" type="primary" v-hasPermi="['admin:coupon:save']">添加优惠劵</el-button>
</router-link>
</div>
<el-table
@@ -24,6 +24,7 @@
:data="tableData.data"
style="width: 100%"
size="mini"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
@@ -97,7 +98,7 @@
label="是否开启"
min-width="100"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="checkPermi(['admin:coupon:update:status'])">
<el-switch
v-model="scope.row.status"
:active-value="true"
@@ -110,11 +111,11 @@
</el-table-column>
<el-table-column label="操作" min-width="180" fixed="right">
<template slot-scope="scope">
<el-button type="text" class="mr10" size="small" @click="receive(scope.row)">领取记录</el-button>
<el-button type="text" class="mr10" size="small" @click="receive(scope.row)" v-hasPermi="['admin:coupon:user:list']">领取记录</el-button>
<router-link :to=" { path: '/marketing/coupon/list/save/' + scope.row.id } ">
<el-button v-if="scope.row.status" type="text" size="small" class="mr10">复制</el-button>
<el-button v-if="scope.row.status" type="text" size="small" class="mr10" v-hasPermi="['admin:coupon:info']">复制</el-button>
</router-link>
<el-button type="text" class="mr10" size="small" @click="handleDelMenu(scope.row)">删除</el-button>
<el-button type="text" class="mr10" size="small" @click="handleDelMenu(scope.row)" v-hasPermi="['admin:coupon:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -182,6 +183,7 @@
<script>
import { marketingListApi, couponIssueStatusApi, couponUserListApi, couponDeleteApi } from '@/api/marketing'
import { roterPre } from '@/settings'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'CouponList',
data() {
@@ -215,6 +217,7 @@
this.getList()
},
methods: {
checkPermi,
seachList() {
this.tableFrom.page = 1
this.getList()
@@ -291,9 +294,14 @@
<style scoped lang="scss">
.selWidth{
width: 350px !important;
height: 40px;
}
::v-deep .el-input--medium .el-input__inner{
height: 40px;
line-height: 40px;
}
.seachTiele{
line-height: 35px;
line-height: 40px;
}
.fa{
color: #0a6aa1;

View File

@@ -39,6 +39,7 @@
v-loading="Loading"
:data="issueData.data"
style="width: 100%"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="couponId"

View File

@@ -226,7 +226,7 @@
<!-- 商品详情-->
<div v-show="currentTab === 2">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
<Tinymce v-model="formValidate.content"></Tinymce>
</el-form-item>
</div>
<el-form-item style="margin-top:30px;">
@@ -258,6 +258,7 @@
class="submission"
size="small"
@click="handleSubmit('formValidate')"
v-hasPermi="['admin:combination:update']"
>提交</el-button>
</el-form-item>
</el-form>
@@ -267,11 +268,14 @@
</template>
<script>
import Tinymce from '@/components/Tinymce/index'
import { productDetailApi, categoryApi } from '@/api/store'
import { shippingTemplatesList } from '@/api/logistics'
import { getSeckillList } from '@/libs/public'
import { combinationSaveApi, combinationUpdateApi, combinationInfoApi } from '@/api/marketing'
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
import {formatDates} from "@/utils";
import {Debounce} from '@/utils/validate'
const defaultObj = {
image: '',
images: '',
@@ -337,7 +341,7 @@
}
export default {
name: "creatSeckill",
components: { CreatTemplates },
components: { CreatTemplates,Tinymce },
data() {
return {
pickerOptions: {
@@ -459,8 +463,10 @@
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
// tmp['value' + i] = { title: o.attrName }
// tmpTab['value' + i] = ''
tmp[o.attrName] = { title: o.attrName };
tmpTab[o.attrName] = '';
})
this.manyTabTit = tmp
this.manyTabDate = tmpTab
@@ -568,7 +574,7 @@
stopTime: res.stopTime || '',
timeVal: [],
status: 0,
isShow: false,
isShow: false,
num : 1,
isHost : false,
people : 2,
@@ -578,24 +584,28 @@
isPostage: false
}
if(res.specType){
res.attrValues.forEach((row) => {
res.attrValue.forEach((row) => {
row.quota = row.stock;
row.attrValue = JSON.parse(row.attrValue);
for (let attrValueKey in row.attrValue) {
row[attrValueKey] = row.attrValue[attrValueKey];
}
});
this.$nextTick(() => {
res.attrValues.forEach((row) => {
res.attrValue.forEach((row) => {
row.image = this.$selfUtil.setDomain(row.image)
this.$refs.multipleTable.toggleRowSelection(row, true);
this.$set(row, 'checked', true)
});
});
this.ManyAttrValue = res.attrValues
this.multipleSelection = res.attrValues
this.ManyAttrValue = res.attrValue
this.multipleSelection = res.attrValue
}else{
res.attrValue.forEach((row) => {
row.quota = row.stock;
});
this.ManyAttrValue = res.attrValue
this.formValidate.attr = []
this.formValidate.attr = res.attr
}
this.fullscreenLoading = false
}).catch(res => {
@@ -620,7 +630,8 @@
productId: res.productId,
giveIntegral: res.giveIntegral,
ficti: res.ficti,
timeVal: res.startTimeStr && res.stopTimeStr ? [res.startTimeStr, res.stopTimeStr] : [],
// timeVal: res.startTimeStr && res.stopTimeStr ? [res.startTimeStr, res.stopTimeStr] : [],
timeVal: res.startTime && res.stopTime ? [formatDates(new Date(res.startTime), 'yyyy-MM-dd'), formatDates(new Date(res.stopTime), 'yyyy-MM-dd')] : [],
status: res.status,
isShow: res.isShow,
num : res.num,
@@ -630,15 +641,20 @@
virtualRation : res.virtualRation,
effectiveTime : res.effectiveTime,
isPostage: false,
startTime: res.startTimeStr || '',
stopTime: res.stopTimeStr || ''
startTime: res.startTime || '',
stopTime: res.stopTime || '',
id: res.id
}
if(res.specType){
this.ManyAttrValue = res.attrValues;
this.ManyAttrValue = res.attrValue;
this.$nextTick(() => {
this.ManyAttrValue.forEach((item, index) => {
item.image = this.$selfUtil.setDomain(item.image)
if (item.checked) {
item.attrValue = JSON.parse(item.attrValue);
for (let attrValueKey in item.attrValue) {
item[attrValueKey] = item.attrValue[attrValueKey];
}
if (item.id) {
this.$set(item, 'price', item.price)
this.$set(item, 'quota', item.quota)
this.$nextTick(() => {
@@ -649,7 +665,7 @@
});
}else{
this.ManyAttrValue = res.attrValue
this.formValidate.attr = []
// this.formValidate.attr = []
}
this.fullscreenLoading = false
}).catch(res => {
@@ -667,14 +683,19 @@
});
},
// 提交
handleSubmit(name) {
handleSubmit:Debounce(function(name) {
if(!this.formValidate.specType){
this.formValidate.attr = []
// this.formValidate.attr = []
this.formValidate.attrValue = this.ManyAttrValue
}else{
this.formValidate.attrValue = this.multipleSelection
this.formValidate.attrValue = this.multipleSelection;
}
this.formValidate.attrValue.forEach(item=>{
item.attrValue = JSON.stringify(item.attrValue);
});
this.formValidate.images = JSON.stringify(this.formValidate.imagelist);
this.formValidate.startTime = this.formValidate.timeVal[0];
this.formValidate.stopTime = this.formValidate.timeVal[1];
// this.formValidate.virtualRation = Math.floor((this.formValidate.people - this.formValidate.peopleNum) / this.formValidate.people * 100)
this.$refs[name].validate((valid) => {
if (valid) {
@@ -724,7 +745,7 @@
}
});
},
}),
handleSubmitUp() {
if (this.currentTab-- < 0) this.currentTab = 0;
},

View File

@@ -18,9 +18,9 @@
</el-form>
</div>
<router-link :to=" { path:'/marketing/groupBuy/creatGroup' }">
<el-button size="mini" type="primary" class="mr10">添加拼团商品</el-button>
<el-button size="mini" type="primary" class="mr10" v-hasPermi="['admin:combination:save']">添加拼团商品</el-button>
</router-link>
<el-button size="mini" class="mr10" @click="exportList">导出</el-button>
<el-button size="mini" class="mr10" @click="exportList" v-hasPermi="['admin:export:excel:combiantion']">导出</el-button>
</div>
<el-table
v-loading="listLoading"
@@ -28,6 +28,7 @@
style="width: 100%"
size="mini"
ref="multipleTable"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
@@ -45,45 +46,55 @@
</div>
</template>
</el-table-column>
<el-table-column
label="拼团名称"
prop="title"
min-width="100"
/>
<el-table-column label="拼团名称" prop="title" min-width="300">
<template slot-scope="scope">
<el-popover trigger="hover" placement="right" :open-delay="800">
<div class="text_overflow" slot="reference">{{scope.row.title}}</div>
<div class="pup_card">{{scope.row.title}}</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
label="原价"
prop="otPrice"
min-width="100"
align="center"
/>
<el-table-column
label="拼团价"
prop="price"
min-width="100"
align="center"
/>
<el-table-column
label="拼团人数"
prop="countPeople"
min-width="100"
align="center"
/>
<el-table-column
label="参与人数"
prop="countPeopleAll"
min-width="100"
align="center"
/>
<el-table-column
label="成团数量"
prop="countPeoplePink"
min-width="100"
align="center"
/>
<el-table-column
label="限量"
min-width="100"
prop="quotaShow"
align="center"
/>
<el-table-column
label="限量剩余"
prop="remainingQuota"
min-width="100"
align="center"
/>
<el-table-column
prop="stopTime"
@@ -98,7 +109,7 @@
label="拼团状态"
min-width="150"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="checkPermi(['admin:combination:update:status'])">
<el-switch
v-model="scope.row.isShow"
:active-value="true"
@@ -112,9 +123,9 @@
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to="{ path:'/marketing/groupBuy/creatGroup/' + scope.row.id}">
<el-button type="text" size="small">编辑</el-button>
<el-button type="text" size="small" v-hasPermi="['admin:combination:info']">编辑</el-button>
</router-link>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10">删除</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10" v-hasPermi="['admin:combination:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -136,6 +147,7 @@
<script>
import { combinationListApi, combinationDeleteApi, combinationStatusApi, exportcombiantionApi } from '@/api/marketing'
import { formatDates } from '@/utils/index';
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: "index",
filters: {
@@ -165,6 +177,7 @@
this.getList()
},
methods: {
checkPermi,
//导出
exportList(){
exportcombiantionApi({keywords: this.tableFrom.keywords, isShow:this.tableFrom.isShow}).then((res) => {
@@ -214,5 +227,22 @@
</script>
<style scoped>
.el-table__body {
width: 100%;
table-layout: fixed !important;
}
.text_overflow{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 400px;
}
.pup_card{
width: 200px;
border-radius: 5px;
padding: 5px;
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
}
</style>

View File

@@ -1,8 +1,8 @@
<template>
<div class="divBox">
<el-card class="box-card mb15">
<cards-data :cardLists="cardLists"></cards-data>
</el-card>
<div class="mt10">
<cards-data :cardLists="cardLists" v-if="checkPermi(['admin:combination:statistics'])"></cards-data>
</div>
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
@@ -30,6 +30,7 @@
size="mini"
ref="multipleTable"
highlight-current-row
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
@@ -55,31 +56,36 @@
<el-table-column
label="开团时间"
prop="addTime"
min-width="100"
/>
<el-table-column
label="拼团商品"
prop="title"
min-width="100"
min-width="130"
/>
<el-table-column
label="拼团商品"
prop="title"
min-width="300"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
label="几人团"
prop="people"
min-width="100"
align="center"
/>
<el-table-column
label="几人参加"
prop="countPeople"
min-width="100"
align="center"
/>
<el-table-column
prop="stopTime"
label="结束时间"
min-width="130"
align="center"
/>
<el-table-column
label="拼团状态"
min-width="150"
align="center"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status | groupColorFilter">{{scope.row.status | groupStatusFilter}}</el-tag>
@@ -164,6 +170,7 @@
<script>
import { combineListApi, combineStatisticsApi,combineOrderPinkApi } from '@/api/marketing'
import cardsData from '@/components/cards/index'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: "groupList",
components: {
@@ -197,6 +204,7 @@
this.getList();
},
methods:{
checkPermi,
handleClose(){
this.dialogVisible = false
},
@@ -250,8 +258,8 @@
getStatistics() {
combineStatisticsApi().then(res => {
this.cardLists = [
{ name: '参与人数(人)', count: res.countPeople },
{ name: '成团数量(个)', count: res.countTeam }
{ name: '参与人数(人)', count: res.countPeople,color:'#1890FF',class:'one',icon:'iconleijiyonghushu' },
{ name: '成团数量(个)', count: res.countTeam,color:'#A277FF',class:'two',icon:'iconxinzengyonghu' }
]
}).catch(() => {
this.listLoading = false
@@ -262,5 +270,25 @@
</script>
<style scoped>
.el-table__body {
width: 100%;
table-layout: fixed !important;
}
.text_overflow{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 400px;
}
.pup_card{
width: 200px;
border-radius: 5px;
padding: 5px;
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
}
.mt10{
margin-top: 10px;
}
</style>

View File

@@ -16,6 +16,7 @@
<script>
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
import { configSaveForm, configInfo } from '@/api/systemConfig.js'
import {Debounce} from '@/utils/validate'
export default {
name: "integralconfig",
components: { zbParser },
@@ -34,7 +35,7 @@
resetForm(formValue) {
this.editData = {}
},
handlerSubmit(data) {
handlerSubmit:Debounce(function(data) {
const tempArr = []
for (var key in data) {
const obj = {}
@@ -53,7 +54,7 @@
this.getFormInfo()
this.$message.success('操作成功')
})
},
}),
// 获取表单详情
getFormInfo() {
configInfo({ id: this.formId }).then(res => {

View File

@@ -15,7 +15,7 @@
@change="onchangeTime"/>
</el-form-item>
<el-form-item label="用户微信昵称:">
<el-input v-model="tableFrom.keywords" placeholder="请输入用户微信昵称" class="selWidth" size="small">
<el-input v-model="tableFrom.keywords" placeholder="请输入用户昵称" class="selWidth" size="small">
<el-button slot="append" icon="el-icon-search" size="small" @click="getList(1)" />
</el-input>
</el-form-item>
@@ -26,10 +26,10 @@
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
size="small"
class="table"
highlight-current-row
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
@@ -61,7 +61,7 @@
prop="mark"
/>
<el-table-column
label="用户微信昵称"
label="用户昵称"
min-width="120"
prop="nickName"
/>

View File

@@ -17,7 +17,7 @@
</el-form-item>
</el-form>
</div>
<el-button size="mini" type="primary" @click="add">添加秒杀配置</el-button>
<el-button size="mini" type="primary" @click="add" v-hasPermi="['admin:seckill:manger:save']">添加秒杀配置</el-button>
</div>
<el-table
v-loading="listLoading"
@@ -25,6 +25,7 @@
style="width: 100%"
size="mini"
ref="multipleTable"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
@@ -77,7 +78,7 @@
label="状态"
min-width="150"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="checkPermi(['admin:seckill:manger:update:status'])">
<el-switch
v-model="scope.row.status"
:active-value="1"
@@ -95,10 +96,10 @@
/>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleEdit(scope.row.id)">编辑</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10">删除</el-button>
<el-button type="text" size="small" @click="handleEdit(scope.row.id)" v-hasPermi="['admin:seckill:manger:info','admin:seckill:manger:update']">编辑</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10" v-hasPermi="['admin:seckill:manger:delete']">删除</el-button>
<router-link :to="{ path:'/marketing/seckill/creatSeckill/creat/' + scope.row.id}">
<el-button type="text" size="small">添加商品</el-button>
<el-button type="text" size="small" v-hasPermi="['admin:seckill:save']">添加商品</el-button>
</router-link>
</template>
</el-table-column>
@@ -140,6 +141,8 @@
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
import { configSaveForm, configInfo } from '@/api/systemConfig.js'
import { seckillListApi, seckillUpdateApi, seckillInfoApi, seckillSaveApi, seckillDeleteApi, seckillConfigStatusApi } from '@/api/marketing'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
import {Debounce} from '@/utils/validate'
export default {
name: "SeckillConfig",
components: { zbParser },
@@ -170,6 +173,7 @@
this.getList()
},
methods: {
checkPermi,
resetForm(formValue) {
this.dialogVisible = false
},
@@ -225,14 +229,14 @@
})
},
// 提交
handlerSubmit(formValue) {
handlerSubmit:Debounce(function(formValue) {
if(formValue.time.split(',')[0].split(':')[0] > formValue.time.split(',')[1].split(':')[0]) return this.$message.error('请填写正确的时间范围')
this.isCreate === 0 ? seckillSaveApi(formValue).then(res => {
this.isSuccess()
}) : seckillUpdateApi({id: this.seckillId}, formValue).then(res => {
this.isSuccess()
})
},
}),
isSuccess(){
this.$message.success('操作成功')
this.dialogVisible = false

View File

@@ -127,7 +127,7 @@
<el-option
v-for="item in seckillTime"
:key="item.id"
:label="item.time"
:label="item.name + ' | ' + item.time"
:value="item.id">
</el-option>
</el-select>
@@ -157,9 +157,9 @@
width="55">
</el-table-column>
<template v-if="manyTabDate && formValidate.specType">
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80">
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="100">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
<span class="priceBox" v-text="scope.row[iii]" />
</template>
</el-table-column>
</template>
@@ -173,7 +173,7 @@
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="140">
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="145">
<template slot-scope="scope">
<el-input-number
size="small"
@@ -205,7 +205,7 @@
<!-- 商品详情-->
<div v-show="currentTab === 2">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
<Tinymce v-model="formValidate.content"></Tinymce>
</el-form-item>
</div>
<el-form-item style="margin-top:30px;">
@@ -237,6 +237,7 @@
class="submission"
size="small"
@click="handleSubmit('formValidate')"
v-hasPermi="['admin:seckill:update']"
>提交</el-button>
</el-form-item>
</el-form>
@@ -246,11 +247,13 @@
</template>
<script>
import Tinymce from '@/components/Tinymce/index'
import { productDetailApi, categoryApi } from '@/api/store'
import { shippingTemplatesList } from '@/api/logistics'
import { getSeckillList } from '@/libs/public'
import { seckillStoreSaveApi, seckillStoreUpdateApi, seckillStoreInfoApi } from '@/api/marketing'
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
import {Debounce} from '@/utils/validate'
const defaultObj = {
image: '',
images: '',
@@ -280,7 +283,7 @@
content: '',
specType: false,
id: 0,
timeId: '',
timeId: 1,
startTime: '',
stopTime: '',
timeVal: [],
@@ -314,7 +317,7 @@
}
export default {
name: "creatSeckill",
components: { CreatTemplates },
components: { CreatTemplates,Tinymce },
data() {
return {
pickerOptions: {
@@ -421,8 +424,10 @@
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
// tmp['value' + i] = { title: o.attrName }
// tmpTab['value' + i] = ''
tmp[o.attrName] = { title: o.attrName };
tmpTab[o.attrName] = '';
})
this.manyTabTit = tmp
this.manyTabDate = tmpTab
@@ -525,6 +530,7 @@
isShow: info.isShow,
tempId: info.tempId,
attr: info.attr,
attrValue: info.attrValue,
selectRule: info.selectRule,
content: info.content,
specType: info.specType,
@@ -539,29 +545,32 @@
num: 1
}
if(info.specType){
info.attrValues.forEach((row) => {
row.quota = row.stock;
});
this.$nextTick(() => {
info.attrValues.forEach((row) => {
info.attrValue.forEach((row) => {
row.quota = row.stock;
row.attrValue = JSON.parse(row.attrValue);
for (let attrValueKey in row.attrValue) {
row[attrValueKey] = row.attrValue[attrValueKey];
}
row.image = this.$selfUtil.setDomain(row.image)
this.$refs.multipleTable.toggleRowSelection(row, true);
this.$set(row, 'checked', true)
// this.$set(row, 'checked', true)
});
});
this.ManyAttrValue = info.attrValues
this.multipleSelection = info.attrValues
this.ManyAttrValue = info.attrValue
this.multipleSelection = info.attrValue
}else{
info.attrValue.forEach((row) => {
row.quota = row.stock;
});
this.ManyAttrValue = info.attrValue
this.formValidate.attr = []
// this.formValidate.attr = []
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
})
});
},
getSekllProdect(id) {
this.fullscreenLoading = true
@@ -570,14 +579,17 @@
this.formValidate = {
image: this.$selfUtil.setDomain(info.image),
imagess: JSON.parse(info.sliderImage),
title: info.title,
info: info.info,
// title: info.title,
title: info.storeName,
// info: info.info,
info: info.storeInfo,
quota: info.quota,
unitName: info.unitName,
sort: info.sort,
isShow: info.isShow,
tempId: info.tempId,
attr: info.attr,
attrValue: info.attrValue,
selectRule: info.selectRule,
content: info.content,
specType: info.specType,
@@ -585,18 +597,25 @@
giveIntegral: info.giveIntegral,
ficti: info.ficti,
timeId: Number(info.timeId),
startTime: info.startTime || '',
stopTime: info.stopTime || '',
// startTime: info.startTime || '',
startTime: info.startTimeStr || '',
// stopTime: info.stopTime || '',
stopTime: info.stopTimeStr || '',
status: info.status,
num: info.num,
timeVal: info.startTime && info.stopTime ? [info.startTime, info.stopTime] : []
timeVal: info.startTimeStr && info.stopTimeStr ? [info.startTimeStr, info.stopTimeStr] : [],
id: info.id
}
if(info.specType){
this.ManyAttrValue = info.attrValues;
this.ManyAttrValue = info.attrValue;
this.$nextTick(() => {
this.ManyAttrValue.forEach((item, index) => {
item.attrValue = JSON.parse(item.attrValue);
for (let attrValueKey in item.attrValue) {
item[attrValueKey] = item.attrValue[attrValueKey];
}
item.image = this.$selfUtil.setDomain(item.image)
if (item.checked) {
if (item.id) { // 设置自动选中逻辑只要id存在
this.$set(item, 'price', item.price)
this.$set(item, 'quota', item.quota)
this.$nextTick(() => {
@@ -607,7 +626,7 @@
});
}else{
this.ManyAttrValue = info.attrValue
this.formValidate.attr = []
// this.formValidate.attr = []
}
this.fullscreenLoading = false
}).catch(res => {
@@ -625,17 +644,20 @@
});
},
// 提交
handleSubmit(name) {
handleSubmit:Debounce(function(name) {
if(!this.formValidate.specType){
this.formValidate.attr = []
// this.formValidate.attr = []
this.formValidate.attrValue = this.ManyAttrValue
}else{
this.multipleSelection.forEach((row) => {
this.$set(row, 'checked', true)
});
// this.multipleSelection.forEach((row) => {
// this.$set(row, 'checked', true)
// });
this.formValidate.attrValue = this.multipleSelection
}
this.formValidate.images = JSON.stringify(this.formValidate.imagess)
this.formValidate.attrValue.forEach(item => {
item.attrValue = JSON.stringify(item.attrValue);
});
this.$refs[name].validate((valid) => {
if (valid) {
this.fullscreenLoading = true;
@@ -684,7 +706,7 @@
}
});
},
}),
handleSubmitUp() {
if (this.currentTab-- < 0) this.currentTab = 0;
},

View File

@@ -31,7 +31,7 @@
</el-form>
</div>
<router-link :to=" { path:'/marketing/seckill/creatSeckill/creat' }">
<el-button size="small" type="primary" class="mr10">添加秒杀商品</el-button>
<el-button size="small" type="primary" class="mr10" v-hasPermi="['admin:seckill:save']">添加秒杀商品</el-button>
</router-link>
</div>
<el-table
@@ -40,6 +40,7 @@
style="width: 100%"
size="mini"
ref="multipleTable"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
@@ -75,16 +76,9 @@
</div>
</template>
</el-table-column>
<el-table-column
label="活动标题"
prop="title"
min-width="180"
/>
<el-table-column
label="活动简介"
min-width="180"
prop="info"
/>
<el-table-column label="商品标题" prop="title" min-width="300" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="活动简介" min-width="300" prop="info" :show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="原价"
prop="otPrice"
@@ -111,10 +105,16 @@
prop="statusName"
/>
<el-table-column
label="状态"
label="创建时间"
prop="createTime"
min-width="150"
/>
<el-table-column
label="状态"
min-width="80"
fixed="right"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="checkPermi(['admin:seckill:update:status'])">
<el-switch
v-model="scope.row.status"
:active-value="1"
@@ -125,17 +125,17 @@
/>
</template>
</el-table-column>
<el-table-column
label="创建时间"
prop="createTime"
min-width="150"
/>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<el-table-column label="操作" min-width="120" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to="{ path:'/marketing/seckill/creatSeckill/updeta/' + scope.row.productId + '/' + scope.row.id}">
<el-button type="text" size="small">编辑</el-button>
<el-button type="text" size="small" v-hasPermi="['admin:seckill:info']">编辑</el-button>
</router-link>
<el-button v-if="scope.row.killStatus !== 2 " type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" class="mr10">删除</el-button>
<el-button v-if="scope.row.killStatus !== 2 "
type="text" size="small"
@click="handleDelete(scope.row.id, scope.$index)"
class="mr10"
v-hasPermi="['admin:seckill:delete']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -157,6 +157,7 @@
<script>
import { seckillStoreListApi, seckillStoreDeleteApi, seckillStoreUpdateApi, seckillStoreStatusApi } from '@/api/marketing'
import { getSeckillList } from '@/libs/public'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: "SeckillList",
data() {
@@ -184,6 +185,7 @@
this.getList()
},
methods: {
checkPermi,
// 订单删除
handleDelete(id, idx) {
this.$modalSure().then(() => {
@@ -227,5 +229,8 @@
</script>
<style scoped>
.el-table__body {
width: 100%;
table-layout: fixed !important;
}
</style>

View File

@@ -92,7 +92,7 @@
<script>
import {required, num} from "@/utils/validate";
import {validatorDefaultCatch} from "@/libs/dialog";
import { orderMarkApi, editPriceApi, orderRefundApi } from '@/api/order';
import { orderMarkApi, updatePriceApi, orderRefundApi } from '@/api/order';
export default {
name: "PriceChange",
components: {},
@@ -165,9 +165,9 @@
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = price;
data.payPrice = price;
data.orderNo = opt.orderId;
editPriceApi(data).then(() => {
updatePriceApi(data).then(() => {
// that.change = false;
this.$emit("closechange", false);
that.$dialog.success("改价成功");

View File

@@ -436,6 +436,7 @@ export default {
.public-wrapper .conter{padding:0 0.3rem;}
.public-wrapper .conter .item{border-bottom:1px solid #f7f7f7;height:0.7rem;font-size:0.24rem;}
.public-wrapper .conter .item .turnover{color:#d84242;}
.statistical-page {margin-top:-50px;}
.statistical-page .navs{width:100%;height:0.96rem;background-color:#fff;overflow:hidden;line-height:0.96rem;position:fixed;top:0;left:0;z-index:9;}
.statistical-page .navs .list{overflow-y:hidden;overflow-x:auto;white-space: nowrap;-webkit-overflow-scrolling: touch;
width: 100%;}

View File

@@ -124,6 +124,7 @@
<style scoped lang="scss">
.order-index{
background: #f5f5f5;
margin-top: -50px;
}
.order-index .header{background:url("../../../assets/imgs/orderIndex.png") no-repeat;background-size:100% 100%;width:100%;height:3.02rem;padding:0.45rem 0.3rem 0 0.3rem;}
.order-index .header .item{flex:1;-webkit-flex:1;-o-flex:1;-ms-flex:1;text-align:center;font-size:0.24rem;color:#fff;}

View File

@@ -4,7 +4,7 @@
<div class="order-num acea-row row-between-wrapper">
<div class="num line1">订单号{{ orderId }}</div>
<div class="name line1">
<span class="iconfont icon-yonghu2"></span>{{ delivery.nickname }}
<span class="iconfont iconios-contact"></span>{{ delivery.nikeName }}
</div>
</div>
<div class="address">

View File

@@ -13,7 +13,7 @@
class="remarks acea-row row-between-wrapper"
v-if="$route.params.goname != 'looks'"
>
<span class="iconfont icon-zhinengkefu-"></span>
<span class="iconfont iconios-flag"></span>
<input
type="button"
class="line1"
@@ -25,12 +25,11 @@
/>
</div>
<div class="orderingUser acea-row row-middle">
<span class="iconfont icon-yonghu2"></span>{{ orderInfo.realName }}
<span class="iconfont iconmd-contact"></span>{{ orderInfo.realName }}
</div>
<div class="address">
<div class="name">
{{ orderInfo.realName
}}<span class="phone">{{ orderInfo.userPhone }}</span>
{{ orderInfo.realName}}<span class="phone">{{ orderInfo.userPhone }}</span>
</div>
<div>{{ orderInfo.userAddress }}</div>
</div>
@@ -49,7 +48,7 @@
<div class="info line2">
{{ item.info.productName }}
</div>
<div class="attr">{{ item.info.sku }}</div>
<div class="attr overflow">{{ item.info.sku }}</div>
</div>
</div>
<div class="money">
@@ -61,17 +60,13 @@
</div>
<div class="public-total">
{{ orderInfo.totalNum }}件商品应支付
<span class="money">{{ orderInfo.payPrice }}</span> ( 邮费 ¥{{
orderInfo.payPostage
}}
)
<span class="money">{{ orderInfo.payPrice }}</span> ( 邮费 ¥{{orderInfo.payPostage }})
</div>
<div class="wrapper">
<div class="item acea-row row-between">
<div>订单编号</div>
<div class="conter acea-row row-middle row-right">
{{ orderInfo.orderId
}}
{{ orderInfo.orderId }}
<span
class="copy copy-data"
:data-clipboard-text="orderInfo.orderId"
@@ -86,7 +81,7 @@
<div class="item acea-row row-between">
<div>支付状态</div>
<div class="conter">
{{ orderInfo.paid == 1 ? "已支付" : "未支付" }}
{{ orderInfo.statusStr.value }}
</div>
</div>
<div class="item acea-row row-between">
@@ -369,13 +364,13 @@ export default {
.pos-order-goods .goods .picTxt .pictrue img{width:100%;height:100%;border-radius:0.06rem;}
.pos-order-goods .goods .picTxt .text{width:3.65rem;height:1.3rem;}
.pos-order-goods .goods .picTxt .text .info{font-size:0.28rem;color:#282828;}
.pos-order-goods .goods .picTxt .text .attr{font-size:0.2rem;color:#999;height: 0.8rem;
line-height: 0.8rem;}
.pos-order-goods .goods .picTxt .text .attr{font-size:0.2rem;color:#999;height: 0.8rem; line-height: 0.8rem;}
.overflow{overflow: hidden;text-overflow: ellipsis; white-space: nowrap;width: 5rem;}
.pos-order-goods .goods .money{width:1.64rem;text-align:right;font-size:0.28rem;}
.pos-order-goods .goods .money .x-money{color:#282828;}
.pos-order-goods .goods .money .num{color:#ff9600;margin:0.05rem 0;}
.pos-order-goods .goods .money .y-money{color:#999;text-decoration:line-through;}
.order-details .header{padding:0 0.3rem;height:1.5rem;}
.order-details .header{padding:0 0.3rem;height:1.5rem;margin-top: -50px;}
.order-details .header.on{background-color:#666!important;}
.order-details .header .pictrue{width:1.1rem;height:1.1rem;}
.order-details .header .pictrue img{width:100%;height:100%;}

View File

@@ -85,11 +85,8 @@
</div>
</template>
<div class="public-total">
{{ item.totalNum }}件商品应支付
<span class="money">{{ item.payPrice }}</span> ( 邮费 ¥{{
item.totalPostage
}}
)
{{ item.totalNum ? item.totalNum : 1 }}件商品应支付
<span class="money">{{ item.payPrice }}</span> ( 邮费 ¥{{item.totalPostage ? item.totalPostage : 0}})
</div>
<div class="operation acea-row row-between-wrapper">
<div class="more">
@@ -102,7 +99,7 @@
<!-- </div>-->
</div>
<div class="acea-row row-middle">
<div class="bnt" @click="modify(item, 0)" v-if="where.status === 'unPaid'">
<div class="bnt" @click="modify(item, 0)" v-if="!item.isAlterPrice && item.paid == false">
一键改价
</div>
<div class="bnt" @click="modify(item, 1)">订单备注</div>
@@ -367,12 +364,12 @@
.pos-order-goods .goods .picTxt .text{width:3.65rem;height:1.3rem;}
.pos-order-goods .goods .picTxt .text .info{font-size:0.28rem;color:#282828;}
.pos-order-goods .goods .picTxt .text .attr{font-size:0.2rem;color:#999;height: 0.8rem;
line-height: 0.8rem;}
line-height: 0.8rem;width: 5rem;overflow: hidden;text-overflow: ellipsis; white-space: nowrap;}
.pos-order-goods .goods .money{width:1.64rem;text-align:right;font-size:0.28rem;height: 1.3rem;}
.pos-order-goods .goods .money .x-money{color:#282828;}
.pos-order-goods .goods .money .num{color:#ff9600;margin:0.05rem 0;}
.pos-order-goods .goods .money .y-money{color:#999;text-decoration:line-through;}
.pos-order-list{background: #f5f5f5;}
.pos-order-list{background: #f5f5f5;margin-top: -50px;}
.pos-order-list .nav{width:100%;height:0.96rem;background-color:#fff;font-size:0.3rem;color:#282828;position:fixed;top:0;left:0;z-index: 66;}
.pos-order-list .nav .item.on{color:#2291f8;}
.pos-order-list .list{margin-top:0.2rem;}

View File

@@ -1,17 +1,10 @@
<template>
<div class="divBox">
<div class="divBox relative">
<el-card class="box-card">
<div slot="header" class="clearfix">
<!--<el-tabs v-model="tableFrom.type" @tab-click="getList">-->
<!--<el-tab-pane label="全部订单" name=""/>-->
<!--<el-tab-pane label="普通订单" name="1"/>-->
<!--<el-tab-pane label="拼团订单" name="2"/>-->
<!--<el-tab-pane label="秒杀订单" name="3"/>-->
<!--<el-tab-pane label="砍价订单" name="4"/>-->
<!--</el-tabs>-->
<div class="clearfix">
<div class="container">
<el-form size="small" label-width="100px">
<el-form-item label="订单状态:">
<el-form-item label="订单状态:" v-if="checkPermi(['admin:order:status:num'])">
<el-radio-group v-model="tableFrom.status" type="button" @change="seachList">
<el-radio-button label="all">全部 {{ '(' +orderChartType.all?orderChartType.all:0 + ')' }}</el-radio-button>
<el-radio-button label="unPaid">未支付 {{ '(' +orderChartType.unPaid?orderChartType.unPaid:0+ ')' }}</el-radio-button>
@@ -31,8 +24,8 @@
</el-radio-group>
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 220px;" @change="onchangeTime" />
</el-form-item>
<el-form-item label="订单类型:" class="width100">
<el-select v-model="tableFrom.type" placeholder="请选择" class="selWidth" @change="seachList">
<!-- <el-form-item label="订单类型:" class="width100">
<el-select v-model="tableFrom.type" clearable placeholder="请选择" class="selWidth" @change="seachList">
<el-option
v-for="item in options"
:key="item.value"
@@ -40,53 +33,41 @@
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="订单号:" class="width100">
</el-form-item> -->
<el-form-item label="订单号:" class="width100">
<el-input v-model="tableFrom.orderNo" placeholder="请输入订单号" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
</el-input>
</el-form-item>
<el-form-item class="width100">
<el-button size="small" @click="exports" v-hasPermi="['admin:export:excel:order']">导出</el-button>
</el-form-item>
</el-form>
</div>
<cards-data :cardLists="cardLists"></cards-data>
</div>
<el-table
</el-card>
<div class="mt20">
<!-- <cards-data :cardLists="cardLists" v-if="checkPermi(['admin:order:list:data'])"></cards-data> -->
</div>
<el-card class="box-card">
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
class="table"
highlight-current-row
@selection-change="handleSelectionChange"
:header-cell-style=" {fontWeight:'bold'}"
:row-key="(row)=>{ return row.orderId}"
>
<!--<el-table-column type="expand">-->
<!--<template slot-scope="props">-->
<!--<el-form label-position="left" inline class="demo-table-expand">-->
<!--<el-form-item label="商品总价:">-->
<!--<span>{{ props.row.totalPrice | filterEmpty }}</span>-->
<!--</el-form-item>-->
<!--<el-form-item label="推广人:">-->
<!--<span>{{ props.row.spreadInfo.id + ' / ' + props.row.spreadInfo.name }}</span>-->
<!--</el-form-item>-->
<!--<el-form-item label="用户备注:">-->
<!--<span>{{ props.row.mark | filterEmpty }}</span>-->
<!--</el-form-item>-->
<!--<el-form-item label="商家备注:">-->
<!--<span>{{ props.row.remark | filterEmpty }}</span>-->
<!--</el-form-item>-->
<!--<el-form-item label="核销码:" v-if="props.row.verifyCode">-->
<!--<span>{{ props.row.verifyCode }}</span>-->
<!--</el-form-item>-->
<!--</el-form>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column
<!-- @selection-change="handleSelectionChange" -->
<!-- <el-table-column
type="selection"
:reserve-selection="true"
width="55"
/>
/> -->
<el-table-column
label="订单号"
min-width="170"
min-width="210"
>
<template slot-scope="scope">
<span style="display: block;" v-text="scope.row.orderId" />
@@ -96,32 +77,42 @@
<el-table-column
prop="orderType"
label="订单类型"
min-width="130"
min-width="110"
/>
<el-table-column
prop="realName"
label="用户信息"
min-width="130"
label="收货人"
min-width="100"
/>
<el-table-column
label="商品信息"
min-width="400"
>
<template slot-scope="scope">
<div v-if=" scope.row.productList && scope.row.productList.length">
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle" style="flex-wrap: inherit;">
<div class="demo-image__preview mr10">
<el-image
:src="val.info.image"
:preview-src-list="[val.info.image]"
/>
</div>
<div>
<span class="tabBox_tit mr10">{{ val.info.productName + ' | ' }}{{ val.info.sku ? val.info.sku:'-' }}</span>
<span class="tabBox_pice">{{ '¥'+ val.info.price ? val.info.price + ' x '+ val.info.payNum : '-' }}</span>
<el-popover trigger="hover" placement="right" :open-delay="800">
<div v-if=" scope.row.productList && scope.row.productList.length" slot="reference">
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle" style="flex-wrap: inherit;">
<div class="demo-image__preview mr10">
<el-image
:src="val.info.image"
:preview-src-list="[val.info.image]"
/>
</div>
<div class="text_overflow">
<span class="tabBox_tit mr10">{{ val.info.productName + ' | ' }}{{ val.info.sku ? val.info.sku:'-' }}</span>
<span class="tabBox_pice">{{ '¥'+ val.info.price ? val.info.price + ' x '+ val.info.payNum : '-' }}</span>
</div>
</div>
</div>
</div>
<div class="pup_card" v-if=" scope.row.productList && scope.row.productList.length">
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle" style="flex-wrap: inherit;">
<div class="">
<span class="tabBox_tit mr10">{{ val.info.productName + ' | ' }}{{ val.info.sku ? val.info.sku:'-' }}</span>
<span class="tabBox_pice">{{ '¥'+ val.info.price ? val.info.price + ' x '+ val.info.payNum : '-' }}</span>
</div>
</div>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
@@ -139,29 +130,36 @@
</el-table-column>
<el-table-column
label="订单状态"
min-width="180"
min-width="100"
>
<template slot-scope="scope">
<div v-if="scope.row.refundStatus === 1 || scope.row.refundStatus === 2" class="refunding">
<b style="color: #f124c7;">{{scope.row.statusStr.value}}</b>
<span>退款原因{{scope.row.refundReasonWap}}</span>
<span>备注说明{{scope.row.refundReasonWapExplain}}</span>
<span>退款时间{{scope.row.refundReasonTime}}</span>
<span class="acea-row">
退款凭证
<template v-if="scope.row.refundReasonWapImg">
<div v-for="(item, index) in scope.row.refundReasonWapImg.split(',')" :key="index" class="demo-image__preview" style="width: 35px;height: auto;display: inline-block;">
<el-image
:src="item"
:preview-src-list="[item]"
/>
<div>
<div v-if="scope.row.refundStatus === 1 || scope.row.refundStatus === 2" class="refunding" >
<template>
<el-popover trigger="hover" placement="left" :open-delay="800">
<b style="color: #f124c7;" slot="reference">{{scope.row.statusStr.value}}</b>
<div class="pup_card flex-column">
<span>退款原因:{{scope.row.refundReasonWap}}</span>
<span>备注说明:{{scope.row.refundReasonWapExplain}}</span>
<span>退款时间:{{scope.row.refundReasonTime}}</span>
<span class="acea-row">
退款凭证:
<template v-if="scope.row.refundReasonWapImg">
<div v-for="(item, index) in scope.row.refundReasonWapImg.split(',')" :key="index" class="demo-image__preview" style="width: 35px;height: auto;display: inline-block;">
<el-image
:src="item"
:preview-src-list="[item]"
/>
</div>
</template>
<span v-else style="display: inline-block">无</span>
</span>
</div>
</el-popover>
</template>
</div>
</template>
<!--<img :src="scope.row.refundReasonWapImg" v-if="scope.row.refundReasonWapImg" >-->
<span v-else style="display: inline-block"></span>
</span>
</div>
<span v-else>{{ scope.row.statusStr.value }}</span>
<span v-else>{{ scope.row.statusStr.value }}</span>
</div>
</template>
</el-table-column>
<el-table-column
@@ -171,21 +169,22 @@
/>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.paid === false" type="text" size="small" @click="edit(scope.row)" class="mr10">编辑</el-button>
<el-button v-if="scope.row.statusStr.key === 'notShipped' && scope.row.refundStatus ===0" type="text" size="small" class="mr10" @click="sendOrder(scope.row)">发送货</el-button>
<el-button v-if=" scope.row.statusStr.key === 'toBeWrittenOff' && scope.row.paid == true && scope.row.refundStatus === 0 " type="text" size="small" class="mr10" @click="onWriteOff(scope.row)">立即核销</el-button>
<el-button v-if="scope.row.paid === false" type="text" size="small" @click="edit(scope.row)" class="mr10" v-hasPermi="['admin:order:update:price']">编辑</el-button>
<el-button v-if="scope.row.statusStr.key === 'notShipped' && scope.row.refundStatus ===0" type="text" size="small" class="mr10" @click="sendOrder(scope.row)" v-hasPermi="['admin:order:send']">发送货</el-button>
<el-button v-if=" scope.row.statusStr.key === 'toBeWrittenOff' && scope.row.paid == true && scope.row.refundStatus === 0 " type="text" size="small" class="mr10" v-hasPermi="['admin:order:write:update']" @click="onWriteOff(scope.row)">立即核销</el-button>
<el-dropdown trigger="click">
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="onOrderDetails(scope.row.orderId)">订单详情</el-dropdown-item>
<el-dropdown-item @click.native="onOrderLog(scope.row.orderId)">订单记录</el-dropdown-item>
<el-dropdown-item @click.native="onOrderMark(scope.row)">订单备注</el-dropdown-item>
<el-dropdown-item v-show="scope.row.refundStatus === 1" @click.native="onOrderRefuse(scope.row)">拒绝退款</el-dropdown-item>
<el-dropdown-item @click.native="onOrderDetails(scope.row.orderId)" v-if="checkPermi(['admin:order:info'])">订单详情</el-dropdown-item>
<el-dropdown-item @click.native="onOrderLog(scope.row.orderId)" v-if="checkPermi(['admin:order:status:list'])">订单记录</el-dropdown-item>
<el-dropdown-item @click.native="onOrderMark(scope.row)" v-if="checkPermi(['admin:order:mark'])">订单备注</el-dropdown-item>
<el-dropdown-item v-if="scope.row.refundStatus === 1 && checkPermi(['admin:order:refund:refuse'])" @click.native="onOrderRefuse(scope.row)">拒绝退款</el-dropdown-item>
<!--v-show="((scope.row.statusStr.key !== 'refunded' && scope.row.statusStr.key !== 'unPaid') && (parseFloat(scope.row.payPrice) >= parseFloat(scope.row.refundPrice))) || (scope.row.payPrice == 0 && [0,1].indexOf(scope.row.refundStatus) !== -1)"-->
<el-dropdown-item v-show="scope.row.refundStatus === 1" @click.native="onOrderRefund(scope.row)">立即退款</el-dropdown-item>
<el-dropdown-item v-show="scope.row.statusStr.key === 'deleted'" @click.native="handleDelete(scope.row, scope.$index)">删除订单</el-dropdown-item>
<el-dropdown-item v-if="scope.row.refundStatus === 1 && checkPermi(['admin:order:refund'])" @click.native="onOrderRefund(scope.row)" >立即退款</el-dropdown-item>
<el-dropdown-item v-if="scope.row.statusStr.key === 'deleted' && checkPermi(['admin:order:delete'])" @click.native="handleDelete(scope.row, scope.$index)">删除订单</el-dropdown-item>
<el-dropdown-item v-if="scope.row.statusStr.key !== 'unPaid'" @click.native="onOrderPrint(scope.row)" >打印小票</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@@ -203,7 +202,6 @@
/>
</div>
</el-card>
<!--编辑-->
<el-dialog
title="编辑订单"
@@ -211,6 +209,7 @@
width="500px"
:before-close="handleClose">
<zb-parser
v-if="dialogVisible"
:form-id="104"
:is-create="isCreate"
:edit-data="editData"
@@ -275,6 +274,7 @@
<!--拒绝退款-->
<el-dialog
title="拒绝退款原因"
v-if="RefuseVisible"
:visible.sync="RefuseVisible"
width="500px"
:before-close="RefusehandleClose">
@@ -306,7 +306,7 @@
</template>
<script>
import { orderListDataApi, orderStatusNumApi, writeUpdateApi, orderListApi, orderUpdateApi, orderLogApi, orderMarkApi, orderDeleteApi, orderRefuseApi, orderRefundApi } from '@/api/order'
import { orderListDataApi, orderStatusNumApi, writeUpdateApi, orderListApi, updatePriceApi, orderLogApi, orderMarkApi, orderDeleteApi, orderRefuseApi, orderRefundApi,orderPrint } from '@/api/order'
import cardsData from '@/components/cards/index'
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
import detailsFrom from './orderDetail'
@@ -315,6 +315,8 @@
import { storeStaffListApi } from '@/api/storePoint'
import Cookies from 'js-cookie'
import { isWriteOff } from "@/utils";
import {orderExcelApi} from '@/api/store'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'orderlistDetails',
components: {
@@ -326,13 +328,6 @@
},
data() {
return {
options: [{
value: 0,
label: '商城订单'
}, {
value: 1,
label: '视频号订单'
}],
RefuseVisible: false,
RefuseData:{},
orderId: '',
@@ -362,26 +357,35 @@
dateLimit: '',
orderNo: '',
page: 1,
limit: 20,
type: ''
limit: 10,
type: 0
},
orderChartType: {},
timeVal: [],
fromList: this.$constants.fromList,
fromType:[
{value:'all',text:'全部'},
{value:'info',text:'普通'},
{value:'pintuan',text:'拼团'},
{value:'bragin',text:'砍价'},
{value:'miaosha',text:'秒杀'},
],
selectionList: [],
ids: '',
orderids: '',
cardLists: [],
isWriteOff: isWriteOff(),
proType: 0
proType: 0,
active:false,
}
},
mounted() {
this.getList();
this.getOrderStatusNum();
this.getOrderListData();
// this.getOrderListData();
},
methods: {
checkPermi,
resetFormRefundhandler(){
this.refundVisible = false
},
@@ -404,6 +408,7 @@
seachList() {
this.tableFrom.page = 1
this.getList()
this.getOrderStatusNum()
},
// 拒绝退款
RefusehandleClose() {
@@ -500,7 +505,7 @@
this.onOrderLog()
},
handleClose() {
this.dialogVisible = false
this.dialogVisible = false;
},
// 备注
onOrderMark(row) {
@@ -525,7 +530,7 @@
this.selectionList = val
const data = []
this.selectionList.map((item) => {
data.push(item.id)
data.push(item.orderId)
})
this.ids = data.join(',')
},
@@ -535,7 +540,7 @@
this.tableFrom.page = 1
this.getList();
this.getOrderStatusNum();
this.getOrderListData();
// this.getOrderListData();
},
// 具体日期
onchangeTime (e) {
@@ -544,12 +549,11 @@
this.tableFrom.page = 1
this.getList();
this.getOrderStatusNum();
this.getOrderListData();
// this.getOrderListData();
},
// 编辑
edit(row) {
this.dialogVisible = true
this.orderId = row.id
this.orderId = row.orderId
this.editData = {
orderId: row.orderId,
totalPrice: row.totalPrice,
@@ -558,9 +562,14 @@
payPostage: row.payPostage,
gainIntegral: row.gainIntegral,
}
this.dialogVisible = true
},
handlerSubmit(formValue) {
orderUpdateApi(formValue, {id: this.orderId}).then(data => {
let data = {
orderNo:formValue.orderId,
payPrice:formValue.payPrice
}
updatePriceApi(data).then(data => {
this.$message.success('编辑数据成功')
this.dialogVisible = false
this.getList()
@@ -573,6 +582,7 @@
this.tableData.data = res.list || [];
this.tableData.total = res.total;
this.listLoading = false
this.checkedCities = this.$cache.local.has('order_stroge') ? this.$cache.local.getJSON('order_stroge') : this.checkedCities;
}).catch(() => {
this.listLoading = false
})
@@ -581,16 +591,16 @@
getOrderListData() {
orderListDataApi({dateLimit:this.tableFrom.dateLimit}).then(res => {
this.cardLists = [
{ name: '订单数量', count: res.count },
{ name: '订单金额', count: res.amount },
{ name: '微信支付金额', count: res.weChatAmount },
{ name: '余额支付金额', count: res.yueAmount }
{ name: '订单数量', count: res.count,color:'#1890FF',class:'one',icon:'icondingdan' },
{ name: '订单金额', count: res.amount, color:'#A277FF',class:'two',icon:'icondingdanjine' },
{ name: '微信支付金额', count: res.weChatAmount, color:'#EF9C20',class:'three',icon:'iconweixinzhifujine' },
{ name: '余额支付金额', count: res.yueAmount,color:'#1BBE6B',class:'four',icon:'iconyuezhifujine2' }
]
});
},
// 获取各状态数量
getOrderStatusNum() {
orderStatusNumApi({dateLimit:this.tableFrom.dateLimit}).then(res => {
orderStatusNumApi({dateLimit:this.tableFrom.dateLimit,type:this.tableFrom.type}).then(res => {
this.orderChartType = res;
});
},
@@ -602,11 +612,33 @@
this.tableFrom.limit = val
this.getList()
},
exports(){
let data = {
dateLimit:this.tableFrom.dateLimit,
orderNo:this.tableFrom.orderNo,
status:this.tableFrom.status,
type:this.tableFrom.type
};
orderExcelApi(data).then(res=>{
window.open(res.fileName);
})
},
//打印小票
onOrderPrint(data){
orderPrint(data.orderId).then(res=>{
this.$modal.msgSuccess('打印成功');
}).catch(error=>{
this.$modal.msgError(error.message)
})
}
}
}
</script>
<style lang="scss" scoped>
.el-table__body {
width: 100%;
table-layout: fixed !important;
}
.demo-table-expand{
/deep/label{
width: 83px !important;
@@ -635,4 +667,28 @@
/*padding: 5px 0;*/
box-sizing: border-box;
}
.text_overflow{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 400px;
}
.pup_card{
width: 200px;
border-radius: 5px;
padding: 5px;
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
}
.flex-column{
display: flex;
flex-direction: column;
}
.mt20{
margin-top:20px
}
.relative{
position: relative;
}
</style>

View File

@@ -9,7 +9,7 @@
<div class="description" v-loading="loading">
<div class="title">用户信息</div>
<div class="acea-row">
<div class="description-term">用户昵称{{orderDatalist.realName}}</div>
<div class="description-term">用户昵称{{orderDatalist.nikeName}}</div>
<div class="description-term">绑定电话{{orderDatalist.phone ? orderDatalist.phone : '无'}}</div>
</div>
<el-divider></el-divider>
@@ -29,10 +29,12 @@
<div class="description-term">支付邮费{{orderDatalist.payPostage}}</div>
<div class="description-term">优惠券金额{{orderDatalist.couponPrice}}</div>
<div class="description-term">实际支付{{orderDatalist.payPrice}}</div>
<div class="description-term">抵扣金额{{orderDatalist.deductionPrice}}</div>
<div class="description-term fontColor3" v-if="orderDatalist.refundPrice">退款金额{{orderDatalist.refundPrice}}</div>
<div class="description-term" v-if="orderDatalist.useIntegral">使用积分{{orderDatalist.useIntegral}}</div>
<div class="description-term" v-if="orderDatalist.backIntegral">退回积分{{orderDatalist.backIntegral}}</div>
<div class="description-term">创建时间{{orderDatalist.createTime}}</div>
<div class="description-term" v-if="orderDatalist.refundReasonTime">退款时间{{orderDatalist.refundReasonTime}}</div>
<div class="description-term">支付方式{{orderDatalist.payTypeStr}}</div>
<div class="description-term">推广人{{orderDatalist.spreadName | filterEmpty}}</div>
<div class="description-term" v-if="orderDatalist.shippingType === 2 && orderDatalist.statusStr.key === 'notShipped'">门店名称{{orderDatalist.storeName}}</div>
@@ -51,7 +53,9 @@
<div class="title">物流信息</div>
<div class="acea-row">
<div class="description-term">快递公司{{orderDatalist.deliveryName}}</div>
<div class="description-term">快递单号{{orderDatalist.deliveryId}}<el-button type="primary" size="mini" @click="openLogistics" style="margin-left: 5px">物流查询</el-button></div>
<div class="description-term">快递单号{{orderDatalist.deliveryId}}
<el-button type="primary" size="mini" @click="openLogistics" style="margin-left: 5px" v-hasPermi="['admin:order:logistics:info']">物流查询</el-button>
</div>
</div>
</template>
<template v-if="orderDatalist.deliveryType === 'send'">
@@ -193,8 +197,8 @@ export default {
}
.title {
margin-bottom: 10px;
color: #17233d;
margin-bottom: 14px;
color: #303133;
font-weight: 500;
font-size: 14px;
}
@@ -206,6 +210,7 @@ export default {
line-height: 20px;
width: 50%;
font-size: 12px;
color: #606266;
}
/deep/ .el-divider--horizontal {
margin: 12px 0 !important;

View File

@@ -12,7 +12,7 @@
<el-form-item label="发货类型:" prop="expressId">
<el-radio-group v-model="formItem.expressRecordType" @change="changeRadio(formItem.expressRecordType)">
<el-radio label="1">手动填写</el-radio>
<el-radio label="2">电子面单打印</el-radio>
<el-radio label="2" v-if="checkPermi(['admin:order:sheet:info'])">电子面单打印</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="快递公司:" prop="expressCode">
@@ -67,10 +67,16 @@
<el-input v-model="formItem.deliveryTel" placeholder="请输入送货人电话" style="width:80%;"></el-input>
</el-form-item>
</div>
<div>
<el-form-item label="" >
<div style="color:#CECECE;">顺丰请输入单号收件人或寄件人手机号后四位</div>
<div style="color:#CECECE;">例如SF000000000000:3941</div>
</el-form-item>
</div>
</el-form>
<div slot="footer">
<el-button size="mini" type="primary" @click="putSend('formItem')">提交</el-button>
<el-button size="mini" @click="cancel('formItem')">取消</el-button>
<el-button type="primary" @click="putSend('formItem')">提交</el-button>
<el-button @click="cancel('formItem')">取消</el-button>
</div>
</el-dialog>
</template>
@@ -78,7 +84,8 @@
<script>
import {orderSendApi, sheetInfoApi} from '@/api/order'
import {expressAllApi, exportTempApi} from '@/api/sms'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
import {Debounce} from '@/utils/validate'
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
@@ -146,6 +153,7 @@
mounted() {
},
methods: {
checkPermi,
// 默认信息
sheetInfo() {
sheetInfoApi().then(async res => {
@@ -191,7 +199,7 @@
})
},
// 提交
putSend(name) {
putSend:Debounce(function(name) {
this.formItem.orderNo = this.orderId;
this.$refs[name].validate((valid) => {
if (valid) {
@@ -205,7 +213,7 @@
this.$message.error('请填写信息');
}
})
},
}),
handleClose() {
this.cancel('formItem');
},

View File

@@ -11,7 +11,7 @@
</el-form-item>
</el-form>
<div slot="footer">
<el-button size="mini" type="primary" @click="putSend('formItem')">提交</el-button>
<el-button size="mini" type="primary" @click="putSend('formItem')" v-hasPermi="['admin:order:video:send']">提交</el-button>
<el-button size="mini" @click="cancel('formItem')">取消</el-button>
</div>
</el-dialog>
@@ -19,6 +19,7 @@
<script>
import {videoSendApi, sheetInfoApi, companyGetListApi} from '@/api/order'
import {Debounce} from '@/utils/validate'
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
@@ -67,7 +68,7 @@
})
},
// 提交
putSend(name) {
putSend:Debounce(function(name) {
this.formItem.orderNo = this.orderId;
this.$refs[name].validate((valid) => {
if (valid) {
@@ -81,7 +82,7 @@
this.$message.error('请填写信息');
}
})
},
}),
handleClose() {
this.cancel('formItem');
},

View File

@@ -24,7 +24,7 @@
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown">{{cutNUm}}</el-button>
<el-button size="mini" :disabled=!this.canClick @click="cutDown" v-hasPermi="['admin:pass:send:code']">{{cutNUm}}</el-button>
</div>
</el-form-item>
</template>

View File

@@ -50,7 +50,7 @@
</template>
<el-form-item class="maxInpt">
<el-button v-if="current === 0" type="primary" @click="handleSubmit1('formInline',current)" class="mb20 width100">下一步</el-button>
<el-button v-if="current === 1" type="primary" @click="handleSubmit2('formInline',current)" class="mb20 width100">提交</el-button>
<el-button v-if="current === 1" type="primary" @click="handleSubmit2('formInline',current)" class="mb20 width100" v-hasPermi="['admin:pass:update:phone']">提交</el-button>
<el-button v-if="current === 2" type="primary" @click="handleSubmit('formInline',current)" class="mb20 width100">登录</el-button>
<el-button @click="returns('formInline')" class="width100" style="margin-left: 0px;">返回</el-button>
</el-form-item>

View File

@@ -16,7 +16,7 @@
:key="passwordType"
v-model="formInline.password"
:type="passwordType"
placeholder="请输入短信平台密码/token"
placeholder="密码"
tabindex="2"
auto-complete="off"
prefix-icon="el-icon-lock"
@@ -43,11 +43,11 @@
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown">{{cutNUm}}</el-button>
<el-button size="mini" :disabled=!this.canClick @click="cutDown" v-hasPermi="['admin:pass:send:code']">{{cutNUm}}</el-button>
</div>
</el-form-item>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')">注册</el-button>
<el-button type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo">立即登录</el-button>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')" v-hasPermi="['admin:pass:register']">注册</el-button>
<el-button type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo" v-hasPermi="['admin:pass:login']">立即登录</el-button>
</el-form>
</div>
</template>

View File

@@ -8,7 +8,7 @@
</el-tabs>
<!--短信列表-->
<div class="note" v-if="(tableFrom.type==='sms' && sms.open === 1) || (tableFrom.type==='expr_query' && query.open === 1) || (tableFrom.type==='copy' && copy.open === 1) || (tableFrom.type==='expr_dump' && dump.open === 1)">
<div class="filter-container mb20" v-if="tableFrom.type === 'sms'">
<div class="filter-container flex-between mb20" v-if="tableFrom.type === 'sms'">
<div class="demo-input-suffix">
<span class="seachTiele">短信状态</span>
<el-radio-group v-model="tableFrom.status" size="small" @change="getList" class="mr20">
@@ -17,18 +17,20 @@
<el-radio-button label="2">失败</el-radio-button>
<el-radio-button label="0">发送中</el-radio-button>
</el-radio-group>
<router-link :to="{path: '/operation/systemSms/template'}">
<el-button type="primary" size="mini" class="mr20">短信模板</el-button>
</router-link>
<el-button size="mini" @click="editSign">修改签名</el-button>
</div>
<div>
<router-link :to="{path: '/operation/systemSms/template'}">
<el-button type="primary" class="mr20" v-hasPermi="['admin:sms:temps']">短信模板</el-button>
</router-link>
<el-button @click="editSign" v-hasPermi="['admin:sms:modify:sign']">修改签名</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
highlight-current-row
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
v-for="(item, index) in columns2" :key="index"
@@ -149,6 +151,7 @@
<el-input
v-model="formInline.phone"
placeholder="请输入您的手机号"
:disabled="true"
prefix-icon="el-icon-phone-outline"
>
</el-input>
@@ -166,9 +169,12 @@
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown">{{cutNUm}}</el-button>
<el-button size="mini" :disabled=!this.canClick @click="cutDown" v-hasPermi="['admin:pass:send:code']">{{cutNUm}}</el-button>
</div>
</el-form-item>
<el-form-item>
<el-alert title="短信签名提交后需要审核才会生效,请耐心等待或者联系客服" type="success"></el-alert>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit('formInline')"> </el-button>
@@ -181,6 +187,8 @@
import { smsLstApi, serviceOpenApi, exportTempApi, expressAllApi, captchaApi, smsSignApi } from '@/api/sms'
import * as commFilter from '@/filters/commFilter';
import Template from "../../../appSetting/wxAccount/wxTemplate/index";
import { checkPermi } from "@/utils/permission"; // 权限判断函数
import {Debounce} from '@/utils/validate'
export default {
name: 'TableList',
props: {
@@ -310,10 +318,11 @@ export default {
editSign(){
this.formInline.account = this.accountInfo.account;
this.formInline.sign = this.accountInfo.sms.sign;
this.formInline.phone = this.accountInfo.phone;
this.dialogVisible = true;
},
//修改签名
handleSubmit (name) {
handleSubmit:Debounce(function(name) {
this.$refs[name].validate((valid) => {
if (valid) {
smsSignApi(this.formInline).then(async res => {
@@ -325,7 +334,7 @@ export default {
return false;
}
})
},
}),
// 短信验证码
cutDown () {
if (this.formInline.phone) {
@@ -397,7 +406,7 @@ export default {
},
// 物流公司
exportTempAllList () {
expressAllApi().then(async res => {
expressAllApi({type:'elec'}).then(async res => {
this.exportList = res;
})
},
@@ -443,7 +452,30 @@ export default {
getList() {
this.listLoading = true
smsLstApi(this.tableFrom).then(res => {
this.tableData.data = res.data
this.tableData.data = res.data;
if(this.tableFrom.type == 'sms'){
let obj = new Object();
let newArr = new Array();
res.data.forEach(item=>{
obj = item;
switch(item.status) {
case 0:
obj.status = '发送中'
break;
case 1:
obj.status = '成功'
break;
case 2:
obj.status = '失败'
break;
case 3:
obj.status = '全部'
break;
}
newArr.push(obj);
this.tableData.data = newArr;
})
}
this.tableData.total = res.count
switch (this.tableFrom.type) {
case 'sms':
@@ -464,11 +496,11 @@ export default {
key: 'add_time',
minWidth: 150
},
{
title: '状态码',
key: '_resultcode',
minWidth: 100
}
// {
// title: '状态',
// key: 'status',
// minWidth: 100
// }
]
break;
case 'expr_dump':
@@ -654,4 +686,8 @@ export default {
text-align: left !important;
}
}
.flex-between{
display: flex;
justify-content: space-between;
}
</style>

View File

@@ -8,18 +8,26 @@
<div class="dashboard-workplace-header-tip">
<div class="dashboard-workplace-header-tip-title">{{ smsAccount }}祝您每一天开心</div>
<div class="dashboard-workplace-header-tip-desc">
<span class="mr10" @click="onChangePassswordIndex">修改密码</span>
<span class="mr10" @click="onChangePhone">修改手机号</span>
<span @click="signOut" class="mr10">退出登录</span>
<el-tooltip class="item" effect="dark" content="
<span class="mr10" @click="onChangePassswordIndex" v-if="checkPermi(['admin:pass:update:password'])">修改密码</span>
<span class="mr10" @click="onChangePhone" v-if="checkPermi(['admin:pass:update:phone'])">修改手机号</span>
<span @click="signOut" class="mr10" v-if="checkPermi(['admin:pass:logout'])">退出登录</span>
<!-- <el-tooltip class="item" effect="dark" content="
一号通为我司一个第三方平台
专门提供短信 物流查询,商品复制,电子面单等个性化服务
省去了自己单独接入功能的麻烦
初次运行代码默认是没有账号的,需要自行注册,
登录成功后根据提示购买自己需要用到的服务即可" placement="right">
<span class="mr10">平台说明</span>
</el-tooltip>
</el-tooltip> -->
<template>
<el-popover trigger="hover" placement="right" >
<span class="mr10" slot="reference">平台说明</span>
<div class="pup_card">
一号通为我司一个第三方平台专门提供短信 物流查询商品复制电子面单等个性化服务省去了自己单独接入功能的麻烦初次运行代码默认是没有账号的需要自行注册
登录成功后根据提示购买自己需要用到的服务即可
</div>
</el-popover>
</template>
</div>
</div>
</div>
@@ -29,22 +37,22 @@
<div class="header-extra">
<p class="mb5"><span>短信条数</span></p>
<p class="mb5">{{sms.num || 0}}</p>
<el-button size="mini" type="primary" @click="sms.open ===0?onOpen('sms'):mealPay('sms')" v-text="sms.open ===0?'开通服务':'套餐购买'"></el-button>
<el-button size="mini" type="primary" @click="sms.open ===0?onOpen('sms'):mealPay('sms')" v-text="sms.open ===0?'开通服务':'套餐购买'" v-hasPermi="['admin:pass:meal:code', 'admin:pass:service:open']"></el-button>
</div>
<div class="header-extra">
<p class="mb5"><span>采集次数</span></p>
<p class="mb5">{{copy.num || 0}}</p>
<el-button size="mini" type="primary" @click="copy.open ===0?onOpen('copy'):mealPay('copy')" v-text="copy.open ===0?'开通服务':'套餐购买'"></el-button>
<el-button size="mini" type="primary" @click="copy.open ===0?onOpen('copy'):mealPay('copy')" v-text="copy.open ===0?'开通服务':'套餐购买'" v-hasPermi="['admin:pass:meal:code', 'admin:pass:service:open']"></el-button>
</div>
<div class="header-extra">
<p class="mb5"><span>物流查询次数</span></p>
<p class="mb5">{{query.num || 0}}</p>
<el-button size="mini" type="primary" @click="query.open ===0?onOpen('expr_query'):mealPay('expr_query')" v-text="query.open ===0?'开通服务':'套餐购买'"></el-button>
<el-button size="mini" type="primary" @click="query.open ===0?onOpen('expr_query'):mealPay('expr_query')" v-text="query.open ===0?'开通服务':'套餐购买'" v-hasPermi="['admin:pass:meal:code', 'admin:pass:service:open']"></el-button>
</div>
<div class="header-extra" style="border: none;">
<p class="mb5"><span>面单打印次数</span> </p>
<p class="mb5">{{dump.num || 0}}</p>
<el-button size="mini" type="primary" @click="dump.open ===0?onOpen('expr_dump'):mealPay('expr_dump')" v-text="dump.open ===0?'开通服务':'套餐购买'"></el-button>
<el-button size="mini" type="primary" @click="dump.open ===0?onOpen('expr_dump'):mealPay('expr_dump')" v-text="dump.open ===0?'开通服务':'套餐购买'" v-hasPermi="['admin:pass:meal:code', 'admin:pass:service:open']"></el-button>
</div>
</div>
</div>
@@ -70,6 +78,7 @@ import forgetPassword from './components/forgetPassword';
import forgetPhone from './components/forgetPhone';
import { logoutApi, smsNumberApi, smsInfoApi } from '@/api/sms'
import { mapGetters } from 'vuex'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'SmsConfig',
components: { tableList, loginFrom, registerFrom, forgetPassword, forgetPhone },
@@ -91,7 +100,7 @@ export default {
query: { open: 0 }, // 物流查询
dump: { open: 0 }, // 电子面单打印
copy: { open: 0 }, // 商品采集,
infoData: {}
infoData: {},
}
},
computed: {
@@ -108,6 +117,7 @@ export default {
// }
},
methods: {
checkPermi,
// 开通服务
openService (val) {
this.getNumber();
@@ -303,4 +313,17 @@ export default {
font-size: 12px;
color: #808695;
}
.text_overflow{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.pup_card{
width: 240px;
border-radius: 5px;
padding: 5px;
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
}
</style>

View File

@@ -1,19 +1,18 @@
<template>
<div class="divBox">
<div class="divBox relative">
<el-card class="box-card">
<router-link :to="{path:'/operation/onePass'}">
<el-button class="mb35" size="mini" icon="el-icon-arrow-left">返回</el-button>
</router-link>
<el-tabs v-model="tableFrom.type" @tab-click="onChangeType" class="mb20">
<el-tab-pane label="短信" name="sms"></el-tab-pane>
<el-tab-pane label="商品采集" name="copy"></el-tab-pane>
<el-tab-pane label="物流查询" name="expr_query"></el-tab-pane>
<el-tab-pane label="电子面单打印" name="expr_dump"></el-tab-pane>
</el-tabs>
<router-link :to="{path:'/operation/onePass'}">
<el-button class="link_abs" size="mini" icon="el-icon-arrow-left">返回</el-button>
</router-link>
<el-row v-loading="fullscreenLoading" :gutter="16">
<el-col :span="24" class="ivu-text-left mb20">
<el-col :xs="12" :sm="6" :md="4" :lg="3" class="mr20">
<el-col :xs="12" :sm="6" :md="4" :lg="2" class="mr20">
<span class="ivu-text-right ivu-block">短信账户名称</span>
</el-col>
<el-col :xs="11" :sm="13" :md="19" :lg="20">
@@ -21,7 +20,7 @@
</el-col>
</el-col>
<el-col :span="24" class="ivu-text-left mb20">
<el-col :xs="12" :sm="6" :md="4" :lg="3" class="mr20">
<el-col :xs="12" :sm="6" :md="4" :lg="2" class="mr20">
<span class="ivu-text-right ivu-block">当前剩余条数</span>
</el-col>
<el-col :xs="11" :sm="13" :md="19" :lg="20">
@@ -29,7 +28,7 @@
</el-col>
</el-col>
<el-col :span="24" class="ivu-text-left mb20">
<el-col :xs="12" :sm="6" :md="4" :lg="3" class="mr20">
<el-col :xs="12" :sm="6" :md="4" :lg="2" class="mr20">
<span class="ivu-text-right ivu-block">选择套餐</span>
</el-col>
<el-col :xs="11" :sm="13" :md="19" :lg="20">
@@ -37,9 +36,8 @@
<el-col
v-for="(item, index) in list"
:key="index"
:xxl="4"
:xl="8"
:lg="8"
:xl="6"
:lg="6"
:md="12"
:sm="24"
:xs="24"
@@ -59,7 +57,7 @@
</el-col>
</el-col>
<el-col v-if="checkList" :span="24" class="ivu-text-left mb20">
<el-col :xs="12" :sm="6" :md="4" :lg="3" class="mr20">
<el-col :xs="12" :sm="6" :md="4" :lg="2" class="mr20">
<span class="ivu-text-right ivu-block">充值条数</span>
</el-col>
<el-col :xs="11" :sm="13" :md="19" :lg="20">
@@ -67,7 +65,7 @@
</el-col>
</el-col>
<el-col v-if="checkList" :span="24" class="ivu-text-left mb20">
<el-col :xs="12" :sm="6" :md="4" :lg="3" class="mr20">
<el-col :xs="12" :sm="6" :md="4" :lg="2" class="mr20">
<span class="ivu-text-right ivu-block">支付金额</span>
</el-col>
<el-col :xs="11" :sm="13" :md="19" :lg="20">
@@ -75,7 +73,7 @@
</el-col>
</el-col>
<el-col :span="24" class="ivu-text-left mb20">
<el-col :xs="12" :sm="6" :md="4" :lg="3" class="mr20">
<el-col :xs="12" :sm="6" :md="4" :lg="2" class="mr20">
<span class="ivu-text-right ivu-block">付款方式</span>
</el-col>
<el-col :xs="11" :sm="13" :md="19" :lg="20">
@@ -83,7 +81,7 @@
</el-col>
</el-col>
<el-col :span="24">
<el-col :xs="12" :sm="6" :md="4" :lg="3" class="mr20">&nbsp;</el-col>
<el-col :xs="12" :sm="6" :md="4" :lg="2" class="mr20">&nbsp;</el-col>
<el-col :xs="11" :sm="13" :md="19" :lg="20">
<div class="list-goods-list-item-code mr20">
<!-- <img :src="code.code_url">-->
@@ -128,7 +126,7 @@ export default {
},
mounted() {
if (!this.isLogin) {
this.$router.push('/operation/onePass?url=' + this.$route.path)
// this.$router.push('/operation/onePass?url=' + this.$route.path)
} else {
this.getNumber()
this.getPrice()
@@ -231,9 +229,13 @@ export default {
}
.list-goods-list-item{
border: 1px solid #DADFE6;
padding: 20px 10px;
height: 118px;
box-sizing: border-box;
border-radius:3px;
border-radius:4px;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
.list-goods-list{
&-item{
@@ -252,7 +254,7 @@ export default {
font-size: 16px;
font-weight: bold;
color: #0091FF;
margin-bottom: 3px;
margin-bottom: 15px;
i{
font-size: 30px;
font-style: normal;
@@ -260,7 +262,7 @@ export default {
}
&-desc{
font-size: 14px;
color: #808695;
color: #303133;
}
&-price{
font-size: 14px;
@@ -292,4 +294,12 @@ export default {
}
}
}
.relative{
position: relative;
}
.link_abs{
position: absolute;
top: 36px;
right: 40px;
}
</style>

View File

@@ -87,6 +87,7 @@ import { smsTempLstApi, tempCreateApi } from '@/api/sms'
import { roterPre } from '@/settings'
import { mapGetters } from 'vuex'
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
import {Debounce} from '@/utils/validate'
export default {
name: 'SmsTemplate',
components: { zbParser },
@@ -144,14 +145,14 @@ export default {
this.dialogVisible = false
this.editData = {}
},
handlerSubmit(formValue) {
handlerSubmit:Debounce(function(formValue) {
tempCreateApi(formValue).then(data => {
this.$message.success('新增成功')
this.dialogVisible = false
this.editData = {}
this.getList()
})
},
}),
add() {
this.dialogVisible = true
},

View File

@@ -23,7 +23,7 @@
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品关键字:">
<el-form-item label="商品关键字:" prop="keyword">
<el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" :disabled="isDisabled"/>
</el-form-item>
</el-col>
@@ -33,7 +33,7 @@
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品简介:">
<el-form-item label="商品简介:" prop="storeInfo">
<el-input v-model="formValidate.storeInfo" type="textarea" maxlength="250" :rows="3" placeholder="请输入商品简介" :disabled="isDisabled"/>
</el-form-item>
</el-col>
@@ -61,7 +61,7 @@
@dragend="handleDragEnd($event, item)"
>
<img :src="item">
<i v-if="!isDisabled" class="el-icon-error btndel" @click="handleRemove(index)" />
<i v-if="!isDisabled" class="el-icon-error btndel" @click="handleRemove(index)"/>
</div>
<div v-if="formValidate.sliderImages.length<10 && !isDisabled" class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
@@ -71,10 +71,9 @@
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :xs="18" :sm="18" :md="18" :lg="12" :xl="12">
<el-form-item label="运费模板:" prop="tempId">
<div class="acea-row">
<el-select v-model="formValidate.tempId" placeholder="请选择" class="selWidthd mr20" :disabled="isDisabled">
<el-select v-model="formValidate.tempId" placeholder="请选择" class="mr20" :disabled="isDisabled" style="width:100%;">
<el-option
v-for="item in shippingList"
:key="item.id"
@@ -82,10 +81,11 @@
:value="item.id"
/>
</el-select>
<el-button v-show="!isDisabled" class="mr15" @click="addTem">添加运费模板</el-button>
</div>
</el-form-item>
</el-col>
<el-col :xs="6" :sm="6" :md="6" :lg="12" :xl="12">
<el-button v-show="!isDisabled" class="mr15" @click="addTem">运费模板</el-button>
</el-col>
<el-col :span="24">
<el-form-item label="商品规格:" props="specType">
<el-radio-group v-model="formValidate.specType" @change="onChangeSpec(formValidate.specType)" :disabled="isDisabled">
@@ -163,7 +163,7 @@
</el-col>
<!-- 批量设置-->
<el-col v-if="formValidate.attr.length>0 && formValidate.specType && !isDisabled" :span="24" class="noForm">
<el-form-item label="批量设置:" class="labeltop">
<el-form-item label="批量设置:">
<el-table :data="oneFormBatch" border class="tabNumWidth" size="mini">
<el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope">
@@ -177,7 +177,7 @@
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
<template slot-scope="scope">
<el-input v-model="scope.row[iii]" :type="formThead[iii].title==='商品编号'?'text':'number'" :min="0" class="priceBox" />
<el-input v-model="scope.row[iii]" :type="formThead[iii].title==='商品编号'?'text':'number'" :min="0" class="priceBox" @keyup.native='keyupEvent($event,oneFormBatch,scope.$index,iii, 1)' />
</template>
</el-table-column>
<template v-if="formValidate.isSub">
@@ -216,7 +216,7 @@
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
<template slot-scope="scope">
<el-input :disabled="isDisabled" v-model="scope.row[iii]" :type="formThead[iii].title==='商品编号'?'text':'number'" :min="0" class="priceBox" />
<el-input :disabled="isDisabled" v-model="scope.row[iii]" :type="formThead[iii].title==='商品编号'?'text':'number'" :min="0" class="priceBox" @keyup.native='keyupEvent($event,oneFormBatch,scope.$index,iii, 2)' />
</template>
</el-table-column>
<template v-if="formValidate.isSub">
@@ -233,6 +233,10 @@
</template>
</el-table>
</el-form-item>
<!-- <div>manyTabDate:{{manyTabDate}}</div> -->
<el-form-item label="全部sku" v-if="$route.params.id && showAll">
<el-button type="default" @click="showAllSku()" :disabled="isDisabled">展示</el-button>
</el-form-item>
<!-- 多规格表格-->
<el-form-item v-if="formValidate.attr.length>0 && formValidate.specType" label="商品属性:" class="labeltop" :class="isDisabled?'disLabel':'disLabelmoren'">
<el-table :data="ManyAttrValue" border class="tabNumWidth" size="mini">
@@ -255,7 +259,8 @@
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
<template slot-scope="scope">
<el-input :disabled="isDisabled" v-model="scope.row[iii]" :type="formThead[iii].title==='商品编号'?'text':'number'" class="priceBox" />
<!-- <span>scope.row:{{scope.row}}</span>-->
<el-input :disabled="isDisabled" v-model="scope.row[iii]" :type="formThead[iii].title==='商品编号'?'text':'number'" class="priceBox" @keyup.native='keyupEvent($event,oneFormBatch,scope.$index,iii, 3)' />
</template>
</el-table-column>
<el-table-column align="center" label="一级返佣(元)" min-width="120" v-if="formValidate.isSub">
@@ -281,7 +286,7 @@
<el-row v-show="currentTab === 1 && !isDisabled">
<el-col :span="24">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
<Tinymce v-model="formValidate.content"></Tinymce>
</el-form-item>
</el-col>
</el-row>
@@ -297,17 +302,17 @@
<el-col :span="24">
<el-col v-bind="grid">
<el-form-item label="排序:">
<el-input-number v-model="formValidate.sort" :max="9999" placeholder="请输入排序" :disabled="isDisabled" />
<el-input-number v-model="formValidate.sort" :min="0" placeholder="请输入排序" :disabled="isDisabled" />
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="积分:">
<el-input-number v-model="formValidate.giveIntegral" placeholder="请输入排序" :disabled="isDisabled" />
<el-input-number v-model="formValidate.giveIntegral" :min="0" placeholder="请输入排序" :disabled="isDisabled" />
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="虚拟销量:">
<el-input-number v-model="formValidate.ficti" placeholder="请输入排序" :disabled="isDisabled" />
<el-input-number v-model="formValidate.ficti" :min="0" placeholder="请输入排序" :disabled="isDisabled" />
</el-form-item>
</el-col>
</el-col>
@@ -340,7 +345,6 @@
<el-form-item label="优惠券:" class="proCoupon">
<div class="acea-row">
<el-tag
v-if="!isDisabled"
v-for="(tag, index) in formValidate.coupons"
:key="index"
class="mr10 mb10"
@@ -350,14 +354,14 @@
>
{{ tag.name }}
</el-tag>
<span v-if="isDisabled"></span>
<el-button v-if="!isDisabled" class="mr15" size="mini" @click="addCoupon">选择优惠券</el-button>
<!-- <span v-if="formValidate.couponIds == null"></span> -->
<el-button v-if="!isDisabled" class="mr15" @click="addCoupon">选择优惠券</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button v-show="currentTab>0" type="primary" class="submission" @click="handleSubmitUp">上一步</el-button>
<el-button v-show="currentTab>0" class="submission priamry_border" @click="handleSubmitUp">上一步</el-button>
<el-button v-show="currentTab<2" type="primary" class="submission" @click="handleSubmitNest('formValidate')">下一步</el-button>
<el-button v-show="(currentTab===2 || $route.params.id) && !isDisabled" type="primary" class="submission" @click="handleSubmit('formValidate')">提交</el-button>
</el-form-item>
@@ -368,14 +372,19 @@
</template>
<script>
import Tinymce from '@/components/Tinymce/index'
import { templateListApi, productCreateApi, categoryApi, productDetailApi, productUpdateApi } from '@/api/store'
import { marketingSendApi} from '@/api/marketing';
import { shippingTemplatesList } from '@/api/logistics'
import { goodDesignList } from "@/api/systemGroup";
import { clearTreeData } from '@/utils/ZBKJIutil'
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
import Templates from "../../appSetting/wxAccount/wxTemplate/index";
import {Debounce} from '@/utils/validate'
const defaultObj = {
image: '',
sliderImages: [],
videoLink:'',
sliderImage: '',
storeName: '',
storeInfo: '',
@@ -436,10 +445,9 @@
title: '体积(m³)'
}
}
const proOptions = [{ name: '是否热卖', value: 'isHot' }, { name: '优品推荐', value: 'isGood' }, { name: '促销单品', value: 'isBenefit' }, { name: '是否精品', value: 'isBest' }, { name: '是否新品', value: 'isNew' }]
export default {
name: 'ProductProductAdd',
components: {Templates, CreatTemplates },
components: {Templates, CreatTemplates,Tinymce },
data() {
return {
isDisabled: this.$route.params.isDisabled==='1'?true:false,
@@ -452,7 +460,7 @@
emitPath: false
},
checkboxGroup: [],
recommend: proOptions,
recommend: [],
tabs: [],
fullscreenLoading: false,
props: { multiple: true },
@@ -475,7 +483,7 @@
manyTabTit: {},
manyTabDate: {},
grid2: {
xl: 10,
xl: 12,
lg: 12,
md: 12,
sm: 24,
@@ -534,7 +542,9 @@
},
tempRoute: {},
keyNum: 0,
isAttr: false
isAttr: false,
showAll:false,
videoLink: "",
}
},
computed: {
@@ -552,7 +562,7 @@
watch: {
'formValidate.attr': {
handler: function(val) {
if (this.formValidate.specType && this.isAttr) this.watCh(val)
if (this.formValidate.specType && this.isAttr) this.watCh(val) //重要!!!
},
immediate: false,
deep: true
@@ -572,8 +582,40 @@
}
this.getCategorySelect()
this.getShippingList()
this.getGoodsType()
},
methods: {
keyupEvent(e,array,index,row,num){
e.target.value=e.target.value.replace(/[^\d.]/g, '');
e.target.value=e.target.value.replace(/\.{2,}/g, '.');
e.target.value=e.target.value.replace(/^\./g, '0.');
e.target.value=e.target.value.replace(/^\d*\.\d*\./g, e.target.value.substring(0,e.target.value.length-1));
e.target.value=e.target.value.replace(/^0[^\.]+/g, '0')
e.target.value=e.target.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2')
switch (num) {
case 1:
if(row == 'stock'){
this.oneFormBatch[index][row]=parseInt(e.target.value)
}else{
this.oneFormBatch[index][row]=e.target.value
}
break;
case 2:
if(row == 'stock'){
this.OneattrValue[index][row]=parseInt(e.target.value)
}else{
this.OneattrValue[index][row]=e.target.value
}
break;
default:
if(row == 'stock'){
this.ManyAttrValue[index][row]=parseInt(e.target.value)
}else{
this.ManyAttrValue[index][row]=e.target.value
}
break;
}
},
handleCloseCoupon(tag) {
this.isAttr = true
this.formValidate.coupons.splice(this.formValidate.coupons.indexOf(tag), 1)
@@ -605,15 +647,17 @@
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
})
this.ManyAttrValue = this.attrFormat(val)
// tmp['value' + i] = { title: o.attrName }
// tmpTab['value' + i] = ''
tmp[o.attrName] = { title: o.attrName };
tmpTab[o.attrName] = '';
});
this.ManyAttrValue = this.attrFormat(val);
this.ManyAttrValue.forEach((val, index) => {
const key = Object.values(val.attrValue).sort().join('/')
if (this.attrInfo[key]) this.ManyAttrValue[index] = this.attrInfo[key]
})
this.attrInfo = {}
this.attrInfo = [];
this.ManyAttrValue.forEach((val) => {
this.attrInfo[Object.values(val.attrValue).sort().join('/')] = val
})
@@ -630,6 +674,7 @@
arr.forEach((v, i) => {
if (i === 0) data = arr[i]['attrValue']
const tmp = []
if(!data) return;
data.forEach(function(vv) {
arr[i + 1] && arr[i + 1]['attrValue'] && arr[i + 1]['attrValue'].forEach(g => {
const rep2 = (i !== 0 ? '' : arr[i]['attrName'] + '_') + vv + '$&' + arr[i + 1]['attrName'] + '_' + g
@@ -648,13 +693,13 @@
brokerage_two: 0
}
rep2.split('$&').forEach((h, k) => {
const rep3 = h.split('_')
const rep3 = h.split('_');
if (!rep4['attrValue']) rep4['attrValue'] = {}
rep4['attrValue'][rep3[0]] = rep3.length > 1 ? rep3[1] : ''
})
Object.values(rep4.attrValue).forEach((v, i) => {
rep4['value' + i] = v
})
for (let attrValueKey in rep4.attrValue) {
rep4[attrValueKey] = rep4.attrValue[attrValueKey];
}
res.push(rep4)
}
})
@@ -679,9 +724,12 @@
brokerage_two: 0,
attrValue: { [v['attrName']]: vv }
}
Object.values(res[kk].attrValue).forEach((v, i) => {
res[kk]['value' + i] = v
})
// Object.values(res[kk].attrValue).forEach((v, i) => {
// res[kk]['value' + i] = v
// })
for (let attrValueKey in res[kk].attrValue) {
res[kk][attrValueKey] = res[kk].attrValue[attrValueKey];
}
})
})
data.push(dataArr.join('$&'))
@@ -722,13 +770,19 @@
})
})
}
this.formValidate.attr = data
})
this.formValidate.attr = data;
});
},
// 商品分类;
getCategorySelect() {
categoryApi({ status: -1, type: 1 }).then(res => {
this.merCateList = this.filerMerCateList(res)
let newArr = [];
res.forEach((value,index) => {
newArr[index] = value;
if(value.child) newArr[index].child = value.child.filter(item => item.status === true)
}) //过滤商品分类设置为隐藏的子分类不出现在树形列表里
this.merCateList = this.filerMerCateList(newArr)
})
},
filerMerCateList(treeData) {
@@ -860,17 +914,27 @@
/* eslint-disable */
hash[next] ? '' : hash[next] = true && item.push(next);
return item
}, [])
}, []);
this.formValidate.attr[idx].inputVisible = false
} else {
this.$message.warning('请添加属性');
}
},
//点击展示所有多规格属性
showAllSku(){
if(this.isAttr == false){
this.isAttr = true;
if (this.formValidate.specType && this.isAttr) this.watCh(this.formValidate.attr) //重要!!!
}else if(this.isAttr == true){
this.isAttr = false;
this.getInfo();
}
},
// 详情
getInfo () {
this.fullscreenLoading = true
productDetailApi(this.$route.params.id).then(async res => {
this.isAttr = true;
// this.isAttr = true;
let info = res
this.formValidate = {
image: this.$selfUtil.setDomain(info.image),
@@ -891,6 +955,7 @@
isBest: info.isBest,
tempId: info.tempId,
attr: info.attr,
attrValue: info.attrValue,
selectRule: info.selectRule,
isSub: info.isSub,
content: this.$selfUtil.replaceImgSrcHttps(info.content),
@@ -902,6 +967,24 @@
couponIds: info.couponIds,
activity: info.activityStr ? info.activityStr.split(',') : ['默认','秒杀','砍价','拼团']
}
marketingSendApi({type:3}).then(res=>{
if(this.formValidate.couponIds !== null){
let ids = this.formValidate.couponIds.toString();
let arr = res.list;
let obj = {};
for (let i in arr) {
obj[arr[i].id] = arr[i];
}
let strArr = ids.split(',');
let newArr = [];
for (let item of strArr) {
if (obj[item]) {
newArr.push(obj[item]);
}
}
this.$set(this.formValidate,'coupons',newArr); //在编辑回显时让返回数据中的优惠券id通过接口匹配显示,
}
})
let imgs = JSON.parse(info.sliderImage)
let imgss = []
Object.keys(imgs).map(i => {
@@ -921,35 +1004,55 @@
attrValue: item.attrValues.split(',')
}
})
this.ManyAttrValue = info.attrValues;
this.ManyAttrValue = info.attrValue;
this.ManyAttrValue.forEach((val) => {
val.image = this.$selfUtil.setDomain(val.image)
this.attrInfo[Object.values(val.attrValue).sort().join('/')] = val
val.image = this.$selfUtil.setDomain(val.image);
val.attrValue = JSON.parse(val.attrValue);
this.attrInfo[Object.values(val.attrValue).sort().join('/')] = val;
})
/***多规格商品如果被删除过sku优先展示api返回的数据,否则会有没有删除的错觉***/
let manyAttr = this.attrFormat(this.formValidate.attr)
if(manyAttr.length !== this.ManyAttrValue.length){
this.$set(this,'showAll',true)
this.isAttr = false;
}else{
this.isAttr = true;
}
/*******/
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.attrName }
tmpTab['value' + i] = ''
// tmp['value' + i] = { title: o.attrName }
// tmpTab['value' + i] = ''
tmp[o.attrName] = { title: o.attrName };
tmpTab[o.attrName] = '';
})
// 此处手动实现后台原本value0 value1的逻辑
this.formValidate.attrValue.forEach(item => {
for (let attrValueKey in item.attrValue) {
item[attrValueKey] = item.attrValue[attrValueKey];
}
});
this.manyTabTit = tmp
this.manyTabDate = tmpTab
this.formThead = Object.assign({}, this.formThead, tmp)
}else{
this.OneattrValue = info.attrValue
this.formValidate.attr = []
// this.formValidate.attr = [] //单规格商品规格设置为空
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
this.$message.error(res.message);
})
});
},
handleRemove (i) {
this.formValidate.sliderImages.splice(i, 1)
},
// 点击商品图
modalPicTap (tit, num, i) {
modalPicTap (tit, num, i,status) {
const _this = this;
if(_this.isDisabled) return;
this.$modalUpload(function(img) {
@@ -993,18 +1096,31 @@
})
},
// 提交
handleSubmit (name) {
handleSubmit:Debounce(function(name) {
this.onChangeGroup()
if( this.formValidate.specType && this.formValidate.attr.length < 1 ) return this.$message.warning("请填写多规格属性!");
this.formValidate.cateId = this.formValidate.cateIds.join(',')
this.formValidate.sliderImage = JSON.stringify(this.formValidate.sliderImages)
if(this.formValidate.specType){
this.formValidate.attrValue=this.ManyAttrValue
for (var i = 0; i < this.formValidate.attr.length; i++) {
this.formValidate.attr[i].attrValues = this.formValidate.attr[i].attrValue.join(',')
this.formValidate.attrValue=this.ManyAttrValue;
this.formValidate.attr = this.formValidate.attr.map((item) =>{
return {
attrName:item.attrName,
id:item.id,
attrValues:item.attrValue.join(','),
}
})
for (var i = 0; i < this.formValidate.attrValue.length; i++) {
this.$set(this.formValidate.attrValue[i],'id',0);
this.$set(this.formValidate.attrValue[i],'productId',0);
this.$set(this.formValidate.attrValue[i],'attrValue',JSON.stringify(this.formValidate.attrValue[i].attrValue)); //
delete this.formValidate.attrValue[i].value0
}
}else{
this.formValidate.attr = []
this.formValidate.attr = [{attrName:'规格',attrValues:'默认',id: this.$route.params.id? this.formValidate.attr[0].id : 0}]
this.OneattrValue.map(item => {
this.$set(item, 'attrValue', JSON.stringify({'规格':'默认'}))
})
this.formValidate.attrValue=this.OneattrValue
}
this.$refs[name].validate((valid) => {
@@ -1033,8 +1149,8 @@
this.$message.warning("请填写完整商品信息!");
}
}
})
},
});
}),
// 表单验证
validate (prop, status, error) {
if (status === false) {
@@ -1076,7 +1192,47 @@
newItems.splice(dst, 0, ...newItems.splice(src, 1))
this.formValidate.activity = newItems;
}
}
},
getGoodsType(){
/** 让商品推荐列表的name属性与页面设置tab的name匹配**/
goodDesignList({gid:70}).then((response)=>{
let list = response.list;
let arr = [],arr1 = [];
const listArr = [{ name: '是否热卖', value: 'isGood' }];
let typeLists = [
{ name: '', value: 'isHot',type:'2' }, //热门榜单
{ name: '', value: 'isBenefit' ,type:'4'}, //促销单品
{ name: '', value: 'isBest',type:'1' }, //精品推荐
{ name: '', value: 'isNew',type:'3' }]; //首发新品
list.forEach((item)=>{
let obj = {};
obj.value = JSON.parse(item.value);
obj.id = item.id;
obj.gid = item.gid;
obj.status = item.status;
arr.push(obj);
})
arr.forEach((item1)=>{
let obj1 = {};
obj1.name = item1.value.fields[1].value;
obj1.status = item1.status;
obj1.type = item1.value.fields[3].value;
arr1.push(obj1);
})
typeLists.forEach((item)=>{
arr1.forEach((item1)=>{
if(item.type == item1.type){
listArr.push({
name:item1.name,
value:item.value,
type:item.type
})
}
})
})
this.recommend = listArr
})
},
}
}
</script>
@@ -1091,7 +1247,10 @@
margin-left: 120px !important;
}
}
.priamry_border{
border: 1px solid #1890FF;
color: #1890FF;
}
.color-item{
height: 30px;
line-height: 30px;
@@ -1180,6 +1339,10 @@
width: 100%;
height: 100%;
}
video{
width: 100%;
height: 100%;
}
}
.btndel{
position: absolute;
@@ -1196,4 +1359,35 @@
width: auto !important;
}
}
.iview-video-style {
width: 300px;
height: 180px;
border-radius: 10px;
background-color: #707070;
margin: 0 120px 20px;
position: relative;
overflow: hidden;
}
.iview-video-style .iconv {
color: #fff;
line-height: 180px;
width: 50px;
height: 50px;
display: inherit;
font-size: 26px;
position: absolute;
top: -74px;
left: 50%;
margin-left: -25px;
}
.iview-video-style .mark {
position: absolute;
width: 100%;
height: 30px;
top: 0;
background-color: rgba(0, 0, 0, 0.5);
text-align: center;
}
</style>

View File

@@ -1,34 +1,35 @@
<template>
<div class="divBox">
<div class="divBox relative">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-tabs v-model="tableFrom.type" @tab-click="seachList">
<el-tabs v-model="tableFrom.type" @tab-click="seachList" v-if="checkPermi(['admin:product:tabs:headers'])">
<el-tab-pane :label="item.name +'('+item.count +')' " :name="item.type.toString()" v-for="(item,index) in headeNum" :key="index"/>
</el-tabs>
<div class="container">
<div class="container mt-1">
<el-form inline size="small">
<el-form-item label="商品分类:">
<el-cascader v-model="tableFrom.cateId" :options="merCateList" :props="props" clearable class="selWidth mr20" @change="seachList" size="small"/>
</el-form-item>
<el-form-item label="商品搜索:">
<el-input v-model="tableFrom.keywords" placeholder="请输入商品名称关键字商品ID" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small" v-hasPermi="['admin:product:list']" />
</el-input>
</el-form-item>
</el-form>
</div>
<router-link :to=" { path:'/store/list/creatProduct' } ">
<el-button size="small" type="primary" class="mr10">添加商品</el-button>
<el-button size="small" type="primary" class="mr10" v-hasPermi="['admin:product:save']">添加商品</el-button>
</router-link>
<el-button size="small" type="success" class="mr10" @click="onCopy">商品采集</el-button>
<el-button size="small" @click="exports">导出</el-button>
<el-button size="small" type="success" class="mr10" @click="onCopy" v-hasPermi="['admin:product:save']">商品采集</el-button>
<el-button size="small" icon="el-icon-upload2" @click="exports" v-hasPermi="['admin:export:excel:product']">导出</el-button>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
highlight-current-row
:highlight-current-row="true"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column type="expand">
<template slot-scope="props">
@@ -67,36 +68,52 @@
</div>
</template>
</el-table-column>
<el-table-column
prop="storeName"
label="商品名称"
min-width="200"
/>
<el-table-column label="商品名称"
prop="storeName"
min-width="300"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price"
label="商品售价"
min-width="90"
align="center"
/>
<el-table-column
prop="sales"
label="销量"
min-width="90"
align="center"
/>
<el-table-column
prop="stock"
label="库存"
min-width="90"
align="center"
/>
<el-table-column
prop="sort"
label="排序"
min-width="70"
align="center"
/>
<el-table-column
label="状态"
min-width="150"
label="添加时间"
min-width="120"
align="center"
>
<template slot-scope="scope">
<span>{{scope.row.addTime | formatDate}}</span>
</template>
</el-table-column>
<el-table-column
label="状态"
min-width="80"
fixed="right"
>
<template slot-scope="scope"
v-if="checkPermi(['admin:product:up','admin:product:down'])">
<el-switch
:disabled="Number(tableFrom.type) > 2"
v-model="scope.row.isShow"
@@ -108,24 +125,16 @@
/>
</template>
</el-table-column>
<el-table-column
label="操作时间"
min-width="120"
>
<template slot-scope="scope">
<span>{{scope.row.addTime | formatDate}}</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<router-link :to="{path: '/store/list/creatProduct/' + scope.row.id + '/1'}">
<el-button type="text" size="small" class="mr10">详情</el-button>
<el-button type="text" size="small" class="mr10" v-hasPermi="['admin:product:info']">详情</el-button>
</router-link>
<router-link :to="{path: '/store/list/creatProduct/' + scope.row.id}">
<el-button type="text" size="small" class="mr10" v-if="tableFrom.type !== '5' && tableFrom.type !== '1'">编辑</el-button>
<el-button type="text" size="small" class="mr10" v-if="tableFrom.type !== '5' && tableFrom.type !== '1'" v-hasPermi="['admin:product:update']">编辑</el-button>
</router-link>
<el-button v-if="tableFrom.type === '5'" type="text" size="small" @click="handleRestore(scope.row.id, scope.$index)">恢复商品</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, tableFrom.type)">{{ tableFrom.type === '5' ? '删除' : '加入回收站' }}</el-button>
<el-button v-if="tableFrom.type === '5'" type="text" size="small" @click="handleRestore(scope.row.id, scope.$index)" v-hasPermi="['admin:product:restore']">恢复商品</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, tableFrom.type)" v-hasPermi="['admin:product:delete']">{{ tableFrom.type === '5' ? '删除' : '加入回收站' }}</el-button>
</template>
</el-table-column>
</el-table>
@@ -141,7 +150,6 @@
/>
</div>
</el-card>
<el-dialog
title="复制淘宝、天猫、京东、苏宁"
:visible.sync="dialogVisible"
@@ -158,6 +166,7 @@
import { productLstApi, productDeleteApi, categoryApi, putOnShellApi, offShellApi, productHeadersApi, productExportApi, restoreApi, productExcelApi } from '@/api/store'
import { getToken } from '@/utils/auth'
import taoBao from './taoBao'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'ProductList',
components: { taoBao },
@@ -186,15 +195,17 @@ export default {
categoryList: [],
merCateList: [],
objectUrl: process.env.VUE_APP_BASE_API,
dialogVisible: false
dialogVisible: false,
}
},
mounted() {
this.goodHeade()
this.getList()
this.getCategorySelect()
this.checkedCities = this.$cache.local.has('goods_stroge') ? this.$cache.local.getJSON('goods_stroge') : this.checkedCities;
},
methods: {
checkPermi,
handleRestore(id) {
this.$modalSure("恢复商品").then(() => {
restoreApi(id)
@@ -241,7 +252,6 @@ export default {
this.merCateList = res
}).catch(res => {
this.$message.error(res.message)
this.$message.error(res.message)
})
},
// 列表
@@ -290,12 +300,17 @@ export default {
}).catch(()=>{
row.isShow = !row.isShow
})
}
},
}
}
</script>
<style scoped lang="scss">
.el-table__body {
width: 100%;
table-layout: fixed !important;
}
.taoBaoModal{
// z-index: 3333 !important;
}
@@ -315,4 +330,7 @@ export default {
.seachTiele{
line-height: 30px;
}
.relative{
position: relative;
}
</style>

View File

@@ -12,8 +12,8 @@
</el-form>
</div>
<div class="acea-row">
<el-button size="small" type="primary" @click="add">添加商品规格</el-button>
<el-button size="small" @click="handleDeleteAll">批量删除</el-button>
<el-button size="small" type="primary" @click="add" v-hasPermi="['admin:product:rule:save']">添加商品规格</el-button>
<el-button size="small" @click="handleDeleteAll" v-hasPermi="['admin:product:rule:delete']">批量删除</el-button>
</div>
</div>
<el-table
@@ -57,8 +57,8 @@
</el-table-column>
<el-table-column label="操作" min-width="120" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="onEdit(scope.row)" class="mr10">编辑</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)">删除</el-button>
<el-button type="text" size="small" @click="onEdit(scope.row)" class="mr10" v-hasPermi="['admin:product:rule:update','admin:product:rule:info']">编辑</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" v-hasPermi="['admin:product:rule:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -76,7 +76,6 @@
</el-card>
</div>
</template>
<script>
import { templateListApi, attrDeleteApi } from '@/api/store'
export default {

View File

@@ -62,6 +62,7 @@
<script>
import { replyCreatApi, replyEditApi, replyInfoApi } from '@/api/store'
import {Debounce} from '@/utils/validate'
const defaultObj= {
avatar: '',
comment: '',
@@ -155,7 +156,7 @@
handleRemove (i) {
this.pics.splice(i, 1)
},
submitForm(formName) {
submitForm:Debounce(function(formName) {
this.formValidate.pics = this.pics.length>0 ? JSON.stringify(this.pics) : ''
this.$refs[formName].validate((valid) => {
if (valid) {
@@ -174,7 +175,7 @@
return false;
}
});
},
}),
resetForm(formName) {
this.$refs[formName].resetFields()
this.pics=[]

View File

@@ -26,19 +26,9 @@
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
</el-input>
</el-form-item>
<!--<el-select v-model="uids" class="selWidth" reserve-keyword multiple remote filterable-->
<!--:remote-method="remoteMethod" :loading="loading" placeholder="请输入用户名称" clearable @change="seachList">-->
<!--<el-option-->
<!--v-for="item in options"-->
<!--:key="item.uid"-->
<!--:label="item.nickname"-->
<!--:value="item.uid">-->
<!--</el-option>-->
<!--</el-select>-->
</el-form>
</div>
<el-button size="small" type="primary" @click="add">添加虚拟评论</el-button>
<el-button size="small" type="primary" @click="add" v-hasPermi="['admin:product:reply:save']">添加虚拟评论</el-button>
</div>
<el-table
v-loading="listLoading"
@@ -52,7 +42,7 @@
label="ID"
width="50"
/>
<el-table-column label="商品信息" min-width="300">
<el-table-column label="商品信息" min-width="400">
<template slot-scope="scope">
<div class="demo-image__preview acea-row row-middle" v-if="scope.row.storeProduct">
<el-image
@@ -68,7 +58,7 @@
<el-table-column
prop="nickname"
label="用户名称"
min-width="200"
min-width="100"
/>
<el-table-column
prop="productScore"
@@ -113,8 +103,8 @@
</el-table-column>
<el-table-column label="操作" min-width="120" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="reply(scope.row.id)" class="mr10">回复</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)">删除</el-button>
<el-button type="text" size="small" @click="reply(scope.row.id)" class="mr10" v-hasPermi="['admin:product:reply:comment']">回复</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" v-hasPermi="['admin:product:reply:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>

View File

@@ -1,10 +1,10 @@
<template>
<div class="Box">
<el-card>
<div>生成的商品默认是没有上架的请手动上架商品
<div class="line-ht">生成的商品默认是没有上架的请手动上架商品
<span v-if="copyConfig.copyType && copyConfig.copyType==1">您当前剩余{{copyConfig.copyNum}}条采集次数
<router-link :to="{path:'/operation/systemSms/pay?type=copy'}">
<el-link type="primary" :underline="false">增加采集次数</el-link>
<span style="color:#1890ff;">增加采集次数</span>
</router-link>
</span>
<el-link v-if="copyConfig.copyType && copyConfig.copyType!=1" type="primary" :underline="false"
@@ -29,7 +29,7 @@
<el-col :span="24" v-if="copyConfig.copyType">
<el-form-item label="链接地址:">
<el-input v-model="url" placeholder="请输入链接地址" class="selWidth" size="small">
<el-button slot="append" icon="el-icon-search" @click="add" size="small"/>
<el-button slot="append" icon="el-icon-search" @click="add" size="small" v-hasPermi="['admin:product:copy:product','admin:product:import:product']" />
</el-input>
</el-form-item>
</el-col>
@@ -61,16 +61,6 @@
<el-input v-model="formValidate.unitName" placeholder="请输入单位" class="selWidth"></el-input>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="积分:">
<el-input-number v-model="formValidate.giveIntegral" placeholder="请输入排序" class="selWidth"/>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="虚拟销量:">
<el-input-number v-model="formValidate.ficti" placeholder="请输入排序" class="selWidth"/>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="运费模板:" prop="tempId">
<el-select v-model="formValidate.tempId" placeholder="请选择" class="selWidth">
@@ -186,13 +176,47 @@
</el-col>
<el-col :span="24">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content"/>
<Tinymce v-model="formValidate.content"></Tinymce>
</el-form-item>
</el-col>
<el-col :span="24">
<template>
<el-row :gutter="24">
<el-col :span="24">
<template>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="排序:">
<el-input-number v-model="formValidate.sort" :max="9999" placeholder="请输入排序" :disabled="isDisabled" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="积分:">
<el-input-number v-model="formValidate.giveIntegral" placeholder="请输入排序" :disabled="isDisabled" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="虚拟销量:">
<el-input-number v-model="formValidate.ficti" placeholder="请输入排序" :disabled="isDisabled" />
</el-form-item>
</el-col>
</el-row>
</template>
</el-col>
<el-col :span="24">
<el-form-item label="商品推荐:">
<el-checkbox-group v-model="checkboxGroup" size="small" @change="onChangeGroup" :disabled="isDisabled">
<el-checkbox v-for="(item, index) in recommend" :key="index" :label="item.value">{{ item.name }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
</template>
</el-col>
<el-col :span="24">
<el-form-item>
<el-button type="primary" :loading="modal_loading" class="submission"
@click="handleSubmit('formValidate')">提交
<el-button type="primary" :loading="modal_loading" class="submission" @click="handleSubmit('formValidate')">提交
</el-button>
</el-form-item>
</el-col>
@@ -213,7 +237,10 @@
productCreateApi,
copyConfigApi
} from '@/api/store';
import { goodDesignList } from "@/api/systemGroup";
import Tinymce from '@/components/Tinymce/index'
import {shippingTemplatesList} from '@/api/logistics'
import {Debounce} from '@/utils/validate'
const defaultObj = [{
image: '',
price: null,
@@ -222,7 +249,7 @@
stock: null,
barCode: '',
weight: 0,
volume: 0
volume: 0,
}]
const objTitle = {
price: {
@@ -249,6 +276,7 @@
}
export default {
name: 'taoBao',
components: {Tinymce },
data() {
return {
loading: false,
@@ -264,6 +292,8 @@
multiple: true,
emitPath: false
},
checkboxGroup: [], //
recommend: [],
modal_loading: false,
ManyAttrValue: [Object.assign({}, defaultObj[0])], // 多规格
imgList: [],
@@ -277,6 +307,7 @@
url: '',
modalPic: false,
isChoice: '',
isDisabled:false,
ruleInline: {
storeName: [
{required: true, message: '请输入商品名称', trigger: 'blur'}
@@ -334,6 +365,7 @@
mounted() {
this.productGetTemplate();
this.getCopyConfig();
this.getGoodsType()
},
methods: {
// 删除表格中的属性
@@ -344,6 +376,13 @@
copyConfigApi().then(res => {
this.copyConfig = res
})
},
onChangeGroup() {
this.checkboxGroup.includes('isGood') ? this.formValidate.isGood = true : this.formValidate.isGood = false
this.checkboxGroup.includes('isBenefit') ? this.formValidate.isBenefit = true : this.formValidate.isBenefit = false
this.checkboxGroup.includes('isBest') ? this.formValidate.isBest = true : this.formValidate.isBest = false
this.checkboxGroup.includes('isNew') ? this.formValidate.isNew = true : this.formValidate.isNew = false
this.checkboxGroup.includes('isHot') ? this.formValidate.isHot = true : this.formValidate.isHot = false
},
// 批量添加
batchAdd() {
@@ -364,8 +403,10 @@
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = {title: o.attrName}
tmpTab['value' + i] = ''
// tmp['value' + i] = {title: o.attrName}
// tmpTab['value' + i] = ''
tmp[o.attrName] = { title: o.attrName };
tmpTab[o.attrName] = '';
})
this.formValidate.attrValue = this.attrFormat(val)
this.manyTabTit = tmp
@@ -404,9 +445,12 @@
if (!rep4['attrValue']) rep4['attrValue'] = {}
rep4['attrValue'][rep3[0]] = rep3.length > 1 ? rep3[1] : ''
})
Object.values(rep4.attrValue).forEach((v, i) => {
rep4['value' + i] = v
})
// Object.values(rep4.attrValue).forEach((v, i) => {
// rep4['value' + i] = v
// })
for (let attrValueKey in rep4.attrValue) {
rep4[attrValueKey] = rep4.attrValue[attrValueKey];
}
res.push(rep4)
}
})
@@ -431,9 +475,9 @@
brokerage_two: 0,
attrValue: {[v['attrName']]: vv}
}
Object.values(res[kk].attrValue).forEach((v, i) => {
res[kk]['value' + i] = v
})
for (let attrValueKey in res[kk].attrValue) {
res[kk][attrValueKey] = res[kk].attrValue[attrValueKey];
}
})
})
data.push(dataArr.join('$&'))
@@ -450,6 +494,7 @@
// 删除图片
handleRemove(i) {
this.formValidate.sliderImages.splice(i, 1);
this.$forceUpdate();
},
// 选择主图
checked(item, index) {
@@ -498,7 +543,12 @@
giveIntegral: info.giveIntegral,
ficti: info.ficti
}
let imgs = JSON.parse(info.sliderImage)
if(info.isHot) this.checkboxGroup.push('isHot')
if(info.isGood) this.checkboxGroup.push('isGood')
if(info.isBenefit) this.checkboxGroup.push('isBenefit')
if(info.isBest) this.checkboxGroup.push('isBest')
if(info.isNew) this.checkboxGroup.push('isNew')
let imgs = JSON.parse(info.sliderImage)
let imgss = []
Object.keys(imgs).map(i => {
imgss.push(this.$selfUtil.setDomain(imgs[i]))
@@ -562,17 +612,21 @@
}
},
// 提交
handleSubmit(name) {
handleSubmit:Debounce(function(name) {
let pram = JSON.parse(JSON.stringify(this.formValidate));
// this.formValidate.attr.length ? this.formValidate.attrValue = this.ManyAttrValue : this.formValidate.attrValue = []
this.formValidate.cateId = this.formValidate.cateIds.join(',')
this.formValidate.sliderImage = JSON.stringify(this.formValidate.sliderImages)
for (var i = 0; i < this.formValidate.attr.length; i++) {
this.formValidate.attr[i].attrValues = JSON.stringify(this.formValidate.attr[i].attrValue)
}
pram.attr.forEach(item => {
item.attrValues = item.attrValue.join(",");
});
pram.cateId = pram.cateIds.join(',')
pram.sliderImage = JSON.stringify(pram.sliderImages);
pram.attrValue.forEach(itemData => {
itemData.attrValue = JSON.stringify(itemData.attrValue);
});
this.$refs[name].validate((valid) => {
if (valid) {
this.modal_loading = true
productCreateApi(this.formValidate).then(async res => {
productCreateApi(pram).then(async res => {
this.$message.success('新增成功');
this.$emit('handleCloseMod', false)
this.modal_loading = false
@@ -580,13 +634,13 @@
this.modal_loading = false
})
} else {
if (!this.formValidate.storeName || !this.formValidate.cateId || !this.formValidate.keyword
|| !this.formValidate.unitName || !this.formValidate.image) {
if (!pram.storeName || !pram.cateId || !pram.keyword
|| !pram.unitName || !pram.image) {
this.$message.warning("请填写完整商品信息!");
}
}
})
},
}),
// 点击商品图
modalPicTap(tit, num, i) {
const _this = this
@@ -606,7 +660,7 @@
_this.OneattrValue[0].image = img[0].sattDir
}
if (tit === '1' && num === 'duo') {
_this.this.formValidate.attrValue[i].image = img[0].sattDir
_this.formValidate.attrValue[i].image = img[0].sattDir
}
if (tit === '1' && num === 'pi') {
_this.oneFormBatch[0].image = img[0].sattDir
@@ -635,7 +689,48 @@
const dst = newItems.indexOf(item)
newItems.splice(dst, 0, ...newItems.splice(src, 1))
this.formValidate.slider_image = newItems
}
},
getGoodsType(){
/** 让商品推荐列表的name属性与页面设置tab的name匹配**/
goodDesignList({gid:70}).then((response)=>{
let list = response.list;
let arr = [];
let arr1 = [];
const listArr = [{ name: '是否热卖', value: 'isHot' }];
let typeLists = [
{ name: '', value: 'isGood',type:'2' }, //精品推荐1 热门榜单2 首发新品3 促销单品4
{ name: '', value: 'isBenefit' ,type:'4'},
{ name: '', value: 'isBest',type:'1' },
{ name: '', value: 'isNew',type:'3' }];
list.forEach((item)=>{
let obj = {};
obj.value = JSON.parse(item.value);
obj.id = item.id;
obj.gid = item.gid;
obj.status = item.status;
arr.push(obj);
})
arr.forEach((item1)=>{
let obj1 = {};
obj1.name = item1.value.fields[1].value;
obj1.status = item1.status;
obj1.type = item1.value.fields[3].value;
arr1.push(obj1);
})
typeLists.forEach((item)=>{
arr1.forEach((item1)=>{
if(item.type == item1.type){
listArr.push({
name:item1.name,
value:item.value,
type:item.type
})
}
})
})
this.recommend = listArr
})
},
}
}
</script>
@@ -650,6 +745,10 @@
width: 100%;
}
.line-ht{
line-height: 28px;
}
.lunBox {
display: flex;
flex-direction: column;

View File

@@ -37,7 +37,7 @@
<el-switch v-model="pram.status" :active-value="true" :inactive-value="false" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handlerSubmit('pram')">{{ isCreate===0?'確定':'更新' }}</el-button>
<el-button type="primary" @click="handlerSubmit('pram')" v-hasPermi="['admin:system:admin:update','admin:system:admin:save']">{{ isCreate===0?'確定':'更新' }}</el-button>
<el-button @click="close">取消</el-button>
</el-form-item>
</el-form>
@@ -47,6 +47,7 @@
<script>
import * as roleApi from '@/api/role.js'
import * as systemAdminApi from '@/api/systemadmin.js'
import {Debounce} from '@/utils/validate'
export default {
// name: "edit"
components: { },
@@ -97,14 +98,11 @@ export default {
roleList: [],
rules: {
account: [{ required: true, message: '请填管理员账号', trigger: ['blur', 'change'] }],
// level: null,
pwd: [{ required: true, message: '请填管理员密码', trigger: ['blur', 'change'] }],
repwd: [{ required: true, message: '确认密码密码', validator: validatePass, trigger: ['blur', 'change'] }],
realName: [{ required: true, message: '管理员姓名', trigger: ['blur', 'change'] }],
roles: [{ required: true, message: '管理员身份', type: 'array', trigger: ['blur', 'change'] }],
phone: [
{ validator: validatePhone, trigger: 'blur' }
]
roles: [{ required: true, message: '管理员身份', trigger: ['blur', 'change'] }],
phone: [ { required: true, message: '请输入手机号', trigger: ['blur', 'change']} ]
}
}
},
@@ -123,7 +121,14 @@ export default {
status: 1
}
roleApi.getRoleList(_pram).then(data => {
this.roleList = data
this.roleList = data;
let arr = [];
data.list.forEach(item=>{
arr.push(item.id);
})
if(!arr.includes(Number.parseInt(this.pram.roles))){
this.$set(this.pram,'roles',[]);
}
})
},
initEditData() {
@@ -133,8 +138,10 @@ export default {
this.pram.realName = realName
const _roles = []
if (roles.length > 0 && !roles.includes(',')) {
//如果权限id集合有长度并且是只有一个就将它Push进_roles这个数组
_roles.push(Number.parseInt(roles))
} else {
//否则就将多个id集合解构以后push进roles并且转换为整型
_roles.push(...roles.split(',').map(item => Number.parseInt(item)))
}
this.pram.roles = _roles
@@ -144,7 +151,7 @@ export default {
this.rules.pwd = []
this.rules.repwd = []
},
handlerSubmit(form) {
handlerSubmit:Debounce(function(form) {
this.$refs[form].validate(valid => {
if (!valid) return
if (this.isCreate === 0) {
@@ -153,7 +160,7 @@ export default {
this.handlerEdit()
}
})
},
}),
handlerSave() {
systemAdminApi.adminAdd(this.pram).then(data => {
this.$message.success('创建管理员成功')

View File

@@ -31,10 +31,10 @@
</el-form>
<el-form inline @submit.native.prevent>
<el-form-item>
<el-button size="mini" type="primary" @click="handlerOpenEdit(0)">添加管理员</el-button>
<el-button size="mini" type="primary" @click="handlerOpenEdit(0)" v-hasPermi="['admin:system:admin:save']">添加管理员</el-button>
</el-form-item>
</el-form>
<el-table :data="listData.list" size="mini">
<el-table :data="listData.list" size="mini" :header-cell-style=" {fontWeight:'bold'}">
<el-table-column
prop="id"
label="ID"
@@ -48,8 +48,8 @@
</template>
</el-table-column>
<el-table-column label="身份" prop="realName" min-width="230">
<template slot-scope="scope">
<el-tag size="small" type="info" v-for="(item, index) in scope.row.roleNames.split(',')" class="mr5">{{ item }}</el-tag>
<template slot-scope="scope" v-if="scope.row.roleNames">
<el-tag size="small" type="info" v-for="(item, index) in scope.row.roleNames.split(',')" :key="index" class="mr5">{{ item }}</el-tag>
</template>
</el-table-column>
<el-table-column label="最后登录时间" prop="lastTime" min-width="180">
@@ -66,7 +66,7 @@
label="状态"
min-width="100"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="checkPermi(['admin:system:admin:update:status'])">
<el-switch
v-model="scope.row.status"
:active-value="true"
@@ -81,7 +81,7 @@
label="是否接收短信"
min-width="100"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="checkPermi(['admin:system:admin:update:sms'])">
<el-switch
v-model="scope.row.isSms"
:active-value="true"
@@ -104,8 +104,8 @@
<span>-</span>
</template>
<template v-else>
<el-button type="text" size="mini" @click="handlerOpenEdit(1,scope.row)">编辑</el-button>
<el-button type="text" size="mini" @click="handlerOpenDel(scope.row)">删除</el-button>
<el-button type="text" size="mini" @click="handlerOpenEdit(1,scope.row)" v-hasPermi="['admin:system:admin:info']">编辑</el-button>
<el-button type="text" size="mini" @click="handlerOpenDel(scope.row)" v-hasPermi="['admin:system:admin:delete']">删除</el-button>
</template>
</template>
</el-table-column>
@@ -140,6 +140,7 @@
import * as systemAdminApi from '@/api/systemadmin.js'
import * as roleApi from '@/api/role.js'
import edit from './edit'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
// name: "index"
components: { edit },
@@ -174,6 +175,7 @@ export default {
this.handleGetRoleList()
},
methods: {
checkPermi,
onchangeIsShow(row) {
systemAdminApi.updateStatusApi({id: row.id, status: row.status})
.then(async () => {

View File

@@ -1,23 +1,29 @@
<template>
<div>
<el-form ref="pram" :model="pram" label-width="100px" @submit.native.prevent>
<el-form-item label="身份名称" prop="roleName" :rules="[{required:true,message:'请填写身份名称', trigger:['blur','change']}]">
<el-form-item label="角色名称" prop="roleName" :rules="[{required:true,message:'请填写角色名称', trigger:['blur','change']}]">
<el-input v-model="pram.roleName" placeholder="身份名称" />
</el-form-item>
<el-form-item label="状态">
<el-switch v-model="pram.status" :active-value="true" :inactive-value="false" />
</el-form-item>
<el-form-item label="权限">
<category-list
:biztype="constants.categoryType[4]"
:select-model="true"
:row-select="pram.rules"
:select-model-keys="editData.rules ? editData.rules.split(',') : []"
@rulesSelect="rulesSelect"
/>
</el-form-item>
<el-form-item label="菜单权限">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
<!-- <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox> -->
<el-checkbox v-model="menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
<el-tree
class="tree-border"
:data="menuOptions"
show-checkbox
ref="menu"
node-key="id"
:check-strictly="!menuCheckStrictly"
empty-text="加载中请稍候"
:props="defaultProps"
></el-tree>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handlerSubmit('pram')">{{ isCreate===0?'確定':'更新' }}</el-button>
<el-button type="primary" @click="handlerSubmit('pram')" v-hasPermi="['admin:system:role:update','admin:system:role:save']">{{ isCreate===0?'確定':'更新' }}</el-button>
<el-button @click="close">取消</el-button>
</el-form-item>
</el-form>
@@ -25,11 +31,10 @@
</template>
<script>
import categoryList from '@/components/Category/list'
import * as roleApi from '@/api/role.js'
import {Debounce} from '@/utils/validate'
export default {
// name: "edit"
components: { categoryList },
name: "roleEdit",
props: {
isCreate: {
type: Number,
@@ -42,18 +47,27 @@ export default {
},
data() {
return {
constants:this.$constants,
pram: {
level: 1,
roleName: null,
rules: [],
rules: '',
status: null,
id: null
}
},
menuExpand: false,
menuNodeAll: false,
menuOptions:[],
menuCheckStrictly: true,
currentNodeId:[],
defaultProps: {
children: "childList",
label: "name",
},
menuIds:[],
}
},
mounted() {
this.initEditData()
this.initEditData();
this.getCacheMenu();
},
methods: {
close() {
@@ -61,23 +75,41 @@ export default {
},
initEditData() {
if (this.isCreate !== 1) return
const { level, roleName, rules, status, id } = this.editData
this.pram.rules = rules.split(',')
this.pram.level = level
const { roleName, status, id } = this.editData
this.pram.roleName = roleName
this.pram.status = status
this.pram.id = id
const loading = this.$loading({
lock: true,
text: 'Loading',
});
roleApi.getInfo(id).then(res=>{
this.menuOptions = res.menuList;
this.checkDisabled(this.menuOptions);
loading.close();
this.getTreeId(res.menuList)
this.$nextTick(()=>{
this.menuIds.forEach((i,n) =>{
var node = this.$refs.menu.getNode(i);
if(node.isLeaf){
this.$refs.menu.setChecked(node, true);
}
})
})
})
},
handlerSubmit(form) {
handlerSubmit:Debounce(function(form) {
this.$refs[form].validate(valid => {
if (!valid) return
let roles = this.getMenuAllCheckedKeys().toString();
this.pram.rules = roles;
if (this.isCreate === 0) {
this.handlerSave()
} else {
this.handlerEdit()
}
})
},
}),
handlerSave() {
roleApi.addRole(this.pram).then(data => {
this.$message.success('创建身份成功')
@@ -92,7 +124,74 @@ export default {
},
rulesSelect(selectKeys) {
this.pram.rules = selectKeys
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
}
}
},
// 树权限(全选/全不选)
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
}
},
// 树权限(父子联动)
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.menuCheckStrictly = value ? true: false;
}
},
// 所有菜单节点数据
getMenuAllCheckedKeys() {
// 目前被选中的菜单节点
let checkedKeys = this.$refs.menu.getCheckedKeys();
// 半选中的菜单节点
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
getCacheMenu(){
if (this.isCreate !== 0) return
const loading = this.$loading({
lock: true,
text: 'Loading',
});
roleApi.menuCacheList().then(res=>{
this.menuOptions = res;
this.checkDisabled(this.menuOptions);
loading.close();
})
},
getTreeId(datas) {
for(var i in datas){
if(datas[i].checked) this.menuIds.push(datas[i].id)
if(datas[i].childList){
this.getTreeId(datas[i].childList);
}
}
},
checkDisabled(data){
//设置公共权限默认勾选且不可操作
data.forEach(item=>{
if(item.id === 280 || item.id === 294 || item.id === 344){
item.disabled = true;
item.childList.forEach(item1=>{
item1.disabled = true;
this.$nextTick(()=>{
var node = this.$refs.menu.getNode(item1.id);
if(node.isLeaf){
this.$refs.menu.setChecked(node, true);
}
})
})
}
})
},
}
}
</script>

View File

@@ -3,46 +3,38 @@
<el-card class="box-card">
<el-form inline size="small" @submit.native.prevent>
<el-form-item>
<el-select v-model="listPram.status" placeholder="状态" clearable class="selWidth">
<el-option
v-for="item in constants.roleListStatus"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-input v-model="listPram.roleName" placeholder="请输入身份昵称" clearable class="selWidth"/>
<el-input v-model="listPram.roleName" placeholder="请输入角色昵称" clearable class="selWidth"/>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" @click.native="handleGetRoleList">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-form inline @submit.native.prevent>
<el-form-item>
<el-button size="mini" type="primary" @click="handlerOpenEdit(0)">添加身份</el-button>
<el-button size="mini" type="primary" @click="handlerOpenEdit(0)" v-hasPermi="['admin:system:role:save','admin:system:menu:cache:tree']">添加角色</el-button>
</el-form-item>
</el-form>
<el-table :data="listData.list" size="mini">
<el-table-column label="身份昵称" prop="roleName" min-width="130"/>
<el-table-column label="权限" show-overflow-tooltip min-width="350">
<template slot-scope="scope">
{{ scope.row.rulesView | filterEmpty }}
</template>
</el-table-column>
<!--<el-table-column label="level" prop="level" />-->
<el-table :data="listData.list" size="mini" :header-cell-style=" {fontWeight:'bold',background:'#f8f8f9',color: '#515a6e',height:'40px'}">
<el-table-column label="角色编号" prop="id" width="120" ></el-table-column>
<el-table-column label="角色昵称" prop="roleName" min-width="130"/>
<el-table-column label="状态" prop="status">
<template slot-scope="scope">
<span>{{ scope.row.status | filterShowOrHide }}</span>
<template slot-scope="scope" v-if="checkPermi(['admin:system:role:update:status'])">
<el-switch
v-model="scope.row.status"
:active-value="true"
:inactive-value="false"
style="width:40px;"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime" min-width="150"/>
<el-table-column label="更新时间" prop="updateTime" min-width="150"/>
<el-table-column label="操作" min-width="130" fixed="right">
<template slot-scope="scope">
<el-button size="small" type="text" @click="handlerOpenEdit(1,scope.row)">编辑</el-button>
<el-button size="small" type="text" @click="handlerOpenDel(scope.row)">删除</el-button>
<el-button size="small" type="text" @click="handlerOpenEdit(1,scope.row)" v-hasPermi="['admin:system:role:info']">编辑</el-button>
<el-button size="small" type="text" @click="handlerOpenDel(scope.row)" v-hasPermi="['admin:system:role:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -60,12 +52,13 @@
:title="editDialogConfig.isCreate === 0? '创建身份':'编辑身份'"
destroy-on-close
:close-on-click-modal="false"
>
width="500px">
<edit
v-if="editDialogConfig.visible"
:is-create="editDialogConfig.isCreate"
:edit-data="editDialogConfig.editData"
@hideEditDialog="hideEditDialog"
ref="editForm"
/>
</el-dialog>
</div>
@@ -73,8 +66,8 @@
<script>
import * as roleApi from '@/api/role.js'
import * as categroyApi from '@/api/categoryApi.js'
import edit from './edit'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
// name: "index"
components: { edit },
@@ -104,6 +97,7 @@ export default {
this.handleGetRoleList()
},
methods: {
checkPermi,
handlerOpenDel(rowData) {
this.$confirm('确认删除当前数据').then(() => {
roleApi.delRole(rowData).then(data => {
@@ -115,7 +109,6 @@ export default {
handleGetRoleList() {
roleApi.getRoleList(this.listPram).then(data => {
this.listData = data
this.handlerGetMenuList()
})
},
handlerOpenEdit(isCreate, editDate) {
@@ -123,24 +116,6 @@ export default {
this.editDialogConfig.isCreate = isCreate
this.editDialogConfig.visible = true
},
handlerGetMenuList() { // 获取菜单全部数据后做menu翻译使用
categroyApi.listCategroy({ page: 1, limit: 999, type: 5 }).then(data => {
this.menuList = data.list
this.listData.list.forEach(item => {
const _muneText = []
const menuids = item.rules.split(',')
menuids.map(muid => {
this.menuList.filter(menu => {
if (menu.id == muid) {
_muneText.push(menu.name)
}
})
})
item.rulesView = _muneText.join(',')
this.$set(item, 'rulesViews', item.rulesView)
})
})
},
hideEditDialog() {
this.editDialogConfig.visible = false
this.handleGetRoleList()
@@ -152,11 +127,22 @@ export default {
handleCurrentChange(val) {
this.listPram.page = val
this.handleGetRoleList(this.listPram)
},
//修改状态
handleStatusChange(row){
roleApi.updateRoleStatus(row).then(res=>{
this.$message.success('更新状态成功')
this.handleGetRoleList()
})
},
resetQuery(){
this.listPram.roleName = '';
this.handleGetRoleList()
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
</style>

View File

@@ -1,55 +1,427 @@
<template>
<div class="divBox">
<category-list :biztype="constants.categoryType[4]" />
<el-card class="box-card">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
<el-form-item label="菜单名称" prop="menuName">
<el-input
v-model="queryParams.name"
placeholder="请输入菜单名称"
clearable
size="small"
/>
</el-form-item>
<el-form-item label="状态" prop="menuType">
<el-select v-model="queryParams.menuType" placeholder="菜单状态" clearable size="small">
<el-option
v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
</el-row>
<el-table
v-if="refreshTable"
v-loading="listLoading"
:data="menuList"
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column prop="name" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
<el-table-column prop="icon" label="图标" align="center" width="100">
<template slot-scope="scope">
<i :class="'el-icon-' + scope.row.icon" style="font-size: 20px;" />
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" width="60"></el-table-column>
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="isShow" label="状态" width="80">
<template slot-scope="scope">
<el-tag :type="scope.row.isShow ? '' : 'danger'">{{scope.row.isShow ? '显示' : '隐藏'}}</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="menuType" label="类型" width="80">
<template slot-scope="scope">
<span class="type_tag one" v-if="scope.row.menuType == 'M'" >目录</span>
<span class="type_tag two" v-else-if="scope.row.menuType == 'C'" >菜单</span>
<span class="type_tag three" v-else type="info">按钮</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['admin:system:menu:info']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['admin:system:menu:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['admin:system:menu:delete']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="上级菜单">
<treeselect
v-model="form.pid"
:options="menuOptions"
:normalizer="normalizer"
:show-count="true"
placeholder="选择上级菜单"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="菜单类型" prop="menuType">
<el-radio-group v-model="form.menuType">
<el-radio label="M">目录</el-radio>
<el-radio label="C">菜单</el-radio>
<el-radio label="A">按钮</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item v-if="form.menuType != 'A'" label="菜单图标">
<el-form-item>
<el-input placeholder="请选择菜单图标" v-model="form.icon">
<el-button slot="append" icon="el-icon-circle-plus-outline" @click="addIcon"></el-button>
</el-input>
</el-form-item>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="菜单名称" prop="menuName">
<el-input v-model="form.name" placeholder="请输入菜单名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="显示排序" prop="sort">
<el-input-number v-model="form.sort" controls-position="right" :min="0" />
</el-form-item>
</el-col>
<el-col :span="12" v-if="form.menuType !== 'A'">
<!-- v-if="form.menuType == 'C'" -->
<el-form-item prop="component">
<span slot="label">
<el-tooltip content="访问的组件路径,如:`system/user/index`,默认在`views`目录下" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
组件路径
</span>
<el-input v-model="form.component" placeholder="请输入组件路径" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.menuType != 'M'">
<el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
<span slot="label">
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
权限字符
</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item >
<!-- v-if="form.menuType != 'A'" -->
<span slot="label">
<el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
显示状态
</span>
<el-radio-group v-model="form.isShow">
<el-radio
v-for="item in showStatus"
:key="item.value"
:label="item.value"
>{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" v-hasPermi="['admin:system:menu:update']"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { asyncRoutes, constantRoutes } from '@/router'
import * as categoryApi from '@/api/categoryApi.js'
import categoryList from '@/components/Category/list'
import { menuListApi,menuInfo,menuUpdate,menuAdd,menuDelete } from '@/api/systemadmin'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {Debounce} from '@/utils/validate'
export default {
// name: "index"
components: { categoryList },
name: "Menu",
components: { Treeselect, },
data() {
return {
asyncRoutes,
constants: this.$constants
}
// 遮罩层
listLoading: true,
// 显示搜索条件
showSearch: true,
// 菜单表格树数据
menuList: [],
// 菜单树选项
menuOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 是否展开,默认全部折叠
isExpandAll: false,
// 重新渲染表格状态
refreshTable: true,
// 查询参数
queryParams: {
name: '',
menuType:''
},
// 表单参数
form: {},
//请求到的menu数据
menuDataList:[],
// 表单校验
rules: {
name: [
{ required: true, message: "菜单名称不能为空", trigger: "blur" }
],
sort: [
{ required: true, message: "菜单顺序不能为空", trigger: "blur" }
],
},
statusOptions: [
{value: 'M',label: '目录'},
{value: 'C',label: '菜单'},
{value: 'A',label: '按钮'},
],
showStatus:[
{label:'显示',value:true},
{label:'隐藏',value:false},
]
};
},
mounted() {
created() {
this.getList();
},
methods: {
categoryAdd(pram) {
const _pram = {
extra: pram.extra,
name: pram.name,
pid: pram.pid,
sort: pram.sort,
status: pram.status,
type: pram.type,
url: pram.url
}
categoryApi.addCategroy(_pram).then(data => {
this.$message.success('添加菜单成功')
// 点击图标
addIcon() {
const _this = this
_this.$modalIcon(function(icon) {
_this.form.icon = icon;
})
},
/** 查询菜单列表 */
getList() {
this.listLoading = true;
menuListApi(this.queryParams).then(res=>{
let obj = {},menuList = [];
res.forEach(item=>{
obj = item;
obj.parentId = item.pid;
obj.children = [];
menuList.push(obj);
})
this.menuDataList = menuList;
this.menuList = this.handleTree(menuList, "menuId")
this.listLoading = false;
})
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id ? node.id : 0,
label: node.name ? node.name : '主目录',
children: node.children
};
},
/** 查询菜单下拉树结构 */
getTreeselect() {
this.menuOptions = [];
const menu = { menuId: 0, menuName: '主类目', children: [] };
menu.children = this.handleTree(this.menuDataList, "menuId");
this.menuOptions.push(menu);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
menuId: '',
parentId: 0,
name: '',
icon: '',
menuType: "M",
sort: 0,
isShow: true,
component:'',
perms:''
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = { name: '', menuType:''},
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
if (row != null && row.id) {
this.form.pid = row.id;
} else {
this.form.pid = 0;
}
this.open = true;
this.title = "添加菜单";
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
const loading = this.$loading({
lock: true,
text: 'Loading',
});
this.reset();
this.getTreeselect();
menuInfo(row.id).then(response => {
this.form = response;
this.open = true;
this.title = "修改菜单";
loading.close();
});
},
/** 提交按钮 */
submitForm: Debounce(function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != undefined) {
menuUpdate(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
menuAdd(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
}),
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.name + '"的数据项?').then(function() {
return menuDelete(row.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
}
};
</script>
<style scoped>
.routerView{
display: flex;
flex-direction: row;
flex: 1;
<style lang="scss">
.mb8{
margin-bottom: 8px;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
.type_tag{
display: inline-block;
height: 32px;
padding: 0 10px;
line-height: 30px;
font-size: 12px;
border-radius: 4px;
box-sizing: border-box;
white-space: nowrap;
}
.two{
background: rgba(239, 156, 32, .1);
color: rgba(239, 156, 32, 1);
}
.one{
background: rgba(75, 202, 213, .1);
color: rgba(75, 202, 213, 1);
}
.three{
color: rgba(120, 128, 160, 1);
background: rgba(120, 128, 160, .1);
}
</style>

View File

@@ -0,0 +1,509 @@
<template>
<el-dialog
v-if="dialogVisible"
title="运费模板"
:visible.sync="dialogVisible"
width="1000px"
:before-close="handleClose"
>
<el-form ref="ruleForm" :model="ruleForm" label-width="120px" size="mini" v-if="dialogVisible" :rules="rules">
<el-form-item label="模板名称" prop="name">
<el-input v-model="ruleForm.name" class="withs" placeholder="请输入模板名称" />
</el-form-item>
<el-form-item label="计费方式" prop="type">
<el-radio-group v-model="ruleForm.type" @change="changeRadio(ruleForm.type)">
<el-radio :label="1">按件数</el-radio>
<el-radio :label="2">按重量</el-radio>
<el-radio :label="3">按体积</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="配送区域及运费" prop="region">
<el-table v-loading="listLoading" :data="ruleForm.region" border fit highlight-current-row style="width: 100%" size="mini" class="tempBox">
<el-table-column align="center" label="可配送区域" min-width="260">
<template slot-scope="scope">
<span v-if="scope.$index === 0">默认全国</span>
<el-cascader
v-else
v-model="scope.row.city_ids"
style="width: 98%"
:options="cityList"
:props="props"
collapse-tags
clearable
filterable
@change="changeRegion"
/>
</template>
</el-table-column>
<el-table-column min-width="130px" align="center" :label="columns.title" prop="first">
<template slot-scope="scope">
<el-form-item :rules="rules.first" :prop="'region.'+scope.$index+'.first'">
<el-input-number v-model="scope.row.first" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="120px" align="center" label="运费(元)" prop="firstPrice">
<template slot-scope="scope">
<el-form-item :rules="rules.firstPrice" :prop="'region.'+scope.$index+'.firstPrice'">
<el-input-number v-model="scope.row.firstPrice" controls-position="right" :min="0" />
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="120px" align="center" :label="columns.title2" prop="renewal">
<template slot-scope="scope">
<el-form-item :rules="rules.renewal" :prop="'region.'+scope.$index+'.renewal'">
<el-input-number v-model="scope.row.renewal" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column class-name="status-col" align="center" label="续费(元)" min-width="120" prop="renewalPrice">
<template slot-scope="scope">
<el-form-item :rules="rules.renewalPrice" :prop="'region.'+scope.$index+'.renewalPrice'">
<el-input-number v-model="scope.row.renewalPrice" controls-position="right" :min="0" />
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="操作" min-width="80">
<template slot-scope="scope">
<el-button
v-if="scope.$index > 0"
type="text"
size="small"
@click="confirmEdit(ruleForm.region,scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" icon="el-icon-edit" @click="addRegion(ruleForm.region)">
添加配送区域
</el-button>
</el-form-item>
<el-form-item label="指定包邮" prop="appoint">
<el-radio-group v-model="ruleForm.appoint">
<el-radio :label="true">开启</el-radio>
<el-radio :label="false">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="ruleForm.appoint === true" prop="free">
<el-table v-loading="listLoading" :data="ruleForm.free" border fit highlight-current-row style="width: 100%" size="mini">
<el-table-column align="center" label="选择地区" min-width="220">
<template slot-scope="{row}">
<el-cascader
v-model="row.city_ids"
style="width: 95%"
:options="cityList"
:props="props"
collapse-tags
clearable
/>
</template>
</el-table-column>
<el-table-column min-width="180px" align="center" :label="columns.title3">
<template slot-scope="{row}">
<el-input-number v-model="row.number" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
</template>
</el-table-column>
<el-table-column min-width="120px" align="center" label="包邮金额(元)">
<template slot-scope="{row}">
<el-input-number v-model="row.price" controls-position="right" />
</template>
</el-table-column>
<el-table-column align="center" label="操作" min-width="120">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="confirmEdit(ruleForm.free,scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item v-if="ruleForm.appoint === true">
<el-button type="primary" size="mini" icon="el-icon-edit" @click="addFree(ruleForm.free)">
添加指定包邮区域
</el-button>
</el-form-item>
<!--<el-row :gutter="20">-->
<!--<el-col :span="7">-->
<!--<el-form-item label="指定区域不配送" prop="undelivery">-->
<!--<el-radio-group v-model="ruleForm.undelivery">-->
<!--<el-radio :label="1">开启</el-radio>-->
<!--<el-radio :label="0">关闭</el-radio>-->
<!--</el-radio-group>-->
<!--</el-form-item>-->
<!--</el-col>-->
<!--<el-col :span="14">-->
<!--<el-form-item v-if="ruleForm.undelivery === 1" class="noBox" prop="city_id3">-->
<!--<el-cascader-->
<!--v-model="ruleForm.city_id3"-->
<!--placeholder="请选择不配送区域"-->
<!--:options="cityList"-->
<!--:props="props"-->
<!--collapse-tags-->
<!--clearable-->
<!--style="width: 46%"-->
<!--/>-->
<!--</el-form-item>-->
<!--</el-col>-->
<!--</el-row>-->
<el-form-item label="排序">
<el-input v-model="ruleForm.sort" class="withs" placeholder="请输入排序" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="onClose('ruleForm')"> </el-button>
<el-button type="primary" :loading="loading" @click="onsubmit('ruleForm')" v-hasPermi="['admin:shipping:templates:update']"> </el-button>
</span>
</el-dialog>
</template>
<script>
import * as logistics from '@/api/logistics'
import { Loading } from 'element-ui'
import {Debounce} from '@/utils/validate'
const defaultRole = {
name: '',
type: 1,
appoint: false,
sort: 0,
region: [{
first: 0,
firstPrice: 0,
renewal: 0,
renewalPrice: 0,
city_ids: []
}],
undelivery: 0,
free: [],
undelives: {},
city_id3: []
}
const kg = '重量kg'
const m = '体积'
const statusMap = [
{
title: '首件',
title2: '续件',
title3: '包邮件数'
},
{
title: `首件${kg}`,
title2: `续件${kg}`,
title3: `包邮${kg}`
},
{
title: `首件${m}`,
title2: `续件${m}`,
title3: `包邮${m}`
}
]
export default {
name: 'CreatTemplates',
components: {
},
data() {
return {
loading : false,
rules: {
name: [
{ required: true, message: '请输入模板名称', trigger: 'blur' }
],
free: [
{ type: 'array', required: true, message: '请至少添加一个地区', trigger: 'change' }
],
appoint: [
{ required: true, message: '请选择是否指定包邮', trigger: 'change' }
],
undelivery: [
{ required: true, message: '请选择是否指定区域不配送', trigger: 'change' }
],
type: [
{ required: true, message: '请选择计费方式', trigger: 'change' }
],
region: [
{ required: true, message: '请选择活动区域', trigger: 'change' }
],
city_id3: [
{ type: 'array', required: true, message: '请至少选择一个地区', trigger: 'change' }
],
first: [
{ required: true, message: '请输入', trigger: 'blur' }
],
renewal: [
{ required: true, message: '请输入', trigger: 'blur' }
],
firstPrice: [
{ required: true, message: '请输入运费', trigger: 'blur' }
],
renewalPrice: [
{ required: true, message: '请输入续费', trigger: 'blur' }
]
},
nodeKey: 'city_id',
props: {
children: 'child',
label: 'name',
value: 'cityId',
multiple: true
},
dialogVisible: false,
ruleForm: Object.assign({}, defaultRole),
listLoading: false,
cityList: [],
columns: {
title: '首件',
title2: '续件',
title3: '包邮件数'
},
tempId: 0,
type: 0 // 0添加 1编辑
}
},
mounted() {
setTimeout(()=>{
let cityList = JSON.parse(sessionStorage.getItem('cityList'));
this.cityList = cityList;
},1000);
},
methods: {
changType(type) {
this.type = type
},
onClose(formName) {
this.dialogVisible = false
this.$refs[formName].resetFields()
},
confirmEdit(row, index) {
row.splice(index, 1)
},
popoverHide() {},
handleClose() {
// this.$refs['ruleForm'].resetFields()
this.dialogVisible = false
this.ruleForm={
name: '',
type: 1,
appoint: false,
sort: 0,
region: [{
first: 0,
firstPrice: 0,
renewal: 0,
renewalPrice: 0,
city_ids: []
}],
undelivery: 0,
free: [],
undelives: {},
city_id3: []
}
},
changeRegion(value) {
console.log(value)
},
changeRadio(num) {
this.columns = Object.assign({}, statusMap[num - 1])
},
// 添加配送区域
addRegion(region) {
region.push(Object.assign({}, {
first: 0,
firstPrice: 0,
renewal: 0,
renewalPrice: 0,
city_ids: []
}))
},
addFree(Free) {
Free.push(Object.assign({}, {
city_id: [],
number: 1,
price: 1,
city_ids: []
}))
},
/**
* 详情
* id 模板id
* appoint true包邮 false不包邮
**/
getInfo(id, appoint) {
this.tempId = id
const loadingInstance = Loading.service({ fullscreen: true })
logistics.templateDetailApi({ id }).then(res => {
this.dialogVisible = true
const info = res
this.ruleForm = Object.assign(this.ruleForm, {
name: info.name,
type: info.type,
appoint: info.appoint,
sort: info.sort
})
this.columns = Object.assign({}, statusMap[this.ruleForm.type - 1])
this.$nextTick(() => {
loadingInstance.close()
})
// 不包邮地区
this.shippingRegion()
// 包邮地区
if (info.appoint) {
this.shippingFree()
}
}).catch(res => {
// console.integralLog(res)
this.$message.error(res.message)
this.$nextTick(() => {
loadingInstance.close()
})
})
},
// 不包邮
shippingRegion() {
logistics.shippingRegion({ tempId: this.tempId }).then(res => {
res.forEach((item, index) => {
item.title = JSON.parse(item.title)
item.city_ids = item.title
})
this.ruleForm.region = res
})
},
// 包邮
shippingFree() {
logistics.shippingFree({ tempId: this.tempId }).then(res => {
res.forEach((item, index) => {
item.title = JSON.parse(item.title)
item.city_ids = item.title
})
this.ruleForm.free = res
})
},
// 列表
getCityList() {
logistics.cityListTree().then(res => {
sessionStorage.setItem('cityList',JSON.stringify(res));
let cityList = JSON.parse(sessionStorage.getItem('cityList'));
this.cityList = cityList;
}).catch(res => {
this.$message.error(res.message)
})
},
change(idBox) {
idBox.map(item => {
const ids = []
item.city_ids.map(j => {
j.splice(0, 1)
ids.push(j[0])
})
item.city_id = ids
})
return idBox
},
changeOne(idBox) {
const city_ids = []
idBox.map(item => {
item.splice(0, 1)
city_ids.push(item[0])
})
return city_ids
},
onsubmit:Debounce(function(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.loading = true;
const param = {
appoint: this.ruleForm.appoint,
name: this.ruleForm.name,
sort: this.ruleForm.sort,
type: this.ruleForm.type,
// 配送区域及运费
// shippingTemplatesRegionRequestList: [],
// // 指定包邮设置
// shippingTemplatesFreeRequestList: []
}
this.ruleForm.region.forEach((el, index) => {
el.title = el.city_ids.length > 0 ? JSON.stringify(el.city_ids) : JSON.stringify([[0, 0]])
for (var i = 0; i < el.city_ids.length; i++) {
el.city_ids[i].shift()
}
el.cityId = el.city_ids.length > 0 ? el.city_ids.join(',') : 'all'
})
param.shippingTemplatesRegionRequestList = this.ruleForm.region
param.shippingTemplatesRegionRequestList.forEach((el, index) => {
// delete el.city_ids
// delete el.city_id
})
if (this.ruleForm.appoint) {
this.ruleForm.free.forEach((el, index) => {
el.title = el.city_ids.length > 0 ? JSON.stringify(el.city_ids) : JSON.stringify([[0, 0]])
for (var i = 0; i < el.city_ids.length; i++) {
el.city_ids[i].shift()
}
el.cityId = el.city_ids.length > 0 ? el.city_ids.join(',') : 'all'
})
param.shippingTemplatesFreeRequestList = this.ruleForm.free
param.shippingTemplatesFreeRequestList.forEach((el, index) => {
// delete el.city_ids
// delete el.city_id
})
}
if (this.type === 0) {
logistics.shippingSave(param).then(res => {
this.$message.success('操作成功')
this.handleClose()
this.$nextTick(() => {
this.dialogVisible = false
})
setTimeout(() => {
this.$emit('getList')
}, 600)
this.loading = false;
})
} else {
logistics.shippingUpdate(param, { id: this.tempId }).then(res => {
this.$message.success('操作成功')
setTimeout(() => {
this.$emit('getList')
this.handleClose()
}, 600)
this.$nextTick(() => {
this.dialogVisible = false
})
this.loading = false;
})
}
} else {
return false
}
})
}),
clear() {
this.ruleForm.name = ''
this.ruleForm.sort = 0
}
}
}
</script>
<style scoped lang="scss">
.withs{
width: 50%;
}
.noBox{
/deep/.el-form-item__content{
margin-left: 0 !important;
}
}
.tempBox{
/deep/.el-input-number--mini{
width: 100px !important;
}
}
</style>

View File

@@ -0,0 +1,192 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form ref="form" inline :model="form">
<el-form-item label="模板名称:">
<el-input v-model="form.keywords" placeholder="请输入模板名称" class="selWidth" size="small" clearable>
<el-button slot="append" icon="el-icon-search" @click="handleSearch" />
</el-input>
</el-form-item>
</el-form>
</div>
<el-button type="primary" size="mini" @click="handleSubmit()" v-hasPermi="['admin:shipping:templates:save']">添加运费模板</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData.list"
style="width: 100%"
size="mini"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
label="ID"
min-width="60"
/>
<el-table-column
label="模板名称"
min-width="180"
prop="name"
/>
<el-table-column
min-width="100"
label="计费方式"
prop="type"
>
<template slot-scope="{row}">
<p>{{ row.type | typeFilter }}</p>
</template>
</el-table-column>
<el-table-column
min-width="100"
label="指定包邮"
prop="appoint"
>
<template slot-scope="{row}">
<p>{{ row.appoint | statusFilter }}</p>
</template>
</el-table-column>
<!--<el-table-column-->
<!--min-width="120"-->
<!--label="指定区域不配送"-->
<!--prop="type"-->
<!--/>-->
<el-table-column
label="排序"
min-width="100"
prop="sort"
/>
<el-table-column
label="添加时间"
min-width="150"
prop="createTime"
/>
<el-table-column
prop="address"
fixed="right"
width="120"
label="操作"
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['admin:shipping:templates:info']">修改</el-button>
<el-button type="text" size="small" @click="bindDelete(scope.row)" v-hasPermi="['admin:shipping:templates:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block-pagination">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableData.limit"
:current-page="tableData.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@current-change="pageChange"
@size-change="handleSizeChange"
/>
</div>
</el-card>
<CreatTemplates ref="addTemplates" @getList="getList"/>
</div>
</template>
<script>
import CreatTemplates from './creatTemplates'
import * as logistics from '@/api/logistics.js'
export default {
name: 'ShippingTemplates',
filters: {
statusFilter(status) {
const statusMap = {
true: '开启',
false: '关闭'
}
return statusMap[status]
},
typeFilter(status) {
const statusMap = {
1: '按件数',
2: '按重量',
3: '按体积'
}
return statusMap[status]
}
},
components: { CreatTemplates },
data() {
return {
isShow: false,
dialogVisible: false,
form: {
keywords: ''
},
tableData: '',
page: 1,
limit: 20,
loading: false
}
},
created() {
this.getDataList()
},
methods: {
// 添加
handleSubmit() {
this.$refs.addTemplates.dialogVisible = true
this.$refs.addTemplates.getCityList()
this.$refs.addTemplates.changType(0)
},
handleSearch() {
this.page = 1
this.getDataList()
},
// 分页
pageChange(e) {
this.page = e
this.getDataList()
},
handleSizeChange(e) {
this.limit = e
this.getDataList()
},
// 数据列表
getDataList() {
this.loading = true
logistics.shippingTemplatesList({
keywords: this.form.keywords,
page: this.page,
limit: this.limit
}).then(res => {
this.loading = false
this.tableData = res
})
},
// 编辑
bindEdit(item) {
this.$refs.addTemplates.getCityList()
this.$refs.addTemplates.getInfo(item.id, item.appoint)
this.$refs.addTemplates.changType(1)
},
// 删除
bindDelete(item) {
this.$modalSure().then(() => {
logistics.shippingDetete({ id: item.id }).then(res => {
this.$message.success('删除成功')
this.getDataList()
})
})
// logistics.shippingDetete()
},
getList() {
this.getDataList()
}
}
}
</script>
<style scoped lang="scss">
.selWidth{
width: 350px;
}
</style>

View File

@@ -1,7 +1,7 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="clearfix">
<div class="container">
<el-form size="small" label-width="100px" :inline="true" >
<el-form-item label="时间选择:" class="width100">
@@ -27,51 +27,68 @@
</el-form-item>
</el-form>
</div>
<cards-data :card-lists="cardLists" />
</div>
<el-table
</el-card>
<div class="mt20">
<cards-data :card-lists="cardLists" />
</div>
<el-card class="box-card">
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
class="table"
highlight-current-row
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
label="订单号"
prop="orderId"
min-width="170"
min-width="200"
/>
<el-table-column
prop="realName"
label="用户信息"
min-width="130"
min-width="100"
/>
<el-table-column
label="推荐人信息"
min-width="150"
min-width="100"
>
<template slot-scope="scope">
<span>{{ scope.row.spreadInfo.name }}</span>
</template>
</el-table-column>
<el-table-column
<el-table-column
label="商品信息"
min-width="330"
min-width="400"
>
<template slot-scope="scope">
<div v-if=" scope.row.productList && scope.row.productList.length">
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle">
<div class="demo-image__preview">
<el-image
:src="val.info.image"
:preview-src-list="[val.info.image]"
/>
<el-popover trigger="hover" placement="right" >
<div v-if=" scope.row.productList && scope.row.productList.length" slot="reference">
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle" style="flex-wrap: inherit;">
<div class="demo-image__preview mr10">
<el-image
:src="val.info.image"
:preview-src-list="[val.info.image]"
/>
</div>
<div class="text_overflow">
<span class="tabBox_tit mr10">{{ val.info.productName + ' | ' }}{{ val.info.sku ? val.info.sku:'-' }}</span>
<span class="tabBox_pice">{{ '¥'+ val.info.price ? val.info.price + ' x '+ val.info.payNum : '-' }}</span>
</div>
</div>
<span class="tabBox_tit mr10">{{ val.info.productName + ' | ' }}{{ val.info.suk ? val.info.suk:'-' }}</span>
<span class="tabBox_pice">{{ '¥'+ val.info.price ? val.info.price + ' x '+ val.info.payNum : '-' }}</span>
</div>
</div>
<div class="pup_card" v-if=" scope.row.productList && scope.row.productList.length">
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle" style="flex-wrap: inherit;">
<div class="">
<span class="tabBox_tit mr10">{{ val.info.productName + ' | ' }}{{ val.info.sku ? val.info.sku:'-' }}</span>
<span class="tabBox_pice">{{ '¥'+ val.info.price ? val.info.price + ' x '+ val.info.payNum : '-' }}</span>
</div>
</div>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
@@ -199,12 +216,12 @@
this.tableData.data = res.list.list
this.tableData.total = res.list.total
this.cardLists = [
{ name: '订单数量', count: res.total },
{ name: '订单金额', count: res.orderTotalPrice },
{ name: '退款总单数', count: res.refundTotal },
{ name: '退款总金额', count: res.refundTotalPrice }
{ name: '订单数量', count: res.total,color:'#1890FF',class:'one',icon:'icondingdan' },
{ name: '订单金额', count: res.orderTotalPrice ,color:'#A277FF',class:'two',icon:'icondingdanjine'},
{ name: '退款总单数', count: res.refundTotal,color:'#EF9C20',class:'three',icon:'icondingdanguanli' },
{ name: '退款总金额', count: res.refundTotalPrice,color:'#1BBE6B',class:'four',icon:'iconshangpintuikuanjine' }
]
this.cardLists = res.data.stat
// this.cardLists = res.data.stat
this.listLoading = false
}).catch(() => {
this.listLoading = false
@@ -247,4 +264,21 @@
padding: 5px 0;
box-sizing: border-box;
}
.text_overflow{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.pup_card{
width: 200px;
border-radius: 5px;
padding: 5px;
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
}
.flex-column{
display: flex;
flex-direction: column;
}
</style>

View File

@@ -24,8 +24,8 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="editForm('ruleForm')" v-if="id">修改</el-button>
<el-button type="primary" @click="submitForm('ruleForm')" v-else>提交</el-button>
<el-button type="primary" @click="editForm('ruleForm')" v-if="id" v-hasPermi="['admin:system:staff:update']">修改</el-button>
<el-button type="primary" @click="submitForm('ruleForm')" v-else v-hasPermi="['admin:system:staff:save']">提交</el-button>
</div>
<customer-info ref="customer" @upImgUid="upImgUid"></customer-info>
</el-dialog>
@@ -35,6 +35,7 @@
import customerInfo from '@/components/customerInfo';
import { storeStaffSaveApi, storeStaffUpdateApi, storeStaffInfoApi, storeListApi } from '@/api/storePoint';
import { getStoreStaff } from '@/libs/public'
import {Debounce} from '@/utils/validate'
export default {
name: "addClerk",
components: { customerInfo },
@@ -115,7 +116,7 @@
this.$refs[name].resetFields();
},
//
submitForm (name) {
submitForm:Debounce(function(name) {
this.$refs[name].validate((valid) => {
if (valid) {
let phone = this.ruleForm.phone;
@@ -137,9 +138,9 @@
return false;
}
})
},
}),
//
editForm(name){
editForm:Debounce(function(name){
this.$refs[name].validate((valid) => {
if (valid) {
let phone = this.ruleForm.phone;
@@ -161,7 +162,7 @@
return false;
}
})
}
})
}
}
</script>

View File

@@ -16,24 +16,19 @@
</el-form-item>
</el-form>
</div>
<el-button type="primary" size="small" @click="add">添加核销员</el-button>
<el-button type="primary" size="small" @click="add" v-hasPermi="['admin:system:staff:save']">添加核销员</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData"
size="mini"
style="width: 100%">
size="small"
:header-cell-style=" {fontWeight:'bold'}">
<el-table-column
prop="id"
label="ID"
sortable
width="80">
</el-table-column>
<!--<el-table-column-->
<!--prop="nickname"-->
<!--label="微信名称"-->
<!--min-width="150">-->
<!--</el-table-column>-->
<el-table-column
prop="staffName"
label="核销员名称"
@@ -59,29 +54,14 @@
label="添加时间"
min-width="180">
</el-table-column>
<!--<el-table-column-->
<!--prop="status"-->
<!--label="状态"-->
<!--min-width="100">-->
<!--<template slot-scope="{ row, index }">-->
<!--<el-switch-->
<!--v-model="row.status"-->
<!--:active-value="1"-->
<!--:inactive-value="0"-->
<!--active-text="显示"-->
<!--inactive-text="隐藏"-->
<!--@change="onchangeIsShow(row.id,row.status)">-->
<!--</el-switch>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column
fixed="right"
label="操作"
min-width="120">
<template slot-scope="{ row, index }">
<el-button type="text" size="small" @click="edit(row.id)">编辑</el-button>
<el-button type="text" size="small" @click="edit(row.id)" v-hasPermi="['admin:system:staff:info']">编辑</el-button>
<!--<el-divider direction="vertical"></el-divider>-->
<el-button type="text" size="small" @click="storeDelete(row.id)">删除</el-button>
<el-button type="text" size="small" @click="storeDelete(row.id)" v-hasPermi="['admin:system:staff:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>

View File

@@ -17,7 +17,7 @@
clearable
v-model="ruleForm.address"
:options="addresData"
:props="{ value: 'label' }"
:props="{ value: 'name', label: 'name',children:'child',expandTrigger: 'hover'}"
@change="handleChange"></el-cascader>
</el-form-item>
<el-form-item label="详细地址:" prop="detailedAddress">
@@ -54,8 +54,8 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="editForm('ruleForm')" v-if="id">修改</el-button>
<el-button type="primary" @click="submitForm('ruleForm')" v-else>提交</el-button>
<el-button type="primary" @click="editForm('ruleForm')" v-if="id" v-hasPermi="['admin:system:store:update']">修改</el-button>
<el-button type="primary" @click="submitForm('ruleForm')" v-else v-hasPermi="['admin:system:store:save']">提交</el-button>
</div>
<el-dialog v-model="modalMap" title='上传经纬度' :visible.sync="modalMap" append-to-body class="mapBox" width="500px">
<iframe
@@ -69,10 +69,10 @@
<script>
import { storeSaveApi, storeInfoApi, storeUpdateApi } from '@/api/storePoint';
import { cityListTree } from '@/api/logistics';
import * as logistics from '@/api/logistics'
import { configInfo } from '@/api/systemConfig';
import city from '@/utils/city';
import Templates from "../../../appSetting/wxAccount/wxTemplate/index";
import Templates from "../../../../appSetting/wxAccount/wxTemplate/index";
import {Debounce} from '@/utils/validate'
export default {
name: "index",
components: {Templates},
@@ -143,7 +143,9 @@
},
created(){
this.ruleForm.image = '';
this.addresData = city;
let cityList = JSON.parse(sessionStorage.getItem('cityList'));
this.addresData = cityList;
this.getCityList();
this.getKey();
},
mounted(){
@@ -182,7 +184,7 @@
this.$refs[name].resetFields();
},
//
submitForm (name) {
submitForm:Debounce(function(name) {
this.$refs[name].validate((valid) => {
if (valid) {
storeSaveApi(this.ruleForm).then(async () => {
@@ -198,9 +200,9 @@
return false;
}
})
},
}),
//
editForm(name){
editForm:Debounce(function(name){
this.$refs[name].validate((valid) => {
if (valid) {
this.handleChange(this.ruleForm.address);
@@ -216,7 +218,7 @@
return false;
}
})
},
}),
//
clearFrom(){
this.ruleForm.introduction = '';
@@ -261,6 +263,15 @@
this.keyUrl = `https://apis.map.qq.com/tools/locpicker?type=1&key=${keys}&referer=myapp`;
})
},
getCityList() {
logistics.cityListTree().then(res => {
sessionStorage.setItem('cityList',JSON.stringify(res));
let cityList = JSON.parse(sessionStorage.getItem('cityList'));
this.addresData = cityList;
}).catch(res => {
this.$message.error(res.message)
})
},
}
}
</script>

View File

@@ -2,7 +2,7 @@
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-tabs v-model="artFrom.status" @tab-click="onClickTab">
<el-tabs v-model="artFrom.status" @tab-click="onClickTab" v-if="checkPermi(['admin:system:store:count','admin:system:store:list'])" >
<el-tab-pane :label="'显示中的提货点('+ headerCount.show +')'" name="1"></el-tab-pane>
<el-tab-pane :label="'隐藏中的提货点('+ headerCount.hide +')'" name="0"></el-tab-pane>
<el-tab-pane :label="'回收站的提货点('+ headerCount.recycle +')'" name="2"></el-tab-pane>
@@ -14,13 +14,13 @@
</el-input>
</el-form-item>
</el-form>
<el-button type="primary" size="small" @click="add">添加提货点</el-button>
<el-button type="primary" size="small" @click="add" v-hasPermi="['admin:system:store:save']">添加提货点</el-button>
</div>
<el-table
v-loading="loading"
size="mini"
size="small"
:data="tableData"
style="width: 100%">
:header-cell-style=" {fontWeight:'bold'}">
<el-table-column
prop="id"
label="ID"
@@ -64,7 +64,7 @@
prop="isShow"
label="是否显示"
min-width="100">
<template slot-scope="{ row, index }">
<template slot-scope="{ row, index }" v-if="checkPermi(['admin:system:store:update:status'])">
<el-switch
:active-value="true"
:inactive-value="false"
@@ -80,11 +80,11 @@
label="操作"
min-width="120">
<template slot-scope="{ row, index }">
<el-button type="text" size="small" @click="edit(row.id)">编辑</el-button>
<el-button type="text" size="small" @click="edit(row.id)" v-hasPermi="['admin:system:store:info']">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-button v-if="artFrom.status==='2'" type="text" size="small" @click="storeRecovery(row.id)">恢复</el-button>
<el-button v-if="artFrom.status==='2'" type="text" size="small" @click="storeRecovery(row.id)" v-hasPermi="['admin:system:store:recovery']">恢复</el-button>
<el-divider v-if="artFrom.status==='2'" direction="vertical"></el-divider>
<el-button type="text" size="small" @click="artFrom.status==='2'?allDelete(row.id):storeDelete(row.id)">删除</el-button>
<el-button type="text" size="small" @click="artFrom.status==='2'?allDelete(row.id):storeDelete(row.id)" v-hasPermi="['admin:system:store:delete','admin:system:store:completely:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -106,6 +106,7 @@
<script>
import systemStore from './addPoint';
import { storeListApi, storeGetCountApi, storeUpdateStatusApi, storeDeleteApi, allDeleteApi, storeRecoveryApi } from '@/api/storePoint';
import { checkPermi } from "@/utils/permission"; //
export default {
name: 'Point',
components: { systemStore },
@@ -128,6 +129,7 @@ export default {
this.tableList();
},
methods: {
checkPermi,
//
storeGetCount(){
let that = this;

View File

@@ -1,4 +1,4 @@
<template>
<<template>
<div>
<router-view />
</div>

View File

@@ -1,74 +0,0 @@
<template>
<div class="divBox">
<el-card class="box-card">
<parser v-if="isShow" class="formBox" :form-conf="formConf" :form-edit-data="formData" :is-edit="isCreate === 1" @submit="submit" />
</el-card>
</div>
</template>
<script>
import parser from '@/components/FormGenerator/components/parser/Parser'
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
import { configSaveForm, configInfo } from '@/api/systemConfig.js'
export default {
name: 'Config',
components: { parser },
data() {
return {
// 表单
formConf: { fields: [] },
formId: 74,
formData: {},
isCreate: 0,
isShow: false
}
},
created() {
systemFormConfigApi.getFormConfigInfo({ id: this.formId }).then(data => {
this.formConf = JSON.parse(data.content)
})
this.getFormInfo()
},
methods: {
submit(data) {
const tempArr = []
for (var key in data) {
const obj = {}
obj.name = key
obj.title = key
obj.value = data[key]
tempArr.push(obj)
}
const _pram = {
'fields': tempArr,
'id': this.formId,
'sort': 0,
'status': true
}
configSaveForm(_pram).then(res => {
this.getFormInfo()
this.$message.success('操作成功')
})
},
// 获取表单详情
getFormInfo() {
configInfo({ id: this.formId }).then(res => {
this.isShow = false
this.formData = res
this.isCreate = 1
setTimeout(() => { // 让表单重复渲染待编辑数据
this.isShow = true
}, 80)
})
}
}
}
</script>
<style lang="scss" scoped>
.el-button--primary{
width: 100%;
height: 40px;
margin-top: 10px;
}
</style>

View File

@@ -36,30 +36,30 @@
</template>
</el-table-column>
<el-table-column min-width="130px" align="center" :label="columns.title" prop="first">
<template scope="scope">
<template slot-scope="scope">
<el-form-item :rules="rules.first" :prop="'region.'+scope.$index+'.first'">
<el-input-number v-model="scope.row.first" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="120px" align="center" label="运费(元)" prop="firstPrice">
<template scope="scope">
<template slot-scope="scope">
<el-form-item :rules="rules.firstPrice" :prop="'region.'+scope.$index+'.firstPrice'">
<el-input-number v-model="scope.row.firstPrice" controls-position="right" />
<el-input-number v-model="scope.row.firstPrice" controls-position="right" :min="0" />
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="120px" align="center" :label="columns.title2" prop="renewal">
<template scope="scope">
<template slot-scope="scope">
<el-form-item :rules="rules.renewal" :prop="'region.'+scope.$index+'.renewal'">
<el-input-number v-model="scope.row.renewal" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column class-name="status-col" align="center" label="续费(元)" min-width="120" prop="renewalPrice">
<template scope="scope">
<template slot-scope="scope">
<el-form-item :rules="rules.renewalPrice" :prop="'region.'+scope.$index+'.renewalPrice'">
<el-input-number v-model="scope.row.renewalPrice" controls-position="right" />
<el-input-number v-model="scope.row.renewalPrice" controls-position="right" :min="0" />
</el-form-item>
</template>
</el-table-column>
@@ -266,6 +266,10 @@ export default {
}
},
mounted() {
setTimeout(()=>{
let cityList = JSON.parse(sessionStorage.getItem('cityList'));
this.cityList = cityList;
},1000);
},
methods: {
changType(type) {
@@ -383,13 +387,9 @@ export default {
// 列表
getCityList() {
logistics.cityListTree().then(res => {
// console.integralLog(res, 'getCityList')
res.forEach((el, index) => {
el.child.forEach((cel, j) => {
delete cel.child
})
})
this.cityList = res
sessionStorage.setItem('cityList',JSON.stringify(res));
let cityList = JSON.parse(sessionStorage.getItem('cityList'));
this.cityList = cityList;
}).catch(res => {
this.$message.error(res.message)
})
@@ -505,4 +505,4 @@ export default {
width: 100px !important;
}
}
</style>
</style>

View File

@@ -0,0 +1,294 @@
<template>
<div class="divBox">
<div>
<el-card :bordered="false" class="box-card">
<div>
<el-tabs v-model="currentTab" @tab-click="changeTab">
<el-tab-pane
:label="item.label"
:name="item.value.toString()"
v-for="(item, index) in headerList"
:key="index + '-only'"
/>
</el-tabs>
</div>
<el-row type="flex" class="mb20 mt-1">
<el-col>
<el-button
type="primary"
icon="el-icon-document"
@click="syncRoutine()"
v-hasPermi="['admin:wechat:routine:sync']"
>同步小程序订阅消息</el-button
>
<el-button
type="primary"
icon="el-icon-document"
@click="syncWechat()"
v-hasPermi="['admin:wechat:whcbqhn:sync']"
>同步微信模版消息</el-button
>
</el-col>
</el-row>
<div class="description">
<p><span class="iconfont iconxiaochengxu"></span> 小程序经营类目生活服务 > 百货/超市/便利店</p>
<p><span class="iconfont icongongzhonghao"></span> 公众号经营类目IT科技/互联网|电子商务IT科技/IT软件与服务</p>
</div>
<el-table
:data="levelLists"
ref="table"
class="mt25"
size="small"
v-loading="loadingList"
:header-cell-style=" {fontWeight:'bold'}">
<el-table-column label="ID" prop="id" width="80"></el-table-column>
<el-table-column label="通知类型" prop="type"></el-table-column>
<el-table-column label="通知场景说明" prop="description"></el-table-column>
<el-table-column label="标识" prop="mark"></el-table-column>
<el-table-column label="公众号模板" prop="isWechat" v-if="currentTab == '1'">
<template slot-scope="scope" v-if="scope.row.isWechat !== 0">
<el-switch
v-model="scope.row.isWechat"
:active-value="1"
:inactive-value="2"
active-text="启用"
inactive-text="禁用"
@change="changeWechat(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column label="小程序订阅" prop="isRoutine" v-if="currentTab == '1'">
<template slot-scope="scope" v-if="scope.row.isRoutine !== 0">
<el-switch
v-model="scope.row.isRoutine"
:active-value="1"
:inactive-value="2"
active-text="启用"
inactive-text="禁用"
@change="changeRoutine(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column label="发送短信" prop="isSms">
<template slot-scope="scope" v-if="scope.row.isSms !== 0">
<el-switch
v-model="scope.row.isSms"
:active-value="1"
:inactive-value="2"
active-text="启用"
inactive-text="禁用"
@change="changeSms(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column label="设置" prop="id">
<template slot-scope="scope">
<el-button type="text" @click="setting(scope.row)" v-hasPermi="['admin:system:notification:detail']">详情</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<el-dialog
title="通知详情"
:visible.sync="centerDialogVisible"
width="50%"
>
<el-tabs :value="infoTab" @tab-click="changeInfo">
<el-tab-pane
:label="item.label"
:name="item.value.toString()"
v-for="(item, index) in currentTab == '1' ? infoList : infoList1"
:key="index"
/>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="ID">
<el-input v-model="form.id" disabled></el-input>
</el-form-item>
<el-form-item label="模板名" v-if="form.name">
<el-input v-model="form.name" disabled></el-input>
</el-form-item>
<el-form-item label="模板ID" v-if="form.tempId">
<el-input v-model="form.tempId"></el-input>
</el-form-item>
<el-form-item label="模板编号" v-if="form.tempKey">
<el-input v-model="form.tempKey" disabled></el-input>
</el-form-item>
<el-form-item label="模板说明" v-if="form.title">
<el-input v-model="form.title" disabled></el-input>
</el-form-item>
<el-form-item label="模板内容" v-if="form.content">
<el-input v-model="form.content" disabled></el-input>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio label="1">开启</el-radio>
<el-radio label="2">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</el-tabs>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="submit()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {notificationListApi,notificationRoutine,notificationWechat,notificationSms,notificationDetail,notificationUpdate} from '@/api/systemFormConfig'
import {wechatAsyncApi,routineAsyncApi} from '@/api/wxApi'
import {Debounce} from '@/utils/validate'
export default {
data() {
return {
modalTitle: "",
notificationModal: false,
headerList: [
{ label: "通知会员", value: "1" },
{ label: "通知平台", value: "2" },
],
id:0,
levelLists: [],
currentTab: "1",
loading: false,
formData: {},
industry: null,
loadingList:false,
centerDialogVisible:false,
infoList:[],
infoList1:[
{ label: "短信", value: "sms" },
],
form:{
content:'',
name:'',
id:'',
status:null,
tempId:'',
tempKey:'',
title:'',
},
detailType:'',
infoTab:''
};
},
created() {
this.getNotificationList(Number(this.currentTab));
},
methods: {
changeTab(data) {
this.getNotificationList(data.name);
},
//获取消息列表
getNotificationList(id){
this.loadingList = true;
notificationListApi({sendType:id}).then(res=>{
this.loadingList = false;
this.levelLists = res;
}).catch(res=>{
this.loadingList = false;
})
},
//公众号消息开关
changeWechat(row){
notificationWechat(row.id).then(res=>{
this.$modal.msgSuccess("修改成功");
})
},
//小程序消息开关
changeRoutine(row){
notificationRoutine(row.id).then(res=>{
this.$modal.msgSuccess("修改成功");
})
},
//短信消息开关
changeSms(row){
notificationSms(row.id).then(res=>{
this.$modal.msgSuccess("修改成功");
})
},
//详情tab切换
changeInfo(data){
this.getNotificationDetail(data);
},
//详情数据
getNotificationDetail(param){
let data = {
id:this.id,
type:param.name
};
this.$set(this,'detailType',data.type);
notificationDetail(data).then(res=>{
this.form = res;
this.$set(this.form,'status',res.status.toString());
})
},
// 设置
setting(row) {
this.infoList = [];
this.id = row.id;
this.centerDialogVisible = true;
if(row.isWechat !== 0){
this.infoList.push({ label: "公众号模板消息", value: "wechat" });
}
if(row.isRoutine !== 0){
this.infoList.push({ label: "小程序订阅消息", value: "routine"});
}
if(row.isSms !== 0){
this.infoList.push({ label: "短信", value: "sms" });
}
this.infoTab = this.infoList[0].value;
this.getNotificationDetail({name:this.infoTab});
},
//修改通知
submit:Debounce(function(){
let data = {
id:this.id,
status:Number(this.form.status),
tempId:this.form.tempId,
type:this.detailType
};
notificationUpdate(data).then(res=>{
this.$modal.msgSuccess("修改成功");
this.centerDialogVisible = false;
this.getNotificationList();
})
}),
syncWechat(){
wechatAsyncApi().then(res=>{
this.$message.success('同步成功');
})
},
syncRoutine(){
routineAsyncApi().then(res=>{
this.$message.success('同步成功');
})
}
},
};
</script>
<style scoped>
.mt-1{
margin-top:6px;
}
.description{
padding: 16px;
position: relative;
border-radius: 4px;
margin-bottom: 20px;
color: #515a6e;
line-height: 1.5;
font-size: 14px;
border: 1px solid #abdcff;
background-color: #f0faff;
}
.iconfont{
color:#06C05F;
}
</style>

View File

@@ -1,29 +1,12 @@
<template>
<div class="divBox">
<el-card class="box-card">
<el-tabs v-model="activeNamel1" @tab-click="handleTabClick" v-loading="loading">
<el-tabs v-model="activeNamel1" @tab-click="handleTabClick" v-loading="loading" v-if="checkPermi(['admin:system:config:info'])">
<el-tab-pane
v-for="tab,index in treeList"
:key="index"
:label="tab.name"
:name="tab.id.toString()"
>
<!-- 文件上传特殊处理-->
<!-- <template v-if="activeNamel1 == 4">-->
<!-- <el-radio-group v-model="activeNamel2" class="mb10">-->
<!-- <el-radio v-for="tabItem,itemIndex in tab.child"-->
<!-- :key="itemIndex"-->
<!-- :label="tabItem.name" @change="()=>handleItemTabClick(tabItem.extra)">{{tabItem.name}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- <parser-->
<!-- v-if="formConfChild.render"-->
<!-- :is-edit="formConfChild.isEdit"-->
<!-- :form-conf="formConfChild.content"-->
<!-- :form-edit-data="currentEditData"-->
<!-- @submit="handlerSubmit"-->
<!-- />-->
<!-- </template>-->
<!-- 正常配置渲染-->
:name="tab.id.toString()">
<template>
<el-tabs v-if="tab.child.length > 0" v-model="activeNamel2"
type="border-card" @tab-click="handleItemTabClick">
@@ -67,6 +50,8 @@ import * as systemSettingApi from '@/api/systemSetting.js'
import * as systemConfigApi from '@/api/systemConfig.js'
import Template from "@/views/appSetting/wxAccount/wxTemplate/index";
import {beautifierConf} from "@/components/FormGenerator/utils";
import { checkPermi } from "@/utils/permission"; // 权限判断函数
import {Debounce} from '@/utils/validate'
export default {
// name: "index",
components: {Template, parser },
@@ -90,43 +75,7 @@ export default {
this.getCurrentUploadSelectedFlag()
},
methods: {
// handleTabClick(tab, event) {
// if (tab.name) {
// this.handlerGetLevel1FormConfig(tab.name)
// } else if (tab.$children.length > 0 ) { // 初次加载第二层的第一个Tab数据
// // if(tab.$children[0].panes){ // todo 优化。。。
// // this.activeNamel2 = tab.$children[0].panes[0].name
// // }else{
// // conaole.integralLog()
// // }
// let _selected = tab.$children[0].panes[0]
// // 设置特殊处理的文件长传表单默认选中第一个tab
// this.activeNamel2 = _selected.name != 72 ? _selected.name : _selected.label
// if(this.activeNamel2 == 108){
// switch (this.currentSelectedUploadFlag) {
// case 1:
// this.activeNamel2 = '本地(不推荐)'
// this.handlerGetLevel2FormConfig(108)
// break
// case 2:
// this.activeNamel2 = '阿里云配置'
// this.handlerGetLevel2FormConfig(81)
// break
// case 3:
// this.activeNamel2 = '七牛云配置'
// this.handlerGetLevel2FormConfig(82)
// break
// case 4:
// this.activeNamel2 = '腾讯云配置'
// this.handlerGetLevel2FormConfig(83)
// break
// }
// }else{
// this.handlerGetLevel2FormConfig(_selected.name)
// }
//
// }
// },
checkPermi,
handleTabClick(tab) {
this.activeNamel2 = tab.$children[0].panes[0].name;
this.handlerGetLevel2FormConfig(this.activeNamel2);
@@ -180,9 +129,9 @@ export default {
}
})
},
handlerSubmit(formValue) {
handlerSubmit:Debounce(function(formValue) {
this.handlerSave(formValue)
},
}),
handlerSave(formValue) {
const _pram = this.buildFormPram(formValue)
let _formId = 0

View File

@@ -1,147 +0,0 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div class="acea-row roomBox">
<div class="room-left">
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
<div class="acea-row room-left-list">
<div class="userHead mr10"><img src="../../../../assets/imgs/mobilehead.png"></div>
<div class="userName">
<span class="sp1" title="小红帽的外婆家">小红帽的外婆家</span>
<span class="sp2">是的你好</span>
</div>
</div>
</div>
<div class="room-med"></div>
<div class="room-right"></div>
</div>
</el-card>
</div>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped lang="scss">
.room{
&-left::-webkit-scrollbar {
display: none; /* Chrome Safari */
}
&-left{
width: 230px;
height: 600px;
border: 1px solid #e6ebf5;
padding: 0 0 15px 15px;
box-sizing: border-box;
scrollbar-width: none; /* firefox */
-ms-overflow-style: none; /* IE 10+ */
overflow-x: hidden;
overflow-y: auto;
&-list{
border-bottom: 1px solid #e6ebf5;
padding-bottom: 15px;
padding: 15px 0;
cursor: pointer;
}
}
&-med{
width: 400px;
height: 600px;
border-top: 1px solid #e6ebf5;
border-bottom: 1px solid #e6ebf5;
}
&-right{
width: 250px;
height: 600px;
border: 1px solid #e6ebf5;
}
}
.userHead{
width: 55px;
height: 55px;
img{
width: 100%;
height: 100%;
border-radius: 4px;
}
}
.userName{
.sp1{
font-size: 15px;
display: block;
width: 118px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.sp2{
font-size: 14px;
display: block;
color: #C0C4CC;
margin-top: 21px;
width: 118px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
}
</style>

View File

@@ -1,13 +0,0 @@
<template>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped>
</style>

View File

@@ -1,65 +1,56 @@
<template>
<el-dialog
v-if="dialogVisible"
title="用户等级"
:visible.sync="dialogVisible"
width="500px"
:before-close="handleClose">
<el-form :model="formValidate" :rules="rules" ref="formValidate" label-width="100px" class="demo-ruleForm" v-loading="loading">
:before-close="handleClose" >
<el-form :model="user" :rules="rules" ref="user" label-width="100px" class="demo-ruleForm" v-loading="loading">
<el-form-item label="等级名称" prop="name">
<el-input v-model="formValidate.name" placeholder="请输入等级名称"></el-input>
<el-input v-model="user.name" placeholder="请输入等级名称"></el-input>
</el-form-item>
<el-form-item label="等级" prop="grade">
<el-input v-model.number="formValidate.grade" placeholder="请输入等级"></el-input>
<el-input v-model.number="user.grade" placeholder="请输入等级"></el-input>
</el-form-item>
<el-form-item label="享受折扣(%)" prop="discount">
<el-input-number :min="0" :max="100" step-strictly v-model="formValidate.discount" placeholder="请输入享受折扣"></el-input-number>
<el-input-number :min="0" :max="100" step-strictly v-model="user.discount" placeholder="请输入享受折扣"></el-input-number>
</el-form-item>
<el-form-item label="经验" prop="experience">
<el-input-number v-model.number="formValidate.experience" placeholder="请输入经验" :max="999999" step-strictly></el-input-number>
<el-input-number v-model.number="user.experience" placeholder="请输入经验" :min="0" step-strictly></el-input-number>
</el-form-item>
<el-form-item label="图标" prop="icon">
<div class="upLoadPicBox" @click="modalPicTap('1', 'icon')">
<div v-if="formValidate.icon" class="pictrue"><img :src="formValidate.icon"></div>
<div v-if="user.icon" class="pictrue"><img :src="user.icon"></div>
<div v-else-if="formValidate.icon" class="pictrue"><img :src="formValidate.icon"></div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</el-form-item>
<!--<el-form-item label="用户背景" required prop="image">-->
<!--<div class="upLoadPicBox" @click="modalPicTap('1', 'image')">-->
<!--<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>-->
<!--<div v-else class="upLoad">-->
<!--<i class="el-icon-camera cameraIconfont" />-->
<!--</div>-->
<!--</div>-->
<!--</el-form-item>-->
<el-form-item label="是否显示" required>
<el-radio-group v-model="formValidate.isShow">
<el-radio :label="true" class="radio">显示</el-radio>
<el-radio :label="false">隐藏</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="resetForm('formValidate')"> </el-button>
<el-button type="primary" @click="submitForm('formValidate')"> </el-button>
<el-button @click="resetForm('user')"> </el-button>
<el-button type="primary" @click="submitForm('formValidate')" v-hasPermi="['admin:system:user:level:update','admin:system:user:level:save']"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { levelSaveApi, levelInfoApi, levelUpdateApi } from '@/api/user'
import {Debounce} from '@/utils/validate'
const obj = {
name:'',
grade: 1,
discount: '',
icon: '',
image: '',
isShow: true,
id: null
}
export default {
name: "CreatGrade",
props:{
'user':Object
},
data() {
return {
dialogVisible: false,
@@ -85,16 +76,18 @@
],
image: [
{ required: true, message: '请上传用户背景', trigger: 'change' }
]
],
}
}
},
methods:{
// 点击商品图
modalPicTap (tit, num) {
const _this = this
const _this = this
this.$modalUpload(function(img) {
tit==='1'&& num === 'icon' ? _this.formValidate.icon = img[0].sattDir : _this.formValidate.image = img[0].sattDir
this.$set(_this.user,'icon', _this.formValidate.icon);
this.$set(_this.user,'isShow', false);
},tit , 'user')
},
info(id) {
@@ -107,14 +100,26 @@
})
},
handleClose() {
this.dialogVisible = false
this.$refs['formValidate'].resetFields();
this.$nextTick(() => {
this.$refs.user.resetFields();
})
this.dialogVisible = false;
// this.user = Object.assign({}, '')
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
submitForm:Debounce(function(formName) {
this.$refs.user.validate((valid) => {
if (valid) {
this.loading = true
this.formValidate.id ? levelUpdateApi({id:this.formValidate.id}, this.formValidate).then(res => {
let data = {
discount:this.user.discount,
experience:this.user.experience,
grade:this.user.grade,
icon:this.user.icon,
id:this.user.id,
isShow:this.user.isShow,
name:this.user.name
};
this.user.id ? levelUpdateApi(this.user.id, data).then(res => {
this.$message.success('编辑成功')
this.loading = false
this.handleClose()
@@ -122,22 +127,28 @@
this.$parent.getList()
}).catch(() => {
this.loading = false
}): levelSaveApi(this.formValidate).then(res => {
}): levelSaveApi(this.user).then(res => {
this.$message.success('添加成功')
this.loading = false
this.handleClose()
this.formValidate = Object.assign({},obj)
this.$parent.getList()
}).catch(() => {
this.loading = false
this.formValidate = Object.assign({},obj)
})
} else {
return false;
}
});
},
}),
resetForm(formName) {
this.dialogVisible = false
this.$refs[formName].resetFields();
// this[formName] = {};
this.$nextTick(() => {
this.$refs.user.resetFields();
})
this.dialogVisible = false;
}
}
}

View File

@@ -2,23 +2,7 @@
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form :inline="true" size="small">
<el-form-item label="用户状态:" class="mr10">
<el-select v-model="tableFrom.isShow" clearable placeholder="请选择用户状态" @change="seachList" class="selWidth">
<el-option label="全部" value=""></el-option>
<el-option label="显示" value="true"></el-option>
<el-option label="隐藏" value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item label="等级名称:">
<el-input v-model="tableFrom.name" placeholder="请输入等级名称" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" @click="seachList" size="small"/>
</el-input>
</el-form-item>
</el-form>
</div>
<el-button type="primary" class="mr10" @click="add" size="small">添加用户等级</el-button>
<el-button type="primary" class="mr10" @click="add" size="small" v-hasPermi="['admin:system:user:level:save']">添加用户等级</el-button>
</div>
<el-table
v-loading="listLoading"
@@ -45,11 +29,11 @@
<el-table-column
prop="name"
label="等级名称"
min-width="150"
min-width="100"
/>
<el-table-column
prop="grade"
label="等级"
prop="experience"
label="经验"
min-width="100"
/>
<el-table-column
@@ -58,46 +42,37 @@
min-width="100"
/>
<el-table-column
label="是否显示"
min-width="150"
label="状态"
min-width="100"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="checkPermi(['admin:system:user:level:use'])">
<el-switch
v-model="scope.row.isShow"
:active-value="true"
:inactive-value="false"
active-text="显示"
inactive-text="隐藏"
@change="onchangeIsShow(scope.row)"
active-text="开启"
inactive-text="关闭"
disabled
@click.native="onchangeIsShow(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="120" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="edit(scope.row.id)" class="mr10">编辑</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)">删除</el-button>
<el-button type="text" size="small" @click="edit(scope.row)" class="mr10" v-hasPermi="['admin:system:user:level:update']">编辑</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)" v-hasPermi="['admin:system:user:level:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<creat-grade ref="grades"></creat-grade>
<creat-grade ref="grades" :user="userInfo"></creat-grade>
</div>
</template>
<script>
import { userListApi, groupListApi, levelListApi, levelUseApi, levelDeleteApi } from '@/api/user'
import creatGrade from './creatGrade'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'Grade',
filters: {
@@ -114,16 +89,10 @@
data() {
return {
listLoading: true,
userInfo:{},
tableData: {
data: [],
total: 0
},
tableFrom: {
isShow: '',
name: '',
page: 1,
limit: 20,
isDel: 0
total: 0,
}
}
},
@@ -131,57 +100,68 @@
this.getList()
},
methods: {
checkPermi,
seachList() {
this.tableFrom.page = 1
this.getList()
},
add() {
this.$refs.grades.dialogVisible = true
this.userInfo = {};
},
edit(id) {
// this.$refs.grades.info(id)
this.userInfo = id;
this.$refs.grades.dialogVisible = true
this.$refs.grades.info(id)
},
// 列表
getList() {
this.listLoading = true
levelListApi(this.tableFrom).then(res => {
this.tableData.data = res.list
this.tableData.total = res.total
levelListApi().then(res => {
this.tableData.data = res
this.listLoading = false
}).catch(() => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
},
// 删除
handleDelete(id, idx) {
this.$modalSure('删除吗?所有用户已经关联的数据都会清除').then(() => {
levelDeleteApi({id:id}).then(() => {
this.$modalSure('删除吗?删除会导致对应用户等级数据清空,请谨慎操作!').then(() => {
levelDeleteApi(id).then(() => {
this.$message.success('删除成功')
this.tableData.data.splice(idx, 1)
})
})
},
onchangeIsShow(row) {
levelUseApi({id: row.id, value:row.isShow}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
if(row.isShow == false){
row.isShow = !row.isShow
})
levelUseApi({id: row.id, isShow:row.isShow}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
row.isShow = !row.isShow
})
}else{
this.$modalSure('该操作会导致对应用户等级隐藏,请谨慎操作').then(() => {
row.isShow = !row.isShow
levelUseApi({id: row.id, isShow:row.isShow}).then(() => {
this.$message.success('修改成功')
this.getList()
}).catch(()=>{
row.isShow = !row.isShow
})
})
}
}
}
}
</script>
<style scoped lang="scss">
.el-switch.is-disabled {
opacity: 1;
}
::v-deep .el-switch__label {
cursor: pointer !important;;
}
</style>

Some files were not shown because too many files have changed in this diff Show More