|
|
|
@ -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: "", |
|
|
|
@ -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.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,9 +459,13 @@ 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++ |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
@ -459,6 +473,23 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取顶级单位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(); |
|
|
|
|