feat: 待办清单功能添加

This commit is contained in:
kun 2024-03-11 17:16:39 +08:00
parent a0118dfaf8
commit 86469738ad
13 changed files with 203 additions and 34 deletions

View File

@ -2,11 +2,11 @@
NODE_ENV = 'development'
# 本地环境接口地址(/api/index.ts文件中使用)
# VITE_API_URL = 'http://192.168.34.155:6677'
VITE_API_URL = 'http://192.168.34.155:6688'
# VITE_API_URL = 'http://183.63.230.59:6090'
# VITE_API_URL = 'http://2xliv7gs.shenzhuo.vip:55296'
VITE_WPAPI_URL = "http://jxjzw.zhgdyun.com:8081"
VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
# VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
# 上传
# VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='

View File

@ -3,9 +3,9 @@ NODE_ENV = "production"
# 线上环境接口地址(easymock)
# VITE_API_URL = "http://139.9.66.234:6688"
VITE_API_URL = 'http://10.75.253.12:6090'
# VITE_API_URL = 'http://10.75.253.12:6090'
# VITE_API_URL = 'http://183.63.230.59:6090'
# VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
VITE_WPAPI_URL = "http://jxjzw.zhgdyun.com:8081"
# VITE_API_URL = "http://101.43.164.214:6688"
# VITE_API_URL = "https://wx.antjg.com:6081/"

View File

@ -94,8 +94,3 @@ export const noticeDetailMyPost = (params: { noticeId: string }) => {
export const noticeReadMyPost = (params: { noticeId: string }) => {
return http.post(BASEURL + `/xmgl/notice/read`, params);
};
// 查询是否有待办事项
export const noFinishApi = (params: any) => {
return http.get(BASEURL + `/xmgl/systemUser/getToDoItems`, params);
};

View File

@ -446,3 +446,9 @@ export const annexFileList = (params: any) => {
export const annexFileSave = (params: any) => {
return http.post(BASEURL + `/gov/engineeringAnnex/batchUpdateFile`, params);
};
// 待办清单
// 查询是否有待办事项
export const noFinishApi = (params: any) => {
return http.get(BASEURL + `/xmgl/systemUser/getToDoItems`, params);
};

View File

@ -40,7 +40,7 @@
<Main />
</el-container>
</el-container>
<el-dialog class="overview" :show-close="false" v-model="visible1" width="50%" @close="visible1 = false">
<!-- <el-dialog class="overview" :show-close="false" v-model="visible1" width="50%" @close="visible1 = false">
<template #title>
<div class="title-detail">
<img src="@/assets/images/tableIcon/look.png" alt="" />
@ -71,7 +71,6 @@
</el-button>
</template>
</el-table-column>
<!-- 表格无数据情况 -->
<template #empty>
<div class="table-empty">
<slot name="empty">
@ -83,7 +82,7 @@
</el-table>
</div>
</div>
</el-dialog>
</el-dialog> -->
</el-container>
</template>
@ -97,7 +96,6 @@ import SubMenu from "@/layouts/components/Menu/SubMenu.vue";
import ToolBarLeft from "@/layouts/components/Header/ToolBarLeft.vue";
import ToolBarRight from "@/layouts/components/Header/ToolBarRight.vue";
import { HOME_URL } from "@/enums/Home";
import { noFinishApi } from "@/api/modules/common";
// import router from "@/routers";
const route = useRoute();
@ -129,13 +127,7 @@ const handleDealItem = (obj: any) => {
const goHome = () => {
router.push(HOME_URL[globalStore.accountType - 1]);
};
onMounted(async () => {
const res: any = await noFinishApi({});
if (res && res.data && res.data.length > 0) {
recordData.value = res.data;
visible1.value = true;
}
});
onMounted(async () => {});
</script>
<style scoped lang="scss">

View File

@ -4,6 +4,7 @@
v-model="active"
:tabs="['项目名称', '工程名称']"
:records="records"
:activeIndex="modelActive"
@change-page="onCurChange"
@search="onSearchInput"
:pageable="pages"
@ -305,6 +306,7 @@ import { jxj_User } from "@/api/types";
import { useHandleData } from "@/hooks/useHandleData";
import { useRoute } from "vue-router";
const route = useRoute();
const modelActive = ref(0);
const rules = reactive<FormRules>({
name: {
required: true,
@ -668,7 +670,17 @@ onMounted(async () => {
await getEngPage();
searchSn.value = (records.value as any[])[0].projectSn;
searchName.value = (records.value as any[])[0].projectName;
onSearch(records.value[0]);
if (route.query.projectName) {
let defaultActive = records.value.findIndex((item: any) => {
return route.query.projectName == item.engineeringName;
});
if (defaultActive != -1) {
modelActive.value = defaultActive;
onSearch(records.value[defaultActive]);
}
} else {
onSearch(records.value[0]);
}
});
</script>

View File

@ -67,16 +67,15 @@ export const datas = ref<EngineeringMainList[number]>({
export const rules = ref<FormRules>({
enterpriseSn: {
type: "string",
required: true,
message: "请输入单位名称"
},
creditCode: {
type: "string",
required: true,
message: "请输入统一社会信用代码",
trigger: "blur"
},
// creditCode: {
// type: "string",
// required: true,
// message: "请输入统一社会信用代码",
// trigger: "blur"
// },
contractType: {
type: "string",
required: true,

View File

@ -1,6 +1,12 @@
.duty-form {
flex: 1;
padding: 0 6%;
.add-btn {
margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: flex-end;
}
.row {
display: flex;
flex-wrap: wrap;

View File

@ -1,10 +1,24 @@
<template>
<div class="duty-form">
<!-- <div class="add-btn">
<el-button class="btnStyle" type="primary">添加</el-button>
</div> -->
<el-form class="form" ref="formRef" :model="formData" :rules="formConfig.rules" label-width="150px">
<div class="row">
<template v-for="(val, key) in formData" :key="datas[key]">
<el-form-item v-if="Object.keys(datas).includes(key)" class="form-item" :prop="key" :label="datas[key]">
<el-select class="select" v-if="key === 'enterpriseSn'" @change="onChange" v-model="formData[key]">
<el-form-item
v-if="Object.keys(datas).includes(key)"
class="form-item"
:prop="formData.type != 4 && formData.type != 5 ? key : ''"
:label="datas[key]"
>
<el-select
class="select"
v-if="key === 'enterpriseSn'"
style="width: 100%"
@change="onChange"
v-model="formData[key]"
>
<el-option value="" @click="openAddDialog" v-show="formData.type != 1">
<div class="selectAdd">
<el-icon><circle-plus /></el-icon>
@ -132,8 +146,8 @@ const openAddDialog = () => {
});
openAddCompany.value = true;
};
const onChange = option => {
const value = nameOptions.value.find(item => item.enterpriseSn == option);
const onChange = (option: any) => {
const value = nameOptions.value.find(item => item.enterpriseSn == option[option.length - 1]);
if (!value) return;
formData.value.creditCode = value.creditCode;
formData.value.legalPerson = value.legalPerson;

View File

@ -4,6 +4,7 @@
v-model="active"
:tabs="['项目名称', '工程名称']"
:records="records"
:activeIndex="modelActive"
@change-page="onCurChange"
@search="onSearchInput"
:pageable="pages"
@ -98,6 +99,7 @@ import { getDustprojectPage, getDustengineeringPage } from "@/api/modules/goverm
import { sendIframeMessage } from "@/utils/util";
import { GlobalStore } from "@/stores";
const route = useRoute();
const modelActive = ref(0);
const pages = ref({
pageNo: 1,
pageSize: 7,
@ -302,7 +304,17 @@ onMounted(async () => {
await getEngPage();
searchSn.value = (records.value as any[])[0].engineeringSn;
searchName.value = (records.value as any[])[0].engineeringName;
onSearch(records.value[0]);
if (route.query.projectName) {
let defaultActive = records.value.findIndex((item: any) => {
return route.query.projectName == item.engineeringName;
});
if (defaultActive != -1) {
modelActive.value = defaultActive;
onSearch(records.value[defaultActive]);
}
} else {
onSearch(records.value[0]);
}
await sendIframeMessage({ obj: { path: route.path } }, 2, undefined);
});
</script>

View File

@ -4,6 +4,7 @@
v-model="active"
:tabs="['项目名称', '工程名称']"
:records="records"
:activeIndex="modelActive"
@change-page="onCurChange"
@search="onSearchInput"
:pageable="pages"
@ -99,6 +100,7 @@ import { getDustprojectPage, getDustengineeringPage } from "@/api/modules/goverm
import { sendIframeMessage } from "@/utils/util";
import { GlobalStore } from "@/stores";
const route = useRoute();
const modelActive = ref(0);
const pages = ref({
pageNo: 1,
pageSize: 7,
@ -302,7 +304,17 @@ onMounted(async () => {
await getEngPage();
searchSn.value = (records.value as any[])[0].engineeringSn;
searchName.value = (records.value as any[])[0].engineeringName;
onSearch(records.value[0]);
if (route.query.projectName) {
let defaultActive = records.value.findIndex((item: any) => {
return route.query.projectName == item.engineeringName;
});
if (defaultActive != -1) {
modelActive.value = defaultActive;
onSearch(records.value[defaultActive]);
}
} else {
onSearch(records.value[0]);
}
await sendIframeMessage({ obj: { path: route.path } }, 2, undefined);
});
</script>

View File

@ -0,0 +1,9 @@
.table-box {
height: 100%;
.table {
height: 100%;
:deep(.table-main) {
height: 100%;
}
}
}

View File

@ -0,0 +1,112 @@
<template>
<div class="table-box">
<ProTable
ref="proTable"
title="待办列表"
:columns="columns"
:requestApi="getTableList"
:initParam="initParam"
:dataCallback="dataCallback"
:tool-button="false"
:pagination="true"
background
:isShowSearch="false"
>
<template #state="{ row }">
{{ row.state === 1 ? "已审核" : "待审核" }}
</template>
<!-- 表格操作 -->
<template #operation="scope">
<el-button type="primary" link @click="handleDealItem(scope.row)">
<img src="@/assets/images/tableIcon/look.png" alt="" class="configureIcon" />
<span>去处理</span>
</el-button>
</template>
</ProTable>
</div>
</template>
<script setup lang="tsx" name="governMentCompanyApprove">
import { ref, reactive, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { ColumnProps } from "@/components/ProTable/interface";
import ProTable from "@/components/ProTable/index.vue";
import { noFinishApi } from "@/api/modules/goverment";
import { GlobalStore } from "@/stores";
import { sendIframeMessage } from "@/utils/util";
const globalStore = GlobalStore();
const route = useRoute();
const router = useRouter();
// ProTable 便
const proTable = ref();
//
const handleDealItem = (obj: any) => {
let projectName = obj.projectName;
let routeUrl = "";
switch (obj.flag) {
case 1: //
routeUrl = "/goverment/huizhou/projectMonitoring/qualityControl/index";
break;
case 2: //
routeUrl = "/goverment/huizhou/projectMonitoring/safetyManagement/index";
break;
case 3: //
routeUrl = "/goverment/huizhou/progressManagement/divisionsAndISubItems/index";
break;
}
router.push({ path: routeUrl, query: { projectName } });
};
//
const columns: ColumnProps[] = [
{ type: "index", label: "序号", width: 80 },
{ prop: "type", label: "待处理事项" },
{ prop: "projectName", label: "项目名称" },
{ prop: "operation", label: "操作", width: 120 }
];
// ProTable()
const initParam = reactive({
// state: 0
});
// dataCallback list && total && pageNum && pageSize
// hooks/useTable.ts
const dataCallback = (data: any) => {
// console.log(data);
return {
list: data.records,
total: Number(data.total),
pageNo: Number(data.current),
pageSize: Number(data.size)
};
};
// params
// ProTable :requestApi="getUserList"
const getTableList = async (params: any) => {
let newParams = JSON.parse(JSON.stringify(params));
const res: any = await noFinishApi({});
if (res && res.data && res.data.length > 0) {
return { result: { records: res.data, current: "1", pages: "1", size: "10", total: res.data.length + "" } };
} else {
return { result: { records: [], current: "1", pages: "1", size: "10", total: "0" } };
}
};
onMounted(async () => {
await sendIframeMessage({ obj: { path: route.path } }, 2, undefined);
});
</script>
<style lang="scss" scoped>
@import "./index.scss";
:deep(td .el-table-fixed-column--right) {
.cell {
text-align: left;
}
}
:deep(#lookDialog .el-dialog__body) {
height: 700px;
overflow: auto;
}
</style>