|
|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<div style="display: flex"> |
|
|
|
<div :style="'margin-left: 5px;width:' + (window.pageWidth - 200 - 120 - 25) + 'px;'"> |
|
|
|
<div :style="'margin-left: 5px;width:' + (window.pageWidth - 200 - 110 - 20) + 'px;'"> |
|
|
|
<!--overflow-y: scroll;height:200px;--> |
|
|
|
<el-form ref="form" :model="form" label-width="85px" :rules="rules" size="medium"> |
|
|
|
<el-row> |
|
|
|
@ -9,54 +9,39 @@ |
|
|
|
<el-cascader v-model="form.parentId" :options="customerOrg.customerOrgTree" |
|
|
|
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" |
|
|
|
:show-all-levels="false" clearable filterable disabled |
|
|
|
:style="'width:' + Math.floor((window.pageWidth - 600) / 3) + 'px;'"> |
|
|
|
:style="'width:' + Math.floor((window.pageWidth - 585) / 3) + 'px;'"> |
|
|
|
</el-cascader> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="单位名称" prop="displayName"> |
|
|
|
<el-input class="enterToTab" v-model="form.displayName" placeholder="请输入单位名称" :disabled="customerOrg.oprStatus ? false:true"/> |
|
|
|
<el-input class="enterToTab" v-model="form.displayName" placeholder="请输入单位名称" |
|
|
|
:disabled="customerOrg.oprStatus ? false : true" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="单位简称" prop="shortName"> |
|
|
|
<el-input class="enterToTab" v-model="form.shortName" placeholder="请输入单位简称" :disabled="customerOrg.oprStatus ? false:true"/> |
|
|
|
<el-input class="enterToTab" v-model="form.shortName" placeholder="请输入单位简称" |
|
|
|
:disabled="customerOrg.oprStatus ? false : true" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="体检中心" prop="organizationUnitId"> |
|
|
|
<el-select |
|
|
|
v-model="form.organizationUnitId" |
|
|
|
placeholder="请选择" |
|
|
|
filterable |
|
|
|
:disabled="peisid ? true : false" |
|
|
|
:style="'width:' + Math.floor((window.pageWidth - 600) / 3) + 'px;'" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in data.organizationdata" |
|
|
|
:key="item.id" |
|
|
|
:label="item.displayName" |
|
|
|
:value="item.id" |
|
|
|
/> |
|
|
|
<el-select v-model="form.organizationUnitId" placeholder="请选择" filterable :disabled="peisid ? true : false" |
|
|
|
:style="'width:' + Math.floor((window.pageWidth - 585) / 3) + 'px;'"> |
|
|
|
<el-option v-for="item in data.organizationdata" :key="item.id" :label="item.displayName" |
|
|
|
:value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="单位性质" prop="orgTypeId"> |
|
|
|
<el-select class="enterToTab" |
|
|
|
v-model="form.orgTypeId" |
|
|
|
placeholder="请选择" |
|
|
|
filterable |
|
|
|
:style="'width:' + Math.floor((window.pageWidth - 600) / 3) + 'px;'" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in data.customerOrgType" |
|
|
|
:key="item.id" |
|
|
|
:label="item.displayName" |
|
|
|
:value="item.id" |
|
|
|
/> |
|
|
|
<el-select class="enterToTab" v-model="form.orgTypeId" placeholder="请选择" filterable |
|
|
|
:style="'width:' + Math.floor((window.pageWidth - 585) / 3) + 'px;'"> |
|
|
|
<el-option v-for="item in data.customerOrgType" :key="item.id" :label="item.displayName" |
|
|
|
:value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -130,12 +115,7 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="地址" prop="address"> |
|
|
|
<el-input class="enterToTab" |
|
|
|
v-model="form.address" |
|
|
|
placeholder="请输入地址" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
/> |
|
|
|
<el-input class="enterToTab" v-model="form.address" placeholder="请输入地址" maxlength="50" show-word-limit /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
@ -152,13 +132,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="7"> |
|
|
|
<el-form-item label="创建时间"> |
|
|
|
<el-date-picker |
|
|
|
v-model="form.creationTime" |
|
|
|
type="datetime" |
|
|
|
size="small" |
|
|
|
style="width: 100%" |
|
|
|
disabled |
|
|
|
/> |
|
|
|
<el-date-picker v-model="form.creationTime" type="datetime" size="small" style="width: 100%" disabled /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
@ -168,13 +142,8 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="7"> |
|
|
|
<el-form-item label="修改时间"> |
|
|
|
<el-date-picker |
|
|
|
v-model="form.lastModificationTime" |
|
|
|
type="datetime" |
|
|
|
size="small" |
|
|
|
style="width: 100%" |
|
|
|
disabled |
|
|
|
/> |
|
|
|
<el-date-picker v-model="form.lastModificationTime" type="datetime" size="small" style="width: 100%" |
|
|
|
disabled /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -183,19 +152,14 @@ |
|
|
|
<!-- 按钮区域 --> |
|
|
|
<div style="width: 110px; margin-left: 10px; margin-top: 3%"> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '新增单位')" class="btnList"> |
|
|
|
<el-button type="primary" @click="add('form', '')" class="commonbutton" |
|
|
|
>新增单位</el-button |
|
|
|
> |
|
|
|
<el-button type="primary" @click="btnAdd('form', '')" class="commonbutton">新增单位</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '新增子单位')" class="btnList"> |
|
|
|
<el-button type="primary" @click="add('form', 'child')" class="commonbutton" |
|
|
|
>新增子单位</el-button |
|
|
|
> |
|
|
|
<el-button type="primary" @click="btnAdd('form', 'child')" 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 |
|
|
|
> |
|
|
|
<el-button type="success" @click="btnSubmit('form')" class="commonbutton"><i |
|
|
|
class="el-icon-check"></i>保存</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '删除')" class="btnList"> |
|
|
|
<el-button type="danger" @click="del('form')" class="commonbutton"> |
|
|
|
@ -252,15 +216,15 @@ export default { |
|
|
|
lastModifierName: "", |
|
|
|
lastModificationTime: null, |
|
|
|
}, //初始化 单位 记录 目前新增与更新是一致 |
|
|
|
|
|
|
|
formInit: {}, |
|
|
|
rules: { |
|
|
|
displayName: [{ required: true, message: "请输入单位名称", trigger: "blur" }], |
|
|
|
shortName: [{ required: true, message: "请输入单位简写", trigger: "blur" }], |
|
|
|
orgTypeId: [{ required: true, message: "请输入单位性质", trigger: "blur" }], |
|
|
|
organizationUnitId: [ |
|
|
|
{ required: true, message: "请输入体检中心", trigger: "blur" }, |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
|
isshow: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
@ -274,6 +238,7 @@ export default { |
|
|
|
if (!this.form.id) { |
|
|
|
this.form.organizationUnitId = this.peisid; |
|
|
|
} |
|
|
|
this.formInit = deepCopy(this.form) |
|
|
|
}, |
|
|
|
|
|
|
|
//挂载完成 |
|
|
|
@ -281,19 +246,14 @@ export default { |
|
|
|
// 表单中 回车 代替 tab |
|
|
|
this.enterToTab(); |
|
|
|
|
|
|
|
//获取体中心字典数据 |
|
|
|
this.getoraniztion(); |
|
|
|
|
|
|
|
//获取单位类别列表 |
|
|
|
this.getOrgType(); |
|
|
|
|
|
|
|
this.getCustomerOrgRd(this.id); |
|
|
|
|
|
|
|
// 初始化 字典数据 |
|
|
|
this.dictInit() |
|
|
|
|
|
|
|
this.getCustomerOrgRd(this.dataTransOpts.tableS.customer_org.id); |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
...mapState(["customerOrg", "window"]), |
|
|
|
...mapState(["customerOrg", "window", "dataTransOpts"]), |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
...mapMutations(["setData"]), checkPagePriv, |
|
|
|
@ -309,9 +269,13 @@ export default { |
|
|
|
|
|
|
|
//获取单位信息 |
|
|
|
getCustomerOrgRd(id) { |
|
|
|
if (!id) return; |
|
|
|
if (!id){ |
|
|
|
this.form = deepCopy(this.formInit) |
|
|
|
return; |
|
|
|
} |
|
|
|
getapi(`/api/app/customer-org/${id}`).then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
this.dataTransOpts.tableS.customer_org.id = res.data.id |
|
|
|
objCopy(res.data, this.form); |
|
|
|
|
|
|
|
if (res.data.isActive == "Y") { |
|
|
|
@ -328,15 +292,14 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 初始化 字典数据 |
|
|
|
dictInit() { |
|
|
|
//获取组织体检中心数据 |
|
|
|
getoraniztion() { |
|
|
|
getapi("/api/app/organization-units/organization-unit-by-is-peis").then((res) => { |
|
|
|
this.data.organizationdata = res.data; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//获取单位类别列表 |
|
|
|
getOrgType() { |
|
|
|
getapi("/api/app/customer-org-type/in-filter").then((res) => { |
|
|
|
this.data.customerOrgType = res.data.items; |
|
|
|
}); |
|
|
|
@ -486,8 +449,9 @@ export default { |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//新增弹框 |
|
|
|
async add(formName, child) { |
|
|
|
async btnAdd(formName, child) { |
|
|
|
await this.$refs[formName].resetFields(); |
|
|
|
//console.log('this.peisid',this.peisid) |
|
|
|
if (!this.peisid || this.peisid == 'null') { |
|
|
|
@ -495,31 +459,27 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.form = deepCopy(this.formInit) |
|
|
|
if (child) { |
|
|
|
if (!this.customerOrg.customerOrgId) { |
|
|
|
if (!this.dataTransOpts.tableS.customer_org.id) { |
|
|
|
this.$message.warning("请先选择上级单位"); |
|
|
|
this.customerOrg.oprStatus = '' |
|
|
|
return; |
|
|
|
} |
|
|
|
this.customerOrg.customerOrgRd.id = ""; |
|
|
|
this.customerOrg.customerOrgRd = { |
|
|
|
id: "", |
|
|
|
isLock: "N", |
|
|
|
isActive: "Y", |
|
|
|
parentId: this.customerOrg.customerOrgId, |
|
|
|
}; |
|
|
|
this.form.parentId = this.dataTransOpts.tableS.customer_org.id |
|
|
|
} else { |
|
|
|
this.customerOrg.customerOrgRd = { |
|
|
|
id: "", |
|
|
|
isLock: "N", |
|
|
|
isActive: "Y", |
|
|
|
parentId: null, |
|
|
|
}; |
|
|
|
// 新增一级单位时,清除 vuex 一级单位ID |
|
|
|
this.dataTransOpts.tableS.customer_org.parent_id = '' |
|
|
|
} |
|
|
|
this.customerOrg.oprStatus = 'add' |
|
|
|
// this.customerOrg.customerOrgId = ""; |
|
|
|
|
|
|
|
this.dataTransOpts.tableS.customer_org.id = '' |
|
|
|
setTimeout(() => { |
|
|
|
this.dataTransOpts.refresh.customer_org_register.M++ |
|
|
|
this.dataTransOpts.refresh.contact_person.M++ |
|
|
|
}, 20); |
|
|
|
|
|
|
|
objCopy(this.customerOrg.customerOrgRd, this.form); |
|
|
|
this.customerOrg.customerOrgId = ""; |
|
|
|
}, |
|
|
|
|
|
|
|
//删除 |
|
|
|
@ -591,10 +551,12 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
id(newVal, oldVal) { |
|
|
|
console.log("watch getCustomerOrgRd ", newVal, oldVal); |
|
|
|
if (newVal != oldVal && newVal != "") { |
|
|
|
this.getCustomerOrgRd(newVal); |
|
|
|
// 单位id未变时,强制刷新 |
|
|
|
"dataTransOpts.refresh.customer_org.S": { |
|
|
|
// immediate: true, |
|
|
|
handler(newVal, oldVal) { |
|
|
|
console.log(`watch 体检单位 newVal:${newVal} oldVal:${oldVal} customerOrgId: ${this.dataTransOpts.tableS.customer_org.id}`); |
|
|
|
this.getCustomerOrgRd(this.dataTransOpts.tableS.customer_org.id); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|