Explorar el Código

基础信息修改

duy hace 3 meses
padre
commit
f91e8e2a6c

+ 15 - 14
src/views/tentative/detect/components/basicInfo.vue

@@ -103,33 +103,33 @@
                 </div>
 
                 <div class="form-box">
-                    <el-form :model="basicInfoData.trialSampleInfoList" label-width="auto">
+                    <el-form :model="basicInfoData.trialSampleInfo" label-width="auto">
                         <el-row :gutter="20">
                             <el-col :span="12">
                                 <el-form-item label="样品名称">
-                                    <el-input v-model="basicInfoData.trialSampleInfoList.materialName" />
+                                    <el-input v-model="basicInfoData.trialSampleInfo.materialName" />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="12">
                                 <el-form-item label="样品编号">
-                                    <el-input v-model="basicInfoData.trialSampleInfoList.specificationNumber" />
+                                    <el-input v-model="basicInfoData.trialSampleInfo.specificationNumber" />
                                 </el-form-item>
                             </el-col>
                         </el-row>
                         <el-row :gutter="20">
                             <el-col :span="8">
                                 <el-form-item label="样品描述">
-                                    <el-input v-model="basicInfoData.trialSampleInfoList.sampleDescription" />
+                                    <el-input v-model="basicInfoData.trialSampleInfo.sampleDescription" />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="8">
                                 <el-form-item label="来样/取样时间">
-                                    <el-input v-model="basicInfoData.trialSampleInfoList.samplingDate" />
+                                    <el-input v-model="basicInfoData.trialSampleInfo.samplingDate" />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="8">
                                 <el-form-item label="样品数量">
-                                    <el-input v-model="basicInfoData.trialSampleInfoList.materialCount" />
+                                    <el-input v-model="basicInfoData.trialSampleInfo.materialCount" />
                                 </el-form-item>
                             </el-col>
                         </el-row>
@@ -218,7 +218,7 @@ import dataApi from '~api/tentative/detect/test'
 import LinkAssociation from '../../detect/components/linkAssociation.vue'
 import LinkAcquisition from '../../detect/components/linkAcquisition.vue'
 import codeApi from '~api/basic/code'
-import { arrToId, arrToKey, formValidate, getArrValue, getObjVal, getObjValue, isNullES, isString } from 'js-fast-way'
+import { getArrValue, getObjValue } from 'js-fast-way'
 const props = defineProps({
      nodeId:{
         type: [String, Number],
@@ -323,7 +323,7 @@ watch(isShow, (newVal) => {
     }
 })
 const basicInfoData = ref({
-    trialSampleInfoList:{
+    trialSampleInfo:{
         materialName:'',
                 specificationNumber:'',
                 sampleDescription:'',
@@ -356,9 +356,9 @@ infoLoad.value = false
    
 
 
-        const { trialSampleInfoList, trailDeviceUseInfoDTOS } = basicInfoData.value
-        if (!trialSampleInfoList) {
-            basicInfoData.value.trialSampleInfoList = {
+        const { trialSampleInfo, trailDeviceUseInfoDTOS } = basicInfoData.value
+        if (!trialSampleInfo) {
+            basicInfoData.value.trialSampleInfo = {
                 materialName:'',
                 specificationNumber:'',
                 sampleDescription:'',
@@ -463,7 +463,7 @@ const linksSampleModalSave = () => {
     linksSampleModal.value = false
     console.log(tableSampleCheckedKeys.value, 'tableSampleCheckedKeys.value')
     if (tableSampleCheckedKeys.value.length > 0) {
-      basicInfoData.value.trialSampleInfoList = tableSampleCheckedKeys.value[0]
+      basicInfoData.value.trialSampleInfo = tableSampleCheckedKeys.value[0]
         basicInfoData.value.sampleIds = tableSampleCheckedKeys.value[0].id
 
 
@@ -557,7 +557,7 @@ const handleSave = async () => {
     basicInfoData.value.oldReportNumber = oldReportNumber.value
     basicInfoData.value.type = type.value
 
-    // emit('change', basicInfoData.value)
+  
     handleSaveLoad.value = true
           const { error, code, data, msg } = await codeApi.saveBaseInfo({
                     ...basicInfoData.value,
@@ -567,7 +567,8 @@ const handleSave = async () => {
             if (!error && code === 200) {
                 window.$message.success(msg)
                 isShow.value = false
-
+                dataId.value = data
+                emit('change', dataId.value)
               
             }
 }

+ 8 - 4
src/views/tentative/detect/test-form.vue

@@ -217,7 +217,7 @@
 </template>
 
 <script setup>
-import { nextTick, onMounted, ref, watch } from 'vue'
+import { nextTick, onActivated, onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import { useRoute, useRouter } from 'vue-router'
 import ListItem from './components/ListItem.vue'
@@ -264,7 +264,11 @@ const testTreeItem = ref(getStoreValue('testTreeItem'))
 const isMixRatioTestIds = ref(false)
 const tabTypeKey = ref('')
 const isopersampleIds = ref(false)
-
+onActivated(()=>{
+    if (!dataId) {
+        isShowBasic.value = true
+    }
+})
 //渲染完成
 onMounted(() => {
     tabTypeKey.value = routerQuery?.tabTypeKey || '1'
@@ -1600,8 +1604,8 @@ const basicInfoData = ref({})
 const basicInfoChange = (val) => {
    console.log(val, 'val')
    tableFormSaveClick(true)
-   basicInfoData.value = val
-
+//    basicInfoData.value = val
+    nodeIdvalue.value = val
    
 }
 </script>