123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- <template>
- <!-- 新增预留转入库作业页面 -->
- <div class="addCheckWarehouse">
- <page-title>预留转入库作业</page-title>
- <div class="material from">
- <span class="text">物资规格型号:</span>
- <el-input class="input" v-model="materialName" disabled> </el-input>
- <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
- </div>
- <div class="materialNumber from">
- <span class="text">最大预留件数:</span>
- <el-input class="input" v-model="max" disabled> </el-input>
- </div>
- <div class="materialNumber from">
- <span class="text">件数:</span>
- <el-input class="input" v-model="materialNumber"> </el-input>
- </div>
- <!-- 模态窗口 -->
- <el-drawer :visible.sync="drawer" :direction="direction" size="40%">
- <div style="margin-bottom: 10px">
- <el-input
- placeholder="请输入内容"
- v-model="input"
- style="margin-top: 10px; margin-right: 10px; width: 250px"
- clearable
- ></el-input>
- <el-button type="primary" class="btn" @click="onclick(a)">
- <i class="el-icon-search"></i>查询
- </el-button>
- </div>
- <div v-show="a == 1">
- <dilTable
- v-bind.sync="first"
- @radio-change="currentRadioChange1"
- ></dilTable>
- </div>
- <div v-show="a == 2">
- <dilTable
- v-bind.sync="second"
- @radio-change="currentRadioChange2"
- ></dilTable>
- </div>
- </el-drawer>
- <div class="button_box">
- <el-button @click="onClickCancel">返回</el-button>
- <el-button type="primary" @click="onClickConfirm" :disabled = "disabled">确认</el-button>
- </div>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- import { sjTime, isNumber, isIntegerNumber } from "@/utils/sharedJsFile";
- import { getCookie } from "@/utils/util.js";
- export default {
- components: { PageTitle },
- data() {
- return {
- max:null,
- disabled:false,
- //仓库名称
- warehouseName:null,
- //物资名称
- materialName: null,
- //物资编码
- materialCode:null,
- // 物资规格
- materialSpecification:null,
- // 物资型号
- materialModel:null,
- //盘点数量
- materialNumber:null,
- //物资id
- materialId: null,
- //是否需要打开模态窗口
- drawer: false,
- a: 1,
- direction: "rtl",
- input: "",
- first: {
- requestUrl: "",
- selectionType: "radio",
- mapList1: [],
- },
- second: {
- requestUrl: "",
- selectionType:"radio"
- }
- };
- },
- watch: {
- drawer(val) {
- if (!val) {
- this.input = null;
- }
- },
- },
- created() {
-
- },
- methods: {
- onclick(a) {
- if (a == 1) {
- this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId="+3+"&status="+2+"&con="+this.input
- }
- },
- ondrawer(num) {
- this.drawer = true;
- this.a = num;
- if(num==1){
- this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId="+3+"&status="+2+"&con="+""
- }
- },
- // 返回
- onClickCancel() {
- this.$router.push("/steel_reserved");
- },
- currentRadioChange1(selection) {
- console.log(selection);
- this.materialName = selection.materialName + selection.materialSpecification + '(' + selection.materialModel + ')' ;
- this.materialId = selection.materialId;
- this.materialCode = selection.materialCode;
- this.materialSpecification = selection.materialSpecification;
- this.materialModel = selection.materialModel;
- this.max = selection.max;
- },
- currentRadioChange2(selection) {
- this.warehouseId = selection.warehouseId
- this.warehouseName = selection.warehouseName
- },
- // 确认
- onClickConfirm() {
- // console.log(this.warehouseId,this.materialCode,this.materialNumber);
- this.disabled = true
- this.axios.post("/api/v1/wms/insertInbounds?warehouseId=" + 3 + "&materialCode=" + this.materialCode+"&materialSpecification="+this.materialSpecification+"&materialModel="+this.materialModel+ "&quantity=" + this.materialNumber ).then((res) => {
- console.log(res.data)
- if (res.data.code == "200") {
- this.$message({
- message: "入库成功!",
- type: "success",
- });
- this.disabled = false
- this.onClickCancel()
- this.$router.go(-1)
- }else if(res.data.code=="201"){
- this.$message({
- message:"入库的数量不正确",
- type:"faile",
- })
- }
- this.$router.go(-1)
- });
- },
- },
- };
- </script>
- <style lang="scss" scope>
- .addCheckWarehouse{
- .contractDetails {
- width: 100%;
- }
- .from {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 5px;
- margin-bottom: 20px;
- }
- .warehouse {
- display: flex;
- justify-content: center;
- margin-top: 20px;
- margin-right: 70px;
- .text {
- display: inline-block;
- width: 170px;
- text-align: right;
- }
- .input {
- width: 250px;
- margin-right: 20px;
- }
- }
- .material {
- display: flex;
- justify-content: center;
- margin-top: 20px;
- .text {
- display: inline-block;
- width: 170px;
- text-align: right;
- }
- .input {
- width: 250px;
- margin-right: 20px;
- }
- }
- .materialNumber {
- display: flex;
- justify-content: center;
- margin-top: 20px;
- margin-right: 70px;
- .text {
- display:inline-block;
- width: 170px;
- text-align: right;
- }
- .input {
- width: 250px;
- margin-right: 20px;
- }
- }
- .button_box {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100px;
- }
- }
- </style>
|