ZaiZai 1 年間 前
コミット
13ca3452dd

+ 7 - 0
src/api/modules/other.js

@@ -170,3 +170,10 @@ export const getContractInfo = (form, msg = true) => HcApi({
     method: 'get',
     params: form,
 }, msg)
+
+//获取合同段信息
+export const getErtractInfo = (form, msg = true) => HcApi({
+    url: '/api/blade-manager/contractInfo/get-ertract-Info',
+    method: 'get',
+    params: form,
+}, msg)

+ 52 - 0
src/api/modules/tentative/detect/commission.js

@@ -0,0 +1,52 @@
+import { HcApi } from '../../../request/index'
+
+export default {
+    //分页
+    async page(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-business/uentrustinfo/page',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+    //新增
+    async save(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-business/uentrustinfo/save',
+            method: 'post',
+            data: form,
+        }, msg)
+    },
+    //修改
+    async update(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-business/uentrustinfo/update',
+            method: 'post',
+            data: form,
+        }, msg)
+    },
+    //新增或修改
+    async submit(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-business/uentrustinfo/submit',
+            method: 'post',
+            data: form,
+        }, msg)
+    },
+    //删除
+    async remove(ids, msg = true) {
+        return HcApi({
+            url: '/api/blade-business/uentrustinfo/remove',
+            method: 'post',
+            params: { ids },
+        }, msg)
+    },
+    //详情
+    async detail(id, msg = true) {
+        return HcApi({
+            url: '/api/blade-business/uentrustinfo/detail',
+            method: 'get',
+            params: { id },
+        }, msg)
+    },
+}

+ 35 - 8
src/views/tentative/detect/commission.vue

@@ -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
+    }
 }
 
 //多选