|
@@ -0,0 +1,182 @@
|
|
|
+<template>
|
|
|
+ <div class="container">
|
|
|
+ <van-search
|
|
|
+ v-model="keyword"
|
|
|
+ class="common-search"
|
|
|
+ :left-icon="searchImg"
|
|
|
+ :right-icon="closeImg"
|
|
|
+ :clearable="false"
|
|
|
+ @search="onSearchKeyword"
|
|
|
+ @click-right-icon.stop="onSearchCancel"
|
|
|
+ />
|
|
|
+ <div class="content">
|
|
|
+ <el-tree
|
|
|
+ ref="treeRef"
|
|
|
+ class="filter-tree"
|
|
|
+ :data="treeData"
|
|
|
+ show-checkbox
|
|
|
+ :props="defaultProps"
|
|
|
+ :filter-node-method="filterNode"
|
|
|
+ node-key="uuid"
|
|
|
+ default-expand-all
|
|
|
+ @check-change="handleCheckChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="footer">
|
|
|
+ <div class="cancel-btn" @click="handleCancel">取消</div>
|
|
|
+ <div class="confirm-btn" @click="handleConfirm">确认转交</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <script lang="ts" setup name="spotCheckUnits">
|
|
|
+ import { ElTree } from 'element-plus';
|
|
|
+ import {onMounted, reactive, ref, watch} from "vue";
|
|
|
+ import {useRoute, useRouter} from "vue-router";
|
|
|
+ import searchImg from "@/assets/images/search.png";
|
|
|
+ import closeImg from "@/assets/images/close.png";
|
|
|
+ import { getPhoneList, WorkApprovalRedirect } from "@/api/InformationReception/InformationReception";
|
|
|
+ import {showFailToast, showToast, showConfirmDialog} from "vant";
|
|
|
+
|
|
|
+ const route = useRoute();
|
|
|
+ const router = useRouter();
|
|
|
+ const infoId = ref<string | string[]>('');
|
|
|
+ let defaultProps = reactive({
|
|
|
+ children: 'children',
|
|
|
+ label: 'label'
|
|
|
+ });
|
|
|
+ let keyword = ref('');
|
|
|
+
|
|
|
+ const onSearchKeyword = (val) => {
|
|
|
+ keyword.value = val;
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+
|
|
|
+ const onSearchCancel = () => {
|
|
|
+ keyword.value = '';
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+ let treeRef = ref();
|
|
|
+ let treeData = ref([]);
|
|
|
+ let checkData = ref([]);
|
|
|
+ const getList = () => {
|
|
|
+ getPhoneList().then((res) => {
|
|
|
+ treeData.value = res.data;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ watch(keyword, (val) => {
|
|
|
+ treeRef.value!.filter(val)
|
|
|
+ })
|
|
|
+ const filterNode = (value, data) => {
|
|
|
+ if (!value) return true;
|
|
|
+ return data.label.indexOf(value) !== -1;
|
|
|
+ };
|
|
|
+ const handleCheckChange = () => {
|
|
|
+ const data = [];
|
|
|
+ const treeData = treeRef.value.getCheckedNodes(false, false);
|
|
|
+ treeData.forEach((item) => {
|
|
|
+ if (!item.deptType) {
|
|
|
+ if (!data.some((obj) => obj.id === item.id)) {
|
|
|
+ data.push(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ checkData.value = data;
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleCancel = () => {
|
|
|
+ router.push({ name : 'DistrictCountyRollCall'})
|
|
|
+ }
|
|
|
+ const handleConfirm = () => {
|
|
|
+ if (checkData.value.length > 1) {
|
|
|
+ showFailToast('只能勾选一个审批人员');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (checkData.value.length > 0) {
|
|
|
+ showConfirmDialog({
|
|
|
+ title: '提示',
|
|
|
+ message: '确认转交到' + checkData.value[0].label+"?"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ WorkApprovalRedirect({info_id: infoId.value, redirect_id: checkData.value[0].id}).then((res) => {
|
|
|
+ showToast({type: 'success', message: res.msg, onClose:()=>{
|
|
|
+ router.back(-1);
|
|
|
+ }});
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ showFailToast('请先选择审批人员')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ onMounted(() => {
|
|
|
+ infoId.value = route.query.id;
|
|
|
+ getList();
|
|
|
+ })
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <style lang="scss" scoped>
|
|
|
+ .container {
|
|
|
+ padding: 16px;
|
|
|
+ background-color: #F4F8FA;
|
|
|
+ }
|
|
|
+
|
|
|
+ .content {
|
|
|
+ height: calc(100vh - 167px);
|
|
|
+ overflow-y: auto;
|
|
|
+ position: relative;
|
|
|
+ background-color: #ffffff;
|
|
|
+ padding: 16px;
|
|
|
+ .btn {
|
|
|
+ position: absolute;
|
|
|
+ top: 16px;
|
|
|
+ right: 16px;
|
|
|
+ width: 90px;
|
|
|
+ height: 24px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ border: 1px solid #2C81FF;
|
|
|
+ border-radius: 2px;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #2C81FF;
|
|
|
+ letter-spacing: 0;
|
|
|
+ line-height: 26px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .footer {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 81px;
|
|
|
+ background: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ .cancel-btn {
|
|
|
+ width: 90px;
|
|
|
+ height: 40px;
|
|
|
+ border: 1px solid #D1D1D1;
|
|
|
+ border-radius: 2px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #B3B3B3;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .confirm-btn {
|
|
|
+ width: 110px;
|
|
|
+ height: 40px;
|
|
|
+ background: #2C81FF;
|
|
|
+ border-radius: 2px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin-left: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|