Browse Source

custorg

master
pengjun 2 years ago
parent
commit
5770c7b02c
  1. 45
      src/components/customerOrg/ContactPerson.vue
  2. 192
      src/components/customerOrg/customerOrgEdit.vue
  3. 73
      src/components/customerOrg/customerOrgRegister.vue
  4. 58
      src/components/customerOrg/customerOrgTree.vue
  5. 15
      src/store/index.js
  6. 28
      src/views/customerOrg/customerOrg.vue

45
src/components/customerOrg/ContactPerson.vue

@ -1,8 +1,8 @@
<template>
<div>
<div style="display: flex;">
<div :style="'width:' + (window.pageWidth - 200 - 120 - 30) + 'px;'">
<el-table :data="customerOrg.contactPersonList" border :height="(window.pageHeight < 600 ? 84:window.pageHeight - 432)/2"
<div :style="'width:' + (window.pageWidth - 200 - 110 - 25) + 'px;'">
<el-table :data="customerOrg.contactPersonList" border :height="(window.pageHeight < 600 ? 100:window.pageHeight - 400)/2"
size="small" highlight-current-row @row-click="rowClick" ref="customerOrg.contactPersonList">
<el-table-column prop="displayName" label="姓名" min-width="70" align="center"/>
<el-table-column prop="title" label="职务" min-width="70" align="center"/>
@ -25,7 +25,7 @@
</el-table-column>
</el-table>
<el-table :data="customerOrg.contactMethodList" border :height="(window.pageHeight < 600 ? 84:window.pageHeight - 432)/2"
<el-table :data="customerOrg.contactMethodList" border :height="(window.pageHeight < 600 ? 100:window.pageHeight - 400)/2"
size="small" highlight-current-row @row-click="rowClickMethod" ref="customerOrg.contactMethodList">
<el-table-column prop="contactMethodType" label="类型" width="60" align="center">
<template slot-scope="scope">
@ -179,21 +179,35 @@ export default {
},
//
mounted() { },
mounted() {
this.getContactPersonList(this.dataTransOpts.tableS.customer_org.id)
},
computed: {
...mapState(["window", "customerOrg"]),
...mapState(["window", "customerOrg","dataTransOpts"]),
},
methods: {
moment,checkPagePriv,
//
getContactPersonList(customerOrgId) {
if(!customerOrgId){
this.customerOrg.contactPersonList = [];
this.customerOrg.contactMethodList = []
return
}
getapi(
`/api/app/contact-person/in-customer-org-id/${customerOrgId}`
).then((res) => {
//console.log('res.data',res.data)
if(res.code != -1){
this.customerOrg.contactPersonList = res.data;
if (res.data.length > 0) {
this.getContactMethodList(res.data[0].id);
} else {
this.customerOrg.contactMethodList = [];
}
}
});
},
@ -427,13 +441,22 @@ export default {
},
watch: {
'customerOrgId' (newVal,oldVal){
console.log('watch customerOrgId',newVal,oldVal)
if(newVal != oldVal){
this.personId = ''
}
// id
"dataTransOpts.refresh.contact_person.M": {
// immediate: true,
handler(newVal, oldVal) {
console.log(`watch 联系人 newVal:${newVal} oldVal:${oldVal} customerOrgId: ${this.dataTransOpts.tableS.customer_org.id}`);
this.getContactPersonList(this.dataTransOpts.tableS.customer_org.id)
}
},
// 'customerOrgId' (newVal,oldVal){
// console.log('watch customerOrgId',newVal,oldVal)
// if(newVal != oldVal){
// this.personId = ''
// }
// }
},
};
</script>
<style scoped>

192
src/components/customerOrg/customerOrgEdit.vue

@ -1,62 +1,47 @@
<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>
<el-col :span="8">
<el-form-item label="上级单位" prop="parentId">
<el-cascader v-model="form.parentId" :options="customerOrg.customerOrgTree"
:props="{checkStrictly: true,expandTrigger: 'hover',...customerOrg.treeprops,}"
: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>
@ -182,22 +151,17 @@
</div>
<!-- 按钮区域 -->
<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
>
<div v-show="checkPagePriv(pagePriv.privs, '新增单位')" class="btnList">
<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
>
<div v-show="checkPagePriv(pagePriv.privs, '新增子单位')" class="btnList">
<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
>
<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>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'删除')" class="btnList">
<div v-show="checkPagePriv(pagePriv.privs, '删除')" class="btnList">
<el-button type="danger" @click="del('form')" class="commonbutton">
<i class="el-icon-delete"></i>删除
</el-button>
@ -208,7 +172,7 @@
<script>
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { getPagePriv,checkPagePriv,tcdate, objCopy, deepCopy, arrayExistObj } from "../../utlis/proFunc";
import { getPagePriv, checkPagePriv, tcdate, objCopy, deepCopy, arrayExistObj } from "../../utlis/proFunc";
import { getTreeNode, getTreePids } from "../../utlis/tree";
export default {
@ -216,9 +180,9 @@ export default {
props: ["id"],
data() {
return {
pagePriv:{
routeUrlorPageName:'customerOrg', //
privs:[] //
pagePriv: {
routeUrlorPageName: 'customerOrg', //
privs: [] //
},
isActiveBox: false,
customerOrgEditStyle: "height:400px;",
@ -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,
};
},
@ -268,12 +232,13 @@ export default {
created() {
//
let userPriv = window.sessionStorage.getItem('userPriv')
if(userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
this.peisid = window.sessionStorage.getItem("peisid");
if (!this.form.id) {
this.form.organizationUnitId = this.peisid;
}
this.formInit = deepCopy(this.form)
},
//
@ -281,22 +246,17 @@ 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,
...mapMutations(["setData"]), checkPagePriv,
changeBox(type) {
//
@ -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;
});
@ -359,7 +322,7 @@ export default {
};
if (body.parentId) {
let pNode = getTreeNode(this.customerOrg.customerOrgTree,"treeChildren","id",body.parentId);
let pNode = getTreeNode(this.customerOrg.customerOrgTree, "treeChildren", "id", body.parentId);
if (!pNode.treeChildren) this.$set(pNode, 'treeChildren', []);
//pNode.treeChildren = []
pNode.treeChildren.push(node);
@ -368,7 +331,7 @@ export default {
this.customerOrg.customerOrgTree.push(node);
}
this.customerOrg.defaultExpandedKeys = []
if(body.parentId){
if (body.parentId) {
this.customerOrg.defaultExpandedKeys.push(body.parentId)
}
this.customerOrg.defaultExpandedKeys.push(body.id)
@ -402,7 +365,7 @@ export default {
body
);
//tree, childNodeName, pidName, idName, idVal getTreeNode(this.customerOrg.customerOrgTree, "treeChildren", "id", body);
console.log('pids',pids,body)
console.log('pids', pids, body)
if (!pids || pids.length < 2) {
lfind = arrayExistObj(this.customerOrg.customerOrgTree, "id", body);
if (lfind > -1) this.customerOrg.customerOrgTree.splice(lfind, 1);
@ -423,8 +386,8 @@ export default {
}
},
onkeyup(e){
console.log('onkeyup e',e)
onkeyup(e) {
console.log('onkeyup e', e)
},
//
@ -486,45 +449,42 @@ 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'){
if (!this.peisid || this.peisid == 'null') {
this.$message.warning("该用户未选归属体检中心,不能执行此操作!");
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 = "";
},
//
del(formName) {
if(!this.customerOrg.customerOrgRd.id){
if (!this.customerOrg.customerOrgRd.id) {
this.$message.warning("请先选中要删除的节点")
return
}
@ -565,7 +525,7 @@ export default {
let inputs = document.querySelectorAll("form input"); // //.inline-input
//console.log('inputs',inputs);
//
inputs.forEach((input,i) => {
inputs.forEach((input, i) => {
input.addEventListener('keydown', (event) => {
@ -577,8 +537,8 @@ export default {
event.preventDefault();
//
for(let j=i+1; j<inputs.length;j++){
if(inputs[j].getAttribute('disabled') != "disabled" ){
for (let j = i + 1; j < inputs.length; j++) {
if (inputs[j].getAttribute('disabled') != "disabled") {
inputs[j].focus();
break;
}
@ -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);
}
},
},

73
src/components/customerOrg/customerOrgRegister.vue

@ -1,9 +1,10 @@
<template>
<div style="display: flex;">
<div :style="'width:' + (window.pageWidth - 200 - 120 - 30) + 'px;'">
<el-table :data="customerOrg.customerOrgRegisterList" border :height="window.pageHeight < 600 ? 168:window.pageHeight - 432" size="small"
highlight-current-row @row-click="rowClick" ref="customerOrg.customerOrgRegisterList">
<el-table-column prop="medicalTimes" label="体检次数" width="70" align="center"/>
<div :style="'width:' + (window.pageWidth - 200 - 110 - 25) + 'px;'">
<el-table :data="customerOrg.customerOrgRegisterList" border
:height="window.pageHeight < 600 ? 200 : window.pageHeight - 400" size="small" highlight-current-row
@row-click="rowClick" ref="customerOrg.customerOrgRegisterList">
<el-table-column prop="medicalTimes" label="体检次数" width="70" align="center" />
<el-table-column prop="beginTime" label="开始日期" min-width="80" align="center">
<template slot-scope="scope">
{{ moment(scope.row.beginTime).format('yyyy-MM-DD') }}
@ -20,7 +21,7 @@
</template>
</el-table-column>
<el-table-column prop="creatorName" label="创建者" min-width="70" align="center" />
<el-table-column prop="creationTime" label="创建时间" min-width="120" align="center" >
<el-table-column prop="creationTime" label="创建时间" min-width="120" align="center">
<template slot-scope="scope">
<div v-if="scope.row.creationTime">
{{ moment(scope.row.creationTime).format('yyyy-MM-DD HH:mm:ss') }}
@ -28,7 +29,7 @@
</template>
</el-table-column>
<el-table-column prop="lastModifierName" label="修改者" min-width="70" align="center" />
<el-table-column prop="lastModificationTime" label="修改时间" min-width="120" align="center" >
<el-table-column prop="lastModificationTime" label="修改时间" min-width="120" align="center">
<template slot-scope="scope">
<div v-if="scope.row.lastModificationTime">
{{ moment(scope.row.lastModificationTime).format('yyyy-MM-DD HH:mm:ss') }}
@ -38,16 +39,16 @@
</el-table>
</div>
<div style="margin-left: 10px; margin-top: 20px">
<div v-show="checkPagePriv(pagePriv.privs,'新增次数')" style="margin-top: 10px">
<div v-show="checkPagePriv(pagePriv.privs, '新增次数')" style="margin-top: 10px">
<el-button type="primary" @click="add" class="commonbutton">新增次数</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'体检完成')" style="margin-top: 10px">
<div v-show="checkPagePriv(pagePriv.privs, '体检完成')" style="margin-top: 10px">
<el-button type="success" @click="edit" class="commonbutton">体检完成</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'取消完成')" style="margin-top: 10px">
<div v-show="checkPagePriv(pagePriv.privs, '取消完成')" style="margin-top: 10px">
<el-button type="warning" @click="cansel" class="commonbutton">取消完成</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'删除次数')" style="margin-top: 10px">
<div v-show="checkPagePriv(pagePriv.privs, '删除次数')" style="margin-top: 10px">
<el-button type="danger" @click="btnDel" class="commonbutton">删除次数</el-button>
</div>
</div>
@ -57,15 +58,15 @@
import moment from "moment";
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { getPagePriv,checkPagePriv,tcdate, objCopy, deepCopy,arrayExistObj } from "../../utlis/proFunc";
import { getPagePriv, checkPagePriv, tcdate, objCopy, deepCopy, arrayExistObj } from "../../utlis/proFunc";
export default {
components: {},
data() {
return {
pagePriv:{
routeUrlorPageName:'customerOrg', //
privs:[] //
pagePriv: {
routeUrlorPageName: 'customerOrg', //
privs: [] //
},
customerOrgRegisterId: "", //ID
};
@ -74,34 +75,41 @@ export default {
created() {
//
let userPriv = window.sessionStorage.getItem('userPriv')
if(userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
},
//
mounted() { },
mounted() {
this.getCustomerOrgRegisterList(this.dataTransOpts.tableS.customer_org_register.pid);
},
computed: {
...mapState(["customerOrg", "window"]),
...mapState(["customerOrg", "window", "dataTransOpts"]),
},
methods: {
moment,checkPagePriv,
moment, checkPagePriv,
//
rowClick(row) {
this.customerOrgRegisterId = row.id;
},
//
getCustomerOrgRegisterList(customerOrgId) {
getCustomerOrgRegisterList(customerOrgPid) {
if (customerOrgPid) {
getapi(
`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${customerOrgId}`
`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${customerOrgPid}`
).then((res) => {
//console.log('res.data',res.data)
if (res.code != -1) {
this.customerOrg.customerOrgRegisterList = res.data;
}
});
this.customerOrgRegisterId = "";
} else {
this.customerOrg.customerOrgRegisterList = []
}
},
//
setOrgRegisterState(IsComplete) {
if (!this.customerOrg.customerOrgId || !this.customerOrgRegisterId) {
@ -122,7 +130,7 @@ export default {
//
async add() {
//console.log(" addTimes");
if (!this.customerOrg.customerOrgId){
if (!this.customerOrg.customerOrgId) {
this.$message.warning("单位信息未保存!");
return;
}
@ -136,7 +144,7 @@ export default {
}
})
} catch (error) {
this.$message.error("操作失败!"+err);
this.$message.error("操作失败!" + err);
}
},
@ -150,7 +158,7 @@ export default {
this.setOrgRegisterState("N");
},
btnDel(){
btnDel() {
if (!this.customerOrg.customerOrgId || !this.customerOrgRegisterId) {
//console.log(this.customerOrg.customerOrgId, this.customerOrgRegisterId);
this.$message.warning('请选中要操作的体检次数')
@ -165,10 +173,10 @@ export default {
//console.log('{patientRegisterIds}',{patientRegisterIds})
return deletapi(`/api/app/customer-org-register/${this.customerOrgRegisterId}`);
}).then((res) => {
if(res.code != -1) {
if (res.code != -1) {
console.log("删除 操作成功");
let lfind = arrayExistObj(this.customerOrg.customerOrgRegisterList, 'id', this.customerOrgRegisterId)
if(lfind > - 1) this.customerOrg.customerOrgRegisterList.splice(lfind,1)
if (lfind > - 1) this.customerOrg.customerOrgRegisterList.splice(lfind, 1)
this.customerOrgRegisterId = ''
}
}).catch((err) => {
@ -177,6 +185,17 @@ export default {
}
},
//
watch: {
// ID
"dataTransOpts.refresh.customer_org_register.M": {
// immediate: true,
handler(newVal, oldVal) {
console.log(`watch 体检次数 newVal:${newVal} oldVal:${oldVal} customerOrgPid: ${this.dataTransOpts.tableS.customer_org.parent_id}`);
this.getCustomerOrgRegisterList(this.dataTransOpts.tableS.customer_org.parent_id);
}
},
},
};
</script>
<style scoped>

58
src/components/customerOrg/customerOrgTree.vue

@ -3,9 +3,9 @@
<div style="margin:2px 2px 2px 2px;">
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" />
</div>
<div :style="'overflow: scroll;height:' +(window.pageHeight < 600 ? 432 : window.pageHeight - 168) + 'px;'">
<div>
<el-tree :data="customerOrg.customerOrgTree" :props="customerOrg.treeprops"
node-key="id" :filter-node-method="filterNode"
node-key="id" :filter-node-method="filterNode" :style="'overflow: scroll;width:200px;height:' +(window.pageHeight < 600 ? 465 : window.pageHeight - 135) + 'px;'"
:default-expanded-keys="customerOrg.defaultExpandedKeys"
@node-click="treeclick" highlight-current ref="customerOrgTree">
<span class="custom-tree-node" slot-scope="{ node, data }">
@ -42,7 +42,7 @@ export default {
},
//<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
computed: {
...mapState(["customerOrg", "window"]),
...mapState(["customerOrg", "window", "dataTransOpts"]),
},
//
@ -84,41 +84,6 @@ export default {
});
},
//
getCustomerOrgRd(id) {
this.customerOrg.customerOrgRd.id = id;
console.log('this.customerOrg.customerOrgRd.id',this.customerOrg.customerOrgRd.id)
},
//
getCustomerOrgRegisterList(customerOrgId) {
//api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=
getapi(
`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${customerOrgId}`
).then((res) => {
if(res.code != -1){
this.customerOrg.customerOrgRegisterList = res.data;
}
});
},
//
getContactPersonList(customerOrgId) {
getapi(
`/api/app/contact-person/in-customer-org-id/${customerOrgId}`
).then((res) => {
if(res.code != -1){
this.customerOrg.contactPersonList = res.data;
if (res.data.length > 0) {
this.getContactMethodList(res.data[0].id);
} else {
this.customerOrg.contactMethodList = [];
}
}
});
},
//
//api/app/contact-method/in-contact-person-id?ContactPersonId=3a0c08ad-4304-138b-d9e6-a7338739dfc4' \
@ -136,21 +101,20 @@ export default {
treeclick(data) {
//console.log(data.id + " " + data.displayName);// api/app/customer-org/3a0c0439-a5ca-8a63-b2b9-e0eb24cb58b1
this.customerOrg.oprStatus = 'edit'
this.customerOrg.customerOrgId = data.id;
this.getCustomerOrgRd(data.id);
//
let firstId = data.id //ID
this.dataTransOpts.tableS.customer_org.id = data.id //ID
this.dataTransOpts.tableS.customer_org.parent_id = data.id //ID
if(data.parentId){
let pids = getTreePids(this.customerOrg.customerOrgTree,"treeChildren", 'parentId', 'id', data.id)
console.log('pids',pids)
firstId = pids[pids.length - 2]
this.dataTransOpts.tableS.customer_org.parent_id = pids[pids.length - 2]
}
this.getCustomerOrgRegisterList(firstId);
setTimeout(() => {
this.dataTransOpts.refresh.customer_org.S++
this.dataTransOpts.refresh.customer_org_register.M++
this.dataTransOpts.refresh.contact_person.M++
}, 20);
//
this.getContactPersonList(data.id);
},
//

15
src/store/index.js

@ -292,6 +292,9 @@ export default new Vuex.Store({
adp_roles: { S: 0, M: 0 }, // 角色
adp_users: { S: 0, M: 0 }, // 用户
asbitem: { S: 0, M: 0 }, // 组合项目
customer_org: { S: 0, M: 0 }, // 体检单位
contact_person: { S: 0, M: 0 }, // 体检单位联系人
customer_org_register: { S: 0, M: 0 }, // 单位体检次数
customer_org_group: { S: 0, M: 0 }, // 单位分组
customer_org_group_detail: { S: 0, M: 0 }, // 单位分组包含的组合项目明细
charge: { S: 0, M: 0 }, // 收费
@ -307,6 +310,9 @@ export default new Vuex.Store({
adp_roles: { id: '' }, // 角色
adp_users: { id: '' }, // 用户
asbitem: { id: '' }, // 组合项目
customer_org: { id: '', parent_id: '' }, // 体检单位
contact_person: { id: '' }, // 体检单位联系人
customer_org_register: { id: '' }, // 单位体检次数 pid/单位一级节点
customer_org_group: { id: '' }, // 单位分组
customer_org_group_detail: { id: '' }, // 单位分组包含的组合项目明细
charge: { id: '' }, // 收费
@ -322,6 +328,9 @@ export default new Vuex.Store({
adp_roles: [], // 角色
adp_users: [], // 用户
asbitem: [], // 组合项目
customer_org: [], // 体检单位
contact_person: [], // 体检单位联系人
customer_org_register: [], // 单位体检次数
customer_org_group: [], // 单位分组
customer_org_group_detail: [], // 单位分组包含的组合项目明细
charge: [], // 收费
@ -332,15 +341,15 @@ export default new Vuex.Store({
register_check_item: [],
role_menu_info: [], // 角色对应的菜单
},
plus:{
clearPatientRegisterQuery:0,
plus: {
clearPatientRegisterQuery: 0,
}
},
// 弹窗控制
dialogWin: {
CustomerOrgGroupEdit:false, // 单位分组 新增/编辑
CustomerOrgGroupEdit: false, // 单位分组 新增/编辑
PatientList: false, // 体检人员档案列表
PatientRegisterEdit: false, // 体检人员登记 新增/编辑
PatientRegisterForChoose: false, // 体检人员登记列表

28
src/views/customerOrg/customerOrg.vue

@ -1,35 +1,21 @@
<template>
<div>
<el-card class="elcard">
<div slot="header">
<span>体检单位设置</span>
<div>
<div class="contenttitle">
体检登记 /<span class="contenttitleBold">单位分组</span>
</div>
<div style="display: flex;">
<!-- 单位树组件 -->
<div :style="'border: 0px solid #888;width:200px; height:' +
(window.pageHeight < 600 ? 470 : window.pageHeight - 130) +
'px;'
">
<div>
<CustomerOrgTree />
</div>
<div :style="'display:block;width:' +
(window.pageWidth - 200 - 20) +
'px;height:' +
(window.pageHeight < 600 ? 470 : window.pageHeight - 130) +
'px;' +
(window.pageHeight < 600 ? 'overflow-y: scroll;' : '')
">
<div>
<!-- 单位详情 录入与编辑 -->
<div style="height:270px;">
<CustomerOrgEdit :id="customerOrg.customerOrgRd.id" />
</div>
<!-- 体检次数 联系人 -->
<el-tabs :style="'margin-left: 10px;width:' +
(window.pageWidth - 200 - 30) +
'px;height:' +
(window.pageHeight < 600 ? 202 : window.pageHeight - 398) +
'px;'
" v-model="tabChoosed">
<el-tabs style="margin-left: 10px;" v-model="tabChoosed">
<!-- 体检次数 -->
<el-tab-pane label="体检次数" name="1">
<CustomerOrgRegister />
@ -41,7 +27,7 @@
</el-tabs>
</div>
</div>
</el-card>
</div>
</div>
</template>
<script>

Loading…
Cancel
Save