policeSecurity/collect_information/src/subPages/projectManager/myProject/myProject.vue

65 lines
2.7 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="myProject">
<view v-if="number !== 0">
<view class="myProjectItem" v-for="(item,index) in myProjectList" :key="index">
<view style="display: flex;justify-content: space-between">
<text>{{ item?.name }}</text>
<text>单位类型:{{ item?.type.label }}</text>
</view>
<view class="myProjectIndex">地址:
<text>{{ item?.provinceName }}{{ item.cityName }}{{ item.districtsName }}{{ item.streetName }}</text>
</view>
<view style="display: flex;justify-content: space-between">
<text>联系人:{{ item?.contactPersonInfo.name }}</text>
<text>电话:{{ item?.contactPersonInfo.telephone }}</text>
</view>
<view class="project">
<view @click="projectClick(item?.name, serviceProject)" v-for="(serviceProject, index) in item.serviceProjectList" :key="index">
<view style="border: 1px solid #cccccc;color: #9b9b9f">
<view style="display: flex; justify-content: space-between">
<text>项目名称{{serviceProject.name}}</text>
<text>项目类型{{serviceProject.type.label}}</text>
</view>
<view style="display: flex; justify-content: space-between">
<text>项目负责人{{serviceProject.projectManagerMiniProgramUserInfo?.name?serviceProject.projectManagerMiniProgramUserInfo?.name:'无分配项目经理'}}</text>
</view>
<view>责任单位{{serviceProject.securityUnitName}}</view>
</view>
</view>
</view>
</view>
</view>
<view v-else class="myProject">
<nut-empty image="empty" description="暂无项目">
<div style="margin-top: 10px">
</div>
</nut-empty>
</view>
</view>
</template>
<script setup lang="ts">
import api from "@/request/index";
import {onMounted, ref} from "vue";
import Taro from "@tarojs/taro";
import './myProject.scss'
import {MyProjectList, ServiceProjectList} from "@/types/subPages/projectManager/myProject";
const myProjectList = ref<MyProjectList[]>()
const number = ref(0)
const getMyServiceProject = async () => {
const resp = await api.get<MyProjectList[]>(`/projectManageIndex/getMyServiceProject`)
myProjectList.value = resp.data
number.value = (resp.data?.length || 0)
}
const projectClick = (enterprisesUnitName: string, serviceProject: ServiceProjectList) => {
Taro.navigateTo({
url: `/subPages/projectManager/myProject/projectDetails/projectDetails?enterprisesUnitName=${enterprisesUnitName}&serviceProject=${JSON.stringify(serviceProject)}`,
})
}
onMounted(async () => {
await getMyServiceProject()
})
</script>