12/31 灯组绑定

20240912_adapter
wangwei 3 months ago
parent fb584ab0c9
commit 4a33b9cac5

@ -0,0 +1,17 @@
import axios from "@/utils/request"
export function getLeds(query) {
return axios({
url: "/udiwms/basic/collect/ledGroup/filter",
method: "post",
data: query
});
}
export function binding(query) {
return axios({
url: "/udiwms/basic/collect/ledGroup/binding",
method: "post",
data: query
});
}

@ -0,0 +1,178 @@
<template>
<div>
<el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" v-if="showSearch" @submit.native.prevent>
<el-row>
<el-col :span="18">
<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="filterQuery.scanCode"
></el-input>
</el-form-item>
</el-col>
</el-row>
<!--<el-row>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="单据类型名称:">-->
<!-- <el-input v-model="filterQuery.name" placeholder="请输入单据类型名称" clearable style="width: 90%"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="出入库类型:">-->
<!-- <el-select v-model="filterQuery.mainAction" style="width: 90%" placeholder="请选择出入库类型">-->
<!-- <el-option label="全部" value=""></el-option>-->
<!-- <el-option label="入库" value="WareHouseIn"></el-option>-->
<!-- <el-option label="出库" value="WareHouseOut"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="是否启用:">-->
<!-- <el-select v-model="filterQuery.enable" style="width: 90%" placeholder="是否启用">-->
<!-- <el-option label="全部" value=""></el-option>-->
<!-- <el-option label="已启用" value="1"></el-option>-->
<!-- <el-option label="未启用" value="0"></el-option>-->
<!-- </el-select>-->
<!-- </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-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></el-button>
<!--<el-button type="primary" icon="el-icon-plus" @click="chooseDrug"></el-button>-->
<!-- <el-button type="primary" icon="el-icon-plus" @click="addDrug"></el-button>-->
</el-button-group>
</div>
<el-table v-loading="loading" :data="ledList" style="width: 100%" :row-style="{height: '25px' }"
>
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column label="灯组标签" prop="mac" ></el-table-column>
<el-table-column label="led灯编号" prop="ledNum" ></el-table-column>
<el-table-column label="红灯状态" prop="red">
<template slot-scope="scope">
<span>{{ lesStatusMap[scope.row.red] }}</span>
</template>
</el-table-column>
<el-table-column label="黄灯状态" prop="orange" >
<template slot-scope="scope">
<span>{{ lesStatusMap[scope.row.orange] }}</span>
</template>
</el-table-column>
<el-table-column label="蓝灯状态" prop="blue" >
<template slot-scope="scope">
<span>{{ lesStatusMap[scope.row.blue] }}</span>
</template>
</el-table-column>
<el-table-column label="绿灯状态" prop="green" >
<template slot-scope="scope">
<span>{{ lesStatusMap[scope.row.green] }}</span>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" fixed="right" >
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="bindLED(scope.row)"
>绑定
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="getList()"
>
</pagination>
</div>
</template>
<script>
import { binding, getLeds } from '@/api/collect/collectLedGroup'
export default {
props: {
product: {
type: Object,
required: true
}
},
data() {
return {
loading: false,
ledList: [],
total:0,
filterQuery:{
page: 1,
limit: 10,
scanCode:"",
},
showSearch: true,
lesStatusMap: {
true : "开启",
false: "关闭"
}
}
},
methods:{
hideSearch() {
this.showSearch = !this.showSearch;
},
getInputFocus(event) {
event.currentTarget.select()
},
getList(){
getLeds(this.filterQuery).then(res => {
if (res.code == 20000){
this.ledList = res.data.list || []
this.total = res.data.total || 0
}else {
this.ledList = []
this.total = 0
this.$message.error(res.message)
}
})
},
onSubmit() {
this.filterQuery.page = 1
this.getList()
},
bindLED(row){
row.relId = this.product.relId
row.nameCode = this.product.nameCode
binding(row).then(res => {
if (res.code == 20000){
this.$message.success("绑定成功")
}else {
this.$message.error(res.meaage)
}
})
this.$emit('bindLed', row);
}
},
created() {
this.getList()
}
}
</script>
<style scoped>
</style>

@ -133,6 +133,7 @@
<el-table-column label="产品标识" 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="mac" 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>-->
@ -217,15 +218,39 @@
id="inputer2"
@focus="getInputFocus($event)"
@keypress.enter.native="enterKey2($event)"
ref="inputRef2"
style="width: 80%"
ref='inputRef2'
style="ime-mode:disabled;width: 80%"
type="tel"
placeholder="请扫追溯码/产品编码/医保编码绑定"
v-model="addBindData.udiCode"
:disabled="!addBindData.udiCodeFlag"
></el-input>
<el-button
style="margin-left: 20px"
type="primary"
size="mini"
@click.native="bingLed()"
>绑定灯组
<!-- v-if="(curAction.checkWebNew !== 2 || viewType !== 1) && orderFormData.billNo"-->
</el-button
>
</el-form-item>
</el-col>
<!--<el-col :span="2">-->
<!-- <el-button-group-->
<!-- style="display: flex; ">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- size="mini"-->
<!-- @click.native="selectOrder()"-->
<!-- >绑定灯组-->
<!-- &lt;!&ndash; v-if="(curAction.checkWebNew !== 2 || viewType !== 1) && orderFormData.billNo"&ndash;&gt;-->
<!-- </el-button-->
<!-- >-->
<!-- </el-button-group>-->
<!--</el-col>-->
<el-col :span="24">
<el-form-item prop="udiCode" label="" class="query-form-item">
@ -241,6 +266,7 @@
</el-form-item>
</el-col>
</el-row>
<div class="center-button">
<!--<div style="text-align: right; margin-bottom: 10px;margin-top: 18px ;margin-right: 18px ;">-->
<el-button @click="closeAddBindData"></el-button>
@ -270,6 +296,24 @@
</selectDrugDialog>
</el-dialog>
<el-dialog
title="绑定灯组"
:visible.sync="addBindLedVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="addBindLedVisible"
width="65%"
append-to-body
@close=""
>
<bingdLedGroupDialog
:product="product"
@bindLed="bingLedGroup"
>
</bingdLedGroupDialog>
</el-dialog>
</div>
</template>
@ -285,6 +329,7 @@ import {
} from '@/api/basic/workPlace/SysWorkplaceQueue'
import { executeFuc, getHead } from '@/utils/customConfig'
import selectDrugDialog from "./selectDrugDialog"
import bingdLedGroupDialog from "./bingdLedGroupDialog"
const formJson = {
site_id: '',
@ -295,7 +340,7 @@ const formJson = {
export default {
name: 'workplaceQueue',
components:{selectDrugDialog},
components:{selectDrugDialog,bingdLedGroupDialog},
data() {
return {
@ -410,6 +455,8 @@ export default {
2: '已使用',
3: '已退回'
},
addBindLedVisible: false,
ledData:{}
}
},
methods: {
@ -507,16 +554,14 @@ export default {
this.product = response.data
if (this.product.relId != null) {
//
this.$confirm('当前出货槽位编码将绑定绑定产品, 是否提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// this.$confirm(', ?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
this.addBindData.relId = this.product.relId
this.submitAddBindData()
})
.catch(() => {
})
this.codeQuery.scanCode = null
// this.submitAddBindData()
} else {
}
@ -534,6 +579,9 @@ export default {
if (this.addBindData.udiCode == null) {
return this.$message.error('请添加产品!')
}
if (this.ledData.id == null){
return this.$message.error('请绑定灯组!')
}
this.addBindData.relId = this.product.relId
bind(this.addBindData).then(
(response) => {
@ -541,12 +589,14 @@ export default {
this.$message.success('绑定成功')
this.addBindData = {
code: null,
//todo addBindData
codeFlag: false,
udiCode: null,
udiCodeFlag: false
}
this.sysWorkplaceQueue = {}
this.product = {}
this.addBindVisible = false
this.$nextTick(() => {
this.$refs.inputRef1.focus() //
})
@ -558,7 +608,7 @@ export default {
}
}).catch((error) => {
this.$message.error(error.message)
this.$refs.inputRef1.select()
// this.$refs.inputRef1.select()
})
},
@ -817,6 +867,17 @@ export default {
}).catch(() => {
})
},
bingLed(){
if (isBlank(this.product.nameCode)){
return this.$message.error("请先录入产品")
}
this.addBindLedVisible = true
},
bingLedGroup(row){
this.ledData = row
this.addBindLedVisible = false
// console.log("hagaggaga",row)
}
},

@ -851,6 +851,7 @@ export default {
key: val,
page: 1,
limit: 10,
workPlaceClass:1
}
filterWorkOptimize(query)
.then((response) => {

Loading…
Cancel
Save