|
@@ -4,7 +4,7 @@
|
|
|
<hc-new-card scrollbar>
|
|
|
<template #header>
|
|
|
<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-option v-for="item in key1Data" :key="item.id" :label="item.periodName" :value="item.id" clearable />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
<hc-lazy-tree :h-props="treeProps" tree-key="id" :auto-expand-keys="TreeAutoExpandKeys" @load="treeLoadNode" @nodeTap="treeNodeTap" />
|
|
@@ -54,13 +54,16 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { nextTick, onMounted, ref } from 'vue'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
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'
|
|
|
+
|
|
|
+import periodApi from '~api/debit-pay/material/periods'
|
|
|
+import unitApi from '~api/project/debit/contract/unit'
|
|
|
+import mainApi from '~api/debit-pay/admin/middlepay'
|
|
|
+
|
|
|
const useAppState = useAppStore()
|
|
|
const projectId = ref(useAppState.getProjectId || '')
|
|
|
const contractId = ref(useAppState.getContractId || '')
|
|
@@ -91,9 +94,9 @@ const setSplitRef = () => {
|
|
|
|
|
|
//搜索表单
|
|
|
const searchForm = ref({
|
|
|
- contractPeriodId: null, current: 1, size: 10, total: 0,
|
|
|
+ contractPeriodId: null, contractUnitId: null, contractId: contractId.value,
|
|
|
+ current: 1, size: 10, total: 0,
|
|
|
})
|
|
|
-//获取合同计量期
|
|
|
|
|
|
//计量期
|
|
|
const key1Data = ref([])
|
|
@@ -111,7 +114,8 @@ const getKey1Data = async ()=>{
|
|
|
}
|
|
|
}
|
|
|
const searchKey1Click = () => {
|
|
|
-
|
|
|
+ searchForm.value.current = 1
|
|
|
+ getTableData()
|
|
|
}
|
|
|
|
|
|
//数据格式
|
|
@@ -137,15 +141,18 @@ const treeLoadNode = async ({ node, item, level }, resolve) => {
|
|
|
|
|
|
resolve(getArrValue(data))
|
|
|
}
|
|
|
-const treeNodeTap = ({ node, data, keys }) => {
|
|
|
- console.log('点击树')
|
|
|
- TreeAutoExpandKeys.value = keys || []
|
|
|
+const treeNodeTap = ({data, keys }) => {
|
|
|
+ searchForm.value.current = 1
|
|
|
+ searchForm.value.contractUnitId = data.id
|
|
|
+ TreeAutoExpandKeys.value = keys || []
|
|
|
setStoreValue('wbsTreeExpandKeys', keys)
|
|
|
+ getTableData()
|
|
|
}
|
|
|
//分页
|
|
|
const pageChange = ({ current, size }) => {
|
|
|
searchForm.value.current = current
|
|
|
searchForm.value.size = size
|
|
|
+ getTableData()
|
|
|
}
|
|
|
|
|
|
//表格数据
|
|
@@ -159,9 +166,18 @@ const tableColumn = ref([
|
|
|
{ key: 'key6', name: '审核状态' },
|
|
|
{ key: 'action', name: '操作', width: 130, align: 'center' },
|
|
|
])
|
|
|
-const tableData = ref([
|
|
|
- { key1: '1111' },
|
|
|
-])
|
|
|
+const tableData = ref([])
|
|
|
+const getTableData = async () => {
|
|
|
+ tableData.value = []
|
|
|
+ tableLoading.value = true
|
|
|
+ const { data } = await mainApi.getPage({
|
|
|
+ ...searchForm.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ })
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
+ searchForm.value.total = data.total || 0
|
|
|
+ tableLoading.value = false
|
|
|
+}
|
|
|
|
|
|
//表格选择
|
|
|
const tableCheckChange = () => {
|