pengjun 2 years ago
parent
commit
327e809b11
  1. 80
      src/components/customerOrg/ContactPerson.vue
  2. 241
      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. 52
      src/views/customerOrg/customerOrg.vue

80
src/components/customerOrg/ContactPerson.vue

@ -1,45 +1,28 @@
<template> <template>
<div> <div>
<div :style="customerOrg.orgDetailStyle">
<div style="display: flex;">
<div :style="'width:' + (window.pageWidth - 200 - 120 - 90) + 'px;'"> <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"
>
<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="displayName" label="姓名" />
<el-table-column prop="title" label="职务" /> <el-table-column prop="title" label="职务" />
<el-table-column prop="remark" label="备注" /> <el-table-column prop="remark" label="备注" />
<el-table-column prop="creatorName" label="创建者" width="" /> <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"> <template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
{{ moment(scope.row.creationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastModifierName" label="修改者" /> <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"> <template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
{{ moment(scope.row.lastModificationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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="类型"> <el-table-column prop="contactMethodType" label="类型">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
@ -47,21 +30,17 @@
</div> </div>
</template> </template>
</el-table-column> </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="creatorName" label="创建者" width="" />
<el-table-column prop="creationTime" label="创建时间" width="200">
<el-table-column prop="creationTime" label="创建时间" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
{{ moment(scope.row.creationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastModifierName" label="修改者" /> <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"> <template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
{{ moment(scope.row.lastModificationTime).format('yyyy-MM-DD HH:mm:ss') }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -106,11 +85,7 @@
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="创建时间" style="margin-left: -5%"> <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-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
@ -120,24 +95,14 @@
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="修改时间" style="margin-left: -5%"> <el-form-item label="修改时间" style="margin-left: -5%">
<el-input
:value="form.lastModificationTime | dateFormat"
disabled
style="width: 90%"
<el-input :value="form.lastModificationTime | dateFormat" disabled style="width: 90%"
size="small"></el-input> size="small"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-divider /> <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="类型"> <el-table-column prop="contactMethodType" label="类型">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.contactMethodType" size="small"> <el-select v-model="scope.row.contactMethodType" size="small">
@ -152,7 +117,8 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="60"> <el-table-column fixed="right" label="操作" width="60">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -166,6 +132,7 @@
</div> </div>
</template> </template>
<script> <script>
import moment from "moment";
import { mapState } from "vuex"; import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { objCopy } from "../../utlis/proFunc"; import { objCopy } from "../../utlis/proFunc";
@ -202,6 +169,7 @@ export default {
}, },
methods: { methods: {
moment,
// //
getContactPersonList(customerOrgId) { getContactPersonList(customerOrgId) {
getapi( getapi(
@ -357,7 +325,7 @@ export default {
}, },
rowClickMethod(row) { rowClickMethod(row) {
this.$message.success("rowClickMethod");
//this.$message.success("rowClickMethod");
}, },
}, },
}; };

241
src/components/customerOrg/customerOrgEdit.vue

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

14
src/components/customerOrg/customerOrgRegister.vue

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

8
src/components/customerOrg/customerOrgTree.vue

@ -4,7 +4,7 @@
<script> <script>
import { mapState, mapMutations } from "vuex"; import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate } from "../../utlis/proFunc";
import { tcdate,deepCopy} from "../../utlis/proFunc";
export default { export default {
components: {}, components: {},
data() { data() {
@ -54,11 +54,7 @@ export default {
// //
getCustomerOrgRd(id) { 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", children: "treeChildren",
}, //树形组件的数据结构 }, //树形组件的数据结构
customerOrgId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑) customerOrgId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑)
customerOrgRd: { id: "", isLock: "N", isActive: "Y", }, //单个体检单位记录值
customerOrgRd: { id: "", isLock: "N", isActive: "Y", isLockBox: false, isActiveBox: true, }, //单个体检单位记录值
customerOrgRegisterList: [{id:'uuid'}], //单位体检次数登记列表 customerOrgRegisterList: [{id:'uuid'}], //单位体检次数登记列表
contactPersonList: [], //联系人列表 contactPersonList: [], //联系人列表
contactMethodList: [], //联系方式列表 contactMethodList: [], //联系方式列表

52
src/views/customerOrg/customerOrg.vue

@ -8,14 +8,15 @@
--> -->
<div style="display: flex"> <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 /> <CustomerOrgTree />
</div> </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"> <el-tab-pane label="体检次数" name="1">
<CustomerOrgRegister /> <CustomerOrgRegister />
@ -46,13 +47,11 @@ export default {
data() { data() {
return { return {
tabChoosed: "1", tabChoosed: "1",
CustomerOrgTreeStyle: "overflow: scroll;border: 1px solid;width:200px; height:600px;",
CustomerOrgRightStyle: "width:200px; height:600px;",
}; };
}, },
created() { created() {
this.resize();
}, },
// //
@ -64,49 +63,10 @@ export default {
...mapState(["customerOrg", "window"]), ...mapState(["customerOrg", "window"]),
}, },
methods: { 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> </script>
<style scoped></style> <style scoped></style>
Loading…
Cancel
Save