Commit 49e46850 by 胡悦

修改一客一群

1 parent 782f980c
......@@ -26,7 +26,7 @@
</div>
<img src="./assets/logo.png" alt="" srcset="" />
</div> -->
<keep-alive exclude="clientDetail,clientGroupDetail,tagsManage,clientDataOverview">
<keep-alive exclude="clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd">
<router-view></router-view>
</keep-alive>
</div>
......
......@@ -70,11 +70,22 @@ const listDepartmentTree = params => {
})
}
const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
export default {
templateList,
insert,
detail,
status,
update,
listDepartmentTree
listDepartmentTree,
nameVaild
}
......@@ -23,7 +23,7 @@ module.exports = {
*/
request: {
// baseURL: 'http://scrm.test.glsx.com.cn', // 测试
baseURL: 'http://192.168.2.42:8064',
baseURL: 'http://192.168.1.97:8064',
// 设置超时时间
timeout: 180000,
// 携带凭证
......
......@@ -108,6 +108,7 @@ import Vue from 'vue'
import SelectMembers from './components/selectMembers.vue'
// import Preview from './components/preview.vue'
export default {
name: 'guestGroupAdd',
components: {
// WelcomeWords,
SelectMembers
......@@ -138,15 +139,32 @@ export default {
}
}
}
const nameVaild = (rule, value, callback) => {
console.log(this.$route.params.id)
if (value) {
const params = {
templateName: value
}
if (this.$route.params.id) params.id = this.$route.params.id
this.$apis.groupGuest.nameVaild(params).then(res => {
if (res) {
callback(new Error('群聊名称不可重复'))
} else {
callback()
}
})
}
}
return {
eventBus: new Vue(),
basicForm: {},
basicRules: {
orgName: [{ required: true, message: '请输入组名', trigger: 'blur' }],
groupName: [{ required: true, message: '请输入群聊名称', trigger: 'blur' }],
orgName: [{ required: true, message: '请输入组名', trigger: 'change' }],
groupName: [{ required: true, message: '请输入群聊名称', trigger: 'change' },
{ validator: nameVaild, trigger: 'blur' }],
userList: [
// { required: true, message: '请选择默认成员', trigger: 'change' },
{ validator: validatorUser, trigger: 'change' }
{ validator: validatorUser, trigger: 'blur' }
]
},
membersVisible: false,
......@@ -155,19 +173,19 @@ export default {
selectData: []
}
},
watch: {
$route(val) {
if (val.params) {
const id = val.params.id
if (id && id != -1) {
this.getDetail(id)
} else {
if (this.$refs.groupForm) this.$refs.groupForm.clearValidate()
this.selectData = []
}
}
}
},
// watch: {
// $route(val) {
// console.log(val)
// if (val.params) {
// const id = val.params.id
// if (id && id != -1) {
// this.getDetail(id)
// } else {
// this.selectData = []
// }
// }
// }
// },
mounted() {
if (this.$route.params) {
const id = this.$route.params.id
......@@ -254,9 +272,6 @@ export default {
handleCancel() {
// this.$router.go(-1)
this.$router.push({ path: '/guestGroup/index' })
this.basicForm = {}
// this.$refs.welcome.updateList([])
this.selectData = []
},
remove(val, idx) {
console.log(val, idx)
......
......@@ -84,6 +84,7 @@
<script>
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'guestGroup',
data() {
return {
url: url,
......@@ -228,11 +229,11 @@ export default {
]
}
},
watch: {
$route(val) {
if (val.path == '/guestGroup/index') this.searchTable()
}
},
// watch: {
// $route(val) {
// if (val.path == '/guestGroup/index') this.searchTable()
// }
// },
mounted() {},
methods: {
//搜索表格
......@@ -266,7 +267,7 @@ export default {
this.searchTable()
this.$message({
type: 'success',
message: '操作成功!'
message: '操作成功'
})
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!