mirror of
https://github.com/shawncai/ERP.git
synced 2024-09-20 06:56:07 +08:00
经销商完成
This commit is contained in:
parent
0d64728faf
commit
5788f22d8f
|
@ -258,7 +258,7 @@ export function startorend(query, stat) {
|
|||
})
|
||||
}
|
||||
|
||||
// 仓库停用和启用
|
||||
// 仓库批量导入
|
||||
export function manyinsert(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null && query !== undefined) {
|
||||
|
|
391
src/api/Supplier.js
Normal file
391
src/api/Supplier.js
Normal file
|
@ -0,0 +1,391 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询分类属性
|
||||
export function searchCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null && query !== undefined) {
|
||||
params.append('type', query) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
params.append('pagenum', 1) // 你要传给后台的参数值 key/value
|
||||
params.append('pagesize', 9999) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierCategory/searchCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 新建供应商
|
||||
export function create(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.supplierName !== '' && query.supplierName !== null && query.supplierName !== undefined) {
|
||||
params.append('supplierName', query.supplierName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.createId !== '' && query.createId !== null && query.createId !== undefined) {
|
||||
params.append('createId', query.createId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.typeId !== '' && query.typeId !== null && query.typeId !== undefined) {
|
||||
params.append('typeId', query.typeId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.supplierShortName !== '' && query.supplierShortName !== null && query.supplierShortName !== undefined) {
|
||||
params.append('supplierShortName', query.supplierShortName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.supplierIntroduction !== '' && query.supplierIntroduction !== null && query.supplierIntroduction !== undefined) {
|
||||
params.append('supplierIntroduction', query.supplierIntroduction) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.countryId !== '' && query.countryId !== null && query.countryId !== undefined) {
|
||||
params.append('countryId', query.countryId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.provinceId !== '' && query.provinceId !== null && query.provinceId !== undefined) {
|
||||
params.append('provinceId', query.provinceId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.cityId !== '' && query.cityId !== null && query.cityId !== undefined) {
|
||||
params.append('cityId', query.cityId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.detailAddress !== '' && query.detailAddress !== null && query.detailAddress !== undefined) {
|
||||
params.append('detailAddress', query.detailAddress) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.groupId !== '' && query.groupId !== null && query.groupId !== undefined) {
|
||||
params.append('groupId', query.groupId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.zipCode !== '' && query.zipCode !== null && query.zipCode !== undefined) {
|
||||
params.append('zipCode', query.zipCode) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.contactPersonName !== '' && query.contactPersonName !== null && query.contactPersonName !== undefined) {
|
||||
params.append('contactPersonName', query.contactPersonName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.contactPersonPhone !== '' && query.contactPersonPhone !== null && query.contactPersonPhone !== undefined) {
|
||||
params.append('contactPersonPhone', query.contactPersonPhone) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.regionId !== '' && query.regionId !== null && query.regionId !== undefined) {
|
||||
params.append('regionId', query.regionId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.giveId !== '' && query.giveId !== null && query.giveId !== undefined) {
|
||||
params.append('giveId', query.giveId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.transportId !== '' && query.transportId !== null && query.transportId !== undefined) {
|
||||
params.append('transportId', query.transportId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.levelId !== '' && query.levelId !== null && query.levelId !== undefined) {
|
||||
params.append('levelId', query.levelId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.isHot !== '' && query.isHot !== null && query.isHot !== undefined) {
|
||||
params.append('isHot', query.isHot) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.isEffective !== '' && query.isEffective !== null && query.isEffective !== undefined) {
|
||||
params.append('isEffective', query.isEffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.buyerId !== '' && query.buyerId !== null && query.buyerId !== undefined) {
|
||||
params.append('buyerId', query.buyerId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.businessScopeIntroduction !== '' && query.businessScopeIntroduction !== null && query.businessScopeIntroduction !== undefined) {
|
||||
params.append('businessScopeIntroduction', query.businessScopeIntroduction) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.paymentId !== '' && query.paymentId !== null && query.paymentId !== undefined) {
|
||||
params.append('paymentId', query.paymentId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.moneyId !== '' && query.moneyId !== null && query.moneyId !== undefined) {
|
||||
params.append('moneyId', query.moneyId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.bankName !== '' && query.bankName !== null && query.bankName !== undefined) {
|
||||
params.append('bankName', query.bankName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.accountName !== '' && query.accountName !== null && query.accountName !== undefined) {
|
||||
params.append('accountName', query.accountName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.account !== '' && query.account !== null && query.account !== undefined) {
|
||||
params.append('account', query.account) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.establishDate !== '' && query.establishDate !== null && query.establishDate !== undefined) {
|
||||
params.append('establishDate', query.establishDate) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.legalPerson !== '' && query.legalPerson !== null && query.legalPerson !== undefined) {
|
||||
params.append('legalPerson', query.legalPerson) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.taxNumber !== '' && query.taxNumber !== null && query.taxNumber !== undefined) {
|
||||
params.append('taxNumber', query.taxNumber) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.businessLicense !== '' && query.businessLicense !== null && query.businessLicense !== undefined) {
|
||||
params.append('businessLicense', query.businessLicense) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.companyTypeId !== '' && query.companyTypeId !== null && query.companyTypeId !== undefined) {
|
||||
params.append('companyTypeId', query.companyTypeId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplier/create',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 供应商列表
|
||||
export function search(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.id !== '' && query.id !== null && query.id !== undefined) {
|
||||
params.append('id', query.id) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.supplierName !== '' && query.supplierName !== null && query.supplierName !== undefined) {
|
||||
params.append('supplierName', query.supplierName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.typeId !== '' && query.typeId !== null && query.typeId !== undefined) {
|
||||
params.append('typeId', query.typeId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.regionId !== '' && query.regionId !== null && query.regionId !== undefined) {
|
||||
params.append('regionId', query.regionId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.levelId !== '' && query.levelId !== null && query.levelId !== undefined) {
|
||||
params.append('levelId', query.levelId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.pagenum !== '' && query.pagenum !== null && query.pagenum !== undefined) {
|
||||
params.append('pagenum', query.pagenum) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.pagesize !== '' && query.pagesize !== null && query.pagesize !== undefined) {
|
||||
params.append('pagesize', query.pagesize) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplier/search',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改供应商
|
||||
export function update(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.supplierName !== '' && query.supplierName !== null && query.supplierName !== undefined) {
|
||||
params.append('supplierName', query.supplierName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.typeId !== '' && query.typeId !== null && query.typeId !== undefined) {
|
||||
params.append('typeId', query.typeId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.supplierShortName !== '' && query.supplierShortName !== null && query.supplierShortName !== undefined) {
|
||||
params.append('supplierShortName', query.supplierShortName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.supplierIntroduction !== '' && query.supplierIntroduction !== null && query.supplierIntroduction !== undefined) {
|
||||
params.append('supplierIntroduction', query.supplierIntroduction) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.countryid !== '' && query.countryid !== null && query.countryid !== undefined) {
|
||||
params.append('countryId', query.countryid) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.provinceid !== '' && query.provinceid !== null && query.provinceid !== undefined) {
|
||||
params.append('provinceId', query.provinceid) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.cityid !== '' && query.cityid !== null && query.cityid !== undefined) {
|
||||
params.append('cityId', query.cityid) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.detailAddress !== '' && query.detailAddress !== null && query.detailAddress !== undefined) {
|
||||
params.append('detailAddress', query.detailAddress) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.groupId !== '' && query.groupId !== null && query.groupId !== undefined) {
|
||||
params.append('groupId', query.groupId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.groupId !== '' && query.groupId !== null && query.groupId !== undefined) {
|
||||
params.append('groupId', query.groupId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.zipCode !== '' && query.zipCode !== null && query.zipCode !== undefined) {
|
||||
params.append('zipCode', query.zipCode) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.contactPersonName !== '' && query.contactPersonName !== null && query.contactPersonName !== undefined) {
|
||||
params.append('contactPersonName', query.contactPersonName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.contactPersonPhone !== '' && query.contactPersonPhone !== null && query.contactPersonPhone !== undefined) {
|
||||
params.append('contactPersonPhone', query.contactPersonPhone) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.regionId !== '' && query.regionId !== null && query.regionId !== undefined) {
|
||||
params.append('regionId', query.regionId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.giveId !== '' && query.giveId !== null && query.giveId !== undefined) {
|
||||
params.append('giveId', query.giveId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.transportId !== '' && query.transportId !== null && query.transportId !== undefined) {
|
||||
params.append('transportId', query.transportId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.levelId !== '' && query.levelId !== null && query.levelId !== undefined) {
|
||||
params.append('levelId', query.levelId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.isHot !== '' && query.isHot !== null && query.isHot !== undefined) {
|
||||
params.append('isHot', query.isHot) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.isEffective !== '' && query.isEffective !== null && query.isEffective !== undefined) {
|
||||
params.append('isEffective', query.isEffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.buyerId !== '' && query.buyerId !== null && query.buyerId !== undefined) {
|
||||
params.append('buyerId', query.buyerId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.businessScopeIntroduction !== '' && query.businessScopeIntroduction !== null && query.businessScopeIntroduction !== undefined) {
|
||||
params.append('businessScopeIntroduction', query.businessScopeIntroduction) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.paymentId !== '' && query.paymentId !== null && query.paymentId !== undefined) {
|
||||
params.append('paymentId', query.paymentId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.moneyId !== '' && query.moneyId !== null && query.moneyId !== undefined) {
|
||||
params.append('moneyId', query.moneyId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.bankName !== '' && query.bankName !== null && query.bankName !== undefined) {
|
||||
params.append('bankName', query.bankName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.accountName !== '' && query.accountName !== null && query.accountName !== undefined) {
|
||||
params.append('accountName', query.accountName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.account !== '' && query.account !== null && query.account !== undefined) {
|
||||
params.append('account', query.account) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.establishDate !== '' && query.establishDate !== null && query.establishDate !== undefined) {
|
||||
params.append('establishDate', query.establishDate) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.legalPerson !== '' && query.legalPerson !== null && query.legalPerson !== undefined) {
|
||||
params.append('legalPerson', query.legalPerson) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.taxNumber !== '' && query.taxNumber !== null && query.taxNumber !== undefined) {
|
||||
params.append('taxNumber', query.taxNumber) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.businessLicense !== '' && query.businessLicense !== null && query.businessLicense !== undefined) {
|
||||
params.append('businessLicense', query.businessLicense) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.companyTypeId !== '' && query.companyTypeId !== null && query.companyTypeId !== undefined) {
|
||||
params.append('companyTypeId', query.companyTypeId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.id !== '' && query.id !== null && query.id !== undefined) {
|
||||
params.append('id', query.id) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplier/update',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除供应商
|
||||
export function delete2(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null && query !== undefined) {
|
||||
params.append('modelids', query) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplier/delete',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询供应商分组
|
||||
export function searchGroup() {
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierGroup/search',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增供应商分组
|
||||
export function createGroup(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null && query !== undefined) {
|
||||
params.append('groupName', query) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierGroup/create',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除供应商分组
|
||||
export function deleteGroup(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null && query !== undefined) {
|
||||
params.append('id', query) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierGroup/delete',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 分类属性列表
|
||||
export function searchEmpCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.categoryname !== '' && query.categoryname !== null) {
|
||||
params.append('categoryname', query.categoryname) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.iseffective !== '' && query.iseffective !== null) {
|
||||
params.append('iseffective', query.iseffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.type !== '' && query.type !== null) {
|
||||
params.append('type', query.type) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
params.append('pagenum', query.pagenum) // 你要传给后台的参数值 key/value
|
||||
params.append('pagesize', query.pagesize) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierCategory/searchCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 新增分类属性
|
||||
export function addEmpCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.categoryname !== '' && query.categoryname !== null) {
|
||||
params.append('categoryname', query.categoryname) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.category !== '' && query.category !== null) {
|
||||
params.append('category', query.category) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.iseffective !== '' && query.iseffective !== null) {
|
||||
params.append('iseffective', query.iseffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.type !== '' && query.type !== null) {
|
||||
params.append('type', query.type) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierCategory/addCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改分类属性
|
||||
export function updateEmpCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.categoryName !== '' && query.categoryName !== null) {
|
||||
params.append('categoryname', query.categoryName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.isEffective !== '' && query.isEffective !== null) {
|
||||
params.append('iseffective', query.isEffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.id !== '' && query.id !== null) {
|
||||
params.append('id', query.id) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierCategory/updateCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除分类属性
|
||||
export function delateEmpCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null) {
|
||||
params.append('ids', query) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierCategory/delateCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 经销商批量导入
|
||||
export function manyinsert(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null && query !== undefined) {
|
||||
params.append('supplierJson', query) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/supplierRecommendation/manyinsert',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
1
src/icons/svg/wupin.svg
Normal file
1
src/icons/svg/wupin.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1551770413186" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2025" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M480.822418 64.268746 64.016501 256.05577l0 511.434112 416.321894 191.788048 414.756235-191.788048L895.09463 256.05577 480.822418 64.268746zM447.591573 872.325555 127.945509 728.120222 127.945509 319.985802l319.647087 127.858016L447.592596 872.325555zM174.710602 271.098371l306.111816-135.839805 300.203246 136.146796-299.664987 120.695896L174.710602 271.098371zM831.167668 731.190141 511.521604 874.474498 511.521604 447.843818l319.646064-127.858016L831.167668 731.190141z" p-id="2026"></path></svg>
|
After Width: | Height: | Size: 886 B |
|
@ -24,7 +24,12 @@ export default {
|
|||
CustomerCategory: '分类属性设置',
|
||||
Manyinsert: '批量导入仓库资料',
|
||||
Supplier: '供应商资料',
|
||||
NewSupplier: '新建供应商'
|
||||
NewSupplier: '新建供应商',
|
||||
SupplierList: '供应商列表',
|
||||
SupplierCategory: '分类属性设置',
|
||||
ManySupplier: '批量导入供应商',
|
||||
Product: '物品资料',
|
||||
NewProduct: '新建物品资料'
|
||||
},
|
||||
navbar: {
|
||||
logOut: '退出登录',
|
||||
|
@ -186,6 +191,7 @@ export default {
|
|||
contactPersonName: '联系人',
|
||||
contactPersonPhone: '电话',
|
||||
regionId: '所在区域',
|
||||
editregionId: '修改区域',
|
||||
giveId: '交货方式',
|
||||
transportId: '运送方式',
|
||||
levelId: '供应商优质级别',
|
||||
|
@ -202,7 +208,15 @@ export default {
|
|||
legalPerson: '法人代表',
|
||||
taxNumber: '税务登记号',
|
||||
businessLicense: '营业执照号',
|
||||
companyTypeId: '单位性质'
|
||||
companyTypeId: '单位性质',
|
||||
id: '供应商编号',
|
||||
supplierGroup: '新建分组',
|
||||
createTime: '建档日期',
|
||||
countyrId: '修改国家',
|
||||
provinceId: '修改省',
|
||||
cityId: '修改市',
|
||||
groupName: '组名称',
|
||||
createId: '建档人'
|
||||
},
|
||||
public: {
|
||||
address: '地址',
|
||||
|
|
|
@ -231,6 +231,44 @@ export const asyncRouterMap = [
|
|||
component: () => import('@/views/Supplier/NewSupplier'),
|
||||
name: 'NewSupplier',
|
||||
meta: { title: 'NewSupplier', noCache: false }
|
||||
},
|
||||
{
|
||||
path: 'SupplierList',
|
||||
component: () => import('@/views/Supplier/SupplierList'),
|
||||
name: 'SupplierList',
|
||||
meta: { title: 'SupplierList', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'SupplierCategory',
|
||||
component: () => import('@/views/Supplier/SupplierCategory'),
|
||||
name: 'SupplierCategory',
|
||||
meta: { title: 'SupplierCategory', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'ManySupplier',
|
||||
component: () => import('@/views/Supplier/ManySupplier'),
|
||||
name: 'ManySupplier',
|
||||
meta: { title: 'ManySupplier', noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/Product',
|
||||
component: Layout,
|
||||
redirect: 'noredirect',
|
||||
name: 'Product',
|
||||
alwaysShow: true,
|
||||
meta: {
|
||||
title: 'Product',
|
||||
icon: 'wupin',
|
||||
type: 1
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'NewProduct',
|
||||
component: () => import('@/views/Product/NewProduct'),
|
||||
name: 'NewProduct',
|
||||
meta: { title: 'NewProduct', noCache: false }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
597
src/views/Product/NewProduct.vue
Normal file
597
src/views/Product/NewProduct.vue
Normal file
|
@ -0,0 +1,597 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<div class="app-container">
|
||||
<!--基本信息-->
|
||||
<h2 ref="geren" class="form-name">基本信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.supplierName')" prop="supplierName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierName" placeholder="请输入供应商名称" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.typeId')" prop="typeId" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.typeId" placeholder="请选择供应商类别" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in typeIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.supplierShortName')" prop="supplierShortName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierShortName" placeholder="请输入供应商简称" clearable/>
|
||||
</el-form-item><br>
|
||||
<el-form-item :label="$t('Supplier.supplierIntroduction')" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierIntroduction" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--联系信息-->
|
||||
<h2 ref="lianxi" class="form-name">业务信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('public.countyrId')" prop="countryId" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.countryId" placeholder="国家" style="width: 100%;" @change ="handlechange">
|
||||
<el-option
|
||||
v-for="(item, index) in nations"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.provinceId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.provinceId" placeholder="请选择省" style="width: 100%;" @change="handlechange2">
|
||||
<el-option
|
||||
v-for="(item, index) in provinces"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.cityId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.cityId" placeholder="请选择市" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in cities"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.address')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.detailAddress" placeholder="请输入地址" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.groupId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.groupId" placeholder="请选择供应商分组" style="width: 100%;">
|
||||
<el-option label="类型1" value="1"/>
|
||||
<el-option label="类型2" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.zipCode')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.zipCode" placeholder="请输入邮编" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.contactPersonName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.contactPersonName" placeholder="请输入联系人" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.contactPersonPhone')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.contactPersonPhone" placeholder="请输入电话" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.regionId')" prop="regionid" style="width: 40%;margin-top: 1%">
|
||||
<el-cascader
|
||||
:options="regions"
|
||||
:props="props"
|
||||
v-model="perregions"
|
||||
:show-all-levels="false"
|
||||
placeholder="请选择区域"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.giveId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.giveId" placeholder="请选择交货方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in giveIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.transportId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.transportId" placeholder="请选择运送方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in transportIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.levelId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.levelId" placeholder="请选择供应商优质级别" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in levelIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.isHot')" prop="isHot" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.isHot" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="是" value="1"/>
|
||||
<el-option label="否" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.isEffective')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.isEffective" placeholder="请选择启用状态" style="width: 100%;">
|
||||
<el-option label="启用" value="1"/>
|
||||
<el-option label="未启用" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.buyerId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="buyerId" placeholder="请输入采购员" @focus="handlechoose"/>
|
||||
</el-form-item> <br>
|
||||
<my-emp :control.sync="empcontrol" @personName="personName"/>
|
||||
<el-form-item :label="$t('Supplier.businessScopeIntroduction')" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.businessScopeIntroduction" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--财务信息-->
|
||||
<h2 class="form-name">财务信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.paymentId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.paymentId" placeholder="请选择结算方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in paymentIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.moneyId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.moneyId" :value="personalForm.moneyId" placeholder="请选择币种" style="width: 100%;">
|
||||
<el-option label="RMB" value="1"/>
|
||||
<el-option label="USD" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.bankName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.bankName" placeholder="请输入开户行" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.accountName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.accountName" placeholder="请输入户名" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.account')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.account" placeholder="请输入账号" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--辅助信息-->
|
||||
<h2 ref="fuzhu" class="form-name">辅助信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm4" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.establishDate')" style="width: 40%;margin-top:1%">
|
||||
<el-date-picker
|
||||
v-model="personalForm.establishDate"
|
||||
type="date"
|
||||
placeholder="选择成立时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
clearable
|
||||
style="width: 100%"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.legalPerson')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.legalPerson" placeholder="请输入法人代表" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.taxNumber')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.taxNumber" placeholder="请输入税务登记号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.businessLicense')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.businessLicense" placeholder="请输入营业执照号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.companyTypeId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.companyTypeId" placeholder="请选择单位性质" style="width: 100%;">
|
||||
<el-option label="类型1" value="1"/>
|
||||
<el-option label="类型2" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--操作-->
|
||||
<div class="buttons" style="margin-top: 20px">
|
||||
<el-button type="primary" @click="handlesave()">保存</el-button>
|
||||
<el-button type="success" @click="handleentry()">继续录入</el-button>
|
||||
<el-button type="danger" @click="handlecancel()">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getcountrylist, getprovincelist, getcitylist, regionlist } from '@/api/public'
|
||||
import { searchCategory, create } from '@/api/Supplier'
|
||||
import MyEmp from './components/MyEmp'
|
||||
export default {
|
||||
name: 'NewSupplier',
|
||||
components: { MyEmp },
|
||||
data() {
|
||||
return {
|
||||
// 结算方式
|
||||
paymentIds: [],
|
||||
// 优质级别
|
||||
levelIds: [],
|
||||
// 运送方式
|
||||
transportIds: [],
|
||||
// 交货方式
|
||||
giveIds: [],
|
||||
// 供应商类别
|
||||
typeIds: [],
|
||||
// 采购员弹窗控制
|
||||
empcontrol: false,
|
||||
// 国家列表
|
||||
nations: [],
|
||||
// 省列表
|
||||
provinces: [],
|
||||
// 城市列表
|
||||
cities: [],
|
||||
// 区域列表
|
||||
regions: [],
|
||||
// 区域列表字段更改
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 采购员回显
|
||||
buyerId: '',
|
||||
// 转化区域id
|
||||
perregions: [],
|
||||
// 供应商信息数据
|
||||
personalForm: {
|
||||
supplierName: '',
|
||||
typeId: '',
|
||||
supplierShortName: '',
|
||||
supplierIntroduction: '',
|
||||
// 业务信息
|
||||
countryId: '',
|
||||
provinceId: '',
|
||||
cityId: '',
|
||||
detailAddress: '',
|
||||
groupId: '',
|
||||
zipCode: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
regionId: '',
|
||||
giveId: '',
|
||||
transportId: '',
|
||||
levelId: '',
|
||||
isHot: '',
|
||||
isEffective: '',
|
||||
buyerId: '',
|
||||
// 财务信息
|
||||
businessScopeIntroduction: '',
|
||||
paymentId: '',
|
||||
moneyId: '',
|
||||
bankName: '',
|
||||
accountName: '',
|
||||
account: '',
|
||||
establishDate: '',
|
||||
legalPerson: '',
|
||||
taxNumber: '',
|
||||
businessLicense: '',
|
||||
companyTypeId: ''
|
||||
},
|
||||
// 个人信息规则数据
|
||||
personalrules: {
|
||||
supplierName: [
|
||||
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
|
||||
],
|
||||
typeId: [
|
||||
{ required: true, message: '请选择供应商类别', trigger: 'change' }
|
||||
],
|
||||
groupId: [
|
||||
{ required: true, message: '请选择供应商分组', trigger: 'change' }
|
||||
],
|
||||
isHot: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
],
|
||||
countryId: [
|
||||
{ required: true, message: '请选择国家', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getnationlist()
|
||||
},
|
||||
methods: {
|
||||
// 国籍列表
|
||||
getnationlist() {
|
||||
getcountrylist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.nations = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 区域列表数据
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 供应商类别
|
||||
searchCategory(1).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.typeIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.giveIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 运送方式
|
||||
searchCategory(3).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.transportIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 优质级别
|
||||
searchCategory(4).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.levelIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 结算方式
|
||||
searchCategory(5).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.paymentIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据国家选择省
|
||||
handlechange(val) {
|
||||
getprovincelist(val).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.provinces = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据省选择市
|
||||
handlechange2(val) {
|
||||
getcitylist(val).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.cities = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 保存操作
|
||||
handlesave() {
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
create(this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
} else if (res.data.msg === 'account isExist') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '登陆账号已存在',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 清空记录
|
||||
restAllForm() {
|
||||
this.personalForm = {
|
||||
supplierName: '',
|
||||
typeId: '',
|
||||
supplierShortName: '',
|
||||
supplierIntroduction: '',
|
||||
// 业务信息
|
||||
countryId: '',
|
||||
provinceId: '',
|
||||
cityId: '',
|
||||
detailAddress: '',
|
||||
groupId: '',
|
||||
zipCode: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
regionId: '',
|
||||
giveId: '',
|
||||
transportId: '',
|
||||
levelId: '',
|
||||
isHot: '',
|
||||
isEffective: '',
|
||||
buyerId: '',
|
||||
// 财务信息
|
||||
businessScopeIntroduction: '',
|
||||
paymentId: '',
|
||||
moneyId: '',
|
||||
bankName: '',
|
||||
accountName: '',
|
||||
account: '',
|
||||
establishDate: '',
|
||||
legalPerson: '',
|
||||
taxNumber: '',
|
||||
businessLicense: '',
|
||||
companyTypeId: ''
|
||||
}
|
||||
this.perregions = []
|
||||
this.buyerId = ''
|
||||
},
|
||||
// 继续录入
|
||||
handleentry() {
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
create(this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
const anchor = this.$refs.geren.offsetTop
|
||||
console.log(anchor)
|
||||
document.documentElement.scrollTop = anchor - 100
|
||||
} else if (res.data.msg === 'account isExist') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '登陆账号已存在',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
const anchor2 = this.$refs.geren.offsetTop
|
||||
console.log(anchor2)
|
||||
document.documentElement.scrollTop = anchor2 - 100
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消操作
|
||||
handlecancel() {
|
||||
this.$router.go(-1)
|
||||
const view = { path: '/Supplier/NewSupplier', name: 'NewSupplier', fullPath: '/Supplier/NewSupplier', title: 'NewSupplier' }
|
||||
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
|
||||
})
|
||||
},
|
||||
// 员工输入框focus事件触发
|
||||
handlechoose() {
|
||||
this.empcontrol = true
|
||||
},
|
||||
// 员工列表返回数据
|
||||
personName(val) {
|
||||
console.log(val)
|
||||
this.buyerId = val.personName
|
||||
this.personalForm.buyerId = val.id
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.ERP-container{
|
||||
margin:0px 30px;
|
||||
.form-name{
|
||||
font-size: 18px;
|
||||
color: #373e4f;
|
||||
margin-bottom: -20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.container{
|
||||
margin-top: 2%;
|
||||
border: 1px solid #eceff6;
|
||||
}
|
||||
}
|
||||
</style>
|
509
src/views/Product/components/MyDialog.vue
Normal file
509
src/views/Product/components/MyDialog.vue
Normal file
|
@ -0,0 +1,509 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="editVisible" :control="control" :editdata="editdata" :close-on-press-escape="false" top="10px" title="修改供应商" @close="$emit('update:control', false)">
|
||||
<!--基本信息-->
|
||||
<h2 ref="geren" class="form-name">基本信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.supplierName')" prop="supplierName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierName" placeholder="请输入供应商名称" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.typeId')" prop="typeId" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.typeId" placeholder="请选择供应商类别" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in typeIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.supplierShortName')" prop="supplierShortName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierShortName" placeholder="请输入供应商简称" clearable/>
|
||||
</el-form-item><br>
|
||||
<el-form-item :label="$t('Supplier.supplierIntroduction')" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierIntroduction" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--联系信息-->
|
||||
<h2 ref="lianxi" class="form-name">业务信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('public.countyrId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.countryNname" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.countyrId')" prop="countryId" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.countryid" placeholder="国家" style="width: 100%;" @change ="handlechange">
|
||||
<el-option
|
||||
v-for="(item, index) in nations"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.provinceId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.provinceName" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.provinceId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.provinceid" placeholder="请选择省" style="width: 100%;" @change="handlechange2">
|
||||
<el-option
|
||||
v-for="(item, index) in provinces"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.cityId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.cityName" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.cityId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.cityid" placeholder="请选择市" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in cities"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.address')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.detailAddress" placeholder="请输入地址" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.groupId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.groupId" placeholder="请选择供应商分组" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in groupIds"
|
||||
:key="index"
|
||||
:label="item.groupName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.zipCode')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.zipCode" placeholder="请输入邮编" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.contactPersonName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.contactPersonName" placeholder="请输入联系人" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.contactPersonPhone')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.contactPersonPhone" placeholder="请输入电话" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.regionId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.regionName" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.editregionId')" prop="regionid" style="width: 40%;margin-top: 1%">
|
||||
<el-cascader
|
||||
:options="regions"
|
||||
:props="props"
|
||||
v-model="perregions"
|
||||
:show-all-levels="false"
|
||||
placeholder="请选择区域"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.giveId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.giveId" placeholder="请选择交货方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in giveIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.transportId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.transportId" placeholder="请选择运送方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in transportIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.levelId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.levelId" placeholder="请选择供应商优质级别" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in levelIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.isHot')" prop="isHot" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.isHot" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="是" value="1"/>
|
||||
<el-option label="否" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.isEffective')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.isEffective" placeholder="请选择启用状态" style="width: 100%;">
|
||||
<el-option label="启用" value="1"/>
|
||||
<el-option label="未启用" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.buyerId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="buyerId" placeholder="请输入采购员" @focus="handlechoose"/>
|
||||
</el-form-item> <br>
|
||||
<my-emp :control.sync="empcontrol" @personName="personName"/>
|
||||
<el-form-item :label="$t('Supplier.businessScopeIntroduction')" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.businessScopeIntroduction" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--财务信息-->
|
||||
<h2 class="form-name">财务信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.paymentId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.paymentId" placeholder="请选择结算方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in paymentIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.moneyId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.moneyId" :value="personalForm.moneyId" placeholder="请选择币种" style="width: 100%;">
|
||||
<el-option label="RMB" value="1"/>
|
||||
<el-option label="USD" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.bankName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.bankName" placeholder="请输入开户行" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.accountName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.accountName" placeholder="请输入户名" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.account')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.account" placeholder="请输入账号" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--辅助信息-->
|
||||
<h2 ref="fuzhu" class="form-name">辅助信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm4" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.establishDate')" style="width: 40%;margin-top:1%">
|
||||
<el-date-picker
|
||||
v-model="personalForm.establishDate"
|
||||
type="date"
|
||||
placeholder="选择成立时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
clearable
|
||||
style="width: 100%"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.legalPerson')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.legalPerson" placeholder="请输入法人代表" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.taxNumber')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.taxNumber" placeholder="请输入税务登记号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.businessLicense')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.businessLicense" placeholder="请输入营业执照号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.companyTypeId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.companyTypeId" placeholder="请选择单位性质" style="width: 100%;">
|
||||
<el-option label="类型1" value="1"/>
|
||||
<el-option label="类型2" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="buttons" style="margin-top: 20px;margin-left: 30px">
|
||||
<el-button type="primary" @click="handleEditok()">修改</el-button>
|
||||
<el-button type="danger" @click="handlecancel()">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getcountrylist, getprovincelist, getcitylist, regionlist } from '@/api/public'
|
||||
import { searchCategory, update, searchGroup } from '@/api/Supplier'
|
||||
import MyEmp from './MyEmp'
|
||||
export default {
|
||||
components: { MyEmp },
|
||||
props: {
|
||||
control: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
editdata: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 分组数据
|
||||
groupIds: [],
|
||||
// 弹窗组件的控制
|
||||
editVisible: this.control,
|
||||
// 结算方式
|
||||
paymentIds: [],
|
||||
// 优质级别
|
||||
levelIds: [],
|
||||
// 运送方式
|
||||
transportIds: [],
|
||||
// 交货方式
|
||||
giveIds: [],
|
||||
// 供应商类别
|
||||
typeIds: [],
|
||||
// 采购员弹窗控制
|
||||
empcontrol: false,
|
||||
// 国家列表
|
||||
nations: [],
|
||||
// 省列表
|
||||
provinces: [],
|
||||
// 城市列表
|
||||
cities: [],
|
||||
// 区域列表
|
||||
regions: [],
|
||||
// 区域列表字段更改
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 采购员回显
|
||||
buyerId: '',
|
||||
// 转化区域id
|
||||
perregions: [],
|
||||
// 供应商信息数据
|
||||
personalForm: this.editdata,
|
||||
// 个人信息规则数据
|
||||
personalrules: {
|
||||
supplierName: [
|
||||
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
|
||||
],
|
||||
typeId: [
|
||||
{ required: true, message: '请选择供应商类别', trigger: 'change' }
|
||||
],
|
||||
groupId: [
|
||||
{ required: true, message: '请选择供应商分组', trigger: 'change' }
|
||||
],
|
||||
isHot: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
],
|
||||
countryId: [
|
||||
{ required: true, message: '请选择国家', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
control() {
|
||||
this.editVisible = this.control
|
||||
},
|
||||
editdata() {
|
||||
this.personalForm = this.editdata
|
||||
this.buyerId = this.editdata.buyerName
|
||||
console.log(this.editdata)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getnationlist()
|
||||
},
|
||||
methods: {
|
||||
// 国籍列表
|
||||
getnationlist() {
|
||||
getcountrylist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.nations = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 区域列表数据
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 供应商类别
|
||||
searchCategory(1).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.typeIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.giveIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 运送方式
|
||||
searchCategory(3).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.transportIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 优质级别
|
||||
searchCategory(4).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.levelIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 结算方式
|
||||
searchCategory(5).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.paymentIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 分组数据
|
||||
searchGroup().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.groupIds = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据国家选择省
|
||||
handlechange(val) {
|
||||
getprovincelist(val).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.provinces = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据省选择市
|
||||
handlechange2(val) {
|
||||
getcitylist(val).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.cities = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 员工输入框focus事件触发
|
||||
handlechoose() {
|
||||
this.empcontrol = true
|
||||
},
|
||||
// 员工列表返回数据
|
||||
personName(val) {
|
||||
console.log(val)
|
||||
this.buyerId = val.personName
|
||||
this.personalForm.buyerId = val.id
|
||||
},
|
||||
// 修改和取消按钮
|
||||
// 修改按钮
|
||||
handleEditok() {
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
console.log(this.personalForm)
|
||||
update(this.personalForm).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
offset: 100
|
||||
})
|
||||
this.$emit('rest', true)
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
this.editVisible = false
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handlecancel() {
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
this.editVisible = false
|
||||
}
|
||||
// 修改操作结束 -------------------------------------------------
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
319
src/views/Product/components/MyEmp.vue
Normal file
319
src/views/Product/components/MyEmp.vue
Normal file
|
@ -0,0 +1,319 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="employeeVisible" :control="control" :close-on-press-escape="false" top="10px" title="选择员工" append-to-body @close="$emit('update:control', false)">
|
||||
<div class="filter-container">
|
||||
<el-input v-model="getemplist.employeename" :placeholder="$t('NewEmployeeInformation.employeename')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-input v-model="getemplist.jobnumber" :placeholder="$t('NewEmployeeInformation.jobnumber2')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-date-picker
|
||||
v-model="getemplist.time"
|
||||
type="date"
|
||||
class="filter-item"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"/>
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
width="500"
|
||||
trigger="click">
|
||||
<el-cascader
|
||||
:options="regions2"
|
||||
:props="props2"
|
||||
v-model="getemplistregions"
|
||||
:show-all-levels="false"
|
||||
placeholder="请选择区域"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 40%;float: left;margin-left: 20px"
|
||||
@change="handlechange4"
|
||||
/>
|
||||
<el-select v-model="getemplist.repositoryid" placeholder="请选择门店" clearable filterable style="width: 40%;float: right;margin-right: 20px">
|
||||
<el-option
|
||||
v-for="(item, index) in repositories"
|
||||
:key="index"
|
||||
:label="item.repositoryName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.postid" :value="getemplist.postid" :placeholder="$t('NewEmployeeInformation.postid2')" class="filter-item" clearable style="width: 40%;float: left;margin-top: 10px;margin-left: 20px">
|
||||
<el-option label="xxx" value="1"/>
|
||||
<el-option label="xxx" value="2"/>
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.deptid" :placeholder="$t('NewEmployeeInformation.deptid2')" class="filter-item" clearable style="width: 40%;float: right;margin-top: 10px;margin-right: 20px">
|
||||
<el-option
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
:label="item.deptName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
|
||||
<el-button v-waves class="filter-item" type="primary" style="float: right" @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
</div>
|
||||
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
|
||||
</el-popover>
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px;" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
:key="tableKey"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column
|
||||
:label="$t('NewEmployeeInformation.id')"
|
||||
:resizable="false"
|
||||
property="id"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column
|
||||
:label="$t('NewEmployeeInformation.jobNumber')"
|
||||
:resizable="false"
|
||||
property="jobNumber"
|
||||
align="center"
|
||||
width="100"/>
|
||||
<el-table-column
|
||||
:label="$t('NewEmployeeInformation.account')"
|
||||
:resizable="false"
|
||||
property="account"
|
||||
width="150"
|
||||
align="center"/>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.name')" :resizable="false" align="center" width="109">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.firstName }} {{ scope.row.middleName }} {{ scope.row.lastName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.gender')" :resizable="false" prop="gender" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.gender | genderFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.deptName')" :resizable="false" prop="deptName" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.deptName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.regionName')" :resizable="false" prop="regionName" align="center" width="230">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.regionName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.repositoryName')" :resizable="false" prop="repositoryName" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.repositoryName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="gitemplist" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { regionlist, searchRepository } from '@/api/public'
|
||||
import { getemplist, getdeptlist } from '@/api/EmployeeInformation'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
export default {
|
||||
directives: { waves },
|
||||
components: { Pagination },
|
||||
filters: {
|
||||
genderFilter(status) {
|
||||
const statusMap = {
|
||||
1: '男',
|
||||
2: '女'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
props: {
|
||||
control: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 仓库管理员回显数据
|
||||
managerPeople: '',
|
||||
// 小区经理回显数据
|
||||
regionManagerId: '',
|
||||
// / 弹窗选择
|
||||
// 单选表格样式
|
||||
currentRow: null,
|
||||
// 员工表格数据
|
||||
list: [],
|
||||
// 员工表格数据条数
|
||||
total: 0,
|
||||
// 员工表格识别
|
||||
tableKey: 0,
|
||||
// 加载员工表格
|
||||
listLoading: true,
|
||||
// 员工查询列表数据
|
||||
getemplist: {
|
||||
repositoryid: '',
|
||||
regionid: '',
|
||||
postid: '',
|
||||
deptid: '',
|
||||
employeename: '',
|
||||
pagenum: 1,
|
||||
pagesize: 10,
|
||||
stat: 1,
|
||||
time: '',
|
||||
jobnumber: ''
|
||||
},
|
||||
// 部门列表
|
||||
depts: [],
|
||||
// 区域级联数据转化
|
||||
props2: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 区域数据
|
||||
regions2: [],
|
||||
getemplistregions: [],
|
||||
// 门店数据
|
||||
repositories: [],
|
||||
// 员工选择框控制
|
||||
employeeVisible: this.control,
|
||||
// 小区经理选择框控制
|
||||
regionManagerVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
control() {
|
||||
this.employeeVisible = this.control
|
||||
console.log(this.control)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.gitemplist()
|
||||
},
|
||||
methods: {
|
||||
// 仓库管理员选择开始
|
||||
gitemplist() {
|
||||
// 员工列表数据
|
||||
this.listLoading = true
|
||||
console.log(this.getemplist)
|
||||
getemplist(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.listLoading = false
|
||||
}, 0.5 * 100)
|
||||
})
|
||||
// 部门列表数据
|
||||
getdeptlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.depts = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 区域数据
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions2 = this.tranKTree(res.data.data.content)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 查询
|
||||
handleFilter() {
|
||||
this.getemplist.regionid = this.getemplistregions[this.getemplistregions.length - 1]
|
||||
getemplist(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
this.employeeVisible = false
|
||||
this.$router.push('/EmployeeInformation/NewEmployeeInformation')
|
||||
},
|
||||
// 根据区域选择门店
|
||||
handlechange4(val) {
|
||||
console.log(val)
|
||||
const finalid = val[val.length - 1]
|
||||
searchRepository(finalid).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
console.log(res)
|
||||
this.repositories = res.data.data.content.list
|
||||
} else {
|
||||
this.$message.error('出错了')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 清空历史搜索数据
|
||||
restemplist() {
|
||||
this.getemplist = {
|
||||
repositoryid: '',
|
||||
regionid: '',
|
||||
postid: '',
|
||||
deptid: '',
|
||||
employeename: '',
|
||||
pagenum: 1,
|
||||
pagesize: 10,
|
||||
stat: 1,
|
||||
time: '',
|
||||
jobnumber: ''
|
||||
}
|
||||
this.getemplistregions = []
|
||||
},
|
||||
// 选择员工数据时的操作
|
||||
handleCurrentChange(val) {
|
||||
this.$emit('personName', val)
|
||||
this.employeeVisible = false
|
||||
}
|
||||
// 仓库管理员选择结束
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ERP-container {
|
||||
margin: 50px 30px;
|
||||
}
|
||||
.filter-item{
|
||||
width: 140px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.form-name{
|
||||
font-size: 18px;
|
||||
color: #373e4f;
|
||||
margin-bottom: -20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.container{
|
||||
margin-top: 2%;
|
||||
border: 1px solid #eceff6;
|
||||
}
|
||||
</style>
|
99
src/views/Supplier/ManySupplier.vue
Normal file
99
src/views/Supplier/ManySupplier.vue
Normal file
|
@ -0,0 +1,99 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>下载模板 </span>
|
||||
</div>
|
||||
<a href="/static/file/经销商资料表.xlsx"><el-button type="primary">下载模板</el-button></a>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 20px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>上传Excel表格</span>
|
||||
</div>
|
||||
<upload-excel-component :on-success="handleSuccess" :before-upload="beforeUpload"/>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 20px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>表格数据</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="primary" @click="uploads">导入数据</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData" border highlight-current-row style="width: 100%;margin-top:20px;">
|
||||
<el-table-column v-for="item of tableHeader" :prop="item" :label="item" :key="item"/>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UploadExcelComponent from '@/components/UploadExcel/index.vue'
|
||||
import { manyinsert } from '@/api/Supplier'
|
||||
|
||||
export default {
|
||||
name: 'ManySupplier',
|
||||
components: { UploadExcelComponent },
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
tableHeader: [],
|
||||
dizhi: '/static/file/ceshi.xlsx',
|
||||
uploadHead: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeUpload(file) {
|
||||
const isLt1M = file.size / 1024 / 1024 < 1
|
||||
|
||||
if (isLt1M) {
|
||||
return true
|
||||
}
|
||||
|
||||
this.$message({
|
||||
message: 'Please do not upload files larger than 1m in size.',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
},
|
||||
handleSuccess({ results, header }) {
|
||||
this.tableData = results
|
||||
this.tableHeader = ['供应商编号', '供应商名称', '供应商简称', '供应商类别', '所在区域', '采购员', '供应商优质级别', '建档人', '建档日期']
|
||||
this.uploadHead = results.map(function(item) {
|
||||
return {
|
||||
id: item.供应商编号,
|
||||
supplierName: item.供应商名称,
|
||||
supplierShortName: item.供应商简称,
|
||||
typeName: item.供应商类别,
|
||||
regionName: item.所在区域,
|
||||
buyerName: item.采购员,
|
||||
levelName: item.供应商优质级别,
|
||||
createName: item.建档人,
|
||||
createTime: item.建档日期
|
||||
}
|
||||
})
|
||||
console.log(header)
|
||||
},
|
||||
uploads() {
|
||||
manyinsert(JSON.stringify(this.uploadHead)).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.app-container {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
|
@ -1,60 +1,37 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<div class="app-container">
|
||||
<!--个人信息-->
|
||||
<!--基本信息-->
|
||||
<h2 ref="geren" class="form-name">基本信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.supplierName')" prop="supplierName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierName" placeholder="请输入供应商名称" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.typeId')" prop="typeId" style="width: 40%">
|
||||
<el-form-item :label="$t('Supplier.typeId')" prop="typeId" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.typeId" placeholder="请选择供应商类别" style="width: 100%;">
|
||||
<el-option label="类型1" value="1"/>
|
||||
<el-option label="类型2" value="2"/>
|
||||
<el-option
|
||||
v-for="(item, index) in typeIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.supplierShortName')" prop="supplierShortName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierShortName" placeholder="请输入供应商简称" autocomplete="new-password" clearable/>
|
||||
<el-input v-model="personalForm.supplierShortName" placeholder="请输入供应商简称" clearable/>
|
||||
</el-form-item><br>
|
||||
<el-form-item :label="$t('Supplier.supplierIntroduction')" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierIntroduction" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.lastname')" prop="firstname" style="width: 40%">
|
||||
<el-input v-model="personalForm.firstname" placeholder="请输入姓氏" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.middlename')" style="width: 40%">
|
||||
<el-input v-model="personalForm.middlename" placeholder="请输入中间名" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.firstname')" prop="lastname" style="width: 40%;">
|
||||
<el-input v-model="personalForm.lastname" placeholder="请输入名" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.birthday')" style="width: 40%">
|
||||
<el-date-picker
|
||||
v-model="personalForm.birthday"
|
||||
type="date"
|
||||
placeholder="选择生日"
|
||||
value-format="yyyy-MM-dd"
|
||||
clearable
|
||||
style="width: 100%"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.email')" prop="email" style="width: 40%">
|
||||
<el-input v-model="personalForm.email" placeholder="请输入邮箱地址" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.gender')" prop="gender" style="width: 40%">
|
||||
<el-radio-group v-model="personalForm.gender" style="width: 80%">
|
||||
<el-radio :label="1" style="width: 50%">{{ $t('Supplier.male') }}</el-radio>
|
||||
<el-radio :label="2">{{ $t('Supplier.female') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.certificatetype')" style="width: 40%">
|
||||
<el-select v-model="personalForm.certificatetype" placeholder="请选择证件类型" style="width: 100%;">
|
||||
<el-option label="类型1" value="1"/>
|
||||
<el-option label="类型2" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.certificatenumber')" style="width: 40%">
|
||||
<el-input v-model="personalForm.certificatenumber" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.country')" prop="country" style="width: 40%">
|
||||
<el-select v-model="personalForm.country" placeholder="请选择国籍" style="width: 100%;" @change ="handlechange">
|
||||
</el-form>
|
||||
</div>
|
||||
<!--联系信息-->
|
||||
<h2 ref="lianxi" class="form-name">业务信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('public.countyrId')" prop="countryId" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.countryId" placeholder="国家" style="width: 100%;" @change ="handlechange">
|
||||
<el-option
|
||||
v-for="(item, index) in nations"
|
||||
:key="index"
|
||||
|
@ -62,20 +39,8 @@
|
|||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--联系信息-->
|
||||
<h2 ref="lianxi" class="form-name">联系信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="connectForm" :model="connectForm" :rules="connectrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.address')" prop="address" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="connectForm.address" placeholder="请输入地址" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.phone')" prop="phone" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model.number="connectForm.phone" placeholder="请输入手机号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.provinceid')" prop="provinceid" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="connectForm.provinceid" placeholder="请选择省" style="width: 100%;" @change="handlechange2">
|
||||
<el-form-item :label="$t('public.provinceId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.provinceId" placeholder="请选择省" style="width: 100%;" @change="handlechange2">
|
||||
<el-option
|
||||
v-for="(item, index) in provinces"
|
||||
:key="index"
|
||||
|
@ -83,8 +48,8 @@
|
|||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.cityid')" prop="cityid" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="connectForm.cityid" placeholder="请选择市" style="width: 100%;">
|
||||
<el-form-item :label="$t('public.cityId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.cityId" placeholder="请选择市" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in cities"
|
||||
:key="index"
|
||||
|
@ -92,51 +57,148 @@
|
|||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--公司信息-->
|
||||
<h2 class="form-name">公司信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="companyForm" :model="companyForm" :rules="companyrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.jobnumber')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model.number="companyForm.jobnumber" placeholder="请输入工号" clearable/>
|
||||
<el-form-item :label="$t('public.address')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.detailAddress" placeholder="请输入地址" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.postid')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="companyForm.postid" :value="companyForm.postid" placeholder="请选择职称" style="width: 100%;">
|
||||
<el-option label="xxx" value="1"/>
|
||||
<el-option label="xxx" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.deptid')" prop="deptid" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="companyForm.deptid" placeholder="请选择部门" style="width: 100%;">
|
||||
<el-form-item :label="$t('Supplier.groupId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.groupId" placeholder="请选择供应商分组" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in depts"
|
||||
v-for="(item, index) in groupIds"
|
||||
:key="index"
|
||||
:label="item.deptName"
|
||||
:label="item.groupName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.regionid')" prop="regionid" style="width: 40%;margin-top: 1%">
|
||||
<el-form-item :label="$t('Supplier.zipCode')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.zipCode" placeholder="请输入邮编" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.contactPersonName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.contactPersonName" placeholder="请输入联系人" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.contactPersonPhone')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.contactPersonPhone" placeholder="请输入电话" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.regionId')" prop="regionid" style="width: 40%;margin-top: 1%">
|
||||
<el-cascader
|
||||
:options="regions"
|
||||
:props="props"
|
||||
v-model="companyForm.regionid"
|
||||
v-model="perregions"
|
||||
:show-all-levels="false"
|
||||
placeholder="请选择区域"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%;"
|
||||
@change="handlechange4"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.repositoryid')" prop="repositoryid" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="companyForm.repositoryid" placeholder="请选择门店" style="width: 100%;">
|
||||
<el-form-item :label="$t('Supplier.giveId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.giveId" placeholder="请选择交货方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in repositories"
|
||||
v-for="(item, index) in giveIds"
|
||||
:key="index"
|
||||
:label="item.repositoryName"
|
||||
:value="item.id"/>
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.transportId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.transportId" placeholder="请选择运送方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in transportIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.levelId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.levelId" placeholder="请选择供应商优质级别" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in levelIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.isHot')" prop="isHot" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.isHot" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="是" value="1"/>
|
||||
<el-option label="否" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.isEffective')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.isEffective" placeholder="请选择启用状态" style="width: 100%;">
|
||||
<el-option label="启用" value="1"/>
|
||||
<el-option label="未启用" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.buyerId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="buyerId" placeholder="请输入采购员" @focus="handlechoose"/>
|
||||
</el-form-item> <br>
|
||||
<my-emp :control.sync="empcontrol" @personName="personName"/>
|
||||
<el-form-item :label="$t('Supplier.businessScopeIntroduction')" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.businessScopeIntroduction" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--财务信息-->
|
||||
<h2 class="form-name">财务信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.paymentId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.paymentId" placeholder="请选择结算方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in paymentIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.moneyId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.moneyId" :value="personalForm.moneyId" placeholder="请选择币种" style="width: 100%;">
|
||||
<el-option label="RMB" value="1"/>
|
||||
<el-option label="USD" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.bankName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.bankName" placeholder="请输入开户行" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.accountName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.accountName" placeholder="请输入户名" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.account')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.account" placeholder="请输入账号" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--辅助信息-->
|
||||
<h2 ref="fuzhu" class="form-name">辅助信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm4" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.establishDate')" style="width: 40%;margin-top:1%">
|
||||
<el-date-picker
|
||||
v-model="personalForm.establishDate"
|
||||
type="date"
|
||||
placeholder="选择成立时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
clearable
|
||||
style="width: 100%"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.legalPerson')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.legalPerson" placeholder="请输入法人代表" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.taxNumber')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.taxNumber" placeholder="请输入税务登记号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.businessLicense')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.businessLicense" placeholder="请输入营业执照号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.companyTypeId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.companyTypeId" placeholder="请选择单位性质" style="width: 100%;">
|
||||
<el-option label="类型1" value="1"/>
|
||||
<el-option label="类型2" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -152,24 +214,28 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getcountrylist, getprovincelist, getcitylist, regionlist, searchRepository } from '@/api/public'
|
||||
import { getdeptlist, register } from '@/api/EmployeeInformation'
|
||||
import { getcountrylist, getprovincelist, getcitylist, regionlist } from '@/api/public'
|
||||
import { searchCategory, create, searchGroup } from '@/api/Supplier'
|
||||
import MyEmp from './components/MyEmp'
|
||||
export default {
|
||||
name: 'NewSupplier',
|
||||
components: { MyEmp },
|
||||
data() {
|
||||
var checkphone = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('手机号不能为空'))
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!Number.isInteger(value)) {
|
||||
callback(new Error('请输入数字值'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
return {
|
||||
// 供应商分组数据
|
||||
groupIds: [],
|
||||
// 结算方式
|
||||
paymentIds: [],
|
||||
// 优质级别
|
||||
levelIds: [],
|
||||
// 运送方式
|
||||
transportIds: [],
|
||||
// 交货方式
|
||||
giveIds: [],
|
||||
// 供应商类别
|
||||
typeIds: [],
|
||||
// 采购员弹窗控制
|
||||
empcontrol: false,
|
||||
// 国家列表
|
||||
nations: [],
|
||||
// 省列表
|
||||
|
@ -178,18 +244,20 @@ export default {
|
|||
cities: [],
|
||||
// 区域列表
|
||||
regions: [],
|
||||
// 门店列表
|
||||
repositories: [],
|
||||
// 部门列表
|
||||
depts: [],
|
||||
// 区域列表字段更改
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 采购员回显
|
||||
buyerId: '',
|
||||
// 转化区域id
|
||||
perregions: [],
|
||||
// 供应商信息数据
|
||||
personalForm: {
|
||||
// 建档人id
|
||||
createId: this.$store.getters.userId,
|
||||
supplierName: '',
|
||||
typeId: '',
|
||||
supplierShortName: '',
|
||||
|
@ -203,7 +271,7 @@ export default {
|
|||
zipCode: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
regionId: [],
|
||||
regionId: '',
|
||||
giveId: '',
|
||||
transportId: '',
|
||||
levelId: '',
|
||||
|
@ -240,48 +308,6 @@ export default {
|
|||
countryId: [
|
||||
{ required: true, message: '请选择国家', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 联系信息数据
|
||||
connectForm: {
|
||||
address: '',
|
||||
phone: '',
|
||||
provinceid: '',
|
||||
cityid: ''
|
||||
},
|
||||
// 联系信息规则数据
|
||||
connectrules: {
|
||||
address: [
|
||||
{ required: true, message: '请输入地址', trigger: 'blur' }
|
||||
],
|
||||
provinceid: [
|
||||
{ required: true, message: '请选择省', trigger: 'change' }
|
||||
],
|
||||
cityid: [
|
||||
{ required: true, message: '请选择市', trigger: 'change' }
|
||||
],
|
||||
phone: [
|
||||
{ required: true, validator: checkphone, trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 公司信息数据
|
||||
companyForm: {
|
||||
jobnumber: '',
|
||||
postid: '',
|
||||
deptid: '',
|
||||
regionid: [],
|
||||
repositoryid: ''
|
||||
},
|
||||
// 公司信息规则数据
|
||||
companyrules: {
|
||||
deptid: [
|
||||
{ required: true, message: '请选择部门', trigger: 'change' }
|
||||
],
|
||||
regionid: [
|
||||
{ required: true, message: '请选择区域', trigger: 'change' }
|
||||
],
|
||||
repositoryid: [
|
||||
{ required: true, message: '请选择门店', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -314,10 +340,70 @@ export default {
|
|||
})
|
||||
}
|
||||
})
|
||||
// 部门列表数据
|
||||
getdeptlist().then(res => {
|
||||
// 供应商类别
|
||||
searchCategory(1).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.depts = res.data.data.content
|
||||
this.typeIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.giveIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 运送方式
|
||||
searchCategory(3).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.transportIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 优质级别
|
||||
searchCategory(4).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.levelIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 结算方式
|
||||
searchCategory(5).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.paymentIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 分组数据
|
||||
searchGroup().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.groupIds = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
|
@ -365,85 +451,35 @@ export default {
|
|||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 根据区域选择门店
|
||||
handlechange4(val) {
|
||||
const finalid = val[val.length - 1]
|
||||
searchRepository(finalid).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.repositories = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拼接json
|
||||
extend(jsonbject1, jsonbject2) {
|
||||
var resultJsonObject = {}
|
||||
for (const attr in jsonbject1) {
|
||||
resultJsonObject[attr] = jsonbject1[attr]
|
||||
}
|
||||
for (const attr in jsonbject2) {
|
||||
resultJsonObject[attr] = jsonbject2[attr]
|
||||
}
|
||||
return resultJsonObject
|
||||
},
|
||||
// 保存操作
|
||||
handlesave() {
|
||||
const form2 = this.extend(this.companyForm, this.connectForm)
|
||||
const form3 = this.extend(form2, this.personalForm)
|
||||
const quyu = this.companyForm.regionid.length
|
||||
form3.roleid = 3
|
||||
form3.regionid1 = form3.regionid[quyu - 1]
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.connectForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.companyForm.validate((valid) => {
|
||||
if (valid) {
|
||||
register(form3).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.connectForm.resetFields()
|
||||
this.$refs.companyForm.resetFields()
|
||||
} else if (res.data.msg === 'account isExist') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '登陆账号已存在',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
create(this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
} else if (res.data.msg === 'account isExist') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '登陆账号已存在',
|
||||
offset: 100
|
||||
})
|
||||
const anchor2 = this.$refs.lianxi.offsetTop
|
||||
document.documentElement.scrollTop = anchor2 - 100
|
||||
return false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -452,9 +488,6 @@ export default {
|
|||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
const anchor = this.$refs.geren.offsetTop
|
||||
console.log(anchor)
|
||||
document.documentElement.scrollTop = anchor - 100
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
@ -462,83 +495,74 @@ export default {
|
|||
// 清空记录
|
||||
restAllForm() {
|
||||
this.personalForm = {
|
||||
supplierName: '',
|
||||
typeId: '',
|
||||
supplierShortName: '',
|
||||
supplierIntroduction: '',
|
||||
// 业务信息
|
||||
countryId: '',
|
||||
provinceId: '',
|
||||
cityId: '',
|
||||
detailAddress: '',
|
||||
groupId: '',
|
||||
zipCode: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
regionId: '',
|
||||
giveId: '',
|
||||
transportId: '',
|
||||
levelId: '',
|
||||
isHot: '',
|
||||
isEffective: '',
|
||||
buyerId: '',
|
||||
// 财务信息
|
||||
businessScopeIntroduction: '',
|
||||
paymentId: '',
|
||||
moneyId: '',
|
||||
bankName: '',
|
||||
accountName: '',
|
||||
account: '',
|
||||
passwd: '',
|
||||
firstname: '',
|
||||
middlename: '',
|
||||
lastname: '',
|
||||
birthday: '',
|
||||
email: '',
|
||||
gender: '',
|
||||
certificatetype: '',
|
||||
certificatenumber: '',
|
||||
country: ''
|
||||
}
|
||||
this.connectForm = {
|
||||
address: '',
|
||||
phone: '',
|
||||
provinceid: '',
|
||||
cityid: ''
|
||||
}
|
||||
this.companyForm = {
|
||||
jobnumber: '',
|
||||
postid: '',
|
||||
deptid: '',
|
||||
regionid: [],
|
||||
repositoryid: ''
|
||||
establishDate: '',
|
||||
legalPerson: '',
|
||||
taxNumber: '',
|
||||
businessLicense: '',
|
||||
companyTypeId: ''
|
||||
}
|
||||
this.perregions = []
|
||||
this.buyerId = ''
|
||||
},
|
||||
// 继续录入
|
||||
handleentry() {
|
||||
const form2 = this.extend(this.companyForm, this.connectForm)
|
||||
const form3 = this.extend(form2, this.personalForm)
|
||||
const quyu = this.companyForm.regionid.length
|
||||
form3.roleid = 3
|
||||
form3.regionid1 = form3.regionid[quyu - 1]
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.connectForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.companyForm.validate((valid) => {
|
||||
if (valid) {
|
||||
register(form3).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.connectForm.resetFields()
|
||||
this.$refs.companyForm.resetFields()
|
||||
const anchor2 = this.$refs.geren.offsetTop
|
||||
document.documentElement.scrollTop = anchor2 - 100
|
||||
} else if (res.data.msg === 'account isExist') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '登陆账号已存在',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
create(this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
const anchor = this.$refs.geren.offsetTop
|
||||
console.log(anchor)
|
||||
document.documentElement.scrollTop = anchor - 100
|
||||
} else if (res.data.msg === 'account isExist') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '登陆账号已存在',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -547,9 +571,9 @@ export default {
|
|||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
const anchor = this.$refs.geren.offsetTop
|
||||
console.log(anchor)
|
||||
document.documentElement.scrollTop = anchor - 100
|
||||
const anchor2 = this.$refs.geren.offsetTop
|
||||
console.log(anchor2)
|
||||
document.documentElement.scrollTop = anchor2 - 100
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
@ -557,9 +581,19 @@ export default {
|
|||
// 取消操作
|
||||
handlecancel() {
|
||||
this.$router.go(-1)
|
||||
const view = { path: '/EmployeeInformation/Supplier', name: 'Supplier', fullPath: '/EmployeeInformation/Supplier', title: 'Supplier' }
|
||||
const view = { path: '/Supplier/NewSupplier', name: 'NewSupplier', fullPath: '/Supplier/NewSupplier', title: 'NewSupplier' }
|
||||
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
|
||||
})
|
||||
},
|
||||
// 员工输入框focus事件触发
|
||||
handlechoose() {
|
||||
this.empcontrol = true
|
||||
},
|
||||
// 员工列表返回数据
|
||||
personName(val) {
|
||||
console.log(val)
|
||||
this.buyerId = val.personName
|
||||
this.personalForm.buyerId = val.id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
481
src/views/Supplier/SupplierCategory.vue
Normal file
481
src/views/Supplier/SupplierCategory.vue
Normal file
|
@ -0,0 +1,481 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<div class="filter-container">
|
||||
<!-- 搜索条件栏目 -->
|
||||
<el-input v-model="getemplist.categoryname" :placeholder="$t('NewEmployeeInformation.categoryname')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-select v-model="getemplist.type" :value="getemplist.type" :placeholder="$t('NewEmployeeInformation.type')" class="filter-item" clearable>
|
||||
<el-option label="部门类别" value="1"/>
|
||||
<el-option label="职位类别" value="2"/>
|
||||
<el-option label="合同类型" value="3"/>
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.iseffective" :value="getemplist.iseffective" :placeholder="$t('NewEmployeeInformation.iseffective')" class="filter-item" clearable>
|
||||
<el-option label="active " value="1"/>
|
||||
<el-option label="dead" value="2"/>
|
||||
</el-select>
|
||||
<!-- 搜索按钮 -->
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
<!-- 批量操作 -->
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-button v-waves class="filter-item" type="primary">
|
||||
{{ $t('public.batchoperation') }} <i class="el-icon-arrow-down el-icon--right"/>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown" style="width: 140px">
|
||||
<el-dropdown-item style="text-align: left" command="delete"><svg-icon icon-class="shanchu" style="width: 40px"/>{{ $t('public.delete') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<!-- 表格导出操作 -->
|
||||
<el-button v-waves :loading="downloadLoading" class="filter-item" style="width: 86px" @click="handleExport"> <svg-icon icon-class="daochu"/>{{ $t('public.export') }}</el-button>
|
||||
<!-- 打印操作 -->
|
||||
<el-button v-waves class="filter-item" icon="el-icon-printer" style="width: 86px" @click="handlePrint">{{ $t('public.print') }}</el-button>
|
||||
<!-- 新建操作 -->
|
||||
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px;float: right" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
<el-dialog :visible.sync="categoryVisible" title="新建分类属性" center>
|
||||
<el-form ref="addCategoryForm" :rules="addCategoryFormRules" :model="addCategoryForm" class="demo-ruleForm" style="margin: 0 auto; width: 400px">
|
||||
<el-form-item :label="$t('NewEmployeeInformation.category')" label-width="100px" prop="category">
|
||||
<el-input v-model="addCategoryForm.category" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.categoryname')" label-width="100px" prop="categoryname">
|
||||
<el-input v-model="addCategoryForm.categoryname" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.type')" label-width="100px" prop="type">
|
||||
<el-select v-model="addCategoryForm.type" placeholder="请选择类别" style="width: 100%">
|
||||
<el-option label="部门类别" value="1"/>
|
||||
<el-option label="职位类别" value="2"/>
|
||||
<el-option label="合同类型" value="3"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.iseffective')" label-width="100px" prop="iseffective">
|
||||
<el-select v-model="addCategoryForm.iseffective" placeholder="请选择状态" style="width: 100%">
|
||||
<el-option label="active " value="1"/>
|
||||
<el-option label="dead" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handlesave()">保存</el-button>
|
||||
<el-button type="danger" @click="handlecancel()">取消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<div class="app-container">
|
||||
<!-- 列表开始 -->
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:key="tableKey"
|
||||
:data="list"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"/>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.id')" :resizable="false" prop="id" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.id }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.type')" :resizable="false" prop="type" align="center" width="350">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.type | typeFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.categoryname')" :resizable="false" prop="categoryName" align="center" width="350">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.categoryName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.iseffective')" :resizable="false" prop="isEffective" align="center" width="350">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isEffective | iseffectiveFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('public.actions')" :resizable="false" align="center" min-width="230">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="handleEdit(scope.row)" >{{ $t('public.edit') }}</el-button>
|
||||
<el-button size="mini" type="danger" @click="handleDelete(scope.row)">{{ $t('public.delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 列表结束 -->
|
||||
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
|
||||
<el-dialog :visible.sync="editcategoryVisible" title="修改分类属性" center>
|
||||
<el-form ref="editCategoryForm" :rules="editCategoryFormRules" :model="editCategoryForm" class="demo-ruleForm" style="margin: 0 auto; width: 400px">
|
||||
<el-form-item :label="$t('NewEmployeeInformation.type')" label-width="100px">
|
||||
<el-select v-model="editCategoryForm.type" placeholder="请选择类别" style="width: 100%" disabled >
|
||||
<el-option label="部门类别" value="1"/>
|
||||
<el-option label="职位类别" value="2"/>
|
||||
<el-option label="合同类型" value="3"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.categoryname')" label-width="100px" prop="categoryName">
|
||||
<el-input v-model="editCategoryForm.categoryName" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.iseffective')" label-width="100px" prop="isEffective">
|
||||
<el-select v-model="editCategoryForm.isEffective" placeholder="请选择状态" style="width: 100%">
|
||||
<el-option label="active " value="1"/>
|
||||
<el-option label="dead" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleOk()">修改</el-button>
|
||||
<el-button type="danger" @click="handleNo()">取消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchEmpCategory, addEmpCategory, updateEmpCategory, delateEmpCategory } from '@/api/Supplier'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
|
||||
export default {
|
||||
name: 'SupplierCategory',
|
||||
directives: { waves },
|
||||
components: { Pagination },
|
||||
filters: {
|
||||
typeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '供应商类别',
|
||||
2: '交货方式',
|
||||
3: '运送方式',
|
||||
4: '优质级别',
|
||||
5: '结算方式',
|
||||
6: '推荐程度'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
iseffectiveFilter(status) {
|
||||
const statusMap = {
|
||||
1: '启用',
|
||||
2: '停用'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 批量删除参数
|
||||
moreaction: [],
|
||||
// 新增窗口
|
||||
categoryVisible: false,
|
||||
// 新增数据
|
||||
addCategoryForm: {
|
||||
category: '',
|
||||
categoryname: '',
|
||||
type: '',
|
||||
iseffective: ''
|
||||
},
|
||||
// 校验新增数据
|
||||
addCategoryFormRules: {
|
||||
category: [
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
categoryname: [
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
],
|
||||
iseffective: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 修改窗口
|
||||
editcategoryVisible: false,
|
||||
// 修改数据
|
||||
editCategoryForm: {
|
||||
categoryName: '',
|
||||
type: '',
|
||||
isEffective: ''
|
||||
},
|
||||
// 校验修改数据
|
||||
editCategoryFormRules: {
|
||||
categoryName: [
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
isEffective: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 加载操作控制
|
||||
downloadLoading: false,
|
||||
// 表格数据
|
||||
list: [],
|
||||
// 表格数据条数
|
||||
total: 0,
|
||||
// 表格识别
|
||||
tableKey: 0,
|
||||
// 加载表格
|
||||
listLoading: true,
|
||||
// 分类列表查询加展示参数
|
||||
getemplist: {
|
||||
categoryname: '',
|
||||
type: '',
|
||||
iseffective: '',
|
||||
pagenum: 1,
|
||||
pagesize: 10
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
getlist() {
|
||||
// 员工列表数据
|
||||
this.listLoading = true
|
||||
searchEmpCategory(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.listLoading = false
|
||||
}, 0.5 * 100)
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
handleFilter() {
|
||||
searchEmpCategory(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 多选数据
|
||||
handleSelectionChange(val) {
|
||||
this.moreaction = val
|
||||
},
|
||||
// 批量删除
|
||||
handleCommand(command) {
|
||||
const ids = this.moreaction.map(item => item.id).join()
|
||||
if (command === 'delete') {
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delateEmpCategory(ids).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 单条删除
|
||||
handleDelete(row) {
|
||||
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delateEmpCategory(row.id).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 修改数据
|
||||
handleEdit(row) {
|
||||
console.log(row)
|
||||
this.editcategoryVisible = true
|
||||
this.editCategoryForm = Object.assign({}, row)
|
||||
this.editCategoryForm.type = String(row.type)
|
||||
this.editCategoryForm.isEffective = String(row.isEffective)
|
||||
},
|
||||
// 取消修改
|
||||
handleNo() {
|
||||
this.editcategoryVisible = false
|
||||
},
|
||||
// 确认修改
|
||||
handleOk() {
|
||||
this.$refs.editCategoryForm.validate((valid) => {
|
||||
if (valid) {
|
||||
updateEmpCategory(this.editCategoryForm).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
this.$refs.editCategoryForm.clearValidate()
|
||||
this.$refs.editCategoryForm.resetFields()
|
||||
this.editcategoryVisible = false
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
this.categoryVisible = true
|
||||
},
|
||||
// 取消操作
|
||||
handlecancel() {
|
||||
this.categoryVisible = false
|
||||
},
|
||||
restAddCategoryForm() {
|
||||
this.addCategoryForm = {
|
||||
category: '',
|
||||
categoryname: '',
|
||||
type: '',
|
||||
iseffective: ''
|
||||
}
|
||||
},
|
||||
// 保存操作
|
||||
handlesave() {
|
||||
console.log(this.addCategoryForm)
|
||||
this.$refs.addCategoryForm.validate((valid) => {
|
||||
if (valid) {
|
||||
addEmpCategory(this.addCategoryForm).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '新建成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
this.$refs.addCategoryForm.clearValidate()
|
||||
this.$refs.addCategoryForm.resetFields()
|
||||
this.restAddCategoryForm()
|
||||
this.categoryVisible = false
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 生成合同
|
||||
handleContract() {
|
||||
console.log(123)
|
||||
},
|
||||
// 导出
|
||||
handleExport() {
|
||||
this.downloadLoading = true
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['编号', '工号', '员工登陆账号', '姓名', '性别', '生日', '邮箱', '职位', '所属部门', '所属区域', '所属门店', '入职时间', '离职时间', '状态']
|
||||
const filterVal = ['id', 'jobNumber', 'account', 'firstName', 'gender', 'birthday', 'email', 'postName', 'deptName', 'regionName', 'repositoryName', 'createTime', 'dimissionTime', 'stat']
|
||||
const data = this.formatJson(filterVal, this.list)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '员工资料表'
|
||||
})
|
||||
this.downloadLoading = false
|
||||
})
|
||||
},
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
// 打印
|
||||
handlePrint() {
|
||||
console.log(456)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/css" scoped>
|
||||
.app-container >>> .el-table .cell {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
line-height: 24px;
|
||||
word-break: keep-all;
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.ERP-container {
|
||||
margin: 0px 30px;
|
||||
}
|
||||
.filter-container{
|
||||
padding: 20px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
.filter-item{
|
||||
width: 140px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
526
src/views/Supplier/SupplierList.vue
Normal file
526
src/views/Supplier/SupplierList.vue
Normal file
|
@ -0,0 +1,526 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<div class="filter-container">
|
||||
<!-- 搜索条件栏目 -->
|
||||
<el-input v-model="getemplist.id" :placeholder="$t('Supplier.id')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-input v-model="getemplist.supplierName" :placeholder="$t('Supplier.supplierName')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-select v-model="getemplist.typeId" :value="getemplist.typeId" placeholder="请选择供应商" class="filter-item" clearable>
|
||||
<el-option
|
||||
v-for="(item, index) in typeIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<!-- 更多搜索条件下拉栏 -->
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
width="500"
|
||||
trigger="click">
|
||||
<el-cascader
|
||||
:options="regions"
|
||||
:props="props"
|
||||
v-model="getemplistregions"
|
||||
:show-all-levels="false"
|
||||
placeholder="所在区域"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 40%;float: left;margin-left: 20px"
|
||||
@change="handlechange4"
|
||||
/>
|
||||
<el-select v-model="getemplist.levelId" placeholder="请选择优质级别" clearable style="width: 40%;float: right;margin-right: 20px">
|
||||
<el-option
|
||||
v-for="(item, index) in levelIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
|
||||
<el-button v-waves class="filter-item" type="primary" style="float: right" @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
</div>
|
||||
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
|
||||
</el-popover>
|
||||
<!-- 搜索按钮 -->
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
<!-- 批量操作 -->
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-button v-waves class="filter-item" type="primary">
|
||||
{{ $t('public.batchoperation') }} <i class="el-icon-arrow-down el-icon--right"/>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown" style="width: 140px">
|
||||
<el-dropdown-item style="text-align: left" command="delete"><svg-icon icon-class="shanchu" style="width: 40px"/>{{ $t('public.delete') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<!-- 新建分组 -->
|
||||
<el-button v-waves class="filter-item" type="primary" style="width: 100px" @click="handleGroup">{{ $t('Supplier.supplierGroup') }}</el-button>
|
||||
<el-dialog :visible.sync="GroupVisible" title="新建分组" width="35%">
|
||||
<el-input v-model="groupName" :placeholder="$t('Supplier.groupName')" class="filter-item" style="width: 40%;margin-left: -1px;float: left" clearable @keyup.enter.native="handleAddGroup"/>
|
||||
<el-button v-waves class="filter-item" type="success" style="width: 86px;float: left" @click="handleAddGroup">{{ $t('public.add') }}</el-button>
|
||||
<el-table :data="groupData" border>
|
||||
<el-table-column property="id" label="编号" align="center" width="150"/>
|
||||
<el-table-column property="groupName" label="组名称" align="center" min-width="300"/>
|
||||
<el-table-column :label="$t('public.actions')" :resizable="false" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="danger" @click="handleDeleteGroup(scope.row)">{{ $t('public.delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<!-- 表格导出操作 -->
|
||||
<el-button v-waves :loading="downloadLoading" class="filter-item" style="width: 86px" @click="handleExport"> <svg-icon icon-class="daochu"/>{{ $t('public.export') }}</el-button>
|
||||
<!-- 打印操作 -->
|
||||
<el-button v-waves class="filter-item" icon="el-icon-printer" style="width: 86px" @click="handlePrint">{{ $t('public.print') }}</el-button>
|
||||
<!-- 新建操作 -->
|
||||
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px;float: right" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 列表开始 -->
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:key="tableKey"
|
||||
:data="list"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"/>
|
||||
<el-table-column :label="$t('Supplier.id')" :resizable="false" prop="id" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.id }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Supplier.supplierName')" :resizable="false" prop="supplierName" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.supplierName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Supplier.supplierShortName')" :resizable="false" prop="supplierShortName" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.supplierShortName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Supplier.typeId')" :resizable="false" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.typeName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Supplier.regionId')" :resizable="false" prop="regionName" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.regionName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Supplier.buyerId')" :resizable="false" prop="buyerName" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.buyerName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Supplier.levelId')" :resizable="false" prop="levelName" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.levelName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Supplier.createId')" :resizable="false" prop="createId" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Supplier.createTime')" :resizable="false" prop="createTime" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('public.actions')" :resizable="false" align="center" min-width="230">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="handleEdit(scope.row)">{{ $t('public.edit') }}</el-button>
|
||||
<el-button size="mini" type="danger" @click="handleDelete(scope.row)">{{ $t('public.delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 列表结束 -->
|
||||
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
|
||||
<!--修改开始=================================================-->
|
||||
<my-dialog :control.sync="editVisible" :editdata.sync="personalForm" @rest="refreshlist"/>
|
||||
<!--修改结束=================================================-->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchRepository, regionlist } from '@/api/public'
|
||||
import { searchCategory, search, delete2, searchGroup, createGroup, deleteGroup } from '@/api/Supplier'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import MyDialog from './components/MyDialog'
|
||||
|
||||
export default {
|
||||
name: 'SupplierList',
|
||||
directives: { waves },
|
||||
components: { Pagination, MyDialog },
|
||||
filters: {
|
||||
genderFilter(status) {
|
||||
const statusMap = {
|
||||
1: '男',
|
||||
2: '女'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 新增分组参数
|
||||
groupName: '',
|
||||
// 分组表格数据
|
||||
groupData: [],
|
||||
// 新建分组控制器
|
||||
GroupVisible: false,
|
||||
// 批量操作
|
||||
moreaction: '',
|
||||
// 优质级别
|
||||
levelIds: [],
|
||||
// 供应商类别
|
||||
typeIds: [],
|
||||
// 加载操作控制
|
||||
downloadLoading: false,
|
||||
// 表格数据
|
||||
list: [],
|
||||
// 表格数据条数
|
||||
total: 0,
|
||||
// 表格识别
|
||||
tableKey: 0,
|
||||
// 加载表格
|
||||
listLoading: true,
|
||||
// 供应商列表查询加展示参数
|
||||
getemplist: {
|
||||
id: '',
|
||||
supplierName: '',
|
||||
typeId: '',
|
||||
regionId: '',
|
||||
levelId: '',
|
||||
pagenum: 1,
|
||||
pagesize: 10
|
||||
},
|
||||
// 部门列表
|
||||
depts: [],
|
||||
// 区域级联数据转化
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 区域数据
|
||||
regions: [],
|
||||
getemplistregions: [],
|
||||
// 门店数据
|
||||
repositories: [],
|
||||
// 传给组件的数据
|
||||
personalForm: {},
|
||||
// 控制组件数据
|
||||
editVisible: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
getlist() {
|
||||
// 供应商列表数据
|
||||
this.listLoading = true
|
||||
search(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.listLoading = false
|
||||
}, 0.5 * 100)
|
||||
})
|
||||
// 供应商类别
|
||||
searchCategory(1).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.typeIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 优质级别
|
||||
searchCategory(4).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.levelIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 区域数据
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
handleFilter() {
|
||||
this.getemplist.regionId = this.getemplistregions[this.getemplistregions.length - 1]
|
||||
search(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修改操作
|
||||
handleEdit(row) {
|
||||
console.log(row)
|
||||
this.editVisible = true
|
||||
this.personalForm = Object.assign({}, row)
|
||||
this.personalForm.isHot = String(row.isHot)
|
||||
this.personalForm.isEffective = String(row.isEffective)
|
||||
this.personalForm.moneyId = String(row.moneyId)
|
||||
this.personalForm.companyTypeId = String(row.companyTypeId)
|
||||
},
|
||||
// 修改组件修改成功后返回
|
||||
refreshlist(val) {
|
||||
if (val === true) {
|
||||
this.getlist()
|
||||
}
|
||||
},
|
||||
// 批量操作
|
||||
handleSelectionChange(val) {
|
||||
this.moreaction = val
|
||||
},
|
||||
// 多条删除
|
||||
// 批量删除
|
||||
handleCommand(command) {
|
||||
const ids = this.moreaction.map(item => item.id).join()
|
||||
if (command === 'delete') {
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delete2(ids).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 单条删除
|
||||
handleDelete(row) {
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delete2(row.id).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 分组数据列表
|
||||
groupList() {
|
||||
// 分组数据
|
||||
searchGroup().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.groupData = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
this.$router.push('/EmployeeInformation/Supplier')
|
||||
},
|
||||
// 新建分组
|
||||
handleGroup() {
|
||||
this.groupList()
|
||||
this.GroupVisible = true
|
||||
},
|
||||
// 重置input
|
||||
restGroup() {
|
||||
this.groupName = ''
|
||||
},
|
||||
// 新增分组
|
||||
handleAddGroup() {
|
||||
createGroup(this.groupName).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restGroup()
|
||||
this.groupList()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除分组
|
||||
handleDeleteGroup(row) {
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteGroup(row.id).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.groupList()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 导出
|
||||
handleExport() {
|
||||
this.downloadLoading = true
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['供应商编号', '供应商名称', '供应商简称', '供应商类别', '所在区域', '采购员', '供应商优质级别', '建档人', '建档日期']
|
||||
const filterVal = ['id', 'supplierName', 'supplierShortName', 'typeName', 'regionName', 'buyerName', 'levelName', 'createName', 'createTime']
|
||||
const data = this.formatJson(filterVal, this.list)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '经销商资料表'
|
||||
})
|
||||
this.downloadLoading = false
|
||||
})
|
||||
},
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
// 打印
|
||||
handlePrint() {
|
||||
console.log(456)
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 根据区域选择门店
|
||||
handlechange4(val) {
|
||||
const finalid = val[val.length - 1]
|
||||
searchRepository(finalid).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.repositories = res.data.data.content
|
||||
} else {
|
||||
this.$message.error('出错了')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/css" scoped>
|
||||
.app-container >>> .el-table .cell {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
line-height: 24px;
|
||||
word-break: keep-all;
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.ERP-container {
|
||||
margin: 0px 30px;
|
||||
}
|
||||
.filter-container{
|
||||
padding: 20px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
.filter-item{
|
||||
width: 140px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
509
src/views/Supplier/components/MyDialog.vue
Normal file
509
src/views/Supplier/components/MyDialog.vue
Normal file
|
@ -0,0 +1,509 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="editVisible" :control="control" :editdata="editdata" :close-on-press-escape="false" top="10px" title="修改供应商" @close="$emit('update:control', false)">
|
||||
<!--基本信息-->
|
||||
<h2 ref="geren" class="form-name">基本信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.supplierName')" prop="supplierName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierName" placeholder="请输入供应商名称" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.typeId')" prop="typeId" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.typeId" placeholder="请选择供应商类别" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in typeIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.supplierShortName')" prop="supplierShortName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierShortName" placeholder="请输入供应商简称" clearable/>
|
||||
</el-form-item><br>
|
||||
<el-form-item :label="$t('Supplier.supplierIntroduction')" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.supplierIntroduction" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--联系信息-->
|
||||
<h2 ref="lianxi" class="form-name">业务信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('public.countyrId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.countryNname" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.countyrId')" prop="countryId" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.countryid" placeholder="国家" style="width: 100%;" @change ="handlechange">
|
||||
<el-option
|
||||
v-for="(item, index) in nations"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.provinceId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.provinceName" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.provinceId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.provinceid" placeholder="请选择省" style="width: 100%;" @change="handlechange2">
|
||||
<el-option
|
||||
v-for="(item, index) in provinces"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.cityId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.cityName" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.cityId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.cityid" placeholder="请选择市" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in cities"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.address')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.detailAddress" placeholder="请输入地址" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.groupId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.groupId" placeholder="请选择供应商分组" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in groupIds"
|
||||
:key="index"
|
||||
:label="item.groupName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.zipCode')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.zipCode" placeholder="请输入邮编" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.contactPersonName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.contactPersonName" placeholder="请输入联系人" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.contactPersonPhone')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.contactPersonPhone" placeholder="请输入电话" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.regionId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.regionName" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.editregionId')" prop="regionid" style="width: 40%;margin-top: 1%">
|
||||
<el-cascader
|
||||
:options="regions"
|
||||
:props="props"
|
||||
v-model="perregions"
|
||||
:show-all-levels="false"
|
||||
placeholder="请选择区域"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.giveId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.giveId" placeholder="请选择交货方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in giveIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.transportId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.transportId" placeholder="请选择运送方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in transportIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.levelId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.levelId" placeholder="请选择供应商优质级别" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in levelIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.isHot')" prop="isHot" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.isHot" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="是" value="1"/>
|
||||
<el-option label="否" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.isEffective')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.isEffective" placeholder="请选择启用状态" style="width: 100%;">
|
||||
<el-option label="启用" value="1"/>
|
||||
<el-option label="未启用" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.buyerId')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="buyerId" placeholder="请输入采购员" @focus="handlechoose"/>
|
||||
</el-form-item> <br>
|
||||
<my-emp :control.sync="empcontrol" @personName="personName"/>
|
||||
<el-form-item :label="$t('Supplier.businessScopeIntroduction')" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.businessScopeIntroduction" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--财务信息-->
|
||||
<h2 class="form-name">财务信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.paymentId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.paymentId" placeholder="请选择结算方式" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in paymentIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.moneyId')" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.moneyId" :value="personalForm.moneyId" placeholder="请选择币种" style="width: 100%;">
|
||||
<el-option label="RMB" value="1"/>
|
||||
<el-option label="USD" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.bankName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.bankName" placeholder="请输入开户行" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.accountName')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.accountName" placeholder="请输入户名" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.account')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.account" placeholder="请输入账号" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--辅助信息-->
|
||||
<h2 ref="fuzhu" class="form-name">辅助信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm4" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('Supplier.establishDate')" style="width: 40%;margin-top:1%">
|
||||
<el-date-picker
|
||||
v-model="personalForm.establishDate"
|
||||
type="date"
|
||||
placeholder="选择成立时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
clearable
|
||||
style="width: 100%"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.legalPerson')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.legalPerson" placeholder="请输入法人代表" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.taxNumber')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.taxNumber" placeholder="请输入税务登记号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.businessLicense')" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.businessLicense" placeholder="请输入营业执照号" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Supplier.companyTypeId')" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.companyTypeId" placeholder="请选择单位性质" style="width: 100%;">
|
||||
<el-option label="类型1" value="1"/>
|
||||
<el-option label="类型2" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="buttons" style="margin-top: 20px;margin-left: 30px">
|
||||
<el-button type="primary" @click="handleEditok()">修改</el-button>
|
||||
<el-button type="danger" @click="handlecancel()">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getcountrylist, getprovincelist, getcitylist, regionlist } from '@/api/public'
|
||||
import { searchCategory, update, searchGroup } from '@/api/Supplier'
|
||||
import MyEmp from './MyEmp'
|
||||
export default {
|
||||
components: { MyEmp },
|
||||
props: {
|
||||
control: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
editdata: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 分组数据
|
||||
groupIds: [],
|
||||
// 弹窗组件的控制
|
||||
editVisible: this.control,
|
||||
// 结算方式
|
||||
paymentIds: [],
|
||||
// 优质级别
|
||||
levelIds: [],
|
||||
// 运送方式
|
||||
transportIds: [],
|
||||
// 交货方式
|
||||
giveIds: [],
|
||||
// 供应商类别
|
||||
typeIds: [],
|
||||
// 采购员弹窗控制
|
||||
empcontrol: false,
|
||||
// 国家列表
|
||||
nations: [],
|
||||
// 省列表
|
||||
provinces: [],
|
||||
// 城市列表
|
||||
cities: [],
|
||||
// 区域列表
|
||||
regions: [],
|
||||
// 区域列表字段更改
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 采购员回显
|
||||
buyerId: '',
|
||||
// 转化区域id
|
||||
perregions: [],
|
||||
// 供应商信息数据
|
||||
personalForm: this.editdata,
|
||||
// 个人信息规则数据
|
||||
personalrules: {
|
||||
supplierName: [
|
||||
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
|
||||
],
|
||||
typeId: [
|
||||
{ required: true, message: '请选择供应商类别', trigger: 'change' }
|
||||
],
|
||||
groupId: [
|
||||
{ required: true, message: '请选择供应商分组', trigger: 'change' }
|
||||
],
|
||||
isHot: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
],
|
||||
countryId: [
|
||||
{ required: true, message: '请选择国家', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
control() {
|
||||
this.editVisible = this.control
|
||||
},
|
||||
editdata() {
|
||||
this.personalForm = this.editdata
|
||||
this.buyerId = this.editdata.buyerName
|
||||
console.log(this.editdata)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getnationlist()
|
||||
},
|
||||
methods: {
|
||||
// 国籍列表
|
||||
getnationlist() {
|
||||
getcountrylist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.nations = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 区域列表数据
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 供应商类别
|
||||
searchCategory(1).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.typeIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.giveIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 运送方式
|
||||
searchCategory(3).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.transportIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 优质级别
|
||||
searchCategory(4).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.levelIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 结算方式
|
||||
searchCategory(5).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.paymentIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 分组数据
|
||||
searchGroup().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.groupIds = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据国家选择省
|
||||
handlechange(val) {
|
||||
getprovincelist(val).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.provinces = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据省选择市
|
||||
handlechange2(val) {
|
||||
getcitylist(val).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.cities = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 员工输入框focus事件触发
|
||||
handlechoose() {
|
||||
this.empcontrol = true
|
||||
},
|
||||
// 员工列表返回数据
|
||||
personName(val) {
|
||||
console.log(val)
|
||||
this.buyerId = val.personName
|
||||
this.personalForm.buyerId = val.id
|
||||
},
|
||||
// 修改和取消按钮
|
||||
// 修改按钮
|
||||
handleEditok() {
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
console.log(this.personalForm)
|
||||
update(this.personalForm).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
offset: 100
|
||||
})
|
||||
this.$emit('rest', true)
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
this.editVisible = false
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handlecancel() {
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
this.editVisible = false
|
||||
}
|
||||
// 修改操作结束 -------------------------------------------------
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
319
src/views/Supplier/components/MyEmp.vue
Normal file
319
src/views/Supplier/components/MyEmp.vue
Normal file
|
@ -0,0 +1,319 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="employeeVisible" :control="control" :close-on-press-escape="false" top="10px" title="选择员工" append-to-body @close="$emit('update:control', false)">
|
||||
<div class="filter-container">
|
||||
<el-input v-model="getemplist.employeename" :placeholder="$t('NewEmployeeInformation.employeename')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-input v-model="getemplist.jobnumber" :placeholder="$t('NewEmployeeInformation.jobnumber2')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-date-picker
|
||||
v-model="getemplist.time"
|
||||
type="date"
|
||||
class="filter-item"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"/>
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
width="500"
|
||||
trigger="click">
|
||||
<el-cascader
|
||||
:options="regions2"
|
||||
:props="props2"
|
||||
v-model="getemplistregions"
|
||||
:show-all-levels="false"
|
||||
placeholder="请选择区域"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 40%;float: left;margin-left: 20px"
|
||||
@change="handlechange4"
|
||||
/>
|
||||
<el-select v-model="getemplist.repositoryid" placeholder="请选择门店" clearable filterable style="width: 40%;float: right;margin-right: 20px">
|
||||
<el-option
|
||||
v-for="(item, index) in repositories"
|
||||
:key="index"
|
||||
:label="item.repositoryName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.postid" :value="getemplist.postid" :placeholder="$t('NewEmployeeInformation.postid2')" class="filter-item" clearable style="width: 40%;float: left;margin-top: 10px;margin-left: 20px">
|
||||
<el-option label="xxx" value="1"/>
|
||||
<el-option label="xxx" value="2"/>
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.deptid" :placeholder="$t('NewEmployeeInformation.deptid2')" class="filter-item" clearable style="width: 40%;float: right;margin-top: 10px;margin-right: 20px">
|
||||
<el-option
|
||||
v-for="(item, index) in depts"
|
||||
:key="index"
|
||||
:label="item.deptName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
|
||||
<el-button v-waves class="filter-item" type="primary" style="float: right" @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
</div>
|
||||
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
|
||||
</el-popover>
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px;" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
:key="tableKey"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column
|
||||
:label="$t('NewEmployeeInformation.id')"
|
||||
:resizable="false"
|
||||
property="id"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column
|
||||
:label="$t('NewEmployeeInformation.jobNumber')"
|
||||
:resizable="false"
|
||||
property="jobNumber"
|
||||
align="center"
|
||||
width="100"/>
|
||||
<el-table-column
|
||||
:label="$t('NewEmployeeInformation.account')"
|
||||
:resizable="false"
|
||||
property="account"
|
||||
width="150"
|
||||
align="center"/>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.name')" :resizable="false" align="center" width="109">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.firstName }} {{ scope.row.middleName }} {{ scope.row.lastName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.gender')" :resizable="false" prop="gender" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.gender | genderFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.deptName')" :resizable="false" prop="deptName" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.deptName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.regionName')" :resizable="false" prop="regionName" align="center" width="230">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.regionName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.repositoryName')" :resizable="false" prop="repositoryName" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.repositoryName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="gitemplist" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { regionlist, searchRepository } from '@/api/public'
|
||||
import { getemplist, getdeptlist } from '@/api/EmployeeInformation'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
export default {
|
||||
directives: { waves },
|
||||
components: { Pagination },
|
||||
filters: {
|
||||
genderFilter(status) {
|
||||
const statusMap = {
|
||||
1: '男',
|
||||
2: '女'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
props: {
|
||||
control: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 仓库管理员回显数据
|
||||
managerPeople: '',
|
||||
// 小区经理回显数据
|
||||
regionManagerId: '',
|
||||
// / 弹窗选择
|
||||
// 单选表格样式
|
||||
currentRow: null,
|
||||
// 员工表格数据
|
||||
list: [],
|
||||
// 员工表格数据条数
|
||||
total: 0,
|
||||
// 员工表格识别
|
||||
tableKey: 0,
|
||||
// 加载员工表格
|
||||
listLoading: true,
|
||||
// 员工查询列表数据
|
||||
getemplist: {
|
||||
repositoryid: '',
|
||||
regionid: '',
|
||||
postid: '',
|
||||
deptid: '',
|
||||
employeename: '',
|
||||
pagenum: 1,
|
||||
pagesize: 10,
|
||||
stat: 1,
|
||||
time: '',
|
||||
jobnumber: ''
|
||||
},
|
||||
// 部门列表
|
||||
depts: [],
|
||||
// 区域级联数据转化
|
||||
props2: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 区域数据
|
||||
regions2: [],
|
||||
getemplistregions: [],
|
||||
// 门店数据
|
||||
repositories: [],
|
||||
// 员工选择框控制
|
||||
employeeVisible: this.control,
|
||||
// 小区经理选择框控制
|
||||
regionManagerVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
control() {
|
||||
this.employeeVisible = this.control
|
||||
console.log(this.control)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.gitemplist()
|
||||
},
|
||||
methods: {
|
||||
// 仓库管理员选择开始
|
||||
gitemplist() {
|
||||
// 员工列表数据
|
||||
this.listLoading = true
|
||||
console.log(this.getemplist)
|
||||
getemplist(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.listLoading = false
|
||||
}, 0.5 * 100)
|
||||
})
|
||||
// 部门列表数据
|
||||
getdeptlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.depts = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 区域数据
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions2 = this.tranKTree(res.data.data.content)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 查询
|
||||
handleFilter() {
|
||||
this.getemplist.regionid = this.getemplistregions[this.getemplistregions.length - 1]
|
||||
getemplist(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
this.employeeVisible = false
|
||||
this.$router.push('/EmployeeInformation/NewEmployeeInformation')
|
||||
},
|
||||
// 根据区域选择门店
|
||||
handlechange4(val) {
|
||||
console.log(val)
|
||||
const finalid = val[val.length - 1]
|
||||
searchRepository(finalid).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
console.log(res)
|
||||
this.repositories = res.data.data.content.list
|
||||
} else {
|
||||
this.$message.error('出错了')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 清空历史搜索数据
|
||||
restemplist() {
|
||||
this.getemplist = {
|
||||
repositoryid: '',
|
||||
regionid: '',
|
||||
postid: '',
|
||||
deptid: '',
|
||||
employeename: '',
|
||||
pagenum: 1,
|
||||
pagesize: 10,
|
||||
stat: 1,
|
||||
time: '',
|
||||
jobnumber: ''
|
||||
}
|
||||
this.getemplistregions = []
|
||||
},
|
||||
// 选择员工数据时的操作
|
||||
handleCurrentChange(val) {
|
||||
this.$emit('personName', val)
|
||||
this.employeeVisible = false
|
||||
}
|
||||
// 仓库管理员选择结束
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ERP-container {
|
||||
margin: 50px 30px;
|
||||
}
|
||||
.filter-item{
|
||||
width: 140px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.form-name{
|
||||
font-size: 18px;
|
||||
color: #373e4f;
|
||||
margin-bottom: -20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.container{
|
||||
margin-top: 2%;
|
||||
border: 1px solid #eceff6;
|
||||
}
|
||||
</style>
|
BIN
static/file/经销商资料表.xlsx
Normal file
BIN
static/file/经销商资料表.xlsx
Normal file
Binary file not shown.
Loading…
Reference in a new issue