47 changed files with 2525 additions and 172 deletions
@ -0,0 +1,13 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
|
||||
|
// USER_CODE_BEGIN -- service_logs
|
||||
|
/** |
||||
|
* |
||||
|
* @param params |
||||
|
* @returns |
||||
|
*/ |
||||
|
export function getServiceLogsList(params) { |
||||
|
return request.get(`service_logs/service_logs`, {params}) |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,172 @@ |
|||||
|
<template> |
||||
|
<el-dialog |
||||
|
v-model="showDialog" |
||||
|
title="客户详情" |
||||
|
width="80%" |
||||
|
class="user-profile p-6" |
||||
|
:destroy-on-close="true" |
||||
|
> |
||||
|
|
||||
|
<!-- 顶部用户信息 --> |
||||
|
<el-card class="mb-4"> |
||||
|
<div class="flex items-center"> |
||||
|
<el-avatar :size="60" class="mr-4" :src="user.headimg"/> |
||||
|
<div> |
||||
|
<h2 class="text-xl font-bold">{{ user.nickname }}</h2> |
||||
|
<div style="display: flex; gap: 200px;margin-top: 10px;"> |
||||
|
<p>ID: U{{ user.member_id }}</p> |
||||
|
<p>电话: {{ user.mobile }}</p> |
||||
|
<p>住址: {{ user.address }}</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
|
||||
|
<!-- 标签导航 --> |
||||
|
<el-tabs v-model="activeTab" class="mb-4"> |
||||
|
<el-tab-pane label="六要素" name="six-elements" /> |
||||
|
<el-tab-pane label="修改日志" name="log" /> |
||||
|
<el-tab-pane label="学生情况" name="student" /> |
||||
|
<el-tab-pane label="订单列表" name="orders" /> |
||||
|
</el-tabs> |
||||
|
|
||||
|
<!-- 六要素信息卡片 --> |
||||
|
<el-card v-if="activeTab === 'six-elements'"> |
||||
|
<h3 class="text-lg font-bold mb-4">六要素信息</h3> |
||||
|
<el-row :gutter="20" class="mb-2"> |
||||
|
<el-col :span="12">需求购买力:<el-tag>{{ info.purchasePower }}</el-tag></el-col> |
||||
|
<el-col :span="12">认知理念:<el-tag>{{ info.knowledge }}</el-tag></el-col> |
||||
|
|
||||
|
</el-row> |
||||
|
<el-row :gutter="20" class="mb-2"> |
||||
|
<el-col :span="12">距离:<span>{{ info.distance }}</span></el-col> |
||||
|
<el-col :span="12">可谈上课时间:<span>{{ info.canTalkDate }}</span></el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row :gutter="20" class="mb-2"> |
||||
|
<el-col :span="12">承诺到访时间:<span>{{ info.promisedVisitDate }}</span></el-col> |
||||
|
<el-col :span="12">实际到访时间:<span>{{ info.actualVisitDate }}</span></el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="20" class="mb-2"> |
||||
|
<el-col :span="12">电话后的意向程度:<el-tag>{{ info.phoneIntention }}</el-tag></el-col> |
||||
|
<el-col :span="12">是否关单: |
||||
|
<el-tag :type="info.isClosed ? 'success' : 'danger'">{{ info.isClosed ? '是' : '否' }}</el-tag> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!-- 备注与访问情况 --> |
||||
|
<el-form label-position="top" class="mt-4"> |
||||
|
<el-form-item label="沟通备注"> |
||||
|
<el-input v-model="info.notes" placeholder="填写备注" disabled/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="一访情况"> |
||||
|
<el-input v-model="info.visit1" placeholder="填写一访情况" disabled/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="二访情况"> |
||||
|
<el-input v-model="info.visit2" placeholder="填写二访情况" disabled/> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-card> |
||||
|
|
||||
|
<el-card v-if="activeTab === 'log'"> |
||||
|
<log :value="user.id"/> |
||||
|
</el-card> |
||||
|
|
||||
|
<el-card v-if="activeTab === 'student'"> |
||||
|
<student :value="user.id"/> |
||||
|
</el-card> |
||||
|
|
||||
|
<el-card v-if="activeTab === 'orders'"> |
||||
|
<orders :value="user.id"/> |
||||
|
</el-card> |
||||
|
|
||||
|
|
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script setup> |
||||
|
import { useDictionary } from '@/app/api/dict' |
||||
|
import { ref, reactive, computed, watch } from 'vue' |
||||
|
import Log from '@/app/views/customer_resources/components/log.vue' |
||||
|
import Student from '@/app/views/customer_resources/components/student_courses.vue' |
||||
|
import Orders from '@/app/views/customer_resources/components/order_table.vue' |
||||
|
let showDialog = ref(false) |
||||
|
|
||||
|
|
||||
|
const activeTab = ref('six-elements') |
||||
|
|
||||
|
const user = reactive({ |
||||
|
id: '', |
||||
|
member_id:'', |
||||
|
nickname: '', |
||||
|
headimg: '', |
||||
|
mobile:'', |
||||
|
address:'' |
||||
|
}) |
||||
|
|
||||
|
const info = reactive({ |
||||
|
purchasePower: '', |
||||
|
knowledge: '', |
||||
|
distance: '', |
||||
|
canTalkDate: '', |
||||
|
promisedVisitDate: '', |
||||
|
actualVisitDate: '', |
||||
|
phoneIntention: '', |
||||
|
isClosed: '', |
||||
|
notes: '', |
||||
|
visit1: '', |
||||
|
visit2: '' |
||||
|
}) |
||||
|
|
||||
|
let call_intentList = ref([]) |
||||
|
let purchase_powerList = ref([]) |
||||
|
let concept_awarenessList = ref([]) |
||||
|
|
||||
|
const setFormData = async (row) => { |
||||
|
call_intentList.value = await ( |
||||
|
await useDictionary('preliminarycustomerintention') |
||||
|
).data.dictionary |
||||
|
|
||||
|
purchase_powerList.value = await ( |
||||
|
await useDictionary('customer_purchasing_power') |
||||
|
).data.dictionary |
||||
|
|
||||
|
concept_awarenessList.value = await ( |
||||
|
await useDictionary('cognitive_concept') |
||||
|
).data.dictionary |
||||
|
|
||||
|
|
||||
|
user.id = row.id; |
||||
|
user.nickname = row.member_info.nickname; |
||||
|
user.member_id = row.member_info.member_id; |
||||
|
user.headimg = row.member_info.headimg; |
||||
|
user.mobile = row.member_info.mobile; |
||||
|
user.address = row.member_info.address; |
||||
|
|
||||
|
|
||||
|
info.purchasePower = purchase_powerList.value.flat().find(item => item.value == row.six.purchase_power)?.name || ''; |
||||
|
info.knowledge = concept_awarenessList.value.flat().find(item => item.value == row.six.concept_awareness)?.name || ''; |
||||
|
info.distance = row.six.distance; |
||||
|
info.canTalkDate = row.six.preferred_class_time; |
||||
|
info.promisedVisitDate = row.six.promised_visit_time; |
||||
|
info.actualVisitDate = row.six.actual_visit_time; |
||||
|
info.phoneIntention = call_intentList.value.flat().find(item => item.value == row.six.call_intent)?.name || ''; |
||||
|
info.isClosed = row.six.is_closed == 1 ? true : false; |
||||
|
info.notes = row.six.communication; |
||||
|
info.visit1 = row.six.first_visit_status; |
||||
|
info.visit2 = row.six.second_visit_status; |
||||
|
console.log(call_intentList.value); |
||||
|
} |
||||
|
|
||||
|
defineExpose({ |
||||
|
showDialog, |
||||
|
setFormData |
||||
|
}) |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.user-profile { |
||||
|
|
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,122 @@ |
|||||
|
<template> |
||||
|
<div class="main-container"> |
||||
|
<el-card class="box-card !border-none" shadow="never"> |
||||
|
<div class="flex justify-between items-center"> |
||||
|
</div> |
||||
|
|
||||
|
<div class="mt-[10px]"> |
||||
|
<el-table |
||||
|
:data="customerResourceChangesTable.data" |
||||
|
size="large" |
||||
|
v-loading="customerResourceChangesTable.loading" |
||||
|
> |
||||
|
<template #empty> |
||||
|
<span>{{ |
||||
|
!customerResourceChangesTable.loading ? t('emptyData') : '' |
||||
|
}}</span> |
||||
|
</template> |
||||
|
|
||||
|
<el-table-column prop="created_at" label="时间" /> |
||||
|
|
||||
|
<el-table-column prop="name" label="操作人员" /> |
||||
|
|
||||
|
|
||||
|
<el-table-column prop="type" label="操作类型"> |
||||
|
<template #default="scope"> |
||||
|
<div v-html="scope.row.type"></div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column prop="values" label="详细信息"> |
||||
|
<template #default="scope"> |
||||
|
<div v-html="scope.row.values"></div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
|
||||
|
</el-table> |
||||
|
<div class="mt-[16px] flex justify-end"> |
||||
|
<el-pagination |
||||
|
v-model:current-page="customerResourceChangesTable.page" |
||||
|
v-model:page-size="customerResourceChangesTable.limit" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="customerResourceChangesTable.total" |
||||
|
@size-change="loadCustomerResourceChangesList()" |
||||
|
@current-change="loadCustomerResourceChangesList" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</el-card> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import { reactive, ref, watch } from 'vue' |
||||
|
import { t } from '@/lang' |
||||
|
import { useDictionary } from '@/app/api/dict' |
||||
|
import { |
||||
|
getLogList, |
||||
|
} from '@/app/api/customer_resources' |
||||
|
import { img } from '@/utils/common' |
||||
|
import { ElMessageBox, FormInstance } from 'element-plus' |
||||
|
import { useRoute } from 'vue-router' |
||||
|
const route = useRoute() |
||||
|
const pageName = route.meta.title |
||||
|
|
||||
|
const props = defineProps({ |
||||
|
value: Number |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
let customerResourceChangesTable = reactive({ |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
total: 0, |
||||
|
loading: true, |
||||
|
data: [], |
||||
|
searchParam: { |
||||
|
customer_resource_id: props.value, |
||||
|
}, |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 获取客户资源表变更记录列表 |
||||
|
*/ |
||||
|
const loadCustomerResourceChangesList = (page: number = 1) => { |
||||
|
customerResourceChangesTable.loading = true |
||||
|
customerResourceChangesTable.page = page |
||||
|
|
||||
|
getLogList({ |
||||
|
page: customerResourceChangesTable.page, |
||||
|
limit: customerResourceChangesTable.limit, |
||||
|
...customerResourceChangesTable.searchParam, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
customerResourceChangesTable.loading = false |
||||
|
customerResourceChangesTable.data = res.data.data |
||||
|
customerResourceChangesTable.total = res.data.total |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
customerResourceChangesTable.loading = false |
||||
|
}) |
||||
|
} |
||||
|
loadCustomerResourceChangesList() |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
/* 多行超出隐藏 */ |
||||
|
.multi-hidden { |
||||
|
word-break: break-all; |
||||
|
text-overflow: ellipsis; |
||||
|
overflow: hidden; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 2; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,118 @@ |
|||||
|
<template> |
||||
|
<div class="main-container"> |
||||
|
<el-card class="box-card !border-none" shadow="never"> |
||||
|
<div class="flex justify-between items-center"> |
||||
|
</div> |
||||
|
|
||||
|
<div class="mt-[10px]"> |
||||
|
<el-table |
||||
|
:data="customerResourceChangesTable.data" |
||||
|
size="large" |
||||
|
v-loading="customerResourceChangesTable.loading" |
||||
|
> |
||||
|
<template #empty> |
||||
|
<span>{{ |
||||
|
!customerResourceChangesTable.loading ? t('emptyData') : '' |
||||
|
}}</span> |
||||
|
</template> |
||||
|
|
||||
|
<el-table-column prop="payment_id" label="订单号" /> |
||||
|
|
||||
|
<el-table-column prop="course_name" label="课程名称" /> |
||||
|
|
||||
|
|
||||
|
<el-table-column prop="order_amount" label="金额" /> |
||||
|
|
||||
|
<el-table-column prop="order_status" label="状态" /> |
||||
|
|
||||
|
<el-table-column prop="created_at" label="下单时间" /> |
||||
|
|
||||
|
<el-table-column prop="type" label="支付方式" /> |
||||
|
|
||||
|
|
||||
|
</el-table> |
||||
|
<div class="mt-[16px] flex justify-end"> |
||||
|
<el-pagination |
||||
|
v-model:current-page="customerResourceChangesTable.page" |
||||
|
v-model:page-size="customerResourceChangesTable.limit" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="customerResourceChangesTable.total" |
||||
|
@size-change="loadCustomerResourceChangesList()" |
||||
|
@current-change="loadCustomerResourceChangesList" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</el-card> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import { reactive, ref, watch } from 'vue' |
||||
|
import { |
||||
|
getOrderTableList, |
||||
|
} from '@/app/api/customer_resources' |
||||
|
import { useRoute } from 'vue-router' |
||||
|
const route = useRoute() |
||||
|
|
||||
|
const props = defineProps({ |
||||
|
value: Number |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
let customerResourceChangesTable = reactive({ |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
total: 0, |
||||
|
loading: true, |
||||
|
data: [], |
||||
|
searchParam: { |
||||
|
customer_resource_id: props.value, |
||||
|
}, |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
const getProgress = (row) => { |
||||
|
if (!row.total) return 0; |
||||
|
return Math.round((row.used / row.total) * 100); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取客户资源表变更记录列表 |
||||
|
*/ |
||||
|
const loadCustomerResourceChangesList = (page: number = 1) => { |
||||
|
customerResourceChangesTable.loading = true |
||||
|
customerResourceChangesTable.page = page |
||||
|
|
||||
|
getOrderTableList({ |
||||
|
page: customerResourceChangesTable.page, |
||||
|
limit: customerResourceChangesTable.limit, |
||||
|
...customerResourceChangesTable.searchParam, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
customerResourceChangesTable.loading = false |
||||
|
customerResourceChangesTable.data = res.data.data |
||||
|
customerResourceChangesTable.total = res.data.total |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
customerResourceChangesTable.loading = false |
||||
|
}) |
||||
|
} |
||||
|
loadCustomerResourceChangesList() |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
/* 多行超出隐藏 */ |
||||
|
.multi-hidden { |
||||
|
word-break: break-all; |
||||
|
text-overflow: ellipsis; |
||||
|
overflow: hidden; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 2; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,131 @@ |
|||||
|
<template> |
||||
|
<div class="main-container"> |
||||
|
<el-card class="box-card !border-none" shadow="never"> |
||||
|
<div class="flex justify-between items-center"> |
||||
|
</div> |
||||
|
|
||||
|
<div class="mt-[10px]"> |
||||
|
<el-table |
||||
|
:data="customerResourceChangesTable.data" |
||||
|
size="large" |
||||
|
v-loading="customerResourceChangesTable.loading" |
||||
|
> |
||||
|
<template #empty> |
||||
|
<span>{{ |
||||
|
!customerResourceChangesTable.loading ? t('emptyData') : '' |
||||
|
}}</span> |
||||
|
</template> |
||||
|
|
||||
|
<el-table-column prop="course_name" label="课程名称" /> |
||||
|
|
||||
|
<el-table-column label="学习进度"> |
||||
|
<template #default="{ row }"> |
||||
|
<div style="display: flex; align-items: center; justify-content: space-between;"> |
||||
|
<el-progress |
||||
|
:percentage="getProgress(row)" |
||||
|
:text-inside="true" |
||||
|
stroke-width="18" |
||||
|
status="success" |
||||
|
style="flex: 1; max-width: 80%;" |
||||
|
/> |
||||
|
<span style="margin-left: 2px; white-space: nowrap; font-size: 14px; color: #666;"> |
||||
|
{{ row.used }}/{{ row.total }} |
||||
|
</span> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
|
||||
|
<el-table-column prop="status" label="状态" /> |
||||
|
|
||||
|
<el-table-column prop="start_date" label="开始时间" /> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</el-table> |
||||
|
<div class="mt-[16px] flex justify-end"> |
||||
|
<el-pagination |
||||
|
v-model:current-page="customerResourceChangesTable.page" |
||||
|
v-model:page-size="customerResourceChangesTable.limit" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="customerResourceChangesTable.total" |
||||
|
@size-change="loadCustomerResourceChangesList()" |
||||
|
@current-change="loadCustomerResourceChangesList" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</el-card> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import { reactive, ref, watch } from 'vue' |
||||
|
import { |
||||
|
getStudentCoursesList, |
||||
|
} from '@/app/api/customer_resources' |
||||
|
import { useRoute } from 'vue-router' |
||||
|
const route = useRoute() |
||||
|
|
||||
|
const props = defineProps({ |
||||
|
value: Number |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
let customerResourceChangesTable = reactive({ |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
total: 0, |
||||
|
loading: true, |
||||
|
data: [], |
||||
|
searchParam: { |
||||
|
customer_resource_id: props.value, |
||||
|
}, |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
const getProgress = (row) => { |
||||
|
if (!row.total) return 0; |
||||
|
return Math.round((row.used / row.total) * 100); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取客户资源表变更记录列表 |
||||
|
*/ |
||||
|
const loadCustomerResourceChangesList = (page: number = 1) => { |
||||
|
customerResourceChangesTable.loading = true |
||||
|
customerResourceChangesTable.page = page |
||||
|
|
||||
|
getStudentCoursesList({ |
||||
|
page: customerResourceChangesTable.page, |
||||
|
limit: customerResourceChangesTable.limit, |
||||
|
...customerResourceChangesTable.searchParam, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
customerResourceChangesTable.loading = false |
||||
|
customerResourceChangesTable.data = res.data.data |
||||
|
customerResourceChangesTable.total = res.data.total |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
customerResourceChangesTable.loading = false |
||||
|
}) |
||||
|
} |
||||
|
loadCustomerResourceChangesList() |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
/* 多行超出隐藏 */ |
||||
|
.multi-hidden { |
||||
|
word-break: break-all; |
||||
|
text-overflow: ellipsis; |
||||
|
overflow: hidden; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 2; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,165 @@ |
|||||
|
<template> |
||||
|
<div class="main-container"> |
||||
|
<el-card class="box-card !border-none" shadow="never"> |
||||
|
<div class="flex justify-between items-center"> |
||||
|
<span class="text-lg">{{ pageName }}</span> |
||||
|
</div> |
||||
|
|
||||
|
<el-card |
||||
|
class="box-card !border-none my-[10px] table-search-wrap" |
||||
|
shadow="never" |
||||
|
> |
||||
|
<el-form |
||||
|
:inline="true" |
||||
|
:model="studentCourseUsageTable.searchParam" |
||||
|
ref="searchFormRef" |
||||
|
> |
||||
|
<el-form-item label="家长姓名" prop="name"> |
||||
|
<el-input |
||||
|
v-model="studentCourseUsageTable.searchParam.name" |
||||
|
placeholder="请输入家长姓名" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item label="评分" prop="score"> |
||||
|
<el-input |
||||
|
v-model="studentCourseUsageTable.searchParam.score" |
||||
|
placeholder="请输入评分" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item> |
||||
|
<el-button type="primary" @click="loadServiceLogsList()">{{ |
||||
|
t('search') |
||||
|
}}</el-button> |
||||
|
<el-button @click="resetForm(searchFormRef)">{{ |
||||
|
t('reset') |
||||
|
}}</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-card> |
||||
|
|
||||
|
<div class="mt-[10px]"> |
||||
|
<el-table |
||||
|
:data="studentCourseUsageTable.data" |
||||
|
size="large" |
||||
|
v-loading="studentCourseUsageTable.loading" |
||||
|
> |
||||
|
<template #empty> |
||||
|
<span>{{ |
||||
|
!studentCourseUsageTable.loading ? t('emptyData') : '' |
||||
|
}}</span> |
||||
|
</template> |
||||
|
|
||||
|
<el-table-column prop="name" label="家长姓名" min-width="120" :show-overflow-tooltip="true"/> |
||||
|
|
||||
|
<el-table-column prop="staff_name" label="教练姓名" min-width="120" :show-overflow-tooltip="true"/> |
||||
|
|
||||
|
<el-table-column prop="service_name" label="服务内容" min-width="120" :show-overflow-tooltip="true"/> |
||||
|
|
||||
|
|
||||
|
<el-table-column prop="customer_confirmation" label="是否需要反馈" min-width="120" :show-overflow-tooltip="true"> |
||||
|
<template #default="{ row }"> |
||||
|
<div v-if="row.customer_confirmation == 1">是</div> |
||||
|
<div v-if="row.customer_confirmation == 0">否</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
|
||||
|
<el-table-column prop="score" label="反馈分数" min-width="120" :show-overflow-tooltip="true"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</el-table> |
||||
|
<div class="mt-[16px] flex justify-end"> |
||||
|
<el-pagination |
||||
|
v-model:current-page="studentCourseUsageTable.page" |
||||
|
v-model:page-size="studentCourseUsageTable.limit" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="studentCourseUsageTable.total" |
||||
|
@size-change="loadServiceLogsList()" |
||||
|
@current-change="loadServiceLogsList" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</el-card> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import { reactive, ref, watch } from 'vue' |
||||
|
import { t } from '@/lang' |
||||
|
import { useDictionary } from '@/app/api/dict' |
||||
|
import { |
||||
|
getServiceLogsList, |
||||
|
} from '@/app/api/service_logs' |
||||
|
|
||||
|
import { img } from '@/utils/common' |
||||
|
import { ElMessageBox, FormInstance } from 'element-plus' |
||||
|
import { useRoute } from 'vue-router' |
||||
|
const route = useRoute() |
||||
|
const pageName = route.meta.title |
||||
|
|
||||
|
let studentCourseUsageTable = reactive({ |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
total: 0, |
||||
|
loading: true, |
||||
|
data: [], |
||||
|
searchParam: { |
||||
|
name: '', |
||||
|
score: '', |
||||
|
}, |
||||
|
}) |
||||
|
|
||||
|
const searchFormRef = ref<FormInstance>() |
||||
|
|
||||
|
// 选中数据 |
||||
|
const selectData = ref<any[]>([]) |
||||
|
|
||||
|
// 字典数据 |
||||
|
|
||||
|
/** |
||||
|
* 获取学员课时消费记录列表 |
||||
|
*/ |
||||
|
const loadServiceLogsList = (page: number = 1) => { |
||||
|
studentCourseUsageTable.loading = true |
||||
|
studentCourseUsageTable.page = page |
||||
|
|
||||
|
getServiceLogsList({ |
||||
|
page: studentCourseUsageTable.page, |
||||
|
limit: studentCourseUsageTable.limit, |
||||
|
...studentCourseUsageTable.searchParam, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
studentCourseUsageTable.loading = false |
||||
|
studentCourseUsageTable.data = res.data.data |
||||
|
studentCourseUsageTable.total = res.data.total |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
studentCourseUsageTable.loading = false |
||||
|
}) |
||||
|
} |
||||
|
loadServiceLogsList() |
||||
|
|
||||
|
|
||||
|
const resetForm = (formEl: FormInstance | undefined) => { |
||||
|
if (!formEl) return |
||||
|
formEl.resetFields() |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
/* 多行超出隐藏 */ |
||||
|
.multi-hidden { |
||||
|
word-break: break-all; |
||||
|
text-overflow: ellipsis; |
||||
|
overflow: hidden; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 2; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,39 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\adminapi\controller\service_logs; |
||||
|
|
||||
|
use app\service\admin\service_logs\ServiceLogsService; |
||||
|
use core\base\BaseAdminController; |
||||
|
use app\service\admin\service\ServiceService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 服务控制器 |
||||
|
* Class Service |
||||
|
* @package app\adminapi\controller\service |
||||
|
*/ |
||||
|
class ServiceLogs extends BaseAdminController |
||||
|
{ |
||||
|
/** |
||||
|
* 获取服务列表 |
||||
|
* @return \think\Response |
||||
|
*/ |
||||
|
public function lists(){ |
||||
|
|
||||
|
$data = $this->request->params([ |
||||
|
["name",""], |
||||
|
["score",""] |
||||
|
]); |
||||
|
return success((new ServiceLogsService())->getPage($data)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
use think\facade\Route; |
||||
|
|
||||
|
use app\adminapi\middleware\AdminCheckRole; |
||||
|
use app\adminapi\middleware\AdminCheckToken; |
||||
|
use app\adminapi\middleware\AdminLog; |
||||
|
|
||||
|
|
||||
|
|
||||
|
// USER_CODE_BEGIN -- service |
||||
|
|
||||
|
Route::group('service_logs', function () { |
||||
|
|
||||
|
Route::get('service_logs', 'service_logs.ServiceLogs/lists'); |
||||
|
|
||||
|
})->middleware([ |
||||
|
AdminCheckToken::class, |
||||
|
AdminCheckRole::class, |
||||
|
AdminLog::class |
||||
|
]); |
||||
|
// USER_CODE_END -- service |
||||
@ -0,0 +1,119 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\api\controller\apiController; |
||||
|
|
||||
|
use app\dict\member\MemberLoginTypeDict; |
||||
|
use app\model\member\Member; |
||||
|
use app\Request; |
||||
|
use app\service\api\apiService\CustomerResourcesService; |
||||
|
use app\service\api\login\LoginService; |
||||
|
use core\base\BaseApiService; |
||||
|
|
||||
|
/** |
||||
|
* 学员登陆控制器相关接口 |
||||
|
* Class Personnel |
||||
|
* @package app\api\controller\apiController |
||||
|
*/ |
||||
|
class customerResourcesAuth extends BaseApiService |
||||
|
{ |
||||
|
|
||||
|
//获取字典 |
||||
|
public function login(Request $request) |
||||
|
{ |
||||
|
$phone = $request->param('phone', ''); //手机号 |
||||
|
$password = $request->param('password', ''); //密码 |
||||
|
$openid = $request->param('openid', ''); //微信小程序openid |
||||
|
|
||||
|
if (empty($phone)) { |
||||
|
return fail('请输入手机号'); |
||||
|
} |
||||
|
if (empty($password)) { |
||||
|
return fail('请输入密码'); |
||||
|
} |
||||
|
|
||||
|
$member_info = Member::where('mobile', $phone)->find();//查账户表信息是否存在 |
||||
|
|
||||
|
|
||||
|
if (!$member_info) { |
||||
|
return fail('账户手机号有误'); |
||||
|
} |
||||
|
|
||||
|
$customerResources = \app\model\customer_resources\CustomerResources::where('member_id', $member_info['member_id'])->find();//查客户资源表信息是否存在 |
||||
|
if (!$customerResources) { |
||||
|
return fail('账户信息有误'); |
||||
|
} |
||||
|
|
||||
|
//创建密码 |
||||
|
//$a = create_password($password); |
||||
|
//验证密码 |
||||
|
if (!check_password($password, $member_info->password)) { |
||||
|
return fail('手机号或密码不正确'); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
$res = (new LoginService())->login($member_info, MemberLoginTypeDict::MOBILE); |
||||
|
if (!$res) { |
||||
|
return fail('账户信息有误'); |
||||
|
} |
||||
|
$res['user_type'] = '3';//用户类型|3=学员 |
||||
|
return success($res); |
||||
|
} |
||||
|
|
||||
|
//学生详情 |
||||
|
public function info(){ |
||||
|
$member_id = $this->member_id; |
||||
|
$where = [ |
||||
|
'member_id'=>$member_id |
||||
|
]; |
||||
|
$res = (new CustomerResourcesService())->getInfo($where); |
||||
|
if (!$res['code']) { |
||||
|
return fail($res['msg']); |
||||
|
} |
||||
|
return success($res['data']); |
||||
|
} |
||||
|
|
||||
|
//学生详情-修改 |
||||
|
public function edit(Request $request){ |
||||
|
$member_id = $this->member_id; |
||||
|
$where = [ |
||||
|
'member_id'=>$member_id |
||||
|
]; |
||||
|
$data = [ |
||||
|
'headimg' => $request->param('headimg', ''), |
||||
|
'name' => $request->param('name', ''), |
||||
|
'gender' => $request->param('gender', ''), |
||||
|
'age' => $request->param('age', ''), |
||||
|
'phone_number' => $request->param('phone_number', ''), |
||||
|
]; |
||||
|
|
||||
|
// 验证必填字段 |
||||
|
if (empty($data['name'])) { |
||||
|
return fail('姓名不能为空'); |
||||
|
} |
||||
|
if (empty($data['gender'])) { |
||||
|
return fail('性别不能为空'); |
||||
|
} |
||||
|
if (empty($data['age'])) { |
||||
|
return fail('年龄不能为空'); |
||||
|
} |
||||
|
if (empty($data['phone_number'])) { |
||||
|
return fail('手机号不能为空'); |
||||
|
} |
||||
|
|
||||
|
$res = (new CustomerResourcesService())->editInfo($where,$data); |
||||
|
if (!$res['code']) { |
||||
|
return fail($res['msg']); |
||||
|
} |
||||
|
return success([]); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\api\controller\apiController; |
||||
|
|
||||
|
use app\Request; |
||||
|
use app\service\api\apiService\PersonCourseScheduleService; |
||||
|
use core\base\BaseApiService; |
||||
|
|
||||
|
/** |
||||
|
* 学生课程安排-控制器相关接口 |
||||
|
* Class Personnel |
||||
|
* @package app\api\controller\apiController |
||||
|
*/ |
||||
|
class PersonCourseSchedule extends BaseApiService |
||||
|
{ |
||||
|
|
||||
|
//列表 |
||||
|
public function index(Request $request) |
||||
|
{ |
||||
|
$resources_id = $request->param('resources_id', '');//客户资源ID |
||||
|
if (empty($resources_id)) { |
||||
|
return fail('缺少参数'); |
||||
|
} |
||||
|
|
||||
|
$where = [ |
||||
|
'resources_id' => $resources_id, |
||||
|
]; |
||||
|
|
||||
|
$res = (new PersonCourseScheduleService())->getList($where); |
||||
|
|
||||
|
return success($res); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,65 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\api\controller\apiController; |
||||
|
|
||||
|
use app\Request; |
||||
|
use app\service\api\apiService\ChatService; |
||||
|
use app\service\api\apiService\PhysicalTestService; |
||||
|
use core\base\BaseApiService; |
||||
|
|
||||
|
/** |
||||
|
* 体测报告-控制器相关接口 |
||||
|
* Class Personnel |
||||
|
* @package app\api\controller\apiController |
||||
|
*/ |
||||
|
class PhysicalTest extends BaseApiService |
||||
|
{ |
||||
|
|
||||
|
//列表 |
||||
|
public function index(Request $request) |
||||
|
{ |
||||
|
$resource_id = $request->param('resource_id', '');//学生资源表id |
||||
|
if (empty($resource_id)) { |
||||
|
return fail('缺少参数'); |
||||
|
} |
||||
|
|
||||
|
$where = [ |
||||
|
'resource_id' => $resource_id, |
||||
|
]; |
||||
|
|
||||
|
$res = (new PhysicalTestService())->getList($where); |
||||
|
|
||||
|
return success($res); |
||||
|
} |
||||
|
|
||||
|
//详情 |
||||
|
public function info(Request $request) |
||||
|
{ |
||||
|
$id = $request->param('id', '');//体测报告的id |
||||
|
|
||||
|
if (empty($id)) { |
||||
|
return fail('缺少参数'); |
||||
|
} |
||||
|
|
||||
|
$where = [ |
||||
|
'id' => $id, |
||||
|
]; |
||||
|
|
||||
|
$res = (new PhysicalTestService())->getInfo($where); |
||||
|
|
||||
|
if(!$res['code']){ |
||||
|
return fail($res['msg']); |
||||
|
} |
||||
|
|
||||
|
return success($res['data']); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,46 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\api\controller\apiController; |
||||
|
|
||||
|
use app\Request; |
||||
|
use app\service\api\apiService\CampusService; |
||||
|
use app\service\api\apiService\ChatService; |
||||
|
use app\service\api\apiService\CommonService; |
||||
|
use core\base\BaseApiService; |
||||
|
|
||||
|
/** |
||||
|
* 测试控制器相关接口 |
||||
|
* Class Personnel |
||||
|
* @package app\api\controller\apiController |
||||
|
*/ |
||||
|
class Test extends BaseApiService |
||||
|
{ |
||||
|
|
||||
|
//测试控制器Demo |
||||
|
public function index(Request $request) |
||||
|
{ |
||||
|
$personnel_id = $request->param('personnel_id', '');//员工人力资源表id(两个参数2选1) |
||||
|
$customer_resources_id = $request->param('customer_resources_id', '');//学生资源表id(两个参数2选1) |
||||
|
if (empty($personnel_id) && empty($customer_resources_id)) { |
||||
|
return fail('缺少参数'); |
||||
|
} |
||||
|
|
||||
|
$where = [ |
||||
|
'personnel_id' => $personnel_id, |
||||
|
'customer_resources_id' => $customer_resources_id, |
||||
|
]; |
||||
|
|
||||
|
$res = (new ChatService())->getChatFriendsPage($where); |
||||
|
|
||||
|
return success($res); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,53 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\api\controller\apiController; |
||||
|
|
||||
|
use app\Request; |
||||
|
use core\base\BaseApiService; |
||||
|
|
||||
|
/** |
||||
|
* 学生用户反馈控制器相关接口 |
||||
|
* Class Personnel |
||||
|
* @package app\api\controller\apiController |
||||
|
*/ |
||||
|
class UserFeedback extends BaseApiService |
||||
|
{ |
||||
|
|
||||
|
//学生用户反馈-添加 |
||||
|
public function add(Request $request) |
||||
|
{ |
||||
|
// 接受参数 |
||||
|
$user_id = $request->post('user_id', ''); // 用户ID(对应school_customer_resources表id) |
||||
|
$feedback_text = $request->post('feedback_text', ''); // 反馈内容 |
||||
|
$attachment_url = $request->post('attachment_url', null); // 附件URL(OSS对象存储),允许为空 |
||||
|
|
||||
|
|
||||
|
//验证必填 |
||||
|
if (empty($user_id) || empty($feedback_text)) { |
||||
|
return fail('必填参数不能为空'); |
||||
|
} |
||||
|
|
||||
|
$data = [ |
||||
|
'user_id' => $user_id, |
||||
|
'feedback_text' => $feedback_text, |
||||
|
'attachment_url' => $attachment_url ?? null, |
||||
|
]; |
||||
|
|
||||
|
$add = \app\model\user_feedback\UserFeedback::create($data); |
||||
|
|
||||
|
if (!$add) { |
||||
|
return fail('添加失败'); |
||||
|
} |
||||
|
|
||||
|
return success([]); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\model\class_personnel_rel; |
||||
|
|
||||
|
use core\base\BaseModel; |
||||
|
use think\model\concern\SoftDelete; |
||||
|
use think\model\relation\HasMany; |
||||
|
use think\model\relation\HasOne; |
||||
|
use app\model\student\Student; |
||||
|
use app\model\student_courses\StudentCourses; |
||||
|
use app\model\class_grade\ClassGrade; |
||||
|
|
||||
|
use app\model\customer_resources\CustomerResources; |
||||
|
|
||||
|
use app\model\campus\Campus; |
||||
|
|
||||
|
class ClassPersonnelRel extends BaseModel |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 数据表主键 |
||||
|
* @var string |
||||
|
*/ |
||||
|
protected $pk = 'id'; |
||||
|
|
||||
|
/** |
||||
|
* 模型名称 |
||||
|
* @var string |
||||
|
*/ |
||||
|
protected $name = 'class_personnel_rel'; |
||||
|
|
||||
|
|
||||
|
public function student(){ |
||||
|
return $this->hasOne(Student::class, 'id', 'source_id'); |
||||
|
} |
||||
|
|
||||
|
public function studentCourses(){ |
||||
|
return $this->hasOne(StudentCourses::class, 'student_id', 'source_id')->joinType('left')->withField('end_date,student_id')->bind(['end_date'=>'end_date']); |
||||
|
} |
||||
|
|
||||
|
public function studentCoursesInfo(){ |
||||
|
return $this->hasOne(StudentCourses::class, 'student_id', 'source_id'); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\model\service_logs; |
||||
|
|
||||
|
use core\base\BaseModel; |
||||
|
use think\model\concern\SoftDelete; |
||||
|
use think\model\relation\HasMany; |
||||
|
use think\model\relation\HasOne; |
||||
|
|
||||
|
/** |
||||
|
* 服务模型 |
||||
|
* Class Service |
||||
|
* @package app\model\service |
||||
|
*/ |
||||
|
class ServiceLogs extends BaseModel |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 数据表主键 |
||||
|
* @var string |
||||
|
*/ |
||||
|
protected $pk = 'id'; |
||||
|
|
||||
|
/** |
||||
|
* 模型名称 |
||||
|
* @var string |
||||
|
*/ |
||||
|
protected $name = 'service_logs'; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,60 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\service\admin\service_logs; |
||||
|
|
||||
|
|
||||
|
use app\model\service_logs\ServiceLogs; |
||||
|
use core\base\BaseAdminService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 学员课时消费记录服务层 |
||||
|
* Class StudentCourseUsageService |
||||
|
* @package app\service\admin\student_course_usage |
||||
|
*/ |
||||
|
class ServiceLogsService extends BaseAdminService |
||||
|
{ |
||||
|
public function __construct() |
||||
|
{ |
||||
|
parent::__construct(); |
||||
|
$this->model = new ServiceLogs(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取学员课时消费记录列表 |
||||
|
* @return array |
||||
|
*/ |
||||
|
public function getPage(array $data = []) |
||||
|
{ |
||||
|
$where = []; |
||||
|
if($data['name']){ |
||||
|
$where[] = ['b.name','like','%'.$data['name'].'%']; |
||||
|
} |
||||
|
|
||||
|
if($data['score']){ |
||||
|
$where[] = ['a.score','=',$data['score']]; |
||||
|
} |
||||
|
|
||||
|
$search_model = $this->model |
||||
|
->alias("a") |
||||
|
->join(['school_customer_resources' => 'b'],'a.resource_id = b.id','left') |
||||
|
->join(['school_personnel' => 'c'],'a.staff_id = c.id','left') |
||||
|
->join(['school_service' => 'd'],'a.service_id = d.id','left') |
||||
|
->where($where) |
||||
|
->field("a.*,b.name,c.name as staff_name,d.service_name,d.customer_confirmation") |
||||
|
->order("a.id desc"); |
||||
|
$list = $this->pageQuery($search_model); |
||||
|
return $list; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,98 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\service\api\apiService; |
||||
|
|
||||
|
use app\model\chat_friends\ChatFriends; |
||||
|
use app\model\course_schedule\CourseSchedule; |
||||
|
use app\model\person_course_schedule\PersonCourseSchedule; |
||||
|
use core\base\BaseApiService; |
||||
|
use think\facade\Db; |
||||
|
|
||||
|
/** |
||||
|
* 测试-控制器服务层 |
||||
|
* Class MemberService |
||||
|
* @package app\service\api\member |
||||
|
*/ |
||||
|
class PersonCourseScheduleService extends BaseApiService |
||||
|
{ |
||||
|
public function __construct() |
||||
|
{ |
||||
|
parent::__construct(); |
||||
|
} |
||||
|
|
||||
|
//查询列表 |
||||
|
public function getList(array $where) |
||||
|
{ |
||||
|
$page_params = $this->getPageParam();//获取请求参数中的页码+分页数 |
||||
|
$page = $page_params['page']; |
||||
|
$limit = $page_params['limit']; |
||||
|
|
||||
|
$model = new PersonCourseSchedule(); |
||||
|
//判断有没有客户资源id |
||||
|
if (!empty($where['resources_id'])) { |
||||
|
$model = $model->where('resources_id', $where['resources_id']); |
||||
|
} |
||||
|
$schedule_id = $model->distinct(true)->column('schedule_id');//课程安排id |
||||
|
if(!$schedule_id){ |
||||
|
return []; |
||||
|
} |
||||
|
|
||||
|
$data = CourseSchedule::whereIn('id', $schedule_id) |
||||
|
->order('course_date','desc') |
||||
|
->with([ |
||||
|
'venue',//场地 |
||||
|
'campus',//校区 |
||||
|
'course',//课程 |
||||
|
]) |
||||
|
|
||||
|
->paginate([ |
||||
|
'list_rows' => $limit, |
||||
|
'page' => $page, |
||||
|
])->toArray(); |
||||
|
|
||||
|
|
||||
|
|
||||
|
return $data; |
||||
|
} |
||||
|
|
||||
|
//查询详情 |
||||
|
public function getTestInfo(array $where) |
||||
|
{ |
||||
|
$model = new ChatFriends(); |
||||
|
//判断用没有员工id |
||||
|
if (!empty($where['personnel_id'])) { |
||||
|
$model = $model->where('personnel_id', $where['personnel_id']); |
||||
|
} |
||||
|
if (!empty($where['customer_resources_id'])) { |
||||
|
$model = $model->where('customer_resources_id', $where['customer_resources_id']); |
||||
|
} |
||||
|
$data = $model->find(); |
||||
|
|
||||
|
|
||||
|
if ($data) { |
||||
|
$data = $data->toArray(); |
||||
|
$res = [ |
||||
|
'code' => 1, |
||||
|
'msg' => '操作成功', |
||||
|
'data' => $data |
||||
|
]; |
||||
|
return $res; |
||||
|
} else { |
||||
|
$res = [ |
||||
|
'code' => 0, |
||||
|
'msg' => '暂无数据', |
||||
|
'data' => [] |
||||
|
]; |
||||
|
return $res; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,115 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\service\api\apiService; |
||||
|
|
||||
|
use app\model\campus\Campus; |
||||
|
use app\model\campus_person_role\CampusPersonRole; |
||||
|
use app\model\chat_friends\ChatFriends; |
||||
|
use app\model\physical_test\PhysicalTest; |
||||
|
use core\base\BaseApiService; |
||||
|
|
||||
|
/** |
||||
|
* 体测报告-控制器服务层 |
||||
|
* Class MemberService |
||||
|
* @package app\service\api\member |
||||
|
*/ |
||||
|
class PhysicalTestService extends BaseApiService |
||||
|
{ |
||||
|
public function __construct() |
||||
|
{ |
||||
|
parent::__construct(); |
||||
|
} |
||||
|
|
||||
|
//查询列表 |
||||
|
public function getList(array $where,string $field = '*') |
||||
|
{ |
||||
|
$page_params = $this->getPageParam();//获取请求参数中的页码+分页数 |
||||
|
$page = $page_params['page']; |
||||
|
$limit = $page_params['limit']; |
||||
|
|
||||
|
$model = new PhysicalTest(); |
||||
|
//判断用没有员工id |
||||
|
if (!empty($where['resource_id'])) { |
||||
|
$model = $model->where('resource_id', $where['resource_id']); |
||||
|
} |
||||
|
|
||||
|
$data = $model |
||||
|
->field($field) |
||||
|
->order('id','desc') |
||||
|
->append([ |
||||
|
'customerResources' |
||||
|
]) |
||||
|
->with([ |
||||
|
'customerResourcesHasOne' |
||||
|
]) |
||||
|
->paginate([ |
||||
|
'list_rows' => $limit, |
||||
|
'page' => $page, |
||||
|
])->toArray(); |
||||
|
|
||||
|
|
||||
|
foreach ($data['data'] as &$v) { |
||||
|
$age = $v['age'];//年龄 |
||||
|
$gender = $v['customerResourcesHasOne']['gender'] == 'female' ? 2:1 ;//性别( 1:男,2:女) |
||||
|
$height = $v['height'];//身高 |
||||
|
$weight = $v['weight'];//体重 |
||||
|
$v['calculateChildHealthScore'] = calculateChildHealthScore($age, $gender, $height, $weight);//综合评分 |
||||
|
} |
||||
|
|
||||
|
return $data; |
||||
|
} |
||||
|
|
||||
|
//查询详情 |
||||
|
public function getInfo(array $where,string $field = '*') |
||||
|
{ |
||||
|
$model = new PhysicalTest(); |
||||
|
//判断用没有体测报告id |
||||
|
if (!empty($where['id'])) { |
||||
|
$model = $model->where('id', $where['id']); |
||||
|
} |
||||
|
|
||||
|
$data = $model |
||||
|
->field($field) |
||||
|
->append([ |
||||
|
'customerResources' |
||||
|
]) |
||||
|
->with([ |
||||
|
'customerResourcesHasOne' |
||||
|
]) |
||||
|
->find(); |
||||
|
|
||||
|
|
||||
|
if ($data) { |
||||
|
$data = $data->toArray(); |
||||
|
|
||||
|
$age = $data['age'];//年龄 |
||||
|
$gender = $data['customerResourcesHasOne']['gender'] == 'female' ? 2 : 1;//性别( 1:男,2:女) |
||||
|
$height = $data['height'];//身高 |
||||
|
$weight = $data['weight'];//体重 |
||||
|
$data['calculateChildHealthScore'] = calculateChildHealthScore($age, $gender, $height, $weight);//综合评分 |
||||
|
|
||||
|
$res = [ |
||||
|
'code' => 1, |
||||
|
'msg' => '操作成功', |
||||
|
'data' => $data |
||||
|
]; |
||||
|
return $res; |
||||
|
} else { |
||||
|
$res = [ |
||||
|
'code' => 0, |
||||
|
'msg' => '暂无数据', |
||||
|
'data' => [] |
||||
|
]; |
||||
|
return $res; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\service\api\apiService; |
||||
|
|
||||
|
use app\model\campus\Campus; |
||||
|
use app\model\campus_person_role\CampusPersonRole; |
||||
|
use app\model\chat_friends\ChatFriends; |
||||
|
use app\model\chat_messages\ChatMessages; |
||||
|
use app\model\dict\Dict; |
||||
|
use core\base\BaseApiService; |
||||
|
use think\facade\Db; |
||||
|
|
||||
|
/** |
||||
|
* 测试-控制器服务层 |
||||
|
* Class MemberService |
||||
|
* @package app\service\api\member |
||||
|
*/ |
||||
|
class TestService extends BaseApiService |
||||
|
{ |
||||
|
public function __construct() |
||||
|
{ |
||||
|
parent::__construct(); |
||||
|
} |
||||
|
|
||||
|
//查询列表 |
||||
|
public function getTestList(array $where) |
||||
|
{ |
||||
|
$page_params = $this->getPageParam();//获取请求参数中的页码+分页数 |
||||
|
$page = $page_params['page']; |
||||
|
$limit = $page_params['limit']; |
||||
|
|
||||
|
$model = new ChatFriends(); |
||||
|
//判断用没有员工id |
||||
|
if (!empty($where['personnel_id'])) { |
||||
|
$model = $model->where('personnel_id', $where['personnel_id']); |
||||
|
} |
||||
|
|
||||
|
if (!empty($where['customer_resources_id'])) { |
||||
|
$model = $model->where('customer_resources_id', $where['customer_resources_id']); |
||||
|
} |
||||
|
|
||||
|
$data = $model |
||||
|
->with([ |
||||
|
'personnel', |
||||
|
'customer', |
||||
|
]) |
||||
|
->paginate([ |
||||
|
'list_rows' => $limit, |
||||
|
'page' => $page, |
||||
|
])->toArray(); |
||||
|
|
||||
|
return $data; |
||||
|
} |
||||
|
|
||||
|
//查询详情 |
||||
|
public function getTestInfo(array $where) |
||||
|
{ |
||||
|
$model = new ChatFriends(); |
||||
|
//判断用没有员工id |
||||
|
if (!empty($where['personnel_id'])) { |
||||
|
$model = $model->where('personnel_id', $where['personnel_id']); |
||||
|
} |
||||
|
if (!empty($where['customer_resources_id'])) { |
||||
|
$model = $model->where('customer_resources_id', $where['customer_resources_id']); |
||||
|
} |
||||
|
$data = $model->find(); |
||||
|
|
||||
|
|
||||
|
if ($data) { |
||||
|
$data = $data->toArray(); |
||||
|
$res = [ |
||||
|
'code' => 1, |
||||
|
'msg' => '操作成功', |
||||
|
'data' => $data |
||||
|
]; |
||||
|
return $res; |
||||
|
} else { |
||||
|
$res = [ |
||||
|
'code' => 0, |
||||
|
'msg' => '暂无数据', |
||||
|
'data' => [] |
||||
|
]; |
||||
|
return $res; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,156 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Niucloud-admin 企业快速开发的多应用管理平台 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | 官方网址:https://www.niucloud.com |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | niucloud团队 版权所有 开源版本可自由商用 |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: Niucloud Team |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
namespace app\service\api\apiService; |
||||
|
|
||||
|
use app\model\class_grade\ClassGrade; |
||||
|
use app\model\student\Student; |
||||
|
use app\model\assignment\Assignment; |
||||
|
use app\model\course\Course; |
||||
|
use core\base\BaseApiService; |
||||
|
|
||||
|
/** |
||||
|
* 考勤管理服务层 |
||||
|
* Class MemberService |
||||
|
* @package app\service\api\member |
||||
|
*/ |
||||
|
class jlClassService extends BaseApiService |
||||
|
{ |
||||
|
public function __construct() |
||||
|
{ |
||||
|
parent::__construct(); |
||||
|
$this->model = (new ClassGrade()); |
||||
|
} |
||||
|
|
||||
|
//列表 |
||||
|
public function list($id,$data) |
||||
|
{ |
||||
|
$order = 'id desc'; |
||||
|
$where = []; |
||||
|
if ($data['name'] !== '') { |
||||
|
$where[] = ['name','like','%'.$data['name'].'%']; |
||||
|
} |
||||
|
$search_model = $this->model->where('head_coach', $id)->where($where)->order($order) |
||||
|
->with(['classPersonnelRel' => function($query) { |
||||
|
$query->with(['student' => function($query) { |
||||
|
$query->with(['customerResources' => function($query) { |
||||
|
$query->with(['member' => function($query) { |
||||
|
$query->select(); |
||||
|
}]); |
||||
|
}]); |
||||
|
},'studentCourses']); |
||||
|
|
||||
|
},'personnelAll']); |
||||
|
$list = $this->pageQuery($search_model); |
||||
|
foreach ($list['data'] as &$v){ |
||||
|
if (count($v['classPersonnelRel']) > 0) { |
||||
|
$now = time(); |
||||
|
$count = 0; |
||||
|
foreach ($v['classPersonnelRel'] as $item) { |
||||
|
if (isset($item['end_date'])) { |
||||
|
$endTime = strtotime($item['end_date']); |
||||
|
if ($endTime > $now && $endTime <= $now + 7 * 86400) { |
||||
|
$count++; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
$v['end_count'] = $count; |
||||
|
} else { |
||||
|
$v['end_count'] = 0; |
||||
|
} |
||||
|
} |
||||
|
return $list; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public function info($data) |
||||
|
{ |
||||
|
$search_model = $this->model->where('id', $data) |
||||
|
->with(['classPersonnelRel' => function($query) { |
||||
|
$query->with(['student' => function($query) { |
||||
|
$query->with(['customerResources' => function($query) { |
||||
|
$query->with(['member' => function($query) { |
||||
|
$query->select(); |
||||
|
}]); |
||||
|
}]); |
||||
|
},'studentCourses','studentCoursesInfo']); |
||||
|
},'personnelAll', 'personnelName']); |
||||
|
$list = $search_model->find(); |
||||
|
if (count($list['classPersonnelRel']) > 0) { |
||||
|
$now = time(); |
||||
|
$count = 0; |
||||
|
foreach ($list['classPersonnelRel'] as $item) { |
||||
|
if (isset($item['end_date'])) { |
||||
|
$endTime = strtotime($item['end_date']); |
||||
|
if ($endTime > $now && $endTime <= $now + 7 * 86400) { |
||||
|
$count++; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
$v['end_count'] = $count; |
||||
|
} else { |
||||
|
$v['end_count'] = 0; |
||||
|
} |
||||
|
return $list; |
||||
|
} |
||||
|
|
||||
|
public function jlStudentsInfo($data) |
||||
|
{ |
||||
|
$Student = new Student(); |
||||
|
$res = $Student->where('id',$data)->with(['customerResources' => function($query) { |
||||
|
$query->with(['member' => function($query) { |
||||
|
$query->select(); |
||||
|
}]); |
||||
|
}]); |
||||
|
$res = $res->find(); |
||||
|
return $res; |
||||
|
} |
||||
|
|
||||
|
public function PhysicalTestList($data) |
||||
|
{ |
||||
|
$resource_id = $data; |
||||
|
$where = [ |
||||
|
'resource_id' => $resource_id, |
||||
|
]; |
||||
|
$physical_test = (new PhysicalTestService())->getList($where); |
||||
|
$res['physical_test'] = $physical_test; |
||||
|
return $res; |
||||
|
} |
||||
|
|
||||
|
public function GetClassesList() |
||||
|
{ |
||||
|
$res = $this->model->where('status',1)->select()->toArray(); |
||||
|
return $res; |
||||
|
} |
||||
|
|
||||
|
public function GetCoursesList() |
||||
|
{ |
||||
|
$Course = new Course(); |
||||
|
$res = $Course->select()->toArray(); |
||||
|
return $res; |
||||
|
} |
||||
|
|
||||
|
public function GetStudentList() |
||||
|
{ |
||||
|
$Student = new Student(); |
||||
|
$res = $Student->where('status', 1)->select()->toArray(); |
||||
|
return $res; |
||||
|
} |
||||
|
|
||||
|
public function addPublishJob($data) |
||||
|
{ |
||||
|
$Assignment = new Assignment(); |
||||
|
$res = $Assignment->create($data); |
||||
|
return $res; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue