feat:添加打印机名称保存

This commit is contained in:
shijing 2024-07-30 15:22:25 +08:00
parent f40ef04e36
commit 94e0ed014a
1 changed files with 32 additions and 5 deletions

View File

@ -153,6 +153,16 @@
@closed="dialog.save = false"
>
</save-dialog>
<el-dialog title="打印机设置" v-model="setNameVisible" width="600px">
<el-form label-width="100px">
<el-form-item label="打印机名称">
<el-input v-model="printer_name"></el-input>
</el-form-item>
</el-form>
<el-footer>
<el-button type="primary" @click="savePrinter">保存</el-button>
</el-footer>
</el-dialog>
</template>
<script>
import saveDialog from "./handover_form.vue";
@ -196,10 +206,13 @@ export default {
mlogId: "",
processId: "",
processCate: "",
printer_name: "",
setNameVisible: false,
};
},
mounted() {
let that = this;
that.printer_name = localStorage.getItem("printer_name");
that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName })
.then((res) => {
@ -243,7 +256,7 @@ export default {
// -
let obj = {};
obj.printer_commands = str;
obj.printer_name = "GP-3150TN";
obj.printer_name = that.printer_name;
this.$API.wpm.prints.req(obj).then((response) => {});
},
//
@ -306,10 +319,24 @@ export default {
table_print(row) {
//
let that = this;
that.$API.wpm.handover.item.req(row.id).then((res) => {
that.handoverItem = res;
that.handoverPrint();
});
if (
that.printer_name == null ||
that.printer_name == "" ||
that.printer_name == undefined
) {
this.setNameVisible = true;
} else {
that.$API.wpm.handover.item.req(row.id).then((res) => {
that.handoverItem = res;
that.handoverPrint();
});
}
},
savePrinter() {
let that = this;
localStorage.setItem("printer_name", that.printer_name);
that.setNameVisible = false;
that.$message.success("打印机设置成功,请重新进行打印操作。");
},
//
//