zxz 2 년 전
부모
커밋
09927b7f48
3개의 변경된 파일113개의 추가작업 그리고 30개의 파일을 삭제
  1. 16 0
      src/api/V2/warehouse/index.js
  2. 23 1
      src/model/warehouse/index.js
  3. 74 29
      src/views/warehousenew/warehouseManagementList.vue

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

@@ -175,3 +175,19 @@ export const API_GET_CUSACTIONINFO_REJECT='/cargoTitleDetails/api/rejection'
 export const API_SET_ROLLIN='/cargoTitleDetails/api/toChangeInto'
 //查看自己负责的仓库new
 export const API_GET_WAREHOUSENAME_NEW='/warehouseBaseInfo/selectWarehouseSelfNew'
+
+//物料出入库  编辑
+export const API_POST_EDITMATERIAL='/materialWarehouseInOut/api/editMaterial'
+//物料出入库  记录
+export const API_GET_MATERIALRECORD='/materialWarehouseInOut/selectMaterialWarehousePage'
+//物料出入库  毛重
+export const API_POST_ADDMATERIAL='/materialWarehouseInOut/api/addMaterial'
+//物料出入库  记录删除
+export const API_POST_DELMATERIAL='/materialWarehouseInOut/api/deleteMaterialInfo'
+//物料出入库  查看
+export const API_GET_LOOKMATERIAL='/materialWarehouseInOut/getMaterialInfo'
+
+//折算纯重
+export const API_GET_GETQUALITYZHE = '/warehouseBaseInfo/getQuantityZhe'
+//实际重量
+export const API_GET_GETQUALITYREAL = '/warehouseBaseInfo/getQuantityReal'

+ 23 - 1
src/model/warehouse/index.js

@@ -85,7 +85,14 @@ import {
     API_GET_CUSACTIONINFO,
     API_GET_CUSACTIONINFO_REJECT,
     API_SET_ROLLIN,
-    API_GET_WAREHOUSENAME_NEW
+    API_GET_WAREHOUSENAME_NEW,
+    API_GET_MATERIALRECORD,
+    API_POST_ADDMATERIAL,
+    API_POST_EDITMATERIAL,
+    API_POST_DELMATERIAL,
+    API_GET_LOOKMATERIAL,
+    API_GET_GETQUALITYZHE,
+    API_GET_GETQUALITYREAL
     // API_GET_EXPENSEINFO
 } from '@/api/V2/warehouse'
 // import { app } from 'electron'
@@ -262,3 +269,18 @@ export const rejectcusationinfo = appRx.post(API_GET_CUSACTIONINFO_REJECT, error
 export const setrollin = appRx.post(API_SET_ROLLIN, errorCatcher, errorHandle, filter)
 //查看自己负责的仓库new
 export const getwarehousNameNew = appRx.get(API_GET_WAREHOUSENAME_NEW,errorCatcher, errorHandle, filter)
+
+//物料出入库  记录
+export const getMaterialRecord = appRx.get(API_GET_MATERIALRECORD,errorCatcher, errorHandle, filter)
+//物料出入库  添加
+export const addMaterial = appRx.post(API_POST_ADDMATERIAL,errorCatcher, errorHandle, filter)
+//物料出入库  编辑
+export const editMaterial = appRx.post(API_POST_EDITMATERIAL,errorCatcher, errorHandle, filter)
+//物料出入库  记录删除
+export const delMaterial = appRx.post(API_POST_DELMATERIAL,errorCatcher, errorHandle, filter)
+//物料出入库 查看
+export const lookMaterial = appRx.get(API_GET_LOOKMATERIAL, errorCatcher, errorHandle, filter)
+//折算纯重
+export const getQualityZhe = appRx.get(API_GET_GETQUALITYZHE, errorCatcher, errorHandle, filter)
+//实际重量
+export const getQualityReal = appRx.get(API_GET_GETQUALITYREAL, errorCatcher, errorHandle, filter)

+ 74 - 29
src/views/warehousenew/warehouseManagementList.vue

@@ -53,6 +53,10 @@
       <div class="right" style="width:70%">
         <div class="position">
         <div class="title"><span class="cangInfo">仓库储量</span></div>
+        <div class="weight">
+            <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="changeWeight(2)">实际重量</ws-button>
+            <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="changeWeight(1)">折算纯重</ws-button>
+          </div>
         <div class="color">
           <div v-for="(item , i) in totalReserves" :key="i" class="color_for">
             <div :style="{background:lineColor[i]}" class="color_item"></div><div class="color_goodsName">{{item.goodsName}}</div>
@@ -62,13 +66,14 @@
           <div class="reservesInfo_item" v-if="warehouseType == '1'"><div class="reservesInfo_GoodsName">{{item.goodsName}}</div>
           <span class="reservesInfo_Amount">{{item.stockNum == 0 ? "-":item.stockNum}}(吨)</span><br/>
           <span v-if="item.stockNum&&item.cost" class="reservesInfo_Amount">{{item.cost == 0 ? "-":item.cost}}(元/吨)</span>
+          <span v-if="item.conversionCost" class="reservesInfo_Amount">{{item.conversionCost == 0 ? "-":item.conversionCost}}(元/吨)</span>
           </div>
           <div class="reservesInfo_item" v-if="warehouseType == '2'"><div class="reservesInfo_GoodsName">{{item.goodsName}}(吨)</div><span class="reservesInfo_Amount">{{item.surplus == 0 ? "-":item.surplus}}</span></div>
         </div>
            <div ref="myEchart7" style="height: 250px; width:96%;border-radius: 4px; border:1px solid #D8DCE6; padding: 10px;" class="column"></div>
         </div>
       </div>
-    </div>
+      </div>
     <div class="position">
       <div class="title"><span style="font-size:18px;font-weight: 600;margin-left:20px">当期储量</span></div>
       <ws-button type="primary" @click="handleAdd()" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" style="margin-left:20px">添加</ws-button>
@@ -89,6 +94,7 @@
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleall()">全部仓库</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleMintor()">查看监控</ws-button>
       <ws-button @click="dryClick()">烘干入库</ws-button>
+      <!-- <ws-button @click="materialInOut()">物料出入库</ws-button> -->
         <el-table ref='table' show-summary :summary-method="getSummaries" class="wenzi setUp_css" :data="warehouseList" style="width: 100%; margin-top: 20px" height="calc(100% - 45px)" v-if="warehouseType == '1'">
         <el-table-column prop="warehouseName" label="仓库名">
         </el-table-column>
@@ -297,6 +303,8 @@
     getsponsible,
     clearancee,
     xiala,
+    getQualityZhe,
+    getQualityReal,
     exportHistoricalInventory,
     postExport,
     addselectinfoList,
@@ -402,7 +410,7 @@
           let hours = d.getHours()<10?'0'+d.getHours():d.getHours()
           let minutes = d.getMinutes()<10?'0'+d.getMinutes():d.getMinutes()
           let seconds = d.getSeconds()<10?'0'+d.getSeconds():d.getSeconds()
-          this.parameter.printStartDate = year + "-" + month+ "-" +date + " "+hours+":"+minutes+":"+seconds;
+          this.parameter.printStartDate = year + '-' + month+ '-' +date + ' '+hours+':'+minutes+':'+seconds;
       },
       endDataChange(e){
             var d = new Date(e);
@@ -413,7 +421,7 @@
           let hours = d.getHours()<10?'0'+d.getHours():d.getHours()
           let minutes = d.getMinutes()<10?'0'+d.getMinutes():d.getMinutes()
           let seconds = d.getSeconds()<10?'0'+d.getSeconds():d.getSeconds()
-           this.parameter.printEndDate = year + "-" + month+ "-" +date + " "+hours+":"+minutes+":"+seconds;
+           this.parameter.printEndDate = year + '-' + month+ '-' +date + ' '+hours+':'+minutes+':'+seconds;
       },
       warehousechange(e){
         for (let i = 0; i < this.warehouseAllXiaLa.length; i++) {
@@ -439,7 +447,7 @@
           var month = date.getMonth() + 1;
           var strDate = date.getDate()
           if(strDate<10){ 
-             strDate = "0"+strDate
+             strDate = '0'+strDate
           }
           var pastdate = new Date(date.getTime() - 24 * 60 * 60 * 1000)
           this.StartDate =pastdate.getFullYear() + '-' + (pastdate.getMonth() + 1) + '-' + (pastdate.getDate()>10?pastdate.getDate():'0'+pastdate.getDate())+' 00:00:00'
@@ -479,8 +487,8 @@
          if(this.parameter.warehouseName == '全部仓库'){
           this.parameter.warehouseName = ''
         }
-        if(this.parameter.binNumber == "全部仓位"){
-          this.parameter.binNumber = ""
+        if(this.parameter.binNumber == '全部仓位'){
+          this.parameter.binNumber = ''
         }
         // let enddate = new Date(this.parameter.endDate).toLocaleString()//将截止时间的时间戳转为时间
         // this.parameter.endDate = enddate.split(' ')[0].replace('/' ,'-').replace('/','-')
@@ -610,15 +618,6 @@
       },
        //导出历史库存记录
        exportHistoricalData() {
-        // 获取仓库
-        // xiala({
-        //     compId: localStorage.getItem('ws-pf_compId'),
-        //     warehouseType: this.warehouseType,
-        //   })
-        //   .toPromise()
-        //   .then((response) => {
-        //     this.packtypeList = response
-        //   })
         let date = new Date()
         var year = date.getFullYear();
         var month = date.getMonth() + 1;
@@ -651,8 +650,8 @@
         if (this.parameter.warehouseName == '全部仓库') {
           this.parameter.warehouseName = ''
         }
-        if(this.parameter.binNumber == "全部仓位"){
-          this.parameter.binNumber = ""
+        if(this.parameter.binNumber == '全部仓位'){
+          this.parameter.binNumber = ''
         }
         const {
           data
@@ -847,6 +846,11 @@
           path: 'dryWarehousing'
         })
       },
+      // materialInOut(){
+      //   this.$router.push({
+      //     path: 'materialInOutWarehouse'
+      //   })
+      // },
       handleall(){
         this.$router.push({
           path: 'warehouseManagement'
@@ -1172,18 +1176,6 @@
                 this.warehouseAllXiaLa = response
                 this.getList1()
               })
-            // xiala({
-            //   compId: localStorage.getItem('ws-pf_compId'),
-            // })
-            //   .toPromise()
-            //   .then((response) => {
-            //     for(var tmp = 0 ; tmp < response.length ; tmp++){
-            //       if(response[tmp].warehouseType == '2'){
-            //         response[tmp].warehouseName = response[tmp].warehouseName + ' (临)'
-            //       }
-            //     }
-            //     this.warehouseAllXiaLa = response
-            //   })
         getsponsible({
             compId: localStorage.getItem('ws-pf_compId')
           }).toPromise()
@@ -1192,6 +1184,54 @@
             this.list = response
           })
       },
+      changeWeight(index) {
+        //实际重量
+				if(index == 2){
+          getQualityReal({
+            compId: localStorage.getItem('ws-pf_compId'),
+            warehouseName: this.warehouseInfo.warehouseName
+          })
+          .toPromise()
+          .then((response) => {
+            this.totalReserves = response.warehouseNumViewList
+            this.initCharts()
+          })
+        }else{
+          getQualityZhe({
+            compId: localStorage.getItem('ws-pf_compId'),
+            baseId: this.warehouseInfo.warehouseId
+          }).toPromise().then((response) =>{
+            console.log(this.totalReserves)
+            this.totalMoney = 0
+            for(let j = 0;j<this.totalReserves.length;j++){
+              if(this.totalReserves[j].cost && this.totalReserves[j].stockNum){
+                this.totalReserves[j].totalMoney = (Number(this.totalReserves[j].cost) *  Number(this.totalReserves[j].stockNum)).toFixed(3)
+                this.totalMoney = (Number(this.totalMoney) + Number(this.totalReserves[j].totalMoney)).toFixed(3)
+              }
+            }
+            if(response.warehouseNumViewList.length != 0){
+              var result = []
+            for(let i = 0; i < response.warehouseNumViewList.length ; i++){
+              let param ={}
+              if (response.warehouseNumViewList[i].pureWeight) {
+                debugger
+                param.goodsName =response.warehouseNumViewList[i].goodsName
+                param.stockNum = Number(response.warehouseNumViewList[i].pureWeight).toFixed(3)
+                param.conversionCost = (Number(this.totalMoney) / Number(param.stockNum)).toFixed(3)
+                result.push(param)
+              } 
+             }
+             console.log(result)
+             this.totalReserves = result
+              this.initCharts()
+            }
+            else{
+              this.$message.error('当前仓库无潮粮库存,无需折算!')
+                return
+            }
+          })
+        }
+			},
       getList1(){
           getList({
             compId: localStorage.getItem('ws-pf_compId'),
@@ -1225,6 +1265,7 @@
             }else{
               this.totalReserves = response.warehouseViewList[0].warehouseNumViewList
             }
+            this.totalMoney = Number(this.totalReserves[0].stockNum * this.totalReserves[0].cost).toFixed(3)
             this.initCharts()
             this.warehouseList = response.warehouseViewList
             if(this.warehouseList.length>0){
@@ -1364,6 +1405,10 @@
     }
   }
 }
+.weight{
+  display: inline-flex;
+  margin-left: 11px;
+}
 .color{
   display: inline-flex;
   width: 100%;