zhongtianhaoyuan 4 rokov pred
rodič
commit
16fedadfb1

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

@@ -10,7 +10,7 @@ export const API_GET_WAREHOUSE_DELETE = '/warehouseBaseInfo/api/deleteWarehouse'
 //仓库编辑
 //仓库编辑
 export const API_POST_WAREHOUSE_EDIT = '/warehouseBaseInfo/api/editWarehouse'
 export const API_POST_WAREHOUSE_EDIT = '/warehouseBaseInfo/api/editWarehouse'
 //盘损
 //盘损
-export const API_POST_WAREHOUSE_IOSS = '/warehouseInventoryCountInfo/getInfo'
+export const API_GET_WAREHOUSE_IOSS = '/warehouseInventoryCountInfo/getInfo'
 //货名下拉
 //货名下拉
 export const API_POST_WAREHOUSE_NAME = '/warehousePositionStorageInfo/selectGoodsName'
 export const API_POST_WAREHOUSE_NAME = '/warehousePositionStorageInfo/selectGoodsName'
 
 
@@ -18,4 +18,6 @@ export const API_POST_WAREHOUSE_NAME = '/warehousePositionStorageInfo/selectGood
 export const API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN = `/commonSysParameter/getInfo`
 export const API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN = `/commonSysParameter/getInfo`
 // 入库添加
 // 入库添加
 export const API_POST_STORAGE_PUT = `/warehouseInOutInfo/InOutWarehouse `
 export const API_POST_STORAGE_PUT = `/warehouseInOutInfo/InOutWarehouse `
+//盘损提交
+export const API_POST_STORAGE_IOSS = '/warehouseInventoryCountInfo/addInventory'
 
 

+ 7 - 4
src/model/warehouse/index.js

@@ -7,11 +7,12 @@ import {
     API_GET_WAREHOUSE_CUSTOMDROPDOWN,
     API_GET_WAREHOUSE_CUSTOMDROPDOWN,
     API_GET_WAREHOUSE_DELETE,
     API_GET_WAREHOUSE_DELETE,
     API_POST_WAREHOUSE_EDIT,
     API_POST_WAREHOUSE_EDIT,
-    API_POST_WAREHOUSE_IOSS,
+    API_GET_WAREHOUSE_IOSS,
     API_POST_WAREHOUSE_NAME,
     API_POST_WAREHOUSE_NAME,
     API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN,
     API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN,
-    API_POST_STORAGE_PUT
-
+    API_POST_STORAGE_PUT,
+    API_POST_STORAGE_IOSS
+     
 } from '@/api/V2/warehouse'
 } from '@/api/V2/warehouse'
 // 列表
 // 列表
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
@@ -26,7 +27,7 @@ export const deletewarehouse = appRx.get(API_GET_WAREHOUSE_DELETE, errorCatcher,
 //仓库编辑
 //仓库编辑
 export const edit = appRx.post(API_POST_WAREHOUSE_EDIT, errorCatcher, errorHandle, filter)
 export const edit = appRx.post(API_POST_WAREHOUSE_EDIT, errorCatcher, errorHandle, filter)
 //盘损
 //盘损
-export const ioss = appRx.post(API_POST_WAREHOUSE_IOSS, errorCatcher, errorHandle, filter)
+export const ioss = appRx.get(API_GET_WAREHOUSE_IOSS, errorCatcher, errorHandle, filter)
 //货名下拉
 //货名下拉
 export const goodsname = appRx.get(API_POST_WAREHOUSE_NAME, errorCatcher, errorHandle, filter)
 export const goodsname = appRx.get(API_POST_WAREHOUSE_NAME, errorCatcher, errorHandle, filter)
 
 
@@ -34,4 +35,6 @@ export const goodsname = appRx.get(API_POST_WAREHOUSE_NAME, errorCatcher, errorH
 export const pullDown = appRx.get(API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN, errorCatcher, errorHandle, filter)
 export const pullDown = appRx.get(API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN, errorCatcher, errorHandle, filter)
 // 入库添加
 // 入库添加
 export const addstorageputList = appRx.post(API_POST_STORAGE_PUT, errorCatcher, errorHandle, filter)
 export const addstorageputList = appRx.post(API_POST_STORAGE_PUT, errorCatcher, errorHandle, filter)
+//盘损提交
+export const submitioss = appRx.post(API_POST_STORAGE_IOSS, errorCatcher, errorHandle, filter)
 
 

+ 104 - 61
src/views/warehouse/warehouseManagementIoss.vue

@@ -14,15 +14,19 @@
         >
         >
       </el-col>
       </el-col>
     </el-row>
     </el-row>
-    <div class="center">
-      <h2>鲅鱼圈一号库  102仓位</h2>
-      <ws-form ref="deptBudgetList" :model="deptBudgetList">
+    <div class="center">  
+      <ws-form ref="deptBudgetList" :model="deptBudgetList" :rules="rules">
+        <h2>                      
+          {{deptBudgetList1.warehouseName }}库
+          {{deptBudgetList1.binNumber }}仓位
+      </h2>
         <!-- 货名 -->
         <!-- 货名 -->
-        <ws-form-item label="货名" span="1"  class="readonly">
+        <ws-form-item label="货名" span="1"  class="readonly" prop="goodsName">
           <ws-select
           <ws-select
+            v-model="deptBudgetList.goodsName"
             placeholder=""
             placeholder=""
             class="typeselect"
             class="typeselect"
-            @change="selectpackingMethod"
+            @change="changeioss"
           >
           >
             <ws-option
             <ws-option
               v-for="item in goodnameList"
               v-for="item in goodnameList"
@@ -33,73 +37,35 @@
           </ws-select>
           </ws-select>
         </ws-form-item>
         </ws-form-item>
         <!--当期累计入库量-->
         <!--当期累计入库量-->
-        <ws-form-item label="当期累计入库量(吨)" span="1" prop="shippingType">
-          <ws-input
-            v-model="deptBudgetList.shippingType"
-            placeholder="当期累计入库量(吨)"
-            maxlength="20"
-            size="small"
-          />
+        <ws-form-item label="当期累计入库量(吨)" span="1" prop="cumulativeStockIn">
+          {{deptBudgetList.cumulativeStockIn}}
         </ws-form-item>
         </ws-form-item>
-
         <!--当期累计出库量(吨)-->
         <!--当期累计出库量(吨)-->
-        <ws-form-item
-          label="当期累计出库量(吨)"
-          span="1"
-          prop="buyer"
-          class="readonly"
-        >
-          <ws-input
-            v-model="deptBudgetList.buyer"
-            placeholder="当期累计出库量(吨)"
-            maxlength="100"
-            size="small"
-          />
+        <ws-form-item label="当期累计出库量(吨)" span="1" prop="cumulativeStockOut" class="readonly">
+          {{deptBudgetList.cumulativeStockOut}}
         </ws-form-item>
         </ws-form-item>
-
         <!--应余库存(吨)-->
         <!--应余库存(吨)-->
-        <ws-form-item label="应余库存(吨)" span="1" prop="settlementMethod">
-          <ws-input
-            v-model="deptBudgetList.settlementMethod"
-            placeholder="应余库存(吨)"
-            maxlength="120"
-            size="small"
-          />
+        <ws-form-item label="应余库存(吨)" span="1" prop="surplusInventory">
+         {{deptBudgetList.cumulativeStockIn-deptBudgetList.cumulativeStockOut > 0 ? deptBudgetList.cumulativeStockIn-deptBudgetList.cumulativeStockOut : 0}}
         </ws-form-item>
         </ws-form-item>
-
         <!--实际库存(吨)-->
         <!--实际库存(吨)-->
-        <ws-form-item
-          label="实际库存(吨)"
-          span="1"
-          prop="seller"
-          class="readonly"
-        >
+        <ws-form-item label="实际库存(吨)" span="1" prop="physicalInventory" class="readonly">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.seller"
-            placeholder="实际库存(吨)"
+            v-model="deptBudgetList.physicalInventory"
+            placeholder="请输入实际库存(吨)"
             maxlength="100"
             maxlength="100"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-
         <!--损耗量(吨)-->
         <!--损耗量(吨)-->
-        <ws-form-item label="损耗量(吨)" span="1" prop="sourceGoods">
-          <ws-input
-            v-model="deptBudgetList.sourceGoods"
-            placeholder="损耗量(吨)"
-            maxlength="20"
-            size="small"
-          />
+        <ws-form-item label="损耗量(吨)" span="1" prop="ioss">
+          {{(deptBudgetList.cumulativeStockIn-deptBudgetList.cumulativeStockOut)-deptBudgetList.physicalInventory > 0 ? (deptBudgetList.cumulativeStockIn-deptBudgetList.cumulativeStockOut)-deptBudgetList.physicalInventory : 0}}
         </ws-form-item>
         </ws-form-item>
 
 
         <!--库损比例-->
         <!--库损比例-->
-        <ws-form-item label="库损比例" span="1" prop="contractNo">
-          <ws-input
-            v-model.number="deptBudgetList.buyerPhone"
-            placeholder="库损比例"
-            maxlength="100"
-            size="small"
-          />
+        <ws-form-item label="库损比例" span="1" prop="inventoryRatio">
+          <!-- .占比=损耗量÷(累计入库-实际库存) -->
+          {{((deptBudgetList.cumulativeStockIn-deptBudgetList.cumulativeStockOut)-deptBudgetList.physicalInventory)/(deptBudgetList.cumulativeStockIn-deptBudgetList.physicalInventory) > 0 ? ((deptBudgetList.cumulativeStockIn-deptBudgetList.cumulativeStockOut)-deptBudgetList.physicalInventory)/(deptBudgetList.cumulativeStockIn-deptBudgetList.physicalInventory) : 0 }} {{'‰'}}
         </ws-form-item>
         </ws-form-item>
         <p>注:提交成功后,当期实际库存将作为下一期的初始库存。</p>
         <p>注:提交成功后,当期实际库存将作为下一期的初始库存。</p>
       </ws-form>
       </ws-form>
@@ -119,6 +85,8 @@
 <script>
 <script>
 import {
 import {
   goodsname,
   goodsname,
+  ioss,
+  submitioss,
 } from '@/model/warehouse/index'
 } from '@/model/warehouse/index'
 
 
 import { downloadFile } from '@/utils/batchDown'
 import { downloadFile } from '@/utils/batchDown'
@@ -169,14 +137,25 @@ export default {
       compId: sessionStorage.getItem('ws-pf_compId'),
       compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
       deptCircularPage: {},
       packtypeList: {},
       packtypeList: {},
+      deptBudgetList1:[],
       date: {
       date: {
         year: dayjs().format('YYYY'),
         year: dayjs().format('YYYY'),
         month: dayjs().format('MM'),
         month: dayjs().format('MM'),
       },
       },
+
       contractList: [],
       contractList: [],
-      deptBudgetList: {},
+      deptBudgetList:{},
       historyList: [],
       historyList: [],
-
+       rules: {
+        netWeight: [
+          {
+            required: true,
+            type: 'number',
+            message: '请输入活动名称',
+            trigger: 'blur',
+          },
+        ],
+      },
       pickerBeginDateBefore: {
       pickerBeginDateBefore: {
         disabledDate: (time) => {
         disabledDate: (time) => {
           return time.getTime() > Date.now()
           return time.getTime() > Date.now()
@@ -191,6 +170,18 @@ export default {
     // this.getVesselData();
     // this.getVesselData();
     this.loaddata()
     this.loaddata()
     this.showType = this.isShow
     this.showType = this.isShow
+  },
+   mounted() {
+    this.deptBudgetList.baseId = this.$route.query.baseId
+    this.deptBudgetList.positionId = this.$route.query.positionId
+    this.deptBudgetList.warehouseName = this.$route.query.warehouseName
+    this.deptBudgetList.binNumber = this.$route.query.binNumber
+    this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
+    this.deptBudgetList1.binNumber = this.$route.query.binNumber
+    this.deptBudgetList1.baseId=this.this.$route.query.baseId
+    this.deptBudgetList1.positionId=this.$route.query.positionId
+    this.deptBudgetList1.goodsNameKey=this.deptBudgetList.goodsNameKey
+    // this.getList()
   },
   },
   methods: {
   methods: {
     //返回按钮
     //返回按钮
@@ -199,7 +190,31 @@ export default {
     },
     },
     //提交按钮
     //提交按钮
     submit(){
     submit(){
-      this.$router.push({ path: 'warehouseManagementList' })
+       this.$refs.deptBudgetList.validate((valid) => {
+        if (valid) {
+          this.deptBudgetList.surplusInventory=this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut
+          this.deptBudgetList.loss=(this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut)-this.deptBudgetList.physicalInventory
+         this.deptBudgetList.inventoryRatio=((this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut)-this.deptBudgetList.physicalInventory)/(this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.physicalInventory)
+         this.deptBudgetList.baseId=this.deptBudgetList1.baseId
+         this.deptBudgetList.positionId=this.deptBudgetList1.positionId
+         this.deptBudgetList.binNumber=this.deptBudgetList1.binNumber
+         this.deptBudgetList.warehouseName=this.deptBudgetList1.warehouseName
+         this.deptBudgetList.goodsNameKey=this.deptBudgetList1.goodsNameKey
+         this.deptBudgetList.compId = this.compId
+          this.deptBudgetList.contractType = 1
+          console.log(this.deptBudgetList)
+         submitioss(this.deptBudgetList)
+            .toPromise()
+            .then((response) => {
+              this.$message.success('提交成功')
+              this.$router.push({ path: 'warehouseManagementList' })
+            })
+        } else {
+          //EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+          return false
+        }
+      })
+      // this.$router.push({ path: 'warehouseManagementList' })
     },
     },
     dateFormat(fmt, date) {
     dateFormat(fmt, date) {
       let ret
       let ret
@@ -235,10 +250,38 @@ export default {
       this.currentPage = val
       this.currentPage = val
       console.log(`当前页: ${val}`)
       console.log(`当前页: ${val}`)
       this.getList()
       this.getList()
+    },
+    changeioss(e){
+      console.log(e)
+        for (var i = 0; i < this.goodnameList.length; i++) {
+        if (this.goodnameList[i].goodsName == e) {
+          this.deptBudgetList.goodsNameKey = this.goodnameList[i].goodsNameKey
+        }
+      }
+      // console.log(this.deptBudgetList)
+      //   for (var i = 0; i < this.packtypeList.length; i++) {
+      //     console.log(this.packtypeList[i].goodsName)
+      //   if (this.packtypeList[i].goodsName == e) {
+      //    this.getLook(this.packtypeList[i].id)
+      //   //  console.log(this.packtypeList[i].positionId)
+      //   }
+      // }    
+      this.ioss()
+    },
+     ioss(){
+      ioss(
+        this.deptBudgetList
+      )
+        .toPromise()
+        .then((response) => {
+         this.deptBudgetList=response
+         console.log(this.deptBudgetList)
+        
+        })
     },
     },
      loaddata() {
      loaddata() {
       // 货名
       // 货名
-      goodsname({ constId: 'CON2' })
+      goodsname({positionId : this.$route.query.positionId})
         .toPromise()
         .toPromise()
         .then((response) => {
         .then((response) => {
           this.goodnameList = response
           this.goodnameList = response

+ 14 - 11
src/views/warehouse/warehouseManagementList.vue

@@ -146,8 +146,8 @@
             </ws-button>
             </ws-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="address" label="操作" width="200">
-          <!-- <template slot-scope="scope"> -->
+        <el-table-column prop="address" label="操作" width="200" >
+         <template slot-scope="scope"> 
           <ws-button
           <ws-button
             type="primary"
             type="primary"
             @click="record()"
             @click="record()"
@@ -159,13 +159,13 @@
 
 
           <ws-button
           <ws-button
             type="primary"
             type="primary"
-            @click="loss()"
+            @click="loss(scope.row)"
             v-hasPermission="
             v-hasPermission="
               `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
               `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
             "
             "
             >盘损</ws-button
             >盘损</ws-button
           >
           >
-          <!-- </template> -->
+          </template> 
         </el-table-column>
         </el-table-column>
       </el-table>
       </el-table>
     </div>
     </div>
@@ -314,13 +314,16 @@ export default {
       this.$router.push({ path: 'warehouseManagementRecord' })
       this.$router.push({ path: 'warehouseManagementRecord' })
     },
     },
     //盘损
     //盘损
-    loss() {
-      // console.log(row.positionId)
-      // this.$router.push({
-      //   name: 'warehouseManagementIoss',
-      //   params: {positionId: row.positionId },
-      // })
-       this.$router.push({ path: 'warehouseManagementIoss' })
+    loss(item) {
+     this.$router.push({
+        path: 'warehouseManagementIoss',
+        query: {
+          baseId: item.warehouseId,
+          positionId: item.binNumberId,
+          warehouseName: item.warehouseName,
+          binNumber: item.binNumber,
+        },
+      })
     },
     },
     //查看
     //查看
     handleLook() {
     handleLook() {