Browse Source

修改医院详情,医院详情回显

master
lucky 4 years ago
parent
commit
6c12c4a314
  1. 38
      package-lock.json
  2. 6
      src/components/LeftList/LeftList.vue
  3. 108
      src/components/RightPage/RightPage.vue
  4. 5
      src/config/api.js
  5. 16
      src/store/modules/home/mutations.js
  6. 2
      src/store/modules/home/state.js
  7. 2
      src/views/Index/Index.vue
  8. 6
      yarn.lock

38
package-lock.json

@ -5499,7 +5499,6 @@
"version": "2.2.4",
"resolved": "https://registry.npm.taobao.org/css/download/css-2.2.4.tgz?cache=0&sync_timestamp=1593663579643&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss%2Fdownload%2Fcss-2.2.4.tgz",
"integrity": "sha1-xkZ1XHOXHyu6amAeLPL9cbEpiSk=",
"dev": true,
"dependencies": {
"inherits": "^2.0.3",
"source-map": "^0.6.1",
@ -5635,7 +5634,6 @@
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/css-parse/download/css-parse-2.0.0.tgz",
"integrity": "sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q=",
"dev": true,
"dependencies": {
"css": "^2.0.0"
}
@ -5696,7 +5694,6 @@
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz",
"integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
@ -13013,8 +13010,7 @@
"node_modules/sax": {
"version": "1.2.4",
"resolved": "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz",
"integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=",
"dev": true
"integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk="
},
"node_modules/schema-utils": {
"version": "2.7.1",
@ -14048,7 +14044,6 @@
"version": "0.54.8",
"resolved": "https://registry.npm.taobao.org/stylus/download/stylus-0.54.8.tgz?cache=0&sync_timestamp=1594899882272&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstylus%2Fdownload%2Fstylus-0.54.8.tgz",
"integrity": "sha1-PaPmWWa8Vnp7BEv+DuzmU+CZ0Uc=",
"dev": true,
"dependencies": {
"css-parse": "~2.0.0",
"debug": "~3.1.0",
@ -14084,7 +14079,6 @@
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&sync_timestamp=1600502871403&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz",
"integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
"dev": true,
"dependencies": {
"ms": "2.0.0"
}
@ -14093,7 +14087,6 @@
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&sync_timestamp=1587535418745&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz",
"integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=",
"dev": true,
"bin": {
"mkdirp": "bin/cmd.js"
},
@ -14104,14 +14097,12 @@
"node_modules/stylus/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"node_modules/stylus/node_modules/semver": {
"version": "6.3.0",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz?cache=0&sync_timestamp=1586886301819&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-6.3.0.tgz",
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=",
"dev": true,
"bin": {
"semver": "bin/semver.js"
}
@ -14120,7 +14111,6 @@
"version": "0.7.3",
"resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.7.3.tgz",
"integrity": "sha1-UwL4FpAxc1ImVECS5kmB91F1A4M=",
"dev": true,
"engines": {
"node": ">= 8"
}
@ -18275,7 +18265,6 @@
"integrity": "sha1-P8X1IYHbdgVOzAhWIvPLBmwkL20=",
"dev": true,
"requires": {
"@babel/core": "^7.11.0",
"@babel/helper-compilation-targets": "^7.9.6",
"@babel/helper-module-imports": "^7.8.3",
"@babel/plugin-proposal-class-properties": "^7.8.3",
@ -18288,7 +18277,6 @@
"@vue/babel-plugin-jsx": "^1.0.0-0",
"@vue/babel-preset-jsx": "^1.1.2",
"babel-plugin-dynamic-import-node": "^2.3.3",
"core-js": "^3.6.5",
"core-js-compat": "^3.6.5",
"semver": "^6.1.0"
},
@ -21144,7 +21132,6 @@
"version": "2.2.4",
"resolved": "https://registry.npm.taobao.org/css/download/css-2.2.4.tgz?cache=0&sync_timestamp=1593663579643&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss%2Fdownload%2Fcss-2.2.4.tgz",
"integrity": "sha1-xkZ1XHOXHyu6amAeLPL9cbEpiSk=",
"dev": true,
"requires": {
"inherits": "^2.0.3",
"source-map": "^0.6.1",
@ -21155,8 +21142,7 @@
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz",
"integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
"dev": true
"integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM="
}
}
},
@ -21248,7 +21234,6 @@
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/css-parse/download/css-parse-2.0.0.tgz",
"integrity": "sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q=",
"dev": true,
"requires": {
"css": "^2.0.0"
}
@ -27183,8 +27168,7 @@
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz",
"integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=",
"dev": true
"integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk="
},
"schema-utils": {
"version": "2.7.1",
@ -28067,7 +28051,6 @@
"version": "0.54.8",
"resolved": "https://registry.npm.taobao.org/stylus/download/stylus-0.54.8.tgz?cache=0&sync_timestamp=1594899882272&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstylus%2Fdownload%2Fstylus-0.54.8.tgz",
"integrity": "sha1-PaPmWWa8Vnp7BEv+DuzmU+CZ0Uc=",
"dev": true,
"requires": {
"css-parse": "~2.0.0",
"debug": "~3.1.0",
@ -28083,7 +28066,6 @@
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&sync_timestamp=1600502871403&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz",
"integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
"dev": true,
"requires": {
"ms": "2.0.0"
}
@ -28091,26 +28073,22 @@
"mkdirp": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&sync_timestamp=1587535418745&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz",
"integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=",
"dev": true
"integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34="
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz?cache=0&sync_timestamp=1586886301819&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-6.3.0.tgz",
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=",
"dev": true
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0="
},
"source-map": {
"version": "0.7.3",
"resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.7.3.tgz",
"integrity": "sha1-UwL4FpAxc1ImVECS5kmB91F1A4M=",
"dev": true
"integrity": "sha1-UwL4FpAxc1ImVECS5kmB91F1A4M="
}
}
},

6
src/components/LeftList/LeftList.vue

@ -35,7 +35,7 @@
</div>
</template>
<script>
import { queryLevel, queryArea, queryHospitalList } from 'config/api';
import { queryLevel, queryArea, queryHospitalList} from 'config/api';
import { mapMutations, mapState } from 'vuex';
export default {
@ -59,7 +59,7 @@ export default {
this.getHospitalList();
},
methods: {
...mapMutations('home', ['setHospitalInfo']),
...mapMutations('home', ['setHospitalInfo','setAreaInfo', 'setLevelInfo']),
//
chooseHospital(info) {
this.setHospitalInfo(info);
@ -100,6 +100,7 @@ export default {
const { code, data, msg } = res.data;
if (code === 200) {
this.options = data;
this.setAreaInfo(data);
} else {
console.error(msg);
}
@ -115,6 +116,7 @@ export default {
const { code, data, msg } = res.data;
if (code === 200) {
this.levalList = data;
this.setLevelInfo(data);
} else {
console.error(msg);
}

108
src/components/RightPage/RightPage.vue

@ -1,6 +1,9 @@
<template>
<div class="d-flex flex-column p-4" style="max-height: 100vh">
<div class="hos-name hos-shadow white mb-2">{{ hospitalInfo.name }}</div>
<div class="hos-name hos-shadow white mb-2 d-flex justify-space-between">
<div>{{ hospitalInfo.name }}</div>
<a-button type="primary" @click="queryHospitalById">修改医院信息</a-button>
</div>
<div class="d-flex justify-space-between tree-title white">
<div class="d-flex">
<!-- <div class="mr-4 cursor-pointer">
@ -36,27 +39,63 @@
{{ addId }}
</a-modal>
<a-modal :visible="visible3" title="修改成员信息" @cancel="visible3 = false" @ok="handleOk"> 修改成员信息 </a-modal>
<a-modal :visible="visible4" title="修改医院信息" @cancel="visible4 = false" @ok="editHospInfoApi">
<a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-form-item label="省">
<a-select default-value="1">
<a-select-option value="1"> 山西省 </a-select-option>
</a-select>
</a-form-item>
<a-form-item label="市/区">
<a-cascader
:field-names="{ label: 'name', value: 'id', children: 'child' }"
:options="area"
placeholder="市/区"
@change="changeArea"
:value="areaId"
/>
</a-form-item>
<a-form-item label="医院等级">
<a-select placeholder="医院等级" allow-clear @change="changeProvince">
<a-select-option v-for="(item, index) in level" :value="item.levelId" :key="index"> {{ item.name }} </a-select-option>
</a-select>
</a-form-item>
<a-form-item label="医院名称">
<a-input v-model="hospitalName" placeholder="医院名称" />
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { queryHospitalInfo } from 'config/api';
import { queryHospitalInfo, editHospitalInfo, queryHospitalById} from 'config/api';
import TreeNode from './TreeNode.vue';
export default {
components: { TreeNode },
data() {
return {
formLayout: 'horizontal',
form: this.$form.createForm(this, { name: 'editHospInfo' }),
treeData: [],
isSelect: '',
visible: false,
visible1: false,
visible2: false,
visible3: false,
visible4: false,
addId: '',
hospitalName: '',
areaId: [],
levelId: '',
provinceId: '',
cityId: '',
countyId: '',
id: ''
};
},
computed: { ...mapState('home', ['hospitalInfo']) },
computed: { ...mapState('home', ['hospitalInfo','level','area']) },
watch: {
hospitalInfo() {
this.getHospitalInfo();
@ -66,6 +105,69 @@ export default {
this.getHospitalInfo();
},
methods: {
//
async queryHospitalById() {
try {
const params = {
param: {
id: this.hospitalInfo.id
},
};
const res = await queryHospitalById(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('查询成功');
this.areaId[0] = data.cityId;
this.areaId[1] = data.countyId;
this.cityId = data.cityId;
this.countyId = data.countyId;
this.levelId = data.levelId;
this.name = data.name;
this.visible4 = true;
} else {
this.$message.warning(msg);
}
} catch (e) {
this.$message.warning(error);
}
},
//
async editHospInfoApi() {
try {
const params = {
param: {
id: this.hospitalInfo.id,
cityId: this.cityId,
countyId: this.countyId,
levelId: this.levelId,
name: this.hospitalName,
provinceId: '140000',
},
};
const res = await editHospitalInfo(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.$emit('getHosList');
this.visible4 = false;
this.cityId = '';
this.countyId = '',
this.levelId = '',
this.name = ''
} else {
this.$message.warning(msg);
}
} catch (e) {
this.$message.warning(error);
}
},
changeArea(e) {
this.cityId = e[0];
this.countyId = e[1];
},
changeProvince(e) {
this.levelId = e;
},
//
changeChooseAll(e) {
// console.log(e.target.checked);

5
src/config/api.js

@ -19,3 +19,8 @@ export const addHospital = params => axios.post(`${management}/addHospital`, par
// 查询机构管理的医院详情
export const queryHospitalInfo = params => axios.post(`${management}/queryHospitalInfo`, params);
// 修改医院详情
export const editHospitalInfo = params => axios.post(`${management}/updateHospital`, params);
// 修改医院详情的回显
export const queryHospitalById = params => axios.post(`${management}/queryHospitalById`, params);

16
src/store/modules/home/mutations.js

@ -49,6 +49,22 @@ const mutations = {
setHospitalInfo(state, data) {
state.hospitalInfo = data;
},
/**
* 设置当前地区信息
* @param {object} state
* @param {array} data
*/
setAreaInfo(state, data) {
state.area = data;
},
/**
* 设置医院等级信息
* @param {object} state
* @param {array} data
*/
setLevelInfo(state, data) {
state.level = data;
},
};
export default mutations;

2
src/store/modules/home/state.js

@ -2,6 +2,8 @@ const state = {
anyringToken: '',
user: { id: '', phone: '', account: '', wxInfo: { nickname: '' } },
hospitalInfo: {},
area: [], //省市县地址
level: [], //医院等级
};
export default state;

2
src/views/Index/Index.vue

@ -2,7 +2,7 @@
<div class="d-flex flex-row">
<LeftList ref="left-list" @showModal="showModal" />
<AddHospital @showModal="showModal" @getHosList="getHosList" :visible="isShow" :options="options" :level-list="levelList" />
<RightPage class="flex-1" v-if="hospitalInfo && hospitalInfo.name" />
<RightPage class="flex-1" v-if="hospitalInfo && hospitalInfo.name" @getHosList="getHosList"/>
</div>
</template>
<script>

6
yarn.lock

@ -34,7 +34,7 @@
"resolved" "https://registry.npm.taobao.org/@babel/compat-data/download/@babel/compat-data-7.12.5.tgz?cache=0&sync_timestamp=1604441336656&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcompat-data%2Fdownload%2F%40babel%2Fcompat-data-7.12.5.tgz"
"version" "7.12.5"
"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.0":
"@babel/core@*", "@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.0":
"integrity" "sha1-G0NohOHjv/b7EyjcArIIdZ3pKtg="
"resolved" "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.12.3.tgz"
"version" "7.12.3"
@ -3007,7 +3007,7 @@
"resolved" "https://registry.npm.taobao.org/core-js/download/core-js-2.6.11.tgz?cache=0&sync_timestamp=1604675608816&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.11.tgz"
"version" "2.6.11"
"core-js@^3.11.0", "core-js@^3.6.5":
"core-js@^3", "core-js@^3.11.0", "core-js@^3.6.5":
"integrity" "sha512-lyvajs+wd8N1hXfzob1LdOCCHFU4bGMbqqmLn1Q4QlCpDqWPpGf+p0nj+LNrvDDG33j0hZXw2nsvvVpHysxyNw=="
"resolved" "https://registry.npmjs.org/core-js/-/core-js-3.17.3.tgz"
"version" "3.17.3"
@ -8771,7 +8771,7 @@
"lodash.clonedeep" "^4.5.0"
"when" "~3.6.x"
"stylus@^0.54.5", "stylus@>=0.52.4":
"stylus@^0.54.8", "stylus@>=0.52.4":
"integrity" "sha1-PaPmWWa8Vnp7BEv+DuzmU+CZ0Uc="
"resolved" "https://registry.npm.taobao.org/stylus/download/stylus-0.54.8.tgz?cache=0&sync_timestamp=1594899882272&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstylus%2Fdownload%2Fstylus-0.54.8.tgz"
"version" "0.54.8"

Loading…
Cancel
Save