feat:添加打印机名称保存
This commit is contained in:
parent
f40ef04e36
commit
94e0ed014a
|
@ -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("打印机设置成功,请重新进行打印操作。");
|
||||
},
|
||||
//本地更新数据
|
||||
//新增岗位后更新数据
|
||||
|
|
Loading…
Reference in New Issue