Bläddra i källkod

预托书临时

fenghaifu 2 år sedan
förälder
incheckning
9803288776
2 ändrade filer med 172 tillägg och 157 borttagningar
  1. 64 62
      src/views/pre-book/addPreBookDrawer.vue
  2. 108 95
      src/views/pre-book/advancePackingListModal.vue

+ 64 - 62
src/views/pre-book/addPreBookDrawer.vue

@@ -188,52 +188,6 @@
           </j-vxe-table>
         </a-spin>
 
-         <!-- 人民币、美金 -->
-        <a-row style="marginTop:10px;marginBottom:50px;background:white;padding:10px;">
-          <div class="purchase-order-table" style="width:48%;marginRight:4%;float:left;">
-            <h6 class="table-title">人民币</h6>
-            <a-table
-              :row-key="record => record.id"
-              :loading="loading"
-              :columns="CNYColumns"
-              :data-source="CNYData"
-              bordered
-              :pagination="false"
-            >
-              <!-- CNY项目列 -->
-              <template slot="itemColumn" slot-scope="text, record, index">
-                <a-form-model-item prop="itemColumn" :rules="rules.itemColumn">
-                  <a-select v-model="record.itemColumn" style="width:100%">
-                    <a-select-option :value="1">项目列1</a-select-option>
-                    <a-select-option :value="2">项目列2</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </template>
-            </a-table>
-          </div>
-
-          <div class="purchase-order-table" style="width:48%;float:right;">
-            <h6 class="table-title">美金</h6>
-            <a-table
-              :row-key="record => record.id"
-              :loading="loading"
-              :columns="USDColumns"
-              :data-source="USDData"
-              bordered
-              :pagination="false"
-            >
-              <!-- USD项目列  -->
-              <template slot="USDProjectList" slot-scope="text, record, index">
-                <a-form-model-item prop="USDProjectList" :rules="rules.USDProjectList">
-                  <a-select v-model="record.USDProjectList" style="width:100%">
-                    <a-select-option :value="1">项目列1</a-select-option>
-                    <a-select-option :value="2">项目列2</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </template>
-            </a-table>
-          </div>
-        </a-row>
       </a-card>
 
       <!-- 页面底部保存取消 -->
@@ -259,7 +213,7 @@
       </div>
     </a-drawer>
     <!-- 参照预装箱单 -->
-    <advancePackingList-modal ref="advancePackingListModal" :father="aa" @ok="modalFormOk"></advancePackingList-modal>
+    <advancePackingList-modal ref="advancePackingListModal" @callback="referCallback" @ok="modalFormOk"></advancePackingList-modal>
   </div>
 </template>
 
@@ -287,20 +241,20 @@ export default {
         },
         {
           title: '款号',
-          dataIndex: 'sort',
+          dataIndex: 'itemNumber',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '小po',
-          dataIndex: 'smallPo',
+          dataIndex: 'poNo',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '数量',
-          dataIndex: '01',
+          dataIndex: 'total',
           width: 120,
           className: 'replacecolor'
         },
@@ -314,21 +268,21 @@ export default {
 
         {
           title: '毛重',
-          dataIndex: 'grossWeight',
+          dataIndex: 'totalGrossWeight',
           width: 120,
 
           className: 'replacecolor'
         },
         {
           title: '净重',
-          dataIndex: 'netWeight',
+          dataIndex: 'totalNetWeight',
           width: 120,
 
           className: 'replacecolor'
         },
         {
           title: '体积',
-          dataIndex: '02',
+          dataIndex: 'totalVolume',
           width: 160,
 
           className: 'replacecolor'
@@ -344,7 +298,7 @@ export default {
           title: '集装箱代号',
           dataIndex: 'containerCode',
           width: 120,
-          scopedSlots: { customRender: 'containerCode' },
+          type:JVXETypes.inputNumber,
           className: 'replacecolor'
         },
 
@@ -352,7 +306,7 @@ export default {
           title: '集装箱号',
           dataIndex: 'containerNumber',
           width: 120,
-          scopedSlots: { customRender: 'containerNumber' },
+          type:JVXETypes.inputNumber,
           className: 'replacecolor'
         },
         {
@@ -551,13 +505,61 @@ export default {
 
     // ------------------------------------------
     modalFormOk() {},
-    aa() {}
-    // // 分页、排序、筛选变化时触发
-    // handleTableChange(pagination, filters, sorter) {
-    //   // console.log('当前页信息>>>>',pagination)
-    //   this.queryParam.pageNo = pagination.current
-    //   this.getAnnList()
-    // }
+    // 参照回调
+    referCallback(dataList){
+      var subList = this.convertReferToSub(dataList);
+        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);
+    },
+    // 参照数据转换成子表
+    convertReferToSub(dataList){
+      var ret = [];
+      for (var i=0; i<dataList.length; i++){
+        var data = dataList[i];
+        var sub = {
+          id:"",
+          syLetterDepositId:"",
+          syPreAssembledPackingListId:data.id,
+          syPreAssembledPackingListItemId:data.itemId,
+          acSetNo:"",
+          garmentFactory:"",
+          hod:"",
+          styleNo:"",
+          poNo:data.poNo,
+          itemCode:"",
+          distributionPoint:data.distributionPoint,
+          size:"",
+          startingBoxNumber:"",
+          endCaseNumber:"",
+          colour:data.colour,
+          piecesBox:"",
+          boxNumber:data.boxNumber,
+          total:0,
+          netWeight:data.totalNetWeight/data.boxNumber,
+          totalNetWeight:data.totalNetWeight,
+          grossWeight:data.totalGrossWeight/data.boxNumber,
+          totalGrossWeight:data.totalGrossWeight,
+          outerBoxLength:0,
+          outerBoxWidth:0,
+          outerBoxHeight:0,
+          totalVolume:0,
+          netWeightToo:0,
+          unitPrice:0,
+          totalPrice:data.totalPrice,
+          containerCode:data.containerCode,
+          containerNumber:data.containerNumber,
+
+          itemNumber:data.itemNumber,
+        };
+        ret.push(sub);
+      }
+      return ret;
+    },
+    
   },
 
   mounted() {}

+ 108 - 95
src/views/pre-book/advancePackingListModal.vue

@@ -15,22 +15,37 @@
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
-              <a-form-item label="订单号">
-                <a-input placeholder="请输入订单号" v-model="queryParam.orderNum"></a-input>
+                <a-form-item label="客户简称">
+                  <j-search-select-tag
+                    placeholder="请选择客户简称"
+                    v-model="queryParam.customerAbbreviation"
+                    dict="view_customer,customername,customername">
+                  </j-search-select-tag>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="8">
+              <a-form-item label="预发货日期">
+                <a-date-picker placeholder="请选择预发货日期" v-model="queryParam.preDeliveryDate" format="YYYY-MM-DD"
+                @change="deliveryDateChange"></a-date-picker>
               </a-form-item>
             </a-col>
-
             <a-col :md="6" :sm="8">
-              <a-form-item label="品名">
-                <a-input placeholder="请输入品名" v-model="queryParam.name"></a-input>
+              <a-form-item label="小PO">
+                <a-input placeholder="请输入小PO" v-model="queryParam.poNo"></a-input>
+              </a-form-item>
+            </a-col>
+            <template v-if="toggleSearchStatus">
+               <a-col :md="6" :sm="8">
+              <a-form-item label="分销点">
+                <a-input placeholder="请输入分销点" v-model="queryParam.distributionPoint"></a-input>
               </a-form-item>
             </a-col>
-
             <a-col :md="6" :sm="8">
               <a-form-item label="款号">
                 <a-input placeholder="请输入款号" v-model="queryParam.styleNum"></a-input>
               </a-form-item>
             </a-col>
+            </template>
 
             <a-col :md="6" :sm="8">
               <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@@ -53,11 +68,11 @@
           :data-source="advancePackingListData"
           :loading="loading"
           :pagination="ipagination"
-          :row-key="record => record.id"
+          row-key="itemId"
           :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
           @change="handleTableChange"
           bordered
-          :scroll="{ x: 1500 }"
+          :scroll="{ x: 2000 }"
           size="small"
         >
         </a-table>
@@ -77,7 +92,9 @@ export default {
   mixins: [JeecgListMixin],
   components: { JEllipsis, moment },
   data() {
+    let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
     return {
+      
       // 查询条件
       queryParam: {
         orderNum: '',
@@ -90,160 +107,150 @@ export default {
       advancePackingListColumns: [
         {
           title: '款号',
-          dataIndex: 'styleNum',
+          dataIndex: 'itemNumber',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '客户简称',
-          dataIndex: 'customerShortName',
+          dataIndex: 'customerAbbreviation',
           width: 120,
           fixed: 'left',
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
-        //  {
-        //   title: '创建时间',
-        //   dataIndex: 'createTime',
-        //   align: 'center',
-        //   sorter: true,
-        //   customRender: text => {
-        //     return moment(text).format('YYYY-MM-DD')
-        //   }
-        // },
         {
           title: '预发货日期',
-          dataIndex: 'scheduledShipDate',
+          dataIndex: 'preDeliveryDate',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '小PO',
-          dataIndex: 'smallPo',
+          dataIndex: 'poNo',
           width: 120,
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
+        //  {
+        //   title: '创建时间',
+        //   dataIndex: 'createTime',
+        //   align: 'center',
+        //   sorter: true,
+        //   customRender: text => {
+        //     return moment(text).format('YYYY-MM-DD')
+        //   }
+        // },
+        
         {
           title: '分销点',
           dataIndex: 'distributionPoint',
           width: 120,
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
 
         {
           title: '备注',
           dataIndex: 'note',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '发货日期',
-          dataIndex: 'shipDate',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '业务员',
-          dataIndex: 'salesman',
-          width: 120,
+          width: 150,
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '客户',
           dataIndex: 'customer',
-          width: 120,
+          width: 250,
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '存货名称',
           dataIndex: 'inventoryName',
-          width: 120,
+          width: 150,
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
-
         {
           title: '颜色',
-          dataIndex: 'color',
+          dataIndex: 'colour',
           width: 120,
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '采购/委外订单号',
-          dataIndex: 'purchaseAboardOrderNum',
-          width: 140,
-          className: 'replacecolor'
-        },
-        {
-          title: '订单类型',
-          dataIndex: 'orderType',
-          width: 120,
+          dataIndex: 'spurOrSubOrder',
+          width: 200,
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
 
+
         {
           title: '工厂单价',
-          dataIndex: 'factoryPeice',
+          dataIndex: 'factoryUnitPrice',
           width: 120,
           className: 'replacecolor'
         },
+        
         {
-          title: '数量(按合并规则累计)',
-          dataIndex: 'quantity',
-          width: 180,
+          title: '数',
+          dataIndex: 'boxNumber',
+          width: 90,
           className: 'replacecolor'
         },
         {
-          title: '数',
-          dataIndex: 'boxesNum',
-          width: 90,
+          title: '数量(按合并规则累计)',
+          dataIndex: 'totalQuantity',
+          width: 200,
           className: 'replacecolor'
         },
         {
-          title: '总净重',
-          dataIndex: 'totalSuttle',
+          title: '订单类型',
+          dataIndex: 'orderType',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '总毛重',
-          dataIndex: 'totalRoughWeigh',
+          title: '集装箱代号',
+          dataIndex: 'containerCode',
           width: 120,
           className: 'replacecolor'
         },
 
         {
-          title: '总体积',
-          dataIndex: 'totalVolume',
+          title: '集装箱号',
+          dataIndex: 'containerNumber',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '总',
-          dataIndex: 'totalPrices',
-          width: 120,
+          title: '总净重',
+          dataIndex: 'totalNetWeight',
+          width: 90,
           className: 'replacecolor'
         },
         {
-          title: '集装箱代号',
-          dataIndex: 'containerCode',
-          width: 120,
+          title: '总毛重',
+          dataIndex: 'totalGrossWeight',
+          width: 90,
           className: 'replacecolor'
         },
 
         {
-          title: '集装箱号',
-          dataIndex: 'containerNo',
-          width: 120,
-          fixed: 'right',
+          title: '总体积',
+          dataIndex: 'totalVolume',
+          width: 90,
           className: 'replacecolor'
         },
         {
-          title: '预托书号',
-          dataIndex: 'preBookNum',
-          width: 120,
-          fixed: 'right',
+          title: '总价',
+          dataIndex: 'totalPrice',
+          width: 90,
           className: 'replacecolor'
-        }
+        },
       ],
       advancePackingListData: [],
 
@@ -265,10 +272,11 @@ export default {
     // 弹框查询按钮
     searchQuery() {
       this.$nextTick(() => {
+        //if (this.queryParam.preDeliveryDate != undefined && this.queryParam.preDeliveryDate != "")
+
         querySyPreAssembledPackingList(this.queryParam).then(res => {
           if (res.success) {
-            this.advancePackingListData = res.result.records
-            console.log('预托书列表', this.advancePackingListData)
+            this.advancePackingListData = res.result.records;
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -284,38 +292,43 @@ export default {
       // this.getShipmentList()
     },
     // 弹框确定
-    onSubmit() {},
+    onSubmit() {
+
+      if (this.selectedRowKeys.length == 0) {
+        this.$message.error('请选择数据');
+      } else {
+        var filterDataList = this.advancePackingListData.filter(item=>{
+          return this.selectedRowKeys.filter(key=>{
+            return item.itemId === key 
+          }).length>0
+        });
+        this.$emit('callback', filterDataList);
+
+        this.advancePackingListModVis = false;
+        this.selectedRowKeys = [];
+
+      }
+    },
 
     close() {
       this.$emit('close')
       this.advancePackingListModVis = false
     },
     handleCancel() {
+      this.selectedRowKeys = [];
       this.close()
     },
     handleTableChange() {},
     // 选中行
     onSelectChange(keys, rows) {
-      this.selectedRowKeys = keys
-      this.selectedRows = rows
-    }
+      this.selectedRowKeys = keys;
+    },
+    deliveryDateChange(value, dateString) {
+      this.queryParam.preDeliveryDate = dateString
+    },
+
   },
   computed: {
-    // 选中项
-    rowSelection() {
-      return {
-        onChange: (selectedRowKeys, selectedRows) => {
-          console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
-        },
-        getCheckboxProps: record => ({
-          props: {
-            disabled: record.title === 'Disabled User',
-            // Column configuration not to be checked
-            title: record.title
-          }
-        })
-      }
-    }
   }
 }
 </script>