feat: 拼箱

20240912_adapter
chenhc 9 months ago
parent e646485455
commit 35d1d14ca2

@ -23,7 +23,13 @@ export function addRelCode(query) {
data: query data: query
}); });
} }
export function addRelCodeSpellBox(query) {
return axios({
url: "/udiwms/relCode/batch/addRelCodeSpellBox",
method: "post",
data: query
});
}
export function getDetailList(query) { export function getDetailList(query) {
return axios({ return axios({

@ -13,7 +13,7 @@
style="display: flex; margin-top: 5px; float: right" style="display: flex; margin-top: 5px; float: right"
> >
<el-button size="mini" type="primary" @click.native="spellBox()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="spellBox()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailListSpell.length == 0"
>拼箱 >拼箱
</el-button> </el-button>
<el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading"
@ -101,6 +101,7 @@
auto-complete="off" auto-complete="off"
style="width: 90%" style="width: 90%"
clearable clearable
:disabled="this.inputDisabled"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -113,6 +114,7 @@
clearable clearable
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 90%" style="width: 90%"
:disabled="this.inputDisabled"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -126,6 +128,7 @@
clearable clearable
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 90%" style="width: 90%"
:disabled="this.inputDisabled"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -138,6 +141,7 @@
clearable clearable
style="width: 90%" style="width: 90%"
placeholder="请输入备注" placeholder="请输入备注"
:disabled="this.inputDisabled"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -236,7 +240,7 @@
<script> <script>
import {enterCodeWeb} from "@/api/inout/order"; import {enterCodeWeb} from "@/api/inout/order";
import {addRelCode,scanCodeRelCode} from "@/api/collect/relCode"; import {addRelCodeSpellBox,scanCodeRelCode} from "@/api/collect/relCode";
import sonRelCode from './sonRelCodeSpell.vue'; import sonRelCode from './sonRelCodeSpell.vue';
import A from "@/plugins/KeyScaner"; import A from "@/plugins/KeyScaner";
export default { export default {
@ -255,6 +259,7 @@
}, },
data() { data() {
return { return {
inputDisabled: false,
// //
codeFormData: { codeFormData: {
code: "", code: "",
@ -350,6 +355,7 @@
detailList:[] detailList:[]
}, },
relFormDatas:[], relFormDatas:[],
detailListSpell: [],
popLevel:1, popLevel:1,
}; };
}, },
@ -396,6 +402,7 @@
return; return;
} }
} }
let tQuery = Object.assign(this.codeFormData); let tQuery = Object.assign(this.codeFormData);
tQuery.curCode = this.codeFormData.code; tQuery.curCode = this.codeFormData.code;
tQuery.parentCode = this.parentCode; tQuery.parentCode = this.parentCode;
@ -469,6 +476,8 @@
}else if(data.packLayer == (this.relFormData.packLayer-1) ) { }else if(data.packLayer == (this.relFormData.packLayer-1) ) {
// //
this.detailList.push(data); this.detailList.push(data);
this.detailListSpell.push(data);
this.inputDisabled = true
this.syxjsl = this.detailList.length; this.syxjsl = this.detailList.length;
// //
@ -543,15 +552,25 @@
detailList: [] detailList: []
} }
this.detailList = [] this.detailList = []
this.detailListSpell = []
this.parentCode = null this.parentCode = null
this.bhxjsl = 0 this.bhxjsl = 0
this.syxjsl = 0 this.syxjsl = 0
this.packLayer = null this.packLayer = null
}, },
spellBox() { spellBox() {
this.relFormDatas.push(this.relFormData) const temp = JSON.parse(JSON.stringify(this.relFormData));
console.log("拼凑箱子详情",this.relFormDatas) this.detailListSpell.forEach( item =>{
temp.detailList.push(item)
});
this.relFormDatas.push(temp)
this.detailListSpell = []
this.relFormData.detailList = []
this.relFormData.batchNo = null
this.relFormData.madeDate = null
this.relFormData.validateDate = null
// console.log("",this.relFormDatas)
this.inputDisabled = false
}, },
submit(val) { submit(val) {
if(this.detailList == null || this.detailList.length == 0){ if(this.detailList == null || this.detailList.length == 0){
@ -571,12 +590,6 @@
return; return;
} }
this.$set(this.relFormData, 'detailList', []);
this.detailList.forEach( item =>{
this.relFormData.detailList.push(item)
});
// //
if( this.bhxjsl != this.syxjsl){ if( this.bhxjsl != this.syxjsl){
this.$confirm("该层级已录入数量与应录入数量不符, 是否继续提交?", "提示", { this.$confirm("该层级已录入数量与应录入数量不符, 是否继续提交?", "提示", {
@ -586,7 +599,14 @@
}) })
.then(() => { .then(() => {
this.loading = true; this.loading = true;
addRelCode(this.relFormData).then((response) => {
const temp = JSON.parse(JSON.stringify(this.relFormData));
this.detailListSpell.forEach( item =>{
temp.detailList.push(item)
});
this.relFormDatas.push(temp)
addRelCodeSpellBox(this.relFormDatas).then((response) => {
this.loading = false; this.loading = false;
if (response.code === 20000) { if (response.code === 20000) {
this.$message.success("保存成功!"); this.$message.success("保存成功!");
@ -604,7 +624,14 @@
}); });
}else { }else {
this.loading = true; this.loading = true;
addRelCode(this.relFormData).then((response) => {
const temp = JSON.parse(JSON.stringify(this.relFormData));
this.detailListSpell.forEach( item =>{
temp.detailList.push(item)
});
this.relFormDatas.push(temp)
addRelCodeSpellBox(this.relFormDatas).then((response) => {
this.loading = false; this.loading = false;
if (response.code === 20000) { if (response.code === 20000) {
this.$message.success("保存成功!"); this.$message.success("保存成功!");
@ -743,6 +770,7 @@
this.scanCode = ""; this.scanCode = "";
this.result = ""; this.result = "";
this.detailList = []; this.detailList = [];
this.detailListSpell = []
this.bhxjsl = 0; this.bhxjsl = 0;
this.syxjsl = 0; this.syxjsl = 0;
this.parentCode = null; this.parentCode = null;

@ -12,14 +12,14 @@
<el-button-group <el-button-group
style="display: flex; margin-top: 5px; float: right" style="display: flex; margin-top: 5px; float: right"
> >
<el-button size="mini" type="primary" @click.native="spellBox()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailListSpell.length == 0"
>拼箱
</el-button>
<el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;"
>放弃 >放弃
</el-button> </el-button>
<!-- <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"-->
<!-- style="margin-right: 8px;border-radius: 5%;"-->
<!-- >保存-->
<!-- </el-button>-->
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;"
>提交 >提交
@ -99,7 +99,7 @@
v-model="relFormData.batchNo" v-model="relFormData.batchNo"
auto-complete="off" auto-complete="off"
style="width: 90%" style="width: 90%"
:disabled="true" :disabled="this.inputDisabled"
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -113,7 +113,7 @@
clearable clearable
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 90%" style="width: 90%"
:disabled="true" :disabled="this.inputDisabled"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -127,7 +127,7 @@
clearable clearable
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 90%" style="width: 90%"
:disabled="true" :disabled="this.inputDisabled"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -140,7 +140,7 @@
clearable clearable
style="width: 90%" style="width: 90%"
placeholder="请输入备注" placeholder="请输入备注"
:disabled="true" :disabled="this.inputDisabled"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -224,7 +224,7 @@
<script> <script>
import {enterCodeWeb} from "@/api/inout/order"; import {enterCodeWeb} from "@/api/inout/order";
import {addRelCode,scanCodeRelCode} from "@/api/collect/relCode"; import {addRelCodeSpellBox,scanCodeRelCode} from "@/api/collect/relCode";
import A from "@/plugins/KeyScaner"; import A from "@/plugins/KeyScaner";
export default { export default {
name: "operateRelCode", name: "operateRelCode",
@ -260,6 +260,7 @@
}, },
data() { data() {
return { return {
inputDisabled:true,
// //
codeFormData: { codeFormData: {
code: "", code: "",
@ -286,6 +287,8 @@
detailList:[] detailList:[]
}, },
detailList: [], detailList: [],
detailListSpell: [],
relFormDatas: [],
checkPreInArray: [], checkPreInArray: [],
errView: 0, errView: 0,
actionEnable: false, actionEnable: false,
@ -390,6 +393,8 @@
if (this.relFormData.productCode){ if (this.relFormData.productCode){
this.detailList.push(data); this.detailList.push(data);
this.detailListSpell.push(data);
this.inputDisabled = true
} }
//-1 //-1
@ -473,11 +478,28 @@
detailList: [] detailList: []
} }
this.detailList = [] this.detailList = []
this.detailListSpell = []
this.parentCode = null this.parentCode = null
this.bhxjsl = 0 this.bhxjsl = 0
this.syxjsl = 0 this.syxjsl = 0
this.packLayer = null this.packLayer = null
}, },
spellBox() {
this.inputDisabled = false
const temp = JSON.parse(JSON.stringify(this.relFormData));
this.detailListSpell.forEach( item =>{
temp.detailList.push(item)
});
this.relFormDatas.push(temp)
this.detailListSpell = []
this.relFormData.detailList = []
this.relFormData.batchNo = null
this.relFormData.madeDate = null
this.relFormData.validateDate = null
this.inputDisabled = false
// console.log("",this.relFormDatas)
},
submit() { submit() {
// //
if( this.bhxjsl != this.syxjsl){ if( this.bhxjsl != this.syxjsl){
@ -487,7 +509,15 @@
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
addRelCode(this.relFormData).then((response) => {
const temp = JSON.parse(JSON.stringify(this.relFormData));
this.detailListSpell.forEach( item =>{
temp.detailList.push(item)
});
this.relFormDatas.push(temp)
this.loading = true;
addRelCodeSpellBox(this.relFormDatas).then((response) => {
this.loading = false; this.loading = false;
if (response.code === 20000) { if (response.code === 20000) {
this.$message.success("保存成功!"); this.$message.success("保存成功!");
@ -504,7 +534,14 @@
.catch(() => { .catch(() => {
}); });
}else { }else {
addRelCode(this.relFormData).then((response) => { const temp = JSON.parse(JSON.stringify(this.relFormData));
this.detailListSpell.forEach( item =>{
temp.detailList.push(item)
});
this.relFormDatas.push(temp)
this.loading = true;
addRelCodeSpellBox(this.relFormDatas).then((response) => {
this.loading = false; this.loading = false;
if (response.code === 20000) { if (response.code === 20000) {
this.$message.success("保存成功!"); this.$message.success("保存成功!");
@ -642,6 +679,7 @@
this.scanCode = ""; this.scanCode = "";
this.result = ""; this.result = "";
this.detailList = []; this.detailList = [];
this.detailListSpell = []
this.bhxjsl = 0; this.bhxjsl = 0;
this.syxjsl = 0; this.syxjsl = 0;
this.parentCode = null; this.parentCode = null;

Loading…
Cancel
Save