打印按钮替换
This commit is contained in:
parent
af448398a2
commit
2117661802
@ -2,7 +2,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-print"
|
icon="el-icon-printer"
|
||||||
@click="handlePrint()"
|
@click="handlePrint()"
|
||||||
>{{labelText}}</el-button>
|
>{{labelText}}</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -22,22 +22,31 @@ export default {
|
|||||||
labelText: {
|
labelText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '打印'
|
default: '打印'
|
||||||
}
|
},
|
||||||
|
printerCode: null
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
handlePrint(){
|
handlePrint(){
|
||||||
//先检查是否有配置默认的打印机
|
|
||||||
const key = 'defaultPrinter';
|
|
||||||
let printerJson = localStorage.getItem(key);
|
|
||||||
|
|
||||||
debugger;
|
var theCode;
|
||||||
if(printerJson !=null){
|
if(this.printerCode ==null){
|
||||||
const printer = JSON.parse(printerJson);
|
//是否有配置默认的打印机
|
||||||
const param = { businessId: this.businessId, businessCode: this.businessCode, businessType: this.businessType, printerCode: printer.printerCode };
|
const key = 'defaultPrinter';
|
||||||
printBarcodeLabel(param);
|
let printerJson = localStorage.getItem(key);
|
||||||
|
if(printerJson !=null){
|
||||||
|
const printer = JSON.parse(printerJson);
|
||||||
|
theCode = printer.printerCode;
|
||||||
|
}else{
|
||||||
|
this.$modal.msgError("请在打印管理-打印机配置功能中指定默认打印机!");
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
this.$modal.msgError("请在打印管理-打印机配置功能中指定默认打印机!");
|
theCode = this.printerCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const param = { businessId: this.businessId, businessCode: this.businessCode, businessType: this.businessType, printerCode: theCode };
|
||||||
|
printBarcodeLabel(param).then(response => {
|
||||||
|
this.$modal.msgSuccess("打印成功");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,13 +97,7 @@
|
|||||||
@click="handleDefault(scope.row)"
|
@click="handleDefault(scope.row)"
|
||||||
v-hasPermi="['print:printerconfig:list']"
|
v-hasPermi="['print:printerconfig:list']"
|
||||||
>设置为默认</el-button>
|
>设置为默认</el-button>
|
||||||
<el-button
|
<printLabel :printerCode="scope.row.printerCode" labelText="测试" businessType = "PRINTTEST"></printLabel>
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-video-play"
|
|
||||||
@click="handleTest(scope.row)"
|
|
||||||
v-hasPermi="['print:printerconfig:list']"
|
|
||||||
>设置为默认</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -265,10 +259,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listPrinterconfig, getPrinterconfig, delPrinterconfig, addPrinterconfig, updatePrinterconfig } from "@/api/print/printerconfig";
|
import { listPrinterconfig, getPrinterconfig, delPrinterconfig, addPrinterconfig, updatePrinterconfig } from "@/api/print/printerconfig";
|
||||||
|
import printLabel from "@/components/printerLabel/index.vue"
|
||||||
export default {
|
export default {
|
||||||
name: "Printerconfig",
|
name: "Printerconfig",
|
||||||
dicts: ['mes_printer_status', 'mes_printer_type', 'mes_conn_type','sys_yes_no'],
|
dicts: ['mes_printer_status', 'mes_printer_type', 'mes_conn_type','sys_yes_no'],
|
||||||
|
components: { printLabel },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//自动生成编码
|
//自动生成编码
|
||||||
|
Loading…
Reference in New Issue
Block a user