Commit b7a5262a by 张立顺

Merge branch 'SAAS+V4.51.1-0415' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.51.1-0415
2 parents ff8a4591 610fae63
import request from "./request"
// const path = 'dj.api.'
......@@ -70,3 +71,9 @@ export function queryServiceRefByShop() {
data.method = `${path2}scenemerchantref.queryServiceRefByShop`
return request(data, "post")
}
//文件上传
export function uploadFile(data) {
data.method = `dj.api.smartcarlife.orderReconciliationRecord.import`
return request(data, "post",["file"])
}
\ No newline at end of file
......@@ -20,9 +20,13 @@ const request = (
) => {
// 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = ""
if (params.method.includes("dj")) {
if(params.method.includes("dj.api.script")){
apiName = 'script'
}
else if (params.method.includes("dj")) {
apiName = "dj"
} else {
console.log( params.method.split(".api"))
apiName = params.method.split(".api")[0]
}
......@@ -39,7 +43,8 @@ const request = (
merchants: "axios3",
reportExport: "axios4",
"glsx.accounts.biz.common.pictureUpload": "common",
clue:'axios5'
clue:'axios5',
script:'axios7'
}
const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName")
......@@ -72,7 +77,8 @@ const request = (
scrm: "sha1",
glsx: "md5",
"glsx.accounts.biz.common.pictureUpload": "md5",
clue:'sha1'
clue:'sha1',
script:'sha1'
}
// console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret
......
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-04-01 11:30:56
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-04-07 14:05:35
* @FilePath: \dj-car-life-system\src\api\verbal.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from "./request"
import RequestMethods from "./request.methods"
// 查询分类列表
export function getClassLabelList(data) {
data.method = `dj.api.script.extract.class.label.list`
return request(data, RequestMethods.POST)
}
// 话术统计列表
export function geRecordSummaryList(data) {
data.method = `dj.api.script.extract.record.summary`
return request(data, RequestMethods.POST)
}
// 查询场景标签列表
export function getSceceLabelList(data) {
data.method = `dj.api.script.extract.scene.label.list`
return request(data, RequestMethods.POST)
}
// 话术明细列表
export function getRecordList(data) {
data.method = `dj.api.script.extract.record.list`
return request(data, RequestMethods.POST)
}
// 话术明细列表导出
export function recordExport(data) {
data.method = `dj.api.script.extract.record.list.export`
return request(data, RequestMethods.POST)
}
// 详情
export function getRecordDetail(data) {
data.method = `dj.api.script.extract.record.detail`
return request(data, RequestMethods.POST)
}
//话术操作记录
export function getOperateList(data) {
data.method = `dj.api.script.extract.record.log`
return request(data, RequestMethods.POST)
}
// 话术埋点列表
export function getRecordBrowseList(data) {
data.method = `dj.api.script.extract.record.browse.list`
return request(data, RequestMethods.POST)
}
// 话术埋点导出
export function recordBrowseExport(data) {
data.method = `dj.api.script.extract.record.browse.list.export`
return request(data, RequestMethods.POST)
}
\ No newline at end of file
......@@ -1131,3 +1131,9 @@ export const outputValue_operTypeOpt = [
{ confId: 2, confValue: "修改" },
{ confId: 3, confValue: "删除" }
]
//话术业务场景
// 预警管理 所属业务
export const businessSceneOpt = [
{ confId: 0, confValue: "延保" },
{ confId: 1, confValue: "精品" }
]
\ No newline at end of file
......@@ -49,7 +49,15 @@ export const routerName = {
parentId: "90501"
}
]
}
},
{
authId: "9050104",
parentId: "90501",
label: "对账确认",
category: "Button",
type: "primary",
handle: "handleAccountConfirm"
},
],
component: _import("financeManage/index")
},
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-01 15:03:31
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-04-01 10:42:02
* @LastEditTime: 2025-04-08 10:33:45
*/
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
......@@ -932,39 +932,39 @@ export const routerName = {
},
component: _import("residentManage/sceneClueManagement/detailView")
},
91219: {
91220: {
path: "/verbalTrickManagement",
name: "verbalTrickManagement",
meta: {
title: "话术管理",
authId: "91219",
authId: "91220",
parentId: "912",
cache: false
},
auth: [
{
authId: "9121901",
parentId: "91219",
authId: "9122001",
parentId: "91220",
label: "明细",
handle: "handleDetail",
addRoutePath: [
{
authId: "912190101",
authId: "912200101",
name: "详情",
parentId: "91219"
parentId: "91220"
}
]
}
],
component: _import("residentManage/verbalTrickManagement/index")
},
912190101: {
912200101: {
path: "/inVerbalConfigView",
name: "inVerbalConfigView",
meta: {
title: "明细",
authId: "912190101",
parentId: "91219",
authId: "912200101",
parentId: "91220",
activePath: "/inVerbalConfigView"
},
component: _import("residentManage/verbalTrickManagement/detailView")
......
......@@ -131,7 +131,7 @@
</el-form-item>
<el-form-item v-if="formData.showChannel == 3" prop="sceneMarketTagList" label="内容标签:" label-width="120px"
:style="{ 'margin-bottom': '22px' }">
<el-select v-model="formData.sceneMarketTagList" value-key="id" @change="sceneMarketTagChange" multiple
<el-select v-model="formData.sceneMarketTagList" value-key="id" filterable @change="sceneMarketTagChange" multiple
placeholder="请选择" style="width: 430px">
<el-option v-for="item in sceneTagsList" :key="item.id" :label="item.tagName" :value="item"
:disabled="formData.sceneMarketTagList.length >= 2 && !formData.sceneMarketTagList.some(selected => selected.id === item.id)">
......
......@@ -15,6 +15,7 @@ export default {
return {
userInfo: this.$store.state.d2admin.user.info,
// 7 - 服务商
// accountType: this.$store.state.d2admin.user.info.detail.accountType
accountType: this.$store.state.d2admin.user.info.detail.accountType
}
},
......
......@@ -418,6 +418,7 @@ import { mapActions, mapState, mapMutations } from "vuex"
import { getParkStore } from "@api/editCustomer"
import chooseRuleDialog from './chooseRuleDialog'
import ruleInfoDialog from './ruleInfoDialog'
import { deepClone } from "@/common/util"
export default {
name: "CarDamage",
components: {
......@@ -1135,11 +1136,9 @@ export default {
},
getList() {
var params = this.getParams()
params = {
...this.page,
...params
}
getList(params).then((res) => {
let eventParams = deepClone({ ...this.page, ...params })
if (eventParams?.zyVoucherStatus == 1) eventParams.status = 13
getList(eventParams).then((res) => {
this.tableData = res.list.map((item) => {
item.paySuccessDate = item.paySuccessDate
? Util.dateFormate(item.paySuccessDate, "YYYY-MM-DD HH:mm:ss")
......@@ -1153,10 +1152,9 @@ export default {
},
getOrderCount() {
var params = this.getParams()
params = {
...params
}
getOrderCount(params).then((res) => {
let eventParams = deepClone({ ...params })
if (eventParams?.zyVoucherStatus == 1) eventParams.status = 13
getOrderCount(eventParams).then((res) => {
this.totalCount = res.totalPriceCount
})
},
......@@ -1177,11 +1175,13 @@ export default {
}
params.pageNum = 1
params.method = "dj.api.smartcarlife.ordermanage.export.async"
let eventParams = deepClone({ ...params })
if (eventParams?.zyVoucherStatus == 1) eventParams.status = 13
const list = [
...this.dowloadList,
{
name: "订单列表",
exportParam: JSON.stringify(params),
exportParam: JSON.stringify(eventParams),
status: "waiting",
timeid: new Date().getTime()
}
......@@ -1193,11 +1193,13 @@ export default {
var params = this.getParams()
params.pageNum = 1
params.method = "dj.api.smartcarlife.order.residentEquity.export.async"
let eventParams = deepClone({ ...params })
if (eventParams?.zyVoucherStatus == 1) eventParams.status = 13
const list = [
...this.dowloadList,
{
name: "分润&成本分析",
exportParam: JSON.stringify(params),
exportParam: JSON.stringify(eventParams),
status: "waiting",
timeid: new Date().getTime()
}
......
......@@ -95,7 +95,7 @@
</div>
</el-form-item>
<el-form-item
label="延保协议:"
label="合同协议:"
class="photoItem photoItemList"
v-if="$$(detail.payOrder, 'zyVoucherUrl')"
>
......
<template>
<div>详情</div>
<div class="detail-view">
<div class="title">场景线索详情</div>
<div class="content">
<template v-for="(item, index) in formData">
<div class="item" :key="index">
<div class="label">{{ item.label }}:</div>
<div class="value" v-if="item.prop">{{ detailInfo[item.prop] }}</div>
<div class="value" v-else>{{ item.formatter(detailInfo) }}</div>
</div>
</template>
</div>
<div class="content bg">
<template v-for="(item, index) in formData2">
<div class="item" :key="index">
<div class="label">{{ item.label }}:</div>
<div class="value" v-if="item.prop">
{{ detailInfo.extendedAttributes[item.prop]|| "-" }}
</div>
<div class="value" v-else>
{{ item.formatter(detailInfo.extendedAttributes)|| "-" }}
</div>
</div>
</template>
</div>
</div>
</template>
<script>
import { findSceneMarketLeadsById } from "@/api/scene.js"
import { Util, deepClone } from "@/common/util"
export default {
data() {
return {
isFlag: false,
id: this.$route.query.id
id: this.$route.query.id,
detailInfo: {},
formData: [
{
label: "门店名称",
prop: "storeName"
},
{
label: "门店品牌",
prop: "storeBrand"
},
{
label: "员工姓名",
prop: "storeBrand"
},
{
label: "提报日期",
formatter: (cellValue) => {
return cellValue.createdDate
? Util.dateFormate(cellValue.createdDate, "YYYY/MM/DD HH:mm:ss")
: "-"
}
},
{
label: "业务分类",
prop: "businessCodeName"
}
],
renewal: {
existingRenewalCustomers: "存量续保客户数",
cooperatingInsuranceCompanies: "合作的保险公司",
giftedStoreServicesOrBenefits: "赠送的门店服务或权益",
newEnergyRenewalCashbackDetails: "新能源续保返现情况",
newEnergyRenewalCashbackDetails: "新能源续保返现情况",
useThirdPartyMallForWithdrawal: "是否使用第三方商场提现",
newThirdPartyMallName: "新第三方商场名称",
insuranceCompanyCommissionPoliciesAndRepairPromises:
"保险公司佣金政策及送修承诺",
renewalDiscountMethods: "续保优惠方式",
renewalStaffDetails: "续保人员情况",
renewalBusinessInvestmentPlans: "续保业务投入计划"
},
crowd: {
dealerName: "经销商姓名/联系方式",
generalManager: "店总经理",
afterSalesDirector: "售后总监",
postSalesDirector: "销售后总监",
marketingManager: "市场经理",
showroomAddress: "展厅地址",
location: "地理位置",
storeNature: "店面性质",
afterSalesStations: "售后工位数",
premiumConstructionStations: "精品施工工位数",
serviceAdvisorsTotal: "SA总人数(服务顾问)",
customerServiceStaff: "客服人数",
currentCustomerBase: "目前基盘数(现有客户)",
targetCustomerBaseWithin3Years: "3年内基盘数(目标客户)",
monthlyVisits: "进店量(月度)",
monthlyPremiumSalesAmount: "精品成交金额(月度)",
mainModels: "主要进店车型",
mainOriginalPremiums: "主要进店原厂精品(列举5个)",
purchaseGiftPremiums: "购车赠送精品",
remarks: "备注"
},
formData2: []
}
},
mounted() {
......@@ -20,13 +109,81 @@ export default {
})
.then((data) => {
this.isFlag = true
console.log(data)
if (data) {
data.extendedAttributes = JSON.parse(data.extendedAttributes)
this.detailInfo = data
console.log(this.detailInfo)
// "SC_B002", "数字化延保"
// "SC_B006", "售后众筹"
let arr =
this.detailInfo.businessCode == "SC_B002"
? this.renewal
: this.crowd
this.formData2 = this.handleData(arr)
}
})
.catch((err) => {
if (error) this.$message.error(error)
})
},
handleData(data) {
let arr = Object.keys(data).map((item) => {
return {
label: data[item],
prop: item
}
})
return arr
}
}
}
</script>
<style></style>
\ No newline at end of file
<style scoped lang="scss">
.detail-view {
min-width: 1200px;
min-height: 706px;
background-color: #fff;
padding-bottom: 20px;
overflow: scroll;
.title {
height: 50px;
padding: 13.5px 20px;
color: #333333;
font-size: 16px;
border-bottom: 1px solid #e5e5e5;
box-sizing: border-box;
}
.content {
margin: 20px 20px 0 20px;
display: flex;
align-items: center;
flex-wrap: wrap;
.item {
width: 50%;
display: flex;
align-items: center;
margin-bottom: 20px;
.label {
min-width: 240px;
color: #666666;
font-size: 14px;
text-align: right;
}
.value {
min-width: 330px;
white-space: wrap;
color: #333333;
font-size: 14px;
text-align: left;
}
}
}
}
.bg {
padding: 12px 0;
border-radius: 4px;
border: 1px solid #e5e5e5;
background: #f5f7fa;
margin: 0px 20px !important;
}
</style>
\ No newline at end of file
......@@ -10,10 +10,9 @@
>
<template slot="businessCode">
<el-cascader
v-model="searchForm.businessCode"
v-model="searchForm.businessCodeArr"
:options="baseData.businessTypeList"
:props="props"
@change="handleChange"
></el-cascader>
</template>
</d2-search>
......@@ -98,8 +97,8 @@ export default {
},
searchFormSearch: {},
searchForm: {
businessCodeArr:[],
storeName: "",
businessCode: "",
reportDate: [],
storeBrandId: "",
createdBy: ""
......@@ -139,7 +138,7 @@ export default {
name: "reportDate",
type: "datePicker",
isClear: false,
pickerOptions: "rangePickerOptions"
pickerOptions: "rangePickerOptions_30day2"
}
],
baseData: {
......@@ -162,8 +161,10 @@ export default {
})
},
beforeSearchFn(type = 1) {
console.log(this.searchForm)
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.businessCode=this.searchFormSearch.businessCodeArr.length>1?this.searchFormSearch.businessCodeArr[1]:''
if (this.searchForm?.reportDate?.length) {
let [startDate, endDate] = this.searchForm.reportDate
this.searchFormSearch.startDate = Util.dateFormate(
......@@ -176,6 +177,7 @@ export default {
)
}
delete this.searchFormSearch.reportDate
delete this.searchFormSearch.businessCodeArr
resolve()
})
},
......
<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">通过</span>
</div>
<div class="content">
{{ item.staffName }}<span>{{ item.createdTime }}</span>
</div>
</div>
</div>
<div v-else class="empty">暂无记录</div>
</div>
</div>
</baseDialog>
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { getRecordDetail, getOperateList } from "@api/verbal"
export default {
name: "DetailDialog",
props: {
visible: {
type: Boolean,
default: false
},
id: {
type: Number,
default: ""
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit("update:visible", val)
}
}
},
watch: {
id(val) {
if (val) this.getDetail()
}
},
mounted() {
this.getDetail()
this.getOperateList()
},
data() {
return {
operateData: [],
configData: [
{
title: "分类名:",
key: "className"
},
{
title: "业务场景:",
key: "scene"
},
{
title: "场景标签:",
key: "sceneLabelName"
},
{
title: "优秀标签:",
key: "labelName"
},
{
title: "状态:",
key: "pushStatusName",
className: (cellValue) => {
return {
1: "yellowSpot",
2: "greenSpot",
3: "ashSpot",
0: "ashSpot"
}[cellValue.pushStatus]
}
},
{
title: "更新时间:",
key: "inputTime"
},
{
title: "推送时间:",
key: "pushTime",
width: "100%"
},
{
title: "话术内容:",
key: "sourceContent",
col: 24
}
],
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.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 {
color: #2cca74;
font-size: 12px;
font-weight: 500;
margin-left: 12px;
}
}
.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;
}
}
}
}
}
.empty {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
}
</style>
\ No newline at end of file
<template>
<baseDialog
:is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose"
>
<div class='flex'>
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'90px'"
:form-data="showFormData"
>
</d2-search>
<el-button size="small" class="bts-search" type="primary" @click="handleSearch">
查询
</el-button>
</div>
<el-button size="small" style="margin-right:1024px;" @click="exportTable">
导出
</el-button>
<d2-table
ref="table"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:layout="'total,prev, pager, next'"
>
</d2-table>
</baseDialog>
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { getRecordBrowseList, recordBrowseExport } from "@api/verbal"
export default {
name: "StatisticsDialog",
props: {
visible: {
type: Boolean,
default: false
},
id: {
type: Number,
default: ""
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit("update:visible", val)
}
}
},
mounted() {
},
data() {
return {
getListApi: getRecordBrowseList,
searchFormSearch: {},
searchForm: {
staffPhone: "",
staffName:"",
merchantName:"",
updateDate: [],
pushStatus: ""
},
showFormData: [
{
label: "手机号",
name: "staffPhone",
type: "input",
placeholder: "请输入",
maxlength: "11",
isClear: true
},
{
label: "员工名称",
name: "staffName",
placeholder: "请输入",
type: "input",
maxlength: "40",
isClear: true
},
{
label: "门店名称",
name: "merchantName",
placeholder: "请输入",
type: "input",
isClear: true
},
{
label: "浏览时间",
name: "updateDate",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
}
],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "员工名称",
prop: "staffName"
},
{
label: "手机号",
prop: "staffPhone"
},
{
label: "门店名称",
prop: "merchantName"
},
{
label: "浏览时间",
prop:'sustainTimeStr'
// formatter: (cellValue) => {
// const secondsToMinutesAndSeconds = (seconds) => {
// const minutes = Math.floor(seconds / 60),
// remainingSeconds = seconds % 60
// let str = ""
// if (minutes > 0) str += `${minutes}分`
// return (str += `${remainingSeconds}秒`)
// }
// return cellValue.sustainTime
// ? secondsToMinutesAndSeconds(cellValue.sustainTime)
// : "0秒"
// }
}
]
},
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
btnList: []
},
config: {
title: "统计",
width: "1080px"
}
}
}
},
methods: {
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.activeName = "2"
console.log("this.searchForm", this.searchForm)
this.handleSearch()
},
async exportTable() {
try {
await this.beforeSearchFn()
const res = await recordBrowseExport({
...this.searchFormSearch
})
if (res) window.open(res)
} catch (error) {
if (error) this.$message.error(error)
}
},
handleDetailClose() {
this.dialogShow = false
},
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.id=this.id
if (this.searchForm?.updateDate?.length) {
let [startTime, endTime] = this.searchForm.updateDate
this.searchFormSearch.startTime = Util.dateFormate(
startTime,
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.endTime = Util.dateFormate(
endTime,
"YYYY-MM-DD"
)+" 23:59:59"
}
delete this.searchFormSearch.updateDate
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
.bts-search{
margin-left:565px;
}
.show-search{
::v-deep{
.d2-search-block {
padding:0 !important;
}
}
}
</style>
\ No newline at end of file
<template>
<d2-container class="customer-tags">
<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>
<div class="header-flex">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="(item, index) in tabPaneList"
:label="item.label"
:name="item.name"
:key="index"
>
</el-tab-pane>
</el-tabs>
<div>
<el-button size="small" type="primary" @click="exportTable">
导出
</el-button>
</div>
</div>
<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">
<el-button type="text" @click="handleDetail(scope.scope)"
>详情</el-button
>
<el-button type="text" @click="handleStatistics(scope.scope)"
>统计</el-button
>
</div>
</d2-table>
</div>
<!-- 详细信息 -->
<detail-dialog
:visible.sync="detailVisible"
v-if="detailVisible"
:id="id"
/>
<statistics-dialog
:visible.sync="statisticsVisible"
v-if="statisticsVisible"
:id="id"
/>
</d2-container>
</template>
<script>
import { getSceceLabelList, getRecordList, recordExport } from "@/api/verbal.js"
import { businessSceneOpt } from "@/common/constants"
import { Util, deepClone } from "@/common/util"
import detailDialog from "./components/detailDialog"
import StatisticsDialog from "./components/statisticsDialog.vue"
export default {
components: { detailDialog,StatisticsDialog },
data() {
return {
queryInfo:this.$route.query,
id: "",
detailVisible: false,
statisticsVisible:false,
activeName: "2",
tabPaneList: [
{
label: "全部",
name: "2"
},
{
label: "未推送",
name: "0"
},
{
label: "已推送",
name: "1"
}
],
statisticsData: [
{
label: "分类名",
key: "className"
},
{
label: "话术条数",
key: "count",
innerHtml: (cellValue) => {
return `<div style="color: #43cf7c;">${cellValue.recordCount}<span style="color: #333;font-size:14px;">条</span></div>`
}
},
{
label: "业务场景",
key: "businessTypeName"
}
],
getListApi: getRecordList,
tableParams: {
listName: "list",
tableOption: {
width: "100"
},
tableColumns: [
{
label: "场景标签",
prop: "sceneLabelName"
},
{
label: "优秀标签",
prop: "labelName"
},
{
label: "话术内容",
prop: "sourceContent"
},
{
label: "更新时间",
formatter: (cellValue) => {
return cellValue.inputTime
? Util.dateFormate(cellValue.inputTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
},
{
label: "推送时间",
formatter: (cellValue) => {
return cellValue.pushTime
? Util.dateFormate(cellValue.pushTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
},
{
label: "状态",
formatter: (cellValue) => {
return {
1: "已推送",
0: "未推送"
}[cellValue.pushStatus]
},
className: (cellValue) => {
return {
1: "yellowSpot",
2: "greenSpot",
3: "ashSpot",
0: "ashSpot"
}[cellValue.pushStatus]
}
}
]
},
searchFormSearch: {},
searchForm: {
sceneLabelCode: "",
updateDate: [],
pushStatus: ""
},
showFormData: [
{
label: "场景标签",
name: "sceneLabelCode",
type: "select",
isClear: true,
optionList: [],
optionId: "labelCode",
optionLabel: "labelName",
optionsName: "labelList"
},
{
label: "更新日期",
name: "updateDate",
type: "datePicker",
isClear: false,
pickerOptions: "rangePickerOptions"
}
],
baseData: {
labelList: []
}
}
},
mounted() {
this.getSceceLabelList()
},
methods: {
handleClick() {
if (this.activeName == 2) {
this.searchForm.pushStatus = ""
} else {
this.searchForm.pushStatus = this.activeName
}
this.handleSearch()
},
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.classCode=this.queryInfo.classCode
this.searchFormSearch.businessType=this.queryInfo.businessType
if (this.searchForm?.updateDate?.length) {
let [startTime, endTime] = this.searchForm.updateDate
this.searchFormSearch.startTime = Util.dateFormate(
startTime,
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.endTime = Util.dateFormate(
endTime,
"YYYY-MM-DD"
)+" 23:59:59"
}
delete this.searchFormSearch.updateDate
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
this.activeName = "2"
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)
}
},
getSceceLabelList() {
getSceceLabelList({classCode:this.queryInfo.classCode})
.then((res) => {
this.baseData.labelList = res
this.getOptionsList()
})
.catch((err) => {
console.error("Error in getClassLabelList:", 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>
.header-flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.statistics-wrap {
width: 100%;
height: 94px;
opacity: 1;
background: #f8faff;
display: flex;
align-items: center;
padding: 0 168px;
box-sizing: border-box;
.statistics-box {
margin: 0 auto;
color: #333333;
flex: 1;
.title {
margin-bottom: 4px;
font-size: 14px;
}
.content {
font-size: 24px;
}
.inner-content {
// color: #43cf7c;
font-size: 30px;
}
}
}
</style>
\ No newline at end of file
<template>
<d2-container class="customer-tags">
<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 {
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>
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!