ZaiZai 1 vuosi sitten
vanhempi
commit
765887219d
1 muutettua tiedostoa jossa 25 lisäystä ja 7 poistoa
  1. 25 7
      src/views/tentative/detect/test.vue

+ 25 - 7
src/views/tentative/detect/test.vue

@@ -109,10 +109,9 @@
                             @keyup="keyUpEvent"
                         />
                     </div>
-                    <div class="ml-2 w-50">
-                        <el-select v-model="searchForm.contractId" placeholder="选择合同段" filterable clearable block>
-                            <el-option label="测试1" value="1" />
-                            <el-option label="测试2" value="2" />
+                    <div class="ml-2 w-200px">
+                        <el-select v-model="searchForm.contractId" placeholder="选择合同段" filterable block>
+                            <el-option v-for="item in contractData" :key="item.id" :label="item.contractName" :value="item.id" />
                         </el-select>
                     </div>
                     <div class="ml-2 w-32">
@@ -294,6 +293,7 @@ import HcDragUpload from './components/HcDragUpload.vue'
 import dataApi from '~api/tentative/detect/test'
 import { getDictionary } from '~api/other'
 import { eVisaTaskCheckApi } from '~api/other'
+import { getErtractInfo } from '~api/other'
 import wbsApi from '~api/data-fill/wbs'
 import samplingApi from '~api/tentative/material/sampling'
 import { arrToId, getArrValue, getObjValue, isString } from 'js-fast-way'
@@ -337,13 +337,29 @@ onMounted(() => {
     btn_edit.value = getButtonsVal('tentative_detect_test_edit')
     setContractType(contractInfo.value?.contractType)
     getCategoryData()
-
+    getContractData()
 })
 //缓存被激活时,重新获取表格数据
 onActivated(() => {
     // setMountOnEventKey()
     getTableData()
 })
+
+
+//获取合同段信息
+const contractData = ref([])
+const getContractData = async () => {
+    const { data } = await getErtractInfo({
+        projectId: projectId.value,
+        contractId: contractId.value,
+    })
+    const res = getArrValue(data)
+    contractData.value = res
+    if (res.length > 0) {
+        searchForm.value.contractId = res[0].id
+    }
+}
+
 const qualifiedData = ref([
     { label: '不合格', value: '0' },
     { label: '合格', value: '1' },
@@ -480,7 +496,7 @@ const pageChange = ({ current, size }) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    { key: 'recordNo', name: '记录编号' },
+    { key: 'recordNo', name: '记录编号', width: 190 },
     { key: 'reportNo', name: '报告编号', width: 190, autoWidth: true },
     { key: 'samplingLocation', name: '取样地点', width: 180, autoWidth: true },
     { key: 'trialProjectName', name: '试验项目名称', width: 100, autoWidth: true },
@@ -490,6 +506,8 @@ const tableColumn = ref([
     { key: 'isUploadCertificate', name: '是否上传合格证', width: 120, autoWidth: true },
     { key: 'contractId', name: '合同段', width: 140, autoWidth: true },
     { key: 'company', name: '单位', width: 160, autoWidth: true },
+    { key: 'key1', name: '委托单名称', autoWidth: true },
+    { key: 'key2', name: '委托单编号', autoWidth: true },
     { key: 'specificationNumber', name: '样品编号', width: 220, autoWidth: true },
     { key: 'specificationModel', name: '规格类型', width: 200, autoWidth: true },
     //{key:'projectPosition', name: '工程部位及用途', width: 160},
@@ -507,7 +525,7 @@ const getTableData = async () => {
     const { error, code, data } = await dataApi.queryPage({
         ...searchForm.value,
         projectId: projectId.value,
-        contractId: contractId.value,
+        //contractId: contractId.value,
     })
     //处理数据
     tableLoading.value = false