Commit 5bb14243 by 前端

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

…ife-system into SAAS+V4.39.0-0603
2 parents 042e7383 61275aaf
Showing 76 changed files with 3374 additions and 369 deletions
/*
* @Description: AI对练相关接口
* @Author: huyue
* @Date: 2024-04-19 11:02:02
* @LastEditors: huyue
* @LastEditTime: 2024-05-08 11:32:07
*/
import request from "./request"
const path = 'dj.api.smartcarlife.ai.sparring.'
// 获取练习列表
export function getList(data) {
data.method = `${path}task.page`
return request(data)
}
// 新建任务
export function createTask(data) {
data.method = `${path}task.create`
return request(data, 'post')
}
// 对练详情
export function getTaskDetail(data) {
data.method = `${path}task.staff.detail.page`
return request(data)
}
// 分页任务员工列表
export function getTaskStaffList(data) {
data.method = `${path}task.staff.page`
return request(data)
}
// 任务员工提醒
export function remindTaskStaff(data) {
data.method = `${path}task.staff.notify`
return request(data)
}
// 查询员工列表
export function getStaffList(data) {
data.method = `dj.api.smartcarlife.staff.page`
// data.method = 'merchants.api.open.serviceCenter.searchStaffPage'
return request(data)
}
// 获取所有的园区店
export function getAllStore(data = {}) {
data.method = `dj.smartcarlife.api.yqMerchant.list`
return request(data)
}
// 获取质检结果
export function getQualityResult(data) {
data.method = `dj.api.carboutique.ai.sparring.detail.check.result`
return request(data)
}
// 查询对练详情
export function getSparringDetail(data) {
data.method = `${path}task.staff.detail.page`
return request(data)
}
// 更新任务提示词状态
export function updateTaskPromptStatus(data) {
data.method = `${path}task.updatePrompt`
return request(data)
}
......@@ -91,3 +91,9 @@ export function batchSetValidMinSellPrice(data) {
data.method = `${path}merchantGoodsInfo.updateBatchValidMinSellPrice`
return request(data, "post")
}
// 批量导入
export function groundingImport(data) {
data.method = `${path}merchantGoodsInfo.import`
return request(data, 'post', ["file"])
}
......@@ -20,3 +20,9 @@ export function queryLabelGroupTree(data) {
data.method = `${path}staff.queryLabelGroupTree`
return request(data, RequestMethods.POST)
}
// 查询员工登录日志
export function queryloginLog(data) {
data.method = `${path}login.log.page`
return request(data, RequestMethods.POST)
}
......@@ -24,3 +24,9 @@ export function getProductServiceItems(data) {
data.method = `${path}vd.item.queryServiceItemsGradeConfig`
return request(data, 'post')
}
// 批量导入
export function productImport(data) {
data.method = `${path}productManager.import`
return request(data, 'post', ["file"])
}
......@@ -86,8 +86,14 @@ export function updateShopLabel(data) {
return request(data)
}
// 店面配置主营品牌下拉列表
export function getBrandList(data) {
data.method = `${path}common.car.brand.list`
return request(data)
}
// 根据4s店或者园区店查询员工信息
export function getResidentStaffList(data) {
data.method = `${path}merchant.staff.list`
return request(data, 'post')
return request(data, "post")
}
......@@ -275,11 +275,16 @@ export default {
item.ifSuccess = ele.progress == 100 && (ele.failNum > 0 || ele.succNum > 0)
if (item.ifSuccess) {
flag = true
if (ele.failNum) {
if (ele.failNum && ele.succNum != 0) {
this.notice.warningTips('部分导入失败,请修改后重新导入')
setTimeout(() => {
downLoadFile(ele.url)
}, index * 7000)
}, 7000)
} else if (ele.failNum && ele.succNum == 0) {
this.notice.warningTips('导入失败,请修改后重新导入')
setTimeout(() => {
downLoadFile(ele.url)
}, 7000)
} else {
this.notice.okTips('导入成功')
}
......@@ -532,7 +537,8 @@ export default {
.popper {
padding: 20px 18px 16px;
z-index: 200;
max-height: 95vh;
overflow: auto !important;
.title {
font-weight: 600;
font-size: 16px;
......
......@@ -245,7 +245,21 @@ export const routerName = {
parentId: "90307",
label: "删除",
handle: "handleDelete"
}
},
{
authId: "9030707",
parentId: "90307",
label: "批量导入",
category: "Button",
type: "primary",
handle: "handleBatchImport"
},
{
authId: "9030708",
parentId: "90307",
label: "查看",
handle: "handleCommodityDetail"
},
],
component: _import("goods/productManage/list")
},
......@@ -367,6 +381,14 @@ export const routerName = {
category: "Button",
type: "primary",
handle: "handleBatchCheckPrice"
},
{
authId: "9030911",
parentId: "90309",
label: "批量导入",
category: "Button",
type: "primary",
handle: "handleBatchImport"
}
],
component: _import("goods/grounding/index")
......
......@@ -20,15 +20,15 @@ export const routerName = {
cache: false
},
auth: [
// {
// authId: '9050103',
// parentId: '90501',
// label: '下载对账单',
// icon: 'download',
// category: 'Button',
// type: 'primary',
// handle: 'downloadAccount'
// },
{
authId: '9050103',
parentId: '90501',
label: '下载对账单',
icon: 'download',
category: 'Button',
type: 'primary',
handle: 'downloadAccount'
},
{
authId: "9050101",
parentId: "90501",
......
......@@ -8,6 +8,71 @@
*/
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
907: {
path: "/index",
name: "index",
meta: {
title: "总览",
authId: "907",
parentId: "1",
cache: false
},
auth: [
{
authId: "90701",
parentId: "907",
label: "报表模块"
},
{
authId: "90702",
parentId: "907",
category: "Button",
label: "查看企微推送对象",
addRoutePath: [
{
authId: "90703",
name: "企微推送配置",
parentId: "907"
}
]
},
{
authId: "90705",
parentId: "907",
category: "Button",
label: "编辑单店信息"
},
{
authId: "90706",
parentId: "907",
category: "Button",
type: "primary",
label: "导出日报",
handle: "exportDailyReport"
},
{
authId: "90707",
parentId: "907",
category: "Button",
label: "渗透率报表",
addRoutePath: [
{
authId: "90704",
name: "渗透率报表",
parentId: "907"
}
]
},
{
authId: "90708",
parentId: "907",
category: "Button",
handle: "handleOutputImport",
label: "导入"
},
],
component: _import("index")
},
90703: {
path: "/outputValue",
name: "outputValue",
......@@ -17,7 +82,7 @@ export const routerName = {
parentId: "907",
cache: false,
sideHidden: true,
activePath: "/outputValue"
activePath: "/index"
},
auth: [
{
......@@ -60,17 +125,33 @@ export const routerName = {
parentId: "907",
cache: false,
sideHidden: true,
activePath: "/permeation"
activePath: "/index"
},
auth: [
{
authId: "9070301",
parentId: "90703",
label: "新增",
icon: "plus",
authId: "9070401",
parentId: "90704",
label: "导出",
category: "Button",
type: "primary",
handle: "handleAdd"
handle: "handleExport"
},
// 新车交付率导出
{
authId: "9070402",
parentId: "90704",
label: "导出",
category: "Button",
type: "primary",
handle: "handleDetailExport"
},
{
authId: "9070403",
parentId: "90704",
label: "日报导出",
category: "Button",
type: "primary",
handle: "handleDailyExport"
}
],
component: _import("index/permeation")
......
......@@ -77,6 +77,14 @@ export const routerName = {
parentId: "90901",
label: "发货单",
handle: "handleSendgoods"
},
{
authId: "9090106",
parentId: "90901",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("purchase/purchaseOrder")
......@@ -148,6 +156,14 @@ export const routerName = {
}
},
handle: "handleReject"
},
{
authId: "9090305",
parentId: "90903",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("purchase/procurementReview")
......@@ -195,6 +211,14 @@ export const routerName = {
handle: "handleAllocat"
},
{
authId: "9090405",
parentId: "90904",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9090406",
parentId: "90904",
label: "结束",
......@@ -283,6 +307,14 @@ export const routerName = {
}
},
handle: "handleReject"
},
{
authId: "9090605",
parentId: "90906",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("purchase/procurementBusiness")
......
......@@ -56,7 +56,22 @@ export const routerName = {
category: "Button",
type: "primary",
handle: "handleAdd"
}
},
{
authId: "9100104",
parentId: "91001",
label: "批量开通非融合",
category: "Button",
type: "primary",
handle: "massDevelopmentNonFusion"
},{
authId: "9100105",
parentId: "91001",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
],
component: _import("rightsAndInterestsManage/ruleConfigurationList")
}
......
......@@ -44,9 +44,9 @@ export const routerName = {
authId: "91202",
parentId: "91201",
// sideHidden: true,
cache: false
cache: false,
activePath: "/qualityControlList"
},
auth: [
{
authId: "9120201",
......@@ -68,6 +68,16 @@ export const routerName = {
parentId: "912",
cache: false
},
auth: [
{
authId: "9120301",
parentId: "91203",
label: "数据同步",
category: "Button",
type: "primary",
handle: "handleUpdate"
}
],
component: _import("residentManage/workCard")
},
91204: {
......@@ -96,10 +106,341 @@ export const routerName = {
parentId: "91205",
label: "查看标签",
handle: "handleViewLabel"
},
{
authId: "9120502",
parentId: "91205",
label: "设备登录历史",
category: "Button",
type: "primary",
handle: "handleLoginHistory"
},
{
authId: "9120503",
parentId: "91205",
label: "导出人员",
category: "Button",
type: "primary",
handle: "handleExportPerson"
},
{
authId: "9120504",
parentId: "91205",
label: "导出标签",
category: "Button",
type: "primary",
handle: "handleExportLabel"
}
],
component: _import("systemConfig/inStoreManage/index")
},
91206: {
path: "/staffManage",
name: "staffManage",
meta: {
title: "驻店工资绩效",
authId: "91206",
parentId: "912",
cache: false
},
auth: [
{
authId: "9120601",
parentId: "91206",
label: "导出工资绩效",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9120602",
parentId: "91206",
label: "导入员工",
category: "Button",
handle: "handleImport"
},
{
authId: "9120603",
parentId: "91206",
label: "绩效配置",
handle: "handlePerformance",
addRoutePath: [
{
authId: "912060301",
name: "绩效配置",
parentId: "91206"
}
]
},
{
authId: "9120604",
parentId: "91206",
label: "导师配置",
handle: "handleMentor",
addRoutePath: [
{
authId: "912060401",
name: "导师配置",
parentId: "91206"
}
]
},
{
authId: "9120605",
parentId: "91206",
label: "启用工资绩效",
handle: "handleEnableOrDisable",
ruleObj: {
attr: "performanceFlag",
rule: {
N: "启用工资绩效",
Y: "禁用工资绩效"
}
}
},
{
authId: "9120606",
parentId: "91206",
label: "业绩详情",
handle: "handleDetail"
}
],
component: _import("systemConfig/businessSchoolManage/index")
},
91208: {
path: "/exercise",
name: "exercise",
meta: {
title: "AI对练",
authId: "91208",
parentId: "912",
cache: false
},
component: _import("residentManage/exercise/index"),
auth: [
{
authId: "9120801",
parentId: "91208",
label: "新建任务",
category: "Button",
type: "primary",
handle: "handleToAdd",
addRoutePath: [
{
authId: "912080403",
name: "新建任务",
parentId: "91208"
}
]
},
{
authId: "9120802",
parentId: "91208",
label: "导出",
category: "Button",
handle: "handleExport"
},
{
authId: "9120803",
parentId: "91208",
label: "查看",
handle: "handleToView",
addRoutePath: [
{
authId: "912080402",
name: "查看",
parentId: "91208"
}
]
},
{
authId: "9120804",
parentId: "91208",
label: "明细",
handle: "handleToDetail",
addRoutePath: [
{
authId: "912080401",
name: "明细",
parentId: "91208"
}
]
}
]
},
912080401: {
path: "/exerciseDetail",
name: "exerciseDetail",
meta: {
title: "明细",
authId: "912080401",
parentId: "91208",
sideHidden: true,
activePath: "/exerciseDetail"
},
component: _import("residentManage/exercise/detail")
},
912080402: {
path: "/exerciseView",
name: "exerciseView",
meta: {
title: "查看",
authId: "912080402",
parentId: "91208",
sideHidden: true,
activePath: "/exerciseView"
},
component: _import("residentManage/exercise/view")
},
912080403: {
path: "/exerciseAdd",
name: "exerciseAdd",
meta: {
title: "新建任务",
authId: "912080403",
parentId: "91208",
sideHidden: true,
activePath: "/exerciseAdd"
},
component: _import("residentManage/exercise/add")
},
912060301: {
path: "/performanceConfig",
name: "performanceConfig",
meta: {
title: "绩效配置",
authId: "912060301",
parentId: "91206",
sideHidden: true,
activePath: "/staffManage"
},
component: _import("systemConfig/businessSchoolManage/performanceConfig")
},
912060401: {
path: "/mentorConfig",
name: "mentorConfig",
meta: {
title: "导师配置",
authId: "912060401",
parentId: "91206",
sideHidden: true,
activePath: "/staffManage"
},
component: _import("systemConfig/businessSchoolManage/mentorConfig")
},
91207: {
path: "/inStoreGoalsConfig",
name: "inStoreGoalsConfig",
meta: {
title: "驻店目标配置",
authId: "91207",
parentId: "912",
cache: false
},
auth: [
{
authId: "9120701",
parentId: "91207",
label: "新增",
category: "Button",
type: "primary",
handle: "handleAdd",
addRoutePath: [
{
authId: "912070101",
name: "新增",
parentId: "91207"
}
]
},
{
authId: "9120702",
parentId: "91207",
label: "查看",
handle: "handleStoreView",
addRoutePath: [
{
authId: "912070201",
name: "查看",
parentId: "91207"
}
]
},
{
authId: "9120703",
parentId: "91207",
label: "编辑",
handle: "handleStoreEdit",
addRoutePath: [
{
authId: "912070101",
name: "编辑",
parentId: "91207"
}
]
},
{
authId: "9120704",
parentId: "91207",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9120705",
parentId: "91207",
label: "查看",
handle: "handleStaffView",
addRoutePath: [
{
authId: "912070501",
name: "查看任务",
parentId: "91207"
}
]
}
],
component: _import("systemConfig/inStoreGoalsConfig/index")
},
912070101: {
path: "/addInStoreConfig",
name: "addInStoreConfig",
meta: {
title: "新增",
authId: "912070101",
parentId: "91207",
sideHidden: true,
activePath: "/inStoreGoalsConfig"
},
component: _import("systemConfig/inStoreGoalsConfig/addInStoreConfig")
},
// 查看店面目标配置
912070201: {
path: "/inStoreConfigView",
name: "inStoreConfigView",
meta: {
title: "查看",
authId: "912070201",
parentId: "91207",
sideHidden: true,
activePath: "/inStoreGoalsConfig"
},
component: _import("systemConfig/inStoreGoalsConfig/addInStoreConfig")
},
// 查看驻店员工任务
912070501: {
path: "/employeeTasksView",
name: "employeeTasksView",
meta: {
title: "查看任务",
authId: "912070501",
parentId: "91207",
sideHidden: true,
activePath: "/inStoreGoalsConfig"
},
component: _import("systemConfig/inStoreGoalsConfig/employeeTasksView")
},
91209: {
path: "/staffExamine",
name: "staffExamine",
......
......@@ -39,8 +39,6 @@ export const routerName = {
authId: "9130102",
parentId: "91301",
label: "查看",
category: "Button",
type: "primary",
handle: "handleDetail",
addRoutePath: [
{
......@@ -54,8 +52,6 @@ export const routerName = {
authId: "9130103",
parentId: "91301",
label: "统计",
category: "Button",
type: "primary",
handle: "goStatisticsPage",
addRoutePath: [
{
......@@ -64,7 +60,53 @@ export const routerName = {
parentId: "91301"
}
]
}
},
{
authId: "9130104",
parentId: "91301",
label: "批量启用",
category: "Button",
handle: "mutiStart"
},
{
authId: "9130105",
parentId: "91301",
label: "批量停用",
category: "Button",
handle: "mutiStop"
},
{
authId: "9130106",
parentId: "91301",
label: "编辑",
handle: "handleAdd",
addRoutePath: [
{
authId: "91302",
name: "新增内容",
parentId: "91301"
}
]
},
{
authId: "9130107",
parentId: "91301",
label: "删除",
handle: "handleDel"
},
{
authId: "9130108",
parentId: "91301",
label: "启用",
handle: "operatStatus",
ruleObj: {
attr: "status",
rule: {
2: "启用",
1: "停用"
}
}
},
],
component: _import("contentManager/contentManagerList")
},
......@@ -102,6 +144,15 @@ export const routerName = {
cache: false,
activePath: "/contentManagerList"
},
auth: [
{
authId: "9130401",
parentId: "91304",
label: "导出",
category: "Button",
handle: "exportList"
}
],
component: _import("contentManager/statisticsList")
}
}
......@@ -126,7 +126,7 @@ export const errorPage = {
export const frameInRoutes = frameIn
export const localRoutes = {
[home.meta.authId]: home,
// [home.meta.authId]: home,
...resources
}
......
......@@ -19,9 +19,9 @@
<div class="d2-container-content">
<d2-table-header>
<span>
<auth-button category="Button" :show-btn-ids="['9130101']" />
<auth-button category="Button" :show-btn-ids="['9130101', '9130104', '9130105']" />
</span>
<span>
<!-- <span>
<el-button size="mini" @click="mutiStartOrStop(1)">
批量启用
</el-button>
......@@ -30,7 +30,7 @@
<el-button size="mini" @click="mutiStartOrStop(2)">
批量停用
</el-button>
</span>
</span> -->
</d2-table-header>
<d2-table
ref="contentTable"
......@@ -68,7 +68,7 @@
<span>{{ statusEnum[scope.scope.status].name }}</span>
</div>
<div slot="auth-button" slot-scope="scope">
<el-button type="text" size="mini" @click="handleDetail(scope.scope)">
<!-- <el-button type="text" size="mini" @click="handleDetail(scope.scope)">
查看
</el-button>
<el-button type="text" size="mini" @click="handleAdd(scope.scope)">
......@@ -97,6 +97,29 @@
>
统计
</el-button>
</template> -->
<!-- 查看 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9130102']" />
</span>
<!-- 编辑 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9130106']" />
</span>
<!-- 删除 -->
<span v-if="scope.scope.status == 0" style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9130107']" />
</span>
<!-- -->
<template v-else>
<!-- 停用/启用 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9130108']" />
</span>
<!-- 统计 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9130103']" />
</span>
</template>
</div>
</d2-table>
......@@ -373,6 +396,14 @@ export default {
}
})
},
// 批量启用
mutiStart() {
this.mutiStartOrStop(1)
},
// 批量停用
mutiStop() {
this.mutiStartOrStop(2)
},
operatStatus(row) {
this.mutiStartOrStop(row.status == 1 ? 2 : 1, [row])
},
......
......@@ -17,7 +17,8 @@
</div>
<div class="d2-container-content">
<d2-table-header>
<el-button size="mini" @click="exportList()"> 导出 </el-button>
<!-- <el-button size="mini" @click="exportList()"> 导出 </el-button> -->
<auth-button category="Button" :show-btn-ids="['9130401']" />
</d2-table-header>
<d2-table
ref="contentTable"
......
......@@ -238,18 +238,25 @@ export default {
mounted() {
// console.log(this.$router)
if (this.userInfo.beSuper) {
getParkStore({}).then(res => {
res.forEach(item => {
item.merchantId = item.merchantNo
})
this.baseData.parkServiceList = res
this.getOptionsList()
getParkStore({}).then(res => {
res.forEach(item => {
item.merchantId = item.merchantNo
})
} else {
this.showFormData = this.showFormData.filter(item => item.name !== 'sellerMerchantId')
this.getServiceStore(this.userInfo.detail.merchantId)
}
this.baseData.parkServiceList = res
this.getOptionsList()
})
// if (this.userInfo.beSuper) {
// getParkStore({}).then(res => {
// res.forEach(item => {
// item.merchantId = item.merchantNo
// })
// this.baseData.parkServiceList = res
// this.getOptionsList()
// })
// } else {
// this.showFormData = this.showFormData.filter(item => item.name !== 'sellerMerchantId')
// this.getServiceStore(this.userInfo.detail.merchantId)
// }
this.getList()
this.getOrderCount()
},
......@@ -347,8 +354,9 @@ export default {
// baseGoodsId: '',
source: ''
}
this.userInfo.beSuper && (this.baseData.storeIdList = [])
// this.userInfo.beSuper && (this.baseData.storeIdList = [])
// this.baseData.goodList = []
this.baseData.storeIdList = []
this.getOptionsList()
},
handleExport() {
......
......@@ -170,13 +170,16 @@
</span>
<!-- <span style="position: absolute; right: 41px; top: 42px; z-index: 999;"> -->
<span class="downloadBtn">
<el-button type="primary"
<!-- <el-button type="primary"
size="mini"
icon="el-icon-download"
v-if="userInfo.beSuper && userInfo.loginAccount.loginAccout != '18123663366'"
@click="downloadAccount">
下载对账单
</el-button>
</el-button> -->
<auth-button :show-btn-ids="['9050103']"
v-if="userInfo.loginAccount.loginAccout != '18123663366'"
category="Button" />
</span>
<auth-button :show-btn-ids="['9050101']"
......@@ -224,7 +227,7 @@
align="center">
<template slot-scope="scope">
<span
v-if="scope.row.businessType">{{ scope.row.businessType == '2' ? '延保' : '权益' }}</span>
v-if="scope.row.businessType">{{ scope.row.businessType == '2' ? '延保' : '权益' }}</span>
<span v-else>-</span>
</template>
</el-table-column>
......@@ -324,7 +327,7 @@
label="入账手续费"
width="100"
align="center">
<!-- <template slot-scope="scope">
<!-- <template slot-scope="scope">
<span>{{
userInfo.beSuper &&
!scope.row.hasOwnProperty('subOrderProfitAllocations')
......@@ -414,12 +417,12 @@
width="200"
prop="yqMerchantName"
v-if="yq_visible">
<!-- <el-table-column prop="yqMerchantName"
<!-- <el-table-column prop="yqMerchantName"
label="园区店名称"
width="170"
align="center" /> -->
<!-- 审计需求先屏蔽 -->
<!-- <el-table-column prop="yqProfitMoney"
<!-- 审计需求先屏蔽 -->
<!-- <el-table-column prop="yqProfitMoney"
label="园区店总金额"
align="center">
<template slot-scope="scope">
......@@ -528,12 +531,12 @@
width="200"
prop="platformMerchantName"
align="center">
<!-- 审计需求先屏蔽 -->
<!-- <el-table-column prop="glProfitMoney"
<!-- 审计需求先屏蔽 -->
<!-- <el-table-column prop="glProfitMoney"
label="平台方金额"
width="100"
align="center" /> -->
<!-- <el-table-column prop="platformMerchantName"
<!-- <el-table-column prop="platformMerchantName"
label="平台方对象"
width="100"
align="center">
......@@ -859,20 +862,27 @@ export default {
const itemName = ['sourceList', 'channelType', 'businessModel']
this.showFormData = this.showFormData.filter(item => !itemName.includes(item.name))
}
if (this.userInfo.beSuper || this.specialAccout) {
getParkStore({}).then(res => {
res.forEach(item => {
item.merchantId = item.merchantNo
})
this.baseData.parkServiceList = res
this.getOptionsList()
getParkStore({}).then(res => {
res.forEach(item => {
item.merchantId = item.merchantNo
})
} else {
this.showFormData = this.showFormData.filter(
item => item.name !== 'yqMerchantId'
)
this.getServiceStore(this.userInfo.detail.merchantId)
}
this.baseData.parkServiceList = res
this.getOptionsList()
})
// if (this.userInfo.beSuper || this.specialAccout) {
// getParkStore({}).then(res => {
// res.forEach(item => {
// item.merchantId = item.merchantNo
// })
// this.baseData.parkServiceList = res
// this.getOptionsList()
// })
// } else {
// this.showFormData = this.showFormData.filter(
// item => item.name !== 'yqMerchantId'
// )
// this.getServiceStore(this.userInfo.detail.merchantId)
// }
// console.log(this.$store.state.d2admin.user.info.detail.merchantId)
getPlatformMerchantList({}).then(res => {
......@@ -907,14 +917,16 @@ export default {
4)隐藏流量方比例,流量费=流量方各项分账类目之和;
5)下载对账单隐藏园区店对账单入口 */
this.sunmmaryVisible = false
if (this.findFormIdx('yqMerchantId') != -1) { // 园区店账号提前屏蔽了该选项,不做判断会导致JS报错
this.showFormData[this.findFormIdx('yqMerchantId')].isHide = true
}
this.showFormData[this.findFormIdx('merchantId')].isHide = true
// if (this.findFormIdx('yqMerchantId') != -1) { // 园区店账号提前屏蔽了该选项,不做判断会导致JS报错
// this.showFormData[this.findFormIdx('yqMerchantId')].isHide = true
// }
// this.showFormData[this.findFormIdx('merchantId')].isHide = true
this.showFormData[this.findFormIdx('businessModel')].isHide = true
this.showFormData[this.findFormIdx('yqMerchantId')].isHide = false
this.showFormData[this.findFormIdx('merchantId')].isHide = false
this.sellerName_visible = false
this.shopProfitType_visible = false
this.yq_visible = false
this.yq_visible = true
if (val == 4) { // 非会员权益隐藏所属业务筛选项
this.showFormData[this.findFormIdx('businessType')].isHide = true
} else this.showFormData[this.findFormIdx('businessType')].isHide = false
......@@ -1022,7 +1034,8 @@ export default {
value: ''
}
}
this.userInfo.beSuper && (this.baseData.storeIdList = [])
// this.userInfo.beSuper && (this.baseData.storeIdList = [])
this.baseData.storeIdList = []
this.getOptionsList()
},
// 导出
......
......@@ -245,14 +245,16 @@ export default {
// 1 太阳膜 2 (1.3场景商品)
const shopType = formData?.goodsType == 1 ? '1' : formData?.sceneType == 3 ? '2' : ''
const shopForm = deepClone(copyFormList[0].formBlock)
// 太阳膜/延保类保留上架部位字段 positionStr
// 太阳膜/延保类(第三方供应方)保留上架部位字段 positionStr
const spliceForm = shopType == '1'
? ['giftCost', 'recoveryCost', 'virtualAccountCost']
? ['giftCost', 'recoveryCost', 'virtualAccountCost', 'djCost', 'thirdPartyCost']
: shopType == '2'
? ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost']
: this.extendedPosiType.includes(formData?.goodsType) && !this.baseConfig.supplierCode.includes(`${formData.supplierCode}`)
? ['productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost']
: ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost']
? ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost', 'djCost', 'thirdPartyCost']
: this.equitySceneType.includes(formData?.goodsType) || this.extendedPosiType.includes(formData?.goodsType)
? (this.extendedPosiType.includes(formData?.goodsType) && this.baseConfig.supplierCode.includes(`${formData.supplierCode}`)
? ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost', 'upgradeProductCost']
: ['productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost', 'upgradeProductCost'])
: ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost', 'djCost', 'thirdPartyCost']
// 未勾选基础商品类型
if (!this.formData.productType?.includes(1)) spliceForm.push('baseSupplyModeStr')
// 赠送成本:仅产品类型选择“基础产品”时展示
......@@ -335,15 +337,16 @@ export default {
return (data ?? '') === ''
},
handleUp(e) {
this.$refs[this.formRef + 'd2FormRuleForm'].validate((valid, options) => {
if (valid) {
this.$emit('handleAddConfirm')
} else {
var needRuleList = Object.keys(options)
this.jumpScroll(needRuleList[0])
return true
}
})
this.$emit('handleAddConfirm')
// this.$refs[this.formRef + 'd2FormRuleForm'].validate((valid, options) => {
// if (valid) {
// this.$emit('handleAddConfirm')
// } else {
// var needRuleList = Object.keys(options)
// this.jumpScroll(needRuleList[0])
// return true
// }
// })
}
}
}
......
......@@ -297,7 +297,9 @@ export default {
giftCost: [{ required: true, message: '请输入赠送成本', trigger: 'blur' }],
recoveryCost: [{ required: true, message: '请输入回收成本', trigger: 'blur' }],
virtualAccountCost: [{ required: true, message: '请输入虚拟对账成本', trigger: 'blur' }],
warrantyType: [{ required: true, message: '请选择质保卡类型', trigger: 'change' }]
warrantyType: [{ required: true, message: '请选择质保卡类型', trigger: 'change' }],
djCost: [{ required: true, message: '请输入嘀加成本', trigger: 'blur' }],
thirdPartyCost: [{ required: true, message: '请输入第三方成本', trigger: 'blur' }]
},
storeSelected: [],
relateStoreVisible: false,
......@@ -512,7 +514,12 @@ export default {
// 1 太阳膜 2 (1.3场景商品)
const shopType = formData?.goodsType == 1 ? '1' : formData?.sceneType == 3 ? '2' : ''
const shopForm = deepClone(copyFormList[0].formBlock)
const spliceForm = shopType == '1' ? ['giftCost', 'recoveryCost', 'virtualAccountCost'] : shopType == '2' ? ['productType', 'warrantyType', 'baseSupplyMode', 'giftCost', 'recoveryCost', 'virtualAccountCost'] : ['productType', 'warrantyType', 'baseSupplyMode', 'upgradeSupplyMode', 'giftCost', 'recoveryCost', 'virtualAccountCost']
const spliceForm = shopType == '1' ? ['giftCost', 'recoveryCost', 'virtualAccountCost', 'djCost', 'thirdPartyCost'] :
shopType == '2' ? ['productType', 'warrantyType', 'baseSupplyMode', 'giftCost', 'recoveryCost', 'virtualAccountCost', 'djCost', 'thirdPartyCost'] :
// 权益/延保类 无升级成本 新增嘀加成本和第三方成本
this.equitySceneType.includes(formData?.goodsType) || this.extendedPosiType.includes(formData?.goodsType) ?
['productType', 'warrantyType', 'baseSupplyMode', 'upgradeSupplyMode', 'giftCost', 'recoveryCost', 'virtualAccountCost', 'upgradeProductCost'] :
['productType', 'warrantyType', 'baseSupplyMode', 'upgradeSupplyMode', 'giftCost', 'recoveryCost', 'virtualAccountCost', 'djCost', 'thirdPartyCost']
// 未勾选基础商品类型
if (!formData.productType?.includes(1)) spliceForm.push('baseSupplyMode')
// 赠送成本:仅产品类型选择“基础产品”时展示
......
......@@ -156,6 +156,20 @@ export default {
width: '432px',
unit: true,
handleInput: true
}, {
name: 'djCost',
label: '嘀加成本',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}]
}, {
title: '门店信息',
......@@ -359,7 +373,9 @@ export default {
res.oldupgradeProductCost = res.upgradeProductCost
res.oldgiftCost = res.giftCost
res.oldrecoveryCost = res.recoveryCost
res.virtualAccountCost = res.virtualAccountCost
res.oldvirtualAccountCost = res.virtualAccountCost
res.olddjCost = res.djCost
res.oldthirdPartyCost = res.thirdPartyCost
const defaultSelect = [{ // 默认选中项 用于回显
confId: res?.upgradeGoodsId,
confNameValue: res?.upgradeGoodsName,
......@@ -481,7 +497,9 @@ export default {
giftCost: '',
recoveryCost: '',
virtualAccountCost: '',
validMinSellPrice: ''
validMinSellPrice: '',
djCost: '',
thirdPartyCost: ''
}
addOrUpdateAPI(this.dealObjectValue(params)).then(res => {
this.notice.okTips()
......
......@@ -37,7 +37,9 @@ export default {
giftCost: [{ required: true }],
recoveryCost: [{ required: true }],
virtualAccountCost: [{ required: true }],
warrantyTypeStr: { required: true }
warrantyTypeStr: [{ required: true }],
djCost: [{ required: true }],
thirdPartyCost: [{ required: true }]
},
editForm: [{
title: '商品信息',
......@@ -115,6 +117,14 @@ export default {
name: 'virtualAccountCost',
label: '虚拟对账成本',
unit: true
}, {
name: 'djCost',
label: '嘀加成本',
unit: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
unit: true
}]
}, {
title: '门店信息',
......
......@@ -28,29 +28,35 @@
<span>上架管理列表</span>
</span>
<!-- 新增上架 -->
<span style="{display: inline-block}">
<span style="display: inline-block">
<auth-button category="Button"
style="{display: inline-block}"
style="display: inline-block"
:show-btn-ids="['9030901']" />
</span>
<!-- 批量导入 -->
<span style="display: inline-block;margin-left: 10px;">
<auth-button category="Button"
style="display: inline-block"
:show-btn-ids="['9030911']" />
</span>
<!-- 批量校验最低价 -->
<span style="{display: inline-block} ;margin-left: 10px">
<span style="display: inline-block;margin-left: 10px;">
<auth-button category="Button" :show-btn-ids="['9030910']" />
</span>
<!-- 批量审核 -->
<span style="{display: inline-block} ;margin-left: 10px">
<span style="display: inline-block;margin-left: 10px;">
<auth-button category="Button" :show-btn-ids="['9030903']" />
</span>
<!-- 批量下架 -->
<span style="{display: inline-block};margin-left: 10px">
<span style="display: inline-block;margin-left: 10px;">
<auth-button category="Button" :show-btn-ids="['9030908']" />
</span>
<!-- 批量复制 -->
<span style="{display: inline-block};margin-left: 10px">
<span style="display: inline-block;margin-left: 10px;">
<auth-button category="Button" :show-btn-ids="['9030909']" />
</span>
<!-- 导出 -->
<span style="{display: inline-block};margin-left: 10px">
<span style="display: inline-block;margin-left: 10px;">
<auth-button category="Button" :show-btn-ids="['9030902']" />
</span>
</d2-table-header>
......@@ -143,15 +149,51 @@
@handleBatchCopyConfirm="handleBatchCopyConfirm"
@handleBatchCopyClose="handleBatchCopyClose">
</batch-copy-dialog>
<d2-dialog :title="'上传文件'"
:is-visible="fileVisible"
@closeDialog="handleBatchImport"
@confirmDialog="handleConfirmImport">
<slot>
<el-form :model="fileForm"
ref="fileRuleForm"
:rules="fileRules"
label-width="120px">
<el-form-item label="导入文件:"
prop="fileName">
<el-col :span="16">
<el-input readonly
v-model="fileForm.fileName" />
</el-col>
<el-col :span="4"
class="m-l-md">
<el-button class="import-btn">
导入文件
<input type="file"
id="fileUpload"
class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@change="importFile($event)">
<el-link type="primary"
class="import-template"
icon="el-icon-link"
@click="exportTemplate">
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
</d2-container>
</template>
<script>
import { getProductTypeBySceneId, getList } from '@api/product'
import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus, batchUpdateBatchCopy, batchSetValidMinSellPrice } from '@api/grounding'
import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus, batchUpdateBatchCopy, batchSetValidMinSellPrice, groundingImport } from '@api/grounding'
import { deepClone, Util } from '@/common/util'
import { sceneCodeList, sceneList, BaseData } from '@/common/constants.js'
import { getParkStore } from '@api/editCustomer'
import { mapActions, mapState } from 'vuex'
import { mapActions, mapState, mapMutations } from 'vuex'
import { baseSupplyModeList, upgradeSupplyModeList } from './constants/data'
import { getShopMerchantList } from '@api/deviceManage'
import { baseConfig } from '@/main'
......@@ -429,6 +471,20 @@ export default {
},
width: 130
}, {
label: '嘀加成本/元',
prop: 'djCost',
formatter: (cellValue) => {
return this.priceFilter(cellValue.djCost)
},
width: 130
}, {
label: '第三方成本/元',
prop: 'thirdPartyCost',
formatter: (cellValue) => {
return this.priceFilter(cellValue.thirdPartyCost)
},
width: 130
}, {
label: '校验最低价',
prop: '',
addHtml: 'validMinSellPrice',
......@@ -485,7 +541,12 @@ export default {
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '',
batchCopySelectScene: '', // 批量复制选中的场景值
batchCopyVisible: false,
batchCopySelectData: [] // 批量辅助选中的上架数据
batchCopySelectData: [], // 批量辅助选中的上架数据
fileRules: {
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
fileForm: {},
fileVisible: false
}
},
mounted() {
......@@ -521,14 +582,25 @@ export default {
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
dowloadList: (state) => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList,
updateRefesh: (state) => state.d2admin.user.updateRefesh
})
},
watch: {
updateRefesh(val) {
if (val == true) {
this.$refs.groundingIndexTable.refreshTable()
this.setUpdateRefesh('false')
}
},
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
......@@ -619,6 +691,67 @@ export default {
// }
return true
},
// 模板下载
exportTemplate() {
var params = {}
params.method = 'dj.api.smartcarlife.merchantGoodsInfo.template.export'
const list = [
...this.dowloadList,
{
name: '门店模板',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
handleBatchImport() {
this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
},
// 上传文件,转码为base64
importFile(e) {
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
this.fileInfo = e.target.files[0].name.split('.')[e.target.files[0].name.split('.')?.length - 1] + '@' + arrBase64[1]
document.getElementById('fileUpload').value = ''
}
} else {
this.notice.errorTips('上传文件不可超过9M')
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = {
file: this.fileInfo
}
groundingImport(params).then(res => {
if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, {
name: this.fileForm.fileName,
ifSuccess: false,
uuid: res,
type: 'upload'
}]
this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功')
this.handleBatchImport()
}
})
}
})
},
handleReset() {
this.searchForm = {
upgradeGoodsName: '',
......@@ -821,21 +954,45 @@ export default {
}
</script>
<style lang="scss" scoped>
.merchant-name-box{
font-size: 12px;
max-height: 400px;
overflow-y: auto;
.title{
color: #333333;
font-weight: 500;
margin-bottom: 7px;
.grounding{
.merchant-name-box{
font-size: 12px;
max-height: 400px;
overflow-y: auto;
.title{
color: #333333;
font-weight: 500;
margin-bottom: 7px;
}
.merchant-item{
color: #666666;
font-weight: 400;
}
}
.merchant-item{
color: #666666;
font-weight: 400;
.checkText{
margin-left: 8px;
}
.m-l-md {
margin-left: 20px;
}
.import-btn {
position: relative;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.import-template {
position: absolute;
height: 20px;
top: 50px;
left: 0;
}
}
.checkText{
margin-left: 8px;
}
</style>
......@@ -58,6 +58,7 @@
</div>
<div v-else>
<el-form-item :prop="`groundingGoodsList[${eleIndex}][${item.name}]`"
:rules="rules[item.name]"
:label="item.label ? (item.unit ? (item.label + '(元)/件') : item.label) + ':' : ''"
v-if="item.name !== 'positionStr' || (item.name == 'positionStr' && extendedPosiType.includes(ele.goodsType) && !baseConfig.supplierCode.includes(`${ele['supplierCode']}`))"
:label-width="item.label ? '180px' : '0px'"
......@@ -291,11 +292,12 @@ export default {
},
// 审核
handleCheck(e) {
this.$refs[this.formRef + 'd2FormRuleForm'].validate((valid, options) => {
if (valid) {
this.$emit('handleCheck')
}
})
this.$emit('handleCheck')
// this.$refs[this.formRef + 'd2FormRuleForm'].validate((valid, options) => {
// if (valid) {
// this.$emit('handleCheck')
// }
// })
}
}
}
......
......@@ -264,7 +264,8 @@ export default {
}
}
],
upgradeProductCost: [{ required: true, message: '请输入产品、升级成本', trigger: 'blur' }]
djCost: [{ required: true, message: '请输入嘀加成本', trigger: 'blur' }],
thirdPartyCost: [{ required: true, message: '请输入第三方成本', trigger: 'blur' }]
},
storeSelected: [],
relateStoreVisible: false,
......@@ -330,16 +331,18 @@ export default {
'formData.groundingGoodsList': {
handler(newVal) {
if (newVal) {
// 建议售价,最低售价,成本合计计算
const acc = { sellPrice: '', minSellPrice: '', upgradeProductCost: '' }
// 建议售价,最低售价,嘀加成本,第三方成本合计计算
const acc = { sellPrice: '', minSellPrice: '', djCost: '', thirdPartyCost: '' }
newVal.forEach(val => {
acc.sellPrice = !this.filterEmpty(val.sellPrice) || !this.filterEmpty(acc.sellPrice) ? this.subStr(acc.sellPrice, Number(val.sellPrice)) : ''
acc.minSellPrice = !this.filterEmpty(val.minSellPrice) || !this.filterEmpty(acc.minSellPrice) ? this.subStr(acc.minSellPrice, Number(val.minSellPrice)) : ''
acc.upgradeProductCost = !this.filterEmpty(val.upgradeProductCost) || !this.filterEmpty(acc.upgradeProductCost) ? this.subStr(acc.upgradeProductCost, Number(val.upgradeProductCost)) : ''
acc.djCost = !this.filterEmpty(val.djCost) || !this.filterEmpty(acc.djCost) ? this.subStr(acc.djCost, Number(val.djCost)) : ''
acc.thirdPartyCost = !this.filterEmpty(val.thirdPartyCost) || !this.filterEmpty(acc.thirdPartyCost) ? this.subStr(acc.thirdPartyCost, Number(val.thirdPartyCost)) : ''
})
this.formData.sellPrice = acc.sellPrice
this.formData.minSellPrice = acc.minSellPrice
this.formData.upgradeProductCost = acc.upgradeProductCost
this.formData.djCost = acc.djCost
this.formData.thirdPartyCost = acc.thirdPartyCost
}
},
deep: true
......@@ -428,7 +431,8 @@ export default {
position: '', // 上架部位
sellPrice: '', // 参考售价
minSellPrice: '', // 最低售价
upgradeProductCost: '' // 成本
djCost: '', // 嘀加成本
thirdPartyCost: '' // 第三方成本
})
},
delGroundingGoods(index) {
......
......@@ -57,8 +57,17 @@ export default {
type: 'input',
width: '432px'
}, {
name: 'upgradeProductCost',
label: '成本',
name: 'djCost',
label: '嘀加成本',
isRequired: true,
isDisabled: true,
placeholder: '根据套餐商品成本自动累加',
unit: true,
type: 'input',
width: '432px'
}, {
name: 'thirdPartyCost',
label: '第三方成本',
isRequired: true,
isDisabled: true,
placeholder: '根据套餐商品成本自动累加',
......@@ -135,8 +144,15 @@ export default {
unit: true,
handleInput: true
}, {
name: 'upgradeProductCost',
label: '成本',
name: 'djCost',
label: '嘀加成本',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
type: 'input',
width: '432px',
unit: true,
......@@ -173,7 +189,8 @@ export default {
packageName: '', // 套餐名称
sellPrice: '', // 套餐售价总价
minSellPrice: '', // 套餐最低售价
upgradeProductCost: '', // 套餐总成本
djCost: '', // 嘀加成本
thirdPartyCost: '', // 第三方成本
validMinSellPriceFlag: false, // 是否校验最低价
groundingGoodsList: [{ // 上架商品集合
upgradeGoodsId: '', // 商品id
......@@ -181,7 +198,8 @@ export default {
position: '', // 上架部位
sellPrice: '', // 参考售价
minSellPrice: '', // 最低售价
upgradeProductCost: '' // 成本
djCost: '', // 嘀加成本
thirdPartyCost: '' // 第三方成本
}],
voucherList: [] // 上架凭证
},
......@@ -331,11 +349,13 @@ export default {
sellPrice: val?.sellPrice, // 售价
minSellPrice: val?.minSellPrice, // 最低售价
validMinSellPriceFlag: val?.validMinSellPrice == 'Y', // 是否校验最低价
upgradeProductCost: val?.upgradeProductCost, // 成本
djCost: val?.djCost, // 嘀加成本
thirdPartyCost: val?.thirdPartyCost, // 第三方成本
supplierCode: val?.goodsInfo?.supplierCode, // 供应方
oldsellPrice: val?.sellPrice,
oldminSellPrice: val?.minSellPrice,
oldupgradeProductCost: val?.upgradeProductCost
olddjCost: val?.djCost,
oldthirdPartyCost: val?.thirdPartyCost
})
defaultSelect.push({
confId: val?.upgradeGoodsId,
......@@ -400,7 +420,8 @@ export default {
sellPrice: val?.sellPrice,
minSellPrice: val?.minSellPrice,
validMinSellPrice: val.validMinSellPrice,
upgradeProductCost: val?.upgradeProductCost
djCost: val?.djCost,
thirdPartyCost: val?.thirdPartyCost
})
})
// 整理上传凭证数据
......
......@@ -226,13 +226,20 @@ export default {
},
width: '100'
}, {
label: '成本/元',
prop: 'upgradeProductCost',
label: '嘀加成本/元',
prop: 'djCost',
formatter: (cellValue) => {
return this.priceFilter(cellValue.upgradeProductCost)
return this.priceFilter(cellValue.djCost)
},
width: '100'
}, {
label: '第三方成本/元',
prop: 'thirdPartyCost',
formatter: (cellValue) => {
return this.priceFilter(cellValue.thirdPartyCost)
},
width: '120'
}, {
label: '上架门店',
name: '',
type: 'slot',
......
......@@ -31,7 +31,8 @@ export default {
upgradeGoodsName: [{ required: true }],
sellPrice: [{ required: true }],
minSellPrice: [{ required: true }],
upgradeProductCost: [{ required: true }]
djCost: [{ required: true }],
thirdPartyCost: [{ required: true }]
},
editForm: [{
title: '套餐信息',
......@@ -47,8 +48,12 @@ export default {
label: '最低售价',
unit: true
}, {
name: 'upgradeProductCost',
label: '成本',
name: 'djCost',
label: '嘀加成本',
unit: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
unit: true
}]
}, {
......@@ -100,8 +105,12 @@ export default {
label: '最低售价',
unit: true
}, {
name: 'upgradeProductCost',
label: '成本',
name: 'djCost',
label: '嘀加成本',
unit: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
unit: true
}]
}, {
......@@ -179,7 +188,8 @@ export default {
sellPrice: val?.sellPrice, // 售价
minSellPrice: val?.minSellPrice, // 最低售价
validMinSellPrice: val?.validMinSellPrice, // 是否校验最低价
upgradeProductCost: val?.upgradeProductCost, // 成本
djCost: val?.djCost, // 嘀加成本
thirdPartyCost: val?.thirdPartyCost, // 第三方成本
supplierCode: val?.goodsInfo?.supplierCode // 供应方
})
})
......
......@@ -21,9 +21,15 @@
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button category="Button" style="{display: inline-block}" :show-btn-ids="['9030701']" />
<!-- 新增产品 -->
<span style="display: inline-block;margin-right: 10px;">
<auth-button category="Button" :show-btn-ids="['9030701']" />
</span>
<!-- 批量导入 -->
<auth-button category="Button" style="display: inline-block;" :show-btn-ids="['9030707']" />
</span>
<auth-button category="Button" style="{display: inline-block}" :show-btn-ids="['9030702']" />
<!-- 导出 -->
<auth-button category="Button" style="display: inline-block" :show-btn-ids="['9030702']" />
</d2-table-header>
<d2-table ref="productManageTable"
:has-num="false"
......@@ -39,12 +45,15 @@
<div v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
slot="auth-button"
slot-scope="scope">
<el-button type="text"
<!-- <el-button type="text"
size="mini"
style="margin-right: 10px;"
@click="handleCommodityDetail(scope.scope)">
查看
</el-button>
</el-button> -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9030708']" />
</span>
<!-- <auth-button :data="scope.scope"></auth-button> -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9030703']" />
......@@ -61,14 +70,50 @@
@handleDrawerClose="handleDrawerClose"
:position-type-list="positionTypeList"
:extended-posi-type-list="extendedPosiTypeList" />
<d2-dialog :title="'上传文件'"
:is-visible="fileVisible"
@closeDialog="handleBatchImport"
@confirmDialog="handleConfirmImport">
<slot>
<el-form :model="fileForm"
ref="fileRuleForm"
:rules="fileRules"
label-width="120px">
<el-form-item label="导入文件:"
prop="fileName">
<el-col :span="16">
<el-input readonly
v-model="fileForm.fileName" />
</el-col>
<el-col :span="4"
class="m-l-md">
<el-button class="import-btn">
导入文件
<input type="file"
id="fileUpload"
class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@change="importFile($event)">
<el-link type="primary"
class="import-template"
icon="el-icon-link"
@click="exportTemplate">
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
</d2-container>
</template>
<script>
import { Util } from '@/common/util'
import { getProductManageList } from '@api/productManage'
import { getProductManageList, productImport } from '@api/productManage'
import { getProductTypeBySceneId } from '@api/product'
import { mapActions, mapState } from 'vuex'
import { mapActions, mapState, mapMutations } from 'vuex'
import { baseGoodsDelete } from '@api/commodity'
import drawerDetail from './components/drawerDetail.vue'
import { baseConfig } from '@/main'
......@@ -224,7 +269,12 @@ export default {
},
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '', // 服务商自建类目值
positionTypeList: [], // 太阳膜类商品部位
extendedPosiTypeList: [] // 延保类商品部位
extendedPosiTypeList: [], // 延保类商品部位
fileRules: {
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
fileForm: {},
fileVisible: false
}
},
......@@ -232,9 +282,20 @@ export default {
drawerDetail
},
watch: {
updateRefesh(val) {
if (val == true) {
this.$refs.productManageTable.refreshTable()
this.setUpdateRefesh('false')
}
},
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
dowloadList: (state) => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList,
updateRefesh: (state) => state.d2admin.user.updateRefesh
})
},
......@@ -253,6 +314,7 @@ export default {
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
......@@ -275,6 +337,67 @@ export default {
keyDowmGetList() {
this.$refs.productManageTable.refreshTable()
},
// 模板下载
exportTemplate() {
var params = {}
params.method = 'dj.api.smartcarlife.productManager.template.export'
const list = [
...this.dowloadList,
{
name: '门店模板',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
handleBatchImport() {
this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
},
// 上传文件,转码为base64
importFile(e) {
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
this.fileInfo = e.target.files[0].name.split('.')[e.target.files[0].name.split('.')?.length - 1] + '@' + arrBase64[1]
document.getElementById('fileUpload').value = ''
}
} else {
this.notice.errorTips('上传文件不可超过9M')
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = {
file: this.fileInfo
}
productImport(params).then(res => {
if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, {
name: this.fileForm.fileName,
ifSuccess: false,
uuid: res,
type: 'upload'
}]
this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功')
this.handleBatchImport()
}
})
}
})
},
handleReset() {
this.searchForm = {
commodityCode: '',
......@@ -381,4 +504,26 @@ export default {
.product-manage p {
margin: 0;
}
.product-manage .m-l-md {
margin-left: 20px;
}
.product-manage .import-btn {
position: relative;
}
.product-manage .import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.product-manage .import-template {
position: absolute;
height: 20px;
top: 50px;
left: 0;
}
</style>
<!-- 月度库存结算单弹窗 -->
<!-- 新车交付明细弹窗 -->
<template>
<d2-dialog
title="新车交付明细"
......@@ -42,12 +42,13 @@
<div class="d2-container-content">
<div class="table-header">
<div class="table-title">{{ merchantName }}</div>
<el-button
<!-- <el-button
class="default-blue-btn"
type="primary"
@click="handleExport"
@click="handleDetailExport"
>导出</el-button
>
> -->
<auth-button category="Button" :show-btn-ids="['9070402']" />
</div>
<d2-table
ref="recordTable"
......@@ -214,7 +215,7 @@ export default {
this.searchFormSearch.sceneType = this.sceneType
return this.searchFormSearch
},
handleExport() {
handleDetailExport() {
var params = this.getParams()
params.method =
"dj.api.smartcarlife.permeability.report.detail.exportAsync"
......
......@@ -15,12 +15,13 @@
<el-button type="primary" size="small" @click="handleSearch" class="searchBtn">
搜索
</el-button>
<el-button size="small" @click="handleReset">
<el-button size="small" style="margin-right: 10px;" @click="handleReset">
重置
</el-button>
<el-button size="small" @click="() => fileVisible = true">
<!-- <el-button size="small" @click="() => fileVisible = true">
导入
</el-button>
</el-button> -->
<auth-button category="Button" size="small" :show-btn-ids="['90708']" />
</el-col>
</div>
<div class="yqdTableContainer">
......@@ -150,6 +151,7 @@ import { downLoadFile } from '@/common/util'
// import orderManage from "@api/orderManage"
import dayjs from 'dayjs'
import { merchantOutputValueTargetExport, merchantOutputValueTargetImport, getMerchantOutputValueTarget, setMerchantOutputValueTarget, findMerchantStaffList } from '@api/index'
import { mapActions, mapState, mapMutations } from 'vuex'
export default {
props: {
isShow: {
......@@ -210,7 +212,12 @@ export default {
set(val) {
this.$emit('update:isShow', false)
}
}
},
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList,
updateRefesh: (state) => state.d2admin.user.updateRefesh
})
},
mounted() {
// console.log(this.nowMonth)
......@@ -220,7 +227,21 @@ export default {
// console.log(moment().subtract(-1, 'months').endOf('month').format('YYYY-MM-DD'))
// console.log(moment().subtract(5, 'months').startOf('month').format('YYYY-MM-DD'))
},
watch: {
updateRefesh(val) {
if (val == true) {
this.getList()
this.setUpdateRefesh('false')
}
},
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions('d2admin/user', ['actionSetDownloadList']),
getSelectList(item, index) {
console.log(item, index, 'item')
if (item.remote) return false
......@@ -250,6 +271,10 @@ export default {
// })
})
},
// 导入
handleOutputImport() {
this.fileVisible = true
},
getOptionsList() {
findMerchantStaffList({ merchantId: -1 }).then((result) => {
console.log('findMerchantStaffList', result)
......@@ -313,40 +338,53 @@ export default {
// fileUrl: this.fileForm.fileUrl
// }
merchantOutputValueTargetImport({ file: this.fileInfo }).then((result) => {
console.log(result, 'result')
const { url, dataList } = result
console.log(url, 'url')
if (url) {
// this.$message.error('上传失败')
this.$message.error('上传失败')
downLoadFile(url)
}
if (dataList) {
this.$message.success('上传成功')
this.fileVisible = false
this.hasPage = false
// const listFilter = result.list
this.tableData = dataList.map((item) => {
item.dataMonth = this.search.targetDate
item.isEdit = true
item.areaSupervision = item.areaSupervision || {}
item.residentManager = item.residentManager || {}
item.area = item.area || ''
// item.residentManagerOptionsList = item.residentManager?{}
if (item.residentManager) {
item.residentManagerOptionsList = [{
userId: item.residentManager.userId,
userName: item.residentManager.userName,
userNum: item.residentManager.userNum,
userType: item.residentManager.userType
}]
} else {
item.residentManagerOptionsList = []
}
return item
})
// this.tableTotal = result.total
if (result) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, {
name: this.fileForm.fileName,
ifSuccess: false,
uuid: result,
type: 'upload'
}]
this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功')
this.handleImport()
}
// console.log(result, 'result')
// const { url, dataList } = result
// console.log(url, 'url')
// if (url) {
// // this.$message.error('上传失败')
// this.$message.error('上传失败')
// downLoadFile(url)
// }
// if (dataList) {
// this.$message.success('上传成功')
// this.fileVisible = false
// this.hasPage = false
// // const listFilter = result.list
// this.tableData = dataList.map((item) => {
// item.dataMonth = this.search.targetDate
// item.isEdit = true
// item.areaSupervision = item.areaSupervision || {}
// item.residentManager = item.residentManager || {}
// item.area = item.area || ''
// // item.residentManagerOptionsList = item.residentManager?{}
// if (item.residentManager) {
// item.residentManagerOptionsList = [{
// userId: item.residentManager.userId,
// userName: item.residentManager.userName,
// userNum: item.residentManager.userNum,
// userType: item.residentManager.userType
// }]
// } else {
// item.residentManagerOptionsList = []
// }
// return item
// })
// // this.tableTotal = result.total
// }
})
// .catch((err) => {
......
......@@ -23,15 +23,16 @@
:picker-options="pickerOptions"
value-format="yyyy-MM-dd" />
</div>
<el-button type="primary"
<!-- <el-button type="primary"
@click="exportDailyReport"
:loading="exportDailyReportBtn"
class="exportBtn">导出日报</el-button>
class="exportBtn">导出日报</el-button> -->
<auth-button category="Button" :show-btn-ids="['90706']" />
</div>
<div class="inputTargetBtn">
<div @click="goCheck"
<div @click="goCheck" v-if="checkBtnFlag"
style="margin-right: 32px;"><i class="el-icon-chat-round"></i>查看企微推送对象</div>
<div @click="outputVisible = true"><i class="el-icon-edit"></i>编辑单店信息</div>
<div @click="outputVisible = true" v-if="editBtnFlag"><i class="el-icon-edit"></i>编辑单店信息</div>
</div>
</div>
</el-card>
......@@ -68,7 +69,9 @@ export default {
// dateValue: dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
dateValue: '',
outputVisible: false,
exportDailyReportBtn: false
exportDailyReportBtn: false,
checkBtnFlag: false, // 查看企微推送对象权限
editBtnFlag: false, // 编辑单店信息权限
}
},
computed: {
......@@ -80,6 +83,15 @@ export default {
}
},
mounted() {
this.$nextTick(() => {
const $store = this.$store.getters['d2admin/auth/curBtns']
const btnId = '90702' // 查看企微推送对象权限ID
const editStoreBtnId = '90705' // 编辑单店信息权限ID
const _item = $store?.find(i => (i.authId === btnId))
const _editItem = $store?.find(i => (i.authId === editStoreBtnId))
if (_item) this.checkBtnFlag = true
if (_editItem) this.editBtnFlag = true
})
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
......@@ -117,6 +129,7 @@ export default {
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
// 查看企微推送对象
goCheck(row) {
// console.log('goCheck')
// return
......
......@@ -7,7 +7,7 @@
<el-card class="box-card">
<div slot="header" class="clearfix card-header">
<span>工作台总览</span>
<div class="tabel-desc" @click="goPer">
<div class="tabel-desc" v-if="btnFlag" @click="goPer">
<i class="el-icon-document"></i>渗透率报表
</div>
<el-select
......@@ -352,7 +352,8 @@ export default {
upgradeTransfer: ""
},
parkServiceList: [],
productType: "thisMonth"
productType: "thisMonth",
btnFlag: false
}
},
computed: {
......@@ -374,6 +375,12 @@ export default {
this.getUserId().then(() => {
this.init()
})
this.$nextTick(() => {
const $store = this.$store.getters['d2admin/auth/curBtns']
const btnId = '90707' // 渗透率报表权限ID
const _item = $store?.find(i => (i.authId === btnId))
if (_item) this.btnFlag = true
})
},
watch: {
totalType(newType) {
......
<!-- 发货单 -->
<!-- 渗透率报表 -->
<template>
<div>
<d2-container>
......@@ -42,21 +42,19 @@
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
/>
<el-button
v-if="searchForm.sceneType == '0'"
<!-- <el-button
size="small"
class="default-blue-btn"
type="primary"
@click="handleExport"
>导出</el-button
>
<el-button
size="small"
type="primary"
:class="searchForm.sceneType == '0' ? '' : 'default-blue-btn'"
@click="handleDailyExport"
>日报导出</el-button
>
> -->
<span style="margin-left: auto;">
<span style="margin-right: 10px;">
<auth-button category="Button" v-if="searchForm.sceneType == '0'" :show-btn-ids="['9070401']" />
</span>
<auth-button category="Button" :show-btn-ids="['9070403']" />
</span>
</div>
<d2-table
:key="searchForm.sceneType"
......
......@@ -21,19 +21,9 @@
<div class="d2-container-content">
<d2-table-header>
<span slot="left">累计订单金额:¥{{ totalCount }}元</span>
<!-- 车损权益营收概况 -->
<span style="padding:0px 13px;">
<auth-button :show-btn-ids="['9040114']"
<!-- 车损权益营收概况 分润&成本分析 导出 -->
<auth-button :show-btn-ids="['9040129', '9040130', '9040131']"
category="Button" />
</span>
<!-- 分润&成本分析 -->
<span style="padding:0px 13px;">
<auth-button :show-btn-ids="['9040113']"
category="Button" />
</span>
<!-- 导出 -->
<auth-button :show-btn-ids="['9040101']"
category="Button" />
</d2-table-header>
<el-table :data="tableData"
v-loading="$store.state.d2admin.loading.value"
......@@ -283,27 +273,42 @@
fixed="right">
<template slot-scope="scope">
<auth-button slot="auth-button"
:show-btn-ids="['9040111']"
:show-btn-ids="['9040132']"
:data="scope" />
<el-button type="text"
<!-- <el-button type="text"
size="small"
v-if="scope.row.profitAllocationStatus == 4"
@click="chooseRule(scope.row)">
发起分账
</el-button>
<el-button type="text"
</el-button> -->
<!-- 发起分账 -->
<auth-button slot="auth-button"
v-if="scope.row.profitAllocationStatus == 4"
:show-btn-ids="['9040133']"
:data="scope.row" />
<!-- <el-button type="text"
size="small"
v-if="scope.row.profitAllocationStatus == 2"
@click="ruleHistory(scope.row)">
分账记录
</el-button>
</el-button> -->
<!-- 分账记录 -->
<auth-button slot="auth-button"
v-if="scope.row.profitAllocationStatus == 2"
:show-btn-ids="['9040134']"
:data="scope.row" />
<!-- 取消分账 分帐中状态 -->
<el-button type="text"
<!-- <el-button type="text"
size="small"
v-if="scope.row.profitAllocationStatus == 5"
@click="cancelRule(scope.row)">
取消分账
</el-button>
</el-button> -->
<!-- 取消分账 -->
<auth-button slot="auth-button"
v-if="scope.row.profitAllocationStatus == 5"
:show-btn-ids="['9040135']"
:data="scope.row" />
</template>
</el-table-column>
</el-table>
......@@ -655,10 +660,10 @@ export default {
// confId: 1,
// confLabel: "待升级"
// },
// {
// confId: 2,
// confLabel: "战败"
// },
{
confId: 2,
confLabel: "战败"
},
{
confId: 3,
confLabel: "待支付"
......@@ -839,7 +844,7 @@ export default {
// }
const $store = this.$store.getters["d2admin/auth/curBtns"]
const btnId = "9040103" // 待补录订单权限ID
const signRefundBtnId = "9040105" // 标记退款权限ID
const signRefundBtnId = "9040136" // 标记退款权限ID
const _item = $store.find((i) => i.authId === btnId)
const signRefundItem = $store.find((i) => i.authId === signRefundBtnId)
if (_item) {
......
......@@ -31,7 +31,9 @@
</div>
<div class="btn-group">
<template>
<el-button class="default-blue-btn" type="primary" @click="handleExport">导出</el-button>
<!-- <el-button class="default-blue-btn" type="primary" @click="handleExport">导出</el-button> -->
<auth-button :show-btn-ids="['9040109']"
category="Button" />
</template>
</div>
<!-- 表格区域 -->
......@@ -104,48 +106,55 @@
</div>
</div>
<div slot="auth-button" slot-scope="scope">
<!-- 查看订单 -->
<span style="margin-left: 10px;">
<auth-button slot="auth-button" :show-btn-ids="['9040112']" :data="scope.scope" />
<auth-button slot="auth-button" :show-btn-ids="['9040118']" :data="scope.scope" />
</span>
<!-- 仅预支付状态显示 -->
<span v-if="scope.scope.tailOrderStatus == '3'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="record(scope.scope)">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="record(scope.scope)">
确认补录
</el-button>
<el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRelat(scope.scope)">
</el-button> -->
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRelat(scope.scope)">
取消关联
</el-button>
</el-button> -->
<auth-button slot="auth-button" style="margin-left: 10px" :show-btn-ids="['9040110', '9040111']" :data="scope.scope" />
</span>
<!-- 核销 -->
<span v-if="scope.scope.showVerf == '1'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="writeOff(scope.scope)">
<span v-if="scope.scope.showVerf == '1'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="writeOff(scope.scope)">
订单核销
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040112']" :data="scope.scope" />
</span>
<!-- 退款 -->
<span v-if="scope.scope.showRefund == '1'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="setRefund(scope.scope)">
<span v-if="scope.scope.showRefund == '1'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="setRefund(scope.scope)">
退款
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040113']" :data="scope.scope" />
</span>
<span v-if="scope.scope.ledgerStatus == '2'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="chooseRule(scope.scope)">
<span v-if="scope.scope.ledgerStatus == '2'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="chooseRule(scope.scope)">
发起分账
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040114']" :data="scope.scope" />
</span>
<span v-if="scope.scope.ledgerStatus == '3'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="ruleHistory(scope.scope)">
<span v-if="scope.scope.ledgerStatus == '3'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="ruleHistory(scope.scope)">
分账记录
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040115']" :data="scope.scope" />
</span>
<!-- 取消分账 分账中状态 -->
<span v-if="scope.scope.ledgerStatus == '4'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRule(scope.scope)">
<span v-if="scope.scope.ledgerStatus == '4'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRule(scope.scope)">
取消分账
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040116']" :data="scope.scope" />
</span>
<!-- 尾款状态 0待支付 1已支付 2已退款 -->
<span v-if="scope.scope.tailOrderStatus == '1'">
<span v-if="scope.scope.tailOrderStatus == '1' && signRefundFlag">
<el-button type="text" size="mini" style="margin-left: 10px" @click="refund(scope.scope)">
标记已退款
</el-button>
......@@ -292,13 +301,20 @@ export default {
ruleVisible: false,
recordInfo: null,
ruleInfoVisible: false
ruleInfoVisible: false,
signRefundFlag: false
}
},
name: "ConfigUpgradation",
mounted() {
this.getCrowdfundingOrderConfig()
this.getCount()
const $store = this.$store.getters['d2admin/auth/curBtns']
const signRefundBtnId = '9040117' // 标记退款权限ID
const signRefundItem = $store.find(i => (i.authId === signRefundBtnId))
if (signRefundItem) {
this.signRefundFlag = true // 是否有标记退款权限
}
},
methods: {
getCount() {
......
......@@ -43,12 +43,14 @@
</div>
<div class="btn-group">
<template>
<el-button class="default-blue-btn"
<!-- <el-button class="default-blue-btn"
type="primary"
@click="handleExport">导出</el-button>
@click="handleExport">导出</el-button>
<el-button class="default-blue-btn"
type="default"
@click="handlebillImport">导入对账单</el-button>
@click="handlebillImport">导入对账单</el-button> -->
<auth-button :show-btn-ids="['9040119', '9040120']"
category="Button" />
</template>
</div>
<!-- 表格区域 -->
......@@ -167,11 +169,11 @@
slot-scope="scope">
<span style="margin-left: 10px;">
<auth-button slot="auth-button"
:show-btn-ids="['9040106']"
:show-btn-ids="['9040121']"
:data="scope.scope" />
</span>
<span>
<el-button type="text"
<span style="margin-left: 10px">
<!-- <el-button type="text"
size="mini"
style="margin-left: 10px"
@click="handleEnd(scope.scope)"
......@@ -179,11 +181,15 @@
scope.scope.marketingStatus == 3
">
设为已完结
</el-button>
</el-button> -->
<auth-button slot="auth-button"
v-if="scope.scope.marketingStatus && scope.scope.marketingStatus == 3"
:show-btn-ids="['9040122']"
:data="scope.scope" />
</span>
<!-- 仅预支付状态显示 -->
<span v-if="scope.scope.tailOrderStatus == '3'">
<el-button type="text"
<!-- <el-button type="text"
size="mini"
style="margin-left: 10px"
@click="record(scope.scope)">
......@@ -194,26 +200,29 @@
style="margin-left: 10px"
@click="cancelRelat(scope.scope)">
取消关联
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040123', '9040124']" :data="scope.scope" />
</span>
<span v-if="scope.scope.ledgerStatus == '2'">
<el-button type="text"
<span v-if="scope.scope.ledgerStatus == '2'" style="margin-left: 10px">
<!-- <el-button type="text"
size="mini"
style="margin-left: 10px"
@click="chooseRule(scope.scope)">
发起分账
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040125']" :data="scope.scope" />
</span>
<span v-if="scope.scope.ledgerStatus == '3'">
<el-button type="text"
<span v-if="scope.scope.ledgerStatus == '3'" style="margin-left: 10px">
<!-- <el-button type="text"
size="mini"
style="margin-left: 10px"
@click="ruleHistory(scope.scope)">
分账记录
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040126']" :data="scope.scope" />
</span>
<!-- 尾款状态 0待支付 1已支付 2已退款 -->
<span v-if="scope.scope.tailOrderStatus == '1'">
<span v-if="scope.scope.tailOrderStatus == '1' && signRefundFlag">
<el-button type="text"
size="mini"
style="margin-left: 10px"
......@@ -222,13 +231,14 @@
</el-button>
</span>
<!-- 取消分账 分账中状态 -->
<span v-if="scope.scope.ledgerStatus == '4'">
<el-button type="text"
<span v-if="scope.scope.ledgerStatus == '4'" style="margin-left: 10px">
<!-- <el-button type="text"
size="mini"
style="margin-left: 10px"
@click="cancelRule(scope.scope)">
取消分账
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040127']" :data="scope.scope" />
</span>
</div>
</d2-table>
......@@ -467,13 +477,20 @@ export default {
ruleVisible: false,
recordInfo: null,
ruleInfoVisible: false
ruleInfoVisible: false,
signRefundFlag: false
}
},
name: "Crowdfunding",
mounted() {
this.getCrowdfundingOrderConfig()
this.getCount()
const $store = this.$store.getters['d2admin/auth/curBtns']
const signRefundBtnId = '9040128' // 标记退款权限ID
const signRefundItem = $store.find(i => (i.authId === signRefundBtnId))
if (signRefundItem) {
this.signRefundFlag = true // 是否有标记退款权限
}
},
methods: {
getCount() {
......
......@@ -23,7 +23,9 @@
</div>
<div class="btn-group">
<template>
<el-button class="default-blue-btn" type="primary" @click="handleExport">导出</el-button>
<!-- <el-button class="default-blue-btn" type="primary" @click="handleExport">导出</el-button> -->
<auth-button :show-btn-ids="['9040137']"
category="Button" />
</template>
</div>
<!-- 表格区域 -->
......@@ -97,50 +99,56 @@
</div>
<div slot="auth-button" slot-scope="scope">
<span style="margin-left: 10px;">
<auth-button slot="auth-button" :show-btn-ids="['9040112']" :data="scope.scope" />
<auth-button slot="auth-button" :show-btn-ids="['9040146']" :data="scope.scope" />
</span>
<!-- 仅预支付状态显示 -->
<span v-if="scope.scope.tailOrderStatus == '3'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="record(scope.scope)">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="record(scope.scope)">
确认补录
</el-button>
<el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRelat(scope.scope)">
取消关联
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040138', '9040139']" :data="scope.scope" />
</span>
<span v-if="scope.scope.ledgerStatus == '2'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="chooseRule(scope.scope)">
<span v-if="scope.scope.ledgerStatus == '2'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="chooseRule(scope.scope)">
发起分账
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040140']" :data="scope.scope"/>
</span>
<span v-if="scope.scope.ledgerStatus == '3'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="ruleHistory(scope.scope)">
<span v-if="scope.scope.ledgerStatus == '3'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="ruleHistory(scope.scope)">
分账记录
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040141']" :data="scope.scope"/>
</span>
<!-- 取消分账 分账中状态 -->
<span v-if="scope.scope.ledgerStatus == '4'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRule(scope.scope)">
<span v-if="scope.scope.ledgerStatus == '4'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRule(scope.scope)">
取消分账
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040142']" :data="scope.scope" />
</span>
<!-- 尾款状态 0待支付 1已支付 2已退款 -->
<span v-if="scope.scope.tailOrderStatus == '1'">
<span v-if="scope.scope.tailOrderStatus == '1' && signRefundFlag">
<el-button type="text" size="mini" style="margin-left: 10px" @click="refund(scope.scope)">
标记已退款
</el-button>
</span>
<!-- 核销 -->
<span v-if="scope.scope.showVerf == '1'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="writeOff(scope.scope)">
<span v-if="scope.scope.showVerf == '1'" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="writeOff(scope.scope)">
订单核销
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040143']" :data="scope.scope"/>
</span>
<!-- 商品发货 -->
<span v-if="scope.scope.deliveryType == 2 && scope.scope.orderStatus == 6">
<el-button type="text" size="mini" style="margin-left: 10px" @click="handleExpressInfo(scope.scope)">
<span v-if="scope.scope.deliveryType == 2 && scope.scope.orderStatus == 6" style="margin-left: 10px">
<!-- <el-button type="text" size="mini" style="margin-left: 10px" @click="handleExpressInfo(scope.scope)">
商品发货
</el-button>
</el-button> -->
<auth-button slot="auth-button" :show-btn-ids="['9040144']" :data="scope.scope" />
</span>
<!-- 退款 -->
<!-- <span v-if="scope.scope.showRefund == '1'">
......@@ -353,13 +361,20 @@ export default {
ruleVisible: false,
recordInfo: null,
ruleInfoVisible: false,
tabClickVal: ''
tabClickVal: '',
signRefundFlag: false
}
},
name: "IntegralShopping",
mounted() {
this.getCrowdfundingOrderConfig()
// this.getCount()
const $store = this.$store.getters['d2admin/auth/curBtns']
const signRefundBtnId = '9040145' // 标记退款权限ID
const signRefundItem = $store.find(i => (i.authId === signRefundBtnId))
if (signRefundItem) {
this.signRefundFlag = true // 是否有标记退款权限
}
},
methods: {
ruleDialogClose(flag) {
......
......@@ -38,7 +38,7 @@
<!-- <auth-button :showBtnIds="['9040104']"
class="p-r-20"
category="Button"></auth-button> -->
<auth-button :show-btn-ids="['9040101', '9040104']"
<auth-button :show-btn-ids="['9040101', '9040103']"
category="Button" />
</d2-table-header>
<el-table :data="tableData"
......@@ -281,28 +281,40 @@
align="center"
fixed="right">
<template slot-scope="scope">
<auth-button slot="auth-button"
:show-btn-ids="['9040102']"
<!-- 查看详情 -->
<auth-button :show-btn-ids="['9040104']"
:data="scope" />
<el-button type="text"
<!-- <el-button type="text"
size="small"
v-if="scope.row.profitAllocationStatus == 4"
@click="chooseRule(scope.row)">
发起分账
</el-button>
<el-button type="text"
</el-button> -->
<!-- 发起分账 -->
<auth-button v-if="scope.row.profitAllocationStatus == 4"
:show-btn-ids="['9040105']"
:data="scope.row" />
<!-- <el-button type="text"
size="small"
v-if="scope.row.profitAllocationStatus == 2"
@click="ruleHistory(scope.row)">
分账记录
</el-button>
<el-button type="text"
</el-button> -->
<!-- 分账记录 -->
<auth-button v-if="scope.row.profitAllocationStatus == 2"
:show-btn-ids="['9040106']"
:data="scope.row" />
<!-- <el-button type="text"
style="margin-left: 0;"
size="small"
v-if="scope.row.profitAllocationStatus == 5"
@click="cancelRule(scope.row)">
取消分账
</el-button>
</el-button> -->
<!-- 取消分账 -->
<auth-button v-if="scope.row.profitAllocationStatus == 5"
:show-btn-ids="['9040107']"
:data="scope.row" />
</template>
</el-table-column>
</el-table>
......@@ -835,21 +847,28 @@ export default {
const itemName = ['sourceList', 'channelType', 'businessModel']
this.showFormData = this.showFormData.filter(item => !itemName.includes(item.name))
}
if (this.userInfo.beSuper || this.specialAccout) {
getParkStore({}).then(res => {
res.forEach(item => {
item.merchantId = item.merchantNo
})
this.baseData.parkServiceList = res
this.getOptionsList()
// if (this.userInfo.beSuper || this.specialAccout) {
// getParkStore({}).then(res => {
// res.forEach(item => {
// item.merchantId = item.merchantNo
// })
// this.baseData.parkServiceList = res
// this.getOptionsList()
// })
// } else {
// this.showFormData = this.showFormData.filter(item => item.name !== 'yqMerchantId')
// this.getServiceStore(this.userInfo.detail.merchantId)
// }
getParkStore({}).then(res => {
res.forEach(item => {
item.merchantId = item.merchantNo
})
} else {
this.showFormData = this.showFormData.filter(item => item.name !== 'yqMerchantId')
this.getServiceStore(this.userInfo.detail.merchantId)
}
this.baseData.parkServiceList = res
this.getOptionsList()
})
const $store = this.$store.getters['d2admin/auth/curBtns']
const btnId = '9040103' // 待补录订单权限ID
const signRefundBtnId = '9040105' // 标记退款权限ID
const btnId = '9040102' // 待补录订单权限ID
const signRefundBtnId = '9040108' // 标记退款权限ID
const _item = $store.find(i => (i.authId === btnId))
const signRefundItem = $store.find(i => (i.authId === signRefundBtnId))
if (_item) {
......
......@@ -4,14 +4,14 @@
<div class="d2-container-content">
<p class="edit-title">
订单详情&nbsp;&nbsp;&nbsp;<el-button size="mini"
v-if="signRefundFlag && [4, 6].includes(detail.status)"
class="signRefundBtn"
@click="refund">
v-if="signRefundFlag && [4, 6].includes(detail.status)"
class="signRefundBtn"
@click="refund">
<img class="signRefundIcon"
src="./images/sign.png"> 标记为退款
</el-button>
&nbsp;&nbsp;&nbsp;<el-button size="mini"
v-if="[4].includes(detail.status)"
v-if="InvoicingFlag && [4].includes(detail.status)"
class="signRefundBtn"
@click="Invoicing(detail.id)">
<img class="signRefundIcon"
......@@ -75,9 +75,12 @@
<el-form-item class="remarkItem"
label="备注:">
{{ detail.remark }} <el-button type="text"
v-if="userInfo.beSuper"
v-if="editRemarkFlag"
@click="editRemark">修改</el-button>
</p>
</el-form-item>
<el-form-item label="战败原因:"
v-if="detail.status == 2">
{{ $$(detail, 'customer', 'refusalReason') }}
</el-form-item>
</el-form>
</div>
......@@ -247,7 +250,7 @@
label="关联操作员">
<template slot-scope="scope">
<span
v-if="detail.payOrder && detail.payOrder.payType == 1 && scope.row.logType == 3">用户
v-if="detail.payOrder && detail.payOrder.payType == 1 && scope.row.logType == 3">用户
微信支付</span>
<span v-else>{{ logType[scope.row.logType] }} {{ scope.row.userName }}</span>
</template>
......@@ -366,7 +369,9 @@ export default {
},
positionTypeList: [],
extendedPosiTypeList: [],
isPartialRefund: false // 支持部分退款
isPartialRefund: false, // 支持部分退款
InvoicingFlag: false, // 标记已开票权限
editRemarkFlag: false // 编辑备注权限
}
},
computed: {
......@@ -378,6 +383,12 @@ export default {
this.signRefundFlag = this.$route.query.signRefundFlag
this.getBaseData()
this.getGoodsOrderDetail()
const $store = this.$store.getters['d2admin/auth/curBtns']
const editRemarkBtnId = '9040303' // 编辑备注信息权限ID
const _item = $store?.find(i => (i.authId === editRemarkBtnId))
if (_item) {
this.editRemarkFlag = true
}
},
methods: {
......@@ -386,7 +397,6 @@ export default {
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.extendedPosiTypeList = await this.get(BaseData.extendedPosiTypeList)
console.log(this.extendedPosiTypeList, '------')
},
handleEnlargeImg(url, name) {
this.imgVisible = !this.imgVisible
......@@ -481,6 +491,14 @@ export default {
}, '')
// 1.1精品升级场景 2.1会员权益/升级场景 标记已退款 支持退部分款
if (res?.sceneType == 1 || res?.sceneType == 0) this.isPartialRefund = true
this.$nextTick(() => {
const $store = this.$store.getters['d2admin/auth/curBtns']
const InvoicingBtnId = res?.sceneType == 1 ? '9040301' : res?.sceneType == 0 ? '9040302' : '' // 标记已开票权限ID
const _item = $store?.find(i => (i.authId === InvoicingBtnId))
if (_item) {
this.InvoicingFlag = true
}
})
// this.detail.remark = ' this.detail.evaluation 价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜价格便宜'
// this.detail = Object.assign(this.detail, res)
// this.detail = Object.assign(res, res.payOrder)
......
......@@ -31,16 +31,18 @@
<!-- <el-button type="primary" @click="batchRecord">
批量确认补录
</el-button> -->
<el-button type="primary" @click="batchUpdateYqMerchant">
<!-- <el-button type="primary" @click="batchUpdateYqMerchant"> -->
<!-- 批量修改所属园区店 -->
批量修改所属服务对接
<!-- 批量修改所属服务对接
</el-button>
<el-button type="primary" @click="batchMarkAsNoUse">
批量标记为无需补录
</el-button>
<el-button type="primary" @click="handleExport">
导出
</el-button>
</el-button> -->
<auth-button :show-btn-ids="['9040201', '9040202', '9040203']"
category="Button" />
</d2-table-header>
<!-- :beforeSearchFn="beforeSearchFn" -->
<d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams"
......@@ -48,10 +50,10 @@
<template slot="auth-button" slot-scope="scope">
<!-- 已分帐无可操作内容 -->
<div v-if="scope.scope.inputStatus !== '6'">
<el-button type="text" v-if="scope.scope.inputStatus == '1'" @click="orderDetail(scope.scope)">
<!-- <el-button type="text" v-if="scope.scope.inputStatus == '1'" @click="orderDetail(scope.scope)">
订单详情
</el-button>
</el-button> -->
<auth-button v-if="scope.scope.inputStatus == '1'" :show-btn-ids="['9040204']" :data="scope.scope"/>
<!-- <el-button type="text"
v-if="scope.scope.inputStatus == '0'"
@click="relatActivityOrder(scope.scope)">
......
......@@ -58,8 +58,6 @@ export default {
components: {},
mounted() {
console.log('this.detail', this.detail)
console.log('this.remarkVisible', this.remarkVisible)
const remark = deepClone(this.detail.remark)
this.infoForm.remark = remark
},
......
......@@ -24,16 +24,17 @@
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<!-- <span slot="left"> -->
<!-- <auth-button category="Button" /> -->
<auth-button category="Button" />
</span>
<!-- <auth-button category="Button" />
</span> -->
<span>
<el-button type="primary"
<!-- <el-button type="primary"
size="mini"
@click="handleExport">
导出
</el-button>
</el-button> -->
<auth-button category="Button" :show-btn-ids="['9090605']" />
</span>
</d2-table-header>
<d2-table ref="purchasementReviewTable"
......
......@@ -24,16 +24,17 @@
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<!-- <span slot="left"> -->
<!-- <auth-button category="Button" /> -->
<auth-button category="Button" />
</span>
<!-- <auth-button category="Button" />
</span> -->
<span>
<el-button type="primary"
<!-- <el-button type="primary"
size="mini"
@click="handleExport">
导出
</el-button>
</el-button> -->
<auth-button category="Button" :show-btn-ids="['9090305']" />
</span>
</d2-table-header>
<d2-table ref="purchasementReviewTable"
......
......@@ -23,16 +23,16 @@
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<!-- <auth-button category="Button" /> -->
<auth-button category="Button" />
</span>
<!-- <span slot="left"> -->
<!-- <auth-button category="Button" /> -->
<!-- <auth-button category="Button" />
</span> -->
<span>
<el-button type="primary"
size="mini"
@click="handleExport">
<!-- <el-button type="primary" size="mini" @click="handleExport">
导出
</el-button>
</el-button> -->
<auth-button category="Button"
:show-btn-ids="['9090405']" />
</span>
</d2-table-header>
<d2-table ref="purchaseAndDeliveryTable"
......
......@@ -29,11 +29,12 @@
<auth-button category="Button" />
</span>
<span>
<el-button type="primary"
<!-- <el-button type="primary"
size="mini"
@click="handleExport">
导出
</el-button>
</el-button> -->
<auth-button category="Button" :show-btn-ids="['9090106']" />
</span>
</d2-table-header>
<d2-table ref="purchaseOrderTable"
......
......@@ -91,7 +91,7 @@ export default {
this.userInput[0] = event
},
handleEndInput (event) {
handleEndInput(event) {
const isNumber = /^\d+$/.test(event)
if (!isNumber) {
event = null
......@@ -130,15 +130,14 @@ export default {
this.$emit("focus", this)
}
},
handleBlur (index) {
handleBlur(index) {
this.pickerVisible = false
this.contrastValue()
},
contrastValue () {
const val = this.userInput
if (Array.isArray(val)) {
if (val[0] > val[1]) {
if (+val[0] > +val[1]) {
val[1] = null
}
}
......
<!-- 关联活动订单弹窗 -->
<template>
<d2-dialog
title="质检详情"
:is-visible="isQualityVisible"
class="qualityDailog"
width="80%"
@closeDialog="handleClose"
@confirmDialog="handleClose">
<div>
<el-tabs v-model="activeName" @tab-click="handleReset">
<el-tab-pane label="质检分析" name="analyse">
<quality-analyse v-if="activeName == 'analyse'" v-bind="$attrs" ref="analyseList" />
</el-tab-pane>
<el-tab-pane label="对练详情" name="dialogue">
<dialogue-detail
v-if="activeName == 'dialogue'"
ref="dialogueDetail"
v-bind="$attrs" />
</el-tab-pane>
</el-tabs>
</div>
</d2-dialog>
</template>
<script>
import { Util } from "@/common/util"
import { shopmallOrderList } from "@api/order"
import QualityAnalyse from "./qualityInspectionAnalyse"
import DialogueDetail from "./pairDetail"
export default {
name: "DialogResult",
components: {
QualityAnalyse,
DialogueDetail
},
data() {
return {
activeName: "analyse",
userInfo: this.$store.state.d2admin.user.info,
countObj: {},
searchForm: {
merchantName: "",
activityName: ""
},
searchFormSearch: {},
searchSelectObj: {
orderOrTrade: {
attr: "inputtedOrderCode",
value: ""
}
},
showFormData: [
{
label: "支付时间",
name: "orderDate",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
},
{
label: "商户名称",
name: "merchantName",
type: "input",
maxlength: 20,
isClear: true,
keyFn: this.keyDowmGetList
},
{
label: "所属活动",
name: "activityName",
type: "input",
maxlength: 20,
isClear: true,
keyFn: this.keyDowmGetList
},
{
label: "客户名称",
name: "customerName",
type: "input",
maxlength: 20,
isClear: true,
keyFn: this.keyDowmGetList
},
{
label: "手机号",
name: "customerPhone",
type: "input",
inputType: "number",
maxlength: 11,
isClear: true,
keyFn: this.keyDowmGetList
}
],
getListApi: shopmallOrderList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
singleSelectUniqueKey: "id",
tableOption: false,
tableColumns: [
{
label: "订单编号",
prop: "orderCode",
width: "200px"
},
{
label: "订单时间",
prop: "orderTime",
width: "150px",
formatter: (cellValue) => {
return cellValue.orderTime
? Util.dateFormate(cellValue.orderTime, "YYYY-MM-DD HH:mm:ss")
: ""
}
},
{
label: "客户名称",
prop: "customerName"
},
{
label: "手机号",
prop: "customerPhone",
width: "120px"
},
{
label: "商品名称",
prop: "goodsName",
formatter: (cellValue) => {
if (cellValue.subOrderList && cellValue.subOrderList.length > 0) {
return cellValue.subOrderList.reduce((str, item, index) => {
// return item.goodsName
if (index) {
str += "/" + item.goodsName
} else {
str += item.goodsName
}
return str
}, "")
// return cellValue.subOrderList[0].goodsName
} else {
return ""
}
}
},
{
label: "活动名称",
prop: "activityName"
// width: '200px'
},
{
label: "所属门店",
prop: "merchantName"
// width: '200px'
},
{
label: "尾款总额",
prop: "balancePaymentPrice",
formatter: (cellValue) => {
return cellValue.balancePaymentPrice
? "¥" + cellValue.balancePaymentPrice
: ""
}
},
{
label: "支付时间",
prop: "payDate",
width: "150px",
formatter: (cellValue) => {
return cellValue.payDate
? Util.dateFormate(cellValue.payDate, "YYYY-MM-DD HH:mm:ss")
: ""
}
}
]
},
baseData: {},
merchantDialogVisible: false,
ids: [],
radio: ""
}
},
props: {
isQualityVisible: {
type: Boolean,
default: false
}
},
computed: {},
mounted() {
console.log(111, this.$attrs)
},
methods: {
handleReset() {},
handleClose() {
this.$emit("closeDialog", false)
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="dialogue">
<!-- <div class="record">
<audio id="audio1">
<source :src="detailObj.fileUrl" type="audio/mpeg" />
<source :src="detailObj.fileUrl" type="audio/ogg" />
您的浏览器不支持 audio 标签。
</audio>
<div class="play" v-if="isPlay" @click="handleAudio">
<img src="@/assets/play.png" />
</div>
<div class="play" v-else @click="handleAudio">
<img src="@/assets/pause.png" />
</div>
<div class="times">{{ currentTime }}/{{ totalTime }}</div>
<div
id="progressBar"
@mousemove="isCircle = true"
@mouseout="isCircle = false">
<div id="progress">
<div
class="circle"
@mousemove="isCircle = true"
draggable="true"
v-if="isCircle"></div>
</div>
</div>
<div class="trumpet" @click="handleMute">
<img src="@/assets/trumpet.png" v-if="isMuted"/>
<img src="@/assets/mute.png" v-if="!isMuted" />
</div>
</div> -->
<div class="record-info">
<div class="dialog">
<template v-for="item in dialogList">
<div :class="{ 'dialog-detail': true, 'nth-child': item.role == '2' }" :key="item.id">
<div class="name">
<img class="role" src="@/assets/role-one.png" v-if="item.role == '1'" />
{{ item.role == '1' ? '客户' : '销售' }}
<img class="role" src="@/assets/role-two.png" v-if="item.role == '2'" />
</div>
<div class="dig-content" @click="currentDialog(item)">
{{ item.content }}
</div>
</div>
</template>
</div>
<div class="abstract">
<div class="title">
<img class="robot" src="@/assets/robot.png" />
AI对话摘要
</div>
<div class="abText" v-html="formatSrt(digest)">
</div>
</div>
</div>
</div>
</template>
<script>
import { getSparringDetail, getQualityResult } from "@api/exercise"
export default {
name: 'PairDetail',
props: {
detailObj: {
type: Object,
default: {}
}
},
data() {
return {
myAud: "",
isPlay: true,
isMuted: true,
dialogList: [],
totalTime: "0:00",
currentTime: "0:00",
isCircle: false,
digest: ''
}
},
mounted() {
// this.myAud = document.getElementById("audio1")
// this.handleprogress()
this.conversationDetailPage()
},
methods: {
formatSrt(str) {
return str ? str.replace(/\n/g, "<br/>") : ''
},
currentDialog(data) {
this.myAud.currentTime = data.mergedOffset
},
toMinutesAndSeconds(seconds) {
let minutes = Math.floor(seconds / 60)
let remainingSeconds = parseInt(seconds % 60)
minutes = minutes > 10 ? minutes : `0${minutes}`
remainingSeconds = remainingSeconds > 10 ? remainingSeconds : `0${remainingSeconds}`
return `${minutes}:${remainingSeconds}`
},
handleprogress() {
const progress = document.getElementById("progress")
const progressBar = document.getElementById("progressBar")
this.myAud.addEventListener("canplay", () => {
if (this.myAud.duration > 0) {
this.totalTime = this.toMinutesAndSeconds(this.myAud.duration)
}
})
this.myAud.addEventListener("timeupdate", () => {
if (this.myAud.duration > 0) {
this.currentTime = this.toMinutesAndSeconds(this.myAud.currentTime)
const progressDur =
(this.myAud.currentTime / this.myAud.duration) * 100
progress.style.width = `${progressDur}%`
}
})
this.myAud.addEventListener("ended", () => {
this.isPlay = !this.isPlay
})
progress.addEventListener(
"click",
(e) => {
const x = e.offsetX / 370
const currentWidth = x * this.myAud.duration
this.myAud.currentTime = currentWidth
},
false
)
progressBar.addEventListener(
"click",
(e) => {
const x = e.offsetX / 370
const currentWidth = x * this.myAud.duration
this.myAud.currentTime = currentWidth
},
false
)
},
handleAudio() {
this.isPlay = !this.isPlay
if (!this.isPlay) {
this.myAud.play()
} else {
this.myAud.pause()
}
},
handleMute() {
this.isMuted = !this.isMuted
this.myAud.muted = !this.isMuted
},
conversationDetailPage() {
console.log(this.detailObj)
getSparringDetail({
taskStaffId: this.detailObj.id,
currentPage: 1,
pageSize: 9999
}).then((res) => {
console.log(res)
this.dialogList = res.list
})
getQualityResult({
taskStaffId: this.detailObj.id
}).then(res => {
this.digest = res.digest
})
}
}
}
</script>
<style scoped lang="scss">
.dialogue {
margin: auto;
.record {
width: 600px;
margin: 5px auto 0px;
height: 56px;
background: #f7f9fa;
border-radius: 32px;
display: flex;
align-items: center;
audio {
width: 600px;
height: 56px;
background: #f7f9fa;
border-radius: 32px;
}
}
.play {
width: 24px;
height: 24px;
margin: 0 20px 0 24px;
img {
width: 100%;
}
}
.trumpet {
width: 16px;
height: 16px;
margin-left: 24px;
img {
width: 100%;
}
}
.times {
font-size: 14px;
color: #666666;
min-width: 80px;
text-align: center;
margin-right: 19px;
}
#progressBar {
// position: absolute;
height: 6px;
width: 370px;
background-color: #e7e7e7;
/* 进度条背景颜色 */
border-radius: 6px;
}
#progress {
width: 0;
/* 初始进度为0 */
height: 6px;
background-image: linear-gradient(90deg, #9662ff 0%, #5850ff 100%);
/* 进度条颜色 */
transition: width 0.5s;
/* 进度条宽度变化动画 */
border-radius: 6px;
position: relative;
}
.circle {
width: 16px;
height: 16px;
background: #5850ff;
border: 4.5px solid #ffffff;
border-radius: 50%;
position: absolute;
right: -14px;
top: -4px;
box-sizing: border-box;
}
.record-info {
width: 100%;
float: left;
position: relative;
padding-right: 354px;
box-sizing: border-box;
height: 544px;
margin: 20px 0;
// display: flex;
// align-items: center;
.dialog {
width: 100%;
min-width: 588px;
height: 544px;
background: #f7f9fa;
border-radius: 4px;
overflow-y: scroll;
padding: 20px;
box-sizing: border-box;
.dialog-detail {
margin-bottom: 8px;
text-align: left;
.name {
font-size: 12px;
color: #666666;
letter-spacing: 0;
line-height: 16px;
.role {
width: 40px;
height: 40px;
vertical-align: top;
margin-right: 10px;
}
}
.dig-content {
width: 404px;
background: #EBEBFF;
border-radius: 4px;
font-size: 14px;
color: #333333;
padding: 10px 12px;
white-space: pre-wrap;
text-align: left;
margin-left: 50px;
margin-top: -20px;
line-height: 20px;
}
}
.nth-child {
text-align: right;
.dig-content {
display: inline-block;
background: #FFFFFF;
margin-right: 58px;
}
}
}
.abstract {
width: 334px;
height: 544px;
padding: 12px 20px;
position: absolute;
right: 0;
top: 0;
background-image: linear-gradient(180deg, #f6f4ff 0%, #f0f3ff 100%);
border: 1px solid #5850ff80;
border-radius: 4px;
box-sizing: border-box;
.title {
font-weight: 700;
font-size: 16px;
color: #333333;
.robot {
width: 28px;
height: 28px;
margin-right: 8px;
display: inline-block;
vertical-align: middle;
}
}
.abText {
margin-top: 14px;
width: 294px;
height: 472px;
padding: 12px;
box-sizing: border-box;
background: #ffffff;
border-radius: 4px;
overflow: scroll;
line-height: 20px;
}
}
}
}
</style>
<template>
<div class="analyse">
<div class="statistics">
<div class="s-item" v-for="(item, index) in sList" :key="index">
<div class="title">{{ item.text }}</div>
<div
class="content"
v-html="item.formatter && item.formatter(detailObj)"></div>
</div>
</div>
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData">
<div slot="firstClassify">
<el-select
v-model="searchForm.firstClassify"
clearable
placeholder="请选择"
@change="changeClassify">
<el-option
v-for="item in baseData.firstClassifyList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</div>
<div slot="secondClassify">
<el-select
v-model="searchForm.secondClassify"
clearable
placeholder="请选择">
<el-option
v-for="item in baseData.secondClassifyList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</div>
<template slot="score">
<el-input-range
start-placeholder="请输入"
end-placeholder="请输入"
:display-value="searchForm.qualityTestScore"></el-input-range>
</template>
</d2-search>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
<div class="theader">
<div class="title">话术列表</div>
<el-radio-group v-model="searchForm.hitResult">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">命中</el-radio-button>
<el-radio-button label="0">未命中</el-radio-button>
</el-radio-group>
</div>
<d2-table
ref="analyseTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:has-page="false">
<div slot="scoreHtml" slot-scope="scope">
<template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }}
</template>
<template v-else>--</template>
</div>
<!-- hitTextHtml -->
<template slot="hitTextHtml" slot-scope="scope">
<div v-html="formatSrt(scope.scope.hitText)"></div>
</template>
<template slot="suggestions" slot-scope="scope">
<div v-html="formatSrt(scope.scope.suggestions)"></div>
</template>
<template slot="hitResult" slot-scope="scope">
<div :class="['tag', scope.scope.hitResult == 1 ? 'gre' : 'red']">
{{ scope.scope.hitResult == 1 ? "是" : "否" }}
</div>
</template>
</d2-table>
</div>
</template>
<script>
import ElInputRange from "../../el-input-range"
import { Util, deepClone } from "@/common/util"
// import { conversationCheckList, getPointCategory } from "@api/resident"
import { getQualityResult } from "@api/exercise"
export default {
name: 'QualityInspectionAnalyse',
components: {
ElInputRange
},
props: {
detailObj: {
type: Object,
default: {}
}
},
data() {
return {
sList: [
{
text: "话术评分",
formatter: (data) => {
return `<span style="font-weight:700;font-size:20px;">${
data.score ? data.score : "0"
}</span>分`
}
},
{
text: '预计营销结果',
formatter: data => {
const classStr = data.estimatedResult == '成交' ? (data.estimatedResult == '战败' ? 'redStr' : 'greenStr') : 'grayStr'
return `<span class="${classStr}" style="font-weight:700;font-size:20px;">${data.estimatedResult ? data.estimatedResult : '--'}</span>`
}
}
],
searchForm: {
// firstClassify: "",
// secondClassify: "",
qualityTestScore: [],
hitResult: ""
},
searchFormSearch: {},
showFormData: [
// {
// label: "一级分类",
// name: "firstClassify",
// addHtml: "firstClassify"
// },
// {
// label: "二级分类",
// name: "secondClassify",
// addHtml: "secondClassify"
// },
{
label: "质检评分",
name: "qualityTestScore",
addHtml: "score"
}
],
select: "全部",
getListApi: getQualityResult,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "checkDetailList",
tableOption: false,
tableColumns: [
{
label: "一级分类",
prop: "firstClassify",
width: "120px"
},
{
label: "二级分类",
prop: "secondClassify",
width: "140px"
},
{
label: "质检评分",
prop: "score",
width: "100px",
addHtml: "scoreHtml"
},
{
label: "是否命中",
prop: "hitResult",
width: "100px",
addHtml: "hitResult"
},
{
label: "命中文本",
prop: "hitText",
addHtml: 'hitTextHtml'
},
{
label: "话术建议",
prop: "suggestions",
addHtml: 'suggestions',
align: 'left'
}
]
},
baseData: {
firstClassifyList: [],
secondClassifyList: []
}
}
},
watch: {
"searchForm.hitResult"() {
this.$refs.analyseTable.refreshTable(true, true)
}
},
mounted() {
// this.getPointCategory()
},
methods: {
formatSrt(str) {
return str ? str.replace(/\n/g, "<br/>") : '--'
},
toMinutesAndSeconds(seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else if (seconds > 3600) {
const hours = Math.floor(seconds / 3600)
const minutes = Math.floor((seconds % 3600) / 60)
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
return formattedTime
} else {
const hours = Math.floor(seconds / 3600)
const minutes = Math.floor((seconds % 3600) / 60)
const remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
}
},
// toMinutesAndSeconds(time) {
// const h = Math.floor(time / 3600)
// const m = parseInt((time % 3600) / 60)
// return {
// h,
// m
// }
// },
getPointCategory() {
this.classifyMap = new Map()
getPointCategory().then((res) => {
console.log(res)
this.baseData.firstClassifyList = Object.keys(res)
for (const item in res) {
this.classifyMap.set(item, res[item])
}
})
},
changeClassify() {
this.searchForm.secondClassify = ""
this.baseData.secondClassifyList = this.classifyMap.get(
this.searchForm.firstClassify
)
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.taskStaffId = this.detailObj.id
// this.searchFormSearch.pageSize = 99999
if (this.searchFormSearch.qualityTestScore) {
console.log(this.searchForm, '===')
this.searchFormSearch.qualityTestScoreBegin =
this.searchFormSearch.qualityTestScore[0]
this.searchFormSearch.qualityTestScoreEnd =
this.searchFormSearch.qualityTestScore[1]
}
delete this.searchFormSearch.qualityTestScore
resolve()
})
},
handleSearch() {
this.$refs.analyseTable.refreshTable(true, true)
},
handleReset() {
this.searchForm = {
// firstClassify: "",
// secondClassify: "",
qualityTestScore: [],
hitResult: ""
}
this.baseData.secondClassifyList = []
this.$refs.analyseTable.refreshTable()
}
}
}
</script>
<style lang="scss" scoped>
.analyse {
.statistics {
display: flex;
align-items: center;
justify-content: space-between;
.s-item {
flex: 1;
// min-width: 248px;
// height: 84px;
background: #f7f9fa;
border-radius: 4px;
padding: 12px 20px;
box-sizing: border-box;
margin-right: 16px;
.title {
font-size: 14px;
color: #333333;
margin-bottom: 8px;
}
.content {
color: #333333;
line-height:32px;
}
}
}
.theader {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
.title {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.tag {
width: 30px;
height: 24px;
border-radius: 2px;
padding: 0 8px;
line-height: 24px;
box-sizing: border-box;
font-size: 14px;
margin: 0 auto;
}
.gre {
color: #2cca74;
background: #e9f9f1;
}
.red {
color: #eb4e4e;
background: #fdeded;
}
}
</style>
<style>
.redStr {
color: #eb4e4e;
}
.greenStr {
color: #2cca74;
}
.grayStr{
color: #999999;
}
</style>
<!-- 关联门店弹窗 -->
<template>
<d2-dialog
:title="title"
:is-visible.sync="relateStoreVisible"
width="70%"
btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore">
<slot />
<el-row class="tableCon">
<div class="tableBox">
<el-table
ref="seletingTable"
:data="selectingData"
height="464px"
class="table"
border
@select="handleChange"
@select-all="handleAll">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="merchantName" label="门店名称" align="center">
</el-table-column>
<el-table-column prop="staffName" label="驻店员工名称" align="center">
</el-table-column>
<el-table-column prop="phoneNumber" label="手机号" align="center">
</el-table-column>
</el-table>
<el-pagination
small
background
@current-change="handleCurrentChange"
:current-page.sync="pageNum"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
</div>
<el-table
class="tableBox table"
:data="selectedData"
border
height="464px">
<el-table-column prop="merchantName" label="门店名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.merchantName }}</span>
</template>
</el-table-column>
<el-table-column prop="staffName" label="驻店员工名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.staffName }}</span>
</template>
</el-table-column>
<el-table-column prop="phoneNumber" label="手机号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.phoneNumber }}</span>
</template>
</el-table-column>
<el-table-column label="删除" align="center" width="50px">
<template slot-scope="scope">
<el-button
class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
</template>
</el-table-column>
</el-table>
</el-row>
</d2-dialog>
</template>
<script>
export default {
name: "SelectEmployees",
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
pageNum: 1,
pageSize: 20
}
},
props: {
title: {
type: String,
default: "选择驻店员工"
},
relateStoreVisible: {
type: Boolean,
default: false
},
storeApi: {
type: Function,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
},
merchantIds: {
type: Array,
default: () => []
}
},
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
console.log(this.selectedData, '---------')
},
methods: {
recoverySelection() {
var exitIds = this.selectedData.map((item) => item.staffUuid)
this.selectingData.forEach((item) => {
exitIds.includes(item.staffUuid) &&
this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
const _storeSearchForm = this.storeSearchForm
// 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理
// if ([0, 4].includes(this.selectedScene)) {
// // 会员权益,积分商城场景查询门店名称参数
// _storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
// }
this.storeApi({
...this.storeSearchForm,
pageNum: this.pageNum,
pageSize: this.pageSize
// merchantNoList: this.merchantIds
}).then((res) => {
// res?.forEach((val) => {
// 账户中心门店返回商户号字段是merchantNo
// if (val.merchantNo) val.merchantId = Number(val.merchantNo)
// val?.sceneList?.forEach((subVal) => {
// if (subVal.scene == this.selectedScene) {
// val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-"
// val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-"
// }
// })
// })
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(
(item) => item.staffUuid === row.staffUuid
)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.staffUuid !== row.staffUuid
))
},
handleAll(selection) {
this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex(
(subItem) => subItem.staffUuid === item.staffUuid
)
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(
(item) => item.staffUuid !== row.staffUuid
)
const obj = this.selectingData.find((v) => v.staffUuid == row.staffUuid)
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.$emit("handleRelateStoreConfirm", this.selectedData)
},
handleRelateStoreClose() {
this.$emit("handleRelateStoreClose")
}
}
}
</script>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .tableCon {
margin-top: 20px;
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
const scenarioType = {
0: '会员权益/升级',
1: '精品升级',
2: '次新车转化',
3: '售后众筹',
4: '积分商城'
}
export { scenarioType }
<!--
* @Description: 明细
* @Author: huyue
* @Date: 2024-04-16 17:54:27
* @LastEditors: huyue
* @LastEditTime: 2024-05-07 11:00:31
-->
<template>
<div>
<div class="title-box">
<div class="title-tag">{{ scenarioType[taskInfo.businessScenario] }}</div>
<div class="title">{{ taskInfo.taskName }}</div>
<div class="title-time">创建时间:{{ taskInfo.createdDate }}</div>
<div class="title-time">任务时间:{{ taskInfo.startTime }} - {{ taskInfo.endTime }}</div>
</div>
<d2-container style="margin-top: 50px;">
<div class="header" slot="header" style="padding: 10px 20px">
<d2-search
ref="showSearch"
class="show-search"
label-width="110px"
:search-form="searchForm"
:form-data="showFormData">
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</d2-search>
</div>
<div class="d2-container-content" style="position: positive">
<span style="position: absolute; right: 41px; top: 42px; z-index: 999;">
<el-button @click="handleExport" size="small" type="primary">
导出
</el-button>
</span>
<el-tabs v-model="activeName" type="card" @tab-click="handleTabChange">
<el-tab-pane label="全部" name="all"> </el-tab-pane>
<el-tab-pane label="未完成" name="0"> </el-tab-pane>
<el-tab-pane label="已完成" name="1"> </el-tab-pane>
</el-tabs>
<d2-table
ref="exerciseDetailTable"
:has-num="true"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<template slot="auth-button-other" slot-scope="scope">
<!-- <el-button type="text" @click="btnClick(scope)">{{ scope.scope.sparringStatus == 1 ? '查看结果' : '提醒' }}</el-button> -->
<el-button v-if="isEndTimePassed && scope.scope.sparringStatus !== 1" type="text" @click="btnClick(scope)">提醒</el-button>
<el-button v-if="scope.scope.sparringStatus === 1" type="text" @click="btnClick(scope)">查看结果</el-button>
</template>
<div slot="sparringStatus" slot-scope="scope">
<div class="online-status"><span :class="[scope.scope.sparringStatus === 0 ? 'dot blue' : scope.scope.sparringStatus === 1 ? 'dot green' : 'dot orange']"></span>{{scope.scope.sparringStatus ? '已完成' : '未完成'}}</div>
</div>
</d2-table>
</div>
</d2-container>
<quality-detail :is-quality-visible="isQualityVisible" v-if="isQualityVisible" :detail-obj="detailObj"
@closeDialog="closeDialog"></quality-detail>
</div>
</template>
<script>
import { mapActions, mapState } from 'vuex'
import QualityDetail from "./components/dialogResult.vue"
import { Util, deepClone } from '@/common/util'
import { getTaskStaffList, remindTaskStaff } from "@api/exercise"
import { scenarioType } from './contant'
export default {
components: { QualityDetail },
data() {
return {
scenarioType,
activeName: 'all',
searchForm: {},
showFormData: [
{
label: "手机号",
name: "staffPhone",
type: "input",
isclear: true
},
{
label: "员工名称",
name: "staffName",
type: "input",
isclear: true
},
{
label: "完成时间",
name: "completionTime",
type: "datePicker",
isclear: true
}
],
// table 相关
getListApi: getTaskStaffList,
searchFormSearch: {},
tableParams: {
listName: "list",
tableOption: true,
tableColumns: [{
label: "手机号",
prop: "staffPhone"
}, {
label: "员工名称",
prop: "staffName"
}, {
label: "完成状态",
prop: "sparringStatus",
addHtml: 'sparringStatus'
}, {
label: "完成时间",
prop: "completionTime"
}]
},
isQualityVisible: false,
detailObj: {},
taskInfo: {}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
}),
isEndTimePassed() {
const currentTime = new Date()
const endTime = new Date(this.taskInfo.endTime)
return currentTime < endTime
}
},
mounted() {
console.log(this.$route.query, '===')
this.taskInfo = JSON.parse(this.$route.query.detail)
this.searchFormSearch.taskId = this.taskInfo.id
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
handleSearch() {
console.log('search', this.searchFormSearch)
this.$refs.exerciseDetailTable.refreshTable(true, true)
},
handleReset() {
console.log('handleReset')
const { activeName } = this
this.searchForm = {}
this.searchForm.sparringStatus = activeName != 'all' ? activeName : ''
this.searchFormSearch = {}
this.$refs.exerciseDetailTable.refreshTable(true, true)
},
// 查询和导出的参数
getParams() {
var params = deepClone(this.searchForm)
const { activeName } = this
params.taskId = this.taskInfo.id
if (params.completionTime && params.completionTime.length) {
params.startTime = Util.dateFormate(params.completionTime[0], 'YYYY-MM-DD HH:mm:ss')
params.endTime = Util.dateFormate(params.completionTime[1], 'YYYY-MM-DD HH:mm:ss')
delete params.completionTime
}
params.sparringStatus = activeName != 'all' ? activeName : ''
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = this.getParams()
resolve()
})
},
// tab 列表切换
handleTabChange(tab, event) {
console.log(tab, event)
this.activeName = tab.name
this.handleSearch()
},
// 查看结果和提醒
btnClick(scope) {
console.log(scope, '2222222')
const _row = scope.scope
if (_row.sparringStatus == '1') {
// 查看结果
this.detailObj = _row
this.isQualityVisible = true
} else {
this.$confirm('是否确认发送提醒给驻店员工?', '发送提醒', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
console.log('dia关闭')
const params = {
id: _row.id
}
remindTaskStaff(params).then(res => {
console.log(res)
this.$message.success('提醒成功')
})
})
}
},
closeDialog() {
this.isQualityVisible = false
},
// 导出
handleExport() {
var params = this.getParams()
params.method =
"dj.api.smartcarlife.ai.sparring.task.staff.list.export"
const list = [
...this.dowloadList,
{
name: "明细列表",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
}
}
}
</script>
<style scoped lang="scss">
.title-box {
display: flex;
align-items: center;
margin-left: 24px;
.title-tag {
font-size: 14px;
color: #1d1d1d;
padding: 6px 16px;
background: #ffffff;
border: 1px solid #e8e8ea;
border-radius: 16px;
}
.title {
font-weight: 500;
font-size: 16px;
color: #1d1d1d;
margin-left: 12px;
line-height: 24px;
}
.title-time {
font-size: 14px;
color: #666666;
margin-left: 20px;
}
}
.online-status {
display: flex;
justify-content: center;
align-items: center;
.dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
.green {
background-color: #27CD5A;
}
.orange {
background-color: #FDB757;
}
.blue {
background-color: #2a58ad;
}
}
</style>
<!--
* @Description: AI对练
* @Author: huyue
* @Date: 2024-04-15 16:26:57
* @LastEditors: huyue
* @LastEditTime: 2024-05-07 10:56:13
-->
<template>
<div>
<d2-container>
<div class="header" slot="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" label-width="110px" :search-form="searchForm"
:form-data="showFormData">
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</d2-search>
</div>
<div class="d2-container-content" style="position: positive;">
<span style="position: absolute; right: 41px; top: 42px; z-index: 999;">
<auth-button :show-btn-ids="['9120801', '9120802']"
category="Button" />
</span>
<el-tabs v-model="activeName" type="card" @tab-click="handleTabChange">
<el-tab-pane label="全部" name="all">
</el-tab-pane>
<el-tab-pane label="进行中" name="1">
</el-tab-pane>
<el-tab-pane label="已结束" name="2">
</el-tab-pane>
</el-tabs>
<d2-table ref="exerciseTable" :has-num="true" :search-form="searchFormSearch" :table-params="tableParams"
:get-list-api="getListApi" :before-search-fn="beforeSearchFn">
<template slot="auth-button" slot-scope="scope">
<auth-button :data="scope.scope" />
</template>
<div slot="prompt" slot-scope="scope">
<el-switch
:value="scope.scope.promptOnOff" @change="handleSwitch(scope)">
</el-switch>
</div>
<div slot="taskState" slot-scope="scope">
<div class="online-status"><span :class="[scope.scope.taskState === 0 ? 'dot blue' : scope.scope.taskState === 1 ? 'dot orange' : 'dot gray']"></span>{{ statusObj[scope.scope.taskState] }}</div>
</div>
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { mapActions, mapState } from 'vuex'
import { Util, deepClone } from '@/common/util'
import { getList, updateTaskPromptStatus } from '@api/exercise'
import { scenarioType } from './contant'
export default {
data() {
return {
searchForm: {},
showFormData: [
{
label: '任务名称',
name: 'taskName',
type: 'input',
maxlength: 20
},
// {
// label: '状态',
// name: 'taskState',
// type: 'select',
// optionList: [
// {
// label: '全部',
// value: ''
// },
// {
// label: '进行中',
// value: '1'
// },
// {
// label: '已结束',
// value: '2'
// },
// {
// label: '未开始',
// value: '0'
// }
// ],
// optionId: "value",
// optionLabel: "label",
// isClear: true
// },
{
label: '业务场景',
name: 'businessScenario',
type: 'select',
isClear: true,
optionList: [{
label: '全部',
name: ''
}, {
label: '会员权益/升级',
value: '0'
}],
optionId: "value",
optionLabel: "label"
},
{
label: '创建时间',
name: 'createdTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
},
{
label: '任务时间',
name: 'taskTime',
type: 'datePicker',
isClear: true
// pickerOptions: 'rangePickerOptions'
}
],
statusTypeList: [
{
label: '全部',
value: ''
},
{
label: '进行中',
value: '1'
},
{
label: '已结束',
value: '2'
},
{
label: '未开始',
value: '0'
}
],
statusObj: { 0: '未开始', 1: '进行中', 2: '已结束' },
activeName: 'all',
// table相关
getListApi: getList,
searchFormSearch: {},
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [{
label: '业务场景',
prop: 'businessScenario',
formatter: cellValue => {
return scenarioType[cellValue.businessScenario]
}
}, {
label: '任务名称',
prop: 'taskName'
}, {
label: '提示词',
prop: 'promptOnOff',
addHtml: "prompt",
width: '80'
}, {
label: '状态',
prop: 'taskState',
addHtml: "taskState",
width: '80'
}, {
label: '创建时间',
prop: 'createdDate',
formatter: cellValue => {
return Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss')
}
}, {
label: '任务时间',
prop: 'startTime',
formatter: cellValue => {
return Util.dateFormate(cellValue.startTime, 'YYYY-MM-DD') + '-' + Util.dateFormate(cellValue.endTime, 'YYYY-MM-DD')
}
}]
}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
handleSearch() {
this.$refs.exerciseTable.refreshTable(true, true)
},
beforeSearchFn() {
console.log(this.searchForm)
return new Promise(resolve => {
this.searchFormSearch = this.getParams()
resolve()
})
},
getParams() {
var params = deepClone(this.searchForm)
if (params.createdTime && params.createdTime.length) {
params.createTimeStart = Util.dateFormate(params.createdTime[0], 'YYYY-MM-DD HH:mm:ss')
params.createTimeEnd = Util.dateFormate(params.createdTime[1], 'YYYY-MM-DD') + ' 23:59:59'
delete params.createdTime
}
if (params.taskTime && params.taskTime.length) {
params.startTime = Util.dateFormate(params.taskTime[0], 'YYYY-MM-DD HH:mm:ss')
params.endTime = Util.dateFormate(params.taskTime[1], 'YYYY-MM-DD') + ' 23:59:59'
delete params.taskTime
}
console.log(params, '4444444444')
return params
},
handleReset() {
console.log('handleReset')
this.searchForm = {}
this.activeName = 'all'
this.searchFormSearch = {}
this.$refs.exerciseTable.refreshTable(true, true)
},
// tab 列表切换
handleTabChange(tab, event) {
console.log(tab, event)
this.searchForm.taskState = tab.name != 'all' ? tab.name : ''
this.handleSearch()
},
// 状态改变
handleSwitch(scope, e) {
console.log(scope)
const { promptOnOff, id } = scope.scope
this.$confirm(`是否确认${promptOnOff ? '关闭' : '开启'}提示词?`, '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
console.log('dia开启')
updateTaskPromptStatus({
id,
promptOnOff: !promptOnOff
}).then(res => {
if (res && res.id) {
this.$message.success('修改成功')
} else {
this.$message.error('修改失败')
}
this.$refs.exerciseTable.refreshTable(true)
}).catch(err => {
console.log(err)
this.$message.error('修改失败')
})
})
},
// 明细
handleToDetail(row) {
this.close({ tagName: '/exercise' })
this.$router.push({
path: '/exerciseDetail',
query: { detail: JSON.stringify(row) }
})
},
// 查看
handleToView(row) {
this.close({ tagName: '/exercise' })
this.$router.push({
path: '/exerciseView',
query: { detail: JSON.stringify(row) }
})
},
// 新建任务
handleToAdd() {
this.close({ tagName: '/exercise' })
this.$router.push({
path: '/exerciseAdd'
})
},
// 导出
handleExport() {
console.log('导出', this.searchFormSearch, this.getParams())
var params = this.getParams()
params.method =
"dj.api.smartcarlife.ai.sparring.task.list.export"
const list = [
...this.dowloadList,
{
name: "任务列表",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
}
// beforeSearchFn() {
// console.log('beforeSearchFn')
// }
}
}
</script>
<style scoped lang="scss">
.online-status {
display: flex;
justify-content: center;
align-items: center;
.dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
.gray {
background-color: #c5c5c5;
}
.orange {
background-color: #FDB757;
}
.blue {
background-color: #2a58ad;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!