Commit 82ff1f69 by wangzhihui

长课程

1 parent 3aef2d8f
......@@ -106,3 +106,14 @@ export function getStaffInfo(data) {
data.method = `${path}servicecenter.staff.info`
return request(data, RequestMethods.POST)
}
// 长课程配置-查询课程列表
export function getStaffTagCourseList(data = {}) {
data.method = `${path}servicecenter.contentmanager.staff.tag.course`
return request(data, RequestMethods.POST)
}
//提交配置
export function insertOrUpdate(data) {
data.method = `${path}contentManagerTask.insertOrUpdate`
return request(data, RequestMethods.POST)
}
......@@ -6,17 +6,17 @@
:class="['type', titleActiveIndex == index ? 'active' : '']"
v-for="(item, index) in titleTypeList"
:key="index"
@click="handleClick(index)"
@click="handleTitleClick(index)"
>
{{ item.title }}
</div>
</div>
<div class="content gl-form-page">
<el-form :inline="true" :model="cousrFrom" class="form-inline">
<el-form :inline="true" :model="courseForm" class="form-inline">
<el-form-item>
<el-input
prefix-icon="el-icon-search"
v-model="cousrFrom.user"
v-model="courseForm.tagSearch"
placeholder="课程/标签搜索"
></el-input>
</el-form-item>
......@@ -27,20 +27,34 @@
<el-button @click="resetForm" size="small">重置</el-button>
</el-form-item>
</el-form>
<el-checkbox-group v-model="checkedCities">
<el-checkbox v-for="city in cityOptions" :label="city" :key="city">
<div class="title">问界延保+安心包套餐培训视频(含考核)</div>
<el-checkbox-group v-model="selected" @change="handleCheckedChange">
<el-checkbox
v-for="course in courseList"
:key="course.id"
:label="course.courseId"
>
<div class="title">{{ course.courseName }}</div>
<el-tooltip
effect="light"
placement="top"
popper-class="tools-gltip"
>
<div slot="content" class="process-info">
<div>学习进度:<span>已完成</span></div>
<div>考核成绩:<span>80分</span></div>
<div>完成时间:<span>2025-06-30 16:30:05</span></div>
<div v-if="course.status">
学习进度:<span>
{{ statusObj[course.status] }}
</span>
</div>
<div>
考核成绩:<span>{{ course.totalScore || 0 }}分</span>
</div>
<div>
完成时间:<span>{{ course.finishDate || "-" }}</span>
</div>
</div>
<div class="status orange" v-if="course.status">
{{ statusObj[course.status] }}
</div>
<div class="status orange">已完成</div>
</el-tooltip>
</el-checkbox>
</el-checkbox-group>
......@@ -49,7 +63,9 @@
<div class="right">
<div class="title-type">
<div class="select">已选课程</div>
<div class="time">共3节 75min</div>
<div class="time">
共{{ selectObj.count }}节 {{ selectObj.courseTotalDuration }}min
</div>
</div>
<div class="reminder">
<img
......@@ -58,39 +74,117 @@
/>提示:总课程时长建议< 60 min
</div>
<div class="select-list">
<div class="select-item" v-for="i in 20">
<div
class="select-item"
v-for="(selectCourse, index) in selectCourseList"
:key="selectCourse.courseId"
>
<div class="item-content">
问界销售异议处理问界销售异议处理问界销售异议处理-质量异议(含考核)<span
class="item-time"
>25min</span
{{ selectCourse.courseName
}}<span class="item-time"
>{{ selectCourse.courseTotalDuration }}min</span
>
</div>
<div class="del">删除</div>
<div class="del" @click="delCourse(selectCourse)">删除</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { getStaffTagCourseList } from "@/api/serviceCentre"
export default {
name: "allocation",
data() {
return {
cousrFrom: {
user: ""
courseForm: {
tagSearch: "",
queryAll: false
},
checkedCities: [],
selected: [],
selectCourseList: [],
titleActiveIndex: 0,
titleTypeList: [{ title: "推荐课程" }, { title: "自选课程" }],
cityOptions: ["上海", "北京", "广州", "深圳"]
titleTypeList: [
{ title: "推荐课程", queryAll: false },
{ title: "自选课程", queryAll: true }
],
cityOptions: ["上海", "北京", "广州", "深圳"],
statusObj: {
1: "未学习",
2: "未完成",
3: "待考核",
4: "未通过",
5: "已完成"
},
selectObj: {
courseTotalDuration: 0,
count: 0
}
}
},
props: {
courseList: {
type: Array,
default: () => []
}
},
mounted() {
console.log(this.courseList, "courseList")
},
methods: {
handleClick(index) {
handleCheckedChange(val) {
console.log(val)
this.selected = val ? val : []
this.handleCourse()
},
handleCourse() {
this.selectObj = {
courseTotalDuration: 0,
count: 0
}
this.selectCourseList = this.courseList.filter((item) => {
const isSelected = this.selected.includes(item.courseId)
if (isSelected) {
this.selectObj.courseTotalDuration += item.courseTotalDuration
this.selectObj.count += 1
}
return isSelected
})
this.$emit("handleCourse", this.selectCourseList)
},
delCourse(val) {
this.selectObj = {
courseTotalDuration: 0,
count: 0
}
let currentIndex = this.selectCourseList.findIndex(
(item) => item.courseId == val.courseId
)
let selectedIndex = this.selected.findIndex(
(item) => item == val.courseId
)
this.selected.splice(selectedIndex, 1)
this.selectCourseList.splice(currentIndex, 1)
this.selectCourseList.forEach((item) => {
this.selectObj.courseTotalDuration += item.courseTotalDuration
this.selectObj.count += 1
})
this.$emit("handleCourse", this.selectCourseList)
},
handleTitleClick(index) {
this.titleActiveIndex = index
this.courseForm.queryAll = this.titleTypeList[index].queryAll
console.log(this.courseForm, " this.courseForm")
this.search()
},
resetForm() {},
search() {}
resetForm() {
this.courseForm.tagSearch = ""
this.search()
},
search() {
this.$EventBus.$emit("fromAllocation", this.courseForm)
}
}
}
</script>
......@@ -161,13 +255,14 @@ export default {
padding: 14px 16px;
white-space: wrap;
border-right: 1px solid #e5e5e5;
min-width: 284px;
}
.item-time {
font-size: 12px;
color: #666666;
}
.del {
padding: 14px 18px;
padding: 0 18px;
color: #2a58ad;
font-size: 14px;
white-space: nowrap;
......
......@@ -40,6 +40,10 @@
<components
:is="tabName"
:staffDetailInfo="staffDetailInfo"
:courseList="courseList"
:staffItem="staffItem"
@handleConfigureCourse="handleConfigureCourse"
:staffList="staffList"
></components>
</div>
</div>
......@@ -49,10 +53,12 @@
<script>
import staffDetail from "./staffDetail"
import couseAllocation from "./couseAllocation"
import {
customizeList,
findStaffByMerchantNo,
findStoreEmployeePerformance
findStoreEmployeePerformance,
getStaffTagCourseList
} from "@/api/serviceCentre"
export default {
name: "configureCourse",
......@@ -69,8 +75,10 @@ export default {
label: "课程配置"
}
],
tabName: "couseAllocation",
tabName: "staffDetail",
staffItem: {},
staffList: [],
courseList: [],
staffDetailInfo: {},
statisticsObj: {
total: 0,
......@@ -78,26 +86,58 @@ export default {
}
}
},
async created() {
created() {
this.$EventBus.$on("fromAllocation", (courseForm) => {
console.log("父组件接收到孙组件事件:", courseForm)
this.getStaffTagCourseList(courseForm)
})
},
async mounted() {
this.queryData = this.$route.query
//获取员工列表
await this.getStaffInfoData()
//查询员工详情
this.findStoreEmployeePerformanceData()
// //获取配置课程列表
// this.getStaffTagCourseList()
},
methods: {
//提交本员工配置回调
async handleConfigureCourse() {
this.staffIndex = 0
//获取员工列表
await this.getStaffInfoData()
this.handleTabClick(0)
},
findStoreEmployeePerformanceData() {
let { staffIndex, staffList, queryData } = this
// this.staffPhone = "18978849947"
findStoreEmployeePerformance({
phone: "18978849947",
// phone: staffList[staffIndex].phone,
// phone: "18978849947",
phone: staffList[staffIndex].phone,
scene: queryData.scene
}).then((res) => {
console.log(this.staffItem, "staffItem")
this.staffDetailInfo = res
console.log(res)
})
},
getStaffTagCourseList(courseForm = {}) {
let params = {
// staffPhone: "18978849947",
staffPhone: this.staffItem.phone,
currentPage: 1,
pageSize: 99999,
queryAll: false,
...courseForm
}
getStaffTagCourseList(params).then((res) => {
console.log(res, "getStaffTagCourseList")
this.courseList = res ? res.list : []
})
},
handleStatistics() {
let total = 0,
complete = 0
......@@ -125,7 +165,13 @@ export default {
},
handleClick(index) {
this.staffIndex = index
this.findStoreEmployeePerformanceData()
this.staffItem = this.staffList[this.staffIndex]
if (this.activeName == 0) {
this.findStoreEmployeePerformanceData()
} else {
//获取配置课程列表
this.getStaffTagCourseList()
}
},
handleTabClick(index) {
this.activeName = index
......@@ -134,7 +180,12 @@ export default {
1: "couseAllocation"
}
this.tabName = arr[+this.activeName]
this.findStoreEmployeePerformanceData()
if (index == 0) {
this.findStoreEmployeePerformanceData()
} else {
//获取配置课程列表
this.getStaffTagCourseList()
}
}
}
}
......
......@@ -140,7 +140,8 @@ export default {
name: "configureCourse",
query: {
scene: this.longForm.scene,
merchantNos: item.merchantNos ? item.merchantNos : [44211227]
merchantNos: [44211227]
// merchantNos: item.merchantNos ? item.merchantNos : [44211227]
}
})
},
......
......@@ -5,6 +5,7 @@
:dialog-config="dialogConfig"
:is-show.sync="visible"
class="accountDailog"
:config="config"
@handleClick="handleConfirm"
@closeDialog="handleClose"
>
......@@ -22,11 +23,11 @@
<div class="staff-list">
<div
:class="['staff-item', item.active ? 'active' : '']"
v-for="(item, index) in staffList"
v-for="(item, index) in selectStaffList"
:key="index"
@click="item.active = !item.active"
@click="handleChooseStaff(index)"
>
{{ item.text }}
{{ item.employeeName }}
</div>
</div>
</template>
......@@ -35,11 +36,26 @@
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
export default {
props: {
multipleVisible: {
type: Boolean,
default: false
},
staffList: {
type: Array,
default: () => []
}
},
watch: {
staffList: {
handler(val) {
console.log(val, "🚀🚀🚀🚀🚀🚀🚀🚀🚀")
this.filterStaffList(deepClone(val))
},
deep: true,
immediate: true
}
},
computed: {
......@@ -61,7 +77,14 @@ export default {
title: "多人配置",
width: "720px"
},
checkAll: true,
config: {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: "取 消",
confirm_name: "确定配置"
},
checkAll: false,
infoRules: {
refundType: [
{
......@@ -79,71 +102,22 @@ export default {
addHtml: "multiple"
}
],
staffList: [
{
text: "杨婷瑶",
value: 1,
active: true
},
{
text: "魏小敏",
value: 2,
active: false
},
{
text: "侯裕",
value: 3,
active: false
},
{
text: "杨婷瑶",
value: 1,
active: true
},
{
text: "魏小敏",
value: 2,
active: false
},
{
text: "侯裕",
value: 3,
active: false
},
{
text: "杨婷瑶",
value: 1,
active: true
},
{
text: "魏小敏",
value: 2,
active: false
},
{
text: "侯裕",
value: 3,
active: false
},
{
text: "杨婷瑶",
value: 1,
active: true
},
{
text: "魏小敏",
value: 2,
active: false
},
{
text: "侯裕",
value: 3,
active: false
}
]
selectStaffList: []
}
},
methods: {
handleChooseStaff(index) {
this.selectStaffList[index].active = !this.selectStaffList[index].active
this.checkAll = this.selectStaffList.every((item) => item.active)
},
filterStaffList(val) {
this.selectStaffList = []
val.forEach((item) => {
if (item.courseConfigFlag != 1) {
this.selectStaffList.push(item)
}
})
},
handleCheckAllChange() {
this.staffList.forEach((item) => {
item.active = this.checkAll
......@@ -153,6 +127,8 @@ export default {
this.visible = false
},
handleConfirm() {
this.$emit("handleMultiple", this.selectStaffList)
// this.$emit("handleMultiple")
this.visible = false
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!