Commit eea2486c by 前端

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

…ife-system into SAAS+V4.55.0-0730
2 parents e2a91f30 30dd6b76
Showing 51 changed files with 5855 additions and 1579 deletions
......@@ -112,3 +112,9 @@ export function billCancelChange(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.cancelChange'
return request(data, "post")
}
// 对账单待取消内容确认
export function tmplCheckField(data) {
data.method = 'dj.api.reconciliation.template.checkField'
return request(data, "post")
}
......@@ -441,23 +441,30 @@ export default {
v.goodsInfo = {}
shopPriceArr.push(v.upgradePrice)
v.listShowShopPrice = v.upgradePrice
let specificationTypeSequenceArr = v.specificationTypeSequence?.split(';~;')
let specificationValueSequenceArr = v?.specificationData?.split(';~;')
let specificationTypeSequenceArr =
v.specificationTypeSequence?.split(";~;")
let specificationValueSequenceArr =
v?.specificationData?.split(";~;")
const suffixMapping = {
1: '年',
2: '(km/万)',
3: '万'
1: "年",
2: "(km/万)",
3: "万"
}
if (specificationTypeSequenceArr?.length) {
specificationValueSequenceArr?.forEach((val, index) => {
const suffix = suffixMapping[specificationTypeSequenceArr[index]]
const suffix =
suffixMapping[specificationTypeSequenceArr[index]]
if (suffix) {
specificationValueSequenceArr[index] = `${val}${suffix}`
specificationValueSequenceArr[
index
] = `${val}${suffix}`
}
})
v.listShowSpecificationData = specificationValueSequenceArr?.join('/')
v.listShowSpecificationData =
specificationValueSequenceArr?.join("/")
} else if (v?.specificationData?.includes(";~;")) {
v.listShowSpecificationData = v?.specificationData?.replace(RegExp(';~;', 'g'), '/')
v.listShowSpecificationData =
v?.specificationData?.replace(RegExp(";~;", "g"), "/")
} else {
v.listShowSpecificationData = "-"
}
......@@ -477,8 +484,10 @@ export default {
val.goodsSpecificationNameList
v.createdDate = val.createdDate
v.updatedDate = val.updatedDate
v.goodsInfo.brandMerchantName = val.goodsInfo?.brandMerchantName || '-'
v.goodsInfo.supplierName = val.goodsInfo?.supplierName || '-'
v.goodsInfo.brandMerchantName =
val.goodsInfo?.brandMerchantName || "-"
v.goodsInfo.supplierName =
val.goodsInfo?.supplierName || "-"
})
const minPrice = shopPriceArr.length
? Math.min(...shopPriceArr)
......
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-06-19 16:57:57
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-07-01 16:36:04
* @FilePath: \dj-car-life-system\src\router\modules\912_residentManage.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/*
* @Description:
* @Author: huyue
* @Date: 2024-04-01 15:03:31
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-06-11 11:33:58
* @LastEditTime: 2025-07-01 16:34:27
*/
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
......@@ -1072,5 +1080,16 @@ export const routerName = {
}
],
component: _import("residentManage/getOutverbalTrickManagement/index")
},
91222: {
path: "/recordLabelManagement",
name: "recordLabelManagement",
meta: {
title: "录音标签管理",
authId: "91222",
parentId: "912",
cache: false
},
component: _import("residentManage/recordLabelManagement/index")
}
}
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
914: {
......@@ -80,7 +79,6 @@ export const routerName = {
parentId: "91402"
}
]
},
{
......@@ -103,8 +101,7 @@ export const routerName = {
parentId: "91402"
}
]
},
}
],
component: _import("pointManagement/pointParticulars")
},
......@@ -132,5 +129,5 @@ export const routerName = {
activePath: "/pointParticulars"
},
component: _import("pointManagement/addDeduction")
},
}
}
......@@ -43,39 +43,6 @@ export const routerName = {
],
component: _import("earlyWarningManager/staff/indexControl")
},
// 91502: {
// path: "/storeWarn",
// name: "storeWarn",
// meta: {
// title: "门店预警管理",
// authId: "91502",
// parentId: "915",
// cache: false
// },
// auth: [
// {
// authId: "9150201",
// parentId: "91502",
// label: "导出",
// category: "Button",
// type: "primary",
// handle: "handleExport"
// },
// {
// authId: "9150202",
// parentId: "91502",
// label: "查看",
// handle: "handleDetail"
// },
// {
// authId: "9150203",
// parentId: "91502",
// label: "处理",
// handle: "handleDeal"
// }
// ],
// component: _import("earlyWarningManager/store/indexControl")
// },
91503: {
path: "/shopGuard",
name: "shopGuard",
......@@ -108,5 +75,5 @@ export const routerName = {
}
],
component: _import("earlyWarningManager/shopGuard/indexControl")
},
}
}
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-04-24 15:36:37
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-04-24 16:31:47
* @FilePath: \dj-car-life-system\src\router\modules\916_largeModel.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
916: {
......
......@@ -23,72 +23,48 @@ export const routerName = {
{
authId: "9190101",
parentId: "91901",
label: "查看",
handle: "handleTaskDetail"
},
{
authId: "9190102",
parentId: "91901",
label: "启用",
handle: "handleOpenOrStop",
ruleObj: {
attr: "status",
rule: {
0: "启用",
1: "停用"
label: "配置课程",
handle: "handleConfigureCourse",
addRoutePath: [
{
authId: "91903",
name: "配置课程",
parentId: "91901"
}
}
]
}
],
component: _import("serviceCentre/longCourse/longCourseCenter")
},
91902: {
path: "/shortCourse",
name: "shortCourse",
meta: {
title: "短课程配置",
authId: "91902",
parentId: "919",
cache: false
},
auth: [
{
authId: "9190201",
parentId: "91902",
label: "查看",
handle: "handleDetail"
}
],
component: _import("serviceCentre/shortCourse/index")
},
91403: {
path: "/configureCourse",
name: "configureCourse",
meta: {
title: "配置课程",
authId: "91403",
parentId: "91901",
cache: false,
activePath: "/longCourse"
},
component: _import("serviceCentre/longCourse/components/configureCourse")
}
// 91702: {
// path: "/invoiceQuery",
// name: "invoiceQuery",
// meta: {
// title: "发票查询",
// authId: "91702",
// parentId: "917",
// cache: false
// },
// auth: [
// {
// authId: "9170201",
// parentId: "91702",
// label: "下载电子发票",
// category: "Button",
// type: "primary",
// handle: "handleDownloadInvoice"
// },
// {
// authId: "9170202",
// parentId: "91702",
// label: "打印电子发票",
// category: "Button",
// type: "primary",
// handle: "handlePrintInvoice"
// },
// {
// authId: "9170203",
// parentId: "91702",
// label: "导出",
// category: "Button",
// type: "primary",
// handle: "handleExport"
// },
// {
// authId: "9170204",
// parentId: "91702",
// label: "详情",
// handle: "handleDetail"
// },
// {
// authId: "9170205",
// parentId: "91702",
// label: "查看发票",
// handle: "handleLookInvoice"
// }
// ],
// component: _import("invoiceManage/invoiceQueryList")
// }
}
......@@ -127,6 +127,7 @@ export default {
},
selectableFn(row) {
this.$emit('changeSelect')
return !row.required
},
......
......@@ -3,7 +3,7 @@
<d2-container class="edit-page edit-tmpl">
<div style="padding: 20px">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px" :isBlock="isBlock" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
<AccountTmpl v-if="showTmpl" ref="accountTmpl" slot="accountTmpl" :type="editData.type" :tmplSelectList="tmplSelectList"></AccountTmpl>
<AccountTmpl v-if="showTmpl" ref="accountTmpl" slot="accountTmpl" :type="editData.type" :tmplSelectList="tmplSelectList" @changeSelect="changeSelect"></AccountTmpl>
</glsx-combi-form>
<div class="footer">
<el-button @click="handleConfirm" type="primary" :loading="$store.state.d2admin.loading.value">提交</el-button>
......@@ -138,6 +138,10 @@ export default {
})
},
changeSelect() {
this.editData.fieldIds = deepClone(this.$refs.accountTmpl.getSelected())
},
handleConfirm() {
this.editData.fieldIds = deepClone(this.$refs.accountTmpl.getSelected())
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
......
......@@ -117,7 +117,7 @@ export default {
handleInput(rowIdx, attr) {
const val = this.tableData[rowIdx][attr]
const oldVal = this.tableOldData[rowIdx][attr]
this.tableData[rowIdx][attr] = limitPrice(val, oldVal, 9, 2)
this.tableData[rowIdx][attr] = limitPrice(val, oldVal, 9, 2, '', '', 'priceReg_negative')
this.tableOldData[rowIdx][attr] = this.tableData[rowIdx][attr]
},
handleInputBlur() {
......
......@@ -713,22 +713,22 @@ export default {
validateField(rowIndex, source, field, fieldConfig) {
const value = this.tableList[rowIndex][source][field]
const headObj = this.tmplFieldsList.find(i => i.fieldCode == field)
// const headObj = this.tmplFieldsList.find(i => i.fieldCode == field)
var key = `${rowIndex}_${source}_${field}`
// console.log(rowIndex, source, field, '0000000')
// console.log(rowIndex, source, field, fieldConfig, '0000000')
if (this.judgeDisable(rowIndex, source, fieldConfig)) {
return true
}
if (headObj?.editType === 'selectInput') {
if (fieldConfig?.editType === 'selectInput') {
const obj = this.tableList[rowIndex][source]
const selectVal = obj[headObj.editObj.selectField]
const inputVal = obj[headObj.editObj.inputField]
const selectVal = obj[fieldConfig.editObj.selectField]
const inputVal = obj[fieldConfig.editObj.inputField]
if (selectVal === undefined || selectVal === null || selectVal === '') {
this.$set(this.validationErrors, `${rowIndex}_${source}_${headObj.editObj.selectField}`, '此项为必填项')
this.$set(this.validationErrors, `${rowIndex}_${source}_${fieldConfig.editObj.selectField}`, '此项为必填项')
return false
}
if (inputVal === undefined || inputVal === null || inputVal === '') {
this.$set(this.validationErrors, `${rowIndex}_${source}_${headObj.editObj.inputField}`, '此项为必填项')
this.$set(this.validationErrors, `${rowIndex}_${source}_${fieldConfig.editObj.inputField}`, '此项为必填项')
return false
}
} else if (value === undefined || value === null || value === '') {
......@@ -736,11 +736,11 @@ export default {
return false
}
if (headObj?.editObj?.rule) {
let errorTxt = headObj.editObj.rule(value, rowIndex, source, headObj.editType == 'selectInput' ? headObj : field)
if (fieldConfig?.editObj?.rule) {
let errorTxt = fieldConfig.editObj.rule(value, rowIndex, source, fieldConfig.editType == 'selectInput' ? fieldConfig : field)
if (errorTxt) {
if (headObj.editType === 'selectInput') {
this.$set(this.validationErrors, `${rowIndex}_${source}_${headObj.editObj.inputField}`, errorTxt)
if (fieldConfig.editType === 'selectInput') {
this.$set(this.validationErrors, `${rowIndex}_${source}_${fieldConfig.editObj.inputField}`, errorTxt)
} else {
this.$set(this.validationErrors, key, errorTxt)
}
......@@ -989,7 +989,7 @@ export default {
/**editable为false,平台方和备注不能编辑
*/
if (value.ORDER.editable == false) {
if (['ORDERplatformMerchantId', 'SUB_ORDERpartnerFeeCalculateCoefficient'].includes(source + fieldConfig.fieldCode)) {
if (['ORDERplatformMerchantId', 'ORDERcoverReceiverType'].includes(source + fieldConfig.fieldCode)) {
isDisable = true
}
}
......
......@@ -14,6 +14,7 @@
<script>
import AccountTmpl from "../accountTmplManage/components/AccountTmpl"
import { deepClone } from '@/common/util'
import { tmplCheckField } from '@api/accountManage'
export default {
name: 'TmplDrawer',
components: {
......@@ -43,8 +44,14 @@ export default {
this.$emit('handleClose')
},
handleConfirm() {
this.$emit('handleConfirm', {
const params = {
type: this.type,
fieldIds: deepClone(this.$refs.accountTmpl.getSelected())
}
tmplCheckField(params).then(res => {
this.$emit('handleConfirm', {
fieldIds: deepClone(this.$refs.accountTmpl.getSelected())
})
})
},
},
......
......@@ -33,7 +33,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="对账商户:" prop="merchant">
<el-select v-model="infoForm.merchant" multiple :multiple-limit="1" filterable style="width:400px" @change="handleChangeMerchant">
<el-select v-model="infoForm.merchant" multiple :multiple-limit="multipleLimit" filterable style="width:400px" @change="handleChangeMerchant">
<el-option v-for="item in baseData.merchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
......@@ -103,6 +103,7 @@ export default {
}
return {
loading: false,
multipleLimit: 10,
// 判断是否是模版模式
isTmpl: false,
localTmplList: deepClone(localTmplList),
......@@ -314,6 +315,8 @@ export default {
judgeTmpl() {
this.isTmpl = this.infoForm.merchantType == '2' || (this.infoForm.merchantType == '7' && this.infoForm.reportType == '4');
this.merchantTypeStr = this.typeObj[this.infoForm.merchantType]
this.multipleLimit = (this.infoForm.merchantType == '7' && this.infoForm.reportType == '4') ? 1 : 10
this.infoForm.merchant = []
this.resetTmplData()
},
......@@ -489,18 +492,22 @@ export default {
return params
},
// 系统对账
// 系统对账 - 单个商户
handleSystemBill() {
this.$refs.accountForm.validate(valid => {
if (valid) {
var params = this.getParams()
params.orderCurrentPage = 1
params.orderPageSize = 10
console.log('params', params)
getBillTmplAdapter(params).then(res => {
console.log(res, 'res')
this.$emit('handleBill', { billTmplInfo: res })
})
if (this.infoForm.merchant.length == 1) {
var params = this.getParams()
params.orderCurrentPage = 1
params.orderPageSize = 10
console.log('params', params)
getBillTmplAdapter(params).then(res => {
console.log(res, 'res')
this.$emit('handleBill', { billTmplInfo: res })
})
} else {
this.$message.warning("仅支持单商户进行系统对账")
}
}
})
},
......@@ -508,26 +515,38 @@ export default {
handleAddConfirm() {
this.$refs.accountForm.validate(valid => {
if (valid) {
var params = this.getParams()
params.method = 'dj.api.smartcarlife.goodsOrderProfitAllocation.exportAccountStatementForAudit.async'
console.log('params', params)
const list = [
...this.dowloadList,
{
name: '对账单',
// uuid: JSON.parse(res).data,
// ifSuccess: false
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
if (this.infoForm.merchantType == '7' && this.infoForm.reportType == '4') {
if (this.infoForm.merchant.length == 1) {
this.dowloadApi()
} else {
this.$message.warning("仅支持单商户进行系统对账")
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
this.handleClose()
} else {
this.dowloadApi()
}
}
})
},
dowloadApi() {
var params = this.getParams()
params.method = 'dj.api.smartcarlife.goodsOrderProfitAllocation.exportAccountStatementForAudit.async'
console.log('params', params)
const list = [
...this.dowloadList,
{
name: '对账单',
// uuid: JSON.parse(res).data,
// ifSuccess: false
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
this.handleClose()
},
handleClose() {
this.$emit('accountClose', true)
}
......
<template>
<el-dialog title="请选择退款明细" :visible.sync="refundVisible" :before-close="handleClose"
:close-on-click-modal="false" width="70%" class="relateStore">
<el-dialog
title="请选择退款明细"
:visible.sync="refundVisible"
:before-close="handleClose"
:close-on-click-modal="false"
width="70%"
class="relateStore"
>
<div>
<el-table ref="seletingTable" :data="tableData" class="table" border @select="handleChange"
@select-all="handleAll">
<el-table-column :selectable="selectableFn" type="selection" width="55" align="center" />
<el-table
ref="seletingTable"
:data="tableData"
class="table"
border
@select="handleChange"
@select-all="handleAll"
>
<el-table-column
:selectable="selectableFn"
type="selection"
width="55"
align="center"
/>
<template v-for="item in tableColumn">
<el-table-column :prop="item.prop" :label="item.label" align="center">
<span slot-scope="scope">
{{ scope.row[item.prop] ? item.unit ? item.unit + scope.row[item.prop] : scope.row[item.prop] : "-" }}
{{
scope.row[item.prop]
? item.unit
? item.unit + scope.row[item.prop]
: scope.row[item.prop]
: "-"
}}
</span>
</el-table-column>
</template>
</el-table>
<div class="total">可选可退总价:<div class="price">¥{{ total }}</div></div>
<div class="total">
可选可退总价:
<div class="price">¥{{ total }}</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="handleConfirm" :disabled="!refundSubOrderCode">下一步</el-button>
<el-button
type="primary"
@click="handleConfirm"
:disabled="!refundSubOrderCode"
>下一步</el-button
>
</span>
</el-dialog>
</template>
......@@ -25,48 +56,48 @@
<script>
import { goodsSubOrder } from "@api/order"
export default {
name: 'refundDetail',
name: "refundDetail",
data() {
return {
tableData: [],
tableColumn: [
{
label: '子订单编码',
prop: 'subOrderCode'
label: "子订单编码",
prop: "subOrderCode"
},
{
label: '商品名称',
prop: 'goodsName'
label: "商品名称",
prop: "goodsName"
},
{
label: '商品别名',
prop: 'goodsAlias'
label: "商品别名",
prop: "goodsAlias"
},
{
label: '商品ID',
prop: 'goodsCommodityCode'
label: "商品ID",
prop: "goodsCommodityCode"
},
{
label: '分类',
prop: 'upgradeGoodsTypeName'
label: "分类",
prop: "upgradeGoodsTypeName"
},
{
label: '售价',
prop: 'upgradePrice',
unit: '¥'
label: "售价",
prop: "upgradePrice",
unit: "¥"
},
{
label: '数量/件',
prop: 'number'
label: "数量/件",
prop: "number"
},
{
label: '支付金额',
prop: 'totalPrice',
unit: '¥'
label: "支付金额",
prop: "totalPrice",
unit: "¥"
}
],
total: 0,
refundSubOrderCode: '',
refundSubOrderCode: "",
isAll: false
}
},
......@@ -100,27 +131,27 @@ export default {
},
handleChange(selection) {
console.log(selection)
this.isAll = selection.length ==this.tableData.length
this.isAll = selection.length == this.tableData.length
this.getParams(selection)
},
handleAll(selection) {
console.log(selection)
this.isAll = selection.length ==this.tableData.length
this.isAll = selection.length == this.tableData.length
this.getParams(selection)
},
getParams(selection) {
let _total = 0
let _refundSubOrderCode = []
selection.forEach(item => {
selection.forEach((item) => {
_total += item.totalPrice
_refundSubOrderCode.push(item.subOrderCode)
})
this.total = _total
this.refundSubOrderCode = _refundSubOrderCode.join('/')
this.refundSubOrderCode = _refundSubOrderCode.join("/")
console.log(this.refundSubOrderCode)
},
handleConfirm() {
const {refundSubOrderCode, total, isAll} = this
const { refundSubOrderCode, total, isAll } = this
this.$emit("handleConfirm", {
total,
refundSubOrderCode,
......@@ -141,8 +172,8 @@ export default {
color: #666666;
font-size: 14px;
.price {
color: #2A58AD;
color: #2a58ad;
margin-left: 10px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -2,8 +2,8 @@
* @Description:
* @Author: huyue
* @Date: 2024-04-17 17:50:41
* @LastEditors: huyue
* @LastEditTime: 2024-05-07 10:57:45
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-07-02 10:43:18
-->
<template>
<div>
......
<template>
<div class="layout">
<div
class="tab"
ref="tabbox"
>
<div class="tab" ref="tabbox">
<div
:class="['tab-item', { 'item-active': windowId == -1 }]"
@click="windowId = -1"
......@@ -19,10 +16,7 @@
:ref="`tab-${index}`"
>
{{ i.text }}
<div
class="close"
@click.stop="close(index)"
>
<div class="close" @click.stop="close(index)">
<i class="el-icon-close"></i>
</div>
</div>
......@@ -30,10 +24,7 @@
</template>
<template v-if="dropdownList.length">
<div class="arrow-box">
<el-dropdown
trigger="click"
@command="windowId = $event"
>
<el-dropdown trigger="click" @command="windowId = $event">
<div class="dropdown-link">
<i class="el-icon-arrow-down"></i>
</div>
......@@ -46,10 +37,7 @@
>
<div class="dropdown-item">
{{ i.text }}
<div
class="close"
@click.stop="closeDrop(index)"
>
<div class="close" @click.stop="closeDrop(index)">
<i class="el-icon-close"></i>
</div>
</div>
......@@ -81,7 +69,7 @@
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import clockSalaryIndex from './components/clockSalaryIndex/index'
import InStoreManageIndex from "./index"
import staffInfo from "./staffInfo"
......@@ -180,7 +168,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.layout {
height: 100%;
.tab {
......
<!-- 录音标签管理 -->
<template>
<d2-container class="customer-tags">
<div class="header" slot="header">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData"
>
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header title="标签录音管理列表">
<el-button size="small" type="primary" @click="exportTable">
导出
</el-button>
</d2-table-header>
<d2-table
ref="table"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<template slot="fileUrl" slot-scope="scope">
<div
class="audio"
@click="play(scope.scope.fileUrl)"
v-if="scope.scope.fileUrl"
>
{{ scope.scope.fileUrl }}
</div>
</template>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9121801']" />
</span>
</div>
</d2-table>
</div>
</d2-container>
</template>
<script>
import {
getBrandList,
findAllLevelList,
getSceneData,
sceneExport
} from "@/api/scene.js"
import { outputValue_businessOpt } from "@/common/constants.js"
import { Util, deepClone } from "@/common/util"
export default {
data() {
return {
getListApi: getSceneData,
tableParams: {
listName: "list",
tableOption: {
width: "100"
},
tableColumns: [
{
label: "驻店名称",
prop: "yqMerchantName"
},
{
label: "门店名称",
prop: "storeBrand"
},
{
label: "品牌",
prop: "storeBrand"
},
{
label: "录音链接",
// prop: "fileUrl"
addHtml: "fileUrl",
width: "150px"
},
{
label: "质检日期",
formatter: (cellValue) => {
return cellValue.createdDate
? Util.dateFormate(cellValue.createdDate, "YYYY-MM-DD")
: "-"
}
},
{
label: "客户车型",
prop: "carModel"
},
{
label: "业务场景",
prop: "bussinessType",
formatter(row) {
let result = { 1: "会员权益/升级", 2: "轻改" }[row.bussinessType]
return result || "-"
}
},
{
label: "APP接待结果",
formatter(row) {
let result = {
1: "成交",
0: "战败"
}[row.receptionStatus]
return result || "-"
}
},
{
label: "身份介绍",
prop: "startTime"
},
{
label: "服务意识",
prop: "startTime"
},
{
label: "话题介入",
prop: "startTime"
},
{
label: "需求分析",
prop: "startTime"
},
{
label: "专业知识",
prop: "startTime"
},
{
label: "场景塑造",
prop: "startTime"
},
{
label: "案例展示",
prop: "startTime"
},
{
label: "攻防能力",
prop: "startTime"
},
{
label: "攻防能力",
prop: "startTime"
}
]
},
props: {
value: "code",
label: "directoryName",
children: "sceneMarketLevelTwoList"
},
searchFormSearch: {},
searchForm: {
businessCodeArr: [],
storeName: "",
reportDate: [],
storeBrandId: "",
createdBy: ""
},
showFormData: [
{
label: "驻店名称",
name: "storeName",
type: "input",
isClear: true
},
// {
// label: "主营品牌",
// name: "storeBrandId",
// type: "select",
// // multiple: true,
// isClear: true,
// optionList: [],
// optionId: "id",
// optionLabel: "label",
// optionsName: "brandList"
// },
{
label: "业务场景",
name: "businessType",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "businessTypeOpt"
},
{
label: "门店",
name: "storeName",
type: "input",
isClear: true
},
{
label: "品牌",
name: "storeBrandId",
type: "select",
// multiple: true,
isClear: true,
collapseTags: true,
optionList: [],
optionId: "id",
optionLabel: "label",
optionsName: "brandList"
},
{
label: "质检时间",
name: "reportDate",
type: "datePicker",
isClear: false,
pickerOptions: "rangePickerOptions_30day2"
},
{
label: "app接待结果",
name: "receptionStatus",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "receptionStatusOpt"
}
],
baseData: {
businessTypeOpt: deepClone(outputValue_businessOpt),
receptionStatusOpt: [
{
confId: 0,
confValue: "成交"
},
{
confId: 1,
confValue: "未成交"
}
],
brandList: []
}
}
},
mounted() {
this.initSelect()
},
methods: {
handleDetail(data) {
console.log("row", data)
this.$router.push({
path: "/inSceneConfigView",
query: {
id: data.id
}
})
},
beforeSearchFn(type = 1) {
console.log(this.searchForm)
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.businessCode =
this.searchFormSearch.businessCodeArr.length > 1
? this.searchFormSearch.businessCodeArr[1]
: ""
if (this.searchForm?.reportDate?.length) {
let [startDate, endDate] = this.searchForm.reportDate
this.searchFormSearch.startDate = Util.dateFormate(
startDate,
"YYYY-MM-DD"
)
this.searchFormSearch.endDate = Util.dateFormate(
endDate,
"YYYY-MM-DD"
)
}
delete this.searchFormSearch.reportDate
delete this.searchFormSearch.businessCodeArr
resolve()
})
},
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
async exportTable() {
try {
await this.beforeSearchFn()
const res = await sceneExport({
...this.searchFormSearch
})
if (res) window.open(res)
} catch (error) {
if (error) this.$message.error(error)
}
},
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getBrandList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
if (result.status === "rejected") {
console.error(`Task ${index} failed:`, result.reason)
}
})
// 统一调用 getOptionsList
this.getOptionsList()
})
.catch((err) => {
console.error("Unexpected error in initSelect:", err)
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getBusinessTypeList() {
return new Promise((resolve, reject) => {
findAllLevelList({})
.then((res) => {
this.baseData.businessTypeList = res
resolve(res) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getBusinessTypeList:", err)
reject(err) // 捕获并传递错误
})
})
},
getBrandList() {
const brandList = []
return new Promise((resolve, reject) => {
getBrandList({ containsChildren: true })
.then((res) => {
res.map((e) => {
if (e && e.children && e.children.length) {
e.children.map((i) => {
i.brandId = e.id
brandList.push(i)
})
}
})
this.baseData.brandList = brandList
resolve(brandList) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getBrandList:", err)
reject(err) // 捕获并传递错误
})
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
// if (item.optionsName != "brandList") {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
// }
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
}
}
}
</script>
<style></style>
<template>
<div>
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
class="detail-content-warn">
<div v-loading="loading">
<div class="form_div">
<el-form label-width="450px"
:inline="true">
<el-form-item label="销售方名称:">
{{ detailInfo.enterpriseName ? detailInfo.enterpriseName : "-" }}
</el-form-item>
<!-- <el-form-item label="企业联系电话:">
{{ "-" }}
</el-form-item> -->
<el-form-item label="开票金额:">
{{ detailInfo.invoiceAmount ? detailInfo.invoiceAmount : "-" }}
</el-form-item>
<el-form-item label="票通订单号:">
{{ detailInfo.tradeNo ? detailInfo.tradeNo : "-" }}
</el-form-item>
<el-form-item label="生成时间:">
{{ detailInfo.createdDate ? detailInfo.createdDate : "-" }}
</el-form-item>
<el-form-item label="二维码有效期:">
{{ detailInfo.expireDay ? detailInfo.expireDay + '天' : "-" }}
</el-form-item>
</el-form>
<div class="imgCon">
<el-image id="printImage"
:src="detailInfo.invoiceQrCode"
class="imgSize"></el-image>
</div>
<div class="tips">
您可以使用微信或支付宝,扫码开票
</div>
</div>
<div class="footer">
<el-button @click="dialogInnerShow = true"
type="primary">发送邮箱</el-button>
<el-button @click="handlePrint">打印</el-button>
</div>
</div>
<baseDialog :is-show.sync="dialogInnerShow"
:config="dialogInnerConfig.setting"
:dialog-config="dialogInnerConfig.config"
@handleClick="handleSendEmail">
<el-form ref="sendFormRef"
:model="sendForm"
label-width="100px">
<el-form-item prop="email"
label="邮箱"
:rules="[
{ required: true, message: '请输入邮箱地址', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
]">
<el-input v-model="sendForm.email"
style="width: 300px;"></el-input>
</el-form-item>
</el-form>
</baseDialog>
</basedialog>
</div>
</template>
<script>
import { getByQrcodeNo, sendEmail } from '@api/invoiceManage'
import { Util, deepClone } from "@/common/util"
export default {
name: "InvoiceCodeDetailDialog",
components: {
},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('dialogClose')
}
}
},
mounted() {
this.getDetail()
},
data() {
return {
dialogConfig: {
setting: {
showClose: true,
appendToBody: true,
btnList: []
},
config: {
title: "查看二维码",
width: "1080px"
}
},
detailInfo: {},
loading: true,
dialogInnerShow: false,
dialogInnerConfig: {
setting: {
showClose: true,
appendToBody: true,
isShowFooter: true,
confirm_name: '发送',
cancel_name: '取消'
},
config: {
title: "发送邮箱",
width: "500px"
}
},
sendForm: {
email: ''
}
}
},
methods: {
getDetail() {
var params = { qrcodeNo: this.paramsObj.qrcodeNo }
getByQrcodeNo(params).then(res => {
this.detailInfo = res
this.loading = false
})
},
handlePrint() {
if (this.detailInfo.invoiceQrCode) {
window.open(this.detailInfo.invoiceQrCode)
}
},
handleSendEmail() {
this.$refs.sendFormRef.validate(valid => {
if (valid) {
var params = deepClone(this.sendForm)
params.qrcodeNo = this.detailInfo.qrcodeNo
sendEmail(params).then(res => {
this.notice.okTips('发送成功')
this.dialogInnerShow = false
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.detail-content-warn {
.form_div {
color: #333333;
.el-form-item__content {
display: inline-block;
width: calc(100% - 150px);
line-height: 24px;
}
.el-form-item__label {
padding: 0;
line-height: 24px;
}
.el-form-item {
width: 100%;
margin-bottom: 20px;
}
.edit-sub-block {
// padding: 0 10px;
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.onLineItem {
::v-deep .el-form-item__content {
max-width: 80%;
}
}
}
.imgCon {
text-align: center;
.imgSize {
width: 120px;
height: 120px;
}
}
.tips {
text-align: center;
margin-top: 10px;
}
}
.footer {
text-align: center;
margin-top: 50px;
}
}
</style>
<template>
<div class="range">
<div :class="[
' el-date-editor',
'el-range-editor',
'el-input__inner',
'el-date-editor--daterange',
'el-range-editor--small',
pickerVisible ? 'is-active' : ''
]"
@click="handleRangeClick"
@mouseleave="showClose = false"
@mousemove="handleMove"
ref="reference">
<template v-if="infinity">
<el-input-number class="el-range-input hide-btn"
:placeholder="startPlaceholder"
v-model="userInput[0]"
@blur="handleBlur(0)"></el-input-number>
<span class="el-range-separator">至</span>
<el-input-number class="el-range-input hide-btn"
:placeholder="endPlaceholder"
v-model="userInput[1]"
@blur="handleBlur(1)"></el-input-number>
</template>
<template v-else>
<el-input v-model="userInput[0]"
:placeholder="startPlaceholder"
@blur="handleBlur(0)"
@input="handleStartInput"
class="el-range-input"></el-input>
<span class="el-range-separator">至</span>
<el-input v-model="userInput[1]"
:placeholder="endPlaceholder"
@input="handleEndInput"
@focus="handleFocus"
@blur="handleBlur(1)"
class="el-range-input"></el-input>
</template>
<i v-show="showClose"
@click="handleClickIcon"
class="el-icon-circle-close"></i>
</div>
<div class="errorTips"
v-if="tipsShow">最大金额需大于最小金额</div>
</div>
</template>
<script>
import { limitPrice } from '@/common/format'
export default {
data() {
return {
pickerVisible: false,
showClose: false,
userInput: this.displayValue,
oldVal: {
startInput: '',
endInput: ''
},
tipsShow: false
}
},
props: {
displayValue: Array,
placeholder: String,
startPlaceholder: String,
endPlaceholder: String,
infinity: Boolean
},
watch: {
displayValue(val) {
if (val) {
this.userInput = val
if (val.length == 0) {
this.tipsShow = false
}
}
}
},
methods: {
handleStartInput(event) {
this.userInput[0] = limitPrice(event, this.oldVal.startInput, 20, 2)
this.oldVal.startInput = this.userInput[0]
},
handleEndInput(event) {
this.userInput[1] = limitPrice(event, this.oldVal.endInput, 20, 2)
this.oldVal.endInput = this.userInput[1]
},
handleClickIcon(event) {
this.userInput[0] = null
this.userInput[1] = null
this.tipsShow = false
},
valueIsEmpty() {
const val = this.userInput
if (Array.isArray(val)) {
for (let i = 0, len = val.length; i < len; i++) {
if (val[i]) {
return false
}
}
}
return true
},
handleRangeClick() {
this.pickerVisible = true
},
handleMove() {
if (this.valueIsEmpty()) {
this.showClose = false
} else {
this.showClose = true
}
},
handleFocus() {
if (!this.pickerVisible) {
this.pickerVisible = true
this.$emit("focus", this)
}
},
handleBlur(index) {
this.pickerVisible = false
this.contrastValue()
},
contrastValue() {
const val = this.userInput
if (Array.isArray(val)) {
if (+val[0] > +val[1]) {
val[1] = null
this.tipsShow = true
} else {
this.tipsShow = false
}
}
}
}
}
</script>
<style scoped lang="scss">
.range {
.el-range-input {
::v-deep {
input {
border: 0;
margin-top: -2px;
height: 28px;
}
}
}
.el-icon-circle-close {
color: #dcdfe6;
margin-left: 10px;
}
.hide-btn {
::v-deep {
span {
display: none;
}
input {
padding: 0;
}
}
}
.errorTips {
color: red;
// text-align: center;
font-size: 12px;
}
}
</style>
<template>
<div>
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
class="detail-content-warn">
<div v-loading="loading">
<div class="form_div">
<el-form class="edit-sub-block"
label-width="150px"
:inline="true">
<div>
<el-form-item label="可选开票种类:"
class="onLineItem">
{{
detailInfo.invoiceTypeShow ? detailInfo.invoiceTypeShow : "-"
}}
</el-form-item>
</div>
<div>
<el-form-item label="主订单号:"
class="onLineItem">
{{
detailInfo.bizOrderCode ? detailInfo.bizOrderCode : "-"
}}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="开票项目:"
class="halfItem">
{{ detailInfo.itemNames ? detailInfo.itemNames : "-" }}
</el-form-item>
<el-form-item label="待开票金额:"
class="halfItem">
{{ detailInfo.invoiceAmount
? detailInfo.invoiceAmount
: "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="收款人:"
class="halfItem">
{{ detailInfo.casherName ? detailInfo.casherName : "-" }}
</el-form-item>
<el-form-item label="复核人:"
class="halfItem">
{{
detailInfo.reviewerName ? detailInfo.reviewerName : "-"
}}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="可开票张数:"
class="halfItem">
{{ detailInfo.allowInvoiceCount ? detailInfo.allowInvoiceCount : "-" }}
</el-form-item>
<el-form-item label="发票备注:"
class="halfItem">
{{
detailInfo.invoiceRemark ? detailInfo.invoiceRemark : "-"
}}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="发送短信:"
class="halfItem">
{{ "-" }}
</el-form-item>
<el-form-item label="二维码有效期:"
class="halfItem">
{{
detailInfo.expireDay ? detailInfo.expireDay + '天' : "-"
}}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="发送邮件:"
class="halfItem">
{{ detailInfo.email ? detailInfo.email : "-" }}
</el-form-item>
</div>
</el-form>
</div>
</div>
</basedialog>
</div>
</template>
<script>
import { getByQrcodeNo } from '@api/invoiceManage'
import { Util, deepClone } from "@/common/util"
import { invoiceTypeOpt } from '@/common/constants.js'
export default {
name: "InvoiceCodeDetailDialog",
components: {
},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('dialogClose')
}
}
},
mounted() {
this.getDetail()
},
data() {
return {
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
btnList: []
},
config: {
title: "开票二维码详情",
width: "1080px"
}
},
detailInfo: {},
loading: true,
invoiceTypeOpt: deepClone(invoiceTypeOpt)
}
},
methods: {
getDetail() {
var params = { qrcodeNo: this.paramsObj.qrcodeNo }
getByQrcodeNo(params).then(res => {
this.detailInfo = res
this.dataProcess(this.detailInfo)
this.loading = false
})
},
dataProcess(info) {
if (info) {
if (info.invoiceType) {
let arr = info.invoiceType.split(",")
console.log('arr', arr)
console.log('this.invoiceTypeOpt', this.invoiceTypeOpt)
arr = arr.map((o) => {
return this.invoiceTypeOpt.find(item => item.confId === o)?.confValue
})
info.invoiceTypeShow = arr.join("/")
}
}
}
}
}
</script>
<style lang="scss" scoped>
.detail-content-warn {
.form_div {
color: #333333;
.el-form-item__content {
display: inline-block;
width: calc(100% - 150px);
line-height: 24px;
}
.el-form-item__label {
padding: 0;
line-height: 24px;
}
.el-form-item {
width: 100%;
margin-bottom: 20px;
}
.edit-sub-block {
// padding: 0 10px;
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.onLineItem {
::v-deep .el-form-item__content {
max-width: 80%;
}
}
}
}
}
</style>
<template>
<div>
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
class="detail-content-warn">
<div v-loading="loading">
<div class="form_div">
<el-form class="edit-sub-block"
label-width="150px"
:inline="true">
<div class="itemDiv">
<el-form-item label="发票种类:"
class="halfItem">
{{ detailInfo.invoiceTypeShow ? detailInfo.invoiceTypeShow : "-" }}
</el-form-item>
<el-form-item label="作废状态:"
class="halfItem">
{{ detailInfo.invalidFlagShow ? detailInfo.invalidFlagShow : "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="购买方名称:"
class="halfItem">
{{ detailInfo.buyerName ? detailInfo.buyerName : "-" }}
</el-form-item>
<el-form-item label="开票人:"
class="halfItem">
{{ detailInfo.drawerName ? detailInfo.drawerName : "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="购买方税号:"
class="halfItem">
{{ detailInfo.buyerTaxpayerNum ? detailInfo.buyerTaxpayerNum : "-" }}
</el-form-item>
<el-form-item label="开票类型:"
class="halfItem">
{{ detailInfo.InvoicingShow ? detailInfo.InvoicingShow : "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="数电票号码:"
class="halfItem">
{{ detailInfo.electronicInvoiceNo ? detailInfo.electronicInvoiceNo : "-" }}
</el-form-item>
<el-form-item label="开票来源:"
class="halfItem">
{{ detailInfo.createdSourceShow ? detailInfo.createdSourceShow : "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="开票日期:"
class="halfItem">
{{ detailInfo.invoiceDate ? detailInfo.invoiceDate : "-" }}
</el-form-item>
<el-form-item label="票通订单号:"
class="halfItem">
{{ detailInfo.tradeNo ? detailInfo.tradeNo : "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="不含税金额:"
class="halfItem">
{{ detailInfo.noTaxAmount ? detailInfo.noTaxAmount : "-" }}
</el-form-item>
<el-form-item label="主订单号:"
class="halfItem">
{{ detailInfo.bizOrderCode ? detailInfo.bizOrderCode : "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="税额:"
class="halfItem">
{{ detailInfo.taxAmount ? detailInfo.taxAmount : "-" }}
</el-form-item>
<el-form-item label="交易参考号:"
class="halfItem">
{{ detailInfo.bizTradeNo ? detailInfo.bizTradeNo : "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="价税合计金额:"
class="halfItem">
{{ detailInfo.amountWithTax ? detailInfo.amountWithTax : "-" }}
</el-form-item>
<el-form-item label="主要项目名称:"
class="halfItem">
{{ detailInfo.itemNames ? detailInfo.itemNames : "-" }}
</el-form-item>
</div>
<div class="itemDiv">
<el-form-item label="冲红状态:"
class="halfItem">
{{ detailInfo.redFlagShow ? detailInfo.redFlagShow : "-" }}
</el-form-item>
</div>
</el-form>
</div>
</div>
</basedialog>
</div>
</template>
<script>
import { getByInvoiceReqSerialNo } from '@api/invoiceManage'
import { Util, deepClone } from "@/common/util"
import { createdSourceOpt, invoiceTypeOpt, redFlagOpt, invalidFlagOpt, InvoicingOpt } from "@/common/constants.js"
export default {
name: "InvoiceQueryDetailDialog",
components: {
},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('dialogClose')
}
}
},
mounted() {
this.getDetail()
},
data() {
return {
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
btnList: []
},
config: {
title: "发票详情",
width: "1080px"
}
},
detailInfo: {},
loading: true,
invoiceTypeOpt: deepClone(invoiceTypeOpt),
createdSourceOpt: deepClone(createdSourceOpt),
redFlagOpt: deepClone(redFlagOpt),
invalidFlagOpt: deepClone(invalidFlagOpt),
InvoicingOpt: deepClone(InvoicingOpt)
}
},
methods: {
getDetail() {
var params = { invoiceReqSerialNo: this.paramsObj.invoiceReqSerialNo }
getByInvoiceReqSerialNo(params).then(res => {
this.detailInfo = res
this.dataProcess(this.detailInfo)
this.loading = false
})
},
dataProcess(info) {
if (info) {
if (info.invoiceKind) {
let arr = info.invoiceKind.split(",")
console.log('arr', arr)
console.log('this.invoiceTypeOpt', this.invoiceTypeOpt)
arr = arr.map((o) => {
return this.invoiceTypeOpt.find(item => item.confId === o)?.confValue
})
info.invoiceTypeShow = arr.join("/")
}
if (info.invalidFlag) {
info.invalidFlagShow = this.invalidFlagOpt.find(item => item.confId === info.invalidFlag)?.confValue
}
if (info.invoiceType) {
info.InvoicingShow = this.InvoicingOpt.find(item => item.confId === info.invoiceType)?.confValue
}
if (info.createdSource) {
info.createdSourceShow = this.createdSourceOpt.find(item => item.confId === info.createdSource)?.confValue
}
if (info.redFlag) {
info.redFlagShow = this.redFlagOpt.find(item => item.confId === info.redFlag)?.confValue
}
}
}
}
}
</script>
<style lang="scss" scoped>
.detail-content-warn {
.form_div {
color: #333333;
.el-form-item__content {
display: inline-block;
width: calc(100% - 150px);
line-height: 24px;
}
.el-form-item__label {
padding: 0;
line-height: 24px;
}
.el-form-item {
width: 100%;
margin-bottom: 20px;
}
.edit-sub-block {
// padding: 0 10px;
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.onLineItem {
::v-deep .el-form-item__content {
max-width: 80%;
}
}
}
}
}
</style>
<!-- 配置课程 -->
<template>
<div class="configureCourse">
<div class="left-wrap">
<div class="header">
<img class="staff-icon" src="../../images/staff-icon.png" alt="" />
<div class="title">
员工列表
<div class="num">共7人,已配置1人</div>
</div>
</div>
<div class="staff-list">
<div
v-for="(item, index) in staffList"
:key="item.id"
:class="['staff-item', staffIndex == index ? 'active' : '']"
@click="handleClick(index)"
>
{{ item.name }}
<div class="config" v-if="item.isConfig">已配置</div>
</div>
</div>
</div>
<div class="right-wrap">
<div class="nav-tabs">
<div
:class="['nav-item', activeName == index ? 'active' : '']"
v-for="(item, index) in tabPaneList"
:key="index"
@click="handleTabClick(index)"
>
{{ item.label }}
</div>
</div>
<components :is="tabName"></components>
</div>
</div>
</template>
<script>
import staffDetail from "./staffDetail"
import couseAllocation from "./couseAllocation"
export default {
name: "configureCourse",
components: { staffDetail, couseAllocation },
data() {
return {
staffIndex: 0,
activeName: "0",
tabPaneList: [
{
label: "员工详情"
},
{
label: "课程配置"
}
],
tabName: "staffDetail",
staffList: [
{
name: "王小虎",
isConfig: true,
id: 1
},
{
name: "李小宣",
isConfig: true,
id: 1
},
{
name: "胡明星",
isConfig: true,
id: 1
},
{
name: "郝怡逸",
isConfig: true,
id: 1
}
]
}
},
methods: {
handleClick(index) {
this.staffIndex = index
},
handleTabClick(index) {
this.activeName = index
const arr = {
0: "staffDetail",
1: "couseAllocation"
}
this.tabName = arr[+this.activeName]
}
}
}
</script>
<style lang="scss" scoped>
.configureCourse {
display: flex;
margin: 0 20px;
.left-wrap {
min-width: 200px;
width: 200px;
height: 988px;
background: #ffffff;
margin-right: 16px;
.header {
display: flex;
align-items: flex-start;
margin: 12px 0 8px 13px;
.staff-icon {
width: 16px;
height: 16px;
margin-right: 8px;
margin-top: 3px;
}
.title {
color: #333333;
font-size: 16px;
font-weight: 400;
.num {
color: #999999;
font-size: 12px;
font-weight: 400;
margin-top: 2px;
}
}
}
.staff-list {
height: calc(100% - 62px);
overflow-y: auto;
.staff-item {
color: #666666;
font-size: 16px;
font-weight: 400;
padding: 10px 12px 10px 36px;
position: relative;
.config {
position: absolute;
border-radius: 2px;
border: 1px solid #2cca74;
background: #e9eef7;
padding: 4px 8px;
color: #2cca74;
font-size: 12px;
font-weight: 500;
top: 10px;
right: 12px;
}
}
.active {
color: #2a58ad;
background: #e9eef7;
border-right: 3px solid #2a58ad;
}
}
}
.right-wrap {
width: calc(100% - 216px);
.nav-tabs {
display: flex;
align-items: center;
.nav-item {
width: 112px;
height: 44px;
border-radius: 4px 4px 0 0;
color: #666666;
font-size: 16px;
font-weight: 400;
line-height: 44px;
box-sizing: border-box;
text-align: center;
margin-right: 2px;
border: 1px solid #e5e5e5;
background: #f8f8f8;
}
.active {
color: #2a58ad;
font-size: 16px;
font-weight: 500;
border: 1px solid #e5e5e5;
background: #ffffff;
}
}
// background: #ffffff;
}
}
</style>
<!-- 课程任务配置 -->
<template>
<div class="couse-wrap">
<div class="header">
课程任务配置
<div class="count-down">
<img class="error-circle" src="../../images/error-circle.png" />
倒计时:还剩 2天11时23分57秒 完成本周课程配置
</div>
</div>
<div class="condition">
<div class="couse-tabs">
<div
:class="['couse-tabs-item', activeIndex == index ? 'active' : '']"
v-for="(item, index) in 10"
:key="index"
@click="handleClick(index)"
>
问界
</div>
</div>
<el-button size="small" type="primary" @click="handleCustom"
>自定义配课</el-button
>
</div>
<div class="couse-content">
<div class="content-item" v-for="item in 10" :key="item">
<div class="name">月产值</div>
<div class="value"><30万</div>
<div class="configuration">
<div class="item">
<div>可配置</div>
<div class="number">4家</div>
</div>
<div class="item">
<div>可配置</div>
<div class="number">4家</div>
</div>
</div>
<div class="btns">
<div class="details" @click="handleDetail(item)">详情</div>
<div class="configure-course" @click="handleConfigureCourse(item)">
配置课程
</div>
</div>
</div>
</div>
<custom-couse
:customVisible="customVisible"
v-if="customVisible"
@dialogClose="handleCloseDialog"
></custom-couse>
</div>
</template>
<script>
import customCouse from "./customCouse.vue"
export default {
components: { customCouse },
data() {
return {
activeIndex: 0,
customVisible: false
}
},
methods: {
handleConfigureCourse(item) {
this.$router.push({
name: "configureCourse"
// params: { id: item.id }
})
},
handleDetail(row) {
console.log(1111)
row.activeName = "indicatorInfo"
this.$emit("openWindow", row)
},
handleClick(index) {
console.log(index)
this.activeIndex = index
},
handleCustom() {
this.customVisible = true
},
handleCloseDialog() {
this.customVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.couse-wrap {
margin-top: 16px;
background: #fff;
.header {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 14px 20px;
border-bottom: 1px solid #e5e5e5;
display: flex;
align-items: center;
.count-down {
margin-left: 20px;
display: flex;
align-items: center;
width: 376px;
height: 32px;
border-radius: 2px;
opacity: 1;
background: #f47f131a;
padding: 6px 11px;
box-sizing: border-box;
color: #666666;
font-size: 12px;
font-weight: 400;
.error-circle {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
}
.condition {
display: flex;
align-items: center;
margin: 16px 20px;
.couse-tabs {
flex: 3;
display: flex;
align-items: center;
flex-wrap: wrap;
&-item {
padding: 6px 20px;
background: #f2f3f5;
border-radius: 2px;
line-height: 20px;
color: #333333;
font-size: 14px;
font-weight: 500;
margin: 0 8px 8px 0;
cursor: pointer;
}
.active {
color: #2a58ad;
background: #2a58ad26;
}
}
}
.couse-content {
display: flex;
align-items: center;
flex-wrap: wrap;
margin: 0 20px;
.content-item {
min-width: 278px;
width: calc((100% / 4) - (16px * 3 / 4));
padding: 20px;
border-radius: 4px;
background: #f8faff;
height: 204px;
box-sizing: border-box;
margin-right: 16px;
margin-bottom: 16px;
.name {
color: #1d1d1d;
font-size: 20px;
font-weight: 500;
line-height: 28px;
}
.value {
color: #1d1d1d;
font-size: 14px;
font-weight: 400;
line-height: 20px;
margin: 4px 0 16px;
}
.configuration {
display: flex;
align-items: center;
margin-bottom: 16px;
.item {
flex: 1;
color: #888888;
font-size: 14px;
font-weight: 400;
.number {
color: #1d1d1d;
font-size: 16px;
font-weight: 400;
line-height: 24px;
margin-top: 4px;
}
}
}
}
.content-item:nth-child(4n) {
margin-right: 0;
}
.btns {
display: flex;
align-items: center;
justify-content: space-between;
color: #2a58ad;
font-size: 14px;
font-weight: 400;
.details {
width: 114px;
height: 32px;
border-radius: 24px;
opacity: 1;
border: 1px solid #2a58ad80;
background: #ffffff;
line-height: 32px;
text-align: center;
cursor: pointer;
}
.configure-course {
width: 114px;
height: 32px;
border-radius: 24px;
opacity: 1;
background: #dfe6f3;
line-height: 32px;
text-align: center;
cursor: pointer;
}
}
}
}
</style>
<!-- 自定义配课 -->
<template>
<div class="coustom-dialog">
<baseDialog
:dialog-config="dialogConfig"
:is-show.sync="visible"
class="accountDailog"
@handleClick="handleConfirm"
@closeDialog="handleClose"
>
<glsx-combi-form
label-width="150px"
default-width="400px"
:form-obj="coustomForm"
:form-data="coustomFormData"
:form-rules="infoRules"
>
<template slot="condition" slot-scope="scope">
<div class="condition-tabs">
<div
:class="['condition-tab', item.active ? 'active' : '']"
v-for="(item, index) in conditionList"
:key="index"
@click="item.active = !item.active"
>
{{ item.text }}
</div>
</div>
</template>
</glsx-combi-form>
</baseDialog>
</div>
</template>
<script>
export default {
props: {
customVisible: {
type: Boolean,
default: false
}
},
computed: {
visible: {
get() {
return this.customVisible
},
set(newVal) {
this.$emit("dialogClose", {
flag: newVal,
attrName: "customVisible"
})
}
}
},
data() {
return {
dialogConfig: {
title: "自定义配课",
width: "720px"
},
infoRules: {
refundType: [
{
required: true,
message: "请选择退款类型",
trigger: "blur"
}
]
},
coustomForm: {},
coustomFormData: [
{
label: "选择筛选条件",
name: "condition",
addHtml: "condition"
},
{
label: "组合筛选条件:",
name: "condition",
type: "radio",
optionId: "confId",
optionLabel: "confLabel",
optionList: [
{
confLabel: "符合其中一项规则(或)",
confId: 1
},
{
confLabel: "符合已选规则(且)",
confId: 2
}
]
}
],
conditionList: [
{
text: "月产值<30万",
value: 1,
active: true
},
{
text: "客单价<9000元",
value: 2,
active: false
},
{
text: "转化率<30%",
value: 3,
active: false
}
]
}
},
methods: {
handleClose() {
this.visible = false
},
handleConfirm() {
this.visible = false
}
}
}
</script>
<style scoped lang="scss">
.condition-tabs {
display: flex;
align-items: center;
.condition-tab {
padding: 6px 12px;
border-radius: 2px;
color: #333333;
font-size: 14px;
font-weight: 400;
background: #f2f3f5;
margin-right: 8px;
margin-bottom: 8px;
box-sizing: border-box;
line-height: 20px;
}
.active {
color: #2a58ad;
font-weight: 500;
background: #2a58ad26;
}
}
</style>
<template>
<div :ref="id" class="canvas"></div>
</template>
<script>
import * as echarts from "echarts"
export default {
name: "barChart",
props: {
colors: {
type: Array,
default: () => ["#FFC154", "#FF9671"]
},
xData: {
type: Array,
default: []
},
yData: {
type: Array,
default: []
},
id: {
type: String,
default: ""
}
},
data() {
return {
client: "",
chart: ""
}
},
// created() {
// const { rotate, analysisList } = this
// const obj = {
// rotate,
// analysisList
// }
// this.lineOptions = this.revese ? getBarReverseOptions(obj) : getBarOptions(obj)
// },
watch: {
analysisList: {
handler() {
this.chart.setOption(this.getChartSetOption())
},
deep: true
}
},
mounted() {
this.client = this.$refs[this.id]
this.chart = echarts.init(this.client)
this.chart.setOption(this.getChartSetOption())
window.addEventListener("resize", this.resizeHandler)
},
methods: {
getChartSetOption() {
var options = {
xAxis: {
type: "category",
axisLabel: {
color: "#000000a6",
fontSize: "11px"
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
data: this.xData
},
grid: {
left: "6%",
right: "6%",
top: "8%",
bottom: "4%",
// bottom: obj.rotate ? '4%' : '12%',
containLabel: true
},
yAxis: {
type: "value",
splitLine: {
lineStyle: {
color: "#E7EBEF"
}
},
axisLabel: {
show: false
},
splitNumber: 4
},
series: [
{
type: "bar",
symbol: "circle",
backgroundStyle: {
color: "#6578FF"
},
label: {
position: "top",
show: true,
color: "#999999"
},
barWidth: "35%",
data: this.yData
}
]
}
return options
}
}
}
</script>
<style lang="scss" scoped>
.canvas {
width: 100%;
height: 100%;
}
</style>
<template>
<div :ref="id" class="canvas"></div>
</template>
<script>
// 按需引入 echarts
import * as echarts from "echarts"
export default {
data() {
return {
client: "",
chart: ""
}
},
props: {
colors: {
type: Array,
default: () => ["#FFC154", "#FF9671"]
},
xData: {
type: Array,
default: []
},
yData: {
type: Array,
default: []
},
id: {
type: String,
default: ""
}
},
watch: {
xData: {
handler() {
this.chart.setOption(this.getChartSetOption())
}
},
yData: {
handler() {
this.chart.setOption(this.getChartSetOption())
}
}
},
mounted() {
this.client = this.$refs[this.id]
this.chart = echarts.init(this.client)
this.chart.setOption(this.getChartSetOption())
window.addEventListener("resize", this.resizeHandler)
},
methods: {
resizeHandler() {
if (this.chart) {
this.chart.clear()
setTimeout(() => {
this.chart.setOption(this.getChartSetOption())
this.chart.resize()
}, 1000)
}
},
getChartSetOption() {
var option = {
grid: {
bottom: "12%",
top: "10%",
left: "15%",
right: "20px"
},
tooltip: {
show: true,
trigger: "axis",
triggerOn: "click",
backgroundColor: "rgba(41, 45, 51, 1)",
borderRadius: 15,
borderColor: "rgba(41, 45, 51, 1)",
textStyle: {
// 悬浮框文字样式
color: "#fff",
fontSize: 12
},
formatter: (params) => {
return params[0].value
}
},
xAxis: {
type: "category",
boundaryGap: false,
splitNumber: 8,
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
interval: 0,
show: true,
color: "#000000a6",
fontSize: "11px"
},
data: this.xData
},
yAxis: {
type: "value",
labelLine: {
show: false
},
axisLine: {
show: false,
lineStyle: {
color: "#E7EBEF"
}
},
axisLabel: {
show: false
},
splitLine: {
show: true,
lineStyle: {
color: "#E7EBEF"
}
},
axisTick: {
show: false
}
},
series: [
{
type: "line",
avoidLabelOverlap: false,
label: {
formatter: "{c}%",
position: "inside",
fontSize: 10,
show: true,
color: "#999999"
},
emphasis: {
label: {
show: false
}
},
showSymbol: false,
itemStyle: {
color: "rgba(52, 123, 255, 1)"
},
data: this.yData
}
]
}
return option
}
}
}
</script>
<style scoped lang="scss">
.canvas {
width: 100%;
height: 100%;
}
</style>
<template>
<d2-container class="customer-tags">
<div class="d2-container-content">
<d2-table-header title="门店列表">
<el-button size="small" type="primary" @click="exportTable">
批量配课
</el-button>
</d2-table-header>
<d2-table
ref="table"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
</d2-table>
</div>
</d2-container>
</template>
<script type="text/ecmascript-6">
import { mapActions, mapState } from 'vuex'
import { refundApplyRecordPage } from "@api/refundExamine"
import { Util, deepClone } from "@/common/util"
import {
studyPage,
studyUpdate
} from "@api/contentManager"
import noDataImg from "@/assets/empty.png"
import dayjs from "dayjs"
export default {
name: "indicatorInfo",
data() {
return {
listOfPenaltiesShow: false,
noDataImg,
searchForm: {
bussinessScene: "",
merchantId: "",
scriptMatching: "",
receptionist: "",
solutionBrowsing: "",
// searchdate: [new Date(), new Date()]
sendStartData: [],
finishStartData: []
},
searchFormSearch: {},
currentItem: {},
getListApi: studyPage,
// 表格参数
tableParams: {
listName: "list",
tableOption: {
width: "100"
},
tableColumns: [
{
label: "门店名称",
prop: "title"
},
{
label: "商户号",
prop: "staffName"
// minWidth: 144,
},
{
label: "是否直营",
prop: "staffPhone"
},
{
label: "展业时间",
prop: "createdDate",
// minWidth: 140
// formatter: (cellValue) => {
// return cellValue.sendStartTime
// ? Util.dateFormate(cellValue.sendStartTime, "YYYY-MM-DD HH:mm:ss")
// : "-"
// }
},
{
label: "归属业务",
addHtml: 'taskStatus'
},
{
label: "主营品牌",
prop: "finishDate",
// minWidth: 140
// formatter: (cellValue) => {
// return cellValue.finishEndTime
// ? Util.dateFormate(cellValue.finishEndTime, "YYYY-MM-DD HH:mm:ss")
// : "-"
// }
},
{
label: "区域运营经理",
prop: "finishDate",
},
{
label: "驻店人数",
prop: "finishDate",
},
{
label: "已配课程人数",
prop: "finishDate",
}
]
},
detailInfo: {}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
created() { },
mounted() {
// this.getServiceStore()
// this.getStudyPage()
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
// 详情
handleDetail(row) {
this.listOfPenaltiesShow = true
this.detailInfo = row
},
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchForm?.sendStartData?.length) {
let [searchStartDate, searchEndDate] = this.searchForm.sendStartData
this.searchFormSearch.sendStartTime = Util.dateFormate(
searchStartDate,
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.sendEndTime = Util.dateFormate(
searchEndDate, "YYYY-MM-DD") + " 23:59:59"
}
if (this.searchForm?.finishStartData?.length) {
let [searchStartDate, searchEndDate] = this.searchForm.finishStartData
this.searchFormSearch.finishStartTime = Util.dateFormate(
searchStartDate,
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.finishEndTime = Util.dateFormate(
searchEndDate, "YYYY-MM-DD") + " 23:59:59"
}
delete this.searchFormSearch.sendStartData
delete this.searchFormSearch.finishStartData
resolve()
})
},
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
// this.getStudyPage()
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
async exportTable() {
await this.beforeSearchFn()
// console.log(params)
let params = this.searchFormSearch
params.method = 'dj.api.smartcarlife.study.punish.list.export'
const list = [
...this.dowloadList,
{
name: '处罚名单',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
// try {
// await this.beforeSearchFn()
// const res = await studyExport({
// ...this.searchFormSearch
// })
// console.log(res)
// if (res) window.open(res)
// } catch (error) {
// if (error) this.$message.error(error)
// }
},
// getServiceStore() {
// listShop4sByRef({}).then((res) => {
// res ||= []
// this.showFormData.forEach((item, index) => {
// if (item.type === "select" && item.name == "merchantId") {
// this.$set(this.showFormData[index], "optionList", [
// {
// merchantName: "全部",
// merchantId: ""
// },
// ...res
// ])
// }
// })
// })
// },
// async getStudyPage() {
// try {
// await this.beforeSearchFn()
// const res = await studyPage({
// ...this.searchFormSearch
// })
// console.log(res)
// this.staticData = res || {}
// } catch (error) {
// if (error) this.$message.error(error)
// }
// },
}
}
</script>
<style scoped lang="scss">
.emptyBg {
display: flex;
flex-direction: column;
align-items: center;
padding: 120px 0;
.noDataImg {
width: 64px;
height: 40px;
}
}
.error-input {
::v-deep.el-input__inner {
border-color: red;
}
}
.tag-item {
display: flex;
align-items: center;
padding: 0 10px;
justify-content: center;
.tag {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.more-info {
white-space: nowrap;
color: #2a58ad;
cursor: pointer;
margin-left: 2px;
}
}
::v-deep.tags-popover {
max-width: 50vw;
}
.static-box {
display: flex;
gap: 0 16px;
margin-bottom: 12px;
.static-item {
flex: 1;
flex-shrink: 0;
height: 82px;
background: #f8faff;
border-radius: 5px;
box-sizing: border-box;
padding: 16px 20px;
.static-title {
font-size: 14px;
color: #333333;
line-height: 20px;
margin-bottom: 4px;
}
.static-value {
display: flex;
font-weight: 700;
font-size: 24px;
line-height: 30px;
align-items: baseline;
::v-deep.static-unit {
font-weight: 600;
font-size: 14px;
margin: 0 2px;
}
}
}
}
.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>
<!-- 上周学习复盘 -->
<template>
<div class="week-replay">
<div class="header">
课程任务配置<span class="time">(2025-06-09 至 2025-06-15)</span>
</div>
<div class="improve">
<div
:class="['item', activeIndex == index ? 'active' : '']"
v-for="(item, index) in improveList"
:key="item.id"
@click="handleClick(index)"
>
{{ item.name }}
</div>
</div>
<d2-table
class="couse-table"
ref="recordTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
v-if="show"
>
<div slot="auth-button" slot-scope="scope">
<!-- 查看 -->
<span style="margin-right: 10px; cursor: pointer">
<el-button type="text" @click="handleLookCouse"> 查看课程 </el-button>
</span>
</div>
<!-- 查看课程 -->
</d2-table>
<long-detail-dialog
:longVisible.sync="detailVisible"
v-if="detailVisible"
:params-obj="recordInfo"
@dialogClose="closeDetailDialog"
/>
</div>
</template>
<script>
import { invoicePage } from "@api/invoiceManage"
import longDetailDialog from "./longDetailDialog"
export default {
components: { longDetailDialog },
data() {
return {
detailVisible: false,
recordInfo: "",
show: false,
activeIndex: 0,
searchFormSearch: {},
getListApi: invoicePage,
improveList: [
{
name: "未改善",
id: 1
},
{
name: "已改善",
id: 2
}
],
column: [
{
label: "驻店人员",
prop: "invoiceAmount",
width: "150",
isHide: false
},
{
label: "手机号码",
prop: "phone",
width: "150",
isHide: false
},
{
label: "门店名称",
prop: "itemNames",
width: "300",
isHide: false
},
{
label: "主营品牌",
prop: "merchantBrandName",
width: "300",
isHide: true
},
{
label: "学习任务情况",
prop: "expireStatus",
width: "120px",
isHide: false
},
{
label: "任务完成时间",
prop: "createdDate",
width: "180",
isHide: false
}
],
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
// mutiSelectUniqueKey: 'id',
// mutiSelectName: 'invoiceCode',
listName: "list",
tableOption: { width: "150px" },
tableColumns: []
}
}
},
created() {
this.handleClick(0)
},
methods: {
closeDetailDialog() {
this.detailVisible = !this.detailVisible
this.$refs.recordTable.refreshTable(false, true)
},
handleLookCouse() {
console.log("查看课程")
this.detailVisible = true
},
handleClick(index) {
this.show = false
this.activeIndex = index
if (this.activeIndex == 0) {
this.column[this.findAttrIdx("merchantBrandName")].isHide = true
this.column[this.findAttrIdx("phone")].isHide = false
} else {
this.column[this.findAttrIdx("merchantBrandName")].isHide = false
this.column[this.findAttrIdx("phone")].isHide = true
}
this.filterColumn()
},
filterColumn() {
let arr = this.column.filter((item) => {
return !item.isHide
})
this.tableParams.tableColumns = arr
this.$nextTick(() => {
this.show = true
})
},
findAttrIdx(attrName) {
return this.column.findIndex((item) => item.prop == attrName)
}
}
}
</script>
<style lang="scss" scoped>
.week-replay {
margin-top: 16px;
background: #fff;
.header {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 14px 20px;
border-bottom: 1px solid #e5e5e5;
.time {
color: #999999;
font-size: 14px;
font-weight: 400;
margin-left: 8px;
}
}
.improve {
display: flex;
align-items: center;
margin: 16px 20px;
.item {
width: 82px;
height: 32px;
line-height: 32px;
border-radius: 2px;
background: #f2f3f5;
color: #333333;
font-size: 14px;
font-weight: 400;
margin-right: 8px;
text-align: center;
cursor: pointer;
}
.active {
background: #2a58ad26;
color: #2a58ad;
}
}
}
.couse-table {
margin: 0 20px;
}
</style>
<!-- 学习情况 -->
<template>
<div class="learning-situation">
<div class="header">学习情况</div>
</div>
</template>
<script></script>
<style scoped lang="scss">
.learning-situation {
.header {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 14px 20px;
border-bottom: 1px solid #e5e5e5;
}
}
</style>
<!-- 查看课程 -->
<template>
<div class="detail-dialog">
<baseDialog
:dialog-config="dialogConfig"
:is-show.sync="visible"
@handleClick="handleConfirm"
@closeDialog="handleClose"
>
<div class="item" v-for="(detail, index) in configData" :key="index">
<div class="title">{{ detail.title }}</div>
<div class="detail-content">
<div
class="form_div"
v-if="detail.infoData && detail.infoData.length"
>
<el-form class="edit-sub-block" label-width="110px" :inline="true">
<el-row :gutter="20">
<template v-for="(item, key) in detail.infoData">
<el-col :span="item.col ? item.col : 8" :key="key">
<el-form-item :label="item.title">
<div
v-if="item.className"
:class="[item.className(detailInfo)]"
></div>
{{
item.formatter
? item.formatter(detailInfo)
: detailInfo[item.key]
? detailInfo[item.key]
: "-"
}}
</el-form-item></el-col
>
</template>
</el-row>
</el-form>
</div>
<div v-if="detail.tableParams" style="margin-top: 20px">
<d2-table
:hasNum="detail.hasNum"
ref="recordTable"
:table-params="detail.tableParams"
:tableData="detail.tableData"
:hasPage="false"
>
</d2-table>
</div>
</div>
</div>
</baseDialog>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
export default {
data() {
return {
dialogConfig: {
title: "查看课程",
width: "1080px"
},
detailInfo: {
tableData: []
},
configData: [
{
title: "个人信息",
infoData: [
{
title: "姓名:",
key: "employeeName",
formatter(cellValue) {
return cellValue.employeeName
}
},
{
title: "手机号码:",
key: "merchantName"
},
{
title: "门店:",
key: "merchantName"
},
{
title: "上级:",
key: "fileUrl"
},
{
title: "导师:",
key: "carModel"
}
],
hasNum: false,
tableParams: {
tableColumns: [
{
label: "个人产值变化",
prop: "invoiceAmount"
},
{
label: "个人转化率变化",
prop: "invoiceAmount"
},
{
label: "个人客单价变化",
prop: "useStatus"
}
]
}
},
{
title: "课程配置",
hasNum: true,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: "课程名称",
prop: "invoiceAmount"
},
{
label: "学习时长",
prop: "invoiceAmount"
},
{
label: "学习进度",
prop: "useStatus",
formatter: (cellValue) => {
return this.baseData.useStatusOpt.find(
(item) => item.confId === cellValue.useStatus
)?.confValue
},
className: (cellValue) => {
return {
N: "redSpot",
Y: "greenSpot"
}[cellValue.useStatus]
}
},
{
label: "成绩",
prop: "penalty "
},
{
label: "完成时间",
prop: "tradeNo",
width: "200",
formatter: (cellValue) => {
return cellValue.createdDate
? Util.dateFormate(
cellValue.createdDate,
"YYYY-MM-DD HH:mm:ss"
)
: ""
}
}
]
}
}
]
}
},
props: {
longVisible: {
type: Boolean,
default: false
}
},
computed: {
visible: {
get() {
return this.longVisible
},
set(newVal) {
this.$emit("dialogClose", {
flag: newVal,
attrName: "longVisible"
})
}
}
},
methods: {
handleClose() {
this.visible = false
},
handleConfirm() {
this.visible = false
}
}
}
</script>
<style scoped lang="scss">
.detail-dialog {
.item {
margin-bottom: 20px;
.title {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 10px 0;
border-bottom: 1px solid #e5e5e5;
}
.form_div {
color: #333333;
padding: 20px 30px;
.edit-sub-block {
.el-form-item {
width: 100%;
margin-bottom: 0px;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
}
.edit-sub-block-two {
.el-form-item {
margin-bottom: 0px;
}
}
}
}
}
</style>
<!-- 月组件 -->
<template>
<div class="week-selector">
<div class="nav-btn left" @click="previousMonth">
<i class="el-icon-arrow-left"></i> 上一月
</div>
<div class="nav-btn current-week" @click="goToCurrentMonth">
<div class="this-week">本月</div>
<div class="week-range">{{ currentMonthRange }}</div>
</div>
<div
:class="['nav-btn', 'right', isDisabled ? 'isDisabled' : '']"
@click="nextMonth"
>
下一月 <i class="el-icon-arrow-right"></i>
</div>
</div>
</template>
<script>
export default {
data() {
return {
monthOffset: 0,
isDisabled: false
}
},
computed: {
currentMonthRange() {
const start = this.getStartOfMonth()
const end = new Date(start)
end.setMonth(start.getMonth(), this.getLastDayOfMonth(start))
this.updateIsDisabled(start)
return `${this.formatDate(start)} - ${this.formatDate(end)}`
}
},
methods: {
getLastDayOfMonth(date) {
return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate()
},
getStartOfMonth() {
const date = new Date()
date.setMonth(date.getMonth() + this.monthOffset)
date.setDate(1)
return date
},
formatDate(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, "0")
const day = String(date.getDate()).padStart(2, "0")
return `${year}/${month}/${day}`
},
previousMonth() {
this.monthOffset--
},
nextMonth() {
if (!this.isDisabled) {
this.monthOffset++
}
},
goToCurrentMonth() {
this.monthOffset = 0
},
getCurrentMonthStart() {
const date = new Date()
date.setDate(1)
return date
},
isSameMonth(date1, date2) {
return (
date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth()
)
},
updateIsDisabled(date) {
const currentMonthStart = this.getCurrentMonthStart()
const targetMonthStart = this.getStartOfMonth(date)
this.isDisabled = this.isSameMonth(currentMonthStart, targetMonthStart)
console.log(this.isDisabled)
}
}
}
</script>
<style lang="scss" scoped>
.week-selector {
display: flex;
align-items: center;
border: 1px solid #dbdbdb;
border-radius: 4px;
height: 32px;
box-sizing: border-box;
.nav-btn {
width: 70px;
padding: 8px 6px;
color: #1d1d1d;
font-size: 12px;
font-weight: 400;
box-sizing: border-box;
}
.left {
border-right: 1px solid #dbdbdb;
}
.right {
border-left: 1px solid #dbdbdb;
}
.current-week {
width: 224px;
display: flex;
align-items: center;
}
.this-week {
width: 36px;
height: 20px;
border-radius: 2px;
background: #f2f3f5;
color: #2a58ad;
font-size: 12px;
text-align: center;
line-height: 20px;
margin-right: 14px;
}
.week-range {
color: #1d1d1d;
font-size: 14px;
}
.isDisabled {
color: #cccccc;
}
}
</style>
<!-- 业绩状况 -->
<template>
<div class="performance-status">
<div class="header">业绩状况(延保)</div>
<div class="tabs">
<div
:class="{
'tabs-item': true,
'tabs-item-active': index === activeIndex
}"
v-for="(item, index) in timeData"
:key="index"
@click="handleClick(index)"
>
{{ item.text }}
</div>
</div>
<div class="content">
<!-- 产值 -->
<div class="content-item">
<div class="title">个人产值(元)</div>
<echart-bar
class="echart"
id="production"
:xData="xData"
:yData="yData"
></echart-bar>
</div>
<div class="content-item">
<div class="title">转化率(%)</div>
<echart-line
class="echart"
id="production"
:xData="xData"
:yData="yData"
></echart-line>
</div>
<div class="content-item">
<div class="title">客单价(元)</div>
<echart-bar
class="echart"
id="production"
:xData="xData"
:yData="yData"
></echart-bar>
</div>
</div>
</div>
</template>
<script>
import EchartLine from "./echartLine"
import EchartBar from "./echartBar"
export default {
components: {
EchartLine,
EchartBar
},
name: "performanceStatus",
data() {
return {
xData: ["2021-01-01", "2021-01-02", "2021-01-03", "2021-01-04"],
yData: [15600, 24897, 24897, 18350],
activeIndex: 0,
timeData: [
{
text: "近4周",
value: 1
},
{
text: "近4月",
value: 2
}
]
}
},
methods: {
handleClick(index) {
this.activeIndex = index
}
}
}
</script>
<style scoped lang="scss">
.performance-status {
.header {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 14px 20px;
border-bottom: 1px solid #e5e5e5;
}
.tabs {
margin: 12px 0 16px 20px;
display: flex;
align-items: center;
background: #fff;
border-radius: 2px;
.tabs-item {
padding: 6px 20px;
cursor: pointer;
font-size: 12px;
font-weight: 400;
color: #1d1d1d;
border: 1px solid #dbdbdb;
}
.tabs-item-active {
color: #ffffff;
background: #2a58ad;
}
}
.content {
margin: 20px;
display: flex;
height: 238px;
width: 100%;
.content-item {
flex: 1;
.echart {
width: 100%;
height: 100%;;
}
.title {
color: #333333;
font-size: 14px;
font-weight: 400;
margin-bottom: 12px;
}
}
}
}
</style>
<!-- 员工详情 -->
<template>
<div class="staff-detail">
<div class="header">基础信息</div>
<div class="baseInfo">
<div class="form_div" v-if="infoData && infoData.length">
<el-form class="edit-sub-block" label-width="128px" :inline="true">
<el-row :gutter="20">
<template v-for="(item, index) in infoData">
<el-col :span="item.col ? item.col : 8" :key="index">
<el-form-item :label="item.title">
<div
v-if="item.className"
:class="[item.className(detailInfo)]"
></div>
{{
item.formatter
? item.formatter(detailInfo)
: detailInfo[item.key]
? detailInfo[item.key]
: "-"
}}
</el-form-item></el-col
>
</template>
</el-row>
</el-form>
</div>
</div>
<!-- 业绩状况 -->
<performance-status :detailInfo="detailInfo"></performance-status>
<!-- 谈客能力-->
<div class="header">谈客能力</div>
<div class="presentation"></div>
<!-- 学习情况 -->
<learning-situation></learning-situation>
</div>
</template>
<script>
import LearningSituation from "./learningSituation.vue"
import PerformanceStatus from "./performanceStatus.vue"
export default {
components: {
PerformanceStatus,
LearningSituation
},
data() {
return {
detailInfo: {},
infoData: [
{
title: "入职时间:",
key: "employeeName",
formatter(cellValue) {
return cellValue.employeeName
}
},
{
title: "上级:",
key: "fileUrl"
},
{
title: "导师:",
key: "carModel"
},
{
title: "门店:",
key: "merchantName"
},
{
title: "归属业务:",
key: "merchantName"
}
]
}
}
}
</script>
<style lang="scss" scoped>
.staff-detail {
background: #fff;
.header {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 14px 20px;
border-bottom: 1px solid #e5e5e5;
}
.form_div {
color: #1d1d1d;
padding: 20px 30px;
.edit-sub-block {
.el-form-item {
width: 100%;
margin-bottom: 0px;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__label {
color: #666666;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 1280px);
word-break: break-all;
}
}
.edit-sub-block-two {
.el-form-item {
margin-bottom: 0px;
}
}
}
}
</style>
<!-- 门店指标 -->
<template>
<div class="store-wrap">
<div v-for="(item, index) in storeList" :key="index" class="store-item">
<div class="name">{{ item.name }}</div>
<div class="value">{{ item.value }}</div>
<div class="link" v-if="item.link">
环比<span>{{ item.link }}</span>
<div class="triangle-up"></div>
</div>
<div class="detail" v-if="item.addHtml" @click="handleDetail(item)">
详情<i class="el-icon-arrow-right"></i>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
storeList: [
{
name: "门店总数",
value: "100",
addHtml: "store"
},
{
name: "产值(元)",
value: "100",
link: "11%",
trend: () => {
return false
}
},
{
name: "客单价(元)",
value: "100",
link: "11%",
trend: () => {
return false
}
},
{
name: "交车数",
value: "100",
link: "11%",
trend: () => {
return false
}
},
{
name: "触客数",
value: "100",
link: "11%",
trend: () => {
return false
}
},
{
name: "订单数",
value: "100",
link: "11%",
trend: () => {
return false
}
}
]
}
},
methods: {
handleDetail(row) {
console.log(1111)
row.activeName = "storeInfo"
this.$emit("openWindow", row)
}
},
mounted() {}
}
</script>
<style lang="scss" scoped>
.store-wrap {
display: flex;
align-items: center;
flex-wrap: wrap;
.store-item {
width: calc((100% / 3) - (16px * 2 / 3));
min-width: 376px;
height: 124px;
border-radius: 4px;
opacity: 1;
background: #f8faff;
padding: 16px 20px;
margin-bottom: 16px;
box-sizing: border-box;
margin-right: 16px;
.name {
color: #333333;
font-size: 14px;
font-weight: 400;
}
.value {
color: #1d1d1d;
font-size: 32px;
font-weight: 500;
margin: 8px 0;
}
.detail {
color: #2a58ad;
font-size: 14px;
font-weight: 400;
cursor: pointer;
}
.link {
display: flex;
align-items: center;
color: #888888;
font-size: 14px;
font-weight: 400;
span {
color: #eb4e4e;
margin: 0 6px;
}
}
}
.store-item:nth-child(3n) {
margin-right: 0;
}
}
// 向上
.triangle-up {
width: 0;
height: 0;
border-left: 3px solid transparent; /* 左半边透明 */
border-right: 3px solid transparent; /* 右半边透明 */
border-bottom: 6px solid #eb4e4e; /* 底部红色形成三角形 */
}
/* 向下 */
.triangle-down {
width: 0;
height: 0;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 6px solid #43cf7c;
}
</style>
<template>
<d2-container class="customer-tags">
<div class="d2-container-content">
<d2-table-header title="门店列表"> </d2-table-header>
<d2-table
ref="table"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
</d2-table>
</div>
</d2-container>
</template>
<script type="text/ecmascript-6">
import { mapActions, mapState } from 'vuex'
import { refundApplyRecordPage } from "@api/refundExamine"
import { Util, deepClone } from "@/common/util"
import {
studyPage,
studyUpdate
} from "@api/contentManager"
import noDataImg from "@/assets/empty.png"
import dayjs from "dayjs"
export default {
name: "storreInfo",
data() {
return {
listOfPenaltiesShow: false,
noDataImg,
searchForm: {
bussinessScene: "",
merchantId: "",
scriptMatching: "",
receptionist: "",
solutionBrowsing: "",
// searchdate: [new Date(), new Date()]
sendStartData: [],
finishStartData: []
},
searchFormSearch: {},
currentItem: {},
getListApi: studyPage,
// 表格参数
tableParams: {
listName: "list",
tableOption: {
width: "100"
},
tableColumns: [
{
label: "门店名称",
prop: "title"
},
{
label: "商户号",
prop: "staffName"
// minWidth: 144,
},
{
label: "是否直营",
prop: "staffPhone"
},
{
label: "展业时间",
prop: "createdDate",
// minWidth: 140
// formatter: (cellValue) => {
// return cellValue.sendStartTime
// ? Util.dateFormate(cellValue.sendStartTime, "YYYY-MM-DD HH:mm:ss")
// : "-"
// }
},
{
label: "归属业务",
addHtml: 'taskStatus'
},
{
label: "主营品牌",
prop: "finishDate",
// minWidth: 140
// formatter: (cellValue) => {
// return cellValue.finishEndTime
// ? Util.dateFormate(cellValue.finishEndTime, "YYYY-MM-DD HH:mm:ss")
// : "-"
// }
},
{
label: "区域运营经理",
prop: "finishDate",
},
{
label: "驻店人数",
prop: "finishDate",
},
{
label: "已配课程人数",
prop: "finishDate",
}
]
},
detailInfo: {}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
created() { },
mounted() {
// this.getServiceStore()
// this.getStudyPage()
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
// 详情
handleDetail(row) {
this.listOfPenaltiesShow = true
this.detailInfo = row
},
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchForm?.sendStartData?.length) {
let [searchStartDate, searchEndDate] = this.searchForm.sendStartData
this.searchFormSearch.sendStartTime = Util.dateFormate(
searchStartDate,
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.sendEndTime = Util.dateFormate(
searchEndDate, "YYYY-MM-DD") + " 23:59:59"
}
if (this.searchForm?.finishStartData?.length) {
let [searchStartDate, searchEndDate] = this.searchForm.finishStartData
this.searchFormSearch.finishStartTime = Util.dateFormate(
searchStartDate,
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.finishEndTime = Util.dateFormate(
searchEndDate, "YYYY-MM-DD") + " 23:59:59"
}
delete this.searchFormSearch.sendStartData
delete this.searchFormSearch.finishStartData
resolve()
})
},
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
// this.getStudyPage()
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
async exportTable() {
await this.beforeSearchFn()
// console.log(params)
let params = this.searchFormSearch
params.method = 'dj.api.smartcarlife.study.punish.list.export'
const list = [
...this.dowloadList,
{
name: '处罚名单',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
// try {
// await this.beforeSearchFn()
// const res = await studyExport({
// ...this.searchFormSearch
// })
// console.log(res)
// if (res) window.open(res)
// } catch (error) {
// if (error) this.$message.error(error)
// }
},
// getServiceStore() {
// listShop4sByRef({}).then((res) => {
// res ||= []
// this.showFormData.forEach((item, index) => {
// if (item.type === "select" && item.name == "merchantId") {
// this.$set(this.showFormData[index], "optionList", [
// {
// merchantName: "全部",
// merchantId: ""
// },
// ...res
// ])
// }
// })
// })
// },
// async getStudyPage() {
// try {
// await this.beforeSearchFn()
// const res = await studyPage({
// ...this.searchFormSearch
// })
// console.log(res)
// this.staticData = res || {}
// } catch (error) {
// if (error) this.$message.error(error)
// }
// },
}
}
</script>
<style scoped lang="scss">
.emptyBg {
display: flex;
flex-direction: column;
align-items: center;
padding: 120px 0;
.noDataImg {
width: 64px;
height: 40px;
}
}
.error-input {
::v-deep.el-input__inner {
border-color: red;
}
}
.tag-item {
display: flex;
align-items: center;
padding: 0 10px;
justify-content: center;
.tag {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.more-info {
white-space: nowrap;
color: #2a58ad;
cursor: pointer;
margin-left: 2px;
}
}
::v-deep.tags-popover {
max-width: 50vw;
}
.static-box {
display: flex;
gap: 0 16px;
margin-bottom: 12px;
.static-item {
flex: 1;
flex-shrink: 0;
height: 82px;
background: #f8faff;
border-radius: 5px;
box-sizing: border-box;
padding: 16px 20px;
.static-title {
font-size: 14px;
color: #333333;
line-height: 20px;
margin-bottom: 4px;
}
.static-value {
display: flex;
font-weight: 700;
font-size: 24px;
line-height: 30px;
align-items: baseline;
::v-deep.static-unit {
font-weight: 600;
font-size: 14px;
margin: 0 2px;
}
}
}
}
.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>
<!-- 周组件 -->
<template>
<div class="week-selector">
<div class="nav-btn left" @click="previousWeek">
<i class="el-icon-arrow-left"></i> 上一周
</div>
<div class="nav-btn current-week" @click="goToCurrentWeek">
<div class="this-week">本周</div>
<div class="week-range">{{ currentWeekRange }}</div>
</div>
<div
:class="['nav-btn', 'right', isDisabled ? 'isDisabled' : '']"
@click="nextWeek"
>
下一周 <i class="el-icon-arrow-right"></i>
</div>
</div>
</template>
<script>
export default {
data() {
return {
weekOffset: 0,
isDisabled: false
}
},
computed: {
currentWeekRange() {
const start = this.getStartOfWeek()
const end = new Date(start)
end.setDate(start.getDate() + 6)
this.isWeek(this.formatDate(start))
let timeStr = `${this.formatDate(start)} - ${this.formatDate(end)}`
this.$emit("changeWeek", {
weekOffset: this.weekOffset,
timeStr
})
return timeStr
}
},
mounted() {},
methods: {
getStartOfWeek() {
const date = new Date()
date.setDate(date.getDate() + this.weekOffset * 7)
const day = date.getDay()
const diff = date.getDate() - day + (day === 0 ? -6 : 1)
return new Date(date.setDate(diff))
},
formatDate(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, "0")
const day = String(date.getDate()).padStart(2, "0")
return `${year}/${month}/${day}`
},
previousWeek() {
this.weekOffset--
},
nextWeek() {
if (!this.isDisabled) {
this.weekOffset++
}
},
goToCurrentWeek() {
this.weekOffset = 0
},
// 获取到周一日期
getMonday() {
const date = new Date()
const day = date.getDay()
const diff = date.getDate() - day + (day === 0 ? -6 : 1)
return new Date(date.setDate(diff))
},
isCurrentWeek(date) {
const currentWeekStart = this.getMonday() // 获取本周的周一
const inputWeekStart = new Date(date)
// 将输入日期调整为所在周的周一
const day = inputWeekStart.getDay()
const diff = inputWeekStart.getDate() - day + (day === 0 ? -6 : 1)
inputWeekStart.setDate(diff)
inputWeekStart.setHours(0, 0, 0, 0)
// 比较两个周一是否相同
return (
currentWeekStart.getFullYear() === inputWeekStart.getFullYear() &&
currentWeekStart.getMonth() === inputWeekStart.getMonth() &&
currentWeekStart.getDate() === inputWeekStart.getDate()
)
},
isWeek(date) {
if (this.isCurrentWeek(date)) {
this.isDisabled = true
} else {
this.isDisabled = false
}
}
}
}
</script>
<style lang="scss" scoped>
.week-selector {
display: flex;
align-items: center;
border: 1px solid #dbdbdb;
border-radius: 4px;
height: 32px;
box-sizing: border-box;
.nav-btn {
width: 70px;
padding: 8px 6px;
color: #1d1d1d;
font-size: 12px;
font-weight: 400;
box-sizing: border-box;
}
.left {
border-right: 1px solid #dbdbdb;
}
.right {
border-left: 1px solid #dbdbdb;
}
.current-week {
width: 224px;
display: flex;
align-items: center;
}
.this-week {
width: 36px;
height: 20px;
border-radius: 2px;
background: #f2f3f5;
color: #2a58ad;
font-size: 12px;
text-align: center;
line-height: 20px;
margin-right: 14px;
}
.week-range {
color: #1d1d1d;
font-size: 14px;
}
.isDisabled {
color: #cccccc;
}
}
</style>
<!--长课程配置 -->
<template>
<div class="long-wrap">
<div class="long-first-section">
<!-- 搜索 -->
<div class="long-wrap-search">
<div class="tabs">
<div
:class="{
'tabs-item': true,
'tabs-item-active': index === activeIndex
}"
v-for="(item, index) in conditionList"
:key="index"
@click="handleClick(index)"
>
{{ item.name }}
</div>
</div>
<week-time-picker @changeWeek="changeWeek"></week-time-picker>
</div>
<div class="analysis-index-wrap">
配课分析指标
<div class="analysis-index-list">
<div
:class="[
'analysis-index-item',
analysisActiveIndex == index ? 'active' : ''
]"
v-for="(analyse, index) in analysisList"
:key="index"
@click="handleAnalysisClick(index)"
>
{{ analyse.name }}{{ analyse.value }}
</div>
</div>
</div>
<!-- 门店指标数据 -->
<store-indicators @openWindow="openWindow"></store-indicators>
</div>
<!-- 课程任务配置 -->
<couse-config @openWindow="openWindow"></couse-config>
<!--上周学习复盘 -->
<last-week-replay></last-week-replay>
</div>
</template>
<script>
import weekTimePicker from "./components/weekTimePicker"
// import monthTimePicker from "./components/monthTimePicker"
import storeIndicators from "./components/storeIndicators"
import couseConfig from "./components/couseConfig"
import lastWeekReplay from "./components/lastWeekReplay"
export default {
components: {
weekTimePicker,
storeIndicators,
couseConfig,
lastWeekReplay
// monthTimePicker
},
data() {
return {
analysisActiveIndex: 0,
activeIndex: 0,
conditionList: [
{
name: "延保",
value: "4"
},
{
name: "权益",
value: "3"
},
{
name: "轻改",
value: "2"
}
],
analysisList: [
{
name: "上周数据",
value: "2025/6/30-2025/7/6"
},
{
name: "当月数据",
value: "2025/7/1-2025/7/31"
}
]
}
},
methods: {
getPreviousWeekMonthToLastSunday(weekOffset) {
const start = this.getStartOfWeek(weekOffset)
// 获取“前一周”的周日
const lastSunday = new Date(start)
lastSunday.setDate(lastSunday.getDate() - 1) // 上周日
// 获取该周所在的月份
const targetMonth = new Date(lastSunday)
const firstDayOfTargetMonth = new Date(
targetMonth.getFullYear(),
targetMonth.getMonth(),
1
)
return `${this.formatDate(firstDayOfTargetMonth)} - ${this.formatDate(
lastSunday
)}`
// return {
// start: this.formatDate(firstDayOfTargetMonth),
// end: this.formatDate(lastSunday)
// }
},
getStartOfWeek(weekOffset) {
const date = new Date()
date.setDate(date.getDate() + weekOffset * 7)
const day = date.getDay()
const diff = date.getDate() - day + (day === 0 ? -6 : 1)
return new Date(date.setDate(diff))
},
formatDate(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, "0")
const day = String(date.getDate()).padStart(2, "0")
return `${year}/${month}/${day}`
},
changeWeek(data) {
let { weekOffset } = data
let analysisObj = {
0: (weekOffset) => {
const start = this.getStartOfWeek(weekOffset - 1)
const end = new Date(start)
end.setDate(start.getDate() + 6)
return `${this.formatDate(start)} - ${this.formatDate(end)}`
},
1: (weekOffset) => {
return this.getPreviousWeekMonthToLastSunday(weekOffset)
}
}
// analysisActiveIndex 0:上周 1:当月
this.analysisList[0].value = analysisObj[0](weekOffset)
this.analysisList[1].value = analysisObj[1](weekOffset)
},
handleClick(index) {
this.activeIndex = index
},
handleAnalysisClick(index) {
this.analysisActiveIndex = index
},
openWindow(data) {
this.$emit("openWindow", data)
}
}
}
</script>
<style lang="scss" scoped>
.long-wrap {
margin: 0 20px;
height: 82vh;
overflow-y: scroll;
overflow-x: hidden;
.long-first-section {
background: #fff;
padding: 16px 20px;
box-sizing: border-box;
}
.long-wrap-search {
display: flex;
align-items: center;
justify-content: space-between;
.tabs {
display: flex;
align-items: center;
background: #fff;
border: 1px solid #dbdbdb;
border-radius: 2px;
.tabs-item {
padding: 8px 20px;
cursor: pointer;
font-size: 12px;
font-weight: 400;
color: #1d1d1d;
border-right: 1px solid #dbdbdb;
}
.tabs-item-active {
border: 1px solid #185efe;
color: #ffffff;
background: #2a58ad;
}
}
}
.count-down {
display: flex;
align-items: center;
width: 376px;
height: 32px;
border-radius: 2px;
opacity: 1;
background: #f47f131a;
padding: 6px 11px;
box-sizing: border-box;
color: #666666;
font-size: 12px;
font-weight: 400;
margin: 12px 0;
.error-circle {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
.analysis-index-wrap {
display: flex;
align-items: center;
color: #111111;
font-size: 16px;
font-weight: 500;
margin: 16px 0;
.analysis-index-list {
display: flex;
align-items: center;
margin-left: 13px;
.analysis-index-item {
padding: 6px 12px;
color: #1d1d1d;
font-size: 12px;
font-weight: 400;
margin-right: 8px;
border-radius: 0 2px 2px 0;
background: #f2f3f5;
cursor: pointer;
}
.active {
background: #2a58ad26;
color: #2a58ad;
}
}
}
}
</style>
<!-- 门店产值 -->
<template>
<d2-container class="m-t-40">
<d2-container>
<div class="header"
slot="header"
style="padding-bottom: 20px;">
style="padding-bottom: 20px">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
......@@ -28,8 +28,7 @@
<!-- </div> -->
<div class="d2-container-content">
<d2-table-header>
<span>
<auth-button category="Button" /></span>
<span> <auth-button category="Button" /></span>
</d2-table-header>
<d2-table ref="recordTable"
:search-form="searchFormSearch"
......@@ -79,11 +78,14 @@ import { Util, deepClone } from "@/common/util"
// import inputRange from './components/inputRange'
// import invoiceCodeDetailDialog from "../../components/invoiceCodeDetailDialog"
// import QRCodeDetailDialog from "../../components/QRCodeDetailDialog"
import { invoicePage, batchCancelInvoiceQrcode } from "@api/invoiceManage"
import {
invoicePage,
batchCancelInvoiceQrcode
} from "@api/invoiceManage"
import { useStatusOpt, expireStatusOpt, createdSourceOpt, cancelStatusOpt, invoiceTypeOpt } from "@/common/constants.js"
useStatusOpt,
expireStatusOpt,
createdSourceOpt,
cancelStatusOpt,
invoiceTypeOpt
} from "@/common/constants.js"
export default {
name: "CourseList",
data() {
......@@ -104,10 +106,10 @@ export default {
searchFormSearch: {},
showFormData: [
{
label: '员工姓名',
name: 'itemNames',
type: 'input',
maxlength: '50',
label: "员工姓名",
name: "itemNames",
type: "input",
maxlength: "50",
isClear: true
},
{
......@@ -119,10 +121,10 @@ export default {
inputType: "number"
},
{
label: '任务名称',
name: 'itemNames',
type: 'input',
maxlength: '50',
label: "任务名称",
name: "itemNames",
type: "input",
maxlength: "50",
isClear: true
},
{
......@@ -136,10 +138,10 @@ export default {
optionsName: "useStatusOpt"
},
{
label: '门店名称',
name: 'itemNames',
type: 'input',
maxlength: '50',
label: "门店名称",
name: "itemNames",
type: "input",
maxlength: "50",
isClear: true
},
{
......@@ -153,25 +155,25 @@ export default {
optionsName: "useStatusOpt"
},
{
label: '课程配置时间',
name: 'createTime',
type: 'datePicker',
label: "课程配置时间",
name: "createTime",
type: "datePicker",
isClear: true,
pickerOptions: 'rangePickerOptions'
pickerOptions: "rangePickerOptions"
},
{
label: '课程结束时间',
name: 'createTime',
type: 'datePicker',
label: "课程结束时间",
name: "createTime",
type: "datePicker",
isClear: true,
pickerOptions: 'rangePickerOptions'
pickerOptions: "rangePickerOptions"
},
{
label: '课程完成时间',
name: 'createTime',
type: 'datePicker',
label: "课程完成时间",
name: "createTime",
type: "datePicker",
isClear: true,
pickerOptions: 'rangePickerOptions'
pickerOptions: "rangePickerOptions"
},
{
label: "任务状态",
......@@ -229,19 +231,23 @@ export default {
width: "300"
},
{
label: '归属业务',
prop: 'expireStatus',
width: '120px',
label: "归属业务",
prop: "expireStatus",
width: "120px",
formatter: (cellValue) => {
return this.baseData.expireStatusOpt.find(item => item.confId === cellValue.expireStatus)?.confValue
return this.baseData.expireStatusOpt.find(
(item) => item.confId === cellValue.expireStatus
)?.confValue
}
},
{
label: '主营品牌',
prop: 'expireStatus',
width: '120px',
label: "主营品牌",
prop: "expireStatus",
width: "120px",
formatter: (cellValue) => {
return this.baseData.expireStatusOpt.find(item => item.confId === cellValue.expireStatus)?.confValue
return this.baseData.expireStatusOpt.find(
(item) => item.confId === cellValue.expireStatus
)?.confValue
}
},
{
......@@ -265,16 +271,18 @@ export default {
width: "180"
},
{
label: '任务状态',
prop: 'useStatus',
width: '120px',
label: "任务状态",
prop: "useStatus",
width: "120px",
formatter: (cellValue) => {
return this.baseData.useStatusOpt.find(item => item.confId === cellValue.useStatus)?.confValue
return this.baseData.useStatusOpt.find(
(item) => item.confId === cellValue.useStatus
)?.confValue
},
className: (cellValue) => {
return {
N: 'redSpot',
Y: 'greenSpot'
N: "redSpot",
Y: "greenSpot"
}[cellValue.useStatus]
}
},
......@@ -289,11 +297,13 @@ export default {
width: "200"
},
{
label: '处罚状态',
prop: 'cancelStatus',
width: '100px',
label: "处罚状态",
prop: "cancelStatus",
width: "100px",
formatter: (cellValue) => {
return this.baseData.cancelStatusOpt.find(item => item.confId === cellValue.cancelStatus)?.confValue
return this.baseData.cancelStatusOpt.find(
(item) => item.confId === cellValue.cancelStatus
)?.confValue
}
},
{
......@@ -313,7 +323,6 @@ export default {
createdSourceOpt: deepClone(createdSourceOpt),
cancelStatusOpt: deepClone(cancelStatusOpt),
invoiceTypeOpt: deepClone(invoiceTypeOpt)
},
recordInfo: null,
detailVisible: false,
......@@ -351,15 +360,27 @@ export default {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.createTime) {
this.searchFormSearch.createdStartDate = Util.dateFormate(this.searchFormSearch.createTime[0], 'YYYY-MM-DD HH:mm:ss')
this.searchFormSearch.createdEndDate = Util.dateFormate(this.searchFormSearch.createTime[1], 'YYYY-MM-DD') + ' 23:59:59'
this.searchFormSearch.createdStartDate = Util.dateFormate(
this.searchFormSearch.createTime[0],
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.createdEndDate =
Util.dateFormate(
this.searchFormSearch.createTime[1],
"YYYY-MM-DD"
) + " 23:59:59"
} else {
delete this.searchFormSearch.createdStartDate
delete this.searchFormSearch.createdEndDate
}
if (this.searchFormSearch.invoiceAmount && this.searchFormSearch.invoiceAmount.length > 0) {
this.searchFormSearch.invoiceAmountMin = this.searchFormSearch.invoiceAmount[0]
this.searchFormSearch.invoiceAmountMax = this.searchFormSearch.invoiceAmount[1]
if (
this.searchFormSearch.invoiceAmount &&
this.searchFormSearch.invoiceAmount.length > 0
) {
this.searchFormSearch.invoiceAmountMin =
this.searchFormSearch.invoiceAmount[0]
this.searchFormSearch.invoiceAmountMax =
this.searchFormSearch.invoiceAmount[1]
} else {
delete this.searchFormSearch.invoiceAmountMin
delete this.searchFormSearch.invoiceAmountMax
......@@ -385,14 +406,23 @@ export default {
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
......@@ -416,8 +446,9 @@ export default {
return false
}
let _flag = true
selectedData.forEach(item => {
if (item.cancelStatus == 'Y' || item.useStatus == 'Y') { // 包含已作废或已使用的二维码
selectedData.forEach((item) => {
if (item.cancelStatus == "Y" || item.useStatus == "Y") {
// 包含已作废或已使用的二维码
_flag = false
}
})
......@@ -432,19 +463,21 @@ export default {
const qrcodeNos = selectedData.map((item) => {
return item.qrcodeNo
})
this.$confirm('请确认是否要执行当前操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
this.$confirm("请确认是否要执行当前操作?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
}).then(() => {
batchCancelInvoiceQrcode({ qrcodeNoList: qrcodeNos }).then(res => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
.then(() => {
batchCancelInvoiceQrcode({ qrcodeNoList: qrcodeNos }).then((res) => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
})
})
.catch((err) => {
console.log(err)
})
},
handleDetail(row) {
......@@ -471,23 +504,26 @@ export default {
var params = this.searchFormSearch
// 去除为null的值
for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) {
if (
params[key] === null ||
params[key] === "" ||
params[key].length == 0
) {
delete params[key]
}
}
params.method = 'dj.smartcarlife.api.vpt.invoiceIssueQrcode.export.async'
params.method = "dj.smartcarlife.api.vpt.invoiceIssueQrcode.export.async"
const list = [
...this.dowloadList,
{
name: '开票二维码',
name: "开票二维码",
exportParam: JSON.stringify(params),
status: 'waiting',
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
this.actionSetDownloadList({ list, type: "dowloadList" })
}
}
}
</script>
......
<template>
<div class="longCourse">
<div class="invoice-header">
<el-tabs v-model="activeName"
@tab-click="handleClick">
<el-tab-pane v-for="(item, index) in tabPaneList"
:label="item.label"
:name="item.name"
:key="index">
</el-tab-pane>
</el-tabs>
<components :is="tabName"
@handleChangeTab="handleChangeTab"></components>
<div class="layout">
<div class="tab" ref="tabbox">
<div
:class="['tab-item', { 'item-active': windowId == -1 }]"
@click="windowId = -1"
>
长课程配置
</div>
<div
:class="['tab-item', { 'item-active': windowId == -2 }]"
@click="windowId = -2"
>
已配置课程
</div>
<template v-for="(i, index) in tab">
<template>
<div
:key="i.id"
:class="['tab-item', { 'item-active': windowId == i.id }]"
@click="windowId = i.id"
:ref="`tab-${index}`"
>
{{ i.text }}
<div class="close" @click.stop="close(index)">
<i class="el-icon-close"></i>
</div>
</div>
</template>
</template>
<template v-if="dropdownList.length">
<div class="arrow-box">
<el-dropdown trigger="click" @command="windowId = $event">
<div class="dropdown-link">
<i class="el-icon-arrow-down"></i>
</div>
<el-dropdown-menu slot="dropdown">
<template v-for="(i, index) in dropdownList">
<el-dropdown-item
:class="{ 'dropdown-item-active': windowId == i.id }"
:key="i.id"
:command="i.id"
>
<div class="dropdown-item">
{{ i.text }}
<div class="close" @click.stop="closeDrop(index)">
<i class="el-icon-close"></i>
</div>
</div>
</el-dropdown-item>
</template>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</div>
<div class="content">
<configure-task
v-show="windowId == -1"
ref="configureTask"
@openWindow="openWindow"
/>
<courseList
v-show="windowId == -2"
ref="configureTask"
@openWindow="openWindow"
/>
<template v-for="i in [...tab, ...dropdownList]">
<component
:ref="`page-${i.id}`"
:key="i.id"
:is="i.component"
v-show="windowId == i.id"
:show="windowId == i.id"
:query-data="i.data"
@backIndex="backIndex"
/>
</template>
</div>
</div>
</template>
<script>
import courseList from "./courseList.vue"
<script type="text/ecmascript-6">
// import clockSalaryIndex from './components/clockSalaryIndex/index'
import configureTask from "./configureTask"
import courseList from "./courseList"
import storeInfo from './components/storeInfo.vue'
import indicatorInfo from './components/indicatorInfo.vue'
export default {
name: "LongCourse",
name: "",
components: {
courseList
configureTask,
courseList,
storeInfo,
indicatorInfo
},
data() {
data () {
return {
activeName: "1",
tabPaneList: [
{
label: "长课程配置任务",
name: "1"
},
{
label: "已配课程状态",
name: "2"
}
],
tabName: "configureTask"
tab: [],
dropdownList: [],
windowId: -1,
tabboxWidth: 0
}
},
mounted() {
if (this.$route.params.tabPane) {
this.activeName = this.$route.params.tabPane
this.tabName = this.$route.params.tabLabel
}
// 在beforeDestroy钩子中移除事件监听
beforeDestroy () {
window.removeEventListener('popstate', this.preventBack)
},
// 在你的Vue组件的mounted钩子中添加事件监听
mounted () {
history.pushState(null, null, document.URL)
window.addEventListener('popstate', this.preventBack)
if (this.tabboxWidth == 0) this.tabboxWidth = this.$refs.tabbox.offsetWidth
},
watch: {},
methods: {
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
preventBack () {
if (this.windowId !== -1) {
const [recep] = this.$refs[`page-${this.windowId}`]
if (recep && recep.isQualityVisible) recep.isQualityVisible = false
else this.windowId = -1
history.pushState(null, null, document.URL)
} else this.$router.go(-1)
},
handleClick() {
const arr = {
1: "configureTask",
2: "courseList"
openWindow (data) {
console.log(data)
const id = data.pageId ? data.pageId : `${data.staffName}_${data.phoneNumber}`
const windowList = [...this.tab, ...this.dropdownList]
const windowItem = windowList.find((e) => e.id == id)
let component = data.activeName,
title = data.staffName || '-'
if (data.componentName) component = data.componentName
if (data.title) title = data.title
if (windowItem) {
this.$refs[`page-${id}`]?.[0]?.setActiveName && this.$refs[`page-${id}`]?.[0]?.setActiveName(data)
return this.windowId = id
}
if (windowList.length == 20) return this.$message.error("最多同时打开20个tabs")
const item = {
text: title,
data,
id,
component
}
if (this.dropdownList.length) this.dropdownList.push(item)
else {
this.tab.push(item)
this.checkEl()
}
this.tabName = arr[+this.activeName]
this.windowId = id
},
handleChangeTab(e) {
if (!e) {
return true
close (index) {
this.tab.splice(index, 1)
if (this.dropdownList.length) {
this.tab.push(this.dropdownList[0])
this.closeDrop(0)
}
const { activeTab } = e
this.activeName = activeTab
this.handleClick()
this.windowId = -1
this.checkEl()
},
closeDrop (index) {
this.dropdownList.splice(index, 1)
},
checkEl () {
const { tab, tabboxWidth } = this
const len = tab.length - 1
this.$nextTick(() => {
const [el] = this.$refs[`tab-${len}`]
if (el) {
const { offsetWidth, offsetLeft } = el
if (offsetLeft + offsetWidth / 2 > tabboxWidth - 54) {
this.dropdownList.push(tab[len])
this.tab.splice(len, 1)
}
}
})
},
backIndex () {
this.windowId = -1
this.$refs['inStoreManageIndex']?.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.longCourse {
padding: 0 20px;
.invoice-header {
::v-deep .el-tabs__header {
margin: 0;
<style scoped lang="scss">
.layout {
height: 100%;
.tab {
display: flex;
align-items: center;
margin-left: 20px;
width: calc(100% - 54px);
box-sizing: border-box;
&-item {
width: fit-content;
height: 40px;
padding: 0 20px;
background: #fafafa;
border-radius: 4px 4px 0 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #666666;
cursor: pointer;
line-height: 40px;
margin-right: 1px;
flex-shrink: 0;
.close {
border-radius: 100%;
padding: 4px;
margin-left: 4px;
display: flex;
align-items: center;
justify-content: center;
&:hover {
background-color: #666;
.el-icon-close {
color: #fff;
}
}
}
.el-icon-close {
font-size: 12px;
display: flex;
align-items: center;
justify-content: center;
color: #666666;
transform: translateY(1px);
}
}
.item-active {
font-weight: 500;
color: #2a58ad;
background: #ffffff;
}
.arrow-box {
width: 32px;
height: 40px;
line-height: 40px;
text-align: center;
background: #fafafa;
cursor: pointer;
flex-shrink: 0;
.el-dropdown {
width: 100%;
}
}
}
.content {
position: relative;
width: 100%;
height: calc(100% - 40px);
// overflow-y: scroll;
box-sizing: border-box;
// padding-bottom: 70px;
}
}
::v-deep.dropdown-item {
display: flex;
align-items: center;
justify-content: center;
.close {
border-radius: 100%;
padding: 4px;
margin-left: 4px;
display: flex;
align-items: center;
justify-content: center;
&:hover {
background-color: #666;
.el-icon-close {
color: #fff;
}
}
i {
margin-right: 0;
}
}
.el-icon-close {
font-size: 12px;
color: #666666;
}
}
.dropdown-item-active {
background-color: #eaeef7;
color: #5579bd;
}
</style>
<template>
<div class="longCourse">
<div class="invoice-header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="(item, index) in tabPaneList"
:label="item.label"
:name="item.name"
:key="index"
>
</el-tab-pane>
</el-tabs>
<components :is="tabName" @handleChangeTab="handleChangeTab"></components>
</div>
</div>
</template>
<script>
import courseList from "./courseList.vue"
import configureTask from "./configureTask.vue"
export default {
name: "LongCourse",
components: {
courseList,
configureTask
},
data() {
return {
activeName: "1",
tabPaneList: [
{
label: "长课程配置任务",
name: "1"
},
{
label: "已配课程状态",
name: "2"
}
],
tabName: "configureTask"
}
},
mounted() {
if (this.$route.params.tabPane) {
this.activeName = this.$route.params.tabPane
this.tabName = this.$route.params.tabLabel
}
},
watch: {},
methods: {
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
},
handleClick() {
const arr = {
1: "configureTask",
2: "courseList"
}
this.tabName = arr[+this.activeName]
},
handleChangeTab(e) {
if (!e) {
return true
}
const { activeTab } = e
this.activeName = activeTab
this.handleClick()
}
}
}
</script>
<style lang="scss" scoped>
.longCourse {
padding: 0 20px;
.invoice-header {
::v-deep .el-tabs {
background: #fff;
}
::v-deep .el-tabs__header {
margin: 0;
padding: 0 20px;
}
}
}
</style>
<!-- 短课程配课 -->
<template>
<div class="short-dialog">
<baseDialog
:dialog-config="dialogConfig"
:is-show.sync="visible"
class="accountDailog"
@handleClick="handleConfirm"
@closeDialog="handleClose"
>
<div class="dialog-content">
<el-form :model="form" :rules="rules" ref="formRef">
<el-form-item label="开启课程:" label-width="100px">
<el-switch v-model="form.isOpen"></el-switch>
</el-form-item>
<h4 class="group-title">学习条件</h4>
<div class="rule-item">
<el-form-item label="本周门店渗透率 <">
<el-input
v-model="form.performanceSalarDeductionRatio"
placeholder="请输入"
style="width: 80px"
>
<template slot="append">%</template>
</el-input>
</el-form-item>
<el-form-item label=",且驻店人员上月渗透率 ≤">
<el-input
v-model="form.performanceSalarDeductionRatio"
placeholder="请输入"
style="width: 80px"
>
<template slot="append">%</template>
</el-input>
</el-form-item>
</div>
<div class="rule-item">
<el-form-item label="本周驻店接待记录为战败,且质检分低于">
<el-input
v-model="form.minAssessmentValue"
placeholder="请输入"
style="width: 80px"
></el-input>
</el-form-item>
<el-form-item label="分时,开展为期">
<el-input
v-model="form.maxAssessmentValue"
placeholder="请输入"
style="width: 80px"
></el-input>
<span class="unit-text">天短课程学习</span>
</el-form-item>
</div>
<h4 class="group-title">学习要求</h4>
<div class="rule-item">
<el-form-item label="短课程学习需要在课程发布后">
<el-input
v-model="form.performanceSalarDeductionRatio"
placeholder="请输入"
style="width: 80px"
>
</el-input>
<span class="unit-text">小时内完成</span>
</el-form-item>
</div>
<div class="rule-item">
<el-form-item label="如果在限时内未完成则">
<el-select v-model="form.value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</div>
<h4 class="生效时间">学习要求</h4>
<div class="rule-item">
<el-form-item label="生效时间为">
<el-select v-model="form.value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</div>
</el-form>
</div>
</baseDialog>
</div>
</template>
<script>
export default {
data() {
return {
dialogConfig: {
title: "短课程配课",
width: "720px"
},
form: {
isOpen: true
},
options: [
{
value: "选项1",
label: "黄金糕"
},
{
value: "选项2",
label: "双皮奶"
},
{
value: "选项3",
label: "蚵仔煎"
},
{
value: "选项4",
label: "龙须面"
},
{
value: "选项5",
label: "北京烤鸭"
}
],
rules: {}
}
},
methods: {
handleClose() {
this.visible = false
},
handleConfirm() {
this.visible = false
}
},
props: {
shortVisible: {
type: Boolean,
default: false
}
},
computed: {
visible: {
get() {
return this.shortVisible
},
set(newVal) {
this.$emit("dialogClose", {
flag: newVal,
attrName: "shortVisible"
})
}
}
}
}
</script>
<style scoped lang="scss">
.short-dialog {
::v-deep .el-dialog__headerbtn .el-dialog__close {
color: #333333;
font-weight: 600;
font-size: 20px;
}
::v-deep .el-form-item__label {
color: #333333;
}
::v-deep .el-form-item__content {
display: flex;
}
::v-deep .el-divider--horizontal {
margin: 16px 0;
}
::v-deep .el-switch {
margin-top: 8px;
}
.group-title {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 10px 0;
border-bottom: 1px solid #e5e5e5;
}
.rule-item {
display: flex;
align-items: center;
}
.unit-text {
margin-left: 4px;
}
}
</style>
<!-- 查看 -->
<template>
<div class="detail-dialog">
<baseDialog
:dialog-config="dialogConfig"
:is-show.sync="visible"
@handleClick="handleConfirm"
@closeDialog="handleClose"
>
<div class="item" v-for="(detail, index) in configData" :key="index">
<div class="title">{{ detail.title }}</div>
<div class="detail-content">
<div
class="form_div"
v-if="detail.infoData && detail.infoData.length"
>
<el-form class="edit-sub-block" label-width="110px" :inline="true">
<el-row :gutter="20">
<template v-for="(item, key) in detail.infoData">
<el-col :span="item.col ? item.col : 12" :key="key">
<el-form-item :label="item.title">
<div
v-if="item.className"
:class="[item.className(detailInfo)]"
></div>
{{
item.formatter
? item.formatter(detailInfo)
: detailInfo[item.key]
? detailInfo[item.key]
: "-"
}}
</el-form-item></el-col
>
</template>
</el-row>
</el-form>
</div>
<div v-else style="margin-top: 20px">
<d2-table
ref="recordTable"
:table-params="detail.tableParams"
:tableData="detail.tableData"
:hasPage="false"
>
</d2-table>
</div>
</div>
</div>
</baseDialog>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
export default {
data() {
return {
dialogConfig: {
title: "任务详情",
width: "720px"
},
detailInfo: {
tableData: []
},
configData: [
{
title: "个人信息",
infoData: [
{
title: "姓名:",
key: "employeeName",
formatter(cellValue) {
return cellValue.employeeName
}
},
{
title: "门店:",
key: "merchantName"
},
{
title: "上级:",
key: "fileUrl"
},
{
title: "导师:",
key: "carModel"
}
]
},
{
title: "任务信息",
infoData: [
{
title: "复盘日期:",
formatter: (cellValue) => {
return cellValue.startTime
? Util.dateFormate(cellValue.startTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
},
{
title: "任务状态:",
key: "violationStatus",
formatter: (cellValue) => {
return {
1: "疑似违规",
2: "已违规",
0: "未违规"
}[cellValue.violationStatus]
}
},
{
title: "课程完成时间:",
formatter: (cellValue) => {
return cellValue.endTime
? Util.dateFormate(cellValue.endTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
},
{
title: "课程结束时间:",
formatter: (cellValue) => {
return cellValue.endTime
? Util.dateFormate(cellValue.endTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
}
]
},
{
title: "课程列表",
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: "课程名称",
prop: "invoiceAmount"
},
{
label: "学习时长",
prop: "invoiceAmount"
},
{
label: "学习进度",
prop: "useStatus",
formatter: (cellValue) => {
return this.baseData.useStatusOpt.find(
(item) => item.confId === cellValue.useStatus
)?.confValue
},
className: (cellValue) => {
return {
N: "redSpot",
Y: "greenSpot"
}[cellValue.useStatus]
}
},
{
label: "成绩",
prop: "penalty "
},
{
label: "完成时间",
prop: "tradeNo",
width: "200",
formatter: (cellValue) => {
return cellValue.createdDate
? Util.dateFormate(
cellValue.createdDate,
"YYYY-MM-DD HH:mm:ss"
)
: ""
}
}
]
}
}
]
}
},
props: {
shortVisible: {
type: Boolean,
default: false
}
},
computed: {
visible: {
get() {
return this.shortVisible
},
set(newVal) {
this.$emit("dialogClose", {
flag: newVal,
attrName: "shortVisible"
})
}
}
},
methods: {
handleClose() {
this.visible = false
},
handleConfirm() {
this.visible = false
}
}
}
</script>
<style scoped lang="scss">
.detail-dialog {
.item {
margin-bottom: 20px;
.title {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 10px 0;
border-bottom: 1px solid #e5e5e5;
}
.form_div {
color: #333333;
padding: 20px 30px;
.edit-sub-block {
.el-form-item {
width: 100%;
margin-bottom: 0px;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
}
.edit-sub-block-two {
.el-form-item {
margin-bottom: 0px;
}
}
}
}
}
</style>
<!-- 短课程 -->
<template>
<d2-container>
<div class="header" slot="header" style="padding-bottom: 20px">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
label-width="120px"
>
<div slot="invoiceAmountHtml">
<!-- <input-range start-placeholder="最小金额"
end-placeholder="最大金额"
:display-value="searchForm.invoiceAmount"></input-range> -->
</div>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<!-- </div> -->
<div class="d2-container-content">
<d2-table-header title="驻店学习记录">
<el-button size="small" type="primary" @click="handleAllocation">
短课程配课
</el-button>
</d2-table-header>
<d2-table
ref="recordTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
>
<div slot="store" slot-scope="scope">
<template
v-if="scope.scope.storeList && scope.scope.storeList.length > 1"
>
<span>{{ scope.scope.storeList.slice(0, 1).join("") }}</span>
<el-popover placement="top" width="fit-content" trigger="hover">
<div
:class="{ scrollHeight: scope.scope.storeList.length >= 10 }"
>
<div
v-for="(item, index) in scope.scope.storeList"
:key="index"
>
{{ item }}
</div>
</div>
<span class="more-info" slot="reference"
>...({{ scope.scope.storeList.length }})</span
>
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.storeList || !scope.scope.storeList.length"
>--</span
>
<span v-else>{{ scope.scope.storeList.join("") }}</span>
</template>
</div>
<div slot="penalty" slot-scope="scope">
<el-switch
:value="scope.scope.dailyReport"
active-value="启用"
inactive-value="停用"
@change="handlePenalty(scope.scope)"
></el-switch>
</div>
<div slot="auth-button" slot-scope="scope">
<!-- 查看 -->
<span style="margin-right: 10px">
<el-button size="small" type="text" @click="handleDetail">
查看
</el-button>
</span>
<!-- 启停 -->
<!-- <span style="margin-right: 10px"
v-if="scope.scope.invoiceQrCode">
<auth-button :data="scope.scope"
:show-btn-ids="['9190102']" />
</span> -->
</div>
</d2-table>
</div>
<!-- 详情 -->
<shortDetailDialog
:shortVisible.sync="detailVisible"
v-if="detailVisible"
:params-obj="recordInfo"
@dialogClose="closeDetailDialog"
/>
<!-- 短课程配课 -->
<short-allocation
:shortVisible="shortVisible"
v-if="shortVisible"
@dialogClose="handleShortCloseDialog"
></short-allocation>
</d2-container>
</template>
<script>
import { mapActions, mapState } from "vuex"
import { Util, deepClone } from "@/common/util"
import shortAllocation from "./components/shortAllocation"
import shortDetailDialog from "./components/shortDetailDialog"
import { invoicePage, batchCancelInvoiceQrcode } from "@api/invoiceManage"
import {
useStatusOpt,
expireStatusOpt,
createdSourceOpt,
cancelStatusOpt,
invoiceTypeOpt
} from "@/common/constants.js"
export default {
name: "CourseList",
data() {
return {
shortVisible: false,
searchForm: {
createTime: "",
useStatus: "",
expireStatus: "",
itemNames: "",
createdSource: "",
cancelStatus: "",
bizOrderCode: "",
bizTradeNo: "",
tradeNo: "",
invoiceType: "",
invoiceAmount: []
},
searchFormSearch: {},
showFormData: [
{
label: "员工姓名",
name: "itemNames",
type: "input",
maxlength: "50",
isClear: true
},
{
label: "手机号码",
name: "staffPhone",
type: "input",
isClear: true,
maxlength: 11,
inputType: "number"
},
{
label: "归属业务",
name: "useStatus",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "useStatusOpt"
},
{
label: "主营品牌",
name: "useStatus",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "useStatusOpt"
},
{
label: "门店名称",
name: "itemNames",
type: "input",
maxlength: "50",
isClear: true
},
{
label: "处罚方式",
name: "useStatus",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "useStatusOpt"
},
{
label: "完成情况",
name: "useStatus",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "useStatusOpt"
},
{
label: "复盘时间",
name: "createTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
},
{
label: "完成时间",
name: "createTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
}
],
getListApi: invoicePage,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
// mutiSelectUniqueKey: 'id',
// mutiSelectName: 'invoiceCode',
listName: "list",
tableOption: { width: "150px" },
tableColumns: [
{
label: "员工姓名",
prop: "invoiceAmount",
width: "150"
},
{
label: "手机号码",
prop: "invoiceAmount",
width: "150"
},
{
label: "门店名称",
addHtml: "store",
width: "300"
},
{
label: "归属业务",
prop: "expireStatus",
width: "120px",
formatter: (cellValue) => {
return this.baseData.expireStatusOpt.find(
(item) => item.confId === cellValue.expireStatus
)?.confValue
}
},
{
label: "主营品牌",
prop: "expireStatus",
width: "120px",
formatter: (cellValue) => {
return this.baseData.expireStatusOpt.find(
(item) => item.confId === cellValue.expireStatus
)?.confValue
}
},
{
label: "学习标签",
prop: "itemNames",
width: "300"
},
{
label: "复盘日期",
prop: "createdDate",
width: "180"
},
{
label: "战败数量",
prop: "createdDate",
width: "180"
},
{
label: "课程结束时间",
prop: "createdDate",
width: "180",
formatter: (cellValue) => {
return cellValue.createdDate
? Util.dateFormate(cellValue.createdDate, "YYYY-MM-DD HH:mm:ss")
: ""
}
},
{
label: "完成情况",
prop: "useStatus",
width: "120px",
formatter: (cellValue) => {
return this.baseData.useStatusOpt.find(
(item) => item.confId === cellValue.useStatus
)?.confValue
},
className: (cellValue) => {
return {
N: "redSpot",
Y: "greenSpot"
}[cellValue.useStatus]
}
},
{
label: "完成时间",
prop: "tradeNo",
width: "200",
formatter: (cellValue) => {
return cellValue.createdDate
? Util.dateFormate(cellValue.createdDate, "YYYY-MM-DD HH:mm:ss")
: ""
}
},
{
label: "处罚方式",
prop: "cancelStatus",
width: "100px",
formatter: (cellValue) => {
return this.baseData.cancelStatusOpt.find(
(item) => item.confId === cellValue.cancelStatus
)?.confValue
}
},
{
label: "处罚状态",
prop: "useStatus",
width: "120px",
formatter: (cellValue) => {
return this.baseData.useStatusOpt.find(
(item) => item.confId === cellValue.useStatus
)?.confValue
},
className: (cellValue) => {
return {
N: "redSpot",
Y: "greenSpot"
}[cellValue.useStatus]
}
},
{
label: "处罚启停",
prop: "penalty ",
addHtml: "penalty"
}
]
},
baseData: {
useStatusOpt: deepClone(useStatusOpt),
expireStatusOpt: deepClone(expireStatusOpt),
createdSourceOpt: deepClone(createdSourceOpt),
cancelStatusOpt: deepClone(cancelStatusOpt),
invoiceTypeOpt: deepClone(invoiceTypeOpt)
},
recordInfo: null,
detailVisible: false
}
},
components: {
shortAllocation,
shortDetailDialog
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList
})
},
mounted() {
this.getBaseData()
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close"
}),
...mapActions("d2admin/user", ["actionSetDownloadList"]),
async getBaseData() {
this.getOptionsList()
},
//短课程配课
handleAllocation() {
this.shortVisible = true
},
//关闭
handleShortCloseDialog() {
this.shortVisible = false
},
handlePenalty() {
this.$confirm(
"切换日报填写开关会影响驻店是否需要填日报才能提单!",
"提示",
{
confirmButtonText: "确定",
type: "warning"
}
)
.then(() => {
// verification({ orderCode: row.orderCode }).then((res) => {
// this.notice.okTips()
// this.handleSearch()
// })
})
.catch(() => {})
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.createTime) {
this.searchFormSearch.createdStartDate = Util.dateFormate(
this.searchFormSearch.createTime[0],
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.createdEndDate =
Util.dateFormate(
this.searchFormSearch.createTime[1],
"YYYY-MM-DD"
) + " 23:59:59"
} else {
delete this.searchFormSearch.createdStartDate
delete this.searchFormSearch.createdEndDate
}
if (
this.searchFormSearch.invoiceAmount &&
this.searchFormSearch.invoiceAmount.length > 0
) {
this.searchFormSearch.invoiceAmountMin =
this.searchFormSearch.invoiceAmount[0]
this.searchFormSearch.invoiceAmountMax =
this.searchFormSearch.invoiceAmount[1]
} else {
delete this.searchFormSearch.invoiceAmountMin
delete this.searchFormSearch.invoiceAmountMax
}
resolve()
})
},
handleReset() {
this.searchForm = {
createTime: "",
useStatus: "",
expireStatus: "",
itemNames: "",
createdSource: "",
cancelStatus: "",
bizOrderCode: "",
bizTradeNo: "",
tradeNo: "",
invoiceType: "",
invoiceAmount: []
}
this.$refs.recordTable.refreshTable()
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
// 批量作废
handleCancel() {
var selectedData = []
if (this.$refs.recordTable.mutiSelectArr.invoiceCode) {
selectedData = this.$refs.recordTable.mutiSelectArr.invoiceCode
}
this.handleCancel_commit(selectedData)
},
handleCancel_commit(selectedData) {
if (!selectedData?.length) {
this.$message({
message: "请选择要作废的二维码",
type: "warning",
showClose: true
})
return false
}
let _flag = true
selectedData.forEach((item) => {
if (item.cancelStatus == "Y" || item.useStatus == "Y") {
// 包含已作废或已使用的二维码
_flag = false
}
})
if (!_flag) {
this.$message({
message: "包含已作废或已使用的二维码,请重新选择",
type: "warning",
showClose: true
})
return
}
const qrcodeNos = selectedData.map((item) => {
return item.qrcodeNo
})
this.$confirm("请确认是否要执行当前操作?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
})
.then(() => {
batchCancelInvoiceQrcode({ qrcodeNoList: qrcodeNos }).then((res) => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
})
})
.catch((err) => {
console.log(err)
})
},
handleDetail(row) {
// this.recordInfo = row
this.detailVisible = true
},
closeDetailDialog() {
this.detailVisible = !this.detailVisible
this.$refs.recordTable.refreshTable(false, true)
},
handleQRCode(row) {
this.recordInfo = row
this.QRdetailVisible = true
},
closeQRDetailDialog() {
this.QRdetailVisible = !this.QRdetailVisible
this.$refs.recordTable.refreshTable(false, true)
},
handleExport() {
var params = this.searchFormSearch
// 去除为null的值
for (const key in params) {
if (
params[key] === null ||
params[key] === "" ||
params[key].length == 0
) {
delete params[key]
}
}
params.method = "dj.smartcarlife.api.vpt.invoiceIssueQrcode.export.async"
const list = [
...this.dowloadList,
{
name: "开票二维码",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
}
}
}
</script>
<style lang="scss" scoped>
.m-t-40 {
margin-top: 40px;
}
@mixin typeBase {
width: 52px;
border-radius: 239px;
opacity: 1;
font-size: 14px;
text-align: center;
line-height: 24px;
display: inline-block;
}
.type-yellow {
@include typeBase();
background: #ff8d1a1a;
color: #ff8d1a;
}
.type-blue {
@include typeBase();
background: #5850ff1a;
color: #5850ff;
}
.type-green {
@include typeBase();
background: #43cf7c1a;
color: #43cf7c;
}
.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;
}
</style>
......@@ -4,7 +4,13 @@
<!-- <div> -->
<d2-container class="m-t-40">
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" label-width="120px" :search-form="searchForm" :form-data="showFormData" />
<d2-search
ref="showSearch"
class="show-search"
label-width="120px"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
......@@ -13,53 +19,154 @@
</div>
</div>
<div class="d2-container-content">
<div style="text-align: right;">
<auth-button category="Button" :show-btn-ids="['9061901', '9061902', '9061911']" />
<span style="margin-right: 10px;"></span>
<auth-button category="Button" :show-btn-ids="['9061934']" :data="{ 'batchActive': 'area'}" />
<span style="margin-right: 10px;"></span>
<auth-button category="Button" :show-btn-ids="['9061935']" :data="{ 'batchActive': 'busiScene'}" />
<span style="margin-right: 10px;"></span>
<auth-button category="Button" :show-btn-ids="['9061936']" :data="{ 'batchActive': 'online'}" />
<div style="text-align: right">
<auth-button
category="Button"
:show-btn-ids="['9061901', '9061902', '9061911']"
/>
<span style="margin-right: 10px"></span>
<auth-button
category="Button"
:show-btn-ids="['9061934']"
:data="{ batchActive: 'area' }"
/>
<span style="margin-right: 10px"></span>
<auth-button
category="Button"
:show-btn-ids="['9061935']"
:data="{ batchActive: 'busiScene' }"
/>
<span style="margin-right: 10px"></span>
<auth-button
category="Button"
:show-btn-ids="['9061936']"
:data="{ batchActive: 'online' }"
/>
</div>
<d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn">
<d2-table
ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<!-- 以下的自定义表格展示,以“业务类型”为基准展示 -->
<template slot="businessType" slot-scope="scope" slot-columnsItem="columnsItem">
<template v-if="scope.scope.businessTypeList && scope.scope.businessTypeList.length">
<template
slot="businessType"
slot-scope="scope"
slot-columnsItem="columnsItem"
>
<template
v-if="
scope.scope.businessTypeList &&
scope.scope.businessTypeList.length
"
>
<template v-for="(k, kIdx) in scope.scope.businessTypeList">
<div class="tb-row" v-if="k.businessSceneType != null" :key="kIdx">
<div v-if="['areaSupervisionList', 'onlineSupervisionList'].includes(scope.columnsObj.prop)">
<el-tooltip class="item" effect="dark" :content="scope.columnsObj.formatter(scope.scope, kIdx)" placement="top">
<div
class="tb-row"
v-if="k.businessSceneType != null"
:key="kIdx"
>
<div
v-if="
['areaSupervisionList', 'onlineSupervisionList'].includes(
scope.columnsObj.prop
)
"
>
<el-tooltip
class="item"
effect="dark"
:content="scope.columnsObj.formatter(scope.scope, kIdx)"
placement="top"
>
<span class="ellipsis-txt">
{{scope.columnsObj.formatter(scope.scope, kIdx)}}
{{ scope.columnsObj.formatter(scope.scope, kIdx) }}
</span>
</el-tooltip>
</div>
<span v-else>{{scope.columnsObj.formatter(scope.scope, kIdx)}}</span>
<span v-else>{{
scope.columnsObj.formatter(scope.scope, kIdx)
}}</span>
</div>
</template>
<div v-if="scope.scope.businessTypeList.every(k => k.businessSceneType === null)">-</div>
<div
v-if="
scope.scope.businessTypeList.every(
(k) => k.businessSceneType === null
)
"
>
-
</div>
</template>
<div v-else>-</div>
</template>
<template v-for="(m, mIdx) in tableSlotList" :slot="m" slot-scope="scope">
<div v-if="scope.scope.businessTypeList && scope.scope.businessTypeList.length" :key="mIdx">
<template
v-for="(m, mIdx) in tableSlotList"
:slot="m"
slot-scope="scope"
>
<div
v-if="
scope.scope.businessTypeList &&
scope.scope.businessTypeList.length
"
:key="mIdx"
>
<template v-for="(k, kIdx) in scope.scope.businessTypeList">
<div class="tb-row" v-if="k.businessSceneType != null" :key="kIdx">
<div v-if="['areaSupervisionList', 'onlineSupervisionList'].includes(scope.columnsObj.prop)">
<el-tooltip class="item" effect="dark" :content="scope.columnsObj.formatter(scope.scope, kIdx)" placement="top">
<div
class="tb-row"
v-if="k.businessSceneType != null"
:key="kIdx"
>
<div
v-if="
['areaSupervisionList', 'onlineSupervisionList'].includes(
scope.columnsObj.prop
)
"
>
<el-tooltip
class="item"
effect="dark"
:content="scope.columnsObj.formatter(scope.scope, kIdx)"
placement="top"
>
<span class="ellipsis-txt">
{{scope.columnsObj.formatter(scope.scope, kIdx)}}
{{ scope.columnsObj.formatter(scope.scope, kIdx) }}
</span>
</el-tooltip>
</div>
<span v-else>{{scope.columnsObj.formatter(scope.scope, kIdx)}}</span>
<span v-else>{{
scope.columnsObj.formatter(scope.scope, kIdx)
}}</span>
</div>
</template>
<div v-if="scope.scope.businessTypeList.every(k => k.businessSceneType === null)">-</div>
<div
v-if="
scope.scope.businessTypeList.every(
(k) => k.businessSceneType === null
)
"
>
-
</div>
</div>
</template>
<auth-button slot="auth-button" slot-scope="scope" :show-btn-ids="[
<template slot="dailyReport" slot-scope="scope">
<el-switch
:value="scope.scope.dailyReport"
active-value="Y"
inactive-value="N"
@change="handleDailyReport(scope.scope)"
></el-switch>
</template>
<auth-button
slot="auth-button"
slot-scope="scope"
:show-btn-ids="[
'9061903',
'9061904',
'9061906',
......@@ -68,14 +175,27 @@
'9061912',
'9061914',
'9061927'
]" :data="scope.scope" />
]"
:data="scope.scope"
/>
</d2-table>
</div>
<!-- 导入门店设置 -->
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleImport" @confirmDialog="handleConfirmImport" width="600px">
<d2-dialog
:title="'上传文件'"
:is-visible="fileVisible"
@closeDialog="handleImport"
@confirmDialog="handleConfirmImport"
width="600px"
>
<slot>
<div>
<el-form :model="fileForm" :rules="fileRules" ref="fileRuleForm" label-width="120px">
<el-form
:model="fileForm"
:rules="fileRules"
ref="fileRuleForm"
label-width="120px"
>
<el-form-item label="导入文件:" prop="fileName">
<el-col :span="16">
<el-input readonly v-model="fileForm.fileName" />
......@@ -83,8 +203,19 @@
<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" @click="downLoadTemplate" icon="el-icon-link">
<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"
@click="downLoadTemplate"
icon="el-icon-link"
>
文件下载
</el-link>
</el-button>
......@@ -113,22 +244,78 @@
</d2-dialog>
<!-- 收款码 -->
<qrcode-dialog :q-rcode-visible="qRcodeVisible" :info="recordInfo" v-if="qRcodeVisible" @dialogClose="dialogClose" />
<employee-dialog :employee-visible="employeeVisible" :info="recordInfo" v-if="employeeVisible" @dialogClose="employeeDialogClose" />
<qrcode-dialog
:q-rcode-visible="qRcodeVisible"
:info="recordInfo"
v-if="qRcodeVisible"
@dialogClose="dialogClose"
/>
<employee-dialog
:employee-visible="employeeVisible"
:info="recordInfo"
v-if="employeeVisible"
@dialogClose="employeeDialogClose"
/>
<!-- 门店标签 -->
<flag-dialog :flag-visible="flagVisible" :info="recordInfo" v-if="flagVisible" @dialogClose="flagDialogClose" />
<d2-dialog title="阳光激励配置" mode="mid" v-if="signVisible" :is-visible="signVisible" @closeDialog="handleSignClose" @confirmDialog="handleConfirmSign">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="220px" :form-obj="integralForm" :form-data="integralFormData">
<flag-dialog
:flag-visible="flagVisible"
:info="recordInfo"
v-if="flagVisible"
@dialogClose="flagDialogClose"
/>
<d2-dialog
title="阳光激励配置"
mode="mid"
v-if="signVisible"
:is-visible="signVisible"
@closeDialog="handleSignClose"
@confirmDialog="handleConfirmSign"
>
<glsx-combi-form
class="edit-form-container"
ref="editFormRef"
label-width="220px"
:form-obj="integralForm"
:form-data="integralFormData"
>
</glsx-combi-form>
</d2-dialog>
<!-- 预警设置 -->
<warning-set :warning-visible="warningVisible" :info="recordInfo" @closeWarnDialog="closeWarnDialog" @confirmWarnDialog="confirmWarnDialog"></warning-set>
<warning-set
:warning-visible="warningVisible"
:info="recordInfo"
@closeWarnDialog="closeWarnDialog"
@confirmWarnDialog="confirmWarnDialog"
></warning-set>
<!-- 批量设置 -->
<d2-dialog :title="batchSetObj[batchSetActive].title" mode="mid" v-if="batchVisible" :is-visible="batchVisible" @closeDialog="handleBatchClose" @confirmDialog="handleConfirmBatch">
<glsx-combi-form class="edit-form-container" ref="editFormSetRef" label-width="220px" :form-ref="editChildRef" :form-obj="batchForm" :form-data="batchFormData" :form-rules="batchRules">
<d2-dialog
:title="batchSetObj[batchSetActive].title"
mode="mid"
v-if="batchVisible"
:is-visible="batchVisible"
@closeDialog="handleBatchClose"
@confirmDialog="handleConfirmBatch"
>
<glsx-combi-form
class="edit-form-container"
ref="editFormSetRef"
label-width="220px"
:form-ref="editChildRef"
:form-obj="batchForm"
:form-data="batchFormData"
:form-rules="batchRules"
>
<template slot="businessDevelopmentScene">
<el-checkbox-group v-model="batchForm.businessDevelopmentScene" @change="changeBusiScene">
<el-checkbox v-for="item in baseData.busiSceneList" :key="item.confId" :label="item.confId">{{item.confValue}}</el-checkbox>
<el-checkbox-group
v-model="batchForm.businessDevelopmentScene"
@change="changeBusiScene"
>
<el-checkbox
v-for="item in baseData.busiSceneList"
:key="item.confId"
:label="item.confId"
>{{ item.confValue }}</el-checkbox
>
</el-checkbox-group>
</template>
</glsx-combi-form>
......@@ -193,12 +380,12 @@ export default {
shopLabelFlag: "",
brandIdList: [],
createdDate: [],
businessSceneType: '',
directSalesFlag: '',
businessDevelopmentScene: '',
businessSceneType: "",
directSalesFlag: "",
businessDevelopmentScene: "",
businessDevTime: [],
serviceMerchantId: '',
onlineSupervision: ''
serviceMerchantId: "",
onlineSupervision: ""
},
searchFormSearch: {},
showFormData: [
......@@ -212,12 +399,16 @@ export default {
optionLabel: "name",
optionsName: "provinceInfoList",
changeAttr: (value, targetItem) => {
this.searchForm.cityId = ''
this.searchForm.cityId = ""
this.baseData.cityList = []
this.getOptionsList()
if (value) {
const params = { districtName: this.baseData.provinceInfoList.find(item => item.code == value).name }
getDistrictDetail(params).then(res => {
const params = {
districtName: this.baseData.provinceInfoList.find(
(item) => item.code == value
).name
}
getDistrictDetail(params).then((res) => {
if (res && res.length) {
this.baseData.cityList = res[0].districts
this.getOptionsList()
......@@ -262,7 +453,7 @@ export default {
optionId: "id",
optionLabel: "label",
optionsName: "brandList",
changeAttr: (value, targetItem) => { }
changeAttr: (value, targetItem) => {}
},
{
label: "门店标签",
......@@ -273,12 +464,13 @@ export default {
optionId: "confId",
optionLabel: "confValue",
optionsName: "shopLabelFlagList"
}, {
label: '创建日期',
name: 'createdDate',
type: 'datePicker',
},
{
label: "创建日期",
name: "createdDate",
type: "datePicker",
isClear: true,
pickerOptions: 'rangePickerOptions'
pickerOptions: "rangePickerOptions"
},
{
label: "业务类型",
......@@ -320,7 +512,7 @@ export default {
label: "展业日期",
name: "businessDevTime",
type: "datePicker",
isClear: true,
isClear: true
// pickerOptions: "rangePickerOptions"
},
{
......@@ -346,7 +538,7 @@ export default {
type: "input",
maxlength: "20",
isClear: true
},
}
],
getListApi: shopSettingList,
tableParams: {
......@@ -389,9 +581,11 @@ export default {
label: "业务性质",
prop: "businessType",
formatter: (cellValue) => {
return this.baseData.businessNature.find(
(item) => item.confId === cellValue.businessType
)?.confName || '-'
return (
this.baseData.businessNature.find(
(item) => item.confId === cellValue.businessType
)?.confName || "-"
)
}
},
{
......@@ -412,6 +606,11 @@ export default {
width: "150px"
},
{
label: "日报填写",
prop: "dailyReport",
addHtml: "dailyReport"
},
{
label: "下级商户",
prop: "list",
width: "200",
......@@ -425,7 +624,7 @@ export default {
})
html = list.join("<br>")
} else {
list.push('-')
list.push("-")
html = list.join("<br>")
}
return html
......@@ -445,69 +644,88 @@ export default {
label: "业务类型",
prop: "businessTypeList",
width: "200px",
addHtml: 'businessType',
addHtml: "businessType",
formatter: (cellValue, idx) => {
const list = this.removeListAll('busiTypeList')
const target = list.find(item => item.confId == cellValue.businessTypeList[idx].businessSceneType + '')
return target ? target.confValue : '-'
const list = this.removeListAll("busiTypeList")
const target = list.find(
(item) =>
item.confId ==
cellValue.businessTypeList[idx].businessSceneType + ""
)
return target ? target.confValue : "-"
}
},
{
label: "区域运营",
prop: "areaSupervisionList",
width: "200px",
addHtml: 'areaSupervision',
addHtml: "areaSupervision",
formatter: (cellValue, idx) => {
return cellValue.businessTypeList[idx].areaSupervisionList
? (cellValue.businessTypeList[idx].areaSupervisionList.length ? cellValue.businessTypeList[idx].areaSupervisionList.map(item => item.directorName).join('/')
: '-')
: '-'
? cellValue.businessTypeList[idx].areaSupervisionList.length
? cellValue.businessTypeList[idx].areaSupervisionList
.map((item) => item.directorName)
.join("/")
: "-"
: "-"
}
},
{
label: "线上运营",
prop: "onlineSupervisionList",
width: "200px",
addHtml: 'onlineSupervision',
addHtml: "onlineSupervision",
formatter: (cellValue, idx) => {
return cellValue.businessTypeList[idx].onlineSupervisionList
? (cellValue.businessTypeList[idx].onlineSupervisionList.length ? cellValue.businessTypeList[idx].onlineSupervisionList.map(item => item.directorName).join('/')
: '-')
: '-'
? cellValue.businessTypeList[idx].onlineSupervisionList.length
? cellValue.businessTypeList[idx].onlineSupervisionList
.map((item) => item.directorName)
.join("/")
: "-"
: "-"
}
},
{
label: "运营模式",
prop: "directSalesFlag",
width: "200px",
addHtml: 'directSalesFlag',
addHtml: "directSalesFlag",
formatter: (cellValue, idx) => {
const list = this.removeListAll('saleFlagList')
const target = list.find(item => item.confId == cellValue.businessTypeList[idx].directSalesFlag)
return target ? target.confValue : '-'
const list = this.removeListAll("saleFlagList")
const target = list.find(
(item) =>
item.confId == cellValue.businessTypeList[idx].directSalesFlag
)
return target ? target.confValue : "-"
}
},
{
label: "展业场景",
prop: "businessDevelopmentScene",
width: "200px",
addHtml: 'businessDevelopmentScene',
addHtml: "businessDevelopmentScene",
formatter: (cellValue, idx) => {
const list = this.removeListAll('busiDelpList')
const list = this.removeListAll("busiDelpList")
let str = []
if (cellValue?.businessTypeList && cellValue?.businessTypeList.length && cellValue?.businessTypeList[idx]?.businessDevelopmentSceneList) {
cellValue?.businessTypeList[idx]?.businessDevelopmentSceneList.forEach(item => {
str.push(list.find(k => k.confId == item)?.confValue)
if (
cellValue?.businessTypeList &&
cellValue?.businessTypeList.length &&
cellValue?.businessTypeList[idx]?.businessDevelopmentSceneList
) {
cellValue?.businessTypeList[
idx
]?.businessDevelopmentSceneList.forEach((item) => {
str.push(list.find((k) => k.confId == item)?.confValue)
})
}
return str.length ? str.join('/') : '-'
return str.length ? str.join("/") : "-"
}
},
{
label: "主服务商",
prop: "serviceMerchantName",
width: "200px",
addHtml: 'serviceMerchant',
addHtml: "serviceMerchant",
formatter: (cellValue, idx) => {
return cellValue.businessTypeList[idx].serviceMerchantName || "-"
}
......@@ -516,10 +734,13 @@ export default {
label: "展业时间",
prop: "businessDevDate",
width: "200px",
addHtml: 'businessDevDate',
addHtml: "businessDevDate",
formatter: (cellValue, idx) => {
return cellValue.businessTypeList[idx].businessDevDate
? Util.dateFormate(cellValue.businessTypeList[idx].businessDevDate, "YYYY-MM-DD")
? Util.dateFormate(
cellValue.businessTypeList[idx].businessDevDate,
"YYYY-MM-DD"
)
: "-"
}
},
......@@ -527,16 +748,27 @@ export default {
label: "最新订单日期",
prop: "latestOrderDate",
width: "200px",
addHtml: 'latestOrderDate',
addHtml: "latestOrderDate",
formatter: (cellValue, idx) => {
return cellValue.businessTypeList[idx].latestOrderDate
? Util.dateFormate(cellValue.businessTypeList[idx].latestOrderDate, "YYYY-MM-DD")
? Util.dateFormate(
cellValue.businessTypeList[idx].latestOrderDate,
"YYYY-MM-DD"
)
: "-"
}
}
]
},
tableSlotList: ['areaSupervision', 'onlineSupervision', 'directSalesFlag', 'businessDevelopmentScene', 'serviceMerchant', 'businessDevDate', 'latestOrderDate'],
tableSlotList: [
"areaSupervision",
"onlineSupervision",
"directSalesFlag",
"businessDevelopmentScene",
"serviceMerchant",
"businessDevDate",
"latestOrderDate"
],
baseData: {
sunshineIncentList: [],
areaList: [],
......@@ -552,16 +784,16 @@ export default {
busiTypeList: [
{ confId: "0", confValue: "轻改" },
{ confId: "1", confValue: "权益" },
{ confId: "2", confValue: "延保" },
{ confId: "2", confValue: "延保" }
],
saleFlagList: [
{ confId: "0", confValue: "非直营" },
{ confId: "1", confValue: "直营" },
{ confId: "1", confValue: "直营" }
],
busiDelpList: [
{ confId: "0", confValue: "售前" },
{ confId: "1", confValue: "售后" },
{ confId: "2", confValue: "存量电销" },
{ confId: "2", confValue: "存量电销" }
],
serviceMerList: [],
busiSceneList: []
......@@ -607,7 +839,7 @@ export default {
{ confId: "Y", confName: "开" },
{ confId: "N", confName: "关" }
],
handleRadioChange: (val) => { }
handleRadioChange: (val) => {}
},
{
label: "门店积分归属",
......@@ -620,7 +852,7 @@ export default {
{ confId: 0, confName: "门店员工" },
{ confId: 1, confName: "驻店员工" }
],
handleRadioChange: (val) => { }
handleRadioChange: (val) => {}
},
{
label: "门店积分支持微信提现功能",
......@@ -633,7 +865,7 @@ export default {
{ confId: "Y", confName: "开" },
{ confId: "N", confName: "关" }
],
handleRadioChange: (val) => { }
handleRadioChange: (val) => {}
},
{
label: "门店订单审批功能",
......@@ -646,7 +878,7 @@ export default {
{ confId: "Y", confName: "开" },
{ confId: "N", confName: "关" }
],
handleRadioChange: (val) => { }
handleRadioChange: (val) => {}
},
{
label: "多角色分润",
......@@ -659,7 +891,7 @@ export default {
{ confId: "Y", confName: "开" },
{ confId: "N", confName: "关" }
],
handleRadioChange: (val) => { }
handleRadioChange: (val) => {}
},
{
label: "交付专员",
......@@ -700,28 +932,34 @@ export default {
batchSetObj: {
// 区域运营
area: {
title: '批量设置区域运营'
title: "批量设置区域运营"
},
// 展业场景
busiScene: {
title: '批量设置展业场景'
title: "批量设置展业场景"
},
// 线上运营
online: {
title: '批量设置线上运营'
},
title: "批量设置线上运营"
}
},
editChildRef: 'editChildRef',
batchSetActive: 'area',
editChildRef: "editChildRef",
batchSetActive: "area",
batchForm: {
sceneType: '',
sceneType: "",
shopOperationMuti: [],
businessDevelopmentScene: []
},
batchRules: {
sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }],
shopOperationMuti: [{ required: true, message: '请选择', trigger: 'change' }],
businessDevelopmentScene: [{ required: true, message: '请选择业务场景', trigger: 'change' }]
sceneType: [
{ required: true, message: "请选择业务场景", trigger: "change" }
],
shopOperationMuti: [
{ required: true, message: "请选择", trigger: "change" }
],
businessDevelopmentScene: [
{ required: true, message: "请选择业务场景", trigger: "change" }
]
},
batchFormData: [
{
......@@ -734,7 +972,7 @@ export default {
{ confId: "1", confName: "轻改" },
{ confId: "0", confName: "权益/延保" }
],
handleRadioChange: (val) => { }
handleRadioChange: (val) => {}
},
{
label: "区域运营",
......@@ -746,14 +984,14 @@ export default {
optionId: "directorUserId",
optionLabel: "directorName",
optionsName: "supervisionOptionsList",
isHide: false,
isHide: false
},
{
label: "业务场景",
name: "businessDevelopmentScene",
addHtml: 'businessDevelopmentScene',
isHide: true,
},
addHtml: "businessDevelopmentScene",
isHide: true
}
]
}
},
......@@ -789,6 +1027,24 @@ export default {
}),
...mapActions("d2admin/user", ["actionSetDownloadList"]),
...mapMutations("d2admin/user", ["setUpdateRefesh"]),
//日报填写
handleDailyReport(val) {
this.$confirm(
"切换日报填写开关会影响驻店是否需要填日报才能提单!",
"提示",
{
confirmButtonText: "确定",
type: "warning"
}
)
.then(() => {
// verification({ orderCode: row.orderCode }).then((res) => {
// this.notice.okTips()
// this.handleSearch()
// })
})
.catch(() => {})
},
changeHideData(val) {
this.integralFormData[
this.findAttrIdx("deliverySpecialistConfig")
......@@ -803,7 +1059,7 @@ export default {
this.getOptionsList()
},
getMerService() {
getMerService({}).then(res => {
getMerService({}).then((res) => {
this.baseData.serviceMerList = res
this.getOptionsList()
})
......@@ -829,7 +1085,7 @@ export default {
this.changeHideData(this.integralForm.pointsMultiRole)
}
)
} catch (err) { }
} catch (err) {}
},
getShopMerchantConfigData(data) {
try {
......@@ -877,7 +1133,7 @@ export default {
})
}
})
} catch (err) { }
} catch (err) {}
},
//获取店铺阳光激励积分配置
markRefundHandle(row) {
......@@ -916,19 +1172,31 @@ export default {
)
delete this.searchFormSearch.orderTime
}
const dateFormatList = [{
attr: 'createdDate',
startAttr: 'createStartTime',
endAttr: 'createEndTime',
}, {
attr: 'businessDevTime',
startAttr: 'businessDevStartTime',
endAttr: 'businessDevEndTime',
}]
dateFormatList.forEach(item => {
if (this.searchFormSearch[item.attr] && this.searchFormSearch[item.attr].length) {
this.searchFormSearch[item.startAttr] = Util.dateFormate(this.searchFormSearch[item.attr][0], 'YYYY-MM-DD')
this.searchFormSearch[item.endAttr] = Util.dateFormate(this.searchFormSearch[item.attr][1], 'YYYY-MM-DD')
const dateFormatList = [
{
attr: "createdDate",
startAttr: "createStartTime",
endAttr: "createEndTime"
},
{
attr: "businessDevTime",
startAttr: "businessDevStartTime",
endAttr: "businessDevEndTime"
}
]
dateFormatList.forEach((item) => {
if (
this.searchFormSearch[item.attr] &&
this.searchFormSearch[item.attr].length
) {
this.searchFormSearch[item.startAttr] = Util.dateFormate(
this.searchFormSearch[item.attr][0],
"YYYY-MM-DD"
)
this.searchFormSearch[item.endAttr] = Util.dateFormate(
this.searchFormSearch[item.attr][1],
"YYYY-MM-DD"
)
delete this.searchFormSearch[item.attr]
}
})
......@@ -936,9 +1204,9 @@ export default {
})
},
removeListAll(listName, optionLabel = 'confValue') {
removeListAll(listName, optionLabel = "confValue") {
var list = deepClone(this.baseData[listName])
const idx = list.findIndex(item => item[optionLabel] == '全部')
const idx = list.findIndex((item) => item[optionLabel] == "全部")
list.splice(idx, 1)
return list
},
......@@ -972,7 +1240,7 @@ export default {
confirmButtonText: "知道了",
showCancelButton: false,
type: "success"
}).then(() => { })
}).then(() => {})
},
getOptionsList() {
......@@ -981,7 +1249,7 @@ export default {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
if (item.optionsName != "brandList") {
......@@ -1002,8 +1270,8 @@ export default {
// 省市区
getProvinceList() {
const params = { districtName: '中国' }
getDistrictDetail(params).then(res => {
const params = { districtName: "中国" }
getDistrictDetail(params).then((res) => {
console.log(res)
if (res && res.length) {
this.baseData.provinceInfoList = res[0].districts
......@@ -1042,12 +1310,12 @@ export default {
shopLabelFlag: "",
brandIdList: [],
createdDate: [],
businessSceneType: '',
directSalesFlag: '',
businessDevelopmentScene: '',
businessSceneType: "",
directSalesFlag: "",
businessDevelopmentScene: "",
businessDevTime: [],
serviceMerchantId: '',
onlineSupervision: ''
serviceMerchantId: "",
onlineSupervision: ""
}
this.baseData.cityList = []
this.getOptionsList()
......@@ -1288,34 +1556,42 @@ export default {
},
handleBatchClose() {
this.batchForm = {
sceneType: '',
sceneType: "",
shopOperationMuti: [],
businessDevelopmentScene: []
}
this.handleBatchVisible()
},
handleConfirmBatch() {
this.$refs.editFormSetRef.$refs[this.editChildRef].validate(valid => {
this.$refs.editFormSetRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
var params = { sceneType: this.batchForm.sceneType, merchantIdList: this.selectItemList.map(item => item.merchantId) }
if (this.batchSetActive == 'busiScene') {
params.businessDevelopmentScene = this.batchForm.businessDevelopmentScene.join(',')
busiBatchSet(params).then(res => {
this.$message.success('操作成功')
var params = {
sceneType: this.batchForm.sceneType,
merchantIdList: this.selectItemList.map((item) => item.merchantId)
}
if (this.batchSetActive == "busiScene") {
params.businessDevelopmentScene =
this.batchForm.businessDevelopmentScene.join(",")
busiBatchSet(params).then((res) => {
this.$message.success("操作成功")
this.selectItemList = []
this.handleBatchClose()
this.handleReset()
})
} else {
params.operationType = this.batchSetActive == 'area' ? '1' : '2'
params.operationType = this.batchSetActive == "area" ? "1" : "2"
params.shopOperationList = []
this.batchForm.shopOperationMuti.forEach(item => {
let idx = this.baseData.supervisionOptionsList.findIndex(k => k.directorUserId == item)
params.shopOperationList.push({ ...this.baseData.supervisionOptionsList[idx] })
this.batchForm.shopOperationMuti.forEach((item) => {
let idx = this.baseData.supervisionOptionsList.findIndex(
(k) => k.directorUserId == item
)
params.shopOperationList.push({
...this.baseData.supervisionOptionsList[idx]
})
})
shopBatchSet(params).then(res => {
shopBatchSet(params).then((res) => {
console.log(res)
this.$message.success('操作成功')
this.$message.success("操作成功")
this.selectItemList = []
this.handleBatchClose()
this.handleReset()
......@@ -1331,7 +1607,7 @@ export default {
judgeMuti() {
this.selectItemList =
this.$refs.recordTable?.mutiSelectArr?.[
this.tableParams.mutiSelectName
this.tableParams.mutiSelectName
] || []
if (this.selectItemList.length) {
return false
......@@ -1346,18 +1622,27 @@ export default {
return true
}
this.batchSetActive = obj.batchActive
let staffIdx = this.batchFormData.findIndex(item => item.name == 'shopOperationMuti')
let sceneIdx = this.batchFormData.findIndex(item => item.name == 'businessDevelopmentScene')
if (['area', 'online'].includes(this.batchSetActive)) {
this.batchFormData[staffIdx].label = this.batchSetActive == 'area' ? '区域运营' : '线上运营'
let staffIdx = this.batchFormData.findIndex(
(item) => item.name == "shopOperationMuti"
)
let sceneIdx = this.batchFormData.findIndex(
(item) => item.name == "businessDevelopmentScene"
)
if (["area", "online"].includes(this.batchSetActive)) {
this.batchFormData[staffIdx].label =
this.batchSetActive == "area" ? "区域运营" : "线上运营"
await this.findMerchantStaffList()
} else {
this.baseData.busiSceneList = this.removeListAll('busiDelpList')
this.baseData.busiSceneList = this.removeListAll("busiDelpList")
}
this.batchFormData[staffIdx].isHide = this.batchSetActive == 'busiScene'
this.batchFormData[sceneIdx].isHide = this.batchSetActive != 'busiScene'
this.batchRules.shopOperationMuti[0].required = ['area', 'online'].includes(this.batchSetActive)
this.batchRules.businessDevelopmentScene[0].required = this.batchSetActive == 'busiScene'
this.batchFormData[staffIdx].isHide = this.batchSetActive == "busiScene"
this.batchFormData[sceneIdx].isHide = this.batchSetActive != "busiScene"
this.batchRules.shopOperationMuti[0].required = [
"area",
"online"
].includes(this.batchSetActive)
this.batchRules.businessDevelopmentScene[0].required =
this.batchSetActive == "busiScene"
this.handleBatchVisible()
},
async findMerchantStaffList() {
......@@ -1371,12 +1656,15 @@ export default {
directorPhone: item.staffPhone
}
})
let idx = this.batchFormData.findIndex(item => item.name == 'shopOperationMuti')
this.batchFormData[idx].optionList = this.baseData.supervisionOptionsList
let idx = this.batchFormData.findIndex(
(item) => item.name == "shopOperationMuti"
)
this.batchFormData[idx].optionList =
this.baseData.supervisionOptionsList
resolve()
})
})
},
}
}
}
</script>
......
<!-- 话术审批进度 -->
<template>
<d2-container class="customer-tags m-t-40">
<div
class="header"
slot="header"
>
<div class="header" slot="header">
<d2-search
ref="showSearch"
class="show-search"
......@@ -14,31 +11,18 @@
>
</d2-search>
<div class="up-btns">
<el-button
size="small"
type="primary"
@click="handleSearch"
>
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button
size="small"
@click="handleReset"
> 重置 </el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="statistics-wrap">
<template v-for="(item, index) in statisticsData">
<div
class="statistics-box"
:key="index"
>
<div class="statistics-box" :key="index">
<div class="title">{{ item.label }}</div>
<div
class="content"
v-if="!item.innerHtml"
>
<div class="content" v-if="!item.innerHtml">
{{ queryInfo[item.key] }}
</div>
<div
......@@ -50,12 +34,9 @@
</template>
</div>
<d2-table-header title="审批列表">
<el-button
size="mini"
type="primary"
plain
@click="exportTable"
>导出</el-button>
<el-button size="mini" type="primary" plain @click="exportTable"
>导出</el-button
>
</d2-table-header>
<d2-table
ref="table"
......@@ -64,34 +45,27 @@
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<template
slot="popoverHtml"
slot-scope="scope"
>
<template slot="popoverHtml" slot-scope="scope">
<template v-if="scope.scope[scope.prop]">
<el-tooltip
class="item"
effect="dark"
:content="$parent.formatterContent(scope.scope,scope.prop)"
:content="$parent.formatterContent(scope.scope, scope.prop)"
placement="top"
popper-class="text-tooltip"
>
<span>
{{$parent.formatterContent(scope.scope,scope.prop, 20)}}
{{ $parent.formatterContent(scope.scope, scope.prop, 20) }}
</span>
</el-tooltip>
</template>
<template v-else>-</template>
</template>
<div
slot="auth-button"
slot-scope="scope"
>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<el-button
type="text"
@click="handleDetail(scope.scope)"
>详情</el-button>
<el-button type="text" @click="handleDetail(scope.scope)"
>详情</el-button
>
</span>
</div>
</d2-table>
......@@ -107,6 +81,7 @@
</template>
<script>
import { getBrandList } from "@/api/scene.js"
import {
getSingleLabelList,
getConditionPage,
......@@ -117,9 +92,9 @@ import { businessSceneOpt, checkStautsOpt } from "@/common/constants"
import { Util, deepClone } from "@/common/util"
import otherDetail from "./components/otherDetail"
export default {
name: 'ApprovalList',
name: "ApprovalList",
components: { otherDetail },
data () {
data() {
return {
getListApi: getConditionPage,
tableData: [],
......@@ -141,7 +116,9 @@ export default {
prop: "scene",
formatter: (cellValue) => {
return cellValue.scene === 0 || cellValue.scene
? businessSceneOpt.find(item => item.confId === cellValue.scene).confValue
? businessSceneOpt.find(
(item) => item.confId === cellValue.scene
).confValue
: "-"
},
width: "80"
......@@ -152,6 +129,11 @@ export default {
width: "80"
},
{
label: "品牌",
prop: "sceneLabelName",
width: "80"
},
{
label: "优秀标签",
prop: "labelName",
width: "80"
......@@ -206,7 +188,7 @@ export default {
{
label: "确认人",
prop: "firstChecker"
},
}
]
},
searchFormSearch: {},
......@@ -258,12 +240,25 @@ export default {
type: "datePicker",
isClear: false,
pickerOptions: "rangePickerOptions"
},
{
label: "品牌",
name: "storeBrandId",
type: "select",
// multiple: true,
isClear: true,
collapseTags: true,
optionList: [],
optionId: "id",
optionLabel: "label",
optionsName: "brandList"
}
],
baseData: {
businessTypeOpt: businessSceneOpt,
checkStatusList: checkStautsOpt,
sceneLabelList: []
sceneLabelList: [],
brandList: []
},
statisticsData: [
{
......@@ -276,35 +271,31 @@ export default {
],
queryInfo: {
recordCount: 0
},
}
}
},
mounted () {
mounted() {
this.initSelect()
this.getTotal()
},
methods: {
handleDetail (data) {
handleDetail(data) {
this.id = data.id
this.detailVisible = true
},
beforeSearchFn (type = 1) {
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = this.getParams()
resolve()
})
},
getParams () {
getParams() {
const params = deepClone(this.searchForm)
if (params.extractionTime?.length) {
params.startTime = Util.dateFormate(
params.extractionTime[0],
"YYYY-MM-DD"
) + ' 00:00:00'
params.endTime = Util.dateFormate(
params.extractionTime[1],
"YYYY-MM-DD"
) + ' 23:59:59'
params.startTime =
Util.dateFormate(params.extractionTime[0], "YYYY-MM-DD") + " 00:00:00"
params.endTime =
Util.dateFormate(params.extractionTime[1], "YYYY-MM-DD") + " 23:59:59"
delete params.extractionTime
}
if (params.checkStatus === 0) {
......@@ -321,16 +312,16 @@ export default {
}
return params
},
handleSearch () {
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
},
handleReset () {
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
console.log("this.searchForm", this.searchForm)
this.handleSearch()
},
async exportTable () {
async exportTable() {
try {
await this.beforeSearchFn()
const res = await conditionExport({
......@@ -341,9 +332,9 @@ export default {
if (error) this.$message.error(error)
}
},
initSelect () {
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getSceceLabelList()])
Promise.allSettled([this.getSceceLabelList(), this.getBrandList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
......@@ -359,8 +350,29 @@ export default {
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getSceceLabelList () {
getBrandList() {
const brandList = []
return new Promise((resolve, reject) => {
getBrandList({ containsChildren: true })
.then((res) => {
res.map((e) => {
if (e && e.children && e.children.length) {
e.children.map((i) => {
i.brandId = e.id
brandList.push(i)
})
}
})
this.baseData.brandList = brandList
resolve(brandList) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getBrandList:", err)
reject(err) // 捕获并传递错误
})
})
},
getSceceLabelList() {
return new Promise((resolve, reject) => {
getSingleLabelList({})
.then((res) => {
......@@ -373,13 +385,13 @@ export default {
})
})
},
getOptionsList () {
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
// if (item.optionsName != "brandList") {
......@@ -397,7 +409,7 @@ export default {
}
})
},
async getTotal () {
async getTotal() {
const res = await getTotalCount({})
this.queryInfo.recordCount = res
}
......@@ -446,4 +458,4 @@ export default {
display: flex;
align-items: center;
}
</style>
\ No newline at end of file
</style>
......@@ -4,7 +4,6 @@
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData"
......@@ -18,8 +17,7 @@
</div>
</div>
<div class="d2-container-content">
<d2-table-header title="话术列表">
</d2-table-header>
<d2-table-header title="话术列表"> </d2-table-header>
<d2-table
ref="table"
:get-list-api="getListApi"
......@@ -36,23 +34,22 @@
</div>
</d2-container>
</template>
<script>
<script>
import {
getClassLabelList,
geRecordSummaryList,
recordExport
getClassLabelList,
geRecordSummaryList,
recordExport
} from "@/api/verbal.js"
import { getBrandList } from "@/api/scene.js"
import { businessSceneOpt } from "@/common/constants"
import { Util, deepClone } from "@/common/util"
export default {
name: 'ExcellentList',
name: "ExcellentList",
data() {
return {
getListApi: geRecordSummaryList,
tableData:[{
}],
tableData: [{}],
tableParams: {
listName: "list",
tableOption: {
......@@ -67,8 +64,10 @@ export default {
label: "业务场景",
prop: "businessType",
formatter: (cellValue) => {
return cellValue.businessType===0||cellValue.businessType
? businessSceneOpt.find(item => item.confId === cellValue.businessType).confValue
return cellValue.businessType === 0 || cellValue.businessType
? businessSceneOpt.find(
(item) => item.confId === cellValue.businessType
).confValue
: "-"
}
},
......@@ -80,11 +79,13 @@ export default {
label: "最后更新时间",
formatter: (cellValue) => {
return cellValue.latestUpdateTime
? Util.dateFormate(cellValue.latestUpdateTime, "YYYY-MM-DD HH:mm:ss")
? Util.dateFormate(
cellValue.latestUpdateTime,
"YYYY-MM-DD HH:mm:ss"
)
: "-"
}
}
]
},
searchFormSearch: {},
......@@ -113,11 +114,24 @@ export default {
optionId: "confId",
optionLabel: "confValue",
optionsName: "businessTypeOpt"
},
{
label: "品牌",
name: "storeBrandId",
type: "select",
// multiple: true,
isClear: true,
collapseTags: true,
optionList: [],
optionId: "id",
optionLabel: "label",
optionsName: "brandList"
}
],
baseData: {
businessTypeOpt:businessSceneOpt,
classLabelList: []
businessTypeOpt: businessSceneOpt,
classLabelList: [],
brandList: []
}
}
},
......@@ -127,14 +141,16 @@ export default {
methods: {
handleDetail(data) {
console.log("row", data)
let businessTypeName=data.businessType===0||data.businessType
? businessSceneOpt.find(item => item.confId === data.businessType).confValue
: "-"
let businessTypeName =
data.businessType === 0 || data.businessType
? businessSceneOpt.find((item) => item.confId === data.businessType)
.confValue
: "-"
this.$router.push({
path: "/inVerbalConfigView",
query: {
...data,
businessTypeName:businessTypeName
...data,
businessTypeName: businessTypeName
}
})
},
......@@ -166,7 +182,7 @@ export default {
},
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getClassLabelList()])
Promise.allSettled([this.getClassLabelList(), this.getBrandList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
......@@ -182,7 +198,28 @@ export default {
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getBrandList() {
const brandList = []
return new Promise((resolve, reject) => {
getBrandList({ containsChildren: true })
.then((res) => {
res.map((e) => {
if (e && e.children && e.children.length) {
e.children.map((i) => {
i.brandId = e.id
brandList.push(i)
})
}
})
this.baseData.brandList = brandList
resolve(brandList) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getBrandList:", err)
reject(err) // 捕获并传递错误
})
})
},
getClassLabelList() {
return new Promise((resolve, reject) => {
getClassLabelList({})
......@@ -223,9 +260,9 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.m-t-40 {
margin-top: 40px;
}
</style>
\ No newline at end of file
</style>
<template>
<d2-container class="customer-tags m-t-40">
<div
class="header"
slot="header"
>
<div class="header" slot="header">
<d2-search
ref="showSearch"
class="show-search"
......@@ -13,31 +10,18 @@
>
</d2-search>
<div class="up-btns">
<el-button
size="small"
type="primary"
@click="handleSearch"
>
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button
size="small"
@click="handleReset"
> 重置 </el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="statistics-wrap">
<template v-for="(item, index) in statisticsData">
<div
class="statistics-box"
:key="index"
>
<div class="statistics-box" :key="index">
<div class="title">{{ item.label }}</div>
<div
class="content"
v-if="!item.innerHtml"
>
<div class="content" v-if="!item.innerHtml">
{{ queryInfo[item.key] }}
</div>
<div
......@@ -49,12 +33,9 @@
</template>
</div>
<d2-table-header title="未推送列表">
<el-button
size="mini"
type="primary"
plain
@click="exportTable"
>导出</el-button>
<el-button size="mini" type="primary" plain @click="exportTable"
>导出</el-button
>
</d2-table-header>
<d2-table
ref="table"
......@@ -63,34 +44,27 @@
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<template
slot="popoverHtml"
slot-scope="scope"
>
<template slot="popoverHtml" slot-scope="scope">
<template v-if="scope.scope[scope.prop]">
<el-tooltip
class="item"
effect="dark"
:content="$parent.formatterContent(scope.scope,scope.prop)"
:content="$parent.formatterContent(scope.scope, scope.prop)"
placement="top"
popper-class="text-tooltip"
>
<span>
{{$parent.formatterContent(scope.scope,scope.prop, 20)}}
{{ $parent.formatterContent(scope.scope, scope.prop, 20) }}
</span>
</el-tooltip>
</template>
<template v-else>-</template>
</template>
<div
slot="auth-button"
slot-scope="scope"
>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<el-button
type="text"
@click="handleDetail(scope.scope)"
>详情</el-button>
<el-button type="text" @click="handleDetail(scope.scope)"
>详情</el-button
>
</span>
</div>
</d2-table>
......@@ -106,6 +80,7 @@
</template>
<script>
import { getBrandList } from "@/api/scene.js"
import {
getSingleLabelList,
getConditionPage,
......@@ -116,9 +91,9 @@ import { businessSceneOpt } from "@/common/constants"
import { Util, deepClone } from "@/common/util"
import otherDetail from "./components/otherDetail"
export default {
name: 'NoPushedList',
name: "NoPushedList",
components: { otherDetail },
data () {
data() {
return {
getListApi: getConditionPage,
tableData: [],
......@@ -139,6 +114,11 @@ export default {
prop: "sceneLabelName"
},
{
label: "品牌",
prop: "sceneLabelName",
width: "80"
},
{
label: "优秀标签",
prop: "labelName"
},
......@@ -165,7 +145,7 @@ export default {
},
searchFormSearch: {},
searchForm: {
sceneLabelCode: "",
sceneLabelCode: ""
},
showFormData: [
{
......@@ -180,6 +160,18 @@ export default {
optionsName: "sceneLabelList"
},
{
label: "品牌",
name: "storeBrandId",
type: "select",
// multiple: true,
isClear: true,
collapseTags: true,
optionList: [],
optionId: "id",
optionLabel: "label",
optionsName: "brandList"
},
{
label: "更新时间",
name: "updateTime",
type: "datePicker",
......@@ -189,7 +181,8 @@ export default {
],
baseData: {
businessTypeOpt: businessSceneOpt,
sceneLabelList: []
sceneLabelList: [],
brandList: []
},
statisticsData: [
{
......@@ -205,44 +198,46 @@ export default {
}
}
},
mounted () {
mounted() {
this.initSelect()
this.getTotal()
},
methods: {
handleDetail (data) {
handleDetail(data) {
this.id = data.id
this.detailVisible = true
},
beforeSearchFn (type = 1) {
beforeSearchFn(type = 1) {
return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.pushStatus = 0
this.searchFormSearch.checkStatusList = [2]
if (this.searchFormSearch.updateTime?.length) {
this.searchFormSearch.startUpdateTime = Util.dateFormate(
this.searchFormSearch.updateTime[0],
"YYYY-MM-DD"
) + ' 00:00:00'
this.searchFormSearch.endUpdateTime = Util.dateFormate(
this.searchFormSearch.updateTime[1],
"YYYY-MM-DD"
) + ' 23:59:59'
this.searchFormSearch.startUpdateTime =
Util.dateFormate(
this.searchFormSearch.updateTime[0],
"YYYY-MM-DD"
) + " 00:00:00"
this.searchFormSearch.endUpdateTime =
Util.dateFormate(
this.searchFormSearch.updateTime[1],
"YYYY-MM-DD"
) + " 23:59:59"
delete this.searchFormSearch.updateTime
}
resolve()
})
},
handleSearch () {
handleSearch() {
this.page = this.$options.data.call(this).page
this.$refs.table.refreshTable(true, true)
},
handleReset () {
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
console.log("this.searchForm", this.searchForm)
this.handleSearch()
},
async exportTable () {
async exportTable() {
try {
await this.beforeSearchFn()
const res = await conditionExport({
......@@ -253,9 +248,9 @@ export default {
if (error) this.$message.error(error)
}
},
initSelect () {
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getSingleLabelList()])
Promise.allSettled([this.getSingleLabelList(), this.getBrandList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
......@@ -271,8 +266,29 @@ export default {
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getSingleLabelList () {
getBrandList() {
const brandList = []
return new Promise((resolve, reject) => {
getBrandList({ containsChildren: true })
.then((res) => {
res.map((e) => {
if (e && e.children && e.children.length) {
e.children.map((i) => {
i.brandId = e.id
brandList.push(i)
})
}
})
this.baseData.brandList = brandList
resolve(brandList) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getBrandList:", err)
reject(err) // 捕获并传递错误
})
})
},
getSingleLabelList() {
return new Promise((resolve, reject) => {
getSingleLabelList({})
.then((res) => {
......@@ -285,13 +301,13 @@ export default {
})
})
},
getOptionsList () {
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
// if (item.optionsName != "brandList") {
......@@ -309,10 +325,10 @@ export default {
}
})
},
async getTotal () {
async getTotal() {
const res = await getTotalCount({ pushStatus: 0, checkStatusList: [2] })
this.queryInfo.recordCount = res
},
}
}
}
</script>
......@@ -358,4 +374,4 @@ export default {
display: flex;
align-items: center;
}
</style>
\ No newline at end of file
</style>
<template>
<d2-container class="customer-tags m-t-40">
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'100px'"
:form-data="showFormData">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData"
>
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
......@@ -19,29 +24,37 @@
<div class="content" v-if="!item.innerHtml">
{{ queryInfo[item.key] }}
</div>
<div class="inner-content" v-else v-html="item.innerHtml(queryInfo)"></div>
<div
class="inner-content"
v-else
v-html="item.innerHtml(queryInfo)"
></div>
</div>
</template>
</div>
<d2-table-header title="推送列表">
<el-button size="mini" type="primary" plain @click="exportTable">导出</el-button>
</d2-table-header>
<d2-table ref="table" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams"
:before-search-fn="beforeSearchFn">
<template
slot="popoverHtml"
slot-scope="scope"
<el-button size="mini" type="primary" plain @click="exportTable"
>导出</el-button
>
</d2-table-header>
<d2-table
ref="table"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<template slot="popoverHtml" slot-scope="scope">
<template v-if="scope.scope[scope.prop]">
<el-tooltip
class="item"
effect="dark"
:content="$parent.formatterContent(scope.scope,scope.prop)"
:content="$parent.formatterContent(scope.scope, scope.prop)"
placement="top"
popper-class="text-tooltip"
>
<span>
{{$parent.formatterContent(scope.scope,scope.prop, 20)}}
{{ $parent.formatterContent(scope.scope, scope.prop, 20) }}
</span>
</el-tooltip>
</template>
......@@ -49,19 +62,33 @@
</template>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
<el-button type="text" @click="handleStatistics(scope.scope)">统计</el-button>
<el-button type="text" @click="handleDetail(scope.scope)"
>详情</el-button
>
<el-button type="text" @click="handleStatistics(scope.scope)"
>统计</el-button
>
</span>
</div>
</d2-table>
</div>
<!-- 详细信息 -->
<other-detail :visible.sync="detailVisible" v-if="detailVisible" :id="id" source="pushed" />
<statistics-dialog :visible.sync="statisticsVisible" v-if="statisticsVisible" :id="id" />
<other-detail
:visible.sync="detailVisible"
v-if="detailVisible"
:id="id"
source="pushed"
/>
<statistics-dialog
:visible.sync="statisticsVisible"
v-if="statisticsVisible"
:id="id"
/>
</d2-container>
</template>
<script>
import { getBrandList } from "@/api/scene.js"
import {
getSingleLabelList,
getConditionPage,
......@@ -73,7 +100,7 @@ import { Util, deepClone } from "@/common/util"
import otherDetail from "./components/otherDetail"
import StatisticsDialog from "./components/statisticsDialog.vue"
export default {
name: 'PushedList',
name: "PushedList",
components: { otherDetail, StatisticsDialog },
data() {
return {
......@@ -97,6 +124,11 @@ export default {
prop: "sceneLabelName"
},
{
label: "品牌",
prop: "sceneLabelName",
width: "80"
},
{
label: "优秀标签",
prop: "labelName"
},
......@@ -131,7 +163,7 @@ export default {
},
searchFormSearch: {},
searchForm: {
sceneLabelCode: "",
sceneLabelCode: ""
},
showFormData: [
{
......@@ -146,6 +178,18 @@ export default {
optionsName: "sceneLabelList"
},
{
label: "品牌",
name: "storeBrandId",
type: "select",
// multiple: true,
isClear: true,
collapseTags: true,
optionList: [],
optionId: "id",
optionLabel: "label",
optionsName: "brandList"
},
{
label: "推送时间",
name: "pushTime",
type: "datePicker",
......@@ -162,7 +206,8 @@ export default {
],
baseData: {
businessTypeOpt: businessSceneOpt,
sceneLabelList: []
sceneLabelList: [],
brandList: []
},
statisticsData: [
{
......@@ -197,25 +242,25 @@ export default {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.pushStatus = 1
if (this.searchFormSearch.pushTime?.length) {
this.searchFormSearch.startPushTime = Util.dateFormate(
this.searchFormSearch.pushTime[0],
"YYYY-MM-DD"
) + ' 00:00:00'
this.searchFormSearch.endPushTime = Util.dateFormate(
this.searchFormSearch.pushTime[1],
"YYYY-MM-DD"
) + ' 23:59:59'
this.searchFormSearch.startPushTime =
Util.dateFormate(this.searchFormSearch.pushTime[0], "YYYY-MM-DD") +
" 00:00:00"
this.searchFormSearch.endPushTime =
Util.dateFormate(this.searchFormSearch.pushTime[1], "YYYY-MM-DD") +
" 23:59:59"
delete this.searchFormSearch.pushTime
}
if (this.searchFormSearch.updateTime?.length) {
this.searchFormSearch.startUpdateTime = Util.dateFormate(
this.searchFormSearch.updateTime[0],
"YYYY-MM-DD"
) + ' 00:00:00'
this.searchFormSearch.endUpdateTime = Util.dateFormate(
this.searchFormSearch.updateTime[1],
"YYYY-MM-DD"
) + ' 23:59:59'
this.searchFormSearch.startUpdateTime =
Util.dateFormate(
this.searchFormSearch.updateTime[0],
"YYYY-MM-DD"
) + " 00:00:00"
this.searchFormSearch.endUpdateTime =
Util.dateFormate(
this.searchFormSearch.updateTime[1],
"YYYY-MM-DD"
) + " 23:59:59"
delete this.searchFormSearch.updateTime
}
resolve()
......@@ -243,7 +288,7 @@ export default {
},
initSelect() {
// 使用 Promise.all 处理多个异步任务,并捕获所有可能的错误
Promise.allSettled([this.getSingleLabelList()])
Promise.allSettled([this.getSingleLabelList(), this.getBrandList()])
.then((results) => {
// 检查每个任务的结果
results.forEach((result, index) => {
......@@ -259,7 +304,28 @@ export default {
this.getOptionsList() // 确保即使有意外错误也调用 getOptionsList
})
},
getBrandList() {
const brandList = []
return new Promise((resolve, reject) => {
getBrandList({ containsChildren: true })
.then((res) => {
res.map((e) => {
if (e && e.children && e.children.length) {
e.children.map((i) => {
i.brandId = e.id
brandList.push(i)
})
}
})
this.baseData.brandList = brandList
resolve(brandList) // 返回结果以便主流程感知
})
.catch((err) => {
console.error("Error in getBrandList:", err)
reject(err) // 捕获并传递错误
})
})
},
getSingleLabelList() {
return new Promise((resolve, reject) => {
getSingleLabelList({})
......@@ -279,7 +345,7 @@ export default {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
// if (item.optionsName != "brandList") {
......@@ -346,4 +412,4 @@ export default {
display: flex;
align-items: center;
}
</style>
\ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!