瀏覽代碼

基础信息保存修改

duy 3 月之前
父節點
當前提交
65ebe3cc37
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7 4
      src/views/tentative/detect/components/basicInfo.vue

+ 7 - 4
src/views/tentative/detect/components/basicInfo.vue

@@ -262,7 +262,7 @@ const isShow = defineModel('modelValue', {
     default: false,
 })
 const standardId = ref('')
-const ypList = ref(null) // 确保 ypList 已定义
+const ypList = ref([]) // 确保 ypList 已定义
 const ypLoad = ref(false)
 const getYpList = async (id)=>{
         ypLoad.value = true
@@ -322,6 +322,8 @@ const basicInfoData = ref({
                 samplingDate:'',
     },
 })
+const oldRecordNumber = ref('')
+const oldReportNumber = ref('')
 const infoLoad = ref(false)
 const getInfoData = async () => {
 infoLoad.value = true
@@ -531,10 +533,11 @@ const linkAcquisitionChange = (ids, rows) => {
 //保存
 const handleSaveLoad = ref(false)
 const handleSave = async () => {
-  const standardInfoIds = ypList.value
-        .filter(item => item.value != null && item.value !== '')
+  const standardInfoIds = ypList.value.length > 0
+
+        ? ypList.value.filter(item => item.value != null && item.value !== '')
         .map(item => item.value)
-        .join(',')
+        .join(',') : []
 
     basicInfoData.value.standardInfoIds = standardInfoIds
     emit('change', basicInfoData.value)