tangning 1 год назад
Родитель
Сommit
5252b2477b
1 измененных файлов с 22 добавлено и 7 удалено
  1. 22 7
      src/views/work/invoiceModal.vue

+ 22 - 7
src/views/work/invoiceModal.vue

@@ -94,7 +94,8 @@
               },
             ],
             onChange: (val) => {
-              handleUpShow(val.target.value == 1 ? true : false);
+              let { invoiceType } = getFieldsValue();
+              handleUpShow(val.target.value == 1 ? true : false, invoiceType == 1);
             },
           },
           colProps: {
@@ -117,6 +118,10 @@
                 value: 1,
               },
             ],
+            onChange: (val) => {
+              let { invoiceType } = getFieldsValue();
+              handleUpShow( true, invoiceType == 0);
+            },
           },
           colProps: {
             span: 22,
@@ -190,6 +195,7 @@
           field: 'getAddress',
           component: 'Input',
           label: '收件地址',
+          ifShow: false,
           colProps: {
             span: 18,
           },
@@ -203,6 +209,7 @@
           field: 'getAddrName',
           component: 'Input',
           label: '收件人',
+          ifShow: false,
           colProps: {
             span: 18,
           },
@@ -216,6 +223,7 @@
           field: 'getAddrPhone',
           component: 'Input',
           label: '收件人电话',
+          ifShow: false,
           colProps: {
             span: 18,
           },
@@ -252,6 +260,7 @@
         registerForm,
         {
           validate,
+          getFieldsValue,
           resetFields,
           setFieldsValue,
           removeSchemaByFiled,
@@ -289,7 +298,7 @@
         fileFlow.invoiceAmount = data.payAmount;
         fileFlow.repairId = data.repairId;
         let getData = await getInvoiceInfo({ repairId: data.repairId });
-        handleUpShow(true);
+        handleUpShow(true, getData && getData.invoiceType == 1 || false);
         setFieldsValue({
           ...data,
           ...getData,
@@ -297,7 +306,7 @@
           deviceType: t(`routes.scene.tableType.${data.cameraType}`) + ' ' + data.cameraSnCode,
         });
       }
-      const handleUpShow = async (val) => {
+      const handleUpShow = async (val, showType = false) => {
         console.log(val);
         updateSchema([
           {
@@ -305,6 +314,10 @@
             ifShow: val,
           },
           {
+            field: 'invoiceHead',
+            ifShow: val,
+          },
+          {
             field: 'companyName',
             ifShow: val,
           },
@@ -330,25 +343,27 @@
           },
           {
             field: 'invoiceEmail',
-            ifShow: val,
+            ifShow: !showType && val,
           },
           {
             field: 'getAddress',
-            ifShow: val,
+            ifShow: showType && val,
           },
           {
             field: 'getAddrName',
-            ifShow: val,
+            ifShow: showType && val,
+
           },
           {
             field: 'getAddrPhone',
-            ifShow: val,
+            ifShow: showType && val,
           },
         ]);
       };
       const handleSubmit = async () => {
         const params = await validate();
         if (params.defineDamage == 0) {
+          // await invoiceRegister( params );
           return closeModal();
         }
         try {