Browse Source

前端 sdy

zhongtianhaoyuan 3 năm trước cách đây
mục cha
commit
bd1e648068

+ 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'
+
 
 

+ 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)
 

+ 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>

+ 72 - 12
src/views/warehouse/warehouseManagementList.vue

@@ -285,15 +285,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 +316,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 +333,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 +396,11 @@ export default {
       isShowPrintType:false,//打印
       headerText:"",
      packtypeList:[],//仓库列表
-     parameter:{},
+     parameter:{
+       radio:3,
+       startDate:"",
+       endDate:"",
+     },
      date: {
 					year: dayjs().format('YYYY'),
 					month: dayjs().format('MM'),
@@ -423,16 +429,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 +475,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)

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

@@ -393,12 +393,14 @@
 				return sums
 			},
 			print(row){
+				sessionStorage.removeItem("record_print")
 				getPrintInfo({
                         id: row.id
                       })
                         .toPromise()
                         .then((response) => {
-                            window.open( '../../../../static/weightCheckInOut.html?type=2&tableData=' +JSON.stringify(response))
+                            window.open( '../../../../../static/weightCheckInOut.html?type=2&tableData=' + JSON.stringify(response))
+							// window.open('../../../../../static/warehousePrint.html')
                         })
 			},
 			//返回按钮