|
|
|
@ -16,15 +16,15 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="getDataList">Query</el-button> |
|
|
|
<el-button type="primary" @click="addModal">New</el-button> |
|
|
|
<el-button type="primary" @click="addModal" v-if="!isComponent">New</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-table |
|
|
|
:height="height" |
|
|
|
:height="isComponent?componentHeight:height" |
|
|
|
:data="dataList" |
|
|
|
border |
|
|
|
style="width: 100%;"> |
|
|
|
@row-dblclick="handleRowClick" |
|
|
|
style="width: 100%;margin-top: 5px"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnList" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
@ -37,7 +37,8 @@ |
|
|
|
: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> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|
|
|
style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
@ -45,6 +46,7 @@ |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="160" |
|
|
|
v-if="!isComponent" |
|
|
|
label="Actions"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link style="cursor: pointer" @click="updateModal(scope.row)">Edit</el-link> |
|
|
|
@ -72,7 +74,7 @@ |
|
|
|
<el-input v-model="modalData.manufacturerNo"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" > |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-checkbox v-model="modalData.active" true-label="Y" false-label="N">Active</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
@ -100,12 +102,23 @@ import { |
|
|
|
manufacturerInformationEdit, // 制造商信息编辑 |
|
|
|
manufacturerInformationDelete // 制造商信息删除 |
|
|
|
} from '@/api/manufacturer/manufacturerInformation.js' |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from '@/api/table.js' |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'Manufacturer', |
|
|
|
components: { |
|
|
|
Chooselist |
|
|
|
}, |
|
|
|
props:{ |
|
|
|
componentHeight: { |
|
|
|
type: Number, |
|
|
|
}, |
|
|
|
isComponent:{ |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
searchData: { |
|
|
|
deep: true, |
|
|
|
@ -118,7 +131,7 @@ export default { |
|
|
|
handler: function (newV, oldV) { |
|
|
|
this.modalData.manufacturerNo = this.modalData.manufacturerNo.toUpperCase() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
@ -164,11 +177,11 @@ export default { |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601008, |
|
|
|
serialNumber: '601008Table1ManufacturerId', |
|
|
|
tableId: "601008Table1", |
|
|
|
tableName: "制造商信息表", |
|
|
|
tableId: '601008Table1', |
|
|
|
tableName: '制造商信息表', |
|
|
|
columnProp: 'manufacturerNo', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'Manufacturer No', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -176,17 +189,17 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
columnWidth: 80 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601008, |
|
|
|
serialNumber: '601008Table1ManufacturerName', |
|
|
|
tableId: "601008Table1", |
|
|
|
tableName: "制造商表", |
|
|
|
tableId: '601008Table1', |
|
|
|
tableName: '制造商表', |
|
|
|
columnProp: 'manufacturerName', |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
columnLabel: 'Manufacturer Name', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -194,7 +207,7 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 300 |
|
|
|
columnWidth: 120 |
|
|
|
}, |
|
|
|
{ |
|
|
|
functionId: 601008, |
|
|
|
@ -211,7 +224,7 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
columnWidth: 80 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
@ -229,17 +242,17 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 170 |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601008, |
|
|
|
serialNumber: '601008Table1CreateBy', |
|
|
|
tableId: "601008Table1", |
|
|
|
tableName: "制造商表", |
|
|
|
tableId: '601008Table1', |
|
|
|
tableName: '制造商表', |
|
|
|
columnProp: 'createBy', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'Created By', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -247,17 +260,17 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
columnWidth: 80 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601008, |
|
|
|
serialNumber: '601008Table1UpdateDate', |
|
|
|
tableId: "601008Table1", |
|
|
|
tableName: "制造商表", |
|
|
|
tableId: '601008Table1', |
|
|
|
tableName: '制造商表', |
|
|
|
columnProp: 'updateDate', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'Updated Time', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -265,17 +278,17 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 170 |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601008, |
|
|
|
serialNumber: '601008Table1UpdateBy', |
|
|
|
tableId: "601008Table1", |
|
|
|
tableName: "制造商表", |
|
|
|
tableId: '601008Table1', |
|
|
|
tableName: '制造商表', |
|
|
|
columnProp: 'updateBy', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'Updated By', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -283,25 +296,25 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
columnWidth: 80 |
|
|
|
}, |
|
|
|
], |
|
|
|
rules: { |
|
|
|
manufacturerNo:[ |
|
|
|
manufacturerNo: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
manufacturerName:[ |
|
|
|
manufacturerName: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
active:[ |
|
|
|
active: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
@ -328,9 +341,11 @@ export default { |
|
|
|
|
|
|
|
created () { |
|
|
|
// 动态列 |
|
|
|
this.getTableUserColumn(this.$route.meta.menuId+'table1',1) |
|
|
|
// 获取数据列表 |
|
|
|
this.getDataList() |
|
|
|
if (!this.isComponent){ |
|
|
|
this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1) |
|
|
|
} |
|
|
|
// 获取数据列表 |
|
|
|
this.getDataList(); |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
@ -349,34 +364,34 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
//导出excel |
|
|
|
async createExportData() { |
|
|
|
async createExportData () { |
|
|
|
this.searchData.limit = -1 |
|
|
|
this.searchData.page = 1 |
|
|
|
await manufacturerInformationSearch(this.searchData).then(({data}) => { |
|
|
|
this.exportList= data.page.list |
|
|
|
this.exportList = data.page.list |
|
|
|
}) |
|
|
|
return this.exportList |
|
|
|
}, |
|
|
|
|
|
|
|
startDownload() { |
|
|
|
startDownload () { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
finishDownload() { |
|
|
|
finishDownload () { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fields () { |
|
|
|
let json = "{" |
|
|
|
let json = '{' |
|
|
|
this.columnList.forEach((item, index) => { |
|
|
|
if (index == this.columnList.length - 1) { |
|
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|
|
|
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' |
|
|
|
} else { |
|
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|
|
|
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ',' |
|
|
|
} |
|
|
|
}) |
|
|
|
json += "}" |
|
|
|
let s = eval("(" + json + ")") |
|
|
|
json += '}' |
|
|
|
let s = eval('(' + json + ')') |
|
|
|
return s |
|
|
|
}, |
|
|
|
|
|
|
|
@ -397,7 +412,7 @@ export default { |
|
|
|
addModal () { |
|
|
|
this.modalData = { |
|
|
|
flag: '1', |
|
|
|
title: 'Manufacturer Addition', |
|
|
|
title: 'Manufacturer', |
|
|
|
site: this.$store.state.user.site, |
|
|
|
manufacturerNo: '', |
|
|
|
manufacturerName: '', |
|
|
|
@ -415,7 +430,7 @@ export default { |
|
|
|
updateModal (row) { |
|
|
|
this.modalData = { |
|
|
|
flag: '2', |
|
|
|
title: 'Manufacturer Editor', |
|
|
|
title: 'Manufacturer', |
|
|
|
site: row.site, |
|
|
|
id: row.id, |
|
|
|
manufacturerNo: row.manufacturerNo, |
|
|
|
@ -485,7 +500,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 动态列开始 获取 用户保存的 格式列 |
|
|
|
async getTableUserColumn(tableId, columnId) { |
|
|
|
async getTableUserColumn (tableId, columnId) { |
|
|
|
let queryTableUser = { |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.$route.meta.menuId, |
|
|
|
@ -498,7 +513,7 @@ export default { |
|
|
|
switch (columnId) { |
|
|
|
case 1: |
|
|
|
this.columnList = data.rows |
|
|
|
break; |
|
|
|
break |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.getColumnList(tableId, columnId) |
|
|
|
@ -508,7 +523,7 @@ export default { |
|
|
|
|
|
|
|
// 获取 tableDefault 列 |
|
|
|
async getColumnList (tableId, columnId) { |
|
|
|
let queryTable= { |
|
|
|
let queryTable = { |
|
|
|
functionId: this.$route.meta.menuId, |
|
|
|
tableId: tableId, |
|
|
|
languageCode: this.$i18n.locale |
|
|
|
@ -518,7 +533,7 @@ export default { |
|
|
|
switch (columnId) { |
|
|
|
case 1: |
|
|
|
this.columnList = data.rows |
|
|
|
break; |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -526,17 +541,21 @@ export default { |
|
|
|
|
|
|
|
//获取按钮的权限数据 |
|
|
|
getButtonAuthData () { |
|
|
|
let searchFlag = this.isAuth(this.menuId+":search") |
|
|
|
let saveFlag = this.isAuth(this.menuId+":save") |
|
|
|
let updateFlag = this.isAuth(this.menuId+":update") |
|
|
|
let deleteFlag = this.isAuth(this.menuId+":delete") |
|
|
|
let searchFlag = this.isAuth(this.menuId + ':search') |
|
|
|
let saveFlag = this.isAuth(this.menuId + ':save') |
|
|
|
let updateFlag = this.isAuth(this.menuId + ':update') |
|
|
|
let deleteFlag = this.isAuth(this.menuId + ':delete') |
|
|
|
//处理页面的权限数据 |
|
|
|
this.authSearch = !searchFlag |
|
|
|
this.authSave = !saveFlag |
|
|
|
this.authUpdate = !updateFlag |
|
|
|
this.authDelete = !deleteFlag |
|
|
|
}, |
|
|
|
|
|
|
|
handleRowClick(row){ |
|
|
|
if (this.isComponent){ |
|
|
|
this.$emit('rowClick', row) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -544,6 +563,5 @@ export default { |
|
|
|
<style scoped lang="scss"> |
|
|
|
/deep/ .customer-tab .el-tabs__content { |
|
|
|
padding: 0px !important; |
|
|
|
height: 459px; |
|
|
|
} |
|
|
|
</style> |