|
@@ -1,69 +1,95 @@
|
|
|
<template>
|
|
|
<div class="hc-layout-box">
|
|
|
- <HcCard :scrollbar="false" actionSize="lg">
|
|
|
+ <HcCard :scrollbar="false" action-size="lg">
|
|
|
<template #header>
|
|
|
- <div class="w-32">
|
|
|
- <el-select v-model="searchForm.tasks" block clearable placeholder="电签任务人" size="large">
|
|
|
- <el-option v-for="item in tasksData" :label="item.dictValue" :value="item.dictKey"/>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- <div class="w-32 ml-3">
|
|
|
- <el-select v-model="searchForm.contract" block clearable placeholder="合同段" size="large"
|
|
|
- @change="ContractIdChange">
|
|
|
- <el-option v-for="item in contractList" :label="item.name" :value="item.id"/>
|
|
|
- </el-select>
|
|
|
+ <div class="w-64">
|
|
|
+ <el-input
|
|
|
+ v-model="searchForm.evisaUserName" block clearable placeholder="请输入用户名称检索"
|
|
|
+ size="large" @keyup="keyUpEvent"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="w-32 ml-3">
|
|
|
- <el-select v-model="searchForm.status" block clearable placeholder="电签状态" size="large">
|
|
|
- <el-option v-for="item in statusData" :label="item.dictValue" :value="item.dictKey"/>
|
|
|
+ <el-select
|
|
|
+ v-model="searchForm.contractId" block clearable placeholder="合同段" size="large"
|
|
|
+ @change="ContractIdChange"
|
|
|
+ >
|
|
|
+ <el-option v-for="item in contractList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="w-64 ml-3">
|
|
|
- <HcDatePicker :dates="betweenTime" clearable size="large" @change="betweenTimeUpdate"/>
|
|
|
+ <HcDatePicker :dates="betweenTime" clearable size="large" @change="betweenTimeUpdate" />
|
|
|
</div>
|
|
|
<div class="w-56 ml-3">
|
|
|
- <el-input v-model="searchForm.queryValue" block clearable placeholder="请输入名称关键词检索"
|
|
|
- size="large" @keyup="keyUpEvent"/>
|
|
|
+ <el-input
|
|
|
+ v-model="searchForm.queryValue" block clearable placeholder="请输入名称关键词检索"
|
|
|
+ size="large" @keyup="keyUpEvent"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="ml-2">
|
|
|
<el-button size="large" type="primary" @click="searchClick">
|
|
|
- <HcIcon name="search-2"/>
|
|
|
+ <HcIcon name="search-2" />
|
|
|
<span>搜索</span>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #extra>
|
|
|
<HcTooltip keys="tasks_sign_key_renewal">
|
|
|
- <el-button hc-btn type="primary">
|
|
|
- <HcIcon name="restart"/>
|
|
|
+ <el-button hc-btn type="primary" :loading="resignLoading" :disabled="tableCheckedKeys.length == 0" @click="resignClick">
|
|
|
+ <HcIcon name="restart" />
|
|
|
<span>一键重签</span>
|
|
|
</el-button>
|
|
|
</HcTooltip>
|
|
|
</template>
|
|
|
- <HcTable ref="tableListRef" :column="tableListColumn" :datas="tableData" :loading="tableLoading" isCheck
|
|
|
- @selection-change="tableSelectionChange"/>
|
|
|
+ <HcTable
|
|
|
+ ref="tableListRef" :column="tableListColumn" :datas="tableData" :loading="tableLoading" is-check
|
|
|
+ @selection-change="tableSelectionChange"
|
|
|
+ >
|
|
|
+ <template #taskStatusName="{ row }">
|
|
|
+ <el-tag
|
|
|
+ v-if="row?.taskStatusName"
|
|
|
+ :type="`${row.taskStatusName === '已审批' ? 'success' : row.taskStatusName === '已废除' ? 'warning' : 'info'}`" class="mx-1" effect="dark"
|
|
|
+ >
|
|
|
+ {{ row.taskStatusName }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ <template #taskApproveUserNamesList="{ row }">
|
|
|
+ <template v-for="item in row.taskApproveUserNamesList">
|
|
|
+ <el-tag
|
|
|
+ v-if="item.taskUserName"
|
|
|
+ :type="`${item.evisaStatus === 2 ? 'success' : item.evisaStatus === 3 ? 'warning' : item.evisaStatus === 999 ? 'danger' : 'info'}`" class="mx-1" effect="dark"
|
|
|
+ >
|
|
|
+ {{ item.taskUserName }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </HcTable>
|
|
|
<template #action>
|
|
|
- <HcPages :pages="searchForm" @change="pageChange"/>
|
|
|
+ <HcPages :pages="searchForm" @change="pageChange" />
|
|
|
</template>
|
|
|
</HcCard>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref, onMounted} from "vue";
|
|
|
-import {useAppStore} from "~src/store";
|
|
|
-import {getObjValue, getArrValue} from "js-fast-way"
|
|
|
+import { onMounted, ref } from 'vue'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
+import { arrToId, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
+import signApi from '~api/tasks/sign'
|
|
|
|
|
|
//变量
|
|
|
const useAppState = useAppStore()
|
|
|
-const projectId = ref(useAppState.getProjectId);
|
|
|
-const contractId = ref(useAppState.getContractId);
|
|
|
-const projectInfo = ref(useAppState.getProjectInfo);
|
|
|
+const projectId = ref(useAppState.getProjectId)
|
|
|
+const contractId = ref(useAppState.getContractId)
|
|
|
+const projectInfo = ref(useAppState.getProjectInfo)
|
|
|
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
const project = getObjValue(projectInfo.value)
|
|
|
contractList.value = getArrValue(project['contractInfoList'])
|
|
|
+ if (contractList.value.length > 0) {
|
|
|
+ searchForm.value.contractId = contractList.value[0].id
|
|
|
+ }
|
|
|
getTableData()
|
|
|
})
|
|
|
|
|
@@ -73,27 +99,27 @@ const statusData = ref([])
|
|
|
//合同段
|
|
|
const contractList = ref([])
|
|
|
const ContractIdChange = () => {
|
|
|
-
|
|
|
+ getTableData()
|
|
|
}
|
|
|
|
|
|
//日期时间被选择
|
|
|
const betweenTime = ref(null)
|
|
|
-const betweenTimeUpdate = ({val, arr}) => {
|
|
|
+const betweenTimeUpdate = ({ val, arr }) => {
|
|
|
betweenTime.value = arr
|
|
|
- searchForm.value.startTime = val['start']
|
|
|
- searchForm.value.endTime = val['end']
|
|
|
+ searchForm.value.startTimeValue = val['start']
|
|
|
+ searchForm.value.endTimeValue = val['end']
|
|
|
}
|
|
|
|
|
|
//搜索表单
|
|
|
const searchForm = ref({
|
|
|
- queryValue: null, tasks: null, contract: null, status: null, startTime: null, endTime: null,
|
|
|
- current: 1, size: 20, total: 0
|
|
|
+ queryValue: null, evisaUserName: null, contractId: null, startTimeValue: null, endTimeValue: null,
|
|
|
+ current: 1, size: 20, total: 0,
|
|
|
})
|
|
|
|
|
|
//回车搜索
|
|
|
const keyUpEvent = (e) => {
|
|
|
- if (e.key === "Enter") {
|
|
|
- searchForm.value.current = 1;
|
|
|
+ if (e.key === 'Enter') {
|
|
|
+ searchForm.value.current = 1
|
|
|
getTableData()
|
|
|
}
|
|
|
}
|
|
@@ -105,7 +131,7 @@ const searchClick = () => {
|
|
|
}
|
|
|
|
|
|
//分页被点击
|
|
|
-const pageChange = ({current, size}) => {
|
|
|
+const pageChange = ({ current, size }) => {
|
|
|
searchForm.value.current = current
|
|
|
searchForm.value.size = size
|
|
|
getTableData()
|
|
@@ -113,90 +139,60 @@ const pageChange = ({current, size}) => {
|
|
|
|
|
|
//获取数据
|
|
|
const tableLoading = ref(false)
|
|
|
-const tableListData = ref([])
|
|
|
+const tableData = ref([])
|
|
|
const getTableData = async () => {
|
|
|
-
|
|
|
+ tableLoading.value = true
|
|
|
+ const { error, code, data } = await signApi.eVisaFailedPage({
|
|
|
+ ...searchForm.value,
|
|
|
+ })
|
|
|
+ //判断状态
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
+ searchForm.value.total = data['total'] || 0
|
|
|
+ } else {
|
|
|
+ tableData.value = []
|
|
|
+ searchForm.value.total = 0
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//多选
|
|
|
const tableListRef = ref(null)
|
|
|
-const tableCheckedKeys = ref([]);
|
|
|
+const tableCheckedKeys = ref([])
|
|
|
const tableSelectionChange = (rows) => {
|
|
|
tableCheckedKeys.value = rows.filter((item) => {
|
|
|
- return (item ?? '') !== '';
|
|
|
+ return (item ?? '') !== ''
|
|
|
})
|
|
|
}
|
|
|
const tableListColumn = ref([
|
|
|
- {key: 'name', name: '流程名称'},
|
|
|
- {key: 'date', name: '任务状态'},
|
|
|
- {key: 'status', name: '电签状态'},
|
|
|
- {key: 'batch', name: '审批时间'},
|
|
|
- {key: 'person', name: '电签失败原因'},
|
|
|
- {key: 'tesk', name: '上报人'},
|
|
|
- {key: 'tesk1', name: '电签任务人'}
|
|
|
+ { key: 'taskReportUserName', name: '流程名称' },
|
|
|
+ { key: 'taskStatusName', name: '任务状态' },
|
|
|
+ { key: 'evisaStatusName', name: '电签状态' },
|
|
|
+ { key: 'evisaUpdateDate', name: '审批时间' },
|
|
|
+ { key: 'evisaFailedInfo', name: '电签失败原因' },
|
|
|
+ { key: 'taskReportUserName', name: '上报人' },
|
|
|
+ { key: 'taskApproveUserNamesList', name: '电签任务人' },
|
|
|
])
|
|
|
-const tableData = ref([
|
|
|
- {
|
|
|
- num: 1,
|
|
|
- name: "test1",
|
|
|
- date: "已审批-电签失败",
|
|
|
- status: "电签失败",
|
|
|
- batch: "2022-05-16 13:35",
|
|
|
- person: "xxxxx原因",
|
|
|
- tesk: "李四",
|
|
|
- tesk1: '张三'
|
|
|
- },
|
|
|
- {
|
|
|
- num: 2,
|
|
|
- name: "test2",
|
|
|
- date: "已审批-电签中",
|
|
|
- status: "电签中",
|
|
|
- batch: "2022-05-16 13:35",
|
|
|
- person: "xxxxx原因",
|
|
|
- tesk: "李四",
|
|
|
- tesk1: '张三'
|
|
|
- },
|
|
|
- {
|
|
|
- num: 3,
|
|
|
- name: "test3",
|
|
|
- date: "已审批完成",
|
|
|
- status: "电签完成",
|
|
|
- batch: "2022-05-16 13:35",
|
|
|
- person: "xxxxx原因",
|
|
|
- tesk: "李四",
|
|
|
- tesk1: '张三'
|
|
|
- },
|
|
|
- {
|
|
|
- num: 4,
|
|
|
- name: "test4",
|
|
|
- date: "已审批-电签中",
|
|
|
- status: "等待电签",
|
|
|
- batch: "2022-05-16 13:35",
|
|
|
- person: "xxxxx原因",
|
|
|
- tesk: "李四",
|
|
|
- tesk1: '张三'
|
|
|
- },
|
|
|
- {
|
|
|
- num: 5,
|
|
|
- name: "test5",
|
|
|
- date: "xxxxxxxxxx",
|
|
|
- status: "xxxx",
|
|
|
- batch: "2022-05-16 13:35",
|
|
|
- person: "xxxxx原因",
|
|
|
- tesk: "李四",
|
|
|
- tesk1: '张三'
|
|
|
- },
|
|
|
- {
|
|
|
- num: 6,
|
|
|
- name: "test6",
|
|
|
- date: "xxxxxxxxxx",
|
|
|
- status: "xxxxxx",
|
|
|
- batch: "2022-05-16 13:35",
|
|
|
- person: "xxxxx原因",
|
|
|
- tesk: "李四",
|
|
|
- tesk1: '张三'
|
|
|
- },
|
|
|
-]);
|
|
|
+
|
|
|
+//一键重签
|
|
|
+const resignLoading = ref(false)
|
|
|
+const resignClick = async ()=>{
|
|
|
+ const taskIds = arrToId(tableCheckedKeys.value)
|
|
|
+
|
|
|
+ resignLoading.value = true
|
|
|
+ const { error, code, msg } = await signApi.reSigningEVisa({
|
|
|
+ contractId:searchForm.value.contractId,
|
|
|
+ projectId:projectId.value,
|
|
|
+ taskIds:taskIds,
|
|
|
+ })
|
|
|
+ //判断状态
|
|
|
+ resignLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(msg)
|
|
|
+ getTableData()
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|