Browse Source

前端gjy

18513069273 4 years ago
parent
commit
9e2534cc14

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

@@ -35,3 +35,5 @@ export const API_GET_WAREHOUSE_INVENTORYCOUNT = '/warehouseInventoryCountInfo/se
 export const API_POST_STORAGE_IOSS = '/warehouseInventoryCountInfo/addInventory'
 //待完善记录
 export const API_GET_WAREHOUSE_COMPLETE = '/warehouseInOutInfo/selectWarehouseInOutInfo'
+// 编辑删除仓位
+export const API_POST_WAREHOUSE_DEL_POSITION = '/warehousePositionInfo/api/deleteWarehousePosition'

+ 5 - 0
src/model/warehouse/index.js

@@ -17,6 +17,7 @@ import {
     API_GET_WAREHOUSE_INVENTORYCOUNT,
     API_POST_STORAGE_IOSS,
     API_GET_WAREHOUSE_COMPLETE,
+    API_POST_WAREHOUSE_DEL_POSITION
 } from '@/api/V2/warehouse'
 // 列表
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
@@ -51,4 +52,8 @@ export const adjustmentrecordList = appRx.get(API_GET_WAREHOUSE_INVENTORYCOUNT,
 export const submitioss = appRx.post(API_POST_STORAGE_IOSS, errorCatcher, errorHandle, filter)
 //待完善记录
 export const complete = appRx.get(API_GET_WAREHOUSE_COMPLETE, errorCatcher, errorHandle, filter)
+// 编辑删除仓位
+
+export const delPosition = appRx.post(API_POST_WAREHOUSE_DEL_POSITION, errorCatcher, errorHandle, filter)
+
 

+ 2 - 7
src/views/warehouse/warehouseManagementDelete.vue

@@ -1,12 +1,7 @@
 //删除仓库
 <template>
-
-  <div class="homepage"> 
-     <el-row>
-
-  <div>
+  <div class="homepage">
     <el-row>
-
       <el-col :span="20">
         <h2 class="bg-left title">删除库房</h2>
       </el-col>
@@ -521,5 +516,5 @@ export default {
 // //表格数据文字
 //  /deep/.el-table .el-table__body .cell{
 //    font-size: 14px;
-//  } 
+//  }
 </style>

+ 2 - 22
src/views/warehouse/warehouseManagementDelivery.vue

@@ -69,6 +69,7 @@
           <!--净重(吨)-->
           <ws-form-item label="净重(吨)" span="1" prop="netWeight">
             <ws-input
+              :readonly="readonly"
               v-model.number="deptBudgetList.netWeight"
               placeholder="不可编辑,自动计算"
               type="number"
@@ -238,11 +239,7 @@
           class="bg-bottom-up"
           type="primary"
           size="small"
-<<<<<<< HEAD
-          @click="returnWarehouse()"
-=======
           @click="temporaryStorage()"
->>>>>>> 41d88bb42d0ea473ee1ccee04976060fbd8bbb5d
           >暂存</el-button
         >
         <el-button
@@ -288,6 +285,7 @@ export default {
       tableDate: [],
       // 是否显示
       showType: true,
+      readonly: true,
       // 年
       year: '',
       deptBudgetTotal: 0,
@@ -409,24 +407,6 @@ export default {
         }
       })
     },
-    //暂存按钮
-    returnWarehouse() {
-      this.$refs.deptBudgetList.validate((valid) => {
-        if (valid) {
-          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
-          this.deptBudgetList.statusFlag = 1
-          addstorageputList(this.deptBudgetList)
-            .toPromise()
-            .then((response) => {
-              this.$message.success('添加成功')
-              this.$router.push({ path: 'warehouseManagementList' })
-            })
-        } else {
-          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-          return false
-        }
-      })
-    },
     tarechange(e) {
       if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
         this.deptBudgetList.netWeight = Number(

+ 63 - 2
src/views/warehouse/warehouseManagementEdit.vue

@@ -96,7 +96,7 @@
             />
           </ws-form-item>
         </ws-info-table>
-        <div v-for="item in deptBudgetList.warehousePositionInfoList">
+        <div v-for="(item, index) in deptBudgetList.warehousePositionInfoList">
           <ws-info-table>
             <!--仓位编号-->
             <ws-form-item label="仓位编号" span="1" prop="binNumber">
@@ -125,6 +125,22 @@
                 size="small"
               />
             </ws-form-item>
+            <img
+              width="22"
+              height="22"
+              class="add"
+              @click="add"
+              src="../../../public/img/add.png"
+              alt=""
+            />
+            <img
+              width="22"
+              height="22"
+              class="del"
+              @click="del(index, item)"
+              src="../../../public/img/del.png"
+              alt=""
+            />
           </ws-info-table>
         </div>
       </ws-form>
@@ -162,7 +178,13 @@
   </div>
 </template>
 <script>
-import { xiala, billoperatehis, getLook, edit } from '@/model/warehouse/index'
+import {
+  xiala,
+  billoperatehis,
+  getLook,
+  edit,
+  delPosition,
+} from '@/model/warehouse/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -281,6 +303,45 @@ export default {
         }
       }
     },
+    add() {
+      this.deptBudgetList.warehousePositionInfoList.push({
+        binNumber: '',
+        maxStorage: '',
+        remark: '',
+      })
+    },
+    del(index, item) {
+      if (item.nowStorage > 0) {
+        this.$message.warning('尚有剩余库存,不可删除')
+      } else {
+        this.$confirm(`此操作将永久删除该仓位的全部信息,是否确定删除`, {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+          .then(() => {
+            if (item.id) {
+              delPosition({ id: item.id })
+                .toPromise()
+                .then((response) => {
+                  this.$message.success('删除成功')
+                })
+                .catch((response) => {
+                  EventBus.$emit(
+                    'error',
+                    this.$t('showMessage.asteriskRequired')
+                  )
+                })
+            }
+            if (this.deptBudgetList.warehousePositionInfoList.length > 1) {
+              this.deptBudgetList.warehousePositionInfoList.splice(index, 1)
+            }
+          })
+          .catch(() => {
+            return false
+          })
+      }
+    },
     loaddata() {
       // 仓库名称
       xiala({ compId: sessionStorage.getItem('ws-pf_compId') })

+ 23 - 1
src/views/warehouse/warehouseManagementIossRecord.vue

@@ -22,7 +22,17 @@
       </el-col>
     </el-row>
     <div class="connert">
-      <h2>鲅鱼圈一号库 102仓位</h2>
+      <h2>
+        <img
+          style="position: relative; top: 2px"
+          width="19"
+          height="19"
+          src="../../../public/img/cangku.png"
+          alt=""
+        />
+        <span style="color: #323233">{{ deptBudgetList.warehouseName }}库</span>
+        <span class="ware">{{ binNumber }}仓位</span>
+      </h2>
       <el-table
         class="wenzi"
         :data="contractList.records"
@@ -137,6 +147,7 @@ export default {
       contractList: [],
       deptBudgetList: {},
       historyList: [],
+      binNumber: '',
       deptBudgetTotal: 0,
       currentPage: 1,
       pageSize: 10,
@@ -150,6 +161,7 @@ export default {
     this.deptBudgetList.baseId = this.$route.query.baseId
     this.deptBudgetList.positionId = this.$route.query.positionId
     this.deptBudgetList.warehouseName = this.$route.query.warehouseName
+    this.binNumber = this.$route.query.binNumber
     this.getList()
     this.showType = this.isShow
   },
@@ -337,6 +349,16 @@ export default {
   width: 62px;
   text-align: right;
 }
+.ware {
+  font-size: 12px;
+  color: rgb(255, 255, 255);
+  background: rgb(175, 181, 203);
+  padding: 3px;
+  position: relative;
+  top: -1px;
+  border-radius: 3px;
+  text-align: center;
+}
 .title {
   position: relative;
 }

+ 167 - 61
src/views/warehouse/warehouseManagementPut.vue

@@ -69,6 +69,7 @@
           <!--净重(吨)-->
           <ws-form-item label="净重(吨)" span="1" prop="netWeight">
             <ws-input
+              readonly="readonly"
               v-model="deptBudgetList.netWeight"
               placeholder="不可编辑,自动计算"
               maxlength="120"
@@ -133,7 +134,7 @@
           </ws-form-item>
 
           <!--车牌号-->
-          <ws-form-item label="车牌号" span="1" prop="sourceGoods">
+          <ws-form-item label="车牌号" span="1" prop="carNo">
             <ws-input
               v-model="deptBudgetList.carNo"
               placeholder="请输入车牌号"
@@ -297,6 +298,7 @@ export default {
       // 提交类型
       submitType: true,
       storageType: [],
+      readonly: true,
       appendixIdsAdd: '',
       uploadSuccess: {},
       onChange: {},
@@ -340,16 +342,22 @@ export default {
     this.deptBudgetList.warehouseName = this.$route.query.warehouseName
     this.deptBudgetList.binNumber = this.$route.query.binNumber
     this.getList()
+    this.deptBudgetList.goodsName = '玉米'
+    this.deptBudgetList.goodsNameKey = '1'
+    this.deptBudgetList.grade = '一等品'
+    this.deptBudgetList.gradeKey = '1'
+    this.deptBudgetList.inOutType = '采购入库'
+    this.deptBudgetList.inOutTypeKey = '1'
   },
   activated() {
-  //   //cg.viewBudget
-  //   //cg.viewSpareMoney
-  //   // this.getVesselData();
-  //   console.log(2222)
-  //   this.getList()
-  //   console.log(1111)
-  //   this.showType = this.isShow
-  // this.getList(this.$route.query.baseId,)
+    //   //cg.viewBudget
+    //   //cg.viewSpareMoney
+    //   // this.getVesselData();
+    //   console.log(2222)
+    //   this.getList()
+    //   console.log(1111)
+    //   this.showType = this.isShow
+    // this.getList(this.$route.query.baseId,)
   },
   methods: {
     //返回按钮
@@ -358,58 +366,160 @@ export default {
     },
     //提交按钮
     submit() {
-      this.$refs.deptBudgetList.validate((valid) => {
-        if (valid) {
-          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
-          this.deptBudgetList.inOutFlag = 2
-          this.deptBudgetList.statusFlag = 3
-          addstorageputList(this.deptBudgetList)
-            .toPromise()
-            .then((response) => {
-              this.$message.success('添加成功')
-              this.$router.push({ path: 'warehouseManagementList' })
-            })
-        } else {
-          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-          return false
-        }
-      })
-    },
-    // 暂存按钮
-    returnWarehouse() {
-      this.$refs.deptBudgetList.validate((valid) => {
-        if (valid) {
-          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
-          this.deptBudgetList.statusFlag = 1
-          addstorageputList(this.deptBudgetList)
-            .toPromise()
-            .then((response) => {
-              this.$message.success('添加成功')
-              this.$router.push({ path: 'warehouseManagementList' })
-            })
-        } else {
-          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-          return false
-        }
+      if (!this.deptBudgetList.goodsName) {
+        this.$message({
+          message: '货名不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.grossWeight < 0 ||
+        this.deptBudgetList.grossWeight > 10000 ||
+        (String(this.deptBudgetList.grossWeight).indexOf('.') != -1 &&
+          String(this.deptBudgetList.grossWeight).length -
+            (String(this.deptBudgetList.grossWeight).indexOf('.') + 1) >
+            3)
+      ) {
+        this.$message({
+          message: '毛重输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.tare < 0 ||
+        this.deptBudgetList.tare > 10000 ||
+        (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
+          String(this.deptBudgetList.tare).length -
+            (String(this.deptBudgetList.tare).indexOf('.') + 1) >
+            3)
+      ) {
+        this.$message({
+          message: '皮重输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.car.length < 2 ||
+        this.deptBudgetList.agent.length > 10
+      ) {
+        this.$message({
+          message: '经办人输入有误',
+          type: 'warning',
+        })
+        return
+      }
+      if (this.deptBudgetList.carNo.length > 7) {
+        this.$message({
+          message: '车牌号输入错误,请输入7个字符之内',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.contractNo.length < 6 ||
+        this.deptBudgetList.contractNo.length > 20
+      ) {
+        this.$message({
+          message: '合同编号长度不符合要求,请输入6-20个字符之内',
+          type: 'warning',
+        })
+        return
+      }
+      this.$confirm(`确定提交入库信息`, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
       })
-    },ubmit() {
-      this.$refs.deptBudgetList.validate((valid) => {
-        if (valid) {
-          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
-          this.deptBudgetList.inOutFlag = 2
-          addstorageputList(this.deptBudgetList)
-            .toPromise()
-            .then((response) => {
-              this.$message.success('添加成功')
-              this.$router.push({ path: 'warehouseManagementList' })
-            })
-        } else {
-          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+        .then(() => {
+          this.$refs.deptBudgetList.validate((valid) => {
+            if (valid) {
+              this.deptBudgetList.compId = sessionStorage.getItem(
+                'ws-pf_compId'
+              )
+              this.deptBudgetList.inOutFlag = 2
+              this.deptBudgetList.statusFlag = 3
+              addstorageputList(this.deptBudgetList)
+                .toPromise()
+                .then((response) => {
+                  this.$message.success('添加成功')
+                  this.$router.push({ path: 'warehouseManagementList' })
+                })
+            } else {
+              EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              return false
+            }
+          })
+        })
+        .catch(() => {
           return false
-        }
-      })
+        })
     },
     temporaryStorage() {
+      if (!this.deptBudgetList.goodsName) {
+        this.$message({
+          message: '货名不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.grossWeight < 0 ||
+        this.deptBudgetList.grossWeight > 10000 ||
+        (String(this.deptBudgetList.grossWeight).indexOf('.') != -1 &&
+          String(this.deptBudgetList.grossWeight).length -
+            (String(this.deptBudgetList.grossWeight).indexOf('.') + 1) >
+            3)
+      ) {
+        this.$message({
+          message: '毛重输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.tare < 0 ||
+        this.deptBudgetList.tare > 10000 ||
+        (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
+          String(this.deptBudgetList.tare).length -
+            (String(this.deptBudgetList.tare).indexOf('.') + 1) >
+            3)
+      ) {
+        this.$message({
+          message: '皮重输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.car.length < 2 ||
+        this.deptBudgetList.agent.length > 10
+      ) {
+        this.$message({
+          message: '经办人输入有误',
+          type: 'warning',
+        })
+        return
+      }
+      if (this.deptBudgetList.carNo.length > 7) {
+        this.$message({
+          message: '车牌号输入错误,请输入7个字符之内',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.contractNo.length < 6 ||
+        this.deptBudgetList.contractNo.length > 20
+      ) {
+        this.$message({
+          message: '合同编号长度不符合要求,请输入6-20个字符之内',
+          type: 'warning',
+        })
+        return
+      }
       this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
@@ -438,7 +548,6 @@ export default {
         .catch(() => {
           return false
         })
-
     },
     tarechange(e) {
       if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
@@ -609,9 +718,6 @@ export default {
 /deep/.el-form-item__label {
   width: 160px;
 }
-/deep/.el-input--small {
-  width: 70%;
-}
 //选填
 /deep/.el-form-item {
   width: 50%;

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

@@ -172,11 +172,21 @@
             </template>
           </el-table-column>
           <el-table-column prop="inOutDate" label="出入库日期">
+            <template slot-scope="scope">
+              <span style="color: #8890b1">{{ scope.row.inOutDate }}</span>
+            </template>
           </el-table-column>
           <el-table-column prop="inOutType" label="类型"> </el-table-column>
           <el-table-column prop="contractNo" label="合同编号">
+            <template slot-scope="scope">
+              <span style="color: #8890b1">{{ scope.row.contractNo }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="carNo" label="车牌号">
+            <template slot-scope="scope">
+              <span style="color: #8890b1">{{ scope.row.carNo }}</span>
+            </template>
           </el-table-column>
-          <el-table-column prop="carNo" label="车牌号"> </el-table-column>
           <el-table-column prop="qualityInspector" label="经办人">
           </el-table-column>
           <el-table-column prop="buyer" label="内勤"> </el-table-column>
@@ -197,6 +207,9 @@
             </template>
           </el-table-column>
           <el-table-column prop="createDate" label="录入时间">
+            <template slot-scope="scope">
+              <span style="color: #8890b1">{{ scope.row.createDate }}</span>
+            </template>
           </el-table-column>
         </el-table>
         <div style="text-align: center; padding: 10px">
@@ -328,6 +341,7 @@ export default {
           baseId: this.deptBudgetList.baseId,
           positionId: this.deptBudgetList.positionId,
           warehouseName: this.deptBudgetList.warehouseName,
+          binNumber: this.binNumber,
         },
       })
     },

+ 2 - 1
vue.config.js

@@ -144,7 +144,8 @@ module.exports = {
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
         // target: 'http://192.168.1.124:8090/',
-        target: 'http://192.168.1.115:8090/',
+        // target: 'http://192.168.1.124:8090/',
+        target: 'http://192.168.1.124:8090/',
         // target: 'http://192.168.24.5:8098',//目标地址
         // target: 'http://product-server.winsea.com/',
         // target: 'http://192.168.24.5:8098',//目标地址