gongchunyi
6 天以前 8da567101119df5e51546ab5741c0936475dcbb1
fix: 售后详情、移除金额相关、自定义数量
已添加1个文件
已修改4个文件
214 ■■■■■ 文件已修改
src/api/customerService/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/afterSalesHandling/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/components/viewDia.vue 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/feedbackRegistration/components/formDia.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/feedbackRegistration/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/customerService/index.js
@@ -130,3 +130,12 @@
        params: query,
    })
}
// å”®åŽå•详情
export function getAfterSalesServiceById(id) {
    return request({
        url: '/afterSalesService/getById',
        method: 'get',
        params: { id }
    })
}
src/views/customerService/afterSalesHandling/index.vue
@@ -102,6 +102,7 @@
            ></PIMTable>
        </div>
        <form-dia ref="formDia" @close="handleQuery"></form-dia>
    <view-dia ref="viewDia"></view-dia>
    <FileList v-if="fileDialogVisible"  v-model:visible="fileDialogVisible" record-type="after_sales_service" :record-id="recordId"  />
  </div>
</template>
@@ -109,6 +110,7 @@
<script setup>
import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick, defineAsyncComponent} from "vue";
import FormDia from "@/views/customerService/afterSalesHandling/components/formDia.vue";
import ViewDia from "@/views/customerService/components/viewDia.vue";
import { ElMessageBox } from "element-plus";
import {
    afterSalesServiceListPage,
@@ -213,6 +215,15 @@
    },
    align: "center"
  },
  {
    label: "数量",
    prop: "productModelQuantities",
    align: "center",
    formatData: params => {
      if (!params) return "0";
      return String(params).split(',').reduce((sum, val) => sum + (Number(val) || 0), 0);
    }
  },
    {
    label: "问题描述",
    prop: "proDesc",
@@ -247,10 +258,10 @@
                }
            },
            {
                name: "查看",
                name: "详情",
                type: "text",
                clickFun: (row) => {
                    openForm("view", row);
                    viewDia.value?.openDialog(row);
                },
            },
            // TODO ä¸ºå†™æŠ¥å‘Šæ·»åŠ çš„
@@ -278,6 +289,7 @@
    selectedRows.value = selection;
};
const formDia = ref()
const viewDia = ref()
const fileListRef = ref(null)
const fileListDialogVisible = ref(false)
const currentFileRow = ref(null)
src/views/customerService/components/viewDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,123 @@
<template>
  <el-dialog v-model="dialogVisible" title="售后单详情" width="80%" @close="closeDia">
    <div v-loading="loading">
      <span class="descriptions">基础资料</span>
      <el-descriptions :column="4" border style="margin-top: 10px;">
        <el-descriptions-item label="客户名称">{{ detail.customerName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="售后类型">{{ getDictLabel(classificationOptions, detail.serviceType) }}</el-descriptions-item>
        <el-descriptions-item label="关联销售单号">{{ detail.salesContractNo || '-' }}</el-descriptions-item>
        <el-descriptions-item label="紧急程度">{{ getDictLabel(degreeOfUrgencyOptions, detail.urgency) }}</el-descriptions-item>
        <el-descriptions-item label="工单编号">{{ detail.afterSalesServiceNo || '-' }}</el-descriptions-item>
        <el-descriptions-item label="处理状态">
          <el-tag :type="detail.status === 1 ? 'danger' : 'success'" size="small">
            {{ detail.status === 1 ? '待处理' : '已处理' }}
          </el-tag>
        </el-descriptions-item>
        <el-descriptions-item label="登记人">{{ detail.checkNickName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="反馈日期">{{ detail.feedbackDate || '-' }}</el-descriptions-item>
        <el-descriptions-item label="客户诉求" :span="4">{{ detail.proDesc || '-' }}</el-descriptions-item>
      </el-descriptions>
      <div style="margin-top: 20px;">
        <span class="descriptions">处理信息</span>
        <el-descriptions :column="3" border style="margin-top: 10px;">
          <el-descriptions-item label="处理人">{{ detail.disposeNickName || '-' }}</el-descriptions-item>
          <el-descriptions-item label="处理日期">{{ detail.disDate || '-' }}</el-descriptions-item>
          <el-descriptions-item label="处理结果" :span="3">{{ detail.disRes || '-' }}</el-descriptions-item>
        </el-descriptions>
      </div>
      <div style="margin-top: 20px;">
        <span class="descriptions">关联产品</span>
        <el-table :data="tableData" border style="width: 100%; margin-top: 10px;">
          <el-table-column type="index" label="序号" width="60" align="center" />
          <el-table-column prop="productCategory" label="产品大类" align="center" />
          <el-table-column prop="specificationModel" label="规格型号" align="center" />
          <el-table-column prop="unit" label="单位" align="center" />
          <el-table-column prop="expressCompany" label="快递公司" align="center" />
          <el-table-column prop="expressNumber" label="快递单号" align="center" />
          <el-table-column prop="shippingCarNumber" label="发货车牌" align="center" />
          <el-table-column prop="shippingDate" label="发货日期" align="center" />
          <el-table-column prop="quantity" label="售后数量" align="center" />
        </el-table>
      </div>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="closeDia">关闭</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
import { ref, computed, getCurrentInstance } from 'vue';
import { getAfterSalesServiceById } from '@/api/customerService/index.js';
const { proxy } = getCurrentInstance();
const dialogVisible = ref(false);
const loading = ref(false);
const detail = ref({});
const tableData = ref([]);
const { post_sale_waiting_list, degree_of_urgency } = proxy.useDict(
  "post_sale_waiting_list",
  "degree_of_urgency"
);
const classificationOptions = computed(() => post_sale_waiting_list?.value || []);
const degreeOfUrgencyOptions = computed(() => degree_of_urgency?.value || []);
const getDictLabel = (options, value) => {
  if (!value) return '-';
  const item = options.find(i => String(i.value) === String(value));
  return item ? item.label : value;
};
const openDialog = (row) => {
  dialogVisible.value = true;
  loading.value = true;
  detail.value = {};
  tableData.value = [];
  getAfterSalesServiceById(row.id).then(res => {
    loading.value = false;
    if (res.code === 200) {
      detail.value = res.data || {};
      let productData = res.data?.salesLedgerDto?.productData || [];
      const selectedIds = res.data.productModelIds ? String(res.data.productModelIds).split(",") : [];
      tableData.value = productData.filter(item => selectedIds.includes(String(item.id)));
    }
  }).catch(() => {
    loading.value = false;
  });
};
const closeDia = () => {
  dialogVisible.value = false;
};
defineExpose({
  openDialog
});
</script>
<style scoped>
.descriptions {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  padding-left: 12px;
  position: relative;
}
.descriptions::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1rem;
  background-color: #002fa7;
  border-radius: 2px;
}
</style>
src/views/customerService/feedbackRegistration/components/formDia.vue
@@ -97,6 +97,9 @@
                {{ getShippingStatusText(row) }}
              </el-tag>
            </template>
            <template #quantity="{ row }">
              <el-input-number v-model="row.quantity" :min="0" size="small" />
            </template>
          </PIMTable>
        </div>
      </div>
@@ -147,6 +150,7 @@
      salesContractNo: "",
      proDesc: "",
      customerName: "",
      productModelQuantities: "",
    },
    rules: {
      customerName: [
@@ -240,25 +244,12 @@
      align: "center",
    },
    { label: "发货日期", prop: "shippingDate", minWidth: 100, align: "center" },
    { label: "数量", prop: "quantity", width: 100 },
    { label: "税率(%)", prop: "taxRate", width: 100 },
    {
      label: "含税单价(元)",
      prop: "taxInclusiveUnitPrice",
      width: 160,
      formatData: formatCurrency,
    },
    {
      label: "含税总价(元)",
      prop: "taxInclusiveTotalPrice",
      width: 160,
      formatData: formatCurrency,
    },
    {
      label: "不含税总价(元)",
      prop: "taxExclusiveTotalPrice",
      width: 160,
      formatData: formatCurrency,
      label: "数量",
      prop: "quantity",
      width: 140,
      dataType: "slot",
      slot: "quantity",
    },
    {
      dataType: "action",
@@ -446,6 +437,21 @@
              id: item.id,
            })
          );
          const opt = associatedSalesOrderNumberOptions.value.find(
            item => item.value === form.value.salesContractNo
          );
          if (opt) {
            let restoredData = (opt.productData || []).map(normalizeProductRow);
            const selectedIds = form.value.productModelIds ? String(form.value.productModelIds).split(",") : [];
            const quantities = form.value.productModelQuantities ? String(form.value.productModelQuantities).split(",") : [];
            tableData.value = restoredData.filter(item => selectedIds.includes(String(item.id))).map(item => {
              let qIndex = selectedIds.indexOf(String(item.id));
              if (qIndex !== -1 && qIndex < quantities.length && quantities[qIndex] !== "") {
                 item.quantity = Number(quantities[qIndex]);
              }
              return item;
            });
          }
        }
      }
      console.log(form.value);
@@ -458,6 +464,9 @@
        form.value.productModelIds = tableData.value
          .map(item => item.id)
          .join(",");
        form.value.productModelQuantities = tableData.value
          .map(item => item.quantity || 0)
          .join(",");
        if (operationType.value === "add") {
          afterSalesServiceAdd(form.value).then(response => {
            proxy.$modal.msgSuccess("新增成功");
src/views/customerService/feedbackRegistration/index.vue
@@ -112,6 +112,7 @@
    </div>
    <form-dia ref="formDia"
              @close="handleQuery"></form-dia>
    <view-dia ref="viewDia"></view-dia>
  </div>
</template>
@@ -126,6 +127,7 @@
    nextTick,
  } from "vue";
  import FormDia from "@/views/customerService/feedbackRegistration/components/formDia.vue";
  import ViewDia from "@/views/customerService/components/viewDia.vue";
  import { ElMessageBox } from "element-plus";
  import {
    afterSalesServiceDelete,
@@ -255,6 +257,15 @@
      align: "center",
    },
    {
      label: "数量",
      prop: "productModelQuantities",
      align: "center",
      formatData: params => {
        if (!params) return "0";
        return String(params).split(',').reduce((sum, val) => sum + (Number(val) || 0), 0);
      }
    },
    {
      label: "客户诉求",
      prop: "proDesc",
      width: 300,
@@ -269,7 +280,16 @@
      dataType: "action",
      label: "操作",
      fixed: "right",
      width: 180,
      align: "center",
      operation: [
        {
          name: "详情",
          type: "text",
          clickFun: row => {
            viewDia.value?.openDialog(row);
          },
        },
        {
          name: "编辑",
          type: "text",
@@ -307,6 +327,7 @@
    selectedRows.value = selection;
  };
  const formDia = ref();
  const viewDia = ref();
  // å­—典获取
  /*