pengjun 2 years ago
parent
commit
327e809b11
  1. 110
      src/components/customerOrg/ContactPerson.vue
  2. 325
      src/components/customerOrg/customerOrgEdit.vue
  3. 14
      src/components/customerOrg/customerOrgRegister.vue
  4. 8
      src/components/customerOrg/customerOrgTree.vue
  5. 2
      src/store/index.js
  6. 54
      src/views/customerOrg/customerOrg.vue

110
src/components/customerOrg/ContactPerson.vue

@ -1,45 +1,28 @@
<template>
<div>
<div :style="customerOrg.orgDetailStyle">
<div :style="'width:'+(window.pageWidth - 200 - 120 - 90)+'px;'">
<el-table
:data="customerOrg.contactPersonList"
border
:height="Math.floor(customerOrg.orgDetailHeight/2)"
size="small"
highlight-current-row
@row-click="rowClick"
ref="customerOrg.contactPersonList"
>
<div style="display: flex;">
<div :style="'width:' + (window.pageWidth - 200 - 120 - 90) + 'px;'">
<el-table :data="customerOrg.contactPersonList" border :height="(window.pageHeight < 600 ? 148:window.pageHeight - 452)/2"
size="small" highlight-current-row @row-click="rowClick" ref="customerOrg.contactPersonList">
<el-table-column prop="displayName" label="姓名" />
<el-table-column prop="title" label="职务" />
<el-table-column prop="remark" label="备注" />
<el-table-column prop="creatorName" label="创建者" width="" />
<el-table-column prop="creationTime" label="创建时间" width="200">
<el-table-column prop="creationTime" label="创建时间" width="180">
<template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
{{ moment(scope.row.creationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column prop="lastModifierName" label="修改者" />
<el-table-column
prop="lastModificationTime"
label="修改时间"
width="200"
>
<el-table-column prop="lastModificationTime" label="修改时间" width="180">
<template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
{{ moment(scope.row.lastModificationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table>
<el-table
:data="customerOrg.contactMethodList"
border
:height="Math.floor(customerOrg.orgDetailHeight/2)"
size="small"
highlight-current-row
@row-click="rowClickMethod"
ref="customerOrg.contactMethodList"
>
<el-table :data="customerOrg.contactMethodList" border :height="(window.pageHeight < 600 ? 148:window.pageHeight - 452)/2"
size="small" highlight-current-row @row-click="rowClickMethod" ref="customerOrg.contactMethodList">
<el-table-column prop="contactMethodType" label="类型">
<template slot-scope="scope">
<div>
@ -47,21 +30,17 @@
</div>
</template>
</el-table-column>
<el-table-column prop="contactMethodValue" label="联系方式" />
<el-table-column prop="contactMethodValue" label="联系方式" width="150"/>
<el-table-column prop="creatorName" label="创建者" width="" />
<el-table-column prop="creationTime" label="创建时间" width="200">
<el-table-column prop="creationTime" label="创建时间" width="180">
<template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
{{ moment(scope.row.creationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column prop="lastModifierName" label="修改者" />
<el-table-column
prop="lastModificationTime"
label="修改时间"
width="200"
>
<el-table-column prop="lastModificationTime" label="修改时间" width="180">
<template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
{{ moment(scope.row.lastModificationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table>
@ -84,12 +63,12 @@
<el-row>
<el-col :span="12">
<el-form-item prop="displayName" label="联系人">
<el-input v-model="form.displayName" size="small" ></el-input>
<el-input v-model="form.displayName" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职务">
<el-input v-model="form.title" size="small" ></el-input>
<el-input v-model="form.title" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
@ -101,46 +80,32 @@
<el-row>
<el-col :span="5">
<el-form-item label="创建者">
<el-input v-model="form.creatorName" disabled size="small" ></el-input>
<el-input v-model="form.creatorName" disabled size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="创建时间" style="margin-left: -5%">
<el-input
:value="form.creationTime | dateFormat"
disabled
style="width: 90%"
size="small" ></el-input>
<el-input :value="form.creationTime | dateFormat" disabled style="width: 90%" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="修改者" style="margin-left: -25%">
<el-input v-model="form.creatorName" disabled size="small" ></el-input>
<el-input v-model="form.creatorName" disabled size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="修改时间" style="margin-left: -5%">
<el-input
:value="form.lastModificationTime | dateFormat"
disabled
style="width: 90%"
size="small" ></el-input>
<el-input :value="form.lastModificationTime | dateFormat" disabled style="width: 90%"
size="small"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-divider />
<el-table
:data="customerOrg.contactMethodList"
border
height="300"
row-key="id"
size="small"
highlight-current-row
ref="contactMethod"
>
<el-table :data="customerOrg.contactMethodList" border height="300" row-key="id" size="small"
highlight-current-row ref="contactMethod">
<el-table-column prop="contactMethodType" label="类型">
<template slot-scope="scope">
<el-select v-model="scope.row.contactMethodType" size="small" >
<el-select v-model="scope.row.contactMethodType" size="small">
<el-option v-for="item in Methodtypes" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</template>
@ -152,7 +117,8 @@
</el-table-column>
<el-table-column fixed="right" label="操作" width="60">
<template slot-scope="scope">
<i class="el-icon-delete" @click="deleteRow(scope.$index)" style="font-size: 24px;color: red;cursor:pointer;" ></i>
<i class="el-icon-delete" @click="deleteRow(scope.$index)"
style="font-size: 24px;color: red;cursor:pointer;"></i>
</template>
</el-table-column>
</el-table>
@ -166,6 +132,7 @@
</div>
</template>
<script>
import moment from "moment";
import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { objCopy } from "../../utlis/proFunc";
@ -185,23 +152,24 @@ export default {
],
rules: {
displayName: [
displayName: [
{ required: true, message: "请输入名称", trigger: "blur" },
],
},
};
},
created() {},
created() { },
//
mounted() {},
mounted() { },
computed: {
...mapState(["window","customerOrg"]),
...mapState(["window", "customerOrg"]),
},
methods: {
moment,
//
getContactPersonList(customerOrgId) {
getapi(
@ -278,7 +246,7 @@ export default {
title: "",
remark: "",
};
this.$refs[formName].validate((valid,failField) => {
this.$refs[formName].validate((valid, failField) => {
if (valid) {
objCopy(this.form, body);
console.log("body", body);
@ -331,7 +299,7 @@ export default {
this.$message.success("操作成功!");
});
}
}else{
} else {
//console.log('failField',failField)
this.$message.warning("未通过数据校验!");
return false;
@ -357,13 +325,13 @@ export default {
},
rowClickMethod(row) {
this.$message.success("rowClickMethod");
//this.$message.success("rowClickMethod");
},
},
};
</script>
<style scoped>
.btnClass{
width:110px;
.btnClass {
width: 110px;
}
</style>

325
src/components/customerOrg/customerOrgEdit.vue

@ -1,146 +1,158 @@
<template>
<div :style="customerOrg.orgEditStyle">
<div style="display:flex;">
<div> <!--overflow-y: scroll;height:200px;-->
<el-form ref="form" :model="customerOrg.customerOrgRd" label-width="100px" :rules="rules" size="medium">
<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="customerOrg.customerOrgRd.parentId"
:options="customerOrg.customerOrgTree"
:props="{
checkStrictly: true,
expandTrigger: 'hover',
...customerOrg.treeprops,
}"
:show-all-levels="false"
clearable filterable disabled width="100px"
>
<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 - 655) / 3) + 'px;'">
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位名称" prop="displayName">
<el-input v-model="customerOrg.customerOrgRd.displayName" placeholder="请输入单位名称" />
<el-input v-model="form.displayName" placeholder="请输入单位名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位简称" prop="shortName">
<el-input v-model="customerOrg.customerOrgRd.shortName" placeholder="请输入单位简称" />
<el-input v-model="form.shortName" placeholder="请输入单位简称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="体检中心" prop="organizationUnitId">
<el-select v-model="customerOrg.customerOrgRd.organizationUnitId" placeholder="请选择" filterable >
<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
:style="'width:' + Math.floor((window.pageWidth - 655) / 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 v-model="customerOrg.customerOrgRd.orgTypeId" placeholder="请选择" filterable >
<el-option v-for="item in data.customerOrgType" :key="item.id" :label="item.displayName" :value="item.id" />
<el-select v-model="form.orgTypeId" placeholder="请选择" filterable
:style="'width:' + Math.floor((window.pageWidth - 655) / 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>
<el-col :span="8">
<!--
<el-form-item label="显示顺序" prop="displayOrder">
<el-input type="number" v-model="customerOrg.customerOrgRd.displayOrder" />
<el-input type="number" v-model="form.displayOrder" />
</el-form-item>
</el-col>
<el-col :span="8">
-->
<!--
<el-form-item label="单位简码" prop="simpleCode">
<el-input v-model="customerOrg.customerOrgRd.simpleCode" placeholder="由系统自动生成" disabled />
<el-input v-model="form.simpleCode" placeholder="由系统自动生成" disabled />
</el-form-item>
</el-col>
-->
<el-col :span="8">
<el-form-item label="联系电话" prop="telephone">
<el-input v-model="customerOrg.customerOrgRd.telephone" placeholder="请输入联系电话" />
<el-input v-model="form.telephone" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="传真" prop="fax">
<el-input v-model="customerOrg.customerOrgRd.fax" placeholder="请输入传真" />
<el-input v-model="form.fax" placeholder="请输入传真" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮政编码" prop="postalCode">
<el-input v-model="customerOrg.customerOrgRd.postalCode" placeholder="请输入邮政编码" />
<el-input v-model="form.postalCode" placeholder="请输入邮政编码" />
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="地址" prop="address">
<el-input v-model="customerOrg.customerOrgRd.address" placeholder="请输入地址" maxlength="50" show-word-limit/>
<el-col :span="4">
<el-form-item label="加锁" prop="isLock" label-width="56px">
<!--
<el-radio v-model="form.isLock" label="Y" ></el-radio>
<el-radio v-model="form.isLock" label="N" ></el-radio>
-->
<el-checkbox v-model="form.isLockBox" @change="changeBox" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="状态" prop="isActive" label-width="56px">
<!--
<el-radio v-model="form.isActive" label="Y">启用</el-radio>
<el-radio v-model="form.isActive" label="N">停用</el-radio>
-->
<el-checkbox v-model="form.isActiveBox" @change="changeBox('isActive')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="发票抬头" prop="invoiceName">
<el-input v-model="customerOrg.customerOrgRd.invoiceName" placeholder="请输入发票抬头" />
<el-input v-model="form.invoiceName" placeholder="请输入发票抬头" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行" prop="bank">
<el-input v-model="customerOrg.customerOrgRd.bank" placeholder="请输入开户银行" />
<el-input v-model="form.bank" placeholder="请输入开户银行" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="银行账号" prop="accounts">
<el-input v-model="customerOrg.customerOrgRd.accounts" placeholder="请输入银行账号" />
<el-input v-model="form.accounts" placeholder="请输入银行账号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="加锁" prop="isLock">
<el-radio v-model="customerOrg.customerOrgRd.isLock" label="Y" ></el-radio>
<el-radio v-model="customerOrg.customerOrgRd.isLock" label="N" ></el-radio>
<el-row>
<el-col :span="12">
<el-form-item label="地址" prop="address">
<el-input v-model="form.address" placeholder="请输入地址" maxlength="50" show-word-limit />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="状态" prop="isActive">
<el-radio v-model="customerOrg.customerOrgRd.isActive" label="Y">启用</el-radio>
<el-radio v-model="customerOrg.customerOrgRd.isActive" label="N">停用</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="customerOrg.customerOrgRd.remark" maxlength="100" show-word-limit />
<el-input v-model="form.remark" maxlength="100" show-word-limit />
</el-form-item>
</el-col>
</el-row>
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="创建者">
<el-input v-model="customerOrg.customerOrgRd.creatorName" size="small" disabled />
<el-input v-model="form.creatorName" size="small" disabled />
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="创建时间">
<el-date-picker v-model="customerOrg.customerOrgRd.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">
<el-form-item label="修改者">
<el-input v-model="customerOrg.customerOrgRd.creatorName" size="small" disabled />
<el-input v-model="form.creatorName" size="small" disabled />
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="修改时间">
<el-date-picker v-model="customerOrg.customerOrgRd.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>
</el-form>
</div>
<!-- 按钮区域 -->
<div style="width:110px;margin-left: 10px; margin-top: 5%" >
<div style="width:110px;margin-left: 10px; margin-top: 3%">
<div class="btnList">
<el-button type="primary" @click="add('')" class="btnClass">新增单位</el-button>
<el-button type="primary" @click="add('form','')" class="btnClass">新增单位</el-button>
</div>
<div class="btnList">
<el-button type="primary" @click="add('child')" class="btnClass">新增子单位</el-button>
<el-button type="primary" @click="add('form','child')" class="btnClass">新增子单位</el-button>
</div>
<div class="btnList">
<el-button type="success" @click="Onsubmit('form')" class="btnClass">保存</el-button>
@ -154,19 +166,23 @@
<script>
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate, objCopy } from "../../utlis/proFunc";
import { tcdate, objCopy, deepCopy } from "../../utlis/proFunc";
export default {
components: {},
props: ['id'],
data() {
return {
customerOrgEditStyle:"height:400px;",
isActiveBox: false,
customerOrgEditStyle: "height:400px;",
data: {
organizationdata: [], //
customerOrgType: [], //
},
pojo: {
displayName: "",
form:{
id: "",
displayName: "",
shortName: "",
invoiceName: "",
parentId: null,
@ -180,28 +196,28 @@ export default {
remark: "",
isLock: "N",
isActive: "Y",
isLockBox: false,
isActiveBox: true,
organizationUnitId: null,
}, //
}, //
rules: {
displayName: [
{ required: true, message: "请输入名称", trigger: "blur" },
{ required: true, message: "请输入单位名称", trigger: "blur" },
],
shortName: [{ required: true, message: "请输入简写", trigger: "blur" }],
orgTypeId: [{ required: true, message: "请输入单位性质" }],
shortName: [{ required: true, message: "请输入单位简写", trigger: "blur" }],
organizationUnitId: [
{ required: true, message: "请输入体检中心", trigger: "blur" },
],
displayOrder: [
{ required: true, message: "请输入显示顺序", trigger: "blur" },
],
},
isshow: false,
};
},
created() {},
created() {
},
//
mounted() {
@ -210,15 +226,55 @@ export default {
//
this.getOrgType();
this.getCustomerOrgRd(this.id);
},
computed: {
...mapState(["customerOrg","window"]),
...mapState(["customerOrg", "window"]),
},
methods: {
...mapMutations(["setData"]),
changeBox(type) {
//
if (type == 'isActive') {
if (this.form.isActiveBox) {
this.form.isActive = 'Y';
} else {
this.form.isActive = 'N';
}
} else {
if (this.form.isLockBox) {
this.form.isLock = 'Y';
} else {
this.form.isLock = 'N';
}
}
},
//
getCustomerOrgRd(id) {
if(!id) return;
getapi(`/api/app/customer-org/${id}`).then((res) => {
if (res.code != -1) {
objCopy(res.data, this.form);
if (res.data.isActive == 'Y') {
this.form.isActiveBox = true;
} else {
this.form.isActiveBox = false;
}
if (res.data.isLock == 'Y') {
this.form.isLockBox = true;
} else {
this.form.isLockBox = false;
}
}
});
},
//
getoraniztion() {
@ -248,75 +304,77 @@ export default {
//
Onsubmit(formName) {
let body = {};
console.log("vuex data", this.customerOrg.customerOrgRd);
this.$refs[formName].validate((valid) => {
if (valid) {
//
objCopy(this.customerOrg.customerOrgRd, this.pojo);
if (typeof this.pojo.parentId === "string") {
if (!this.pojo.parentId || this.pojo.parentId.length < 1) {
this.pojo.parentId = null;
}
} else {
if (this.pojo.parentId && this.pojo.parentId.length > 0) {
this.pojo.parentId =
this.pojo.parentId[this.pojo.parentId.length - 1];
} else {
this.pojo.parentId = null;
}
}
this.$refs[formName].validate((valid, fields) => {
if (!valid) {
this.$message.warning(fields[Object.keys(fields)[0]][0].message);
return false;
}
body = deepCopy(this.form);
delete body.isActiveBox;
delete body.isLockBox;
console.log(
"pojo",
this.pojo,
"this.customerOrg.customerOrgRd",
this.customerOrg.customerOrgRd
);
if (this.customerOrg.customerOrgRd.id.length < 1) {
//id
postapi(`/api/app/customer-org`, this.pojo).then((res) => {
if (res.code == 1) {
this.$message.success("创健 操作成功");
this.setData({ key: "customerOrg.customerOrgRd", value: res });
this.customerOrg.customerOrgId = res.id;
this.customerOrg.customerOrgRd = res;
this.getCustomerOrgTree();
}
});
if (typeof body.parentId === "string") {
if (!body.parentId || body.parentId.length < 1) {
body.parentId = null;
}
} else {
if (body.parentId && body.parentId.length > 0) {
body.parentId = body.parentId[body.parentId.length - 1];
} else {
//id
putapi(
`/api/app/customer-org/${this.customerOrg.customerOrgRd.id}`,
this.pojo
).then((res) => {
if (res.code == 1) {
this.$message.success("更新 操作成功");
this.getCustomerOrgTree();
}
});
body.parentId = null;
}
}
console.log("body", body, "this.form", this.form);
if (this.customerOrg.customerOrgRd.id.length < 1) {
//id
postapi(`/api/app/customer-org`, body).then((res) => {
if (res.code == 1) {
this.$message.success("创健 操作成功");
this.setData({ key: "customerOrg.customerOrgRd", value: res });
this.customerOrg.customerOrgId = res.id;
this.customerOrg.customerOrgRd = res;
this.getCustomerOrgTree();
}
});
} else {
alert("未通过数据校验");
return false;
//id
putapi(
`/api/app/customer-org/${this.customerOrg.customerOrgRd.id}`,
body
).then((res) => {
if (res.code == 1) {
this.$message.success("更新 操作成功");
this.getCustomerOrgTree();
}
});
}
});
},
//
add(child) {
async add(formName,child) {
if(child){
if(!this.customerOrg.customerOrgId){
await this.$refs[formName].resetFields();
if (child) {
if (!this.customerOrg.customerOrgId) {
this.$message.info("请先选择单位")
return
}
this.customerOrg.customerOrgRd = { id: "", isLock: "N", isActive: "Y" ,parentId:this.customerOrg.customerOrgId};
}else{
this.customerOrg.customerOrgRd = { id: "", isLock: "N", isActive: "Y",parentId:null };
this.customerOrg.customerOrgRd.id = '';
this.customerOrg.customerOrgRd = { id: "", isLock: "N", isActive: "Y", parentId: this.customerOrg.customerOrgId };
} else {
this.customerOrg.customerOrgRd = { id: "", isLock: "N", isActive: "Y", parentId: null };
}
this.customerOrg.customerOrgId = "";
},
//
@ -331,17 +389,26 @@ export default {
},
},
watch: {
'id'(newVal, oldVal) {
console.log("watch getCustomerOrgRd newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal && newVal != '') {
this.getCustomerOrgRd(newVal);
}
},
},
};
</script>
<style scoped>
::v-deep .el-form-item {
margin-bottom: 5px;
}
.btnList{
.btnList {
margin-bottom: 10px;
}
.btnClass{
width:110px;
.btnClass {
width: 110px;
}
</style>

14
src/components/customerOrg/customerOrgRegister.vue

@ -1,17 +1,17 @@
<template>
<div :style="customerOrg.orgDetailStyle">
<div style="display: flex;">
<div :style="'width:' + (window.pageWidth - 200 - 120 - 90) + 'px;'">
<el-table :data="customerOrg.customerOrgRegisterList" border :height="customerOrg.orgDetailHeight" size="small"
<el-table :data="customerOrg.customerOrgRegisterList" border :height="window.pageHeight < 600 ? 148:window.pageHeight - 452" size="small"
highlight-current-row @row-click="rowClick" ref="customerOrg.customerOrgRegisterList">
<el-table-column prop="medicalTimes" label="体检次数" />
<el-table-column prop="beginTime" label="开始日期">
<template slot-scope="scope">
{{ scope.row.beginTime | dateFormat }}
{{ moment(scope.row.beginTime).format('yyyy-MM-DD') }}
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束日期">
<template slot-scope="scope">
{{ scope.row.endTime | dateFormat }}
{{ moment(scope.row.endTime).format('yyyy-MM-DD') }}
</template>
</el-table-column>
<el-table-column prop="isComplete" label="完成标志">
@ -22,13 +22,13 @@
<el-table-column prop="creatorName" label="创建者" width="" />
<el-table-column prop="creationTime" label="创建时间" width="200">
<template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
{{ moment(scope.row.creationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column prop="lastModifierName" label="修改者" />
<el-table-column prop="lastModificationTime" label="修改时间" width="200">
<template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
{{ moment(scope.row.lastModificationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table>
@ -47,6 +47,7 @@
</div>
</template>
<script>
import moment from "moment";
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
@ -68,6 +69,7 @@ export default {
},
methods: {
moment,
//
rowClick(row) {
this.customerOrgRegisterId = row.id;

8
src/components/customerOrg/customerOrgTree.vue

@ -4,7 +4,7 @@
<script>
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate } from "../../utlis/proFunc";
import { tcdate,deepCopy} from "../../utlis/proFunc";
export default {
components: {},
data() {
@ -54,11 +54,7 @@ export default {
//
getCustomerOrgRd(id) {
getapi(`/api/app/customer-org/${id}`).then((res) => {
if(res.code != -1){
this.customerOrg.customerOrgRd = res.data;
}
});
this.customerOrg.customerOrgRd.id = id;
},
//

2
src/store/index.js

@ -28,7 +28,7 @@ export default new Vuex.Store({
children: "treeChildren",
}, //树形组件的数据结构
customerOrgId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑)
customerOrgRd: { id: "", isLock: "N", isActive: "Y", }, //单个体检单位记录值
customerOrgRd: { id: "", isLock: "N", isActive: "Y", isLockBox: false, isActiveBox: true, }, //单个体检单位记录值
customerOrgRegisterList: [{id:'uuid'}], //单位体检次数登记列表
contactPersonList: [], //联系人列表
contactMethodList: [], //联系方式列表

54
src/views/customerOrg/customerOrg.vue

@ -8,14 +8,15 @@
-->
<div style="display: flex">
<!-- 单位树组件 -->
<div :style="CustomerOrgTreeStyle">
<div :style="'overflow: scroll;border: 1px solid;width:200px; height:' + (window.pageHeight < 600 ? 450:window.pageHeight - 150) + 'px;'">
<CustomerOrgTree />
</div>
<div :style="CustomerOrgRightStyle">
<div :style="'display:block;width:'+ (window.pageWidth - 200 - 80) + 'px;height:'
+ (window.pageHeight < 600 ? 450:window.pageHeight - 150) + 'px;' + (window.pageHeight < 600 ? 'overflow-y: scroll;':'')">
<!-- 单位详情 录入与编辑 -->
<CustomerOrgEdit />
<CustomerOrgEdit :id="customerOrg.customerOrgRd.id"/>
<!-- 体检次数 联系人 -->
<el-tabs style="margin-left: 10px" v-model="tabChoosed">
<el-tabs :style="'margin-left: 10px;width:'+ (window.pageWidth - 200 - 90) + 'px;height:'+ (window.pageHeight < 600 ? 204:window.pageHeight - 396) + 'px;'" v-model="tabChoosed">
<!-- 体检次数 -->
<el-tab-pane label="体检次数" name="1">
<CustomerOrgRegister />
@ -46,13 +47,11 @@ export default {
data() {
return {
tabChoosed: "1",
CustomerOrgTreeStyle: "overflow: scroll;border: 1px solid;width:200px; height:600px;",
CustomerOrgRightStyle: "width:200px; height:600px;",
};
},
created() {
this.resize();
},
//
@ -64,49 +63,10 @@ export default {
...mapState(["customerOrg", "window"]),
},
methods: {
resize() {
let headerHeight = Number(150);
let orgDetailHeight = Number(150);
let editHeight = Number(250);
this.CustomerOrgTreeStyle = "overflow: scroll;border: 1px solid;width:200px; height:" + (this.window.pageHeight - headerHeight) + "px;";
this.CustomerOrgRightStyle = "width:" + (this.window.pageWidth - 200 - 60) + "px; height:" + (this.window.pageHeight - headerHeight) + "px;";
this.customerOrg.orgEditStyle = 'display: flex;';
this.customerOrg.orgDetailStyle = 'display: flex;';
if (this.window.pageHeight < 600) {
this.customerOrg.orgDetailHeight = orgDetailHeight;
this.CustomerOrgTreeStyle = "overflow: scroll;border: 1px solid;width:200px; height:" + (orgDetailHeight*2 + Number(50)) + "px;";
this.customerOrg.orgEditStyle += "overflow-y: scroll;height:" + orgDetailHeight + "px;";
this.customerOrg.orgDetailStyle += "overflow-y: scroll;height:" + orgDetailHeight + "px;";
} else {
this.customerOrg.orgDetailHeight = orgDetailHeight + Math.floor((this.window.pageHeight - 600) * 1 / 3);
editHeight = this.window.pageHeight - headerHeight - this.customerOrg.orgDetailHeight - 50;
if (editHeight > 310) {
this.customerOrg.orgEditStyle += "height:" + editHeight + "px;";
this.customerOrg.orgDetailStyle += "height:" + this.customerOrg.orgDetailHeight + "px;";
} else {
this.customerOrg.orgEditStyle += "overflow-y: scroll;height:" + editHeight + "px;";
this.customerOrg.orgDetailStyle += "overflow-y: scroll;height:" + this.customerOrg.orgDetailHeight + "px;";
}
}
}
},
//
watch: {
"window.pageHeight"(newVal, oldVal) {
if (newVal != oldVal) {
this.resize();
}
},
"window.pageWidth"(newVal, oldVal) {
if (newVal != oldVal) {
this.resize();
}
},
},
};
</script>
<style scoped></style>
Loading…
Cancel
Save