diff --git a/acupuncture-前台/src/App.vue b/acupuncture-前台/src/App.vue index 8e3e4cd8..0fa2ca13 100644 --- a/acupuncture-前台/src/App.vue +++ b/acupuncture-前台/src/App.vue @@ -2,15 +2,130 @@ <div id="app"> <router-view /> <theme-picker /> + <el-dialog + :close-on-click-modal="false" + :close-on-press-escape="false" + title="修改密码" + :visible.sync="passShow" + width="620px" + append-to-body + class="popup" + :show-close="false" + > + <el-form ref="form" :model="user" :rules="rules" label-width="80px"> + <el-form-item label="旧密码" prop="oldPassword"> + <el-input + v-model="user.oldPassword" + placeholder="请输入旧密码" + type="password" + show-password + /> + </el-form-item> + <el-form-item label="新密码" prop="newPassword"> + <el-input + v-model="user.newPassword" + placeholder="请输入新密码" + type="password" + show-password + /> + </el-form-item> + <el-form-item label="确认密码" prop="confirmPassword"> + <el-input + v-model="user.confirmPassword" + placeholder="请确认新密码" + type="password" + show-password + /> + </el-form-item> + <el-form-item label=" " style="margin-bottom: 0px"> + <template slot-scope="scope"> + <el-button type="primary" @click="submit" size="mini" + >确 定</el-button + > + </template> + </el-form-item> + </el-form> + </el-dialog> </div> </template> <script> +import { updateUserPwd } from "@/api/system/user"; import ThemePicker from "@/components/ThemePicker"; - +import { mapState, mapMutations } from "vuex"; export default { name: "App", components: { ThemePicker }, + data() { + const equalToPassword = (rule, value, callback) => { + if (this.user.newPassword !== value) { + callback(new Error("两次输入的密码不一致")); + } else { + callback(); + } + }; + return { + passShow: false, + user: { + oldPassword: undefined, + newPassword: undefined, + confirmPassword: undefined, + }, + rules: { + oldPassword: [ + { required: true, message: "旧密码不能为空", trigger: "blur" }, + ], + newPassword: [ + { required: true, message: "密码不能为空", trigger: "blur" }, + { + pattern: /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^\da-zA-Z\s]).{8,20}$/, + message: "必须包含数字、字母、特殊字符, 长度为8到20位", + trigger: "blur", + }, + ], + confirmPassword: [ + { required: true, message: "确认密码不能为空", trigger: "blur" }, + { required: true, validator: equalToPassword, trigger: "blur" }, + ], + }, + userInfo: {}, + }; + }, + computed: { + ...mapState({ + forceUpdPwdFlag: (state) => state.user.forceUpdPwdFlag, + }), + }, + watch: { + // 监听store中forceUpdPwdFlag的变化 + forceUpdPwdFlag(new1, old) { + if (new1) { + this.passShow = true; + } + }, + }, + + created() {}, + methods: { + submit() { + this.$refs["form"].validate(async (valid) => { + if (valid) { + const res = await updateUserPwd( + this.user.oldPassword, + this.user.newPassword + ); + const { code, msg } = res; + if (code === 200) { + this.passShow = false; + this.$message.success("修改成功"); + // const res = await getInfo(); + } else { + this.$message.warning(msg); + } + } + }); + }, + }, metaInfo() { return { title: diff --git a/acupuncture-前台/src/api/medicalFile.js b/acupuncture-前台/src/api/medicalFile.js index 860d27fc..4e8b27bd 100644 --- a/acupuncture-前台/src/api/medicalFile.js +++ b/acupuncture-前台/src/api/medicalFile.js @@ -32,6 +32,21 @@ export function treatmentDel(data) { data: data, }); } +// 查询上报管理 +export function managerMy(data) { + return request({ + url: "/report/queryManagerMy", + method: "post", + data: data, + }); +} +export function reportList(data) { + return request({ + url: "/report/list", + method: "post", + data: data, + }); +} // 档案详情 export function queryRecord(data) { return request({ diff --git a/acupuncture-前台/src/store/getters.js b/acupuncture-前台/src/store/getters.js index 8adb1b65..dacf3b92 100644 --- a/acupuncture-前台/src/store/getters.js +++ b/acupuncture-前台/src/store/getters.js @@ -15,5 +15,6 @@ const getters = { topbarRouters:state => state.permission.topbarRouters, defaultRoutes:state => state.permission.defaultRoutes, sidebarRouters:state => state.permission.sidebarRouters, + forceUpdPwdFlag: state => state.user.forceUpdPwdFlag, } export default getters diff --git a/acupuncture-前台/src/store/modules/user.js b/acupuncture-前台/src/store/modules/user.js index 15969d6a..b1d488c2 100644 --- a/acupuncture-前台/src/store/modules/user.js +++ b/acupuncture-前台/src/store/modules/user.js @@ -1,107 +1,121 @@ -import { login, logout, getInfo } from '@/api/login' -import { getToken, setToken, removeToken } from '@/utils/auth' -import { isHttp, isEmpty } from "@/utils/validate" -import defAva from '@/assets/images/profile.jpg' +import { login, logout, getInfo } from "@/api/login"; +import { getToken, setToken, removeToken } from "@/utils/auth"; +import { isHttp, isEmpty } from "@/utils/validate"; +import defAva from "@/assets/images/profile.jpg"; const user = { state: { token: getToken(), - id: '', - name: '', - avatar: '', + id: "", + name: "", + avatar: "", roles: [], - permissions: [] + permissions: [], + forceUpdPwdFlag: 0, }, mutations: { SET_TOKEN: (state, token) => { - state.token = token + state.token = token; }, SET_ID: (state, id) => { - state.id = id + state.id = id; }, SET_NAME: (state, name) => { - state.name = name + state.name = name; }, SET_AVATAR: (state, avatar) => { - state.avatar = avatar + state.avatar = avatar; }, SET_ROLES: (state, roles) => { - state.roles = roles + state.roles = roles; }, SET_PERMISSIONS: (state, permissions) => { - state.permissions = permissions - } + state.permissions = permissions; + }, + SET_PWDFLAG: (state, data) => { + state.forceUpdPwdFlag = data; + }, }, actions: { // 登录 Login({ commit }, userInfo) { - const username = userInfo.username.trim() - const password = userInfo.password - const code = userInfo.code - const uuid = userInfo.uuid + const username = userInfo.username.trim(); + const password = userInfo.password; + const code = userInfo.code; + const uuid = userInfo.uuid; return new Promise((resolve, reject) => { - login(username, password, code, uuid).then(res => { - setToken(res.token) - commit('SET_TOKEN', res.token) - resolve() - }).catch(error => { - reject(error) - }) - }) + login(username, password, code, uuid) + .then((res) => { + setToken(res.token); + commit("SET_TOKEN", res.token); + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); }, // 获取用户信息 GetInfo({ commit, state }) { return new Promise((resolve, reject) => { - getInfo().then(res => { - const user = res.user - localStorage.setItem("user", JSON.stringify(user)) - let avatar = user.avatar || "" - if (!isHttp(avatar)) { - avatar = (isEmpty(avatar)) ? defAva : process.env.VUE_APP_BASE_API + avatar - } - if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 - commit('SET_ROLES', res.roles) - commit('SET_PERMISSIONS', res.permissions) - } else { - commit('SET_ROLES', ['ROLE_DEFAULT']) - } - commit('SET_ID', user.userId) - commit('SET_NAME', user.userName) - commit('SET_AVATAR', avatar) - resolve(res) - }).catch(error => { - reject(error) - }) - }) + getInfo() + .then((res) => { + const user = res.user; + commit("SET_PWDFLAG", res.forceUpdPwdFlag); + localStorage.setItem("user", JSON.stringify(user)); + let avatar = user.avatar || ""; + if (!isHttp(avatar)) { + avatar = isEmpty(avatar) + ? defAva + : process.env.VUE_APP_BASE_API + avatar; + } + if (res.roles && res.roles.length > 0) { + // 验证返回的roles是否是一个非空数组 + commit("SET_ROLES", res.roles); + commit("SET_PERMISSIONS", res.permissions); + } else { + commit("SET_ROLES", ["ROLE_DEFAULT"]); + } + commit("SET_ID", user.userId); + commit("SET_NAME", user.userName); + commit("SET_AVATAR", avatar); + resolve(res); + }) + .catch((error) => { + reject(error); + }); + }); }, // 退出系统 LogOut({ commit, state }) { return new Promise((resolve, reject) => { - logout(state.token).then(() => { - commit('SET_TOKEN', '') - commit('SET_ROLES', []) - commit('SET_PERMISSIONS', []) - removeToken() - resolve() - }).catch(error => { - reject(error) - }) - }) + logout(state.token) + .then(() => { + commit("SET_TOKEN", ""); + commit("SET_ROLES", []); + commit("SET_PERMISSIONS", []); + removeToken(); + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); }, // 前端 登出 FedLogOut({ commit }) { - return new Promise(resolve => { - commit('SET_TOKEN', '') - removeToken() - resolve() - }) - } - } -} + return new Promise((resolve) => { + commit("SET_TOKEN", ""); + removeToken(); + resolve(); + }); + }, + }, +}; -export default user +export default user; diff --git a/acupuncture-前台/src/views/medicalFile/index.vue b/acupuncture-前台/src/views/medicalFile/index.vue index dbd6c130..1eff6364 100644 --- a/acupuncture-前台/src/views/medicalFile/index.vue +++ b/acupuncture-前台/src/views/medicalFile/index.vue @@ -6,7 +6,6 @@ size="small" :inline="true" v-show="showSearch" - label-width="80px" > <el-form-item label="" prop="noticeTitle"> <el-input @@ -48,14 +47,6 @@ <el-option label="女" :value="1" /> </el-select> </el-form-item> - <!-- <el-form-item label="手机号码" prop="phone"> - <el-input v-model="queryParams.param.phone" placeholder="请输入" clearable - @keyup.enter.native="handleQuery" /> - </el-form-item> - <el-form-item label="证件号码" prop="idCard"> - <el-input v-model="queryParams.param.idCard" placeholder="请输入" clearable - @keyup.enter.native="handleQuery" /> - </el-form-item> --> <el-form-item label="年龄范围" prop="createBy"> <div class="form-item-age"> <el-input @@ -93,6 +84,49 @@ <el-option label="驳回" :value="3" /> </el-select> </el-form-item> + <el-form-item label="诊疗日期" prop="time"> + <el-date-picker + v-model="time" + type="daterange" + value-format="yyyy-MM-dd" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期" + > + </el-date-picker> + </el-form-item> + <!-- <el-form-item label="上报标题" prop="managementId"> + <el-select + v-model="queryParams.param.managementId" + placeholder="请选择" + filterable + clearable + > + <el-option + v-for="item in managerList" + :key="item.id" + :label="item.reportTitle" + :value="item.id" + > + </el-option> + </el-select> + </el-form-item> --> + <el-form-item label="填报类型" prop="reportTypeId"> + <el-select + v-model="queryParams.param.reportTypeId" + placeholder="请选择" + filterable + clearable + > + <el-option + v-for="item in reporTypeList" + :key="item.id" + :label="item.typeName" + :value="item.id" + > + </el-option> + </el-select> + </el-form-item> <el-form-item> <el-button type="primary" @@ -116,7 +150,7 @@ icon="el-icon-plus" size="mini" @click="handleAdd" - >新增</el-button + >新增病历直报</el-button > </el-col> <el-col :span="1.5"> @@ -318,6 +352,18 @@ show-overflow-tooltip min-width="180" /> + <el-table-column + label="诊疗日期" + align="center" + show-overflow-tooltip + min-width="140" + > + <template slot-scope="scope"> + <span> + {{ parseTime(scope.row.visitTime, "{y}-{m}-{d}") }} + </span> + </template> + </el-table-column> <el-table-column label="门诊时间/住院时间" align="center" @@ -343,7 +389,14 @@ </span> </template> </el-table-column> - + <el-table-column + label="上报标题" + align="center" + prop="reportTitle" + show-overflow-tooltip + min-width="150" + > + </el-table-column> <el-table-column label="建档人" align="center" @@ -471,9 +524,20 @@ ref="form" :model="form" :rules="rules" - label-width="140px" + label-width="100px" class="formStep" > + <el-form-item label="上报标题" prop="managementId"> + <el-select v-model="form.managementId" placeholder="请选择"> + <el-option + v-for="item in managerList" + :key="item.id" + :label="item.reportTitle" + :value="item.id" + > + </el-option> + </el-select> + </el-form-item> <el-form-item label="姓名" prop="name"> <el-input v-model="form.name" placeholder="请输入" /> </el-form-item> @@ -578,18 +642,6 @@ <el-form-item label="责任医生" prop=""> <el-input v-model="form.doctor" placeholder="请输入" /> </el-form-item> - - <!-- <el-form-item label="随访队列" prop="queueIdList"> - <el-select v-model="form.queueIdList" multiple placeholder="请选择"> - <el-option - v-for="item in followupList" - :key="item.id" - :label="item.name" - :value="item.id" - > - </el-option> - </el-select> - </el-form-item> --> </el-form> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitForm">确 定</el-button> @@ -644,6 +696,8 @@ import { saveAidRecord, queueAdd, exportTreatmentPg, + managerMy, + reportList, } from "@/api/medicalFile"; import { getToken } from "@/utils/auth"; import { followupQuery } from "@/api/followupFile"; @@ -652,8 +706,9 @@ export default { dicts: ["sys_normal_disable", "sys_user_sex"], data() { return { + time: [], reportPath: "", - + managerList: [], // 我的上报 timestamp: "", qzUrl: process.env.VUE_APP_API_QZURL, // 二维码路径 userInfo: {}, @@ -830,52 +885,6 @@ export default { importform: {}, form: {}, - detailsForm: { - JBXX_ZYZD: [], //主要诊断 - JBXX_ZYZD_QT: "", //主要诊断_其他 - PG_RTCF_TZ: "", //体重 - PG_RTCF_QZTZ: "", //去脂体重 - PG_RTCF_JRL: "", //肌肉量 - PG_RTCF_TBW: "", //总水分(TBW) - PG_RTCF_DBZ: "", //蛋白质 - PG_RTCF_GZ: "", //骨质量(GZ) - G_RTCF_ZF: "", //脂肪 - PG_RTCF_PBF: "", //体脂百分比 - PG_RTCF_GGJ: "", //骨骼肌 - PG_RTCF_BMI: "", //体质指数(BMI) - PG_RTCF_WHR: "", //腰臀比(WHR) - PG_RTCF_NZZFSP: "", //内脏脂肪水平 - PG_RTCF_STGCFBFB: "", //身体成分脂肪百分比 - PG_RTCF_TXLX: "", //体型类型 - PG_RTCF_STNL: "", //身体年龄 - PG_RTCF_JKPF: "", //健康评分 - PG_TZBS_ZYTZ: "", //主要体质 - PG_TZBS_JJTZ: [], //兼夹体质 - PG_TT_TAPS_DF: "", //体型评分(TAPS)得分 - PG_TT_TRACE_DF: "", //体型评分(TRACE)得分 - PG_TT_SRS22_DF: "", //体型评分(SRS-22)得分 - "PG_SM_PHQ-9_DF": "", // 患者健康问卷(PHQ-9)评估得分 - PG_SM_EPSW_DF: "", //Epworth嗜睡评估得分 - PG_SM_PSQI_DF: "", //匹兹堡睡眠质量指数(PSQI)评估得分 - "PG_JL_HAMD-24_DF": "", //汉密尔顿抑郁评估(HAMD-24)得分 - PG_JL_SAS_DF: "", //焦虑自评量表(SAS)得分 - ZLFA_ZLLX: "", //治疗方式 - ZLFA_XWXLGY: "", // 行为心理干预 - ZLFA_YDGY: "", //运动干预 - ZLFA_ZJ_LF: "", //针灸疗法-疗法 - ZLFA_ZJ_XW: "", //针灸疗法-穴位 - ZLFA_YW: "", //药物治疗 - ZLFA_SHXG: "", // 生活习惯 - ZLFA_XLTS: "", //心理调适 - - ZLFA_LCYYZL: "", //临床用药治疗 - ZLFA_ZJ_LF_SMZ: "", // 失眠症-针灸疗法-疗法 - ZLFA_ZJ_XW_SMZ: "", // 失眠症-针灸疗法-穴位 - ZLFA_YW_SMZ: "", // 失眠症-药物治疗 - ZLFA_ZJ_LF_QT: "", // 其他-针灸疗法-疗法 - ZLFA_ZJ_XW_QT: "", // 其他-针灸疗法-穴位 - ZLFA_YW_QT: "", // 其他-药物治疗 - }, // 档案详情表单 // 表单校验 rules: { name: [ @@ -970,6 +979,7 @@ export default { }, ], }, + reporTypeList: [], }; }, created() { @@ -992,10 +1002,29 @@ export default { this.open = true; } this.getList(); + this.getManagerMy(); + this.getReportType(); this.userInfo = JSON.parse(localStorage.getItem("user")); // this.getFollowupQuery(); }, methods: { + // 获取上报类型 + getReportType() { + reportList({ + pageNum: -1, + param: {}, + }).then((res) => { + this.reporTypeList = res.data.list; + }); + }, + getManagerMy() { + managerMy({ + pageNum: -1, + param: {}, + }).then((res) => { + this.managerList = res.data.list; + }); + }, // 获取随访队列信息 getFollowupQuery() { followupQuery({ @@ -1049,8 +1078,8 @@ export default { getList() { this.loading = true; treatmentQuery(this.queryParams).then((res) => { - this.listDat = res.data.list; - this.total = res.data.total; + this.listDat = res.data.list || []; + this.total = res.data.total || 0; this.loading = false; }); }, @@ -1077,12 +1106,21 @@ export default { doctor: "", status: 0, queueIdList: [], + managementId: "", }; this.resetForm("form"); }, /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageNum = 1; + // 处理time,拼接时分秒,开始时间 + 00:00:00,结束时间 + 23:59:59 + if (this.time?.length > 0) { + this.queryParams.param.startTime = this.time[0] + " 00:00:00"; + this.queryParams.param.endTime = this.time[1] + " 23:59:59"; + } else { + this.queryParams.param.startTime = ""; + this.queryParams.param.endTime = ""; + } this.getList(); }, /** 重置按钮操作 */ @@ -1098,7 +1136,10 @@ export default { endAge: "", doctor: "", status: "", + managementId: "", + reportTypeId: "", }; + this.time = []; this.handleQuery(); }, // 多选框选中数据 @@ -1170,78 +1211,6 @@ export default { row )}`, }); - // this.getDetailsForm() //重置详情表单 - // this.form = JSON.parse(JSON.stringify(row)); - // queryRecord({ - // treatmentId: row.id - // }).then((res) => { - // let arrList = ["JBXX_ZYZD", "PG_RTCF_TXLX", "PG_TZBS_JJTZ"]; - // let recordValDict = res.data.recordValDict; - // for (let key in recordValDict) { - // if (arrList.includes(key)) { - // recordValDict[key] = recordValDict[key][0].answer; - // } else { - // recordValDict[key] = recordValDict[key][0].answer.join(","); - // } - // } - // this.detailsForm = { - // ...this.detailsForm, - // ...recordValDict - // }; - // console.log(" this.detailsForm", this.detailsForm); - - // this.drawer = true; - // this.title = "诊疗档案详情"; - // }); - }, - - getDetailsForm() { - this.detailsForm = { - JBXX_ZYZD: [], //主要诊断 - JBXX_ZYZD_QT: "", //主要诊断_其他 - PG_RTCF_TZ: "", //体重 - PG_RTCF_QZTZ: "", //去脂体重 - PG_RTCF_JRL: "", //肌肉量 - PG_RTCF_TBW: "", //总水分(TBW) - PG_RTCF_DBZ: "", //蛋白质 - PG_RTCF_GZ: "", //骨质量(GZ) - G_RTCF_ZF: "", //脂肪 - PG_RTCF_PBF: "", //体脂百分比 - PG_RTCF_GGJ: "", //骨骼肌 - PG_RTCF_BMI: "", //体质指数(BMI) - PG_RTCF_WHR: "", //腰臀比(WHR) - PG_RTCF_NZZFSP: "", //内脏脂肪水平 - PG_RTCF_STGCFBFB: "", //身体成分脂肪百分比 - PG_RTCF_TXLX: "", //体型类型 - PG_RTCF_STNL: "", //身体年龄 - PG_RTCF_JKPF: "", //健康评分 - PG_TZBS_ZYTZ: "", //主要体质 - PG_TZBS_JJTZ: [], //兼夹体质 - PG_TT_TAPS_DF: "", //体型评分(TAPS)得分 - PG_TT_TRACE_DF: "", //体型评分(TRACE)得分 - PG_TT_SRS22_DF: "", //体型评分(SRS-22)得分 - "PG_SM_PHQ-9_DF": "", // 患者健康问卷(PHQ-9)评估得分 - PG_SM_EPSW_DF: "", //Epworth嗜睡评估得分 - PG_SM_PSQI_DF: "", //匹兹堡睡眠质量指数(PSQI)评估得分 - "PG_JL_HAMD-24_DF": "", //汉密尔顿抑郁评估(HAMD-24)得分 - PG_JL_SAS_DF: "", //焦虑自评量表(SAS)得分 - ZLFA_ZLLX: "", //治疗方式 - ZLFA_XWXLGY: "", // 行为心理干预 - ZLFA_YDGY: "", //运动干预 - ZLFA_ZJ_LF: "", //针灸疗法-疗法 - ZLFA_ZJ_XW: "", //针灸疗法-穴位 - ZLFA_YW: "", //药物治疗 - ZLFA_SHXG: "", // 生活习惯 - ZLFA_XLTS: "", //心理调适 - - ZLFA_LCYYZL: "", //临床用药治疗 - ZLFA_ZJ_LF_SMZ: "", // 失眠症-针灸疗法-疗法 - ZLFA_ZJ_XW_SMZ: "", // 失眠症-针灸疗法-穴位 - ZLFA_YW_SMZ: "", // 失眠症-药物治疗 - ZLFA_ZJ_LF_QT: "", // 其他-针灸疗法-疗法 - ZLFA_ZJ_XW_QT: "", // 其他-针灸疗法-穴位 - ZLFA_YW_QT: "", // 其他-药物治疗 - }; }, /** 诊疗档案 */ submitForm: function () { diff --git a/acupuncture-前台/src/views/patientFile/index.vue b/acupuncture-前台/src/views/patientFile/index.vue index 65d59863..7f9ad7c0 100644 --- a/acupuncture-前台/src/views/patientFile/index.vue +++ b/acupuncture-前台/src/views/patientFile/index.vue @@ -321,7 +321,7 @@ type="text" icon="el-icon-plus" @click="handleArchivesAdd(scope.row)" - >新增诊疗档案 + >新增病历直报 </el-button> </template> </el-table-column> diff --git a/acupuncture-前台/南宁针灸前台ssl-添加不良反应、并发症1.zip b/acupuncture-前台/南宁针灸前台ssl-4.zip similarity index 93% rename from acupuncture-前台/南宁针灸前台ssl-添加不良反应、并发症1.zip rename to acupuncture-前台/南宁针灸前台ssl-4.zip index 0b69389e..7ddced48 100644 Binary files a/acupuncture-前台/南宁针灸前台ssl-添加不良反应、并发症1.zip and b/acupuncture-前台/南宁针灸前台ssl-4.zip differ diff --git a/acupuncture-前台/针灸前台clientssl-2.zip b/acupuncture-前台/针灸前台clientssl-2.zip new file mode 100644 index 00000000..06d120de Binary files /dev/null and b/acupuncture-前台/针灸前台clientssl-2.zip differ diff --git a/acupuncture-后台/src/api/medicalFile.js b/acupuncture-后台/src/api/medicalFile.js index b44674c4..3aa383b2 100644 --- a/acupuncture-后台/src/api/medicalFile.js +++ b/acupuncture-后台/src/api/medicalFile.js @@ -64,3 +64,11 @@ export function exportTreatmentPg(data) { data: data, }); } +// 审核 +export function treatmentAudit(data) { + return request({ + url: "/admin/treatment/aduit", + method: "post", + data: data, + }); +} \ No newline at end of file diff --git a/acupuncture-后台/src/api/monitor/cache.js b/acupuncture-后台/src/api/monitor/cache.js index 72c5f6a3..d06fec99 100644 --- a/acupuncture-后台/src/api/monitor/cache.js +++ b/acupuncture-后台/src/api/monitor/cache.js @@ -1,57 +1,65 @@ -import request from '@/utils/request' +import request from "@/utils/request"; // 查询缓存详细 export function getCache() { return request({ - url: '/monitor/cache', - method: 'get' - }) + url: "/monitor/cache", + method: "get", + }); } // 查询缓存名称列表 export function listCacheName() { return request({ - url: '/monitor/cache/getNames', - method: 'get' - }) + url: "/monitor/cache/getNames", + method: "get", + }); } // 查询缓存键名列表 export function listCacheKey(cacheName) { return request({ - url: '/monitor/cache/getKeys/' + cacheName, - method: 'get' - }) + url: "/monitor/cache/getKeys/" + cacheName, + method: "get", + }); } // 查询缓存内容 export function getCacheValue(cacheName, cacheKey) { return request({ - url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey, - method: 'get' - }) + url: "/monitor/cache/getValue/" + cacheName + "/" + cacheKey, + method: "get", + }); } // 清理指定名称缓存 export function clearCacheName(cacheName) { return request({ - url: '/monitor/cache/clearCacheName/' + cacheName, - method: 'delete' - }) + url: "/monitor/cache/clearCacheName/" + cacheName, + method: "delete", + }); } // 清理指定键名缓存 export function clearCacheKey(cacheKey) { return request({ - url: '/monitor/cache/clearCacheKey/' + cacheKey, - method: 'delete' - }) + url: "/monitor/cache/clearCacheKey/" + cacheKey, + method: "delete", + }); } // 清理全部缓存 export function clearCacheAll() { return request({ - url: '/monitor/cache/clearCacheAll', - method: 'delete' - }) + url: "/monitor/cache/clearCacheAll", + method: "delete", + }); +} +// 新增修改 +export function cacheAdd(query) { + return request({ + url: "/monitor/cache/add", + method: "get", + params: query, + }); } diff --git a/acupuncture-后台/src/api/report.js b/acupuncture-后台/src/api/report.js index 6155ddfd..d5664849 100644 --- a/acupuncture-后台/src/api/report.js +++ b/acupuncture-后台/src/api/report.js @@ -61,4 +61,12 @@ export function managerDel(data) { method: "post", data: data, }); -} \ No newline at end of file +} +// 下载上报汇总表 +export function reportDown(data) { + return request({ + url: "/admin/treatment/adminExportTreatmentPgZip", + method: "post", + data: data, + }); +} diff --git a/acupuncture-后台/src/views/followFile/work.vue b/acupuncture-后台/src/views/followFile/work.vue index 490c4dd4..d3d66dcd 100644 --- a/acupuncture-后台/src/views/followFile/work.vue +++ b/acupuncture-后台/src/views/followFile/work.vue @@ -530,7 +530,7 @@ export default { created() { let { name, phone } = this.$route.query; this.queryParams.param.keywords = name || ""; - this.queryParams.param.phone = phone || ""; + this.queryParams.param.phone = phone !== 'null' ? phone : ""; this.getList(); this.getTenantsList(); // 组织列表 }, diff --git a/acupuncture-后台/src/views/medicalFile/index.vue b/acupuncture-后台/src/views/medicalFile/index.vue index c420ef2b..c71e9b0f 100644 --- a/acupuncture-后台/src/views/medicalFile/index.vue +++ b/acupuncture-后台/src/views/medicalFile/index.vue @@ -6,7 +6,6 @@ size="small" :inline="true" v-show="showSearch" - label-width="80px" > <el-form-item label="" prop="noticeTitle"> <el-input @@ -93,7 +92,23 @@ <el-option label="驳回" :value="3" /> </el-select> </el-form-item> - <el-form-item label="建档组织" prop="tenantId"> + <el-form-item label="上报标题" prop="managementId"> + <el-select + v-model="queryParams.param.managementId" + placeholder="请选择" + filterable + clearable + > + <el-option + v-for="item in managerList" + :key="item.id" + :label="item.reportTitle" + :value="item.id" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item label="上报单位" prop="tenantId"> <el-select v-model="queryParams.param.tenantId" placeholder="请选择" @@ -108,6 +123,17 @@ /> </el-select> </el-form-item> + <el-form-item label="门诊/住院时间" prop="time"> + <el-date-picker + v-model="time" + type="daterange" + value-format="yyyy-MM-dd" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期" + > + </el-date-picker> + </el-form-item> <el-form-item> <el-button type="primary" @@ -359,9 +385,16 @@ </span> </template> </el-table-column> - <el-table-column - label="建档人" + label="上报标题" + align="center" + prop="reportTitle" + show-overflow-tooltip + min-width="150" + > + </el-table-column> + <el-table-column + label="上报人" align="center" prop="createBy" show-overflow-tooltip @@ -369,7 +402,7 @@ /> <el-table-column prop="tenantName" - label="建档组织" + label="上报单位" align="center" show-overflow-tooltip min-width="150" @@ -400,7 +433,7 @@ label="操作" align="center" class-name="small-padding fixed-width" - width="300" + width="250" > <template slot-scope="scope"> <!-- <el-button @@ -456,7 +489,7 @@ 提交审核 </el-button> --> <!-- 审核 --> - <!-- <el-button + <el-button :disabled="scope.row.status != 1" size="mini" type="text" @@ -475,7 +508,7 @@ v-hasPermi="['medicalFile:index:reject']" > 驳回 - </el-button> --> + </el-button> </template> </el-table-column> </el-table> @@ -661,7 +694,9 @@ import { saveAidRecord, queueAdd, exportTreatmentPg, + treatmentAudit, } from "@/api/medicalFile"; +import { managerQuery } from "@/api/report"; import { tenantsList } from "@/api/member"; import { getToken } from "@/utils/auth"; import { followupQuery } from "@/api/followupFile"; @@ -670,6 +705,8 @@ export default { dicts: ["sys_normal_disable", "sys_user_sex"], data() { return { + time: [], + managerList: [], // 管理员列表 tenantsListData: [], qzUrl: process.env.VUE_APP_API_QZURL, // 二维码路径 // 通过年限对象获取学历 @@ -755,16 +792,6 @@ export default { fileList: [], followupList: [], queueOpen: false, - // 现病史 - medicalHistory: [ - "肥胖症", - "失眠病", - "中风病", - "面瘫病", - "项痹病", - "腰痛病", - "痉挛性斜颈", - ], idCardType: [ { label: "身份证", @@ -794,392 +821,6 @@ export default { 3: "台湾居民来往大陆通行证", 4: "其他", }, - // 体型类型 - systemType: [ - "隐形肥胖型", - "脂肪过多型", - "肥胖型", - "肌肉不足型", - "健康匀称型", - "超重肌肉型", - "消瘦型", - "低脂肪型", - "运动员型", - ], - // 体质辨识 - habitus: [ - "平和质", - "气虚质", - " 阳虚质", - "阴虚质", - "痰湿质", - " 湿热质", - "血瘀质", - "气郁质", - "特禀质", - ], - // 治疗类型 - healType: [ - { - title: "肥胖症", - list: [ - { - title: "行为心理干预", - valueCode: "ZLFA_XWXLGY", - list: [ - { - title: - "行为技能训练:辅导有效的应对压力技巧,避免因情绪波动导致过度进食,训练正念饮食,提高对饥饿和饱足感的感知能力", - value: "行为技能训练", - type: "but", - }, - { - title: - "目标设定与追踪:与患者共同设立短期和长期减重目标,定期进行进度评估,强化正面反馈,提高自我管理能力", - value: "目标设定与追踪", - type: "but", - }, - ], - }, - { - title: "运动干预", - valueCode: "ZLFA_YDGY", - list: [ - { - title: - "有氧运动:如快走、慢跑、游泳等,建议每周至少进行150分钟中等强度的有氧运动", - value: "有氧运动", - type: "but", - }, - { - title: - "抗阻运动:如举重、俯卧撑等,建议每周进行2-3次抗阻运动", - value: "抗阻运动", - type: "but", - }, - ], - }, - { - title: "临床营养治疗", - valueCode: "ZLFA_LCYYZL", - list: [ - { - title: - "限能量饮食:在限制能量摄入(日常饮食能量减去30%)的基础上,营养素比例符合平衡膳食的要求", - value: "限能量饮食", - type: "but", - }, - { - title: "高蛋白饮食:每日蛋白质摄入量超过20%,但一般不高于35%", - value: "高蛋白饮食", - type: "but", - }, - { - title: "低碳水化合物饮食:碳水化合物供能比一般在20%-40%", - value: "低碳水化合物饮食", - type: "but", - }, - { - title: - "断食:如5+2模式,1周中5天相对正常进食,其他2天摄取平常的1/4能量", - value: "断食", - type: "but", - }, - ], - }, - { - title: "针灸疗法", - list: [ - { - title: "疗法", - valueCode: "ZLFA_ZJ_LF", - list: [ - { - title: "毫针/电针疗法", - type: "but", - }, - { - title: "温针疗法", - type: "but", - }, - { - title: "耳穴贴压疗法", - type: "but", - }, - { - title: "穴位埋针法", - type: "but", - }, - { - title: "穴位埋线法", - type: "but", - }, - ], - }, - { - title: "穴位", - valueCode: "ZLFA_ZJ_XW", - list: [ - { - title: "神门:安神定志,改善睡眠质量", - value: "神门", - type: "but", - }, - { - title: "三阴交:调理脾胃,养血安神", - value: "三阴交", - type: "but", - }, - { - title: "百会:调节大脑功能,促进睡眠", - value: "百会", - type: "but", - }, - { - title: "安眠:直接作用于睡眠中枢,帮助入睡", - value: "安眠", - type: "but", - }, - ], - }, - ], - }, - { - title: "药物治疗", - valueCode: "ZLFA_YW", - list: [ - { - title: "奥利司他:通过抑制胃肠道脂肪酶,减少脂肪吸收", - value: "奥利司他", - type: "but", - }, - { - title: "利拉鲁肽:GLP-1受体激动剂,延缓胃排空,增加饱腹感", - value: "利拉鲁肽", - type: "but", - }, - { - title: "贝那鲁肽:GLP-1受体激动剂,作用机制与利拉鲁肽类似", - value: "贝那鲁肽", - type: "but", - }, - { - title: - "司美格鲁肽:GLP-1受体激动剂,每周一次给药,减重效果显著", - value: "司美格鲁肽", - type: "but", - }, - { - title: "替尔泊肽:GLP-1受体激动剂,适用于肥胖症治疗", - value: "替尔泊肽", - type: "but", - }, - ], - }, - ], - }, - { - title: "失眠症", - list: [ - { - title: "生活习惯", - valueCode: "ZLFA_SHXG", - list: [ - { - title: - "科学膳食:避免午后摄入咖啡、茶、酒精等刺激性饮品,以及睡前过度进食", - value: "科学膳食", - type: "but", - }, - { - title: - "充足日照:增加日间自然光照,减少夜间人工光源,特别是电子产品的使用", - value: "充足日照", - type: "but", - }, - { - title: - "合理运动:推荐瑜伽、太极拳、八段锦等传统运动,有助于改善睡眠质量", - value: "合理运动", - type: "but", - }, - ], - }, - { - title: "心理调适", - valueCode: "ZLFA_XLTS", - list: [ - { - title: - "放松训练:包括渐进式肌肉放松训练、腹式呼吸、冥想等,可降低紧张与过度警觉,提高睡眠质量", - value: "放松训练", - type: "but", - }, - { - title: - "音乐疗法:轻柔舒缓的音乐可以降低神经系统兴奋性,减轻焦虑情绪从而改善睡眠", - value: "音乐疗法", - type: "but", - }, - { - title: - "认知调整:不灾难化和过分关注失眠,不因偶尔失眠而产生挫败感,培养失眠的耐受性", - value: "认知调整", - type: "but", - }, - ], - }, - { - title: "针灸疗法", - list: [ - { - title: "疗法", - valueCode: "ZLFA_ZJ_LF_SMZ", - list: [ - { - title: "毫针/电针疗法", - type: "but", - }, - { - title: "温针疗法", - type: "but", - }, - { - title: "耳穴贴压疗法", - type: "but", - }, - { - title: "穴位埋针法", - type: "but", - }, - { - title: "穴位埋线法", - type: "but", - }, - ], - }, - { - title: "穴位", - valueCode: "ZLFA_ZJ_XW_SMZ", - list: [ - { - title: "神门:安神定志,改善睡眠质量", - value: "神门", - type: "but", - }, - { - title: "三阴交:调理脾胃,养血安神", - value: "三阴交", - type: "but", - }, - { - title: "百会:调节大脑功能,促进睡眠", - value: "百会", - type: "but", - }, - { - title: "安眠:直接作用于睡眠中枢,帮助入睡", - value: "安眠", - type: "but", - }, - ], - }, - ], - }, - { - title: "药物治疗", - valueCode: "ZLFA_YW_SMZ", - list: [ - { - title: - "苯二氮䓬受体激动剂(BZRAs):艾司唑仑、阿普唑仑、劳拉西泮等", - value: "苯二氮䓬受体激动剂(BZRAs)", - type: "but", - }, - { - title: - "非苯二氮䓬类药物(non-BZDs):唑吡坦、扎来普隆、右佐匹克隆、佐匹克隆", - value: "非苯二氮䓬类药物(non-BZDs)", - type: "but", - }, - { - title: "褪黑素和褪黑素受体激动剂:调节生物钟,改善睡眠", - value: "褪黑素和褪黑素受体激动剂", - type: "but", - }, - { - title: - "抗抑郁药物:具有镇静作用的抗抑郁药物,如曲唑酮、米氮平等,可用于失眠伴抑郁症状的患者", - value: "抗抑郁药物", - type: "but", - }, - { - title: - "其他药物:选择性食欲素受体拮抗剂苏沃雷生,可用于改善睡眠质量", - value: "其他药物", - type: "but", - }, - ], - }, - ], - }, - { - title: "其他", - list: [ - { - title: "针灸疗法", - list: [ - { - title: "疗法", - valueCode: "ZLFA_ZJ_LF_QT", - list: [ - { - title: "毫针/电针疗法", - type: "but", - }, - { - title: "温针疗法", - type: "but", - }, - { - title: "耳穴贴压疗法", - type: "but", - }, - { - title: "穴位埋针法", - type: "but", - }, - { - title: "穴位埋线法", - type: "but", - }, - ], - }, - { - title: "穴位", - valueCode: "ZLFA_ZJ_XW_QT", - list: [ - { - title: "填写", - type: "input", - }, - ], - }, - ], - }, - { - title: "药物治疗", - valueCode: "ZLFA_YW_QT", - list: [ - { - title: "填写", - type: "input", - }, - ], - }, - ], - }, - ], status: { 0: "保存", 1: "待审核", @@ -1213,6 +854,9 @@ export default { doctor: "", status: "", tenantId: "", + managementId: "", + startTime: "", + endTime: "", }, }, formDisabled: false, @@ -1367,13 +1011,24 @@ export default { }; }, created() { - let { name, phone } = this.$route.query; - this.queryParams.param.keywords = name || ""; - this.queryParams.param.phone = phone || ""; + let { name, phone, managementId } = this.$route.query; + this.queryParams.param.keywords = name; + this.queryParams.param.phone = phone !== "null" ? phone : ""; + this.queryParams.param.managementId = managementId; this.getList(); this.getTenantsList(); // 组织列表 + this.getManagerList(); // 上报管理列表 }, methods: { + /** 上报管理列表 */ + getManagerList() { + managerQuery({ + pageNum: -1, + param: {}, + }).then((res) => { + this.managerList = res.data.list; + }); + }, // 组织列表 getTenantsList() { tenantsList({ @@ -1470,6 +1125,14 @@ export default { /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageNum = 1; + // 处理time,拼接时分秒,开始时间 + 00:00:00,结束时间 + 23:59:59 + if (this.time?.length > 0) { + this.queryParams.param.startTime = this.time[0] + " 00:00:00"; + this.queryParams.param.endTime = this.time[1] + " 23:59:59"; + } else { + this.queryParams.param.startTime = ""; + this.queryParams.param.endTime = ""; + } this.getList(); }, /** 重置按钮操作 */ @@ -1485,7 +1148,10 @@ export default { endAge: "", doctor: "", status: "", + tenantId: "", + managementId: "", }; + this.time = []; this.handleQuery(); }, // 多选框选中数据 @@ -1514,15 +1180,17 @@ export default { }, /** 提交审核 */ handleExamine(row, _status) { - let form = JSON.parse(JSON.stringify(row)); - form = { - ...JSON.parse(JSON.stringify(row)), + let params = { + tenantId: row.tenantId, // 租户id + treatmentId: row.id, // 诊疗id + status: _status, // 状态 0:保存 1:待审核 2:通过 3:驳回 }; - form.status = _status; + let title = this.status[_status]; + title = title == "待审核" ? "提交" : title; this.$modal - .confirm(`是否确认提交当前选择的数据(${row.name})?`) + .confirm(`是否确认${title}当前选择的数据(${row.name})?`) .then(function () { - return treatmentUpd(form); + return treatmentAudit(params); }) .then(() => { this.getList(); @@ -1636,35 +1304,6 @@ export default { } }); }, - // 诊疗详情 - submitDetailsForm: function () { - this.$refs["detailsForm"].validate((valid) => { - if (valid) { - let codeAndAnswerList = []; - for (let key in this.detailsForm) { - let data = { - questionCode: key, - answer: "", - }; - if (typeof this.detailsForm[key] === "string") { - data.answer = this.detailsForm[key].split(","); - } else { - data.answer = this.detailsForm[key]; - } - codeAndAnswerList.push(data); - } - - saveAidRecord({ - treatmentId: this.form.id, - codeAndAnswerList, - }).then((response) => { - this.$modal.msgSuccess("保存成功"); - this.drawer = false; - this.getList(); - }); - } - }); - }, /** 删除按钮操作 */ handleDelete(row) { const idList = row.id ? [row.id] : this.ids; diff --git a/acupuncture-后台/src/views/monitor/cache/list.vue b/acupuncture-后台/src/views/monitor/cache/list.vue index 29a7c741..1d021dd9 100644 --- a/acupuncture-后台/src/views/monitor/cache/list.vue +++ b/acupuncture-后台/src/views/monitor/cache/list.vue @@ -11,6 +11,12 @@ icon="el-icon-refresh-right" @click="refreshCacheNames()" ></el-button> + <el-button + style="float: right; padding: 3px 0" + type="text" + icon="el-icon-plus" + @click="handelAdd()" + ></el-button> </div> <el-table v-loading="loading" @@ -47,6 +53,12 @@ class-name="small-padding fixed-width" > <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpd(scope.row)" + ></el-button> <el-button size="mini" type="text" @@ -148,33 +160,106 @@ </el-card> </el-col> </el-row> + <el-dialog + :title="title" + :visible.sync="open" + width="620px" + append-to-body + class="popup" + > + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="缓存名称" prop="cacheName"> + <el-input + v-model="form.cacheName" + placeholder="请输入缓存名称" + :disabled="title == '修改缓存'" + /> + </el-form-item> + <el-form-item label="备注" prop="remark"> + <el-input v-model="form.remark" placeholder="请输入备注" /> + </el-form-item> + <el-form-item label=" " style="margin-bottom: 0px"> + <template slot-scope="scope"> + <el-button type="primary" @click="submit" size="mini" + >确 定</el-button + > + <el-button @click="open = false">取 消</el-button> + </template> + </el-form-item> + </el-form> + </el-dialog> </div> </template> <script> -import { listCacheName, listCacheKey, getCacheValue, clearCacheName, clearCacheKey, clearCacheAll } from "@/api/monitor/cache"; +import { + listCacheName, + listCacheKey, + getCacheValue, + clearCacheName, + clearCacheKey, + clearCacheAll, + cacheAdd, +} from "@/api/monitor/cache"; export default { name: "CacheList", data() { return { + form: { + cacheName: "", + remark: "", + }, + rules: { + cacheName: [ + { required: true, message: "缓存名称不能为空", trigger: "blur" }, + ], + }, + open: false, cacheNames: [], cacheKeys: [], cacheForm: {}, loading: true, subLoading: false, nowCacheName: "", - tableHeight: window.innerHeight - 200 + tableHeight: window.innerHeight - 200, }; }, created() { this.getCacheNames(); }, methods: { + handleUpd(row) { + this.title = "修改缓存"; + this.form = { + cacheName: row.cacheName, + remark: row.remark, + }; + this.open = true; + }, + handelAdd() { + this.title = "新增缓存"; + this.open = true; + this.form = { + cacheName: "", + remark: "", + }; + }, + submit() { + this.$refs["form"].validate(async (valid) => { + if (valid) { + cacheAdd(this.form).then((response) => { + this.$modal.msgSuccess("添加成功"); + this.open = false; + this.getCacheNames(); + }); + } + }); + }, /** 查询缓存名称列表 */ getCacheNames() { this.loading = true; - listCacheName().then(response => { + listCacheName().then((response) => { this.cacheNames = response.data; this.loading = false; }); @@ -186,7 +271,7 @@ export default { }, /** 清理指定名称缓存 */ handleClearCacheName(row) { - clearCacheName(row.cacheName).then(response => { + clearCacheName(row.cacheName).then((response) => { this.$modal.msgSuccess("清理缓存名称[" + row.cacheName + "]成功"); this.getCacheKeys(); }); @@ -198,7 +283,7 @@ export default { return; } this.subLoading = true; - listCacheKey(cacheName).then(response => { + listCacheKey(cacheName).then((response) => { this.cacheKeys = response.data; this.subLoading = false; this.nowCacheName = cacheName; @@ -211,7 +296,7 @@ export default { }, /** 清理指定键名缓存 */ handleClearCacheKey(cacheKey) { - clearCacheKey(cacheKey).then(response => { + clearCacheKey(cacheKey).then((response) => { this.$modal.msgSuccess("清理缓存键名[" + cacheKey + "]成功"); this.getCacheKeys(); }); @@ -226,16 +311,16 @@ export default { }, /** 查询缓存内容详细 */ handleCacheValue(cacheKey) { - getCacheValue(this.nowCacheName, cacheKey).then(response => { + getCacheValue(this.nowCacheName, cacheKey).then((response) => { this.cacheForm = response.data; }); }, /** 清理全部缓存 */ handleClearCacheAll() { - clearCacheAll().then(response => { + clearCacheAll().then((response) => { this.$modal.msgSuccess("清理全部缓存成功"); }); - } + }, }, }; </script> diff --git a/acupuncture-后台/src/views/monitor/online/index.vue b/acupuncture-后台/src/views/monitor/online/index.vue index ad613c96..5b9752fe 100644 --- a/acupuncture-后台/src/views/monitor/online/index.vue +++ b/acupuncture-后台/src/views/monitor/online/index.vue @@ -45,6 +45,11 @@ <span>{{ parseTime(scope.row.loginTime) }}</span> </template> </el-table-column> + <el-table-column label="最后访问时间" align="center" prop="lastVisitTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.lastVisitTime) }}</span> + </template> + </el-table-column> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <el-button diff --git a/acupuncture-后台/src/views/monitor/server/index.vue b/acupuncture-后台/src/views/monitor/server/index.vue index 15ffc9a6..b99ec341 100644 --- a/acupuncture-后台/src/views/monitor/server/index.vue +++ b/acupuncture-后台/src/views/monitor/server/index.vue @@ -171,6 +171,31 @@ </div> </el-card> </el-col> + <el-col :span="24" class="card-box"> + <el-card> + <div slot="header"> + <span><i class="el-icon-s-data"></i> 数据库状态</span> + </div> + <div class="el-table el-table--enable-row-hover el-table--medium"> + <table cellspacing="0" style="width: 100%;"> + <thead> + <tr> + <th class="el-table__cell el-table__cell is-leaf"><div class="cell">数据库类型</div></th> + <th class="el-table__cell is-leaf"><div class="cell">版本号</div></th> + <th class="el-table__cell is-leaf"><div class="cell">状态</div></th> + </tr> + </thead> + <tbody v-if="server.sysFiles"> + <tr > + <td class="el-table__cell is-leaf"><div class="cell">MariaDB</div></td> + <td class="el-table__cell is-leaf"><div class="cell">10.3.23</div></td> + <td class="el-table__cell is-leaf"><div class="cell">在线</div></td> + </tr> + </tbody> + </table> + </div> + </el-card> + </el-col> </el-row> </div> </template> diff --git a/acupuncture-后台/src/views/patientFile/index.vue b/acupuncture-后台/src/views/patientFile/index.vue index 8a4fb4d4..be986927 100644 --- a/acupuncture-后台/src/views/patientFile/index.vue +++ b/acupuncture-后台/src/views/patientFile/index.vue @@ -82,14 +82,27 @@ <el-col :span="1.5"> <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button> - </el-col> - <el-col :span="1.5"> - <el-button type="info" plain icon="el-icon-bottom" size="mini" - @click="handleDownload">下载模版</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 + type="info" + plain + icon="el-icon-bottom" + size="mini" + @click="handleDownload" + >下载模版</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 type="warning" @@ -454,7 +467,8 @@ export default { Authorization: "Bearer " + getToken(), deptId: localStorage.getItem("hospitalId"), }, - uploadFileUrl1: process.env.VUE_APP_API_QZURL + "/patient/import", // 上传的图片服务器地址 + uploadFileUrl1: + process.env.VUE_APP_API_QZURL + "/admin/treatment/importTreatment", // 上传的图片服务器地址 fileList: [], // 通过年限对象获取学历 educationYearsValue: { @@ -818,7 +832,7 @@ export default { /** 下载按钮操作 */ handleDownload() { window.open( - `${process.env.VUE_APP_API_QZURL}/profile/PatientTemplate.xlsx` + `${process.env.VUE_APP_API_QZURL}profile/PatientTemplateAdmin.xlsx` ); // this.download1( // "/patient/export", {}, diff --git a/acupuncture-后台/src/views/report/manage.vue b/acupuncture-后台/src/views/report/manage.vue index c4418d12..2ffe5ef7 100644 --- a/acupuncture-后台/src/views/report/manage.vue +++ b/acupuncture-后台/src/views/report/manage.vue @@ -1,345 +1,620 @@ <template> - <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" - label-width="80px"> - <el-form-item label="标题" prop="reportTitle"> - <el-input v-model="queryParams.param.reportTitle" 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">新增</el-button> - </el-col> - <el-col :span="1.5"> - <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" - @click="handleDelete">删除</el-button> - </el-col> - <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> - </el-row> + <div class="app-container"> + <el-form + :model="queryParams" + ref="queryForm" + size="small" + :inline="true" + v-show="showSearch" + label-width="80px" + > + <el-form-item label="标题" prop="reportTitle"> + <el-input + v-model="queryParams.param.reportTitle" + 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" + >新增</el-button + > + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + >删除</el-button + > + </el-col> + <right-toolbar + :showSearch.sync="showSearch" + @queryTable="getList" + ></right-toolbar> + </el-row> - <el-table v-loading="loading" :data="listData" @selection-change="handleSelectionChange" max-height="600"> - <el-table-column type="selection" width="55" align="center" /> - <el-table-column fixed label="标题" align="center" prop="reportTitle" min-width="100" /> - <el-table-column fixed label="类型" align="center" prop="typeName" show-overflow-tooltip min-width="100"> - </el-table-column> - <el-table-column fixed label="开始时间" align="center" prop="timeRangeStart" show-overflow-tooltip - min-width="100"> - <template slot-scope="scope"> - <span> - {{ parseTime(scope.row.timeRangeStart, "{y}-{m}-{d}") }} - </span> - </template> - </el-table-column> - <el-table-column fixed label="结束时间" align="center" prop="timeRangeEnd" show-overflow-tooltip - min-width="100"> - <template slot-scope="scope"> - <span> - {{ parseTime(scope.row.timeRangeEnd, "{y}-{m}-{d}") }} - </span> - </template> - </el-table-column> - <el-table-column label="创建人/创建时间" align="center" min-width="140"> - <template slot-scope="scope"> - <div>{{scope.row.createBy}}</div> - <span> - {{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }} - </span> - </template> - </el-table-column> - <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200"> - <template slot-scope="scope"> - <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" - :disabled="scope.row.id == 1 || scope.row.id == 2">修改</el-button> - <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" - :disabled="scope.row.id == 1 || scope.row.id == 2">删除</el-button> - </template> - </el-table-column> - </el-table> + <el-table + v-loading="loading" + :data="listData" + @selection-change="handleSelectionChange" + max-height="600" + > + <el-table-column type="selection" width="55" align="center" /> + <el-table-column + fixed + label="标题" + align="center" + prop="reportTitle" + min-width="100" + /> + <el-table-column + fixed + label="类型" + align="center" + prop="typeName" + show-overflow-tooltip + min-width="100" + > + </el-table-column> + <el-table-column + label="单位" + align="center" + prop="tenantIdList" + min-width="250" + show-overflow-tooltip + > + <template slot-scope="scope"> + <!-- 通过id列表找到tenantsData中匹配的数据并替换为中文,数据后面添加逗号 --> + <template v-for="(item, index) in scope.row.tenantIdList"> + <template v-if="tenantsData.some((tenant) => tenant.id === item)"> + {{ tenantsData.find((tenant) => tenant.id === item).name + }}{{ index < scope.row.tenantIdList.length - 1 ? "," : "" }} + </template> + </template> + </template> + </el-table-column> + <el-table-column + fixed + label="开始时间" + align="center" + prop="timeRangeStart" + show-overflow-tooltip + min-width="100" + > + <template slot-scope="scope"> + <span> + {{ parseTime(scope.row.timeRangeStart, "{y}-{m}-{d}") }} + </span> + </template> + </el-table-column> + <el-table-column + fixed + label="结束时间" + align="center" + prop="timeRangeEnd" + show-overflow-tooltip + min-width="100" + > + <template slot-scope="scope"> + <span> + {{ parseTime(scope.row.timeRangeEnd, "{y}-{m}-{d}") }} + </span> + </template> + </el-table-column> + <el-table-column + label="状态" + align="center" + prop="status" + show-overflow-tooltip + min-width="100" + > + <template slot-scope="scope"> + <span v-if="scope.row.status === 0"> 未开始 </span> + <span v-if="scope.row.status === 1"> 进行中 </span> + <span v-if="scope.row.status === 2"> 已结束 </span> + </template> + </el-table-column> + <!-- <el-table-column + label="开启/结束" + align="center" + prop="typeName" + show-overflow-tooltip + min-width="100" + > + <template slot-scope="scope"> + <el-switch + v-model="scope.row.status" + active-color="#13ce66" + inactive-color="#ff4949" + ></el-switch> + </template> + </el-table-column> --> + <el-table-column label="创建人/创建时间" align="center" min-width="140"> + <template slot-scope="scope"> + <div>{{ scope.row.createBy }}</div> + <span> + {{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }} + </span> + </template> + </el-table-column> - <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" - :limit.sync="queryParams.pageSize" @pagination="getList" /> + <el-table-column + fixed="right" + label="操作" + align="center" + class-name="small-padding fixed-width" + width="150" + > + <template slot-scope="scope"> + <el-button + v-if="scope.row.status === 0 || scope.row.status === 2" + size="mini" + type="text" + icon="el-icon-folder-checked" + @click="handleSwitch(scope.row, 1)" + >开启</el-button + > + <el-button + v-if="scope.row.status === 1" + size="mini" + type="text" + icon="el-icon-folder-delete" + @click="handleSwitch(scope.row, 2)" + >结束</el-button + > + <el-button + size="mini" + type="text" + icon="el-icon-document" + @click="handleDetails(scope.row)" + >上报详情</el-button + > + <el-button + size="mini" + type="text" + icon="el-icon-download" + @click="handleDownload(scope.row)" + >上报汇总表</el-button + > + <el-button + :disabled="scope.row.status === 1" + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + >修改</el-button + > + <el-button + :disabled="scope.row.status === 1" + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + >删除</el-button + > + </template> + </el-table-column> + </el-table> - <!-- 添加或修改公告对话框 --> - <el-dialog class="popup" :title="title" :visible.sync="open" width="780px" append-to-body> - <el-form ref="form" :model="form" :rules="rules" label-width="140px" class="formStep"> - <el-form-item label="标题" prop="reportTitle"> - <el-input v-model="form.reportTitle" placeholder="请输入" /> - </el-form-item> - <el-form-item label="上报类型" prop="reportType"> - <el-select v-model="form.reportType" placeholder="请选择"> - <el-option v-for="item in reporTypeList" :key="item.id" :label="item.typeName" :value="item.id"> - </el-option> - </el-select> - </el-form-item> - <el-form-item label="时间范围" prop="time"> - <!-- <el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.timeRangeStart" - type="date" placeholder="选择日期"> - </el-date-picker> --> - <el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.time" type="daterange" - range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @input="$forceUpdate()"> - </el-date-picker> - </el-form-item> - <!-- <el-form-item label="结束时间" prop="timeRangeEnd"> - <el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.timeRangeEnd" type="date" - placeholder="选择日期"> - </el-date-picker> - </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> + <pagination + v-show="total > 0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 添加或修改公告对话框 --> + <el-dialog + class="popup" + :title="title" + :visible.sync="open" + width="780px" + append-to-body + > + <el-form + ref="form" + :model="form" + :rules="rules" + label-width="100px" + class="formStep" + > + <el-form-item label="标题" prop="reportTitle"> + <el-input v-model="form.reportTitle" placeholder="请输入" /> + </el-form-item> + <el-form-item label="上报类型" prop="reportType"> + <el-select + v-model="form.reportType" + placeholder="请选择" + @change="handleTypeChage" + > + <el-option + v-for="item in reporTypeList" + :key="item.id" + :label="item.typeName" + :value="item.id" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item label="单位" prop="tenantIdList"> + <el-select v-model="form.tenantIdList" multiple placeholder="请选择"> + <el-option + v-for="item in tenantsData" + :key="item.id" + :label="item.name" + :value="item.id" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item label="时间范围" prop="time"> + <el-date-picker + format="yyyy-MM-dd" + value-format="yyyy-MM-dd" + v-model="form.time" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期" + @input="$forceUpdate()" + > + </el-date-picker> + </el-form-item> + <el-form-item label="状态" prop="status" v-if="!form.id"> + <el-radio-group v-model="form.status"> + <el-radio :label="0">未开始</el-radio> + <el-radio :label="1">进行中</el-radio> + <el-radio :label="2">已结束</el-radio> + </el-radio-group> + </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 { - managerQuery, - managerAdd, - managerUpd, - managerDel, - reportList - } from "@/api/report"; - export default { - name: "Notice", - data() { - return { - reporTypeList: [], - queryParams: { - param: { - reportTitle: "", - } - }, - listData: [], - title: '', - open: false, - total: 0, - form: {}, - loading: false, - showSearch: true, - multiple: false, - // 表单校验 - rules: { - reportTitle: [{ - required: true, - message: "标题不能为空", - trigger: "blur", - }], - reportType: [{ - required: true, - message: "类型不能为空", - trigger: "blur", - }], - time: [{ - required: true, - message: "时间范围不能为空", - trigger: "change", - }] - // timeRangeStart: [{ - // required: true, - // message: "开始时间不能为空", - // trigger: "blur", - // }], - // timeRangeEnd: [{ - // required: true, - // message: "结束时间不能为空", - // trigger: "blur" - // }], - }, - }; - }, - created() { - this.getList(); - this.getReportType(); - }, - methods: { - getReportType() { - reportList({ - pageNum: -1, - param: {}, - }).then((res) => { - this.reporTypeList = res.data.list; - }); - }, - /** 查询公告列表 */ - getList() { - this.loading = true; - managerQuery(this.queryParams).then((res) => { - this.listData = res.data.list; - this.total = res.data.total; - this.loading = false; - }); - }, - // 取消按钮 - cancel() { - this.open = false; - this.reset(); - }, - // 表单重置 - reset() { - this.form = { - "reportTitle": "", - "reportType": "", - time:[], - "timeRangeStart": "", - "timeRangeEnd": "", - }; - this.resetForm("form"); - }, - /** 搜索按钮操作 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, - /** 重置按钮操作 */ - resetQuery() { - this.queryParams.param = { - reportTitle: "", - }; - 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.open = true; - this.title = "修改上报"; - this.form = JSON.parse(JSON.stringify(row)) - let timeRangeStart = this.parseTime(this.form.timeRangeStart, "{y}-{m}-{d}") - let timeRangeEnd = this.parseTime(this.form.timeRangeEnd, "{y}-{m}-{d}") - this.form.time = [] - this.form.time[0] = timeRangeStart - this.form.time[1] = timeRangeEnd - }, - /** 诊疗档案 */ - submitForm: function() { - this.$refs["form"].validate((valid) => { - if (valid) { - let data = JSON.parse(JSON.stringify(this.form)) - let time = data.time - data.timeRangeStart = data.time[0] - data.timeRangeEnd = data.time[1] - if (data.id != undefined) { - managerUpd(data).then((response) => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); - } else { - managerAdd(data).then((response) => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); - } - } - }); - }, +import { + managerQuery, + managerAdd, + managerUpd, + managerDel, + reportList, + reportDown, +} from "@/api/report"; +import { tenantsList } from "@/api/member"; +export default { + name: "Notice", + data() { + return { + reporTypeList: [], + queryParams: { + pageNum: 1, + pageSize: 10, + param: { + reportTitle: "", + }, + }, + listData: [], + title: "", + open: false, + total: 0, + form: {}, + loading: false, + showSearch: true, + multiple: false, + // 表单校验 + rules: { + reportTitle: [ + { + required: true, + message: "标题不能为空", + trigger: "blur", + }, + ], + reportType: [ + { + required: true, + message: "类型不能为空", + trigger: "blur", + }, + ], + time: [ + { + required: true, + message: "时间范围不能为空", + trigger: "change", + }, + ], + tenantIdList: [ + { + required: true, + message: "单位不能为空", + trigger: "change", + }, + ], + // timeRangeStart: [{ + // required: true, + // message: "开始时间不能为空", + // trigger: "blur", + // }], + // timeRangeEnd: [{ + // required: true, + // message: "结束时间不能为空", + // trigger: "blur" + // }], + }, + tenantsData: [], + qzUrl: process.env.VUE_APP_API_QZURL, // 二维码路径 + }; + }, + created() { + this.getList(); + this.getReportType(); + this.getTenantsList(); + }, + methods: { + handleDownload(row) { + reportDown({ + managementId: row.id, + }).then((res) => { + if (res.data) { + window.open(this.qzUrl + res.data); + } else { + this.$modal.msgError("暂无上报汇总表"); + } + }); + }, + // 上报详情 + handleDetails(row) { + this.$router.push({ + path: "/medicalFile/index", + query: { managementId: row.id }, + }); + }, + // 获取上报类型切换处理 + handleTypeChage() { + // form.reportType reporTypeList 找到对应的id 然后获取到tenantIdList + let reportType = this.form.reportType; + let tenantIdList = this.reporTypeList.find( + (item) => item.id == reportType + ).tenantIdList; + this.form.tenantIdList = tenantIdList; + }, + // 获取上报类型 + getReportType() { + reportList({ + pageNum: -1, + param: {}, + }).then((res) => { + this.reporTypeList = res.data.list; + }); + }, + /** 查询公告列表 */ + getTenantsList() { + tenantsList({ + pageNum: -1, + param: {}, + }).then((res) => { + this.tenantsData = res.data.list; + }); + }, + /** 查询公告列表 */ + getList() { + this.loading = true; + managerQuery(this.queryParams).then((res) => { + this.listData = res.data.list; + this.total = res.data.total; + this.loading = false; + }); + }, + // 取消按钮 + cancel() { + this.open = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + reportTitle: "", + reportType: "", + time: [], + timeRangeStart: "", + timeRangeEnd: "", + tenantIdList: [], + status: 0, + }; + this.resetForm("form"); + }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 重置按钮操作 */ + resetQuery() { + this.queryParams.param = { + reportTitle: "", + }; + 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 = "新增上报"; + }, + /** 修改按钮操作 */ + handleSwitch(row, status) { + this.form = JSON.parse(JSON.stringify(row)); + this.form.status = status; + managerUpd(this.form).then((response) => { + this.$modal.msgSuccess("操作成功"); + this.getList(); + }); + }, + /** 修改按钮操作 */ + handleUpdate(row) { + this.open = true; + this.title = "修改上报"; + this.form = JSON.parse(JSON.stringify(row)); + let timeRangeStart = this.parseTime( + this.form.timeRangeStart, + "{y}-{m}-{d}" + ); + let timeRangeEnd = this.parseTime(this.form.timeRangeEnd, "{y}-{m}-{d}"); + this.form.time = []; + this.form.time[0] = timeRangeStart; + this.form.time[1] = timeRangeEnd; + }, + /** 诊疗档案 */ + submitForm: function () { + this.$refs["form"].validate((valid) => { + if (valid) { + let data = JSON.parse(JSON.stringify(this.form)); + let time = data.time; + data.timeRangeStart = data.time[0]; + data.timeRangeEnd = data.time[1]; + if (data.id != undefined) { + managerUpd(data).then((response) => { + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + }); + } else { + managerAdd(data).then((response) => { + this.$modal.msgSuccess("新增成功"); + this.open = false; + this.getList(); + }); + } + } + }); + }, - /** 删除按钮操作 */ - handleDelete(row) { - const idList = row.id ? [row.id] : this.ids; - this.$modal - .confirm("是否确认删除当前选择的数据?") - .then(function() { - return managerDel({ - idList: idList, - }); - }) - .then(() => { - this.$modal.msgSuccess("删除成功"); - this.getList(); - }) - .catch(() => {}); - }, - }, - }; + /** 删除按钮操作 */ + handleDelete(row) { + const idList = row.id ? [row.id] : this.ids; + this.$modal + .confirm("是否确认删除当前选择的数据?") + .then(function () { + return managerDel({ + idList: idList, + }); + }) + .then(() => { + this.$modal.msgSuccess("删除成功"); + this.getList(); + }) + .catch(() => {}); + }, + }, +}; </script> <style scoped src="@/assets/styles/common.css"></style> <style scoped> - .div-title1 { - font-size: 22px; - font-weight: bold; - margin-bottom: 10px; - } +.div-title1 { + font-size: 22px; + font-weight: bold; + margin-bottom: 10px; +} - .div-title2 { - font-size: 20px; - font-weight: bold; - margin-bottom: 10px; - } +.div-title2 { + font-size: 20px; + font-weight: bold; + margin-bottom: 10px; +} - .div-title3 { - font-size: 18px; - font-weight: bold; - margin-bottom: 10px; - } +.div-title3 { + font-size: 18px; + font-weight: bold; + margin-bottom: 10px; +} - .span-but { - display: inline-block; - border-radius: 4px; - border: 1px solid #dcdfe6; - line-height: 32px; - padding: 0 15px; - margin: 5px; - } +.span-but { + display: inline-block; + border-radius: 4px; + border: 1px solid #dcdfe6; + line-height: 32px; + padding: 0 15px; + margin: 5px; +} - .span-but-active { - border: 1px solid #1890ff; - } +.span-but-active { + border: 1px solid #1890ff; +} - .human-body { - display: flex; - flex-wrap: wrap; - } +.human-body { + display: flex; + flex-wrap: wrap; +} - .human-body>>>.el-form-item { - width: 49%; - margin-right: 2%; - } +.human-body >>> .el-form-item { + width: 49%; + margin-right: 2%; +} - .human-body>>>.el-form-item:nth-of-type(2n) { - margin-right: 0; - } +.human-body >>> .el-form-item:nth-of-type(2n) { + margin-right: 0; +} - .formStep1>>>.el-form-item__label {} +.formStep1 >>> .el-form-item__label { +} - .form-item-zd { - width: 100%; - text-align: left; - } +.form-item-zd { + width: 100%; + text-align: left; +} - .form-item-age { - display: flex; - align-items: center; - } +.form-item-age { + display: flex; + align-items: center; +} - .form-item-age span { - margin: 0 10px; - } +.form-item-age span { + margin: 0 10px; +} - .form-item-age>>>.el-input { - width: 100px; - } +.form-item-age >>> .el-input { + width: 100px; +} - >>>.el-drawer.rtl { - width: 50% !important; - } -</style> \ No newline at end of file +>>> .el-drawer.rtl { + width: 50% !important; +} +</style> diff --git a/acupuncture-后台/src/views/report/type.vue b/acupuncture-后台/src/views/report/type.vue index ce57cdf9..bdf53bef 100644 --- a/acupuncture-后台/src/views/report/type.vue +++ b/acupuncture-后台/src/views/report/type.vue @@ -1,265 +1,504 @@ <template> - <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" - label-width="80px"> - <el-form-item label="类型名称" prop="typeName"> - <el-input v-model="queryParams.param.typeName" 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">新增</el-button> - </el-col> - <el-col :span="1.5"> - <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" - @click="handleDelete">删除</el-button> - </el-col> - <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> - </el-row> + <div class="app-container"> + <el-form + :model="queryParams" + ref="queryForm" + size="small" + :inline="true" + v-show="showSearch" + label-width="80px" + > + <el-form-item label="类型名称" prop="typeName"> + <el-input + v-model="queryParams.param.typeName" + 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" + >新增</el-button + > + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + >删除</el-button + > + </el-col> + <right-toolbar + :showSearch.sync="showSearch" + @queryTable="getList" + ></right-toolbar> + </el-row> - <el-table v-loading="loading" :data="listData" @selection-change="handleSelectionChange" max-height="600"> - <el-table-column type="selection" width="55" align="center" /> - <el-table-column fixed label="类型名称" align="center" prop="typeName" min-width="100" /> - <el-table-column label="创建人/创建时间" align="center" min-width="140"> - <template slot-scope="scope"> - <div>{{scope.row.createBy}}</div> - <span> - {{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }} - </span> - </template> - </el-table-column> - <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200"> - <template slot-scope="scope"> - <el-button size="mini" type="text" icon="el-icon-edit" - @click="handleUpdate(scope.row)">修改</el-button> - <el-button size="mini" type="text" icon="el-icon-delete" - @click="handleDelete(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> + <el-table + v-loading="loading" + :data="listData" + @selection-change="handleSelectionChange" + max-height="600" + > + <el-table-column type="selection" width="55" align="center" /> + <el-table-column + fixed + label="类型名称" + align="center" + prop="typeName" + min-width="100" + show-overflow-tooltip + /> + <el-table-column + label="单位" + align="center" + prop="tenantIdList" + min-width="250" + show-overflow-tooltip + > + <template slot-scope="scope"> + <!-- 通过id列表找到tenantsData中匹配的数据并替换为中文,数据后面添加逗号 --> + <template v-for="(item, index) in scope.row.tenantIdList"> + <template v-if="tenantsData.some((tenant) => tenant.id === item)"> + {{ tenantsData.find((tenant) => tenant.id === item).name + }}{{ index < scope.row.tenantIdList.length - 1 ? "," : "" }} + </template> + </template> + </template> + </el-table-column> + <el-table-column + label="附件" + align="center" + prop="typeName" + min-width="150" + show-overflow-tooltip + > + <template slot-scope="scope"> + <el-button type="text" size="mini" @click="handleDownload(scope.row)"> + <span v-if="scope.row.file"> + <i class="el-icon-download"></i> + <span>{{ + scope.row.file.substring(scope.row.file.lastIndexOf("/") + 1) + }}</span> + </span> + </el-button> + </template> + </el-table-column> + <el-table-column + label="备注" + align="center" + prop="remark" + min-width="150" + show-overflow-tooltip + /> + <el-table-column label="创建人/创建时间" align="center" min-width="140"> + <template slot-scope="scope"> + <div>{{ scope.row.createBy }}</div> + <span> + {{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }} + </span> + </template> + </el-table-column> + <el-table-column + fixed="right" + label="操作" + align="center" + class-name="small-padding fixed-width" + width="200" + > + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + >修改</el-button + > + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + >删除</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" /> + <pagination + v-show="total > 0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> - <!-- 添加或修改公告对话框 --> - <el-dialog class="popup" :title="title" :visible.sync="open" width="780px" append-to-body> - <el-form ref="form" :model="form" :rules="rules" label-width="90px" class="formStep"> - <el-form-item label="类型名称" prop="typeName"> - <el-input v-model="form.typeName" 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> - </div> + <!-- 添加或修改公告对话框 --> + <el-dialog + class="popup" + :title="title" + :visible.sync="open" + width="780px" + append-to-body + > + <el-form + ref="form" + :model="form" + :rules="rules" + label-width="90px" + class="formStep" + > + <el-form-item label="类型名称" prop="typeName"> + <el-input v-model="form.typeName" placeholder="请输入" /> + </el-form-item> + <el-form-item label="单位" prop="tenantIdList"> + <el-select v-model="form.tenantIdList" multiple placeholder="请选择"> + <el-option + v-for="item in tenantsData" + :key="item.id" + :label="item.name" + :value="item.id" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item label="附件" prop="file"> + <el-upload + :limit="1" + class="avatar-uploader wj-uploader" + :headers="headers" + :action="uploadFileUrl" + accept=".xlsx,.xls,.pdf,.doc,.docx" + :before-upload="handleBeforePdfUpload1" + :on-success="handleUploadPdfAdd1" + :on-remove="handleRemove" + :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-item label="备注" prop="remark"> + <el-input + type="textarea" + v-model="form.remark" + 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> + </div> </template> <script> - import { - reportList, - reportAdd, - reportUpd, - reportDel - } from "@/api/report"; - export default { - name: "Notice", - data() { - return { - dataSourceList: [], - queryParams: { - param: { - name: "", - } - }, - listData: [], - title: '', - open: false, - total: 0, - form: {}, - loading: false, - showSearch: true, - multiple: false, - // 表单校验 - rules: { - typeName: [{ - required: true, - message: "上报类型不能为空", - trigger: "blur", - }], - }, - }; - }, - created() { - this.getList(); - }, - methods: { - /** 查询公告列表 */ - getList() { - this.loading = true; - reportList(this.queryParams).then((res) => { - this.listData = res.data.list; - this.total = res.data.total; - this.loading = false; - }); - }, - // 取消按钮 - cancel() { - this.open = false; - this.reset(); - }, - // 表单重置 - reset() { - this.form = { - "typeName": "", - }; - this.resetForm("form"); - }, - /** 搜索按钮操作 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, - /** 重置按钮操作 */ - resetQuery() { - this.queryParams.param = { - typeName: "", - }; - 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.open = true; - this.title = "修改诊疗档案"; - this.form = JSON.parse(JSON.stringify(row)) - }, - /** 诊疗档案 */ - submitForm: function() { - this.$refs["form"].validate((valid) => { - if (valid) { - if (this.form.id != undefined) { - reportUpd(this.form).then((response) => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); - } else { - reportAdd(this.form).then((response) => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); - } - } - }); - }, +import { getToken } from "@/utils/auth"; +import { tenantsList } from "@/api/member"; +import { reportList, reportAdd, reportUpd, reportDel } from "@/api/report"; +export default { + name: "Notice", + data() { + return { + uploadFileUrl: process.env.VUE_APP_API_QZURL + "/common/upload", // 上传的图片服务器地址 + headers: { + Authorization: "Bearer " + getToken(), + }, + dataSourceList: [], + queryParams: { + param: { + name: "", + }, + }, + listData: [], + title: "", + open: false, + total: 0, + form: {}, + loading: false, + showSearch: true, + multiple: false, + // 表单校验 + rules: { + typeName: [ + { + required: true, + message: "上报类型不能为空", + trigger: "blur", + }, + ], + tenantIdList: [ + { + required: true, + message: "单位不能为空", + trigger: "change", + }, + ], + file: [ + { + required: true, + message: "附件不能为空", + trigger: "change", + }, + ], + }, + tenantsData: [], + fileList: [], + qzUrl: process.env.VUE_APP_API_QZURL, // 二维码路径 + }; + }, + created() { + this.getList(); + this.getTenantsList(); + }, + methods: { + handleDownload(row) { + window.open(this.qzUrl + row.file); + }, + handleRemove(file, fileList) { + this.form.file = ""; + this.fileList = []; + }, + // 上传成功回 - pdg + handleUploadPdfAdd1(res) { + if (res.code == 200) { + this.$message.success(res.msg || "导入成功"); + this.form.file = res.fileName; + setTimeout(() => { + this.$refs["form"].validateField("file", (errorMessage) => {}); + }); + } else { + this.$message.error(res.msg || "导入失败"); + this.fileList = []; + } + }, - /** 删除按钮操作 */ - handleDelete(row) { - const idList = row.id ? [row.id] : this.ids; - this.$modal - .confirm("是否确认删除当前选择的数据?") - .then(function() { - return reportDel({ - idList: idList, - }); - }) - .then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }) - .catch(() => {}); - }, - }, - }; + // 上传前校检格式和大小 - 文件 + handleBeforePdfUpload1(file) { + const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1); + const whiteList = ["xlsx", "xls", "pdf", "doc", "docx"]; + if (whiteList.indexOf(fileSuffix) === -1) { + this.$message.error("上传文件只能是xlsx/xls/pdf/doc/docx 格式!"); + return false; + } + }, + /** 查询公告列表 */ + getTenantsList() { + tenantsList({ + pageNum: -1, + param: {}, + }).then((res) => { + this.tenantsData = res.data.list; + }); + }, + /** 查询公告列表 */ + getList() { + this.loading = true; + reportList(this.queryParams).then((res) => { + this.listData = res.data.list; + this.total = res.data.total; + this.loading = false; + }); + }, + // 取消按钮 + cancel() { + this.open = false; + this.reset(); + }, + // 表单重置 + reset() { + this.fileList = []; + this.form = { + typeName: "", + tenantIdList: [], + remark: "", + file: "", + }; + this.resetForm("form"); + }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 重置按钮操作 */ + resetQuery() { + this.queryParams.param = { + typeName: "", + }; + 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.open = true; + this.title = "修改上报类型"; + this.form = JSON.parse(JSON.stringify(row)); + if (row.file) { + this.fileList = [ + { + // 截取字符串,获取文件名 + name: row.file.substring(row.file.lastIndexOf("/") + 1), + url: row.file, + }, + ]; + } else { + this.fileList = []; + } + }, + /** 诊疗档案 */ + submitForm: function () { + this.$refs["form"].validate((valid) => { + if (valid) { + if (this.form.id != undefined) { + reportUpd(this.form).then((response) => { + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + }); + } else { + reportAdd(this.form).then((response) => { + this.$modal.msgSuccess("新增成功"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + + /** 删除按钮操作 */ + handleDelete(row) { + const idList = row.id ? [row.id] : this.ids; + this.$modal + .confirm("是否确认删除当前选择的数据?") + .then(function () { + return reportDel({ + idList: idList, + }); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }) + .catch(() => {}); + }, + }, +}; </script> <style scoped src="@/assets/styles/common.css"></style> <style scoped> - .div-title1 { - font-size: 22px; - font-weight: bold; - margin-bottom: 10px; - } +>>> .el-upload-list__item:first-child { + margin-top: 0 !important; +} +.div-title1 { + font-size: 22px; + font-weight: bold; + margin-bottom: 10px; +} - .div-title2 { - font-size: 20px; - font-weight: bold; - margin-bottom: 10px; - } +.div-title2 { + font-size: 20px; + font-weight: bold; + margin-bottom: 10px; +} - .div-title3 { - font-size: 18px; - font-weight: bold; - margin-bottom: 10px; - } +.div-title3 { + font-size: 18px; + font-weight: bold; + margin-bottom: 10px; +} - .span-but { - display: inline-block; - border-radius: 4px; - border: 1px solid #dcdfe6; - line-height: 32px; - padding: 0 15px; - margin: 5px; - } +.span-but { + display: inline-block; + border-radius: 4px; + border: 1px solid #dcdfe6; + line-height: 32px; + padding: 0 15px; + margin: 5px; +} - .span-but-active { - border: 1px solid #1890ff; - } +.span-but-active { + border: 1px solid #1890ff; +} - .human-body { - display: flex; - flex-wrap: wrap; - } +.human-body { + display: flex; + flex-wrap: wrap; +} - .human-body>>>.el-form-item { - width: 49%; - margin-right: 2%; - } +.human-body >>> .el-form-item { + width: 49%; + margin-right: 2%; +} - .human-body>>>.el-form-item:nth-of-type(2n) { - margin-right: 0; - } +.human-body >>> .el-form-item:nth-of-type(2n) { + margin-right: 0; +} - .formStep1>>>.el-form-item__label {} +.formStep1 >>> .el-form-item__label { +} - .form-item-zd { - width: 100%; - text-align: left; - } +.form-item-zd { + width: 100%; + text-align: left; +} - .form-item-age { - display: flex; - align-items: center; - } +.form-item-age { + display: flex; + align-items: center; +} - .form-item-age span { - margin: 0 10px; - } +.form-item-age span { + margin: 0 10px; +} - .form-item-age>>>.el-input { - width: 100px; - } +.form-item-age >>> .el-input { + width: 100px; +} - >>>.el-drawer.rtl { - width: 50% !important; - } -</style> \ No newline at end of file +>>> .el-drawer.rtl { + width: 50% !important; +} +</style> diff --git a/acupuncture-后台/src/views/system/dict/data.vue b/acupuncture-后台/src/views/system/dict/data.vue index 3befe4a6..5af3b941 100644 --- a/acupuncture-后台/src/views/system/dict/data.vue +++ b/acupuncture-后台/src/views/system/dict/data.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="dictType"> <el-select v-model="queryParams.dictType"> <el-option @@ -20,7 +27,11 @@ /> </el-form-item> <el-form-item label="状态" prop="status"> - <el-select v-model="queryParams.status" placeholder="数据状态" clearable> + <el-select + v-model="queryParams.status" + placeholder="数据状态" + clearable + > <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" @@ -30,8 +41,16 @@ </el-select> </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> @@ -44,7 +63,8 @@ size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']" - >新增</el-button> + >新增</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -55,7 +75,8 @@ :disabled="single" @click="handleUpdate" v-hasPermi="['system:dict:edit']" - >修改</el-button> + >修改</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -66,7 +87,8 @@ :disabled="multiple" @click="handleDelete" v-hasPermi="['system:dict:remove']" - >删除</el-button> + >删除</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -76,7 +98,8 @@ size="mini" @click="handleExport" v-hasPermi="['system:dict:export']" - >导出</el-button> + >导出</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -85,34 +108,87 @@ icon="el-icon-close" size="mini" @click="handleClose" - >关闭</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="dataList" @selection-change="handleSelectionChange"> + <el-table + v-loading="loading" + :data="dataList" + @selection-change="handleSelectionChange" + > <el-table-column type="selection" width="55" align="center" /> <el-table-column label="字典编码" align="center" prop="dictCode" /> <el-table-column label="字典标签" align="center" prop="dictLabel"> <template slot-scope="scope"> - <span v-if="(scope.row.listClass == '' || scope.row.listClass == 'default') && (scope.row.cssClass == '' || scope.row.cssClass == null)">{{ scope.row.dictLabel }}</span> - <el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass" :class="scope.row.cssClass">{{ scope.row.dictLabel }}</el-tag> + <span + v-if=" + (scope.row.listClass == '' || scope.row.listClass == 'default') && + (scope.row.cssClass == '' || scope.row.cssClass == null) + " + >{{ scope.row.dictLabel }}</span + > + <el-tag + v-else + :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass" + :class="scope.row.cssClass" + >{{ scope.row.dictLabel }}</el-tag + > </template> </el-table-column> <el-table-column label="字典键值" align="center" prop="dictValue" /> <el-table-column label="字典排序" align="center" prop="dictSort" /> + <el-table-column label="数据类型" align="center" prop="dataType" /> + <!-- 长度,是否必填,是否唯一 --> + <el-table-column label="长度" align="center" prop="dataLength" /> + <el-table-column label="是否必填" align="center" width="100"> + <template slot-scope="scope"> + <el-tag type="info" v-if="scope.row.isRequired == 0">否</el-tag> + <el-tag type="success" v-if="scope.row.isRequired == 1">是</el-tag> + </template> + </el-table-column> + <el-table-column label="是否唯一" align="center" width="100"> + <template slot-scope="scope"> + <el-tag type="info" v-if="scope.row.isSole == 0">否</el-tag> + <el-tag type="success" v-if="scope.row.isSole == 1">是</el-tag> + </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" + fixed="right" + width="150" + > <template slot-scope="scope"> <el-button size="mini" @@ -120,20 +196,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" @@ -155,8 +233,30 @@ <el-form-item label="样式属性" prop="cssClass"> <el-input v-model="form.cssClass" placeholder="请输入样式属性" /> </el-form-item> + <el-form-item label="数据类型" prop="dataType"> + <el-input v-model="form.dataType" placeholder="请输入" /> + </el-form-item> + <el-form-item label="长度" prop="dataLength"> + <el-input v-model="form.dataLength" placeholder="请输入长度" /> + </el-form-item> + <el-form-item label="是否必填" prop="isRequired"> + <el-radio-group v-model="form.isRequired"> + <el-radio label="1">是</el-radio> + <el-radio label="0">否</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="是否唯一" prop="isSole"> + <el-radio-group v-model="form.isSole"> + <el-radio label="1">是</el-radio> + <el-radio label="0">否</el-radio> + </el-radio-group> + </el-form-item> <el-form-item label="显示排序" prop="dictSort"> - <el-input-number v-model="form.dictSort" controls-position="right" :min="0" /> + <el-input-number + v-model="form.dictSort" + controls-position="right" + :min="0" + /> </el-form-item> <el-form-item label="回显样式" prop="listClass"> <el-select v-model="form.listClass"> @@ -174,11 +274,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"> @@ -190,12 +295,21 @@ </template> <script> -import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data"; -import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type"; +import { + listData, + getData, + delData, + addData, + updateData, +} from "@/api/system/dict/data"; +import { + optionselect as getDictOptionselect, + getType, +} from "@/api/system/dict/type"; export default { name: "Data", - dicts: ['sys_normal_disable'], + dicts: ["sys_normal_disable"], data() { return { // 遮罩层 @@ -222,28 +336,28 @@ export default { listClassOptions: [ { value: "default", - label: "默认" + label: "默认", }, { value: "primary", - label: "主要" + label: "主要", }, { value: "success", - label: "成功" + label: "成功", }, { value: "info", - label: "信息" + label: "信息", }, { value: "warning", - label: "警告" + label: "警告", }, { value: "danger", - label: "危险" - } + label: "危险", + }, ], // 类型数据字典 typeOptions: [], @@ -253,22 +367,22 @@ export default { pageSize: 10, dictType: undefined, dictLabel: undefined, - status: undefined + status: undefined, }, // 表单参数 form: {}, // 表单校验 rules: { dictLabel: [ - { required: true, message: "数据标签不能为空", trigger: "blur" } + { required: true, message: "数据标签不能为空", trigger: "blur" }, ], dictValue: [ - { required: true, message: "数据键值不能为空", trigger: "blur" } + { required: true, message: "数据键值不能为空", trigger: "blur" }, ], dictSort: [ - { required: true, message: "数据顺序不能为空", trigger: "blur" } - ] - } + { required: true, message: "数据顺序不能为空", trigger: "blur" }, + ], + }, }; }, created() { @@ -279,7 +393,7 @@ export default { methods: { /** 查询字典类型详细 */ getType(dictId) { - getType(dictId).then(response => { + getType(dictId).then((response) => { this.queryParams.dictType = response.data.dictType; this.defaultDictType = response.data.dictType; this.getList(); @@ -287,14 +401,14 @@ export default { }, /** 查询字典类型列表 */ getTypeList() { - getDictOptionselect().then(response => { + getDictOptionselect().then((response) => { this.typeOptions = response.data; }); }, /** 查询字典数据列表 */ getList() { this.loading = true; - listData(this.queryParams).then(response => { + listData(this.queryParams).then((response) => { this.dataList = response.rows; this.total = response.total; this.loading = false; @@ -312,10 +426,14 @@ export default { dictLabel: undefined, dictValue: undefined, cssClass: undefined, - listClass: 'default', + listClass: "default", dictSort: 0, status: "0", - remark: undefined + remark: undefined, + dataType: "", + dataLength: "", + isRequired: 1, + isSole: 1, }; this.resetForm("form"); }, @@ -344,34 +462,40 @@ export default { }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map(item => item.dictCode) - this.single = selection.length!=1 - this.multiple = !selection.length + this.ids = selection.map((item) => item.dictCode); + this.single = selection.length != 1; + this.multiple = !selection.length; }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const dictCode = row.dictCode || this.ids - getData(dictCode).then(response => { + const dictCode = row.dictCode || this.ids; + getData(dictCode).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.dictCode != undefined) { - updateData(this.form).then(response => { - this.$store.dispatch('dict/removeDict', this.queryParams.dictType); + updateData(this.form).then((response) => { + this.$store.dispatch( + "dict/removeDict", + this.queryParams.dictType + ); this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); } else { - addData(this.form).then(response => { - this.$store.dispatch('dict/removeDict', this.queryParams.dictType); + addData(this.form).then((response) => { + this.$store.dispatch( + "dict/removeDict", + this.queryParams.dictType + ); this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); @@ -383,20 +507,28 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const dictCodes = row.dictCode || this.ids; - this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() { - return delData(dictCodes); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - this.$store.dispatch('dict/removeDict', this.queryParams.dictType); - }).catch(() => {}); + this.$modal + .confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?') + .then(function () { + return delData(dictCodes); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + this.$store.dispatch("dict/removeDict", this.queryParams.dictType); + }) + .catch(() => {}); }, /** 导出按钮操作 */ handleExport() { - this.download('system/dict/data/export', { - ...this.queryParams - }, `data_${new Date().getTime()}.xlsx`) - } - } + this.download( + "system/dict/data/export", + { + ...this.queryParams, + }, + `data_${new Date().getTime()}.xlsx` + ); + }, + }, }; -</script> \ No newline at end of file +</script> diff --git a/acupuncture-后台/src/views/system/dict/index.vue b/acupuncture-后台/src/views/system/dict/index.vue index 6a1dede9..cc7e40cb 100644 --- a/acupuncture-后台/src/views/system/dict/index.vue +++ b/acupuncture-后台/src/views/system/dict/index.vue @@ -168,6 +168,7 @@ </router-link> </template> </el-table-column> + <el-table-column label="状态" align="center" prop="status"> <template slot-scope="scope"> <dict-tag @@ -235,6 +236,7 @@ <el-form-item label="字典类型" prop="dictType"> <el-input v-model="form.dictType" placeholder="请输入字典类型" /> </el-form-item> + <el-form-item label="状态" prop="status"> <el-radio-group v-model="form.status"> <el-radio diff --git a/acupuncture-后台/src/views/system/menu/index.vue b/acupuncture-后台/src/views/system/menu/index.vue index c4b50031..f77817e4 100644 --- a/acupuncture-后台/src/views/system/menu/index.vue +++ b/acupuncture-后台/src/views/system/menu/index.vue @@ -19,6 +19,17 @@ /> </el-select> </el-form-item> + <el-form-item label="客户端类型" prop="status"> + <el-select + v-model="queryParams.clientType" + placeholder="客户端类型" + clearable + style="width: 240px" + > + <el-option label="PC端" :value="0" /> + <el-option label="移动端" :value="1" /> + </el-select> + </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> @@ -70,6 +81,12 @@ <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> </template> </el-table-column> + <el-table-column label="客户端类型" align="center" width="100"> + <template slot-scope="scope"> + <el-tag type="success" v-if="scope.row.clientType === 0">PC端</el-tag> + <el-tag type="info" v-if="scope.row.clientType === 1">移动端</el-tag> + </template> + </el-table-column> <el-table-column label="创建时间" align="center" prop="createTime"> <template slot-scope="scope"> <span>{{ parseTime(scope.row.createTime) }}</span> @@ -278,6 +295,16 @@ </el-form-item> </el-col> </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="客户端类型"> + <el-radio-group v-model="form.clientType"> + <el-radio :label="0">PC端</el-radio> + <el-radio :label="1">移动端</el-radio> + </el-radio-group> + </el-form-item> + </el-col> + </el-row> </el-form> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitForm">确 定</el-button> @@ -389,7 +416,8 @@ export default { isFrame: "1", isCache: "0", visible: "0", - status: "0" + status: "0", + clientType: 0 }; this.resetForm("form"); }, diff --git a/acupuncture-后台/src/views/system/notice/index.vue b/acupuncture-后台/src/views/system/notice/index.vue index 7982b545..9b7c9f18 100644 --- a/acupuncture-后台/src/views/system/notice/index.vue +++ b/acupuncture-后台/src/views/system/notice/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="noticeTitle"> <el-input v-model="queryParams.noticeTitle" @@ -18,7 +25,11 @@ /> </el-form-item> <el-form-item label="类型" prop="noticeType"> - <el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable> + <el-select + v-model="queryParams.noticeType" + placeholder="公告类型" + clearable + > <el-option v-for="dict in dict.type.sys_notice_type" :key="dict.value" @@ -28,8 +39,16 @@ </el-select> </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> @@ -42,7 +61,8 @@ size="mini" @click="handleAdd" v-hasPermi="['system:notice:add']" - >新增</el-button> + >新增</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -53,7 +73,8 @@ :disabled="single" @click="handleUpdate" v-hasPermi="['system:notice:edit']" - >修改</el-button> + >修改</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -64,37 +85,88 @@ :disabled="multiple" @click="handleDelete" v-hasPermi="['system:notice: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="noticeList" @selection-change="handleSelectionChange"> + <el-table + v-loading="loading" + :data="noticeList" + @selection-change="handleSelectionChange" + > <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="序号" align="center" prop="noticeId" width="100" /> + <el-table-column + label="序号" + align="center" + prop="noticeId" + width="100" + /> <el-table-column label="公告标题" align="center" prop="noticeTitle" :show-overflow-tooltip="true" /> - <el-table-column label="公告类型" align="center" prop="noticeType" width="100"> + + <el-table-column + label="公告类型" + align="center" + prop="noticeType" + width="100" + > <template slot-scope="scope"> - <dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/> + <dict-tag + :options="dict.type.sys_notice_type" + :value="scope.row.noticeType" + /> </template> </el-table-column> <el-table-column label="状态" align="center" prop="status" width="100"> <template slot-scope="scope"> - <dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/> + <dict-tag + :options="dict.type.sys_notice_status" + :value="scope.row.status" + /> </template> </el-table-column> - <el-table-column label="创建者" align="center" prop="createBy" width="100" /> - <el-table-column label="创建时间" align="center" prop="createTime" width="100"> + <el-table-column + label="创建者" + align="center" + prop="createBy" + width="100" + /> + <el-table-column + label="创建时间" + align="center" + prop="createTime" + width="100" + > <template slot-scope="scope"> - <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> + <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span> </template> </el-table-column> - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> + <el-table-column + label="更新时间" + align="center" + prop="createTime" + width="140" + > + <template slot-scope="scope"> + <span>{{ + parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{i}") + }}</span> + </template> + </el-table-column> + <el-table-column + label="操作" + align="center" + class-name="small-padding fixed-width" + > <template slot-scope="scope"> <el-button size="mini" @@ -102,20 +174,22 @@ icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:notice:edit']" - >修改</el-button> + >修改</el-button + > <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice: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" @@ -125,41 +199,48 @@ <!-- 添加或修改公告对话框 --> <el-dialog :title="title" :visible.sync="open" width="780px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> - <el-row> - <el-col :span="12"> - <el-form-item label="公告标题" prop="noticeTitle"> - <el-input v-model="form.noticeTitle" placeholder="请输入公告标题" /> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="公告类型" prop="noticeType"> - <el-select v-model="form.noticeType" placeholder="请选择公告类型"> - <el-option - v-for="dict in dict.type.sys_notice_type" - :key="dict.value" - :label="dict.label" - :value="dict.value" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :span="24"> - <el-form-item label="状态"> - <el-radio-group v-model="form.status"> - <el-radio - v-for="dict in dict.type.sys_notice_status" - :key="dict.value" - :label="dict.value" - >{{dict.label}}</el-radio> - </el-radio-group> - </el-form-item> - </el-col> - <el-col :span="24"> - <el-form-item label="内容"> - <editor v-model="form.noticeContent" :min-height="192"/> - </el-form-item> - </el-col> - </el-row> + <el-form-item label="公告标题" prop="noticeTitle"> + <el-input v-model="form.noticeTitle" placeholder="请输入公告标题" /> + </el-form-item> + <el-form-item label="公告类型" prop="noticeType"> + <el-select v-model="form.noticeType" placeholder="请选择公告类型"> + <el-option + v-for="dict in dict.type.sys_notice_type" + :key="dict.value" + :label="dict.label" + :value="dict.value" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="通知用户" prop="userIdList"> + <el-select + v-model="form.userIdList" + multiple + placeholder="请选择" + style="width: 100%" + > + <el-option + v-for="item in userList" + :key="item.userId" + :label="`${item.userName}-${item.nickName}`" + :value="item.userId" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item label="状态"> + <el-radio-group v-model="form.status"> + <el-radio + v-for="dict in dict.type.sys_notice_status" + :key="dict.value" + :label="dict.value" + >{{ dict.label }}</el-radio + > + </el-radio-group> + </el-form-item> + <el-form-item label="内容"> + <editor v-model="form.noticeContent" :min-height="192" /> + </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitForm">确 定</el-button> @@ -170,11 +251,17 @@ </template> <script> -import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"; - +import { + listNotice, + getNotice, + delNotice, + addNotice, + updateNotice, +} from "@/api/system/notice"; +import { listUser } from "@/api/system/user"; export default { name: "Notice", - dicts: ['sys_notice_status', 'sys_notice_type'], + dicts: ["sys_notice_status", "sys_notice_type"], data() { return { // 遮罩层 @@ -201,29 +288,47 @@ export default { pageSize: 10, noticeTitle: undefined, createBy: undefined, - status: undefined + status: undefined, }, // 表单参数 form: {}, // 表单校验 rules: { noticeTitle: [ - { required: true, message: "公告标题不能为空", trigger: "blur" } + { required: true, message: "公告标题不能为空", trigger: "blur" }, ], noticeType: [ - { required: true, message: "公告类型不能为空", trigger: "change" } - ] - } + { required: true, message: "公告类型不能为空", trigger: "change" }, + ], + userIdList: [ + { required: true, message: "通知用户不能为空", trigger: "blur" }, + ], + }, + userList: [], }; }, created() { this.getList(); + this.getUserList(); }, methods: { + /** 查询用户列表 */ + getUserList() { + listUser({ + pageNum: 1, + pageSize: 1000000, + }).then((response) => { + // 删除userName为admin的用户 + response.rows = response.rows.filter( + (item) => item.userName != "admin" + ); + this.userList = response.rows; + }); + }, /** 查询公告列表 */ getList() { this.loading = true; - listNotice(this.queryParams).then(response => { + listNotice(this.queryParams).then((response) => { this.noticeList = response.rows; this.total = response.total; this.loading = false; @@ -241,7 +346,8 @@ export default { noticeTitle: undefined, noticeType: undefined, noticeContent: undefined, - status: "0" + status: "0", + userIdList: [], }; this.resetForm("form"); }, @@ -257,9 +363,9 @@ export default { }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map(item => item.noticeId) - this.single = selection.length!=1 - this.multiple = !selection.length + this.ids = selection.map((item) => item.noticeId); + this.single = selection.length != 1; + this.multiple = !selection.length; }, /** 新增按钮操作 */ handleAdd() { @@ -270,25 +376,25 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const noticeId = row.noticeId || this.ids - getNotice(noticeId).then(response => { + const noticeId = row.noticeId || this.ids; + getNotice(noticeId).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.noticeId != undefined) { - updateNotice(this.form).then(response => { + updateNotice(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); } else { - addNotice(this.form).then(response => { + addNotice(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); @@ -299,14 +405,18 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - const noticeIds = row.noticeId || this.ids - this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() { - return delNotice(noticeIds); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); - } - } + const noticeIds = row.noticeId || this.ids; + this.$modal + .confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?') + .then(function () { + return delNotice(noticeIds); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }) + .catch(() => {}); + }, + }, }; </script> diff --git a/acupuncture-后台/src/views/system/role/index.vue b/acupuncture-后台/src/views/system/role/index.vue index 47419baa..b5d5c66f 100644 --- a/acupuncture-后台/src/views/system/role/index.vue +++ b/acupuncture-后台/src/views/system/role/index.vue @@ -1,6 +1,12 @@ <template> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> + <el-form + :model="queryParams" + ref="queryForm" + size="small" + :inline="true" + v-show="showSearch" + > <el-form-item label="角色名称" prop="roleName"> <el-input v-model="queryParams.roleName" @@ -34,6 +40,17 @@ /> </el-select> </el-form-item> + <el-form-item label="客户端类型" prop="status"> + <el-select + v-model="queryParams.clientType" + placeholder="客户端类型" + clearable + style="width: 240px" + > + <el-option label="PC端" :value="0" /> + <el-option label="移动端" :value="1" /> + </el-select> + </el-form-item> <el-form-item label="创建时间"> <el-date-picker v-model="dateRange" @@ -46,8 +63,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 +85,8 @@ size="mini" @click="handleAdd" v-hasPermi="['system:role:add']" - >新增</el-button> + >新增</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -71,7 +97,8 @@ :disabled="single" @click="handleUpdate" v-hasPermi="['system:role:edit']" - >修改</el-button> + >修改</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -82,7 +109,8 @@ :disabled="multiple" @click="handleDelete" v-hasPermi="['system:role:remove']" - >删除</el-button> + >删除</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -92,16 +120,34 @@ size="mini" @click="handleExport" v-hasPermi="['system:role:export']" - >导出</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="roleList" @selection-change="handleSelectionChange"> + <el-table + v-loading="loading" + :data="roleList" + @selection-change="handleSelectionChange" + > <el-table-column type="selection" width="55" align="center" /> <el-table-column label="角色编号" prop="roleId" width="120" /> - <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> - <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" /> + <el-table-column + label="角色名称" + prop="roleName" + :show-overflow-tooltip="true" + width="150" + /> + <el-table-column + label="权限字符" + prop="roleKey" + :show-overflow-tooltip="true" + width="150" + /> <el-table-column label="显示顺序" prop="roleSort" width="100" /> <el-table-column label="状态" align="center" width="100"> <template slot-scope="scope"> @@ -113,12 +159,27 @@ ></el-switch> </template> </el-table-column> - <el-table-column label="创建时间" align="center" prop="createTime" width="180"> + <el-table-column label="客户端类型" align="center" width="100"> + <template slot-scope="scope"> + <el-tag type="success" v-if="scope.row.clientType === 0">PC端</el-tag> + <el-tag type="info" v-if="scope.row.clientType === 1">移动端</el-tag> + </template> + </el-table-column> + <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" v-if="scope.row.roleId !== 1"> <el-button size="mini" @@ -126,21 +187,37 @@ icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:role:edit']" - >修改</el-button> + >修改</el-button + > <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']" - >删除</el-button> - <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']"> - <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button> + >删除</el-button + > + <el-dropdown + size="mini" + @command="(command) => handleCommand(command, scope.row)" + v-hasPermi="['system:role:edit']" + > + <el-button size="mini" type="text" icon="el-icon-d-arrow-right" + >更多</el-button + > <el-dropdown-menu slot="dropdown"> - <el-dropdown-item command="handleDataScope" icon="el-icon-circle-check" - v-hasPermi="['system:role:edit']">数据权限</el-dropdown-item> - <el-dropdown-item command="handleAuthUser" icon="el-icon-user" - v-hasPermi="['system:role:edit']">分配用户</el-dropdown-item> + <el-dropdown-item + command="handleDataScope" + icon="el-icon-circle-check" + v-hasPermi="['system:role:edit']" + >数据权限</el-dropdown-item + > + <el-dropdown-item + command="handleAuthUser" + icon="el-icon-user" + v-hasPermi="['system:role:edit']" + >分配用户</el-dropdown-item + > </el-dropdown-menu> </el-dropdown> </template> @@ -148,7 +225,7 @@ </el-table> <pagination - v-show="total>0" + v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @@ -163,7 +240,10 @@ </el-form-item> <el-form-item prop="roleKey"> <span slot="label"> - <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top"> + <el-tooltip + content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" + placement="top" + > <i class="el-icon-question"></i> </el-tooltip> 权限字符 @@ -171,7 +251,11 @@ <el-input v-model="form.roleKey" placeholder="请输入权限字符" /> </el-form-item> <el-form-item label="角色顺序" prop="roleSort"> - <el-input-number v-model="form.roleSort" controls-position="right" :min="0" /> + <el-input-number + v-model="form.roleSort" + controls-position="right" + :min="0" + /> </el-form-item> <el-form-item label="状态"> <el-radio-group v-model="form.status"> @@ -179,13 +263,32 @@ 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="客户端类型"> + <el-radio-group v-model="form.clientType"> + <el-radio :label="0">PC端</el-radio> + <el-radio :label="1">移动端</el-radio> </el-radio-group> </el-form-item> <el-form-item label="菜单权限"> - <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox> - <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox> - <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox> + <el-checkbox + v-model="menuExpand" + @change="handleCheckedTreeExpand($event, 'menu')" + >展开/折叠</el-checkbox + > + <el-checkbox + v-model="menuNodeAll" + @change="handleCheckedTreeNodeAll($event, 'menu')" + >全选/全不选</el-checkbox + > + <el-checkbox + v-model="form.menuCheckStrictly" + @change="handleCheckedTreeConnect($event, 'menu')" + >父子联动</el-checkbox + > <el-tree class="tree-border" :data="menuOptions" @@ -198,7 +301,11 @@ ></el-tree> </el-form-item> <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-form> <div slot="footer" class="dialog-footer"> @@ -208,7 +315,12 @@ </el-dialog> <!-- 分配角色数据权限对话框 --> - <el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body> + <el-dialog + :title="title" + :visible.sync="openDataScope" + width="500px" + append-to-body + > <el-form :model="form" label-width="80px"> <el-form-item label="角色名称"> <el-input v-model="form.roleName" :disabled="true" /> @@ -227,9 +339,21 @@ </el-select> </el-form-item> <el-form-item label="数据权限" v-show="form.dataScope == 2"> - <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox> - <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox> - <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox> + <el-checkbox + v-model="deptExpand" + @change="handleCheckedTreeExpand($event, 'dept')" + >展开/折叠</el-checkbox + > + <el-checkbox + v-model="deptNodeAll" + @change="handleCheckedTreeNodeAll($event, 'dept')" + >全选/全不选</el-checkbox + > + <el-checkbox + v-model="form.deptCheckStrictly" + @change="handleCheckedTreeConnect($event, 'dept')" + >父子联动</el-checkbox + > <el-tree class="tree-border" :data="deptOptions" @@ -252,12 +376,24 @@ </template> <script> -import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"; -import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"; +import { + listRole, + getRole, + delRole, + addRole, + updateRole, + dataScope, + changeRoleStatus, + deptTreeSelect, +} from "@/api/system/role"; +import { + treeselect as menuTreeselect, + roleMenuTreeselect, +} from "@/api/system/menu"; export default { name: "Role", - dicts: ['sys_normal_disable'], + dicts: ["sys_normal_disable"], data() { return { // 遮罩层 @@ -290,24 +426,24 @@ export default { dataScopeOptions: [ { value: "1", - label: "全部数据权限" + label: "全部数据权限", }, { value: "2", - label: "自定数据权限" + label: "自定数据权限", }, { value: "3", - label: "本部门数据权限" + label: "本部门数据权限", }, { value: "4", - label: "本部门及以下数据权限" + label: "本部门及以下数据权限", }, { value: "5", - label: "仅本人数据权限" - } + label: "仅本人数据权限", + }, ], // 菜单列表 menuOptions: [], @@ -319,26 +455,26 @@ export default { pageSize: 10, roleName: undefined, roleKey: undefined, - status: undefined + status: undefined, }, // 表单参数 form: {}, defaultProps: { children: "children", - label: "label" + label: "label", }, // 表单校验 rules: { roleName: [ - { required: true, message: "角色名称不能为空", trigger: "blur" } + { required: true, message: "角色名称不能为空", trigger: "blur" }, ], roleKey: [ - { required: true, message: "权限字符不能为空", trigger: "blur" } + { required: true, message: "权限字符不能为空", trigger: "blur" }, ], roleSort: [ - { required: true, message: "角色顺序不能为空", trigger: "blur" } - ] - } + { required: true, message: "角色顺序不能为空", trigger: "blur" }, + ], + }, }; }, created() { @@ -348,7 +484,8 @@ export default { /** 查询角色列表 */ getList() { this.loading = true; - listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => { + listRole(this.addDateRange(this.queryParams, this.dateRange)).then( + (response) => { this.roleList = response.rows; this.total = response.total; this.loading = false; @@ -357,7 +494,7 @@ export default { }, /** 查询菜单树结构 */ getMenuTreeselect() { - menuTreeselect().then(response => { + menuTreeselect().then((response) => { this.menuOptions = response.data; }); }, @@ -381,14 +518,14 @@ export default { }, /** 根据角色ID查询菜单树结构 */ getRoleMenuTreeselect(roleId) { - return roleMenuTreeselect(roleId).then(response => { + return roleMenuTreeselect(roleId).then((response) => { this.menuOptions = response.menus; return response; }); }, /** 根据角色ID查询部门树结构 */ getDeptTree(roleId) { - return deptTreeSelect(roleId).then(response => { + return deptTreeSelect(roleId).then((response) => { this.deptOptions = response.depts; return response; }); @@ -396,13 +533,17 @@ export default { // 角色状态修改 handleStatusChange(row) { let text = row.status === "0" ? "启用" : "停用"; - this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() { - return changeRoleStatus(row.roleId, row.status); - }).then(() => { - this.$modal.msgSuccess(text + "成功"); - }).catch(function() { - row.status = row.status === "0" ? "1" : "0"; - }); + this.$modal + .confirm('确认要"' + text + '""' + row.roleName + '"角色吗?') + .then(function () { + return changeRoleStatus(row.roleId, row.status); + }) + .then(() => { + this.$modal.msgSuccess(text + "成功"); + }) + .catch(function () { + row.status = row.status === "0" ? "1" : "0"; + }); }, // 取消按钮 cancel() { @@ -419,22 +560,23 @@ export default { if (this.$refs.menu != undefined) { this.$refs.menu.setCheckedKeys([]); } - this.menuExpand = false, - this.menuNodeAll = false, - this.deptExpand = true, - this.deptNodeAll = false, - this.form = { - roleId: undefined, - roleName: undefined, - roleKey: undefined, - roleSort: 0, - status: "0", - menuIds: [], - deptIds: [], - menuCheckStrictly: true, - deptCheckStrictly: true, - remark: undefined - }; + (this.menuExpand = false), + (this.menuNodeAll = false), + (this.deptExpand = true), + (this.deptNodeAll = false), + (this.form = { + roleId: undefined, + roleName: undefined, + roleKey: undefined, + roleSort: 0, + status: "0", + menuIds: [], + deptIds: [], + menuCheckStrictly: true, + deptCheckStrictly: true, + remark: undefined, + clientType: 0, + }); this.resetForm("form"); }, /** 搜索按钮操作 */ @@ -450,9 +592,9 @@ export default { }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map(item => item.roleId) - this.single = selection.length!=1 - this.multiple = !selection.length + this.ids = selection.map((item) => item.roleId); + this.single = selection.length != 1; + this.multiple = !selection.length; }, // 更多操作触发 handleCommand(command, row) { @@ -469,12 +611,12 @@ export default { }, // 树权限(展开/折叠) handleCheckedTreeExpand(value, type) { - if (type == 'menu') { + if (type == "menu") { let treeList = this.menuOptions; for (let i = 0; i < treeList.length; i++) { this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value; } - } else if (type == 'dept') { + } else if (type == "dept") { let treeList = this.deptOptions; for (let i = 0; i < treeList.length; i++) { this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value; @@ -483,18 +625,18 @@ export default { }, // 树权限(全选/全不选) handleCheckedTreeNodeAll(value, type) { - if (type == 'menu') { - this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []); - } else if (type == 'dept') { - this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []); + if (type == "menu") { + this.$refs.menu.setCheckedNodes(value ? this.menuOptions : []); + } else if (type == "dept") { + this.$refs.dept.setCheckedNodes(value ? this.deptOptions : []); } }, // 树权限(父子联动) handleCheckedTreeConnect(value, type) { - if (type == 'menu') { - this.form.menuCheckStrictly = value ? true: false; - } else if (type == 'dept') { - this.form.deptCheckStrictly = value ? true: false; + if (type == "menu") { + this.form.menuCheckStrictly = value ? true : false; + } else if (type == "dept") { + this.form.deptCheckStrictly = value ? true : false; } }, /** 新增按钮操作 */ @@ -507,19 +649,19 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const roleId = row.roleId || this.ids + const roleId = row.roleId || this.ids; const roleMenu = this.getRoleMenuTreeselect(roleId); - getRole(roleId).then(response => { + getRole(roleId).then((response) => { this.form = response.data; this.open = true; this.$nextTick(() => { - roleMenu.then(res => { - let checkedKeys = res.checkedKeys + roleMenu.then((res) => { + let checkedKeys = res.checkedKeys; checkedKeys.forEach((v) => { - this.$nextTick(()=>{ - this.$refs.menu.setChecked(v, true ,false); - }) - }) + this.$nextTick(() => { + this.$refs.menu.setChecked(v, true, false); + }); + }); }); }); }); @@ -527,7 +669,7 @@ export default { }, /** 选择角色权限范围触发 */ dataScopeSelectChange(value) { - if(value !== '2') { + if (value !== "2") { this.$refs.dept.setCheckedKeys([]); } }, @@ -535,11 +677,11 @@ export default { handleDataScope(row) { this.reset(); const deptTreeSelect = this.getDeptTree(row.roleId); - getRole(row.roleId).then(response => { + getRole(row.roleId).then((response) => { this.form = response.data; this.openDataScope = true; this.$nextTick(() => { - deptTreeSelect.then(res => { + deptTreeSelect.then((res) => { this.$refs.dept.setCheckedKeys(res.checkedKeys); }); }); @@ -547,24 +689,24 @@ export default { this.title = "分配数据权限"; }, /** 分配用户操作 */ - handleAuthUser: function(row) { + handleAuthUser: function (row) { const roleId = row.roleId; this.$router.push("/system/role-auth/user/" + roleId); }, /** 提交按钮 */ - submitForm: function() { - this.$refs["form"].validate(valid => { + submitForm: function () { + this.$refs["form"].validate((valid) => { if (valid) { if (this.form.roleId != undefined) { this.form.menuIds = this.getMenuAllCheckedKeys(); - updateRole(this.form).then(response => { + updateRole(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); } else { this.form.menuIds = this.getMenuAllCheckedKeys(); - addRole(this.form).then(response => { + addRole(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); @@ -574,10 +716,10 @@ export default { }); }, /** 提交按钮(数据权限) */ - submitDataScope: function() { + submitDataScope: function () { if (this.form.roleId != undefined) { this.form.deptIds = this.getDeptAllCheckedKeys(); - dataScope(this.form).then(response => { + dataScope(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.openDataScope = false; this.getList(); @@ -587,19 +729,27 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const roleIds = row.roleId || this.ids; - this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() { - return delRole(roleIds); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + this.$modal + .confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?') + .then(function () { + return delRole(roleIds); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }) + .catch(() => {}); }, /** 导出按钮操作 */ handleExport() { - this.download('system/role/export', { - ...this.queryParams - }, `role_${new Date().getTime()}.xlsx`) - } - } + this.download( + "system/role/export", + { + ...this.queryParams, + }, + `role_${new Date().getTime()}.xlsx` + ); + }, + }, }; -</script> \ No newline at end of file +</script> diff --git a/acupuncture-后台/南宁后台ssl-3.zip b/acupuncture-后台/南宁针灸后台ssl-4.zip similarity index 91% rename from acupuncture-后台/南宁后台ssl-3.zip rename to acupuncture-后台/南宁针灸后台ssl-4.zip index cdca145c..54e3d353 100644 Binary files a/acupuncture-后台/南宁后台ssl-3.zip and b/acupuncture-后台/南宁针灸后台ssl-4.zip differ