Commit aa846b4b by 无尘

fix: 修改原有组件

parent 60784d87
<!--
<store-auth-detail @closeLog="closeLog"></store-auth-detail>
import storeAuthDetail from '@/components/company/store-auth-detail.vue';
-->
<template>
<el-dialog title="绑定详情" :visible.sync="dialogVisible" width="995px" :before-close="handleClose">
<div class="">
<el-table class="select-table" ref="multipleTable" height="450" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }">
<el-table-column label="操作" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.dataName }}</template>
</el-table-column>
<el-table-column prop="" label="变更前" >
<template slot-scope="scope">
{{ scope.row.dataCode }}
</template>
</el-table-column>
<el-table-column prop="" label="变更后">
<template slot-scope="scope">
{{ scope.row.chainName }}
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
</template>
<script>
import { getRequest } from '@/api/api';
import errMsg from '@/common/js/error';
// import { _debounce } from '@/common/js/public';
export default {
name: 'store-auth-detail',
props: {
taskId: {
type: String,
default() {
return '';
}
}
},
data() {
return {
dialogVisible: true,
tableData: []
};
},
computed: {},
methods: {
handleClose() {
const that = this;
that.tableData = [];
that.$emit('closeLog');
},
/**
* 路由跳转
*/
changeRoute(path) {
this.$router.push(path);
},
/**
* 获取列表数据
*/
getTableList(val) {
const that = this;
let para = {
taskId: that.taskId,
};
getRequest('/haoban-manage3-web/sync-task-detail', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.tableData = resData.result || [];
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
taskId(newData, oldData) {
const that = this;
if (newData) {
that.getTableList();
}
}
},
mounted() {
const that = this;
if (that.taskId) {
that.getTableList();
}
document.documentElement.style.backgroundColor = '#f0f2f5';
},
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
components: {}
};
</script>
<style type="text/less" lang="less" scoped>
.line-h-18 {
line-height: 18px;
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-07-22 14:59:25
-->
<!--
<add-self-app :editRow="editRow" @closeText="closeText" @submitText="submitText"></add-self-app>
import addSelfApp from '@/components/set/add-self-app.vue';
-->
<template>
<el-dialog :title="!!editRow.materialId ? '自建应用' : '自建应用'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
<div class="">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item label="应用名称" prop="secretName">
<limitInput :inputWidth="440" :inputValue.sync="ruleForm.secretName" :holder="''" :getByType="'word'" :maxLength="50"> </limitInput>
</el-form-item>
<el-form-item label="Agentld" prop="secretVal">
<limit-textarea :inputWidth="440" :inputValue.sync="ruleForm.secretVal" :holder="''" :getByType="'word'" :maxLength="200"></limit-textarea>
</el-form-item>
<el-form-item label="Secret" prop="enterpriseId">
<limit-textarea :inputWidth="440" :inputValue.sync="ruleForm.secretVal" :holder="''" :getByType="'word'" :maxLength="200"></limit-textarea>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="toCancel">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import limitInput from '@/components/limit-input.vue';
import limitTextarea from '@/components/limit-textarea.vue';
import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
export default {
props: {
editRow: {
type: Object,
default() {
return {};
}
},
categoryId: {
type: Object,
default() {
return '';
}
}
},
components: {
limitInput,
limitTextarea
},
data() {
return {
dialogVisible: true,
ruleForm: {
secretName: '',
secretVal: '',
enterpriseId: '',
secretId: ''
},
rules: {
secretName: [{ required: true, message: '请输入应用名称', trigger: 'blur' }],
secretVal: [{ required: true, message: '请输入secret', trigger: 'blur' }],
enterpriseId: [{ required: true, message: '请输入Agentld', trigger: 'blur' }]
},
brandOptions: [] //品牌
};
},
methods: {
toCancel() {
const that = this;
that.$emit('closeText');
that.$refs['ruleForm'].resetFields();
},
handleClose(done) {
const that = this;
that.$emit('closeText');
that.$refs['ruleForm'].resetFields();
},
submitForm: _debounce(function(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
that.postSave();
}
});
}, 300),
postSave() {
const that = this;
const data = {
secretId: that.ruleForm.secretId,
secretName: that.ruleForm.secretName,
enterpriseId: that.ruleForm.enterpriseId,
memberSecret: that.ruleForm.secretVal
};
postRequest('/haoban-manage3-web/wx-enterprise-member-secret-set', data)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('操作成功', 'success');
that.$refs['ruleForm'].resetFields();
that.$emit('submitText');
} else {
errMsg.errorMsg(resData);
}
})
.catch(error => {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
editRow(newData) {
const that = this;
if (Object.keys(newData).length) {
that.ruleForm = JSON.parse(JSON.stringify(newData));
}
}
},
mounted() {
const that = this;
if (Object.keys(that.editRow).length) {
that.ruleForm = JSON.parse(JSON.stringify(that.editRow));
}
}
};
</script>
<style lang="less" scoped>
.w-440 {
width: 440px;
}
.m-b-20 {
margin-bottom: 20px;
}
.p-l-18 {
padding-left: 18px;
}
.material-content {
position: relative;
.material-body {
/* resize: none;
width: 440px;
height: 273px;
border-radius: 2px;
border: 1px solid rgba(196, 198, 207, 1); */
.el-textarea {
/deep/ .el-textarea__inner {
height: 68px;
}
}
}
}
.el-textarea {
/deep/ .el-textarea__inner {
height: 68px;
}
}
</style>
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-04-14 09:50:16 * @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-07-20 14:48:46 * @LastEditTime: 2020-07-22 15:01:23
--> -->
<!-- <!--
<secret-set :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></secret-set> <secret-set :editRow="editRow" @closeText="closeText" @submitText="submitText"></secret-set>
import secretSet from '@/components/set/secret-set.vue'; import secretSet from '@/components/set/secret-set.vue';
--> -->
<template> <template>
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-07-22 14:22:21
-->
<template>
<div class="my-customer-wrap common-set-wrap">
<nav-crumb :navpath="navpath"> </nav-crumb>
<div class="right-content">
<div class="right-box" :style="{ 'min-height': bgHeight }">
<div class="apps-content flex" :style="{ 'min-height': bgHeight }">
<div class="apps-content-right">
<div class="flex flex-space-between">
<div class="flex ">
<div class="auth-merchant-img">
<img src="" alt="">
</div>
<div>
<div class="auth-merchant-name w-170">
<span class="font-14 color-606266"></span><el-tag class="m-l-10" size="small" type="danger">4.0</el-tag>
</div>
</div>
</div>
<div class="overstore-tip" style="width:643px;">
<div role="alert" class="el-alert el-alert--info flex flex-align-start">
<i class="el-alert__icon el-icon-info font-12 color-2f54eb"></i>
<div class="el-alert__content">
<span class="el-alert__title color-606266 font-14">仅保存近一年失败日志</span>
</div>
</div>
</div>
</div>
<div class="m-t-20">
<el-table class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }">
<el-table-column label="申请事项" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.userName }}</template>
</el-table-column>
<el-table-column prop="" label="申请理由" show-overflow-tooltip>
<template slot-scope="scope">
<div class="line-18">{{ scope.row.createTime | timeStampToYmd }}</div>
<div class="line-18">{{ scope.row.createTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column prop="" label="门店绑定" show-overflow-tooltip>
<template slot-scope="scope">
<div class="line-18">{{ scope.row.updateTime | timeStampToYmd }}</div>
<div class="line-18">{{ scope.row.updateTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column prop="" label="门店共享" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.taskDesc | '--' }}</template>
</el-table-column>
<el-table-column prop="" label="提交人" show-overflow-tooltip>
<template slot-scope="scope">
<span class="font-14 color-606266">{{ scope.row.statusFlag == 4 ? '成功' : scope.row.statusFlag == 5 ? '完成有错误' : scope.row.statusFlag == 6 ? '有错误关闭' : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="" label="审核人" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.taskDesc | '--' }}</template>
</el-table-column>
<el-table-column prop="" label="审核结果" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.taskDesc | '--' }}</template>
</el-table-column>
<el-table-column prop="" label="审核时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="line-18">{{ scope.row.createTime | timeStampToYmd }}</div>
<div class="line-18">{{ scope.row.createTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column prop="" label="操作" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" @click="toShowLog(scope.$index, scope.row)">绑定详情</el-button>
<el-button type="text" @click="toCancleAudit(scope.$index, scope.row)">取消审核</el-button>
</template>
</el-table-column>
</el-table>
<div class="block common-wrap__page text-right m-t-24" v-if="tableData.length != 0">
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
<store-auth-detail v-if="logShow" :taskId="taskId" @closeLog="closeLog"></store-auth-detail>
<!-- <vue-gic-footer></vue-gic-footer> -->
</div>
</template>
<script>
import navCrumb from '@/components/nav/nav.vue';
import storeAuthDetail from '@/components/company/store-auth-detail.vue';
import { getRequest, postRequest } from '@/api/api';
import errMsg from '@/common/js/error';
export default {
name: 'auditLog',
data() {
return {
bgHeight: window.screen.availHeight - 288 + 'px',
// 面包屑参数
navpath: [
{
name: '首页',
path: '/index'
},
{
name: '通讯录',
path: '/contactsList'
},
{
name: '授权商户',
path: '/authMerchant'
},
{
name: '审核日志',
path: ''
}
],
searchInput: '',
// 分页参数
currentPage: 1,
pageSize: 20,
total: 0,
tableData: [],
// 绑定详情
logShow: false,
taskId: ''
};
},
computed: {},
methods: {
/**
* 查看失败日志
*/
toShowLog(index, item) {
const that = this;
that.taskId = item.taskId;
that.logShow = true;
},
closeLog() {
const that = this;
that.taskId = '';
that.logShow = false;
},
/**
* 路由跳转
*/
changeRoute(path) {
this.$router.push(path);
},
/**
* 分页---页码变化
*/
handleSizeChange(val) {
const that = this;
that.currentPage = 1;
that.pageSize = val;
that.getTableList();
},
/**
* 分页---当前页变化
*/
handleCurrentChange(val) {
const that = this;
that.currentPage = val;
that.getTableList();
},
/**
* 获取品牌
*/
getBrandData() {
const that = this;
postRequest('/haoban-manage3-web/wx-enterprise-list', {})
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
if (!!resData.result && !!resData.result.length) {
that.brandOptions = resData.result;
}
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 获取列表数据
*/
getTableList(val) {
const that = this;
let para = {
keyWord: that.searchInput || '', // 搜索字段
pageNum: that.currentPage, // 当前页
pageSize: that.pageSize // 一页显示个数
};
getRequest('/haoban-manage3-web/sync-task', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.tableData = resData.result.result || [];
that.total = resData.result.totalCount;
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
},
mounted() {
const that = this;
that.getTableList();
document.documentElement.style.backgroundColor = '#f0f2f5';
},
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
components: {
navCrumb,
storeAuthDetail
}
};
</script>
<style type="text/less" lang="less" scoped>
.line-h-18 {
line-height: 18px;
}
.w-170 {
width: 170px;
}
.my-customer-wrap {
height: 100%;
}
.right-content {
/*width: 100%;*/
padding: 0 20px 20px 20px;
min-height: calc(100% - 160px);
.right-box {
background: #fff;
min-height: 500px;
padding: 0px;
.apps-content {
.apps-content-right {
width: 100%;
padding: 20px;
background: #fff;
.common-set-wrap {
height: 100%;
background: #fff;
}
}
}
}
}
</style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-06-28 11:14:26 * @LastEditTime: 2020-07-22 14:30:42
--> -->
<template> <template>
<div class="my-customer-wrap common-set-wrap"> <div class="my-customer-wrap common-set-wrap">
...@@ -14,8 +14,15 @@ ...@@ -14,8 +14,15 @@
<div class="apps-content flex" style="min-height: calc(100vh - 104px);"> <div class="apps-content flex" style="min-height: calc(100vh - 104px);">
<div class="apps-content-right"> <div class="apps-content-right">
<div class="flex flex-space-between"> <div class="flex flex-space-between">
<div></div> <div class="" style="width:643px;">
<el-button type="primary" @click="showAddDialog">新建授权</el-button> <div role="alert" class="el-alert el-alert--info flex flex-align-start">
<i class="el-alert__icon el-icon-info font-12 color-2f54eb"></i>
<div class="el-alert__content">
<span class="el-alert__title color-606266 font-14">提示:授权的商户,需在同一个微信开放平台主体下;最多授权10个商户。 </span><el-button type="text" @click="openUrl">主体查询方法</el-button>
</div>
</div>
</div>
<el-button type="primary" @click="changeRoute('/newAuthMerchant')">新建GIC商户授权</el-button>
</div> </div>
<div class="m-t-20"> <div class="m-t-20">
<el-table class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }"> <el-table class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }">
...@@ -53,11 +60,9 @@ ...@@ -53,11 +60,9 @@
</div> </div>
</div> </div>
<!-- <vue-gic-footer></vue-gic-footer> --> <!-- <vue-gic-footer></vue-gic-footer> -->
<add-enterprise v-if="addShow" @refreshData="refreshData"></add-enterprise>
</div> </div>
</template> </template>
<script> <script>
import addEnterprise from '@/components/company/add-enterprise.vue';
import navCrumb from '@/components/nav/nav.vue'; import navCrumb from '@/components/nav/nav.vue';
import { getRequest } from '@/api/api'; import { getRequest } from '@/api/api';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
...@@ -66,7 +71,6 @@ export default { ...@@ -66,7 +71,6 @@ export default {
name: 'authMerchant', name: 'authMerchant',
data() { data() {
return { return {
bgHeight: window.screen.availHeight - 104 + 'px',
// 面包屑参数 // 面包屑参数
navpath: [ navpath: [
{ {
...@@ -82,31 +86,20 @@ export default { ...@@ -82,31 +86,20 @@ export default {
path: '' path: ''
} }
], ],
// 分页参数 // 分页参数
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
total: 0, total: 0,
tableData: [], tableData: [],
addShow: false
}; };
}, },
computed: {}, computed: {},
methods: { methods: {
/** /**
* 新增企业 * url 跳转
*/ */
showAddDialog() { openUrl() {
const that = this; window.open('https://developers.weixin.qq.com/community/develop/doc/00046610a9cbb0fd80f9a7dd354c09');
that.addShow = true;
},
refreshData(res) {
const that = this;
that.addShow = false;
if (res == 'close') {
return false;
}
that.getTableList();
}, },
/** /**
* 路由跳转 * 路由跳转
...@@ -157,14 +150,7 @@ export default { ...@@ -157,14 +150,7 @@ export default {
} }
}, },
watch: { watch: {
activeBrand: function(newData, oldData) {
const that = this;
that.activeBrand = newData;
},
activeGroup: function(newData, oldData) {
const that = this;
that.activeGroup = newData;
}
}, },
mounted() { mounted() {
const that = this; const that = this;
...@@ -175,8 +161,7 @@ export default { ...@@ -175,8 +161,7 @@ export default {
document.documentElement.style.backgroundColor = '#fff'; document.documentElement.style.backgroundColor = '#fff';
}, },
components: { components: {
navCrumb, navCrumb
addEnterprise
} }
}; };
</script> </script>
......
...@@ -4,22 +4,19 @@ ...@@ -4,22 +4,19 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-06-10 11:19:29 * @LastEditTime: 2020-07-22 15:18:48
--> -->
<template> <template>
<div class="daily-set-wrap "> <div class="daily-set-wrap ">
<div class="company-set-content border-box"> <div class="company-set-content border-box">
<div class="company-title m-b-20 flex flex-space-between"> <div class="company-title m-b-20 flex flex-space-between">
<div class="line-h-32"><span class="color-303133 font-14 font-w-600">企业微信基本信息</span><el-button class="m-l-20" type="text" @click="refeshData">同步刷新 </el-button></div> <div class="line-h-32"><span class="color-303133 font-14 font-w-600">企业微信基本信息</span><el-button class="m-l-20" type="text" @click="refeshData">同步刷新 </el-button></div>
<div>
<set-tip v-if="!checkShow" :tipText="tipText"></set-tip>
</div>
</div> </div>
<div class="company-info-body"> <div class="company-info-body">
<el-form ref="form" :model="form" label-width="105px"> <el-form ref="form" :model="form" label-width="105px">
<!-- <el-form-item label="小程序版本"> <el-form-item label="小程序版本">
<span class="font-14 color-303133">{{ companyObj.smallVersion || '免费版' }}</span> <span class="font-14 color-303133">{{ companyObj.smallVersion || '免费版' }}</span>
</el-form-item> --> </el-form-item>
<el-form-item label="企业名称"> <el-form-item label="企业名称">
<span class="font-14 color-303133 p-r-10">{{ companyObj.corpName }}</span> <el-tag> {{ companyObj.contactFlag == 1 ? '已认证' : '未认证' }}</el-tag <span class="font-14 color-303133 p-r-10">{{ companyObj.corpName }}</span> <el-tag> {{ companyObj.contactFlag == 1 ? '已认证' : '未认证' }}</el-tag
><span v-if="companyObj.contactFlag == 1" class="p-l-10 font-12 color-909399">认证到期 {{ companyObj.verifiedEndTime | timeStampToYmd }}</span> ><span v-if="companyObj.contactFlag == 1" class="p-l-10 font-12 color-909399">认证到期 {{ companyObj.verifiedEndTime | timeStampToYmd }}</span>
...@@ -40,85 +37,30 @@ ...@@ -40,85 +37,30 @@
</div> </div>
<div class="company-title m-b-20 m-t-30"><span class="color-303133 font-14 font-w-600">客户密钥维护</span></div> <div class="company-title m-b-20 m-t-30"><span class="color-303133 font-14 font-w-600">客户密钥维护</span></div>
<div class="company-info-body secret-body"> <div class="company-info-body secret-body">
<div class="m-b-20 secret-cell"> <div class="m-b-20 secret-cell flex">
<span class="inline-block w-127" <div>
><el-tooltip class="item" effect="dark" content="企业微信中【客户联系】API中若更新secret,请复制后更新至此处。首次使用好办请输入。" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;" class="font-14 color-606266">客户联系secret:</span></el-tooltip> </span <el-tooltip class="item" effect="dark" content="用于获取登录小程序用户的手机号/姓名/部门信息。必填项" placement="top-start"> <span class="font-14 color-606266 common-bottom-border">自建应用:</span></el-tooltip>
><el-input class="m-l-10 w-399" maxlength="200" v-model="wxObj.secretVal" placeholder="必填"></el-input><el-button class="m-l-20" type="text" @click="saveSecret('1')">保存</el-button><span v-if="wxObj.updateTime" class="m-l-20 font-12 color-909399">最后一次保存:{{ wxObj.updateTime | formatTimeStamp }}</span </div>
><span class="m-l-37 font-14 color-303133" <div>
><span :class="['iconfont', wxObj.checkFlag ? 'color-49c958 iconchenggong' : 'color-f83431 iconshibai']"></span><span class="p-l-10">{{ wxObj.checkFlag ? '校验成功' : '校验失败' }}</span></span <div class="self-app-info">
> <div class="flex flex-space-between">
<div v-if="showWxError" class="el-form-item__error m-l-137">请填写客户联系 secret</div> <div></div>
</div> <div></div>
</div>
<div class="m-b-20 secret-cell"> <div></div>
<span class="inline-block w-127" <div></div>
><el-tooltip class="item" effect="dark" placement="top-start"> </div>
<div slot="content">企业微信中通讯录同步若更新secret,请复制后更新至此处。<br />因获取Secret而获取通讯录的相关信息。首次使用好办请输入。<br />若发生相关变更,与企业微信无关,特此告知!</div>
<span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;" class="font-14 color-606266">通讯录secret:</span></el-tooltip
></span
><el-input class="m-l-10 w-399" maxlength="200" v-model="contactObj.secretVal" placeholder="非必填"></el-input><el-button class="m-l-20" type="text" @click="saveSecret('2')">保存</el-button><span v-if="contactObj.updateTime" class="m-l-20 font-12 color-909399">最后一次保存:{{ contactObj.updateTime | formatTimeStamp }}</span
><span class="m-l-37 font-14 color-303133"
><span :class="['iconfont', contactObj.checkFlag ? 'color-49c958 iconchenggong' : 'color-f83431 iconshibai']"></span><span class="p-l-10">{{ contactObj.checkFlag ? '校验成功' : '校验失败' }}</span></span
>
</div>
<div class="m-b-20 secret-cell">
<span class="inline-block w-127"
><el-tooltip class="item" effect="dark" content="用于获取登录小程序用户的手机号/姓名/部门信息" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;" class="font-14 color-606266">好办助手secret:</span></el-tooltip> </span
><el-input class="m-l-10 w-399" v-model="haobanObj.secretVal" placeholder="必填"></el-input><el-button class="m-l-20" type="text" @click="saveSecret('3')">保存</el-button><span v-if="haobanObj.updateTime" class="m-l-20 font-12 color-909399">最后一次保存:{{ haobanObj.updateTime | formatTimeStamp }}</span
><span class="m-l-37 font-14 color-303133"
><span :class="['iconfont', haobanObj.checkFlag ? 'color-49c958 iconchenggong' : 'color-f83431 iconshibai']"></span><span class="p-l-10">{{ haobanObj.checkFlag ? '校验成功' : '校验失败' }}</span></span
>
<div v-if="showHaobanError" class="el-form-item__error m-l-137">请填写好办助手 secret</div>
</div>
<!-- <div class="secret-cell m-b-20">
<span class="inline-block w-127"
><el-tooltip class="item" effect="dark" content="企业微信中【应用管理】关联的会员小程序secret,请复制后更新至此处。首次使用好办请输入。" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;" class="font-14 color-606266">会员小程序secret:</span></el-tooltip> </span
><el-input class="m-l-10 w-399" maxlength="200" v-model="companyObj.memberSecret" placeholder="非必填"></el-input><el-button class="m-l-20" type="text" @click="saveSecret('3')">保存</el-button><span v-if="companyObj.memberSecretLastTime" class="m-l-20 font-12 color-909399">最后一次保存:{{ companyObj.memberSecretLastTime | formatTimeStamp }}</span
><span class="m-l-37 font-14 color-303133"
><span :class="['iconfont', companyObj.memberSecretFlag ? 'color-49c958 iconchenggong' : 'color-f83431 iconshibai']"></span><span class="p-l-10">{{ companyObj.memberSecretFlag ? '校验成功' : '校验失败' }}</span></span
>
</div> -->
<div class="secret-cell ">
<el-tooltip class="item" effect="dark" content="企业微信中【应用管理】关联的会员小程序secret,请复制后更新至此处。首次使用好办请输入。" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;" class="font-14 color-606266">会员小程序secret:</span></el-tooltip>
<span class="p-l-5 font-14 color-303133 font-w-500">会员小程序信息</span>
<div class="table-cell m-t-10 p-l-137">
<el-table class="no-empty-icon-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }">
<el-table-column label="小程序名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.secretName || '--' }}</template>
</el-table-column>
<el-table-column prop="" label="secret" width="506">
<template slot-scope="scope">
<span>{{ scope.row.secretVal || '-- ' }} </span><span :class="['iconfont', scope.row.checkFlag ? 'color-49c958 iconchenggong' : 'color-f83431 iconshibai']"></span><span class="p-l-10">{{ scope.row.checkFlag ? '校验成功' : '校验失败' }}</span>
</template>
</el-table-column>
<el-table-column prop="" label="关联商户" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.enterpriseName || '--' }}</template>
</el-table-column>
<el-table-column prop="" label="最近编辑时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="line-18">{{ scope.row.updateTime | timeStampToYmd }}</div>
<div class="line-18">{{ scope.row.updateTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column prop="" label="操作" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button><el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div v-if="tableData.length < 10" class="text-center add-cell cursor-pointer" @click="addSecret"><span class="el-icon-plus font-14 color-2f54eb add-cell-txt"></span><span class="font-14 color-2f54eb p-l-5 add-cell-txt">新建</span><span class="font-12 color-c0c4cc p-l-20">最多添加10个</span></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<secret-set v-if="addShow" :editRow="editRow" @closeText="closeText" @submitText="submitText"></secret-set> <add-self-app v-if="addShow" :editRow="editRow" @closeText="closeText" @submitText="submitText"></add-self-app>
</div> </div>
</template> </template>
<script> <script>
import setTip from '@/components/app/set-tip.vue'; import addSelfApp from '@/components/set/add-self-app.vue';
import secretSet from '@/components/set/secret-set.vue';
import { getRequest, postRequest } from '@/api/api'; import { getRequest, postRequest } from '@/api/api';
import { _debounce } from '@/common/js/public'; // import { _debounce } from '@/common/js/public';
import showMsg from '@/common/js/showmsg'; import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
export default { export default {
...@@ -127,7 +69,6 @@ export default { ...@@ -127,7 +69,6 @@ export default {
return { return {
checkShow: true, checkShow: true,
tipText: '请在企业密钥维护中输入对应的secret', tipText: '请在企业密钥维护中输入对应的secret',
tableH: window.screen.availHeight - 464 - 126,
wxEnterpriseId: localStorage.getItem('userInfos') ? JSON.parse(localStorage.getItem('userInfos')).wxEnterpriseId : '', wxEnterpriseId: localStorage.getItem('userInfos') ? JSON.parse(localStorage.getItem('userInfos')).wxEnterpriseId : '',
companyObj: { companyObj: {
smallVersion: '', smallVersion: '',
...@@ -233,54 +174,7 @@ export default { ...@@ -233,54 +174,7 @@ export default {
}); });
}); });
}, },
/**
* 保存secret
*/
saveSecret: _debounce(function(flag) {
const that = this;
let para = {};
if (flag == 1) {
para.wxSecretKey = String(that.wxObj.secretVal).trim();
that.showWxError = !!that.wxObj.secretVal ? false : true;
}
if (flag == 2) {
para.contactSecret = String(that.contactObj.secretVal).trim();
}
if (flag == 2 && para.contactSecret == '') {
return false;
}
if (flag == 3) {
para.contactSecret = String(that.haobanObj.secretVal).trim();
that.showHaobanError = !!that.haobanObj.secretVal ? false : true;
}
if (flag == 1 && that.showWxError) {
return false;
}
if (flag == 3 && that.showHaobanError) {
return false;
}
that.postSaveSecret(flag, para);
}, 300),
postSaveSecret(flag, para) {
const that = this;
const url = flag == 1 ? '/wx-enterprise-wx-secret-set' : flag == 2 ? 'wx-enterprise-contact-secret-set' : 'wx-enterprise-haoban-secret-set';
postRequest(`/haoban-manage3-web/${url}`, para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('操作成功', 'success');
that.getSecretData();
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
refeshData() { refeshData() {
const that = this; const that = this;
that.refreshData(); that.refreshData();
...@@ -311,46 +205,7 @@ export default { ...@@ -311,46 +205,7 @@ export default {
}); });
}, },
/**
* 获取secret数据
*/
getSecretData() {
const that = this;
let para = {
wxEnterpriseId: that.wxEnterpriseId
};
getRequest('/haoban-manage3-web/secret-list', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.tableData = [];
if (resData.result && resData.result.length) {
resData.result.forEach(ele => {
if (ele.secretType == 1) {
that.wxObj = ele;
}
if (ele.secretType == 2) {
that.contactObj = ele;
}
if (ele.secretType == 3) {
that.haobanObj = ele;
}
if (ele.secretType == 4) {
that.tableData.push(ele);
}
});
}
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/** /**
* 获取数据 * 获取数据
*/ */
...@@ -374,28 +229,6 @@ export default { ...@@ -374,28 +229,6 @@ export default {
message: error.message message: error.message
}); });
}); });
},
/**
* 获取显示的提示
*/
getTipData() {
const that = this;
let para = {};
getRequest('/haoban-manage3-web/is-wx-enterprise-secret-set', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.checkShow = resData.result;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
} }
}, },
watch: {}, watch: {},
...@@ -404,15 +237,12 @@ export default { ...@@ -404,15 +237,12 @@ export default {
that.$emit('showTab', 1); that.$emit('showTab', 1);
document.documentElement.style.backgroundColor = '#f0f2f5'; document.documentElement.style.backgroundColor = '#f0f2f5';
that.getData(); that.getData();
that.getSecretData();
that.getTipData();
}, },
destroyed() { destroyed() {
document.documentElement.style.backgroundColor = '#fff'; document.documentElement.style.backgroundColor = '#fff';
}, },
components: { components: {
setTip, addSelfApp
secretSet
} }
}; };
</script> </script>
...@@ -477,6 +307,11 @@ export default { ...@@ -477,6 +307,11 @@ export default {
} }
.secret-cell { .secret-cell {
position: relative; position: relative;
.common-bottom-border {
cursor: pointer;
padding-bottom: 2px;
border-bottom: 1px dashed #2f54eb;
}
} }
.add-cell { .add-cell {
height: 43px; height: 43px;
...@@ -488,16 +323,7 @@ export default { ...@@ -488,16 +323,7 @@ export default {
} }
} }
} }
.table-condition {
// min-width: 1200px;
}
.secret-body {
.el-input {
/deep/ .el-input__inner {
color: #c0c4cc;
}
}
}
.daily-set-wrap { .daily-set-wrap {
height: 100%; height: 100%;
.company-set-content { .company-set-content {
......
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