diff --git a/src/components/customerOrg/customerOrgEdit.vue b/src/components/customerOrg/customerOrgEdit.vue index b7086f0..753d875 100644 --- a/src/components/customerOrg/customerOrgEdit.vue +++ b/src/components/customerOrg/customerOrgEdit.vue @@ -156,18 +156,18 @@ export default { displayName: "string", shortName: "string", invoiceName: "string", - parentId: "3fa85f64-5717-4562-b3fc-2c963f66afa6", + parentId: null, telephone: "string", fax: "string", postalCode: "string", address: "string", bank: "string", accounts: "string", - orgTypeId: "3fa85f64-5717-4562-b3fc-2c963f66afa6", + orgTypeId: null, remark: "string", isLock: "N", isActive: "Y", - organizationUnitId: "3fa85f64-5717-4562-b3fc-2c963f66afa6" + organizationUnitId: null }, //单位 记录 目前新增与更新是一致 rules: { @@ -266,16 +266,27 @@ export default { isActive: vpojo.isActive, organizationUnitId: vpojo.organizationUnitId } + + // + if(this.pojo.parentId && this.pojo.parentId.length > 0){ + this.pojo.parentId = this.pojo.parentId[this.pojo.parentId.length - 1] + }else{ + this.pojo.parentId = null + } + console.log('pojo',this.pojo) + console.log(this.customerOrg.customerOrgRd) if(this.customerOrg.customerOrgRd.id.length < 1){ //id为空则新增 postapi(`/api/app/customer-org`, this.pojo).then( - (res) => { - this.$message.success("创健 操作成功"); - this.setData({ key: 'customerOrg.customerOrgRd', value: res}) - this.customerOrg.customerOrgId = res.id - this.getCustomerOrgTree() - + (res) => { + if(res.code == 1){ + this.$message.success("创健 操作成功"); + this.setData({ key: 'customerOrg.customerOrgRd', value: res}) + this.customerOrg.customerOrgId = res.id + this.customerOrg.customerOrgRd = res + this.getCustomerOrgTree() + } } ); diff --git a/src/store/index.js b/src/store/index.js index 4c7e33d..d6cb2d8 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -14,7 +14,7 @@ export default new Vuex.Store({ children: "treeChildren", }, //树形组件的数据结构 customerOrgId:'',//当前单位ID(可根据此值是否为空,判断是新增还是编辑) - customerOrgRd:{displayName:'单位名称',englishShortName:'简称'}, //单个体检单位记录值 + customerOrgRd:{displayName:'单位名称'}, //单个体检单位记录值 customerOrgRegisterList: [], //单位体检次数登记列表 contactPersonList:[], //联系人列表 contactMethodList:[], //联系方式列表