xy 9 months ago
parent fbdbaa1def
commit 21b38ba58d

@ -8,11 +8,11 @@
type="daterange" type="daterange"
size="small" size="small"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
clearable
style="width: 260px;" style="width: 260px;"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期"
@input="e => (e && e.length === 2) ? (select.start_date = e[0],select.end_date = e[1]) : (select.start_date = '',select.end_date = '')">
</el-date-picker> </el-date-picker>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 6px;" @click="getList"></el-button> <el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 6px;" @click="getList"></el-button>
</template> </template>
@ -128,6 +128,28 @@
</template> </template>
</vxe-column> </vxe-column>
</vxe-table> </vxe-table>
<el-pagination
style="margin-top: 10px"
@size-change="
(e) => {
select.page_size = e;
select.page = 1;
getList();
}
"
@current-change="
(e) => {
select.page = e;
getList();
}
"
:current-page.sync="select.page"
:page-sizes="[10, 20, 30, 50, 100]"
:page-size.sync="select.page_size"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</card-container> </card-container>
</div> </div>
</template> </template>
@ -151,7 +173,7 @@ export default {
tableData: [], tableData: [],
select: { select: {
page: 1, page: 1,
page_size: 9999, page_size: 10,
start_date: this.$moment().subtract(1, 'months').format('YYYY-MM-DD'), start_date: this.$moment().subtract(1, 'months').format('YYYY-MM-DD'),
end_date: this.$moment().add(1, 'months').format('YYYY-MM-DD') end_date: this.$moment().add(1, 'months').format('YYYY-MM-DD')
}, },

@ -3,9 +3,14 @@
<CardContainer> <CardContainer>
<div> <div>
<el-button v-if="isShowDuty" type="primary" style="display: block;margin: auto auto 20px;" @click="startDuty"></el-button> <el-button v-if="isShowDuty" type="primary" style="display: block;margin: auto auto 20px;" @click="startDuty"></el-button>
<button class="sign-btn" @click="clockIn"> <div style="display: flex;">
<span>{{ isOutSign ? ' 外勤' : '' }}打卡</span> <button class="sign-btn" v-if="signStatus === 1 || signStatus === 2" @click="clockIn(false)">
<span>打卡</span>
</button> </button>
<button class="sign-btn" v-if="signStatus === 2 || signStatus === 0" @click="clockIn(true)">
<span>外勤打卡</span>
</button>
</div>
<div class="sign-info"> <div class="sign-info">
<div class="sign-statue"> <div class="sign-statue">
<div>打卡状态 <el-tag size="small" effect="dark" type="primary">{{ (isGetLocation || isIpSign) ? (isOutSign ? '外勤打卡' : '可打卡') : '不可打卡' }}</el-tag></div> <div>打卡状态 <el-tag size="small" effect="dark" type="primary">{{ (isGetLocation || isIpSign) ? (isOutSign ? '外勤打卡' : '可打卡') : '不可打卡' }}</el-tag></div>
@ -86,6 +91,7 @@ export default {
return { return {
uploadSize, uploadSize,
isInUni: false, isInUni: false,
signStatus: 0,
// start // start
loading: false, loading: false,
action: process.env.VUE_APP_UPLOAD_API, action: process.env.VUE_APP_UPLOAD_API,
@ -160,7 +166,8 @@ export default {
if (this.isIpSign) { if (this.isIpSign) {
const res = await signIp({ const res = await signIp({
image_id: this.imageId, image_id: this.imageId,
remark: this.remark remark: this.remark,
status: 3
}) })
} else { } else {
const res = await sign({ const res = await sign({
@ -180,7 +187,7 @@ export default {
this.loading = false this.loading = false
} }
}, 1000, true), }, 1000, true),
clockIn: throttle(async function() { clockIn: throttle(async function(isOut=true) {
try { try {
if (!this.isInUni && !this.isIpSign) { if (!this.isInUni && !this.isIpSign) {
await this.getLocation() await this.getLocation()
@ -195,12 +202,14 @@ export default {
return return
} }
if(!this.isGetLocation && !this.isIpSign) return if(!this.isGetLocation && !this.isIpSign) return
if(this.isOutSign) { if(isOut) {
this.isShow = true this.isShow = true
return return
} }
if (this.isIpSign) { if (this.isIpSign) {
const res = await signIp() const res = await signIp({
status: 1
})
} else { } else {
const res = await sign({ const res = await sign({
location: `${this.pos.lng},${this.pos.lat}`, location: `${this.pos.lng},${this.pos.lat}`,
@ -262,10 +271,12 @@ export default {
async preIp() { async preIp() {
try { try {
const res = await preIp() const { result } = await preIp()
this.isOutSign = false this.signStatus = result
// this.isOutSign = false
} catch (err) { } catch (err) {
this.isOutSign = true // this.isOutSign = true
} }
}, },
async pos2Address(lat, lng) { async pos2Address(lat, lng) {

@ -77,15 +77,15 @@
@click="getList(true)" @click="getList(true)"
>搜索</el-button >搜索</el-button
> >
<el-button <!-- <el-button-->
v-if="$route.path === '/flow/list/todo'" <!-- v-if="$route.path === '/flow/list/todo'"-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
type="primary" <!-- type="primary"-->
size="small" <!-- size="small"-->
plain <!-- plain-->
@click="multiDeal" <!-- @click="multiDeal"-->
>批量审批</el-button <!-- >批量审批</el-button-->
> <!-- >-->
</div> </div>
</template> </template>
</vxe-toolbar> </vxe-toolbar>
@ -386,7 +386,7 @@ import moment from "moment/moment";
import ListPopover from "./components/ListPopover.vue"; import ListPopover from "./components/ListPopover.vue";
import MultiDeal from "./components/MultiDeal.vue" import MultiDeal from "./components/MultiDeal.vue"
import share from "./components/share.vue"; import share from "./components/share.vue";
import {index as departmentIndex} from "@/api/department"; import { departmentListNoAuth } from "@/api/common"
export default { export default {
name: "flowList", name: "flowList",
components: { components: {
@ -512,7 +512,7 @@ export default {
methods: { methods: {
async getDepartments() { async getDepartments() {
try { try {
this.departments = await departmentIndex({ this.departments = await departmentListNoAuth({
page: 1, page: 1,
page_size: 9999 page_size: 9999
}) })

Loading…
Cancel
Save