Commit 5ce85789 by 胡悦

话术管理新增三个tab

1 parent d4baac8b
...@@ -71,3 +71,23 @@ export function findViolationByBatchId(data) { ...@@ -71,3 +71,23 @@ export function findViolationByBatchId(data) {
data.method = `dj.api.mindworkplate.violation.findViolationByBatchId` data.method = `dj.api.mindworkplate.violation.findViolationByBatchId`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 多条件查询话术详情列表
export function getConditionPage(data) {
data.method = 'dj.api.script.extract.condition.page'
return request(data, RequestMethods.POST)
}
// 话术条数
export function getTotalCount(data) {
data.method = 'dj.api.script.extract.total.count'
return request(data, RequestMethods.POST)
}
// 获取场景标签列表
export function getSingleLabelList(data) {
data.method = 'dj.api.script.extract.scene.label.single.list'
return request(data, RequestMethods.POST)
}
// 多话术查询话术详情列表导出
export function conditionExport(data) {
data.method = 'dj.api.script.extract.condition.export'
return request(data, RequestMethods.POST)
}
\ No newline at end of file \ No newline at end of file
...@@ -1191,6 +1191,12 @@ export const channelTypeList = [ ...@@ -1191,6 +1191,12 @@ export const channelTypeList = [
// 预警管理 所属业务 // 预警管理 所属业务
export const businessSceneOpt = [ export const businessSceneOpt = [
{ confId: 0, confValue: "延保" }, { confId: 0, confValue: "延保/权益" },
{ confId: 1, confValue: "精品" } { confId: 1, confValue: "精品" }
] ]
export const checkStautsOpt = [
{ confId: 0, confValue: "待确认" },
{ confId: 1, confValue: "待核验" },
{ confId: 2, confValue: "已入库" },
{ confId: 3, confValue: "已驳回" }
]
\ No newline at end of file \ No newline at end of file
<template>
<d2-container class="customer-tags m-t-40">
<div class="header" slot="header">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData"
>
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header title="话术列表">
</d2-table-header>
<d2-table
ref="table"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9122001']" />
</span>
</div>
</d2-table>
</div>
</d2-container>
</template>
<script>
import {
getClassLabelList,
geRecordSummaryList,
recordExport
} from "@/api/verbal.js"
import { businessSceneOpt } from "@/common/constants"
import { Util, deepClone } from "@/common/util"
export default {
name: 'ExcellentList',
data() {
return {
getListApi: geRecordSummaryList,
tableData:[{
}],
tableParams: {
listName: "list",
tableOption: {
width: "100"
},
tableColumns: [
{
label: "分类名",
prop: "className"
},
{
label: "业务场景",
prop: "businessType",
formatter: (cellValue) => {
return cellValue.businessType===0||cellValue.businessType
? businessSceneOpt.find(item => item.confId === cellValue.businessType).confValue
: "-"
}
},
{
label: "话术条数",
prop: "recordCount"
},
{
label: "最后更新时间",
formatter: (cellValue) => {
return cellValue.latestUpdateTime
? Util.dateFormate(cellValue.latestUpdateTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
}
]
},
searchFormSearch: {},
searchForm: {
classCode: "",
businessType: ""
},
showFormData: [
{
label: "分类名",
name: "classCode",
type: "select",
// multiple: true,
isClear: true,
optionList: [],
optionId: "classCode",
optionLabel: "className",
optionsName: "classLabelList"
},
{
label: "业务场景",
name: "businessType",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "businessTypeOpt"
}
],
baseData: {
businessTypeOpt:businessSceneOpt,
classLabelList: []
}
}
},
mounted() {
this.initSelect()
},
methods: {
handleDetail(data) {
console.log("row", data)
let businessTypeName=data.businessType===0||data.businessType
? businessSceneOpt.find(item => item.confId === data.businessType).confValue
: "-"
this.$router.push({
path: "/inVerbalConfigView",
query: {
...data,
businessTypeName:businessTypeName
}
})
},
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
console.log("this.searchForm", this.searchForm)
this.handleSearch()
},
async exportTable() {
try {
await this.beforeSearchFn()
const res = await recordExport({
...this.searchFormSearch
})
if (res) window.open(res)
} catch (error) {
if (error) this.$message.error(error)
}
},
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getClassLabelList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
if (result.status === "rejected") {
console.error(`Task ${index} failed:`, result.reason)
}
})
// 统一调用 getOptionsList
this.getOptionsList()
})
.catch((err) => {
console.error("Unexpected error in initSelect:", err)
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getClassLabelList() {
return new Promise((resolve, reject) => {
getClassLabelList({})
.then((res) => {
this.baseData.classLabelList = res
resolve(res) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getClassLabelList:", err)
reject(err) // 捕获并传递错误
})
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
// if (item.optionsName != "brandList") {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
// }
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.m-t-40 {
margin-top: 40px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<d2-container class="customer-tags m-t-40">
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="statistics-wrap">
<template v-for="(item, index) in statisticsData">
<div class="statistics-box" :key="index">
<div class="title">{{ item.label }}</div>
<div class="content" v-if="!item.innerHtml">
{{ queryInfo[item.key] }}
</div>
<div class="inner-content" v-else v-html="item.innerHtml(queryInfo)"></div>
</div>
</template>
</div>
<d2-table-header title="审批列表">
<el-button size="mini" type="primary" plain @click="exportTable">导出</el-button>
</d2-table-header>
<d2-table ref="table" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams"
:before-search-fn="beforeSearchFn">
<template slot="polishContent" slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.scope.polishContent" placement="top"
popper-class="text-tooltip">
<span>
{{
scope.scope.polishContent
? scope.scope.polishContent.length > 10
? scope.scope.polishContent.slice(0, 10) + "..."
: item.polishContent
: ""
}}
</span>
</el-tooltip>
</template>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
</span>
</div>
</d2-table>
</div>
<!-- 详细信息 -->
<other-detail :visible.sync="detailVisible" v-if="detailVisible" :id="id" source="nopushed" />
</d2-container>
</template>
<script>
import {
getSingleLabelList,
getConditionPage,
conditionExport,
getTotalCount
} from "@/api/verbal.js"
import { businessSceneOpt } from "@/common/constants"
import { Util, deepClone } from "@/common/util"
import otherDetail from "./components/otherDetail"
export default {
name: 'NoPushedList',
components: { otherDetail },
data() {
return {
getListApi: getConditionPage,
tableData: [],
id: "",
detailVisible: false,
tableParams: {
listName: "list",
tableOption: {
width: "100"
},
tableColumns: [
{
label: "分类名",
prop: "className"
},
{
label: "场景标签",
prop: "sceneLabelName"
},
{
label: "优秀标签",
prop: "labelName"
},
{
label: "话术内容",
prop: "polishContent",
addHtml: "polishContent"
},
{
label: "更新时间",
formatter: (cellValue) => {
return cellValue.updatedTime
? Util.dateFormate(cellValue.updatedTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
}
]
},
searchFormSearch: {},
searchForm: {
sceneLabelCode: "",
},
showFormData: [
{
label: "场景标签",
name: "sceneLabelCode",
type: "select",
// multiple: true,
isClear: true,
optionList: [],
optionId: "sceneLabelCode",
optionLabel: "sceneLabelName",
optionsName: "sceneLabelList"
},
{
label: "更新时间",
name: "updateTime",
type: "datePicker",
isClear: false,
pickerOptions: "rangePickerOptions"
}
],
baseData: {
businessTypeOpt: businessSceneOpt,
sceneLabelList: []
},
statisticsData: [
{
label: "话术条数",
key: "count",
innerHtml: (cellValue) => {
return `<div style="color: #43cf7c;">${cellValue.recordCount}<span style="color: #333;font-size:14px;">条</span></div>`
}
}
],
queryInfo: {
recordCount: 1550
}
}
},
mounted() {
this.initSelect()
this.getTotal()
},
methods: {
handleDetail(data) {
this.id = data.id
this.detailVisible = true
},
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.pushStatus = 0
this.searchFormSearch.checkStatusList = [2]
if (this.searchFormSearch.updateTime?.length) {
this.searchFormSearch.startUpdateTime = Util.dateFormate(
this.searchFormSearch.updateTime[0],
"YYYY-MM-DD"
) + ' 00:00:00'
this.searchFormSearch.endUpdateTime = Util.dateFormate(
this.searchFormSearch.updateTime[1],
"YYYY-MM-DD"
) + ' 23:59:59'
delete this.searchFormSearch.updateTime
}
resolve()
})
},
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
console.log("this.searchForm", this.searchForm)
this.handleSearch()
},
async exportTable() {
try {
await this.beforeSearchFn()
const res = await conditionExport({
...this.searchFormSearch
})
if (res) window.open(res)
} catch (error) {
if (error) this.$message.error(error)
}
},
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getSingleLabelList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
if (result.status === "rejected") {
console.error(`Task ${index} failed:`, result.reason)
}
})
// 统一调用 getOptionsList
this.getOptionsList()
})
.catch((err) => {
console.error("Unexpected error in initSelect:", err)
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getSingleLabelList() {
return new Promise((resolve, reject) => {
getSingleLabelList({})
.then((res) => {
this.baseData.sceneLabelList = res
resolve(res) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getSingleLabelList:", err)
reject(err) // 捕获并传递错误
})
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
// if (item.optionsName != "brandList") {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
// }
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
async getTotal() {
const res = await getTotalCount({ pushStatus: 0, checkStatusList: [2] })
this.queryInfo.recordCount = res
}
}
}
</script>
<style lang="scss" scoped>
.m-t-40 {
margin-top: 40px;
}
.statistics-wrap {
width: 100%;
height: 94px;
opacity: 1;
background: #f8faff;
display: flex;
align-items: center;
padding: 0 168px;
box-sizing: border-box;
.statistics-box {
display: inline-block;
text-align: center;
color: #333333;
flex: 1;
.title {
margin-bottom: 4px;
font-size: 14px;
}
.content {
font-size: 24px;
}
.inner-content {
// color: #43cf7c;
font-size: 30px;
}
}
}
.table-header {
display: flex;
align-items: center;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<d2-container class="customer-tags m-t-40">
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="statistics-wrap">
<template v-for="(item, index) in statisticsData">
<div class="statistics-box" :key="index">
<div class="title">{{ item.label }}</div>
<div class="content" v-if="!item.innerHtml">
{{ queryInfo[item.key] }}
</div>
<div class="inner-content" v-else v-html="item.innerHtml(queryInfo)"></div>
</div>
</template>
</div>
<d2-table-header title="审批列表">
<el-button size="mini" type="primary" plain @click="exportTable">导出</el-button>
</d2-table-header>
<d2-table ref="table" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams"
:before-search-fn="beforeSearchFn">
<template slot="polishContent" slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.scope.polishContent" placement="top"
popper-class="text-tooltip">
<span>
{{
scope.scope.polishContent
? scope.scope.polishContent.length > 10
? scope.scope.polishContent.slice(0, 10) + "..."
: item.polishContent
: ""
}}
</span>
</el-tooltip>
</template>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
<el-button type="text" @click="handleStatistics(scope.scope)">统计</el-button>
</span>
</div>
</d2-table>
</div>
<!-- 详细信息 -->
<other-detail :visible.sync="detailVisible" v-if="detailVisible" :id="id" source="pushed" />
<statistics-dialog :visible.sync="statisticsVisible" v-if="statisticsVisible" :id="id" />
</d2-container>
</template>
<script>
import {
getSingleLabelList,
getConditionPage,
conditionExport,
getTotalCount
} from "@/api/verbal.js"
import { businessSceneOpt } from "@/common/constants"
import { Util, deepClone } from "@/common/util"
import otherDetail from "./components/otherDetail"
import StatisticsDialog from "./components/statisticsDialog.vue"
export default {
name: 'PushedList',
components: { otherDetail, StatisticsDialog },
data() {
return {
getListApi: getConditionPage,
tableData: [],
id: "",
detailVisible: false,
statisticsVisible: false,
tableParams: {
listName: "list",
tableOption: {
width: "100"
},
tableColumns: [
{
label: "分类名",
prop: "className"
},
{
label: "场景标签",
prop: "sceneLabelName"
},
{
label: "优秀标签",
prop: "labelName"
},
{
label: "话术内容",
prop: "polishContent",
addHtml: "polishContent"
},
{
label: "更新时间",
formatter: (cellValue) => {
return cellValue.updatedTime
? Util.dateFormate(cellValue.updatedTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
},
{
label: "推送时间",
formatter: (cellValue) => {
return cellValue.pushTime
? Util.dateFormate(cellValue.pushTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
}
]
},
searchFormSearch: {},
searchForm: {
sceneLabelCode: "",
},
showFormData: [
{
label: "场景标签",
name: "sceneLabelCode",
type: "select",
// multiple: true,
isClear: true,
optionList: [],
optionId: "sceneLabelCode",
optionLabel: "sceneLabelName",
optionsName: "sceneLabelList"
},
{
label: "推送时间",
name: "pushTime",
type: "datePicker",
isClear: false,
pickerOptions: "rangePickerOptions"
},
{
label: "更新时间",
name: "updateTime",
type: "datePicker",
isClear: false,
pickerOptions: "rangePickerOptions"
}
],
baseData: {
businessTypeOpt: businessSceneOpt,
sceneLabelList: []
},
statisticsData: [
{
label: "话术条数",
key: "count",
innerHtml: (cellValue) => {
return `<div style="color: #43cf7c;">${cellValue.recordCount}<span style="color: #333;font-size:14px;">条</span></div>`
}
}
],
queryInfo: {
recordCount: 0
}
}
},
mounted() {
this.initSelect()
this.getTotal()
},
methods: {
handleDetail(data) {
this.id = data.id
this.detailVisible = true
},
//统计
handleStatistics(data) {
this.id = data.id
this.statisticsVisible = true
},
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.pushStatus = 1
if (this.searchFormSearch.pushTime?.length) {
this.searchFormSearch.startPushTime = Util.dateFormate(
this.searchFormSearch.pushTime[0],
"YYYY-MM-DD"
) + ' 00:00:00'
this.searchFormSearch.endPushTime = Util.dateFormate(
this.searchFormSearch.pushTime[1],
"YYYY-MM-DD"
) + ' 23:59:59'
delete this.searchFormSearch.pushTime
}
if (this.searchFormSearch.updateTime?.length) {
this.searchFormSearch.startUpdateTime = Util.dateFormate(
this.searchFormSearch.updateTime[0],
"YYYY-MM-DD"
) + ' 00:00:00'
this.searchFormSearch.endUpdateTime = Util.dateFormate(
this.searchFormSearch.updateTime[1],
"YYYY-MM-DD"
) + ' 23:59:59'
delete this.searchFormSearch.updateTime
}
resolve()
})
},
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
console.log("this.searchForm", this.searchForm)
this.handleSearch()
},
async exportTable() {
try {
await this.beforeSearchFn()
const res = await conditionExport({
...this.searchFormSearch
})
if (res) window.open(res)
} catch (error) {
if (error) this.$message.error(error)
}
},
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getSingleLabelList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
if (result.status === "rejected") {
console.error(`Task ${index} failed:`, result.reason)
}
})
// 统一调用 getOptionsList
this.getOptionsList()
})
.catch((err) => {
console.error("Unexpected error in initSelect:", err)
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getSingleLabelList() {
return new Promise((resolve, reject) => {
getSingleLabelList({})
.then((res) => {
this.baseData.sceneLabelList = res
resolve(res) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getSingleLabelList:", err)
reject(err) // 捕获并传递错误
})
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
// if (item.optionsName != "brandList") {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
// }
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
async getTotal() {
const res = await getTotalCount({ pushStatus: 1 })
this.queryInfo.recordCount = res
}
}
}
</script>
<style lang="scss" scoped>
.m-t-40 {
margin-top: 40px;
}
.statistics-wrap {
width: 100%;
height: 94px;
opacity: 1;
background: #f8faff;
display: flex;
align-items: center;
padding: 0 168px;
box-sizing: border-box;
.statistics-box {
display: inline-block;
text-align: center;
color: #333333;
flex: 1;
.title {
margin-bottom: 4px;
font-size: 14px;
}
.content {
font-size: 24px;
}
.inner-content {
// color: #43cf7c;
font-size: 30px;
}
}
}
.table-header {
display: flex;
align-items: center;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<baseDialog :is-show.sync="dialogShow" :config="dialogConfig.setting" :dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose">
<div class="detail-content">
<div class="form_div">
<el-form class="edit-sub-block" label-width="110px" :inline="true">
<el-row :gutter="20">
<template v-for="(item, index) in configData">
<el-col :span="item.col ? item.col : 12" :key="index">
<el-form-item :label="item.title">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" />
<div v-else>
<div v-if="item.className" :class="[item.className(detailInfo)]"></div>
{{ detailInfo[item.key] ? detailInfo[item.key] : "-" }}
</div>
</el-form-item></el-col>
</template>
</el-row>
</el-form>
</div>
<div class="operate-wrap">
<div class="title">操作记录</div>
<div class="operate-list" v-if="operateData.length > 0">
<div v-for="(item, index) in operateData" :key="index" class="operate-item">
<div class="header">
<span class="icon"></span>
<span class="type">{{
item.type == 1 ? "标注分类" : "二次确认"
}}</span>
<span :class="['result', check_class[item.checkStatus]]">{{ check_status[item.checkStatus] }}</span>
</div>
<div :class="[
'content',
operateData.length == index + 1 ? 'last' : ''
]">
{{ item.staffName }}<span>{{ item.createdTime }}</span>
</div>
</div>
</div>
<div v-else class="empty">暂无记录</div>
</div>
</div>
</baseDialog>
</template>
<script>
const check_status = {
1: '通过',
2: '通过',
3: '驳回',
4: '驳回'
}
const check_class = {
1: 'green',
2: 'green',
3: 'red',
4: 'red'
}
import { Util, deepClone } from "@/common/util"
import { getRecordDetail, getOperateList } from "@api/verbal"
export default {
name: "OtherDetail",
props: {
visible: {
type: Boolean,
default: false
},
id: {
type: Number,
default: ""
},
source: {
type: String,
default: ""
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit("update:visible", val)
}
},
configData() {
// 定义字段顺序模板
const fieldOrder = [
'className', 'scene', 'staffName', 'sceneLabelName', 'labelName',
'scriptTime', 'checkStatusName', 'firstChecker', 'updatedTime',
'pushTime', 'sourceContent', 'polishContent'
];
// 定义字段元数据映射
const fieldMetadata = {
className: { title: "分类名:" },
scene: { title: "业务场景:" },
staffName: { title: "话术来源:" },
sceneLabelName: { title: "场景标签:" },
labelName: { title: "优秀标签:" },
scriptTime: { title: "萃取时间:" },
checkStatusName: {
title: "状态:",
className: (cellValue) => {
return {
1: "yellowSpot",
2: "greenSpot",
3: "redSpot",
4: "redSpot",
0: "yellowSpot"
}[cellValue.checkStatus];
}
},
firstChecker: { title: "确认人:" },
updatedTime: { title: "更新时间:" },
pushTime: { title: "推送时间:" },
sourceContent: { title: "原文内容:", col: 24 },
polishContent: { title: "话术内容:", col: 24 }
};
// 定义不同来源包含的字段
const sourceFields = {
approval: [
'className', 'scene', 'staffName', 'sceneLabelName', 'labelName',
'scriptTime', 'checkStatusName', 'firstChecker', 'sourceContent', 'polishContent'
],
pushed: [
'className', 'scene', 'sceneLabelName', 'labelName',
'updatedTime', 'pushTime', 'sourceContent', 'polishContent'
],
nopushed: [
'className', 'scene', 'sceneLabelName', 'labelName',
'updatedTime', 'sourceContent', 'polishContent'
]
};
// 根据模板顺序过滤并构建配置
return fieldOrder
.filter(fieldKey => (sourceFields[this.source] || []).includes(fieldKey))
.map(fieldKey => ({ key: fieldKey, ...fieldMetadata[fieldKey] }));
}
},
watch: {
id(val) {
if (val) this.getDetail()
}
},
mounted() {
this.getDetail()
this.getOperateList()
},
data() {
return {
operateData: [],
check_status,
check_class,
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
btnList: []
},
config: {
title: "查看详情",
width: "1080px"
}
},
detailInfo: {}
}
},
methods: {
handleDetailClose() {
this.dialogShow = false
},
getDetail() {
getRecordDetail({ id: this.id }).then((res) => {
if (res) {
res.scene = res.scene == 1 ? "精品" : "延保/权益"
// res.pushStatusName = res.pushStatus == 1 ? "已推送" : "未推送"
res.checkStatusName = {
1: "待核验",
0: "待确认",
2: "已入库",
3: "已驳回",
4: "二次驳回"
}[res.checkStatus]
res.pushTime = res.pushTime
? Util.dateFormate(res.pushTime, "YYYY/MM/DD HH:mm:ss")
: "--"
res.inputTime = res.inputTime
? Util.dateFormate(res.inputTime, "YYYY/MM/DD HH:mm:ss")
: "--"
this.detailInfo = res
}
})
},
getOperateList() {
getOperateList({ id: this.id }).then((res) => {
if (res) {
this.operateData = res
}
})
}
}
}
</script>
<style lang="scss" scoped>
.form_div {
color: #333333;
padding: 20px 30px;
.edit-sub-block {
.el-form-item {
width: 100%;
margin-bottom: 0px;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
}
.edit-sub-block-two {
.el-form-item {
margin-bottom: 0px;
}
}
}
.operate-wrap {
.title {
padding: 10px 0;
color: #333333;
font-size: 16px;
font-weight: 500;
border-bottom: 1px solid #e5e5e5;
}
.operate-list {
margin: 20px;
.operate-item {
.header {
display: flex;
align-items: center;
.icon {
width: 8px;
height: 8px;
border: 2px solid #347bff;
border-radius: 50%;
}
.type {
color: #666666;
font-size: 14px;
line-height: 20px;
margin: 0 12px 0 16px;
}
.result {
font-size: 12px;
font-weight: 500;
margin-left: 12px;
&.green {
color: #2cca74;
}
&.red {
color: #eb4e4e;
}
}
}
.content {
height: 44px;
box-sizing: border-box;
padding: 4px 0 8px 20px;
color: #999999;
font-size: 12px;
border-left: 2px solid #e4e8ee;
margin-left: 4px;
span {
margin-left: 16px;
}
}
.last {
border-left: 0px solid #e4e8ee;
}
}
}
}
.empty {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
}
</style>
<!-- 驻店目标配置 -->
<template> <template>
<d2-container class="customer-tags"> <div class="in-store-list-wrap">
<div class="header" slot="header"> <div class="header" slot="header">
<d2-search <el-tabs v-model="activeName" @tab-click="handleClick">
ref="showSearch" <el-tab-pane v-for="(item, index) in tabPaneList" :label="item.label" :name="item.name" :key="index">
class="show-search" </el-tab-pane>
:search-form="searchForm" </el-tabs>
:label-width="'100px'" <components :is="tabName" :scene-type="activeName"></components>
:form-data="showFormData"
>
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div> </div>
</div> </div>
<div class="d2-container-content">
<d2-table-header title="话术列表">
</d2-table-header>
<d2-table
ref="table"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9122001']" />
</span>
</div>
</d2-table>
</div>
</d2-container>
</template> </template>
<script>
<script> import ExcellentList from "./ExcellentList.vue"
import { import ApprovalList from "./ApprovalList.vue"
getClassLabelList, import PushedList from "./PushedList.vue"
geRecordSummaryList, import NoPushedList from "./NoPushedList.vue"
recordExport
} from "@/api/verbal.js"
import { businessSceneOpt } from "@/common/constants"
import { Util, deepClone } from "@/common/util"
export default { export default {
name: 'InStoreGoalsConfig',
components: {
ExcellentList,
ApprovalList,
PushedList,
NoPushedList
},
data() { data() {
return { return {
getListApi: geRecordSummaryList, activeName: "0",
tableData:[{ tabPaneList: [
}],
tableParams: {
listName: "list",
tableOption: {
width: "100"
},
tableColumns: [
{ {
label: "分类名", label: "优秀话术",
prop: "className" name: "0"
}, },
{ {
label: "业务场景", label: '话术审批进度',
prop: "businessType", name: "1"
formatter: (cellValue) => {
return cellValue.businessType===0||cellValue.businessType
? businessSceneOpt.find(item => item.confId === cellValue.businessType).confValue
: "-"
}
},
{
label: "话术条数",
prop: "recordCount"
},
{
label: "最后更新时间",
formatter: (cellValue) => {
return cellValue.latestUpdateTime
? Util.dateFormate(cellValue.latestUpdateTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
}
]
},
searchFormSearch: {},
searchForm: {
classCode: "",
businessType: ""
}, },
showFormData: [
{ {
label: "分类名", label: '已推送话术',
name: "classCode", name: "2"
type: "select",
// multiple: true,
isClear: true,
optionList: [],
optionId: "classCode",
optionLabel: "className",
optionsName: "classLabelList"
}, },
{ {
label: "业务场景", label: '未推送话术',
name: "businessType", name: "3"
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "businessTypeOpt"
} }
], ],
baseData: { tabName: "ExcellentList"
businessTypeOpt:businessSceneOpt,
classLabelList: []
}
} }
}, },
mounted() { mounted() {
this.initSelect() if (this.$route.params.tabPane) {
this.activeName = this.$route.params.tabPane
this.tabName = this.$route.params.tabLabel
}
}, },
watch: {},
methods: { methods: {
handleDetail(data) { handleClick() {
console.log("row", data) const arr = {
let businessTypeName=data.businessType===0||data.businessType 0: "ExcellentList",
? businessSceneOpt.find(item => item.confId === data.businessType).confValue 1: "ApprovalList",
: "-" 2: "PushedList",
this.$router.push({ 3: "NoPushedList"
path: "/inVerbalConfigView",
query: {
...data,
businessTypeName:businessTypeName
} }
}) this.tabName = arr[+this.activeName]
},
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
console.log("this.searchForm", this.searchForm)
this.handleSearch()
},
async exportTable() {
try {
await this.beforeSearchFn()
const res = await recordExport({
...this.searchFormSearch
})
if (res) window.open(res)
} catch (error) {
if (error) this.$message.error(error)
} }
},
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getClassLabelList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
if (result.status === "rejected") {
console.error(`Task ${index} failed:`, result.reason)
} }
}) }
// 统一调用 getOptionsList </script>
this.getOptionsList() <style scoped lang="scss">
}) .in-store-list-wrap {
.catch((err) => { padding: 0 26px 0 20px;
console.error("Unexpected error in initSelect:", err)
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getClassLabelList() { .header {
return new Promise((resolve, reject) => { ::v-deep .el-tabs__header {
getClassLabelList({}) margin: 0;
.then((res) => { padding: 0 20px;
this.baseData.classLabelList = res
resolve(res) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getClassLabelList:", err)
reject(err) // 捕获并传递错误
})
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
// if (item.optionsName != "brandList") {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
// }
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
} }
} }
} }
</script>
<style>
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!