| | |
| | | <template> |
| | | <div>我的投诉</div> |
| | | <div class="app-container"> |
| | | <!-- 搜索栏 --> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="70px"> |
| | | <el-form-item label="建议类型" prop="adviceType"> |
| | | <el-select v-model="queryParams.adviceType" placeholder="全部类型" clearable style="width: 130px"> |
| | | <el-option label="投诉" value="1" /> |
| | | <el-option label="建议" value="2" /> |
| | | <el-option label="表扬" value="3" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="内容" prop="content"> |
| | | <el-input v-model="queryParams.content" placeholder="请输入内容关键字" clearable style="width: 180px" @keyup.enter.native="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="创建者" prop="createBy"> |
| | | <el-input v-model="queryParams.createBy" placeholder="请输入创建者" clearable style="width: 140px" @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> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" /> |
| | | </el-row> |
| | | |
| | | <!-- 表格 --> |
| | | <el-table v-loading="loading" :data="adviceList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="50" align="center" /> |
| | | <el-table-column label="建议类型" align="center" prop="adviceType" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="adviceTypeTag(scope.row.adviceType)" size="small">{{ adviceTypeText(scope.row.adviceType) }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="内容" align="center" prop="content" min-width="200" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="涉及科室" align="center" prop="deptCodes" width="140" :show-overflow-tooltip="true"> |
| | | <template slot-scope="scope">{{ getDeptNames(scope.row.deptCodes) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="涉及病区" align="center" prop="wardCodes" width="140" :show-overflow-tooltip="true"> |
| | | <template slot-scope="scope">{{ getWardNames(scope.row.wardCodes) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="涉及人员" align="center" prop="involvedUsers" width="120" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="备注" align="center" prop="remark" min-width="140" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="创建者" align="center" prop="createBy" width="100" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="160" /> |
| | | <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width"> |
| | | <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" style="color: #f56c6c" @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" |
| | | /> |
| | | |
| | | <!-- 新增/编辑弹窗 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-form-item label="建议类型" prop="adviceType"> |
| | | <el-radio-group v-model="form.adviceType"> |
| | | <el-radio label="1">投诉</el-radio> |
| | | <el-radio label="2">建议</el-radio> |
| | | <el-radio label="3">表扬</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="任务ID" prop="subid"> |
| | | <el-input v-model="form.subid" placeholder="任务ID" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="服务ID" prop="taskid"> |
| | | <el-input v-model="form.taskid" placeholder="服务ID" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="病人ID" prop="patid"> |
| | | <el-input v-model="form.patid" placeholder="病人ID" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="涉及科室" prop="deptCodes"> |
| | | <el-select v-model="form.deptCodes" multiple filterable clearable placeholder="请选择涉及科室(可多选)" style="width: 100%"> |
| | | <el-option v-for="d in deptOptions" :key="d.value" :label="d.label" :value="d.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="涉及病区" prop="wardCodes"> |
| | | <el-select v-model="form.wardCodes" multiple filterable clearable placeholder="请选择涉及病区(可多选)" style="width: 100%"> |
| | | <el-option v-for="w in wardOptions" :key="w.value" :label="w.label" :value="w.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="涉及人员" prop="involvedUsers"> |
| | | <el-input v-model="form.involvedUsers" placeholder="涉及人员代码,多个用逗号分隔" /> |
| | | </el-form-item> |
| | | <el-form-item label="内容" prop="content"> |
| | | <el-input type="textarea" :rows="4" v-model="form.content" placeholder="请输入投诉/建议/表扬内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input type="textarea" :rows="2" v-model="form.remark" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="open = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listAdvice, getAdvice, addAdvice, updateAdvice, delAdvice } from "@/api/followvisit/advice"; |
| | | import store from "@/store"; |
| | | |
| | | export default { |
| | | name: "ComplaintMy", |
| | | data() { |
| | | return {}; |
| | | return { |
| | | loading: false, |
| | | adviceList: [], |
| | | total: 0, |
| | | ids: [], |
| | | single: true, |
| | | multiple: true, |
| | | showSearch: true, |
| | | title: "", |
| | | open: false, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | adviceType: undefined, |
| | | content: undefined, |
| | | createBy: undefined |
| | | }, |
| | | form: {}, |
| | | rules: { |
| | | adviceType: [{ required: true, message: "请选择建议类型", trigger: "change" }], |
| | | content: [{ required: true, message: "请输入内容", trigger: "blur" }] |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | deptOptions() { |
| | | return (store.getters.belongDepts || []).map(d => ({ label: d.deptName, value: d.deptCode })); |
| | | }, |
| | | wardOptions() { |
| | | return (store.getters.belongWards || []).map(w => ({ label: w.districtName, value: w.districtCode })); |
| | | } |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | adviceTypeText(t) { |
| | | const map = { "1": "投诉", "2": "建议", "3": "表扬" }; |
| | | return map[t] || "未知"; |
| | | }, |
| | | adviceTypeTag(t) { |
| | | const map = { "1": "danger", "2": "primary", "3": "success" }; |
| | | return map[t] || "info"; |
| | | }, |
| | | getDeptNames(codes) { |
| | | if (!codes) return "-"; |
| | | return codes.split(",").filter(Boolean).map(c => { |
| | | const found = this.deptOptions.find(d => d.value == c); |
| | | return found ? found.label : c; |
| | | }).join("、") || "-"; |
| | | }, |
| | | getWardNames(codes) { |
| | | if (!codes) return "-"; |
| | | return codes.split(",").filter(Boolean).map(c => { |
| | | const found = this.wardOptions.find(w => w.value == c); |
| | | return found ? found.label : c; |
| | | }).join("、") || "-"; |
| | | }, |
| | | |
| | | created() {}, |
| | | |
| | | methods: {}, |
| | | getList() { |
| | | this.loading = true; |
| | | const body = { |
| | | adviceType: this.queryParams.adviceType || undefined, |
| | | content: this.queryParams.content || undefined, |
| | | createBy: this.queryParams.createBy || undefined |
| | | }; |
| | | const query = { |
| | | pageNum: this.queryParams.pageNum, |
| | | pageSize: this.queryParams.pageSize |
| | | }; |
| | | listAdvice(body, query).then(res => { |
| | | this.adviceList = res.rows || []; |
| | | this.total = res.total || 0; |
| | | this.loading = false; |
| | | }).catch(() => { this.loading = false; }); |
| | | }, |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | resetQuery() { |
| | | this.queryParams.adviceType = undefined; |
| | | this.queryParams.content = undefined; |
| | | this.queryParams.createBy = undefined; |
| | | this.handleQuery(); |
| | | }, |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id); |
| | | this.single = selection.length !== 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | | reset() { |
| | | this.form = { |
| | | id: undefined, |
| | | subid: undefined, |
| | | taskid: undefined, |
| | | patid: undefined, |
| | | adviceType: "1", |
| | | deptCodes: [], |
| | | wardCodes: [], |
| | | involvedUsers: "", |
| | | content: "", |
| | | remark: "" |
| | | }; |
| | | }, |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.title = "新增投诉建议"; |
| | | this.open = true; |
| | | }, |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | this.title = "修改投诉建议"; |
| | | getAdvice(row.id).then(res => { |
| | | const data = res.data || {}; |
| | | this.form = { |
| | | id: data.id, |
| | | subid: data.subid, |
| | | taskid: data.taskid, |
| | | patid: data.patid, |
| | | adviceType: data.adviceType || "1", |
| | | deptCodes: data.deptCodes ? data.deptCodes.split(",").filter(Boolean) : [], |
| | | wardCodes: data.wardCodes ? data.wardCodes.split(",").filter(Boolean) : [], |
| | | involvedUsers: data.involvedUsers || "", |
| | | content: data.content || "", |
| | | remark: data.remark || "" |
| | | }; |
| | | this.open = true; |
| | | }); |
| | | }, |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (!valid) return; |
| | | const data = { |
| | | id: this.form.id, |
| | | subid: this.form.subid, |
| | | taskid: this.form.taskid, |
| | | patid: this.form.patid, |
| | | adviceType: this.form.adviceType, |
| | | deptCodes: this.form.deptCodes.join(","), |
| | | wardCodes: this.form.wardCodes.join(","), |
| | | involvedUsers: this.form.involvedUsers, |
| | | content: this.form.content, |
| | | remark: this.form.remark, |
| | | delFlag: "0" |
| | | }; |
| | | const api = this.form.id ? updateAdvice(data) : addAdvice(data); |
| | | api.then(res => { |
| | | if (res.code === 200) { |
| | | this.$modal.msgSuccess(this.form.id ? "修改成功" : "新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.$modal.msgError(res.msg || "操作失败"); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete(row) { |
| | | const ids = row.id ? [row.id] : this.ids; |
| | | if (!ids.length) { |
| | | this.$modal.msgWarning("请选择要删除的数据"); |
| | | return; |
| | | } |
| | | this.$modal.confirm("是否确认删除所选投诉建议?").then(() => { |
| | | return delAdvice(ids.join(",")); |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | } |
| | | }).catch(() => {}); |
| | | }, |
| | | handleExport() { |
| | | this.download( |
| | | "/system/serviceSubtaskAdvice/export", |
| | | { |
| | | adviceType: this.queryParams.adviceType, |
| | | content: this.queryParams.content, |
| | | createBy: this.queryParams.createBy |
| | | }, |
| | | `随访建议数据_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |