Commit ad424f63 by 前端

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

…ife-system into SAAS+V4.51.1-0415
2 parents f3392e84 e4b11133
...@@ -20,13 +20,13 @@ const request = ( ...@@ -20,13 +20,13 @@ const request = (
) => { ) => {
// 兼容线上dj和scrm appkey和secret不一样的情况 // 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = "" let apiName = ""
if(params.method.includes("dj.api.script")){
apiName = 'script' if (params.method.includes("dj.api.smartcarlife")) {
}
else if (params.method.includes("dj")) {
apiName = "dj" apiName = "dj"
} else if (params.method.includes("dj.api.script")) {
apiName = "script"
} else { } else {
console.log( params.method.split(".api")) console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0] apiName = params.method.split(".api")[0]
} }
...@@ -43,8 +43,9 @@ const request = ( ...@@ -43,8 +43,9 @@ const request = (
merchants: "axios3", merchants: "axios3",
reportExport: "axios4", reportExport: "axios4",
"glsx.accounts.biz.common.pictureUpload": "common", "glsx.accounts.biz.common.pictureUpload": "common",
clue:'axios5', clue: "axios5",
script:'axios7' "dj.businessSchool": "axios6",
script: "axios7"
} }
const baseApiName = mappingName[apiName] const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName") // console.log(baseApiName, "baseApiName")
...@@ -77,8 +78,8 @@ const request = ( ...@@ -77,8 +78,8 @@ const request = (
scrm: "sha1", scrm: "sha1",
glsx: "md5", glsx: "md5",
"glsx.accounts.biz.common.pictureUpload": "md5", "glsx.accounts.biz.common.pictureUpload": "md5",
clue:'sha1', clue: "sha1",
script:'sha1' script: "sha1"
} }
// console.log(signWay[apiName], "baseApiName") // console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret const secret = baseConfig[baseApiName].secret
......
...@@ -481,4 +481,10 @@ export function updateStaffDailyReportConfigApi(data) { ...@@ -481,4 +481,10 @@ export function updateStaffDailyReportConfigApi(data) {
export function deleteStaffDailyReportConfigApi(data) { export function deleteStaffDailyReportConfigApi(data) {
data.method = `${path2}staffDailyReportConfig.delete` data.method = `${path2}staffDailyReportConfig.delete`
return request(data, 'post') return request(data, 'post')
}
\ No newline at end of file \ No newline at end of file
}
// 更新指定员工记录项内容
export function updateTmlpStaffItem(data) {
data.method = `${path2}digital.management.staff.item.update`
return request(data, 'post')
}
...@@ -119,3 +119,9 @@ export function uploadFileWithFileName(data) { ...@@ -119,3 +119,9 @@ export function uploadFileWithFileName(data) {
data.method = `dj.api.common.uploadFile.with.file.name` data.method = `dj.api.common.uploadFile.with.file.name`
return request(data, RequestMethods.POST, ["file"]) return request(data, RequestMethods.POST, ["file"])
} }
// 查询门店
export function getMerchantPage(data) {
data.method = `dj.api.merchant.page`
return request(data, RequestMethods.POST)
}
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.api.smartcarlife."
const path1 = "dj.businessSchool.api."
// 带教任务分页查询
export function getTeachTaskPage(data) {
data.method = `${path1}teach.task.page`
return request(data, RequestMethods.POST)
}
// 查询督导
export function getDudaoList(data) {
data.method = `${path}merchant.staff.by.role.list`
return request(data, RequestMethods.POST)
}
// 查询门店
export function getMerchantPage(data) {
data.method = `dj.api.merchant.page`
return request(data, RequestMethods.POST)
}
// 带教任务导出
export function teachTaskExportAsync(data) {
data.method = `${path1}teach.task.export.Async`
return request(data)
}
// 查询带教门店信息
export function areaOperatorList(data) {
data.method = `${path}serviceMerchant.areaOperator.list`
return request(data, RequestMethods.POST)
}
// 带教任务创建
export function teachTaskCreate(data) {
data.method = `${path1}teach.task.create`
return request(data, RequestMethods.POST)
}
...@@ -1131,7 +1131,47 @@ export const outputValue_operTypeOpt = [ ...@@ -1131,7 +1131,47 @@ export const outputValue_operTypeOpt = [
{ confId: 2, confValue: "修改" }, { confId: 2, confValue: "修改" },
{ confId: 3, confValue: "删除" } { confId: 3, confValue: "删除" }
] ]
//话术业务场景
// 带教管理 业务类型1
export const teaching_businessOpt = [
{ confId: 0, confValue: "权益升级" },
{ confId: 1, confValue: "延保升级" },
{ confId: 2, confValue: "精品升级" }
]
// 带教管理 业务类型2
export const teaching_saleTypeOpt = [
{ confId: "0", confValue: "售前" },
{ confId: "1", confValue: "售后" }
]
// 带教管理 任务状态
export const teaching_taskStatusOpt = [
{ confId: 0, confValue: "待接受" },
{ confId: 1, confValue: "进行中" },
{ confId: 2, confValue: "已结束" }
]
// 带教管理 支援类型
export const teaching_supportTypeOpt = [
{ confId: 0, confValue: "新店启动" },
{ confId: 1, confValue: "老店业绩提升-渗透率过低" },
{ confId: 2, confValue: "老店业绩提升-客单价过低" }
]
// 带教管理 支援方式
export const teaching_supportWayOpt = [
{ confId: 0, confValue: "线上" },
{ confId: 1, confValue: "线下" }
]
// 带教管理 支援方式
export const teaching_storeTypeOpt = [
{ confId: 0, confValue: "老店" },
{ confId: 1, confValue: "新店" }
]
// 话术业务场景
export const channelTypeList = [ export const channelTypeList = [
{ confId: 1, confValue: "企业微信" }, { confId: 1, confValue: "企业微信" },
{ confId: 2, confValue: "展业app" } { confId: 2, confValue: "展业app" }
......
...@@ -932,6 +932,60 @@ export const routerName = { ...@@ -932,6 +932,60 @@ export const routerName = {
}, },
component: _import("residentManage/sceneClueManagement/detailView") component: _import("residentManage/sceneClueManagement/detailView")
}, },
91219: {
path: "/teachingManage",
name: "teachingManage",
meta: {
title: "带教管理",
authId: "91219",
parentId: "912",
cache: false
},
auth: [
{
authId: "9121901",
parentId: "91219",
label: "带教任务",
icon: "plus",
category: "Button",
type: "primary",
handle: "handleAdd",
addRoutePath: [
{
authId: "912190101",
name: "新建带教任务",
parentId: "91219"
}
]
},
{
authId: "9121902",
parentId: "91219",
label: "导出",
category: "Button",
handle: "handleExport"
},
{
authId: "9121903",
parentId: "91219",
label: "查看",
handle: "handleDetail"
}
],
component: _import("residentManage/teachingManage/index")
},
912190101: {
path: "/addTeachingTask",
name: "addTeachingTask",
meta: {
title: "新建带教任务",
authId: "912190101",
parentId: "91219",
sideHidden: true,
activePath: "/teachingManage"
},
component: _import("residentManage/teachingManage/addTeachingTask")
},
91220: { 91220: {
path: "/verbalTrickManagement", path: "/verbalTrickManagement",
name: "verbalTrickManagement", name: "verbalTrickManagement",
......
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
<div v-else-if="item.type == 'list'" class="table-box"> <div v-else-if="item.type == 'list'" class="table-box">
<!-- 表格数据 --> <!-- 表格数据 -->
<div class="table-title"> <div class="table-title">
{{ {{ orderInfo.showMerchant ?
orderInfo.showMerchant == 1 orderInfo.showMerchant == 1
? "指定品牌" ? "指定品牌"
: orderInfo.showMerchant == 2 : orderInfo.showMerchant == 2
? "指定门店" ? "指定门店"
: "全部门店" : "全部门店": "-"
}} }}
</div> </div>
<el-table v-if="orderInfo.showMerchant" :data="orderInfo[item.prop]" border :header-cell-style="{ <el-table v-if="orderInfo.showMerchant" :data="orderInfo[item.prop]" border :header-cell-style="{
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
<div v-if="sceneConfig" class="file-box"> <div v-if="sceneConfig" class="file-box">
<div @click="toOpenPDF(i)" class="file-box-inner"> <div @click="toOpenPDF(i)" class="file-box-inner">
<img class="icon" src="../../assets/pdf.png" /> <img class="icon" src="../../assets/pdf.png" />
<div class="title-desc">{{ orderInfo.title }}.pdf</div> <div class="title-desc">{{ orderInfo.detailInfos[0].imageName }}</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -291,8 +291,8 @@ export default { ...@@ -291,8 +291,8 @@ export default {
1: "视频", 1: "视频",
2: "PDF", 2: "PDF",
3: "富文本", 3: "富文本",
4: "excel", 4: "Excel",
5: "word" 5: "Word"
}[cellValue.type] }[cellValue.type]
} }
}, },
......
...@@ -565,6 +565,16 @@ ...@@ -565,6 +565,16 @@
: "" : ""
}}</span> }}</span>
</el-table-column> </el-table-column>
<el-table-column
prop="reconciliationFlag"
label="对账状态"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.reconciliationFlag === 'Y'">已对账</span>
<span v-else>未对账</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="120" fixed="right"> <el-table-column align="center" label="操作" width="120" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text" <!-- <el-button type="text"
...@@ -912,7 +922,7 @@ export default { ...@@ -912,7 +922,7 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList, dowloadList: (state) => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList, updateList: (state) => state.d2admin.user.updateList
}), }),
specialAccout() { specialAccout() {
return this.userInfo?.loginAccount?.loginAccout == "18123663366" return this.userInfo?.loginAccount?.loginAccout == "18123663366"
...@@ -1075,7 +1085,7 @@ export default { ...@@ -1075,7 +1085,7 @@ export default {
this.$refs.fileRuleForm.validate((valid) => { this.$refs.fileRuleForm.validate((valid) => {
if (valid) { if (valid) {
var params = { var params = {
file: this.fileInfo file: this.fileInfo
} }
api.uploadFile(params).then((res) => { api.uploadFile(params).then((res) => {
if (res) { if (res) {
...@@ -1365,7 +1375,6 @@ export default { ...@@ -1365,7 +1375,6 @@ export default {
}, },
getParams() { getParams() {
var params = this.getSelectInputParams() var params = this.getSelectInputParams()
if (this.searchForm.yqMerchantId) { if (this.searchForm.yqMerchantId) {
params.yqMerchantId = this.searchForm.yqMerchantId params.yqMerchantId = this.searchForm.yqMerchantId
} }
...@@ -1407,9 +1416,13 @@ export default { ...@@ -1407,9 +1416,13 @@ export default {
if (this.searchForm?.sceneType == 0 && this.searchForm?.businessType) { if (this.searchForm?.sceneType == 0 && this.searchForm?.businessType) {
params.businessType = this.searchForm?.businessType params.businessType = this.searchForm?.businessType
} }
if (this.searchForm.reconciliationFlag) {
params.reconciliationFlag = this.searchForm?.reconciliationFlag
}
return params return params
}, },
getTotal() { getTotal() {
console.log(this.getParams())
api.getListTotal(this.getParams()).then((res) => { api.getListTotal(this.getParams()).then((res) => {
this.totalObj = res this.totalObj = res
}) })
...@@ -1641,25 +1654,25 @@ export default { ...@@ -1641,25 +1654,25 @@ export default {
display: inline-block; display: inline-block;
} }
.m-l-md { .m-l-md {
margin-left: 20px; margin-left: 20px;
} }
.import-btn { .import-btn {
position: relative; position: relative;
} }
.import-input { .import-input {
opacity: 0; opacity: 0;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
width: 98px; width: 98px;
height: 36px; height: 36px;
cursor: pointer; cursor: pointer;
font-size: 0; font-size: 0;
} }
.import-template { .import-template {
position: absolute; position: absolute;
height: 20px; height: 20px;
top: 50px; top: 50px;
left: 0; left: 0;
} }
</style> </style>
...@@ -85,6 +85,12 @@ export default { ...@@ -85,6 +85,12 @@ export default {
fileName: this.basicInfo.goodsCreateExcel.split('/')[this.basicInfo.goodsCreateExcel.split('/').length - 1] fileName: this.basicInfo.goodsCreateExcel.split('/')[this.basicInfo.goodsCreateExcel.split('/').length - 1]
}) })
} }
if (this.basicInfo.submitGoodsCreateExcel) {
item.fileList.push({
url: this.basicInfo.submitGoodsCreateExcel,
fileName: this.basicInfo.submitGoodsCreateExcel.split('/')[this.basicInfo.goodsCreateExcel.split('/').length - 1]
})
}
// console.log(item.value, 'item.value') // console.log(item.value, 'item.value')
const valueList = item.value ? item.value.split(',') : [] const valueList = item.value ? item.value.split(',') : []
valueList.forEach((k, kIdx) => { valueList.forEach((k, kIdx) => {
......
...@@ -5,43 +5,18 @@ ...@@ -5,43 +5,18 @@
<span>流量方信息</span> <span>流量方信息</span>
</div> </div>
<div style="padding: 20px"> <div style="padding: 20px">
<glsx-combi-form <glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px"
class="edit-form-container" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
ref="editFormRef"
label-width="150px"
default-width="314px"
:form-ref="editChildRef"
:form-obj="editData"
:form-data="editFormData"
:form-rules="formRules"
>
<div slot="merchantId" slot-scope="scope"> <div slot="merchantId" slot-scope="scope">
<el-select <el-select v-model="editData[scope.scope.name]" disabled :placeholder="scope.scope.placeholder"
v-model="editData[scope.scope.name]" @change="scope.scope.changeAttr" style="width: 274px" filterable remote reserve-keyword
disabled @visible-change="(event) => selectVisibleChange(event, scope.scope)" :remote-method="(event) => remoteMethod(event, scope.scope.searchKey, 'store')
:placeholder="scope.scope.placeholder" " v-el-select-loadmore="interestsLoadmoreMerchant">
@change="scope.scope.changeAttr" <el-option v-for="subItem in scope.scope.optionList" :key="subItem[scope.scope.optionId]"
style="width: 274px" :label="subItem[scope.scope.optionLabel]" :value="subItem[scope.scope.optionId]">
filterable
remote
reserve-keyword
@visible-change="(event) => selectVisibleChange(event, scope.scope)"
:remote-method="
(event) => remoteMethod(event, scope.scope.searchKey, 'store')
"
v-el-select-loadmore="interestsLoadmoreMerchant"
>
<el-option
v-for="subItem in scope.scope.optionList"
:key="subItem[scope.scope.optionId]"
:label="subItem[scope.scope.optionLabel]"
:value="subItem[scope.scope.optionId]"
>
</el-option> </el-option>
</el-select> </el-select>
<el-button type="text" class="add-mer-btn" @click="handleAddMerchant" <el-button type="text" class="add-mer-btn" @click="handleAddMerchant">新建</el-button>
>新建</el-button
>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
...@@ -69,7 +44,7 @@ export default { ...@@ -69,7 +44,7 @@ export default {
props: { props: {
editData: { editData: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
...@@ -369,7 +344,7 @@ export default { ...@@ -369,7 +344,7 @@ export default {
hasAll && hasAll &&
this.baseData[item.optionsName].length && this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][ this.baseData[item.optionsName][0][
this[formName][index].optionLabel this[formName][index].optionLabel
] !== "全部" ] !== "全部"
) { ) {
const temp = {} const temp = {}
...@@ -392,7 +367,7 @@ export default { ...@@ -392,7 +367,7 @@ export default {
hasAll && hasAll &&
this.baseData[item.optionsName].length && this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][ this.baseData[item.optionsName][0][
this[formName][index].optionLabel this[formName][index].optionLabel
] !== "全部" ] !== "全部"
) { ) {
const temp = {} const temp = {}
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<div class="view"> <div class="view" v-if="!templateDealList.map(k => k.name).includes(searchFormSearch.typeName)">
<div class="view-item"> <div class="view-item">
<div class="label">应收日报数<el-button v-if="showEdit" type="text" class="btn" @click="openDrawer(1)">修改名单</el-button></div> <div class="label">应收日报数<el-button v-if="showEdit" type="text" class="btn" @click="openDrawer(1)">修改名单</el-button></div>
<div class="value"><span class="orange">{{summaryData.totalCount}}</span>份</div> <div class="value"><span class="orange">{{summaryData.totalCount}}</span>份</div>
...@@ -87,6 +87,11 @@ ...@@ -87,6 +87,11 @@
<div class="text-box" slot="textarea" slot-scope="scope"> <div class="text-box" slot="textarea" slot-scope="scope">
{{scope.scope[scope.prop] || '-'}} {{scope.scope[scope.prop] || '-'}}
</div> </div>
<div slot="upload" class="upload-box" slot-scope="scope">
<div class="uploade-btn" v-show="!scope.scope['assessmentResult' + trainTmlpSuffix]" @click="handleUpload(scope.scope)">上传</div>
<div class="uploade-btn" v-show="scope.scope['assessmentResult' + trainTmlpSuffix]" @click="handleDelete(scope.scope)">删除</div>
<a v-show="scope.scope['assessmentResult' + trainTmlpSuffix]" class="uploade-btn" :href="scope.scope['assessmentResult' + trainTmlpSuffix]" target="_blank">查看</a>
</div>
<div class="text-box" slot="link" slot-scope="scope"> <div class="text-box" slot="link" slot-scope="scope">
<template v-if="scope.scope[scope.prop]"> <template v-if="scope.scope[scope.prop]">
<a :href="scope.scope[scope.prop]" target="_blank">查看</a> <a :href="scope.scope[scope.prop]" target="_blank">查看</a>
...@@ -106,6 +111,36 @@ ...@@ -106,6 +111,36 @@
</div> </div>
<Drawer :drawerVisible="drawer" :type="contentType" :templateData="templateData" @handleClose="handleClose" @handleSubmit="handleSubmit"> <Drawer :drawerVisible="drawer" :type="contentType" :templateData="templateData" @handleClose="handleClose" @handleSubmit="handleSubmit">
</Drawer> </Drawer>
<d2-dialog :title="'上传文件'"
:is-visible="fileVisible"
@closeDialog="handleBatchImport"
@confirmDialog="handleConfirmImport">
<slot>
<el-form :model="fileForm"
ref="fileRuleForm"
:rules="fileRules"
label-width="120px">
<el-form-item label="导入文件:"
prop="fileName">
<el-col :span="16">
<el-input readonly
v-model="fileForm.fileName" />
</el-col>
<el-col :span="4"
class="m-l-md">
<el-button class="import-btn">
导入文件
<input type="file"
id="fileUpload"
class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/pdf,image/png,image/jpeg"
@change="importFile($event)">
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
</d2-container> </d2-container>
</div> </div>
</template> </template>
...@@ -113,7 +148,8 @@ ...@@ -113,7 +148,8 @@
<script> <script>
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getTemplateList, getStaffList, getRecordPage, getTemplateDetail, getSummary, updateStaff } from "@api/resident" import { getTemplateList, getStaffList, getRecordPage, getTemplateDetail, getSummary, updateStaff, updateTmlpStaffItem } from "@api/resident"
import { uploadFile } from "@/api/sys.base"
import Drawer from './drawer.vue'; import Drawer from './drawer.vue';
// import mockData from '../data.json' // import mockData from '../data.json'
// import recordData from './record.json' // import recordData from './record.json'
...@@ -127,6 +163,20 @@ export default { ...@@ -127,6 +163,20 @@ export default {
data() { data() {
return { return {
labelWidth: '100px', labelWidth: '100px',
templateDealList: [{
name: '导师培训日报模板',
searchTxt: '导师'
}, {
name: '督导培训日报模板',
searchTxt: '督导'
}],
// 适配不同“带教配置”模版字段,organizeTraining/organizeTraining_1/organizeTraining_2
trainTmlpSuffix: '',
fileVisible: false,
fileForm: {},
fileRules: {
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
searchForm: { searchForm: {
createdDate: [new Date(), new Date()], createdDate: [new Date(), new Date()],
startTime: '', startTime: '',
...@@ -155,6 +205,11 @@ export default { ...@@ -155,6 +205,11 @@ export default {
} }
], ],
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
let staffIdx = this.showFormData.findIndex(item => item.name == 'merchantIds')
this.showFormData[staffIdx].label = '员工'
if(this.templateDealList.map(k => k.name).includes(value)) {
this.showFormData[staffIdx].label = this.templateDealList.find(k => k.name == value).searchTxt
}
this.searchForm.merchantIds = '' this.searchForm.merchantIds = ''
this.getStaff() this.getStaff()
} }
...@@ -293,14 +348,28 @@ export default { ...@@ -293,14 +348,28 @@ export default {
} }
this.getTableList() this.getTableList()
}, },
/**
* 适配“带教培训”模版
*/
fitTraninTmlp(tabName) {
let matchStr = 'organizeTraining'
let afterMatch = ''
let index = tabName.indexOf(matchStr);
if (index !== -1) {
// 获取匹配字符串后面的所有字符
afterMatch = tabName.substring(index + matchStr.length);
}
return afterMatch
},
// 改变表头 // 改变表头
changeTable(norefresh = false) { changeTable(norefresh = false) {
this.tableData = [] this.tableData = []
let colums = [] let colums = []
this.sortObj = {} this.sortObj = {}
this.trainTmlpSuffix = this.fitTraninTmlp(this.activeName)
console.log(this.trainTmlpSuffix)
this.tabList.find(item => item.key == this.activeName).items.forEach(i => { this.tabList.find(item => item.key == this.activeName).items.forEach(i => {
const frontRule = JSON.parse(i.frontRule) const frontRule = JSON.parse(i.frontRule)
// console.log(frontRule);
const obj = { const obj = {
label: i.name, label: i.name,
prop: i.key prop: i.key
...@@ -332,7 +401,12 @@ export default { ...@@ -332,7 +401,12 @@ export default {
weekRate: n.weekRate, weekRate: n.weekRate,
suffix: n.suffix suffix: n.suffix
} }
} else { } else if (frontRule && frontRule.addHtml == 'upload') {
console.log(obj, 'obj---------------------')
console.log(n.key)
obj[n.key] = n.value
obj.id = n.id
} else {
obj[n.key] = n.value obj[n.key] = n.value
} }
}) })
...@@ -349,6 +423,7 @@ export default { ...@@ -349,6 +423,7 @@ export default {
pageSize: 10, pageSize: 10,
currentPage: 1 currentPage: 1
} }
this.searchFormSearch = { ...this.getParams() }
const { createdDate, merchantIds } = this.searchForm const { createdDate, merchantIds } = this.searchForm
// this.showEdit = dayjs(this.searchForm.createdDate).format('YYYY-MM-DD') == dayjs(new Date()).format('YYYY-MM-DD') // this.showEdit = dayjs(this.searchForm.createdDate).format('YYYY-MM-DD') == dayjs(new Date()).format('YYYY-MM-DD')
this.showEdit = dayjs(createdDate[0]).format('YYYY-MM-DD') == dayjs(new Date()).format('YYYY-MM-DD') this.showEdit = dayjs(createdDate[0]).format('YYYY-MM-DD') == dayjs(new Date()).format('YYYY-MM-DD')
...@@ -369,7 +444,9 @@ export default { ...@@ -369,7 +444,9 @@ export default {
this.tabList = r1.types this.tabList = r1.types
this.activeName = this.tabList[0].key this.activeName = this.tabList[0].key
// 总览 // 总览
this.summaryData = await getSummary(params1) if(!this.templateDealList.map(k => k.name).includes(this.searchForm.typeName)) {
this.summaryData = await getSummary(params1)
}
this.templateData.staffUuidList = this.searchForm.merchantIds this.templateData.staffUuidList = this.searchForm.merchantIds
this.getTableList() this.getTableList()
}, },
...@@ -422,6 +499,93 @@ export default { ...@@ -422,6 +499,93 @@ export default {
this.handleSearch() this.handleSearch()
}, },
handleUpload(scope) {
console.log(scope)
this.fileForm.id = scope.id
this.fileVisible = !this.fileVisible
},
handleBatchImport() {
this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
},
handleDelete(scope) {
this.$confirm('删除后不可恢复,是否删除?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
var params = {
id: scope.id,
value: ''
}
updateTmlpStaffItem(params).then(res => {
this.notice.okTips()
this.notice.okTips('删除成功')
this.handleSearch()
})
}).catch(err => {
console.log(err)
})
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = {
...this.fileForm
}
updateTmlpStaffItem(params).then(res => {
if (res) {
document.getElementById('fileUpload').value = ''
this.fileForm.fileName = ''
this.fileVisible = false
this.notice.okTips('提交成功')
this.handleSearch()
}
})
}
})
},
// 上传文件,转码为base64
importFile(e) {
console.log(e, 'e000')
const size = e.target.files[0].size / 1024 / 1024
const fileTypeKey = {
"application/pdf": "pdf",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
"excel",
"application/vnd.ms-excel": "excel",
"application/msword": "doc",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document":
"doc",
"image/png": "image",
"image/jpeg": "image"
}
if (size < 9) {
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileInfo = e.target.files[0].name.split('.')[e.target.files[0].name.split('.')?.length - 1] + '@' + arrBase64[1]
// document.getElementById('fileUpload').value = ''
console.log(uploadFile, 'uploadFile')
uploadFile({
file: fileInfo,
fileType: fileTypeKey[e.target.files[0].type],
})
.then((res) => {
this.fileForm.value = res
})
.catch(() => {
})
}
} else {
this.notice.errorTips('上传文件不可超过9M')
}
},
handleExport() { handleExport() {
// var params = this.searchFormSearch // var params = this.searchFormSearch
const { merchantIds } = this.searchForm const { merchantIds } = this.searchForm
...@@ -582,4 +746,30 @@ export default { ...@@ -582,4 +746,30 @@ export default {
padding-left: 0; padding-left: 0;
} }
} }
.upload-box {
display: flex;
justify-content: center;
align-items: center;
}
.uploade-btn {
cursor: pointer;
margin-left: 6px;
color: #5850ff;
}
.import-btn {
position: relative;
margin-left: 10px !important;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
</style> </style>
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
}, },
searchFormSearch: {}, searchFormSearch: {},
searchForm: { searchForm: {
businessCodeArr:[], businessCodeArr: [],
storeName: "", storeName: "",
reportDate: [], reportDate: [],
storeBrandId: "", storeBrandId: "",
...@@ -114,13 +114,25 @@ export default { ...@@ -114,13 +114,25 @@ export default {
label: "主营品牌", label: "主营品牌",
name: "storeBrandId", name: "storeBrandId",
type: "select", type: "select",
// multiple: true, // multiple: true,
isClear: true, isClear: true,
collapseTags: true,
optionList: [], optionList: [],
optionId: "id", optionId: "id",
optionLabel: "label", optionLabel: "label",
optionsName: "brandList" optionsName: "brandList"
}, },
// {
// label: "主营品牌",
// name: "storeBrandId",
// type: "select",
// // multiple: true,
// isClear: true,
// optionList: [],
// optionId: "id",
// optionLabel: "label",
// optionsName: "brandList"
// },
{ {
label: "业务类型", label: "业务类型",
name: "businessCode", name: "businessCode",
...@@ -161,10 +173,13 @@ export default { ...@@ -161,10 +173,13 @@ export default {
}) })
}, },
beforeSearchFn(type = 1) { beforeSearchFn(type = 1) {
console.log(this.searchForm) console.log(this.searchForm)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.businessCode=this.searchFormSearch.businessCodeArr.length>1?this.searchFormSearch.businessCodeArr[1]:'' this.searchFormSearch.businessCode =
this.searchFormSearch.businessCodeArr.length > 1
? this.searchFormSearch.businessCodeArr[1]
: ""
if (this.searchForm?.reportDate?.length) { if (this.searchForm?.reportDate?.length) {
let [startDate, endDate] = this.searchForm.reportDate let [startDate, endDate] = this.searchForm.reportDate
this.searchFormSearch.startDate = Util.dateFormate( this.searchFormSearch.startDate = Util.dateFormate(
...@@ -232,13 +247,21 @@ export default { ...@@ -232,13 +247,21 @@ export default {
}) })
}) })
}, },
getBrandList() { getBrandList() {
const brandList = []
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getBrandList({}) getBrandList({ containsChildren: true })
.then((res) => { .then((res) => {
this.baseData.brandList = res res.map((e) => {
resolve(res) // 返回结果以便主流程感知 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) => { .catch((err) => {
console.error("Error in getBrandList:", err) console.error("Error in getBrandList:", err)
......
<template>
<d2-dialog :title="title"
:is-visible.sync="selectStoreVisible"
width="70%"
btn-ok-label="确定"
@confirmDialog="handleSelectStoreConfirm"
@closeDialog="handleSelectStoreClose"
class="selectStore">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
</div>
<d2-table ref="groundingIndexTable"
:has-num="false"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<template slot="select_btn"
slot-scope="scope">
<el-radio v-model="selectedRowId"
:label="scope.scope.merchantId">{{ '' }}</el-radio>
</template>
<div slot="areaOperatorHtml"
slot-scope="scope">
<template v-if="
scope.scope.areaOperatorList && scope.scope.areaOperatorList.length > 1
">
<span>{{ scope.scope.areaOperatorList[0].areaOperatorName + ' ' + scope.scope.areaOperatorList[0].areaOperatorPhone }}</span>
<el-popover placement="top"
width="fit-content"
trigger="hover">
<div :class="{ scrollHeight: scope.scope.areaOperatorList.length >= 10 }">
<div v-for="(item, index) in scope.scope.areaOperatorList"
:key="index">
{{ item.areaOperatorName + ' ' + item.areaOperatorPhone }}
</div>
</div>
<span class="more-info"
slot="reference">...({{ scope.scope.areaOperatorList.length }})</span>
</el-popover>
</template>
<template v-else>
<span>--</span>
</template>
</div>
</d2-table>
</d2-dialog>
</template>
<script>
import { areaOperatorList } from '@api/teachingManage'
export default {
name: 'SelectStoreDialog',
props: {
title: {
type: String,
default: "选择门店"
},
selectStoreVisible: {
type: Boolean,
default: false
},
supervisorUuid: {
type: String,
default: ""
}
},
data() {
return {
getListApi: areaOperatorList,
tableData: [],
showFormData: [{
label: '门店名称',
name: 'merchantIdName',
type: 'input',
maxlength: 50,
isClear: true,
keyFn: this.keyDowmGetList
}],
searchForm: {
merchantIdName: ''
},
baseData: {
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [{
label: '',
width: '60',
addHtml: 'select_btn'
}, {
label: '门店名称',
prop: 'merchantName'
}, {
label: '区域运营',
prop: 'areaOperatorList',
addHtml: 'areaOperatorHtml'
}]
},
selectedRowId: ''
}
},
mounted() {
// this.getList()
},
methods: {
// getList() {
// const params = this.searchForm
// getDudaoList(params).then(res => {
// this.tableData = res || []
// })
// },
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.supervisorUuid = this.supervisorUuid
resolve()
})
},
setTableFinishFun(data) {
this.tableData = data
},
handleSelectStoreConfirm() {
const selectData = this.tableData?.find(v => v.merchantId == this.selectedRowId)
if (!selectData) return this.$message.warning('请选择门店')
this.$emit('handleSelectStoreConfirm', selectData)
},
handleSelectStoreClose() {
this.$emit('handleSelectStoreClose')
}
}
}
</script>
<style lang="scss" scoped>
.show-search {
::v-deep .d2-search-block {
padding: 0;
}
}
.more-info {
white-space: nowrap;
color: #5850ff;
cursor: pointer;
}
</style>
<template>
<d2-dialog :title="title"
:is-visible.sync="selectSupervisorVisible"
width="50%"
btn-ok-label="确定"
@confirmDialog="handleSelectSupervisorConfirm"
@closeDialog="handleSelectSupervisorClose"
class="selectSupervisor">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
</div>
<d2-table ref="groundingIndexTable"
:has-num="false"
:has-page="false"
:search-form="searchForm"
:table-params="tableParams"
:table-data="tableData"
:before-search-fn="beforeSearchFn">
<template slot="select_btn"
slot-scope="scope">
<el-radio v-model="selectedRowId"
:label="scope.scope.id">{{ '' }}</el-radio>
</template>
</d2-table>
</d2-dialog>
</template>
<script>
import { getDudaoList } from '@api/teachingManage'
export default {
name: 'SelectSupervisorDialog',
props: {
title: {
type: String,
default: "选择督导"
},
selectSupervisorVisible: {
type: Boolean,
default: false
}
},
data() {
return {
// getListApi: getDudaoList,
tableData: [],
showFormData: [{
label: '督导名称',
name: 'upgradeGoodsName',
type: 'input',
maxlength: 50,
width: '250px',
isClear: true,
keyFn: this.keyDowmGetList
}],
searchForm: {
roleName: '飞行督导'
},
baseData: {
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [{
label: '',
width: '60',
addHtml: 'select_btn'
}, {
label: '督导名称',
prop: 'staffName'
}, {
label: '手机号',
prop: 'staffPhone'
}]
},
selectedRowId: ''
}
},
mounted() {
this.getList()
},
methods: {
getList() {
const params = this.searchForm
getDudaoList(params).then(res => {
this.tableData = res || []
})
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleSelectSupervisorConfirm() {
const selectData = this.tableData?.find(v => v.id == this.selectedRowId)
if (!selectData) return this.$message.warning('请选择督导')
this.$emit('handleSelectSupervisorConfirm', selectData)
},
handleSelectSupervisorClose() {
this.$emit('handleSelectSupervisorClose')
}
}
}
</script>
<style lang="scss" scoped>
.show-search {
::v-deep .d2-search-block {
padding: 0;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!