10 changed files with 573 additions and 105 deletions
-
11src/api/labelSetting/com_add_update_customer_label.js
-
15src/api/labelSetting/com_add_update_user_label_printer.js
-
2src/api/labelSetting/customer_label_setting.js
-
8src/api/labelSetting/label_setting_printer.js
-
55src/views/modules/labelSetting/com_add_update_customer_label.vue
-
22src/views/modules/labelSetting/com_add_update_default_label.vue
-
5src/views/modules/labelSetting/com_add_update_label.vue
-
391src/views/modules/labelSetting/com_add_update_user_label_printer.vue
-
5src/views/modules/labelSetting/customer_label_setting.vue
-
160src/views/modules/labelSetting/label_setting_printer.vue
@ -0,0 +1,11 @@ |
|||||
|
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
|
// 插入打印标签的信息数据
|
||||
|
export const insertLabelSetting = data => createAPI('/label/setting/insertCustomerLabelSetting','post',data) |
||||
|
|
||||
|
// 修改打印标签的信息数据
|
||||
|
export const updateLabelSetting = data => createAPI('/label/setting/updateCustomerLabelSetting','post',data) |
||||
|
|
||||
|
// 修改打印标签的信息数据
|
||||
|
export const checkLabelNo = data => createAPI('/label/setting/checkLabelNo','post',data) |
||||
|
|
||||
@ -0,0 +1,15 @@ |
|||||
|
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
|
// 插入打印标签的信息数据
|
||||
|
export const insertUserLabelPrinter = data => createAPI('/label/setting/insertUserLabelPrinter','post',data) |
||||
|
|
||||
|
// 修改打印标签的信息数据
|
||||
|
export const updateUserLabelPrinter = data => createAPI('/label/setting/updateUserLabelPrinter','post',data) |
||||
|
|
||||
|
// 修改打印标签的信息数据
|
||||
|
export const checkLabelNo = data => createAPI('/label/setting/checkLabelNo','post',data) |
||||
|
|
||||
|
// 修改打印标签的信息数据
|
||||
|
export const checkUserId = data => createAPI('/label/setting/checkUserId','post',data) |
||||
|
|
||||
|
|
||||
@ -1,7 +1,7 @@ |
|||||
import { createAPI } from "@/utils/httpRequest.js"; |
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
// 获取打印标签的信息数据
|
|
||||
export const getLabelSettingList = data => createAPI('/label/setting/getLabelSettingList','post',data) |
|
||||
|
// 获取用户标签的打印机信息
|
||||
|
export const getUserLabelPrinters = data => createAPI('/label/setting/getUserLabelPrinters','post',data) |
||||
|
|
||||
// 删除标签的信息
|
|
||||
export const deleteLabelSetting = data => createAPI('/label/setting/deleteLabelSetting','post',data) |
|
||||
|
// 删除用户标签的打印机信息
|
||||
|
export const deleteUserLabelPrinter = data => createAPI('/label/setting/deleteUserLabelPrinter','post',data) |
||||
@ -0,0 +1,391 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="350px" style="height: 420px;" class="customer-dialog"> |
||||
|
|
||||
|
<el-form :inline="true" label-position="top" label-width="80px"> |
||||
|
<!-- 标签自定义信息 --> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" :label=labels.userId> |
||||
|
<el-input v-model="pageData.userId" :readonly="readOnlyUserId" @blur="checkUserIdMethod()" style="width: 120px;" > |
||||
|
</el-input > |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" :label=labels.userDisplay> |
||||
|
<el-input v-model="pageData.userDisplay" disabled style="width: 120px;" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item"> |
||||
|
<span slot="label" v-if="!labelNoReadOnly" @click="getBaseList(1099)"><a herf="#">{{labels.labelNo}}</a></span> |
||||
|
<span slot="label" v-if="labelNoReadOnly">{{labels.labelNo}}</span> |
||||
|
<el-input v-model="pageData.labelNo" :disabled="labelNoReadOnly" @blur="checkLabelNoMethod()" style="width: 120px;" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" :label=labels.labelName> |
||||
|
<el-input v-model="pageData.labelName" disabled style="width: 120px;" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" :label=labels.labelClass> |
||||
|
<el-select v-model="pageData.labelClass" disabled style="width: 150px;" > |
||||
|
<el-option label="打印软件" value="打印软件"></el-option> |
||||
|
</el-select > |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" :label=labels.ipAddress> |
||||
|
<el-input v-model="pageData.ipAddress" style="width: 120px;" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item class="customer-item" :label=labels.printerName> |
||||
|
<el-select v-model="pageData.printerName" style="width: 285px;" > |
||||
|
<el-option v-for="(item,index) in printList" |
||||
|
:key="index" :label="item.label" :value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="saveUserLabelPrinterMethod()">{{ buttons.saveButton }}</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">{{buttons.closeButton}}</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
|
||||
|
<select v-show="false" ref="printElement"> |
||||
|
</select> |
||||
|
<!--列表的组件--> |
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
insertUserLabelPrinter, |
||||
|
updateUserLabelPrinter, |
||||
|
checkLabelNo, |
||||
|
checkUserId, |
||||
|
} from '@/api/labelSetting/com_add_update_user_label_printer.js'; |
||||
|
|
||||
|
import { |
||||
|
searchSysLanguagePackList, |
||||
|
searchSysLanguageParam, |
||||
|
searchFunctionButtonList, |
||||
|
saveButtonList, |
||||
|
searchSysLanguage, |
||||
|
searchLanguageListByLanguageCode, |
||||
|
saveSysLanguageOne, |
||||
|
searchPageLanguageData, |
||||
|
removerLanguage, |
||||
|
saveSysLanguageList |
||||
|
} from "@/api/sysLanguage.js"; |
||||
|
|
||||
|
|
||||
|
/* 引入组件 */ |
||||
|
import Chooselist from '@/views/modules/common/Chooselist'/* 列表组件 */ |
||||
|
var functionId = 'C10000043'; |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '客户标签定义维护', |
||||
|
showDefault: false, |
||||
|
visible: false, |
||||
|
readOnlyUserId: true, |
||||
|
printList: [], |
||||
|
userId: this.$store.state.user.name, |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
userId: this.$store.state.user.name, |
||||
|
userDisplay: '', |
||||
|
labelNo: '', |
||||
|
labelName: '', |
||||
|
labelClass: '', |
||||
|
ipAddress: '', |
||||
|
printerName: '', |
||||
|
addFlag: false, |
||||
|
checkFlag: 'Y', |
||||
|
}, |
||||
|
labelNoReadOnly: false, |
||||
|
dataListLoading: false, |
||||
|
buttons: { |
||||
|
saveButton: '保存', |
||||
|
closeButton: '关闭', |
||||
|
}, |
||||
|
queryButton: { |
||||
|
functionId: functionId, |
||||
|
table_id: '*', |
||||
|
languageCode: this.$i18n.locale, |
||||
|
objectType: 'button' |
||||
|
}, |
||||
|
labels: { |
||||
|
userId: '用户ID:', |
||||
|
userDisplay: '用户名:', |
||||
|
titleCon: '标签打印机维护', |
||||
|
labelNo: '标签编号:', |
||||
|
labelName: '标签文件名:', |
||||
|
labelClass: '标签种类:', |
||||
|
ipAddress: 'IP地址:', |
||||
|
printerName: '打印机:', |
||||
|
confirmLabel: '确认', |
||||
|
cancelLabel: '取消', |
||||
|
}, |
||||
|
queryLabel: { |
||||
|
functionId: functionId, |
||||
|
table_id: '*', |
||||
|
languageCode: this.$i18n.locale, |
||||
|
objectType: 'label' |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
//初始化组件的参数 |
||||
|
init(currentRow) { |
||||
|
//初始化参数 |
||||
|
this.pageData = JSON.parse(JSON.stringify(currentRow)); |
||||
|
//打开页面 |
||||
|
this.visible = true; |
||||
|
//判断是否是新增 |
||||
|
if(this.pageData.addFlag == 'Y'){ |
||||
|
this.labelNoReadOnly = false; |
||||
|
}else{ |
||||
|
this.labelNoReadOnly = true; |
||||
|
} |
||||
|
//重置是否需要检验 |
||||
|
this.pageData.checkFlag = 'Y'; |
||||
|
//重置人员信息 |
||||
|
this.pageData.username = this.userId; |
||||
|
//判断是否启用多语言 |
||||
|
//this.getMultiLanguageList(); //刷新多语言的信息 |
||||
|
//重置标题 |
||||
|
this.titleCon = this.labels.titleCon; |
||||
|
//刷新所有的打印机名称 |
||||
|
this.getPrintName(); |
||||
|
//判断当前用户是都是admin |
||||
|
if(this.userId.toUpperCase() == "ADMIN"){ |
||||
|
//放开修改 |
||||
|
this.readOnlyUserId = false; |
||||
|
}else { |
||||
|
this.readOnlyUserId = true; |
||||
|
} |
||||
|
//触发查询用户ID事件 |
||||
|
this.checkUserIdMethod(); |
||||
|
//判断是否是修改的操作 |
||||
|
if(this.pageData.addFlag == 'N'){ |
||||
|
//修改的时候不允许改人名和标签编号 |
||||
|
this.readOnlyUserId = true; |
||||
|
this.labelNoReadOnly = true; |
||||
|
this.checkLabelNoMethod(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 获取所有打印机 |
||||
|
getPrintName(){ |
||||
|
this.$nextTick(() => { |
||||
|
let lodop = this.getLodop() |
||||
|
var elementById = this.$refs.printElement; |
||||
|
lodop.Create_Printer_List(elementById) |
||||
|
setTimeout(()=>{},1000) |
||||
|
var children = elementById.children |
||||
|
let list = [] |
||||
|
for (let child of children) { |
||||
|
let option = { |
||||
|
value: child.innerText, |
||||
|
label: child.innerText |
||||
|
} |
||||
|
list.push(option) |
||||
|
} |
||||
|
this.printList = list |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/*检验标签的编码*/ |
||||
|
checkUserIdMethod(){ |
||||
|
checkUserId(this.pageData).then(({data}) => { |
||||
|
//判断是否查询到了 |
||||
|
if(data && data.code == 200){ |
||||
|
//设置参数 |
||||
|
let sysUser = data.sysUser; |
||||
|
this.pageData.userDisplay = sysUser.userDisplay; |
||||
|
}else{ |
||||
|
this.pageData.userId = ''; |
||||
|
this.pageData.userDisplay = ''; |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/*检验标签的编码*/ |
||||
|
checkLabelNoMethod(){ |
||||
|
checkLabelNo(this.pageData).then(({data}) => { |
||||
|
//判断是否查询到了 |
||||
|
if(data && data.code == 200){ |
||||
|
//设置参数 |
||||
|
let labelSetting = data.resultRow; |
||||
|
this.pageData.labelType = labelSetting.labelType; |
||||
|
this.pageData.labelClass = labelSetting.labelClass; |
||||
|
this.pageData.labelName = labelSetting.labelName; |
||||
|
}else{ |
||||
|
this.pageData.labelName = ''; |
||||
|
this.pageData.labelNo = ''; |
||||
|
this.pageData.labelType = ''; |
||||
|
this.pageData.labelClass = ''; |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/*保存标签自定义的信息*/ |
||||
|
saveUserLabelPrinterMethod(){ |
||||
|
//判断标签内容是否为空 |
||||
|
let labelNo = this.pageData.labelNo.trim(); |
||||
|
let userId = this.pageData.userId.trim(); |
||||
|
let printerName = this.pageData.printerName.trim(); |
||||
|
if(labelNo == null || labelNo === ''){ |
||||
|
this.$message.success("标签编号不能为空!"); |
||||
|
return false; |
||||
|
} |
||||
|
if(userId == null || userId === ''){ |
||||
|
this.$message.success("用户ID不能为空!"); |
||||
|
return false; |
||||
|
} |
||||
|
if(printerName == null || printerName === ''){ |
||||
|
this.$message.success("打印机不能为空!"); |
||||
|
return false; |
||||
|
} |
||||
|
//判断是否是新增标签自定义 |
||||
|
if(this.pageData.addFlag === 'Y'){ |
||||
|
this.insertUserLabelPrinterData(); |
||||
|
}else{ |
||||
|
this.updateUserLabelPrinterData(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*数量失去焦点的事件*/ |
||||
|
insertUserLabelPrinterData(){ |
||||
|
insertUserLabelPrinter(this.pageData).then(({data}) => { |
||||
|
if(data.code == 200){ |
||||
|
this.$message.success(data.msg); |
||||
|
setTimeout(this.closeDialog(), 2000); |
||||
|
}else if(data.code == 201){ |
||||
|
this.$confirm(data.msg, '提示', { |
||||
|
confirmButtonText: this.labels.confirmLabel, |
||||
|
cancelButtonText: this.labels.cancelLabel, |
||||
|
type: "warning" |
||||
|
}).then(() => { |
||||
|
//调用存储过程实现 |
||||
|
this.pageData.checkFlag = 'N'; |
||||
|
//重新调用当前的方法 |
||||
|
this.insertUserLabelPrinter(); |
||||
|
}).catch(() => { |
||||
|
this.pageData.checkFlag = 'Y'; |
||||
|
}); |
||||
|
//重置标签 |
||||
|
this.pageData.checkFlag = 'Y'; |
||||
|
}else{ |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/*验证时长的参数*/ |
||||
|
updateUserLabelPrinterData(){ |
||||
|
updateUserLabelPrinter(this.pageData).then(({data}) => { |
||||
|
if(data.code == 200){ |
||||
|
this.$message.success(data.msg); |
||||
|
setTimeout(this.closeDialog(), 2000); |
||||
|
}else{ |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
//刷新报工的页面 |
||||
|
this.$emit('refreshPageTables'); |
||||
|
//关闭当前的页面 |
||||
|
this.visible = false; |
||||
|
}, |
||||
|
|
||||
|
/* 列表方法的回调 */ |
||||
|
getBaseData(val) { |
||||
|
if (this.tagNo === 1099) { |
||||
|
//设置参数 |
||||
|
this.pageData.labelNo = val.ReportID; |
||||
|
this.pageData.labelType = val.ReportFamily; |
||||
|
this.pageData.labelName = val.Reportfile; |
||||
|
this.pageData.labelClass = val.ReportType; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 获取基础数据列表 |
||||
|
getBaseList(val) { |
||||
|
this.tagNo = val |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = '' |
||||
|
if (val === 1099) { |
||||
|
strVal = this.pageData.labelNo; |
||||
|
} |
||||
|
this.$refs.baseList.init(val, strVal) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
getMultiLanguageList() { |
||||
|
//首先查询当前按钮的多语言 |
||||
|
searchFunctionButtonList(this.queryButton).then(({data}) => { |
||||
|
if (data && data.code == 0 ) { |
||||
|
this.buttons = data.data |
||||
|
} else { |
||||
|
// saveButtonList(this.buttonList).then(({data}) => { |
||||
|
// }) |
||||
|
} |
||||
|
}); |
||||
|
//其次查询当前标签的多语言 |
||||
|
searchFunctionButtonList(this.queryLabel).then(({data}) => { |
||||
|
if (data && data.code == 0 ) { |
||||
|
this.labels = data.data |
||||
|
} else { |
||||
|
// saveButtonList(this.buttonList).then(({data}) => { |
||||
|
// }) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
components: { |
||||
|
Chooselist, /* 选择的组件 */ |
||||
|
}, |
||||
|
watch: { |
||||
|
pageData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.pageData.userId = this.pageData.userId.trim().toUpperCase(); |
||||
|
this.pageData.labelNo = this.pageData.labelNo.trim().toUpperCase(); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
created() { |
||||
|
// this.factoryList() |
||||
|
// this.getLanguageList() |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue