关联关系界面修改

dev_unify
yewj 8 months ago
parent c8044a70bf
commit c2687e1966

@ -12,7 +12,7 @@
<el-card> <el-card>
<el-row style="margin-top: 5px; display: flex; align-items: center;"> <el-row style="margin-top: 5px;margin-bottom: 12px; display: flex; align-items: center;">
<div style="flex: 1;font-size: 24px"> <div style="flex: 1;font-size: 24px">
<span v-if="parentCode"><strong>{{ relFormData.packUnit }}</strong></span> <span v-if="parentCode"><strong>{{ relFormData.packUnit }}</strong></span>
<span v-if="parentCode" style="margin-left: 30px"><strong>{{ relFormData.packLayer }}层级</strong></span> <span v-if="parentCode" style="margin-left: 30px"><strong>{{ relFormData.packLayer }}层级</strong></span>

@ -8,11 +8,13 @@
label-width="110px" label-width="110px"
> >
<el-card> <el-card>
<el-row style="margin-top: 5px; display: flex; align-items: center;"> <el-row style="margin-top: 5px;margin-bottom: 12px; display: flex; align-items: center;">
<div style="flex: 1;font-size: 24px"> <div style="flex: 1;font-size: 24px">
<span v-if="parentCode"><strong>{{ relFormData.packUnit }}</strong></span> <span v-if="parentCode"><strong>{{ relFormData.packUnit }}</strong></span>
<span v-if="parentCode" style="margin-left: 30px"><strong>{{ relFormData.packLayer }}层级</strong></span> <span v-if="parentCode" style="margin-left: 30px"><strong>{{ relFormData.packLayer }}层级</strong></span>
<span v-if="parentCode" style="margin-left: 30px"><strong>{{ parentCode || '暂未录入'}}</strong> <strong> (<span style="color: #FF0000;">{{ syxjsl || 0}}</span>/<span >{{ bhxjsl || 0}}</span>)</strong></span> <span v-if="parentCode"
style="margin-left: 30px"><strong>{{ parentCode || '暂未录入' }}</strong> <strong> (<span
style="color: #FF0000;">{{ syxjsl || 0 }}</span>/<span>{{ bhxjsl || 0 }}</span>)</strong></span>
</div> </div>
<div style="margin-left: auto;"> <div style="margin-left: auto;">
<el-button size="mini" type="primary" @click.native="spellBox()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="spellBox()" :loading="submitLoading"
@ -188,18 +190,19 @@
<sonRelCode <sonRelCode
:closeDialog="this.popCloseDialog" :closeDialog="this.popCloseDialog"
:opeParentCode="this.popParentCode" :opeParentCode="this.popParentCode"
:opeRelFormData ="this.popRelFormData" :opeRelFormData="this.popRelFormData"
></sonRelCode> ></sonRelCode>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script>
import {enterCodeWeb} from "@/api/inout/order";
import {addRelCodeSpellBox, scanCodeRelCode, deleteDetail, deleteAllDetail} from "@/api/collect/relCode";
import sonRelCode from './sonRelCodeSpell.vue';
import A from "@/plugins/KeyScaner";
<script> export default {
import {enterCodeWeb} from "@/api/inout/order";
import {addRelCodeSpellBox,scanCodeRelCode,deleteDetail,deleteAllDetail} from "@/api/collect/relCode";
import sonRelCode from './sonRelCodeSpell.vue';
import A from "@/plugins/KeyScaner";
export default {
name: "operateRelCode", name: "operateRelCode",
props: { props: {
orderQuery: { orderQuery: {
@ -244,7 +247,7 @@
packUnit: null, packUnit: null,
bhxjsl: null, bhxjsl: null,
packLayer: null, packLayer: null,
detailList:[] detailList: []
}, },
detailList: [], detailList: [],
checkPreInArray: [], checkPreInArray: [],
@ -291,14 +294,14 @@
errResult: "", errResult: "",
warnVisible: false, warnVisible: false,
errVisible: false, errVisible: false,
parentCode:null, parentCode: null,
bhxjsl:0, bhxjsl: 0,
syxjsl:0, syxjsl: 0,
packLayer: null, packLayer: null,
popDialogVisible:false, popDialogVisible: false,
title:null, title: null,
popParentCode:null, popParentCode: null,
popRelFormData:{ popRelFormData: {
productCode: null, productCode: null,
subTypeNo: null, subTypeNo: null,
cascadeRatio: null, cascadeRatio: null,
@ -312,11 +315,11 @@
lineManager: null, lineManager: null,
packUnit: null, packUnit: null,
bhxjsl: null, bhxjsl: null,
detailList:[] detailList: []
}, },
relFormDatas:[], relFormDatas: [],
detailListSpell: [], detailListSpell: [],
popLevel:1, popLevel: 1,
}; };
}, },
components: { components: {
@ -338,7 +341,7 @@
if (row.packLayer > 1) { if (row.packLayer > 1) {
this.loading = true this.loading = true
// //
deleteDetail({ curCode: curCode }).then((response) => { deleteDetail({curCode: curCode}).then((response) => {
this.loading = false this.loading = false
if (response.code === 20000) { if (response.code === 20000) {
this.$message.success('删除成功!') this.$message.success('删除成功!')
@ -364,7 +367,7 @@
this.popDialogVisible = false; this.popDialogVisible = false;
if( this.bhxjsl === this.syxjsl){ if (this.bhxjsl === this.syxjsl) {
this.$confirm("该层级已录入完成, 是否关闭?", "提示", { this.$confirm("该层级已录入完成, 是否关闭?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -376,7 +379,7 @@
}) })
.catch(() => { .catch(() => {
}); });
}else { } else {
this.$refs.inputRef.focus(); this.$refs.inputRef.focus();
} }
@ -408,12 +411,12 @@
this.$refs.inputRef.select(); this.$refs.inputRef.select();
this.isSuccess = true; this.isSuccess = true;
let data = response.data; let data = response.data;
if(data !== null){ if (data !== null) {
//1. //1.
if (this.parentCode == null){ if (this.parentCode == null) {
if (data.packLayer == 1) { if (data.packLayer == 1) {
this.$message.warning("该层级为最小包装层级无需进行码关联操作!"); this.$message.warning("该层级为最小包装层级无需进行码关联操作!");
if (this.closeCodeDialog != null){ if (this.closeCodeDialog != null) {
this.closeCodeDialog() this.closeCodeDialog()
} }
return; return;
@ -433,20 +436,20 @@
this.parentCode = data.curCode; this.parentCode = data.curCode;
this.bhxjsl = data.bhxjsl; this.bhxjsl = data.bhxjsl;
this.detailList = []; this.detailList = [];
}else { } else {
if(this.detailList.some(item => item.curCode === data.curCode)) { if (this.detailList.some(item => item.curCode === data.curCode)) {
// //
this.$message.warning("录入码重复!"); this.$message.warning("录入码重复!");
return; return;
} else { } else {
if(this.bhxjsl === this.syxjsl){ if (this.bhxjsl === this.syxjsl) {
// //
this.$message.warning("包含下级码已录满!"); this.$message.warning("包含下级码已录满!");
return; return;
} }
} }
// //
if(data.packLayer == this.relFormData.packLayer) { if (data.packLayer == this.relFormData.packLayer) {
// //
this.$confirm("非当前编码的子层级码,是否进行替换操作?", "提示", { this.$confirm("非当前编码的子层级码,是否进行替换操作?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
@ -472,7 +475,7 @@
.catch(() => { .catch(() => {
return; return;
}); });
}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.detailListSpell.push(data);
@ -480,7 +483,7 @@
this.syxjsl = this.detailList.length; this.syxjsl = this.detailList.length;
// //
if (data.packLayer > 1 && data.bhxjsl > 0){ if (data.packLayer > 1 && data.bhxjsl > 0) {
this.popRelFormData.cpmctymc = data.cpmctymc; this.popRelFormData.cpmctymc = data.cpmctymc;
this.popRelFormData.productCode = data.productCode; this.popRelFormData.productCode = data.productCode;
this.popRelFormData.subTypeNo = data.subTypeNo; this.popRelFormData.subTypeNo = data.subTypeNo;
@ -501,8 +504,8 @@
this.popDialogVisible = true; this.popDialogVisible = true;
this.title = "手工关联:" + data.curCode; this.title = "手工关联:" + data.curCode;
this.popParentCode = data.curCode; this.popParentCode = data.curCode;
}else { } else {
if( this.bhxjsl === this.syxjsl){ if (this.bhxjsl === this.syxjsl) {
this.$confirm("该层级已录入完成, 是否关闭?", "提示", { this.$confirm("该层级已录入完成, 是否关闭?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -519,7 +522,7 @@
} }
} }
} }
}else{ } else {
this.$message.error(response.message); this.$message.error(response.message);
} }
this.loading = false; this.loading = false;
@ -581,9 +584,15 @@
}, },
spellBox() { spellBox() {
this.$confirm("拼箱后,需重新录入批次信息,请确认是否进行拼箱?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
const temp = JSON.parse(JSON.stringify(this.relFormData)); const temp = JSON.parse(JSON.stringify(this.relFormData));
temp.detailList = [] temp.detailList = []
this.detailListSpell.forEach( item =>{ this.detailListSpell.forEach(item => {
item.flag = 2 item.flag = 2
temp.detailList.push(item) temp.detailList.push(item)
}); });
@ -595,9 +604,14 @@
this.relFormData.validateDate = null this.relFormData.validateDate = null
// console.log("",this.relFormDatas) // console.log("",this.relFormDatas)
this.inputDisabled = false this.inputDisabled = false
})
.catch(() => {
});
}, },
submit(val) { submit(val) {
if(this.detailList == null || this.detailList.length == 0){ if (this.detailList == null || this.detailList.length == 0) {
this.$message.warning("请先录入关联码!"); this.$message.warning("请先录入关联码!");
return; return;
} }
@ -615,7 +629,7 @@
} }
// //
if( this.bhxjsl != this.syxjsl){ if (this.bhxjsl != this.syxjsl) {
this.$confirm("该层级已录入数量与应录入数量不符, 是否继续提交?", "提示", { this.$confirm("该层级已录入数量与应录入数量不符, 是否继续提交?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -626,7 +640,7 @@
const temp = JSON.parse(JSON.stringify(this.relFormData)); const temp = JSON.parse(JSON.stringify(this.relFormData));
temp.detailList = [] temp.detailList = []
this.detailListSpell.forEach( item =>{ this.detailListSpell.forEach(item => {
item.flag = 2 item.flag = 2
temp.detailList.push(item) temp.detailList.push(item)
}); });
@ -648,12 +662,12 @@
}) })
.catch(() => { .catch(() => {
}); });
}else { } else {
this.loading = true; this.loading = true;
const temp = JSON.parse(JSON.stringify(this.relFormData)); const temp = JSON.parse(JSON.stringify(this.relFormData));
temp.detailList = [] temp.detailList = []
this.detailListSpell.forEach( item =>{ this.detailListSpell.forEach(item => {
item.flag = 2 item.flag = 2
temp.detailList.push(item) temp.detailList.push(item)
}); });
@ -793,7 +807,7 @@
lineName: null, lineName: null,
lineManager: null, lineManager: null,
packUnit: null, packUnit: null,
cpmctymc:null, cpmctymc: null,
} }
this.scanCode = ""; this.scanCode = "";
this.result = ""; this.result = "";
@ -804,12 +818,12 @@
this.parentCode = null; this.parentCode = null;
this.inputDisabled = false this.inputDisabled = false
this.refreshCodesPanel() this.refreshCodesPanel()
if (this.closeCodeDialog != null){ if (this.closeCodeDialog != null) {
this.closeCodeDialog() this.closeCodeDialog()
} }
}, },
init(){ init() {
if(this.orderQuery != null){ if (this.orderQuery != null) {
this.scanCode = this.orderQuery.code this.scanCode = this.orderQuery.code
// this.scanCode = "82015700010101701314" // this.scanCode = "82015700010101701314"
this.enterKey(); this.enterKey();
@ -850,12 +864,12 @@
created() { created() {
this.init(); this.init();
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.scroll-alert { .scroll-alert {
width: 100%; /* 或者你需要的宽度 */ width: 100%; /* 或者你需要的宽度 */
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
@ -864,29 +878,29 @@
background-color: rgba(255, 235, 59, 0.1); /* 类似于 Element UI 警告框的背景色 */ background-color: rgba(255, 235, 59, 0.1); /* 类似于 Element UI 警告框的背景色 */
padding: 10px; padding: 10px;
position: relative; position: relative;
} }
.scroll-text { .scroll-text {
display: inline-block; display: inline-block;
padding-left: 100%; /* 初始位置在容器右侧 */ padding-left: 100%; /* 初始位置在容器右侧 */
animation: scroll 10s linear infinite; /* 滚动动画 */ animation: scroll 10s linear infinite; /* 滚动动画 */
} }
@keyframes scroll { @keyframes scroll {
from { from {
transform: translateX(0); transform: translateX(0);
} }
to { to {
transform: translateX(-100%); transform: translateX(-100%);
} }
} }
.query-form-item { .query-form-item {
margin-right: 5px; margin-right: 5px;
margin-bottom: 6px; margin-bottom: 6px;
} }
#inputer { #inputer {
width: 100%; width: 100%;
min-height: 30px; min-height: 30px;
background-color: white; background-color: white;
@ -894,9 +908,9 @@
border-style: solid; border-style: solid;
border-width: 0.1px; border-width: 0.1px;
color: #4a4a4a; color: #4a4a4a;
} }
#inputer:focus { #inputer:focus {
width: 100%; width: 100%;
min-height: 30px; min-height: 30px;
background-color: white; background-color: white;
@ -904,13 +918,13 @@
border-style: solid; border-style: solid;
border-width: 0.1px; border-width: 0.1px;
color: #4a4a4a; color: #4a4a4a;
} }
.ime-disabled { .ime-disabled {
ime-mode: disabled; ime-mode: disabled;
} }
.result-display { .result-display {
border: 2px solid #ccc; /* 默认外框颜色 */ border: 2px solid #ccc; /* 默认外框颜色 */
border-radius: 10px; border-radius: 10px;
margin-top: 5px; margin-top: 5px;
@ -918,33 +932,33 @@
margin-right: 25px; margin-right: 25px;
padding-left: 25px; padding-left: 25px;
/* 不设置背景颜色 */ /* 不设置背景颜色 */
} }
.result-success { .result-success {
border-color: #4CAF50; /* 成功时外框颜色 */ border-color: #4CAF50; /* 成功时外框颜色 */
} }
.result-failure { .result-failure {
border-color: #0080ff; /* 失败时外框颜色 */ border-color: #0080ff; /* 失败时外框颜色 */
} }
.result-text { .result-text {
height: 18px; height: 18px;
/* 你可以在这里设置默认的文本颜色或其他样式 */ /* 你可以在这里设置默认的文本颜色或其他样式 */
} }
.result-text-success { .result-text-success {
color: #4CAF50; /* 成功时文本颜色 */ color: #4CAF50; /* 成功时文本颜色 */
font-size: 14px; font-size: 14px;
} }
.result-text-failure { .result-text-failure {
color: #0080ff; /* 失败时文本颜色 */ color: #0080ff; /* 失败时文本颜色 */
font-size: 14px; font-size: 14px;
} }
.mar-left { .mar-left {
margin-left: 20px; margin-left: 20px;
} }
</style> </style>

Loading…
Cancel
Save