弹窗优化,设置盘仓优化
This commit is contained in:
@@ -527,51 +527,68 @@ export default {
|
||||
this.cdShow = false
|
||||
},
|
||||
cdSubmit() {
|
||||
let top = this.cdList.filter((item) => item.cdType === 2)
|
||||
let bottom = this.cdList.filter((item) => item.cdType === 3)
|
||||
if (!top || top.length === 0) {
|
||||
this.$message({
|
||||
message: '请设置上光驱',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!bottom || bottom.length === 0) {
|
||||
this.$message({
|
||||
message: '请设置下光驱',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (top.length > 1) {
|
||||
this.$message({
|
||||
message: '上光驱只能设置一个',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (bottom.length > 1) {
|
||||
this.$message({
|
||||
message: '下光驱只能设置一个',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
let device_list = [
|
||||
{
|
||||
device_path: this.cdList[0].dev_path,
|
||||
device_pos: 2
|
||||
}
|
||||
]
|
||||
if (this.$store.state.chat.printer_info.printer_name !== 'SE3') {
|
||||
let top = this.cdList.filter((item) => item.cdType === 2)
|
||||
let bottom = this.cdList.filter((item) => item.cdType === 3)
|
||||
if (!top || top.length === 0) {
|
||||
this.$message({
|
||||
message: '请设置上光驱',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!bottom || bottom.length === 0) {
|
||||
this.$message({
|
||||
message: '请设置下光驱',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (top.length > 1) {
|
||||
this.$message({
|
||||
message: '上光驱只能设置一个',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (bottom.length > 1) {
|
||||
this.$message({
|
||||
message: '下光驱只能设置一个',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
device_list = [
|
||||
{
|
||||
device_path: top[0].dev_path,
|
||||
device_pos: 2
|
||||
},
|
||||
{
|
||||
device_path: bottom[0].dev_path,
|
||||
device_pos: 1
|
||||
}
|
||||
]
|
||||
} else {
|
||||
if (!this.cdList[0].cdType) {
|
||||
this.$message({
|
||||
message: '请设置光驱',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
this.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'setCDDevice',
|
||||
req_type: 2,
|
||||
req_info: {
|
||||
device_list: [
|
||||
{
|
||||
device_path: top[0].dev_path,
|
||||
device_pos: 2
|
||||
},
|
||||
{
|
||||
device_path: bottom[0].dev_path,
|
||||
device_pos: 1
|
||||
}
|
||||
]
|
||||
device_list: device_list
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user