提交 e23b2be2 编写于 作者: 钟一霄's avatar 钟一霄

设置打卡范围,未完成

上级 e21358b4
......@@ -9,6 +9,9 @@
<title>值班管理</title>
</head>
<body>
<!-- <script charset="utf-8" src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=ZNMBZ-NYOEO-WNMWL-SJF4C-MWKQT-KJB7W&referer=myapp"></script> -->
<!-- <script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77"></script> -->
<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&key=ZNMBZ-NYOEO-WNMWL-SJF4C-MWKQT-KJB7W"></script>
<script type="text/javascript" src="/a/manager/identify/identify.js"></script>
<noscript>
<strong>
......
......@@ -446,3 +446,44 @@ export function Messageretry(data) {
data
});
}
/**
* Attendance
*/
// 获取考勤列表
export function GetAttendanceList() {
return request({
url: `/api/Attendance/GetAttendanceList`,
method: 'get',
});
}
// 保存考勤
export function AttendanceSave(data) {
return request({
url: `/api/Attendance/AttendanceSave`,
method: 'post',
data,
});
}
// 删除考勤
export function AttendanceDel() {
return request({
url: `/api/Attendance/AttendanceDel`,
method: 'get',
});
}
// 获取考勤时间
export function GetSignTime() {
return request({
url: `/api/Attendance/GetSignTime`,
method: 'get',
});
}
// 保存考勤时间
export function GetSignTimeSave(data) {
return request({
url: `/api/Attendance/GetSignTimeSave`,
method: 'post',
data,
});
}
......@@ -50,7 +50,7 @@
<span>值班领导:&nbsp;&nbsp;&nbsp;&nbsp;</span>
<Select v-model="cityListAllObject.is_lead" clearable placeholder="是否为值班领导"
style="width:10vw;">
<Option v-for="(item,index) in dutyRole" :value="item.value">{{ item.label }}</Option>
<Option v-for="(item,index) in dutyRole" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</div>
</Col>
......@@ -136,7 +136,7 @@
</FormItem>
<FormItem label="是否为值班领导" prop="is_lead">
<Select v-model="formValidate.is_lead" placeholder="是否为值班领导">
<Option v-for="(item,index) in dutyRole" :value="item.value">{{ item.label }}</Option>
<Option v-for="(item,index) in dutyRole" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem v-for="(item,index) in addDutySlectList" :key="index" :label="item[1]" :prop="item[2]"
......@@ -178,7 +178,7 @@
</FormItem>
<FormItem label="是否为值班领导" prop="is_lead">
<Select v-model="updateDutyFrom.is_lead" placeholder="是否为值班领导">
<Option v-for="(item,index) in dutyRole" :value="item.value">{{ item.label }}</Option>
<Option v-for="(item,index) in dutyRole" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem v-for="(item,index) in addDutySlectList" :key="index" :label="item[1]" :prop="item[2]"
......@@ -213,7 +213,7 @@
</FormItem>
<FormItem label="是否为值班领导" prop="is_lead">
<Select v-model="dutyDataInputObject.is_lead" placeholder="是否为值班领导">
<Option v-for="(item,index) in dutyRole" :value="item.value">{{ item.label }}</Option>
<Option v-for="(item,index) in dutyRole" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem v-for="(item,index) in addDutySlectList" :key="index" :label="item[1]" :prop="item[2]"
......
<template>
<!-- 考勤管理 -->
<div>
<!-- table列表 -->
<Table :columns="tableColumns" :data="tableData">
<template #action="{ row }">
<!-- <a @click="rowEdit(row)">编辑</a>
<Divider type="vertical"/> -->
<a @click="rowDelete(row)">删除</a>
</template>
</Table>
<!-- <div id="tmap"></div> -->
<!-- 编辑Modal -->
<Modal
v-model="editModalShow"
mask-closable
:title="`${isEdit ? '编辑' : '添加'}考勤地点`">
<template>
<iframe
id="mapPage"
width="100%"
height="500px"
frameborder="0"
:src="`https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=ZNMBZ-NYOEO-WNMWL-SJF4C-MWKQT-KJB7W&referer=myapp`">
</iframe>
<!-- <div id="tmap"></div> -->
</template>
<template #footer>
<Button type="primary" @click="nextStep">下一步</Button>
</template>
</Modal>
</div>
</template>
<script>
import * as api from '@/api/lezRequest'
export default {
data() {
return {
tableColumns: [
{ title: '序号', type: 'index', width: 80, align: 'center' },
{ title: '标题', key: 'title' },
{ title: '地址', key: 'address' },
{ title: '纬度', key: 'latitude' },
{ title: '经度', key: 'longitude' },
{ title: '误差', key: 'offset' },
// { title: '精度', key: 'accuracy' },
{ title: '创建时间', key: 'createtime' },
{ title: '操作', slot: 'action', width: 120, align: 'center' },
],
tableData: [],
// true.编辑 false.添加
isEdit: false,
editModalShow: false,
addrName: undefined,
address: undefined,
}
},
computed: {},
created() {
this.getAttendanceList()
},
mounted() {
var that = this
window.addEventListener('message', function (event) {
// 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息
var loc = event.data;
if (loc && loc.module == 'locationPicker') {//防止其他应用也会向该页面post信息,需判断module是否为'locationPicker'
console.log('location', loc);
that.address = loc
}
}, false);
},
methods: {
nextStep() {
this.addrName = this.address.poiname
},
// rowEdit(row) {
// console.log('编辑',row)
// this.isEdit = true
// this.editModalShow = true
// // var center = new window.TMap.LatLng(Number(row.latitude), Number(row.longitude))
// // var map = new window.TMap.Map(document.getElementById('tmap'), {
// // center: center,//设置地图中心点坐标
// // zoom: 17.2, //设置地图缩放级别
// // pitch: 43.5, //设置俯仰角
// // rotation: 45 //设置地图旋转角度
// // });
// this.$nextTick(() => {
// var center = new TMap.LatLng(39.984104, 116.307503);
// //初始化地图
// var map = new TMap.Map("mapPage", {
// zoom: 12, //设置地图缩放级别
// center: center //设置地图中心点坐标
// });
// var circle = new TMap.MultiCircle({
// map,
// styles: { // 设置圆形样式
// 'circle': new TMap.CircleStyle({
// 'color': 'rgba(41,91,255,0.16)',
// 'showBorder': true,
// 'borderColor': 'rgba(41,91,255,1)',
// 'borderWidth': 2,
// }),
// },
// geometries: [{
// styleId: 'circle',
// center: center,
// radius: 6500,
// }],
// });
// })
// },
rowDelete(row) {
console.log('删除',row)
},
// 获取考勤列表
getAttendanceList() {
this.$Spin.show()
api.GetAttendanceList().then(res => {
// console.log(res)
this.tableData = res.response
}).catch(e => {
this.globalMessage('error', e)
}).finally(() => {
this.$Spin.hide()
})
},
globalMessage(type, content, time = 3, background = true) {
this.$Message[type]({
type: type,
content: content,
duration: time,
background: background,
})
},
},
}
</script>
<style scoped lang="less">
</style>
\ No newline at end of file
......@@ -16,7 +16,13 @@
<!-- </template>-->
<Table :columns="columns" :data="data">
<!-- 签到类型 -->
<template #sign_type="{ row }">
<span v-if="row.sign_type == 0">免打卡</span>
<span v-if="row.sign_type == 1">无定位打卡</span>
<span v-if="row.sign_type == 2">定位拍照打卡</span>
</template>
<!-- 操作 -->
<template #action="{row}">
<Button type="primary" size="small" @click="update(row)">修改</Button>
<Button type="error" size="small" @click="Delete(row)" style="margin-left: 10px;">删除</Button>
......@@ -36,6 +42,13 @@
<FormItem label="值班类型备注" prop="input2">
<Input v-model="formTop.input2"></Input>
</FormItem>
<FormItem label="签到类型">
<Select v-model="formTop.type">
<Option :value="0">免打卡</Option>
<Option :value="1">无定位打卡</Option>
<Option :value="2">定位拍照打卡</Option>
</Select>
</FormItem>
<!-- <FormItem label="选择教师" prop="input2" >-->
<!-- <Select v-model="teacherSelectCurrentValue" filterable placeholder="请选择或搜索...">-->
<!-- <Option v-for="item in cityTeacherList" :value="item.id" :key="item.id" >{{ item.name }}</Option>-->
......@@ -84,6 +97,7 @@
id: '',
input1: '',
input2: '',
type: '',
},
page_size: 10,
page_index: 1,
......@@ -103,6 +117,10 @@
title: '类型备注',
key: 'watchtype_remark',
},
{
title: '签到类型',
slot: 'sign_type',
},
// {
// title: '备注',
// key:'role_remark',
......@@ -154,16 +172,18 @@
"watchtypeid": this.formTop.id,
"watchtypename": this.formTop.input1,
"watchtype_remark": this.formTop.input2,
"sign_type": this.formTop.type,
}
const res = await api.WatchTypeSave(data)
this.GetWatchTypeList()
},
update(e) {
console.log(e)
// console.log(e)
this.formTop.id = e.watchtypeid;
this.formTop.input1 = e.watchtypename;
this.formTop.input2 = e.watchtype_remark
this.formTop.type = e.sign_type
this.modal = true
},
async DeleteAction() {
......
......@@ -10,6 +10,7 @@
<Radio label="time">值班时间</Radio>
<Radio label="campus">校区配置</Radio>
<Radio label="info">消息提醒</Radio>
<Radio label="attendance">考勤管理</Radio>
</RadioGroup>
</div>
......@@ -17,13 +18,14 @@
<template #extra>
<div style="display: flex;flex-wrap: nowrap;align-items: center; ">
<Input v-if="!showComponent.info" v-model="searchValue" placeholder="请输入权限名称进行查找..."></Input>
<Button v-if="!showComponent.info" type="primary" :disabled="searchValue === ''" @click="searchEvent"
<Input v-if="!showComponent.info && !showComponent.attendance" v-model="searchValue" placeholder="请输入权限名称进行查找..."></Input>
<Button v-if="!showComponent.info && !showComponent.attendance" type="primary" :disabled="searchValue === ''" @click="searchEvent"
style="margin-left: 10px;">查找
</Button>
<Button v-if="!showComponent.info" type="primary" @click="addWatchType" style="margin-left: 10px;">
<Button v-if="!showComponent.info && !showComponent.attendance" type="primary" @click="addWatchType" style="margin-left: 10px;">
{{ ModalTitleValue }}
</Button>
<Button v-if="showComponent.attendance" type="primary" @click="addAttendance">添加考勤范围</Button>
</div>
</template>
<watchType v-if="showComponent.type" :input="formTop" @cancelModal="cancelModal"
......@@ -33,6 +35,7 @@
:searchValue="searchValue"></Campus>
<WatchHour v-if="showComponent.time" :input="formTop" @cancelModal="cancelModal"
:searchValue="searchValue"></WatchHour>
<Attendance v-if="showComponent.attendance" ref="attendance"></Attendance>
<!-- <Table :columns="columns" :data="data">-->
<!-- <template #action="{row}">-->
......@@ -105,6 +108,7 @@
import Campus from '@/pages/systemConfiguration/component/initialComponent/Campus.vue'
import MessageConfig from '@/pages/systemConfiguration/component/initialComponent/MessageConfig.vue'
import WatchHour from '@/pages/systemConfiguration/component/initialComponent/WatchHour.vue'
import Attendance from '@/pages/systemConfiguration/component/initialComponent/Attendance.vue'
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
......@@ -115,6 +119,7 @@
MessageConfig,
Campus,
WatchHour,
Attendance,
},
data() {
//这里存放数据",
......@@ -125,6 +130,7 @@
time: false,
campus: false,
info: false,
attendance: false,
},
buttonSize: '',
searchValue: '', // 公共输入框值
......@@ -181,6 +187,10 @@
addWatchType() {
this.modal = true
},
addAttendance() {
this.$refs.attendance.isEdit = false
this.$refs.attendance.editModalShow = true
},
modalOk() {
this.formTop.flag = true
},
......@@ -191,6 +201,7 @@
this.showComponent.info = false
this.showComponent.time = false
this.showComponent.campus = false
this.showComponent.attendance = false
this.searchValue = ''
this.formTop.input1 = ''
this.formTop.input2 = ''
......@@ -201,6 +212,7 @@
this.showComponent.info = true
this.showComponent.time = false
this.showComponent.campus = false
this.showComponent.attendance = false
this.searchValue = ''
this.formTop.input1 = ''
this.formTop.input2 = ''
......@@ -212,6 +224,7 @@
this.showComponent.info = false
this.showComponent.time = true
this.showComponent.campus = false
this.showComponent.attendance = false
this.searchValue = ''
this.formTop.input1 = ''
this.formTop.input2 = ''
......@@ -222,6 +235,18 @@
this.showComponent.info = false
this.showComponent.time = false
this.showComponent.campus = true
this.showComponent.attendance = false
this.searchValue = ''
this.formTop.input1 = ''
this.formTop.input2 = ''
this.formTop.timeName1 = ''
break;
case 'attendance':
this.showComponent.type = false
this.showComponent.info = false
this.showComponent.time = false
this.showComponent.campus = false
this.showComponent.attendance = true
this.searchValue = ''
this.formTop.input1 = ''
this.formTop.input2 = ''
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或