|
@@ -2,15 +2,15 @@
|
|
|
<div class="relative h-full flex">
|
|
|
<div :id="`hc_tree_card_${uuid}`">
|
|
|
<hc-new-card v-loading="treeLoaing" scrollbar>
|
|
|
- <hc-lazy-tree
|
|
|
+ <hc-lazy-tree
|
|
|
v-if="ishowTree"
|
|
|
- :h-props="treeProps"
|
|
|
+ :h-props="treeProps"
|
|
|
is-load-menu
|
|
|
- :auto-expand-keys="autoExpandKeys"
|
|
|
- tree-key="id"
|
|
|
- @load="treeLoadNode"
|
|
|
- @menu-tap="treeMenuTap"
|
|
|
- @node-tap="treeNodeTap"
|
|
|
+ :auto-expand-keys="autoExpandKeys"
|
|
|
+ tree-key="id"
|
|
|
+ @load="treeLoadNode"
|
|
|
+ @menu-tap="treeMenuTap"
|
|
|
+ @node-tap="treeNodeTap"
|
|
|
@load-menu="treeLoadMenu"
|
|
|
/>
|
|
|
</hc-new-card>
|
|
@@ -304,7 +304,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { nextTick, onMounted, ref } from 'vue'
|
|
|
+import { nextTick, onActivated, onMounted, ref } from 'vue'
|
|
|
import { arrToId, formValidate, getArrValue, getObjValue, getRandom, isNullES } from 'js-fast-way'
|
|
|
import { getHeader } from 'hc-vue3-ui'
|
|
|
import { useAppStore } from '~src/store'
|
|
@@ -330,9 +330,10 @@ const uuid = getRandom(4)
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
setSplitRef()
|
|
|
-
|
|
|
+})
|
|
|
+
|
|
|
+onActivated(() => {
|
|
|
getFormType()
|
|
|
-
|
|
|
})
|
|
|
|
|
|
//初始化设置拖动分割线
|
|
@@ -413,7 +414,7 @@ const getTreeNodeDetail = async (node)=>{
|
|
|
if (!error && code === 200) {
|
|
|
infoData.value = getObjValue(data)
|
|
|
tableData.value = infoData.value['list']
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
infoData.value = {}
|
|
|
tableData.value = []
|
|
@@ -436,7 +437,7 @@ const treeLoadMenu = ({ item, level }, resolve) => {
|
|
|
{ icon: 'arrow-up-down-line', label: '排序', key: 'sort' },
|
|
|
])
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
if (isLock === 1) {
|
|
|
return resolve([
|
|
@@ -494,7 +495,7 @@ const treeMenuTap = ({ key, data, node }) => {
|
|
|
if (key === 'sort') {
|
|
|
let nodes = [], childNodes = []
|
|
|
childNodes = node?.parent?.childNodes || node?.parent?.children || []
|
|
|
-
|
|
|
+
|
|
|
for (let i = 0; i < childNodes.length; i++) {
|
|
|
const res = childNodes[i]?.data
|
|
|
nodes.push({
|
|
@@ -509,11 +510,11 @@ const treeMenuTap = ({ key, data, node }) => {
|
|
|
if (key === 'del') {
|
|
|
delModalClick()
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
if (data?.isLock === 1 && key !== 'lock') {
|
|
|
window.$message.warning('当前节点为锁定状态,不允许操作')
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (key === 'lock') {
|
|
|
handleLockNode()
|
|
|
}
|
|
@@ -529,16 +530,16 @@ const changeAddFormType = (val)=>{
|
|
|
const FchangeIsForm = (val)=>{
|
|
|
const { hasChild } = treeItem.value
|
|
|
const { citeStatus } = infoData.value
|
|
|
-
|
|
|
+
|
|
|
if (hasChild && val === 1) {
|
|
|
window.$message.warning('该节点下面存在子节点,不允许修改为清单节点')
|
|
|
formModel.value.isFormNode = 0
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
if (citeStatus && val === 0) {
|
|
|
window.$message.warning('当前前清单已经被计量引用,不允许修改为非清单节点')
|
|
|
formModel.value.isFormNode = 1
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
//修改清单节点是否为清单节点限制
|
|
@@ -547,7 +548,7 @@ const IchangeIsForm = (val)=>{
|
|
|
if (citeStatus && val === 0) {
|
|
|
window.$message.warning('当前清单已经被计量引用,则不允许修改为非清单节点')
|
|
|
formModel.value.isFormNode = 1
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
//删除节点
|
|
@@ -615,7 +616,7 @@ const treeModalTitle = ref('')
|
|
|
const formRef = ref(null)
|
|
|
const formModel = ref({})
|
|
|
const formRules = ref({
|
|
|
-
|
|
|
+
|
|
|
formNumber: {
|
|
|
required: true,
|
|
|
trigger: 'blur',
|
|
@@ -641,7 +642,7 @@ const formRules = ref({
|
|
|
trigger: 'blur',
|
|
|
message: '请输入合同数量',
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
const addNodeLoading = ref(false)
|
|
|
//弹窗保存
|
|
@@ -676,7 +677,7 @@ const treeModalSave = async () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//合同工程清单导入
|
|
@@ -745,7 +746,7 @@ const addsupply = ()=>{
|
|
|
isSupplement:1,
|
|
|
chapterNumber:treeItem.value?.chapterNumber,
|
|
|
formType:treeItem.value?.formType,
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
supplementsModalShow.value = true
|
|
|
}
|
|
@@ -754,7 +755,7 @@ const supplementsModalSave = async () => {
|
|
|
console.log(supplementsFormModel.value, 'val')
|
|
|
const res = await formValidate(supplementsFormRef.value)
|
|
|
if (res) {
|
|
|
-
|
|
|
+
|
|
|
const { error, code } = await addNode({
|
|
|
...supplementsFormModel.value,
|
|
|
isSupplement:1,
|
|
@@ -770,7 +771,7 @@ const supplementsModalSave = async () => {
|
|
|
window?.location?.reload() //刷新页面
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//调整排序
|
|
@@ -825,7 +826,7 @@ const sortModalSave = async () => {
|
|
|
sortModalShow.value = false
|
|
|
window?.location?.reload() //刷新页面
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
//下载范例模板
|
|
|
const downLoadExel = async ()=>{
|
|
@@ -837,7 +838,7 @@ const downLoadExel = async ()=>{
|
|
|
} else {
|
|
|
window.$message.warning(msg)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
//修改中标单价
|
|
@@ -866,6 +867,6 @@ const changeContractTotal = (val)=>{
|
|
|
formModel.value.changeTotal = total
|
|
|
formModel.value.contractMoney = (BigNumber(total).multipliedBy(formModel.value.bidPrice)).toString()
|
|
|
formModel.value.changeMoney = (BigNumber(total).multipliedBy(formModel.value.bidPrice)).toString()
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
</script>
|