工作提交
This commit is contained in:
parent
167756be7c
commit
6b97199cfb
3
src/api/baseurl.js
Normal file
3
src/api/baseurl.js
Normal file
@ -0,0 +1,3 @@
|
||||
var baseurl = "http://192.168.16.81:8081";
|
||||
|
||||
export default baseurl
|
||||
44
src/api/system/diseaseInfo.js
Normal file
44
src/api/system/diseaseInfo.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询疾病信息字典列表
|
||||
export function listDiseaseInfo(query) {
|
||||
return request({
|
||||
url: '/system/diseaseInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询疾病信息字典详细
|
||||
export function getDiseaseInfo(id) {
|
||||
return request({
|
||||
url: '/system/diseaseInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增疾病信息字典
|
||||
export function addDiseaseInfo(data) {
|
||||
return request({
|
||||
url: '/system/diseaseInfo/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改疾病信息字典
|
||||
export function updateDiseaseInfo(data) {
|
||||
return request({
|
||||
url: '/system/diseaseInfo/edit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除疾病信息字典
|
||||
export function delDiseaseInfo(id) {
|
||||
return request({
|
||||
url: '/system/diseaseInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
62
src/api/system/nurseItem.js
Normal file
62
src/api/system/nurseItem.js
Normal file
@ -0,0 +1,62 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询护理站护理项目列表
|
||||
export function list(query) {
|
||||
return request({
|
||||
url: '/system/stationItem/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询护理站信息列表
|
||||
export function liststation(query) {
|
||||
return request({
|
||||
url: '/system/station/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询护理类型
|
||||
export function getInfoList() {
|
||||
return request({
|
||||
url: '/system/nurseType/getInfoList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询护理站护理项目详细
|
||||
export function getNurseItem(id) {
|
||||
return request({
|
||||
url: '/system/stationItem/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增护理站护理项目
|
||||
export function addNurseItem(data) {
|
||||
return request({
|
||||
url: '/system/stationItem/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改护理站护理项目
|
||||
export function updateNurseItem(data) {
|
||||
return request({
|
||||
url: '/system/stationItem/edit',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除护理站护理项目
|
||||
export function delNurseItem(id) {
|
||||
return request({
|
||||
url: '/system/stationItem/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
61
src/api/system/station.js
Normal file
61
src/api/system/station.js
Normal file
@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询护理站信息列表
|
||||
export function listStation(query) {
|
||||
return request({
|
||||
url: '/system/station/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询护理站信息详细
|
||||
export function getStation(id) {
|
||||
return request({
|
||||
url: '/system/station/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增护理站信息
|
||||
export function addStation(data) {
|
||||
return request({
|
||||
url: '/system/station/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改护理站信息
|
||||
export function updateStation(data) {
|
||||
return request({
|
||||
url: '/system/station/edit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除护理站信息
|
||||
export function delStation(id) {
|
||||
return request({
|
||||
url: '/system/station/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// /system/communityInfo/getFirstLevelInfo 省级区域
|
||||
|
||||
export function getFirstLevelInfo() {
|
||||
return request({
|
||||
url: '/system/communityInfo/getFirstLevelInfo',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 所属下级区域信息集合
|
||||
|
||||
export function getSecondaryLevelInfo(id) {
|
||||
return request({
|
||||
url: `/system/communityInfo/getSecondaryLevelInfo?parentId=${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
21
src/api/system/stationAvatar.js
Normal file
21
src/api/system/stationAvatar.js
Normal file
@ -0,0 +1,21 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 用户头像上传
|
||||
export function updateNurseStationHeads(data) {
|
||||
return request({
|
||||
url: '/system/station/updateNurseStationHeads',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export function posts(data) {
|
||||
return request({
|
||||
url: 'https://jsonplaceholder.typicode.com/posts/',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
54
src/api/system/stationConsumable.js
Normal file
54
src/api/system/stationConsumable.js
Normal file
@ -0,0 +1,54 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询护理站耗材信息列表
|
||||
export function listStationConsumable(query) {
|
||||
return request({
|
||||
url: '/system/stationConsumable/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询护理站信息列表
|
||||
export function list(query) {
|
||||
return request({
|
||||
url: '/system/station/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询护理站耗材信息详细
|
||||
export function getStationConsumable(id) {
|
||||
return request({
|
||||
url: '/system/stationConsumable/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增护理站耗材信息
|
||||
export function addStationConsumable(data) {
|
||||
return request({
|
||||
url: '/system/stationConsumable/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改护理站耗材信息
|
||||
export function updateStationConsumable(data) {
|
||||
return request({
|
||||
url: '/system/stationConsumable/edit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除护理站耗材信息
|
||||
export function delStationConsumable(id) {
|
||||
return request({
|
||||
url: '/system/stationConsumable/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
14
src/directives.js
Normal file
14
src/directives.js
Normal file
@ -0,0 +1,14 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
Vue.directive('loadmore', {
|
||||
bind(el, binding) {
|
||||
// 获取element-ui定义好的scroll盒子
|
||||
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
|
||||
SELECTWRAP_DOM.addEventListener('scroll', function() {
|
||||
const CONDITION = this.scrollHeight - this.scrollTop === this.clientHeight;
|
||||
if (CONDITION == false) {
|
||||
binding.value()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -9,7 +9,7 @@
|
||||
<template v-if="device!=='mobile'">
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
|
||||
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||
<ruo-yi-git id="xinyilu-git" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
</el-tooltip> -->
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
17
src/main.js
17
src/main.js
@ -38,6 +38,11 @@ import VueMeta from 'vue-meta'
|
||||
// 字典数据组件
|
||||
import DictData from '@/components/DictData'
|
||||
|
||||
|
||||
import directives from "./directives";
|
||||
Vue.use(directives);
|
||||
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
Vue.prototype.getConfigKey = getConfigKey
|
||||
@ -73,14 +78,14 @@ DictData.install()
|
||||
*/
|
||||
|
||||
Vue.use(Element, {
|
||||
size: Cookies.get('size') || 'medium' // set element-ui default size
|
||||
size: Cookies.get('size') || 'medium' // set element-ui default size
|
||||
})
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
})
|
||||
el: '#app',
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
})
|
||||
457
src/views/system/diseaseInfo/index.vue
Normal file
457
src/views/system/diseaseInfo/index.vue
Normal file
@ -0,0 +1,457 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="疾病名称" prop="diseaseName">
|
||||
<el-input
|
||||
v-model="queryParams.diseaseName"
|
||||
placeholder="请输入疾病名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="疾病描述" prop="description">
|
||||
<el-input
|
||||
v-model="queryParams.description"
|
||||
placeholder="请输入疾病描述"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:diseaseInfo:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:diseaseInfo:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:diseaseInfo:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:diseaseInfo:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="diseaseInfoList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="疾病名称" align="center" prop="diseaseName" />
|
||||
<el-table-column label="疾病描述" align="center" prop="description" />
|
||||
<el-table-column label="疾病唯一编码" align="center" prop="diseaseCode" />
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:diseaseInfo:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:diseaseInfo:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加疾病信息字典对话框 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="open2"
|
||||
width="1200px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="80px"
|
||||
:inline="true"
|
||||
>
|
||||
<div
|
||||
v-for="(item, index) in form.diseaseInfoList"
|
||||
:key="index"
|
||||
style="margin-top: 20px"
|
||||
>
|
||||
<el-form-item
|
||||
label="疾病名称"
|
||||
:rules="rules.diseaseInfoList.diseaseName"
|
||||
:prop="`diseaseInfoList.${index}.diseaseName`"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.diseaseName"
|
||||
placeholder="请输入疾病名称"
|
||||
maxlength="50"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="疾病描述" prop="description">
|
||||
<el-input
|
||||
style="width: 400px"
|
||||
v-model="item.description"
|
||||
placeholder="请输入疾病描述"
|
||||
maxlength="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="排序"
|
||||
:rules="rules.diseaseInfoList.sort"
|
||||
:prop="`diseaseInfoList.${index}.sort`"
|
||||
label-width="50px"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.sort"
|
||||
placeholder="不可输入小数点"
|
||||
type="number"
|
||||
min="0"
|
||||
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+0)} if(value.length>10){value=value.slice(0,10)}"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
circle
|
||||
plain
|
||||
icon="el-icon-circle-plus-outline"
|
||||
@click="adddisease"
|
||||
v-if="index == 0"
|
||||
style="margin-left: 10px"
|
||||
></el-button>
|
||||
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
circle
|
||||
plain
|
||||
@click="deldisease(index)"
|
||||
style="margin-left: 10px"
|
||||
v-if="index != 0"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="margin-right: 50px">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 修改疾病信息字典对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="疾病名称" prop="diseaseName">
|
||||
<el-input
|
||||
v-model="form.diseaseName"
|
||||
placeholder="请输入疾病名称"
|
||||
maxlength="50"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="疾病描述" prop="description">
|
||||
<el-input
|
||||
v-model="form.description"
|
||||
placeholder="请输入疾病描述"
|
||||
maxlength="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input
|
||||
v-model="form.sort"
|
||||
placeholder="请输入排序"
|
||||
maxlength="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listDiseaseInfo,
|
||||
getDiseaseInfo,
|
||||
delDiseaseInfo,
|
||||
addDiseaseInfo,
|
||||
updateDiseaseInfo,
|
||||
} from "@/api/system/diseaseInfo";
|
||||
|
||||
export default {
|
||||
name: "DiseaseInfo",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
open2: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
diseaseCode: null,
|
||||
diseaseName: null,
|
||||
description: null,
|
||||
sort: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 疾病信息字典表格数据
|
||||
diseaseInfoList: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
diseaseName: [
|
||||
{ required: true, message: "请填写活动形式", trigger: "blur" },
|
||||
],
|
||||
sort: [{ required: true, message: "请填写排序", trigger: "blur" }],
|
||||
|
||||
diseaseInfoList: {
|
||||
diseaseName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入疾病名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
sort: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入排序",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//删除deldisease
|
||||
deldisease(index) {
|
||||
this.form.diseaseInfoList.splice(index, 1);
|
||||
console.log(this.form.diseaseInfoList);
|
||||
},
|
||||
//添加adddisease
|
||||
adddisease() {
|
||||
var obj = {
|
||||
diseaseName: "",
|
||||
description: "",
|
||||
sort: "",
|
||||
};
|
||||
if (this.form.diseaseInfoList.length == 5) {
|
||||
this.$message.error("最多只能5条");
|
||||
} else {
|
||||
this.form.diseaseInfoList.push(obj);
|
||||
}
|
||||
},
|
||||
/** 查询疾病信息字典列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDiseaseInfo(this.queryParams).then((response) => {
|
||||
this.diseaseInfoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.open2 = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
userId: null,
|
||||
diseaseCode: null,
|
||||
diseaseName: null,
|
||||
description: null,
|
||||
sort: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
diseaseInfoList: [
|
||||
{
|
||||
diseaseName: "",
|
||||
description: "",
|
||||
sort: "",
|
||||
},
|
||||
],
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open2 = true;
|
||||
this.title = "添加疾病信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getDiseaseInfo(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改疾病信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateDiseaseInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addDiseaseInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open2 = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm("是否确认删除?")
|
||||
.then(function () {
|
||||
return delDiseaseInfo(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"system/diseaseInfo/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`diseaseInfo_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
1158
src/views/system/nurseItem/index.vue
Normal file
1158
src/views/system/nurseItem/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
896
src/views/system/station/index.vue
Normal file
896
src/views/system/station/index.vue
Normal file
@ -0,0 +1,896 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="100px"
|
||||
>
|
||||
<!-- <el-form-item label="区域编码" prop="areaCode">
|
||||
<el-input
|
||||
v-model="queryParams.areaCode"
|
||||
placeholder="请输入所属区域编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="护理站名称" prop="nurseStationName">
|
||||
<el-input
|
||||
v-model="queryParams.nurseStationName"
|
||||
placeholder="请输入护理站名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/> </el-form-item
|
||||
><el-form-item label="护理站编号" prop="nurseStationCode">
|
||||
<el-input
|
||||
v-model="queryParams.nurseStationCode"
|
||||
placeholder="请输入护理站编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站类型" prop="nurseStationName">
|
||||
<el-select
|
||||
v-model="queryParams.nurseStationType"
|
||||
clearable
|
||||
placeholder="请选择护理类型"
|
||||
style="width: 208px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in nurseStationTypelist"
|
||||
:key="item.nurseTypeCode"
|
||||
:label="item.nurseTypeName"
|
||||
:value="item.nurseTypeCode"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="护理站地址" prop="address">
|
||||
<el-input
|
||||
v-model="queryParams.address"
|
||||
placeholder="请输入护理站地址"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="负责人" prop="dutyPerson">
|
||||
<el-input
|
||||
v-model="queryParams.dutyPerson"
|
||||
placeholder="请输入负责人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人电话" prop="dutyPhone">
|
||||
<el-input
|
||||
v-model="queryParams.dutyPhone"
|
||||
placeholder="请输入负责人联系电话"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:station:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:station:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:station:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handledata"
|
||||
v-hasPermi="['system:station:importData']"
|
||||
>导入</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:station:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="stationList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="所属区域编码" align="center" prop="areaCode" />
|
||||
<el-table-column
|
||||
label="护理站编号"
|
||||
align="center"
|
||||
prop="nurseStationCode"
|
||||
/>
|
||||
<el-table-column
|
||||
label="护理站名称"
|
||||
align="center"
|
||||
prop="nurseStationName"
|
||||
/>
|
||||
<el-table-column label="护理类型" align="center" prop="nurseTypeName">
|
||||
<template slot-scope="scope">
|
||||
<div v-for="(item, index) in scope.row.nurseTypeList" :key="index">
|
||||
<span>
|
||||
{{ item.nurseTypeName }}
|
||||
</span>
|
||||
<span v-if="scope.row.nurseTypeList.length > 1">.</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="护理站简介"
|
||||
align="center"
|
||||
prop="agencyIntroduce"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="护理站总概述"
|
||||
align="center"
|
||||
prop="nurseStationDescription"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="护理站经度" align="center" prop="longitude" />
|
||||
<el-table-column label="护理站纬度" align="center" prop="latitude" />
|
||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||
<el-table-column label="护理站地址" align="center" prop="address" />
|
||||
<el-table-column label="负责人" align="center" prop="dutyPerson" />
|
||||
<el-table-column label="负责人电话" align="center" prop="dutyPhone" />
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:station:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:station:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="liststationinfo"
|
||||
/>
|
||||
|
||||
<!-- 新增护理站信息对话框 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
width="800px"
|
||||
append-to-body
|
||||
:before-close="cancel"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="所属区域" prop="areaCode">
|
||||
<el-select
|
||||
v-model="value"
|
||||
clearable
|
||||
placeholder="请选择省"
|
||||
style="width: 127px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in provincelist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="province(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="value1"
|
||||
clearable
|
||||
placeholder="请选择市"
|
||||
style="width: 127px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in citylist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="clickcity(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="value2"
|
||||
clearable
|
||||
placeholder="请选择区"
|
||||
style="width: 127px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in arealist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="clickarea(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="form.areaCode"
|
||||
clearable
|
||||
placeholder="请选择街道"
|
||||
style="width: 127px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in streetlist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="clickstreet(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站名称" prop="nurseStationName">
|
||||
<el-input
|
||||
v-model="form.nurseStationName"
|
||||
placeholder="请输入护理站名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站地址" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入护理站地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站经度" prop="longitude">
|
||||
<el-input v-model="form.longitude" placeholder="请输入护理站经度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站纬度" prop="latitude">
|
||||
<el-input v-model="form.latitude" placeholder="请输入护理站纬度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="护理类型" prop="nurseStationType">
|
||||
<el-select
|
||||
v-model="form.nurseStationType"
|
||||
multiple
|
||||
placeholder="请选择护理类型"
|
||||
style="width: 208px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in nurseStationTypelist"
|
||||
:key="item.nurseTypeCode"
|
||||
:label="item.nurseTypeName"
|
||||
:value="item.nurseTypeCode"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="dutyPerson">
|
||||
<el-input v-model="form.dutyPerson" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人电话" prop="dutyPhone">
|
||||
<el-input
|
||||
v-model="form.dutyPhone"
|
||||
placeholder="请输入负责人联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站总概述" prop="nurseStationDescription">
|
||||
<el-input
|
||||
style="width: 208px"
|
||||
v-model="form.nurseStationDescription"
|
||||
placeholder="请输入护理站信息总概述"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站简介" prop="agencyIntroduce">
|
||||
<editor
|
||||
style="width: 90%; margin: 0 auto"
|
||||
v-model="form.agencyIntroduce"
|
||||
></editor>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站头像" prop="stationPictureUrl">
|
||||
<stationAcatar
|
||||
:img="form.stationPictureUrl"
|
||||
:type="'stationPictureUrl'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站简介头像" prop="stationPictureUrl">
|
||||
<stationAcatar
|
||||
:img="form.stationPictureUrl"
|
||||
:type="'stationIntroducePcitureUrl'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 修改护理站信息对话框 -->
|
||||
<!-- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
:inline="true"
|
||||
>
|
||||
<el-form-item label="所属区域" prop="areaCode">
|
||||
<el-select
|
||||
v-model="value"
|
||||
clearable
|
||||
placeholder="请选择省"
|
||||
style="width: 127px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in provincelist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="province(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="value1"
|
||||
clearable
|
||||
placeholder="请选择市"
|
||||
style="width: 127px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in citylist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="clickcity(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="value2"
|
||||
clearable
|
||||
placeholder="请选择区"
|
||||
style="width: 127px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in arealist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="clickarea(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="form.areaCode"
|
||||
clearable
|
||||
placeholder="请选择街道"
|
||||
style="width: 127px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in streetlist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="clickstreet(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站名称" prop="nurseStationName">
|
||||
<el-input
|
||||
v-model="form.nurseStationName"
|
||||
placeholder="请输入护理站名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站经度" prop="longitude">
|
||||
<el-input v-model="form.longitude" placeholder="请输入护理站经度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站纬度" prop="latitude">
|
||||
<el-input v-model="form.latitude" placeholder="请输入护理站纬度" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="护理站地址" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入护理站地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="护理类型" prop="nurseStationType">
|
||||
<el-select
|
||||
v-model="form.nurseStationType"
|
||||
multiple
|
||||
placeholder="请选择护理类型"
|
||||
style="width: 208px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in nurseStationTypelist"
|
||||
:key="item.nurseTypeCode"
|
||||
:label="item.nurseTypeName"
|
||||
:value="item.nurseTypeCode"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="dutyPerson">
|
||||
<el-input v-model="form.dutyPerson" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人电话" prop="dutyPhone">
|
||||
<el-input
|
||||
v-model="form.dutyPhone"
|
||||
placeholder="请输入负责人联系电话"
|
||||
maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站总概述" prop="nurseStationDescription">
|
||||
<el-input
|
||||
style="width: 208px"
|
||||
v-model="form.nurseStationDescription"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站简介" prop="agencyIntroduce">
|
||||
<editor
|
||||
style="margin: 0 auto"
|
||||
v-model="form.agencyIntroduce"
|
||||
></editor>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站头像" prop="stationPictureUrl">
|
||||
<stationAcatar
|
||||
:img="form.stationPictureUrl"
|
||||
:type="'stationPictureUrl'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站简介头像" prop="stationPictureUrl">
|
||||
<stationAcatar
|
||||
:img="form.stationPictureUrl"
|
||||
:type="'stationIntroducePcitureUrl'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog> -->
|
||||
<!-- //导入 -->
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link
|
||||
type="primary"
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate"
|
||||
>下载模板</el-link
|
||||
>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import editor from "@/components/Editor";
|
||||
|
||||
import {
|
||||
listStation,
|
||||
getStation,
|
||||
delStation,
|
||||
addStation,
|
||||
updateStation,
|
||||
getFirstLevelInfo,
|
||||
getSecondaryLevelInfo,
|
||||
} from "@/api/system/station";
|
||||
import { getInfoList } from "@/api/system/nurseItem";
|
||||
import stationAcatar from "../stationAvatar/index.vue";
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
components: { stationAcatar, editor },
|
||||
name: "Station",
|
||||
data() {
|
||||
return {
|
||||
imageUrl: "",
|
||||
imageUrl2: "",
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url:
|
||||
process.env.VUE_APP_BASE_API +
|
||||
"/system/station/insertNurseStationImportList",
|
||||
},
|
||||
//护理类型
|
||||
nurseTypeCode: "nurse_type_code",
|
||||
nurseStationTypelist: [],
|
||||
//shengshiqu
|
||||
value3: "",
|
||||
value2: "",
|
||||
value1: "",
|
||||
value: "",
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 护理站信息表格数据
|
||||
stationList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
openadd: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
areaCode: null,
|
||||
userId: null,
|
||||
nurseStationCode: null,
|
||||
nurseStationName: null,
|
||||
nurseStationType: null,
|
||||
agencyIntroduce: null,
|
||||
nurseStationDescription: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: null,
|
||||
address: null,
|
||||
dutyPerson: null,
|
||||
dutyPhone: null,
|
||||
stationPictureUrl: null,
|
||||
sort: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
provincelist: [],
|
||||
arealist: [],
|
||||
citylist: [],
|
||||
streetlist: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
areaCode: [
|
||||
{ required: true, message: "所属区域不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleAvatarSuccess2(res, file) {
|
||||
this.imageUrl2 = URL.createObjectURL(file.raw);
|
||||
},
|
||||
handleAvatarSuccess(res, file) {
|
||||
this.imageUrl = URL.createObjectURL(file.raw);
|
||||
},
|
||||
//点击街道
|
||||
clickstreet(item) {
|
||||
this.form.areaCode = item.areaCode;
|
||||
console.log(this.form);
|
||||
},
|
||||
//点击区县城
|
||||
clickarea(item) {
|
||||
this.value3 = "";
|
||||
console.log(item);
|
||||
getSecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
this.streetlist = res.data;
|
||||
});
|
||||
},
|
||||
//点击市
|
||||
clickcity(item) {
|
||||
this.value2 = "";
|
||||
this.value3 = "";
|
||||
console.log(item);
|
||||
getSecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
this.arealist = res.data;
|
||||
});
|
||||
},
|
||||
//点击省
|
||||
province(item) {
|
||||
console.log(item);
|
||||
this.value1 = "";
|
||||
this.value2 = "";
|
||||
this.value3 = "";
|
||||
getSecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
this.citylist = res.data;
|
||||
});
|
||||
},
|
||||
/** 查询护理站信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.liststationinfo();
|
||||
|
||||
getFirstLevelInfo().then((res) => {
|
||||
this.provincelist = res.data;
|
||||
});
|
||||
getInfoList().then((res) => {
|
||||
this.nurseStationTypelist = res.data;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
// this.openadd = false;
|
||||
this.reset();
|
||||
this.value3 = "";
|
||||
this.value2 = "";
|
||||
this.value1 = "";
|
||||
this.value = "";
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
areaCode: null,
|
||||
nurseStationCode: null,
|
||||
nurseStationName: null,
|
||||
nurseStationType: null,
|
||||
agencyIntroduce: null,
|
||||
nurseStationDescription: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: null,
|
||||
address: null,
|
||||
dutyPerson: null,
|
||||
dutyPhone: null,
|
||||
stationPictureUrl: null,
|
||||
sort: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
liststationinfo() {
|
||||
listStation(this.queryParams).then((response) => {
|
||||
this.stationList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.liststationinfo();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加护理站信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getStation(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改护理站信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
console.log(this.form);
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateStation(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addStation(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm('是否确认删除护理站信息编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delStation(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"system/station/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`station_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handledata() {
|
||||
this.upload.title = "用户导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download(
|
||||
"/system/station/downloadTemplate?fileType=nurseStation",
|
||||
{},
|
||||
`护理站模板.xlsx`
|
||||
);
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{ dangerouslyUseHTMLString: true }
|
||||
);
|
||||
this.getList();
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
274
src/views/system/stationAvatar/index.vue
Normal file
274
src/views/system/stationAvatar/index.vue
Normal file
@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div>
|
||||
<div
|
||||
class="user-info-head"
|
||||
@click="editCropper()"
|
||||
style="width: 208px; height: 200px"
|
||||
>
|
||||
<img
|
||||
v-if="options.img"
|
||||
v-bind:src="options.img"
|
||||
title="点击上传头像"
|
||||
style="width: 208px; height: 200px; line-height: 200px"
|
||||
/>
|
||||
<i
|
||||
v-else
|
||||
class="el-icon-plus avatar-uploader-icon"
|
||||
style="
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
"
|
||||
></i>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="openimg"
|
||||
width="800px"
|
||||
append-to-body
|
||||
@opened="modalOpened"
|
||||
@close="closeDialog"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
|
||||
<vue-cropper
|
||||
ref="cropper"
|
||||
:img="options.img"
|
||||
:info="true"
|
||||
:autoCrop="options.autoCrop"
|
||||
:autoCropWidth="options.autoCropWidth"
|
||||
:autoCropHeight="options.autoCropHeight"
|
||||
:fixedBox="options.fixedBox"
|
||||
@realTime="realTime"
|
||||
v-if="visible"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
|
||||
<div class="avatar-upload-preview">
|
||||
<img :src="previews.url" :style="previews.img" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<br />
|
||||
<el-row>
|
||||
<el-col :lg="2" :md="2">
|
||||
<el-upload
|
||||
action="#"
|
||||
:http-request="requestUpload"
|
||||
:show-file-list="false"
|
||||
:before-upload="beforeUpload"
|
||||
>
|
||||
<el-button size="small">
|
||||
选择
|
||||
<i class="el-icon-upload el-icon--right"></i>
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</el-col>
|
||||
<el-col :lg="{ span: 1, offset: 2 }" :md="2">
|
||||
<el-button
|
||||
icon="el-icon-plus"
|
||||
size="small"
|
||||
@click="changeScale(1)"
|
||||
></el-button>
|
||||
</el-col>
|
||||
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
|
||||
<el-button
|
||||
icon="el-icon-minus"
|
||||
size="small"
|
||||
@click="changeScale(-1)"
|
||||
></el-button>
|
||||
</el-col>
|
||||
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
|
||||
<el-button
|
||||
icon="el-icon-refresh-left"
|
||||
size="small"
|
||||
@click="rotateLeft()"
|
||||
></el-button>
|
||||
</el-col>
|
||||
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
|
||||
<el-button
|
||||
icon="el-icon-refresh-right"
|
||||
size="small"
|
||||
@click="rotateRight()"
|
||||
></el-button>
|
||||
</el-col>
|
||||
<el-col :lg="{ span: 2, offset: 6 }" :md="2">
|
||||
<el-button type="primary" size="small" @click="uploadImg()"
|
||||
>提 交</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { VueCropper } from "vue-cropper";
|
||||
import baseurl from "@/api/baseurl.js";
|
||||
import { updateNurseStationHeads, posts } from "@/api/system/stationAvatar.js";
|
||||
|
||||
export default {
|
||||
components: { VueCropper },
|
||||
|
||||
props: {
|
||||
img: {
|
||||
inputName: String,
|
||||
required: true,
|
||||
},
|
||||
type: {
|
||||
inputName: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imageUrl: "",
|
||||
types: "",
|
||||
// 是否显示弹出层
|
||||
openimg: false,
|
||||
// 是否显示cropper
|
||||
visible: false,
|
||||
// 弹出层标题
|
||||
title: "上传头像",
|
||||
options: {
|
||||
img: null, //裁剪图片的地址
|
||||
autoCrop: true, // 是否默认生成截图框
|
||||
autoCropWidth: 200, // 默认生成截图框宽度
|
||||
autoCropHeight: 200, // 默认生成截图框高度
|
||||
fixedBox: true, // 固定截图框大小 不允许改变
|
||||
},
|
||||
previews: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
console.log(this.img);
|
||||
console.log(this.type);
|
||||
this.types = this.type;
|
||||
if (this.img == null) {
|
||||
console.log(1);
|
||||
this.options.img = null;
|
||||
} else if (this.img == "") {
|
||||
console.log(2);
|
||||
this.options.img = null;
|
||||
} else {
|
||||
console.log(3);
|
||||
this.options.img = baseurl + this.img;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
img: {
|
||||
handler(newimg, oldimg) {
|
||||
console.log(this.img);
|
||||
if (this.img == null) {
|
||||
console.log(1);
|
||||
this.options.img = null;
|
||||
} else if (this.img == "") {
|
||||
console.log(2);
|
||||
this.options.img = null;
|
||||
} else {
|
||||
console.log(3);
|
||||
this.options.img = baseurl + this.img;
|
||||
}
|
||||
},
|
||||
},
|
||||
type: {
|
||||
handler(newimg, oldimg) {
|
||||
this.types = this.type;
|
||||
console.log(this.types);
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 编辑头像
|
||||
editCropper() {
|
||||
this.openimg = true;
|
||||
},
|
||||
// 打开弹出层结束时的回调
|
||||
modalOpened() {
|
||||
this.visible = true;
|
||||
},
|
||||
// 覆盖默认的上传行为
|
||||
requestUpload() {},
|
||||
// 向左旋转
|
||||
rotateLeft() {
|
||||
this.$refs.cropper.rotateLeft();
|
||||
},
|
||||
// 向右旋转
|
||||
rotateRight() {
|
||||
this.$refs.cropper.rotateRight();
|
||||
},
|
||||
// 图片缩放
|
||||
changeScale(num) {
|
||||
num = num || 1;
|
||||
this.$refs.cropper.changeScale(num);
|
||||
},
|
||||
// 上传预处理
|
||||
beforeUpload(file) {
|
||||
if (file.type.indexOf("image/") == -1) {
|
||||
this.$modal.msgError(
|
||||
"文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。"
|
||||
);
|
||||
} else {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => {
|
||||
this.options.img = reader.result;
|
||||
};
|
||||
}
|
||||
},
|
||||
// 上传图片
|
||||
uploadImg() {
|
||||
// console.log(this.types);
|
||||
this.$refs.cropper.getCropBlob((data) => {
|
||||
console.log(data);
|
||||
let formData = new FormData();
|
||||
console.log(formData);
|
||||
formData.append("file", data);
|
||||
formData.append("type", this.types);
|
||||
console.log(formData);
|
||||
updateNurseStationHeads(formData).then((response) => {
|
||||
console.log(response);
|
||||
this.options.img = baseurl + response.imgUrl;
|
||||
this.openimg = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
// 实时预览
|
||||
realTime(data) {
|
||||
this.previews = data;
|
||||
},
|
||||
// 关闭窗口
|
||||
closeDialog() {
|
||||
this.imgs = "";
|
||||
this.visible = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.user-info-head {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.user-info-head:hover:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
color: #eee;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
cursor: pointer;
|
||||
line-height: 110px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
982
src/views/system/stationConsumable/index.vue
Normal file
982
src/views/system/stationConsumable/index.vue
Normal file
@ -0,0 +1,982 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="护理站名称" prop="">
|
||||
<el-select
|
||||
v-model="queryParams.nurseStationId"
|
||||
clearable
|
||||
placeholder="请选择护理站"
|
||||
v-loadmore="loadMore"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in nurseStationlist"
|
||||
:key="item.id"
|
||||
:label="item.nurseStationName"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包编号" prop="consumableCode">
|
||||
<el-input
|
||||
v-model="queryParams.consumableCode"
|
||||
placeholder="请输入耗材包编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包详情" prop="consumableDetail">
|
||||
<el-input
|
||||
v-model="queryParams.consumableDetail"
|
||||
placeholder="请输入服务项目耗材包详情"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包单位" prop="consumableUnit">
|
||||
<el-input
|
||||
v-model="queryParams.consumableUnit"
|
||||
placeholder="请输入耗材包单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包价格" prop="consumablePrice">
|
||||
<el-input
|
||||
v-model="queryParams.consumablePrice"
|
||||
placeholder="请输入耗材包价格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="sresetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:stationConsumable:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:stationConsumable:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:stationConsumable:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:stationConsumable:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handleport"
|
||||
v-hasPermi="['system:stationConsumable:importData']"
|
||||
>导入</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="stationConsumableList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="护理站名称"
|
||||
align="center"
|
||||
prop="nurseStationName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="耗材包编号"
|
||||
align="center"
|
||||
prop="consumableCode"
|
||||
/>
|
||||
<el-table-column
|
||||
label="服务项目耗材包详情"
|
||||
align="center"
|
||||
prop="consumableDetail"
|
||||
/>
|
||||
<el-table-column
|
||||
label="耗材包单位"
|
||||
align="center"
|
||||
prop="consumableUnit"
|
||||
/>
|
||||
<el-table-column
|
||||
label="耗材包价格"
|
||||
align="center"
|
||||
prop="consumablePrice"
|
||||
/>
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:stationConsumable:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:stationConsumable:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="handleQuery"
|
||||
/>
|
||||
<!-- 修改护理站耗材信息对话框 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="xgopen"
|
||||
width="500px"
|
||||
append-to-body
|
||||
:before-close="cancel"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="所属护理站" prop="nurseStationId">
|
||||
<el-button style="width: 370px; text-align: left; height: 36px">
|
||||
{{ form.nurseStationName }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包详情" prop="consumableDetail">
|
||||
<el-input
|
||||
v-model="form.consumableDetail"
|
||||
placeholder="请输入服务项目耗材包详情"
|
||||
maxlength="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包单位" prop="consumableUnit">
|
||||
<el-input
|
||||
v-model="form.consumableUnit"
|
||||
placeholder="请输入耗材包单位"
|
||||
maxlength="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包价格" prop="consumablePrice">
|
||||
<el-input
|
||||
v-model="form.consumablePrice"
|
||||
placeholder="请输入耗材包价格"
|
||||
type="number"
|
||||
min="0"
|
||||
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>10){value=value.slice(0,10)}"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input
|
||||
v-model="form.sort"
|
||||
placeholder="请输入排序"
|
||||
type="number"
|
||||
min="0"
|
||||
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+0)} if(value.length>10){value=value.slice(0,10)}"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 添加护理站耗材信息对话框 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
width="1200px"
|
||||
append-to-body
|
||||
:before-close="cancel"
|
||||
><el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
:inline="true"
|
||||
>
|
||||
<div
|
||||
v-for="(item, index) in form.nurseStationConsumables"
|
||||
:key="index"
|
||||
style="margin-top: 20px; border-bottom: 1px solid #f3f3f3"
|
||||
>
|
||||
<el-form-item
|
||||
label="所属护理站"
|
||||
:rules="rules.nurseStationConsumables.nurseStationId"
|
||||
:prop="`nurseStationConsumables.${index}.nurseStationId`"
|
||||
>
|
||||
<el-button
|
||||
style="
|
||||
width: 208px;
|
||||
text-align: left;
|
||||
height: 36px;
|
||||
color: #c0c4cc;
|
||||
"
|
||||
@click="choicenurseStation(item, index)"
|
||||
v-if="item.nurseStationName == '请选择所属护理站'"
|
||||
>
|
||||
{{ item.nurseStationName }}
|
||||
</el-button>
|
||||
<el-button
|
||||
style="width: 208px; text-align: left; height: 36px"
|
||||
@click="choicenurseStation(item, index)"
|
||||
v-else
|
||||
>
|
||||
{{ item.nurseStationName }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="耗材包详情"
|
||||
:rules="rules.nurseStationConsumables.consumableDetail"
|
||||
:prop="`nurseStationConsumables.${index}.consumableDetail`"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.consumableDetail"
|
||||
placeholder="请输入服务项目耗材包详情"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="耗材包单位"
|
||||
:rules="rules.nurseStationConsumables.consumableUnit"
|
||||
:prop="`nurseStationConsumables.${index}.consumableUnit`"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.consumableUnit"
|
||||
placeholder="请输入耗材包单位"
|
||||
maxlength="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="耗材包价格"
|
||||
:rules="rules.nurseStationConsumables.consumablePrice"
|
||||
:prop="`nurseStationConsumables.${index}.consumablePrice`"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.consumablePrice"
|
||||
placeholder="保留小数点后两位"
|
||||
type="number"
|
||||
min="0"
|
||||
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>10){value=value.slice(0,10)}"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="排序"
|
||||
:rules="rules.nurseStationConsumables.sort"
|
||||
:prop="`nurseStationConsumables.${index}.sort`"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.sort"
|
||||
placeholder="不可输入小数点"
|
||||
type="number"
|
||||
min="0"
|
||||
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+0)} if(value.length>10){value=value.slice(0,10)}"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
circle
|
||||
plain
|
||||
icon="el-icon-circle-plus-outline"
|
||||
style="margin-left: 400px"
|
||||
v-if="index == 0"
|
||||
@click="addnurseStationConsumables"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
circle
|
||||
plain
|
||||
@click="delnurseStationConsumables(index)"
|
||||
style="margin-left: 400px"
|
||||
v-if="index != 0"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="所属护理站" prop="nurseStationId">
|
||||
<el-button
|
||||
style="width: 360px; text-align: left; height: 36px; color: #c0c4cc"
|
||||
@click="open2 = true"
|
||||
v-if="nurseStationName == '请选择所属护理站'"
|
||||
>
|
||||
{{ nurseStationName }}
|
||||
</el-button>
|
||||
<el-button
|
||||
style="width: 360px; text-align: left; height: 36px"
|
||||
@click="open2 = true"
|
||||
v-else
|
||||
>
|
||||
{{ nurseStationName }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包编号" prop="consumableCode">
|
||||
<el-input
|
||||
v-model="form.consumableCode"
|
||||
placeholder="请输入耗材包编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包详情" prop="consumableDetail">
|
||||
<el-input
|
||||
v-model="form.consumableDetail"
|
||||
placeholder="请输入服务项目耗材包详情"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包单位" prop="consumableUnit">
|
||||
<el-input
|
||||
v-model="form.consumableUnit"
|
||||
placeholder="请输入耗材包单位"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材包价格" prop="consumablePrice">
|
||||
<el-input
|
||||
v-model="form.consumablePrice"
|
||||
placeholder="请输入耗材包价格"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- //选择所属护理站 -->
|
||||
<el-dialog
|
||||
width="1150px"
|
||||
title="选择所属项目"
|
||||
:visible.sync="open2"
|
||||
append-to-body
|
||||
:before-close="cancel2"
|
||||
>
|
||||
<el-form
|
||||
:model="nurseStationqueryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="护理站名称" prop="nurseStationName">
|
||||
<el-input
|
||||
style="width: 180px"
|
||||
v-model="nurseStationqueryParams.nurseStationName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery2"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="护理站编号" prop="nurseStationCode">
|
||||
<el-input
|
||||
style="width: 180px"
|
||||
v-model="nurseStationqueryParams.nurseStationCode"
|
||||
placeholder="请输入护理站编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery2"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery2"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="nurseStationlist"
|
||||
@cell-dblclick="clicknurseStation"
|
||||
>
|
||||
<el-table-column width="60" align="center" label="请选择">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
style="width: 15px; height: 15px"
|
||||
circle
|
||||
@click="clicknurseStation(scope.row)"
|
||||
v-if="
|
||||
form.nurseStationConsumables[index].nurseStationId ==
|
||||
scope.row.id
|
||||
"
|
||||
></el-button>
|
||||
|
||||
<el-button
|
||||
style="width: 15px; height: 15px"
|
||||
@click="clicknurseStation(scope.row)"
|
||||
circle
|
||||
v-else
|
||||
></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="护理站名称"
|
||||
align="center"
|
||||
prop="nurseStationName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="护理站编号"
|
||||
align="center"
|
||||
prop="nurseStationCode"
|
||||
/>
|
||||
<el-table-column label="护理站经度" align="center" prop="longitude" />
|
||||
<el-table-column label="护理站纬度" align="center" prop="latitude" />
|
||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||
<el-table-column label="护理站地址" align="center" prop="address" />
|
||||
<el-table-column label="负责人" align="center" prop="dutyPerson" />
|
||||
<el-table-column label="负责人电话" align="center" prop="dutyPhone" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total2 > 0"
|
||||
:total="total2"
|
||||
:page.sync="nurseStationqueryParams.pageNum"
|
||||
:limit.sync="nurseStationqueryParams.pageSize"
|
||||
@pagination="listinfo"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<!-- //导入 -->
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link
|
||||
type="primary"
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate"
|
||||
>下载模板</el-link
|
||||
>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listStationConsumable,
|
||||
getStationConsumable,
|
||||
delStationConsumable,
|
||||
addStationConsumable,
|
||||
updateStationConsumable,
|
||||
list,
|
||||
} from "@/api/system/stationConsumable";
|
||||
import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
name: "StationConsumable",
|
||||
data() {
|
||||
return {
|
||||
upload: {
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url:
|
||||
process.env.VUE_APP_BASE_API + "/system/stationConsumable/importData",
|
||||
},
|
||||
value: "",
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
total2: 0,
|
||||
// 护理站耗材信息表格数据
|
||||
stationConsumableList: [],
|
||||
nurseStationlist: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
open2: false,
|
||||
xgopen: false,
|
||||
index: "",
|
||||
// 查询参数
|
||||
nurseStationqueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
areaCode: null,
|
||||
userId: null,
|
||||
nurseStationCode: null,
|
||||
nurseStationName: null,
|
||||
nurseStationType: null,
|
||||
agencyIntroduce: null,
|
||||
nurseStationDescription: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: null,
|
||||
address: null,
|
||||
dutyPerson: null,
|
||||
dutyPhone: null,
|
||||
stationPictureUrl: null,
|
||||
sort: null,
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
nurseStationId: "",
|
||||
userId: null,
|
||||
consumableCode: null,
|
||||
consumableDetail: null,
|
||||
consumableUnit: null,
|
||||
consumablePrice: null,
|
||||
sort: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
consumableDetail: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入耗材包详情",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
consumableUnit: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入耗材包单位",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
consumablePrice: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入耗材包价格",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
sort: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入排序",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
nurseStationConsumables: {
|
||||
consumableDetail: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入耗材包详情",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
nurseStationId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择所属护理站",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
consumableUnit: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入耗材包单位",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
consumablePrice: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入耗材包价格",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
sort: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入排序",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.listinfo();
|
||||
},
|
||||
methods: {
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download(
|
||||
"/system/stationItem/downloadTemplate?fileType=2",
|
||||
{},
|
||||
`护理站耗材模板.xlsx`
|
||||
);
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{ dangerouslyUseHTMLString: true }
|
||||
);
|
||||
this.getList();
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
loadMore() {
|
||||
console.log("1");
|
||||
var a = Math.ceil(this.total2 / 10);
|
||||
console.log(this.nurseStationlist.length);
|
||||
if (this.nurseStationlist.length + 1 >= this.total2) {
|
||||
} else {
|
||||
if (this.nurseStationqueryParams.pageNum >= a) {
|
||||
} else {
|
||||
this.nurseStationqueryParams.pageNum++;
|
||||
list(this.nurseStationqueryParams).then((res) => {
|
||||
console.log(res);
|
||||
res.rows.forEach((e) => {
|
||||
this.nurseStationlist.push(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
delnurseStationConsumables(index) {
|
||||
this.form.nurseStationConsumables.splice(index, 1);
|
||||
console.log(this.form.nurseStationConsumables);
|
||||
},
|
||||
addnurseStationConsumables() {
|
||||
var obj = {
|
||||
nurseStationId: "",
|
||||
consumableUnit: null,
|
||||
sort: "",
|
||||
consumablePrice: "",
|
||||
consumableDetail: null,
|
||||
nurseStationName: "请选择所属护理站",
|
||||
};
|
||||
if (this.form.nurseStationConsumables.length == 5) {
|
||||
this.$message.error("最多只能5条");
|
||||
} else {
|
||||
this.form.nurseStationConsumables.push(obj);
|
||||
}
|
||||
},
|
||||
choicenurseStation(item, index) {
|
||||
console.log(item);
|
||||
this.index = index;
|
||||
this.open2 = true;
|
||||
},
|
||||
//点击护理站左侧按钮
|
||||
clicknurseStation(item) {
|
||||
console.log(item);
|
||||
console.log(this.index);
|
||||
console.log(this.form);
|
||||
this.form.nurseStationConsumables[this.index].nurseStationId = item.id;
|
||||
this.form.nurseStationConsumables[this.index].nurseStationName =
|
||||
item.nurseStationName;
|
||||
this.open2 = false;
|
||||
this.reset2();
|
||||
},
|
||||
/** 查询护理站耗材信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.listStationConsumableinfo();
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.xgopen = false;
|
||||
this.nurseStationName = "请选择所属护理站";
|
||||
this.reset();
|
||||
},
|
||||
cancel2() {
|
||||
this.open2 = false;
|
||||
this.reset2();
|
||||
list(this.nurseStationqueryParams).then((res) => {
|
||||
console.log(res);
|
||||
this.nurseStationlist = res.rows;
|
||||
this.total2 = res.total;
|
||||
});
|
||||
},
|
||||
// 表单重置
|
||||
reset2() {
|
||||
this.nurseStationqueryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
areaCode: null,
|
||||
userId: null,
|
||||
nurseStationCode: null,
|
||||
nurseStationName: null,
|
||||
nurseStationType: null,
|
||||
agencyIntroduce: null,
|
||||
nurseStationDescription: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: null,
|
||||
address: null,
|
||||
dutyPerson: null,
|
||||
dutyPhone: null,
|
||||
stationPictureUrl: null,
|
||||
sort: null,
|
||||
};
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
consumablePrice: null,
|
||||
sort: null,
|
||||
nurseStationId: "",
|
||||
nurseStationConsumables: [
|
||||
{
|
||||
nurseStationId: "",
|
||||
consumableUnit: null,
|
||||
sort: "",
|
||||
consumablePrice: "",
|
||||
consumableDetail: null,
|
||||
nurseStationName: "请选择所属护理站",
|
||||
},
|
||||
],
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
listStationConsumableinfo() {
|
||||
listStationConsumable(this.queryParams).then((response) => {
|
||||
this.stationConsumableList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.listStationConsumableinfo();
|
||||
},
|
||||
//护理站分页
|
||||
listinfo() {
|
||||
list(this.nurseStationqueryParams).then((res) => {
|
||||
console.log(res);
|
||||
this.nurseStationlist = res.rows;
|
||||
this.total2 = res.total;
|
||||
});
|
||||
},
|
||||
//护理站搜索
|
||||
handleQuery2() {
|
||||
console.log(this.nurseStationqueryParams);
|
||||
this.nurseStationqueryParams.pageNum = 1;
|
||||
this.listinfo();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
sresetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
nurseStationId: "",
|
||||
userId: null,
|
||||
consumableCode: null,
|
||||
consumableDetail: null,
|
||||
consumableUnit: null,
|
||||
consumablePrice: null,
|
||||
sort: null,
|
||||
};
|
||||
this.handleQuery();
|
||||
},
|
||||
//护理站重置
|
||||
resetQuery() {
|
||||
this.reset2();
|
||||
this.handleQuery2();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加护理站耗材信息";
|
||||
this.cancel2();
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getStationConsumable(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.xgopen = true;
|
||||
this.title = "修改护理站耗材信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
console.log(this.form);
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateStationConsumable(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.xgopen = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addStationConsumable(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.nurseStationName = "请选择所属护理站";
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm("是否确认删除?")
|
||||
.then(function () {
|
||||
return delStationConsumable(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"system/stationConsumable/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`stationConsumable_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleport() {
|
||||
this.upload.title = "用户导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--部门数据-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<!-- <el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="deptName"
|
||||
@ -25,10 +25,17 @@
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<!--用户数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-col :span="24" :xs="24">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
@ -74,8 +81,16 @@
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@ -88,7 +103,8 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:user:add']"
|
||||
>新增</el-button>
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -99,7 +115,8 @@
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>修改</el-button>
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -110,9 +127,10 @@
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:user:remove']"
|
||||
>删除</el-button>
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
@ -131,18 +149,58 @@
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:user:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-col> -->
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
:columns="columns"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="userList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
||||
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
||||
<el-table-column
|
||||
label="用户编号"
|
||||
align="center"
|
||||
key="userId"
|
||||
prop="userId"
|
||||
v-if="columns[0].visible"
|
||||
/>
|
||||
<el-table-column
|
||||
label="用户名称"
|
||||
align="center"
|
||||
key="userName"
|
||||
prop="userName"
|
||||
v-if="columns[1].visible"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="用户昵称"
|
||||
align="center"
|
||||
key="nickName"
|
||||
prop="nickName"
|
||||
v-if="columns[2].visible"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<!-- <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> -->
|
||||
<el-table-column
|
||||
label="手机号码"
|
||||
align="center"
|
||||
key="phonenumber"
|
||||
prop="phonenumber"
|
||||
v-if="columns[4].visible"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
key="status"
|
||||
v-if="columns[5].visible"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
@ -152,7 +210,13 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
v-if="columns[6].visible"
|
||||
width="160"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
@ -170,23 +234,37 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>修改</el-button>
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:user:remove']"
|
||||
>删除</el-button>
|
||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
|
||||
>删除</el-button
|
||||
>
|
||||
<el-dropdown
|
||||
size="mini"
|
||||
@command="(command) => handleCommand(command, scope.row)"
|
||||
v-hasPermi="['system:user:resetPwd', 'system:user:edit']"
|
||||
>
|
||||
<span class="el-dropdown-link">
|
||||
<i class="el-icon-d-arrow-right el-icon--right"></i>更多
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
|
||||
v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
|
||||
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check"
|
||||
v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="handleResetPwd"
|
||||
icon="el-icon-key"
|
||||
v-hasPermi="['system:user:resetPwd']"
|
||||
>重置密码</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
command="handleAuthRole"
|
||||
icon="el-icon-circle-check"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>分配角色</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
@ -194,7 +272,7 @@
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@ -209,40 +287,13 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
|
||||
<el-input
|
||||
v-model="form.nickName"
|
||||
placeholder="请输入用户昵称"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-select v-model="form.sex" placeholder="请选择性别">
|
||||
@ -255,6 +306,81 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input
|
||||
v-model="form.phonenumber"
|
||||
placeholder="请输入手机号码"
|
||||
maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input
|
||||
v-model="form.email"
|
||||
placeholder="请输入邮箱"
|
||||
maxlength="50"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
v-if="form.userId == undefined"
|
||||
label="用户名称"
|
||||
prop="userName"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.userName"
|
||||
placeholder="请输入用户名称"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
v-if="form.userId == undefined"
|
||||
label="用户密码"
|
||||
prop="password"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.password"
|
||||
placeholder="请输入用户密码"
|
||||
type="password"
|
||||
maxlength="20"
|
||||
show-password
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="护理站">
|
||||
<el-select
|
||||
v-model="form.nurseStationIds"
|
||||
multiple
|
||||
placeholder="请选择护理站"
|
||||
v-loadmore="loadMore"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in nurseStationlist"
|
||||
:key="item.id"
|
||||
:label="item.nurseStationName"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
@ -262,13 +388,14 @@
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="岗位">
|
||||
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
|
||||
<el-option
|
||||
@ -280,10 +407,14 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色">
|
||||
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
|
||||
<el-select
|
||||
v-model="form.roleIds"
|
||||
multiple
|
||||
placeholder="请选择角色"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in roleOptions"
|
||||
:key="item.roleId"
|
||||
@ -298,7 +429,11 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -310,7 +445,12 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
@ -327,10 +467,17 @@
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
||||
<el-checkbox v-model="upload.updateSupport" />
|
||||
是否更新已经存在的用户数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
<el-link
|
||||
type="primary"
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate"
|
||||
>下载模板</el-link
|
||||
>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -342,15 +489,23 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
||||
import {
|
||||
listUser,
|
||||
getUser,
|
||||
delUser,
|
||||
addUser,
|
||||
updateUser,
|
||||
resetUserPwd,
|
||||
changeUserStatus,
|
||||
} from "@/api/system/user";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { treeselect } from "@/api/system/dept";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
import { list } from "@/api/system/stationConsumable";
|
||||
export default {
|
||||
name: "User",
|
||||
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
||||
dicts: ["sys_normal_disable", "sys_user_sex"],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
@ -366,6 +521,8 @@ export default {
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
total2: 0,
|
||||
nurseStationlist: [],
|
||||
// 用户表格数据
|
||||
userList: null,
|
||||
// 弹出层标题
|
||||
@ -388,7 +545,7 @@ export default {
|
||||
form: {},
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "label"
|
||||
label: "label",
|
||||
},
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
@ -403,7 +560,7 @@ export default {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/system/user/importData"
|
||||
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
@ -412,7 +569,27 @@ export default {
|
||||
userName: undefined,
|
||||
phonenumber: undefined,
|
||||
status: undefined,
|
||||
deptId: undefined
|
||||
deptId: undefined,
|
||||
},
|
||||
// 查询参数
|
||||
nurseStationqueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 50,
|
||||
areaCode: null,
|
||||
userId: null,
|
||||
nurseStationCode: null,
|
||||
nurseStationName: null,
|
||||
nurseStationType: null,
|
||||
agencyIntroduce: null,
|
||||
nurseStationDescription: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: null,
|
||||
address: null,
|
||||
dutyPerson: null,
|
||||
dutyPhone: null,
|
||||
stationPictureUrl: null,
|
||||
sort: null,
|
||||
},
|
||||
// 列信息
|
||||
columns: [
|
||||
@ -422,56 +599,92 @@ export default {
|
||||
{ key: 3, label: `部门`, visible: true },
|
||||
{ key: 4, label: `手机号码`, visible: true },
|
||||
{ key: 5, label: `状态`, visible: true },
|
||||
{ key: 6, label: `创建时间`, visible: true }
|
||||
{ key: 6, label: `创建时间`, visible: true },
|
||||
],
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||
{
|
||||
min: 2,
|
||||
max: 20,
|
||||
message: "用户名称长度必须介于 2 和 20 之间",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
nickName: [
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
||||
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
|
||||
{
|
||||
min: 5,
|
||||
max: 20,
|
||||
message: "用户密码长度必须介于 5 和 20 之间",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
email: [
|
||||
{
|
||||
type: "email",
|
||||
message: "请输入正确的邮箱地址",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
phonenumber: [
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据名称筛选部门树
|
||||
deptName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getTreeselect();
|
||||
this.getConfigKey("sys.user.initPassword").then(response => {
|
||||
this.listinfo();
|
||||
this.getConfigKey("sys.user.initPassword").then((response) => {
|
||||
this.initPassword = response.msg;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
listinfo() {
|
||||
list(this.nurseStationqueryParams).then((res) => {
|
||||
console.log(res);
|
||||
this.nurseStationlist = res.rows;
|
||||
this.total2 = res.total;
|
||||
});
|
||||
},
|
||||
loadMore() {
|
||||
var a = Math.ceil(this.total2 / 10);
|
||||
console.log(this.nurseStationlist.length);
|
||||
if (this.nurseStationlist.length + 1 >= this.total2) {
|
||||
} else {
|
||||
if (this.nurseStationqueryParams.pageNum >= a) {
|
||||
} else {
|
||||
this.nurseStationqueryParams.pageNum++;
|
||||
list(this.nurseStationqueryParams).then((res) => {
|
||||
console.log(res);
|
||||
res.rows.forEach((e) => {
|
||||
this.nurseStationlist.push(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
|
||||
(response) => {
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -480,7 +693,7 @@ export default {
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
treeselect().then(response => {
|
||||
treeselect().then((response) => {
|
||||
this.deptOptions = response.data;
|
||||
});
|
||||
},
|
||||
@ -497,13 +710,17 @@ export default {
|
||||
// 用户状态修改
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === "0" ? "启用" : "停用";
|
||||
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
|
||||
return changeUserStatus(row.userId, row.status);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
}).catch(function() {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
this.$modal
|
||||
.confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
|
||||
.then(function () {
|
||||
return changeUserStatus(row.userId, row.status);
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
})
|
||||
.catch(function () {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
@ -524,7 +741,7 @@ export default {
|
||||
status: "0",
|
||||
remark: undefined,
|
||||
postIds: [],
|
||||
roleIds: []
|
||||
roleIds: [],
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -541,7 +758,7 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.userId);
|
||||
this.ids = selection.map((item) => item.userId);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
@ -562,7 +779,7 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
getUser().then(response => {
|
||||
getUser().then((response) => {
|
||||
this.postOptions = response.posts;
|
||||
this.roleOptions = response.roles;
|
||||
this.open = true;
|
||||
@ -575,8 +792,21 @@ export default {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
const userId = row.userId || this.ids;
|
||||
getUser(userId).then(response => {
|
||||
getUser(userId).then((response) => {
|
||||
this.form = response.data;
|
||||
if (
|
||||
!this.form.nurseStationIds ||
|
||||
this.form.nurseStationIds == null ||
|
||||
this.form.nurseStationIds.length == 0
|
||||
) {
|
||||
} else {
|
||||
this.form.nurseStationIds = this.form.nurseStationIds.split(",");
|
||||
this.form.nurseStationIds = this.form.nurseStationIds.map((e) => {
|
||||
return (e = Number(e));
|
||||
});
|
||||
}
|
||||
|
||||
console.log(this.form);
|
||||
this.postOptions = response.posts;
|
||||
this.roleOptions = response.roles;
|
||||
this.form.postIds = response.postIds;
|
||||
@ -593,30 +823,34 @@ export default {
|
||||
cancelButtonText: "取消",
|
||||
closeOnClickModal: false,
|
||||
inputPattern: /^.{5,20}$/,
|
||||
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间"
|
||||
}).then(({ value }) => {
|
||||
resetUserPwd(row.userId, value).then(response => {
|
||||
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
|
||||
})
|
||||
.then(({ value }) => {
|
||||
resetUserPwd(row.userId, value).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
});
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 分配角色操作 */
|
||||
handleAuthRole: function(row) {
|
||||
handleAuthRole: function (row) {
|
||||
const userId = row.userId;
|
||||
this.$router.push("/system/user-auth/role/" + userId);
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
submitForm: function () {
|
||||
console.log(this.form);
|
||||
this.form.nurseStationIds = this.form.nurseStationIds.join(",");
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.userId != undefined) {
|
||||
updateUser(this.form).then(response => {
|
||||
updateUser(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addUser(this.form).then(response => {
|
||||
addUser(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@ -628,18 +862,26 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const userIds = row.userId || this.ids;
|
||||
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
|
||||
return delUser(userIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal
|
||||
.confirm("是否确认删除此用户?")
|
||||
.then(function () {
|
||||
return delUser(userIds);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/user/export', {
|
||||
...this.queryParams
|
||||
}, `user_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
"system/user/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`user_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
@ -648,8 +890,11 @@ export default {
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('system/user/importTemplate', {
|
||||
}, `user_template_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
"system/user/importTemplate",
|
||||
{},
|
||||
`user_template_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
@ -660,13 +905,19 @@ export default {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.$alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{ dangerouslyUseHTMLString: true }
|
||||
);
|
||||
this.getList();
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user