|
@@ -3,7 +3,7 @@
|
|
<hc-table ref="tableRef" is-new is-expand :index-style="{ width: 60 }" :column="tableColumn" :datas="tableData" :loading="tableLoading">
|
|
<hc-table ref="tableRef" is-new is-expand :index-style="{ width: 60 }" :column="tableColumn" :datas="tableData" :loading="tableLoading">
|
|
<template #table-expand="{ row, index: index1 }">
|
|
<template #table-expand="{ row, index: index1 }">
|
|
<div class="relative p-2">
|
|
<div class="relative p-2">
|
|
- <hc-table is-new :is-index="false" :column="tableColumn1" :datas="tableData1">
|
|
|
|
|
|
+ <hc-table is-new :is-index="false" :column="tableColumn1" :datas="row.detail">
|
|
<template #index-key="{ index: index2 }">
|
|
<template #index-key="{ index: index2 }">
|
|
{{ index1 + 1 }}-{{ index2 + 1 }}
|
|
{{ index1 + 1 }}-{{ index2 + 1 }}
|
|
</template>
|
|
</template>
|
|
@@ -20,9 +20,19 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, watch } from 'vue'
|
|
import { ref, watch } from 'vue'
|
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
|
+import mainApi from '~api/debit-pay/admin/middlepay'
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
- ids: {
|
|
|
|
|
|
+ projectId: {
|
|
|
|
+ type: [String, Number],
|
|
|
|
+ default: '',
|
|
|
|
+ },
|
|
|
|
+ contractId: {
|
|
|
|
+ type: [String, Number],
|
|
|
|
+ default: '',
|
|
|
|
+ },
|
|
|
|
+ periodId: {
|
|
type: [String, Number],
|
|
type: [String, Number],
|
|
default: '',
|
|
default: '',
|
|
},
|
|
},
|
|
@@ -31,6 +41,9 @@ const props = defineProps({
|
|
//事件
|
|
//事件
|
|
const emit = defineEmits(['close'])
|
|
const emit = defineEmits(['close'])
|
|
const tableRef = ref(null)
|
|
const tableRef = ref(null)
|
|
|
|
+const period_id = ref(props.periodId)
|
|
|
|
+const pid = ref(props.projectId)
|
|
|
|
+const cid = ref(props.contractId)
|
|
|
|
|
|
//双向绑定
|
|
//双向绑定
|
|
// eslint-disable-next-line no-undef
|
|
// eslint-disable-next-line no-undef
|
|
@@ -40,31 +53,48 @@ const isShow = defineModel('modelValue', {
|
|
|
|
|
|
//监听
|
|
//监听
|
|
watch(() => [
|
|
watch(() => [
|
|
- props.ids,
|
|
|
|
-], ([ids]) => {
|
|
|
|
- console.log('ids', ids)
|
|
|
|
-}, { immediate: true })
|
|
|
|
|
|
+ props.projectId,
|
|
|
|
+ props.contractId,
|
|
|
|
+ props.periodId,
|
|
|
|
+], ([projectId, contractId, periodId]) => {
|
|
|
|
+ pid.value = projectId
|
|
|
|
+ cid.value = contractId
|
|
|
|
+ period_id.value = periodId
|
|
|
|
+}, { deep: true })
|
|
|
|
|
|
//监听
|
|
//监听
|
|
watch(isShow, (val) => {
|
|
watch(isShow, (val) => {
|
|
- if (val) {}
|
|
|
|
|
|
+ if (val) {
|
|
|
|
+ getTableData()
|
|
|
|
+ } else {
|
|
|
|
+ tableData.value = []
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
//表格数据
|
|
//表格数据
|
|
const tableLoading = ref(false)
|
|
const tableLoading = ref(false)
|
|
const tableColumn = [
|
|
const tableColumn = [
|
|
{ key: 'action', name: '操作', width: 130, align: 'center' },
|
|
{ key: 'action', name: '操作', width: 130, align: 'center' },
|
|
- { key: 'key1', name: '清单编号', width: 120, align: 'center' },
|
|
|
|
- { key: 'key2', name: '清单名称' },
|
|
|
|
- { key: 'key3', name: '变更后数量', width: 120, align: 'center' },
|
|
|
|
- { key: 'key4', name: '计量数量', width: 120, align: 'center' },
|
|
|
|
- { key: 'key5', name: '单价', width: 120, align: 'center' },
|
|
|
|
- { key: 'key6', name: '完成金额', width: 120, align: 'center' },
|
|
|
|
|
|
+ { key: 'formNumber', name: '清单编号', width: 120, align: 'center' },
|
|
|
|
+ { key: 'formName', name: '清单名称' },
|
|
|
|
+ { key: 'changeTotal', name: '变更后数量', width: 120, align: 'center' },
|
|
|
|
+ { key: 'allMeterTotal', name: '计量数量', width: 120, align: 'center' },
|
|
|
|
+ { key: 'currentPrice', name: '单价', width: 120, align: 'center' },
|
|
|
|
+ { key: 'allMeterMoney', name: '完成金额', width: 120, align: 'center' },
|
|
]
|
|
]
|
|
-const tableData = ref([
|
|
|
|
- { id: '1', key1: '1111' }, { id: '2', key1: '2222' }, { id: '3', key1: '3333' },
|
|
|
|
-])
|
|
|
|
|
|
+const tableData = ref([])
|
|
|
|
|
|
|
|
+//获取明细数据
|
|
|
|
+const getTableData = async () => {
|
|
|
|
+ tableLoading.value = true
|
|
|
|
+ const { data } = await mainApi.getFormDetail({
|
|
|
|
+ projectId: pid.value,
|
|
|
|
+ contractId: cid.value,
|
|
|
|
+ contractPeriodId: period_id.value,
|
|
|
|
+ })
|
|
|
|
+ tableData.value = getArrValue(data)
|
|
|
|
+ tableLoading.value = false
|
|
|
|
+}
|
|
|
|
|
|
//展开
|
|
//展开
|
|
const unfoldClick = (row) => {
|
|
const unfoldClick = (row) => {
|
|
@@ -80,23 +110,16 @@ const awayClick = (row) => {
|
|
|
|
|
|
const tableColumn1 = [
|
|
const tableColumn1 = [
|
|
{ key: 'index-key', name: '序号', width: 90, align: 'center' },
|
|
{ key: 'index-key', name: '序号', width: 90, align: 'center' },
|
|
- { key: 'key1', name: '凭证编号', width: 100, align: 'center' },
|
|
|
|
- { key: 'key2', name: '计量期', width: 100, align: 'center' },
|
|
|
|
- { key: 'key3', name: '工程部位' },
|
|
|
|
- { key: 'key4', name: '审核状态', width: 120, align: 'center' },
|
|
|
|
- { key: 'key5', name: '本期计量数量', width: 120, align: 'center' },
|
|
|
|
- { key: 'key6', name: '计量总金额', width: 120, align: 'center' },
|
|
|
|
|
|
+ { key: 'key1', name: '凭证编号(暂无此字段)', width: 100, align: 'center' },
|
|
|
|
+ { key: 'meterPeriodName', name: '计量期', width: 100, align: 'center' },
|
|
|
|
+ { key: 'engineerDivide', name: '工程部位' },
|
|
|
|
+ { key: 'approveStatusName', name: '审核状态', width: 120, align: 'center' },
|
|
|
|
+ { key: 'currentMeterTotal', name: '本期计量数量', width: 120, align: 'center' },
|
|
|
|
+ { key: 'currentMeterMoney', name: '计量总金额', width: 120, align: 'center' },
|
|
]
|
|
]
|
|
-const tableData1 = ref([
|
|
|
|
- { key1: '1111' }, { key1: '2222' }, { key1: '3333' },
|
|
|
|
-])
|
|
|
|
|
|
|
|
const modalClose = () => {
|
|
const modalClose = () => {
|
|
isShow.value = false
|
|
isShow.value = false
|
|
emit('close')
|
|
emit('close')
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
-
|
|
|
|
-<style scoped lang="scss">
|
|
|
|
-
|
|
|
|
-</style>
|
|
|