zhangwencui
2026-05-23 613e0cfd861011b99568a0d78f5a50eedc5f666c
反馈登记-问题描述修改为客户诉求
已修改1个文件
237 ■■■■ 文件已修改
src/views/customerService/feedbackRegistration/index.vue 237 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/feedbackRegistration/index.vue
@@ -1,13 +1,13 @@
<template>
  <div class="app-container">
    <div class="workorder-stats">
      <div
          v-for="(item, index) in statsList"
      <div v-for="(item, index) in statsList"
          :key="index"
          class="stat-card"
      >
        <div class="stat-icon" :style="{ backgroundColor: item.bgColor }">
          <el-icon :color="item.color" :size="20">
           class="stat-card">
        <div class="stat-icon"
             :style="{ backgroundColor: item.bgColor }">
          <el-icon :color="item.color"
                   :size="20">
            <component :is="item.icon" />
          </el-icon>
        </div>
@@ -18,84 +18,64 @@
      </div>
    </div>
    <div class="search-wrapper">
      <el-form
          :model="searchForm"
          class="demo-form-inline"
      >
      <el-form :model="searchForm"
               class="demo-form-inline">
        <el-row :gutter="20">
          <el-col :span="4">
            <el-form-item>
              <el-input
                  v-model="searchForm.afterSalesServiceNo"
              <el-input v-model="searchForm.afterSalesServiceNo"
                  placeholder="请输入工单编号"
                  clearable
              />
                        clearable />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item>
              <el-select
                  v-model="searchForm.status"
              <el-select v-model="searchForm.status"
                  placeholder="请选择工单状态"
                  clearable
              >
                <el-option
                    v-for="dict in workOrderStatusOptions"
                         clearable>
                <el-option v-for="dict in workOrderStatusOptions"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                />
                           :value="dict.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item>
              <el-select
                  v-model="searchForm.urgency"
              <el-select v-model="searchForm.urgency"
                  placeholder="请选择紧急程度"
                  clearable
              >
                <el-option
                    v-for="dict in degreeOfUrgencyOptions"
                         clearable>
                <el-option v-for="dict in degreeOfUrgencyOptions"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                />
                           :value="dict.value" />
              </el-select>
            </el-form-item>
          </el-col>
           <el-col :span="4">
            <el-form-item>
              <el-select
                  v-model="searchForm.serviceType"
              <el-select v-model="searchForm.serviceType"
                  placeholder="请选择售后类型"
                  clearable
              >
                <el-option
                    v-for="dict in classificationOptions"
                         clearable>
                <el-option v-for="dict in classificationOptions"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                />
                           :value="dict.value" />
              </el-select>
            </el-form-item>
          </el-col>
            <el-col :span="4">
              <el-form-item>
                <el-input
                    v-model="searchForm.orderNo"
              <el-input v-model="searchForm.orderNo"
                    placeholder="请输入销售单号"
                    clearable
                />
                        clearable />
              </el-form-item>
            </el-col>
          <!-- 按钮 -->
          <el-col :span="4">
            <el-form-item>
              <el-button type="primary" @click="handleQuery">
              <el-button type="primary"
                         @click="handleQuery">
                搜索
              </el-button>
              <el-button @click="handleReset">
@@ -107,17 +87,20 @@
      </el-form>
    </div>
    <div class="table_list">
      <div class="table_header" style="display: flex; justify-content: space-between; align-items: center;">
      <div class="table_header"
           style="display: flex; justify-content: space-between; align-items: center;">
        <div>
          <el-button type="primary" @click="openForm('add')">新增售后单</el-button>
          <el-button type="primary"
                     @click="openForm('add')">新增售后单</el-button>
        </div>
        <div>
          <el-button @click="handleOut">导出</el-button>
          <el-button type="danger" plain @click="handleDelete">删除</el-button>
          <el-button type="danger"
                     plain
                     @click="handleDelete">删除</el-button>
        </div>
      </div>
      <PIMTable
          rowKey="id"
      <PIMTable rowKey="id"
          :column="tableColumn"
          :tableData="tableData"
          :page="page"
@@ -125,47 +108,59 @@
          :isSelection="true"
          @selection-change="handleSelectionChange"
          :tableLoading="tableLoading"
          @pagination="pagination"
      ></PIMTable>
                @pagination="pagination"></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
    <form-dia ref="formDia"
              @close="handleQuery"></form-dia>
  </div>
</template>
<script setup>
import {onMounted, reactive, ref, toRefs, computed, getCurrentInstance, nextTick} from "vue";
  import {
    onMounted,
    reactive,
    ref,
    toRefs,
    computed,
    getCurrentInstance,
    nextTick,
  } from "vue";
import FormDia from "@/views/customerService/feedbackRegistration/components/formDia.vue";
import {ElMessageBox} from "element-plus";
import {afterSalesServiceDelete, afterSalesServiceListPage, getSalesLedgerDetail} from "@/api/customerService/index.js";
  import {
    afterSalesServiceDelete,
    afterSalesServiceListPage,
    getSalesLedgerDetail,
  } from "@/api/customerService/index.js";
import useUserStore from "@/store/modules/user.js";
const { proxy } = getCurrentInstance();
const userStore = useUserStore()
import { Document, FolderOpened, UserFilled } from "@element-plus/icons-vue"
import { markRaw } from 'vue'
  const userStore = useUserStore();
  import { Document, FolderOpened, UserFilled } from "@element-plus/icons-vue";
  import { markRaw } from "vue";
const statsList = ref([
  {
    icon: markRaw(Document),
    count: 0,
    label: '全部工单',
    color: '#4080ff',
    bgColor: '#eaf2ff'
      label: "全部工单",
      color: "#4080ff",
      bgColor: "#eaf2ff",
  },
  {
    icon: markRaw(FolderOpened),
    count: 0,
    label: '已处理',
    color: '#ff9a2e',
    bgColor: '#fff5e6'
      label: "已处理",
      color: "#ff9a2e",
      bgColor: "#fff5e6",
  },
  {
    icon: markRaw(UserFilled),
    count: 0,
    label: '已完成',
    color: '#00b42a',
    bgColor: '#e6f7ed'
      label: "已完成",
      color: "#00b42a",
      bgColor: "#e6f7ed",
  },
])
  ]);
const data = reactive({
  searchForm : {
@@ -175,7 +170,7 @@
    serviceType: "",
    reviewStatus: "",
    orderNo: "",
  }
    },
});
const { searchForm } = toRefs(data);
@@ -184,28 +179,30 @@
    label: "工单编号",
    prop:"afterSalesServiceNo",
    width: 150,
    align: "center"
      align: "center",
  },
  {
    label: "销售单号",
    prop:"salesContractNo",
    width: 150,
    align: "center"
      align: "center",
  },
  {
    label: "处理状态",
    prop: "status",
    dataType: "tag",
    
    formatData: (params) => {
      formatData: params => {
      if (params) {
        let part = String(params)
        const item = workOrderStatusOptions.value.find(item => item.value === part);
          let part = String(params);
          const item = workOrderStatusOptions.value.find(
            item => item.value === part
          );
        return item?.label || params; 
      }
      return null;
    },
    formatType: (params) => {
      formatType: params => {
      if (params === 1) {
        return "danger";
      } else if (params === 2) {
@@ -214,47 +211,51 @@
        return null;
      }
    },
    align: "center"
      align: "center",
  },
  {
    label: "反馈日期",
    prop: "feedbackDate",
    width: 150,
    align: "center"
      align: "center",
  },
  {
    label: "登记人",
    prop: "checkNickName",
    align: "center"
      align: "center",
  },
  {
    label: "紧急程度",
    prop: "urgency",
    // 根据degreeOfUrgencyOptions字典去自动匹配
    formatData: (params) => {
      formatData: params => {
      if (params) {
        const item = degreeOfUrgencyOptions.value.find(item => item.value === params);
          const item = degreeOfUrgencyOptions.value.find(
            item => item.value === params
          );
        return item?.label || params;
      }
      return null;
    },
    align: "center"
      align: "center",
  },
  {
    label: "售后类型",
    prop: "serviceType",
    // 根据classificationOptions字典去自动匹配
    formatData: (params) => {
      formatData: params => {
      if (params) {
        const item = classificationOptions.value.find(item => item.value === params);
          const item = classificationOptions.value.find(
            item => item.value === params
          );
        return item?.label || params;
      }
      return null;
    },
    align: "center"
      align: "center",
  },
  {
    label: "问题描述",
      label: "客户诉求",
    prop: "proDesc",
    width:300,
  },
@@ -262,26 +263,26 @@
    label: "关联部门",
    prop: "deptName",
    width: 200,
    align: "center"
      align: "center",
  },
  {
    dataType: "action",
    label: "操作",
    fixed: 'right',
      fixed: "right",
    operation: [
      {
        name: "编辑",
        type: "text",
        clickFun: (row) => {
          console.log(row)
          clickFun: row => {
            console.log(row);
          openForm("edit", row);
        },
        disabled: (row) => {
          return row.status !== 1
        }
          disabled: row => {
            return row.status !== 1;
          },
      },
    ],
    align: "center"
      align: "center",
  },
]);
const tableData = ref([]);
@@ -296,16 +297,16 @@
const handleReset = () => {
  Object.keys(searchForm.value).forEach(key => {
    searchForm.value[key] = ""
  })
      searchForm.value[key] = "";
    });
  page.current = 1;
  getList();
}
  };
// 表格选择数据
const handleSelectionChange = (selection) => {
  const handleSelectionChange = selection => {
  selectedRows.value = selection;
};
const formDia = ref()
  const formDia = ref();
// 字典获取
/* 
@@ -314,14 +315,21 @@
work_order_status 主页的工单状态
review_status 首页的审核状态
*/
const { post_sale_waiting_list, degree_of_urgency, work_order_status, review_status } = proxy.useDict(
  const {
    post_sale_waiting_list,
    degree_of_urgency,
    work_order_status,
    review_status,
  } = proxy.useDict(
  "post_sale_waiting_list",
  "degree_of_urgency",
  "work_order_status",
  "review_status"
);
const classificationOptions = computed(() => post_sale_waiting_list?.value || []);
  const classificationOptions = computed(
    () => post_sale_waiting_list?.value || []
  );
const degreeOfUrgencyOptions = computed(() => degree_of_urgency?.value || []);
const workOrderStatusOptions = computed(() => work_order_status?.value || []);
@@ -331,15 +339,15 @@
  page.current = 1;
  getList();
};
const pagination = (obj) => {
  const pagination = obj => {
  page.current = obj.page;
  page.size = obj.limit;
  getList();
};
const getList = () => {
  tableLoading.value = true;
  getSalesLedgerDetails()
  afterSalesServiceListPage({ ...searchForm.value, ...page }).then((res) => {
    getSalesLedgerDetails();
    afterSalesServiceListPage({ ...searchForm.value, ...page }).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records;
    page.total = res.data.total;
@@ -349,20 +357,22 @@
// 打开弹框
const openForm = (type, row) => {
  nextTick(() => {
    formDia.value?.openDialog(type, row)
  })
      formDia.value?.openDialog(type, row);
    });
};
function handleDelete() {
  let ids = [];
  if (selectedRows.value.length > 0) {
    // 检查是否有他人维护的数据
    const unauthorizedData = selectedRows.value.filter(item => item.checkUserId !== userStore.id);
      const unauthorizedData = selectedRows.value.filter(
        item => item.checkUserId !== userStore.id
      );
    if (unauthorizedData.length > 0) {
      proxy.$modal.msgWarning("不可删除他人维护的数据");
      return;
    }
    ids = selectedRows.value.map((item) => item.id);
      ids = selectedRows.value.map(item => item.id);
  } else {
    proxy.$modal.msgWarning("请选择数据");
    return;
@@ -386,7 +396,7 @@
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
};
  }
// 导出
const handleOut = () => {
@@ -405,12 +415,12 @@
const getStatsCountByStatus = (list, status) => {
  if (!Array.isArray(list)) return 0;
  return list.find((item) => item?.status === status)?.count || 0;
    return list.find(item => item?.status === status)?.count || 0;
};
  // 获取统计数据并刷新顶部卡片
  const getSalesLedgerDetails = () => {
    getSalesLedgerDetail({}).then((res) => {
    getSalesLedgerDetail({}).then(res => {
      if (res.code === 200) {
        const statsData = Array.isArray(res.data) ? res.data : [];
        statsList.value[0].count = getStatsCountByStatus(statsData, 3);
@@ -418,13 +428,10 @@
        statsList.value[2].count = getStatsCountByStatus(statsData, 1);
      }
    });
  }
  };
onMounted(() => {
  getList();
});
</script>