pengjun 2 years ago
parent
commit
7b045e524b
  1. 70
      package-lock.json
  2. 3
      package.json
  3. 347
      src/components/patientRegister/ContactPerson.vue
  4. 2
      src/components/patientRegister/PatientRegisterItem.vue

70
package-lock.json

@ -9,12 +9,9 @@
"version": "0.1.0",
"dependencies": {
"axios": "^1.3.3",
"core-js": "^3.8.3",
"crypto-js": "^4.1.1",
"element-ui": "^2.15.13",
"moment": "^2.29.4",
"sortable": "^2.0.0",
"sortable.js": "^0.3.0",
"sortablejs": "^1.15.0",
"vue": "^2.6.14",
"vue-json-excel": "^0.3.0",
@ -3635,11 +3632,6 @@
"node": ">=8"
}
},
"node_modules/browser-split": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/browser-split/-/browser-split-0.0.0.tgz",
"integrity": "sha512-CNXO3AXAS1H/kOGQkPjucm1161/XoF3aVkMfujqwk85XN/D/MkQMvoB81lXyX/2rerZS+hPAYYRR3mAW05awjQ=="
},
"node_modules/browserslist": {
"version": "4.21.5",
"resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.21.5.tgz",
@ -3810,14 +3802,6 @@
"integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==",
"dev": true
},
"node_modules/class-list": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/class-list/-/class-list-0.1.1.tgz",
"integrity": "sha512-zqR0uW+VsLtyQhixBhkdQ+z6B8+Y8HTh28kdSVjJ4zTTKM7Xz2asAQSya9VI6m/34F6N6Ktm0mrchKB+E5a8Xw==",
"dependencies": {
"indexof": "0.0.1"
}
},
"node_modules/clean-css": {
"version": "5.3.2",
"resolved": "https://registry.npmmirror.com/clean-css/-/clean-css-5.3.2.tgz",
@ -4195,6 +4179,7 @@
"version": "3.28.0",
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.28.0.tgz",
"integrity": "sha512-GiZn9D4Z/rSYvTeg1ljAIsEqFm0LaN9gVtwDCrKL80zHtS31p9BAjmTxVqTQDMpwlMolJZOFntUG2uwyj7DAqw==",
"dev": true,
"hasInstallScript": true
},
"node_modules/core-js-compat": {
@ -4842,11 +4827,6 @@
"node": ">= 4"
}
},
"node_modules/domhelpers": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/domhelpers/-/domhelpers-0.1.0.tgz",
"integrity": "sha512-VZYqemdYgtxO3oI3L9o3Zdf9GmQAiFV9SP3Sccf7cVbEQtMrYBENyWnrW61Ejnsv4KldzzLs0UjHNbemTff8ZA=="
},
"node_modules/domutils": {
"version": "2.8.0",
"resolved": "https://registry.npmmirror.com/domutils/-/domutils-2.8.0.tgz",
@ -6452,15 +6432,6 @@
"node": ">=10.17.0"
}
},
"node_modules/hyperscript": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/hyperscript/-/hyperscript-1.0.7.tgz",
"integrity": "sha512-dyfX683lwCsXiVUnmfnO6xji30exAUtr2yWWfCDz6FXjD+qNXwGsBKgSfFTEKNg+MArVI25ZdadfqBgsA32NMw==",
"dependencies": {
"browser-split": "0.0.0",
"class-list": "~0.1.0"
}
},
"node_modules/iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -6528,11 +6499,6 @@
"node": ">=0.8.19"
}
},
"node_modules/indexof": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
"integrity": "sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg=="
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz",
@ -6793,11 +6759,6 @@
"@hapi/topo": "^6.0.1"
}
},
"node_modules/jquery-browserify": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/jquery-browserify/-/jquery-browserify-1.8.1.tgz",
"integrity": "sha512-IDMCKuU5padhYWP21juFL10BOySPnlihoX7R1dHKeCcwl/JdeO3trDbimKQdPXtQsWIdYMwkAyxQ3+ksEj1iMQ=="
},
"node_modules/js-message": {
"version": "1.0.7",
"resolved": "https://registry.npmmirror.com/js-message/-/js-message-1.0.7.tgz",
@ -7522,11 +7483,6 @@
"node": "*"
}
},
"node_modules/mout": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/mout/-/mout-0.11.1.tgz",
"integrity": "sha512-pK9VNiLE3QgGBrC/3ICAscwOLU7oTNeK2l32uqNAioBYtB2tQAfSsGDNChUlk7CP23126mc5lUt6+na9FlN8JA=="
},
"node_modules/mrmime": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/mrmime/-/mrmime-1.0.1.tgz",
@ -7762,11 +7718,6 @@
"node": ">= 0.4"
}
},
"node_modules/observable": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/observable/-/observable-1.3.1.tgz",
"integrity": "sha512-n1QLn+I5eo/4TJxdrC54mHPYwDPvCZQ9FwwM2VE/jVkXf7aodqb0XImZnLbAIeSbnsWm1BzGcwjxeKktD/rb9g=="
},
"node_modules/obuf": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/obuf/-/obuf-1.1.2.tgz",
@ -9564,25 +9515,6 @@
"websocket-driver": "^0.7.4"
}
},
"node_modules/sortable": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/sortable/-/sortable-2.0.0.tgz",
"integrity": "sha512-VB3IABlS7TQDd2sRE5zSqW6pPqDsuduyuJZ5vcuGpR9gPQKtFrh1Y3xUAPfxhJ6djF1HYZEfXSO9mFs2eldJ3w==",
"dependencies": {
"hyperscript": "~1.0.1",
"jquery-browserify": "~1.8.1",
"observable": "~1.3.1"
}
},
"node_modules/sortable.js": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/sortable.js/-/sortable.js-0.3.0.tgz",
"integrity": "sha512-sAtcxX/ff9L334IKcFPnssFt7xVwsLVoaTft3iTyARBfNl42yq6JSJLbgpImO9/TRN51f5QP+6lRUsFjmz1reQ==",
"dependencies": {
"domhelpers": "^0.1.0",
"mout": "^0.11.0"
}
},
"node_modules/sortablejs": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.0.tgz",

3
package.json

@ -9,12 +9,9 @@
},
"dependencies": {
"axios": "^1.3.3",
"core-js": "^3.8.3",
"crypto-js": "^4.1.1",
"element-ui": "^2.15.13",
"moment": "^2.29.4",
"sortable": "^2.0.0",
"sortable.js": "^0.3.0",
"sortablejs": "^1.15.0",
"vue": "^2.6.14",
"vue-json-excel": "^0.3.0",

347
src/components/patientRegister/ContactPerson.vue

@ -0,0 +1,347 @@
<template>
<div>
<div style="display:flex">
<div style="width: 95%;">
<el-table :data="customerOrg.contactPersonList" border height="150" row-key="id" size="small"
class="el-table__body-wrapper tbody" 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">
<template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
</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 }}
</template>
</el-table-column>
</el-table>
<el-table :data="customerOrg.contactMethodList" border height="150" row-key="id" size="small"
class="el-table__body-wrapper tbody" highlight-current-row @row-click="rowClickMethod"
ref="customerOrg.contactMethodList">
<el-table-column prop="contactMethodType" label="类型">
<template slot-scope="scope">
<div>{{scope.row.contactMethodType==='0' ? '手机':'邮箱'}}</div>
</template>
</el-table-column>
<el-table-column prop="contactMethodValue" label="联系方式" />
<el-table-column prop="creatorName" label="创建者" width="" />
<el-table-column prop="creationTime" label="创建时间" width="200">
<template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
</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 }}
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-left: 10px; margin-top: 5%">
<div style="margin-top: 10px">
<el-button type="primary" @click="add">新增</el-button>
</div>
<div style="margin-top: 10px">
<el-button type="success" @click="edit">编辑</el-button>
</div>
<div style="margin-top: 10px">
<el-button type="danger" @click="del">删除</el-button>
</div>
</div>
</div>
<!-- 联系人 -->
<el-dialog :title="formTitle" :visible.sync="dialogContactPerson" width="480">
<el-form :model="form" ref="form" label-width="100px" :rules="rules">
<el-row>
<el-col :span="8">
<el-form-item label="联系人">
<el-input v-model="form.displayName"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="职务">
<el-input v-model="form.title"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="创建者">
<el-input v-model="form.creatorName" disabled></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%"></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></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%"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-divider/>
<el-table :data="customerOrg.contactMethodList" border height="300" row-key="id" size="small"
class="el-table__body-wrapper tbody" highlight-current-row ref="contactMethod">
<el-table-column prop="contactMethodType" label="类型">
<template slot-scope="scope">
<el-select v-model="customerOrg.contactMethodList[scope.$index].contactMethodType">
<el-option
v-for="item in Methodtypes"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="contactMethodValue" label="联系方式">
<template slot-scope="scope">
<el-input v-model="customerOrg.contactMethodList[scope.$index].contactMethodValue" required/>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="60">
<template slot-scope="scope">
<i class="el-icon-delete" @click="deleteRow(scope.$index)" size="medium"></i>
</template>
</el-table-column>
</el-table>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogContactPerson = false"> </el-button>
<el-button type="success" @click="addMethod">新增联系方式</el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex'
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { objCopy } from '../../utlis/proFunc'
export default {
components: {
},
data() {
return {
personId:'',
form: {}, //
formTitle:'新增',
dialogContactPerson: false, //
Methodtypes:[
//{ value: '',label: '' },
{ value: '0',label: '电话' },
{ value: '1',label: '邮箱' },
],
rules: {
displayName: [
{ required: true, message: "请输入名称", trigger: "blur" },
],
},
};
},
created() {
},
//
mounted() {
},
computed:{
...mapState(['customerOrg']),
},
methods: {
//
getContactPersonList(customerOrgId){
getapi(`/api/app/contact-person/in-customer-org-id/${customerOrgId}`).then(
(res) => {
//console.log('res.data',res.data)
this.customerOrg.contactPersonList = res.data
}
);
},
//
//api/app/contact-method/in-contact-person-id?ContactPersonId=3a0c08ad-4304-138b-d9e6-a7338739dfc4' \
getContactMethodList(ContactPersonId){
getapi('/api/app/contact-method/in-contact-person-id',{ContactPersonId}).then(
(res) => {
//console.log('res.data',res.data)
this.customerOrg.contactMethodList = res.data
}
);
},
//
add() {
//this.$message.success(" addContactPerson");
if(!this.customerOrg.customerOrgId){
alert("没有体检单位信息")
return
}
this.form = {customerOrgId:this.customerOrg.customerOrgId}
this.dialogContactPerson = true
this.formTitle = "新增"
this.personId = ''
this.customerOrg.contactMethodList = []
},
edit() {
//this.$message.success(" editContactPerson");
if(!this.customerOrg.customerOrgId){
alert("没有体检单位信息")
return
}else if(!this.personId){
alert("请先选择要编辑的联系人")
return
}
this.dialogContactPerson = true
this.formTitle = "编辑"
},
//
del() {
//this.$message.success(" delContactPerson");
if(!this.personId){
alert("请先选择要编辑的联系人")
return
}
deletapi(`/api/app/contact-person/${this.personId}`).then(
(res) => {
this.personId = ''
this.getContactPersonList(this.customerOrg.customerOrgId)
this.customerOrg.contactMethodList = []
this.$message.success("操作成功!");
}
);
},
//
deleteRow (index){
this.customerOrg.contactMethodList.splice(index, 1)
},
//
submit(){
let body = {
customerOrgId:'',
displayName: "",
title: "",
remark: "",
}
objCopy(this.form,body)
console.log('body',body)
if(this.formTitle === '新增'){
postapi('/api/app/contact-person',body).then(
(res) => {
//console.log('api/app/contact-person')
this.personId = res.data.id
this.formTitle = '编辑'
return deletapi(`/api/app/contact-method/many/${this.personId}`)
}
).then(
(res) => {
//console.log(`deletapi api/app/contact-method/${this.personId}`)
let contactMethod = [] //form
this.customerOrg.contactMethodList.forEach((item, index) => {
contactMethod.push({
contactMethodValue: item.contactMethodValue,
contactMethodType: item.contactMethodType,
contactPersonId: this.personId
})
});
return postapi('/api/app/contact-method/many',contactMethod)
}
).then(
(res) => {
//console.log('api/app/contact-method/many')
this.getContactPersonList(this.customerOrg.customerOrgId)
this.$message.success("操作成功!");
}
);
}else{
putapi(`/api/app/contact-person/${this.personId}`,body).then(
(res) => {
//console.log(`/api/app/contact-person/${this.personId}`)
return deletapi(`/api/app/contact-method/many/${this.personId}`)
}
).then(
(res) => {
console.log(`deletapi api/app/contact-method/${this.personId}`)
let contactMethod = [] //form
this.customerOrg.contactMethodList.forEach((item, index) => {
contactMethod.push({
contactMethodValue: item.contactMethodValue,
contactMethodType: item.contactMethodType,
contactPersonId: this.personId
})
});
return postapi('/api/app/contact-method/many',contactMethod)
}
).then(
(res) => {
//console.log('api/app/contact-method/many')
this.getContactPersonList(this.customerOrg.customerOrgId)
this.$message.success("操作成功!");
}
);
}
},
//
addMethod(){
this.customerOrg.contactMethodList.push({
contactMethodValue: "",
contactMethodType: "0",
contactPersonId: this.personId
})
},
rowClick(row){
console.log('row',row)
// this.$message.success("rowClick");
this.form = row
this.personId = row.id
this.getContactMethodList(row.id)
},
rowClickMethod(row){
this.$message.success("rowClickMethod");
}
},
};
</script>
<style scoped>
</style>

2
src/components/patientRegister/PatientRegisterItem.vue

@ -1,4 +1,4 @@
<template>emType
<template>
<div style="margin-left: 10px;">
<div>
<span>项目类别</span>

Loading…
Cancel
Save