|
@@ -396,6 +396,7 @@
|
|
|
:contract-id="contractId"
|
|
|
:wbs-id="projectInfo.referenceWbsTemplateId"
|
|
|
:project-id="projectId"
|
|
|
+ :is-custom="isCustom"
|
|
|
@check-change="addTreeNodeCheckChange"
|
|
|
/>
|
|
|
<HcTreeNode
|
|
@@ -405,7 +406,8 @@
|
|
|
:contract-id="contractId"
|
|
|
:wbs-id="projectInfo.referenceWbsTemplateId"
|
|
|
:project-id="projectId"
|
|
|
- strictly @check-change="addTreeNodeCheckChange"
|
|
|
+ strictly :is-custom="isCustom"
|
|
|
+ @check-change="addTreeNodeCheckChange"
|
|
|
/>
|
|
|
<template #footer>
|
|
|
<div class="lr-dialog-footer">
|
|
@@ -424,6 +426,12 @@
|
|
|
</template>
|
|
|
</hc-new-dialog>
|
|
|
|
|
|
+ <!-- 新增自定义节点 -->
|
|
|
+ <hc-new-dialog v-model="addNodeModalCus" :loading="addNodeLoadingCus" loading-text="新增节点中,请耐心等待..." title="新增自定义节点" widths="720px" @save="addNodeClickCur">
|
|
|
+ <div>节点名称:</div>
|
|
|
+ <el-input v-model="nodeNameinput" placeholder="请输入节点名称" size="large" style="margin-top: 15px;" />
|
|
|
+ </hc-new-dialog>
|
|
|
+
|
|
|
<!-- 调整排序 -->
|
|
|
<hc-new-dialog v-model="sortNodeModal" :loading="sortNodeLoading" title="调整排序" widths="700px" @save="sortNodeClick">
|
|
|
<el-alert :closable="false" title="可拖动排序,也可在后面点击图标,切换排序" type="warning" />
|
|
@@ -762,6 +770,8 @@ const TreeMark = ref(false)
|
|
|
const setElTreeMenu = (contractType) => {
|
|
|
let newArr = []
|
|
|
if (contractType === 1) {
|
|
|
+ //新增自定义节点功能
|
|
|
+ newArr.push({ icon: 'add-circle', label: '新增自定义节点', key: 'add1' })
|
|
|
if (HcIsButton('wbs_tree_add')) {
|
|
|
newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
|
|
|
}
|
|
@@ -788,6 +798,8 @@ const setElTreeMenu = (contractType) => {
|
|
|
newArr.push({ icon: 'folder-shared', label: '工程划分', key: 'nodetree' })
|
|
|
}
|
|
|
} else if (contractType === 2) {
|
|
|
+ //新增自定义节点功能
|
|
|
+ newArr.push({ icon: 'add-circle', label: '新增自定义节点', key: 'add1' })
|
|
|
if (HcIsButton('wbs_tree_add')) {
|
|
|
newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
|
|
|
}
|
|
@@ -976,11 +988,19 @@ const setTreeMenuDataClick = ({ key, node, data }) => {
|
|
|
copyNodeLoading.value = false
|
|
|
copyNodeModal.value = true
|
|
|
} else if (key === 'add') {
|
|
|
- console.log(data, 'data')
|
|
|
+ isCustomAdd.value = false
|
|
|
+ isCustom.value = data?.isCustom
|
|
|
addTreeNodeId.value = data?.primaryKeyId
|
|
|
addTreeNodeOldId.value = data?.oldId
|
|
|
addNodeLoading.value = false
|
|
|
addNodeModal.value = true
|
|
|
+ } else if (key === 'add1') {
|
|
|
+ isCustomAdd.value = true
|
|
|
+ addTreeNodeId.value = data?.primaryKeyId
|
|
|
+ addTreeNodeOldId.value = data?.oldId
|
|
|
+ addNodeLoading.value = false
|
|
|
+ nodeNameinput.value = ''
|
|
|
+ addNodeModalCus.value = true
|
|
|
} else if (key === 'upload') {
|
|
|
const info = nodeDataInfo.value
|
|
|
//上传的配置
|
|
@@ -1366,7 +1386,13 @@ const addNodeModal = ref(false)
|
|
|
const addTreeNodeId = ref('')
|
|
|
const addTreeNodeOldId = ref('')
|
|
|
const addTreeNodeType = ref('1')
|
|
|
+const isCustom = ref(null)
|
|
|
+const isCustomAdd = ref(false)
|
|
|
|
|
|
+//新增自定义节点
|
|
|
+const addNodeModalCus = ref(false)
|
|
|
+const addNodeLoadingCus = ref(false)
|
|
|
+const nodeNameinput = ref('')
|
|
|
//选中的节点
|
|
|
const allSelectedList = ref([])
|
|
|
const halfSelectedList = ref([])
|
|
@@ -1404,25 +1430,42 @@ const addNodeClick = async () => {
|
|
|
if (keys.length <= 0) {
|
|
|
window?.$message?.warning('请先选择节点')
|
|
|
} else {
|
|
|
- //发起请求
|
|
|
- addNodeLoading.value = true
|
|
|
- const primaryKeyId = nodeDataInfo.value?.primaryKeyId || ''
|
|
|
- const { error, code } = await wbsApi.saveContractTreeNode({
|
|
|
- projectId: projectId.value,
|
|
|
- contractId: contractId.value,
|
|
|
- saveType: addTreeNodeType.value,
|
|
|
- allSelectedList: allSelectedList.value,
|
|
|
- halfSelectedList: halfSelectedList.value,
|
|
|
- currentNodePrimaryKeyId: primaryKeyId,
|
|
|
- })
|
|
|
- //判断状态
|
|
|
- addNodeLoading.value = false
|
|
|
- if (!error && code === 200) {
|
|
|
- window?.$message?.success('新增成功')
|
|
|
- addNodeModal.value = false
|
|
|
- window?.location?.reload() //刷新页面
|
|
|
+ //发起请求
|
|
|
+ addNodeLoading.value = true
|
|
|
+ const primaryKeyId = nodeDataInfo.value?.primaryKeyId || ''
|
|
|
+ const { error, code } = await wbsApi.saveContractTreeNode({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ saveType: addTreeNodeType.value,
|
|
|
+ allSelectedList: allSelectedList.value,
|
|
|
+ halfSelectedList: halfSelectedList.value,
|
|
|
+ currentNodePrimaryKeyId: primaryKeyId,
|
|
|
+ })
|
|
|
+ //判断状态
|
|
|
+ addNodeLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('新增成功')
|
|
|
+ addNodeModal.value = false
|
|
|
+ // window?.location?.reload() //刷新页面
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+const addNodeClickCur = async ()=>{
|
|
|
+ //发起请求
|
|
|
+ addNodeLoadingCus.value = true
|
|
|
+ const { error, code } = await wbsApi.saveCustomAddContractNode({
|
|
|
+ nodeName: nodeNameinput.value,
|
|
|
+ nodeType: nodeDataInfo.value?.nodeType || '',
|
|
|
+ partitionCode: nodeDataInfo.value?.partitionCode || '',
|
|
|
+ primaryKeyId: nodeDataInfo.value?.primaryKeyId || '',
|
|
|
+ })
|
|
|
+ //判断状态
|
|
|
+ addNodeLoadingCus.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('新增成功')
|
|
|
+ addNodeModalCus.value = false
|
|
|
+ // window?.location?.reload() //刷新页面
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//删除节点
|