|
@@ -1,20 +1,32 @@
|
|
|
<template>
|
|
|
<!-- 新增入库转预留作业页面 -->
|
|
|
<div class="addCheckWarehouse">
|
|
|
- <page-title>入库转预留作业</page-title>
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+ <div class="materialNumber from">
|
|
|
+ <span class="text">理重(磅重)</span>
|
|
|
+ <el-input class="input" v-model="materialTheWeight" disabled> </el-input>
|
|
|
+ </div>
|
|
|
+ <div class="materialNumber from">
|
|
|
+ <span class="text">实重</span>
|
|
|
+ <el-input class="input" v-model="actuallyWeight"> </el-input>
|
|
|
+ </div>
|
|
|
+ <div class="materialNumber from">
|
|
|
+ <span class="text">备注</span>
|
|
|
+ <el-input class="input" v-model="remark"> </el-input>
|
|
|
+ </div>
|
|
|
<!-- 模态窗口 -->
|
|
|
<el-drawer :visible.sync="drawer" :direction="direction" size="40%">
|
|
|
<div style="margin-bottom: 10px">
|
|
@@ -39,11 +51,13 @@
|
|
|
v-bind.sync="second"
|
|
|
@radio-change="currentRadioChange2"
|
|
|
></dilTable>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
</el-drawer>
|
|
|
<div class="button_box">
|
|
|
<el-button @click="onClickCancel">返回</el-button>
|
|
|
- <el-button type="primary" @click="onClickConfirm" :disabled = "disabled">确认</el-button>
|
|
|
+ <el-button type="primary" @click="onClickConfirm" :disabled="disabled"
|
|
|
+ >确认</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -55,22 +69,22 @@ export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
|
return {
|
|
|
- startTime:null,
|
|
|
- endTime:null,
|
|
|
- max:null,
|
|
|
- disabled:false,
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
+ max: null,
|
|
|
+ disabled: false,
|
|
|
//仓库名称
|
|
|
- warehouseName:null,
|
|
|
+ warehouseName: null,
|
|
|
//物资名称
|
|
|
materialName: null,
|
|
|
//物资编码
|
|
|
- materialCode:null,
|
|
|
+ materialCode: null,
|
|
|
// 物资规格
|
|
|
- materialSpecification:null,
|
|
|
+ materialSpecification: null,
|
|
|
// 物资型号
|
|
|
- materialModel:null,
|
|
|
+ materialModel: null,
|
|
|
//盘点数量
|
|
|
- materialNumber:null,
|
|
|
+ materialNumber: null,
|
|
|
//物资id
|
|
|
materialId: null,
|
|
|
//是否需要打开模态窗口
|
|
@@ -81,12 +95,15 @@ export default {
|
|
|
first: {
|
|
|
requestUrl: "",
|
|
|
selectionType: "radio",
|
|
|
- mapList1: [],
|
|
|
+ mapList1: []
|
|
|
},
|
|
|
second: {
|
|
|
- requestUrl: "",
|
|
|
- selectionType:"radio"
|
|
|
- }
|
|
|
+ requestUrl: "",
|
|
|
+ selectionType: "radio"
|
|
|
+ },
|
|
|
+ materialTheWeight: 0,
|
|
|
+ actuallyWeight: 0,
|
|
|
+ remark: null
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -95,46 +112,99 @@ export default {
|
|
|
this.input = null;
|
|
|
}
|
|
|
},
|
|
|
+ materialNumber() {
|
|
|
+ this.getTheoreticalByInfo();
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- let strTime=this.formatDate(new Date(),"yyyy-MM-dd hh:mm:ss")
|
|
|
- this.startTime= Date.parse(new Date(strTime));
|
|
|
- this.endTime=new Date(this.startTime+86400000);
|
|
|
+ let strTime = this.formatDate(new Date(), "yyyy-MM-dd hh:mm:ss");
|
|
|
+ this.startTime = Date.parse(new Date(strTime));
|
|
|
+ this.endTime = new Date(this.startTime + 86400000);
|
|
|
},
|
|
|
methods: {
|
|
|
- formatDate (date, fmt) {
|
|
|
- if (/(y+)/.test(fmt)) {
|
|
|
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
|
|
|
- }
|
|
|
- let o = {
|
|
|
- 'M+': date.getMonth() + 1,
|
|
|
- 'd+': date.getDate(),
|
|
|
- 'h+': 0,
|
|
|
- 'm+': 0,
|
|
|
- 's+': 0
|
|
|
+ getTheoreticalByInfo() {
|
|
|
+ this.axios
|
|
|
+ .post(
|
|
|
+ "/api/v1/wms/getTheoreticalByInfo?warehouseId=" +
|
|
|
+ 3 +
|
|
|
+ "&materialCode=" +
|
|
|
+ this.materialCode +
|
|
|
+ "&materialSpecification=" +
|
|
|
+ this.materialSpecification +
|
|
|
+ "&materialModel=" +
|
|
|
+ this.materialModel +
|
|
|
+ "&num=" +
|
|
|
+ this.materialNumber +
|
|
|
+ "&status=1"
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.data == -1) {
|
|
|
+ this.$message.error("数量超出");
|
|
|
+ this.materialTheWeight = null;
|
|
|
+ } else {
|
|
|
+ this.materialTheWeight = parseFloat(res.data.data);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ formatDate(date, fmt) {
|
|
|
+ if (/(y+)/.test(fmt)) {
|
|
|
+ fmt = fmt.replace(
|
|
|
+ RegExp.$1,
|
|
|
+ (date.getFullYear() + "").substr(4 - RegExp.$1.length)
|
|
|
+ );
|
|
|
}
|
|
|
+ let o = {
|
|
|
+ "M+": date.getMonth() + 1,
|
|
|
+ "d+": date.getDate(),
|
|
|
+ "h+": 0,
|
|
|
+ "m+": 0,
|
|
|
+ "s+": 0
|
|
|
+ };
|
|
|
for (let k in o) {
|
|
|
if (new RegExp(`(${k})`).test(fmt)) {
|
|
|
- let str = o[k] + ''
|
|
|
- fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.padLeftZero(str))
|
|
|
+ let str = o[k] + "";
|
|
|
+ fmt = fmt.replace(
|
|
|
+ RegExp.$1,
|
|
|
+ RegExp.$1.length === 1 ? str : this.padLeftZero(str)
|
|
|
+ );
|
|
|
}
|
|
|
- }
|
|
|
- return fmt
|
|
|
+ }
|
|
|
+ return fmt;
|
|
|
},
|
|
|
- padLeftZero (str) {
|
|
|
- return ('00' + str).substr(str.length)
|
|
|
+ padLeftZero(str) {
|
|
|
+ return ("00" + str).substr(str.length);
|
|
|
},
|
|
|
onclick(a) {
|
|
|
if (a == 1) {
|
|
|
- console.log(this.input)
|
|
|
- this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId="+3+"&status="+1+"&con="+this.input+"&startTime=" + sjTime(this.startTime) + "&endTime=" + sjTime(this.endTime)
|
|
|
+ console.log(this.input);
|
|
|
+ this.first.requestUrl =
|
|
|
+ "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId=" +
|
|
|
+ 3 +
|
|
|
+ "&status=" +
|
|
|
+ 1 +
|
|
|
+ "&con=" +
|
|
|
+ this.input +
|
|
|
+ "&startTime=" +
|
|
|
+ sjTime(this.startTime) +
|
|
|
+ "&endTime=" +
|
|
|
+ sjTime(this.endTime);
|
|
|
}
|
|
|
},
|
|
|
ondrawer(num) {
|
|
|
this.drawer = true;
|
|
|
this.a = num;
|
|
|
- if(num==1){
|
|
|
- this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId="+3+"&status="+1+"&con="+""+"&startTime=" + sjTime(this.startTime) + "&endTime=" + sjTime(this.endTime)
|
|
|
+ if (num == 1) {
|
|
|
+ this.first.requestUrl =
|
|
|
+ "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId=" +
|
|
|
+ 3 +
|
|
|
+ "&status=" +
|
|
|
+ 1 +
|
|
|
+ "&con=" +
|
|
|
+ "" +
|
|
|
+ "&startTime=" +
|
|
|
+ sjTime(this.startTime) +
|
|
|
+ "&endTime=" +
|
|
|
+ sjTime(this.endTime);
|
|
|
}
|
|
|
},
|
|
|
// 返回
|
|
@@ -150,97 +220,124 @@ export default {
|
|
|
this.max = selection.max;
|
|
|
},
|
|
|
currentRadioChange2(selection) {
|
|
|
- this.warehouseId = selection.warehouseId
|
|
|
- this.warehouseName = selection.warehouseName
|
|
|
+ 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/insertReserved?warehouseId=" + 3 + "&materialCode=" + this.materialCode+"&materialSpecification="+this.materialSpecification+"&materialModel="+this.materialModel+ "&quantity=" + this.materialNumber ).then((res) => {
|
|
|
- console.log(res.data)
|
|
|
+ this.disabled = true;
|
|
|
+ // if(isNumber(this.actuallyWeight))
|
|
|
+ if (!isNumber(this.actuallyWeight)) {
|
|
|
+ this.$message.error("实重填写不正确");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.axios
|
|
|
+ .post(
|
|
|
+ "/api/v1/wms/insertReserved?warehouseId=" +
|
|
|
+ 3 +
|
|
|
+ "&materialCode=" +
|
|
|
+ this.materialCode +
|
|
|
+ "&materialSpecification=" +
|
|
|
+ this.materialSpecification +
|
|
|
+ "&materialModel=" +
|
|
|
+ this.materialModel +
|
|
|
+ "&quantity=" +
|
|
|
+ this.materialNumber +
|
|
|
+ "&actuallyWeight=" +
|
|
|
+ Number(parseFloat(this.actuallyWeight)) +
|
|
|
+ "&materialTheWeight=" +
|
|
|
+ Number(parseFloat(this.materialTheWeight)) +
|
|
|
+ "&remark=" +
|
|
|
+ this.remark
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ console.log(res.data);
|
|
|
if (res.data.code == "200") {
|
|
|
this.$message({
|
|
|
- message: "预留成功!",
|
|
|
- type: "success",
|
|
|
+ message: "入库成功!",
|
|
|
+ type: "success"
|
|
|
});
|
|
|
- this.disabled = false
|
|
|
- this.onClickCancel()
|
|
|
- this.$router.go(-1)
|
|
|
- }else if(res.data.code=="201"){
|
|
|
+ this.disabled = false;
|
|
|
+ this.onClickCancel();
|
|
|
+ this.$router.go(-1);
|
|
|
+ } else if (res.data.code == "201") {
|
|
|
this.$message({
|
|
|
- message:"预留的数量不正确",
|
|
|
- type:"faile",
|
|
|
- })
|
|
|
+ message: "入库的数量不正确",
|
|
|
+ type: "faile"
|
|
|
+ });
|
|
|
+ this.disabled = false;
|
|
|
}
|
|
|
- this.$router.go(-1)
|
|
|
+ this.$router.go(-1);
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.disabled = false;
|
|
|
});
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</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;
|
|
|
+.addCheckWarehouse {
|
|
|
+ .contractDetails {
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
- .input {
|
|
|
- width: 250px;
|
|
|
- margin-right: 20px;
|
|
|
+ .from {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 5px;
|
|
|
+ margin-bottom: 20px;
|
|
|
}
|
|
|
-}
|
|
|
-.material {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- margin-top: 20px;
|
|
|
- .text {
|
|
|
- display: inline-block;
|
|
|
- width: 170px;
|
|
|
- text-align: right;
|
|
|
+ .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;
|
|
|
+ }
|
|
|
}
|
|
|
- .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 {
|
|
|
+ .materialNumber {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
margin-top: 20px;
|
|
|
margin-right: 70px;
|
|
|
.text {
|
|
|
- display:inline-block;
|
|
|
- width: 170px;
|
|
|
- text-align: right;
|
|
|
+ display: inline-block;
|
|
|
+ width: 170px;
|
|
|
+ text-align: right;
|
|
|
}
|
|
|
.input {
|
|
|
- width: 250px;
|
|
|
- margin-right: 20px;
|
|
|
+ width: 250px;
|
|
|
+ margin-right: 20px;
|
|
|
}
|
|
|
+ }
|
|
|
+ .button_box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 100%;
|
|
|
+ height: 100px;
|
|
|
+ }
|
|
|
}
|
|
|
-.button_box {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- width: 100%;
|
|
|
- height: 100px;
|
|
|
-}
|
|
|
-}
|
|
|
-</style>
|
|
|
+</style>
|