Browse Source

标签自定义功能

master
DOUDOU 3 years ago
parent
commit
0603e63aa3
  1. 11
      src/api/labelSetting/com_add_update_default_label.js
  2. 10
      src/api/labelSetting/customer_label_setting.js
  3. 10
      src/api/labelSetting/default_label_setting.js
  4. 3
      src/api/labelSetting/label_setting.js
  5. 7
      src/api/labelSetting/label_setting_printer.js
  6. 344
      src/views/modules/labelSetting/com_add_update_customer_label.vue
  7. 333
      src/views/modules/labelSetting/com_add_update_default_label.vue
  8. 11
      src/views/modules/labelSetting/com_add_update_label.vue
  9. 609
      src/views/modules/labelSetting/customer_label_setting.vue
  10. 552
      src/views/modules/labelSetting/default_label_setting.vue
  11. 29
      src/views/modules/labelSetting/label_setting.vue
  12. 521
      src/views/modules/labelSetting/label_setting_printer.vue

11
src/api/labelSetting/com_add_update_default_label.js

@ -0,0 +1,11 @@
import { createAPI } from "@/utils/httpRequest.js";
// 插入打印标签的信息数据
export const insertLabelSetting = data => createAPI('/label/setting/insertDefaultLabelSetting','post',data)
// 修改打印标签的信息数据
export const updateLabelSetting = data => createAPI('/label/setting/updateDefaultLabelSetting','post',data)
// 修改打印标签的信息数据
export const checkLabelNo = data => createAPI('/label/setting/checkLabelNo','post',data)

10
src/api/labelSetting/customer_label_setting.js

@ -0,0 +1,10 @@
import { createAPI } from "@/utils/httpRequest.js";
// 检查标签边编号
export const checkLabelNo = data => createAPI('/label/setting/checkLabelNo','post',data)
// 获取打印标签的信息数据
export const getLabelSettingList = data => createAPI('/label/setting/getCustomerLabelSettingList','post',data)
// 删除标签的信息
export const deleteLabelSetting = data => createAPI('/label/setting/deleteDefaultLabelSetting','post',data)

10
src/api/labelSetting/default_label_setting.js

@ -0,0 +1,10 @@
import { createAPI } from "@/utils/httpRequest.js";
// 检查标签边编号
export const checkLabelNo = data => createAPI('/label/setting/checkLabelNo','post',data)
// 获取打印标签的信息数据
export const getDefaultLabelSettingList = data => createAPI('/label/setting/getDefaultLabelSettingList','post',data)
// 删除标签的信息
export const deleteLabelSetting = data => createAPI('/label/setting/deleteDefaultLabelSetting','post',data)

3
src/api/labelSetting/label_setting.js

@ -2,3 +2,6 @@ import { createAPI } from "@/utils/httpRequest.js";
// 获取打印标签的信息数据
export const getLabelSettingList = data => createAPI('/label/setting/getLabelSettingList','post',data)
// 删除标签的信息
export const deleteLabelSetting = data => createAPI('/label/setting/deleteLabelSetting','post',data)

7
src/api/labelSetting/label_setting_printer.js

@ -0,0 +1,7 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取打印标签的信息数据
export const getLabelSettingList = data => createAPI('/label/setting/getLabelSettingList','post',data)
// 删除标签的信息
export const deleteLabelSetting = data => createAPI('/label/setting/deleteLabelSetting','post',data)

344
src/views/modules/labelSetting/com_add_update_customer_label.vue

@ -0,0 +1,344 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="380px" style="height: 420px;" class="customer-dialog">
<el-form :inline="true" label-position="top" label-width="80px">
<!-- 标签自定义信息 -->
<el-container>
<fieldset class="customer-fieldset" style="width: 300px;">
<!-- -->
<el-row>
<el-col :span="12">
<el-form-item class="customer-item" :label=labels.site>
<el-input v-model="pageData.site" style="width: 150px;" >
</el-input >
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="customer-item" :label=labels.customerId>
<el-input v-model="pageData.customerId" :readonly="labelNoReadOnly" @blur="checkLabelNoMethod()" 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.labelType>
<el-select v-model="pageData.labelType" disabled style="width: 150px;" >
<el-option label="外箱标签" value="外箱标签"></el-option>
<el-option label="卷标签" value="卷标签"></el-option>
</el-select >
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="customer-item">
<span slot="label" style="" @click="getBaseList(1099)"><a herf="#">{{labels.labelNo}}</a></span>
<el-input v-model="pageData.labelNo" :readonly="labelNoReadOnly" 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.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" style="margin-top: -8px;">
<span>{{labels.subLabelFlag}}</span>
<el-checkbox v-model="pageData.subLabelFlag" @change="changeParentLabelNo()" true-label="Y" false-label="N"
style="margin-top: 28px; margin-left: 10px;"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="customer-item" :label=labels.parentLabelNo>
<el-input v-model="pageData.parentLabelNo" 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.remark>
<el-input v-model="pageData.remark" style="width: 310px;" ></el-input>
</el-form-item>
</el-col>
</el-row>
</fieldset>
</el-container>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveLabelSetting()">{{ buttons.saveButton }}</el-button>
<el-button type="primary" @click="closeDialog">{{buttons.closeButton}}</el-button>
</span>
</el-dialog>
<!--列表的组件-->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
insertLabelSetting,
updateLabelSetting,
} from '@/api/labelSetting/com_add_update_default_label.js';
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne,
searchPageLanguageData,
removerLanguage,
saveSysLanguageList
} from "@/api/sysLanguage.js";
import {checkLabelNo} from "../../../api/labelSetting/default_label_setting";
/* 引入组件 */
import Chooselist from '@/views/modules/common/Chooselist'/* 列表组件 */
var functionId = 'C10000043';
export default {
data() {
return {
titleCon: '客户标签定义维护',
showDefault: false,
visible: false,
pageData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
labelNo: '',
labelType: '',
labelName: '',
labelClass: '',
subLabelFlag: 'N',
parentLabelNo: '*',
remark: '',
addFlag: false,
checkFlag: 'Y',
},
labelNoReadOnly: false,
dataListLoading: false,
buttons: {
saveButton: '保存',
closeButton: '关闭',
},
queryButton: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'button'
},
labels: {
site: '工厂编号:',
customerId: '客户编码:',
titleCon: '客户标签定义维护',
labelNo: '标签编号:',
labelType: '标签类型:',
labelName: '报表文件名:',
labelClass: '标签种类:',
subLabelFlag: '子报表:',
parentLabelNo: '上机标签编号:',
remark: '备注:',
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 = 'N';
//
//this.getMultiLanguageList(); //
//
this.titleCon = this.labels.titleCon;
},
/*检验标签的编码*/
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);
}
})
},
/*子报表事件触发*/
changeParentLabelNo(){
//
if(this.pageData.subLabelFlag === 'Y'){
this.pageData.parentLabelNo = '';
}else{
this.pageData.parentLabelNo = '*';
}
},
/*保存标签自定义的信息*/
saveLabelSetting(){
//
let labelNo = this.pageData.labelNo.trim();
let labelType = this.pageData.labelType.trim();
let labelName = this.pageData.labelName.trim();
if(labelNo == null || labelNo === ''){
this.$message.success("标签编号不能为空!");
return false;
}
if(labelType == null || labelType === ''){
this.$message.success("标签类型不能为空!");
return false;
}
if(labelName == null || labelName === ''){
this.$message.success("报表文件名不能为空!");
return false;
}
//
if(this.pageData.addFlag === 'Y'){
this.insertLabelSettingData();
}else{
this.updateLabelSettingData();
}
},
/*数量失去焦点的事件*/
insertLabelSettingData(){
insertLabelSetting(this.pageData).then(({data}) => {
if(data.code == 200){
this.$message.success(data.msg);
setTimeout(this.closeDialog(), 2000);
}else{
this.$message.error(data.msg);
}
})
},
/*验证时长的参数*/
updateLabelSettingData(){
updateLabelSetting(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) {
}
},
//
getBaseList(val) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 1099) {
}
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) {
//
if(null == newV || '' === newV){
debugger;
}else{
this.pageData.labelNo = this.pageData.labelNo.toUpperCase();
this.pageData.parentLabelNo = this.pageData.parentLabelNo.toUpperCase();
}
}
},
},
created() {
// this.factoryList()
// this.getLanguageList()
}
}
</script>
<style scoped lang="scss">
</style>

333
src/views/modules/labelSetting/com_add_update_default_label.vue

@ -0,0 +1,333 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="380px" style="height: 380px;" class="customer-dialog">
<el-form :inline="true" label-position="top" label-width="80px">
<!-- 标签自定义信息 -->
<el-container>
<fieldset class="customer-fieldset" style="width: 300px;">
<!-- -->
<el-row>
<el-col :span="12">
<el-form-item class="customer-item" :label=labels.labelType>
<el-select v-model="pageData.labelType" disabled style="width: 150px;" >
<el-option label="外箱标签" value="外箱标签"></el-option>
<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.labelNo>
<el-input v-model="pageData.labelNo" :readonly="labelNoReadOnly" @blur="checkLabelNoMethod()" 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.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" style="margin-top: -8px;">
<span>{{labels.subLabelFlag}}</span>
<el-checkbox v-model="pageData.subLabelFlag" @change="changeParentLabelNo()" true-label="Y" false-label="N"
style="margin-top: 28px; margin-left: 10px;"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="customer-item" :label=labels.parentLabelNo>
<el-input v-model="pageData.parentLabelNo" 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.remark>
<el-input v-model="pageData.remark" style="width: 310px;" ></el-input>
</el-form-item>
</el-col>
</el-row>
</fieldset>
</el-container>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveLabelSetting()">{{ buttons.saveButton }}</el-button>
<el-button type="primary" @click="closeDialog">{{buttons.closeButton}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
insertLabelSetting,
updateLabelSetting,
checkLabelNo,
} from '@/api/labelSetting/com_add_update_default_label.js';
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne,
searchPageLanguageData,
removerLanguage,
saveSysLanguageList
} from "@/api/sysLanguage.js";
var functionId = 'C10000043';
export default {
data() {
return {
titleCon: '默认标签定义维护',
showDefault: false,
visible: false,
pageData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
labelNo: '',
labelType: '',
labelName: '',
labelClass: '',
subLabelFlag: 'N',
parentLabelNo: '*',
remark: '',
addFlag: false,
checkFlag: 'Y',
},
labelNoReadOnly: false,
dataListLoading: false,
buttons: {
saveButton: '保存',
closeButton: '关闭',
},
queryButton: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'button'
},
labels: {
titleCon: '默认标签定义维护',
labelNo: '标签编号:',
labelType: '标签类型:',
labelName: '报表文件名:',
labelClass: '标签种类:',
subLabelFlag: '子报表:',
parentLabelNo: '上机标签编号:',
remark: '备注:',
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 = 'N';
//
//this.getMultiLanguageList(); //
//
this.titleCon = this.labels.titleCon;
},
/*检验标签的编码*/
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);
}
})
},
/*子报表事件触发*/
changeParentLabelNo(){
//
if(this.pageData.subLabelFlag === 'Y'){
this.pageData.parentLabelNo = '';
}else{
this.pageData.parentLabelNo = '*';
}
},
/*保存标签自定义的信息*/
saveLabelSetting(){
//
let labelNo = this.pageData.labelNo.trim();
let labelType = this.pageData.labelType.trim();
let labelName = this.pageData.labelName.trim();
if(labelNo == null || labelNo === ''){
this.$message.success("标签编号不能为空!");
return false;
}
if(labelType == null || labelType === ''){
this.$message.success("标签类型不能为空!");
return false;
}
if(labelName == null || labelName === ''){
this.$message.success("报表文件名不能为空!");
return false;
}
//
if(this.pageData.addFlag === 'Y'){
this.insertLabelSettingData();
}else{
this.updateLabelSettingData();
}
},
/*数量失去焦点的事件*/
insertLabelSettingData(){
insertLabelSetting(this.pageData).then(({data}) => {
if(data.code == 200){
this.$message.success(data.msg);
setTimeout(this.closeDialog(), 2000);
}else{
this.$message.error(data.msg);
}
})
},
/*验证时长的参数*/
updateLabelSettingData(){
updateLabelSetting(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;
},
/*检查新的工具实例信息*/
checkConnectToolInstanceIdBun(){
/*验证工具的实例*/
if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){
this.$message.error(this.labels.pleaseScanToolInstanceId);
return false;
}
/*调用检查的方法检验下*/
checkConnectToolInstanceId(this.pageData).then(({data}) => {
//
if(data.code == 500){
this.$message.error(data.msg);
}else if (data.resultMap.resultCode == 201){
let msg = data.resultMap.resultMsg;
this.$confirm(msg, '提示', {
confirmButtonText: this.labels.confirmLabel,
cancelButtonText: this.labels.cancelLabel,
type: "warning"
}).then(() => {
this.pageData.checkFlag = true;
}).catch(() => {
this.pageData.checkFlag = false;
});
}else{
this.pageData.checkFlag = true;
}
});
},
//
async saveMultiLanguage() {
// button label title
let buttons = this.buttonList;
let labels = this.labelsList;
await saveButtonList(buttons)
await saveButtonList(labels)
},
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}) => {
// })
}
});
},
},
watch: {
pageData: {
deep: true,
handler: function (newV, oldV) {
this.pageData.labelNo = this.pageData.labelNo.toUpperCase();
this.pageData.parentLabelNo = this.pageData.parentLabelNo.toUpperCase();
}
},
},
created() {
// this.factoryList()
// this.getLanguageList()
}
}
</script>
<style scoped lang="scss">
</style>

11
src/views/modules/labelSetting/com_add_update_label.vue

@ -15,7 +15,10 @@
</el-col>
<el-col :span="12">
<el-form-item class="customer-item" :label=labels.labelType>
<el-input v-model="pageData.labelType" style="width: 150px;" ></el-input>
<el-select v-model="pageData.labelType" style="width: 150px;" >
<el-option label="外箱标签" value="外箱标签"></el-option>
<el-option label="卷标签" value="卷标签"></el-option>
</el-select >
</el-form-item>
</el-col>
</el-row>
@ -27,7 +30,9 @@
</el-col>
<el-col :span="12">
<el-form-item class="customer-item" :label=labels.labelClass>
<el-input v-model="pageData.labelClass" style="width: 150px;" ></el-input>
<el-select v-model="pageData.labelClass" style="width: 150px;" >
<el-option label="打印软件" value="打印软件"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -125,7 +130,7 @@ export default {
this.visible = true;
//
if(this.pageData.addFlag == 'Y'){
this.labelNoReadOnly = false;
this.labelNoReadOnly = true;
}else{
this.labelNoReadOnly = true;
}

609
src/views/modules/labelSetting/customer_label_setting.vue

@ -0,0 +1,609 @@
<template>
<div class="customer-css">
<!-- 查询时间和产品 -->
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
<el-form-item :label=labels.customerId>
<el-input v-model="pageData.customerId" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label=labels.labelNo>
<el-input v-model="pageData.labelNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label=labels.labelType>
<el-input v-model="pageData.labelType" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label=labels.labelName>
<el-input v-model="pageData.labelName" style="width: 120px" ></el-input>
</el-form-item>
<el-form-item style="margin-top: 16px;">
<el-button type="primary" @click="refreshPageTables()" class="customer-bun-mid"
style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.searchButton }}
</el-button>
</el-form-item>
<el-form-item style="margin-top: 16px;">
<el-button type="primary" @click="addLabelSettingModal()" class="customer-bun-mid"
style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.addButton }}
</el-button>
</el-form-item>
</el-form>
<!-- 标签列表数据 -->
<el-main style="margin-left: -20px; margin-top: -20px; width: 104%;">
<el-table @row-click="setCurrentRow"
:height="height"
highlight-current-row
:data="labelArrays"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="left"
header-align="center"
align="center"
width="100"
:label=labels.operationLabel>
<template slot-scope="scope">
<a class="customer-a" @click="editLabelSettingModal(scope.row)">{{ labels.editLabel }}</a>
<a class="customer-a" @click="deleteLabelSettingConfirm(scope.row)">{{ labels.deleteLabel }}</a>
</template>
</el-table-column>
</el-table>
</el-main>
<!-- 动态列 -->
<column v-if="showDefault" ref="column" @refreshData="getTableUserColumn" v-drag></column>
<!-- 新增或者修改的modal -->
<comAddUpdateLabel ref="comAddUpdateLabel" @refreshPageTables="refreshPageTables" v-drag></comAddUpdateLabel>
</div>
</template>
<script>
import {
getLabelSettingList,
deleteLabelSetting,
} from '@/api/labelSetting/customer_label_setting.js';
/*引入組件*/
import comAddUpdateLabel from "./com_add_update_customer_label";/*新增或者修改的組件*/
/* 动态表头 */
import {
saveTableDefaultList,
getTableDefaultListLanguage,
getTableUserListLanguage,
removerDefault,
removerUser
} from '@/api/table.js'
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne,
searchPageLanguageData,
removerLanguage,
saveSysLanguageList
} from "@/api/sysLanguage.js";
var functionId = '100008003';
export default {
data() {
return {
height: 800,
authEdit: false,
authAdd: false,
authDelete: false,
menuId: this.$route.meta.menuId,
menuShow: false,
showDefault: false,
pageData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
customerId: '',
labelNo: '',
labelName: '',
labelType: '',
searchFlag: 'N'
},
currentRow: {},
labelArrays: [],
dataListLoading: false,
columnList: [
{
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelLabelType',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'labelType',
headerAlign: 'center',
align: 'center',
columnLabel: '标签类型',
columnWidth: 100,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelCustomerId',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'customerId',
headerAlign: 'center',
align: 'center',
columnLabel: '客户编码',
columnWidth: 100,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelCustomerDesc',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'customerDesc',
headerAlign: 'center',
align: 'center',
columnLabel: '客户名称',
columnWidth: 100,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelLabelNo',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'labelNo',
headerAlign: 'center',
align: 'center',
columnLabel: '标签编号',
columnWidth: 160,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelLabelName',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'labelName',
headerAlign: 'center',
align: 'center',
columnLabel: '报表文件名',
columnWidth: 220,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelLabelClass',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'labelClass',
headerAlign: 'center',
align: 'left',
columnLabel: '标签种类',
columnWidth: 140,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelSite',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'site',
headerAlign: 'center',
align: 'left',
columnLabel: '工厂编号',
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelSubLabelFlag',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'subLabelFlag',
headerAlign: 'center',
align: 'left',
columnLabel: '子报表',
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelParentLabelNo',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'parentLabelNo',
headerAlign: 'center',
align: 'left',
columnLabel: '上级标签编号',
columnWidth: 120,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008003,
serialNumber: '100008003LabelRemark',
tableId: '100008003Label',
tableName: '客户标签自定义列表',
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnWidth: 240,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
},
],
queryTable: {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008003Label',
languageCode: this.$i18n.locale
},
// table
queryTableUser: {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008003Label',
status: true,
languageCode: this.$i18n.locale
},
// table
userColumnList: [],
buttons: {
searchButton: '查询',
addButton: '新增',
},
queryButton: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'button'
},
labels: {
customerId: '客户编码',
labelNo: '标签编号:',
labelType: '标签类型:',
labelName: '报表文件名:',
operationLabel: '操作',
editLabel: '编辑',
deleteLabel: '删除',
},
queryLabel: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'label'
},
}
},
components: {
comAddUpdateLabel,/*标签新增或者修改的组件*/
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 165;
})
},
methods: {
/* 刷新页面table */
refreshPageTables() {
this.currentRow = {};
//
this.pageData.searchFlag = 'Y';
this.refreshLabelSettingList();
},
//
refreshLabelSettingList() {
//
getLabelSettingList(this.pageData).then(({data}) => {
//
this.labelArrays = data.rows;
})
},
/*新增标签定义的modal*/
addLabelSettingModal(){
let currentData = {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
labelNo: '',
labelName: '',
labelType: '',
labelClass: '',
subLabelFlag: '',
parentLabelNo: '',
remark: '',
addFlag: 'Y'
};
//
this.$nextTick(() => {
this.$refs.comAddUpdateLabel.init(currentData);
})
},
/*修改标签定义的modal*/
editLabelSettingModal(row){
let currentData = row;
currentData.addFlag = 'N';
//
this.$nextTick(() => {
this.$refs.comAddUpdateLabel.init(currentData);
})
},
/*删除标签*/
deleteLabelSettingConfirm(row){
this.$confirm('确定要删除该记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteLabelSetting(row).then(({data}) => {
if (data && data.code == 200) {
this.refreshPageTables();
this.$message.success(data.msg);
} else {
this.$message.error(data.msg);
}
});
});
},
/* 设置选中行的参数 */
setCurrentRow(row, column, event) {
this.currentRow = JSON.parse(JSON.stringify(row))
},
//
userSetting() {
this.visible = true
let queryTable = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008003Label',
languageCode: this.$i18n.locale
}
this.$nextTick(() => {
this.$refs.column.init(queryTable)
})
},
//
getTableUserColumn() {
getTableUserListLanguage(this.queryTableUser).then(({data}) => {
if (data && data.code == 0 && data.rows.length > 0) {
// this.columnList = []
this.columnList = data.rows
} else {
this.getColumnList()
}
})
},
// tableDefault
getColumnList() {
getTableDefaultListLanguage(this.queryTable).then(({data}) => {
if (data && data.code == 0) {
// this.showDefault = false
this.columnList = data.rows
} else {
// this.showDefault = true
}
})
},
//
getButtonAuthData(){
let updateFlag = this.isAuth(this.menuId+":revise");
let fullControFlag = this.isAuth(this.menuId+":fullContro");
let deleteFlag = this.isAuth(this.menuId+":remove");
//
this.authEdit = !updateFlag && !fullControFlag;
this.authAdd = !fullControFlag;
this.authDelete = !deleteFlag;
},
//
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}) => {
// })
}
});
},
},
created() {
//
this.refreshLabelSettingList();
//
//this.getTableUserColumn()
//
//this.getButtonAuthData();
//this.getMultiLanguageList(); //
}
}
</script>
<style>
.el-textarea__inner {
padding: 5px 5px;
}
</style>
<!--当前页面的标签样式-->
<style scoped lang="scss">
/*针对el-card*/
.customer-card .el-form-item__content {
margin-top: -15px;
}
.customer-card .el-form-item {
height: 22px;
}
.customer-border .el-form-item__content {
margin-top: -30px;
}
/*全局年与日类型 宽度*/
div.el-time-width {
width: 110px !important;
}
/* 全局时间右边框*/
.customer-css input.el-input__inner {
height: 22px !important;
padding-right: 0px !important;
}
/* 控制el-card标签的数据*/
div.customer-el-card {
margin-left: 110px;
margin-top: -15px;
height: 20px;
width: 60px;
}
/* 颜色控制 */
div.customer-el-card-pink {
background: #FF00FF;
}
div.customer-el-card-orange {
background: #FFD700;
}
div.customer-el-card-blue {
background: #0000CD;
}
/*清掉样式*/
.el-radio + .el-radio {
margin-left: 0px;
}
/*当前按钮的通用样式*/
.customer-css .customer-bun-mid {
width: 65px;
text-align: center;
}
/*当前按钮的通用样式*/
.customer-css .el-button--medium {
padding: 5px 5px;
}
/*添加主菜单和明细菜单的样式*/
.customer-css .customer-dropdown .el-button--primary {
padding: 2px;
font-size: 12px;
}
.el-dropdown-menu--medium .el-dropdown-menu__item {
line-height: 18px;
padding: 0 17px;
font-size: 12px;
}
hr {
margin-top: 0px;
}
/*控制上下间距*/
</style>

552
src/views/modules/labelSetting/default_label_setting.vue

@ -0,0 +1,552 @@
<template>
<div class="customer-css">
<!-- 查询时间和产品 -->
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
<el-form-item :label=labels.labelNo>
<el-input v-model="pageData.labelNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label=labels.labelType>
<el-input v-model="pageData.labelType" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label=labels.labelName>
<el-input v-model="pageData.labelName" style="width: 120px" ></el-input>
</el-form-item>
<el-form-item style="margin-top: 16px;">
<el-button type="primary" @click="refreshPageTables()" class="customer-bun-mid"
style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.searchButton }}
</el-button>
</el-form-item>
<el-form-item style="margin-top: 16px;">
<el-button type="primary" @click="addLabelSettingModal()" class="customer-bun-mid"
style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.addButton }}
</el-button>
</el-form-item>
</el-form>
<!-- 标签列表数据 -->
<el-main style="margin-left: -20px; margin-top: -20px; width: 104%;">
<el-table @row-click="setCurrentRow"
:height="height"
highlight-current-row
:data="labelArrays"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="left"
header-align="center"
align="center"
width="100"
:label=labels.operationLabel>
<template slot-scope="scope">
<a class="customer-a" @click="editLabelSettingModal(scope.row)">{{ labels.editLabel }}</a>
<a class="customer-a" @click="deleteLabelSettingConfirm(scope.row)">{{ labels.deleteLabel }}</a>
</template>
</el-table-column>
</el-table>
</el-main>
<!-- 动态列 -->
<column v-if="showDefault" ref="column" @refreshData="getTableUserColumn" v-drag></column>
<!-- 新增或者修改的modal -->
<comAddUpdateLabel ref="comAddUpdateLabel" @refreshPageTables="refreshPageTables" v-drag></comAddUpdateLabel>
</div>
</template>
<script>
import {
getDefaultLabelSettingList,
deleteLabelSetting,
} from '@/api/labelSetting/default_label_setting.js';
/*引入組件*/
import comAddUpdateLabel from "./com_add_update_default_label";/*新增或者修改的組件*/
/* 动态表头 */
import {
saveTableDefaultList,
getTableDefaultListLanguage,
getTableUserListLanguage,
removerDefault,
removerUser
} from '@/api/table.js'
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne,
searchPageLanguageData,
removerLanguage,
saveSysLanguageList
} from "@/api/sysLanguage.js";
var functionId = '100008002';
export default {
data() {
return {
height: 800,
authEdit: false,
authAdd: false,
authDelete: false,
menuId: this.$route.meta.menuId,
menuShow: false,
showDefault: false,
pageData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
labelNo: '',
labelName: '',
labelType: '',
searchFlag: 'N'
},
currentRow: {},
labelArrays: [],
dataListLoading: false,
columnList: [
{
userId: this.$store.state.user.name,
functionId: 100008002,
serialNumber: '100008002LabelLabelType',
tableId: '100008002Label',
tableName: '默认标签列表',
columnProp: 'labelType',
headerAlign: 'center',
align: 'center',
columnLabel: '标签类型',
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008002,
serialNumber: '100008002LabelLabelNo',
tableId: '100008002Label',
tableName: '默认标签列表',
columnProp: 'labelNo',
headerAlign: 'center',
align: 'center',
columnLabel: '标签编号',
columnWidth: 125,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008002,
serialNumber: '100008002LabelLabelClass',
tableId: '100008002Label',
tableName: '默认标签列表',
columnProp: 'labelClass',
headerAlign: 'center',
align: 'left',
columnLabel: '标签种类',
columnWidth: 120,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008002,
serialNumber: '100008002LabelLabelName',
tableId: '100008002Label',
tableName: '默认标签列表',
columnProp: 'labelName',
headerAlign: 'center',
align: 'center',
columnLabel: '报表文件名',
columnWidth: 220,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008002,
serialNumber: '100008002LabelRemark',
tableId: '100008002Label',
tableName: '默认标签列表',
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnWidth: 200,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008002,
serialNumber: '100008002LabelSubLabelFlag',
tableId: '100008002Label',
tableName: '默认标签列表',
columnProp: 'subLabelFlag',
headerAlign: 'center',
align: 'left',
columnLabel: '子报表',
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
}, {
userId: this.$store.state.user.name,
functionId: 100008002,
serialNumber: '100008002LabelParentLabelNo',
tableId: '100008002Label',
tableName: '默认标签列表',
columnProp: 'parentLabelNo',
headerAlign: 'center',
align: 'left',
columnLabel: '上级标签编号',
columnWidth: 120,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
},
],
queryTable: {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008002Label',
languageCode: this.$i18n.locale
},
// table
queryTableUser: {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008002Label',
status: true,
languageCode: this.$i18n.locale
},
// table
userColumnList: [],
buttons: {
searchButton: '查询',
addButton: '新增',
},
queryButton: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'button'
},
labels: {
labelNo: '标签编号:',
labelType: '标签类型:',
labelName: '报表文件名:',
operationLabel: '操作',
editLabel: '编辑',
deleteLabel: '删除',
},
queryLabel: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'label'
},
}
},
components: {
comAddUpdateLabel,/*标签新增或者修改的组件*/
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 165;
})
},
methods: {
/* 刷新页面table */
refreshPageTables() {
this.currentRow = {};
//
this.pageData.searchFlag = 'Y';
this.refreshLabelSettingList();
},
//
refreshLabelSettingList() {
//
getDefaultLabelSettingList(this.pageData).then(({data}) => {
//
this.labelArrays = data.rows;
})
},
/*新增标签定义的modal*/
addLabelSettingModal(){
let currentData = {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
labelNo: '',
labelName: '',
labelType: '',
labelClass: '',
subLabelFlag: 'N',
parentLabelNo: '*',
remark: '',
addFlag: 'Y',
};
//
this.$nextTick(() => {
this.$refs.comAddUpdateLabel.init(currentData);
})
},
/*修改标签定义的modal*/
editLabelSettingModal(row){
let currentData = row;
currentData.addFlag = 'N';
//
this.$nextTick(() => {
this.$refs.comAddUpdateLabel.init(currentData);
})
},
/*删除标签*/
deleteLabelSettingConfirm(row){
this.$confirm('确定要删除该记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteLabelSetting(row).then(({data}) => {
if (data && data.code == 200) {
this.refreshPageTables();
this.$message.success(data.msg);
} else {
this.$message.error(data.msg);
}
});
});
},
/* 设置选中行的参数 */
setCurrentRow(row, column, event) {
this.currentRow = JSON.parse(JSON.stringify(row))
},
//
userSetting() {
this.visible = true
let queryTable = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008002Label',
languageCode: this.$i18n.locale
}
this.$nextTick(() => {
this.$refs.column.init(queryTable)
})
},
//
getTableUserColumn() {
getTableUserListLanguage(this.queryTableUser).then(({data}) => {
if (data && data.code == 0 && data.rows.length > 0) {
// this.columnList = []
this.columnList = data.rows
} else {
this.getColumnList()
}
})
},
// tableDefault
getColumnList() {
getTableDefaultListLanguage(this.queryTable).then(({data}) => {
if (data && data.code == 0) {
// this.showDefault = false
this.columnList = data.rows
} else {
// this.showDefault = true
}
})
},
//
getButtonAuthData(){
let updateFlag = this.isAuth(this.menuId+":revise");
let fullControFlag = this.isAuth(this.menuId+":fullContro");
let deleteFlag = this.isAuth(this.menuId+":remove");
//
this.authEdit = !updateFlag && !fullControFlag;
this.authAdd = !fullControFlag;
this.authDelete = !deleteFlag;
},
//
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}) => {
// })
}
});
},
},
created() {
//
this.refreshLabelSettingList();
//
//this.getTableUserColumn()
//
//this.getButtonAuthData();
//this.getMultiLanguageList(); //
}
}
</script>
<style>
.el-textarea__inner {
padding: 5px 5px;
}
</style>
<!--当前页面的标签样式-->
<style scoped lang="scss">
/*针对el-card*/
.customer-card .el-form-item__content {
margin-top: -15px;
}
.customer-card .el-form-item {
height: 22px;
}
.customer-border .el-form-item__content {
margin-top: -30px;
}
/*全局年与日类型 宽度*/
div.el-time-width {
width: 110px !important;
}
/* 全局时间右边框*/
.customer-css input.el-input__inner {
height: 22px !important;
padding-right: 0px !important;
}
/* 控制el-card标签的数据*/
div.customer-el-card {
margin-left: 110px;
margin-top: -15px;
height: 20px;
width: 60px;
}
/* 颜色控制 */
div.customer-el-card-pink {
background: #FF00FF;
}
div.customer-el-card-orange {
background: #FFD700;
}
div.customer-el-card-blue {
background: #0000CD;
}
/*清掉样式*/
.el-radio + .el-radio {
margin-left: 0px;
}
/*当前按钮的通用样式*/
.customer-css .customer-bun-mid {
width: 65px;
text-align: center;
}
/*当前按钮的通用样式*/
.customer-css .el-button--medium {
padding: 5px 5px;
}
/*添加主菜单和明细菜单的样式*/
.customer-css .customer-dropdown .el-button--primary {
padding: 2px;
font-size: 12px;
}
.el-dropdown-menu--medium .el-dropdown-menu__item {
line-height: 18px;
padding: 0 17px;
font-size: 12px;
}
hr {
margin-top: 0px;
}
/*控制上下间距*/
</style>

29
src/views/modules/labelSetting/label_setting.vue

@ -55,6 +55,7 @@
:label=labels.operationLabel>
<template slot-scope="scope">
<a class="customer-a" @click="editLabelSettingModal(scope.row)">{{ labels.editLabel }}</a>
<a class="customer-a" @click="deleteLabelSettingConfirm(scope.row)">{{ labels.deleteLabel }}</a>
</template>
</el-table-column>
</el-table>
@ -71,6 +72,7 @@
import {
getLabelSettingList,
deleteLabelSetting,
} from '@/api/labelSetting/label_setting.js';
/*引入組件*/
@ -245,6 +247,7 @@ export default {
labelName: '报表文件名:',
operationLabel: '操作',
editLabel: '编辑',
deleteLabel: '删除',
},
queryLabel: {
functionId: functionId,
@ -288,10 +291,10 @@ export default {
let currentData = {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
labelNo: '',
labelNo: '*',
labelName: '',
labelType: '',
labelClass: '',
labelType: '外箱标签',
labelClass: '打印软件',
remark: '',
addFlag: 'Y'
};
@ -301,7 +304,6 @@ export default {
})
},
/*修改标签定义的modal*/
editLabelSettingModal(row){
let currentData = row;
@ -312,6 +314,25 @@ export default {
})
},
/*删除标签*/
deleteLabelSettingConfirm(row){
this.$confirm('确定要删除该记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteLabelSetting(row).then(({data}) => {
if (data && data.code == 200) {
this.refreshPageTables();
this.$message.success(data.msg);
} else {
this.$message.error(data.msg);
}
});
});
},
/* 设置选中行的参数 */
setCurrentRow(row, column, event) {
this.currentRow = JSON.parse(JSON.stringify(row))

521
src/views/modules/labelSetting/label_setting_printer.vue

@ -0,0 +1,521 @@
<template>
<div class="customer-css">
<!-- 查询时间和产品 -->
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
<el-form-item :label=labels.labelNo>
<el-input v-model="pageData.labelNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label=labels.labelType>
<el-input v-model="pageData.labelType" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label=labels.labelName>
<el-input v-model="pageData.labelName" style="width: 120px" ></el-input>
</el-form-item>
<el-form-item style="margin-top: 16px;">
<el-button type="primary" @click="refreshPageTables()" class="customer-bun-mid"
style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.searchButton }}
</el-button>
</el-form-item>
<el-form-item style="margin-top: 16px;">
<el-button type="primary" @click="addLabelSettingModal()" class="customer-bun-mid"
style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.addButton }}
</el-button>
</el-form-item>
</el-form>
<!-- 标签列表数据 -->
<el-main style="margin-left: -20px; margin-top: -20px; width: 104%;">
<el-table @row-click="setCurrentRow"
:height="height"
highlight-current-row
:data="labelArrays"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="left"
header-align="center"
align="center"
width="100"
:label=labels.operationLabel>
<template slot-scope="scope">
<a class="customer-a" @click="editLabelSettingModal(scope.row)">{{ labels.editLabel }}</a>
<a class="customer-a" @click="deleteLabelSettingConfirm(scope.row)">{{ labels.deleteLabel }}</a>
</template>
</el-table-column>
</el-table>
</el-main>
<!-- 动态列 -->
<column v-if="showDefault" ref="column" @refreshData="getTableUserColumn" v-drag></column>
<!-- 新增或者修改的modal -->
<comAddUpdateLabel ref="comAddUpdateLabel" @refreshPageTables="refreshPageTables" v-drag></comAddUpdateLabel>
</div>
</template>
<script>
import {
getLabelSettingList,
deleteLabelSetting,
} from '@/api/labelSetting/label_setting.js';
/*引入組件*/
import comAddUpdateLabel from "./com_add_update_label";/*新增或者修改的組件*/
/* 动态表头 */
import {
saveTableDefaultList,
getTableDefaultListLanguage,
getTableUserListLanguage,
removerDefault,
removerUser
} from '@/api/table.js'
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne,
searchPageLanguageData,
removerLanguage,
saveSysLanguageList
} from "@/api/sysLanguage.js";
var functionId = '100008001';
export default {
data() {
return {
height: 800,
authEdit: false,
authAdd: false,
authDelete: false,
menuId: this.$route.meta.menuId,
menuShow: false,
showDefault: false,
pageData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
labelNo: '',
labelName: '',
labelType: '',
searchFlag: 'N'
},
currentRow: {},
labelArrays: [],
dataListLoading: false,
columnList: [
{
userId: this.$store.state.user.name,
functionId: 100008001,
serialNumber: '100008001LabelLabelNo',
tableId: '100008001Label',
tableName: '标签自定义列表',
columnProp: 'labelNo',
headerAlign: 'center',
align: 'center',
columnLabel: '标签编号',
columnWidth: 160,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
},
{
userId: this.$store.state.user.name,
functionId: 100008001,
serialNumber: '100008001LabelLabelType',
tableId: '100008001Label',
tableName: '标签自定义列表',
columnProp: 'labelType',
headerAlign: 'center',
align: 'center',
columnLabel: '标签类型',
columnWidth: 100,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
},
{
userId: this.$store.state.user.name,
functionId: 100008001,
serialNumber: '100008001LabelLabelName',
tableId: '100008001Label',
tableName: '标签自定义列表',
columnProp: 'labelName',
headerAlign: 'center',
align: 'center',
columnLabel: '报表文件名',
columnWidth: 220,
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: ''
},
{
userId: this.$store.state.user.name,
functionId: 100008001,
serialNumber: '100008001LabelLabelClass',
tableId: '100008001Label',
tableName: '标签自定义列表',
columnProp: 'labelClass',
headerAlign: 'center',
align: 'left',
columnLabel: '标签种类',
columnWidth: 140,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
},
{
userId: this.$store.state.user.name,
functionId: 100008001,
serialNumber: '100008001LabelRemark',
tableId: '100008001Label',
tableName: '标签自定义列表',
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnWidth: 300,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
},
],
queryTable: {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008001Label',
languageCode: this.$i18n.locale
},
// table
queryTableUser: {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008001Label',
status: true,
languageCode: this.$i18n.locale
},
// table
userColumnList: [],
buttons: {
searchButton: '查询',
addButton: '新增',
},
queryButton: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'button'
},
labels: {
labelNo: '标签编号:',
labelType: '标签类型:',
labelName: '报表文件名:',
operationLabel: '操作',
editLabel: '编辑',
deleteLabel: '删除',
},
queryLabel: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'label'
},
}
},
components: {
comAddUpdateLabel,/*标签新增或者修改的组件*/
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 165;
})
},
methods: {
/* 刷新页面table */
refreshPageTables() {
this.currentRow = {};
//
this.pageData.searchFlag = 'Y';
this.refreshLabelSettingList();
},
//
refreshLabelSettingList() {
//
getLabelSettingList(this.pageData).then(({data}) => {
//
this.labelArrays = data.rows;
})
},
/*新增标签定义的modal*/
addLabelSettingModal(){
let currentData = {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
labelNo: '*',
labelName: '',
labelType: '外箱标签',
labelClass: '打印软件',
remark: '',
addFlag: 'Y'
};
//
this.$nextTick(() => {
this.$refs.comAddUpdateLabel.init(currentData);
})
},
/*修改标签定义的modal*/
editLabelSettingModal(row){
let currentData = row;
currentData.addFlag = 'N';
//
this.$nextTick(() => {
this.$refs.comAddUpdateLabel.init(currentData);
})
},
/*删除标签*/
deleteLabelSettingConfirm(row){
this.$confirm('确定要删除该记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteLabelSetting(row).then(({data}) => {
if (data && data.code == 200) {
this.refreshPageTables();
this.$message.success(data.msg);
} else {
this.$message.error(data.msg);
}
});
});
},
/* 设置选中行的参数 */
setCurrentRow(row, column, event) {
this.currentRow = JSON.parse(JSON.stringify(row))
},
//
userSetting() {
this.visible = true
let queryTable = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: '100008001Label',
languageCode: this.$i18n.locale
}
this.$nextTick(() => {
this.$refs.column.init(queryTable)
})
},
//
getTableUserColumn() {
getTableUserListLanguage(this.queryTableUser).then(({data}) => {
if (data && data.code == 0 && data.rows.length > 0) {
// this.columnList = []
this.columnList = data.rows
} else {
this.getColumnList()
}
})
},
// tableDefault
getColumnList() {
getTableDefaultListLanguage(this.queryTable).then(({data}) => {
if (data && data.code == 0) {
// this.showDefault = false
this.columnList = data.rows
} else {
// this.showDefault = true
}
})
},
//
getButtonAuthData(){
let updateFlag = this.isAuth(this.menuId+":revise");
let fullControFlag = this.isAuth(this.menuId+":fullContro");
let deleteFlag = this.isAuth(this.menuId+":remove");
//
this.authEdit = !updateFlag && !fullControFlag;
this.authAdd = !fullControFlag;
this.authDelete = !deleteFlag;
},
//
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}) => {
// })
}
});
},
},
created() {
//
this.refreshLabelSettingList();
//
//this.getTableUserColumn()
//
//this.getButtonAuthData();
//this.getMultiLanguageList(); //
}
}
</script>
<style>
.el-textarea__inner {
padding: 5px 5px;
}
</style>
<!--当前页面的标签样式-->
<style scoped lang="scss">
/*针对el-card*/
.customer-card .el-form-item__content {
margin-top: -15px;
}
.customer-card .el-form-item {
height: 22px;
}
.customer-border .el-form-item__content {
margin-top: -30px;
}
/*全局年与日类型 宽度*/
div.el-time-width {
width: 110px !important;
}
/* 全局时间右边框*/
.customer-css input.el-input__inner {
height: 22px !important;
padding-right: 0px !important;
}
/* 控制el-card标签的数据*/
div.customer-el-card {
margin-left: 110px;
margin-top: -15px;
height: 20px;
width: 60px;
}
/* 颜色控制 */
div.customer-el-card-pink {
background: #FF00FF;
}
div.customer-el-card-orange {
background: #FFD700;
}
div.customer-el-card-blue {
background: #0000CD;
}
/*清掉样式*/
.el-radio + .el-radio {
margin-left: 0px;
}
/*当前按钮的通用样式*/
.customer-css .customer-bun-mid {
width: 65px;
text-align: center;
}
/*当前按钮的通用样式*/
.customer-css .el-button--medium {
padding: 5px 5px;
}
/*添加主菜单和明细菜单的样式*/
.customer-css .customer-dropdown .el-button--primary {
padding: 2px;
font-size: 12px;
}
.el-dropdown-menu--medium .el-dropdown-menu__item {
line-height: 18px;
padding: 0 17px;
font-size: 12px;
}
hr {
margin-top: 0px;
}
/*控制上下间距*/
</style>
Loading…
Cancel
Save