From 2736806c9fbccb6e3fdf981a6f48a9343e21fa4a Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 19 八月 2026 15:33:10 +0800
Subject: [PATCH] 提交
---
src/views/complaint/complaintmy/index.vue | 320 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 313 insertions(+), 7 deletions(-)
diff --git a/src/views/complaint/complaintmy/index.vue b/src/views/complaint/complaintmy/index.vue
index 7c13ca3..7295a41 100644
--- a/src/views/complaint/complaintmy/index.vue
+++ b/src/views/complaint/complaintmy/index.vue
@@ -1,17 +1,323 @@
<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="娑夊強浜哄憳浠g爜锛屽涓敤閫楀彿鍒嗛殧" />
+ </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>
--
Gitblit v1.9.3