// 这种写法不仅繁琐,而且会导致form中的input无法正常输入文字
async getPrinterScheme(info) {
const { printerId, shopId, erpModel, id: useSceneId, isCloudPrinter } = info
const { data } = await this.axios.post(`/printScheme/${printerId}/${shopId}/${erpModel}/${useSceneId}/${isCloudPrinter}/getPrinterScheme`)
this.ruleForm = data.data || {}
if (!this.ruleForm.printMachine) {
this.ruleForm.printMachine = 0
}
if (!this.ruleForm.printNumber) {
this.ruleForm.printNumber = 1
}
if (!this.ruleForm.leftPadding) {
this.ruleForm.leftPadding = 0
}
if (!this.ruleForm.rightPadding) {
this.ruleForm.rightPadding = 0
}
this.printMachine = this.ruleForm.printMachine
if (!this.ruleForm.printSchemeMachineList) {
this.ruleForm.printSchemeMachineList = []
}
},
async getPrinterScheme(info) {
const { printerId, shopId, erpModel, id: useSceneId, isCloudPrinter } = info
const { data } = await this.axios.post(`/printScheme/${printerId}/${shopId}/${erpModel}/${useSceneId}/${isCloudPrinter}/getPrinterScheme`)
const theData = data.data || {}
const { printMachine = 0, printNumber = 1, leftPadding = 0, rightPadding = 0, printSchemeMachineList = [] } = theData
this.ruleForm.printMachine = printMachine
this.ruleForm.printNumber = printNumber
this.ruleForm.leftPadding = leftPadding
this.ruleForm.rightPadding = rightPadding
this.ruleForm.printSchemeMachineList = printSchemeMachineList
},