fix:槽位关联关系

20240912_adapter
chenhc 5 months ago
parent ccd6ff005a
commit 9a13067e2d

@ -62,9 +62,33 @@ export function addLayer(query) {
});
}
export function getInfoByCode(query) {
return axios({
url: "/udiwms/sysWorkplaceQueue/getInfoByCode",
method: "post",
data: query
});
}
export function getProductByCode(query) {
return axios({
url: "/udiwms/sysWorkplaceQueue/getProductByCode",
method: "post",
data: query
});
}
export function bind(query) {
return axios({
url: "/udiwms/WorkplaceQueue/bind",
method: "post",
data: query
});
}
export function getQueueListPage(query) {
return axios({
url: "/udiwms/sysWorkplaceQueue/getQueueList",
url: "/udiwms/sysWorkplaceQueue/getQueueBindList",
method: "get",
params: query
});

@ -4,21 +4,28 @@
<el-form :model="codeQuery" class="query-form" size="mini" label-width="100px">
<el-row>
<el-col :span="18">
<el-form-item class="query-form-item" label="扫码查询:">
<el-input v-model="codeQuery.code"
style="width: 97%"
placeholder="请扫描或输入UDI码"
clearable="true"
@keyup.enter.native="keyup_submit($event)"></el-input>
<el-form-item prop="code" label="扫码查询:">
<el-input
id="inputer"
@focus="getInputFocus($event)"
@keypress.enter.native="enterKey($event)"
ref="inputRef"
style="ime-mode: disabled"
type="tel"
placeholder="请点击输入框进行扫码设置或者扫码录入"
v-model="codeQuery.scanCode"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<el-button type="primary" icon="el-icon-plus" @click="addBind"
>维护绑定关系
</el-button>
<el-button
type="primary"
icon="el-icon-refresh"
@ -27,8 +34,7 @@
</el-button>
<el-button type="primary" icon="el-icon-search" @click="onCodeSubmit"
>查询
</el-button
>
</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
@ -40,7 +46,9 @@
<el-table-column label="出货槽编号" prop="code" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="货架名称" prop="name" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="产品ID" prop="relId" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="DI标识" prop="nameCode" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="产品通用名" prop="cpmctymc" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="所属取货架编号" prop="freightCode" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="所属摆货层编号" prop="layerCode" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="格数" prop="grid" show-overflow-tooltip width="160"></el-table-column>
@ -60,12 +68,88 @@
@pagination="getCodeDetailList"
/>
</el-card>
<el-dialog
title="维护绑定关系"
:visible.sync="addBindVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="addBindVisible"
width="65%"
append-to-body
>
<el-form :model="addBindData" ref="stockCompare" class="query-form"
size="mini" label-width="auto">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item prop="code" label="出货槽位编号:" class="query-form-item">
<el-input
id="inputer1"
@focus="getInputFocus($event)"
@keypress.enter.native="enterKey1($event)"
ref="inputRef1"
type="tel"
placeholder="请点击输入框进行出货槽位编号设置或者出货槽位编号录入"
v-model="addBindData.code"
style="width: 80%"
:disabled="addBindData.codeFlag"
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item prop="udiCode" label="" class="query-form-item">
<el-descriptions class="margin-top" title="" :column="3" border style="width: 80%">
<el-descriptions-item label="出货槽编号">{{sysWorkplaceQueue.code}}</el-descriptions-item>
<el-descriptions-item label="货架名称">{{sysWorkplaceQueue.name}}</el-descriptions-item>
<el-descriptions-item label="备注">{{sysWorkplaceQueue.remark}}</el-descriptions-item>
</el-descriptions>
</el-form-item>
</el-col>
<el-col :span="24" style="margin-top: 30px">
<el-form-item prop="udiCode" label="UDI码:" class="query-form-item">
<el-input
id="inputer2"
@focus="getInputFocus($event)"
@keypress.enter.native="enterKey2($event)"
ref="inputRef2"
style="width: 80%"
type="tel"
placeholder="请点击输入框进行UDI码设置或者UDI码录入"
v-model="addBindData.udiCode"
:disabled="!addBindData.udiCodeFlag"
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item prop="udiCode" label="" class="query-form-item">
<el-descriptions class="margin-top" title="" :column="3" border style="width: 80%">
<el-descriptions-item label="DI标识">{{product.nameCode}}</el-descriptions-item>
<el-descriptions-item label="产品通用名">{{product.cpmctymc}}</el-descriptions-item>
<el-descriptions-item label="规格型号">{{product.ggxh}}</el-descriptions-item>
</el-descriptions>
</el-form-item>
</el-col>
</el-row>
<div style="text-align: right; margin-bottom: 10px;margin-top: 18px ;margin-right: 18px ;">
<el-button type="primary" @click="submitAddBindData"></el-button>
</div>
</el-form>
</el-dialog>
</div>
</template>
<script>
import {getQueueListPage} from "@/api/basic/workPlace/SysWorkplaceQueue";
import {isBlank} from "@/utils/strUtil";
import {getQueueListPage,getInfoByCode,getProductByCode,bind} from "@/api/basic/workPlace/SysWorkplaceQueue";
const formJson = {
site_id: "",
@ -103,7 +187,17 @@ export default {
deleteData: {
orderId: null,
},
addBindData:{
id: null,
code: null,
relId: null,
codeFlag: false,
udiCode: null,
udiCodeFlag: false
},
dialogTableVisible: false,
radio: 1,
addBindVisible: false,
formLoading: false,
dialogVisible: false,
formData: formJson,
@ -143,6 +237,7 @@ export default {
],
},
codeQuery: {
scanCode: null,
code: null,
orderId: null,
status: null,
@ -154,10 +249,12 @@ export default {
ylqxzcrbarmc: null,
zczbhhzbapzbh: null,
page: 1,
limit: 10
limit: 20
},
codeTotal: 0,
codeDetailLoading: false,
sysWorkplaceQueue: {},
product: {},
codeDetailList: [],
fromOptions: [],
auditDateRange: [],
@ -193,6 +290,115 @@ export default {
hideSearch() {
this.showSearch = !this.showSearch;
},
getInputFocus(event) {
event.currentTarget.select();
},
enterKey1(){
//1
if(isBlank(this.addBindData.code)){
return this.$message.error("出货槽位编码不可以为空")
}
getInfoByCode({code:this.addBindData.code}).then(
(response) => {
if (response.code === 20000) {
this.sysWorkplaceQueue = response.data;
if (this.sysWorkplaceQueue.relId != null){
//
this.$confirm("出货槽位编码已绑定产品, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.product.nameCode = this.sysWorkplaceQueue.nameCode
this.product.ggxh = this.sysWorkplaceQueue.ggxh
this.product.cpmctymc = this.sysWorkplaceQueue.cpmctymc
this.addBindData.id = this.sysWorkplaceQueue.id
this.addBindData.codeFlag = true
this.addBindData.udiCodeFlag = true
this.$nextTick(() => {
this.$refs.inputRef2.focus(); //
});
})
.catch(() => {
});
}else {
this.addBindData.id = this.sysWorkplaceQueue.id
this.addBindData.codeFlag = true
this.addBindData.udiCodeFlag = true
this.$nextTick(() => {
this.$refs.inputRef2.focus(); //
});
}
} else {
this.$message.error(response.message)
}
}).catch((error) => {
this.$message.error(error.message)
});
},
enterKey2() {
if(isBlank(this.addBindData.udiCode)){
return this.$message.error("UDI码不可以为空")
}
getProductByCode({udiCode:this.addBindData.udiCode}).then(
(response) => {
if (response.code === 20000) {
this.product = response.data;
if (this.product.relId != null){
//
this.$confirm("当前出货槽位编码将绑定绑定产品, 是否提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.addBindData.relId = this.product.relId
this.submitAddBindData()
})
.catch(() => {
});
}else {
}
} else {
this.$message.error(response.message)
}
}).catch((error) => {
this.$message.error(error.message)
});
},
submitAddBindData(){
bind(this.addBindData).then(
(response) => {
if (response.code === 20000) {
this.$message.success("绑定成功")
this.addBindData = {
code: null,
codeFlag: false,
udiCode: null,
udiCodeFlag: false
}
this.sysWorkplaceQueue = {},
this.product = {},
this.$nextTick(() => {
this.$refs.inputRef1.focus(); //
});
} else {
this.$message.error(response.message)
}
}).catch((error) => {
this.$message.error(error.message)
});
},
enterKey() {
this.getOrderDetails()
},
getBusType() {
let query = {
code: this.filterQuery.invCode,
@ -278,7 +484,7 @@ export default {
this.codeQuery = {
orderIdFk: null,
page: 1,
limit: 10
limit: 20
};
this.getCodeDetailList();
},
@ -293,6 +499,18 @@ export default {
this.codeQuery.page = 1;
this.getCodeDetailList();
},
addBind() {
this.addBindData = {
code: null,
codeFlag: false,
udiCode: null,
udiCodeFlag: false
}
this.addBindVisible = true
this.$nextTick(() => {
this.$refs.inputRef1.focus(); //
});
},
getCodeDetailList() {
this.codeDetailLoading = true;
getQueueListPage(this.codeQuery).then((res) => {
@ -355,4 +573,10 @@ export default {
</script>
<style type="text/scss" lang="scss">
.el-radio__original {
display: none !important; /* 隐藏原生 radio 输入,但仍然允许交互 */
}
.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none !important;
}
</style>

Loading…
Cancel
Save