Browse Source

前台患者档案添加导入功能,后台字典表添加导入功能

master^2
1747191978@qq.com 1 month ago
parent
commit
1079b4fa4c
  1. 4
      acupuncture-前台/src/views/patientFile/index.vue
  2. BIN
      acupuncture-前台/南宁针灸体重同步添加参数.zip
  3. 266
      acupuncture-后台/src/views/system/dict/index.vue

4
acupuncture-前台/src/views/patientFile/index.vue

@ -90,7 +90,7 @@
>删除</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-col :span="1.5">
<el-button
type="info"
plain
@ -109,7 +109,7 @@
@click="handleImport"
>导入</el-button
>
</el-col> -->
</el-col>
<el-col :span="1.5">
<el-button
type="warning"

BIN
acupuncture-前台/南宁针灸体重同步添加参数.zip

Binary file not shown.

266
acupuncture-后台/src/views/system/dict/index.vue

@ -1,6 +1,13 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="字典名称" prop="dictName">
<el-input
v-model="queryParams.dictName"
@ -46,8 +53,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>
@ -60,7 +75,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -71,7 +87,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -82,7 +99,18 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -92,8 +120,10 @@
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
@ -102,34 +132,71 @@
size="mini"
@click="handleRefreshCache"
v-hasPermi="['system:dict:remove']"
>刷新缓存</el-button>
>刷新缓存</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="字典编号" align="center" prop="dictId" />
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
<el-table-column
label="字典名称"
align="center"
prop="dictName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="字典类型"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
<router-link
:to="'/system/dict-data/index/' + scope.row.dictId"
class="link-type"
>
<span>{{ scope.row.dictType }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
<dict-tag
:options="dict.type.sys_normal_disable"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<el-table-column
label="备注"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
@ -137,20 +204,22 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@ -172,11 +241,16 @@
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-form-item label="备注" prop="remark">
<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-form>
<div slot="footer" class="dialog-footer">
@ -184,15 +258,52 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入患者信息 -->
<el-dialog
title="导入字典表"
:visible.sync="importOpen"
width="640px"
append-to-body
>
<el-form ref="importform" :model="importform">
<el-form-item prop="accessUrl">
<el-upload
:limit="1"
class="avatar-uploader wj-uploader"
:headers="headers"
:action="uploadFileUrl1"
accept=".xlsx, .xls"
:before-upload="handleBeforePdfUpload1"
:on-success="handleUploadPdfAdd1"
:file-list="fileList"
:show-file-list="true"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
</el-upload>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { getToken } from "@/utils/auth";
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from "@/api/system/dict/type";
export default {
name: "Dict",
dicts: ['sys_normal_disable'],
dicts: ["sys_normal_disable"],
data() {
return {
//
@ -221,29 +332,72 @@ export default {
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
status: undefined,
},
//
form: {},
importform: {},
importOpen: false, //
//
rules: {
dictName: [
{ required: true, message: "字典名称不能为空", trigger: "blur" }
{ required: true, message: "字典名称不能为空", trigger: "blur" },
],
dictType: [
{ required: true, message: "字典类型不能为空", trigger: "blur" }
]
}
{ required: true, message: "字典类型不能为空", trigger: "blur" },
],
},
headers: {
Authorization: "Bearer " + getToken(),
deptId: localStorage.getItem("hospitalId"),
},
uploadFileUrl1:
process.env.VUE_APP_API_QZURL + "/system/dict/type/importData", //
fileList: [],
};
},
created() {
this.getList();
},
methods: {
// - pdg
handleUploadPdfAdd1(res) {
if (res.code == 200) {
this.importOpen = false;
this.getList();
this.$modal.msgSuccess("导入成功");
} else {
this.$message.error(res.msg || "导入失败");
this.fileList = [];
}
},
// -
handleBeforeUpload1(file) {
const isLt2M = file.size / 1024 / 1024 < 100;
//
if (!isLt2M) {
this.$message.error("上传文件大小不能超过 100MB!");
}
return isLt2M;
},
// -
handleBeforePdfUpload1(file) {
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
const whiteList = ["xlsx", "xls"];
if (whiteList.indexOf(fileSuffix) === -1) {
this.$message.error("上传文件只能是.xlsx, .xls");
return false;
}
},
/** 导入按钮操作 */ handleImport() {
this.fileList = [];
this.importOpen = true;
},
/** 查询字典类型列表 */
getList() {
this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
listType(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
@ -262,7 +416,7 @@ export default {
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined
remark: undefined,
};
this.resetForm("form");
},
@ -285,32 +439,32 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictId)
this.single = selection.length!=1
this.multiple = !selection.length
this.ids = selection.map((item) => item.dictId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const dictId = row.dictId || this.ids
getType(dictId).then(response => {
const dictId = row.dictId || this.ids;
getType(dictId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改字典类型";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then(response => {
updateType(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addType(this.form).then(response => {
addType(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -322,26 +476,34 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.$modal
.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
.then(function () {
return delType(dictIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/dict/type/export', {
...this.queryParams
}, `type_${new Date().getTime()}.xlsx`)
this.download(
"system/dict/type/export",
{
...this.queryParams,
},
`type_${new Date().getTime()}.xlsx`
);
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
this.$store.dispatch('dict/cleanDict');
this.$store.dispatch("dict/cleanDict");
});
}
}
},
},
};
</script>
Loading…
Cancel
Save