弹窗优化,设置盘仓优化

This commit is contained in:
24kycj
2025-03-16 10:28:12 +08:00
parent a3d2f3f1b9
commit b1a711a5ab
3 changed files with 78 additions and 50 deletions
+1
View File
@@ -205,6 +205,7 @@ const defaultData = {
yellow_last: 0, //黄色墨盒遗留 yellow_last: 0, //黄色墨盒遗留
system_ip: '', //主机IP system_ip: '', //主机IP
system_name: '', //主机名称 system_name: '', //主机名称
is_set_cddev: 1,
// 左右盘仓 // 左右盘仓
strong_list: [ strong_list: [
{ {
+21 -11
View File
@@ -424,7 +424,8 @@ export default {
showAll: false, showAll: false,
workShow: false, workShow: false,
isNew: true, isNew: true,
saveWorkList: {} saveWorkList: {},
is_set_cddev: false
} }
}, },
watch: { watch: {
@@ -482,15 +483,18 @@ export default {
} }
this.default_cd = data.strongList this.default_cd = data.strongList
this.printer_info = { ...data } this.printer_info = { ...data }
if (that.printer_info.is_set_cddev == 1) { if (this.printer_info.is_set_cddev == 1) {
if (this.is_set_cddev) return
this.is_set_cddev = true
this.$confirm('上下光驱未设置,请前往设置', '温馨提示', { this.$confirm('上下光驱未设置,请前往设置', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.is_set_cddev = false
this.goSet('/manage') this.goSet('/manage')
}).catch(() => { }).catch(() => {
this.is_set_cddev = false
}); });
} }
}, },
@@ -535,10 +539,10 @@ export default {
'$store.state.chat.isConnect': { '$store.state.chat.isConnect': {
handler(val) { handler(val) {
if (val) { if (val) {
this.$message({ // this.$message({
message: '服务已连接', // message: '服务已连接',
type: 'success' // type: 'success'
}) // })
this.serviceLoading = false this.serviceLoading = false
} }
this.isConnect = val this.isConnect = val
@@ -866,14 +870,17 @@ export default {
return return
} }
if (that.printer_info.is_set_cddev == 1) { if (that.printer_info.is_set_cddev == 1) {
this.$confirm('上下光驱未设置,请前往设置', '温馨提示', { if (that.is_set_cddev) return
that.is_set_cddev = true
that.$confirm('上下光驱未设置,请前往设置', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
that.is_set_cddev = false
that.goSet('/manage') that.goSet('/manage')
}).catch(() => { }).catch(() => {
that.is_set_cddev = false
}); });
return return
} }
@@ -893,14 +900,17 @@ export default {
return return
} }
if (that.printer_info.is_set_cddev == 1) { if (that.printer_info.is_set_cddev == 1) {
this.$confirm('上下光驱未设置,请前往设置', '温馨提示', { if (that.is_set_cddev) return
that.is_set_cddev = true
that.$confirm('上下光驱未设置,请前往设置', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
that.is_set_cddev = false
that.goSet('/manage') that.goSet('/manage')
}).catch(() => { }).catch(() => {
that.is_set_cddev = false
}); });
return return
} }
+23 -6
View File
@@ -527,6 +527,13 @@ export default {
this.cdShow = false this.cdShow = false
}, },
cdSubmit() { cdSubmit() {
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 top = this.cdList.filter((item) => item.cdType === 2)
let bottom = this.cdList.filter((item) => item.cdType === 3) let bottom = this.cdList.filter((item) => item.cdType === 3)
if (!top || top.length === 0) { if (!top || top.length === 0) {
@@ -557,12 +564,7 @@ export default {
}) })
return return
} }
this.$store device_list = [
.dispatch('chat/websocketsend', {
req_name: 'setCDDevice',
req_type: 2,
req_info: {
device_list: [
{ {
device_path: top[0].dev_path, device_path: top[0].dev_path,
device_pos: 2 device_pos: 2
@@ -572,6 +574,21 @@ export default {
device_pos: 1 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_list
} }
}) })
.then(() => { .then(() => {