Przeglądaj źródła

装箱单面料

jbb 2 lat temu
rodzic
commit
17912c392e

+ 17 - 1
src/api/document/packing-list/packinglist-fabrics.js

@@ -13,5 +13,21 @@ const getShippingDetailId = params => getAction('/splfi/syPackingListFabric/getS
 //新增
 const addFabricList = params => postAction('/splfi/syPackingListFabric/add', params)
 
+//根据id查询
+const fabricListId = params => getAction('/splfi/syPackingListFabric/queryById', params)
 
-export {fabricList,referenceList,getShippingDetailId,addFabricList}
+//编辑
+const editFabricList = params => postAction('/splfi/syPackingListFabric/edit', params)
+
+//删除
+const deleteFabricList = params => deleteAction('/splfi/syPackingListFabric/delete', params)
+
+//提交
+const submitList = params => postAction('/splfi/syPackingListFabric/submit', params)
+
+//取消提交
+const cancelSubmit = params => postAction('/splfi/syPackingListFabric/cancelSubmit', params)
+
+
+
+export {fabricList,referenceList,getShippingDetailId,addFabricList,fabricListId,editFabricList,deleteFabricList,submitList,cancelSubmit}

+ 124 - 16
src/views/packing-list/fabric-list.vue

@@ -6,11 +6,18 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
-            <a-col :md="6" :sm="8">
+
+             <a-col :md="6" :sm="8">
+              <a-form-item label="单据号">
+                <a-input placeholder="请输入单据号" v-model="queryParam.documentNo"></a-input>
+              </a-form-item>
+            </a-col>
+
+            <!-- <a-col :md="6" :sm="8">
               <a-form-item label="订单号">
                 <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
               </a-form-item>
-            </a-col>
+            </a-col> -->
 
             <a-col :md="6" :sm="8">
               <a-form-item label="集装箱号">
@@ -69,6 +76,11 @@
             <a-input style="width:100%" v-model="record.containerNumber" />
           </a-form-model-item>
         </a-form-model> -->
+         <!-- 单据状态 -->
+        <span slot="state" slot-scope="text, record">
+          <a-tag color="orange" v-if="record.status == '0'">已保存</a-tag>
+          <a-tag color="green" v-if="record.status == '1'">已提交</a-tag>
+        </span>
 
         <!-- 操作 -->
         <span slot="operationSlot" slot-scope="text, record">
@@ -79,6 +91,7 @@
             <a-menu slot="overlay">
               <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
               <a-menu-item><a @click="edit(record)">编辑</a></a-menu-item>
+              <a-menu-item><a @click="submit(record)">提交</a></a-menu-item>
               <a-menu-item>
                 <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
                   <a href="javascript:void(0);" style="color:red;">删除</a>
@@ -106,7 +119,7 @@ import moment from 'moment'
 import addFabricDrawer from '@views/packing-list/packinglist-fabrics/addFabricDrawer.vue'
 import detailsFabricDrawer from '@views/packing-list/packinglist-fabrics/detailsFabricDrawer.vue'
 import editFabricDrawer from '@views/packing-list/packinglist-fabrics/editFabricDrawer.vue'
-import { fabricList} from '@api/document/packing-list/packinglist-fabrics'
+import { fabricList,fabricListId,deleteFabricList,submitList} from '@api/document/packing-list/packinglist-fabrics'
 
 export default {
   name: 'FabricList', // 装箱单-面料
@@ -119,11 +132,17 @@ export default {
       // 表头
       fabricListColumns: [
         {
-          title: '单号',
-          dataIndex: 'orderNumber',
+          title: '单号',
+          dataIndex: 'documentNo',
           width: 160,
           className: 'replacecolor'
         },
+        // {
+        //   title: '订单号',
+        //   dataIndex: 'orderNumber',
+        //   width: 160,
+        //   className: 'replacecolor'
+        // },
         {
           title: '外销发票号',
           dataIndex: 'exportInvoiceNo',
@@ -176,6 +195,14 @@ export default {
         {
           title: '托书号',
           dataIndex: 'shippingOrderNumber',
+          scopedSlots: { customRender: 'operationSlot' },
+          width: 160,
+          className: 'replacecolor'
+        },
+         {
+          title: '状态',
+          dataIndex: 'status',
+          scopedSlots: { customRender: 'state' },
           width: 160,
           className: 'replacecolor'
         },
@@ -196,7 +223,7 @@ export default {
 
       // 查询条件
       queryParam: {
-        orderNumber: '',
+        // orderNumber: '',
         containerNumber: '', // 集装箱号
         invoiceNo: '', // 发票号
         pageNo: '' // 初始页
@@ -258,15 +285,96 @@ export default {
     // 操作 详情
     details(record) {
       console.log('详情', record.id)
-      this.$refs.detailsFabricDrawer.visible = true
+      // console.log('编辑')
+       this.$nextTick(() => {
+        fabricListId({id:record.id}).then(res => {
+          if (res.success) {
+            var data = res.result
+             this.$refs.detailsFabricDrawer.visible = true
+             this.$refs.detailsFabricDrawer.addFabric ={
+               documentNo:data.documentNo,
+              //  orderNumber:data.orderNumber,
+               containerNumber:data.containerNumber,
+               latestDateOfShipment:data.latestDateOfShipment,
+               garmentFactory:data.garmentFactory,
+               invoiceNo:data.invoiceNo,
+               preparedBy:data.preparedBy,
+               preparedDate:data.preparedDate,
+               exportInvoiceNo:data.exportInvoiceNo,
+               shippingOrderNumber:data.shippingOrderNumber,
+               remarks:data.remarks,
+             }
+              this.$refs.detailsFabricDrawer.addFabricData = data.syPackingListFabricItem
+          }else{
+              this.$message.error(res.message);
+          }
+        })
+      })
     },
     // 操作 编辑
     edit(record) {
-      console.log('编辑')
-      this.$refs.editFabricDrawer.visible = true
+      // console.log('编辑')
+       this.$nextTick(() => {
+        fabricListId({id:record.id}).then(res => {
+          if (res.success) {
+            var data = res.result
+             this.$refs.addFabricDrawer.visible = true
+             this.$refs.addFabricDrawer.defaultMethod = 'edit'
+             this.$refs.addFabricDrawer.addFabric ={
+               id:data.id,
+              //  orderNumber:data.orderNumber,
+               documentNo:data.documentNo,
+               containerNumber:data.containerNumber,
+               latestDateOfShipment:data.latestDateOfShipment,
+               garmentFactory:data.garmentFactory,
+               invoiceNo:data.invoiceNo,
+               preparedBy:data.preparedBy,
+               preparedDate:data.preparedDate,
+               exportInvoiceNo:data.exportInvoiceNo,
+               shippingOrderNumber:data.shippingOrderNumber,
+               remarks:data.remarks,
+             }
+              this.$refs.addFabricDrawer.addFabricData = data.syPackingListFabricItem
+          }else{
+              this.$message.error(res.message);
+          }
+        })
+      })
+      
+    },
+    
+    //提交
+    submit(record){
+     this.$nextTick(() => {
+        submitList({id: record.id}).then(res => {
+          if (res.success) {
+            console.log('提交成功,单据状态改为【已提交】')
+            record.status = '1'
+            this.getFabricList() // 渲染 发运明细列表
+            this.$message.success('提交成功')
+          }else {
+             this.$message.error(res.message)
+          }
+        })
+      })
     },
     // 操作 删除
-    handleDelete() {},
+    handleDelete(id) {
+       this.$nextTick(() => {
+         if(this.queryParam.pageNo > 1 && this.fabricListData.length === 1){
+          this.queryParam.pageNo = this.queryParam.pageNo -1
+        }
+        deleteFabricList({ id: id }).then(res => {
+          if (res.success) {
+            this.getFabricList()
+            this.$message.success('删除成功')
+          } else {
+            this.$message.error('删除成功')
+          }
+       
+        })
+      })
+    },
     // --------------------------------------
     // ??
     modalFormOk() {},
@@ -278,13 +386,13 @@ export default {
     // --------------------------------------
     aa() {},
     bb() {},
-    cc() {}
+    cc() {},
     // 分页、排序、筛选变化时触发
-    // handleTableChange(pagination, filters, sorter) {
-    //   // console.log('当前页信息>>>>',pagination)
-    //   this.queryParam.pageNo = pagination.current
-    //   // this.getAnnList()
-    // }
+    handleTableChange(pagination, filters, sorter) {
+      // console.log('当前页信息>>>>',pagination)
+      this.queryParam.pageNo = pagination.current
+      this.getFabricList()
+    }
   },
   computed: {
     // 选中项

+ 51 - 22
src/views/packing-list/packinglist-fabrics/addFabricDrawer.vue

@@ -13,9 +13,15 @@
                 </a-form-model-item>
               </a-col>
 
+              <!-- <a-col :md="6" :sm="8">
+                <a-form-model-item label="订单号" prop="oddNum">
+                  <a-input placeholder="选择子表自动生成" v-model="addFabric.orderNumber"></a-input>
+                </a-form-model-item>
+              </a-col> -->
+
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="集装箱号" prop="styleNum">
-                  <a-input placeholder="选择子表自动生成" v-model="addFabric.containerNumber"></a-input>
+                  <a-input placeholder="请输入集装箱号" v-model="addFabric.containerNumber"></a-input>
                 </a-form-model-item>
               </a-col>
 
@@ -32,13 +38,7 @@
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="成衣工厂" prop="clothesFactory">
-                  <a-input placeholder="请输入成衣工厂" v-model="addFabric.garmentFactory"></a-input>
-                  <!-- <a-select placeholder="请选择成衣工厂">
-                <a-select-option value="">请选择</a-select-option>
-                <a-select-option value="0">成衣工厂1</a-select-option>
-                <a-select-option value="1">成衣工厂2</a-select-option>
-                <a-select-option value="2">成衣工厂3</a-select-option>
-              </a-select> -->
+                  <a-input placeholder="勾选数据自动生成" v-model="addFabric.garmentFactory"></a-input>
                 </a-form-model-item>
               </a-col>
 
@@ -102,13 +102,12 @@
               :columns="addFabricColumns"
               :data-source="addFabricData"
               :loading="loading"
-              :pagination="ipagination"
               :scroll="{ x: 1500 }"
               @change="handleTableChange"
             >
               <!-- 操作 -->
-              <span slot="operationSlot" slot-scope="text, record">
-                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
+              <span slot="operationSlot" slot-scope="text, record,index">
+                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record,index)">
                   <a href="javascript:void(0);" style="color:red;">删除</a>
                 </a-popconfirm>
               </span>
@@ -207,7 +206,7 @@
               <!-- 入库数量 -->
               <template slot="inventoryQuantity" slot-scope="text, record, index">
                 <a-form-model-item prop="inventoryQuantity">
-                  <a-input style="width:100%" type="text" v-model="record.inventoryQuantity" />
+                  <a-input style="width:100%" type="text" v-model="record.inventoryQuantity" @change="inventoryQuantityChange(record)" />
                 </a-form-model-item>
               </template>
 
@@ -252,7 +251,7 @@
 
 <script>
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import { getShippingDetailId,addFabricList} from '@api/document/packing-list/packinglist-fabrics'
+import { getShippingDetailId,addFabricList,editFabricList} from '@api/document/packing-list/packinglist-fabrics'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import referShipDetailsModal from '@views/packing-list/packinglist-fabrics/referShipDetailsModal.vue'
 
@@ -523,6 +522,7 @@ export default {
       addFabric: {},
       visible: false,
       confirmLoading: false,
+      defaultMethod:'add',
       validatorRules: {
         // oddNum: [{ required: true, message: '单号不能为空', trigger: 'blur' }],
         // containerNo: [{ required: true, message: '款号不能为空', trigger: 'blur' }]
@@ -540,14 +540,19 @@ export default {
       this.$refs.referShipDetailsModal.referShipDetailsModVis = true
       this.$refs.referShipDetailsModal.getReferenceList()
     },
-    getFabricData(rowsId,token) {
+    getFabricData(rows,token) {
       this.addFabric = {}
       this.addFabricData = []
+      var rowsId = []
+      rows.map(item => rowsId.push(item.id) )
       var ids = rowsId.toString()
       getShippingDetailId({ids:ids,token:token}).then(res => {
           if (res.success) {
             var data = res.result
             this.addFabric ={
+              // id:data.id,
+              // orderNumber:data.orderNumber,
+              documentNo:data.documentNo,
               containerNumber : data.containerNumber,
               latestDateOfShipment : data.latestDateOfShipment,
               garmentFactory : data.garmentFactory,
@@ -559,6 +564,9 @@ export default {
               remarks : data.remarks
             }
             this.addFabricData = data.syPackingListFabricItem 
+            this.addFabricData.map(item =>{
+              item.inventoryQuantity = 0
+            })
           }else {
             this.$message.error(res.message);
           }
@@ -607,8 +615,8 @@ export default {
 
     // -------------------------------------
     // 操作 删除
-    handleDelete(id) {
-      console.log('id:', id)
+    handleDelete(record,index) {
+      this.addFabricData.splice(index, 1);
     },
     // -------------------------------------
 
@@ -627,6 +635,7 @@ export default {
           // that.confirmLoading = true
           var newObj = {
             documentNo:this.addFabric.documentNo,
+            // orderNumber:this.addFabric.orderNumber,
             containerNumber:this.addFabric.containerNumber,
             latestDateOfShipment:this.addFabric.latestDateOfShipment,
             garmentFactory:this.addFabric.garmentFactory,
@@ -638,17 +647,33 @@ export default {
             memo:this.addFabric.remarks,
             syPackingListFabricItem:this.addFabricData
           }
-          addFabricList(newObj).then(res => {
+          if(this.defaultMethod === 'add'){
+            addFabricList(newObj).then(res => {
              if (res.success) {
               this.$message.success('新增成功')
               this.close()
               //清空信息
               newObj = {};
              that.fatherList() // 调用父组件 查询方法
-           }else{
-             this.$message.error(res.message)
-           }
-         })
+            }else{
+              this.$message.error(res.message)
+            }
+           })
+          }else {
+            newObj.id = this.addFabric.id,
+            editFabricList(newObj).then(res => {
+             if (res.success) {
+              this.$message.success('编辑成功')
+              this.close()
+              //清空信息
+              newObj = {};
+              that.fatherList() // 调用父组件 查询方法
+            }else{
+              this.$message.error(res.message)
+            }
+           })
+          }
+          
         }
       })
       this.close()
@@ -659,13 +684,17 @@ export default {
     close() {
       this.$emit('close')
       this.visible = false
+      this.defaultMethod = 'add'
       this.addFabric = {}
       this.addFabricData = []
       this.$refs.form.resetFields()
     },
     // - father------------------------------------
     aa() {},
-    modalFormOk() {}
+    modalFormOk() {},
+    inventoryQuantityChange(record){
+      record.actualDeclaredQuantity = record.inventoryQuantity
+    },
 
     // 分页、排序、筛选变化时触发
     // handleTableChange(pagination, filters, sorter) {

+ 79 - 76
src/views/packing-list/packinglist-fabrics/detailsFabricDrawer.vue

@@ -1,85 +1,69 @@
 <template>
-  <!-- 详情 回显所有信息 面料 装箱单  -->
-  <div id="detailsFabricDrawer">
-    <a-drawer title="详情" width="89%" placement="right" :closable="true" :visible="visible" @close="handleCancel">
-      <!-- 主表信息 回显-->
+  <!-- 新增面料 装箱单  -->
+  <div id="addFabricDrawer">
+    <a-drawer title="新增面料" width="89%" placement="right" :closable="true" :visible="visible" @close="handleCancel">
+      <!-- 主表信息 填写-->
       <a-card :bordered="true">
         <div class="table-page-search-wrapper">
-          <a-form-model layout="inline" ref="form" :model="editFabric">
+          <a-form-model layout="inline" ref="form" :model="addFabric" :rules="validatorRules">
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="单号" prop="oddNum">
-                  YT67889
+                {{ addFabric.documentNo}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="集装箱号" prop="styleNum">
-                  <!-- <a-input placeholder="请输入集装箱号" v-model="editFabric.containerNo"></a-input> -->
+                  {{addFabric.containerNumber}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="装柜日期" prop="loadingDate">
-                  <!-- <a-date-picker
-                    placeholder="请选择装柜日期"
-                    :format="dateFormat"
-                    style="width: 100%"
-                    v-model="editFabric.loadingDate"
-                  /> -->
+                 {{addFabric.latestDateOfShipment}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="成衣工厂" prop="clothesFactory">
-                  <!-- <a-input placeholder="请输入成衣工厂" v-model="editFabric.clothesFactory"></a-input> -->
-                  <!-- <a-select placeholder="请选择成衣工厂">
-                <a-select-option value="">请选择</a-select-option>
-                <a-select-option value="0">成衣工厂1</a-select-option>
-                <a-select-option value="1">成衣工厂2</a-select-option>
-                <a-select-option value="2">成衣工厂3</a-select-option>
-              </a-select> -->
+                  {{addFabric.garmentFactory}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="发票号" prop="invoiceNum">
-                  <!-- <a-input placeholder="请输入发票号" v-model="editFabric.invoiceNum"></a-input> -->
+                 {{addFabric.invoiceNo}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="制单人" prop="preparedBy">
-                  <!-- <a-input placeholder="请输入制单人" v-model="editFabric.preparedBy"></a-input> -->
+                  {{addFabric.preparedBy}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="制单日期" prop="preparedDate">
-                  <!-- <a-date-picker
-                    placeholder="请选择制单日期"
-                    :format="dateFormat"
-                    style="width: 100%"
-                    v-model="editFabric.preparedDate"
-                  /> -->
+                 {{addFabric.preparedDate}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="外销发票号" prop="exportInvoiceNo">
-                  <!-- <a-input placeholder="请输入外销发票号" v-model="editFabric.exportInvoiceNo"></a-input> -->
+                 {{addFabric.exportInvoiceNo}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="托书号" prop="bookNum">
-                  <!-- <a-input placeholder="请输入托书号" v-model="editFabric.bookNum"></a-input> -->
+                  {{addFabric.shippingOrderNumber}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="备注" prop="note">
-                  <!-- <a-input placeholder="请输入备注" v-model="editFabric.note"></a-input> -->
+                  {{addFabric.remarks}}
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -87,24 +71,43 @@
         </div>
       </a-card>
 
-      <!-- 子表   -->
+      <!--操作按钮区域 参照发运明细 増行-->
       <a-card :bordered="true" style="margin:10px 0 60px 0;">
+        <!-- 子表   -->
         <a-spin :spinning="confirmLoading">
-          <a-form-model ref="formRef">
+          <a-form-model ref="formRef" :rules="validatorRules">
             <a-table
               bordered
-              :row-key="record => record.id"
-              :columns="columns"
-              :data-source="data"
+              :columns="addFabricColumns"
+              :data-source="addFabricData"
               :loading="loading"
-              :pagination="ipagination"
+              pagination="false"
               :scroll="{ x: 1500 }"
               @change="handleTableChange"
             >
+           
             </a-table>
           </a-form-model>
         </a-spin>
       </a-card>
+      <!-- 页面底部提交取消 -->
+      <div
+        :style="{
+          position: 'absolute',
+          right: 0,
+          bottom: 0,
+          width: '100%',
+          borderTop: '1px solid #e9e9e9',
+          padding: '10px 16px',
+          background: '#fff',
+          textAlign: 'right',
+          zIndex: 1
+        }"
+      >
+        <a-button type="primary" @click="handleCancel">
+          关闭
+        </a-button>
+      </div>
     </a-drawer>
   </div>
 </template>
@@ -114,51 +117,51 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 
 export default {
-  name: 'DetailsFabricDrawer', //  详情 装箱单 -面料
+  name: 'AddFabricDrawer', //  新增 装箱单 -面料
   mixins: [JeecgListMixin],
   computed: {},
-  components: { JEllipsis },
+  components: { JEllipsis}, // 参照发运明细 弹框
   data() {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
     return {
       // 表头
-      columns: [
+      addFabricColumns: [
         {
           title: '业务员 Merchandiser',
-          dataIndex: 'merchandiser',
+          dataIndex: 'salesman',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '计划单号',
-          dataIndex: 'planNum',
+          dataIndex: 'planLotNumber',
           width: 160,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '款号/Kimball',
-          dataIndex: 'Kimball',
+          dataIndex: 'itemNumber',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '缸号/Batch no.',
-          dataIndex: 'batchNo',
+          dataIndex: 'dyelotNumber',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '颜色/Color',
-          dataIndex: 'color',
+          dataIndex: 'colour',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '项目/Item(存货编码)',
-          dataIndex: 'itemCode',
+          dataIndex: 'inventoryCode',
           width: 120,
           className: 'replacecolor'
         },
@@ -185,7 +188,7 @@ export default {
 
         {
           title: '门幅/Width',
-          dataIndex: 'larghezza',
+          dataIndex: 'width',
           width: 140,
           className: 'replacecolor'
         },
@@ -197,32 +200,32 @@ export default {
         },
         {
           title: '毛重/GW/kg',
-          dataIndex: 'roughWeigh',
+          dataIndex: 'grossWeight',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '净重/NW/kg',
-          dataIndex: 'suttle',
+          dataIndex: 'netWeight',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '染后重',
-          dataIndex: 'postDyeingWweight',
+          dataIndex: 'afterHeavy',
           width: 90,
           className: 'replacecolor'
         },
         {
           title: '拷布重',
-          dataIndex: 'clothWeight',
+          dataIndex: 'kaoClothWeight',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '米数/Length/m',
-          dataIndex: '米数',
+          dataIndex: 'meter',
           width: 130,
           className: 'replacecolor'
         },
@@ -240,31 +243,31 @@ export default {
         },
         {
           title: '供应商编码(染厂)',
-          dataIndex: 'supplierCodeDye',
+          dataIndex: 'supplierCodeDyeingPlant',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '供应商(染厂)',
-          dataIndex: 'supplierDye',
+          dataIndex: 'supplierDyeingPlant',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '供应商编码(印厂)',
-          dataIndex: 'supplierCodePrint',
+          dataIndex: 'supplierCodePrintingPlant',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '供应商(印厂)',
-          dataIndex: 'supplierPrint',
+          dataIndex: 'supplierPrintingPlant',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '包装方式',
-          dataIndex: 'packingWay ',
+          dataIndex: 'mannerOfPacking ',
           width: 120,
           className: 'replacecolor'
         },
@@ -276,45 +279,45 @@ export default {
         },
         {
           title: '是否手册纱',
-          dataIndex: 'isManualYarn',
+          dataIndex: 'manualYarnFlag',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '手册纱单价',
-          dataIndex: 'manualYarnPrice',
+          dataIndex: 'manualYarnUnitPrice',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '手册纱占比%',
-          dataIndex: 'aa',
+          dataIndex: 'manualYarnProportion',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '柜号',
-          dataIndex: 'containerNum',
+          dataIndex: 'containerNumber',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '备注',
-          dataIndex: 'note',
+          dataIndex: 'memo',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '入库数量',
-          dataIndex: 'inQuantity',
+          dataIndex: 'inventoryQuantity',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '规格型号',
-          dataIndex: 'specificationsModels',
+          dataIndex: 'specificationAndModel',
           width: 120,
           className: 'replacecolor'
         },
@@ -326,30 +329,31 @@ export default {
         },
         {
           title: '超发',
-          dataIndex: 'superHair',
+          dataIndex: 'excessQuantity',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '单位',
-          dataIndex: 'unit',
+          dataIndex: 'masterMetering',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '备注(U8)',
-          dataIndex: 'noteU8',
+          dataIndex: 'remarks2',
           width: 160,
           fixed: 'right',
           customRender: t => ellipsis(t),
           className: 'replacecolor'
-        }
+        },
       ],
-      data: [{}, {}, {}],
+      addFabricData: [],
       loading: false, // 表格加载
-      editFabric: {},
+      addFabric: {},
       visible: false,
       confirmLoading: false,
+      validatorRules: { },
       dateFormat: 'YYYY-MM-DD'
     }
   },
@@ -361,23 +365,22 @@ export default {
       console.log('点击抽屉取消')
       this.close()
     },
+ 
 
     // -------------------------------------
     close() {
       this.$emit('close')
       this.visible = false
-      this.$refs.form.resetFields()
+      this.addFabric = {}
+      this.addFabricData = []
     },
-    // - father------------------------------------
-    aa() {},
-    modalFormOk() {}
 
-    // 分页、排序、筛选变化时触发
+     // 分页、排序、筛选变化时触发
     // handleTableChange(pagination, filters, sorter) {
     //   // console.log('当前页信息>>>>',pagination)
     //   this.queryParam.pageNo = pagination.current
     //   this.getAnnList()
-    // }'
+    // }
   }
 }
 </script>

+ 28 - 9
src/views/packing-list/packinglist-fabrics/referShipDetailsModal.vue

@@ -29,6 +29,12 @@
                </a-select>
               </a-form-item>
             </a-col>
+            
+            <a-col :md="6" :sm="8">
+              <a-form-item label="成衣工厂">
+                <a-input placeholder="请输入成衣工厂" v-model="queryParam.garmentFactory"></a-input>
+              </a-form-item>
+            </a-col>
 
 
             <template v-if="toggleSearchStatus">
@@ -83,7 +89,6 @@
       <a-table
         :columns="referShipDetailsColumns"
         :data-source="referShipDetailsData"
-        :row-key="groupId"
         :loading="loading"
         :pagination="pagination"
         :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
@@ -115,6 +120,7 @@ export default {
       token:'',
       config:null,
       selectedRowKeys: [], // 勾选航
+      selectedRows:[],
       loading: false, // 表格加载
       preDeliveryDate:[],
       // 表头
@@ -133,6 +139,12 @@ export default {
           fixed: 'left',
           className: 'replacecolor'
         },
+        {
+          title: '成衣工厂',
+          dataIndex: 'garmentFactory',
+          width: 120,
+          className: 'replacecolor'
+        },
 
         {
           title: '客户简称',
@@ -276,12 +288,6 @@ export default {
           width: 120,
           className: 'replacecolor'
         },
-        {
-          title: '成衣工厂',
-          dataIndex: 'garmentFactory',
-          width: 120,
-          className: 'replacecolor'
-        },
         {
           title: '报关单价',
           dataIndex: 'customsDeclarationUnitPrice',
@@ -295,6 +301,7 @@ export default {
 
       // 查询条件
       queryParam: {
+        garmentFactory:'',//成衣工厂
         documentNo: '',
         chineseName: '',
         status:'',
@@ -351,11 +358,12 @@ export default {
        if (this.selectedRowKeys.length == 0) {
         this.$message.error('请选择数据');
       } else{
-        this.$emit('callback', this.selectedRowKeys,this.token);
+        this.$emit('callback', this.selectedRows,this.token);
         this.referShipDetailsModVis = false;
         var msg = "选中记录后,会清除编辑的内容。";
         this.$message.info(msg);        
         this.selectedRowKeys = [];
+        this.selectedRows = []
       }
     },
     close() {
@@ -370,7 +378,18 @@ export default {
     },
     // 选中行
     onSelectChange(keys, rows) {
-      this.selectedRowKeys = keys
+      var garmentFactoryArr = []
+      rows.map(item =>garmentFactoryArr.push(item.garmentFactory) )
+      garmentFactoryArr = [...new Set(garmentFactoryArr)]
+      if(garmentFactoryArr.length>1){
+        this.$message.info('必须选择相同成衣工厂,请重新选择!');        
+        this.selectedRowKeys = []
+        this.selectedRows = []
+      }else{
+        this.selectedRowKeys = keys
+        this.selectedRows = rows
+      }
+
     },
     handleTableChange(pagination, filters, sorter) {
       this.queryParam.pageNo = pagination.current