feat: 打印机设置支持ip
This commit is contained in:
parent
f88e3d27c8
commit
d87662ce33
|
|
@ -548,9 +548,9 @@ export default {
|
||||||
},
|
},
|
||||||
prints: {
|
prints: {
|
||||||
name: "打印",
|
name: "打印",
|
||||||
req: async function (data) {
|
req: async function (ip, data) {
|
||||||
// return await http.post("http://localhost:8080/prints/", data);
|
// return await http.post("http://localhost:8080/prints/", data);
|
||||||
return await http.post("http://127.0.0.1:8080/prints/", data);
|
return await http.post(`http://${ip}:8080/prints/`, data);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ana:{
|
ana:{
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,11 @@
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog title="打印机设置" v-model="setNameVisible" width="600px">
|
<el-dialog title="打印机设置" v-model="setNameVisible" width="600px">
|
||||||
|
<el-form label-width="100px">
|
||||||
|
<el-form-item label="打印机IP">
|
||||||
|
<el-input v-model="printer_ip"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
<el-form label-width="100px">
|
<el-form label-width="100px">
|
||||||
<el-form-item label="打印机名称">
|
<el-form-item label="打印机名称">
|
||||||
<el-input v-model="printer_name"></el-input>
|
<el-input v-model="printer_name"></el-input>
|
||||||
|
|
@ -138,6 +143,7 @@ export default {
|
||||||
scanId:'',
|
scanId:'',
|
||||||
scanType:'',
|
scanType:'',
|
||||||
printer_name:'',
|
printer_name:'',
|
||||||
|
printer_ip:'',
|
||||||
scanVisible:false,
|
scanVisible:false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -157,6 +163,7 @@ export default {
|
||||||
this.userName = userInfo.username;
|
this.userName = userInfo.username;
|
||||||
this.userNameF = this.userName.substring(0, 1);
|
this.userNameF = this.userName.substring(0, 1);
|
||||||
this.printer_name = localStorage.getItem("printer_name") || "";
|
this.printer_name = localStorage.getItem("printer_name") || "";
|
||||||
|
this.printer_ip = localStorage.getItem("printer_ip") || "127.0.0.1";
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openBook() {
|
openBook() {
|
||||||
|
|
@ -250,7 +257,10 @@ export default {
|
||||||
this.setNameVisible=true;
|
this.setNameVisible=true;
|
||||||
},
|
},
|
||||||
savePrinter(){
|
savePrinter(){
|
||||||
this.$TOOL.setPrint(this.printer_name);
|
this.$TOOL.setPrint({
|
||||||
|
"printer_name":this.printer_name,
|
||||||
|
"printer_ip":this.printer_ip
|
||||||
|
});
|
||||||
this.setNameVisible=false;
|
this.setNameVisible=false;
|
||||||
},
|
},
|
||||||
//显示短消息
|
//显示短消息
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,12 @@ tool.screen = function (element) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tool.setPrint = function (val) {
|
tool.setPrint = function (val) {
|
||||||
|
if (val.printer_name) {
|
||||||
|
localStorage.setItem('printer_name', val.printer_name)
|
||||||
|
localStorage.setItem('printer_ip', val.printer_ip)
|
||||||
|
}else{
|
||||||
localStorage.setItem('printer_name', val)
|
localStorage.setItem('printer_name', val)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* 复制对象 */
|
/* 复制对象 */
|
||||||
tool.objCopy = function (obj) {
|
tool.objCopy = function (obj) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue