zhongtianhaoyuan 3 anos atrás
pai
commit
06e5fb765e

+ 17 - 1
src/views/warehousenew/component/router/index.js

@@ -402,7 +402,23 @@ const warehouseManagementRouter = {
         // module: 'procurement.sparepart.applDetail'
       },
       hidden: true
-    },                                     
+    },  
+    // 折转
+    {
+      path: 'transformation',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/warehousenew/transformation'),
+      name: 'transformation',
+      meta: {
+        title: 'transformation',
+        shortcutEntrance: 'transformation',
+        module: 'warehouseManagement.warehouse.warehouseInfo',
+        permissicon: [],
+        keepAlive: true
+        // module: 'procurement.sparepart.applDetail'
+      },
+      hidden: true
+    },                                   
   ],
 };
 export default warehouseManagementRouter;

+ 23 - 19
src/views/warehousenew/warehouseManagementList.vue

@@ -2,7 +2,7 @@
 <template>
   <div class="container">
     <!-- 表格 -->
-    <div class="top_form">
+    <div class="top_form" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`">
       <div class="title"><span style="font-size:18px;font-weight: 600;margin-left:20px">今年储量明细</span><span style="color:#8890B1;font-size:16px">({{dateTime}})</span></div>
       <el-table :data="tableData" style="width: 100%;margin-top:20px">
       <el-table-column :prop="item" :label="item" show-overflow-tooltip v-for="(item, index) in tableHeader" :key="index"></el-table-column>
@@ -33,7 +33,7 @@
           </el-form-item>
 
           <!--总储量(吨)-->
-          <el-form-item label-width="120px" label="最大容量(吨)" span="1" prop="settlementMethod">
+          <el-form-item label-width="120px" label="最大容量(吨)" span="1" prop="settlementMethod" v-if="warehouseType == 1">
             <el-input :readonly="true" v-model="warehouseInfo.maxReserves" maxlength="100" placeholder="暂无" size="small" disabled />
           </el-form-item>
             <!--负责人-->
@@ -68,17 +68,17 @@
       <ws-button type="primary" @click="handleAdd()" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" style="margin-left:20px">添加</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.edit` " @click="handleEdit()">编辑</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="handleDelete()">删除</ws-button>
-      <ws-button  v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`" @click="record()">记录</ws-button>
-      <ws-button   v-if="warehouseType == '1'" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`" @click="loss()">盘库</ws-button>
-      <ws-button  v-if="warehouseInfo.clearStatusFlag == 1 && warehouseType == '2'" @click="clearance()">清库</ws-button>
-      <ws-button  v-if="warehouseInfo.clearStatusFlag == 3 && warehouseType == '2'" disabled> 已清库</ws-button>
+      <ws-button v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`" @click="record()">记录</ws-button>
+      <ws-button v-if="warehouseType == '1'" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`" @click="loss()">盘库</ws-button>
+      <ws-button v-if="warehouseInfo.clearStatusFlag == 1 && warehouseType == '2'" @click="clearance()">清库</ws-button>
+      <ws-button v-if="warehouseInfo.clearStatusFlag == 3 && warehouseType == '2'" disabled> 已清库</ws-button>
       <!-- createType 1手动创建 2 自动创建 -->
       <ws-button v-if='warehouseInfo.createType==1' v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="indialog = true">入库量</ws-button>
       <ws-button v-if='list.length>0' @click="handlTask()">任务</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" @click="outData(1)">导出</ws-button>
       <ws-button @click="outData(2)">打印</ws-button>
-      <ws-button @click="transformation()">折转</ws-button>
-      <ws-button v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`" @click="handleall()">全部仓库</ws-button>
+      <ws-button @click="transformation()" v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`">折转</ws-button>
+      <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleall()">全部仓库</ws-button>
         <el-table ref='table' show-summary :summary-method="getSummaries" class="wenzi" :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>
@@ -730,9 +730,16 @@
       handleDelete() {
         for(var num = 0 ; num < this.warehouseList.length; num++){//删除仓库前应当判断是否有库存
           for(var num_item = 0 ; num_item < this.warehouseList[num].warehouseNumViewList.length ; num_item++){
-            if(this.warehouseList[num].warehouseNumViewList[num_item].storage){
-              this.$message.error("删除前应清空库存!")
-              return
+            if(this.warehouseType == 2){
+               if(Number(this.warehouseList[num].warehouseNumViewList[num_item].surplus) > 0){
+                this.$message.error("删除前应清空库存!")
+                return
+              }
+            }else if(this.warehouseType == 1){
+               if(Number(this.warehouseList[num].warehouseNumViewList[num_item].storage) > 0){
+                this.$message.error("删除前应清空库存!")
+                return
+               }
             }
           }
         }
@@ -901,10 +908,10 @@
         return sums
       },
        // 折转
-      transformation(row){
+      transformation(){
         this.$router.push({
           path: 'transformation', 
-          query:{warehouseId:row.warehouseId,warehouseName:row.warehouseName,binNumberId:row.binNumberId,warehouseType:this.warehouseType}//warehouseType 1常用 2临时
+          query:{warehouseId:this.warehouseInfo.warehouseId,warehouseName:this.warehouseInfo.warehouseName,binNumberId:this.warehouseInfo.binNumberId,warehouseType:this.warehouseType}//warehouseType 1常用 2临时
         })
       },
       getList() {
@@ -1011,17 +1018,15 @@
             this.warehouseList = response.warehouseViewList
             this.warehouseInfo = this.warehouseList[0]
             this.warehouseInfo.warehouseLocation = this.warehouseList[0].warehousePrivate + this.warehouseList[0].warehouseCity + this.warehouseList[0].warehouseArea
-            this.warehouseInfo.maxReserves = 0
+            // this.warehouseInfo.maxReserves = 0
             //经纬度
              this.warehousePositioning.lat = this.warehouseInfo.warehousePositioning.split(",")[1]
              this.warehousePositioning.lng = this.warehouseInfo.warehousePositioning.split(",")[0]
              for(let j = 0 ; j < this.warehouseXiaLa.length ; j++){
                 if(this.warehouseInfo.warehouseName == this.warehouseXiaLa[j].warehouseName){
-                for(let count = 0 ;count < this.warehouseXiaLa[j].goodsNameInfos.length ; count++){
-                  this.warehouseInfo.maxReserves += this.warehouseXiaLa[j].goodsNameInfos[count].storage
-                }
+                  this.warehouseInfo.maxReserves = this.warehouseXiaLa[j].totalStorage
+                 }
               }
-          }
           })
       }
     },
@@ -1030,7 +1035,6 @@
 <style lang="scss" scoped>
 .container{
   background: #E8ECF6;
- 
 }
 .top_form{
   background: #FFFFFF;