|
@@ -2,7 +2,7 @@
|
|
<hc-drawer v-model="isShow" to-id="hc-project-list" is-close @close="drawerClose">
|
|
<hc-drawer v-model="isShow" to-id="hc-project-list" is-close @close="drawerClose">
|
|
<div class="hc-contract-info-drawer relative h-full">
|
|
<div class="hc-contract-info-drawer relative h-full">
|
|
<hc-tab-card :scrollbar="tabsKey === '1'" :tabs="tabsData" :tab-key="tabsKey" is-action-btn @change="tabsChange">
|
|
<hc-tab-card :scrollbar="tabsKey === '1'" :tabs="tabsData" :tab-key="tabsKey" is-action-btn @change="tabsChange">
|
|
- 111111
|
|
|
|
|
|
+ <HcInfo v-if="tabsKey === '1'" :data="dataInfo" />
|
|
</hc-tab-card>
|
|
</hc-tab-card>
|
|
</div>
|
|
</div>
|
|
</hc-drawer>
|
|
</hc-drawer>
|
|
@@ -11,9 +11,7 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, watch } from 'vue'
|
|
import { ref, watch } from 'vue'
|
|
import { getObjValue, isNullES } from 'js-fast-way'
|
|
import { getObjValue, isNullES } from 'js-fast-way'
|
|
-import { getDictionaryData } from '~uti/tools'
|
|
|
|
-import mainApi from '~api/project/contract'
|
|
|
|
-import projectApi from '~api/project/project'
|
|
|
|
|
|
+import HcInfo from './info.vue'
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
data: {
|
|
data: {
|
|
@@ -45,85 +43,15 @@ watch(isShow, (val) => {
|
|
const tabsKey = ref('1')
|
|
const tabsKey = ref('1')
|
|
const tabsData = ref([])
|
|
const tabsData = ref([])
|
|
const getDataApi = async () => {
|
|
const getDataApi = async () => {
|
|
- const { cid, type, tab } = getObjValue(dataInfo.value)
|
|
|
|
|
|
+ const { cid, tab } = getObjValue(dataInfo.value)
|
|
if (isNullES(cid)) {
|
|
if (isNullES(cid)) {
|
|
tabsData.value = [{ key: '1', name: '合同段信息' }]
|
|
tabsData.value = [{ key: '1', name: '合同段信息' }]
|
|
} else {
|
|
} else {
|
|
tabsData.value = [{ key: '1', name: '合同段信息' }, { key: '2', name: '分配WBS' }, { key: '3', name: '分配项目人员' }]
|
|
tabsData.value = [{ key: '1', name: '合同段信息' }, { key: '2', name: '分配WBS' }, { key: '3', name: '分配项目人员' }]
|
|
}
|
|
}
|
|
- await getContractTypeList()
|
|
|
|
- if (!isNullES(cid)) {
|
|
|
|
- if ([1, 4, 8].includes(type)) {
|
|
|
|
- await getContractInfo()
|
|
|
|
- } else if ([2, 3].includes(type)) {
|
|
|
|
- await getContractInfo2()
|
|
|
|
- await getContractRelation()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- await getProjectDeatil()
|
|
|
|
if (!isNullES(tab)) {
|
|
if (!isNullES(tab)) {
|
|
tabsKey.value = tab
|
|
tabsKey.value = tab
|
|
}
|
|
}
|
|
- getStoragePeriodList().then()
|
|
|
|
- getSecurityLevelList().then()
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//获取项目详情
|
|
|
|
-const projectInfo = ref({})
|
|
|
|
-const getProjectDeatil = async () => {
|
|
|
|
- const { pid } = getObjValue(dataInfo.value)
|
|
|
|
- contractForm.value = {}
|
|
|
|
- if (isNullES(pid)) return
|
|
|
|
- const { data } = await projectApi.detail(pid)
|
|
|
|
- projectInfo.value = getObjValue(data)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//获取合同类型
|
|
|
|
-const contractTypeList = ref([])
|
|
|
|
-const getContractTypeList = async () => {
|
|
|
|
- contractTypeList.value = await getDictionaryData('contract_type')
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//获取合同段基本信息
|
|
|
|
-const contractForm = ref({})
|
|
|
|
-const getContractInfo = async () => {
|
|
|
|
- const { cid } = getObjValue(dataInfo.value)
|
|
|
|
- contractForm.value = {}
|
|
|
|
- if (isNullES(cid)) return
|
|
|
|
- const { data } = await mainApi.detail(cid)
|
|
|
|
- contractForm.value = getObjValue(data)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//获取合同段基本信息
|
|
|
|
-const getContractInfo2 = async () => {
|
|
|
|
- const { cid, type } = getObjValue(dataInfo.value)
|
|
|
|
- contractForm.value = {}
|
|
|
|
- if (isNullES(cid)) return
|
|
|
|
- const { data } = await mainApi.detail2({
|
|
|
|
- id: cid,
|
|
|
|
- contractType: type,
|
|
|
|
- })
|
|
|
|
- contractForm.value = getObjValue(data)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//监理、业主关联施工
|
|
|
|
-const getContractRelation = async () => {
|
|
|
|
- const { cid } = getObjValue(dataInfo.value)
|
|
|
|
- if (isNullES(cid)) return
|
|
|
|
- const { data } = await projectApi.getContractRelation(cid)
|
|
|
|
- console.log(data)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//获取业务字典
|
|
|
|
-const storagePeriods = ref([])
|
|
|
|
-const getStoragePeriodList = async () => {
|
|
|
|
- storagePeriods.value = await getDictionaryData('storage_period', true)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//获取安全等级
|
|
|
|
-const securityLevels = ref([])
|
|
|
|
-const getSecurityLevelList = async () => {
|
|
|
|
- securityLevels.value = await getDictionaryData('security_level', true)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//选项卡
|
|
//选项卡
|