Prechádzať zdrojové kódy

箱装单成衣分页初始化

jbb 2 rokov pred
rodič
commit
820dc4df95

+ 77 - 11
src/views/packing-list/packinglist-clothes/clothesAddDrawer.vue

@@ -105,7 +105,7 @@
               :columns="clothesAddColumns"
               :data-source="clothesAddData"
               :loading="loading"
-              :pagination="ipagination"
+              :pagination="pagination"
               :scroll="{ x: 1500 }"
               @change="handleTableChange"
             >
@@ -210,20 +210,20 @@
     </a-drawer>
 
     <!-- 参照预装箱单 -->
-    <advancePackingList-modal ref="advancePackingListModal" :father="aa" @ok="modalFormOk"></advancePackingList-modal>
+    <reference-pre-packlist ref="ReferencePrePacklist" @callback='referCallback' :father="aa" @ok="modalFormOk"></reference-pre-packlist>
   </div>
 </template>
 
 <script>
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
-import AdvancePackingListModal from '@views/pre-book/advancePackingListModal.vue'
+import ReferencePrePacklist from '@views/packing-list/packinglist-clothes/referencePrePacklist'
 
 export default {
   name: 'ClothesAddDrawer', //  新增-装箱单 -成衣
   mixins: [JeecgListMixin],
   computed: {},
-  components: { AdvancePackingListModal, JEllipsis }, // 参照预装箱单 弹框
+  components: { ReferencePrePacklist, JEllipsis }, // 参照预装箱单 弹框
   data() {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
 
@@ -453,6 +453,11 @@ export default {
       clothesAddData: [{}, {}, {}],
       loading: false, // 表格加载
       clothesAdd: {},
+       pagination: {
+        // total: '',
+        // current: 0,
+        // pageSize: 0
+      },
       visible: false,
       confirmLoading: false,
       validatorRules: {
@@ -467,11 +472,71 @@ export default {
   created() {},
   mounted() {},
   methods: {
+    // 参照回调
+    referCallback(filterDataList){
+      var subList = this.convertReferToSub(filterDataList);
+        var filterList = subList.filter(newItem=>{
+          return this.addPreBook.syLetterDepositItemList.filter(item=>{
+            return item.syPreAssembledPackingListItemId === newItem.syPreAssembledPackingListItemId;
+          }).length == 0;
+        });
+        this.addPreBook.syLetterDepositItemList = this.addPreBook.syLetterDepositItemList.concat(filterList);
+        this.setHeadCalField();
+        
+    },
+      // 参照数据转换成子表
+    convertReferToSub(dataList){
+      var ret = [];
+      console.log(dataList)
+      debugger
+      for (var i=0; i<dataList.length; i++){
+        var data = dataList[i];
+        var sub = {
+        accountSet: '',
+        clothesFactory: data.garmentFactory,
+        hod: '',
+        styleNo: '',
+        poNo: '',
+        itemNo: '',
+        dcLabel: data.distributionPoint,
+        s: '',
+        m: '',
+        l: '',
+        xl: '',
+        xxl: '',
+        xxxl: '',
+        inceptionBoxNo: '',
+        endBoxNo: '',
+        colorChUsa: '',
+        configCode: '',
+        packagesBox: '',
+        boxes: '',
+        totalPackagesNum: '',
+        suttle: '',
+        totalSuttle: '',
+        roughWeight: '',
+        totalRoughWeigh: '',
+        boxLength: '',
+        boxWidth: '',
+        boxHeight: '',
+        totalVolume: '',
+        netNetWeight: '',
+        price: '',
+        totalPrices: '',
+        note: '',
+        operation: ''
+        };
+        ret.push(sub);
+      }
+      return ret;
+    },
     // 参照预装箱单
     referadvancePackingList() {
       console.log('打开参照订单数据')
       // 打开订单数据弹框
-      this.$refs.advancePackingListModal.advancePackingListModVis = true
+      this.$refs.ReferencePrePacklist.referencePrePacklist = true
+      this.$refs.ReferencePrePacklist.queryParam = {}
+      this.$refs.ReferencePrePacklist.searchQuery()
     },
     // 増行
     handleAddColumn() {
@@ -550,14 +615,15 @@ export default {
     },
     // - father------------------------------------
     aa() {},
-    modalFormOk() {}
+    modalFormOk() {},
 
     // 分页、排序、筛选变化时触发
-    // handleTableChange(pagination, filters, sorter) {
-    //   // console.log('当前页信息>>>>',pagination)
-    //   this.queryParam.pageNo = pagination.current
-    //   this.getAnnList()
-    // }'
+    handleTableChange(pagination, filters, sorter) {
+      console.log('当前页信息>>>>',pagination)
+      debugger
+      this.queryParam.pageNo = pagination.current
+      this.getAnnList()
+    }
   }
 }
 </script>