gjy 4 سال پیش
والد
کامیت
863359ee69
3فایلهای تغییر یافته به همراه67 افزوده شده و 88 حذف شده
  1. 4 2
      src/model/warehouse/index.js
  2. 1 1
      src/views/warehouse/warehouseManagementEdit.vue
  3. 62 85
      src/views/warehouse/warehouseManagementList.vue

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

@@ -35,7 +35,7 @@ export const getLook = appRx.get(API_GET_WAREHOUSE_LOOK, errorCatcher, errorHand
 export const xiala = appRx.get(API_GET_WAREHOUSE_CUSTOMDROPDOWN, errorCatcher, errorHandle, filter)
 //删除
 export const deletewarehouse = appRx.post(API_POST_WAREHOUSE_DELETE, errorCatcher, errorHandle, filter)
-//删除库列表
+//删除库列表
 export const delectlist = appRx.get(API_GET_WAREHOUSE_DELETELIST, errorCatcher, errorHandle, filter)
 //隐藏
 export const hide = appRx.post(API_POST_WAREHOUSE_HIDE, errorCatcher, errorHandle, filter)
@@ -64,7 +64,9 @@ export const delInOut = appRx.post(API_POST_WAREHOUSE_DEL_INOUTINFO, errorCatche
 //临时库增加add
 export const increase = appRx.post(API_POST_WAREHOUSE_ADD, errorCatcher, errorHandle, filter)
 //临时库清仓
-export const clearancee = appRx.post(API_POST_WAREHOUSE_CLEARANCEE, errorCatcher, errorHandle,filter)
+export const clearancee = appRx.post(API_POST_WAREHOUSE_CLEARANCEE, errorCatcher, errorHandle, filter)
+//获取负责人
+export const getstaff = appRx.get(API_GET_STAFF, errorCatcher, errorHandle, filter)
 
 
 

+ 1 - 1
src/views/warehouse/warehouseManagementEdit.vue

@@ -265,7 +265,7 @@ export default {
       size: 10,
       options_: regionData,
       selectedOptions: [],
-      compId: sessionStorage.getItem('ws-pf_compId'),  
+      compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
       packtypeList: [],
       date: {

+ 62 - 85
src/views/warehouse/warehouseManagementList.vue

@@ -3,9 +3,7 @@
   <div>
     <BaseHeaderLayout :leftSpan="20">
       <template slot="left">
-        <ws-button
-          type="primary"
-          @click="handleAdd()"
+        <ws-button type="primary" @click="handleAdd()"
           ><img
             width="11"
             height="11"
@@ -16,20 +14,9 @@
           添加</ws-button
         >
 
-        <ws-button
-          @click="handleLook()"
-          >查看</ws-button
-        >
-        <ws-button
-          @click="handleEdit()"
-          
-          >编辑</ws-button
-        >
-        <ws-button
-          @click="handleDelete()"
-          
-          >删除</ws-button
-        >
+        <ws-button @click="handleLook()">查看</ws-button>
+        <ws-button @click="handleEdit()">编辑</ws-button>
+        <ws-button @click="handleDelete()">删除</ws-button>
         <ws-button @click="handleLook()">查看</ws-button>
         <ws-button @click="handleEdit()">编辑</ws-button>
         <ws-button @click="handleDelete()">删除</ws-button>
@@ -56,11 +43,7 @@
           class="findValue"
         ></ws-input>
         <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
-        <ws-button
-          class="find"
-          type="primary"
-          @click="find()"
-         
+        <ws-button class="find" type="primary" @click="find()"
           ><img
             width="16"
             height="16"
@@ -137,24 +120,13 @@
         </el-table-column>
         <el-table-column prop="seller" label="出入库" width="300">
           <template slot-scope="scope">
-            <ws-button
-              class="completed"
-              @click="nocomplete(scope.row)"
-
-            >
+            <ws-button class="completed" @click="nocomplete(scope.row)">
               待完成({{ scope.row.number }})
             </ws-button>
-            <ws-button
-              class="putstorage"
-              @click="warehousing(scope.row)"
-
-            >
+            <ws-button class="putstorage" @click="warehousing(scope.row)">
               入库
             </ws-button>
-            <ws-button
-              class="deliverystorage"
-              @click="delivery(scope.row)"
-            >
+            <ws-button class="deliverystorage" @click="delivery(scope.row)">
               出库
             </ws-button>
           </template>
@@ -174,12 +146,11 @@
         :data="warehouseList"
         style="width: 100%; margin-top: 20px"
         height="780"
-       
       >
         <el-table-column type="index" label="序号" width="80">
           <template scope="scope">
-            <span v-if="scope.$index < 9 ">0{{scope.$index +1}}</span>
-            <span v-else>{{scope.$index +1}}</span>
+            <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+            <span v-else>{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
         <el-table-column prop="warehouseName" label="仓库名" width="80">
@@ -220,26 +191,18 @@
               style="height: 24px"
               v-for="(item, i) in scope.row.warehouseNumViewList"
             >
-
-           {{ item.inNetWeight - item.outNetWeight}}
+              {{ item.inNetWeight - item.outNetWeight }}
 
               {{ item.storage }}
-
             </div>
           </template>
         </el-table-column>
         <el-table-column prop="seller" label="出入库" width="300">
           <template slot-scope="scope">
-            <ws-button
-              class="completed"
-              @click="nocomplete(scope.row)"
-            >
+            <ws-button class="completed" @click="nocomplete(scope.row)">
               待完成({{ scope.row.number }})
             </ws-button>
-            <ws-button
-              class="putstorage"
-              @click="warehousing(scope.row)" 
-            >
+            <ws-button class="putstorage" @click="warehousing(scope.row)">
               入库
             </ws-button>
             <ws-button
@@ -254,8 +217,16 @@
         <el-table-column prop="address" label="操作" width="200">
           <template slot-scope="scope">
             <div class="record" @click="record(scope.row)">记录</div>
-            <div class="adjustment" v-if="scope.row.clearStatusFlag==1"  @click="clearance(scope.row)">清仓</div>
-            <div class="adjustment" v-if="scope.row.clearStatusFlag==3"  >已清仓</div>
+            <div
+              class="adjustment"
+              v-if="scope.row.clearStatusFlag == 1"
+              @click="clearance(scope.row)"
+            >
+              清仓
+            </div>
+            <div class="adjustment" v-if="scope.row.clearStatusFlag == 3">
+              已清仓
+            </div>
           </template>
         </el-table-column>
       </el-table>
@@ -302,7 +273,7 @@ export default {
       showType: true,
       // 年
       year: '',
-      clearancee:{},
+      clearancee: {},
       currentPage: 1,
       pageSize: 10,
       searchType: 1,
@@ -331,40 +302,47 @@ export default {
   },
   activated() {
     this.getList()
-    this.clearancee()
     this.showType = this.isShow
   },
 
   methods: {
     //清仓
-     clearance(row){
-       
-         this.$confirm(`清仓操作代表库存已清零,清仓后不可进行出库操作,是否确定清仓`,{
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      })
-        .then(() => {
-         clearancee({ id: row.warehouseId })
-            .toPromise()
-            .then((response) => {
-              this.$notify.success({
-                title: '成功',
-                message: '状态清仓成功',
-              })
-              this.getList()
-            })
-            .catch((response) => {
-              
-            })
+    clearance(row) {
+      console.log(row.outNumber)
+      if (row.outNumber > 0) {
+        this.$confirm(`你还有未完善的出库记录,请完善提交后再进行操作`, {
+          cancelButtonText: '关闭',
         })
-        .catch(() => {
-          return false
-        })
-
-       },
-      
-
+          .then(() => {})
+          .catch(() => {
+            return false
+          })
+      } else {
+        this.$confirm(
+          `清仓操作代表库存已清零,清仓后不可进行出库操作,是否确定清仓`,
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          }
+        )
+          .then(() => {
+            clearancee({ id: row.warehouseId })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '状态清仓成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {})
+          })
+          .catch(() => {
+            return false
+          })
+      }
+    },
 
     //出库
     delivery(item) {
@@ -376,13 +354,12 @@ export default {
           warehouseName: item.warehouseName,
           binNumber: item.binNumber,
           capacity: item.capacity,
-          warehouseType: this.warehouseType
+          warehouseType: this.warehouseType,
         },
       })
     },
     //入库
     warehousing(item) {
-
       var free = 0
       for (var i = 0; i < item.warehouseNumViewList.length; i++) {
         free += Number(item.warehouseNumViewList[i].storage)
@@ -397,7 +374,7 @@ export default {
           capacity: item.capacity - free,
           id: item.id,
           warehouseType: this.warehouseType,
-          createType: item.createType
+          createType: item.createType,
         },
       })
     },
@@ -599,7 +576,7 @@ export default {
     handleCloe() {
       this.dialogViewSpareMoney = false
     },
-    
+
     history(row) {
       billoperatehis({ id: row.id })
         .toPromise()