Browse Source

自定义表头

jbb 2 years ago
parent
commit
e7f06f1725

+ 5 - 0
public/index.html

@@ -236,6 +236,11 @@
       ::-webkit-scrollbar-corner {
         background: #f6f6f6;
       }
+      .form-table-heard:before {
+      content: '*';
+      color: red;
+    }
+
     </style>
     <!-- 全局配置 -->
     <!-- <script src="<%= BASE_URL %>static/config.js"></script>  odd -->

+ 38 - 8
src/views/advance-packingList/addAdpackingDrawer.vue

@@ -151,6 +151,29 @@
               :scroll="{ x: 1500,y: 350 }"
               @change="handleTableChange"
             >
+            <!-- 自定义表头 -->
+            <span slot="startingBoxNumberTitle" class="form-table-heard">
+             起始箱号
+            </span>
+            <span slot="endCaseNumberTitle" class="form-table-heard">
+             结束箱号
+            </span>
+            <span slot="netWeightTitle" class="form-table-heard">
+             净重/箱
+            </span>
+            <span slot="grossWeightTitle" class="form-table-heard">
+             毛重/箱
+            </span>
+            <span slot="outerBoxLengthTitle" class="form-table-heard">
+             外箱长度
+            </span>
+            <span slot="outerBoxWidthTitle" class="form-table-heard">
+             外箱宽度
+            </span>
+            <span slot="outerBoxHeightTitle" class="form-table-heard">
+             外箱高度
+            </span>
+
              <!-- itemCode -->
              <template slot="itemCode" slot-scope="text, record, index">
                 <a-form-model-item prop="itemCode" :rules="rules.itemCode">
@@ -423,20 +446,22 @@ export default {
         },
 
         {
-          title: '起始箱号',
+          // title: '起始箱号',
           dataIndex: 'startingBoxNumber',
           width: 120,
           className: 'replacecolor',
           scopedSlots: { customRender: 'startingBoxNumber' },
+          slots:{title:'startingBoxNumberTitle'}
 
         },
 
         {
-          title: '结束箱号',
+          // title: '结束箱号',
           dataIndex: 'endCaseNumber',
           width: 140,
           className: 'replacecolor',
           scopedSlots: { customRender: 'endCaseNumber' },
+          slots:{title:'endCaseNumberTitle'}
 
         },
 
@@ -485,11 +510,12 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '净重/箱',
+          // title: '净重/箱',
           dataIndex: 'netWeight',
-          width: 90,
+          width: 120,
           className: 'replacecolor',
           scopedSlots: { customRender: 'netWeight' },
+          slots:{title:'netWeightTitle'}
         },
         {
           title: '总净重',
@@ -499,11 +525,12 @@ export default {
         },
 
         {
-          title: '毛重/箱',
+          // title: '毛重/箱',
           dataIndex: 'grossWeight',
           width: 120,
           className: 'replacecolor',
           scopedSlots: { customRender: 'grossWeight' },
+          slots:{title:'grossWeightTitle'}
         },
         {
           title: '总毛重',
@@ -512,26 +539,29 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '外箱长度',
+          // title: '外箱长度',
           dataIndex: 'outerBoxLength',
           width: 120,
           className: 'replacecolor',
           scopedSlots: { customRender: 'outerBoxLength' },
+          slots:{title:'outerBoxLengthTitle'}
         },
 
         {
-          title: '外箱宽度',
+          // title: '外箱宽度',
           dataIndex: 'outerBoxWidth',
           width: 140,
           className: 'replacecolor',
           scopedSlots: { customRender: 'outerBoxWidth' },
+          slots:{title:'outerBoxWidthTitle'}
         },
         {
-          title: '外箱高度',
+          // title: '外箱高度',
           dataIndex: 'outerBoxHeight',
           className: 'replacecolor',
           width: 140,
           scopedSlots: { customRender: 'outerBoxHeight' },
+          slots:{title:'outerBoxHeightTitle'}
         },
 
         {

+ 7 - 2
src/views/book/addBookDrawer.vue

@@ -255,6 +255,10 @@
               :scroll="{ x: 1500,y: 350 }"
               @change="handleTableChange"
             >
+             <!-- 自定义表头 -->
+            <span slot="containerNumberTitle" class="form-table-heard">
+             集装箱号
+            </span>
               <!-- 集装箱代号 输入框 -->
               <template slot="containerCode" slot-scope="text, record, index">
                 <a-form-model-item prop="containerCode" :rules="rules.containerCode" >
@@ -265,7 +269,7 @@
               <!-- 集装箱号 输入框-->
               <template slot="containerNumber" slot-scope="text, record, index">
                 <a-form-model-item prop="containerNumber" :rules="rules.containerNumber">
-                  <a-input style="border-color: red;width:100%" type="text" v-model="record.containerNumber" @blur="changeContainerNumber" />
+                  <a-input style="width:100%" type="text" v-model="record.containerNumber" @blur="changeContainerNumber" />
                 </a-form-model-item>
               </template>
 
@@ -462,10 +466,11 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '集装箱号',
+          // title: '集装箱号',
           dataIndex: 'containerNumber',
           ellipsis: true,
           scopedSlots: { customRender: 'containerNumber' },
+          slots:{title:'containerNumberTitle'},
           width: 120,
           // fixed: 'left',
           className: 'replacecolor'

+ 73 - 62
src/views/packing-list/packinglist-clothes/clothesAddDrawer.vue

@@ -159,6 +159,34 @@
               :scroll="{ x: 1500,y: 350 }"
               @change="handleTableChange"
             >
+             <!-- 自定义表头 -->
+            <span slot="startingBoxNumberTitle" class="form-table-heard">
+             起始箱号
+            </span>
+            <span slot="endCaseNumberTitle" class="form-table-heard">
+             结束箱号
+            </span>
+            <span slot="netWeightTitle" class="form-table-heard">
+             净重/箱
+            </span>
+            <span slot="grossWeightTitle" class="form-table-heard">
+             毛重/箱
+            </span>
+            <span slot="outerBoxLengthTitle" class="form-table-heard">
+             外箱长度
+            </span>
+            <span slot="outerBoxWidthTitle" class="form-table-heard">
+             外箱宽度
+            </span>
+            <span slot="outerBoxHeightTitle" class="form-table-heard">
+             外箱高度
+            </span>
+            <span slot="boxNumberTitle" class="form-table-heard">
+             箱数
+            </span>
+            <span slot="netWeightTooTitle" class="form-table-heard">
+             净净重
+            </span>
              <!-- prepackSku  -->
              <template slot="prepackSku" slot-scope="text, record, index">
                 <a-form-model-item prop="prepackSku" :rules="rules.prepackSku">
@@ -403,19 +431,21 @@ export default {
           insertAfter:true,
         },
         {
-          title: '启始箱号',
+          // title: '起始箱号',
           dataIndex: 'startingBoxNumber',
           className: 'replacecolor',
-          scopedSlots: { customRender: 'startingBoxNumber' }  ,        
+          scopedSlots: { customRender: 'startingBoxNumber' }  ,    
+          slots:{title:'startingBoxNumberTitle'} ,   
           width: 120,
         },
 
         {
-          title: '结束箱号',
+          // title: '结束箱号',
           dataIndex: 'endCaseNumber',
           width: 120,
            className: 'replacecolor',
-           scopedSlots: { customRender: 'endCaseNumber' }  ,   
+           scopedSlots: { customRender: 'endCaseNumber' }  ,
+          slots:{title:'endCaseNumberTitle'}
         },
 
         {
@@ -437,11 +467,12 @@ export default {
           type: JVXETypes.normal 
         },
         {
-          title: '箱数',
+          // title: '箱数',
           dataIndex: 'boxNumber',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'boxNumber' }  , 
+           slots:{title:'boxNumberTitle'}
         },
         {
           title: '计划尺码数量',
@@ -462,11 +493,12 @@ export default {
            className: 'replacecolor'
         },
         {
-          title: '净重/箱',
+          // title: '净重/箱',
           dataIndex: 'netWeight',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'netWeight' }  , 
+           slots:{title:'netWeightTitle'}
         },
         {
           title: '总净重',
@@ -475,11 +507,12 @@ export default {
            className: 'replacecolor'
         },
         {
-          title: '毛重/箱',
+          // title: '毛重/箱',
           dataIndex: 'grossWeight',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'grossWeight' }  , 
+           slots:{title:'grossWeightTitle'}
         },
         {
           title: '总毛重',
@@ -488,25 +521,28 @@ export default {
            className: 'replacecolor'
         },
         {
-          title: '外箱长度',
+          // title: '外箱长度',
           dataIndex: 'outerBoxLength',
           width: 120,
           className: 'replacecolor',
           scopedSlots: { customRender: 'outerBoxLength' }  , 
+          slots:{title:'outerBoxWidthTitle'}
         },
         {
-          title: '外箱宽度',
+          // title: '外箱宽度',
           dataIndex: 'outerBoxWidth',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'outerBoxWidth' }  , 
+           slots:{title:'outerBoxWidthTitle'}
         },
         {
-          title: '外箱高度',
+          // title: '外箱高度',
           dataIndex: 'outerBoxHeight',
           width: 120,
            className: 'replacecolor',
-           scopedSlots: { customRender: 'outerBoxHeight' }  , 
+           scopedSlots: { customRender: 'outerBoxHeight' }  ,
+           slots:{title:'outerBoxWidthTitle'} 
         },
         {
           title: '总体积',
@@ -515,11 +551,13 @@ export default {
            className: 'replacecolor'
         },
         {
-          title: '净净重',
+          // title: '净净重',
           dataIndex: 'netWeightToo',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'netWeightToo' }  , 
+           slots:{title:'netWeightTooTitle'} 
+
         },
         // {
         //   title: '单价',
@@ -712,47 +750,7 @@ export default {
       this.$refs.ReferencePrePacklist.queryParam = {}
       this.$refs.ReferencePrePacklist.searchQuery()
     },
-    // 増行
-    // handleAddColumn() {
-    //   console.log('増行')
-    //   const addrow = {
-    //     accountSet: '',
-    //     garmentFactory: '',
-    //     hod: '',
-    //     styleNo: '',
-    //     poNo: '',
-    //     itemCode: '',
-    //     distributionPoint: '',
-    //     s: '',
-    //     m: '',
-    //     l: '',
-    //     xl: '',
-    //     xxl: '',
-    //     xxxl: '',
-    //     startingBoxNumber: '',
-    //     endCaseNumber: '',
-    //     colour: '',
-    //     withCode: '',
-    //     piecesBox: '',
-    //     boxNumber: '',
-    //     total: '',
-    //     netWeight: '',
-    //     totalNetWeight: '',
-    //     grossWeight: '',
-    //     totalGrossWeight: '',
-    //     outerBoxLength: '',
-    //     outerBoxWidth: '',
-    //     outerBoxHeight: '',
-    //     totalVolume: '',
-    //     netWeightToo: '',
-    //     // unitPrice: '',
-    //     // totalPrices: '',
-    //     remarks: '',
-    //     operation: ''
-    //   }
-    //   this.clothesAddData.push(addrow)
-    // },
-
+   
     // -------------------------------------
     // 操作 删除
     handleDelete(ind) {
@@ -1038,19 +1036,21 @@ export default {
           insertAfter:true,
         },
         {
-          title: '启始箱号',
+          // title: '起始箱号',
           dataIndex       : 'startingBoxNumber',
           className: 'replacecolor',          
           width: 120,
           scopedSlots: { customRender: 'startingBoxNumber' }  ,
+          slots:{title:'startingBoxNumberTitle'}
         },
 
         {
-          title: '结束箱号',
+          // title: '结束箱号',
           dataIndex       : 'endCaseNumber',
           width: 120,
           className: 'replacecolor', 
-          scopedSlots: { customRender: 'endCaseNumber' }  ,         
+          scopedSlots: { customRender: 'endCaseNumber' }  ,     
+          slots:{title:'endCaseNumberTitle'}
         },
 
         {
@@ -1077,6 +1077,7 @@ export default {
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'replacecolor' }  ,
+          slots:{title:'boxNumberTitle'}           
         },
         {
           title: '计划尺码数量',
@@ -1097,11 +1098,12 @@ export default {
            className: 'replacecolor'
         },
         {
-          title: '净重/箱',
+          // title: '净重/箱',
           dataIndex       : 'netWeight',
           width: 120,
            className: 'replacecolor',
           scopedSlots: { customRender: 'netWeight' }  ,
+          slots:{title:'netWeightTitle'}
         },
         {
           title: '总净重',
@@ -1110,11 +1112,12 @@ export default {
            className: 'replacecolor'
         },
         {
-          title: '毛重/箱',
+          // title: '毛重/箱',
           dataIndex       : 'grossWeight',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'grossWeight' }  ,
+          slots:{title:'grossWeightTitle'}
         },
         {
           title: '总毛重',
@@ -1123,25 +1126,32 @@ export default {
            className: 'replacecolor'
         },
         {
-          title: '外箱长度',
+          // title: '外箱长度',
           dataIndex       : 'outerBoxLength',
           width: 120,
           className: 'replacecolor',
           scopedSlots: { customRender: 'outerBoxLength' }  ,
+          slots:{title:'outerBoxLengthTitle'}
+
         },
         {
-          title: '外箱宽度',
+          // title: '外箱宽度',
           dataIndex       : 'outerBoxWidth',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'outerBoxWidth' }  ,
+          slots:{title:'outerBoxWidthTitle'}
+
         },
         {
-          title: '外箱高度',
+          // title: '外箱高度',
           dataIndex       : 'outerBoxHeight',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'outerBoxHeight' }  ,
+          slots:{title:'outerBoxHeightTitle'}
+
+           
         },
         {
           title: '总体积',
@@ -1150,11 +1160,12 @@ export default {
            className: 'replacecolor'
         },
         {
-          title: '净净重',
+          // title: '净净重',
           dataIndex       : 'netWeightToo',
           width: 120,
            className: 'replacecolor',
            scopedSlots: { customRender: 'netWeightToo' }  ,
+          slots:{title:'netWeightTooTitle'}
         },
         {
           title: '备注',

+ 28 - 11
src/views/packing-list/packinglist-fabrics/addFabricDrawer.vue

@@ -113,6 +113,19 @@
               :scroll="{ x: 1500,y: 350 }"
               @change="handleTableChange"
             >
+            <!-- 自定义表头 -->
+             <span slot="netWeightTitle" class="form-table-heard">
+             净重/NW/kg
+            </span>
+            <span slot="grossWeightTitle" class="form-table-heard">
+             毛重/GW/kg
+            </span>
+            <span slot="dyelotNumberTitle" class="form-table-heard">
+             缸号/Batch no.
+            </span>
+            <span slot="actualDeclaredQuantityTitle" class="form-table-heard">
+             实际报关数量
+            </span>
               <!-- 操作 -->
               <span slot="operationSlot" slot-scope="text, record,index">
                 <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record,index)">
@@ -349,10 +362,11 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '缸号/Batch no.',
+          // title: '缸号/Batch no.',
           dataIndex: 'dyelotNumber',
           scopedSlots: { customRender: 'dyelotNumber' },
-          width: 120,
+          slots:{title:'dyelotNumberTitle'},
+          width: 170,
           className: 'replacecolor'
         },
         {
@@ -405,18 +419,20 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '毛重/GW/kg',
+          // title: '毛重/GW/kg',
           dataIndex: 'grossWeight',
           scopedSlots: { customRender: 'grossWeight' },
-          width: 120,
-          className: 'replacecolor'
+          width: 170,
+          className: 'replacecolor',
+          slots:{title:'grossWeightTitle'}
         },
         {
-          title: '净重/NW/kg',
+          // title: '净重/NW/kg',
           scopedSlots: { customRender: 'netWeight' },
           dataIndex: 'netWeight',
-          width: 120,
-          className: 'replacecolor'
+          width: 170,
+          className: 'replacecolor',
+           slots:{title:'netWeightTitle'}
         },
 
         {
@@ -440,11 +456,12 @@ export default {
           className: 'replacecolor'
         },
           {
-          title: '实际报关数量',
+          // title: '实际报关数量',
           dataIndex: 'actualDeclaredQuantity',
           scopedSlots: { customRender: 'actualDeclaredQuantity' },
-          width: 120,
-          className: 'replacecolor'
+          width: 170,
+          className: 'replacecolor',
+          slots:{title:'actualDeclaredQuantityTitle'}
         },
         // {
         //   title: '价格',