|
|
@@ -191,28 +191,53 @@ export default {
|
|
|
this.tagList = res.data.option
|
|
|
},
|
|
|
onDel(){
|
|
|
- this.$confirm('是否确认删除当前联系人?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- closeOnClickModal:false,
|
|
|
- type: 'warning'
|
|
|
- }).then(async () => {
|
|
|
- const res = await this.$api.requested({
|
|
|
- "id": "20220831164703",
|
|
|
- "content": {
|
|
|
- "sys_phonebookid":this.$route.query.id,
|
|
|
- }
|
|
|
- })
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
- this.$store.dispatch('changeDetailDrawer',false)
|
|
|
- this.$emit('delSuccess')
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
+ if (this.mainData.islinkcustomer == 1 || this.mainData.islinkproject == 1){
|
|
|
+ this.$confirm('当前联系人已存在关联客户/项目,是否确定删除?', '提示', {
|
|
|
+ confirmButtonText: '确定删除',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ closeOnClickModal:false,
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20220831164703",
|
|
|
+ "content": {
|
|
|
+ "sys_phonebookid":this.mainData.sys_phonebookid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.$store.dispatch('changeDetailDrawer',false)
|
|
|
+ this.$emit('delSuccess')
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }else {
|
|
|
+ this.$confirm('是否确认删除当前联系人?', '提示', {
|
|
|
+ confirmButtonText: '确定删除',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ closeOnClickModal:false,
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20220831164703",
|
|
|
+ "content": {
|
|
|
+ "sys_phonebookid":this.mainData.sys_phonebookid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.$store.dispatch('changeDetailDrawer',false)
|
|
|
+ this.$emit('delSuccess')
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
// 监听切换数据,上一页,下一页
|
|
|
pageChange(id,rowindex){
|