ソースを参照

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-web

fenghaifu 2 年 前
コミット
7a32754341

+ 36 - 9
src/views/advance-packingList/adPaList-clothes.vue

@@ -88,7 +88,8 @@
     <a-card :bordered="false" style="margin:10px 0">
       <div class="table-operator">
         <a-button type="primary" @click="addAdpacking" icon="plus">新增</a-button>
-        <a-button type="primary" icon="download" @click="handleExportXls('预装箱单-成衣')">导出</a-button>
+        <a-button type="primary" icon="download" @click="handleExportXls('预装箱单-成衣','0')">报表模版导出</a-button>
+        <a-button type="primary" icon="download" @click="handleExportXls('预装箱单-成衣','1')">成衣模版导出</a-button>
         <a-upload productName="file" :showUploadList="false"  :multiple="false"  :headers="tokenHeader"  :action="importExcelUrl"   @change="handleImportExcel">
           <a-button type="primary" icon="import">导入</a-button>
         </a-upload>
@@ -124,7 +125,7 @@
 
         <!-- 操作 默认按钮  未提交未推送-->
         <span slot="operationSlot" slot-scope="text, record">
-          <a href="javascript:void(0);" @click="itemXls(record)" style="color:green">导出</a>
+          <a href="javascript:void(0);" @click="itemXls(record,'0')" style="color:green">报表模版导出</a>
 
           <a-divider type="vertical" />
 
@@ -138,7 +139,13 @@
 
               <a-menu-item>
                 <a @click="edit(record)">编辑</a>
+                
               </a-menu-item>
+              <a-menu-item>
+                <a href="javascript:void(0);" @click="itemXls(record,'1')" >成衣模版导出</a>              
+              </a-menu-item>
+          
+
 
               <!-- <a-menu-item>
                 <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
@@ -158,6 +165,9 @@
               <a-menu-item>
                 <a @click="details(record)">详情</a>
               </a-menu-item>
+              <a-menu-item>
+                <a href="javascript:void(0);" @click="itemXls(record,'1')" >成衣模版导出</a>              
+              </a-menu-item>
             </a-menu>
 
             <!-- 已提交 且 推送失败  -->
@@ -171,6 +181,9 @@
                   <a href="javascript:void(0);" style="color:green;">重新推送</a>
                 </a-popconfirm>
               </a-menu-item>
+              <a-menu-item>
+                <a href="javascript:void(0);" @click="itemXls(record,'1')" >成衣模版导出</a>              
+              </a-menu-item>
             </a-menu>
 
             <!-- 已提交 -->
@@ -184,6 +197,9 @@
                   <a href="javascript:void(0);" style="color:red;">取消提交</a>
                 </a-popconfirm>
               </a-menu-item> -->
+              <a-menu-item>
+                <a href="javascript:void(0);" @click="itemXls(record,'1')" >成衣模版导出</a>              
+              </a-menu-item>
 
               <a-menu-item>
                 <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
@@ -203,6 +219,9 @@
                   <a href="javascript:void(0);" style="color:green;">推送</a>
                 </a-popconfirm>
               </a-menu-item>
+              <a-menu-item>
+                <a href="javascript:void(0);" @click="itemXls(record,'1')">成衣模版导出</a>              
+              </a-menu-item>
             </a-menu>
           </a-dropdown>
         </span>
@@ -440,7 +459,7 @@ export default {
           title: '操作',
           dataIndex: 'operation',
           scopedSlots: { customRender: 'operationSlot' },
-          width: 120,
+          width: 180,
           fixed: 'right',
           className: 'replacecolor'
         }
@@ -460,7 +479,11 @@ export default {
         // pageSize: 0
       },
       selectedRowKeys: [], // 勾选航
-      dateFormat: 'YYYY-MM-DD'
+      dateFormat: 'YYYY-MM-DD',
+      url: {
+        list: '/sys/user/list',
+        importExcelUrl: '/spapl/syPreAssembledPackingList/importExcel3' // 导入
+      },
     }
   },
   created() {
@@ -566,8 +589,9 @@ export default {
     },
 
     // 列表导出
-    handleExportXls(fileName) {
-      downFile('/spapl/syPreAssembledPackingList/exportXls').then(data => {
+    handleExportXls(fileName,sta) {
+      var data = sta
+      downFile('/spapl/syPreAssembledPackingList/exportXls',{status:data}).then(data => {
         if (!data) {
           this.$message.warning('文件下载失败')
           return
@@ -588,6 +612,7 @@ export default {
       })
     },
 
+
     //  删除
     handleDelete(record) {
       console.log('点击删除项id:', record.id)
@@ -624,8 +649,9 @@ export default {
     },
 
     // 操作 单条数据导出
-    itemXls(record) {
-       downFile('/spapl/syPreAssembledPackingList/exportXls',{id:record.id}).then(data => {
+    itemXls(record,sta) {
+      var data = sta
+       downFile('/spapl/syPreAssembledPackingList/exportXls',{id:record.id,status:data}).then(data => {
          if (!data) {
           this.$message.warning('文件下载失败')
           return
@@ -818,7 +844,8 @@ export default {
   computed: {
     // 导入
     importExcelUrl() {
-      //   return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+        // this.
     },
     // 选中项
     rowSelection() {

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

@@ -210,6 +210,12 @@
                 </a-form-model-item>
               </a-col>
 
+              <a-col :md="6" :sm="8">
+                <a-form-model-item label="体积" prop="totalVolume"> 
+                  <a-input placeholder="请输入体积" v-model="addBook.totalVolume" readOnly></a-input>
+                </a-form-model-item>
+              </a-col>
+
              
 
               <!-- <a-col :md="6" :sm="8">
@@ -259,7 +265,7 @@
               <!-- 集装箱号 输入框-->
               <template slot="containerNumber" slot-scope="text, record, index">
                 <a-form-model-item prop="containerNumber" :rules="rules.containerNumber">
-                  <a-input style="width:100%" type="text" v-model="record.containerNumber" />
+                  <a-input style="width:100%" type="text" v-model="record.containerNumber" @blur="changeContainerNumber"/>
                 </a-form-model-item>
               </template>
 
@@ -596,7 +602,7 @@ export default {
     },
 
     // 参照装箱单
-    referPackingList(data) {
+    referPackingList(data) {   
       console.log('打开参照装箱单')
       if(data === '0'){
          this.$refs.packingListModal.packingListModVis = true
@@ -614,7 +620,7 @@ export default {
          }
       }
     },
-    referCallback(data){
+    referCallback(data,text){
       data.map(item=>{
          item.readyFabric=item.readyFabric
          item.tailoringFabricItemId=item.itemId
@@ -622,13 +628,14 @@ export default {
          item.clientAbbreviation = item.customerAbbreviation
          item.styleNumber = item.itemNumber
          item.boxNumber = item.planQuantity
-         var str = item.preDeliveryDate
-         var n=str.split(" ");
-         item.preDeliveryDate = n[0]
-         item.price = (item.totalPrice/item.netWeight).toFixed(2)
+     
          item.netWeight = (Number(item.netWeight)).toFixed(2)
          item.grossWeight = (Number(item.grossWeight)).toFixed(2)
          item.number = (Number(item.number)).toFixed(2)
+         //参照面料时,单价许计算 金额/净重
+         if(item.readyFabric == '面料'){
+            item.price = (item.totalPrice/item.netWeight).toFixed(2)
+         }
       })
         // var subList = this.convertReferToSub(data);
         this.addBookData = this.addBookData.concat(data);
@@ -637,6 +644,29 @@ export default {
         this.addBook.exportPort='宁波'
         var dd = moment(new Date()).format('YYYY-MM-DD')
          this.$set( this.addBook,'shippingOrderDate',dd)
+         //参照成衣是表头数据默认值
+         if(text == '成衣'){
+           var transitionData = data[0]
+           this.addBook = {
+             shippingOrderNumber:transitionData.depositaryReceiptNo,
+             shippingOrderDate:transitionData.shippingOrderDate,
+             unitInOperation:transitionData.unitInOperation,
+             unitInOperationAddress:transitionData.unitInOperationAddress,
+             latestDateOfShipment:transitionData.latestDateOfShipment,
+             theFinalShippingDate:transitionData.theFinalShippingDate,
+             tradeCountry:transitionData.tradeCountry,
+             arriveInCountry:transitionData.arriveInCountry,
+             consignee:transitionData.consignee,
+             consigneeAddress:transitionData.consigneeAddress,
+             notifyParty:transitionData.notifyParty,
+             notifyPartyAddress:transitionData.notifyPartyAddress,
+             exportPort:transitionData.exportPort,
+             destinationPort:transitionData.destinationPort,
+             exchangeEarningsValue:transitionData.exchangeEarningsValue,
+             termsOfDeliveryvalue:transitionData.termsOfDeliveryvalue,
+             totalVolume:transitionData.totalVolume,
+           }
+         }
         this.setHeadCalField()
     },
 
@@ -719,17 +749,34 @@ export default {
     },
         // 设置表头计算值,直接设置表头值对象不能刷新,把表头对象换了就可以了
     setHeadCalField(){
+      var containerNumberArr = [],
+          readyFabricArr = []
       var headData = JSON.parse(JSON.stringify(this.addBook));
       var moneyAll = 0;
       for (var i=0; i<this.addBookData.length; i++){
         var rowData = this.addBookData[i];
+        if(rowData.readyFabric == '面料'){
+          containerNumberArr.push(rowData.containerNumber)
+          readyFabricArr.push(rowData.readyFabric)
+        }
+        
         if (rowData.totalPrice != undefined && rowData.totalPrice != ""){
           moneyAll += rowData.totalPrice*1;
         }
       }
+      containerNumberArr = [...new Set(containerNumberArr)]
+      readyFabricArr = [...new Set(readyFabricArr)]
+      if(readyFabricArr.length == 1 && readyFabricArr[0] == '面料'){
+        headData.totalVolume = (containerNumberArr.length)*68;
+      }
       headData.money = moneyAll;
       this.addBook = headData;
     },
+
+    //集装箱号修改
+    changeContainerNumber(){
+      this.setHeadCalField()
+    },
     // // 新增托书 子表合计
     // addBookFooterShow(data) {
     //   console.log('新增托书 子表 ----合计行')

+ 4 - 4
src/views/book/book-list.vue

@@ -13,8 +13,8 @@
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="单日期" has-feedback>
-                <a-date-picker style="width: 100%" v-model="queryParam.orderDate"> </a-date-picker>
+              <a-form-item label="单日期" has-feedback>
+                <a-date-picker style="width: 100%" v-model="queryParam.shippingOrderDate"> </a-date-picker>
               </a-form-item>
             </a-col>
 
@@ -120,7 +120,7 @@
               <!-- <a-menu-item><a @click="submit(record)">提交</a></a-menu-item> -->
               <a-menu-item><a @click="edit(record,'2')">详情</a></a-menu-item>
               <a-menu-item><a @click="edit(record,'1')">编辑</a></a-menu-item>
-              <a-menu-item><a @click="print(record)">打印</a></a-menu-item>
+              <!-- <a-menu-item><a @click="print(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>
@@ -331,7 +331,7 @@ export default {
           let link = document.createElement('a')
           link.style.display = 'none'
           link.href = url
-          link.setAttribute('download', item + '.xlsx')
+          link.setAttribute('download', record.shippingOrderNumber+item + '.xlsx')
           document.body.appendChild(link)
           link.click()
           document.body.removeChild(link) // 下载完成移除元素

+ 1 - 1
src/views/book/packingListModal.vue

@@ -408,7 +408,7 @@ export default {
         this.$message.error('所勾选数据与已存在数据'+fatherCc+'必须相同!');
         this.errorFather = []
       }else{
-        this.$emit('callback',this.selectedRows)
+        this.$emit('callback',this.selectedRows,'成衣')
         this.close()
       }
     },

+ 2 - 2
src/views/book/packingListModalFabrics.vue

@@ -174,7 +174,7 @@ export default {
         },
         {
           title: '总件数',
-          dataIndex: 'total',
+          dataIndex: 'number',
           width: 120,
           ellipsis: true,
           className: 'replacecolor'
@@ -249,7 +249,7 @@ export default {
         this.$message.error('所勾选的数据必须与已存在数据成衣工厂必须相同!');
         this.errorFather = []
       }else{
-        this.$emit('callback',this.selectedRows)
+        this.$emit('callback',this.selectedRows,'面辅料')
         this.close()
       }
     },

+ 1 - 0
src/views/order/orderList.vue

@@ -304,6 +304,7 @@ export default {
     // 查询按钮
     searchQuery() {
       this.queryParam.pageNo = ''
+      this.toggleSearchStatus = false
       this.getOrderList()
       // console.log('发货状态', this.queryParam.dilivery)
     },

+ 1 - 1
src/views/packing-list/clothes-list.vue

@@ -486,7 +486,7 @@ export default {
         // delete: '/sys/user/delete',
         // deleteBatch: '/sys/user/deleteBatch',
         exportXlsUrl: '/sys/user/exportXls', // 导出
-        importExcelUrl: 'sys/user/importExcel' // 导入
+        importExcelUrl: '/splt/syPackingListTailoring/importExcel3' // 导入
       }
     }
   },

+ 9 - 1
src/views/packing-list/packinglist-fabrics/addFabricDrawer.vue

@@ -658,7 +658,7 @@ export default {
             }
             this.addFabricData = this.addFabricData.concat(data.syPackingListFabricItem )
             this.addFabricData.map(item =>{
-              item.inventoryQuantity = 0
+              // item.inventoryQuantity = 0
               item.meter = 0
               item.excessQuantity = item.actualDeclaredQuantity - item.remainingQuantity
               if(item.excessQuantity < 0){
@@ -669,6 +669,10 @@ export default {
               }else {
                  this.manualYarnDisabled = false
               }
+              var code = item.inventoryCcode.slice(0,2)
+              if(!((code =='03' || code == '04') && (item.inventoryCcode !== '0399' || item.inventoryCcode !== '0499'))){
+                item.actualDeclaredQuantity = item.inventoryQuantity
+              }
             })
           }else {
             this.$message.error(res.message);
@@ -681,6 +685,10 @@ export default {
       }else {
         event.meter = 0
       }
+      var code = event.inventoryCcode.slice(0,2)
+      if((code =='03' || code == '04') && (event.inventoryCcode !== '0399' || event.inventoryCcode !== '0499')){
+        event.actualDeclaredQuantity = event.meter
+      }
     },
     // 増行
     handleAddColumn() {

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

@@ -382,7 +382,6 @@ export default {
         this.close()
         // var msg = "选中记录后,会清除编辑的内容。";
         // this.$message.info(msg);        
-        this.fatherFactory = ''
       }
     },
     close() {
@@ -392,6 +391,7 @@ export default {
       }
       this.preDeliveryDate = []
       this.referShipDetailsModVis = false
+      this.fatherFactory = ''
       this.defulatSelect()
     },
     handleCancel() { 

+ 22 - 1
src/views/pre-book/preBookList.vue

@@ -135,6 +135,7 @@ import moment from 'moment'
 
 import addPreBookDrawer from '@views/pre-book/addPreBookDrawer.vue'
 import detailsPreBookDrawer from '@views/pre-book/detailsPreBookDrawer.vue'
+import { downFile } from '@/api/manage'
 import editPreBookDrawer from '@views/pre-book/editPreBookDrawer.vue'
 
 import { preBookList, addPreBook, preBookById, editById,deletePreBook,submit,cancelSubmit } from '@api/document/pre-book.js'
@@ -409,7 +410,27 @@ export default {
     },
 
     // 操作 打印
-    print(record) {},
+    print(record) {
+      downFile('/letterDeposit/syLetterDeposit/printSyletterDeposit',{id:record.id}).then(data => {
+        if (!data) {
+          this.$message.warning('文件下载失败')
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), item + '.xlsx')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', item + '.xlsx')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
+    },
 
     handleTableChange(pagination, filters, sorter) {
       this.queryParam.pageNo = pagination.current

+ 10 - 1
src/views/reportForms/fabric-loss-table.vue

@@ -108,6 +108,11 @@
           bordered
           :pagination="false"
         >
+          <template slot="omcVenAbbName" slot-scope="text, record, index">
+              <div v-for="(item,index) in record.omcVenAbbName" :key="index">
+                {{item}}
+              </div>
+          </template>
           <!-- 采购数量 弹框-->
           <span slot="purchaseQuantity" slot-scope="text">
             <a>{{ text }}</a>
@@ -422,7 +427,7 @@ export default {
 
         { title: '采购供应商', dataIndex: 'cvenAbbName', width: 100, className: 'replacecolor' },
         { title: '分配数量', dataIndex: 'iquantityOut', width: 80, className: 'replacecolor' },
-        { title: '委外供应商', dataIndex: 'omcVenAbbName', width: 100, className: 'replacecolor' },
+        { title: '委外供应商', dataIndex: 'omcVenAbbName', width: 100, className: 'replacecolor',scopedSlots: { customRender: 'omcVenAbbName' }, },
         {
           title: '余纱',
           dataIndex: 'iquantityLeft',
@@ -655,6 +660,10 @@ export default {
               else
                 this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsAll;
               this.fabricLoss = res.result;
+              this.fabricLoss.fabricPoOrderList.map(item => {
+                item.omcVenAbbName = item.omcVenAbbName ? (item.omcVenAbbName.split(",")) : ''
+                debugger
+              })
             }else{
               this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[]};
               this.$message.info(res.message);

+ 4 - 5
src/views/shipment-details/referOrderDataModal.vue

@@ -70,14 +70,14 @@
                 </a-form-item>              
               </a-col>
 
-               <!-- <a-col :md="5" :sm="8">
+               <a-col :md="5" :sm="8">
                 <a-form-model-item label="是否被参照">
                   <a-select v-model="queryParam.refer">
                     <a-select-option value="1">是</a-select-option>
                     <a-select-option value="0">否</a-select-option>
                   </a-select>
                 </a-form-model-item>
-              </a-col> -->
+              </a-col>
 
               <a-col :md="5" :sm="8">
                 <a-form-item label="订单日期">
@@ -530,7 +530,7 @@ export default {
           this.error = ''
       }else if(this.queryParam.account == '901' && this.garmentArr.includes("")){
           this.$message.error('含有成衣工厂为空的数据,请重新选择!');
-      }else if(this.queryParam.account == '903' && !(this.customerArr.length==1 && this.customerArr[0] == '香港森语')){
+      }else if(this.queryParam.account == '903' && !((this.customerArr.length==1 && this.customerArr[0] == '香港森语') || (this.customerArr.length==1 && this.customerArr[0] == '森语集团'))){
           this.$message.error('含有客户简称不为香港森语的数据,请重新选择!');
       }else{
         var garment = ''
@@ -677,8 +677,7 @@ export default {
 
     close() {
       this.referOrderDataModVis = false;
-      this.queryParam = {}
-      this.$emit('close')
+      this.$emit('close',this.queryParam.flourOrGarment)
       this.searchReset();
     },
     handleCancel() {

+ 38 - 8
src/views/shipment-details/shipmentList.vue

@@ -119,8 +119,10 @@
     <a-card :bordered="false" style=" marginTop:10px;">
       <div class="table-operator">
         <!-- <a-button type="primary" @click.stop="addShipDet" icon="plus">新增</a-button> -->
-        <a-button type="primary" @click.stop="referOrderDataOpen" icon="plus">参照订单数据</a-button>
-        <a-button type="primary" icon="download" @click="handleExportXls('箱单数据')">箱单数据导出</a-button>
+        <a-button type="primary" @click.stop="referOrderDataOpen" icon="plus" >参照订单数据</a-button>
+        <a-button type="primary" icon="download" @click="handleExportXls('出运成衣')">出运成衣数据导出</a-button>
+        <a-button type="primary" icon="download" @click="handleExportXls('出运面辅料')">出运面辅料数据导出</a-button>
+        <a-button type="primary" icon="download" @click="exportXlsShipment('明细')">出运明细导出</a-button>
         <a-button type="primary" icon="check" @click="submit">批量提交</a-button>
         <a-button type="primary" icon="close" @click="cancelSubmit">批量取消提交</a-button>
       </div>
@@ -613,8 +615,7 @@ export default {
     // 分页查询 发运明细
     async getShipmentList() {
       this.loading = true
-      await  shipmentList(this.queryParam)
-         .then(res => {
+      await  shipmentList(this.queryParam).then(res => {
           if (res.success) {
            this.loading = false
            this.shipmentListData = res.result.records
@@ -626,8 +627,10 @@ export default {
               current: res.result.current,
               pageSize: res.result.size
             }
+          }else {
+             this.$message.error(res.message)
+             this.loading = false
           }
-          return  this.shipmentListData
         })
     },
 
@@ -709,7 +712,6 @@ export default {
 
     // 导出
     handleExportXls(fileName) {
-  
       downFile('/shippingDetails/syShippingDetails/exportXls',this.queryParam).then(data => {
         if (!data) {
           this.$message.warning('文件下载失败')
@@ -731,6 +733,29 @@ export default {
       })
     },
 
+    //明细导出
+    exportXlsShipment(fileName){
+      downFile('/shippingDetails/syShippingDetails/exportXlsShipping',this.queryParam).then(data => {
+        if (!data) {
+          this.$message.warning('文件下载失败')
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', fileName + '.xls')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
+    },
+
     //  编辑
     edit(record) {
       this.$refs.editShipDetDrawer.visible = true
@@ -887,6 +912,8 @@ export default {
       this.toggleSearchStatus = false
       if(this.queryParam.flourOrGarment === '' || !this.queryParam.hasOwnProperty('flourOrGarment')){
        this.$message.error('请选择查询类型!');
+      }else if(this.queryParam.flourOrGarment == '0' && this.preDeliveryDate.length == 0){
+        this.$message.error('请选择预发货时间!');
       }else{
          if(this.preDeliveryDate.length ==2){
             var separator = "-"; //日期分隔符  
@@ -943,11 +970,14 @@ export default {
     },
 
     //关闭新增弹窗
-    closeAdd(){
+    async closeAdd(data){
       this.queryParam ={}
+      this.queryParam.flourOrGarment = data
       this.timeRange = []
       this.preDeliveryDate = []
-      this.shipmentListData = [] // 渲染 发运明细列表
+      // this.shipmentListData = [] // 渲染 发运明细列表
+     await this.getShipmentList()
+      this.queryParam = {}
       this.defalutDate()
     }
   }