Forráskód Böngészése

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun-pc

ccjgmwz 3 éve
szülő
commit
08f28e4869

+ 24 - 23
public/static/warehousePrint.html

@@ -178,12 +178,12 @@
   </head>
   <body>
     <div id="app">
-      <div v-for="(item,index) in printData1" :key="index">
       <div class="center">
-        <div class="title">**公司-***仓库出/入库单</div>
+        <div class="title">黑龙江中天昊元贸易有限公司-{{warehouseName}}仓库<span v-if="type == '2'">出</span><span v-if="type == '3'">入</span>库单</div>
         <table class="table">
             <tr class="row">
-                 <th>出库日期</th>
+                 <th v-if="type == '2'">出库日期</th>
+                 <th v-if="type == '3'">入库日期</th>
                  <th>合同/业务编号</th>
                  <th>客户</th>
                  <th>货名</th>
@@ -194,25 +194,25 @@
                  <th>皮重</th>
                  <th>净重</th>
             </tr>
-            <div>
-          <tr class="row">
-            <td class="col">买方</td>
-            <td class="col">单位名称</td>
-            <td class="col">{{ item.compName}}</td>
-            <td class="col">卖方</td>
-            <td class="col">姓名</td>
-            <td class="col">{{ item.customerName}}</td>
-            <td class="col">{{ item.customerName}}</td>
-            <td class="col">{{ item.customerName}}</td>
-            <td class="col">{{ item.customerName}}</td>
-            <td class="col">{{ item.customerName}}</td>
+            <!-- <div v-for="(item,index) in printData"> -->
+         <tr class="row" v-for="(item,index) in printData">
+            <td class="col">{{item.inOutDate}}</td>
+            <td class="col">{{item.contractNo}}</td>
+            <td class="col">{{item.companyName}}</td>
+            <td class="col">{{item.goodsName}}</td>
+            <td class="col">{{item.carNo}}</td>
+            <td class="col">{{item.boxNo}}<span v-if="item.boxNoOther">,</span>{{item.boxNoOther}}</td>
+            <td class="col">{{item.boxNo}}<span v-if="item.boxNoOther">,</span>{{item.boxNoOther}}</td>
+            <td class="col">{{item.grossWeight}}</td>
+            <td class="col">{{item.tare}}</td>
+            <td class="col">{{item.netWeight}}</td>
           </tr>
-        </div>
+        <!-- </div> -->
         </table>
         <!-- <div class="bottom">
         </div> -->
       </div>
-    </div>
+    
     </div>
   </body>
   <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
@@ -235,6 +235,8 @@
         customerList1: [],
        
         date: '',
+        warehouseName:"",
+        type:"",
      
       },
       computed: {},
@@ -269,13 +271,12 @@
       },
       mounted() {
         this.date = new Date().toLocaleString()
-        // let _data = decodeURIComponent(this.getQueryVariable('dataList'))
-        // console.log("cdsjkvdjkljklkcj",JSON.parse(_data))
-        // inOutRecord_print
-        this.printData = JSON.parse(sessionStorage.getItem('inOutRecord_printBD'))
-        this.printData1 = JSON.parse(sessionStorage.getItem('inOutRecord_printJSD'))
+        this.type = decodeURIComponent(this.getQueryVariable('type'))
+        this.warehouseName = decodeURIComponent(this.getQueryVariable('warehouseName'))
+        this.printData = JSON.parse(sessionStorage.getItem('inOutWarehouse_Print'))
         console.log("磅单",this.printData)
-        console.log("结算单",this.printData1)
+        
+        console.log(this.printData % 17)
         // document.title = this.printData.compName + '结算凭证'
         window.print()
         window.onafterprint = function(event) {

+ 2 - 1
public/static/weightCheck.html

@@ -438,8 +438,9 @@
         } else {
           this.tableData = JSON.parse(_data)
           console.log(this.tableData)
-
         }
+        // sessionStorage.setItem('record_print', JSON.stringify(response))
+        this.tableData = JSON.parse(sessionStorage.getItem("record_print"))
 
         document.title = "粮食检斤单"
         window.print()

+ 3 - 0
src/api/V2/warehouse/index.js

@@ -82,5 +82,8 @@ export const API_GET_CHECKORUPDATE = '/inOutWarehouseTask/api/checkOrUpdateInOut
 export const API_GET_RECEIPTTASKNO = '/inOutWarehouseTask/selectInOutWarehouseNo'
 //导出
 export const API_POST_EXPORT = '/warehouseBaseInfo/export'
+//打印增量
+export const API_GET_PRINT = '/commonConstantFalse/getInfo'
+
 
 

+ 1 - 2
src/components/mapdrag/indexMap.vue

@@ -157,11 +157,10 @@
         this.listData = val1
         var that = this
         this.makeJsonData()
-        AMapLoader.reset();
         AMapLoader.load({
           "key": "211dd6f989e719022aaf47ddb0659c47", // 申请好的Web端开发者Key,首次调用 load 时必填
           "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
-          "plugins": ['plugin=AMap.Scale', 'AMap.ToolBar'],
+          "plugins": ['plugin=AMap.Scale', 'AMap.ToolBar','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch'],
           "Loca": { // 是否加载 Loca, 缺省不加载
             "version": '2.0.0' // Loca 版本,缺省 1.3.2
           },

+ 27 - 38
src/components/mapdrag/mapdrag.vue

@@ -126,6 +126,7 @@
     TextToCode
   } from 'element-china-area-data'
   import image from '../../../public/img/ic_locationmarker.jpg'
+  import AMapLoader from '@amap/amap-jsapi-loader';
   export default {
     data() {
       return {
@@ -168,17 +169,26 @@
       }
     },
     async created() {
-      AMapLoader.reset();
+      
+        
+    },
+    mounted() {
+      // AMapLoader.reset();
       // 已载入高德地图API,则直接初始化地图
       if (window.AMap && window.AMapUI) {
         // 未载入高德地图API,则先载入API再初始化
       } else {
-        await remoteLoad(`http://webapi.amap.com/maps?v=1.3&key=${MapKey}`)
-        await remoteLoad('http://webapi.amap.com/ui/1.0/main.js')
-      }
-    },
-    mounted() {
-      // console.log(this)
+        // await remoteLoad(`http://webapi.amap.com/maps?v=1.3&key=${MapKey}&plugin=AMap.AutoComplete`)
+        // await remoteLoad('http://webapi.amap.com/ui/1.0/main.js')
+        //  AMapLoader.reset();
+        AMapLoader.load({
+          "key": "211dd6f989e719022aaf47ddb0659c47", // 申请好的Web端开发者Key,首次调用 load 时必填
+          "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
+          "plugins": ['plugin=AMap.Scale', 'AMap.ToolBar','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch'],
+          "Loca": { // 是否加载 Loca, 缺省不加载
+            "version": '2.0.0' // Loca 版本,缺省 1.3.2
+          },
+        }).then((AMap) => {
       setTimeout(() => {
         var that = this
         this.map = new AMap.Map('mapContainer', {
@@ -208,9 +218,9 @@
           map: that.map,
         })
         AMap.plugin(
-          ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch'],
+          ['AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch'],
           function() {
-            var autocomplete = new AMap.Autocomplete({
+            var autocomplete = new AMap.AutoComplete({
               input: 'searchValue',
             })
             var placeSearch = new AMap.PlaceSearch({
@@ -225,8 +235,7 @@
               level: 'city',
               showbiz: false,
             });
-
-            AMap.event.addListener(autocomplete, 'select', function(e) {
+            autocomplete.on( 'select', function(e) {
               that.marker.setMap(that.map)
               if (e.poi.location) {
                 placeSearch.search() // 关键字查询查询
@@ -283,10 +292,9 @@
             that.map.on('moveend', function(e) {
               //地图变动之后需要重新赋值省市区,未完成
               that.center = that.map.getCenter(); //获取当前地图中心位置
+              console.log(that.center)
               that.center.lat = Number(that.center.lat.toFixed(3))
               that.center.lng = Number(that.center.lng.toFixed(3))
-              that.center.Q = Number(that.center.Q.toFixed(3))
-              that.center.R = Number(that.center.R.toFixed(3))
               for (var i = 0, l = that.polygons.length; i < l; i++) {
                 that.polygons[i].setMap(null)
               }
@@ -313,10 +321,9 @@
               //地图变动之后需要重新赋值省市区,未完成
               // this.zoom = map.getZoom(); //获取当前地图级别
               that.center = that.map.getCenter(); //获取当前地图中心位置
+              console.log(that.center)
               that.center.lat = Number(that.center.lat.toFixed(3))
               that.center.lng = Number(that.center.lng.toFixed(3))
-              that.center.Q = Number(that.center.Q.toFixed(3))
-              that.center.R = Number(that.center.R.toFixed(3))
               for (var i = 0, l = that.polygons.length; i < l; i++) {
                 that.polygons[i].setMap(null)
               }
@@ -339,29 +346,6 @@
                 }
               })
             });
-            // that.map.on('click', function (e) {
-            //   for (var i = 0, l = that.polygons.length; i < l; i++) {
-            //     that.polygons[i].setMap(null)
-            //   }
-            //   that.marker.setMap(that.map)
-            //   that.marker.setPosition(e.lnglat)
-            //   geocoder.getAddress(e.lnglat, function (status, result) {
-            //     if (status === 'complete') {
-            //       var obj = {}
-            //       that.province = result.regeocode.addressComponent.province
-            //       that.city = result.regeocode.addressComponent.city
-            //       that.district = result.regeocode.addressComponent.district
-            //       obj.formattedAddress = result.regeocode.formattedAddress
-            //       obj.areacode = result.regeocode.addressComponent.adcode
-            //       that.address = result.regeocode.formattedAddress
-            //       obj.lat = e.lnglat.lat
-            //       obj.lng = e.lnglat.lng
-            //       that.$emit('pickedAddress', obj)
-            //     } else {
-            //       that.$emit('pickedAddress', '')
-            //     }
-            //   })
-            // })
             // 根据坐标点定位,获取地址的详细信息
             if (that.position) {
               that.marker.setMap(that.map)
@@ -386,6 +370,11 @@
         )
       }, 500)
       this.loadmap()
+        // this.loadmap()
+        }).catch(e => {
+          console.log(e);
+        })
+      }
     },
     methods: {
       positions() {

+ 1 - 1
src/components/mapdrag/warehouseReceiptMap.vue

@@ -77,7 +77,7 @@
         this.initMap()
         // 未载入高德地图API,则先载入API再初始化
       } else {
-        await remoteLoad(`http://webapi.amap.com/maps?v=1.3&key=${MapKey}`)
+        await remoteLoad(`http://webapi.amap.com/maps?v=1.3&key=${MapKey}&plugin=AMap.AutoComplete`)
         await remoteLoad('http://webapi.amap.com/ui/1.0/main.js')
         this.initMap()
       }

+ 9 - 9
src/main.js

@@ -15,8 +15,8 @@ window.$crudCommon = crudCommon;
 import vendors from '@/vendors'
 const { router, store } = vendors
 Vue.config.productionTip = false
-import AMap from 'vue-amap';
-Vue.use(AMap);
+// import AMap from 'vue-amap';
+// Vue.use(AMap);
 import imgPreview from '@/components/imgPreview'
 Vue.use(imgPreview)
 import echarts from "echarts";
@@ -27,13 +27,13 @@ import Warehouse from './common.js'
 Vue.prototype.WAREHOUSE = Warehouse.houseName
 Vue.prototype.common = Warehouse
 // 初始化vue-amap
-AMap.initAMapApiLoader({
-  // 高德key
-  key: 'd5486742b76ab0969e4c3ce26f46dfc6',
-  // 插件集合 (插件按需引入)
-  plugin: ['AMap.Geolocation', 'Geolocation', 'AMap.DistrictSearch', "AMap.PlaceSearch",],
-  v: '1.4.4'
-});
+// AMap.initAMapApiLoader({
+//   // 高德key
+//   key: 'd5486742b76ab0969e4c3ce26f46dfc6',
+//   // 插件集合 (插件按需引入)
+//   plugin: ['AMap.Geolocation', 'Geolocation', 'AMap.DistrictSearch', "AMap.PlaceSearch",'AMap.Autocomplete', 'AMap.Geocoder', 'AMap.DistrictSearch'],
+//   v: '1.4.4'
+// });
 // ------------ 通过域名判断起始的登陆页面 开始 --------------------
 //使用login的Url
 // const urls = [

+ 3 - 0
src/model/warehouse/index.js

@@ -40,6 +40,7 @@ import {
     API_GET_CHECKORUPDATE,
     API_GET_RECEIPTTASKNO,
     API_POST_EXPORT,
+    API_GET_PRINT
 } from '@/api/V2/warehouse'
 // import { app } from 'electron'
 // 列表
@@ -121,4 +122,6 @@ export const postcheckorupdate = appRx.post(API_GET_CHECKORUPDATE,errorCatcher,
 export const getReceiptTaskNo = appRx.get(API_GET_RECEIPTTASKNO,errorCatcher, errorHandle, filter)
 //导出
 export const postExport = appRx.post(API_POST_EXPORT)
+//打印增量
+export const  printAdd = appRx.get(API_GET_PRINT,errorCatcher, errorHandle, filter)
 

+ 2 - 0
src/views/contractManagement/futuresPurchaseContractAdd.vue

@@ -1887,6 +1887,8 @@
   .address-btn {
     width: 100%;
     text-align: left;
+    color:#000;
+    border:1px solid #ccc;
   }
 
   .inline-input {

+ 2 - 0
src/views/contractManagement/futuresPurchaseContractEdit.vue

@@ -1971,6 +1971,8 @@ export default {
 .address-btn {
   width: 100%;
   text-align: left;
+  color:#000;
+    border:1px solid #ccc;
 }
   .typeselect{
     width: 100%;

+ 4 - 0
src/views/contractManagement/futuresSalesContractAdd.vue

@@ -531,12 +531,14 @@
           this.deptBudgetList.contractGoodsInfo.outputPrivate = data[0]
           this.deptBudgetList.contractGoodsInfo.outputCity = data[1]
           this.deptBudgetList.contractGoodsInfo.outputArea = data[2]
+          this.deptBudgetList.sourceLocation=data[5].lat+','+data[5].lng
         } else {
           this.newSelectedOptions1 = data[0] + '/' + data[1] + '/' + data[2]
           this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions[0]]
           this.deptBudgetList.deliveryCity = data[1]
           this.deptBudgetList.deliveryArea = data[2]
           this.deptBudgetList.placeDelivery = data[3]
+          this.deptBudgetList.deliveryLocation=data[5].lat+','+data[5].lng
         }
       },
       mapInputClick(type) {
@@ -1841,6 +1843,8 @@
   .address-btn {
     width: 100%;
     text-align: left;
+    color:#000;
+    border:1px solid #ccc;
   }
    .inline-input {
       width: 100%;

+ 2 - 0
src/views/contractManagement/futuresSalesContractEdit.vue

@@ -1725,5 +1725,7 @@
   .address-btn {
     width: 100%;
     text-align: left;
+    color:#000;
+    border:1px solid #ccc;
   }
 </style>

+ 2 - 0
src/views/contractManagement/purchaseContractAdd.vue

@@ -1878,6 +1878,8 @@
   .address-btn {
     width: 100%;
     text-align: left;
+    color:#000;
+    border:1px solid #ccc;
   }
 
   .inline-input {

+ 2 - 0
src/views/contractManagement/purchaseContractEdit.vue

@@ -1569,5 +1569,7 @@
   .address-btn {
     width: 100%;
     text-align: left;
+    color:#000;
+    border:1px solid #ccc;
   }
 </style>

+ 2 - 0
src/views/contractManagement/salesContractAdd.vue

@@ -1895,6 +1895,8 @@
   .address-btn {
     width: 100%;
     text-align: left;
+    color:#000;
+    border:1px solid #ccc;
   }
 
   .inline-input {

+ 2 - 0
src/views/contractManagement/salesContractEdit.vue

@@ -1641,5 +1641,7 @@
   .address-btn {
     width: 100%;
     text-align: left;
+    color:#000;
+    border:1px solid #ccc;
   }
 </style>

+ 16 - 2
src/views/houseSelfCollect/weighingManagement.vue

@@ -1,7 +1,7 @@
 <!--检斤管理-->
 <template>
   <div>
-    <BaseHeaderLayout :leftSpan="16">
+    <BaseHeaderLayout :leftSpan="10">
       <template slot="left">
         <ws-button type="primary" @click="print('',1)"
           v-hasPermission="`acquisitionManagement.acquisitionWeight.print`">批量打印
@@ -9,10 +9,13 @@
       </template>
       <template slot="right">
         <ws-select v-model="warehouseName" placeholder="" @change="warehouseNameChange" :value="searchType"
-          style="margin: 0 10px">
+          style="margin: 0 10px;width:400px">
           <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
+        <el-date-picker  style="margin: 0 10px 0 0" value-format='yyyy-MM-dd' v-model="value2" @change='datechange' type="daterange" align="right" unlink-panels range-separator="至"
+					start-placeholder="起始时间" end-placeholder="截止时间" >
+				</el-date-picker>
         <div></div>
         <ws-input v-model="searchKeyWord" placeholder="可按编号、客户名、车牌号查找" clearable maxlength="500" type="input">
         </ws-input>
@@ -170,6 +173,9 @@
         jjSelectPrintList: [],
         radio: 'A4',
         isShowPrintType: false,
+        value2:[],
+        startDate:"",
+        endDate:""
       }
     },
     activated() {
@@ -301,6 +307,12 @@
       find() {
         this.getList()
       },
+      datechange(){
+        this.startDate = this.value2[0]
+        this.endDate = this.value2[1]
+        this.getList()
+
+      },
       handleSizeChange(val) {
         console.log(`每页 ${val} 条`)
         this.pageSize = val
@@ -375,6 +387,8 @@
             pageSize: this.pageSize,
             searchKeyWord: this.searchKeyWord,
             warehouseName: this.warehouseName,
+              startDate:this.startDate,
+              endDate:this.endDate,
             managementType: 1
           })
           .toPromise()

+ 9 - 9
src/views/statisticalReport/stockSaleOutReportList.vue

@@ -29,28 +29,28 @@
         </el-tabs>
         <div class="content2-item">
           <div v-if="contractNo != ''">
-            <div class="buyer" v-if="orderList.buyer">买方: {{ orderList.buyer }} </div>
+            <div class="buyer" v-if="orderList.buyer">买方: {{ orderList.buyer}} </div>
             <div v-else>买方: </div>
           </div>
           <div v-if="contractNo != ''" class="row2">
-            <span v-if="orderList.goodsName">货名: {{ orderList.goodsName }} </span>
+            <span v-if="orderList.goodsName">货名: {{ orderList.goodsName}} </span>
             <span v-else>货名: </span>
-            <span v-if="orderList.weight">合同重量: {{ orderList.weight }} 吨</span>
+            <span v-if="orderList.weight">合同重量: {{ orderList.weight.toFixed(3) }} 吨</span>
             <span v-else>合同重量: 0 吨</span>
-            <span v-if="outboundVolume">出库量: {{ outboundVolume }} 吨</span>
+            <span v-if="outboundVolume">出库量: {{ outboundVolume.toFixed(3)}} 吨</span>
             <span v-else>出库量: 0 吨</span>
-            <span v-if="orderList.unitContractPrice&&this.tranType!='随行就市'">合同单价: {{ orderList.unitContractPrice }} 元/吨</span>
+            <span v-if="orderList.unitContractPrice&&this.tranType!='随行就市'">合同单价: {{ orderList.unitContractPrice.toFixed(3) }} 元/吨</span>
             <span v-else>合同单价: 0 元/吨</span>
-            <span v-if="amountReceivable">应收: {{ amountReceivable }} 元</span>
+            <span v-if="amountReceivable">应收: {{ amountReceivable.toFixed(3)}} 元</span>
             <span v-else>应收: 0 元</span>
-            <span v-if="amountReceived">已收: {{ amountReceived }} 元
+            <span v-if="amountReceived">已收: {{ amountReceived.toFixed(3) }} 元
               <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
                 src="../../../public/img/fujian.png" @click="fujian1()" alt="" />
             </span>
             <span v-else>已收: 0 元</span>
-            <span v-if="uncollectedAmount">未收: {{ uncollectedAmount }} 元</span>
+            <span v-if="uncollectedAmount">未收: {{ uncollectedAmount.toFixed(3)}} 元</span>
             <span v-else>未收: 0 元</span>
-            <span v-if="orderList.deposit">定金: {{ orderList.deposit }} 元
+            <span v-if="orderList.deposit">定金: {{ orderList.deposit.toFixed(3)}} 元
               <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
                 src="../../../public/img/fujian.png" @click="fujian()" alt="" />
             </span>

+ 13 - 5
src/views/warehouse/warehouseManagementGross.vue

@@ -1791,11 +1791,22 @@
         }
         for (var i = 0; i < this.outContractNo.length; i++) {
           if (this.outContractNo[i].contractNo == this.deptBudgetList.contractNo) {
+             this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
+            this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
+            this.deptBudgetList.grade = this.outContractNo[i].grade
             if (this.outContractNo[i].inOutType == '采购入库') {
-              this.deptBudgetList.tips='卖方'+this.outContractNo[i].seller
+              this.deptBudgetList.tips='卖方'+this.outContractNo[i].seller+ ' '+this.outContractNo[i].unitContractPrice+'(元/吨)'
               this.deptBudgetList.inOutTypeKey = 1
             } else if (this.outContractNo[i].inOutType == '移库入库') {
-              this.deptBudgetList.tips='出货库'+data.sendWarehouse
+               this.deptBudgetList.goodsName = data.goodsName
+               this.deptBudgetList.goodsNameKey =data.goodsNameKey
+               this.deptBudgetList.grade = data.grade
+              if(this.outContractNo[i].unitContractPrice){
+                this.deptBudgetList.tips='出货库'+data.sendWarehouse+ ' '+this.outContractNo[i].unitContractPrice+'(元/吨)'
+              }else{
+                this.deptBudgetList.tips='出货库'+data.sendWarehouse
+              }
+              
               this.deptBudgetList.inOutTypeKey = 3
             }else if (this.outContractNo[i].inOutType == '移库出库') {
               this.deptBudgetList.tips='入货库'+data.receiveWarehouse
@@ -1813,9 +1824,6 @@
               this.deptBudgetList.inOutTypeKey = 6
             }
             console.log(this.outContractNo[i])
-            this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
-            this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
-            this.deptBudgetList.grade = this.outContractNo[i].grade
             // this.deptBudgetList.cost = this.outContractNo[i].contractPrice
             this.cost = this.outContractNo[i].contractPrice
             if (this.cost) {

+ 75 - 13
src/views/warehouse/warehouseManagementList.vue

@@ -28,7 +28,9 @@
           " @click="handleDelete()">删除</ws-button>
         <ws-button v-if='list.length>0'
            @click="handlTask()">任务</ws-button>
-           <ws-button @click="outData(1)">导出</ws-button>
+           <ws-button v-hasPermission="
+           `warehouseManagement.warehouse.warehouseInfo.add`
+          " @click="outData(1)">导出</ws-button>
            <ws-button @click="outData(2)">打印</ws-button>
       </template>
       <template slot="left">
@@ -285,15 +287,15 @@
             <el-form ref="form"  label-width="110px">
               <el-form-item label="类型" v-if="headerText == '打印记录'">
             <el-radio-group v-model="parameter.radio" >
-                <el-radio :label="1">入库记录</el-radio>
+                <el-radio :label="3" >入库记录</el-radio>
                 <el-radio :label="2">出库记录</el-radio>
              </el-radio-group>
               </el-form-item>
               <el-form-item label="起始日期">
-              <el-date-picker value-format="yyyy-MM-dd" type="date"  placeholder="请选择起始日期" v-model="parameter.startDate"></el-date-picker>
+              <el-date-picker value-format="yyyy-MM-dd" type="date"  placeholder="请选择起始日期" v-model="parameter.startDate" :default-value="new Date()"></el-date-picker>
               </el-form-item>
               <el-form-item label="截止日期">
-              <el-date-picker  value-format="yyyy-MM-dd" type="date" placeholder="请选择截止日期" v-model="parameter.endDate" ></el-date-picker>
+              <el-date-picker  value-format="yyyy-MM-dd" type="date" placeholder="请选择截止日期" v-model="parameter.endDate" :default-value="new Date()"></el-date-picker>
               </el-form-item>
                <!--仓库名称-->
             <el-form-item label="仓库名称" span="1" prop="warehouseName" >
@@ -316,9 +318,9 @@
         </div>
       </div>
       <div class="bottom-btn">
-        <el-button @click="submitClick()" >确定</el-button>
+        <el-button @click="submitClick()">确定</el-button>
         <!-- <el-button @click="submitClick()" v-if="headerText == '打印记录'">确定</el-button> -->
-        <el-button @click="isShowPrintType = false">取消</el-button>
+        <el-button @click="removePrint">取消</el-button>
       </div>
     </div>
   </div>
@@ -333,7 +335,9 @@ import {
   getsponsible,
   clearancee,
   xiala,
-  postExport
+  postExport,
+  addselectinfoList,
+  printAdd,
 } from '@/model/warehouse/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
@@ -394,7 +398,11 @@ export default {
       isShowPrintType:false,//打印
       headerText:"",
      packtypeList:[],//仓库列表
-     parameter:{},
+     parameter:{
+       radio:3,
+       startDate:"",
+       endDate:"",
+     },
      date: {
 					year: dayjs().format('YYYY'),
 					month: dayjs().format('MM'),
@@ -423,16 +431,45 @@ export default {
         .then((response) => {
           this.packtypeList = response
         })
+        let date = new Date()
+        var year = date.getFullYear();
+        var month = date.getMonth() + 1;
+        var strDate = date.getDate()
+        this.parameter.startDate = ""+year+"-"+month+"-"+(strDate-1)
+        this.parameter.endDate = ""+year+"-"+month+"-"+strDate
       this.isShowPrintType = true
     },
+    removePrint(){
+        this.isShowPrintType = false
+        this.parameter = {}
+    },
     async submitClick(){
-      if(this.headerText = "导出入库记录"){
+      if(!this.parameter.radio && this.headerText == "打印记录"){
+        this.$message.error("请选择打印的类型")
+        return
+      }
+      if(!this.parameter.startDate){
+        this.$message.error("请选择打印的起始日期")
+        return
+      }
+      if(!this.parameter.endDate){
+        this.$message.error("请选择打印的截止日期")
+        return
+      }
+      if(new Date(this.parameter.endDate).getTime() < new Date(this.parameter.startDate).getTime()){
+        this.$message.error("截止日期输入错误")
+        return
+      }
+      if(!this.parameter.warehouseName){
+        this.$message.error("请选择所要打印的仓库")
+        return
+      }
+      if(this.headerText == "导出入库记录"){
         const { 
            data 
            } = await postExport({startDate:this.parameter.startDate,endDate:this.parameter.endDate,warehouseName:this.parameter.warehouseName}, {}, {
           responseType: 'blob'
         }).toPromise()
-        debugger
         downloadFile({
           res: data,
           fileName: `${
@@ -440,11 +477,36 @@ export default {
         }导出记录`,
           type: 'xls',
         })
-      }else if(this.headerText = "打印记录"){
-       window.open('../../../../../static/warehousePrint.html')
-       console.log(this.parameter)
+      }else if(this.headerText == "打印记录"){
+        addselectinfoList({
+        compId: localStorage.getItem('ws-pf_compId'),
+        startDate:this.parameter.startDate,
+        endDate:this.parameter.endDate,
+        warehouseName:this.parameter.warehouseName,
+        searchType:this.parameter.radio,
+        currentPage: 1,
+         pageSize: 999,
+      }).toPromise()
+        .then((response) => {
+          if(response.records.length == 0){
+            this.$message.error("暂未查到所要打印的出入库信息")
+          }else{
+            sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(response.records))
+          let i = ""
+          i = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
+           window.open('../../../../../static/warehousePrint.html?type=' + i)
+          }
+        })
+        // printAdd().toPromise()
+        // .then((response) => {
+        //   debugger
+        //   console.log(response)
+        // })
       }
     },
+    startChane(e){
+      console.log(e)
+    },
     //清仓
     clearance(row) {
       console.log(row.outNumber)

+ 1 - 0
src/views/warehouse/warehouseManagementRecord.vue

@@ -439,6 +439,7 @@
 			this.value2= [formatDate, nowData]  // 默认赋值一年时间
    		 },
 			print(row){
+				sessionStorage.removeItem("record_print")
 				getPrintInfo({
                         id: row.id
                       })

+ 7 - 4
src/views/warehouse/warehouseManagementTare.vue

@@ -540,10 +540,17 @@
         }
         for (var i = 0; i < this.outContractNo.length; i++) {
           if (this.outContractNo[i].contractNo == this.deptBudgetList.contractNo) {
+            this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
+            this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
+            this.deptBudgetList.grade = this.outContractNo[i].grade
+            this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
             if (this.outContractNo[i].inOutType == '销售出库') {
               this.deptBudgetList.tips='买方'+this.outContractNo[i].buyer
               this.deptBudgetList.inOutTypeKey = 1
             } else if (this.outContractNo[i].inOutType == '移库出库') {
+              this.deptBudgetList.goodsName = data.goodsName
+              this.deptBudgetList.goodsNameKey = data.goodsNameKey
+              this.deptBudgetList.grade = data.grade
               this.deptBudgetList.tips='入货库'+data.receiveWarehouse
               this.deptBudgetList.inOutTypeKey = 3
             } else if (this.outContractNo[i].inOutType == '暂存入库') {
@@ -553,10 +560,6 @@
             } else if (this.outContractNo[i].inOutType == '采购出库') {
               this.deptBudgetList.inOutTypeKey = 6
             }
-            this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
-            this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
-            this.deptBudgetList.grade = this.outContractNo[i].grade
-            this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
             if (this.outContractNo[i].deliverType == '1') {
               this.carstatus = true
             } else {