0325-海宁pad走访

This commit is contained in:
2026-03-25 14:37:28 +08:00
parent 59e05e85b1
commit 15891708de
9 changed files with 344 additions and 6 deletions

View File

@@ -6,4 +6,12 @@ export function getPADVisitRecord(query) {
method: 'get',
params: query
})
}
}
export function updatePADVisitFeedback(data) {
return request({
url: `/system/campaign/updateVisitInfoFeedback`,
method: 'post',
data: data
})
}

View File

@@ -380,9 +380,14 @@
<el-table-column align="left" prop="filename" label="批量导入文件名" show-overflow-tooltip width="180px" v-if="columns[23].visible"></el-table-column>
<el-table-column align="left" prop="outCallStatus" label="外呼状态" show-overflow-tooltip width="120px" v-if="columns[24].visible"></el-table-column>
<el-table-column align="left" prop="outCallIntention" label="客户意愿" show-overflow-tooltip width="140px" v-if="columns[25].visible"></el-table-column>
<el-table-column align="left" prop="source" label="来源" show-overflow-tooltip width="120px" v-if="columns[26].visible"></el-table-column>
<el-table-column align="left" prop="source" label="走访渠道" show-overflow-tooltip width="120px" v-if="columns[26].visible"></el-table-column>
<el-table-column align="left" prop="analysisValue" label="nlp模型提取" show-overflow-tooltip width="140px" v-if="columns[27].visible"></el-table-column>
<el-table-column align="left" prop="facility" label="预授信额度" show-overflow-tooltip width="140px" v-if="columns[28].visible"></el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="handleEditFeedback(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@@ -393,22 +398,87 @@
:total="total"
:current-page="pageNum"
></el-pagination>
<el-dialog
title="编辑走访反馈"
:visible.sync="feedbackDialogVisible"
width="960px"
custom-class="feedback-dialog"
append-to-body
@close="resetFeedbackForm"
>
<el-form ref="feedbackFormRef" :model="feedbackForm" label-width="100px" class="feedback-form">
<el-form-item label="走访渠道" required>
<el-radio-group v-model="feedbackForm.source">
<el-radio v-for="item in sourceOptions" :key="item" :label="item">{{ item }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="客户意愿" required>
<div class="feedback-groups">
<section v-for="type in feedbackTypeOptions" :key="type" class="feedback-group">
<div class="feedback-group__title">{{ type }}</div>
<el-checkbox-group v-model="feedbackForm.feedbackSelections[type]">
<el-checkbox
v-for="product in feedbackProductOptions"
:key="`${type}-${product}`"
:label="product"
>
{{ product }}
</el-checkbox>
</el-checkbox-group>
</section>
</div>
</el-form-item>
<el-form-item label="预览结果">
<div class="feedback-preview">{{ feedbackPreview || "-" }}</div>
</el-form-item>
</el-form>
<span slot="footer">
<el-button @click="feedbackDialogVisible = false">取消</el-button>
<el-button type="primary" :loading="feedbackSubmitting" @click="handleSubmitFeedback">确定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { getPADVisitRecord } from "@/api/task/PADvisitRecord.js";
import { Message } from "element-ui";
import { getPADVisitRecord, updatePADVisitFeedback } from "@/api/task/PADvisitRecord.js";
const SOURCE_OPTIONS = ["企业微信", "PAD"];
const FEEDBACK_TYPE_OPTIONS = ["拒绝", "考虑", "意愿", "其他", "愿意", "现场办理"];
const FEEDBACK_PRODUCT_OPTIONS = [
"丰收互联",
"贷款",
"电子社保卡签约",
"基金",
"贵金属",
"信用卡",
"医保电子凭证",
"社保卡",
"理财签约"
];
function createEmptyFeedbackSelections() {
return FEEDBACK_TYPE_OPTIONS.reduce((result, item) => {
result[item] = [];
return result;
}, {});
}
export default {
data() {
return {
selectedTab: "0",
tableData: [],
Loading: false,
feedbackDialogVisible: false,
feedbackSubmitting: false,
total: 0,
pageSize: 10,
pageNum: 1,
sourceOptions: SOURCE_OPTIONS,
feedbackTypeOptions: FEEDBACK_TYPE_OPTIONS,
feedbackProductOptions: FEEDBACK_PRODUCT_OPTIONS,
searchForm: {
visName: "",
visId: "",
@@ -447,14 +517,19 @@ export default {
{ key: 23, label: "批量导入文件名", visible: true },
{ key: 24, label: "外呼状态", visible: true },
{ key: 25, label: "客户意愿", visible: true },
{ key: 26, label: "来源", visible: true },
{ key: 26, label: "走访渠道", visible: true },
{ key: 27, label: "nlp模型提取", visible: true },
{ key: 28, label: "预授信额度", visible: true }
],
columns875: [
{ key: 29, label: "异常走访标签", visible: true },
{ key: 30, label: "异常走访信息", visible: true },
]
],
feedbackForm: {
id: null,
source: "",
feedbackSelections: createEmptyFeedbackSelections()
}
};
},
computed: {
@@ -493,6 +568,9 @@ export default {
// 海宁
is875() {
return this.userName.slice(0, 3) === '875'
},
feedbackPreview() {
return this.buildFeedbackValue(this.feedbackForm.feedbackSelections)
}
},
created() {
@@ -516,6 +594,77 @@ export default {
this.initVisitingTaskList();
},
methods: {
resetFeedbackForm() {
this.feedbackSubmitting = false;
this.feedbackForm = {
id: null,
source: "",
feedbackSelections: createEmptyFeedbackSelections()
};
},
parseFeedbackValue(value) {
const feedbackSelections = createEmptyFeedbackSelections();
if (!value) {
return feedbackSelections;
}
value.split(";").forEach((segment) => {
const [type, products] = segment.split(":");
if (!type || !feedbackSelections[type]) {
return;
}
feedbackSelections[type] = (products || "")
.split(",")
.map(item => item && item.trim())
.filter(Boolean);
});
return feedbackSelections;
},
buildFeedbackItems(feedbackSelections) {
return this.feedbackTypeOptions
.map((type) => ({
feedbackType: type,
products: (feedbackSelections[type] || []).filter(Boolean)
}))
.filter(item => item.products.length > 0);
},
buildFeedbackValue(feedbackSelections) {
return this.buildFeedbackItems(feedbackSelections)
.map(item => `${item.feedbackType}:${item.products.join(",")}`)
.join(";");
},
handleEditFeedback(row) {
this.feedbackForm = {
id: row.id,
source: row.source || "",
feedbackSelections: this.parseFeedbackValue(row.intentionProductValue)
};
this.feedbackDialogVisible = true;
},
handleSubmitFeedback() {
const feedbackItems = this.buildFeedbackItems(this.feedbackForm.feedbackSelections);
if (!this.feedbackForm.source) {
this.$message.warning("请选择走访渠道");
return;
}
if (!feedbackItems.length) {
this.$message.warning("请至少选择一组客户意愿和营销产品");
return;
}
const payload = {
id: this.feedbackForm.id,
source: this.feedbackForm.source || null,
feedbackItems
};
this.feedbackSubmitting = true;
updatePADVisitFeedback(payload).then(() => {
this.$message.success("保存成功");
this.feedbackDialogVisible = false;
this.resetFeedbackForm();
this.initVisitingTaskList();
}).finally(() => {
this.feedbackSubmitting = false;
});
},
handleChange(val) {
this.pageSize = 10;
this.pageNum = 1;
@@ -752,6 +901,67 @@ export default {
}
}
.feedback-form {
::v-deep .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::before {
color: #f56c6c;
margin-right: 4px;
}
.feedback-groups {
display: flex;
flex-direction: column;
gap: 12px;
}
.feedback-group {
padding: 10px 12px;
border: 1px solid #ebeef5;
border-radius: 8px;
background: #fafbfc;
}
.feedback-group__title {
margin-bottom: 10px;
color: #303133;
font-weight: 600;
}
::v-deep .el-checkbox-group {
display: flex;
flex-wrap: wrap;
gap: 6px 8px;
}
::v-deep .el-checkbox {
margin-right: 0;
min-width: auto;
white-space: nowrap;
}
.feedback-preview {
min-height: 20px;
color: #606266;
word-break: break-all;
}
}
::v-deep .feedback-dialog {
border-radius: 18px;
overflow: hidden;
.el-dialog__header {
padding: 20px 24px 16px;
}
.el-dialog__body {
padding: 12px 24px 20px;
}
.el-dialog__footer {
padding: 10px 24px 20px;
}
}
.quesiton {
color: #b9b9b9;
}