|
@@ -0,0 +1,409 @@
|
|
|
|
+// 仓库折转
|
|
|
|
+<template>
|
|
|
|
+ <div class="container">
|
|
|
|
+ <el-row class="toptitle">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <h2 class="bg-left title">折转</h2>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12" class="bg-right">
|
|
|
|
+ <el-button type="primary" size="small" @click="returnsales()">
|
|
|
|
+ <img
|
|
|
|
+ width="6"
|
|
|
|
+ height="10"
|
|
|
|
+ style="vertical-align: bottom; margin-right: 3px"
|
|
|
|
+ src="../../../public/img/lujing.png"
|
|
|
|
+ alt=""
|
|
|
|
+ />返回
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <div class="center">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <div class="bg-left centertitle">
|
|
|
|
+ <h1>{{ warehouseName }}</h1>
|
|
|
|
+ <span class="temporary" v-show="warehouseType == 2">(临)</span>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12" class="bg-right">
|
|
|
|
+ <el-button type="primary" size="small" @click="addTurnAround()">新增折转</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-table
|
|
|
|
+ class="forData"
|
|
|
|
+ :data="transformationList"
|
|
|
|
+ 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>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="beforeBinNo" label="折转前仓位"></el-table-column>
|
|
|
|
+ <el-table-column prop="beforeGoodsName" label="折转前货名"></el-table-column>
|
|
|
|
+ <el-table-column prop="beforeWeight" label="折转前重量(吨)"></el-table-column>
|
|
|
|
+ <el-table-column prop="afterBinNo" label="折转后仓位"></el-table-column>
|
|
|
|
+ <el-table-column prop="afterGoodsName" label="折转后货名"></el-table-column>
|
|
|
|
+ <el-table-column prop="afterWeight" label="折转后重量(吨)"></el-table-column>
|
|
|
|
+ <el-table-column prop="backOffice" label="操作人"></el-table-column>
|
|
|
|
+ <el-table-column prop="updateDate" label="操作时间"></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="折转"
|
|
|
|
+ :visible.sync="dialogShow"
|
|
|
|
+ width="40%"
|
|
|
|
+ top="35vh"
|
|
|
|
+ :before-close="dialogClose"
|
|
|
|
+ >
|
|
|
|
+ <div>
|
|
|
|
+ <span class="eject-warehouse">{{ warehouseName }}</span
|
|
|
|
+ ><span v-show="warehouseType == 2">(临)</span>
|
|
|
|
+ </div>
|
|
|
|
+ <table class="table_css">
|
|
|
|
+ <tr>
|
|
|
|
+ <td></td>
|
|
|
|
+ <td v-show="warehouseType != 2">仓位</td>
|
|
|
|
+ <td>货名</td>
|
|
|
|
+ <td>重量(吨)</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td class="table_item">折转前</td>
|
|
|
|
+ <td v-show="warehouseType != 2">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="transformationAdd.beforeBinNo"
|
|
|
|
+ placeholder="请选择仓位号"
|
|
|
|
+ @change="binNo"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in binNoList"
|
|
|
|
+ :key="item.binNumber"
|
|
|
|
+ :label="item.binNumber"
|
|
|
|
+ :value="index"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="transformationAdd.beforeGoodsName"
|
|
|
|
+ placeholder="请选择货名"
|
|
|
|
+ @change="goodsNameChange">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in goodsNameList"
|
|
|
|
+ :key="item.goodsName"
|
|
|
|
+ :label="item.goodsName"
|
|
|
|
+ :value="index">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <el-input v-model="transformationAdd.beforeWeight" placeholder="请输入重量" type="number" :validate-event="true" maxlength="10"></el-input>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td class="table_item">折转后</td>
|
|
|
|
+ <td v-show="warehouseType != 2">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="transformationAdd.afterBinNo"
|
|
|
|
+ placeholder="请选择仓位号"
|
|
|
|
+ @change="binNo1">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in binNoList"
|
|
|
|
+ :key="item.binNumber"
|
|
|
|
+ :label="item.binNumber"
|
|
|
|
+ :value="index">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <el-select v-model="transformationAdd.afterGoodsName" placeholder="请选择货名" @change="goodsNameChange1">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in goodsNameAllList"
|
|
|
|
+ :key="item.constValue"
|
|
|
|
+ :label="item.constValue"
|
|
|
|
+ :value="index">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <el-input v-model="transformationAdd.afterWeight" placeholder="请输入重量" type="number"></el-input>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ </table>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="dialogClose">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="submit">确 定 折 转</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <div style="text-align: center; padding: 10px">
|
|
|
|
+ <el-pagination
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-size="deptCircularPage.pageSize"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :total="deptBudgetTotal"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import {
|
|
|
|
+ turnAroundList,
|
|
|
|
+ turnAroundAdd,
|
|
|
|
+ turnAroundXiaLa,
|
|
|
|
+ turnAroundGoodsNameAll,
|
|
|
|
+ getbinnumber,
|
|
|
|
+} from '@/model/warehouse/index'
|
|
|
|
+export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ dialogShow: false,
|
|
|
|
+ transformationList: [],
|
|
|
|
+ warehouseId: '',
|
|
|
|
+ warehouseName: '',
|
|
|
|
+ goodsNameList: [],
|
|
|
|
+ goodsNameAllList: [],
|
|
|
|
+ binNoList: [],
|
|
|
|
+ binNumberId: '', //仓位Id
|
|
|
|
+ warehouseType: '',
|
|
|
|
+ compId: '',
|
|
|
|
+ transformationAdd: {},
|
|
|
|
+ //分页
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ deptCircularPage: {},
|
|
|
|
+ deptBudgetTotal: 0,
|
|
|
|
+ storage: '',
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ activated() {
|
|
|
|
+ this.compId = localStorage.getItem('ws-pf_compId')
|
|
|
|
+ this.binNumberId = this.$route.query.binNumberId //仓位Id
|
|
|
|
+ this.warehouseId = this.$route.query.warehouseId //仓库Id
|
|
|
|
+ this.warehouseName = this.$route.query.warehouseName //仓库名
|
|
|
|
+ this.warehouseType = this.$route.query.warehouseType //仓库类型
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ returnsales() {
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ },
|
|
|
|
+ goodsNameChange(e) {
|
|
|
|
+ this.transformationAdd.beforeGoodsName = this.goodsNameList[e].goodsName
|
|
|
|
+ this.transformationAdd.beforeGoodsNameKey = this.goodsNameList[e].goodsNameKey
|
|
|
|
+ this.storage = this.goodsNameList[e].storage
|
|
|
|
+ },
|
|
|
|
+ goodsNameChange1(e) {
|
|
|
|
+ this.transformationAdd.afterGoodsName = this.goodsNameAllList[e].constValue
|
|
|
|
+ this.transformationAdd.afterGoodsNameKey = this.goodsNameAllList[e].constKey
|
|
|
|
+ },
|
|
|
|
+ //新增折转
|
|
|
|
+ addTurnAround() {
|
|
|
|
+ if(this.warehouseType==2){
|
|
|
|
+ turnAroundXiaLa({
|
|
|
|
+ id: this.warehouseId,
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.goodsNameList = response
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ turnAroundGoodsNameAll({
|
|
|
|
+ constId: 'CON2',
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.goodsNameAllList = response
|
|
|
|
+ })
|
|
|
|
+ getbinnumber({
|
|
|
|
+ id: this.warehouseId,
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.binNoList = response.warehousePositionInfoList
|
|
|
|
+ })
|
|
|
|
+ this.dialogShow = true
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
+ console.log(`每页 ${val} 条`)
|
|
|
|
+ this.pageSize = val
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
+ this.currentPage = val
|
|
|
|
+ console.log(`当前页: ${val}`)
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ getList() {
|
|
|
|
+ // 列表
|
|
|
|
+ turnAroundList({
|
|
|
|
+ baseId: this.warehouseId,
|
|
|
|
+ currentPage: this.currentPage,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.deptCircularPage.currentPage = response.current
|
|
|
|
+ this.deptCircularPage.pageSize = response.size
|
|
|
|
+ this.deptBudgetTotal = response.total
|
|
|
|
+ this.transformationList = response.records
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ binNo(e) {
|
|
|
|
+ if(this.warehouseType==1){
|
|
|
|
+ turnAroundXiaLa({
|
|
|
|
+ id: this.binNoList[e].id,
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.goodsNameList = response
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.transformationAdd.beforeBinNo = this.binNoList[e].binNumber
|
|
|
|
+ this.transformationAdd.positionId = this.binNoList[e].id
|
|
|
|
+ },
|
|
|
|
+ binNo1(e) {
|
|
|
|
+ this.transformationAdd.afterBinNo = this.binNoList[e].binNumber
|
|
|
|
+ this.transformationAdd.afterPositionId = this.binNoList[e].id
|
|
|
|
+ },
|
|
|
|
+ dialogClose() {
|
|
|
|
+ this.transformationAdd = {}
|
|
|
|
+ this.dialogShow = false
|
|
|
|
+ },
|
|
|
|
+ submit() {
|
|
|
|
+ if (!this.transformationAdd.beforeBinNo && this.warehouseType != 2) {
|
|
|
|
+ this.$message.error('请选择折转前仓位')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.transformationAdd.beforeGoodsName) {
|
|
|
|
+ this.$message.error('请选择折转前货名')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.transformationAdd.beforeWeight) {
|
|
|
|
+ this.$message.error('请选择折转前重量')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (Number(this.transformationAdd.beforeWeight) > Number(this.storage)) {
|
|
|
|
+ this.$message.error('折转前重量不能超过现有储量')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.transformationAdd.afterBinNo && this.warehouseType != 2) {
|
|
|
|
+ this.$message.error('请选择折转后仓位')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.transformationAdd.afterGoodsName) {
|
|
|
|
+ this.$message.error('请选择折转后货名')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.transformationAdd.afterWeight) {
|
|
|
|
+ this.$message.error('请选择折转后重量')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (Number(this.transformationAdd.afterWeight) > Number(this.transformationAdd.beforeWeight)) {
|
|
|
|
+ this.$message.error('折转后重量不可超过折转前重量')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$confirm(`确定提交折转信息?`, '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.transformationAdd.backOffice = localStorage.getItem('ws-pf_staffName')
|
|
|
|
+ // this.transformationAdd.compId = this.compId
|
|
|
|
+ this.transformationAdd.baseId = this.warehouseId
|
|
|
|
+ this.transformationAdd.warehouseName = this.warehouseName
|
|
|
|
+ turnAroundAdd(this.transformationAdd)
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ if (response == 'OK') {
|
|
|
|
+ this.$notify({
|
|
|
|
+ title: '成功',
|
|
|
|
+ message: '折转信息提交成功!',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ this.transformationAdd = {}
|
|
|
|
+ this.dialogShow = false
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.toptitle {
|
|
|
|
+ background: #f6f7fc;
|
|
|
|
+}
|
|
|
|
+.bg-left {
|
|
|
|
+ padding-left: 30px;
|
|
|
|
+}
|
|
|
|
+.bg-right {
|
|
|
|
+ text-align: right;
|
|
|
|
+ padding: 16px 20px;
|
|
|
|
+}
|
|
|
|
+.top-title {
|
|
|
|
+ width: 50%;
|
|
|
|
+ display: flex;
|
|
|
|
+}
|
|
|
|
+.title {
|
|
|
|
+ position: relative;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.title::before {
|
|
|
|
+ content: '';
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 5px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ background: #5473e8;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+}
|
|
|
|
+.container {
|
|
|
|
+ overflow: scroll;
|
|
|
|
+ height: 93vh;
|
|
|
|
+}
|
|
|
|
+.center {
|
|
|
|
+ padding: 0 5%;
|
|
|
|
+ margin: auto;
|
|
|
|
+}
|
|
|
|
+.centertitle {
|
|
|
|
+ display: flex;
|
|
|
|
+}
|
|
|
|
+.temporary {
|
|
|
|
+ line-height: 80px;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ color: #abaaaa;
|
|
|
|
+}
|
|
|
|
+/deep/.forData .cell {
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+//弹出框
|
|
|
|
+.eject-warehouse {
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ margin-left: 15px;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+}
|
|
|
|
+.table_css {
|
|
|
|
+ margin: 20px auto;
|
|
|
|
+ tr {
|
|
|
|
+ height: 50px;
|
|
|
|
+ }
|
|
|
|
+ .table_item {
|
|
|
|
+ min-width: 70px;
|
|
|
|
+ }
|
|
|
|
+ td {
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ }
|
|
|
|
+ .el-select {
|
|
|
|
+ width: 90%;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|