Jelajahi Sumber

试验接口

iZaiZaiA 2 tahun lalu
induk
melakukan
c030c907ad

+ 8 - 0
src/api/modules/tentative/detect/test.js

@@ -113,6 +113,14 @@ export default {
             params: form
         }, msg);
     },
+    //自检删除复制的表
+    async removeBussTabInfo(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-business/detection/self/remove-buss-tabInfo',
+            method: 'post',
+            params: form
+        }, msg);
+    },
     //保存表单
     async saveExcelBussData(form, msg = true) {
         return httpApi({

+ 104 - 78
src/views/tentative/detect/components/ListItem.vue

@@ -88,31 +88,6 @@
         <HcUpload :fileList="fileListData" :datas="uploadData" @change='uploadChange'/>
     </HcDialog>
 
-    <!--插入设计值/频率-->
-    <HcDialog :show="IDVFModal" title="插入设计值/频率" widths="600px" saveText="确认插入" @close="IDVFModal = false" @save="IDVFModalSaveClick">
-        <el-alert title="填写完设计值和频率,系统自动计算实测值" type="warning" :closable="false"/>
-        <el-form ref="formIDVFRef" :model="formIDVFModel" label-width="auto" size="large">
-            <div class="form-item-div text-center mb-3">
-                <el-radio-group size="large" v-model="formIDVFModel.type">
-                    <el-radio :label="1">公路工程</el-radio>
-                    <el-radio :label="2" class="ml-4">水利水电</el-radio>
-                </el-radio-group>
-            </div>
-            <el-form-item label="设计值">
-                <el-input v-model="formIDVFModel.design" placeholder="请输入设计值"/>
-            </el-form-item>
-            <el-form-item label="频率" v-if="formIDVFModel.type === 1">
-                <el-input v-model="formIDVFModel.size" placeholder="请输入频率"/>
-            </el-form-item>
-            <el-form-item label="容量" v-if="formIDVFModel.type === 2">
-                <el-input v-model="formIDVFModel.capacity" placeholder="请输入容量"/>
-            </el-form-item>
-            <el-form-item label="合格点数">
-                <el-input v-model="formIDVFModel.fail" placeholder="请填写合格点数(不填写则默认全部合格)"/>
-            </el-form-item>
-        </el-form>
-    </HcDialog>
-
     <!--插入特殊字符-->
     <HcDialog :show="specialModal" title="插入特殊字符" widths="600px" saveText="确认插入" @close="specialModal = false" @save="specialNodeClick">
         <el-form ref="specialFormRef" :model="specialFormModel" :rules="specialFormRules" label-width="0px" size="large" class="mb-6">
@@ -129,10 +104,16 @@
         </el-row>
     </HcDialog>
 
-    <!--关联试验数据-->
-    <HcDialog :show="CTDModal" title="关联试验数据" widths="850px" saveText="确认关联" @close="CTDModal = false" @save="CTDModal = false">
-        开发中...
+    <!--引用容器参数-->
+    <HcDialog :show="vesselModal" title="引用容器参数" widths="700px" saveText="确认引用" isTable @close="vesselModalClose" @save="vesselModalSave">
+        <HcTable ref="vesselTableRef" :column="vesselTableColumn" :datas="vesselTableData" :loading="vesselTableLoading" isCheck @selection-change="vesselTableSelection"/>
     </HcDialog>
+
+    <!--引用设备仪器-->
+    <HcDialog :show="deviceModal" title="引用设备仪器" widths="850px" saveText="确认引用" isTable @close="deviceModalClose" @save="deviceModalSave">
+        <HcTable ref="deviceTableRef" :column="deviceTableColumn" :datas="deviceTableData" :loading="deviceTableLoading" isCheck @selection-change="deviceTableSelection"/>
+    </HcDialog>
+
 </template>
 
 <script setup>
@@ -247,7 +228,9 @@ const formRegExpJson = ref({})
 const getExcelHtml = async (item,index) => {
     const pkeyIds = getValString(item.pKeyId)
     if (pkeyIds) {
+        const { id } = baseData.value
         const {error, code, data} = await dataApi.getExcelHtml({
+            id: id,
             primaryKeyId: pkeyIds
         }, false)
         const resData = isString(data) ? data || '' : ''
@@ -306,7 +289,9 @@ const setTableFormBlurReg = (pkeyId, event, key, reg, val, msg, item, index) =>
 const getBussDataInfo = async (item, index) => {
     const pkeyIds = getValString(item.pKeyId)
     if (pkeyIds) {
+        const { id } = baseData.value
         const {error, code, data} = await dataApi.getBussDataInfo({
+            id: id,
             pkeyId: pkeyIds
         }, false)
         const resData = getObjNullValue(data)
@@ -371,7 +356,9 @@ const saveExcelBussData = async (item, index, showTip = true) => {
 const getBussPdfInfo = async ({pKeyId}, showTip = true) => {
     const pkeyIds = getValString(pKeyId)
     if (pkeyIds) {
+        const { id } = baseData.value
         const {error, code, data} = await dataApi.getBussPdf({
+            id: id,
             pKeyId: pkeyIds
         },false)
         if (!error && code === 200) {
@@ -391,20 +378,17 @@ const getBussPdfInfo = async ({pKeyId}, showTip = true) => {
 }
 
 //删除本表
-const delClick = async (item) => {
-    const pkeyIds = item.pKeyId ? item.pKeyId + '' : ''
+const delClick = async ({pKeyId}) => {
+    const pkeyIds = getValString(pKeyId)
     if (pkeyIds) {
-        if (isStatus.value !== '3') {
-            const {error, code} = await wbsApi.removeBussTabInfo({
-                pkeyid: pkeyIds,
-                classify: classify.value,
-            })
-            if (!error && code === 200) {
-                window?.$message?.success('操作成功')
-                renewData()
-            }
-        } else {
-            window?.$message?.warning('已上报的资料,不允许删除')
+        const { id } = baseData.value
+        const {error, code} = await dataApi.removeBussTabInfo({
+            id: id,
+            pKeyId: pkeyIds
+        })
+        if (!error && code === 200) {
+            window?.$message?.success('操作成功')
+            renewData()
         }
     } else {
         window?.$message?.warning('pkeyId为空')
@@ -439,7 +423,9 @@ const copyClick = async (item,index) => {
 }
 
 const copeBussTab = async (pkeyIds) => {
+    const { id } = baseData.value
     const {error, code} = await dataApi.copyBussTab({
+        id: id,
         pKeyId: pkeyIds
     })
     if (!error && code === 200) {
@@ -453,8 +439,10 @@ const hideClick = async ({pKeyId, isBussShow}) => {
     const pkeyIds = getValString(pKeyId)
     if (pkeyIds) {
         if (isStatus.value !== '3') {
+            const { id } = baseData.value
             const isBussShows = isBussShow === 2 ? 1 : 2 //状态(1显示 2隐藏)
             const {error, code} = await dataApi.showBussTab({
+                id: id,
                 pKeyId: pkeyIds,
                 status: isBussShows
             })
@@ -530,9 +518,9 @@ const tableFormItemNode = ref({})
 
 //菜单数据
 const tableFormMenu = ref([
-    {label: '插入设计值/频率', key: "IDVF"},
+    {label: '容器参数', key: "vessel"},
+    {label: '引用设备仪器', key: "device"},
     {label: '插入特殊字符', key: "special"},
-    {label: '关联试验数据', key: "CTD"},
 ])
 
 //鼠标右键事件
@@ -549,19 +537,84 @@ const onRightClick = (event, KeyName, index) => {
 
 //鼠标右键菜单被点击
 const handleMenuSelect = ({key}) => {
-    if (key === 'IDVF') {
-        IDVFModal.value = true
+    if (key === 'vessel') {
+        vesselModal.value = true
+        getVesselTableData()
     } else if (key === 'special') {
         specialModalShow()
-    } else if (key === 'CTD') {
-        CTDModal.value = true
+    } else if (key === 'device') {
+        deviceModal.value = true
+        getDeviceTableData()
     }
 }
 
-//插入设计值
-const IDVFModal = ref(false)
-const formIDVFRef = ref(null)
-const formIDVFModel = ref({type: 1, design: '', size: '', dev: '', key: '', capacity: '', fail: '', pkId: ''})
+//引用容器参数
+const vesselModal = ref(false)
+const vesselTableRef = ref(null)
+
+//表格数据
+const vesselTableColumn = ref([
+    {key:'key1', name: '容器编号'},
+])
+const vesselTableData = ref([])
+
+//获取表格数据
+const vesselTableLoading = ref(false)
+const getVesselTableData = () => {
+
+}
+
+//多选
+const vesselTableKeys = ref([]);
+const vesselTableSelection = (rows) => {
+    vesselTableKeys.value = rows
+}
+
+//确认引用
+const vesselModalSave = () => {
+    vesselModal.value = false
+}
+//关闭
+const vesselModalClose = () => {
+    vesselModal.value = false
+}
+
+
+
+//引用设备仪器
+const deviceModal = ref(false)
+const deviceTableRef = ref(null)
+
+//表格数据
+const deviceTableColumn = ref([
+    {key:'key1', name: '设备编号'},
+    {key:'key2', name: '设备仪器名称'},
+])
+const deviceTableData = ref([])
+
+//获取表格数据
+const deviceTableLoading = ref(false)
+const getDeviceTableData = () => {
+
+}
+
+//多选
+const deviceTableKeys = ref([]);
+const deviceTableSelection = (rows) => {
+    deviceTableKeys.value = rows
+}
+
+//确认引用
+const deviceModalSave = () => {
+    deviceModal.value = false
+}
+//关闭
+const deviceModalClose = () => {
+    deviceModal.value = false
+}
+
+
+
 
 //插入特殊字符
 const specialModal = ref(false)
@@ -630,33 +683,6 @@ const specialNodeClick = async () => {
     }
 }
 
-//关联试验数据
-const CTDModal = ref(false)
-
-//设计值频率计算
-const IDVFModalSaveClick = async () => {
-    const {pkeyId, KeyName, index} = tableFormItemNode.value
-    if (pkeyId) {
-        const { design, size } = formIDVFModel.value
-        const { error, code, data } = await wbsApi.queryFormulaRange({
-            ...formIDVFModel.value,
-            dev: (!design && !size) ? '±5': '',
-            key: KeyName,
-            pkId: pkeyId
-        })
-        //处理数据
-        const res = getObjNullValue(data)
-        if (!error && code === 200 && res) {
-            Object.keys(data).forEach(key => {
-                formData.value[index][key] = data[key]
-            })
-            IDVFModal.value = false
-        }
-    } else {
-        window?.$message?.warning('pkeyId为空')
-    }
-}
-
 //事件
 const emit = defineEmits(['renew','offsetTop'])
 

+ 5 - 6
src/views/tentative/detect/test-form.vue

@@ -80,7 +80,7 @@
                 </div>
                 <div class="hc-tree-scrollbar" v-loading="linksRelateTreeLoading" element-loading-text="获取数据中...">
                     <el-scrollbar>
-                        <TestTree :projectId="projectId" :contractId="contractId"/>
+                        
                     </el-scrollbar>
                 </div>
             </div>
@@ -203,7 +203,7 @@ const getCategoryData = async () => {
 const ListItemRef = ref(null);
 const listItemBaseData = ref({
     sampleIds: '', contractId: null, nodeId: nodeId, trialProjectName: null, type: dataType, tableType: '1',
-    detectionCategory: '', detection_result: '', reportDate: '', trialUserName: '',
+    detectionCategory: '', detection_result: '', reportDate: '', trialUserName: '', id: dataId,
 })
 
 //获取数据
@@ -212,6 +212,7 @@ const listItemData = ref([])
 const getSearchNodeTables = async () => {
     isLoading.value = true
     const { error, code, data } = await dataApi.searchNodeTables({
+        id: dataId,
         projectId: projectId.value,
         contractId: contractId.value,
         primaryKeyId: nodeId,
@@ -244,7 +245,6 @@ const ListItemOffsetTop = (offsetTop) => {
     }
 }
 
-
 //关联工程用途及部位 树
 const linksRelateModal = ref(false)
 const linksRelateModalClick = () => {
@@ -435,11 +435,10 @@ const setFormRegExpJson = (FormRegExpJson) => {
     })
 }
 
-
 //上报数据
 const reportLoading = ref(false)
 const reportModalClick = async () => {
-
+    window.$message?.warning('暂无接口')
 }
 
 //多表预览
@@ -463,7 +462,7 @@ const bussPdfsClick = async () => {
 
 //撤回上报流程
 const abolishOneClick = () => {
-
+    window.$message?.warning('暂无接口')
 }
 
 //返回