From 63cc990a36f5c29c5b5e278a429a61ced170a24d Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Fri, 10 Jul 2020 08:56:04 +0800 Subject: [PATCH] zhuzhixinxi --- client/src/api/enterprise.js | 2 +- client/src/router/index.js | 8 +- client/src/views/enterprise/addresstype.vue | 44 +- client/src/views/enterprise/enterprise.vue | 7 +- .../src/views/enterprise/enterprisecreate.vue | 16 +- .../src/views/enterprise/enterpriseupdate.vue | 502 ++++++++++++++++++ server/apps/crm/views.py | 6 + 7 files changed, 566 insertions(+), 19 deletions(-) create mode 100644 client/src/views/enterprise/enterpriseupdate.vue diff --git a/client/src/api/enterprise.js b/client/src/api/enterprise.js index 549cede..4ad2656 100644 --- a/client/src/api/enterprise.js +++ b/client/src/api/enterprise.js @@ -62,7 +62,7 @@ export function updateAddress(id, data) { export function deleteAddress(id) { return request({ - url: `/certset/enterpriseaddress/${id}/`, + url: `/crm/enterpriseaddress/${id}/`, method: 'delete' }) } diff --git a/client/src/router/index.js b/client/src/router/index.js index a2bdb87..3d29026 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -118,7 +118,13 @@ export const asyncRoutes = [ meta: { title: '新增组织信息', noCache: true, icon: '', perms: ['enterprise_create']}, hidden: true }, - + { + path: 'enterprise/update', + name: 'EnterpriseUpdate', + component: () => import('@/views/enterprise/enterpriseupdate.vue'), + meta: { title: '修改组织信息', noCache: true, icon: '', perms: ['enterprise_update'] }, + hidden: true + }, ] }, { diff --git a/client/src/views/enterprise/addresstype.vue b/client/src/views/enterprise/addresstype.vue index cc24eba..b0f001b 100644 --- a/client/src/views/enterprise/addresstype.vue +++ b/client/src/views/enterprise/addresstype.vue @@ -32,6 +32,17 @@ {{ scope.row.type }} + + + { + getAddressList({ enterprise: this.enterprise }).then(response => { if (response.data) { - this.addressList = response.data.results + this.addressList = response.data + console.log(response.data) } this.listLoading = false }); @@ -164,7 +175,7 @@ export default { }, getValue() { - console.log(this.addressData.country_code) + if (this.addressData.country_code == 69) { getDictList({ type__code: "china_regions" }).then(response => { this.countyOptions = genTree(response.data); @@ -190,14 +201,30 @@ export default { }) }, handleDelete(scope){ - deleteAddress(scope.row.id).then(res=>{ + + this.$confirm('确定删除本条数据吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + + + deleteAddress(scope.row.id).then(res=>{ this.$notify({ - title: '成功', + title: '删除成功', type: 'success', duration: 2000 }) this.getList() }) + + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }); + }); + }, async confirm(form) { @@ -205,6 +232,7 @@ handleDelete(scope){ if (valid) { const isEdit = this.dialogType === 'update' if (isEdit) { + this.addressData.county_code=this.addressData.county_code[2] updateAddress(this.addressData.id, this.addressData).then(() => { this.getList() this.dialogVisible = false diff --git a/client/src/views/enterprise/enterprise.vue b/client/src/views/enterprise/enterprise.vue index e1446fb..5b21f52 100644 --- a/client/src/views/enterprise/enterprise.vue +++ b/client/src/views/enterprise/enterprise.vue @@ -43,8 +43,8 @@ -