|
@@ -1,47 +1,152 @@
|
|
<template>
|
|
<template>
|
|
- <hc-dialog v-model="isShow" ui="hc-project-info-dialog-box" widths="64rem" is-table title="项目信息" :footer="false" :padding="false" @close="dialogClose">
|
|
|
|
|
|
+ <hc-dialog
|
|
|
|
+ v-model="isShow"
|
|
|
|
+ ui="hc-project-info-dialog-box"
|
|
|
|
+ widths="64rem"
|
|
|
|
+ is-table
|
|
|
|
+ title="项目信息"
|
|
|
|
+ :footer="false"
|
|
|
|
+ :padding="false"
|
|
|
|
+ @close="dialogClose"
|
|
|
|
+ >
|
|
<el-container class="hc-project-info-dialog">
|
|
<el-container class="hc-project-info-dialog">
|
|
<el-header>
|
|
<el-header>
|
|
<div class="left">
|
|
<div class="left">
|
|
- <el-button hc-btn color="#626aef" style="color: white" @click="toCheck('measure')">计量管理</el-button>
|
|
|
|
- <el-button hc-btn color="#e233fb" style="color: white" @click="toCheck('lar')">征拆划分</el-button>
|
|
|
|
- <el-button hc-btn color="#ac54ff" style="color: white" @click="toCheck('test')">实验划分</el-button>
|
|
|
|
- <el-button hc-btn type="success" style="color: white" @click="toCheck('wbsTree')">WBS树管理</el-button>
|
|
|
|
- <el-button hc-btn color="#2bbeed" style="color: white" @click="toCheck('logTree')">日志树管理</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ color="#626aef"
|
|
|
|
+ style="color: white"
|
|
|
|
+ @click="toCheck('measure')"
|
|
|
|
+ >计量管理</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ color="#e233fb"
|
|
|
|
+ style="color: white"
|
|
|
|
+ @click="toCheck('lar')"
|
|
|
|
+ >征拆划分</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ color="#ac54ff"
|
|
|
|
+ style="color: white"
|
|
|
|
+ @click="toCheck('test')"
|
|
|
|
+ >试验划分</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ type="success"
|
|
|
|
+ style="color: white"
|
|
|
|
+ @click="toCheck('wbsTree')"
|
|
|
|
+ >WBS树管理</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ color="#2bbeed"
|
|
|
|
+ style="color: white"
|
|
|
|
+ @click="toCheck('logTree')"
|
|
|
|
+ >日志树管理</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
<div class="right">
|
|
<div class="right">
|
|
- <el-button hc-btn type="warning" @click="toCheck('editProject')">编辑项目</el-button>
|
|
|
|
- <el-button hc-btn type="primary" @click="toCheck('addContract')">创建合同段</el-button>
|
|
|
|
- <el-button v-del-com:[delProject] hc-btn type="danger">删除项目</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ type="warning"
|
|
|
|
+ @click="toCheck('editProject')"
|
|
|
|
+ >编辑项目</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="toCheck('addContract')"
|
|
|
|
+ >创建合同段</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button v-del-com:[delProject] hc-btn type="danger"
|
|
|
|
+ >删除项目</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
</el-header>
|
|
</el-header>
|
|
<el-container>
|
|
<el-container>
|
|
<el-aside width="300px">
|
|
<el-aside width="300px">
|
|
<hc-body scrollbar padding="0px">
|
|
<hc-body scrollbar padding="0px">
|
|
- <hc-list-item title="项目ID:" :content="projectInfo.id" />
|
|
|
|
- <hc-list-item title="项目简称:" :content="projectInfo.projectAlias" />
|
|
|
|
- <hc-list-item title="项目全名:" :content="projectInfo.projectName" />
|
|
|
|
- <hc-list-item title="创建时间:" :content="projectInfo.createTime" />
|
|
|
|
- <hc-list-item title="更新时间:" :content="projectInfo.updateTime" />
|
|
|
|
|
|
+ <hc-list-item
|
|
|
|
+ title="项目ID:"
|
|
|
|
+ :content="projectInfo.id"
|
|
|
|
+ />
|
|
|
|
+ <hc-list-item
|
|
|
|
+ title="项目简称:"
|
|
|
|
+ :content="projectInfo.projectAlias"
|
|
|
|
+ />
|
|
|
|
+ <hc-list-item
|
|
|
|
+ title="项目全名:"
|
|
|
|
+ :content="projectInfo.projectName"
|
|
|
|
+ />
|
|
|
|
+ <hc-list-item
|
|
|
|
+ title="创建时间:"
|
|
|
|
+ :content="projectInfo.createTime"
|
|
|
|
+ />
|
|
|
|
+ <hc-list-item
|
|
|
|
+ title="更新时间:"
|
|
|
|
+ :content="projectInfo.updateTime"
|
|
|
|
+ />
|
|
</hc-body>
|
|
</hc-body>
|
|
</el-aside>
|
|
</el-aside>
|
|
<el-main>
|
|
<el-main>
|
|
<hc-body :scrollbar="contractList.length > 0" padding="0px">
|
|
<hc-body :scrollbar="contractList.length > 0" padding="0px">
|
|
<hc-empty v-if="contractList.length <= 0" />
|
|
<hc-empty v-if="contractList.length <= 0" />
|
|
- <hc-card-item v-for="item in contractList" v-else :key="item.id" class="hc-contract-list-card">
|
|
|
|
|
|
+ <hc-card-item
|
|
|
|
+ v-for="item in contractList"
|
|
|
|
+ v-else
|
|
|
|
+ :key="item.id"
|
|
|
|
+ class="hc-contract-list-card"
|
|
|
|
+ >
|
|
<div class="contract-type">
|
|
<div class="contract-type">
|
|
- <div v-if="item.contractType === 1" class="name bg-1">施工</div>
|
|
|
|
- <div v-if="item.contractType === 2" class="name bg-2">监理</div>
|
|
|
|
- <div v-if="item.contractType === 3" class="name bg-3">业主</div>
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-if="item.contractType === 1"
|
|
|
|
+ class="name bg-1"
|
|
|
|
+ >
|
|
|
|
+ 施工
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ v-if="item.contractType === 2"
|
|
|
|
+ class="name bg-2"
|
|
|
|
+ >
|
|
|
|
+ 监理
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ v-if="item.contractType === 3"
|
|
|
|
+ class="name bg-3"
|
|
|
|
+ >
|
|
|
|
+ 业主
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="contract-content">
|
|
<div class="contract-content">
|
|
<div class="name">{{ item.contractName }}</div>
|
|
<div class="name">{{ item.contractName }}</div>
|
|
<div class="footer">
|
|
<div class="footer">
|
|
- <div class="time">{{ item.updateTime }}</div>
|
|
|
|
|
|
+ <div class="time">
|
|
|
|
+ {{ item.updateTime }}
|
|
|
|
+ </div>
|
|
<div class="action">
|
|
<div class="action">
|
|
- <el-link type="warning" @click="toCheck('editContract', item)">编辑合同段信息</el-link>
|
|
|
|
- <el-link v-if="item.contractType === 1" type="success" @click="toCheck('wbsContract', item)">分配WBS</el-link>
|
|
|
|
- <el-link v-del-com:[delContract]="item" type="danger">删除</el-link>
|
|
|
|
|
|
+ <el-link
|
|
|
|
+ type="warning"
|
|
|
|
+ @click="
|
|
|
|
+ toCheck('editContract', item)
|
|
|
|
+ "
|
|
|
|
+ >编辑合同段信息</el-link
|
|
|
|
+ >
|
|
|
|
+ <el-link
|
|
|
|
+ v-if="item.contractType === 1"
|
|
|
|
+ type="success"
|
|
|
|
+ @click="
|
|
|
|
+ toCheck('wbsContract', item)
|
|
|
|
+ "
|
|
|
|
+ >分配WBS</el-link
|
|
|
|
+ >
|
|
|
|
+ <el-link
|
|
|
|
+ v-del-com:[delContract]="item"
|
|
|
|
+ type="danger"
|
|
|
|
+ >删除</el-link
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -54,96 +159,100 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, watch } from 'vue'
|
|
|
|
-import { deepClone, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
|
-import mainApi from '~api/project/project'
|
|
|
|
-import contractApi from '~api/project/contract'
|
|
|
|
|
|
+import { ref, watch } from "vue";
|
|
|
|
+import { deepClone, getArrValue, getObjValue, isNullES } from "js-fast-way";
|
|
|
|
+import mainApi from "~api/project/project";
|
|
|
|
+import contractApi from "~api/project/contract";
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
ids: {
|
|
ids: {
|
|
type: [String, Number],
|
|
type: [String, Number],
|
|
- default: '',
|
|
|
|
|
|
+ default: "",
|
|
},
|
|
},
|
|
-})
|
|
|
|
|
|
+});
|
|
|
|
|
|
//事件
|
|
//事件
|
|
-const emit = defineEmits(['change', 'check', 'close'])
|
|
|
|
|
|
+const emit = defineEmits(["change", "check", "close"]);
|
|
|
|
|
|
//双向绑定
|
|
//双向绑定
|
|
// eslint-disable-next-line no-undef
|
|
// eslint-disable-next-line no-undef
|
|
-const isShow = defineModel('modelValue', {
|
|
|
|
|
|
+const isShow = defineModel("modelValue", {
|
|
default: false,
|
|
default: false,
|
|
-})
|
|
|
|
|
|
+});
|
|
|
|
|
|
//监听数据
|
|
//监听数据
|
|
-const projectId = ref(props.ids)
|
|
|
|
-watch(() => props.ids, (id) => {
|
|
|
|
- projectId.value = id
|
|
|
|
-}, { deep: true })
|
|
|
|
|
|
+const projectId = ref(props.ids);
|
|
|
|
+watch(
|
|
|
|
+ () => props.ids,
|
|
|
|
+ (id) => {
|
|
|
|
+ projectId.value = id;
|
|
|
|
+ },
|
|
|
|
+ { deep: true }
|
|
|
|
+);
|
|
|
|
|
|
//监听显示
|
|
//监听显示
|
|
watch(isShow, (val) => {
|
|
watch(isShow, (val) => {
|
|
if (val) {
|
|
if (val) {
|
|
- getProjectInfo()
|
|
|
|
|
|
+ getProjectInfo();
|
|
} else {
|
|
} else {
|
|
- projectInfo.value = {}
|
|
|
|
- projectId.value = ''
|
|
|
|
- emit('close')
|
|
|
|
|
|
+ projectInfo.value = {};
|
|
|
|
+ projectId.value = "";
|
|
|
|
+ emit("close");
|
|
}
|
|
}
|
|
-})
|
|
|
|
|
|
+});
|
|
|
|
|
|
//获取项目信息
|
|
//获取项目信息
|
|
-const projectInfo = ref({})
|
|
|
|
|
|
+const projectInfo = ref({});
|
|
const getProjectInfo = async () => {
|
|
const getProjectInfo = async () => {
|
|
- if (isNullES(projectId.value)) return
|
|
|
|
- const { data } = await mainApi.detail(projectId.value)
|
|
|
|
- projectInfo.value = getObjValue(data)
|
|
|
|
- await getContractList(projectId.value)
|
|
|
|
-}
|
|
|
|
|
|
+ if (isNullES(projectId.value)) return;
|
|
|
|
+ const { data } = await mainApi.detail(projectId.value);
|
|
|
|
+ projectInfo.value = getObjValue(data);
|
|
|
|
+ await getContractList(projectId.value);
|
|
|
|
+};
|
|
|
|
|
|
//获取合同段信息
|
|
//获取合同段信息
|
|
-const contractList = ref([])
|
|
|
|
|
|
+const contractList = ref([]);
|
|
const getContractList = async (id) => {
|
|
const getContractList = async (id) => {
|
|
- if (isNullES(id)) return
|
|
|
|
- const { data } = await contractApi.getList(id)
|
|
|
|
- contractList.value = getArrValue(data)
|
|
|
|
-}
|
|
|
|
|
|
+ if (isNullES(id)) return;
|
|
|
|
+ const { data } = await contractApi.getList(id);
|
|
|
|
+ contractList.value = getArrValue(data);
|
|
|
|
+};
|
|
|
|
|
|
//关闭弹窗
|
|
//关闭弹窗
|
|
const dialogClose = () => {
|
|
const dialogClose = () => {
|
|
- projectInfo.value = {}
|
|
|
|
- isShow.value = false
|
|
|
|
- emit('close')
|
|
|
|
-}
|
|
|
|
|
|
+ projectInfo.value = {};
|
|
|
|
+ isShow.value = false;
|
|
|
|
+ emit("close");
|
|
|
|
+};
|
|
|
|
|
|
//删除项目
|
|
//删除项目
|
|
const delProject = async (_, resolve) => {
|
|
const delProject = async (_, resolve) => {
|
|
- if (isNullES(projectId.value)) return
|
|
|
|
- const { isRes } = await mainApi.del(projectId.value)
|
|
|
|
- resolve() //关闭弹窗
|
|
|
|
- if (!isRes) return
|
|
|
|
- window.$message.success('删除成功')
|
|
|
|
- dialogClose()
|
|
|
|
- emit('change')
|
|
|
|
-}
|
|
|
|
|
|
+ if (isNullES(projectId.value)) return;
|
|
|
|
+ const { isRes } = await mainApi.del(projectId.value);
|
|
|
|
+ resolve(); //关闭弹窗
|
|
|
|
+ if (!isRes) return;
|
|
|
|
+ window.$message.success("删除成功");
|
|
|
|
+ dialogClose();
|
|
|
|
+ emit("change");
|
|
|
|
+};
|
|
|
|
|
|
//删除合同段
|
|
//删除合同段
|
|
const delContract = async ({ item }, resolve) => {
|
|
const delContract = async ({ item }, resolve) => {
|
|
- const { isRes } = await contractApi.del(item.id)
|
|
|
|
- resolve() //关闭弹窗
|
|
|
|
- if (!isRes) return
|
|
|
|
- window.$message.success('删除成功')
|
|
|
|
- getContractList(projectId.value).then()
|
|
|
|
-}
|
|
|
|
|
|
+ const { isRes } = await contractApi.del(item.id);
|
|
|
|
+ resolve(); //关闭弹窗
|
|
|
|
+ if (!isRes) return;
|
|
|
|
+ window.$message.success("删除成功");
|
|
|
|
+ getContractList(projectId.value).then();
|
|
|
|
+};
|
|
|
|
|
|
//功能事件回调
|
|
//功能事件回调
|
|
const toCheck = (type, item = {}) => {
|
|
const toCheck = (type, item = {}) => {
|
|
//measure, lar, test, wbsTree, logTree, editProject, addContract, editContract, wbsContract
|
|
//measure, lar, test, wbsTree, logTree, editProject, addContract, editContract, wbsContract
|
|
//计量管理,征拆划分,实验划分,WBS树管理,日志树管理,编辑项目,创建合同段,编辑合同段信息,分配WBS
|
|
//计量管理,征拆划分,实验划分,WBS树管理,日志树管理,编辑项目,创建合同段,编辑合同段信息,分配WBS
|
|
- const info = deepClone(projectInfo.value)
|
|
|
|
- dialogClose()
|
|
|
|
- emit('check', { type, info, item })
|
|
|
|
-}
|
|
|
|
|
|
+ const info = deepClone(projectInfo.value);
|
|
|
|
+ dialogClose();
|
|
|
|
+ emit("check", { type, info, item });
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
@@ -159,7 +268,8 @@ const toCheck = (type, item = {}) => {
|
|
--el-header-height: 50px;
|
|
--el-header-height: 50px;
|
|
border-bottom: 1px solid #f4f4f4;
|
|
border-bottom: 1px solid #f4f4f4;
|
|
}
|
|
}
|
|
- .el-aside, .el-main {
|
|
|
|
|
|
+ .el-aside,
|
|
|
|
+ .el-main {
|
|
position: relative;
|
|
position: relative;
|
|
--el-main-padding: 0;
|
|
--el-main-padding: 0;
|
|
.hc-new-main-body {
|
|
.hc-new-main-body {
|
|
@@ -232,7 +342,7 @@ const toCheck = (type, item = {}) => {
|
|
color: #747474;
|
|
color: #747474;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
}
|
|
}
|
|
- .el-link + .el-link{
|
|
|
|
|
|
+ .el-link + .el-link {
|
|
margin-left: 10px;
|
|
margin-left: 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|