|
|
|
@ -10,7 +10,7 @@ |
|
|
|
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" |
|
|
|
:show-all-levels="false" clearable filterable disabled |
|
|
|
:style="'width:' + Math.floor((window.pageWidth - 585) / 3) + 'px;'"> |
|
|
|
</el-cascader> |
|
|
|
</el-cascader> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
@ -124,6 +124,18 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="编号" prop="id"> |
|
|
|
<el-input v-model="form.id" disabled /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="税号" prop="countryOrgCode"> |
|
|
|
<el-input v-model="form.countryOrgCode" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="创建人员"> |
|
|
|
@ -147,13 +159,6 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="16"> |
|
|
|
<el-form-item label="编号" prop="id"> |
|
|
|
<el-input v-model="form.id" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<!-- 按钮区域 --> |
|
|
|
@ -210,6 +215,7 @@ export default { |
|
|
|
postalCode: "", |
|
|
|
address: "", |
|
|
|
bank: "", |
|
|
|
countryOrgCode: "", |
|
|
|
accounts: "", |
|
|
|
orgTypeId: null, |
|
|
|
remark: "", |
|
|
|
@ -403,7 +409,7 @@ export default { |
|
|
|
console.log("vuex data", this.customerOrg.customerOrgRd); |
|
|
|
this.$refs[formName].validate((valid, fields) => { |
|
|
|
if (!valid) { |
|
|
|
this.$message.warning({ showClose: true, message: fields[Object.keys(fields)[0]][0].message}); |
|
|
|
this.$message.warning({ showClose: true, message: fields[Object.keys(fields)[0]][0].message }); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
@ -431,16 +437,20 @@ export default { |
|
|
|
|
|
|
|
if (!this.form.id) { |
|
|
|
//id为空则新增 |
|
|
|
postapi(`/api/app/customerorg/create`, body).then((res) => { |
|
|
|
postapi(`/api/app/customerorg/create`, body).then(async (res) => { |
|
|
|
if (res.code == 1) { |
|
|
|
console.log("创健 操作成功"); |
|
|
|
//this.setData({ key: "customerOrg.customerOrgRd", value: res }); |
|
|
|
this.form = res.data |
|
|
|
this.dataTransOpts.tableS.customer_org.id = res.data.id |
|
|
|
// this.customerOrg.customerOrgId = res.data.id; |
|
|
|
this.dataTransOpts.tableS.customer_org = res.data |
|
|
|
// this.customerOrg.customerOrgId = res.data.id; |
|
|
|
this.customerOrg.customerOrgRd = res.data; |
|
|
|
this.getCustomerOrgTree("insert", res.data); |
|
|
|
this.customerOrg.oprStatus = 'edit' |
|
|
|
this.dataTransOpts.tableS.customer_org.parent_id = await this.getParentCustomerOrgId(res.data.id) |
|
|
|
this.dataTransOpts.refresh.customer_org.S++ |
|
|
|
this.dataTransOpts.refresh.customer_org_register.M++ |
|
|
|
this.dataTransOpts.refresh.contact_person.M++ |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
@ -449,29 +459,50 @@ export default { |
|
|
|
(res) => { |
|
|
|
if (res.code == 1) { |
|
|
|
console.log("更新 操作成功"); |
|
|
|
let lbody = { id: this.form.id, ...body }; |
|
|
|
let lbody = { ...deepCopy(body), id: this.form.id }; |
|
|
|
this.getCustomerOrgTree("update", lbody); |
|
|
|
this.customerOrg.oprStatus = 'edit' |
|
|
|
|
|
|
|
this.dataTransOpts.refresh.customer_org.S++ |
|
|
|
this.dataTransOpts.refresh.customer_org_register.M++ |
|
|
|
this.dataTransOpts.refresh.contact_person.M++ |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取顶级单位ID |
|
|
|
async getParentCustomerOrgId(customerOrgId) { |
|
|
|
let customerOrgParentId = null |
|
|
|
if (!customerOrgId) return customerOrgParentId |
|
|
|
if (typeof customerOrgId == 'string') { |
|
|
|
try { |
|
|
|
let res = await getapi(`/api/app/customer-org/parent/${customerOrgId}`) |
|
|
|
if (res.code != -1) customerOrgParentId = res.data |
|
|
|
} catch (error) { |
|
|
|
console.log('获取顶级单位ID出错:', error) |
|
|
|
} |
|
|
|
} else if (customerOrgId.length > 0) { |
|
|
|
customerOrgParentId = customerOrgId[0] |
|
|
|
} |
|
|
|
return customerOrgParentId |
|
|
|
}, |
|
|
|
|
|
|
|
//新增弹框 |
|
|
|
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: "该用户未选归属体检中心,不能执行此操作!"}); |
|
|
|
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.$message.warning({ showClose: true, message: "请先选择上级单位" }); |
|
|
|
this.customerOrg.oprStatus = '' |
|
|
|
return; |
|
|
|
} |
|
|
|
@ -494,7 +525,7 @@ export default { |
|
|
|
//删除 |
|
|
|
btnDel(formName) { |
|
|
|
if (!this.dataTransOpts.tableS.customer_org.id) { |
|
|
|
this.$message.warning({ showClose: true, message: "请先选中要删除的节点"}) |
|
|
|
this.$message.warning({ showClose: true, message: "请先选中要删除的节点" }) |
|
|
|
return |
|
|
|
} |
|
|
|
//复制待删除的节点 |
|
|
|
@ -522,9 +553,9 @@ export default { |
|
|
|
} |
|
|
|
}).catch((err) => { |
|
|
|
if (err == "cancel") { |
|
|
|
this.$message.info({ showClose: true, message: "已取消删除"}); |
|
|
|
this.$message.info({ showClose: true, message: "已取消删除" }); |
|
|
|
} else { |
|
|
|
this.$message.error({ showClose: true, message: "操作失败,原因:" + err}); |
|
|
|
this.$message.error({ showClose: true, message: "操作失败,原因:" + err }); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|