|
@@ -39,7 +39,7 @@
|
|
|
<br>
|
|
|
|
|
|
<el-tooltip placement="right" effect="light" :visible="item.taskDetailvisible">
|
|
|
- <template #content>
|
|
|
+ <template #content>
|
|
|
<el-timeline class="hc-time-line">
|
|
|
<template v-for="(item1, index1) in item.userList" :key="index1">
|
|
|
<el-timeline-item :class="item1.status === '2' ? 'success' : 'primary'" size="large">
|
|
@@ -57,7 +57,7 @@
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<div class="reply-time">{{ item.date }}</div>
|
|
|
<div class="reply-content" v-html="item.flowValue" />
|
|
|
</el-timeline-item>
|
|
@@ -105,16 +105,19 @@
|
|
|
<HcTaskNotes v-model="isNotesShow" :table="tableNoteInfo" :info="rowInfo" :is-edit="tabsKey === 1" @finish="taskNotesFinish" />
|
|
|
<!-- 驳回 -->
|
|
|
<HcRepealForm v-model="isRepealShow" :info="rowInfo" @finish="taskRepealFinish" />
|
|
|
+ <!-- 短信认证 -->
|
|
|
+ <HcSmsAuth :loading="SMSAuthLoading" :show="SMSAuthShow" @cancel="SMSAuthCancel" @confirm="SMSAuthConfirm" />
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { nextTick, ref, watch } from 'vue'
|
|
|
-import { arrUnion, getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import HcTaskForm from './task-form.vue'
|
|
|
import HcTaskNotes from './task-notes.vue'
|
|
|
import HcRepealForm from './repeal-form.vue'
|
|
|
+import { arrUnion, getArrValue, getObjValue, getRandom, isNullES } from 'js-fast-way'
|
|
|
import mainApi from '~api/tasks/hc-data'
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
|
const props = defineProps({
|
|
|
tabs: {
|
|
@@ -146,14 +149,9 @@ const tableRef = ref(null)
|
|
|
const tabsKey = ref(Number(props.tabs))
|
|
|
const rowInfo = ref(props.row)
|
|
|
|
|
|
-watch(() => [
|
|
|
- props.tabs,
|
|
|
- props.row,
|
|
|
-], ([key, row]) => {
|
|
|
+watch(() => [props.tabs, props.row], ([key, row]) => {
|
|
|
tabsKey.value = Number(key)
|
|
|
rowInfo.value = row
|
|
|
- console.log(rowInfo.value.fixedFlowId == null)
|
|
|
-
|
|
|
}, {
|
|
|
immediate: true,
|
|
|
deep: true,
|
|
@@ -162,6 +160,7 @@ watch(() => [
|
|
|
//监听显示
|
|
|
watch(isShow, (val) => {
|
|
|
if (val) {
|
|
|
+ checkSmsCode()
|
|
|
setTaskInfo()
|
|
|
setSplitRef()
|
|
|
}
|
|
@@ -219,7 +218,7 @@ const getTableDetail = async () => {
|
|
|
})
|
|
|
flowListTask.value = arrUnion(firstarr, taskList)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//默认选中第一行
|
|
|
let info = {}
|
|
|
if (tableData.value.length > 0) {
|
|
@@ -312,21 +311,11 @@ const taskFormFinish = () => {
|
|
|
|
|
|
//确认审批
|
|
|
const confirmLoading = ref(false)
|
|
|
-const confirmClick = async () => {
|
|
|
- confirmLoading.value = true
|
|
|
- const { error, code, msg } = await mainApi.taskApprove({
|
|
|
- taskId: rowInfo.value.id,
|
|
|
- projectId: projectId.value,
|
|
|
- contractId: contractId.value,
|
|
|
- })
|
|
|
- confirmLoading.value = false
|
|
|
- if (!error && code === 200) {
|
|
|
- window.$message.success('审批成功')
|
|
|
- emit('finish')
|
|
|
- cancelClick()
|
|
|
- } else {
|
|
|
- window.$message.error(msg ?? '审批失败')
|
|
|
- }
|
|
|
+const confirmClick = () => {
|
|
|
+ const ShowAuth = isCheckSmsCodeTime()
|
|
|
+ SMSAuthShow.value = ShowAuth
|
|
|
+ //免短信验证
|
|
|
+ if (!ShowAuth) SMSAuthConfirm()
|
|
|
}
|
|
|
|
|
|
//驳回审批
|
|
@@ -355,6 +344,50 @@ const taskDetailvisible = ref(false)
|
|
|
const getTaskDetail = ()=>{
|
|
|
taskDetailvisible.value = true
|
|
|
}
|
|
|
+
|
|
|
+//短信验证有效期
|
|
|
+const smsCodeTime = ref('')
|
|
|
+const checkSmsCode = async () => {
|
|
|
+ const { data } = await mainApi.checkSmsCode()
|
|
|
+ smsCodeTime.value = data ? data : ''
|
|
|
+}
|
|
|
+
|
|
|
+//验证短信有效期
|
|
|
+const isCheckSmsCodeTime = () => {
|
|
|
+ const smsTime = smsCodeTime.value
|
|
|
+ if (isNullES(smsTime)) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ const toDayTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ return dayjs(smsTime).isBefore(toDayTime)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//短信验证
|
|
|
+const SMSAuthLoading = ref(false)
|
|
|
+const SMSAuthShow = ref(false)
|
|
|
+const SMSAuthConfirm = async () => {
|
|
|
+ confirmLoading.value = true
|
|
|
+ const { error, code, msg } = await mainApi.taskApprove({
|
|
|
+ taskId: rowInfo.value.id,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success('审批成功')
|
|
|
+ await checkSmsCode()
|
|
|
+ confirmLoading.value = false
|
|
|
+ emit('finish')
|
|
|
+ SMSAuthCancel()
|
|
|
+ cancelClick()
|
|
|
+ } else {
|
|
|
+ confirmLoading.value = false
|
|
|
+ window.$message.error(msg ?? '审批失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+const SMSAuthCancel = () => {
|
|
|
+ SMSAuthShow.value = false
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|