ZaiZai 1 年之前
父節點
當前提交
3c8d6883a2

+ 2 - 2
src/api/modules/tentative/material/testSample.js

@@ -28,8 +28,8 @@ export default {
     //详情
     async detail(id, msg = true) {
         return HcApi({
-            url: '/api/blade-business/detection/self/detail',
-            method: 'get',
+            url: '/api/blade-business/detection/self/trialSelfInById',
+            method: 'post',
             params: { id },
         }, msg)
     },

+ 2 - 0
src/views/tentative/detect/commission.vue

@@ -454,6 +454,8 @@ const rowActionSave = async () => {
     const { contractType } = contractInfo.value
     const { id, expCount } = formModel.value
     const { primaryKeyId } = nodeDataInfo.value
+    setStoreValue('testTreeItem', nodeDataInfo.value)
+    setStoreValue('prenodeDataInfo', nodeDataInfo.value)
     const { error, code, msg } = await mainApi.update({ id, expCount })
     if (!error && code === 200) {
         window.$message.success('创建成功')

+ 3 - 0
src/views/tentative/material/modules/testSample/inventory.vue

@@ -89,6 +89,7 @@ import router from '~src/router/index'
 import { getErtractInfo } from '~api/other'
 import { formValidate, getArrValue, getObjValue, isNullES } from 'js-fast-way'
 import mainApi from '~api/tentative/material/testSample'
+import { setStoreValue } from '~uti/storage'
 
 //参数
 const props = defineProps({
@@ -256,6 +257,8 @@ const rowActionSave = async () => {
         rowActionModalClose()
         //跳转到试验填报的新增
         if (title === '创建报告') {
+            setStoreValue('testTreeItem', treeInfo.value)
+            setStoreValue('prenodeDataInfo', treeInfo.value)
             const { contractType } = contractInfo.value
             const { primaryKeyId } = treeInfo.value
             router.push({

+ 19 - 17
src/views/tentative/material/modules/testSample/testUnder.vue

@@ -299,22 +299,24 @@ const sampleRemoveApi = async (ids) => {
 
 //填写报告
 const fillReportClick = async ({ id, testId }) => {
-    //const { contractType } = contractInfo.value
-    //const { primaryKeyId } = treeInfo.value
-    await mainApi.detail(testId)
-
-    /*setStoreValue('test-form', row)
-    setStoreValue('testTreeItem', treeInfo.value)
-    setStoreValue('prenodeDataInfo', treeInfo.value)*/
-    /*router.push({
-        path: '/tentative/detect/test-form',
-        query: {
-            id: testId,
-            nodeId: nodeId,
-            dataType: type,
-            commissionId: id,
-            tabTypeKey: 1
-        },
-    })*/
+    const { error, code, data, msg } = await mainApi.detail(testId)
+    if (!error && code === 200) {
+        const res = getObjValue(data)
+        setStoreValue('test-form', res)
+        setStoreValue('testTreeItem', treeInfo.value)
+        setStoreValue('prenodeDataInfo', treeInfo.value)
+        router.push({
+            path: '/tentative/detect/test-form',
+            query: {
+                id: testId,
+                nodeId: res.nodeId,
+                dataType: res.type,
+                commissionId: id,
+                tabTypeKey: 1,
+            },
+        }).then()
+    } else {
+        window.$message.error(msg || '操作失败')
+    }
 }
 </script>

+ 3 - 0
src/views/tentative/material/modules/testSample/tested.vue

@@ -88,6 +88,7 @@ import { getErtractInfo } from '~api/other'
 import { HcDelMsg } from 'hc-vue3-ui'
 import { arrToId, formValidate, getArrValue, getObjValue, isNullES } from 'js-fast-way'
 import mainApi from '~api/tentative/material/testSample'
+import { setStoreValue } from '~uti/storage'
 
 //参数
 const props = defineProps({
@@ -224,6 +225,8 @@ const rowActionSave = async () => {
         rowActionModalClose()
         getTableData().then()
         //跳转到试验填报的新增
+        setStoreValue('testTreeItem', treeInfo.value)
+        setStoreValue('prenodeDataInfo', treeInfo.value)
         const { contractType } = contractInfo.value
         const { primaryKeyId } = treeInfo.value
         router.push({