|
@@ -3,8 +3,8 @@
|
|
|
<div :id="`hc_tree_card_${uuid}`">
|
|
|
<hc-new-card scrollbar>
|
|
|
<template #header>
|
|
|
- <el-select v-model="searchForm.key1" filterable block placeholder="选择计量期" @change="searchKey1Click">
|
|
|
- <el-option v-for="item in key1Data" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ <el-select v-model="searchForm.contractPeriodId" placeholder="选择计量期" filterable clearable block @change="searchKey1Click">
|
|
|
+ <el-option v-for="item in key1Data" :key="item.id" :label="item.periodNumber" :value="item.id" clearable />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
<hc-lazy-tree :h-props="treeProps" tree-key="id" :auto-expand-keys="TreeAutoExpandKeys" @load="treeLoadNode" @nodeTap="treeNodeTap" />
|
|
@@ -58,6 +58,7 @@ import HcAddModal from './components/middlepay/addModal.vue'
|
|
|
import HcDetailsModal from './components/middlepay/detailsModal.vue'
|
|
|
import { arrToId, getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
import unitApi from '~api/project/debit/contract/unit.js'
|
|
|
+import periodApi from '~api/debit-pay/admin/periods.js'
|
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
const useAppState = useAppStore()
|
|
@@ -73,6 +74,7 @@ const uuid = getRandom(4)
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
setSplitRef()
|
|
|
+ getKey1Data()
|
|
|
})
|
|
|
|
|
|
//初始化设置拖动分割线
|
|
@@ -89,14 +91,25 @@ const setSplitRef = () => {
|
|
|
|
|
|
//搜索表单
|
|
|
const searchForm = ref({
|
|
|
- key1: null, current: 1, size: 10, total: 0,
|
|
|
+ contractPeriodId: null, current: 1, size: 10, total: 0,
|
|
|
})
|
|
|
+//获取合同计量期
|
|
|
|
|
|
//计量期
|
|
|
-const key1Data = ref([
|
|
|
- { id: 1, name: '计量期1' },
|
|
|
- { id: 2, name: '计量期2' },
|
|
|
-])
|
|
|
+const key1Data = ref([])
|
|
|
+const getKey1Data = async ()=>{
|
|
|
+ const { error, code, data } = await periodApi.allPeriod({
|
|
|
+ contractId:contractId.value,
|
|
|
+ type:1,
|
|
|
+ })
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ key1Data.value = getArrValue(data)
|
|
|
+ searchForm.value.contractPeriodId = key1Data.value[ key1Data.value.length - 1].id
|
|
|
+ } else {
|
|
|
+ key1Data.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
const searchKey1Click = () => {
|
|
|
|
|
|
}
|
|
@@ -119,6 +132,7 @@ const treeLoadNode = async ({ node, item, level }, resolve) => {
|
|
|
const { error, code, data } = await unitApi.lazyTree({
|
|
|
contractId: contractId.value,
|
|
|
id:id,
|
|
|
+ contractPeriodId:searchForm.value.contractPeriodId,
|
|
|
})
|
|
|
|
|
|
resolve(getArrValue(data))
|