|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="relative h-full flex">
|
|
|
<div :id="`hc_tree_card_${uuid}`">
|
|
|
- <hc-new-card scrollbar>
|
|
|
- <hc-lazy-tree :h-props="treeProps" is-load-menu @load="treeLoadNode" @loadMenu="treeLoadMenu" @menuTap="treeMenuTap" @nodeTap="treeNodeTap" />
|
|
|
+ <hc-new-card v-loading="treeLoaing" scrollbar>
|
|
|
+ <HcDataTree :h-props="treeProps" :datas="treeData" is-load-menu @menuTap="treeMenuTap" @nodeTap="treeNodeTap" @loadMenu="treeLoadMenu" />
|
|
|
</hc-new-card>
|
|
|
</div>
|
|
|
<div :id="`hc_table_card_${uuid}`" class="flex-1">
|
|
@@ -13,7 +13,7 @@
|
|
|
<el-button hc-btn type="primary">导出</el-button>
|
|
|
</template>
|
|
|
<div class="relative">
|
|
|
- <infoTable1 v-if="isInfoView" />
|
|
|
+ <infoTable1 v-if="isInfoView" :info-data="infoData" />
|
|
|
<template v-else>
|
|
|
<infoTable />
|
|
|
<el-divider border-style="dashed">下级节点列表</el-divider>
|
|
@@ -53,12 +53,12 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="中标单价:">
|
|
|
- <el-input v-model="formModel.key5" :disabled="treeItem.type === 1" />
|
|
|
+ <el-input v-model="formModel.key5" :disabled="treeItem.isFormNode === 0" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="合同数量:">
|
|
|
- <el-input v-model="formModel.key6" :disabled="treeItem.type === 1" />
|
|
|
+ <el-input v-model="formModel.key6" :disabled="treeItem.isFormNode === 0" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
@@ -80,7 +80,7 @@
|
|
|
</el-col>
|
|
|
</template>
|
|
|
<!-- 修改和清单 -->
|
|
|
- <template v-if="menuType === 'edit' && treeItem.type === 2">
|
|
|
+ <template v-if="menuType === 'edit' && treeItem.isFormNode === 1">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="中标单价:">
|
|
|
<el-input v-model="formModel.key5" />
|
|
@@ -151,8 +151,8 @@
|
|
|
<div class="hc-el-upload-drag">
|
|
|
<el-upload
|
|
|
ref="leadUploadRef" hc drag :show-file-list="false" :auto-upload="false" :headers="getHeader()"
|
|
|
- action="/api/blade-resource/oss/endpoint/upload-file" :data="leadUploadData"
|
|
|
- accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
|
|
|
+ action="/api/blade-meter/contractInventoryForm/importExcel" :data="leadUploadData" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
|
|
|
+ @on-success="handleFileDUcess"
|
|
|
>
|
|
|
<div class="hc-ui-upload-btn">
|
|
|
<div class="hc-uploader-drop">
|
|
@@ -275,11 +275,17 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { nextTick, onMounted, ref } from 'vue'
|
|
|
-import { getRandom } from 'js-fast-way'
|
|
|
+import { getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
import { getHeader } from 'hc-vue3-ui'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
import infoTable from './components/check-list/info-table.vue'
|
|
|
import infoTable1 from './components/check-list/info-table1.vue'
|
|
|
+import { getDetail, getFormTree, importExcel } from '~api/project/debit/contract.js'
|
|
|
|
|
|
+//变量
|
|
|
+const useAppState = useAppStore()
|
|
|
+const projectId = ref(useAppState.getProjectId)
|
|
|
+const contractId = ref(useAppState.getContractId)
|
|
|
defineOptions({
|
|
|
name: 'ProjectDebitContractList',
|
|
|
})
|
|
@@ -289,6 +295,7 @@ const uuid = getRandom(4)
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
setSplitRef()
|
|
|
+ treeLoadNode()
|
|
|
})
|
|
|
|
|
|
//初始化设置拖动分割线
|
|
@@ -308,33 +315,51 @@ const searchForm = ref({})
|
|
|
|
|
|
//数据格式
|
|
|
const treeProps = {
|
|
|
- label: 'name',
|
|
|
+ label: 'formName',
|
|
|
children: 'children',
|
|
|
- isLeaf: 'leaf',
|
|
|
+ isLeaf: 'hasChild',
|
|
|
}
|
|
|
+const treeData = ref([])
|
|
|
+//获取树的数据
|
|
|
|
|
|
-//懒加载的数据
|
|
|
-const treeLoadNode = ({ level, node }, resolve) => {
|
|
|
- if (level === 0) {
|
|
|
- return resolve([{ name: '根节点', type: 2 }])
|
|
|
- }
|
|
|
- if (level > 3) {
|
|
|
- return resolve([])
|
|
|
+const treeLoaing = ref(false)
|
|
|
+const treeLoadNode = async ()=>{
|
|
|
+ treeLoaing.value = true
|
|
|
+ const { error, code, data } = await getFormTree({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId:contractId.value,
|
|
|
+ })
|
|
|
+ treeLoaing.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ treeData.value = getArrValue(data)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ treeData.value = []
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- resolve([
|
|
|
- { name: '清单节点', type: 2, leaf: true },
|
|
|
- { name: '非清单节点', type: 1 },
|
|
|
- ])
|
|
|
- }, 500)
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
//树被点击
|
|
|
const isInfoView = ref(false)
|
|
|
-const treeNodeTap = ({ node }) => {
|
|
|
+const treeNodeTap = ({ node, data }) => {
|
|
|
isInfoView.value = !!node.isLeaf
|
|
|
+ console.log( isInfoView.value, ' isInfoView.value ')
|
|
|
+ getTreeNodeDetail(data)
|
|
|
}
|
|
|
+const infoData = ref({})
|
|
|
+//获取节点详情
|
|
|
+const getTreeNodeDetail = async (node)=>{
|
|
|
+ const { id } = node
|
|
|
+ const { error, code, data } = await getDetail({
|
|
|
+ id,
|
|
|
+ })
|
|
|
|
|
|
+ if (!error && code === 200) {
|
|
|
+ infoData.value = getObjValue(data)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ infoData.value = {}
|
|
|
+ }
|
|
|
+}
|
|
|
//菜单
|
|
|
const treeLoadMenu = ({ item, level }, resolve) => {
|
|
|
if (level === 1) {
|
|
@@ -354,6 +379,7 @@ const treeLoadMenu = ({ item, level }, resolve) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
const menuType = ref('')
|
|
|
const treeItem = ref({})
|
|
|
const treeMenuTap = ({ key, data }) => {
|
|
@@ -376,20 +402,18 @@ const treeMenuTap = ({ key, data }) => {
|
|
|
//表格数据
|
|
|
const tableLoading = ref(false)
|
|
|
const tableColumn = ref([
|
|
|
- { key: 'key1', name: '清单编号' },
|
|
|
- { key: 'key2', name: '清单名称' },
|
|
|
- { key: 'key3', name: '单位' },
|
|
|
- { key: 'key4', name: '现行单价' },
|
|
|
- { key: 'key5', name: '合同数量' },
|
|
|
- { key: 'key6', name: '合同金额' },
|
|
|
- { key: 'key7', name: '变更后单价' },
|
|
|
- { key: 'key8', name: '变更后数量' },
|
|
|
- { key: 'key9', name: '变更后金额' },
|
|
|
- { key: 'key10', name: '是否增补' },
|
|
|
-])
|
|
|
-const tableData = ref([
|
|
|
- { key1: '1111' },
|
|
|
+ { key: 'formNumber', name: '清单编号' },
|
|
|
+ { key: 'formName', name: '清单名称' },
|
|
|
+ { key: 'unit', name: '单位' },
|
|
|
+ { key: 'currentPrice', name: '现行单价' },
|
|
|
+ { key: 'contractTotal', name: '合同数量' },
|
|
|
+ { key: 'contractMoney', name: '合同金额' },
|
|
|
+ { key: 'changePrice', name: '变更后单价' },
|
|
|
+ { key: 'changeTotal', name: '变更后数量' },
|
|
|
+ { key: 'changeMoney', name: '变更后金额' },
|
|
|
+ { key: 'isSupplement', name: '是否增补' },
|
|
|
])
|
|
|
+const tableData = ref([])
|
|
|
|
|
|
//弹窗
|
|
|
const treeModalShow = ref(false)
|
|
@@ -408,8 +432,13 @@ const treeModalSave = () => {
|
|
|
//合同工程清单导入
|
|
|
const leadModalShow = ref(false)
|
|
|
const leadUploadRef = ref(null)
|
|
|
-const leadUploadData = ref({})
|
|
|
-
|
|
|
+const leadUploadData = ref({
|
|
|
+ projectId:projectId.value,
|
|
|
+ contractId:contractId.value,
|
|
|
+})
|
|
|
+const handleFileDUcess = (data)=>{
|
|
|
+ console.log(data, 'data')
|
|
|
+}
|
|
|
const tableLeadData = ref([
|
|
|
{ id: 1, k1: '100', k2: '100', k3: '总则', k4: '', k5: '', k6: '', k7: '1', k8: '100', k9: '' },
|
|
|
{ id: 2, k1: '101-1', k2: '101-1', k3: '保险费', k4: '', k5: '', k6: '', k7: '1', k8: '100', k9: '' },
|
|
@@ -419,6 +448,7 @@ const tableLeadData = ref([
|
|
|
])
|
|
|
|
|
|
const leadModalSave = () => {
|
|
|
+ leadUploadRef.value.submit()
|
|
|
leadModalShow.value = false
|
|
|
}
|
|
|
|