8 changed files with 2850 additions and 5 deletions
-
26src/api/manufacturer/manufacturerInformation.js
-
5src/api/part/external.js
-
549src/views/modules/manufacturer/manufacturerInformation.vue
-
7src/views/modules/part/customer/linkedCustomer.vue
-
19src/views/modules/part/external.vue
-
7src/views/modules/part/manufacturer/linkedManufacturer.vue
-
1128src/views/modules/part/partCustomer.vue
-
1114src/views/modules/part/partManufacturer.vue
@ -0,0 +1,26 @@ |
|||||
|
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
|
/** |
||||
|
* 制造商信息列表查询 |
||||
|
* @param data |
||||
|
* @returns {*} |
||||
|
*/ |
||||
|
export const manufacturerInformationSearch = data => createAPI(`/manufacturerInformation/manufacturerInformationSearch`,'post',data) |
||||
|
/** |
||||
|
* 制造商信息新增 |
||||
|
* @param data |
||||
|
* @returns {*} |
||||
|
*/ |
||||
|
export const manufacturerInformationSave = data => createAPI(`/manufacturerInformation/manufacturerInformationSave`,'post',data) |
||||
|
/** |
||||
|
* 制造商信息编辑 |
||||
|
* @param data |
||||
|
* @returns {*} |
||||
|
*/ |
||||
|
export const manufacturerInformationEdit = data => createAPI(`/manufacturerInformation/manufacturerInformationEdit`,'post',data) |
||||
|
/** |
||||
|
* 制造商信息删除 |
||||
|
* @param data |
||||
|
* @returns {*} |
||||
|
*/ |
||||
|
export const manufacturerInformationDelete = data => createAPI(`/manufacturerInformation/manufacturerInformationDelete`,'post',data) |
||||
@ -0,0 +1,549 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList"> |
||||
|
<el-form-item :label="'Manufacturer No'"> |
||||
|
<el-input v-model="searchData.manufacturerNo" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'Manufacturer Name'"> |
||||
|
<el-input v-model="searchData.manufacturerName" clearable style="width: 210px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'Active'"> |
||||
|
<el-select clearable v-model="searchData.active" style="width: 120px"> |
||||
|
<el-option label="All" value=""></el-option> |
||||
|
<el-option label="Active" value="Y"></el-option> |
||||
|
<el-option label="Not Active" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</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-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
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" |
||||
|
:min-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="160" |
||||
|
label="Actions"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link style="cursor: pointer" @click="updateModal(scope.row)">Edit</el-link> |
||||
|
<el-link style="cursor: pointer" @click="delModal(scope.row)">Delete</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<!-- 分页栏 --> |
||||
|
<el-pagination |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
|
||||
|
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px"> |
||||
|
<el-form label-position="top" :model="modalData" :rules="rules" ref="saveForm"> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="Manufacturer No" prop="manufacturerNo"> |
||||
|
<el-input v-model="modalData.manufacturerNo"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<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> |
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="Manufacturer Name" prop="manufacturerName" :show-message="false"> |
||||
|
<el-input v-model="modalData.manufacturerName"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<el-footer style="height:30px;margin-top: 20px;text-align:center"> |
||||
|
<el-button type="primary" @click="saveData">Save</el-button> |
||||
|
<el-button type="primary" @click="modalFlag = false">Cancel</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
manufacturerInformationSearch, // 制造商信息列表查询 |
||||
|
manufacturerInformationSave, // 制造商信息新增 |
||||
|
manufacturerInformationEdit, // 制造商信息编辑 |
||||
|
manufacturerInformationDelete // 制造商信息删除 |
||||
|
} from '@/api/manufacturer/manufacturerInformation.js' |
||||
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
||||
|
import Chooselist from '@/views/modules/common/Chooselist' |
||||
|
export default { |
||||
|
components: { |
||||
|
Chooselist |
||||
|
}, |
||||
|
watch: { |
||||
|
searchData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.searchData.manufacturerNo = this.searchData.manufacturerNo.toUpperCase() |
||||
|
} |
||||
|
}, |
||||
|
modalData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.modalData.manufacturerNo = this.modalData.manufacturerNo.toUpperCase() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
// 导出 |
||||
|
exportData: [], |
||||
|
exportName: '制造商' + this.dayjs().format('YYYYMMDDHHmmss'), |
||||
|
exportHeader: ['制造商'], |
||||
|
exportFooter: [], |
||||
|
resultList: [], |
||||
|
userBuList: [], |
||||
|
// ======== 行高 ======== |
||||
|
height: 200, |
||||
|
// ======== 分页 ======== |
||||
|
pageIndex: 1, |
||||
|
pageSize: 50, |
||||
|
totalPage: 0, |
||||
|
// 条件查询 |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
userName: this.$store.state.user.name, |
||||
|
buDesc: '', |
||||
|
manufacturerNo: '', |
||||
|
manufacturerName: '', |
||||
|
active: '', |
||||
|
page: 1, |
||||
|
limit: 10 |
||||
|
}, |
||||
|
modalData: { |
||||
|
flag: '', |
||||
|
title: '', |
||||
|
bu: '', |
||||
|
site: this.$store.state.user.site, |
||||
|
buNo: '', |
||||
|
manufacturerNo: '', |
||||
|
manufacturerName: '', |
||||
|
active: '' |
||||
|
}, |
||||
|
// ======== 数据列表 ======== |
||||
|
dataList: [], |
||||
|
// 展示列集 |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 601008, |
||||
|
serialNumber: '601008Table1ManufacturerId', |
||||
|
tableId: "601008Table1", |
||||
|
tableName: "制造商信息表", |
||||
|
columnProp: 'manufacturerNo', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: 'Manufacturer No', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 601008, |
||||
|
serialNumber: '601008Table1ManufacturerName', |
||||
|
tableId: "601008Table1", |
||||
|
tableName: "制造商表", |
||||
|
columnProp: 'manufacturerName', |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: 'Manufacturer Name', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 300 |
||||
|
}, |
||||
|
{ |
||||
|
functionId: 601008, |
||||
|
serialNumber: '601008Table1Active', |
||||
|
tableId: '601008Table1', |
||||
|
tableName: '制造商信息表', |
||||
|
columnProp: 'active', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: 'Active', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 601008, |
||||
|
serialNumber: '601008Table1CreateDate', |
||||
|
tableId: '601008Table1', |
||||
|
tableName: '制造商表', |
||||
|
columnProp: 'createDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: 'Created Time', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170 |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 601008, |
||||
|
serialNumber: '601008Table1CreateBy', |
||||
|
tableId: "601008Table1", |
||||
|
tableName: "制造商表", |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: 'Created By', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 601008, |
||||
|
serialNumber: '601008Table1UpdateDate', |
||||
|
tableId: "601008Table1", |
||||
|
tableName: "制造商表", |
||||
|
columnProp: 'updateDate', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: 'Updated Time', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170 |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 601008, |
||||
|
serialNumber: '601008Table1UpdateBy', |
||||
|
tableId: "601008Table1", |
||||
|
tableName: "制造商表", |
||||
|
columnProp: 'updateBy', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: 'Updated By', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
}, |
||||
|
], |
||||
|
rules: { |
||||
|
manufacturerNo:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: 'change' |
||||
|
} |
||||
|
], |
||||
|
manufacturerName:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: 'change' |
||||
|
} |
||||
|
], |
||||
|
active:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: 'change' |
||||
|
} |
||||
|
], |
||||
|
}, |
||||
|
// ======== 模态框开关控制 ======== |
||||
|
authSearch: false, |
||||
|
authSave: false, |
||||
|
authUpdate: false, |
||||
|
authDelete: false, |
||||
|
modalFlag: false, |
||||
|
modalDisableFlag: false, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 180 |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
created () { |
||||
|
// 动态列 |
||||
|
this.getTableUserColumn(this.$route.meta.menuId+'table1',1) |
||||
|
// 获取数据列表 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
// 每页数 |
||||
|
sizeChangeHandle (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle (val) { |
||||
|
this.pageIndex = val |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
//导出excel |
||||
|
async createExportData() { |
||||
|
this.searchData.limit = -1 |
||||
|
this.searchData.page = 1 |
||||
|
await manufacturerInformationSearch(this.searchData).then(({data}) => { |
||||
|
this.exportList= data.page.list |
||||
|
}) |
||||
|
return this.exportList |
||||
|
}, |
||||
|
|
||||
|
startDownload() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
finishDownload() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
fields () { |
||||
|
let json = "{" |
||||
|
this.columnList.forEach((item, index) => { |
||||
|
if (index == this.columnList.length - 1) { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
||||
|
} else { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
||||
|
} |
||||
|
}) |
||||
|
json += "}" |
||||
|
let s = eval("(" + json + ")") |
||||
|
return s |
||||
|
}, |
||||
|
|
||||
|
// 获取数据列表 |
||||
|
getDataList () { |
||||
|
this.searchData.limit = this.pageSize |
||||
|
this.searchData.page = this.pageIndex |
||||
|
manufacturerInformationSearch(this.searchData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.dataList = data.page.list |
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
addModal () { |
||||
|
this.modalData = { |
||||
|
flag: '1', |
||||
|
title: 'Manufacturer Addition', |
||||
|
site: this.$store.state.user.site, |
||||
|
manufacturerNo: '', |
||||
|
manufacturerName: '', |
||||
|
active: 'Y', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
} |
||||
|
this.modalDisableFlag = false |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 制造商信息编辑模态框 |
||||
|
* @param row |
||||
|
*/ |
||||
|
updateModal (row) { |
||||
|
this.modalData = { |
||||
|
flag: '2', |
||||
|
title: 'Manufacturer Editor', |
||||
|
site: row.site, |
||||
|
id: row.id, |
||||
|
manufacturerNo: row.manufacturerNo, |
||||
|
manufacturerName: row.manufacturerName, |
||||
|
active: row.active, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
} |
||||
|
this.modalDisableFlag = true |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// ======== New/编辑/删除方法 ======== |
||||
|
/** |
||||
|
* 制造商信息新增/编辑 |
||||
|
*/ |
||||
|
saveData () { |
||||
|
if (this.modalData.manufacturerNo === '' || this.modalData.manufacturerNo == null) { |
||||
|
this.$message.warning('Please input manufacturer no!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.manufacturerName === '' || this.modalData.manufacturerName == null) { |
||||
|
this.$message.warning('Please input manufacturer name!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.flag === '1') { |
||||
|
manufacturerInformationSave(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
manufacturerInformationEdit(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
/** |
||||
|
* 制造商信息删除 |
||||
|
*/ |
||||
|
delModal (row) { |
||||
|
this.$confirm(`Whether to delete the manufacturer information?`, 'Tips', { |
||||
|
confirmButtonText: 'Yes', |
||||
|
cancelButtonText: 'No', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
manufacturerInformationDelete(row).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.partSelections = [] |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 动态列开始 获取 用户保存的 格式列 |
||||
|
async getTableUserColumn(tableId, columnId) { |
||||
|
let queryTableUser = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableUserListLanguage(queryTableUser).then(({data}) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
} |
||||
|
} else { |
||||
|
this.getColumnList(tableId, columnId) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取 tableDefault 列 |
||||
|
async getColumnList (tableId, columnId) { |
||||
|
let queryTable= { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableDefaultListLanguage(queryTable).then(({data}) => { |
||||
|
if (!data.rows.length === 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//获取按钮的权限数据 |
||||
|
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") |
||||
|
//处理页面的权限数据 |
||||
|
this.authSearch = !searchFlag |
||||
|
this.authSave = !saveFlag |
||||
|
this.authUpdate = !updateFlag |
||||
|
this.authDelete = !deleteFlag |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
/deep/ .customer-tab .el-tabs__content { |
||||
|
padding: 0px !important; |
||||
|
height: 459px; |
||||
|
} |
||||
|
</style> |
||||
1128
src/views/modules/part/partCustomer.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1114
src/views/modules/part/partManufacturer.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue