|
|
|
@ -180,6 +180,9 @@ |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '新增子单位')" class="btnList"> |
|
|
|
<el-button type="primary" @click="btnAdd('form', 'child')" class="commonbutton">新增子单位</el-button> |
|
|
|
</div> |
|
|
|
<div class="btnList"> |
|
|
|
<el-button type="primary" @click="btnAdd('form', 'newCopy')" class="commonbutton">复制新增</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '保存')" class="btnList"> |
|
|
|
<el-button type="success" @click="btnSubmit('form')" class="commonbutton"><i |
|
|
|
class="el-icon-check"></i>保存</el-button> |
|
|
|
@ -458,7 +461,8 @@ export default { |
|
|
|
//id为空则新增 |
|
|
|
postapi(`/api/app/customerorg/create`, body).then(async (res) => { |
|
|
|
if (res.code == 1) { |
|
|
|
console.log("创健 操作成功"); |
|
|
|
this.$message.success({showClose:true,message:'操作成功!'}) |
|
|
|
//console.log("创健 操作成功"); |
|
|
|
//this.setData({ key: "customerOrg.customerOrgRd", value: res }); |
|
|
|
this.form = res.data |
|
|
|
this.dataTransOpts.tableS.customer_org = res.data |
|
|
|
@ -477,7 +481,7 @@ export default { |
|
|
|
putapi(`/api/app/customer-org/${this.form.id}`, body).then( |
|
|
|
(res) => { |
|
|
|
if (res.code == 1) { |
|
|
|
console.log("更新 操作成功"); |
|
|
|
this.$message.success({showClose:true,message:'操作成功!'}) |
|
|
|
let lbody = { ...deepCopy(body), id: this.form.id }; |
|
|
|
this.getCustomerOrgTree("update", lbody); |
|
|
|
this.customerOrg.oprStatus = 'edit' |
|
|
|
@ -511,25 +515,40 @@ export default { |
|
|
|
|
|
|
|
//新增弹框 |
|
|
|
async btnAdd(formName, child) { |
|
|
|
await this.$refs[formName].resetFields(); |
|
|
|
//console.log('this.peisid',this.peisid) |
|
|
|
if (!this.peisid || this.peisid == 'null') { |
|
|
|
this.$message.warning({ showClose: true, message: "该用户未选归属体检中心,不能执行此操作!" }); |
|
|
|
return |
|
|
|
switch (child) { |
|
|
|
case 'newCopy': |
|
|
|
if(!this.form.id) return |
|
|
|
//let copyForm = deepCopy(this.form) |
|
|
|
//this.from = deepCopy(copyForm) |
|
|
|
this.form.displayName = '' |
|
|
|
this.form.shortName = '' |
|
|
|
this.form.id = '' |
|
|
|
this.$message.warning({showClose:true,message:'复制新增,请记得要点击【保存】!'}) |
|
|
|
break; |
|
|
|
default: |
|
|
|
let formPre = deepCopy(this.form) |
|
|
|
await this.$refs[formName].resetFields(); |
|
|
|
//console.log('this.peisid',this.peisid) |
|
|
|
if (!this.peisid || this.peisid == 'null') { |
|
|
|
this.$message.warning({ showClose: true, message: "该用户未选归属体检中心,不能执行此操作!" }); |
|
|
|
return |
|
|
|
} |
|
|
|
this.form = deepCopy(this.formInit) |
|
|
|
if (child) { |
|
|
|
if (!this.dataTransOpts.tableS.customer_org.id) { |
|
|
|
this.$message.warning({ showClose: true, message: "请先选择上级单位" }); |
|
|
|
this.customerOrg.oprStatus = '' |
|
|
|
return; |
|
|
|
} |
|
|
|
this.form.parentId = this.dataTransOpts.tableS.customer_org.id |
|
|
|
this.form.orgTypeId = formPre.orgTypeId |
|
|
|
} else { |
|
|
|
// 新增一级单位时,清除 vuex 一级单位ID |
|
|
|
this.dataTransOpts.tableS.customer_org.parent_id = '' |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
this.form = deepCopy(this.formInit) |
|
|
|
if (child) { |
|
|
|
if (!this.dataTransOpts.tableS.customer_org.id) { |
|
|
|
this.$message.warning({ showClose: true, message: "请先选择上级单位" }); |
|
|
|
this.customerOrg.oprStatus = '' |
|
|
|
return; |
|
|
|
} |
|
|
|
this.form.parentId = this.dataTransOpts.tableS.customer_org.id |
|
|
|
} else { |
|
|
|
// 新增一级单位时,清除 vuex 一级单位ID |
|
|
|
this.dataTransOpts.tableS.customer_org.parent_id = '' |
|
|
|
} |
|
|
|
this.customerOrg.oprStatus = 'add' |
|
|
|
// this.customerOrg.customerOrgId = ""; |
|
|
|
|
|
|
|
@ -559,7 +578,7 @@ export default { |
|
|
|
return deletapi(`/api/app/customer-org/${this.dataTransOpts.tableS.customer_org.id}`); |
|
|
|
}).then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
console.log("删除 操作成功"); |
|
|
|
//console.log("删除 操作成功"); |
|
|
|
this.getCustomerOrgTree("delete", this.dataTransOpts.tableS.customer_org.id); |
|
|
|
this.customerOrg.customerOrgRegisterList = [] |
|
|
|
this.customerOrg.contactPersonList = [] |
|
|
|
|