1/4 灯组优化 摆货层删除按钮
parent
7f73187583
commit
117a73ca41
@ -0,0 +1,161 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form :model="formData" style="width: 100%;" ref="dataForm" :rules="formRules"
|
||||||
|
label-width="auto"
|
||||||
|
>
|
||||||
|
<el-row :gutter="24" class="el-row">
|
||||||
|
<el-col :span="12" class="el-col">
|
||||||
|
<el-form-item label="灯组标签:" prop="mac" class="query-form-item">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.mac" style="width: 80%"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="请输入灯组标签"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" class="el-col">
|
||||||
|
<el-form-item label="灯组备注:" prop="remark" class="query-form-item">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.remark" style="width: 80%"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="请输入灯组备注"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="24" class="el-row">
|
||||||
|
<el-col :span="12" class="el-col">
|
||||||
|
<el-form-item label="灭灯时间:" prop="timeout" class="query-form-item">
|
||||||
|
<el-input-number :min="0" v-model="formData.timeout" style="width: 80%"
|
||||||
|
placeholder="灭灯时间"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!--<el-col :span="12" class="el-col">-->
|
||||||
|
<!-- <el-form-item label="灯组状态:" prop="monopoly" class="query-form-item">-->
|
||||||
|
<!-- <el-select v-model="formData.monopoly" style="width: 80%" placeholder="独占库存"-->
|
||||||
|
<!-- :disabled="formData.autoTag == 0">-->
|
||||||
|
<!-- <el-option label="否" :value="0"></el-option>-->
|
||||||
|
<!-- <el-option label="是" :value="1"></el-option>-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!--</el-col>-->
|
||||||
|
</el-row>
|
||||||
|
<!--<el-row :gutter="24" class="el-row">-->
|
||||||
|
<!-- <el-col :span="12" class="el-col">-->
|
||||||
|
<!-- <el-form-item label="常用业务:" prop="isPopular" class="query-form-item">-->
|
||||||
|
<!-- <el-select v-model="formData.isPopular" style="width: 80%" placeholder="业务类型是否常用">-->
|
||||||
|
<!-- <el-option label="是" :value="1"></el-option>-->
|
||||||
|
<!-- <el-option label="否" :value="0"></el-option>-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!-- <el-col :span="12" class="el-col">-->
|
||||||
|
<!-- <el-form-item label="顺序号:" prop="number" class="query-form-item">-->
|
||||||
|
|
||||||
|
<!-- <el-input-number :min="0" v-model="formData.number" style="width: 80%"-->
|
||||||
|
<!-- placeholder="顺序号"-->
|
||||||
|
<!-- ></el-input-number>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!--</el-row>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--<el-row :gutter="24" class="el-row">-->
|
||||||
|
<!-- <el-col class="el-col">-->
|
||||||
|
<!-- <el-form-item label="备注:" prop="remark" class="query-form-item">-->
|
||||||
|
<!-- <el-input-->
|
||||||
|
<!-- v-model="formData.remark"-->
|
||||||
|
<!-- style="width: 91%"-->
|
||||||
|
<!-- auto-complete="off"-->
|
||||||
|
<!-- ></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!--</el-row>-->
|
||||||
|
|
||||||
|
|
||||||
|
<el-divider></el-divider>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click.native="hideForm">取消</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click.native="formSubmit()"
|
||||||
|
>提交
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { editLed, saveLed } from '@/api/collect/collectLedGroup'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
closeDialog: {
|
||||||
|
type: Function,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
rowData:{
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formData: {
|
||||||
|
timeout:0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formSubmit(){
|
||||||
|
if (this.rowData != null){
|
||||||
|
editLed(this.formData).then(res => {
|
||||||
|
if (res.code == 20000){
|
||||||
|
this.closeDialog()
|
||||||
|
this.$message.success("修改成功")
|
||||||
|
}else {
|
||||||
|
this.closeDialog()
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
saveLed(this.formData).then(res => {
|
||||||
|
if (res.code == 20000){
|
||||||
|
this.closeDialog()
|
||||||
|
this.$message.success("添加成功")
|
||||||
|
}else {
|
||||||
|
this.closeDialog()
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hideForm(){
|
||||||
|
this.closeDialog()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.rowData != null){
|
||||||
|
this.formData = this.rowData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,249 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card>
|
||||||
|
<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="addLed">新增灯组</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 v-if="scope.row.red === 0">关闭</span>
|
||||||
|
<span v-else>开启</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="黄灯状态" prop="orange" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.red === 0">关闭</span>
|
||||||
|
<span v-else>开启</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="蓝灯状态" prop="blue" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.red === 0">关闭</span>
|
||||||
|
<span v-else>开启</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="绿灯状态" prop="green" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.red === 0">关闭</span>
|
||||||
|
<span v-else>开启</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="editLED(scope.row)"
|
||||||
|
>编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native.stop="deleteLED(scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
:total="total"
|
||||||
|
:limit.sync="filterQuery.limit"
|
||||||
|
:page.sync="filterQuery.page"
|
||||||
|
@pagination="getList()"
|
||||||
|
>
|
||||||
|
</pagination>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
title="新增灯组"
|
||||||
|
:visible.sync="addLedVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
v-if="addLedVisible"
|
||||||
|
width="65%"
|
||||||
|
append-to-body
|
||||||
|
@close=""
|
||||||
|
>
|
||||||
|
<addLedGroupDialog
|
||||||
|
:closeDialog="closeDialog"
|
||||||
|
:rowData="rowData"
|
||||||
|
>
|
||||||
|
|
||||||
|
</addLedGroupDialog>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { deleteLed, getLeds } from '@/api/collect/collectLedGroup'
|
||||||
|
import {binding } from '@/api/basic/workPlace/SysWorkplaceQueue'
|
||||||
|
import addLedGroupDialog from "./addLedGroupDialog"
|
||||||
|
import { isBlank } from '@/utils/strUtil'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ledManage',
|
||||||
|
components:{addLedGroupDialog},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
ledList: [],
|
||||||
|
total:0,
|
||||||
|
filterQuery:{
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
scanCode:"",
|
||||||
|
isBind: 0,
|
||||||
|
},
|
||||||
|
showSearch: true,
|
||||||
|
lesStatusMap: {
|
||||||
|
true : "开启",
|
||||||
|
0: "关闭"
|
||||||
|
},
|
||||||
|
addLedVisible: false,
|
||||||
|
rowData: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
hideSearch() {
|
||||||
|
this.showSearch = !this.showSearch;
|
||||||
|
},
|
||||||
|
onReset() {
|
||||||
|
this.$router.push({
|
||||||
|
path: ''
|
||||||
|
})
|
||||||
|
this.filterQuery = {
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
scanCode:"",
|
||||||
|
isBind: 0,
|
||||||
|
}
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
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()
|
||||||
|
},
|
||||||
|
enterKey(){
|
||||||
|
if (isBlank(this.filterQuery.scanCode)) {
|
||||||
|
return this.$message.error('灯组标签不能为null')
|
||||||
|
}
|
||||||
|
this.filterQuery.mac = this.filterQuery.scanCode
|
||||||
|
this.getList()
|
||||||
|
this.filterQuery.scanCode = null
|
||||||
|
},
|
||||||
|
deleteLED(row){
|
||||||
|
this.$confirm('此操作将永久删除该灯组, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
deleteLed(row).then(res => {
|
||||||
|
if (res.code == 20000){
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
this.getList()
|
||||||
|
}else {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
editLED(row){
|
||||||
|
this.rowData = row
|
||||||
|
this.addLedVisible = true
|
||||||
|
},
|
||||||
|
addLed(){
|
||||||
|
this.rowData = null
|
||||||
|
this.addLedVisible = true
|
||||||
|
},
|
||||||
|
closeDialog(){
|
||||||
|
this.addLedVisible = false
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in New Issue