|
@@ -1,5 +1,9 @@
|
|
<template>
|
|
<template>
|
|
<div class="container">
|
|
<div class="container">
|
|
|
|
+ <div style="padding: 16px 0 ;display:flex;flex-direction: row;justify-content: space-between;" v-if="type === '2'">
|
|
|
|
+ <div class="van-doc-block__title"></div>
|
|
|
|
+ <div class="van-doc-block__sub_title" @click="change_user">换人签到</div>
|
|
|
|
+ </div>
|
|
<van-form @submit="onSubmit">
|
|
<van-form @submit="onSubmit">
|
|
<van-cell-group inset>
|
|
<van-cell-group inset>
|
|
<van-field
|
|
<van-field
|
|
@@ -51,24 +55,12 @@
|
|
<van-button :loading="loading" loading-text="签到中..." block type="primary" native-type="submit">
|
|
<van-button :loading="loading" loading-text="签到中..." block type="primary" native-type="submit">
|
|
确定签到
|
|
确定签到
|
|
</van-button>
|
|
</van-button>
|
|
-
|
|
|
|
- <div class="div-line"></div>
|
|
|
|
-
|
|
|
|
- <van-button block type="default" @click="handleSignCancel" v-if="type === '1'">
|
|
|
|
- 取消签到
|
|
|
|
- </van-button>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="button-list" v-if="type === '2'">
|
|
<div class="button-list" v-if="type === '2'">
|
|
<van-button :loading="loading" loading-text="签退中..." block type="danger" native-type="submit">
|
|
<van-button :loading="loading" loading-text="签退中..." block type="danger" native-type="submit">
|
|
确定签退
|
|
确定签退
|
|
</van-button>
|
|
</van-button>
|
|
-
|
|
|
|
- <div class="div-line"></div>
|
|
|
|
-
|
|
|
|
- <van-button block type="default" @click="handleSignCancel">
|
|
|
|
- 取消签退
|
|
|
|
- </van-button>
|
|
|
|
</div>
|
|
</div>
|
|
</van-form>
|
|
</van-form>
|
|
</div>
|
|
</div>
|
|
@@ -110,32 +102,45 @@ const onSubmit = () => {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
signEvent(data).then((res)=>{
|
|
signEvent(data).then((res)=>{
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
|
+ if(submitMethod == '1') {
|
|
|
|
+ form.value.sign_time = res.data.sign_time;
|
|
|
|
+ localStorage.setItem(event_id+"_signData", JSON.stringify(form.value));
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ localStorage.removeItem(event_id+"_signData");
|
|
|
|
+ }
|
|
router.push("/signOK?type="+submitMethod)
|
|
router.push("/signOK?type="+submitMethod)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-const handleSignCancel = () => {
|
|
|
|
- router.push("/")
|
|
|
|
-}
|
|
|
|
|
|
+const change_user = () => {
|
|
|
|
+ type.value = '1';
|
|
|
|
+ form.value = {
|
|
|
|
+ user_id: '0',
|
|
|
|
+ nick_name: '',
|
|
|
|
+ dept_id: '0',
|
|
|
|
+ dept_name: '',
|
|
|
|
+ duties: '',
|
|
|
|
+ sign_time: '',
|
|
|
|
+ phone: ''
|
|
|
|
+ };
|
|
|
|
+ localStorage.removeItem(event_id+"_signData");
|
|
|
|
+};
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- if (/(wxworklocal)/i.test(navigator.userAgent)) {
|
|
|
|
- getSignInfo({event_id: event_id}).then((res)=> {
|
|
|
|
- const user = res.data;
|
|
|
|
- console.log('user', user);
|
|
|
|
- type.value = user.sign_time == '' ? '1' : '2';
|
|
|
|
-
|
|
|
|
- form.value = {
|
|
|
|
- user_id: user.user_id,
|
|
|
|
- nick_name: user.nick_name,
|
|
|
|
- dept_id: user.dept_id,
|
|
|
|
- dept_name: user.dept_name,
|
|
|
|
- duties: user.duties,
|
|
|
|
- sign_time: user.sign_time,
|
|
|
|
- phone: user.phone
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ const jsonData = localStorage.getItem(event_id+"_signData");
|
|
|
|
+ if (jsonData) {
|
|
|
|
+ const user = JSON.parse(jsonData);
|
|
|
|
+ type.value = user.sign_time == '' ? '1' : '2';
|
|
|
|
+ form.value = {
|
|
|
|
+ user_id: user.user_id,
|
|
|
|
+ nick_name: user.nick_name,
|
|
|
|
+ dept_id: user.dept_id,
|
|
|
|
+ dept_name: user.dept_name,
|
|
|
|
+ duties: user.duties,
|
|
|
|
+ sign_time: user.sign_time,
|
|
|
|
+ phone: user.phone
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
@@ -150,5 +155,13 @@ onMounted(() => {
|
|
.div-line {
|
|
.div-line {
|
|
height: 16px;
|
|
height: 16px;
|
|
}
|
|
}
|
|
|
|
+ .van-doc-block__sub_title {
|
|
|
|
+ margin: 0px;
|
|
|
|
+ padding: 0 6vmin;
|
|
|
|
+ font-size: 3.6vmin;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ line-height: 6.0vmin;
|
|
|
|
+ color: #1989fa;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|