|
@@ -10,8 +10,7 @@
|
|
|
<template #headerToSearch>
|
|
|
<div class="w-50">
|
|
|
<el-select v-model="searchForm.contractId" placeholder="选择合同段" filterable clearable block>
|
|
|
- <el-option label="测试1" value="1" />
|
|
|
- <el-option label="测试2" value="2" />
|
|
|
+ <el-option v-for="item in contractData" :key="item.id" :label="item.contractName" :value="item.id" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="ml-2 w-40">
|
|
@@ -141,11 +140,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onActivated, onDeactivated, ref } from 'vue'
|
|
|
+import { onActivated, ref } from 'vue'
|
|
|
+import samplingApi from '~api/tentative/material/sampling'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
import TestTree from '~src/views/tentative/material/components/TestTree.vue'
|
|
|
import SamplingPage from './commission/sampling.vue'
|
|
|
+import { getErtractInfo } from '~api/other'
|
|
|
+import mainApi from '~api/tentative/detect/commission'
|
|
|
|
|
|
//变量
|
|
|
const useAppState = useAppStore()
|
|
@@ -156,7 +159,7 @@ const projectInfo = ref(useAppState.getProjectInfo)
|
|
|
|
|
|
//渲染完成
|
|
|
onActivated(() => {
|
|
|
-
|
|
|
+ getContractData()
|
|
|
})
|
|
|
|
|
|
//搜索表单
|
|
@@ -172,6 +175,18 @@ const wbsElTreeClick = ({ data, keys }) => {
|
|
|
//缓存自动展开
|
|
|
treeAutoExpandKeys.value = keys
|
|
|
setStoreValue('testTreeExpandKeys', keys)
|
|
|
+ //获取表格
|
|
|
+ searchClick()
|
|
|
+}
|
|
|
+
|
|
|
+//获取合同段信息
|
|
|
+const contractData = ref([])
|
|
|
+const getContractData = async () => {
|
|
|
+ const { data } = await getErtractInfo({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ })
|
|
|
+ contractData.value = getArrValue(data)
|
|
|
}
|
|
|
|
|
|
//搜索
|
|
@@ -188,9 +203,7 @@ const pageChange = ({ current, size }) => {
|
|
|
}
|
|
|
|
|
|
//表格数据
|
|
|
-const tableData = ref([
|
|
|
- { key5:1 }, { key5:2 }, { key5:3 }, { key5:4 },
|
|
|
-])
|
|
|
+const tableData = ref([])
|
|
|
const tableColumn = ref([
|
|
|
{ key: 'key1', name: '委托单位' },
|
|
|
{ key: 'key2', name: '委托单编号' },
|
|
@@ -203,7 +216,21 @@ const tableColumn = ref([
|
|
|
//获取数据
|
|
|
const tableLoading = ref(false)
|
|
|
const getTableData = async () => {
|
|
|
-
|
|
|
+ tableLoading.value = true
|
|
|
+ const { error, code, data } = await mainApi.page({
|
|
|
+ ...searchForm.value,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
+ searchForm.value.total = data.total || 0
|
|
|
+ } else {
|
|
|
+ tableData.value = []
|
|
|
+ searchForm.value.total = 0
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//多选
|