Commit 9515e750 authored by 黄奎's avatar 黄奎
parents 49342f4d 48e5f316
......@@ -153,3 +153,27 @@ export function SetSynvEduEmployee(data) {
data
})
}
/**
* 获取欢迎语分页列表
*
*/
export function getWeChatWelcomesPageList(data) {
return request({
url: '/QYWeChat/GetWeChatWelcomesPageList',
method: 'post',
data
})
}
/**
* 新增修改欢迎语
*
*/
export function setWeChatWelcomesInfo(data) {
return request({
url: '/QYWeChat/SetWeChatWelcomesInfo',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -345,6 +345,7 @@
addMsg: {
Id: 0,
Type: 1,
Is_Sync:1,//是否同步 暂时默认为1 同步
MediaGroupId: '',
}
......@@ -353,6 +354,7 @@
created() {
if (this.editobj != null) {
this.addMsg = this.editobj
this.addMsg.Is_Sync=1
} else {
this.gettype()
}
......@@ -361,6 +363,7 @@
gettype() {
this.addMsg.Id = 0;
this.addMsg.Type = this.type
this.addMsg.Is_Sync = 1;
this.addMsg.MediaGroupId = '';
if (this.type == 1) {//文本
this.addMsg.TextModel = {
......
......@@ -6,8 +6,9 @@
</div>
</div> -->
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table no-bottom-table"
separator="none" title="" :data="dataList" :columns="columns" row-key="name">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table no-bottom-table" separator="none" title="" :data="dataList" :columns="columns"
row-key="name">
<template v-slot:body-cell-title="props">
<q-td :props="props">
......@@ -17,6 +18,7 @@
<template v-slot:body-cell-Content="props">
<q-td :props="props">
<div style="width: 200px;">
<span v-if="props.row.Type==1">{{getType(props.row,'content')}}</span>
<q-img v-if="props.row.Type==2 || props.row.Type==3 || props.row.Type==6"
:src="getType(props.row,'content')" style="width: 80px;height: 80px;border-radius: 6px;display: flex;">
......@@ -44,13 +46,15 @@
" class="iconfont icon-word"></i>
<i v-else class="iconfont icon-excel"></i>
</div>
</div>
</q-td>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" label="编辑" v-if="props.row.Type==1 || props.row.Type==3 || props.row.Type==6 "
@click="goedit(props.row)" />
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" label="编辑"
v-if="props.row.Type==1 || props.row.Type==3 || props.row.Type==6 " @click="goedit(props.row)" />
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" label="移动"
@click="plmove(props)" />
<q-btn flat size="xs" icon="delete" color="negative" class="q-mr-xs" label="删除"
......@@ -95,8 +99,8 @@
Isadd: false,
ISsystem: false,
editobj:null,
showtype:1,
editobj: null,
showtype: 1,
msg: {
pageIndex: 1,
pageSize: 10,
......@@ -243,18 +247,18 @@
this.editobj.Id = row.Id;
this.editobj.MediaGroupId = row.MediaGroupId;
this.editobj.Type = row.Type;
if(row.Type==1){
if (row.Type == 1) {
this.editobj.TextModel = JSON.parse(JSON.stringify(row.TextModel));
}else if(row.Type==3){
} else if (row.Type == 3) {
this.editobj.ImgTextModel = JSON.parse(JSON.stringify(row.ImgTextModel));
}else if(row.Type==6){
} else if (row.Type == 6) {
this.editobj.AppletModel = JSON.parse(JSON.stringify(row.AppletModel));
}
this.showtype = row.Type.toString()
this.Isadd = true
},
getchildren(){
getchildren() {
this.$emit('editsuccess')
this.Isadd = false
},
......
......@@ -51,7 +51,8 @@
<div style="padding: 20px;">
<div style="display: flex;align-items: flex-start;">
<i class="el-icon-user" style="margin-right:20px;font-size: 40px;color: #1890ff;"></i>
<div style="width: 1px; flex:1;background: #f3f6fb;word-wrap: break-word;padding: 10px;border-radius: 4px;min-height: 40px;">
<div
style="width: 1px; flex:1;background: #f3f6fb;word-wrap: break-word;padding: 10px;border-radius: 4px;min-height: 40px;">
{{addMsg.Content}}
</div>
</div>
......@@ -61,14 +62,14 @@
<el-form ref="addMsg" :model="addMsg" label-width="120px">
<el-form-item label="企业微信成员:">
<div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.membertype" val="1" label="通用" />
<q-radio v-model="addMsg.membertype" val="2" label="指定企业成员" />
<q-radio v-model="membertype" val="1" label="通用" />
<q-radio v-model="membertype" val="2" label="指定企业成员" />
<q-btn color="accent" label="选择成员" size='sm' class="q-mr-md" style="margin-left: 20px;"
v-if="addMsg.membertype==2" @click='getMember' />
<div v-if="addMsg.ryList.length>0 && addMsg.membertype==2" style="margin-top: 8px;">
<span style="margin-left: 15px">已选择{{addMsg.ryList.length}}名成员</span>
v-if="membertype==2" @click='getMember' />
<div v-if="ryList.length>0 && membertype==2" style="margin-top: 8px;">
<span style="margin-left: 15px">已选择{{ryList.length}}名成员</span>
<span style="cursor: pointer;color: #1890ff;margin-left: 15px;"
@click='addMsg.ryList =[],showMember=[]'>重置</span>
@click='ryList =[],showMember=[]'>重置</span>
</div>
</div>
......@@ -76,20 +77,22 @@
</el-form-item>
<el-form-item label="文本内容:">
<q-input v-model="addMsg.Content" filled clearable type="textarea" label="文本内容" style="width: 60%;"/>
<q-input v-model="addMsg.Content" filled clearable type="textarea" label="文本内容"
style="width: 60%;" />
<div style="margin-top: 10px;">
<q-btn color="accent" label="+插入客户名称" size='sm' class="q-mr-md" @click='insert' />
</div>
</el-form-item>
<el-form-item label="添加内容:">
<q-btn color="white" text-color="black" label="+添加图片/图文/小程序" size='md' v-if="JSON.stringify(Selectobj) == '{}'">
<q-btn color="white" text-color="black" label="+添加图片/图文/小程序" size='md'
v-if="JSON.stringify(Selectobj) == '{}'">
<q-popup-proxy ref='popupproxy'>
<q-banner>
<q-btn-group push>
<q-btn label="图片" icon="images" @click="selectimg()"/>
<q-btn label="图文" icon="visibility" @click="selecttextimg()"/>
<q-btn label="小程序" icon="update" @click="selectxcx()"/>
<q-btn label="图片" icon="images" @click="selectimg()" />
<q-btn label="图文" icon="visibility" @click="selecttextimg()" />
<q-btn label="小程序" icon="update" @click="selectxcx()" />
</q-btn-group>
</q-banner>
</q-popup-proxy>
......@@ -102,12 +105,17 @@
</el-form-item>
</el-form>
<q-card-actions align="left" class="bg-white" style="margin-top: 15px;">
<q-btn color="accent" class="q-mr-md" label="保存" @click="savemove()" style="width: 100px;" :loading="loading"/>
<q-btn class="q-mr-md" label="返回" @click="goblck()" style="width: 60px;" />
</q-card-actions>
</div>
<!-- 人员选择 -->
<el-dialog custom-class='w700' title="选择人员" :visible.sync="outerVisible" center>
<div class="fl" style="width: 300px; margin: 0 20px;">
<p style="margin: 0 0 10px 0;">选择: <el-input class='w200' placeholder="输入关键字进行过滤" v-model="filterText" @input="">
<p style="margin: 0 0 10px 0;">选择: <el-input class='w200' placeholder="输入关键字进行过滤" v-model="filterText"
@input="">
</el-input>
</p>
<el-tree class='ApprovalProcessBg' :data="memberList" show-checkbox :filter-node-method="filterNode"
......@@ -129,31 +137,22 @@
</div>
</el-dialog>
<!-- 图片 -->
<selectMaterial v-if="isshowselectMaterial"
:materialType="materialType"
:saveobj = 'Selectobj'
@close ="getclose()"
@success='getsuccess'>
<selectMaterial v-if="isshowselectMaterial" :materialType="materialType" :saveobj='Selectobj'
@close="getclose()" @success='getsuccess'>
</selectMaterial>
<!-- 图文 -->
<imagetextform v-if="isshowimagetext"
:saveobj = 'Selectobj'
@close ="gettwclose()"
@success='gettwsuccess'
>
<imagetextform v-if="isshowimagetext" :saveobj='Selectobj' @close="gettwclose()" @success='gettwsuccess'>
</imagetextform>
<!-- 小程序 -->
<appletform v-if="isshowapplet"
:saveobj = 'Selectobj'
@close ="getxcxclose()"
@success='getxcxsuccess'
>
<appletform v-if="isshowapplet" :saveobj='Selectobj' @close="getxcxclose()" @success='getxcxsuccess'>
</appletform>
</div>
</template>
<script>
selectMaterial
import {
setWeChatWelcomesInfo,
} from '../../api/system/wechat';
import selectMaterial from "../../components/enterprise/selectMaterial"
import imagetextform from "../../components/enterprise/imagetext-form"
import appletform from "../../components/enterprise/applet-form"
......@@ -178,20 +177,24 @@
filterText: '',//人员选择 帅选
memberList: [],//
showMember: [],
addMsg: {
membertype: 1,
membertype: '1',
ryList: [],
addMsg: {
Id: 0,
UserIdList: [],//成员列表
Content: "",
MediumIds: '',//使用的素材id '1,2,3'格式
Type: 1,//如果MediumIds不为空的情况 type为2
},
defaultProps: {
children: 'ChildList',
label: 'EmployeeName',
},
materialType:1,
isshowselectMaterial:false,
isshowimagetext:false,
isshowapplet:false,
Selectobj:{},//选中对象
materialType: 1,
isshowselectMaterial: false,
isshowimagetext: false,
isshowapplet: false,
Selectobj: {},//选中对象
}
},
created() {
......@@ -244,55 +247,104 @@
},
getmember() {//人员确定选择
this.outerVisible = false;
this.addMsg.ryList = JSON.parse(JSON.stringify(this.showMember))
this.ryList = JSON.parse(JSON.stringify(this.showMember))
},
insert() {
this.addMsg.Content = this.addMsg.Content + '##客户名称##'
},
selectimg(){//素材选择 图片模式
selectimg() {//素材选择 图片模式
this.materialType = 2;
this.isshowselectMaterial=true;
if(this.$refs.popupproxy){
this.isshowselectMaterial = true;
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
getclose(){//素材关闭
this.isshowselectMaterial=false
getclose() {//素材关闭
this.isshowselectMaterial = false
},
getsuccess(data){//选择数据回来
getsuccess(data) {//选择数据回来
this.Selectobj = data
this.isshowselectMaterial=false
this.isshowselectMaterial = false
},
selecttextimg(){//图文
this.isshowimagetext=true;
if(this.$refs.popupproxy){
selecttextimg() {//图文
this.isshowimagetext = true;
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
gettwclose(){//图文
this.isshowimagetext=false;
gettwclose() {//图文
this.isshowimagetext = false;
},
gettwsuccess(data){//图文返回成功
gettwsuccess(data) {//图文返回成功
this.Selectobj = data
this.isshowimagetext=false
this.isshowimagetext = false
},
selectxcx(){//图文
this.isshowapplet=true;
selectxcx() {//图文
this.isshowapplet = true;
if(this.$refs.popupproxy){
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
getxcxclose(){//小程序 关闭
this.isshowapplet=false;
getxcxclose() {//小程序 关闭
this.isshowapplet = false;
},
getxcxsuccess(){//小程序 关闭
getxcxsuccess() {//小程序 关闭
this.Selectobj = data
this.isshowapplet=false
this.isshowapplet = false
},
savemove() {//保存
if (this.membertype == 1) {
this.addMsg.UserIdList = ["-1"];
} else {
if (this.ryList.length > 0) {
this.addMsg.UserIdList = []
this.ryList.forEach(x => {
this.addMsg.UserIdList.push(x.Id)
})
} else {
this.$q.notify({
type: 'negative',
message: `请选择人员列表`,
position: 'top'
})
return
}
}
if (this.addMsg.MediumIds == '') {
this.addMsg.Type = 1;
if (this.addMsg.Content == '') {
this.$q.notify({
type: 'negative',
message: `请输入文本内容`,
position: 'top'
})
return
}
} else {
this.addMsg.Type = 2;
}
// 调取接口
this.loading = true
setWeChatWelcomesInfo(this.addMsg).then(res => {
this.loading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
this.goblck()
})
},
goblck() {//返回上一个页面
this.$router.go(-1);//返回上一层
},
......
<template>
<div class="welcomeList page-body">
<!-- <div class="page-search row items-center">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-select filled stack-label @input="changePage(1)" option-value="Id" option-label="Name"
v-model="msg.Type" ref="Id" :options="typeList" label="类型" :dense="false" emit-value
map-options />
</div>
</div>
</div> -->
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" title="" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">欢迎语列表</div>
<q-space />
<q-btn color="accent" style="float:right;margin-right:0;" size="sm" class="q-mr-md" icon="add"
label="新增欢迎语" @click="goadd()"></q-btn>
<q-btn color="accent" style="float:right;margin-right:0;" size="sm" class="q-mr-md" icon="add" label="新增欢迎语"
@click="goadd()"></q-btn>
</template>
<template v-slot:body-cell-Type="props">
<q-td :props="props">
<span v-if="props.row.Type==1">图文</span>
<span v-if="props.row.Type==1">文本</span>
<span v-if="props.row.Type==2">图片</span>
<span v-if="props.row.Type==3">图文</span>
<span v-if="props.row.Type==4">小程序</span>
</q-td>
</template>
<template v-slot:body-cell-Content="props">
......@@ -27,13 +34,15 @@
</div>
</q-td>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs"
label="编辑" @click="goDetailed(props.row,'0')" />
<q-btn flat size="xs" icon="delete" style="font-weight:400;color: #3FC4FF" class="q-mr-xs"
label="删除" @click="goDetailed(props.row,'0')" />
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" label="编辑"
@click="goedit(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" class="q-mr-xs" label="删除"
@click="goDetailed(props.row)" />
</q-td>
</template>
<template v-slot:bottom>
......@@ -44,10 +53,12 @@
</div>
</div>
</template>
<script>
</template>
<script>
import {
getWeChatWelcomesPageList,
} from '../../api/system/wechat';
export default {
meta: {
......@@ -58,16 +69,21 @@
return {
loading: false,
ISsystem: false,
data: [{Type:1,Content:'文本:您好,##客户名称##!亲~你終於來啦!!我是你的专属顾问,任何有关日语学习问题都可以问我哦!!~~~~~~~~~~ 加入甲鹤大家庭~优惠天天有 第一条~9.9块日语体验课!! 第二条~每周活动免费参加! 第三条~猛戳我,”赞羊”电商优惠券免费送!! 第四条~再戳我,”旅游优惠券”我再送! ~~~~~从现在起”甲鹤日语”就是你学习日语的好帮手!! 现在回复”甲鹤”两个字~看看甲鹤想给你看甚么?~呵呵呵!',applymember:'通用',UpdateTime:'2021-08-04 15:48'}],
data: [],
pageCount: 0,
msg: {
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
Month: '',
TeacherId: 0,
State: 0,
pageSize: 15,
rowsPerPage: 15,
Type: 0,
},
typeList:[
{Id:0,Name:'不限'},
{Id:1,Name:'文本'},
{Id:2,Name:'图片'},
{Id:3,Name:'图文'},
{Id:4,Name:'小程序'},
],
//公告column
columns: [{
name: 'Type',
......@@ -81,11 +97,17 @@
align: 'left',
},
{
name: 'applymember',
field: 'applymember',
name: 'UserIdName',
field: 'UserIdName',
label: '使用成员',
align: 'left'
},
{
name: 'UpdateByName',
field: 'UpdateByName',
label: '创建者',
align: 'left'
},
{
name: 'UpdateTime',
field: 'UpdateTime',
......@@ -102,24 +124,54 @@
}
},
created() {
this.getList()
},
methods: {
changePage(e){
changePage(e) {
this.msg.pageIndex = 1
this.getList()
},
getList() {
this.loading = true
getWeChatWelcomesPageList(this.msg).then(res => {
this.loading = false
this.data = res.Data.PageData;
this.pageCount = res.Data.Count
this.data.forEach(x=>{
x.UserIdName=''
x.UserIdList.map((j,i)=>{
if(j==-1){
x.UserIdName='通用'
return
}else{
if(i+1!=x.UserIdList.length){
x.UserIdName=x.UserIdName+'某某、'
}else{
x.UserIdName=x.UserIdName+'某某'
}
}
})
})
})
},
goadd(){
goadd() {
this.$router.push({
path:'/enterprise/addWelcome',
path: '/enterprise/addWelcome',
});
},
goedit(){//编辑
},
goDetailed(row){//修改
console.log(row)
}
}
}
</script>
</script>
<style>
<style>
.welcomeList .Sysuser_Date .el-input--prefix .el-input__inner {
background-color: red;
border: 0;
......@@ -164,8 +216,8 @@
background: transparent !important;
border: 0 !important;
}
.welcomeList .el-drawer.rtl{
.welcomeList .el-drawer.rtl {
overflow: inherit;
}
</style>
\ No newline at end of file
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment