Commit 3a6824fa by 胡悦

Merge branch 'v1.0.2'

2 parents 21ea1c3c 58eecb22
......@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.2.5",
"glsx-components": "^1.3.6",
"lodash": "^4.17.21",
"vue": "^2.6.10",
"vue-amap": "^0.5.10",
......@@ -42,4 +42,4 @@
"> 1%",
"last 2 versions"
]
}
}
\ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http_config } from '@/main'
const sessionId = 'mini-a8d84762-da6a-4ff7-b009-eb7fa0c80dfb-rop';
const listFollowerStaffByPage = params => {
params.method = 'entmicro.api.staff.listFollowerStaffByPage'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取跟进类型列表
const listEntFollowerType = params => {
params.method = 'entmicro.api.staff.listEntFollowerType'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 删除根据员工
const deleteFollowerStaff = params => {
params.method = 'entmicro.api.staff.deleteFollowerStaff'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 删除跟进类型
const deleteFollowerType = params => {
params.sessionId = sessionId
params.method = 'entmicro.api.staff.deleteFollowerType'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询外部联系人员工
const listEntmicroStaff = params => {
params.sessionId = sessionId
params.method = 'entmicro.api.staff.listEntmicroStaff'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 添加跟进员工
const saveFollowerStaff = params => {
params.sessionId = sessionId
params.method = 'entmicro.api.staff.saveFollowerStaff'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 新增跟进类型
const saveFollowerType = params => {
params.sessionId = sessionId
params.method = 'entmicro.api.staff.saveFollowerType'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 同步企微外部联系人
const syncEntmicroIsOutsiderStaff = params => {
params.sessionId = sessionId
params.method = 'entmicro.api.staff.syncEntmicroIsOutsiderStaff'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询组织树
const listDepartmentTree = params => {
params.sessionId = sessionId
params.method = 'entmicro.api.department.listDepartmentTree'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
listFollowerStaffByPage,
listEntFollowerType,
deleteFollowerStaff,
deleteFollowerType,
listEntmicroStaff,
saveFollowerType,
saveFollowerStaff,
syncEntmicroIsOutsiderStaff,
listDepartmentTree
}
\ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http_config } from '@/main'
const sessionId = 'ca5da0cc-f97f-4364-b0fd-f36cc7f93405'
const getAccess = params => {
params.method = 'scrm.api.work.wechat.auth.access'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const getCheckStatus = params => {
params.method = 'scrm.api.work.wechat.access.check.status'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const getQrcode = params => {
params.method = 'scrm.api.work.wechat.access.qrcode'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const getReportStatus = params => {
params.method = 'scrm.api.work.wechat.access.report.status'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const getSecret = params => {
params.method = 'scrm.api.work.wechat.setting.app.secret'
params.sessionId = sessionId
return http_config({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getAccess,
getStatus,
getCheckStatus,
getQrcode,
getReportStatus,
getSecret
}
\ No newline at end of file
......@@ -138,4 +138,20 @@ img {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, .3);
}
.el-message--info {
height: 40px;
background: #e6e9ff;
border: 1px solid #5850ff;
border-radius: 4px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: #5850ff;
font-size: 16px;
}
.el-cascader-menu {
max-height:500px;
}
\ No newline at end of file
......@@ -23,12 +23,14 @@ VueAMap.initAMapApiLoader({
});
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.size = 'small'
start()
export { bootstrap, mount, unmount }
from '@/setup'
from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
export const http_config = params => Vue.prototype.$http_config(params)
console.log(http_config)
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]);
});
\ No newline at end of file
......@@ -7,8 +7,8 @@ import { getRoutes } from '@/router'
import render from './render'
Vue.use(ElementUI)
Vue.use(GLTable)
// import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
// import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/common.scss'
let routes = []
......@@ -25,15 +25,19 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_config = new common.Http({ response, request: request_config, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
subscribe({ messenger })
Vue.use(GLButton, { routes, routerBase })
}
export async function mount({ routerBase }) {
const insts = render(routerBase, routes)
export async function mount(props) {
console.log('22222', props)
console.log(routes)
const insts = render(props.routerBase, routes)
router = insts.router
instance = insts.vm
}
......
......@@ -29,8 +29,8 @@
<label class="el-form-item__label" style="width: 120px">账户等级</label>
<div class="el-form-item__content" style="margin-left: 120px">
<el-select size="small" :disabled="nextStatus" v-model="accountDetail.merchantAccountLevel" placeholder="请选择">
<el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
<el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</div>
</div>
</el-col>
......@@ -43,7 +43,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="登录密码" prop="merchantLoginPassword">
<el-input maxlength="15" :disabled="nextStatus" size="small" type="password" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码"></el-input>
<el-input maxlength="20" :disabled="nextStatus" size="small" type="password" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码(必须包含6-20个字母+数字)" show-password></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -109,7 +109,15 @@ export default {
callback()
}
}
const validatePwd = (rule, value, callback) => {
if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) {
callback(new Error('请输入正确的6-20个密码,必须同时包含字母、数字。'))
} else {
callback()
}
}
return {
editStatus: false,
nextStatus: false,
accountTypesRule: false,
filterText: '',
......@@ -153,17 +161,39 @@ export default {
],
merchantLoginPassword: [
{ required: true, message: '请输入登录密码', trigger: 'blur' },
{ min: 6, max: 15, message: '长度在 6 到 15 个字符', trigger: 'blur' }
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' },
{ validator: validatePwd, trigger: 'blur' }
]
}
}
},
watch: {
accountInfoForm: {
handler() {
this.editStatus = true
},
deep: true
},
accountDetail: {
handler() {
this.editStatus = true
},
deep: true
},
accountAddForm: {
handler() {
this.editStatus = true
},
deep: true
}
},
methods: {
getAddress() {
this.dialogMapVisible = false
this.accountAddForm.merchantAddress = this.$refs.mapForm.address
},
getBtnStatus(status, value) {
this.editStatus = true
this.accountTypesRule = false
if (status) {
this.accounttypeId.push(value)
......@@ -191,7 +221,21 @@ export default {
})
},
handleCancel() {
this.$router.push('/account/index')
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push({
path: '/account/index'
})
})
} else {
this.$router.push({
path: '/account/index'
})
}
},
handlePrev() {
document.querySelector('#app').scrollTop = 0
......@@ -331,6 +375,9 @@ export default {
})
this.accountDetail.merchantAccountLevel = 4
}
this.$nextTick(() => {
this.editStatus = false
})
})
},
twoMerchantDetail(pid) {
......
......@@ -15,6 +15,19 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="联系电话" prop="merchantLegalPersonPhone">
<el-input maxlength="11" size="small" v-model="accountAddForm.merchantLegalPersonPhone" placeholder="请输入联系电话"></el-input>
<el-checkbox v-model="accountAddForm.isloginName">联系电话同时作为登录账户名</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人">
<el-input size="small" v-model="accountAddForm.merchantLegalPerson" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="12">
<el-form-item size="small" label="商户类型" class="merchant-row">
<el-input v-model="accountAddForm.merchantOrgcode" placeholder="请输入组织机构号码" v-if="accountAddForm.merchantType == 2" maxlength="50">
<el-select v-model="accountAddForm.merchantType" slot="prepend" placeholder="请选择">
......@@ -30,7 +43,7 @@
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
<el-row>
<el-col :span="24">
<el-form-item size="small" label="商户地址" class="form-row">
......@@ -39,7 +52,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-row>
<el-col :span="12">
<el-form-item label="联系电话" prop="merchantLegalPersonPhone">
<el-input maxlength="11" size="small" v-model="accountAddForm.merchantLegalPersonPhone" placeholder="请输入联系电话"></el-input>
......@@ -51,7 +64,7 @@
<el-input size="small" v-model="accountAddForm.merchantLegalPerson" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
<el-row>
<el-col :span="12">
<el-form-item label="驻店联系人">
......
......@@ -95,7 +95,7 @@
</span>
</el-col>
</el-row>
<el-row>
<!-- <el-row>
<el-col :span="14" class="flexCol">
<span class="itemName">商户类型:</span>
<span class="itemValue">{{ firstPageObj.merchantTypeName || '-' }}</span>
......@@ -106,14 +106,11 @@
<span class="itemValue">{{ firstPageObj.merchantOrgcode || '-' }}</span>
</el-col>
</el-row>
</el-row> -->
<el-row>
<el-col :span="14" class="flexCol">
<span class="itemName">地址:</span>
<span class="itemValue">
{{ firstPageObj.merchantAddress || '-' }}
</span>
<span class="itemName">联系电话:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone || '-' }}</span>
</el-col>
<el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">联系人:</span>
......@@ -122,8 +119,11 @@
</el-row>
<el-row>
<el-col :span="14" class="flexCol">
<span class="itemName">联系电话:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone || '-' }}</span>
<span class="itemName">地址:</span>
<span class="itemValue">
{{ firstPageObj.merchantAddress || '-' }}
</span>
</el-col>
<el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">营业范围:</span>
......
......@@ -4,123 +4,51 @@
<div class="el-tabs__header is-top">
<div class="el-tabs__nav-wrap is-top">
<div class="el-tabs__nav-scroll">
<div
role="tablist"
class="el-tabs__nav is-top"
style="transform: translateX(0px)"
>
<div
class="el-tabs__active-bar is-top"
:style="{ width: '84px', transform: 'translateX(' + tabWidth + 'px)' }"
></div>
<div
@click="hanleTab(1)"
id="tab-first"
aria-controls="pane-first"
role="tab"
aria-selected="true"
tabindex="0"
class="el-tabs__item is-top"
:class="{ 'is-active': step == 'first' }"
>
修改功能权限
</div>
<div
@click="hanleTab(2)"
id="tab-second"
aria-controls="pane-second"
role="tab"
tabindex="-1"
class="el-tabs__item is-top"
:class="{ 'is-active': step == 'second' }"
>
修改基本信息
</div>
<div role="tablist" class="el-tabs__nav is-top" style="transform: translateX(0px)">
<div class="el-tabs__active-bar is-top" :style="{ width: '84px', transform: 'translateX(' + tabWidth + 'px)' }"></div>
<div @click="hanleTab(1)" id="tab-first" aria-controls="pane-first" role="tab" aria-selected="true" tabindex="0" class="el-tabs__item is-top" :class="{ 'is-active': step == 'first' }">修改功能权限</div>
<div @click="hanleTab(2)" id="tab-second" aria-controls="pane-second" role="tab" tabindex="-1" class="el-tabs__item is-top" :class="{ 'is-active': step == 'second' }">修改基本信息</div>
</div>
</div>
</div>
</div>
<div class="el-tabs__content">
<div
data-v-db55ad92=""
role="tabpanel"
id="pane-first"
aria-labelledby="tab-first"
class="el-tab-pane"
></div>
<div
data-v-db55ad92=""
role="tabpanel"
aria-hidden="true"
id="pane-second"
aria-labelledby="tab-second"
class="el-tab-pane"
style="display: none"
></div>
<div data-v-db55ad92="" role="tabpanel" id="pane-first" aria-labelledby="tab-first" class="el-tab-pane"></div>
<div data-v-db55ad92="" role="tabpanel" aria-hidden="true" id="pane-second" aria-labelledby="tab-second" class="el-tab-pane" style="display: none"></div>
</div>
</div>
<div v-show="step == 'second'">
<div class="account-body scrm-box-f">
<div class="form-title">修改账户信息</div>
<el-form
ref="accountInfoForm"
:model="accountInfoForm"
class="account-body-form"
label-width="120px"
:rules="accountInfoRules"
>
<el-form ref="accountInfoForm" :model="accountInfoForm" class="account-body-form" label-width="120px" :rules="accountInfoRules">
<el-row>
<el-col :span="12">
<el-form-item label="登录账户名" prop="merchantLoginAccount">
<el-input
readonly
size="small"
v-model="accountInfoForm.merchantLoginAccount"
placeholder="请输入登录账户名"
>
</el-input>
<el-input readonly size="small" v-model="accountInfoForm.merchantLoginAccount" placeholder="请输入登录账户名"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
size="small"
label="登录密码"
prop="merchantLoginPassword"
class="form-row"
>
<el-input
type="password"
:readonly="pwdStatus ? 'readonly' : false"
v-model="accountInfoForm.merchantLoginPassword"
placeholder="请输入登录密码"
></el-input>
<el-form-item size="small" label="登录密码" prop="merchantLoginPassword" class="form-row">
<el-input type="password" maxlength="20" :readonly="pwdStatus ? 'readonly' : false" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码(必须包含6-20个字母+数字)" show-password></el-input>
<el-button
type="primary"
class="form-btn"
@click="
pwdStatus = false;
accountInfoForm.merchantLoginPassword = '';
pwdStatus = false
accountInfoForm.merchantLoginPassword = ''
"
>重置密码</el-button
>
重置密码
</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item label="账户类型">
<auto-button
v-for="(item, index) in accountTypes"
:key="index"
:btnLabel="item.accounttypeName"
:btnValue="item.accounttypeId"
stopClick="true"
:typeStatus="
accounttypeId.indexOf(item.accounttypeId) == -1 ? true : false
"
></auto-button>
<auto-button v-for="(item, index) in accountTypes" :key="index" :btnLabel="item.accounttypeName" :btnValue="item.accounttypeId" stopClick="true" :typeStatus="accounttypeId.indexOf(item.accounttypeId) == -1 ? true : false"></auto-button>
</el-form-item>
</el-col>
</el-row>
......@@ -128,13 +56,7 @@
</div>
<div class="account-body scrm-box-f">
<div class="form-title">修改企业信息</div>
<base-info
ref="baseInfoForm"
:brandData="brandData"
:accountAddForm="accountAddForm"
:businessScopeCustomize="businessScopeCustomize"
:businessOption="businessOption"
></base-info>
<base-info ref="baseInfoForm" :brandData="brandData" :accountAddForm="accountAddForm" :businessScopeCustomize="businessScopeCustomize" :businessOption="businessOption"></base-info>
</div>
</div>
<div v-show="step == 'first'">
......@@ -144,15 +66,11 @@
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleSave()" v-show="step == 'first'"
>确定</el-button
>
<el-button type="primary" @click="handleNext()" v-show="step == 'second'"
>确定</el-button
>
<el-button type="primary" @click="handleSave()" v-show="step == 'first'">确定</el-button>
<el-button type="primary" @click="handleNext()" v-show="step == 'second'">确定</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
<el-dialog :visible.sync="dialogMapVisible" width="60%">
......@@ -166,39 +84,46 @@
</template>
<script>
import util from "@/utils/util";
import mapView from "@/components/mapView/index";
import autoButton from "@/components/auto-button/index";
import selectProduct from "./components/selectProduct";
import baseInfo from "./components/baseInfo";
import util from '@/utils/util'
import mapView from '@/components/mapView/index'
import autoButton from '@/components/auto-button/index'
import selectProduct from './components/selectProduct'
import baseInfo from './components/baseInfo'
export default {
name: "index",
name: 'index',
components: {
mapView,
autoButton,
selectProduct,
baseInfo,
baseInfo
},
data() {
const validatePwd = (rule, value, callback) => {
if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) {
callback(new Error('请输入正确的6-20个密码,必须同时包含字母、数字。'))
} else {
callback()
}
}
return {
editStatus: false,
detailFirst: {},
tabWidth: 0,
editInfo: {},
pwdStatus: true,
step: "first",
filterText: "",
step: 'first',
filterText: '',
brandData: [],
defaultProps: {
children: "children",
label: "label",
children: 'children',
label: 'label'
},
parentId: "1",
parentId: '1',
mapHeight: 400,
typeStatus: false,
loadingImg: false,
dialogMapVisible: false,
businessScopeCustomize: [{ name: "" }],
businessScopeCustomize: [{ name: '' }],
accountAddForm: {
id: null,
isloginName: null,
......@@ -218,12 +143,12 @@ export default {
merchantModel: null,
businessScope: [],
bussinessTime: [],
merchantFiles: [],
merchantFiles: []
},
accounttypeId: [],
accountInfoForm: {
merchantLoginAccount: "",
merchantLoginPassword: "",
merchantLoginAccount: '',
merchantLoginPassword: ''
},
accountTypes: [],
accountLevel: [],
......@@ -231,281 +156,250 @@ export default {
businessOption: [],
accountValidityPeriod: [],
baseRules: {
merchantName: [{ required: true, message: "请输入商户名称", trigger: "blur" }],
merchantLegalPersonPhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
],
merchantName: [{ required: true, message: '请输入商户名称', trigger: 'blur' }],
merchantLegalPersonPhone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }]
},
accountInfoRules: {
merchantLoginAccount: [
{ required: true, message: "请输入登录账户名", trigger: "blur" },
],
merchantLoginAccount: [{ required: true, message: '请输入登录账户名', trigger: 'blur' }],
merchantLoginPassword: [
{ required: true, message: "请输入登录密码", trigger: "blur" },
{ min: 6, max: 15, message: "长度在 6 到 15 个字符", trigger: "blur" },
],
},
};
{ required: true, message: '请输入登录密码', trigger: 'blur' },
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' },
{ validator: validatePwd, trigger: 'blur' }
]
}
}
},
watch: {
filterText(val) {
this.$refs.brandTree.filter(val);
this.$refs.brandTree.filter(val)
},
accountAddForm: {
handler() {
this.editStatus = true;
this.editStatus = true
},
deep: true,
deep: true
},
accountInfoForm: {
handler() {
this.editStatus = true;
this.editStatus = true
},
deep: true,
},
deep: true
}
},
methods: {
hanleTab(status) {
if (this.editStatus) {
this.$confirm("是否保存修改信息?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm('是否保存修改信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
status == 1? this.handleNext(status):this.handleSave(status);
status == 1 ? this.handleNext(status) : this.handleSave(status)
})
.catch(() => {
this.tabCancel(status);
});
this.tabCancel(status)
})
} else {
this.handleTabs(status);
this.handleTabs(status)
}
},
tabCancel(status) {
if (status == 2) {
this.$refs.productForm.resetView();
this.$refs.productForm.resetView()
} else {
this.renderView(this.detailFirst);
this.pwdStatus = true;
this.renderView(this.detailFirst)
this.pwdStatus = true
}
this.handleTabs(status);
this.handleTabs(status)
},
handleTabs(status) {
this.editStatus = false;
if (status == 1 && this.step == "second") {
this.tabWidth = 0;
this.step = "first";
this.editStatus = false
if (status == 1 && this.step == 'second') {
this.tabWidth = 0
this.step = 'first'
}
if (status == 2 && this.step == "first") {
this.step = "second";
this.tabWidth = 124;
if (status == 2 && this.step == 'first') {
this.step = 'second'
this.tabWidth = 124
}
},
handleCancel() {
this.$router.push("/account/index");
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push({
path: '/account/index'
})
})
} else {
this.$router.push({
path: '/account/index'
})
}
},
//保存
handleSave(status) {
let product = this.$refs.productForm.getSelectInfo();
if (product && product.every((item) => item.products.length == 0)) {
this.$message.error("请选择产品");
return;
let product = this.$refs.productForm.getSelectInfo()
if (product && product.every(item => item.products.length == 0)) {
this.$message.error('请选择产品')
return
}
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo());
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo())
let params = {
accountTypes,
status: 2,
merchantId: this.accountAddForm.id,
};
this.$apis.store.updatePermissions(params).then((res) => {
if (res) {
status ? this.handleTabs(status) : this.$router.push("/account/index");
}
});
merchantId: this.accountAddForm.id
}
this.$apis.store.updatePermissions(params).then(res => {
if (res) {
status ? this.handleTabs(status) : this.$router.push('/account/index')
}
})
},
//下一步
handleNext(status) {
const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate((valid) => {
if (valid) resolve();
this.$refs.baseInfoForm.$refs.baseForm.validate(valid => {
if (valid) resolve()
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
});
});
var isError = document.getElementsByClassName('is-error')
isError[0].querySelector('input').focus()
}, 100)
})
})
const pm2 = new Promise((resolve, reject) => {
this.$refs.accountInfoForm.validate((valid) => {
if (valid) resolve();
this.$refs.accountInfoForm.validate(valid => {
if (valid) resolve()
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
});
});
if (
this.accountAddForm.merchantType == 1 &&
this.accountAddForm.merchantOrgcode &&
!util.checkIdCard(this.accountAddForm.merchantOrgcode)
) {
this.$message.error("请输入正确的身份证号码");
document.querySelector("#app").scrollTop = 0;
var isError = document.getElementsByClassName('is-error')
isError[0].querySelector('input').focus()
}, 100)
})
})
if (this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantOrgcode && !util.checkIdCard(this.accountAddForm.merchantOrgcode)) {
this.$message.error('请输入正确的身份证号码')
document.querySelector('#app').scrollTop = 0
setTimeout(() => {
var isError = document.getElementsByClassName("card-input");
isError[0].querySelectorAll(".el-input__inner")[1].focus();
}, 100);
return;
var isError = document.getElementsByClassName('card-input')
isError[0].querySelectorAll('.el-input__inner')[1].focus()
}, 100)
return
}
if (
this.accountAddForm.residentPhone &&
!util.checkPhone(this.accountAddForm.residentPhone)
) {
this.$message.error("请输入正确的驻店电话");
document.querySelector("#app").scrollTop = 0;
if (this.accountAddForm.residentPhone && !util.checkPhone(this.accountAddForm.residentPhone)) {
this.$message.error('请输入正确的驻店电话')
document.querySelector('#app').scrollTop = 0
setTimeout(() => {
var isError = document.getElementsByClassName("phone-input");
isError[0].querySelector("input").focus();
}, 100);
return;
var isError = document.getElementsByClassName('phone-input')
isError[0].querySelector('input').focus()
}, 100)
return
}
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm);
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm)
if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0];
params.bussinessEndtime = params.bussinessTime[1];
params.bussinessBegintime = params.bussinessTime[0]
params.bussinessEndtime = params.bussinessTime[1]
} else {
params.bussinessBegintime = "";
params.bussinessEndtime = "";
params.bussinessBegintime = ''
params.bussinessEndtime = ''
}
if (params.businessScope) {
params.businessScope = params.businessScope.join(",");
params.businessScope = params.businessScope.join(',')
}
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree
.getCheckedKeys()
.join(",");
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0);
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name);
params.businessScopeCustomize = businessScopeCustomize.join(",");
params.merchantFiles = JSON.stringify(params.merchantFiles);
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',')
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
params.businessScopeCustomize = businessScopeCustomize.join(',')
params.merchantFiles = JSON.stringify(params.merchantFiles)
Promise.all([pm1, pm2]).then(() => {
this.$apis.store.updateMerchant(params).then((res) => {
this.$apis.store.updateMerchant(params).then(res => {
if (res) {
status ? this.handleTabs(status) : this.$router.push("/account/index");
status ? this.handleTabs(status) : this.$router.push('/account/index')
}
});
});
})
})
},
async findAllDictData() {
let accountLevel = this.$apis.store.findAllDictData({ dictType: "account_level" });
let accountType = this.$apis.store.findAllDictData({ dictType: "account_type" });
let accountLevel = this.$apis.store.findAllDictData({ dictType: 'account_level' })
let accountType = this.$apis.store.findAllDictData({ dictType: 'account_type' })
let businessOption = this.$apis.store.findAllDictData({
dictType: "business_scope",
});
await Promise.all([accountLevel, accountType, businessOption]).then((res) => {
[this.accountLevel, this.accountType, this.businessOption] = res;
});
this.findMerchantDetail();
dictType: 'business_scope'
})
await Promise.all([accountLevel, accountType, businessOption]).then(res => {
;[this.accountLevel, this.accountType, this.businessOption] = res
})
this.findMerchantDetail()
},
async findMerchantDetail() {
this.$apis.store
.findMerchantDetail({
id: this.accountAddForm.id,
id: this.accountAddForm.id
})
.then((res) => {
let para;
.then(res => {
let para
if (res.parentMerchant) {
para = {
id: this.accountAddForm.id,
parentId: res.parentId,
accountlevel: res.merchantAccountLevel,
};
accountlevel: res.merchantAccountLevel
}
} else {
para = {
ids: res.accountType,
merchantId: res.id,
accountlevel: res.merchantAccountLevel,
};
accountlevel: res.merchantAccountLevel
}
}
this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant);
this.detailFirst = util.deepClone(res);
this.renderView(res);
});
this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant)
this.detailFirst = util.deepClone(res)
this.renderView(res)
})
},
renderView(res) {
let {
isloginName,
bussinessBegintime,
bussinessEndtime,
lat,
lng,
merchantAddress,
merchantName,
merchantAbbreviation,
merchantType,
merchantOrgcode,
merchantLegalPerson,
merchantLegalPersonPhone,
residentContact,
residentPhone,
merchantLoginAccount,
merchantLoginPassword,
merchantAccountLevel,
businessScope,
businessScopeCustomize,
merchantBrand,
merchantFileResponses,
merchantModel,
accountTypes,
accountType,
accounttypeId,
channelId,
status,
parentId,
} = res;
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
this.accountTypes = accountTypes;
this.accountAddForm.businessScope = businessScope ? businessScope.split(",") : [];
let { isloginName, bussinessBegintime, bussinessEndtime, lat, lng, merchantAddress, merchantName, merchantAbbreviation, merchantType, merchantOrgcode, merchantLegalPerson, merchantLegalPersonPhone, residentContact, residentPhone, merchantLoginAccount, merchantLoginPassword, merchantAccountLevel, businessScope, businessScopeCustomize, merchantBrand, merchantFileResponses, merchantModel, accountTypes, accountType, accounttypeId, channelId, status, parentId } = res
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword
this.accountTypes = accountTypes
this.accountAddForm.businessScope = businessScope ? businessScope.split(',') : []
if (this.accountAddForm.businessScope.length > 0) {
for (let i in this.accountAddForm.businessScope) {
this.accountAddForm.businessScope[i] = parseInt(
this.accountAddForm.businessScope[i]
);
this.accountAddForm.businessScope[i] = parseInt(this.accountAddForm.businessScope[i])
}
}
this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime];
businessScopeCustomize = businessScopeCustomize
? businessScopeCustomize.split(",")
: [];
this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime]
businessScopeCustomize = businessScopeCustomize ? businessScopeCustomize.split(',') : []
if (businessScopeCustomize.length > 0) {
this.businessScopeCustomize = businessScopeCustomize.map((item) => {
this.businessScopeCustomize = businessScopeCustomize.map(item => {
return {
name: item,
};
});
}else {
this.businessScopeCustomize = [{name:''}];
name: item
}
})
} else {
this.businessScopeCustomize = [{ name: '' }]
}
this.accounttypeId = accountType ? accountType.split(",") : [];
this.accounttypeId = accountType ? accountType.split(',') : []
if (this.accounttypeId.length > 0) {
this.accounttypeId = this.accounttypeId.map((item) => {
this.accounttypeId = this.accounttypeId.map(item => {
return {
name: item,
};
});
name: item
}
})
}
if (merchantFileResponses.length > 0) {
this.accountAddForm.merchantFiles = merchantFileResponses.map((item) => {
this.accountAddForm.merchantFiles = merchantFileResponses.map(item => {
return {
fileUrl: item.fileUrl,
};
});
fileUrl: item.fileUrl
}
})
}
merchantBrand = merchantBrand ? merchantBrand.split(",") : [];
merchantBrand = merchantBrand ? merchantBrand.split(',') : []
for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]);
merchantBrand[i] = parseInt(merchantBrand[i])
}
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand);
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand)
this.accountAddForm = Object.assign(this.accountAddForm, {
isloginName: isloginName ? true : false,
lat,
......@@ -524,29 +418,28 @@ export default {
parentId,
channelId,
status,
accounttypeId: accountType,
});
accounttypeId: accountType
})
this.$nextTick(() => {
this.$refs.baseInfoForm.$refs.baseForm.validate();
this.editStatus = false;
});
this.$refs.baseInfoForm.$refs.baseForm.validate()
this.editStatus = false
})
},
getCarbrandTree() {
this.$apis.store.getCarbrandTree({}).then((res) => {
this.brandData = res;
});
},
this.$apis.store.getCarbrandTree({}).then(res => {
this.brandData = res
})
}
},
mounted() {
document.querySelector("#app").scrollTop = 0;
this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft;
this.accountAddForm.id = this.$route.params.id;
this.getCarbrandTree();
this.findAllDictData();
},
};
document.querySelector('#app').scrollTop = 0
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.accountAddForm.id = this.$route.params.id
this.getCarbrandTree()
this.findAllDictData()
}
}
</script>
<style scoped lang="scss">
......
<template>
<div class="scrm-main">
<div class="form-header" v-if="$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1">
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link"
<div
class="form-header"
v-if="$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1"
>
<GLButton
@click="handleContact"
icon="el-icon-link"
fn="门店账户关联企微"
type="primary"
size="small"
mode="el-button"
>门店账户关联企微</GLButton>
<!-- <el-button type="primary" @click="handleContact" size="small" icon="el-icon-link"
>门店账户关联企微</el-button
>
>-->
</div>
<div class="follow-form">
<el-form :inline="true" :model="searchForm" class="follow-form-item" label-width="80px">
<el-form :inline="true" :model="searchForm" class="follow-form-item" label-width="90px">
<el-row>
<el-form-item size="small" label="关联企微">
<el-select v-model="searchForm.isRelevance" placeholder="请选择">
<el-option v-for="item in optionsContact" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option
v-for="item in optionsContact"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item class="merchant-row" size="small">
......@@ -21,9 +37,14 @@
v-if="searchForm.accountOrPhone == 1"
>
<el-select
class="merchant-row-input"
size="small"
v-model="searchForm.accountOrPhone"
@change="searchForm.merchantLoginAccount = '';searchForm.merchantLegalPersonPhone = ''"
@change="
searchForm.merchantLoginAccount = ''
searchForm.merchantLegalPersonPhone = ''
"
slot="prepend"
placeholder="请选择"
>
......@@ -38,10 +59,15 @@
v-if="searchForm.accountOrPhone == 2"
>
<el-select
class="merchant-row-input"
size="small"
v-model="searchForm.accountOrPhone"
slot="prepend"
@change="searchForm.merchantLoginAccount = '';searchForm.merchantLegalPersonPhone = ''"
@change="
searchForm.merchantLoginAccount = ''
searchForm.merchantLegalPersonPhone = ''
"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option>
......@@ -51,34 +77,98 @@
</el-form-item>
<el-form-item size="small" label="账户状态">
<el-select size="small" v-model="searchForm.status" placeholder="请选择">
<el-option v-for="item in merchantStatus" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
<el-option
v-for="item in merchantStatus"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="账户等级">
<el-select size="small" v-model="searchForm.merchantAccountLevel" placeholder="请选择">
<el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
<el-option
v-for="item in accountLevel"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item class="merchant-wx" size="small">
<el-input size="small" v-model="searchForm.merchantName" placeholder="请输入商户名称/关联的企业微信名"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-form-item size="small" label="商户号">
<el-input
size="small"
v-model="searchForm.merchantNo"
onkeyup="value=value.replace(/[^\d]/g,'')"
placeholder="请输入商户号,仅限11位"
maxlength="11"
></el-input>
</el-form-item>
<el-form-item
size="small"
style="float: right; margin-right: 0px"
v-if="$globalState.session.accountLevel == 4"
>
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
<el-row v-if="$globalState.session.accountLevel != 4">
<el-form-item size="small" label="上级商户号">
<el-input
size="small"
v-model="searchForm.parentMerchantNo"
onkeyup="value=value.replace(/[^\d]/g,'')"
placeholder="请输入上级商户号,仅限11位"
maxlength="11"
></el-input>
</el-form-item>
<el-form-item :size="size" style="float: right; margin-right: 0px">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<GLTable
ref="table"
:layout="layout"
:tableData="tableData"
:tableTotal="tableTotal"
:pageConf="pageConf"
:tableParams="tableParams"
@refreshTable="handleSearch"
>
<div slot="accountTypeNames" slot-scope="scope">
<div class="accountType-row" v-for="(item, index) in scope.scope.accountTypeNames.split(',')" :key="index">
{{ item }}
</div>
<div
class="accountType-row"
v-for="(item, index) in scope.scope.accountTypeNames.split(',')"
:key="index"
>{{ item }}</div>
</div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleLook(scope.scope)">查看</el-button>
<el-button type="text" @click="handleEdit(scope.scope)" v-if="$globalState.session.merchantId != scope.scope.merchantNo">修改</el-button>
<el-button type="text" @click="handleAdd(scope.scope)" v-if="scope.scope.status == 2 && scope.scope.merchantAccountLevel != 4">创建子商户/门店</el-button>
<GLButton type="text" @click="handleLook(scope.scope)" fn="查看">查看</GLButton>
<GLButton
type="text"
@click="handleEdit(scope.scope)"
v-if="$globalState.session.merchantId != scope.scope.merchantNo"
fn="修改"
mode="el-button"
>修改</GLButton>
<GLButton
type="text"
@click="handleAdd(scope.scope)"
v-if="scope.scope.status == 2 && scope.scope.merchantAccountLevel != 4"
fn="创建子商户/门店"
mode="el-button"
>创建子商户/门店</GLButton>
<!-- <el-button type="text" @click="handleLook(scope.scope)">查看</el-button> -->
<!-- <el-button type="text" @click="handleEdit(scope.scope)" v-if="$globalState.session.merchantId != scope.scope.merchantNo">修改</el-button>
<el-button type="text" @click="handleAdd(scope.scope)" v-if="scope.scope.status == 2 && scope.scope.merchantAccountLevel != 4">创建子商户/门店</el-button>-->
</template>
</GLTable>
</div>
......@@ -107,7 +197,10 @@ export default {
drawer: false,
direction: 'rtl',
searchForm: {
isRelevance: '',
accountOrPhone: 1,
status: '',
merchantAccountLevel: '',
merchantLegalPersonPhone: '',
merchantLoginAccount: ''
},
......@@ -132,11 +225,11 @@ export default {
prop: 'merchantName'
},
{
label: "关联的企业微信",
prop: "entmicroName",
formatter: (cellValue) => {
return cellValue.entmicroName ? cellValue.entmicroName : "-";
},
label: '关联的企业微信',
prop: 'entmicroName',
formatter: cellValue => {
return cellValue.entmicroName ? cellValue.entmicroName : '-'
}
},
{
label: '账户类型',
......@@ -153,11 +246,11 @@ export default {
width: '80px'
},
{
label: "上级商户",
prop: "parentMerchant",
formatter: (cellValue) => {
return cellValue.parentMerchant ? cellValue.parentMerchant : "-";
},
label: '上级商户',
prop: 'parentMerchant',
formatter: cellValue => {
return cellValue.parentMerchant ? cellValue.parentMerchant : '-'
}
},
{
label: '账户状态',
......@@ -165,11 +258,11 @@ export default {
width: '80px'
},
{
label: "联系人",
prop: "merchantLegalPerson",
formatter: (cellValue) => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : "-";
},
label: '联系人',
prop: 'merchantLegalPerson',
formatter: cellValue => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : '-'
}
},
{
label: '手机号',
......@@ -177,10 +270,10 @@ export default {
width: '120px'
},
{
label: "更新时间",
prop: "updatedTime",
},
],
label: '更新时间',
prop: 'updatedTime'
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
......@@ -206,14 +299,14 @@ export default {
}
this.$apis.store.findAllDictData(params).then(res => {
if (res) {
if (dictType == "account_level") {
this.accountLevel = [{ dictValue: "", dictLabel: "全部" }].concat(res);
if (dictType == 'account_level') {
this.accountLevel = [{ dictValue: '', dictLabel: '全部' }].concat(res)
}
if (dictType == 'account_type') {
this.accountType = res
}
if (dictType == "merchant_status") {
this.merchantStatus = [{ dictValue: "", dictLabel: "全部" }].concat(res);
if (dictType == 'merchant_status') {
this.merchantStatus = [{ dictValue: '', dictLabel: '全部' }].concat(res)
}
}
})
......@@ -233,10 +326,24 @@ export default {
this.$apis.store.findMerchantByPage(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.data && res.data.length == []) {
this.$refs.table.setTableHeightFun()
}
this.tableData.length ? (this.$refs.table.tableHeightValues = '') : this.$refs.table.setTableHeightFun()
// if (res.data && res.data.length == []) {
// this.$refs.table.setTableHeightFun()
// }
})
},
handleReset() {
this.searchForm = {
isRelevance: '',
accountOrPhone: 1,
status: '',
merchantAccountLevel: '',
merchantLegalPersonPhone: '',
merchantLoginAccount: ''
}
this.handleSearch()
}
},
......@@ -255,11 +362,20 @@ export default {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 10px;
/deep/ {
.el-input--small .el-input__inner {
width: 215px;
}
.el-form--inline .el-form-item {
margin-right: 10px;
}
}
}
.accountType-row {
text-align: left;
position: relative;
padding-left: 15px;
margin-bottom: 2px;
&::before {
content: '';
position: absolute;
......@@ -268,11 +384,18 @@ export default {
background: #5850ff;
border-radius: 8px;
left: 0px;
top: 7px;
top: 5px;
}
}
.merchant-row {
margin-left: 20px;
&-input {
/deep/ {
.el-input__inner {
width: 118px!important;
}
}
}
/deep/ {
.el-form-item__content {
line-height: 1;
......@@ -287,8 +410,8 @@ export default {
.merchant-wx {
margin-left: 20px;
/deep/ {
.el-input__inner {
width: 310px;
.el-input--small .el-input__inner {
width: 325px;
}
}
}
......
<template>
<div class="out_main">
<!-- <div class="base-info-index"> -->
<div class="top_widget">
<img class="sign_icon" src="../../assets/scrm_base_info_icon_one.png" />
<div class="info_widget">
<div class="title_text">
{{ blocInfo.merchantName }}
<span class="min_text">(商户号:{{ blocInfo.merchantNo }})</span>
</div>
<div class="sec_title_text dr_top_1">
<span>关联企微:{{ blocInfo.entmicroName || '--' }}</span>
<div v-if="blocInfo.entmicroName" class="auth_btn" :class="accountLevel != 4 ? 'auth_btn_cp' : ''">已授权</div>
</div>
<div v-if="accountLevel==1" class="min_text dr_top_1">所属企业:--</div>
<div v-if="accountLevel!=1" class="min_text dr_top_1">所属企业:{{ blocInfo.parentName }}</div>
<div v-if="accountLevel==4" class="min_text">企微员工:{{ blocInfo.entMicroEmployeeCount }}人</div>
<div class="top_widget">
<img class="sign_icon" src="../../assets/scrm_base_info_icon_one.png" />
<div class="info_widget">
<div class="title_text">
{{ blocInfo.merchantName }}
<span class="min_text">(商户号:{{ blocInfo.merchantNo }})</span>
</div>
<div class="sec_title_text dr_top_1">
<span>关联企微:{{ blocInfo.entmicroName || '--' }}</span>
<div
v-if="blocInfo.entmicroName"
class="auth_btn"
:class="accountLevel != 4 ? 'auth_btn_cp' : ''"
>已授权</div>
</div>
<div v-if="accountLevel==1" class="min_text dr_top_1">所属企业:--</div>
<div v-if="accountLevel!=1" class="min_text dr_top_1">所属企业:{{ blocInfo.parentName }}</div>
<div
v-if="blocInfo.channelId == 2"
class="min_text"
>商户SAP编码:{{blocInfo.sapCode ? blocInfo.sapCode : '--'}}</div>
<div v-if="accountLevel==4" class="min_text">企微员工:{{ blocInfo.entMicroEmployeeCount }}人</div>
</div>
<blocModule :bloc="blocInfo" :list.sync="storesList" v-if="accountLevel != 4"></blocModule>
<shopModule v-if="accountLevel == 4"></shopModule>
</div>
<blocModule :bloc="blocInfo" :list.sync="storesList" v-if="accountLevel != 4"></blocModule>
<shopModule :bloc="blocInfo" v-if="accountLevel == 4"></shopModule>
<!-- </div> -->
</div>
</template>
......@@ -36,7 +44,7 @@ export default {
data() {
return {
platform: 1, //1 集团 2 门店
accountLevel:1,//1-工厂;2-省代;3-市代;4-门店
accountLevel: 1, //1-工厂;2-省代;3-市代;4-门店
blocInfo: {
merchantName: ''
},
......@@ -54,7 +62,7 @@ export default {
methods: {
getBlocData() {
let para = {
merchantId: this.loginInfo.merchantId,
merchantId: this.loginInfo.merchantId
}
this.$apis.baseInfo.merchantInfo(para).then(res => {
this.blocInfo = res
......@@ -64,7 +72,7 @@ export default {
})
})
},
dateFormat: function (dateTime, format = 'yyyy-MM-dd') {
dateFormat: function(dateTime, format = 'yyyy-MM-dd') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
......
......@@ -6,7 +6,7 @@
<div class="title_text">产品信息</div>
<div class="desc_text">
<span>有效期:</span>
<span class="spc_text">2021年1月1日-2022年1月1日</span>
<span class="spc_text">{{bloc.effectiveTimeName || '--'}}</span>
</div>
</div>
<div class="item_info">
......@@ -102,6 +102,12 @@
<script>
export default {
name: '',
props: {
bloc: Object,
default:{
effectiveTimeName:''
}
},
data() {
return {
platform: 1,
......
......@@ -5,39 +5,11 @@
</div> -->
<div class="container edit-box">
<p class="edit-title">员工基本信息</p>
<glsx-combi-form
style="margin: 20px 20px 0 0;"
ref="editFormRef"
defaultWidth="320px"
@handleImgDelete="handleImgDelete"
:isBlock="isBlock"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
isEdit="true"
>
<glsx-combi-form style="margin: 20px 20px 0 0" ref="editFormRef" defaultWidth="320px" @handleImgDelete="handleImgDelete" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule" isEdit="true">
<template slot="merchantId" slot-scope="item">
<span
class="txt-ellipsis"
v-if="routeInfo.addOrEdit == 2 || (routeInfo.addOrEdit == 1 && userInfo.accountLevel == 4)"
:title="editForm.merchantName"
>{{ editForm.merchantName}}</span>
<el-select
v-else
:style="{ width: item.scope.width }"
v-model="editForm[item.scope.name]"
:clearable="item.scope.isClear || false"
:placeholder="'请选择' + item.scope.label"
:filterable="!item.scope.noFilter"
@change="handleChangeMerchant($event)"
>
<el-option
v-for="subItem in baseData.allMerchantList"
:key="subItem[item.scope.optionId]"
:label="subItem[item.scope.optionLabel]"
:value="subItem[item.scope.optionId]"
></el-option>
<span class="txt-ellipsis" v-if="routeInfo.addOrEdit == 2 || (routeInfo.addOrEdit == 1 && userInfo.accountLevel == 4)" :title="editForm.merchantName">{{ editForm.merchantName }}</span>
<el-select v-else :style="{ width: item.scope.width }" v-model="editForm[item.scope.name]" :clearable="item.scope.isClear || false" :placeholder="'请选择' + item.scope.label" :filterable="!item.scope.noFilter" @change="handleChangeMerchant($event)">
<el-option v-for="subItem in baseData.allMerchantList" :key="subItem[item.scope.optionId]" :label="subItem[item.scope.optionLabel]" :value="subItem[item.scope.optionId]"></el-option>
</el-select>
<!-- <select-page v-else :form="editForm" width="320" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page> -->
</template>
......@@ -49,26 +21,9 @@
<el-button class="m-l-10 el-icon-refresh" type="primary" @click="handleRefresh">刷新</el-button>
</template>
<template slot="visibleInferiorMer" slot-scope="item">
<el-input
:style="{ width: item.width || '320px' }"
placeholder="可见商户"
v-model="filterText"
></el-input>
<el-button class="m-l-10" type="primary" @click="checkAll">{{isCheckAll ? '全不选':'全选'}}</el-button>
<el-tree
v-show="baseData.merchantTree.length != 0"
show-checkbox
check-on-click-node
check-strictly
class="filter-tree"
node-key="id"
:data="baseData.merchantTree"
:props="defaultProps"
default-expand-all
:filter-node-method="filterNode"
ref="tree"
@check="handleClickNode"
></el-tree>
<el-input :style="{ width: item.width || '320px' }" placeholder="可见商户" v-model="filterText"></el-input>
<el-button class="m-l-10" type="primary" @click="checkAll">{{ isCheckAll ? '全不选' : '全选' }}</el-button>
<el-tree v-show="baseData.merchantTree.length != 0" show-checkbox check-on-click-node check-strictly class="filter-tree" node-key="id" :data="baseData.merchantTree" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @check="handleClickNode"></el-tree>
</template>
</glsx-combi-form>
</div>
......@@ -113,6 +68,7 @@ export default {
value: 'id',
label: 'label'
},
editStatus: false,
editForm: {
merchantId: '',
merchantName: '',
......@@ -143,7 +99,7 @@ export default {
{
required: true,
validator: (rule, value, callback) => {
;/^[\S]{6,15}$/.test(value) ? callback() : callback(new Error('密码必须6-15位'))
;/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value) ? callback() : callback(new Error('请输入正确的6-20个密码,必须同时包含字母、数字。'))
},
trigger: 'change'
}
......@@ -185,7 +141,7 @@ export default {
name: 'password',
showPass: true,
type: 'input',
maxlength: 15,
maxlength: 20,
suffixSlot: 'passwordSlot'
},
{
......@@ -248,6 +204,12 @@ export default {
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
editForm: {
handler() {
this.editStatus = true
},
deep: true
}
},
......@@ -289,6 +251,9 @@ export default {
fileName: res.merchantFileResponse ? res.merchantFileResponse.fileName : ''
}
this.handleChangeMerchant(this.editForm.merchantId, true)
this.$nextTick(()=>{
this.editStatus = false
})
})
},
handleChangeMerchant(e, editRecovery = false) {
......@@ -394,16 +359,30 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.$router.push({
path: '/employee/index'
})
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/employee/index'
})
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push({
path: '/employee/index'
})
})
} else {
this.$router.push({
path: '/employee/index'
})
}
},
getAllId(data, arr = []) {
if (data) {
......
......@@ -3,7 +3,7 @@
<div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :label-width="labelWidth" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px': '30px', ...item.style }" :label="item.label" :prop="item.name">
<el-form-item v-if="!item.isHide" :key="index" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
......@@ -12,7 +12,7 @@
{{ item.label }}
</span>
<span v-else-if="!item.isHide && item.label" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth ? (item.labelWidth + labelPaddingRight) + 'px' : '', 'padding-right': isEdit ? '12px' : (labelPaddingRight + 'px') }">{{ item.label }}</span>
<span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span>
</span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'">
......@@ -90,7 +90,9 @@
</template>
</el-form-item>
</template>
<slot name="footer"></slot>
<el-form-item class="footer-btns">
<slot name="footer"></slot>
</el-form-item>
</el-form>
<el-dialog :visible.sync="isImgVisible">
<img class="dialog-img" width="100%" :src="dialogImageUrl" alt="" />
......@@ -245,7 +247,8 @@ export default {
}
.glsx-combi-form .el-form-item--small.el-form-item {
margin: 0 30px 20px 0;
/* margin: 0 30px 20px 0; */
margin: 0 0 20px 0;
}
.glsx-combi-form .el-form-item--small .el-form-item__label {
......@@ -319,7 +322,7 @@ export default {
.glsx-combi-form .activity-img {
position: relative;
color: #999999;
background-color: #F7F7F7;
background-color: #f7f7f7;
border: 1px dashed #d9d9d9;
cursor: pointer;
}
......@@ -388,4 +391,7 @@ export default {
height: 100%;
}
/* 图片上传 */
.footer-btns {
float: right;
}
</style>
<!-- 员工管理 -->
<template>
<div class="config-employee employee-list">
<div style="margin-bottom: 20px;">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">创建员工</el-button>
<div style="margin-bottom: 20px">
<GLButton @click="handleEdit(1)" :size="size" class="el-icon-plus" fn="创建员工" type="primary" mode="el-button">创建员工</GLButton>
<!-- <el-button :size="size" type="primary" class="el-icon-plus" >创建员工</el-button> -->
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
</glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData2">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
</span>
</glsx-combi-form>
<template v-if="userInfo.accountLevel != 4">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData"></glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData2">
<span slot="footer" class="footer-btns">
<el-button size="small" @click="reSetFindData">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<GLButton @click="handleExport" fn="导出" :size="size" type="primary" mode="el-button">导出</GLButton>
<!-- <el-button :size="size" type="primary" @click="handleExport">导出</el-button> -->
</span>
</glsx-combi-form>
</template>
<template v-else>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData3">
<span slot="footer" class="footer-btns">
<el-button size="small" @click="reSetFindData">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<GLButton @click="handleExport" fn="导出" :size="size" type="primary" mode="el-button">导出</GLButton>
</span>
</glsx-combi-form>
</template>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">修改</el-button>
<!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> -->
<!-- <el-button type="text" @click="handleEdit(2, scope.scope)">修改</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleDetail(scope.scope)" fn="查看" mode="el-button">查看</GLButton>
<GLButton type="text" @click="handleEdit(2, scope.scope)" fn="修改" mode="el-button">修改</GLButton>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</div>
<template slot="otherOptions" slot-scope="scope">
<el-popover v-if="scope.scope.statusName == '禁用'" placement="top" width="180" trigger="hover">
<!-- <el-popover v-if="scope.scope.statusName == '禁用'" placement="top" width="180" trigger="hover">
<p>启用前,你可先为该员工创建角色,配置其所需的功能权限。如下所示:</p>
<p>1. 角色管理-创建角色</p>
<p>2. 选择员工账户-修改角色</p>
<el-switch :size="size" slot="reference" v-model="scope.scope.statusName" active-value="启用" inactive-value="禁用" @change="e => handleSwitchChange(e, scope.scope)"></el-switch>
</el-popover>
<el-switch v-else :size="size" slot="reference" v-model="scope.scope.statusName" active-value="启用" inactive-value="禁用" @change="e => handleSwitchChange(e, scope.scope)"></el-switch>
<GLButton mode="el-switch" fn="开关" :size="size" slot="reference" v-model="scope.scope.statusName" active-value="启用" inactive-value="禁用" @change="e => handleSwitchChange(e, scope.scope)"></GLButton>
</el-popover> -->
<GLButton mode="div" fn="开关">
<el-popover v-if="scope.scope.statusName == '禁用'" placement="top" width="180" trigger="hover">
<p>启用前,你可先为该员工创建角色,配置其所需的功能权限。如下所示:</p>
<p>1. 角色管理-创建角色</p>
<p>2. 选择员工账户-修改角色</p>
<GLButton mode="el-switch" fn="开关" :size="size" slot="reference" v-model="scope.scope.statusName" active-value="启用" inactive-value="禁用" @change="e => handleSwitchChange(e, scope.scope)"></GLButton>
</el-popover>
<GLButton mode="el-switch" fn="开关" v-else :size="size" slot="reference" v-model="scope.scope.statusName" active-value="启用" inactive-value="禁用" @change="e => handleSwitchChange(e, scope.scope)"></GLButton>
</GLButton>
</template>
</GLTable>
<!-- 表格区域 end -->
......@@ -121,6 +146,7 @@ export default {
}
}
],
searchFormData3: [],
// 表格
getListApi: this.$apis.employee.getListApi,
tableParams: {
......@@ -215,6 +241,7 @@ export default {
this.searchFormData.splice(0, 1)
var idx = this.tableParams.tableColumns.findIndex(item => item.prop == 'merchantName')
this.tableParams.tableColumns.splice(idx, 1)
this.searchFormData3 = [...this.searchFormData, ...this.searchFormData2]
}
this.getAllMerchantList()
this.getStaffStatusList()
......@@ -293,9 +320,10 @@ export default {
})
},
setTableFinishFun() {
if (this.$refs.employeeRef.data && !this.$refs.employeeRef.data.length) {
this.$refs.employeeRef.setTableHeightFun()
}
// if (this.$refs.employeeRef.data && !this.$refs.employeeRef.data.length) {
// this.$refs.employeeRef.setTableHeightFun()
// }
this.$refs.employeeRef.data.length ? (this.$refs.employeeRef.tableHeightValues = '') : this.$refs.employeeRef.setTableHeightFun()
},
handleDetail(row) {
this.$router.push('/employee/detailEmployee/' + row.id)
......@@ -344,7 +372,26 @@ export default {
handleSearch() {
this.$refs.employeeRef.refreshTable()
},
// 重置
reSetFindData() {
this.distoryTable = false
this.searchForm = {
merchantId: '',
merchantName: '',
roleId: '',
status: ''
}
this.searchSelectObj = {
staffNameOrPhone: {
attr: 'staffName',
value: ''
}
},
this.$refs.employeeRef.refreshTable()
this.$nextTick(() => {
this.distoryTable = true
})
},
handleExport() {
var params = this.getParams()
this.$apis.employee.exportEmployeeApi(params).then(res => {
......
<template>
<div class="scrm-main">
<div class="enterprise-panel" v-loading="loading">
<div class="enterprise-title">
企业自建应用接入流程
<span>(适合没有自己技术团队的企业,接入即可使用全部功能)</span>
</div>
<div
class="step-panel"
:style="{
'min-height': boxHeight + 'px'
}"
>
<div class="step-right scrm-box-f">
<div class="enterprise-step-box">
<div class="el-steps el-steps--horizontal">
<div class="el-step is-horizontal" style="flex-basis: 50%; margin-right: 0px">
<div class="el-step__head" :class="{ 'is-finish': active == 1 }">
<div class="el-step__line" style="margin-right: 0px">
<i class="el-step__line-inner" style="transition-delay: 0ms; border-width: 0px; width: 0%"></i>
</div>
<div class="el-step__icon is-text">
<div class="el-step__icon-inner">1</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title" :class="{ 'is-finish': active == 1 }">第一步</div>
<div class="el-step__description" :class="{ 'is-finish': active == 1 }">管理员授权绑定企业</div>
</div>
</div>
</div>
<div class="el-step is-horizontal" style="flex-basis: 50%; margin-right: 0px">
<div class="el-step__head" :class="{ 'is-finish': active == 2 }">
<div class="el-step__line" style="margin-right: 0px">
<i class="el-step__line-inner" style="transition-delay: -150ms; border-width: 0px; width: 0%"></i>
</div>
<div class="el-step__icon is-text">
<!---->
<div class="el-step__icon-inner">2</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title" :class="{ 'is-finish': active == 2 }">第二步</div>
<div class="el-step__description" :class="{ 'is-finish': active == 2 }">管理员授权配置</div>
</div>
</div>
</div>
<div class="el-step is-horizontal is-flex" style="flex-basis: 50%; max-width: 33.3333%">
<div class="el-step__head" :class="{ 'is-finish': active == 3 }">
<div class="el-step__line"><i class="el-step__line-inner"></i></div>
<div class="el-step__icon is-text">
<!---->
<div class="el-step__icon-inner">3</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title" :class="{ 'is-finish': active == 3 }">第三步</div>
<div class="el-step__description" :class="{ 'is-finish': active == 3 }">配置完成</div>
</div>
</div>
</div>
</div>
<div
class="config-box"
v-if="active == 1"
:style="{
'min-height': boxHeight - 140 + 'px'
}"
>
<div>
<div class="config-box-h1">初次使用客户,需要企业微信超级管理员授权绑定企业,具体如下:</div>
<div class="config-box-h2">
未注册企业微信的用户,请先前往企业微信的官网进行注册。
<a @click="jumpUrl('https://work.weixin.qq.com/wework_admin/loginpage_wx?from=myhome')">
企业微信官网
<i class="el-icon-d-arrow-right"></i>
</a>
</div>
<div class="config-box-h3">1.企业微信超级管理员扫码授权接入嘀加企微管家</div>
<div class="config-box-qrcode" style="width: 50%" v-if="qrcodeUrl">
<div class="config-use-qrcode">
<img :src="qrcodeUrl" />
<div class="qrcode-refresh" v-if="checkStatus != 'never'">
<div class="qrcode-status" v-if="checkStatus == 'succ'">
<i class="el-icon-circle-check"></i>
<div>完成</div>
</div>
<div class="qrcode-status qrcode-status-ing" v-if="checkStatus == 'ing'">
<i class="el-icon-loading"></i>
</div>
<div class="qrcode-status" v-if="checkStatus == 'expired'" @click="handleRefresh">
<i class="el-icon-refresh"></i>
<div>刷新</div>
</div>
</div>
</div>
<div class="config-use-desc">请联系超级管理员用企业微信扫码接入</div>
</div>
<div class="config-box-qrcode" style="width: 50%" v-else>
<div class="config-use-qrcode">
<img src="@/assets/img/qrcode.png" />
<div class="qrcode-refresh">
<div class="qrcode-status">
<i class="el-icon-circle-check"></i>
<div>完成</div>
</div>
</div>
</div>
</div>
<div class="config-form-panel" v-if="applicationList && applicationList.length > 0">
<div>
<div class="config-box-h3 text-bettwn" style="margin-bottom: 20px">
<span>2.填写嘀加企微管家门店秘钥secret</span>
<div class="config-box-link">
<span @click="jumpUrl('http://img01.glsx.com.cn/upload/temporary/illustrate.html')">
查看如何获取
<i class="el-icon-d-arrow-right"></i>
</span>
</div>
</div>
<div class="config-box-form">
<div class="config-box-input" v-for="(item, index) in applicationList" :key="index">
<label v-if="item.appCode == 'DJQWGJ'">*Secret:</label>
<label v-if="item.appCode == 'WBLXR'">*客户联系Secret:</label>
<label v-if="item.appCode == 'TXLTBZS'">*通讯录Secret:</label>
<input type="text" :readonly="toStatus" v-model="item.appSecret" class="config-item-input" />
</div>
</div>
</div>
<div class="config-box-qrcode">
<div class="config-box-h3">如未成功,请加我微信帮您接入</div>
<div class="config-use-qrcode">
<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/lianghh.png" alt="" />
</div>
<div class="config-use-desc">联系电话:18824231191</div>
</div>
</div>
</div>
</div>
<div
class="config-box config-box-second"
v-if="active == 2"
:style="{
'min-height': boxHeight - 160 + 'px'
}"
>
<div>
<div class="config-box-h1">如若完整使用本系统,还需要企业微信超级管理员完成以下授权配置。</div>
<div class="config-form-panel">
<div>
<div class="config-box-h3 text-bettwn">
<span>通讯录接收事件服务配置</span>
<span class="config-box-link" @click="jumpUrl('http://img01.glsx.com.cn/upload/temporary/illustration.html')">
查看如何配置
<i class="el-icon-d-arrow-right"></i>
</span>
</div>
<div class="config-box-form">
<div class="config-box-input">
<label>*URL:</label>
<input type="text" readonly v-model="callbackUrl" class="config-item-input" />
<span @click="cloneText(callbackUrl)">
复制
<img src="@/assets/img/enterprise/clone.png" />
</span>
</div>
<div class="config-box-input">
<label>*Token:</label>
<input type="text" readonly v-model="token" class="config-item-input" />
<span @click="cloneText(token)">
复制
<img src="@/assets/img/enterprise/clone.png" />
</span>
</div>
<div class="config-box-input">
<label>*EncodingAESKey:</label>
<input type="text" readonly v-model="encodingAesKey" class="config-item-input" />
<span @click="cloneText(encodingAesKey)">
复制
<img src="@/assets/img/enterprise/clone.png" />
</span>
</div>
<div class="config-box-link step-link">
<span></span>
<el-button type="primary" size="mini" class="step-jump" @click="jumpUrl('https://work.weixin.qq.com/wework_admin/loginpage_wx?from=myhome')">打开企业微信</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="config-box config-box-third"
v-if="active == 3"
:style="{
'min-height': boxHeight - 110 + 'px'
}"
>
<div>
<div class="config-box-h1"></div>
<div class="config-box-qrcode config-qrcode-finish">
<div class="config-finish">
<img src="@/assets/img/enterprise/config.png" />
</div>
</div>
<div class="config-box-h4" v-if="$globalState.session.merchantModel == 2">进入首页即可开始您的营销获客之旅。</div>
<div class="config-box-h4" v-if="$globalState.session.merchantModel == 1">配置完成后,您需先创建您的门店,门店关联企微后,方可使用</div>
<div style="margin-top: 15px">
<div class="step-jump-home" @click="jumpHome" v-if="$globalState.session.merchantModel == 2">
前往首页
<i class="el-icon-d-arrow-right"></i>
</div>
<div class="step-jump-home" @click="jumpStore" v-if="$globalState.session.merchantModel == 1">
去创建门店
<i class="el-icon-d-arrow-right"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" v-show="active == 2" @click="handlePrev">上一步</el-button>
<el-button type="primary" v-show="active == 3" @click="handlePrev">返回上一步</el-button>
<el-button type="primary" v-show="active == 1 && statusQrcode != 'SUCCESS' && statusQrcode != 'SERVER_CHECK'" @click="handleNext">确定</el-button>
<el-button type="primary" v-show="active == 1 && (statusQrcode == 'SUCCESS' || statusQrcode == 'SERVER_CHECK')" @click="handleNext">下一步</el-button>
<el-button type="primary" v-show="active == 2 && statusQrcode != 'SUCCESS'" @click="handleNext">确定</el-button>
<el-button type="primary" v-show="active == 2 && statusQrcode == 'SUCCESS'" @click="handleNext">下一步</el-button>
</div>
</div>
<div class="enterprise-dialog" v-show="dialogStatus">
<div class="enterprise-dialog-warpper">
<div class="dialog-close-btn" @click="dialogStatus = false">{{ dialogTime }}s</div>
<div class="enterprise-warpper-logo">
<img src="@/assets/img/enterprise/wechat.png" />
<span>></span>
<span>></span>
<img src="@/assets/img/enterprise/dj.png" />
</div>
<div class="enterprise-warpper-desc">使用嘀加SCRM系统,需先接入企业微信,成功接入后系统后台功能方可使用!</div>
<div class="dialog-footer">
<el-button type="primary" @click="dialogStatus = false">立即接入</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'index',
data() {
return {
loading: false,
boxHeight: 0,
toStatus: false,
token: '',
callbackUrl: '',
encodingAesKey: '',
checkStatus: 'never',
entryStatus: true,
qrcodeUrl: '',
dialogTime: 5,
active: 0,
dialogStatus: false,
Secret: '',
SecretContact: '',
SecretCode: '',
timer: null,
timerQrcode: null,
statusQrcode: '',
URL: '',
nextStatus: false,
Token: '',
Secret_1: '',
Secret_2: '',
Secret_3: '',
applicationList: [],
checkResult: 0
}
},
watch: {
active(val) {
if (val == 3) {
this.toStatus = true
}
}
},
methods: {
jumpUrl(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.click()
},
jumpHome() {
this.$history.push('home/home/index?id=2')
},
jumpStore() {
this.$router.push('/account/index')
},
handleGetSecret() {
for (let i in this.applicationList) {
if (this.applicationList[i].appSecret === '' || this.applicationList[i].appSecret === null) {
this.$message({
message: '请填写Secret',
type: 'error'
})
return
}
}
if (this.checkStatus != 'succ' && this.qrcodeUrl) {
this.$message({
message: '请联系超级管理员用企业微信扫码接入',
type: 'error'
})
return
}
let params = {
apps: this.applicationList
}
this.$apis.ww.getSecret(params).then(res => {
if (res) {
this.statusQrcode == 'SUCCESS' ? (this.active = 3) : (this.active = 2)
}
})
},
cloneText(msg) {
util.cloneText(msg)
this.$message({
message: '复制成功',
type: 'success'
})
},
handleNext() {
if (this.active == 1) {
if (this.statusQrcode == 'SUCCESS') {
this.nextStatus ? (this.active = 2) : (this.active = 3)
} else {
this.handleGetSecret()
}
return
}
if (this.active == 2) {
if (this.statusQrcode == 'SUCCESS') {
this.active++
} else {
this.getStatus()
// this.$message({
// message: "消息服务器未验证",
// type: "warning",
// });
}
}
},
handlePrev() {
if (this.active == 3) {
this.nextStatus = true
}
this.active--
},
closeDalog() {
this.dialogTime--
if (this.dialogTime == 0) {
this.dialogStatus = false
clearInterval(this.timer)
}
},
//检测二维码
getCheckStatus() {
this.$apis.ww
.getCheckStatus({
status: this.checkStatus
})
.then(res => {
if (res) {
if (res.status == 'succ') {
clearInterval(this.timerQrcode)
this.getReportStatus('succ')
this.getAccess()
return
} else if (res.status == 'ing') {
this.getReportStatus('scan')
} else {
this.getReportStatus('new')
}
this.checkStatus = res.status
} else {
this.checkStatus = 'expired'
this.getReportStatus('expired')
clearInterval(this.timerQrcode)
}
})
},
//获取二维码
getQrcode() {
this.$apis.ww.getQrcode({ loginType: 'login_admin' }).then(res => {
this.qrcodeUrl = res.qrcodeUrl
this.timerQrcode = setInterval(this.getCheckStatus, 3000)
})
},
//企微授权接入
getAccess() {
this.$apis.ww.getAccess({}).then(res => {
if (res) {
this.checkStatus = 'succ'
this.getStatus()
} else {
this.checkStatus = 'expired'
}
})
},
//检测二维码
getStatus() {
this.loading = true
this.$apis.ww.getStatus({}).then(res => {
this.loading = false
this.statusQrcode = res.status
if (res.applicationList) {
res.applicationList.forEach((item, index) => {
if (item.appCode == 'DJQWGJ') {
this.applicationList[0] = item
}
if (item.appCode == 'WBLXR') {
this.applicationList[1] = item
}
if (item.appCode == 'TXLTBZS') {
this.applicationList[2] = item
}
})
if (this.applicationList) {
let index = res.applicationList.findIndex(item => {
return item.appCode == 'TXLTBZS'
})
this.callbackUrl = this.applicationList[index].callbackUrl
this.token = this.applicationList[index].token
this.encodingAesKey = this.applicationList[index].encodingAesKey
this.checkResult = this.applicationList[index].checkResult
}
}
if (this.statusQrcode == 'NEVER') {
this.active = 1
this.dialogStatus = true
this.timer = setInterval(this.closeDalog, 1000)
this.getQrcode()
} else if (this.statusQrcode == 'SUCCESS') {
this.active = 3
} else if (this.statusQrcode == 'SERVER_CHECK') {
this.active = 2
} else {
this.active = 1
}
})
},
//上报
getReportStatus(sts) {
let operation
let status
if (this.entryStatus || !sts) {
operation = 'get'
status = 'succ'
} else {
operation = 'check'
status = sts
}
var a = this.$apis.ww
.getReportStatus({
loginType: 'login_admin',
operation: operation,
status: status
})
.then(res => {
this.entryStatus = false
})
},
//刷新
handleRefresh() {
this.checkStatus = 'never'
this.getQrcode()
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
this.getStatus()
},
beforeDestroy() {
clearInterval(this.timerQrcode)
}
}
</script>
<style scoped lang="scss">
.scrm-main {
// position: relative;
}
.enterprise-step-box {
padding-top: 40px;
width: 80%;
margin: 0 auto;
}
.el-steps {
transform: translateX(-30px);
}
.el-step.is-vertical .el-step__head {
width: 32px;
}
.el-step__line {
background: rgba(0, 0, 0, 0.15);
}
.el-step__icon {
width: 32px;
height: 32px;
border: 1px solid rgba(0, 0, 0, 0.15);
}
.el-step.is-horizontal .el-step__line {
top: 14px;
left: 100px;
right: 4%;
}
.el-step__icon-inner {
color: rgba(0, 0, 0, 0.25);
}
.el-step__head.is-finish {
color: #ffffff;
border-color: #5850ff;
}
.el-step__desc {
position: absolute;
display: inline-block;
top: -5px;
left: 36px;
width: 134px;
color: rgba(0, 0, 0, 0.45);
}
.el-step__head.is-finish .el-step__icon-inner {
color: #ffffff;
}
.el-step__head.is-finish .el-step__line {
background: #5850ff;
}
.el-step__head.is-finish .el-step__icon.is-text {
background-color: #5850ff;
}
.el-step__title {
font-size: 17px;
}
.el-step__description {
font-size: 13px;
}
.el-step__title.is-wait {
color: #999999;
}
.el-step__title.is-finish {
color: #333333;
font-weight: 700;
}
.el-step__description.is-finish {
color: #666666;
}
.enterprise-title {
margin-bottom: 15px;
font-size: 20px;
font-weight: 600;
color: #424242;
line-height: 20px;
> span {
font-size: 12px;
font-weight: 500;
color: #aaaaaa;
margin: 0 10px;
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.step-panel {
display: flex;
margin-bottom: 55px;
position: relative;
.step-left {
width: 220px;
padding: 40px 20px;
box-sizing: border-box;
.step-box {
height: 300px;
margin: 0 auto;
text-align: center;
}
}
.step-right {
flex: 1;
.config-box {
display: flex;
justify-content: center;
align-items: center;
padding: 40px 0px;
&.config-box-second {
width: 600px;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
.config-form-panel {
justify-content: center;
}
}
&.config-box-third {
text-align: center;
padding: 0px;
display: flex;
justify-content: center;
align-items: center;
}
&-h1 {
height: 25px;
font-size: 18px;
font-weight: 600;
color: #424242;
line-height: 25px;
letter-spacing: 1px;
text-align: center;
}
&-h2 {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
letter-spacing: 1px;
margin-top: 10px;
text-align: center;
> a {
cursor: pointer;
font-size: 12px;
font-weight: 600;
color: #5850ff;
}
}
&-h3 {
margin: 30px 0px 10px 0px;
font-size: 14px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
margin-left: 10px;
&.text-bettwn {
display: flex;
justify-content: space-between;
.config-box-link {
font-size: 12px;
font-weight: 600;
color: #6e65ff;
line-height: 30px;
i {
font-weight: 600;
}
}
}
}
.config-box-form {
margin-left: 10px;
}
&-h4 {
font-weight: 500;
color: #8d8d8d;
line-height: 20px;
letter-spacing: 1px;
}
.config-finish {
width: 240px;
height: 240px;
margin-bottom: 40px;
}
.step-jump-home {
cursor: pointer;
font-size: 16px;
font-weight: 500;
color: #6e65ff;
line-height: 22px;
letter-spacing: 1px;
}
.config-box-qrcode {
width: 300px;
text-align: center;
.config-box-h4 {
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.config-use-qrcode {
position: relative;
width: 120px;
height: 120px;
margin: 14px auto;
position: relative;
.qrcode-refresh {
position: absolute;
width: 120px;
height: 120px;
top: 0px;
left: 0px;
background: rgba(255, 255, 255, 0.8);
}
.qrcode-status {
position: absolute;
top: 32px;
left: 44px;
font-size: 14px;
font-weight: 500;
color: #5850ff;
line-height: 20px;
letter-spacing: 1px;
> i {
font-size: 32px;
color: #5850ff;
}
&.qrcode-status-ing {
top: 42px;
}
}
}
.config-use-desc {
font-size: 12px;
font-weight: 400;
color: #a0a0a0;
line-height: 17px;
letter-spacing: 1px;
}
}
.config-form-panel {
display: flex;
.config-box-qrcode {
margin-top: 36px;
}
}
.config-box-form {
.config-box-input {
width: 600px;
height: 32px;
background: #ffffff;
border-radius: 2px;
border: 1px solid #e8e8ea;
font-size: 12px;
line-height: 32px;
padding-left: 10px;
margin-bottom: 32px;
color: #999999;
display: flex;
align-items: center;
> label {
font-weight: 500;
color: #333333;
line-height: 28px;
letter-spacing: 1px;
font-size: 12px;
}
.config-item-input {
flex: 1;
color: #999999;
font-size: 12px;
border: none;
appearance: none;
outline: none;
}
> span {
cursor: pointer;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
}
img {
width: 14px;
height: 14px;
margin-right: 10px;
margin-top: 3px;
cursor: pointer;
display: inline-block;
}
}
.config-box-link {
width: 610px;
font-size: 12px;
font-weight: 400;
color: #a0a0a0;
line-height: 30px;
&.step-link {
display: flex;
justify-content: space-between;
}
> span {
cursor: pointer;
font-weight: 600;
color: #5850ff;
}
}
}
}
}
}
.config-qrcode-finish {
margin: 0 auto;
}
.step-ul {
padding: 30px;
}
.step-li {
position: relative;
padding: 0 30px;
list-style: none;
min-height: 100px;
border-left: 2px solid #ccc;
padding-bottom: 20px;
.step-two-panel {
margin-top: 20px;
padding: 20px;
display: flex;
justify-content: space-around;
.step-use-qrcode {
width: 100px;
height: 100px;
border: 1px solid #333333;
margin: 20px auto;
}
}
.step-three-panel {
margin-top: 20px;
display: flex;
.service-config-border {
border: 1px solid #cccccc;
width: 500px;
margin-right: 30px;
}
.service-config-title {
height: 40px;
line-height: 40px;
background: #f4f6fc;
padding: 0px 20px;
}
.service-config-item {
line-height: 30px;
height: 30px;
border-bottom: 1px solid #cccccc;
padding-left: 10px;
}
.service-config-operation {
height: 46px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 10px;
}
}
.step-jump {
margin: 0px 8px;
}
}
.step-li:last-child {
border: none;
}
.step-li:before {
content: '';
display: block;
position: absolute;
margin-left: -6px;
top: 0;
left: -5px;
width: 22px;
height: 22px;
line-height: 22px;
text-align: center;
background: #e6e9ff;
color: #fff;
font-size: 14px;
border-radius: 50%;
}
.enterprise-dialog {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
z-index: 2001;
background: rgba(0, 0, 0, 0.3);
.enterprise-dialog-warpper {
position: relative;
margin: 0 auto 50px;
background: #fff;
border-radius: 2px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
box-sizing: border-box;
width: 40%;
height: 260px;
border-radius: 4px;
margin-top: 15vh;
padding: 10px 62px;
.dialog-close-btn {
position: absolute;
top: 16px;
right: 16px;
width: 30px;
height: 30px;
line-height: 30px;
text-align: center;
background: #ffffff;
border: 1px solid #999999;
border-radius: 50%;
font-size: 16px;
color: #999999;
}
.enterprise-warpper-logo {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
> img {
width: 56px;
height: 56px;
&:first-child {
margin-right: 30px;
}
&:last-child {
margin-left: 20px;
}
}
> span {
font-size: 30px;
font-weight: 400;
color: #6e65ff;
line-height: 42px;
margin-right: 10px;
&:nth-child(2) {
color: #008df1;
}
}
}
.enterprise-warpper-desc {
font-size: 18px;
font-weight: 400;
color: #3a3a3a;
line-height: 25px;
margin: 20px 0px;
text-align: center;
}
.dialog-footer {
margin: 0 auto;
text-align: center;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="drawer-sale-panel">
<el-form label-width="150px" :model="addForm">
<div class="scrm-textRight sale-reload">
<el-button size="small" slot="append" type="primary" @click="syncEntmicroIsOutsiderStaff" :loading="loading">同步有外部联系人权限的员工</el-button>
</div>
<el-form-item label="请选择员工">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag effect="plain" type="info" v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item>
<el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp'
export default {
name: 'addSale',
components: {
selectEmp
},
data() {
return {
loading: false,
editStatus: false,
addForm: {},
typeIndex: 0,
empType: [],
empTypeF: [],
empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
this.empTypeF = res.filter(item => item.commonFlag)
})
},
handleType(index) {
this.typeIndex = index
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
})
},
syncEntmicroIsOutsiderStaff() {
this.loading = true
let params = {
departmentId: 1,
merchantId: this.$globalState.session.merchantId
}
this.$apis.emp.syncEntmicroIsOutsiderStaff(params).then(res => {
if (res) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$message({
message: '同步成功',
type: 'success'
})
}
this.loading = false
})
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择员工',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
},
onCancel() {
if (this.innerTags.length != 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('closeDrawer')
})
} else {
this.$emit('closeDrawer')
}
}
},
mounted() {
this.listEntFollowerType()
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
\ No newline at end of file
<template>
<div class="select-emp-panel">
<div class="scrm-p10 emp-tree-panel">
<div class="popper-arrow"></div>
<div
class="emp-scroll-panel"
:style="{
height: treeHeight + 'px'
}"
>
<div class="tree-title">所在门店/部门</div>
<el-tree :data="listTree" :expand-on-click-node="false" highlight-current :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
</div>
<el-col
class="scrm-p10 emp-table-panel"
:style="{
height: treeHeight + 20 + 'px'
}"
>
<GLTable ref="saleTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" @selectionTable="selectionTable"></GLTable>
</el-col>
</div>
</template>
<script>
export default {
name: 'selectEmp',
data() {
return {
treeHeight: 0,
staffName: '',
listTree: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '职务',
prop: 'staffTitle'
}
]
},
tableEmpData: []
}
},
methods: {
selectionTable(val) {
this.$emit('selectTable', val)
},
listDepartmentTree() {
this.$apis.emp.listDepartmentTree({ id: 1 }).then(res => {
this.listTree = res
this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
document.getElementsByClassName('el-tree-node__content')[0].click()
})
})
},
clearSelect(row) {
this.tableEmpData.forEach(item => {
if (item.id == row.id) {
this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(item)
}
})
},
clearSelection() {
this.$refs.saleTable.$refs.salelistMutiTable.clearSelection()
},
handleNodeClick(data) {
this.departmentId = data.id
this.listEntmicroStaff()
},
listEntmicroStaff(staffName) {
let params = {
departmentId: this.departmentId,
staffName: staffName ? staffName : this.staffName,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.listEntmicroStaff(params).then(res => {
this.tableEmpData = res
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.treeHeight = clientHeight - 480
this.listDepartmentTree()
}
}
</script>
<style scoped lang="scss">
.select-emp-panel {
display: flex;
.emp-tree-panel {
margin-top: 10px;
width: 200px;
position: relative;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e7ed;
.emp-scroll-panel {
min-height: 200px;
overflow: auto;
box-sizing: border-box;
}
.popper-arrow {
border-top-width: 0;
border-width: 6px;
position: absolute;
top: -12px;
left: 30px;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-bottom-color: #e4e7ed;
&:after {
content: ' ';
border-width: 6px;
top: 1px;
margin-left: -6px;
border-top-width: 0;
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-bottom-color: #fff;
}
}
}
.emp-table-panel {
flex: 1;
min-height: 200px;
overflow: auto;
margin-top: 10px;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e7ed;
/deep/ .el-checkbox__input.is-disabled .el-checkbox__inner {
background-color: #999999;
}
}
.emp-tree-panel {
margin-right: 10px;
font-size: 15px;
/deep/ .el-tree-node:focus > .el-tree-node__content {
color: #5850ff;
background: #f2f5fa;
}
}
.tree-title {
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 14px;
padding: 10px;
}
}
</style>
\ No newline at end of file
<template>
<div className="scrm-main">
<div class="follow-header">
<p>
为不同的业务部门设置对应的跟进专员,方便后续业务部门创办相关的活动时能为其成员创建活动和发送企微消息,引导其跟进活动。跟进专员接收任务后可转发给客户/客户群,拥有“添加外部联系人权限”的员工才允许设置为跟进专员。
<a class="follow-process-a" @click="jumpUrl('https://img01.glsx.com.cn/upload/temporary/process.html')">
企微管理员为员工“设置外部联系人权限”流程
<i class="el-icon-d-arrow-right"></i>
</a>
</p>
</div>
<div class="follow-form" :style="{ 'min-height': formHeight + 'px' }">
<el-form :inline="true" :model="searchForm" class="follow-form-item">
<el-form-item label="跟进专员类型">
<el-select size="small" v-model="searchForm.followerTypeId" placeholder="请选择">
<el-option v-for="item in optionsType" :key="item.id" :label="item.followName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="员工搜索">
<el-input size="small" v-model="searchForm.staffName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="handleReset" size="small">重置</el-button>
<el-button type="primary" @click="handleSearch" size="small">查询</el-button>
</el-form-item>
<el-form-item class="follow-form-jump">
<GLButton fn="新增" size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</GLButton>
</el-form-item>
</el-form>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLButton fn="删除" type="text" @click="handleDele(scope.scope)">删除</GLButton>
</template>
</GLTable>
</div>
<el-drawer class="drawer-panel" size="60%" title="添加跟进员工" :visible.sync="drawer" :direction="direction" :before-close="handleClose">
<add-sale ref="drawerForm" @closeDrawer="closeDrawer" @handSelectdEmp="handSelectdEmp"></add-sale>
</el-drawer>
</div>
</template>
<script>
import addSale from './components/addSale'
export default {
name: 'index',
components: {
addSale
},
data() {
return {
alertStatus: true,
formHeight: 300,
drawer: false,
direction: 'rtl',
searchForm: {
followerTypeId: '',
staffName: ''
},
optionsType: [
{
value: '',
label: '全部'
},
{
value: '1',
label: '新车跟进专员'
},
{
value: '2',
label: '售后跟进专员'
}
],
scope: {
scope: ''
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
tableOption: true,
mutiSelectName: 'user',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName'
},
{
label: '手机号',
prop: 'staffPhone'
},
{
label: '首次开通时间',
prop: 'followerCreatedTime'
},
{
label: '是否有外部联系人权限',
prop: 'isAddOutsider',
formatter: cellValue => {
return {
0: '是',
1: '否'
}[cellValue.isAddOutsider]
}
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0
}
},
watch: {
drawer(val) {
if (!val) {
this.listEntFollowerType()
}
}
},
methods: {
jumpUrl(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.click()
},
openDrawer() {
this.drawer = true
this.$nextTick(() => {
this.$refs.drawerForm.init()
})
},
beforeSearchFn() {
return new Promise(resolve => {
// 调接口前,操作
resolve()
})
},
handleClose() {
this.drawer = false
},
closeDrawer() {
this.handleClose()
},
handSelectdEmp(followerTypeId, userIds) {
var params = {
followerTypeId,
userIds
}
this.$apis.emp.saveFollowerStaff(params).then(res => {
if (res) {
this.handleClose()
this.handleSearch()
}
})
},
handleReset() {
this.searchForm = {
followerTypeId: '',
staffName: ''
}
this.handleSearch()
},
handleSearch() {
var params = {
...JSON.parse(JSON.stringify(this.searchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum
}
this.$apis.emp.listFollowerStaffByPage(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.data && res.data.length == []) {
this.$refs.table.setTableHeightFun()
}
})
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.optionsType = [{ followName: '全部', id: '' }].concat(res)
})
},
handleDele(scope) {
this.$confirm('是否删除该员工?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$apis.emp.deleteFollowerStaff({ userId: scope.userId, userOneId: scope.userOneId }).then(res => {
if (res) {
this.$message({
type: 'success',
message: '删除成功!'
})
}
this.handleSearch()
})
})
.catch(() => {})
},
jumpWx() {
this.$router.push('/enterpriseWechat/index')
},
wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (!item.children) {
return
}
item.children.forEach(itm => {
if (itm.path == '/enterpriseWechat/index') {
this.$apis.ww.getStatus({}).then(res => {
if (res.status != 'SUCCESS') {
const h = this.$createElement
this.$message({
showClose: true,
duration: 0,
message: h('p', null, [h('span', null, '此功能需完成【企业微信授权】后方可使用! '), h('span', { on: { click: this.jumpWx }, style: { margin: '0px 60px 0px 20px', cursor: 'pointer', color: '#5850ff' } }, ['企业微信授权 ', h('i', { class: 'el-icon-d-arrow-right' }, '')])])
})
}
})
}
})
})
}
},
beforeDestroy() {
this.$message.closeAll()
},
mounted() {
this.wxTips()
this.listEntFollowerType()
this.handleSearch()
this.formHeight = document.documentElement.clientHeight - 230
}
}
</script>
<style scoped lang="scss">
.slide-fade-enter-active {
transition: all 0.3s ease;
}
.slide-fade-leave-active {
transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter, .slide-fade-leave-to
/* .slide-fade-leave-active 用于 2.1.8 以下版本 */ {
transform: translateX(10px);
opacity: 0;
}
.message-tips {
padding: 10px;
box-sizing: border-box;
border-width: 1px;
border-style: solid;
border-color: #ebeef5;
position: fixed;
left: 50%;
top: 0px;
transform: translate(-50%, 20px);
display: flex;
align-items: center;
transition: all 0.3s ease-in;
background: forestgreen;
}
.follow-header {
background: #ffffff;
line-height: 20px;
padding: 20px;
font-size: 15px;
color: rgba(0, 0, 0, 0.65);
position: relative;
p {
// width: 70%;
}
.follow-process-a {
text-decoration: underline;
line-height: 24px;
color: #5850ff;
cursor: pointer;
}
}
.follow-form {
min-height: calc(100% - 200px);
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
/deep/ {
.el-form-item {
margin-right: 20px;
}
.el-button {
margin-left: 20px;
}
}
&-item {
position: relative;
.follow-form-jump {
position: absolute;
right: 0px;
margin-right: 0px;
}
}
}
.drawer-panel {
/deep/ .el-drawer__body {
overflow-y: auto;
}
}
</style>
\ No newline at end of file
......@@ -18,10 +18,10 @@
<el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input>
</el-form-item>
<el-form-item label="角色名称" prop="roleName">
<el-input size="small" maxlength="20" style="width: 40%; padding-right: 50px" v-model="ruleForm.roleName" placeholder="请输入角色名称"></el-input>
<el-input size="small" maxlength="20" style="width: 40%; padding-right: 50px" @input="changeInput" v-model="ruleForm.roleName" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色说明" prop="roleDesc">
<el-input size="small" maxlength="50" style="width: 40%; padding-right: 50px" v-model="ruleForm.roleDesc" placeholder="请输入角色说明"></el-input>
<el-input size="small" maxlength="50" style="width: 40%; padding-right: 50px" @input="changeInput" v-model="ruleForm.roleDesc" placeholder="请输入角色说明"></el-input>
</el-form-item>
<!-- <el-form-item label="角色权限" prop="roleRoot">
<div class="custom_element">
......@@ -65,27 +65,24 @@
width: footerWidth + 'px'
}"
>
<el-button class="custtom" size="small" v-if="pageType == 'create'" type="primary" @click="toCreateRole(1)">草稿</el-button>
<el-button class="custtom" v-if="pageType == 'create'" type="primary" @click="toCreateRole(1)">草稿</el-button>
<div class="wrap_driver">
<el-button size="small" type="primary" @click="toCreateRole(0)">确定</el-button>
<el-button type="primary" @click="toCreateRole(0)">确定</el-button>
</div>
<el-button size="small" @click="toBack">取消</el-button>
<el-button @click="toBack">取消</el-button>
</div>
</div>
</div>
</template>
<script>
import AutoButton from '../../components/auto-button/index.vue'
import SelectProduct from './components/selectProduct.vue'
export default {
name: '',
components: {
AutoButton,
SelectProduct
},
data() {
return {
roleRootRules: false,
......@@ -110,7 +107,8 @@ export default {
// tree数据
treeDataList: [],
accountLevel: 1,
isHaveEdit: false
isHaveEdit: false,
isChangeEdit: false
}
},
watch: {
......@@ -122,6 +120,10 @@ export default {
}
},
methods: {
// 输入有变就触发提醒
changeInput() {
this.isChangeEdit = true
},
// 获取角色信息
getRoleData(id) {
this.$apis.role.roleInfoData({ id }).then(res => {
......@@ -198,6 +200,7 @@ export default {
},
// 选择商户权限
selectCurAccount(item, index) {
this.isChangeEdit = true
this.roleRootRules = false
this.accountListSelect[index].select = !item.select
this.curRootIndex = 0
......@@ -210,7 +213,6 @@ export default {
this.rootList = arr
}
let accounttypeId = []
this.rootList.forEach(item => {
accounttypeId.push(item.accounttypeId)
})
......@@ -218,7 +220,6 @@ export default {
this.accounttypeIds = accounttypeId
this.$refs.productFrom.findMenuFunTree(item.accounttypeId, item.select)
},
// 确定按钮---处理参数---提交数据---创建为0---草稿为1
toCreateRole(delFlag) {
let { merchantId, roleDesc, roleName } = this.ruleForm
......@@ -227,7 +228,6 @@ export default {
this.$refs.ruleForm.validateField('merchantId')
return
}
if (!roleName && this.$refs.productFrom.getSelectInfo().length == 0) {
this.$message.error('角色和权限至少选择一项')
return
......@@ -298,34 +298,22 @@ export default {
}
},
insertRole(para) {
this.$confirm('是否保存当前信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.role.createRole(para).then(res => {
if (res) {
this.$router.push('/role/index')
}
})
this.$apis.role.createRole(para).then(res => {
if (res) {
this.$router.push('/role/index')
}
})
},
updateRole(para) {
this.$confirm('是否保存当前信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.role.updateRole(para).then(res => {
if (res) {
this.$router.push('/role/index')
}
})
this.$apis.role.updateRole(para).then(res => {
if (res) {
this.$router.push('/role/index')
}
})
},
toBack() {
if (this.isHaveEdit&&this.pageType=='create') {
this.$confirm('离开当前页面内容将不会保存,是否继续?', '提示', {
if ((this.isHaveEdit && this.pageType == 'create') || (this.isChangeEdit && this.pageType == 'edit')) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
......@@ -337,7 +325,6 @@ export default {
this.$router.push('/role/index')
}
},
async created() {
const { session } = this.$globalState
this.accountLevel = session.accountLevel
......@@ -358,7 +345,6 @@ export default {
// document.getElementById('tab-/account/role/create').innerHTML='修改角色'
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
......@@ -368,7 +354,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.role-create-page {
height: 100%;
......
<template>
<div class="role-home-page">
<div class="top_widget">
<el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button>
<GLButton size="small" fn="创建角色" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</GLButton>
<!-- <el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button> -->
</div>
<div class="table_widget">
<div class="search_widget">
......@@ -30,8 +31,10 @@
</div>
<GLTable v-if="distoryTable" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData">
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button v-if="scope.scope.roleName!='超级管理员'" type="text" @click="toEditPage(scope.scope)">修改</el-button>
<GLButton type="text" @click="toLookPage(scope.scope)" fn="查看">查看</GLButton>
<GLButton v-if="!scope.scope.defalutRole" fn="修改" type="text" @click="toEditPage(scope.scope)">修改</GLButton>
<!-- <el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button v-if="scope.scope.roleName!='超级管理员'" type="text" @click="toEditPage(scope.scope)">修改</el-button> -->
<el-button v-if="scope.scope.delFlag" type="text" @click="todelete(scope.scope)">删除</el-button>
</template>
</GLTable>
......@@ -118,7 +121,8 @@ export default {
let { delFlag, roleName, merchantId } = this.searchForm
let para = {}
console.log(merchantId)
if (!this.distoryTable) {//代表重置
if (!this.distoryTable) {
//代表重置
para = {
pageNum: 1,
pageSize: 10
......@@ -141,9 +145,10 @@ export default {
this.$apis.role.roleDataList(para).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (!res.data.length || !res) {
this.$refs.table.setTableHeightFun()
}
this.tableData.length ? (this.$refs.table.tableHeightValues = '') : this.$refs.table.setTableHeightFun()
// if (!res.data.length || !res) {
// this.$refs.table.setTableHeightFun()
// }
// this.$nextTick(() => {
// this.$refs.table.setTableHeightFun()
// })
......@@ -205,18 +210,17 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$apis.role.deleteRole({ id: row.id }).then(res => {
if (res) {
this.getTableData()
this.$message({
type: 'success',
message: '删除成功!'
})
}
})
}).then(() => {
this.$apis.role.deleteRole({ id: row.id }).then(res => {
if (res) {
this.getTableData()
this.$message({
type: 'success',
message: '删除成功!'
})
}
})
})
}
},
......
......@@ -53,7 +53,7 @@
width: footerWidth + 'px'
}"
>
<el-button size="small" type="primary" @click="toBack">关闭</el-button>
<el-button type="primary" @click="toBack">关闭</el-button>
</div>
</div>
</template>
......
......@@ -3,7 +3,7 @@ const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
css: [
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!