Commit b3c83d0a by huyue

提交日报

1 parent ad01a0b8
......@@ -310,3 +310,45 @@ export function getSalaryDetailApi(data) {
data.method = `${path2}staffMonthSalary.detail`
return request(data, "post")
}
// 查询日报模板类型列表
export function getTemplateList(data = {}) {
data.method = 'dj.api.smartcarlife.digital.management.template.type.list'
return request(data, 'post')
}
// 督导
export function getStaffList(data) {
data.method = 'dj.api.smartcarlife.digital.management.template.staff.ref.list'
return request(data, 'post')
}
// 分页查询日报列表,表格数据
export function getRecordPage(data) {
data.method = 'dj.api.smartcarlife.digital.management.record.page'
return request(data, 'post')
}
// 查询模板详情, 表头数据
export function getTemplateDetail(data) {
data.method = 'dj.api.smartcarlife.digital.management.template.detail'
return request(data, 'post')
}
// 查询日报统计总览
export function getSummary(data) {
data.method = 'dj.api.smartcarlife.digital.management.record.summary'
return request(data, 'post')
}
// 查询未提交明细列表
export function getSummaryStaff(data) {
data.method = 'dj.api.smartcarlife.digital.management.record.staff.summary'
return request(data, 'post')
}
// 更新模版绑定员工
export function updateStaff(data) {
data.method = 'dj.api.smartcarlife.digital.management.template.staff.ref.update'
return request(data, 'post')
}
......@@ -819,5 +819,26 @@ export const routerName = {
}
],
component: _import("residentManage/growUpGrade/indexControl")
},
91215: {
path: "/dailyPaperManagement",
name: "dailyPaperManagement",
meta: {
title: "日报管理",
authId: "91215",
parentId: "912",
cache: false
},
auth: [
{
authId: "9121501",
parentId: "91215",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("residentManage/dailyPaperManagement/index")
}
}
<template>
<div>
<d2-container>
<div class="header" slot="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="reportTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { loginRecordPage } from "@api/resident"
export default {
components: {},
data() {
return {
searchForm: {},
labelWidth: '100px',
showFormData: [
{
label: '日报模板',
name: 'templateName',
type: 'select',
optionList: [
{
label: '模板1',
value: 1
},
{
label: '模板2',
value: 2
}
]
},
{
label: '日报日期',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
},
{
label: '督导',
name: 'dudao',
type: 'select',
}
],
searchFormSearch: {
businessScene: ["1"]
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOptions: false,
tableColumns: [
{
label: '督导',
prop: 'positionName'
},
{
label: '管理门店数',
prop: 'positionValue'
},
{
label: '门店平均渗透率(权益升级)',
prop: 'positionValue',
// sortable: "custom"
}
],
getListApi: loginRecordPage
}
}
},
created() {//默认当前日期
this.searchForm.time = [new Date(), new Date()]
},
methods: {
handleReset() {
this.searchForm = {
time: '',
merchantName: '',
}
this.$refs.reportTable.refreshTable(false, true)
},
handleSearch() {
this.$refs.reportTable.refreshTable(false, true)
},
beforeSearchFn() {
}
}
}
</script><!-- 登录日志 - 列表 -->
<template>
<div>
<!-- class="order-detail" -->
<d2-container>
<!-- <div class="offline-account"> -->
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="labelWidth"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<!-- </d2-container>
<d2-container> -->
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { loginRecordPage } from "@api/resident"
export default {
name: 'TransferAccountsList',
components: {
},
data() {
return {
labelWidth: '100px',
searchForm: {
time: '',
merchantName: '',
},
searchFormSearch: {},
showFormData: [{
label: '日期',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '登录商户',
name: 'merchantName',
type: 'input',
maxlength: '20',
isClear: true
}],
getListApi: loginRecordPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: false,
tableColumns: [{
label: '商户名称',
prop: 'merchantName'
}, {
label: '商户号',
prop: 'merchantId'
}, {
label: '员工姓名',
prop: 'staffName',
sortable: "custom"
}, {
label: '员工手机号',
prop: 'staffPhone',
width: '120px'
}, {
label: '登录次数',
prop: 'loginTimes'
}
]
},
baseData: {
},
}
},
created() {//默认当前日期
this.searchForm.time = [new Date(), new Date()]
},
mounted() {
this.getBaseData()
},
methods: {
async getBaseData() {
this.getOptionsList()
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.time) {
this.searchFormSearch.beginDate = Util.dateFormate(this.searchFormSearch.time[0], 'YYYY-MM-DD')
this.searchFormSearch.endDate = Util.dateFormate(this.searchFormSearch.time[1], 'YYYY-MM-DD')
delete this.searchFormSearch.time
}
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleSearch() {
this.$refs.recordTable.refreshTable(false, true)
},
handleReset() {
this.searchForm = {
time: '',
merchantName: '',
}
this.$refs.recordTable.refreshTable(false, true)
},
handleExport() {
var params = this.searchFormSearch
// 去除为null的值
for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) {
delete params[key]
}
}
params.method = 'dj.api.smartcarlife.staff.login.record.export'
const list = [
...this.dowloadList,
{
name: '登录日志',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
.tableHeaderBtn {
margin-left: 10px;
}
</style>
<template>
<div class="report">
<el-drawer :title="type == 1 ? '修改名单' : type == 2 ? '未提交详情' : ''" :visible.sync="drawer" :direction="direction"
:before-close="handleClose">
<div class="demo-drawer__content">
<div class="content">
<div class="title">基本信息</div>
<template v-if="type == 1">
<el-transfer class="transfer" v-model="value" filterable :titles="['待选列表', '已选列表']"
:left-default-checked="leftDefaultChecked" :right-default-checked="rightDefaultChecked" :format="{
noChecked: '${total}项',
hasChecked: '${checked}/${total}项'
}" @change="handleChange" @left-check-change="leftChange" @right-check-change="rightChange" :data="data">
<span slot-scope="{ option }">{{ option.key }} - {{ option.label }}</span>
<el-button class="transfer-footer" slot="left-footer" size="mini"
@click="selectTranfer('left')">反选</el-button>
<el-button class="transfer-footer" slot="right-footer" size="mini"
@click="selectTranfer('right')">反选</el-button>
</el-transfer>
</template>
<template v-else-if="type == 2">
<div class="basic-info"><span>日报模板:</span>区域督导考核模板</div>
<div class="basic-info"><span>日报日期:</span>2024-12-25</div>
<div class="basic-info"><span>缺失份数:</span>30份</div>
<div class="title">明细数据 <el-button type="primary" size="mini">导出</el-button></div>
<d2-table style="margin-top: 16px;" ref="detailTable" :get-list-api="getListApi"
:table-params="tableParams">
</d2-table>
</template>
<template v-else>
<span>我来啦!</span>
</template>
</div>
<div class="demo-drawer__footer" v-if="type == 1">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="submit">确 定</el-button>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import { loginRecordPage } from "@api/resident"
import { template } from "babel-core";
export default {
name: 'Drawer',
props: {
drawerVisible: {
type: Boolean,
default: false
},
direction: {
type: String,
default: 'rtl'
},
type: {
type: Number,
default: 0
}
},
watch: {
drawerVisible(val) {
this.drawer = val
}
},
data() {
const generateData = _ => {
const data = [];
for (let i = 1; i <= 15; i++) {
data.push({
key: i,
label: `备选项 ${i}`,
// disabled: i % 4 === 0
});
}
return data;
};
return {
drawer: false,
data: generateData(),
value: [1],
leftChecked: [],
rightChecked: [],
leftDefaultChecked: [],
rightDefaultChecked: [],
getListApi: loginRecordPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: false,
tableColumns: [{
label: '督导姓名',
prop: 'merchantName'
}, {
label: '最近提交日报日期',
prop: 'merchantId',
sortable: "custom"
}, {
label: '本周提交总数',
prop: 'staffName',
sortable: "custom"
}, {
label: '本月提交总数',
prop: 'loginTimes'
}
]
},
}
},
methods: {
handleClose(done) {
done()
this.$emit('handleClose')
},
handleChange(value, direction, movedKeys) {
this.$emit('drawerChange', value)
},
leftChange(currentValue, selectValue) {
this.leftChecked = currentValue
},
rightChange(currentValue, selectValue) {
this.rightChecked = currentValue
},
selectTranfer(type) {
switch (type) {
case 'left':
// 左边反选的 = 全部 - value - 左边已选的
const all = new Set(this.data.map(item => item.key))
const leftArr = this.value.concat(this.leftChecked) // value + 左边已选
leftArr.map(item => all.delete(item))
this.leftDefaultChecked = Array.from(all)
this.leftChecked = this.leftDefaultChecked // 修改左边已选的值
break
case 'right':
// 右边边反选的 = value - 右边已选的
const value = new Set(this.value)
this.rightChecked.map(item => value.delete(item))
this.rightDefaultChecked = Array.from(value)
this.rightChecked = this.rightDefaultChecked
break
default:
break
}
},
cancel() {
if (this.type == 1) {
this.drawer = false
this.leftChecked = []
this.rightChecked = []
this.leftDefaultChecked = []
this.rightDefaultChecked = []
this.$emit('handleClose')
} else {
this.$emit('handleClose')
}
},
submit() {
if (this.type == 1) {
this.drawer = false
this.leftChecked = []
this.rightChecked = []
this.leftDefaultChecked = []
this.rightDefaultChecked = []
this.$emit('handleSubmit', this.value)
} else {
this.$emit('handleSubmit')
}
}
}
}
</script>
<style lang="scss">
.report {
.el-drawer__header {
padding: 18.5px 20px;
margin-bottom: 0;
border-bottom: 1px solid #E5E5E5;
}
.el-drawer.rtl {
width: 774px !important;
}
.el-transfer-panel {
width: 270px;
}
.el-transfer-panel .el-transfer-panel__footer {
padding-left: 16px;
}
.content {
padding: 0 20px;
.title {
display: flex;
color: #333333;
font-size: 16px;
justify-content: space-between;
padding: 13.5px 0;
border-bottom: 1px solid #E5E5E5;
}
.transfer {
text-align: left;
display: inline-block;
margin-top: 16px;
}
}
.demo-drawer__content {
display: flex;
flex-direction: column;
height: 100%;
}
.demo-drawer__footer {
background-color: #fff;
display: flex;
position: absolute;
bottom: 20px;
right: 20px;
}
.basic-info {
font-size: 14px;
color: #333;
padding-left: 100px;
margin: 16px 20px 0 0;
span {
color: #666;
}
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!