Browse Source

JLHWEB: 1、多区时候的排列,或1/3/5/7区自动跟随1区的排列,2/4/6区自动跟随2区弹簧

JohnnyChan 1 day ago
parent
commit
111b97e8ba
1 changed files with 22 additions and 7 deletions
  1. 22 7
      JLHWEB/src/views/quote/bednetQuote/hooks/index.tsx

+ 22 - 7
JLHWEB/src/views/quote/bednetQuote/hooks/index.tsx

@@ -168,7 +168,6 @@ export const useHooks = (t?: any, props?: any) => {
    * @description 填充明细弹簧
    */
   const rModelSetMxSpring = (data: any, item: any) => {
-    console.log("rModelSetSpring data, item :>> ", data, item);
     if (item) {
       data.springid = item.springid;
       data.springname = item.springname;
@@ -181,10 +180,25 @@ export const useHooks = (t?: any, props?: any) => {
    * @description 填充海绵
    */
   const rModelSetSpring = (data: any, item: any) => {
-    console.log("rModelSetSpring data, item :>> ", data, item);
     if (item) {
-      data.springid = item.springid;
-      data.springname = item.springname;
+      data.row.springid = item.springid;
+      data.row.springname = item.springname;
+    }
+
+    if (data.rowIndex == 0) {
+      data.visibleData.forEach((o, i) => {
+        if (i % 2 == 0 && i > 0) {
+          o.springid = item.springid;
+          o.springname = item.springname;
+        }
+      });
+    } else if (data.rowIndex == 1) {
+      data.visibleData.forEach((o, i) => {
+        if (i % 2 == 1 && i > 1) {
+          o.springid = item.springid;
+          o.springname = item.springname;
+        }
+      });
     }
   };
 
@@ -1674,6 +1688,7 @@ export const useHooks = (t?: any, props?: any) => {
                 // console.log("lengthVal :>> ", lengthVal);
 
                 let _data = {
+                  pid: springData.length + i + 1,
                   ...dw_bednet_mx_spring,
                   spring_qty_width: Number(state.bednetMxData[0].spring_qty_width),
                   spring_qty_length: 0
@@ -2076,7 +2091,7 @@ export const useHooks = (t?: any, props?: any) => {
       editRender: {},
       editColRender: (scope: any) => {
         console.log("springname editColRender scope :>> ", scope);
-        const { column, row, status } = scope;
+        const { column, row, status, rowIndex } = scope;
         let _label = column.title;
         let { fullData: mxlist } = state.vxeTableMxRef.element.getTableData();
 
@@ -2089,12 +2104,12 @@ export const useHooks = (t?: any, props?: any) => {
               placeholder={_label}
               onOpenModal={() =>
                 fModelChoseSpring(
-                  scope.row,
+                  scope,
                   { arg_height: mxlist[0]?.bednet_height, arg_bednettypeid: state.LjDetailRef._mainData.bednettypeid },
                   rModelSetSpring
                 )
               }
-              onSelect={(val: any) => rModelSetSpring(scope.row, val)}
+              onSelect={(val: any) => rModelSetSpring(scope, val)}
               onClear={() => rModelClearSpring(scope.row)}
             >
               {{