소스 검색

测试表单内容提交

ZaiZai 2 년 전
부모
커밋
d07b3af422
3개의 변경된 파일11개의 추가작업 그리고 15개의 파일을 삭제
  1. 2 2
      src/components/table-form/index.vue
  2. 2 4
      src/views/data-fill/collapse-form/index.vue
  3. 7 9
      src/views/data-fill/wbs.vue

+ 2 - 2
src/components/table-form/index.vue

@@ -344,12 +344,12 @@ const setTableFormInfoValue = async (key, value) => {
 
 //获取表单数据
 const getFormData = () => {
-    return excelForm.value
+    return deepClone(excelForm.value)
 }
 
 //设置表单数据
 const setFormData = (data) => {
-    excelForm.value = data
+    excelForm.value = deepClone(data)
 }
 
 //获取表单效验数据

+ 2 - 4
src/views/data-fill/collapse-form/index.vue

@@ -1169,7 +1169,6 @@ const setMountKey_down_up = () => {
     //全局按键按下监听
     document.onkeydown = async (event) => {
         const pkeyId = presentId.value
-        console.log('按下' + event.key + '键')
         if (!isValueNull(pkeyId)) {
             const {key, ctrlKey} = event
             //按下ctrl键
@@ -1225,10 +1224,9 @@ const getFormData = async () => {
         const pkeyId = formArr[i].pkeyId
         const refs = await getFormRef(pkeyId)
         const form = refs?.getFormData()
-        newArr.push({
-            ...form
-        })
+        newArr.push({...form})
     }
+    console.log('表单数据', newArr)
     return newArr
 }
 

+ 7 - 9
src/views/data-fill/wbs.vue

@@ -1321,12 +1321,12 @@ const copyNodeClick = async () => {
         classify = arr.join(',')
     }
     //isSameNode 是否同节点 1=同节点,0=跨节点
-    if(table.length>0){
-        table.forEach((ele)=>{
-            if(ele.primaryKeyId===formCopyNodeModel.value.primaryKeyId){
-               ele.isSameNode =1 
-            }else{
-                ele.isSameNode =0
+    if (table.length > 0) {
+        table.forEach((ele) => {
+            if (ele.primaryKeyId === formCopyNodeModel.value.primaryKeyId) {
+                ele.isSameNode = 1
+            } else {
+                ele.isSameNode = 0
             }
         })
     }
@@ -1699,7 +1699,7 @@ const tableFormSaveClick = async () => {
         setFormRegExpJson(FormRegExpJson)
     } else if (FormData.length > 0) {
         tableFormSaveLoading.value = true
-        console.log(FormData, 'FormData')
+        console.log('FormData', FormData)
         const {error, code} = await wbsApi.saveExcelBussData({
             dataInfo: {orderList: FormData}
         })
@@ -1710,7 +1710,6 @@ const tableFormSaveClick = async () => {
             getTableDataAll()
         }
     } else {
-        //http://testcandao.hcxxy.com/bug-view-819.html
         await bussPdfsClick()
     }
 }
@@ -1753,7 +1752,6 @@ const setFormRegExpJson = (FormRegExpJson) => {
 const bussPdfsLoading = ref(false)
 const bussPdfsClick = async () => {
     const info = nodeDataInfo.value;
-    console.log(info, 'info')
     bussPdfsLoading.value = true
     const {error, code, data} = await wbsApi.getBussPdfs({
         nodeId: info?.primaryKeyId || '',